@arcfusionz/arc-primitive-ui 0.1.0 → 0.2.1

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.
Files changed (135) hide show
  1. package/dist/components/AILoader/AILoader.d.ts +32 -0
  2. package/dist/components/AILoader/AILoader.js +157 -0
  3. package/dist/components/AILoader/index.d.ts +2 -0
  4. package/dist/components/AILoader/index.js +2 -0
  5. package/dist/components/Accordion/Accordion.d.ts +96 -0
  6. package/dist/components/Accordion/Accordion.js +149 -0
  7. package/dist/components/Accordion/index.d.ts +2 -0
  8. package/dist/components/Accordion/index.js +2 -0
  9. package/dist/components/Avatar/Avatar.d.ts +152 -0
  10. package/dist/components/Avatar/Avatar.js +216 -0
  11. package/dist/components/Avatar/index.d.ts +2 -0
  12. package/dist/components/Avatar/index.js +2 -0
  13. package/dist/components/Badge/Badge.d.ts +87 -0
  14. package/dist/components/Badge/Badge.js +118 -0
  15. package/dist/components/Badge/index.d.ts +2 -0
  16. package/dist/components/Badge/index.js +2 -0
  17. package/dist/components/Breadcrumb/Breadcrumb.d.ts +109 -0
  18. package/dist/components/Breadcrumb/Breadcrumb.js +182 -0
  19. package/dist/components/Breadcrumb/index.d.ts +2 -0
  20. package/dist/components/Breadcrumb/index.js +2 -0
  21. package/dist/components/Button/Button.d.ts +57 -0
  22. package/dist/components/Button/Button.js +177 -0
  23. package/dist/components/Button/index.d.ts +2 -0
  24. package/dist/components/Button/index.js +2 -0
  25. package/dist/components/Calendar/Calendar.d.ts +140 -0
  26. package/dist/components/Calendar/Calendar.js +468 -0
  27. package/dist/components/Calendar/index.d.ts +2 -0
  28. package/dist/components/Calendar/index.js +2 -0
  29. package/dist/components/Checkbox/Checkbox.d.ts +60 -0
  30. package/dist/components/Checkbox/Checkbox.js +129 -0
  31. package/dist/components/Checkbox/index.d.ts +2 -0
  32. package/dist/components/Checkbox/index.js +2 -0
  33. package/dist/components/Combobox/Combobox.d.ts +251 -0
  34. package/dist/components/Combobox/Combobox.js +354 -0
  35. package/dist/components/Combobox/index.d.ts +2 -0
  36. package/dist/components/Combobox/index.js +2 -0
  37. package/dist/components/ContextMenu/ContextMenu.d.ts +129 -0
  38. package/dist/components/ContextMenu/ContextMenu.js +93 -0
  39. package/dist/components/ContextMenu/index.d.ts +2 -0
  40. package/dist/components/ContextMenu/index.js +2 -0
  41. package/dist/components/DatePicker/DatePicker.d.ts +109 -0
  42. package/dist/components/DatePicker/DatePicker.js +145 -0
  43. package/dist/components/DatePicker/index.d.ts +2 -0
  44. package/dist/components/DatePicker/index.js +2 -0
  45. package/dist/components/DateRangePicker/DateRangePicker.d.ts +107 -0
  46. package/dist/components/DateRangePicker/DateRangePicker.js +161 -0
  47. package/dist/components/DateRangePicker/index.d.ts +2 -0
  48. package/dist/components/DateRangePicker/index.js +2 -0
  49. package/dist/components/Dialog/Dialog.d.ts +112 -0
  50. package/dist/components/Dialog/Dialog.js +141 -0
  51. package/dist/components/Dialog/index.d.ts +2 -0
  52. package/dist/components/Dialog/index.js +2 -0
  53. package/dist/components/Drawer/Drawer.d.ts +188 -0
  54. package/dist/components/Drawer/Drawer.js +268 -0
  55. package/dist/components/Drawer/index.d.ts +2 -0
  56. package/dist/components/Drawer/index.js +2 -0
  57. package/dist/components/Field/Field.d.ts +123 -0
  58. package/dist/components/Field/Field.js +241 -0
  59. package/dist/components/Field/FieldContext.d.ts +43 -0
  60. package/dist/components/Field/FieldContext.js +28 -0
  61. package/dist/components/Field/index.d.ts +3 -0
  62. package/dist/components/Field/index.js +3 -0
  63. package/dist/components/Fieldset/Fieldset.d.ts +43 -0
  64. package/dist/components/Fieldset/Fieldset.js +48 -0
  65. package/dist/components/Fieldset/index.d.ts +2 -0
  66. package/dist/components/Fieldset/index.js +2 -0
  67. package/dist/components/Form/Form.d.ts +54 -0
  68. package/dist/components/Form/Form.js +57 -0
  69. package/dist/components/Form/index.d.ts +2 -0
  70. package/dist/components/Form/index.js +2 -0
  71. package/dist/components/Input/Input.d.ts +64 -0
  72. package/dist/components/Input/Input.js +111 -0
  73. package/dist/components/Input/index.d.ts +2 -0
  74. package/dist/components/Input/index.js +2 -0
  75. package/dist/components/Menu/Menu.d.ts +212 -0
  76. package/dist/components/Menu/Menu.js +255 -0
  77. package/dist/components/Menu/index.d.ts +2 -0
  78. package/dist/components/Menu/index.js +2 -0
  79. package/dist/components/Popover/Popover.d.ts +122 -0
  80. package/dist/components/Popover/Popover.js +116 -0
  81. package/dist/components/Popover/index.d.ts +2 -0
  82. package/dist/components/Popover/index.js +2 -0
  83. package/dist/components/Progress/Progress.d.ts +87 -0
  84. package/dist/components/Progress/Progress.js +73 -0
  85. package/dist/components/Progress/index.d.ts +2 -0
  86. package/dist/components/Progress/index.js +2 -0
  87. package/dist/components/Radio/Radio.d.ts +65 -0
  88. package/dist/components/Radio/Radio.js +93 -0
  89. package/dist/components/Radio/index.d.ts +2 -0
  90. package/dist/components/Radio/index.js +2 -0
  91. package/dist/components/Select/Select.d.ts +136 -0
  92. package/dist/components/Select/Select.js +219 -0
  93. package/dist/components/Select/index.d.ts +2 -0
  94. package/dist/components/Select/index.js +2 -0
  95. package/dist/components/Skeleton/Skeleton.d.ts +39 -0
  96. package/dist/components/Skeleton/Skeleton.js +44 -0
  97. package/dist/components/Skeleton/index.d.ts +2 -0
  98. package/dist/components/Skeleton/index.js +2 -0
  99. package/dist/components/Stepper/Stepper.d.ts +161 -0
  100. package/dist/components/Stepper/Stepper.js +344 -0
  101. package/dist/components/Stepper/index.d.ts +2 -0
  102. package/dist/components/Stepper/index.js +2 -0
  103. package/dist/components/Switch/Switch.d.ts +56 -0
  104. package/dist/components/Switch/Switch.js +87 -0
  105. package/dist/components/Switch/index.d.ts +2 -0
  106. package/dist/components/Switch/index.js +2 -0
  107. package/dist/components/Table/Table.d.ts +116 -0
  108. package/dist/components/Table/Table.js +143 -0
  109. package/dist/components/Table/index.d.ts +2 -0
  110. package/dist/components/Table/index.js +2 -0
  111. package/dist/components/Tabs/Tabs.d.ts +116 -0
  112. package/dist/components/Tabs/Tabs.js +158 -0
  113. package/dist/components/Tabs/index.d.ts +2 -0
  114. package/dist/components/Tabs/index.js +2 -0
  115. package/dist/components/Timeline/Timeline.d.ts +137 -0
  116. package/dist/components/Timeline/Timeline.js +243 -0
  117. package/dist/components/Timeline/index.d.ts +2 -0
  118. package/dist/components/Timeline/index.js +2 -0
  119. package/dist/components/Toast/Toast.d.ts +135 -0
  120. package/dist/components/Toast/Toast.js +314 -0
  121. package/dist/components/Toast/index.d.ts +2 -0
  122. package/dist/components/Toast/index.js +2 -0
  123. package/dist/components/Tooltip/Tooltip.d.ts +104 -0
  124. package/dist/components/Tooltip/Tooltip.js +95 -0
  125. package/dist/components/Tooltip/index.d.ts +2 -0
  126. package/dist/components/Tooltip/index.js +2 -0
  127. package/dist/components/Typography/Typography.d.ts +38 -0
  128. package/dist/components/Typography/Typography.js +53 -0
  129. package/dist/components/Typography/index.d.ts +2 -0
  130. package/dist/components/Typography/index.js +2 -0
  131. package/dist/index.d.ts +66 -3398
  132. package/dist/index.js +34 -5343
  133. package/dist/lib/cn.d.ts +6 -0
  134. package/dist/lib/cn.js +9 -0
  135. package/package.json +6 -2
@@ -0,0 +1,344 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { createContext, forwardRef, useContext, useEffect, useMemo, useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { useRender } from "@base-ui/react/use-render";
5
+ //#region src/components/Stepper/Stepper.tsx
6
+ function CheckIcon(props) {
7
+ return /* @__PURE__ */ jsx("svg", {
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ stroke: "currentColor",
11
+ strokeWidth: 2.5,
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ ...props,
15
+ children: /* @__PURE__ */ jsx("path", { d: "m5 13 4 4L19 7" })
16
+ });
17
+ }
18
+ function XIcon(props) {
19
+ return /* @__PURE__ */ jsx("svg", {
20
+ viewBox: "0 0 24 24",
21
+ fill: "none",
22
+ stroke: "currentColor",
23
+ strokeWidth: 2.5,
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ ...props,
27
+ children: /* @__PURE__ */ jsx("path", { d: "m6 6 12 12M18 6 6 18" })
28
+ });
29
+ }
30
+ const StepperContext = createContext({
31
+ value: 0,
32
+ linear: true,
33
+ orientation: "horizontal",
34
+ size: "md",
35
+ completedLabel: "Completed",
36
+ incompleteLabel: "Not completed",
37
+ invalidLabel: "Error"
38
+ });
39
+ const StepperItemContext = createContext({
40
+ index: 0,
41
+ current: false,
42
+ complete: false,
43
+ invalid: false,
44
+ disabled: false,
45
+ setHasTrigger: () => {}
46
+ });
47
+ function stepStateAttributes(item, orientation) {
48
+ return {
49
+ "data-orientation": orientation,
50
+ "data-current": item.current ? "" : void 0,
51
+ "data-complete": item.complete ? "" : void 0,
52
+ "data-incomplete": !item.current && !item.complete ? "" : void 0,
53
+ "data-invalid": item.invalid ? "" : void 0,
54
+ "data-disabled": item.disabled ? "" : void 0
55
+ };
56
+ }
57
+ const listOrientationClasses = {
58
+ horizontal: "w-full flex-row items-center",
59
+ vertical: "flex-col"
60
+ };
61
+ const gapClasses = {
62
+ sm: "gap-2",
63
+ md: "gap-3",
64
+ lg: "gap-4"
65
+ };
66
+ const itemClasses = "relative data-disabled:pointer-events-none data-disabled:opacity-50";
67
+ const itemOrientationClasses = {
68
+ horizontal: "flex min-w-0 flex-1 items-center last:flex-initial",
69
+ vertical: "flex flex-col"
70
+ };
71
+ const itemVerticalGapClasses = {
72
+ sm: "[&:not(:last-child)]:pb-4",
73
+ md: "[&:not(:last-child)]:pb-6",
74
+ lg: "[&:not(:last-child)]:pb-8"
75
+ };
76
+ const triggerClasses = "group/trigger grid cursor-pointer select-none grid-cols-[auto_1fr] items-center gap-y-0.5 rounded-md text-start transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none data-disabled:opacity-50";
77
+ const triggerGapClasses = {
78
+ sm: "gap-x-2",
79
+ md: "gap-x-2.5",
80
+ lg: "gap-x-3"
81
+ };
82
+ const indicatorClasses = "flex shrink-0 items-center justify-center rounded-full border font-sans font-medium tabular-nums transition-colors duration-150 [&_svg]:pointer-events-none [&_svg]:shrink-0";
83
+ const indicatorSizeClasses = {
84
+ sm: "size-6 text-xs [&_svg:not([class*='size-'])]:size-3.5",
85
+ md: "size-8 text-sm [&_svg:not([class*='size-'])]:size-4",
86
+ lg: "size-10 text-base [&_svg:not([class*='size-'])]:size-5"
87
+ };
88
+ const indicatorStateClasses = {
89
+ filled: "border-transparent bg-primary text-primary-foreground",
90
+ incomplete: "border-border bg-background text-slate-600 group-hover/trigger:border-slate-400",
91
+ invalid: "border-destructive bg-background text-error-700"
92
+ };
93
+ const titleClasses = "font-sans font-medium transition-colors duration-150";
94
+ const titleSizeClasses = {
95
+ sm: "text-sm",
96
+ md: "text-sm",
97
+ lg: "text-base"
98
+ };
99
+ const descriptionClasses = "col-start-2 font-sans text-muted-foreground";
100
+ const descriptionSizeClasses = {
101
+ sm: "text-xs",
102
+ md: "text-xs",
103
+ lg: "text-sm"
104
+ };
105
+ const separatorClasses = "select-none transition-colors duration-150";
106
+ const separatorHorizontalClasses = "h-px flex-1";
107
+ const separatorVerticalClasses = {
108
+ sm: "absolute start-3 top-7 bottom-1 w-px",
109
+ md: "absolute start-4 top-9 bottom-1 w-px",
110
+ lg: "absolute start-5 top-11 bottom-1 w-px"
111
+ };
112
+ /**
113
+ * Class list for an element laid out and focus-styled as a StepperTrigger.
114
+ *
115
+ * Use it when a foreign interactive element must sit in a step's place — e.g.
116
+ * a router link that re-enters a completed step:
117
+ *
118
+ * <a href="/checkout/plan" className={stepperTriggerVariants()}>
119
+ * <StepperIndicator />
120
+ * <StepperTitle>Choose plan</StepperTitle>
121
+ * </a>
122
+ */
123
+ function stepperTriggerVariants({ size = "md", className } = {}) {
124
+ return cn(triggerClasses, triggerGapClasses[size], className);
125
+ }
126
+ /**
127
+ * Progress through a multi-step flow, marked up as an ordered list with
128
+ * `aria-current="step"` on the current step and visually-hidden state text on
129
+ * the others. It defaults to `aria-label="Progress"`; pass a localized
130
+ * `aria-label` (or `aria-labelledby`) when the page language isn't English.
131
+ */
132
+ const Stepper = forwardRef(({ value = 0, onValueChange, linear = true, orientation = "horizontal", size = "md", completedLabel = "Completed", incompleteLabel = "Not completed", invalidLabel = "Error", render, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...rest }, ref) => {
133
+ const contextValue = useMemo(() => ({
134
+ value,
135
+ linear,
136
+ orientation,
137
+ size,
138
+ onValueChange,
139
+ completedLabel,
140
+ incompleteLabel,
141
+ invalidLabel
142
+ }), [
143
+ value,
144
+ linear,
145
+ orientation,
146
+ size,
147
+ onValueChange,
148
+ completedLabel,
149
+ incompleteLabel,
150
+ invalidLabel
151
+ ]);
152
+ const element = useRender({
153
+ defaultTagName: "ol",
154
+ render,
155
+ ref,
156
+ props: {
157
+ role: "list",
158
+ "aria-label": ariaLabel ?? (ariaLabelledBy == null ? "Progress" : void 0),
159
+ "aria-labelledby": ariaLabelledBy,
160
+ "data-orientation": orientation,
161
+ ...rest,
162
+ className: cn("flex", listOrientationClasses[orientation], orientation === "horizontal" && gapClasses[size], className)
163
+ }
164
+ });
165
+ return /* @__PURE__ */ jsx(StepperContext.Provider, {
166
+ value: contextValue,
167
+ children: element
168
+ });
169
+ });
170
+ Stepper.displayName = "Stepper";
171
+ /**
172
+ * One step in the flow. When it holds no `StepperTrigger` the item itself
173
+ * carries `aria-current="step"` (the USWDS static-indicator pattern); with a
174
+ * trigger, the trigger takes over so keyboard focus announces the state.
175
+ */
176
+ const StepperItem = forwardRef(({ index, completed, disabled = false, invalid = false, render, className, ...rest }, ref) => {
177
+ const { value, orientation, size } = useContext(StepperContext);
178
+ const [hasTrigger, setHasTrigger] = useState(false);
179
+ const current = index === value;
180
+ const complete = completed ?? index < value;
181
+ const contextValue = useMemo(() => ({
182
+ index,
183
+ current,
184
+ complete,
185
+ invalid,
186
+ disabled,
187
+ setHasTrigger
188
+ }), [
189
+ index,
190
+ current,
191
+ complete,
192
+ invalid,
193
+ disabled
194
+ ]);
195
+ const element = useRender({
196
+ defaultTagName: "li",
197
+ render,
198
+ ref,
199
+ props: {
200
+ "aria-current": current && !hasTrigger ? "step" : void 0,
201
+ ...stepStateAttributes(contextValue, orientation),
202
+ ...rest,
203
+ className: cn(itemClasses, itemOrientationClasses[orientation], orientation === "horizontal" ? gapClasses[size] : itemVerticalGapClasses[size], className)
204
+ }
205
+ });
206
+ return /* @__PURE__ */ jsx(StepperItemContext.Provider, {
207
+ value: contextValue,
208
+ children: element
209
+ });
210
+ });
211
+ StepperItem.displayName = "StepperItem";
212
+ /**
213
+ * Makes a step navigable: activating it calls the stepper's `onValueChange`
214
+ * with this step's index. Under `linear` (the default) upcoming steps are
215
+ * blocked automatically; completed steps stay revisitable, which is the
216
+ * universal wizard convention. Carries `aria-current="step"` on the current
217
+ * step so the state is announced on focus, not only while browsing the list.
218
+ */
219
+ const StepperTrigger = forwardRef(({ render, className, disabled = false, onClick, ...rest }, ref) => {
220
+ const { linear, size, orientation, onValueChange } = useContext(StepperContext);
221
+ const item = useContext(StepperItemContext);
222
+ const { setHasTrigger } = item;
223
+ useEffect(() => {
224
+ setHasTrigger(true);
225
+ return () => setHasTrigger(false);
226
+ }, [setHasTrigger]);
227
+ const explicitlyDisabled = disabled || item.disabled;
228
+ const blocked = linear && !item.current && !item.complete;
229
+ const handleClick = (event) => {
230
+ onClick?.(event);
231
+ if (!event.defaultPrevented) onValueChange?.(item.index, event);
232
+ };
233
+ return useRender({
234
+ defaultTagName: "button",
235
+ render,
236
+ ref,
237
+ props: {
238
+ type: "button",
239
+ disabled: explicitlyDisabled || blocked,
240
+ "aria-current": item.current ? "step" : void 0,
241
+ ...stepStateAttributes({
242
+ ...item,
243
+ disabled: explicitlyDisabled
244
+ }, orientation),
245
+ ...rest,
246
+ onClick: handleClick,
247
+ className: cn(stepperTriggerVariants({ size }), className)
248
+ }
249
+ });
250
+ });
251
+ StepperTrigger.displayName = "StepperTrigger";
252
+ /**
253
+ * The step's circular marker: the step number, a check once completed, an
254
+ * error glyph when invalid. Numbers and glyphs are decorative — the
255
+ * visually-hidden status text rendered alongside them (`completedLabel` /
256
+ * `incompleteLabel` / `invalidLabel`) plus the list position carry the state
257
+ * for screen readers, following the USWDS step indicator.
258
+ */
259
+ const StepperIndicator = forwardRef(({ children, render, className, ...rest }, ref) => {
260
+ const { orientation, size, completedLabel, incompleteLabel, invalidLabel } = useContext(StepperContext);
261
+ const item = useContext(StepperItemContext);
262
+ const stateClasses = item.invalid ? indicatorStateClasses.invalid : item.current || item.complete ? indicatorStateClasses.filled : indicatorStateClasses.incomplete;
263
+ const glyph = item.invalid ? /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" }) : item.complete && !item.current ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx("span", {
264
+ "aria-hidden": "true",
265
+ children: item.index + 1
266
+ });
267
+ const statusLabel = item.invalid ? invalidLabel : item.current ? null : item.complete ? completedLabel : incompleteLabel;
268
+ return useRender({
269
+ defaultTagName: "span",
270
+ render,
271
+ ref,
272
+ props: {
273
+ ...stepStateAttributes(item, orientation),
274
+ ...rest,
275
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [children ?? glyph, statusLabel != null && /* @__PURE__ */ jsx("span", {
276
+ className: "sr-only",
277
+ children: statusLabel
278
+ })] }),
279
+ className: cn(indicatorClasses, indicatorSizeClasses[size], stateClasses, orientation === "horizontal" && "row-span-2", className)
280
+ }
281
+ });
282
+ });
283
+ StepperIndicator.displayName = "StepperIndicator";
284
+ /** The step's label. Carbon guidance: keep it to one or two words. */
285
+ const StepperTitle = forwardRef(({ render, className, ...rest }, ref) => {
286
+ const { orientation, size } = useContext(StepperContext);
287
+ const item = useContext(StepperItemContext);
288
+ const stateClasses = item.invalid ? "text-error-700" : item.current || item.complete ? "text-foreground" : "text-slate-600";
289
+ return useRender({
290
+ defaultTagName: "span",
291
+ render,
292
+ ref,
293
+ props: {
294
+ ...stepStateAttributes(item, orientation),
295
+ ...rest,
296
+ className: cn(titleClasses, titleSizeClasses[size], stateClasses, !item.invalid && "group-hover/trigger:text-primary", className)
297
+ }
298
+ });
299
+ });
300
+ StepperTitle.displayName = "StepperTitle";
301
+ /**
302
+ * Secondary line under the title: helper copy, or the "Optional" marker the
303
+ * W3C multi-page-forms guidance asks for on skippable steps.
304
+ */
305
+ const StepperDescription = forwardRef(({ render, className, ...rest }, ref) => {
306
+ const { orientation, size } = useContext(StepperContext);
307
+ const item = useContext(StepperItemContext);
308
+ return useRender({
309
+ defaultTagName: "span",
310
+ render,
311
+ ref,
312
+ props: {
313
+ ...stepStateAttributes(item, orientation),
314
+ ...rest,
315
+ className: cn(descriptionClasses, descriptionSizeClasses[size], item.invalid && "text-error-700", className)
316
+ }
317
+ });
318
+ });
319
+ StepperDescription.displayName = "StepperDescription";
320
+ /**
321
+ * Connector after a step (omit it on the last item). It fills toward the
322
+ * next step horizontally and hangs below the indicator vertically — where it
323
+ * tracks the item's height, so inline step content stretches it. The line
324
+ * turns primary once its step completes.
325
+ */
326
+ const StepperSeparator = forwardRef(({ render, className, ...rest }, ref) => {
327
+ const { orientation, size } = useContext(StepperContext);
328
+ const item = useContext(StepperItemContext);
329
+ return useRender({
330
+ defaultTagName: "span",
331
+ render,
332
+ ref,
333
+ props: {
334
+ role: "presentation",
335
+ "aria-hidden": "true",
336
+ ...stepStateAttributes(item, orientation),
337
+ ...rest,
338
+ className: cn(separatorClasses, orientation === "horizontal" ? separatorHorizontalClasses : separatorVerticalClasses[size], item.complete ? "bg-primary" : "bg-border", className)
339
+ }
340
+ });
341
+ });
342
+ StepperSeparator.displayName = "StepperSeparator";
343
+ //#endregion
344
+ export { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, stepperTriggerVariants };
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperDescription, StepperDescriptionProps, StepperIndicator, StepperIndicatorProps, StepperItem, StepperItemProps, StepperOrientation, StepperProps, StepperSeparator, StepperSeparatorProps, StepperSize, StepperTitle, StepperTitleProps, StepperTrigger, StepperTriggerProps, StepperTriggerVariantsOptions, stepperTriggerVariants } from "./Stepper.js";
2
+ export { Stepper, StepperDescription, type StepperDescriptionProps, StepperIndicator, type StepperIndicatorProps, StepperItem, type StepperItemProps, type StepperOrientation, type StepperProps, StepperSeparator, type StepperSeparatorProps, type StepperSize, StepperTitle, type StepperTitleProps, StepperTrigger, type StepperTriggerProps, type StepperTriggerVariantsOptions, stepperTriggerVariants };
@@ -0,0 +1,2 @@
1
+ import { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, stepperTriggerVariants } from "./Stepper.js";
2
+ export { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger, stepperTriggerVariants };
@@ -0,0 +1,56 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { Switch } from "@base-ui/react/switch";
3
+ //#region src/components/Switch/Switch.d.ts
4
+ type SwitchSize = "sm" | "md" | "lg";
5
+ type SwitchLabelPosition = "start" | "end";
6
+ interface SwitchVariantsOptions {
7
+ size?: SwitchSize;
8
+ className?: string;
9
+ }
10
+ /**
11
+ * Class list for the switch track itself. State styling hangs off Base UI's
12
+ * data-attributes (`data-checked`, `data-disabled`, `data-readonly`,
13
+ * `data-invalid`) plus `aria-invalid`.
14
+ */
15
+ declare function switchVariants({ size, className }?: SwitchVariantsOptions): string;
16
+ interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof Switch.Root>, "className"> {
17
+ /**
18
+ * Track size. The 24px-tall `lg` track meets the WCAG 2.5.8 target-size
19
+ * floor on its own; `sm`/`md` rely on the clickable `label` (or surrounding
20
+ * spacing) to extend the target. Prefer `md`+ with a label on touch-first
21
+ * surfaces.
22
+ */
23
+ size?: SwitchSize;
24
+ /**
25
+ * Visible label rendered in an enclosing `<label>`, so clicking it flips
26
+ * the switch and it names the control. Without it, provide an accessible
27
+ * name another way: `aria-label`, `aria-labelledby`, or an external
28
+ * `<label>`. When `required` is set, the label shows a decorative asterisk.
29
+ */
30
+ label?: ReactNode;
31
+ /**
32
+ * Supporting copy below the label, linked via `aria-describedby`. Rendered
33
+ * outside the `<label>` element so screen readers announce it as the
34
+ * description instead of reading it into the accessible name.
35
+ */
36
+ description?: ReactNode;
37
+ /**
38
+ * Side of the switch the `label` text sits on. `end` (the default) reads
39
+ * label-after like a Checkbox row; `start` reads text-first and pushes the
40
+ * switch to the far edge when the row is stretched — the settings-list
41
+ * pattern. Ignored without `label`.
42
+ */
43
+ labelPosition?: SwitchLabelPosition;
44
+ /** Applied to the switch track itself, also when `label`/`description` wrap it. */
45
+ className?: string;
46
+ }
47
+ /**
48
+ * On/off control built on Base UI's Switch. Reach for it when flipping the
49
+ * value takes effect immediately (settings); for choices collected until a
50
+ * form submit, prefer Checkbox. The thumb slide is built in behind
51
+ * `motion-safe`. `ref` and `className` always target the track element,
52
+ * whether or not the labelled layout wraps it.
53
+ */
54
+ declare const Switch$1: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLSpanElement>>;
55
+ //#endregion
56
+ export { Switch$1 as Switch, SwitchLabelPosition, SwitchProps, SwitchSize, SwitchVariantsOptions, switchVariants };
@@ -0,0 +1,87 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { forwardRef, useId } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Switch } from "@base-ui/react/switch";
5
+ //#region src/components/Switch/Switch.tsx
6
+ const trackClasses = "inline-flex shrink-0 cursor-pointer select-none items-center rounded-full border border-border bg-muted p-px transition-colors duration-150 hover:border-slate-300 hover:bg-slate-200 data-checked:border-primary data-checked:bg-primary hover:data-checked:border-primary-700 hover:data-checked:bg-primary-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:border-destructive data-invalid:border-destructive aria-invalid:focus-visible:outline-destructive data-invalid:focus-visible:outline-destructive data-readonly:cursor-default disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50";
7
+ const trackSizeClasses = {
8
+ sm: "h-4 w-7",
9
+ md: "h-5 w-9",
10
+ lg: "h-6 w-11"
11
+ };
12
+ const thumbSizeClasses = {
13
+ sm: "size-3 data-checked:translate-x-3",
14
+ md: "size-4 data-checked:translate-x-4",
15
+ lg: "size-5 data-checked:translate-x-5"
16
+ };
17
+ const trackOffsetClasses = {
18
+ sm: "mt-0.5",
19
+ md: "",
20
+ lg: ""
21
+ };
22
+ const labelTextClasses = {
23
+ sm: "text-sm",
24
+ md: "text-sm",
25
+ lg: "text-base"
26
+ };
27
+ const descriptionTextClasses = {
28
+ sm: "text-xs",
29
+ md: "text-xs",
30
+ lg: "text-sm"
31
+ };
32
+ const descriptionIndentClasses = {
33
+ sm: "ps-9",
34
+ md: "ps-11",
35
+ lg: "ps-13"
36
+ };
37
+ /**
38
+ * Class list for the switch track itself. State styling hangs off Base UI's
39
+ * data-attributes (`data-checked`, `data-disabled`, `data-readonly`,
40
+ * `data-invalid`) plus `aria-invalid`.
41
+ */
42
+ function switchVariants({ size = "md", className } = {}) {
43
+ return cn(trackClasses, trackSizeClasses[size], className);
44
+ }
45
+ /**
46
+ * On/off control built on Base UI's Switch. Reach for it when flipping the
47
+ * value takes effect immediately (settings); for choices collected until a
48
+ * form submit, prefer Checkbox. The thumb slide is built in behind
49
+ * `motion-safe`. `ref` and `className` always target the track element,
50
+ * whether or not the labelled layout wraps it.
51
+ */
52
+ const Switch$1 = forwardRef(({ size = "md", label, description, labelPosition = "end", required, className, "aria-describedby": ariaDescribedBy, ...rest }, ref) => {
53
+ const descriptionId = useId();
54
+ const hasLabel = label != null;
55
+ const hasText = hasLabel || description != null;
56
+ const control = /* @__PURE__ */ jsx(Switch.Root, {
57
+ ref,
58
+ required,
59
+ "aria-describedby": [ariaDescribedBy, description != null ? descriptionId : void 0].filter(Boolean).join(" ") || void 0,
60
+ className: cn(switchVariants({ size }), hasText && "data-disabled:opacity-100", hasLabel && trackOffsetClasses[size], className),
61
+ ...rest,
62
+ children: /* @__PURE__ */ jsx(Switch.Thumb, { className: cn("pointer-events-none block rounded-full bg-background shadow-sm", "motion-safe:transition-[translate] motion-safe:duration-150", thumbSizeClasses[size]) })
63
+ });
64
+ if (!hasText) return control;
65
+ const labelText = /* @__PURE__ */ jsxs("span", {
66
+ className: cn("font-medium text-foreground select-none", labelTextClasses[size]),
67
+ children: [label, required && /* @__PURE__ */ jsx("span", {
68
+ "aria-hidden": "true",
69
+ className: "ms-0.5 text-destructive",
70
+ children: "*"
71
+ })]
72
+ });
73
+ return /* @__PURE__ */ jsxs("span", {
74
+ className: cn("inline-flex max-w-full flex-col gap-1 font-sans", "has-data-disabled:pointer-events-none has-data-disabled:opacity-50"),
75
+ children: [hasLabel ? /* @__PURE__ */ jsx("label", {
76
+ className: cn("inline-flex cursor-pointer items-start gap-2", "has-data-readonly:cursor-default", labelPosition === "start" && "justify-between"),
77
+ children: labelPosition === "start" ? /* @__PURE__ */ jsxs(Fragment, { children: [labelText, control] }) : /* @__PURE__ */ jsxs(Fragment, { children: [control, labelText] })
78
+ }) : control, description != null && /* @__PURE__ */ jsx("span", {
79
+ id: descriptionId,
80
+ className: cn("text-muted-foreground", descriptionTextClasses[size], labelPosition === "end" && descriptionIndentClasses[size]),
81
+ children: description
82
+ })]
83
+ });
84
+ });
85
+ Switch$1.displayName = "Switch";
86
+ //#endregion
87
+ export { Switch$1 as Switch, switchVariants };
@@ -0,0 +1,2 @@
1
+ import { Switch, SwitchLabelPosition, SwitchProps, SwitchSize, SwitchVariantsOptions, switchVariants } from "./Switch.js";
2
+ export { Switch, type SwitchLabelPosition, type SwitchProps, type SwitchSize, type SwitchVariantsOptions, switchVariants };
@@ -0,0 +1,2 @@
1
+ import { Switch, switchVariants } from "./Switch.js";
2
+ export { Switch, switchVariants };
@@ -0,0 +1,116 @@
1
+ import { ComponentPropsWithoutRef } from "react";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ //#region src/components/Table/Table.d.ts
4
+ type TableSize = "sm" | "md" | "lg";
5
+ type TableLayout = "auto" | "fixed";
6
+ type TableContainerVariant = "plain" | "outline" | "elevated";
7
+ type TableCaptionSide = "top" | "bottom";
8
+ interface TableRenderState extends Record<string, unknown> {
9
+ /** Density applied to header and data cells. */
10
+ size: TableSize;
11
+ /** Browser column-sizing algorithm. */
12
+ layout: TableLayout;
13
+ /** Whether alternating body rows receive a supporting surface. */
14
+ striped: boolean;
15
+ /** Whether body rows receive a hover affordance. */
16
+ hoverable: boolean;
17
+ /** Whether column headers stay pinned inside a scrolling container. */
18
+ stickyHeader: boolean;
19
+ /** Whether adjacent cells are visually separated. */
20
+ showColumnBorders: boolean;
21
+ }
22
+ interface TableContainerRenderState extends Record<string, unknown> {
23
+ /** Surface treatment surrounding the scroll area. */
24
+ variant: TableContainerVariant;
25
+ }
26
+ interface TableCaptionRenderState extends Record<string, unknown> {
27
+ /** Visual edge where the native caption is placed. */
28
+ side: TableCaptionSide;
29
+ }
30
+ interface TableRowRenderState extends Record<string, unknown> {
31
+ /** Whether the row receives the selected visual treatment. */
32
+ selected: boolean;
33
+ }
34
+ interface TableContainerProps extends Omit<ComponentPropsWithoutRef<"div">, "className"> {
35
+ /** Surface around the responsive scroll area. `elevated` is the rich card default, `outline` removes depth, and `plain` keeps only overflow behavior. */
36
+ variant?: TableContainerVariant;
37
+ /** Replace the rendered `div` or inspect `{ variant }` in a render callback. Preserve a suitable grouping element. */
38
+ render?: useRender.RenderProp<TableContainerRenderState>;
39
+ /** Additional classes merged after the container recipe; set `max-height` here to activate a sticky header. */
40
+ className?: string;
41
+ }
42
+ declare const TableContainer: import("react").ForwardRefExoticComponent<TableContainerProps & import("react").RefAttributes<HTMLDivElement>>;
43
+ interface TableProps extends Omit<ComponentPropsWithoutRef<"table">, "className"> {
44
+ /** Cell density. `sm` is optimized for desktop data review; prefer `md` or `lg` for touch-heavy rows containing controls. */
45
+ size?: TableSize;
46
+ /** `auto` lets content size columns; `fixed` obeys explicit widths and makes truncation predictable. */
47
+ layout?: TableLayout;
48
+ /** Add a supporting surface to alternating rows to improve scanning across wide datasets. */
49
+ striped?: boolean;
50
+ /** Add a subtle body-row hover affordance. This is visual only and does not make a row interactive. */
51
+ hoverable?: boolean;
52
+ /** Pin column headers to the top of the nearest scrolling `TableContainer`; give the container a max height for vertical scrolling. */
53
+ stickyHeader?: boolean;
54
+ /** Draw semantic-border separators between adjacent columns. */
55
+ showColumnBorders?: boolean;
56
+ /** Replace the rendered `table` or inspect the visual state in a render callback. Preserve native table semantics. */
57
+ render?: useRender.RenderProp<TableRenderState>;
58
+ /** Additional classes for table width, minimum width, or context-specific layout. */
59
+ className?: string;
60
+ }
61
+ declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
62
+ interface TableHeaderProps extends Omit<ComponentPropsWithoutRef<"thead">, "className"> {
63
+ /** Replace the rendered `thead`. Preserve its row-group semantics. */
64
+ render?: useRender.RenderProp;
65
+ /** Additional classes merged after the header recipe. */
66
+ className?: string;
67
+ }
68
+ declare const TableHeader: import("react").ForwardRefExoticComponent<TableHeaderProps & import("react").RefAttributes<HTMLTableSectionElement>>;
69
+ interface TableBodyProps extends Omit<ComponentPropsWithoutRef<"tbody">, "className"> {
70
+ /** Replace the rendered `tbody`. Preserve its row-group semantics. */
71
+ render?: useRender.RenderProp;
72
+ /** Additional classes merged after the body recipe. */
73
+ className?: string;
74
+ }
75
+ declare const TableBody: import("react").ForwardRefExoticComponent<TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
76
+ interface TableFooterProps extends Omit<ComponentPropsWithoutRef<"tfoot">, "className"> {
77
+ /** Replace the rendered `tfoot`. Preserve its row-group semantics. */
78
+ render?: useRender.RenderProp;
79
+ /** Additional classes merged after the footer recipe. */
80
+ className?: string;
81
+ }
82
+ declare const TableFooter: import("react").ForwardRefExoticComponent<TableFooterProps & import("react").RefAttributes<HTMLTableSectionElement>>;
83
+ interface TableRowProps extends Omit<ComponentPropsWithoutRef<"tr">, "className"> {
84
+ /** Apply the selected visual treatment. In a native data table, the composed checkbox or control must expose the accessible checked state; use an advanced grid for row-level selection semantics. */
85
+ selected?: boolean;
86
+ /** Replace the rendered `tr` or inspect `{ selected }` in a render callback. Preserve its row semantics. */
87
+ render?: useRender.RenderProp<TableRowRenderState>;
88
+ /** Additional classes merged after the row recipe. */
89
+ className?: string;
90
+ }
91
+ declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
92
+ interface TableHeadProps extends Omit<ComponentPropsWithoutRef<"th">, "className"> {
93
+ /** Replace the rendered `th`. Preserve header-cell semantics and set `scope`, `id`, and `headers` as the table structure requires. */
94
+ render?: useRender.RenderProp;
95
+ /** Additional classes for alignment, width, truncation, or a sortable-header button. */
96
+ className?: string;
97
+ }
98
+ declare const TableHead: import("react").ForwardRefExoticComponent<TableHeadProps & import("react").RefAttributes<HTMLTableCellElement>>;
99
+ interface TableCellProps extends Omit<ComponentPropsWithoutRef<"td">, "className"> {
100
+ /** Replace the rendered `td`. Preserve data-cell semantics; use `headers` for complex header relationships. */
101
+ render?: useRender.RenderProp;
102
+ /** Additional classes for alignment, width, truncation, or tabular numeric data. */
103
+ className?: string;
104
+ }
105
+ declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
106
+ interface TableCaptionProps extends Omit<ComponentPropsWithoutRef<"caption">, "className"> {
107
+ /** Place the native caption above or below the data. Captions identify tables for screen-reader navigation. */
108
+ side?: TableCaptionSide;
109
+ /** Replace the rendered `caption`. Preserve caption semantics so the table keeps its accessible name. */
110
+ render?: useRender.RenderProp<TableCaptionRenderState>;
111
+ /** Additional classes merged after the caption recipe. */
112
+ className?: string;
113
+ }
114
+ declare const TableCaption: import("react").ForwardRefExoticComponent<TableCaptionProps & import("react").RefAttributes<HTMLTableCaptionElement>>;
115
+ //#endregion
116
+ export { Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCaptionRenderState, TableCaptionSide, TableCell, TableCellProps, TableContainer, TableContainerProps, TableContainerRenderState, TableContainerVariant, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableLayout, TableProps, TableRenderState, TableRow, TableRowProps, TableRowRenderState, TableSize };