Skip to content

Commit fb51835

Browse files
DitwanPdriskullgithub-actions[bot]
authored
docs: improve consistency for component prop descriptions (#8580)
**Related Issue:** #7071 ## Summary Updates doc consistency across various components defined in the above issue for props, events, methods, and css vars, including: - `block-section` - `checkbox` - `chip` - `combobox` - `fab` - `input-number` - `input-time-zone` - `radio-button` - `segmented-control` - `shell-panel` - `switch` - `text-area` - `tile-select` - `tree` --------- Co-authored-by: Matt Driscoll <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent ad25204 commit fb51835

File tree

24 files changed

+112
-64
lines changed

24 files changed

+112
-64
lines changed

packages/calcite-components/src/components.d.ts

Lines changed: 43 additions & 30 deletions
Large diffs are not rendered by default.

packages/calcite-components/src/components/block-section/block-section.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ export class BlockSection implements LocalizedComponent, T9nComponent, LoadableC
6565
@Prop() text: string;
6666

6767
/**
68-
* Specifies how the component's toggle is displayed -
68+
* Specifies how the component's toggle is displayed, where:
6969
*
70-
* `"button"` (selectable header), or
70+
* `"button"` sets the toggle to a selectable header, and
7171
*
72-
* `"switch"` (toggle switch).
72+
* `"switch"` sets the toggle to a switch.
7373
*/
7474
@Prop({ reflect: true }) toggleDisplay: BlockSectionToggleDisplay = "button";
7575

packages/calcite-components/src/components/button/button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Button
9797
@Prop({ reflect: true }) disabled = false;
9898

9999
/**
100-
* The ID of the form that will be associated with the component.
100+
* The `id` of the form that will be associated with the component.
101101
*
102102
* When not set, the component will be associated with its ancestor form element, if any.
103103
*/
@@ -404,7 +404,8 @@ export class Button
404404
private setTooltipText = (): void => {
405405
const { contentEl } = this;
406406
if (contentEl) {
407-
this.tooltipText = contentEl.offsetWidth < contentEl.scrollWidth ? this.el.innerText || null : null;
407+
this.tooltipText =
408+
contentEl.offsetWidth < contentEl.scrollWidth ? this.el.innerText || null : null;
408409
}
409410
};
410411

packages/calcite-components/src/components/checkbox/checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Checkbox
5555
@Prop({ reflect: true }) disabled = false;
5656

5757
/**
58-
* The ID of the form that will be associated with the component.
58+
* The `id` of the form that will be associated with the component.
5959
*
6060
* When not set, the component will be associated with its ancestor form element, if any.
6161
*/

packages/calcite-components/src/components/chip/chip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class Chip
7878
@Prop({ reflect: true }) appearance: Extract<"outline" | "outline-fill" | "solid", Appearance> =
7979
"solid";
8080

81-
/** Specifies the kind of the component (will apply to border and background if applicable). */
81+
/** Specifies the kind of the component, which will apply to border and background if applicable. */
8282
@Prop({ reflect: true }) kind: Extract<"brand" | "inverse" | "neutral", Kind> = "neutral";
8383

8484
/** When `true`, a close button is added to the component. */

packages/calcite-components/src/components/combobox/combobox.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ export class Combobox
122122
@Prop({ reflect: true }) clearDisabled = false;
123123

124124
/**
125-
* When `selectionMode` is `"ancestors"` or `"multiple"`, specifies the display of multiple `calcite-combobox-item` selections
126-
* - `"all"` (displays all selections with individual `calcite-chip`s), `"fit"` (displays individual `calcite-chip`s that scale to the component's size, including a non-closable `calcite-chip`, which provides the number of additional `calcite-combobox-item` selections not visually displayed), or `"single"` (display one `calcite-chip` with the total number of selections).
125+
* When `selectionMode` is `"ancestors"` or `"multiple"`, specifies the display of multiple `calcite-combobox-item` selections, where:
126+
*
127+
* `"all"` displays all selections with individual `calcite-chip`s,
128+
*
129+
* `"fit"` displays individual `calcite-chip`s that scale to the component's size, including a non-closable `calcite-chip`, which provides the number of additional `calcite-combobox-item` selections not visually displayed, and
130+
*
131+
* `"single"` displays one `calcite-chip` with the total number of selections.
127132
*/
128133
@Prop({ reflect: true }) selectionDisplay: SelectionDisplay = "all";
129134

@@ -153,7 +158,7 @@ export class Combobox
153158
}
154159

155160
/**
156-
* The ID of the form that will be associated with the component.
161+
* The `id` of the form that will be associated with the component.
157162
*
158163
* When not set, the component will be associated with its ancestor form element, if any.
159164
*/

packages/calcite-components/src/components/fab/fab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class Fab implements InteractiveComponent, LoadableComponent {
3434
@Prop({ reflect: true }) appearance: Extract<"solid" | "outline-fill", Appearance> = "solid";
3535

3636
/**
37-
* Specifies the kind of the component (will apply to border and background).
37+
* Specifies the kind of the component, which will apply to border and background.
3838
*/
3939
@Prop({ reflect: true }) kind: Extract<"brand" | "danger" | "inverse" | "neutral", Kind> =
4040
"brand";

packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class InputDatePicker
131131
}
132132

133133
/**
134-
* The ID of the form that will be associated with the component.
134+
* The `id` of the form that will be associated with the component.
135135
*
136136
* When not set, the component will be associated with its ancestor form element, if any.
137137
*/
@@ -379,7 +379,7 @@ export class InputDatePicker
379379
//--------------------------------------------------------------------------
380380

381381
/**
382-
* Fires when the component's value changes.
382+
* Fires when the component's `value` changes.
383383
*/
384384
@Event({ cancelable: false }) calciteInputDatePickerChange: EventEmitter<void>;
385385

packages/calcite-components/src/components/input-number/input-number.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class InputNumber
123123
}
124124

125125
/**
126-
* The ID of the form that will be associated with the component.
126+
* The `id` of the form that will be associated with the component.
127127
*
128128
* When not set, the component will be associated with its ancestor form element, if any.
129129
*/

packages/calcite-components/src/components/input-text/input-text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class InputText
103103
}
104104

105105
/**
106-
* The ID of the form that will be associated with the component.
106+
* The `id` of the form that will be associated with the component.
107107
*
108108
* When not set, the component will be associated with its ancestor form element, if any.
109109
*/

packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class InputTimePicker
203203
}
204204

205205
/**
206-
* The ID of the form that will be associated with the component.
206+
* The `id` of the form that will be associated with the component.
207207
*
208208
* When not set, the component will be associated with its ancestor form element, if any.
209209
*/
@@ -392,7 +392,7 @@ export class InputTimePicker
392392
@Event({ cancelable: false }) calciteInputTimePickerBeforeOpen: EventEmitter<void>;
393393

394394
/**
395-
* Fires when the time value is changed as a result of user input.
395+
* Fires when the component's `value` is changes.
396396
*/
397397
@Event({ cancelable: true }) calciteInputTimePickerChange: EventEmitter<void>;
398398

packages/calcite-components/src/components/input-time-zone/input-time-zone.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class InputTimeZone
7878
@Prop({ reflect: true }) disabled = false;
7979

8080
/**
81-
* The ID of the form that will be associated with the component.
81+
* The `id` of the form that will be associated with the component.
8282
*
8383
* When not set, the component will be associated with its ancestor form element, if any.
8484
*/
@@ -151,9 +151,9 @@ export class InputTimeZone
151151
@Prop({ reflect: true }) overlayPositioning: OverlayPositioning = "absolute";
152152

153153
/**
154-
* This date will be used as a reference to Daylight Savings Time when creating time zone item groups.
154+
* This `date` will be used as a reference to Daylight Savings Time when creating time zone item groups.
155155
*
156-
* It can be either a Date instance or a string in ISO format (YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS.SSSZ)
156+
* It can be either a Date instance or a string in ISO format (`"YYYY-MM-DD"`, `"YYYY-MM-DDTHH:MM:SS.SSSZ"`).
157157
*
158158
* @see [Date.prototype.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
159159
*/
@@ -211,14 +211,29 @@ export class InputTimeZone
211211
//
212212
//--------------------------------------------------------------------------
213213

214+
/**
215+
* Fires when the component is requested to be closed and before the closing transition begins.
216+
*/
214217
@Event({ cancelable: false }) calciteInputTimeZoneBeforeClose: EventEmitter<void>;
215218

219+
/**
220+
* Fires when the component is added to the DOM but not rendered, and before the opening transition begins.
221+
*/
216222
@Event({ cancelable: false }) calciteInputTimeZoneBeforeOpen: EventEmitter<void>;
217223

224+
/**
225+
* Fires when the component's `value` changes.
226+
*/
218227
@Event({ cancelable: false }) calciteInputTimeZoneChange: EventEmitter<void>;
219228

229+
/**
230+
* Fires after the component is closed and animation is complete.
231+
*/
220232
@Event({ cancelable: false }) calciteInputTimeZoneClose: EventEmitter<void>;
221233

234+
/**
235+
* Fires after the component is opened and animation is complete.
236+
*/
222237
@Event({ cancelable: false }) calciteInputTimeZoneOpen: EventEmitter<void>;
223238

224239
//--------------------------------------------------------------------------

packages/calcite-components/src/components/input/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class Input
124124
}
125125

126126
/**
127-
* The ID of the form that will be associated with the component.
127+
* The `id` of the form that will be associated with the component.
128128
*
129129
* When not set, the component will be associated with its ancestor form element, if any.
130130
*/

packages/calcite-components/src/components/meter/meter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class Meter implements FormComponent, LoadableComponent, LocalizedCompone
5151
@Prop({ reflect: true }) fillType: "single" | "range" = "range";
5252

5353
/**
54-
* The ID of the form that will be associated with the component.
54+
* The `id` of the form that will be associated with the component.
5555
*
5656
* When not set, the component will be associated with its ancestor form element, if any.
5757
*/

packages/calcite-components/src/components/radio-button/radio-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class RadioButton
8080
@Prop({ mutable: true, reflect: true }) focused = false;
8181

8282
/**
83-
* The ID of the form that will be associated with the component.
83+
* The `id` of the form that will be associated with the component.
8484
*
8585
* When not set, the component will be associated with its ancestor form element, if any.
8686
*/

packages/calcite-components/src/components/rating/rating.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Rating
7171
@Prop({ reflect: true }) disabled = false;
7272

7373
/**
74-
* The ID of the form that will be associated with the component.
74+
* The `id` of the form that will be associated with the component.
7575
*
7676
* When not set, the component will be associated with its ancestor form element, if any.
7777
*/

packages/calcite-components/src/components/segmented-control/segmented-control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class SegmentedControl
6363
@Prop({ reflect: true }) disabled = false;
6464

6565
/**
66-
* The ID of the form that will be associated with the component.
66+
* The `id` of the form that will be associated with the component.
6767
*
6868
* When not set, the component will be associated with its ancestor form element, if any.
6969
*/

packages/calcite-components/src/components/select/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class Select
7575
@Prop({ reflect: true }) disabled = false;
7676

7777
/**
78-
* The ID of the form that will be associated with the component.
78+
* The `id` of the form that will be associated with the component.
7979
*
8080
* When not set, the component will be associated with its ancestor form element, if any.
8181
*/

packages/calcite-components/src/components/shell-panel/shell-panel.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ export class ShellPanel implements ConditionalSlotComponent, LocalizedComponent,
7575
}
7676

7777
/**
78-
* Specifies the display mode - `"dock"` (full height, displays adjacent to center content), `"float"` (not full height, content is separated detached from `calcite-action-bar`, displays on top of center content),
79-
* or `"overlay"` (full height, displays on top of center content).
78+
* Specifies the display mode of the component, where:
79+
*
80+
* `"dock"` displays at full height adjacent to center content,
81+
*
82+
* `"overlay"` displays at full height on top of center content, and
83+
*
84+
* `"float"` does not display at full height with content separately detached from `calcite-action-bar` on top of center content.
8085
*/
8186
@Prop({ reflect: true }) displayMode: DisplayMode = "dock";
8287

packages/calcite-components/src/components/slider/slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class Slider
7979
@Prop({ reflect: true }) disabled = false;
8080

8181
/**
82-
* The ID of the form that will be associated with the component.
82+
* The `id` of the form that will be associated with the component.
8383
*
8484
* When not set, the component will be associated with its ancestor form element, if any.
8585
*/

packages/calcite-components/src/components/switch/switch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class Switch
5151
@Prop({ reflect: true }) disabled = false;
5252

5353
/**
54-
* The ID of the form that will be associated with the component.
54+
* The `id` of the form that will be associated with the component.
5555
*
5656
* When not set, the component will be associated with its ancestor form element, if any.
5757
*/

packages/calcite-components/src/components/text-area/text-area.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class TextArea
100100
@Prop({ reflect: true }) disabled = false;
101101

102102
/**
103-
* The ID of the form that will be associated with the component.
103+
* The `id` of the form that will be associated with the component.
104104
*
105105
* When not set, the component will be associated with its ancestor form element, if any.
106106
*/

packages/calcite-components/src/components/tile-select/tile-select.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ export class TileSelect implements InteractiveComponent, LoadableComponent {
8585
@Prop({ reflect: true }) inputAlignment: Extract<"end" | "start", Alignment> = "start";
8686

8787
/**
88-
* The selection mode of the component.
88+
* Specifies the selection mode of the component, where:
8989
*
90-
* Use `"radio"` for single selection, and `"checkbox"` for multiple selections.
90+
* `"radio"` is for single selection, and
91+
*
92+
* `"checkbox"` is for multiple selections.
9193
*/
9294
@Prop({ reflect: true }) type: TileSelectType = "radio";
9395

packages/calcite-components/src/components/tree/tree.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ export class Tree {
4141
@Prop({ mutable: true, reflect: true }) scale: Scale = "m";
4242

4343
/**
44-
* Specifies the selection mode, where
44+
* Specifies the selection mode of the component, where:
45+
*
4546
* `"ancestors"` displays with a checkbox and allows any number of selections from corresponding parent and child selections,
47+
*
4648
* `"children"` allows any number of selections from one parent from corresponding parent and child selections,
49+
*
4750
* `"multichildren"` allows any number of selections from corresponding parent and child selections,
51+
*
4852
* `"multiple"` allows any number of selections,
53+
*
4954
* `"none"` allows no selections,
55+
*
5056
* `"single"` allows one selection, and
57+
*
5158
* `"single-persist"` allows and requires one selection.
5259
*
5360
* @default "single"

0 commit comments

Comments
 (0)