-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define style guide and proof read component API reference #4442
Comments
Thanks for putting this together! I have no preference on content structure or verbiage as long as it is consistent, and anything that can be turned into metadata items, is - like in the examples you mention above for read-only, and default values. |
Did we discuss back-ticks? I see single and double quotes mentioned. We use these to highlight code in descriptions. It's nice to see them highlighted in markdown. |
We did have some inclusions with the component names above.
So they would be recognized as calcite-list-item over The back-ticks were recommended for removal since they don't register in the docs. For instance on the list item doc page. |
Makes perfect sense. thanks for clarifying! |
Kitty beat me to it. @macandcheese is there any way you can highlight backticks in the doc? If so then I agree using backticks would be nice |
I'm wondering if the docs could just find/replace all backticks? Maybe use them to apply their own highlighting. |
Looks possible to me. Maybe we could switch backticks with |
If it is possible, should we switch from only |
So far I've only seen one instance of need for the double quotes ( With the rarity (granted it's rare so far), leaning towards all refs using back-ticks ( |
That would be a good identifier for us to place inside a code block on the docs site. |
In the future we could think about allowing markdown and parsing it on the documentation site side |
We could do it pretty easily with this https://github.com/remarkjs/react-markdown |
…nents (#5230) **Related Issue:** #4442 ## Summary Adds consistency to our API documentation within some of the t-named components, including: - tab - tab-nav - tab-title - tabs - tile - tile-select - tile-select-group - time-picker - tip - tip-group - tip-manager <!-- Please make sure the PR title and/or commit message adheres to the https://www.conventionalcommits.org/en/v1.0.0/ specification. Note: If your PR only has one commit and it is NOT semantic, you will need to either a. add another commit and wait for the check to update b. proceed to squash merge, but make sure the commit message is the same as the title. This is because of the way GitHub handles single-commit squash merges (see zeke/semantic-pull-requests#17) If this is component-related, please verify that: - [ ] feature or fix has a corresponding test - [ ] changes have been tested with demo page in Edge --- If this is skipping an unstable test: - include info about the test failure - submit an unstable-test issue by [choosing](https://github.com/Esri/calcite-components/issues/new/choose) the unstable test template and filling it out -->
**Related Issue:** #4442 ## Summary 1. Includes consistency across API references, this PR finalizes the style guide across all components. 2. Also includes the removal of the optional "`?`" JSDoc tags for the components listed below. - A separate PR will be created for the remaining components. ### Components included: - ` date-picker` - `dropdown` - `dropdown-group` - `dropdown-item` - `fab` - `filter` - `flow` - `flow-item` - `icon` - `inline-editable` <!-- Please make sure the PR title and/or commit message adheres to the https://www.conventionalcommits.org/en/v1.0.0/ specification. Note: If your PR only has one commit and it is NOT semantic, you will need to either a. add another commit and wait for the check to update b. proceed to squash merge, but make sure the commit message is the same as the title. This is because of the way GitHub handles single-commit squash merges (see zeke/semantic-pull-requests#17) If this is component-related, please verify that: - [ ] feature or fix has a corresponding test - [ ] changes have been tested with demo page in Edge --- If this is skipping an unstable test: - include info about the test failure - submit an unstable-test issue by [choosing](https://github.com/Esri/calcite-components/issues/new/choose) the unstable test template and filling it out -->
**Related Issue:** #4442 ## Summary 1. Removes JSDoc optional props (`?`) across components 2. Small doc changes to: - `accordion` - `alert` slots - `list` refactor props - `list`, - `list-item`, and - `list-item-group` Once merged, will close out the API style guide issue above.
Installed and assigned for verification. |
@benelan Could you verify this issue related to our API style guide across components? |
Sure! I'm putting another checklist here that I'll use as I go through the component docs
|
Closing in favor of #7071. |
Current Style Guide
So far we have the following conventions for API ref descriptions:
calcite-
), e.g.calcite-button
instead ofbutton
.calcite-button
s instead ofcalcite-button
elements.`
) for the names of slots, events, properties, CSS variables, and component names."
) for the values of properties/attributes and event details.'
) as apostrophes.?
)Common slots
header
- A slot for adding header text.content
- A slot for adding the component's content.Events
Common properties
active
- When true, the component is active.appearance
- Specifies the appearance style of the component.checked
- When true, the component is checked.disabled
- When true, interaction is prevented and the component is displayed with lower opacity.dismissible
- When true, a close button is added to the component.flipPlacements
- Defines the available placements that can be used when a flip occurs.groupSeparator
- When true, number values are displayed with the locale's group separator.heading
- The component header text.headingLevel
- Specifies the number at which section headings should start.height
- Specifies the height of the component.icon
- Specifies an icon to display.iconStart
- Specifies an icon to display at the start of the component.iconEnd
- Specifies an icon to display at the end of the component.iconPosition
- When used with "icon", specifies its position.flipRtl
/iconFlipRtl
- When true, the icon will be flipped when the element direction is right-to-left ("rtl").label
/intlLabel
/textLabel
(repeated below) - Accessible name for the component.intlClose
/dismissLabel
- Accessible name for the component's close button.intlCollapse
- Accessible name for the component's collapse button.intlExpand
-Accessible name for the component's expand button.intlLoading
- Accessible name when the component is loading.intlOptions
-Accessible name for the component's options button.intlClear
- Accessible name for the component's clear button.layout
- Defines the layout of the component.loading
- When true, a busy indicator is displayed.locale
- Specifies the BCP 47 language tag for the desired language and country format.name
- Specifies the name of the component on form submission.open
- When true, displays and positions the component.placement
referenceElement
- ThereferenceElement
used to position the component according to its "placement" value. Setting to anHTMLElement
is preferred so the component does not need to query the DOM. However, a stringid
of the reference element can also be used.required
- When true, the component must have a value in order for the form to submit.scale
- Specifies the size of the component.selected
- When true, the component is selected.text
/textLabel
(repeated above)value
- The component's value.width
- Specifies the width of the component.Original Issue Description
Our property/slot/method descriptions are all over the place right now. We need to decide on some conventions, and then audit and proofread to make sure they are consistent. Some things to consider:
calcite-xyz
vs "value")? e.g.disableCloseOnSelect
uses double andoverlayPositioning
uses singleindeterminate
,download
,value
In addition to the consistency conventions, there is a lot of clean up that needs to happen. For example,
This is not an exhaustive list, but it is a start. If anyone else has something to add please feel free. @geospatialem and I will decide on and document the conventions, and then start updating the jsdoc.
cc @macandcheese and @jcfranco if you have any preferences on the conventions.
Which Component
All components
Progress checklist (all done!)
accordion
(Ben)accordion-item
(Ben)action
(Ben)action-bar
(Ben)action-group
(Ben)action-menu
(Ben)action-pad
(Ben)alert
(Ben)avatar
(Ben)block
(Kitty)block-section
(Kitty)button
(Kitty)card
(Kitty)checkbox
(Kitty)chip
(Kitty)color-picker
(Kitty)combobox
(Kitty)combobox-item
(Kitty)combobox-item-group
(Kitty)date-picker
(Kitty)dropdown
(Kitty)dropdown-group
(Kitty)dropdown-item
(Kitty)fab
(Kitty)filter
(Kitty)flow
(Kitty)flow-item
(Kitty)icon
(Kitty)inline-editable
(Kitty)input
(Kitty)input-date-picker
(Kitty)input-message
(Kitty)input-time-picker
(Kitty)label
(Kitty)link
(Kitty)list
(Kitty)list-item
(Kitty)list-item-group
(Kitty)loader
(Kitty)modal
(Kitty)notice
(Kitty)option
(Kitty)option-group
(Kitty)pagination
(Kitty)panel
(Kitty)pick-list
(Kitty)pick-list-group
(Kitty)pick-list-item
(Kitty)popover
(Kitty)(Kitty) deprecatedpopover-manager
progress
(Kitty)radio-button
(Kitty)radio-button-group
(Kitty)radio-group
(Kitty)radio-group-item
(Kitty)rating
(Kitty)scrim
(Kitty)select
(Kitty)shell
(Kitty)shell-center-row
(Kitty)shell-panel
(Kitty)slider
(Kitty)split-button
(Kitty)stepper
(Kitty)stepper-item
(Kitty)switch
(Kitty)tab
(Kitty)tab-nav
(Kitty)tab-title
(Kitty)tabs
(Kitty)tile
(Kitty)tile-select
(Kitty)tile-select-group
(Kitty)time-picker
(Kitty)tip
(Kitty)tip-group
(Kitty)tip-manager
(Kitty)tooltip
(Kitty)(Kitty) deprecatedtooltip-manager
tree
(Kitty)tree-item
(Kitty)value-list
(Kitty)value-list-item
(Kitty)The text was updated successfully, but these errors were encountered: