Skip to content

Commit e963791

Browse files
committed
Update jsdocs
1 parent 658c41f commit e963791

File tree

4 files changed

+29
-25
lines changed

4 files changed

+29
-25
lines changed

docs/reference/generated/toggle-group.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"props": {
55
"defaultValue": {
66
"type": "any[]",
7-
"description": "The open state of the ToggleGroup represented by an array of\nthe values of all pressed toggle buttons.\nThis is the uncontrolled counterpart of `value`."
7+
"description": "The open state of the toggle group represented by an array of\nthe values of all pressed toggle buttons.\nThis is the uncontrolled counterpart of `value`."
88
},
99
"value": {
1010
"type": "any[]",
11-
"description": "The open state of the ToggleGroup represented by an array of\nthe values of all pressed toggle buttons\nThis is the controlled counterpart of `defaultValue`."
11+
"description": "The open state of the toggle group represented by an array of\nthe values of all pressed toggle buttons.\nThis is the controlled counterpart of `defaultValue`."
1212
},
1313
"onValueChange": {
1414
"type": "((groupValue: any[], event: Event) => void)",
15-
"description": "Callback fired when the pressed states of the ToggleGroup changes."
15+
"description": "Callback fired when the pressed states of the toggle group changes."
1616
},
1717
"toggleMultiple": {
1818
"type": "boolean",
@@ -22,7 +22,7 @@
2222
"disabled": {
2323
"type": "boolean",
2424
"default": "false",
25-
"description": "Whether the component should ignore user interaction."
25+
"description": "Whether the toggle group should ignore user interaction."
2626
},
2727
"loop": {
2828
"type": "boolean",

docs/reference/generated/toggle.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"props": {
55
"value": {
66
"type": "string",
7-
"description": "A unique string that identifies the component when used\ninside a ToggleGroup."
7+
"description": "A unique string that identifies the toggle when used\ninside a toggle group."
88
},
99
"defaultPressed": {
1010
"type": "boolean",
1111
"default": "false",
12-
"description": "The default pressed state. Use when the component is not controlled."
12+
"description": "Whether the toggle button is currently pressed.\nThis is the uncontrolled counterpart of `pressed`."
1313
},
1414
"pressed": {
1515
"type": "boolean",
16-
"description": "Whether the toggle button is currently active."
16+
"description": "Whether the toggle button is currently pressed.\nThis is the controlled counterpart of `defaultPressed`."
1717
},
1818
"onPressedChange": {
1919
"type": "((pressed: boolean, event: Event) => void)",

packages/react/src/toggle-group/ToggleGroup.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,26 @@ namespace ToggleGroup {
132132

133133
export interface Props extends Omit<BaseUIComponentProps<'div', State>, 'defaultValue'> {
134134
/**
135-
* The open state of the ToggleGroup represented by an array of
136-
* the values of all pressed toggle buttons
135+
* The open state of the toggle group represented by an array of
136+
* the values of all pressed toggle buttons.
137137
* This is the controlled counterpart of `defaultValue`.
138138
*/
139139
value?: readonly any[];
140140
/**
141-
* The open state of the ToggleGroup represented by an array of
141+
* The open state of the toggle group represented by an array of
142142
* the values of all pressed toggle buttons.
143143
* This is the uncontrolled counterpart of `value`.
144144
*/
145145
defaultValue?: readonly any[];
146146
/**
147-
* Callback fired when the pressed states of the ToggleGroup changes.
147+
* Callback fired when the pressed states of the toggle group changes.
148148
*
149149
* @param {any[]} groupValue An array of the `value`s of all the pressed items.
150150
* @param {Event} event The corresponding event that initiated the change.
151151
*/
152152
onValueChange?: (groupValue: any[], event: Event) => void;
153153
/**
154-
* Whether the component should ignore user interaction.
154+
* Whether the toggle group should ignore user interaction.
155155
* @default false
156156
*/
157157
disabled?: boolean;
@@ -190,13 +190,13 @@ ToggleGroup.propTypes /* remove-proptypes */ = {
190190
*/
191191
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
192192
/**
193-
* The open state of the ToggleGroup represented by an array of
193+
* The open state of the toggle group represented by an array of
194194
* the values of all pressed toggle buttons.
195195
* This is the uncontrolled counterpart of `value`.
196196
*/
197197
defaultValue: PropTypes.array,
198198
/**
199-
* Whether the component should ignore user interaction.
199+
* Whether the toggle group should ignore user interaction.
200200
* @default false
201201
*/
202202
disabled: PropTypes.bool,
@@ -207,7 +207,7 @@ ToggleGroup.propTypes /* remove-proptypes */ = {
207207
*/
208208
loop: PropTypes.bool,
209209
/**
210-
* Callback fired when the pressed states of the ToggleGroup changes.
210+
* Callback fired when the pressed states of the toggle group changes.
211211
*
212212
* @param {any[]} groupValue An array of the `value`s of all the pressed items.
213213
* @param {Event} event The corresponding event that initiated the change.
@@ -232,8 +232,8 @@ ToggleGroup.propTypes /* remove-proptypes */ = {
232232
*/
233233
toggleMultiple: PropTypes.bool,
234234
/**
235-
* The open state of the ToggleGroup represented by an array of
236-
* the values of all pressed toggle buttons
235+
* The open state of the toggle group represented by an array of
236+
* the values of all pressed toggle buttons.
237237
* This is the controlled counterpart of `defaultValue`.
238238
*/
239239
value: PropTypes.array,

packages/react/src/toggle/Toggle.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ namespace Toggle {
104104

105105
export interface Props extends Omit<BaseUIComponentProps<'button', State>, 'value'> {
106106
/**
107-
* Whether the toggle button is currently active.
107+
* Whether the toggle button is currently pressed.
108+
* This is the controlled counterpart of `defaultPressed`.
108109
*/
109110
pressed?: boolean;
110111
/**
111-
* The default pressed state. Use when the component is not controlled.
112+
* Whether the toggle button is currently pressed.
113+
* This is the uncontrolled counterpart of `pressed`.
112114
* @default false
113115
*/
114116
defaultPressed?: boolean;
@@ -125,8 +127,8 @@ namespace Toggle {
125127
*/
126128
onPressedChange?: (pressed: boolean, event: Event) => void;
127129
/**
128-
* A unique string that identifies the component when used
129-
* inside a ToggleGroup.
130+
* A unique string that identifies the toggle when used
131+
* inside a toggle group.
130132
*/
131133
value?: string;
132134
}
@@ -147,7 +149,8 @@ Toggle.propTypes /* remove-proptypes */ = {
147149
*/
148150
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
149151
/**
150-
* The default pressed state. Use when the component is not controlled.
152+
* Whether the toggle button is currently pressed.
153+
* This is the uncontrolled counterpart of `pressed`.
151154
* @default false
152155
*/
153156
defaultPressed: PropTypes.bool,
@@ -168,7 +171,8 @@ Toggle.propTypes /* remove-proptypes */ = {
168171
*/
169172
onPressedChange: PropTypes.func,
170173
/**
171-
* Whether the toggle button is currently active.
174+
* Whether the toggle button is currently pressed.
175+
* This is the controlled counterpart of `defaultPressed`.
172176
*/
173177
pressed: PropTypes.bool,
174178
/**
@@ -183,8 +187,8 @@ Toggle.propTypes /* remove-proptypes */ = {
183187
*/
184188
type: PropTypes.oneOf(['button', 'reset', 'submit']),
185189
/**
186-
* A unique string that identifies the component when used
187-
* inside a ToggleGroup.
190+
* A unique string that identifies the toggle when used
191+
* inside a toggle group.
188192
*/
189193
value: PropTypes.string,
190194
} as any;

0 commit comments

Comments
 (0)