Skip to content

Commit ca0c6a7

Browse files
committed
docs(vue): update props docs
1 parent e32f3aa commit ca0c6a7

File tree

9 files changed

+45
-67
lines changed

9 files changed

+45
-67
lines changed

packages/vue/src/components/editable/editable.types.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export interface RootProps {
44
/**
55
* The activation mode for the preview element.
66
*
7-
* - "focus" - Enter edit mode when the preview element is focused
8-
* - "dblclick" - Enter edit mode when the preview element is double-clicked
9-
* - "none" - No interaction with the preview element will trigger edit mode.
7+
* - "focus" - Enter edit mode when the preview is focused
8+
* - "dblclick" - Enter edit mode when the preview is double-clicked
9+
* - "click" - Enter edit mode when the preview is clicked
1010
*
1111
* @default "focus"
1212
*/
@@ -107,16 +107,11 @@ export interface RootProps {
107107
translations?: editable.IntlTranslations
108108
}
109109

110-
// TODO: remove when Zag is fixed
111-
export interface EditChangeDetails {
112-
edit: boolean
113-
}
114-
115110
export type RootEmits = {
116111
/**
117-
* The callback that is called when in the edit mode.
112+
* The callback that is called when the edit mode is changed
118113
*/
119-
editChange: [event: EditChangeDetails]
114+
editChange: [details: editable.EditChangeDetails]
120115
/**
121116
* Function called when the focus is moved outside the component
122117
*/

packages/vue/src/components/field/field.types.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export interface ElementIds {
77
}
88

99
export interface RootProps {
10+
/**
11+
* Indicates whether the field is disabled.
12+
*/
13+
disabled?: boolean
1014
/**
1115
* The id of the field.
1216
*/
@@ -15,14 +19,6 @@ export interface RootProps {
1519
* The ids of the field parts.
1620
*/
1721
ids?: ElementIds
18-
/**
19-
* Indicates whether the field is required.
20-
*/
21-
required?: boolean
22-
/**
23-
* Indicates whether the field is disabled.
24-
*/
25-
disabled?: boolean
2622
/**
2723
* Indicates whether the field is invalid.
2824
*/
@@ -31,4 +27,8 @@ export interface RootProps {
3127
* Indicates whether the field is read-only.
3228
*/
3329
readOnly?: boolean
30+
/**
31+
* Indicates whether the field is required.
32+
*/
33+
required?: boolean
3434
}

packages/vue/src/components/fieldset/fieldset.types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export interface RootProps {
2-
/**
3-
* The id of the fieldset.
4-
*/
5-
id?: string
62
/**
73
* Indicates whether the fieldset is disabled.
84
*/
95
disabled?: boolean | 'true' | 'false'
6+
/**
7+
* The id of the fieldset.
8+
*/
9+
id?: string
1010
/**
1111
* Indicates whether the fieldset is invalid.
1212
*/

packages/vue/src/components/file-upload/file-upload.types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export interface RootProps {
4040
itemSizeText(id: string): string
4141
itemPreview(id: string): string
4242
}>
43+
/**
44+
* Whether the file input is invalid
45+
*/
46+
invalid?: boolean
4347
/**
4448
* The current locale. Based on the BCP 47 definition.
4549
* @default "en-US"
@@ -77,11 +81,7 @@ export interface RootProps {
7781
/**
7882
* Function to validate a file
7983
*/
80-
validate?: (file: File) => fileUpload.FileError[]
81-
/**
82-
* Whether the file input is invalid
83-
*/
84-
invalid?: boolean
84+
validate?: (file: File) => fileUpload.FileError[] | null
8585
}
8686

8787
export type RootEmits = {

packages/vue/src/components/steps/steps.types.ts

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type * as steps from '@zag-js/steps'
22

33
export interface RootProps {
44
/**
5-
* The number of steps in the component.
5+
* The total number of steps
66
*/
77
count?: number
88
/**
@@ -14,49 +14,34 @@ export interface RootProps {
1414
*/
1515
id?: string
1616
/**
17-
* The ids of the elements. Useful for composition.
17+
* The custom ids for the stepper elements
1818
*/
19-
ids?: Partial<{
20-
root: string
21-
list: string
22-
progress: string
23-
trigger(index: number): string
24-
separator(index: number): string
25-
item(index: number): string
26-
itemContent(index: number): string
27-
}>
19+
ids?: steps.ElementIds
2820
/**
29-
* Whether the step transitions should be linear and require the user
30-
* to go through each step one by one.
31-
*
32-
* @default false
21+
* If `true`, the stepper requires the user to complete the steps in order
3322
*/
3423
linear?: boolean
3524
/**
36-
* The orientation of the steps.
37-
*
38-
* @default "horizontal"
25+
* The v-model value of the step
3926
*/
40-
orientation?: 'horizontal' | 'vertical'
27+
modelValue?: number
4128
/**
42-
* The v-model value of the component.
29+
* The orientation of the stepper
4330
*/
44-
modelValue?: number
31+
orientation?: 'horizontal' | 'vertical'
4532
}
4633

4734
export type RootEmits = {
4835
/**
49-
* Event triggered when a step is changed, either by clicking on a step,
50-
* clicking on the next/previous triggers, or by calling `setStep`.
36+
* Callback to be called when the value changes
5137
*/
5238
stepChange: [details: steps.StepChangeDetails]
5339
/**
54-
* Event triggered when a step is completed by clicking on the next/previous
55-
* triggers or by calling `setStep`.
40+
* Callback to be called when a step is completed
5641
*/
5742
stepComplete: []
5843
/**
59-
* Event triggered when the model value changes.
44+
* The callback fired when the model value changes.
6045
*/
61-
'update:modelValue': [step: number]
46+
'update:modelValue': [value: number]
6247
}

scripts/src/generate-vue-props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const main = async () => {
122122
Promise.all(
123123
components
124124
.map((component) => parse(component).base)
125-
.filter((x) => !['format', 'toast'].includes(x))
125+
.filter((x) => !['format', 'toast', 'highlight', 'frame'].includes(x))
126126
.map(extractTypes),
127127
)
128128
}

website/src/content/types/vue/editable.types.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
"Root": {
6666
"emits": {
6767
"editChange": {
68-
"type": "[event: EditChangeDetails]",
68+
"type": "[details: EditChangeDetails]",
6969
"isRequired": true,
70-
"description": "The callback that is called when in the edit mode."
70+
"description": "The callback that is called when the edit mode is changed"
7171
},
7272
"focusOutside": {
7373
"type": "[event: FocusOutsideEvent]",
@@ -115,7 +115,7 @@
115115
"type": "ActivationMode",
116116
"defaultValue": "\"focus\"",
117117
"isRequired": false,
118-
"description": "The activation mode for the preview element.\n\n- \"focus\" - Enter edit mode when the preview element is focused\n- \"dblclick\" - Enter edit mode when the preview element is double-clicked\n- \"none\" - No interaction with the preview element will trigger edit mode."
118+
"description": "The activation mode for the preview element.\n\n- \"focus\" - Enter edit mode when the preview is focused\n- \"dblclick\" - Enter edit mode when the preview is double-clicked\n- \"click\" - Enter edit mode when the preview is clicked"
119119
},
120120
"asChild": {
121121
"type": "boolean",

website/src/content/types/vue/file-upload.types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"description": "The localized messages to use."
211211
},
212212
"validate": {
213-
"type": "(file: File) => FileError[]",
213+
"type": "(file: File) => FileError[] | null",
214214
"isRequired": false,
215215
"description": "Function to validate a file"
216216
}

website/src/content/types/vue/steps.types.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"count": {
8484
"type": "number",
8585
"isRequired": false,
86-
"description": "The number of steps in the component."
86+
"description": "The total number of steps"
8787
},
8888
"defaultStep": {
8989
"type": "number",
@@ -96,26 +96,24 @@
9696
"description": "The unique identifier of the machine."
9797
},
9898
"ids": {
99-
"type": "Partial<{\n root: string\n list: string\n progress: string\n trigger(index: number): string\n separator(index: number): string\n item(index: number): string\n itemContent(index: number): string\n}>",
99+
"type": "ElementIds",
100100
"isRequired": false,
101-
"description": "The ids of the elements. Useful for composition."
101+
"description": "The custom ids for the stepper elements"
102102
},
103103
"linear": {
104104
"type": "boolean",
105-
"defaultValue": "false",
106105
"isRequired": false,
107-
"description": "Whether the step transitions should be linear and require the user\nto go through each step one by one."
106+
"description": "If `true`, the stepper requires the user to complete the steps in order"
108107
},
109108
"modelValue": {
110109
"type": "number",
111110
"isRequired": false,
112-
"description": "The v-model value of the component."
111+
"description": "The v-model value of the step"
113112
},
114113
"orientation": {
115114
"type": "'horizontal' | 'vertical'",
116-
"defaultValue": "\"horizontal\"",
117115
"isRequired": false,
118-
"description": "The orientation of the steps."
116+
"description": "The orientation of the stepper"
119117
}
120118
}
121119
},

0 commit comments

Comments
 (0)