@neynar/ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +1 -25
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +240 -46
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert.d.ts +73 -11
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +44 -10
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +117 -33
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +50 -71
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +231 -49
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +189 -71
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +197 -40
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +7 -22
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/carousel.d.ts +369 -99
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +110 -38
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +246 -61
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/combobox.d.ts +207 -159
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts +336 -67
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/container.d.ts +159 -64
- package/dist/components/ui/container.d.ts.map +1 -1
- package/dist/components/ui/context-menu.d.ts +321 -39
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts +113 -86
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +106 -25
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +388 -59
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +521 -74
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/empty-state.d.ts +148 -76
- package/dist/components/ui/empty-state.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts +253 -34
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +143 -44
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +0 -8
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts +288 -46
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +444 -127
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +342 -66
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +0 -8
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +88 -30
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +189 -45
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +178 -62
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +180 -21
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +382 -60
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +52 -39
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +144 -27
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +81 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts +94 -32
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +37 -31
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +280 -46
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/stack.d.ts +289 -148
- package/dist/components/ui/stack.d.ts.map +1 -1
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts +1 -2
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/container.stories.d.ts +2 -3
- package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/empty-state.stories.d.ts +2 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts +1 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/stack.stories.d.ts +1 -1
- package/dist/components/ui/stories/text-field.stories.d.ts +7 -1
- package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +44 -38
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +33 -0
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -22
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/text-field.d.ts +170 -84
- package/dist/components/ui/text-field.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +106 -29
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.d.ts +190 -65
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme.d.ts +107 -23
- package/dist/components/ui/theme.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +143 -67
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +118 -30
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +152 -28
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +452 -134
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/index.js +9388 -8281
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +173 -3
- package/package.json +5 -2
- package/src/components/ui/accordion.tsx +112 -27
- package/src/components/ui/alert-dialog.tsx +401 -46
- package/src/components/ui/alert.tsx +114 -11
- package/src/components/ui/aspect-ratio.tsx +69 -14
- package/src/components/ui/avatar.tsx +179 -33
- package/src/components/ui/badge.tsx +74 -75
- package/src/components/ui/breadcrumb.tsx +335 -50
- package/src/components/ui/button.tsx +198 -90
- package/src/components/ui/calendar.tsx +867 -43
- package/src/components/ui/card.tsx +140 -33
- package/src/components/ui/carousel.tsx +529 -98
- package/src/components/ui/chart.tsx +222 -1
- package/src/components/ui/checkbox.tsx +176 -38
- package/src/components/ui/collapsible.tsx +321 -67
- package/src/components/ui/combobox.tsx +284 -83
- package/src/components/ui/command.tsx +527 -67
- package/src/components/ui/container.tsx +217 -65
- package/src/components/ui/context-menu.tsx +716 -51
- package/src/components/ui/date-picker.tsx +228 -38
- package/src/components/ui/dialog.tsx +270 -33
- package/src/components/ui/drawer.tsx +546 -67
- package/src/components/ui/dropdown-menu.tsx +657 -74
- package/src/components/ui/empty-state.tsx +241 -82
- package/src/components/ui/hover-card.tsx +328 -39
- package/src/components/ui/input.tsx +207 -44
- package/src/components/ui/label.tsx +98 -8
- package/src/components/ui/menubar.tsx +587 -54
- package/src/components/ui/navigation-menu.tsx +557 -128
- package/src/components/ui/pagination.tsx +561 -79
- package/src/components/ui/popover.tsx +119 -8
- package/src/components/ui/progress.tsx +131 -29
- package/src/components/ui/radio-group.tsx +260 -51
- package/src/components/ui/resizable.tsx +289 -63
- package/src/components/ui/scroll-area.tsx +377 -66
- package/src/components/ui/select.tsx +545 -60
- package/src/components/ui/separator.tsx +146 -40
- package/src/components/ui/sheet.tsx +348 -31
- package/src/components/ui/sidebar.tsx +471 -29
- package/src/components/ui/skeleton.tsx +114 -32
- package/src/components/ui/slider.tsx +77 -31
- package/src/components/ui/sonner.tsx +574 -46
- package/src/components/ui/stack.tsx +423 -101
- package/src/components/ui/switch.tsx +78 -39
- package/src/components/ui/table.tsx +170 -4
- package/src/components/ui/tabs.tsx +108 -22
- package/src/components/ui/text-field.tsx +226 -81
- package/src/components/ui/textarea.tsx +180 -29
- package/src/components/ui/theme-toggle.tsx +313 -65
- package/src/components/ui/theme.tsx +117 -23
- package/src/components/ui/toggle-group.tsx +280 -69
- package/src/components/ui/toggle.tsx +124 -35
- package/src/components/ui/tooltip.tsx +239 -29
- package/src/components/ui/typography.tsx +1115 -165
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,EAAE,EACvB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,EAAE,EACvB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,gEAAgE;AAChE,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAE3C,+CAA+C;AAC/C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEjE,2CAA2C;AAC3C,KAAK,e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YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAK9C,QAAA,MAAM,MAAM;;;CAAwC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC5B,GAAG,CACA;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,GACjC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAChE;CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAK9C,QAAA,MAAM,MAAM;;;CAAwC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC5B,GAAG,C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AAc,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,GACvD,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,kDAmHF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,QAAA,MAAM,WAAW,iCAA2B,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,QAAgB,EAChB,OAAO,EACP,aAAwB,EACxB,OAAO,GACR,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAC5B,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG;IACjE;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,kDA0CF;AAsDD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,CAAC"}
|
|
@@ -8,7 +8,11 @@ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
|
8
8
|
* and comprehensive form integration. Features consistent styling with the design
|
|
9
9
|
* system and proper keyboard navigation.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The component automatically renders a hidden input element when used within a form
|
|
12
|
+
* to ensure proper form submission and native validation support. Supports three states:
|
|
13
|
+
* checked (true), unchecked (false), and indeterminate for partial selections.
|
|
14
|
+
*
|
|
15
|
+
* @example Basic usage with Label
|
|
12
16
|
* ```tsx
|
|
13
17
|
* <div className="flex items-center space-x-2">
|
|
14
18
|
* <Checkbox id="terms" />
|
|
@@ -33,55 +37,123 @@ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
|
33
37
|
* @example Indeterminate state for parent-child relationships
|
|
34
38
|
* ```tsx
|
|
35
39
|
* const [parentState, setParentState] = useState("indeterminate");
|
|
40
|
+
* const [childStates, setChildStates] = useState([true, false, true]);
|
|
36
41
|
*
|
|
37
|
-
* <
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* <div className="space-y-2">
|
|
43
|
+
* <div className="flex items-center space-x-2">
|
|
44
|
+
* <Checkbox
|
|
45
|
+
* id="parent"
|
|
46
|
+
* checked={parentState}
|
|
47
|
+
* onCheckedChange={(checked) => {
|
|
48
|
+
* setParentState(checked);
|
|
49
|
+
* if (checked === true) {
|
|
50
|
+
* setChildStates([true, true, true]);
|
|
51
|
+
* } else if (checked === false) {
|
|
52
|
+
* setChildStates([false, false, false]);
|
|
53
|
+
* }
|
|
54
|
+
* }}
|
|
55
|
+
* />
|
|
56
|
+
* <Label htmlFor="parent">Select all options</Label>
|
|
57
|
+
* </div>
|
|
58
|
+
* {childStates.map((childChecked, index) => (
|
|
59
|
+
* <div key={index} className="flex items-center space-x-2 ml-6">
|
|
60
|
+
* <Checkbox
|
|
61
|
+
* id={`child-${index}`}
|
|
62
|
+
* checked={childChecked}
|
|
63
|
+
* onCheckedChange={(checked) => {
|
|
64
|
+
* const newStates = [...childStates];
|
|
65
|
+
* newStates[index] = checked;
|
|
66
|
+
* setChildStates(newStates);
|
|
67
|
+
* // Update parent based on child states
|
|
68
|
+
* const checkedCount = newStates.filter(Boolean).length;
|
|
69
|
+
* if (checkedCount === 0) setParentState(false);
|
|
70
|
+
* else if (checkedCount === newStates.length) setParentState(true);
|
|
71
|
+
* else setParentState("indeterminate");
|
|
72
|
+
* }}
|
|
73
|
+
* />
|
|
74
|
+
* <Label htmlFor={`child-${index}`}>Option {index + 1}</Label>
|
|
75
|
+
* </div>
|
|
76
|
+
* ))}
|
|
77
|
+
* </div>
|
|
44
78
|
* ```
|
|
45
79
|
*
|
|
46
80
|
* @example Form integration with multiple selections
|
|
47
81
|
* ```tsx
|
|
48
82
|
* const [preferences, setPreferences] = useState([]);
|
|
83
|
+
* const options = [
|
|
84
|
+
* { id: "email", label: "Email notifications", value: "email" },
|
|
85
|
+
* { id: "sms", label: "SMS notifications", value: "sms" },
|
|
86
|
+
* { id: "push", label: "Push notifications", value: "push" }
|
|
87
|
+
* ];
|
|
49
88
|
*
|
|
50
|
-
* {
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
89
|
+
* <form onSubmit={(e) => {
|
|
90
|
+
* e.preventDefault();
|
|
91
|
+
* const formData = new FormData(e.currentTarget);
|
|
92
|
+
* console.log(formData.getAll("preferences"));
|
|
93
|
+
* }}>
|
|
94
|
+
* <fieldset className="space-y-3">
|
|
95
|
+
* <legend className="text-sm font-medium">Notification Preferences</legend>
|
|
96
|
+
* {options.map((option) => (
|
|
97
|
+
* <div key={option.id} className="flex items-center space-x-2">
|
|
98
|
+
* <Checkbox
|
|
99
|
+
* id={option.id}
|
|
100
|
+
* name="preferences"
|
|
101
|
+
* value={option.value}
|
|
102
|
+
* checked={preferences.includes(option.id)}
|
|
103
|
+
* onCheckedChange={(checked) => {
|
|
104
|
+
* setPreferences(prev =>
|
|
105
|
+
* checked
|
|
106
|
+
* ? [...prev, option.id]
|
|
107
|
+
* : prev.filter(id => id !== option.id)
|
|
108
|
+
* );
|
|
109
|
+
* }}
|
|
110
|
+
* />
|
|
111
|
+
* <Label htmlFor={option.id}>{option.label}</Label>
|
|
112
|
+
* </div>
|
|
113
|
+
* ))}
|
|
114
|
+
* </fieldset>
|
|
115
|
+
* <button type="submit" className="mt-4">Save Preferences</button>
|
|
116
|
+
* </form>
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @example Disabled states
|
|
120
|
+
* ```tsx
|
|
121
|
+
* <div className="space-y-3">
|
|
122
|
+
* <div className="flex items-center space-x-2">
|
|
123
|
+
* <Checkbox id="disabled-unchecked" disabled />
|
|
124
|
+
* <Label htmlFor="disabled-unchecked" className="text-muted-foreground">
|
|
125
|
+
* Disabled unchecked
|
|
126
|
+
* </Label>
|
|
127
|
+
* </div>
|
|
128
|
+
* <div className="flex items-center space-x-2">
|
|
129
|
+
* <Checkbox id="disabled-checked" disabled defaultChecked />
|
|
130
|
+
* <Label htmlFor="disabled-checked" className="text-muted-foreground">
|
|
131
|
+
* Disabled checked
|
|
132
|
+
* </Label>
|
|
133
|
+
* </div>
|
|
134
|
+
* <div className="flex items-center space-x-2">
|
|
135
|
+
* <Checkbox id="disabled-indeterminate" disabled checked="indeterminate" />
|
|
136
|
+
* <Label htmlFor="disabled-indeterminate" className="text-muted-foreground">
|
|
137
|
+
* Disabled indeterminate
|
|
138
|
+
* </Label>
|
|
66
139
|
* </div>
|
|
67
|
-
*
|
|
140
|
+
* </div>
|
|
68
141
|
* ```
|
|
69
142
|
*
|
|
70
|
-
* @
|
|
71
|
-
*
|
|
143
|
+
* @accessibility
|
|
144
|
+
* - **Keyboard Navigation**: Space key toggles the checkbox state
|
|
145
|
+
* - **Screen Readers**: Properly announces state changes and supports required/invalid states
|
|
146
|
+
* - **Focus Management**: Receives focus and shows focus indicators
|
|
147
|
+
* - **Form Integration**: Automatically includes hidden input for form submission
|
|
148
|
+
* - **ARIA Support**: Uses proper ARIA states for checked/unchecked/indeterminate
|
|
149
|
+
* - **Labeling**: Should always be associated with a Label component using htmlFor and id
|
|
150
|
+
*
|
|
151
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/checkbox} Radix UI Checkbox primitive
|
|
152
|
+
* @see {@link https://ui.shadcn.com/docs/components/checkbox} shadcn/ui design patterns
|
|
72
153
|
* @see {@link Label} for accessible labeling
|
|
73
|
-
* @see {@link Switch} for boolean toggles
|
|
154
|
+
* @see {@link Switch} for boolean toggles with different semantics
|
|
74
155
|
* @see {@link RadioGroup} for single selection scenarios
|
|
75
|
-
*
|
|
76
|
-
* @param className - Additional CSS classes to apply to the checkbox
|
|
77
|
-
* @param checked - Controlled checked state (boolean | "indeterminate")
|
|
78
|
-
* @param defaultChecked - Default checked state for uncontrolled usage
|
|
79
|
-
* @param onCheckedChange - Callback when the checked state changes
|
|
80
|
-
* @param disabled - Whether the checkbox is disabled
|
|
81
|
-
* @param required - Whether the checkbox is required for form validation
|
|
82
|
-
* @param name - Form field name for form submission
|
|
83
|
-
* @param value - Form field value for form submission
|
|
84
|
-
* @param id - Unique identifier, used with Label htmlFor attribute
|
|
156
|
+
* @since 1.0.0
|
|
85
157
|
*/
|
|
86
158
|
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
87
159
|
export { Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAuE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0JG;AACH,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,2CAkBrD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -3,26 +3,33 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
|
3
3
|
/**
|
|
4
4
|
* An interactive component which expands/collapses a panel
|
|
5
5
|
*
|
|
6
|
-
* A flexible container component built on Radix UI primitives that allows users to
|
|
6
|
+
* A flexible container component built on Radix UI Collapsible primitives that allows users to
|
|
7
7
|
* toggle the visibility of content sections. Unlike Accordion, Collapsible provides
|
|
8
|
-
* more flexibility without enforcing specific visual structures
|
|
9
|
-
* expandable details, settings panels,
|
|
8
|
+
* more flexibility without enforcing specific visual structures or mutual exclusivity.
|
|
9
|
+
* Perfect for FAQ sections, expandable details, settings panels, sidebar navigation,
|
|
10
|
+
* and any content that should be conditionally visible.
|
|
11
|
+
*
|
|
12
|
+
* Built on `@radix-ui/react-collapsible` with enhanced TypeScript support and
|
|
13
|
+
* comprehensive prop documentation.
|
|
10
14
|
*
|
|
11
15
|
* @component
|
|
12
16
|
* @example
|
|
13
17
|
* ```tsx
|
|
14
|
-
* // Basic controlled collapsible
|
|
18
|
+
* // Basic controlled collapsible with state management
|
|
15
19
|
* const [isOpen, setIsOpen] = React.useState(false)
|
|
16
20
|
*
|
|
17
21
|
* <Collapsible open={isOpen} onOpenChange={setIsOpen}>
|
|
18
22
|
* <CollapsibleTrigger asChild>
|
|
19
|
-
* <Button variant="outline">
|
|
23
|
+
* <Button variant="outline" className="w-full justify-between">
|
|
20
24
|
* Can I use this in my project?
|
|
21
|
-
* <ChevronDown className=
|
|
25
|
+
* <ChevronDown className={cn(
|
|
26
|
+
* "h-4 w-4 transition-transform duration-200",
|
|
27
|
+
* isOpen && "rotate-180"
|
|
28
|
+
* )} />
|
|
22
29
|
* </Button>
|
|
23
30
|
* </CollapsibleTrigger>
|
|
24
|
-
* <CollapsibleContent>
|
|
25
|
-
* <div className="p-4 border rounded-md bg-muted/50">
|
|
31
|
+
* <CollapsibleContent className="overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
|
|
32
|
+
* <div className="p-4 border rounded-md bg-muted/50 mt-2">
|
|
26
33
|
* Yes. Free to use for personal and commercial projects.
|
|
27
34
|
* No attribution required.
|
|
28
35
|
* </div>
|
|
@@ -32,14 +39,14 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
|
32
39
|
*
|
|
33
40
|
* @example
|
|
34
41
|
* ```tsx
|
|
35
|
-
* // Uncontrolled collapsible with
|
|
36
|
-
* <Collapsible className="w-full space-y-2">
|
|
42
|
+
* // Uncontrolled collapsible with default state
|
|
43
|
+
* <Collapsible defaultOpen={true} className="w-full space-y-2">
|
|
37
44
|
* <div className="flex items-center justify-between">
|
|
38
45
|
* <h4 className="text-sm font-semibold">@radix-ui/primitives</h4>
|
|
39
46
|
* <CollapsibleTrigger asChild>
|
|
40
47
|
* <Button variant="ghost" size="sm">
|
|
41
|
-
* <ChevronDown className="h-4 w-4" />
|
|
42
|
-
* <span className="sr-only">Toggle</span>
|
|
48
|
+
* <ChevronDown className="h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-180" />
|
|
49
|
+
* <span className="sr-only">Toggle package list</span>
|
|
43
50
|
* </Button>
|
|
44
51
|
* </CollapsibleTrigger>
|
|
45
52
|
* </div>
|
|
@@ -47,98 +54,188 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
|
47
54
|
* <div className="rounded-md border px-4 py-2 text-sm shadow-sm">
|
|
48
55
|
* @radix-ui/react-collapsible
|
|
49
56
|
* </div>
|
|
57
|
+
* <div className="rounded-md border px-4 py-2 text-sm shadow-sm">
|
|
58
|
+
* @radix-ui/react-accordion
|
|
59
|
+
* </div>
|
|
50
60
|
* </CollapsibleContent>
|
|
51
61
|
* </Collapsible>
|
|
52
62
|
* ```
|
|
53
63
|
*
|
|
54
64
|
* @example
|
|
55
65
|
* ```tsx
|
|
56
|
-
* // FAQ-style implementation
|
|
57
|
-
* <Collapsible>
|
|
58
|
-
* <CollapsibleTrigger className="flex w-full items-center justify-between py-4 text-sm font-medium transition-all hover:underline">
|
|
66
|
+
* // FAQ-style implementation with custom animations
|
|
67
|
+
* <Collapsible className="group" data-orientation="vertical">
|
|
68
|
+
* <CollapsibleTrigger className="flex w-full items-center justify-between py-4 text-sm font-medium transition-all hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring">
|
|
59
69
|
* How do I get started?
|
|
60
|
-
* <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
70
|
+
* <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180" />
|
|
61
71
|
* </CollapsibleTrigger>
|
|
62
|
-
* <CollapsibleContent className="overflow-hidden text-sm transition-all">
|
|
72
|
+
* <CollapsibleContent className="overflow-hidden text-sm transition-all data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
|
|
63
73
|
* <div className="pb-4 pt-0">
|
|
64
|
-
* Getting started is easy! Simply follow our quick setup guide
|
|
74
|
+
* Getting started is easy! Simply follow our quick setup guide,
|
|
75
|
+
* install the required dependencies, and begin building your application.
|
|
76
|
+
* Check out our documentation for detailed instructions.
|
|
77
|
+
* </div>
|
|
78
|
+
* </CollapsibleContent>
|
|
79
|
+
* </Collapsible>
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* // Disabled collapsible state
|
|
85
|
+
* <Collapsible disabled className="opacity-50 cursor-not-allowed">
|
|
86
|
+
* <CollapsibleTrigger className="flex w-full items-center justify-between py-4 text-sm font-medium">
|
|
87
|
+
* This section is temporarily unavailable
|
|
88
|
+
* <ChevronDown className="h-4 w-4" />
|
|
89
|
+
* </CollapsibleTrigger>
|
|
90
|
+
* <CollapsibleContent>
|
|
91
|
+
* <div className="pb-4 pt-0 text-sm text-muted-foreground">
|
|
92
|
+
* This content is currently disabled and cannot be accessed.
|
|
65
93
|
* </div>
|
|
66
94
|
* </CollapsibleContent>
|
|
67
95
|
* </Collapsible>
|
|
68
96
|
* ```
|
|
69
97
|
*
|
|
70
98
|
* @accessibility
|
|
71
|
-
* -
|
|
72
|
-
* - ARIA expanded state
|
|
73
|
-
* -
|
|
74
|
-
* - Focus
|
|
75
|
-
* -
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
99
|
+
* - **Keyboard Navigation**: Space and Enter keys toggle the collapsed state
|
|
100
|
+
* - **ARIA States**: `aria-expanded` automatically reflects current state (true/false)
|
|
101
|
+
* - **ARIA Controls**: `aria-controls` automatically connects trigger to content panel
|
|
102
|
+
* - **Focus Management**: Proper focus handling and focus-visible indicators
|
|
103
|
+
* - **Screen Reader Support**: Content properly hidden/announced based on state
|
|
104
|
+
* - **Disabled States**: Supports disabled prop with appropriate ARIA attributes
|
|
105
|
+
* - **Role Management**: Trigger has `button` role, content has proper labeling
|
|
106
|
+
* - **State Announcements**: State changes properly announced to assistive technology
|
|
107
|
+
*
|
|
108
|
+
* **Data Attributes for Styling:**
|
|
109
|
+
* - `[data-state="open"|"closed"]` - Reflects current expanded state
|
|
110
|
+
* - `[data-disabled]` - Present when disabled prop is true
|
|
111
|
+
*
|
|
112
|
+
* **CSS Variables for Animation:**
|
|
113
|
+
* - `--radix-collapsible-content-width` - Natural width of content
|
|
114
|
+
* - `--radix-collapsible-content-height` - Natural height of content for smooth animations
|
|
115
|
+
*
|
|
116
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/collapsible} Radix UI Collapsible Documentation
|
|
117
|
+
* @see {@link https://ui.shadcn.com/docs/components/collapsible} shadcn/ui Design Patterns
|
|
118
|
+
* @see {@link CollapsibleTrigger} Interactive button element to toggle visibility
|
|
119
|
+
* @see {@link CollapsibleContent} Content container with automatic height animations
|
|
120
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/} WAI-ARIA Disclosure Pattern
|
|
80
121
|
* @since 1.0.0
|
|
81
122
|
*/
|
|
82
|
-
declare function Collapsible(
|
|
123
|
+
declare function Collapsible(props: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
83
124
|
/**
|
|
84
125
|
* Interactive trigger element that toggles collapsible content visibility
|
|
85
126
|
*
|
|
86
127
|
* The clickable element that controls the expanded/collapsed state of the associated
|
|
87
|
-
* CollapsibleContent.
|
|
88
|
-
*
|
|
128
|
+
* CollapsibleContent. Built on Radix UI CollapsibleTrigger primitive with automatic
|
|
129
|
+
* ARIA management and keyboard support. Supports the asChild prop for composition
|
|
130
|
+
* with custom button components or other interactive elements.
|
|
131
|
+
*
|
|
132
|
+
* **Key Features:**
|
|
133
|
+
* - Automatic `aria-expanded` state management
|
|
134
|
+
* - Built-in keyboard navigation (Space/Enter)
|
|
135
|
+
* - Flexible composition via `asChild` pattern
|
|
136
|
+
* - Seamless integration with any interactive element
|
|
89
137
|
*
|
|
90
138
|
* @component
|
|
91
139
|
* @example
|
|
92
140
|
* ```tsx
|
|
93
|
-
* // Simple text trigger
|
|
94
|
-
* <CollapsibleTrigger>
|
|
141
|
+
* // Simple text trigger with default button styling
|
|
142
|
+
* <CollapsibleTrigger className="font-medium hover:underline">
|
|
95
143
|
* Can I use this in my project?
|
|
96
144
|
* </CollapsibleTrigger>
|
|
97
145
|
* ```
|
|
98
146
|
*
|
|
99
147
|
* @example
|
|
100
148
|
* ```tsx
|
|
101
|
-
* // Composed with Button component
|
|
149
|
+
* // Composed with Button component for consistent styling
|
|
102
150
|
* <CollapsibleTrigger asChild>
|
|
103
151
|
* <Button variant="outline" className="w-full justify-between">
|
|
104
152
|
* Advanced Settings
|
|
105
|
-
* <ChevronDown className="h-4 w-4" />
|
|
153
|
+
* <ChevronDown className="h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-180" />
|
|
106
154
|
* </Button>
|
|
107
155
|
* </CollapsibleTrigger>
|
|
108
156
|
* ```
|
|
109
157
|
*
|
|
110
158
|
* @example
|
|
111
159
|
* ```tsx
|
|
112
|
-
* // Custom styled trigger
|
|
113
|
-
* <CollapsibleTrigger className="flex w-full items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline">
|
|
160
|
+
* // Custom styled trigger with icon animation
|
|
161
|
+
* <CollapsibleTrigger className="flex w-full items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring">
|
|
114
162
|
* How does it work?
|
|
115
|
-
* <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
163
|
+
* <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200 data-[state=open]:rotate-180" />
|
|
164
|
+
* </CollapsibleTrigger>
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```tsx
|
|
169
|
+
* // Trigger composed with icon button
|
|
170
|
+
* <CollapsibleTrigger asChild>
|
|
171
|
+
* <Button variant="ghost" size="sm" className="h-8 w-8 p-0">
|
|
172
|
+
* <MoreHorizontal className="h-4 w-4" />
|
|
173
|
+
* <span className="sr-only">Toggle options</span>
|
|
174
|
+
* </Button>
|
|
175
|
+
* </CollapsibleTrigger>
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```tsx
|
|
180
|
+
* // Trigger with custom element using asChild
|
|
181
|
+
* <CollapsibleTrigger asChild>
|
|
182
|
+
* <div
|
|
183
|
+
* role="button"
|
|
184
|
+
* tabIndex={0}
|
|
185
|
+
* className="flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-accent"
|
|
186
|
+
* >
|
|
187
|
+
* <FolderIcon className="h-4 w-4" />
|
|
188
|
+
* <span>Project Files</span>
|
|
189
|
+
* <ChevronRight className="h-3 w-3 transition-transform data-[state=open]:rotate-90" />
|
|
190
|
+
* </div>
|
|
116
191
|
* </CollapsibleTrigger>
|
|
117
192
|
* ```
|
|
118
193
|
*
|
|
119
194
|
* @accessibility
|
|
120
|
-
* - Keyboard
|
|
121
|
-
* - aria-expanded attribute reflects current
|
|
122
|
-
* - aria-controls connects trigger to its content panel
|
|
123
|
-
* - Role
|
|
124
|
-
* - Focus
|
|
195
|
+
* - **Keyboard Navigation**: Space and Enter keys activate the trigger
|
|
196
|
+
* - **ARIA Expanded**: `aria-expanded` attribute automatically reflects current state (true/false)
|
|
197
|
+
* - **ARIA Controls**: `aria-controls` automatically connects trigger to its content panel ID
|
|
198
|
+
* - **Role Management**: Has `button` role for screen reader compatibility
|
|
199
|
+
* - **Focus Management**: Proper focus handling with focus-visible indicators
|
|
200
|
+
* - **Disabled State**: When parent Collapsible is disabled, trigger becomes non-interactive
|
|
201
|
+
* - **Screen Reader Announcements**: State changes properly announced to assistive technology
|
|
202
|
+
*
|
|
203
|
+
* **Data Attributes:**
|
|
204
|
+
* - `[data-state="open"|"closed"]` - Reflects current expanded state for styling
|
|
205
|
+
* - `[data-disabled]` - Present when the trigger is disabled
|
|
206
|
+
*
|
|
207
|
+
* @param asChild - When true, merges props onto immediate child instead of rendering button
|
|
208
|
+
* @param className - Additional CSS classes for styling
|
|
209
|
+
* @param onClick - Custom click handler (called after internal toggle logic)
|
|
210
|
+
* @param onKeyDown - Custom keyboard handler (Space/Enter keys handled internally)
|
|
125
211
|
*
|
|
212
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/collapsible#trigger} Radix UI CollapsibleTrigger API
|
|
213
|
+
* @see {@link Collapsible} Parent container component
|
|
214
|
+
* @see {@link CollapsibleContent} Content container that this trigger controls
|
|
126
215
|
* @since 1.0.0
|
|
127
216
|
*/
|
|
128
|
-
declare function CollapsibleTrigger(
|
|
217
|
+
declare function CollapsibleTrigger(props: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
129
218
|
/**
|
|
130
219
|
* Content container that can be expanded or collapsed
|
|
131
220
|
*
|
|
132
221
|
* The panel containing content that is shown or hidden based on the collapsible state.
|
|
133
|
-
*
|
|
134
|
-
* when toggling between expanded
|
|
222
|
+
* Built on Radix UI CollapsibleContent primitive with automatic height animations,
|
|
223
|
+
* accessibility attributes, and smooth transitions when toggling between expanded
|
|
224
|
+
* and collapsed states.
|
|
225
|
+
*
|
|
226
|
+
* **Key Features:**
|
|
227
|
+
* - Automatic height animations using CSS variables
|
|
228
|
+
* - Proper accessibility tree management (hidden when collapsed)
|
|
229
|
+
* - CSS data attributes for custom styling and animations
|
|
230
|
+
* - Support for forceMount to keep content in DOM when collapsed
|
|
231
|
+
* - Seamless composition via asChild pattern
|
|
135
232
|
*
|
|
136
233
|
* @component
|
|
137
234
|
* @example
|
|
138
235
|
* ```tsx
|
|
139
|
-
* // Basic content panel
|
|
140
|
-
* <CollapsibleContent>
|
|
141
|
-
* <div className="rounded-md border px-4 py-2 text-sm">
|
|
236
|
+
* // Basic content panel with simple styling
|
|
237
|
+
* <CollapsibleContent className="pt-2">
|
|
238
|
+
* <div className="rounded-md border px-4 py-2 text-sm bg-muted/50">
|
|
142
239
|
* Yes. Free to use for personal and commercial projects.
|
|
143
240
|
* No attribution required.
|
|
144
241
|
* </div>
|
|
@@ -147,12 +244,15 @@ declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof Co
|
|
|
147
244
|
*
|
|
148
245
|
* @example
|
|
149
246
|
* ```tsx
|
|
150
|
-
* // Content with
|
|
151
|
-
* <CollapsibleContent className="space-y-2">
|
|
152
|
-
* <div className="rounded-md border px-4 py-3 font-mono text-sm">
|
|
247
|
+
* // Content with multiple elements and spacing
|
|
248
|
+
* <CollapsibleContent className="space-y-2 pt-2">
|
|
249
|
+
* <div className="rounded-md border px-4 py-3 font-mono text-sm shadow-sm">
|
|
153
250
|
* @radix-ui/react-collapsible
|
|
154
251
|
* </div>
|
|
155
|
-
* <div className="rounded-md border px-4 py-3 font-mono text-sm">
|
|
252
|
+
* <div className="rounded-md border px-4 py-3 font-mono text-sm shadow-sm">
|
|
253
|
+
* @radix-ui/react-accordion
|
|
254
|
+
* </div>
|
|
255
|
+
* <div className="rounded-md border px-4 py-3 font-mono text-sm shadow-sm">
|
|
156
256
|
* @radix-ui/react-dialog
|
|
157
257
|
* </div>
|
|
158
258
|
* </CollapsibleContent>
|
|
@@ -160,23 +260,108 @@ declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof Co
|
|
|
160
260
|
*
|
|
161
261
|
* @example
|
|
162
262
|
* ```tsx
|
|
163
|
-
* // Content with
|
|
263
|
+
* // Content with custom animations using CSS variables
|
|
164
264
|
* <CollapsibleContent className="overflow-hidden text-sm transition-all data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
|
|
165
|
-
* <div className="pb-4 pt-0">
|
|
166
|
-
* Content with
|
|
265
|
+
* <div className="pb-4 pt-0 px-1">
|
|
266
|
+
* Content with smooth height animations. The CSS variables
|
|
267
|
+
* --radix-collapsible-content-height and --radix-collapsible-content-width
|
|
268
|
+
* are available for custom animation implementations.
|
|
269
|
+
* </div>
|
|
270
|
+
* </CollapsibleContent>
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* ```tsx
|
|
275
|
+
* // Force mounted content (stays in DOM when collapsed)
|
|
276
|
+
* <CollapsibleContent forceMount className="data-[state=closed]:hidden">
|
|
277
|
+
* <div className="p-4 text-sm">
|
|
278
|
+
* This content remains in the DOM even when collapsed,
|
|
279
|
+
* useful for maintaining form state or for SSR consistency.
|
|
280
|
+
* </div>
|
|
281
|
+
* </CollapsibleContent>
|
|
282
|
+
* ```
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```tsx
|
|
286
|
+
* // Content with asChild composition
|
|
287
|
+
* <CollapsibleContent asChild>
|
|
288
|
+
* <motion.div
|
|
289
|
+
* initial={{ height: 0 }}
|
|
290
|
+
* animate={{ height: "auto" }}
|
|
291
|
+
* exit={{ height: 0 }}
|
|
292
|
+
* className="overflow-hidden"
|
|
293
|
+
* >
|
|
294
|
+
* <div className="p-4">
|
|
295
|
+
* Content with custom Framer Motion animations
|
|
296
|
+
* </div>
|
|
297
|
+
* </motion.div>
|
|
298
|
+
* </CollapsibleContent>
|
|
299
|
+
* ```
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```tsx
|
|
303
|
+
* // Content with complex nested structure
|
|
304
|
+
* <CollapsibleContent className="overflow-hidden">
|
|
305
|
+
* <div className="border-t pt-4 mt-2">
|
|
306
|
+
* <div className="grid grid-cols-2 gap-4">
|
|
307
|
+
* <div className="space-y-2">
|
|
308
|
+
* <h4 className="font-medium">Documentation</h4>
|
|
309
|
+
* <ul className="text-sm space-y-1 text-muted-foreground">
|
|
310
|
+
* <li>Getting Started</li>
|
|
311
|
+
* <li>Installation</li>
|
|
312
|
+
* <li>Configuration</li>
|
|
313
|
+
* </ul>
|
|
314
|
+
* </div>
|
|
315
|
+
* <div className="space-y-2">
|
|
316
|
+
* <h4 className="font-medium">Examples</h4>
|
|
317
|
+
* <ul className="text-sm space-y-1 text-muted-foreground">
|
|
318
|
+
* <li>Basic Usage</li>
|
|
319
|
+
* <li>Advanced Patterns</li>
|
|
320
|
+
* <li>Custom Styling</li>
|
|
321
|
+
* </ul>
|
|
322
|
+
* </div>
|
|
323
|
+
* </div>
|
|
167
324
|
* </div>
|
|
168
325
|
* </CollapsibleContent>
|
|
169
326
|
* ```
|
|
170
327
|
*
|
|
171
328
|
* @accessibility
|
|
172
|
-
* - Automatically hidden from accessibility tree when collapsed
|
|
173
|
-
* -
|
|
174
|
-
* -
|
|
175
|
-
* -
|
|
176
|
-
* -
|
|
329
|
+
* - **Screen Reader Management**: Automatically hidden from accessibility tree when collapsed
|
|
330
|
+
* - **ARIA Association**: Properly associated with trigger via `aria-controls` relationship
|
|
331
|
+
* - **Content Announcements**: Content changes announced by screen readers when expanded
|
|
332
|
+
* - **Height Animations**: Smooth height transitions with CSS variables for natural motion
|
|
333
|
+
* - **Focus Management**: Focus properly managed when content becomes visible/hidden
|
|
334
|
+
* - **Disabled State**: Content appropriately disabled when parent Collapsible is disabled
|
|
335
|
+
*
|
|
336
|
+
* **Data Attributes for Styling:**
|
|
337
|
+
* - `[data-state="open"|"closed"]` - Reflects current expanded state
|
|
338
|
+
* - `[data-disabled]` - Present when the parent collapsible is disabled
|
|
339
|
+
*
|
|
340
|
+
* **CSS Variables for Animation:**
|
|
341
|
+
* - `--radix-collapsible-content-width` - The natural width of the content
|
|
342
|
+
* - `--radix-collapsible-content-height` - The natural height for smooth animations
|
|
343
|
+
*
|
|
344
|
+
* **Animation Classes:**
|
|
345
|
+
* Use data-state attributes to apply conditional animations:
|
|
346
|
+
* ```css
|
|
347
|
+
* .CollapsibleContent[data-state="open"] {
|
|
348
|
+
* animation: slideDown 300ms ease-out;
|
|
349
|
+
* }
|
|
350
|
+
* .CollapsibleContent[data-state="closed"] {
|
|
351
|
+
* animation: slideUp 300ms ease-out;
|
|
352
|
+
* }
|
|
353
|
+
* ```
|
|
354
|
+
*
|
|
355
|
+
* @param asChild - When true, merges props onto immediate child instead of rendering div
|
|
356
|
+
* @param forceMount - When true, forces content to stay in DOM even when collapsed
|
|
357
|
+
* @param className - Additional CSS classes for styling and animations
|
|
358
|
+
* @param children - The content to be shown/hidden
|
|
177
359
|
*
|
|
360
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/collapsible#content} Radix UI CollapsibleContent API
|
|
361
|
+
* @see {@link Collapsible} Parent container component
|
|
362
|
+
* @see {@link CollapsibleTrigger} Trigger component that controls this content
|
|
178
363
|
* @since 1.0.0
|
|
179
364
|
*/
|
|
180
|
-
declare function CollapsibleContent(
|
|
365
|
+
declare function CollapsibleContent(props: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
181
366
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
182
367
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAuEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuHG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAG9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AACH,iBAAS,kBAAkB,CACzB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,2CAQ5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkJG;AACH,iBAAS,kBAAkB,CACzB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,2CAQ5E;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|