@aircall/ds 0.26.0 → 0.28.0
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/globals.css +1 -1
- package/dist/index.d.ts +2488 -54
- package/dist/index.js +2274 -35
- package/dist/theme.css +30 -0
- package/package.json +1 -1
- package/skills/aircall-ds/adopt-attachment/SKILL.md +5 -6
- package/skills/aircall-ds/migrate-audio-player/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-icons/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/SKILL.md +2 -1
- package/skills/aircall-ds/migrate-tractor/accordion/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/alert/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/avatar/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/badge/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/button/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/card/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/combobox/SKILL.md +42 -4
- package/skills/aircall-ds/migrate-tractor/data-table/SKILL.md +2 -1
- package/skills/aircall-ds/migrate-tractor/dialog/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/divider/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/dropdown-menu/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/dropzone/SKILL.md +30 -1
- package/skills/aircall-ds/migrate-tractor/form-and-field/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/gauge/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/input/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/item/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/link/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/popover/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/select/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/sheet-vs-drawer/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/skeleton/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/styling/SKILL.md +138 -3
- package/skills/aircall-ds/migrate-tractor/tabs/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/toast/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/tooltip/SKILL.md +0 -1
- package/skills/aircall-ds/migrate-tractor/tree/SKILL.md +0 -1
- package/skills/aircall-ds/setup/SKILL.md +33 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createContext, useCallback, useContext, useSyncExternalStore } from "re
|
|
|
3
3
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
6
|
-
import { ArrowDownToLine, ArrowLeft, ArrowRight, Backward10, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlert, CircleAlertIcon, CircleCheck, FLAGS, FastForward, FlagUs, Forward10, Info, Loader2Icon, Minus, MinusIcon, MoreHorizontalIcon, PanelLeftIcon, Pause, Play, Plus, Rewind, RotateCcw, Search, Smile, TriangleAlertIcon, XIcon } from "@aircall/react-icons";
|
|
6
|
+
import { ArrowDownToLine, ArrowLeft, ArrowRight, Backward10, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlert, CircleAlertIcon, CircleCheck, FLAGS, FastForward, FlagUs, Forward10, Info, Loader2Icon, Minus, MinusIcon, MoreHorizontalIcon, PanelLeftIcon, Pause, Play, Plus, PlusIcon, Rewind, RotateCcw, Search, Smile, TriangleAlertIcon, XIcon } from "@aircall/react-icons";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Button as Button$1 } from "@base-ui/react/button";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
@@ -109,6 +109,20 @@ function cn(...inputs) {
|
|
|
109
109
|
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/components/accordion.tsx
|
|
112
|
+
/**
|
|
113
|
+
* Root container for an accordion, wrapping Base UI's `Accordion.Root`.
|
|
114
|
+
* Renders a `<div>` that lays out its `AccordionItem` children in a column.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* <Accordion>
|
|
119
|
+
* <AccordionItem value="item-1">
|
|
120
|
+
* <AccordionTrigger>Section one</AccordionTrigger>
|
|
121
|
+
* <AccordionContent>Panel content</AccordionContent>
|
|
122
|
+
* </AccordionItem>
|
|
123
|
+
* </Accordion>
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
112
126
|
const Accordion = React.forwardRef((componentProps, forwardRef) => {
|
|
113
127
|
const { className, ...props } = componentProps;
|
|
114
128
|
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
@@ -119,6 +133,10 @@ const Accordion = React.forwardRef((componentProps, forwardRef) => {
|
|
|
119
133
|
});
|
|
120
134
|
});
|
|
121
135
|
Accordion.displayName = "Accordion";
|
|
136
|
+
/**
|
|
137
|
+
* A single collapsible section of the accordion, wrapping `Accordion.Item`.
|
|
138
|
+
* Renders a `<div>` grouping one `AccordionTrigger` and one `AccordionContent`.
|
|
139
|
+
*/
|
|
122
140
|
const AccordionItem = React.forwardRef((componentProps, forwardRef) => {
|
|
123
141
|
const { className, ...props } = componentProps;
|
|
124
142
|
return /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
@@ -129,6 +147,11 @@ const AccordionItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
129
147
|
});
|
|
130
148
|
});
|
|
131
149
|
AccordionItem.displayName = "AccordionItem";
|
|
150
|
+
/**
|
|
151
|
+
* The clickable heading that toggles its section open or closed, wrapping
|
|
152
|
+
* `Accordion.Trigger`. Renders a `<button>` inside an `Accordion.Header`
|
|
153
|
+
* heading element, with chevron up/down icons reflecting the expanded state.
|
|
154
|
+
*/
|
|
132
155
|
const AccordionTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
133
156
|
const { className, children, ...props } = componentProps;
|
|
134
157
|
return /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
@@ -153,6 +176,11 @@ const AccordionTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
153
176
|
});
|
|
154
177
|
});
|
|
155
178
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
179
|
+
/**
|
|
180
|
+
* The collapsible panel revealed when its section is open, wrapping
|
|
181
|
+
* `Accordion.Panel`. Renders a `<div>` panel (animated via
|
|
182
|
+
* `--accordion-panel-height`) that wraps its children in an inner padded `<div>`.
|
|
183
|
+
*/
|
|
156
184
|
const AccordionContent = React.forwardRef((componentProps, forwardRef) => {
|
|
157
185
|
const { className, children, ...props } = componentProps;
|
|
158
186
|
return /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
@@ -170,8 +198,10 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
170
198
|
|
|
171
199
|
//#endregion
|
|
172
200
|
//#region src/components/button.tsx
|
|
201
|
+
/** Tailwind class string for link-styled buttons and anchors (primary color, underlined). */
|
|
173
202
|
const linkStyle = "text-primary underline underline-offset-4";
|
|
174
|
-
|
|
203
|
+
/** `cva` variant definitions for {@link Button} — resolves `variant`, `size`, and `block` into class names. */
|
|
204
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px active:not-aria-[haspopup]:opacity-60 disabled:pointer-events-auto disabled:opacity-50 disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
175
205
|
variants: {
|
|
176
206
|
variant: {
|
|
177
207
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
@@ -197,6 +227,15 @@ const buttonVariants = cva("group/button inline-flex shrink-0 cursor-pointer ite
|
|
|
197
227
|
block: false
|
|
198
228
|
}
|
|
199
229
|
});
|
|
230
|
+
/**
|
|
231
|
+
* Clickable button. Renders a Base UI `Button` primitive as a `<button>` element,
|
|
232
|
+
* styled via `buttonVariants` (variant / size / block).
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```tsx
|
|
236
|
+
* <Button variant="outline" size="sm">Save</Button>
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
200
239
|
const Button = React.forwardRef((componentProps, forwardRef) => {
|
|
201
240
|
const { className, variant = "default", size = "default", block = false, ...props } = componentProps;
|
|
202
241
|
return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -228,6 +267,8 @@ const de = {
|
|
|
228
267
|
"tree.expand": "Erweitern",
|
|
229
268
|
"multiselect.remove": "Entfernen",
|
|
230
269
|
"multiselect.clearAll": "Alles löschen",
|
|
270
|
+
"multiselect.addItem": "Hinzufügen",
|
|
271
|
+
"multiselect.search": "Suchen",
|
|
231
272
|
"sidebar.toggle": "Seitenleiste umschalten",
|
|
232
273
|
"drawer.close": "Schließen",
|
|
233
274
|
"emojiPicker.emoji": "Emoji",
|
|
@@ -257,6 +298,8 @@ const en = {
|
|
|
257
298
|
"tree.expand": "Expand",
|
|
258
299
|
"multiselect.remove": "Remove",
|
|
259
300
|
"multiselect.clearAll": "Clear all",
|
|
301
|
+
"multiselect.addItem": "Add item",
|
|
302
|
+
"multiselect.search": "Search",
|
|
260
303
|
"sidebar.toggle": "Toggle Sidebar",
|
|
261
304
|
"drawer.close": "Close",
|
|
262
305
|
"emojiPicker.emoji": "Emoji",
|
|
@@ -286,6 +329,8 @@ const es = {
|
|
|
286
329
|
"tree.expand": "Ampliar",
|
|
287
330
|
"multiselect.remove": "Eliminar",
|
|
288
331
|
"multiselect.clearAll": "Borrar todo",
|
|
332
|
+
"multiselect.addItem": "Añadir",
|
|
333
|
+
"multiselect.search": "Buscar",
|
|
289
334
|
"sidebar.toggle": "Alternar barra lateral",
|
|
290
335
|
"drawer.close": "Cerrar",
|
|
291
336
|
"emojiPicker.emoji": "Emoji",
|
|
@@ -315,6 +360,8 @@ const fr = {
|
|
|
315
360
|
"tree.expand": "Développer",
|
|
316
361
|
"multiselect.remove": "Supprimer",
|
|
317
362
|
"multiselect.clearAll": "Tout effacer",
|
|
363
|
+
"multiselect.addItem": "Ajouter",
|
|
364
|
+
"multiselect.search": "Rechercher",
|
|
318
365
|
"sidebar.toggle": "Basculer la barre latérale",
|
|
319
366
|
"drawer.close": "Fermer",
|
|
320
367
|
"emojiPicker.emoji": "Émoji",
|
|
@@ -344,6 +391,8 @@ const it = {
|
|
|
344
391
|
"tree.expand": "Espandi",
|
|
345
392
|
"multiselect.remove": "Rimuovi",
|
|
346
393
|
"multiselect.clearAll": "Cancella tutto",
|
|
394
|
+
"multiselect.addItem": "Aggiungi",
|
|
395
|
+
"multiselect.search": "Cerca",
|
|
347
396
|
"sidebar.toggle": "Attiva/disattiva barra laterale",
|
|
348
397
|
"drawer.close": "Chiudi",
|
|
349
398
|
"emojiPicker.emoji": "Emoji",
|
|
@@ -444,6 +493,18 @@ const ActionBarButton = React.forwardRef((componentProps, forwardRef) => {
|
|
|
444
493
|
});
|
|
445
494
|
});
|
|
446
495
|
ActionBarButton.displayName = "ActionBarButton";
|
|
496
|
+
/**
|
|
497
|
+
* A selection action bar: shows the selected-item count with a clear button and hosts
|
|
498
|
+
* contextual action buttons on the right. Renders a `<div role="toolbar">`. `count` and
|
|
499
|
+
* `onClear` fall back to `ActionBarContext` (e.g. supplied by `DataTable`) when omitted.
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```tsx
|
|
503
|
+
* <ActionBar count={3} onClear={clearSelection}>
|
|
504
|
+
* <ActionBarButton>Delete</ActionBarButton>
|
|
505
|
+
* </ActionBar>
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
447
508
|
const ActionBar = React.forwardRef((componentProps, forwardRef) => {
|
|
448
509
|
const { className, count, onClear, children, label, clearLabel, style, ...props } = componentProps;
|
|
449
510
|
const t = useDsTranslation("ds");
|
|
@@ -484,6 +545,7 @@ ActionBar.displayName = "ActionBar";
|
|
|
484
545
|
|
|
485
546
|
//#endregion
|
|
486
547
|
//#region src/components/spinner.tsx
|
|
548
|
+
/** Class variants for `Spinner`, controlling its `size` (`default`, `sm`, `lg`, `xl`). */
|
|
487
549
|
const spinnerVariants = cva("animate-spin text-current", {
|
|
488
550
|
variants: { size: {
|
|
489
551
|
default: "size-4",
|
|
@@ -493,6 +555,15 @@ const spinnerVariants = cva("animate-spin text-current", {
|
|
|
493
555
|
} },
|
|
494
556
|
defaultVariants: { size: "default" }
|
|
495
557
|
});
|
|
558
|
+
/**
|
|
559
|
+
* Animated loading indicator. Renders a spinning `<svg>` (Loader icon) with
|
|
560
|
+
* `role="status"` and a localized `aria-label` for assistive technology.
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* ```tsx
|
|
564
|
+
* <Spinner size="lg" />
|
|
565
|
+
* ```
|
|
566
|
+
*/
|
|
496
567
|
const Spinner = React.forwardRef((componentProps, forwardRef) => {
|
|
497
568
|
const { className, size, ...props } = componentProps;
|
|
498
569
|
const t = useDsTranslation("ds");
|
|
@@ -577,6 +648,28 @@ function useAnimationFrameLoop(callback) {
|
|
|
577
648
|
return () => cancelAnimationFrame(raf);
|
|
578
649
|
}, []);
|
|
579
650
|
}
|
|
651
|
+
/**
|
|
652
|
+
* Root provider for all AudioPlayer sub-components. Manages a single hidden
|
|
653
|
+
* `<audio>` element and publishes playback state via React context. Renders a
|
|
654
|
+
* `<div>` wrapper around its children.
|
|
655
|
+
*
|
|
656
|
+
* When `src` is provided the audio element pre-loads metadata so duration is
|
|
657
|
+
* available before the user presses play. Omit `src` for multi-item layouts
|
|
658
|
+
* where the source is set imperatively via `player.play({ src })`.
|
|
659
|
+
*
|
|
660
|
+
* Errors are accessed via `useAudioPlayer().error` — no `onError` prop.
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* ```tsx
|
|
664
|
+
* <Audio src="https://example.com/audio.mp3">
|
|
665
|
+
* <AudioPlayerRow>
|
|
666
|
+
* <AudioPlayerButton />
|
|
667
|
+
* <AudioPlayerBar />
|
|
668
|
+
* <AudioPlayerTime />
|
|
669
|
+
* </AudioPlayerRow>
|
|
670
|
+
* </Audio>
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
580
673
|
function Audio({ src, defaultPlaybackRate = 1, preload = "metadata", crossOrigin, children, ...divProps }) {
|
|
581
674
|
const audioRef = React.useRef(null);
|
|
582
675
|
const playPromiseRef = React.useRef(null);
|
|
@@ -835,11 +928,14 @@ function AudioPlayerBar({ className, step = .25, playheadHeight, ...props }) {
|
|
|
835
928
|
if (wasPlayingRef.current) play();
|
|
836
929
|
wasPlayingRef.current = false;
|
|
837
930
|
},
|
|
838
|
-
className: cn("group/audio-player-bar data-[orientation=horizontal]:w-full", !knownDuration && "pointer-events-none opacity-50", className),
|
|
931
|
+
className: cn("group/audio-player-bar data-[orientation=horizontal]:w-full", playheadHeight && "relative h-4", !knownDuration && "pointer-events-none opacity-50", className),
|
|
839
932
|
...props,
|
|
840
933
|
children: /* @__PURE__ */ jsxs(Slider$1.Control, {
|
|
841
|
-
className: "
|
|
842
|
-
style:
|
|
934
|
+
className: cn("flex w-full touch-none select-none", playheadHeight ? "absolute top-0 items-start" : "relative items-center"),
|
|
935
|
+
style: playheadHeight ? {
|
|
936
|
+
height: 16 + playheadHeight,
|
|
937
|
+
paddingTop: 6
|
|
938
|
+
} : { height: 16 },
|
|
843
939
|
children: [
|
|
844
940
|
/* @__PURE__ */ jsx(Slider$1.Track, {
|
|
845
941
|
"data-slot": "audio-player-bar-track",
|
|
@@ -851,7 +947,7 @@ function AudioPlayerBar({ className, step = .25, playheadHeight, ...props }) {
|
|
|
851
947
|
}),
|
|
852
948
|
playheadHeight && /* @__PURE__ */ jsx("div", {
|
|
853
949
|
"aria-hidden": true,
|
|
854
|
-
className: "absolute top-
|
|
950
|
+
className: "absolute top-2 w-0.5 bg-primary pointer-events-none",
|
|
855
951
|
style: {
|
|
856
952
|
left: `${value / max * 100}%`,
|
|
857
953
|
height: playheadHeight,
|
|
@@ -862,7 +958,7 @@ function AudioPlayerBar({ className, step = .25, playheadHeight, ...props }) {
|
|
|
862
958
|
"data-slot": "audio-player-bar-thumb",
|
|
863
959
|
className: cn("block shrink-0 rounded-full shadow-sm select-none", playheadHeight ? [
|
|
864
960
|
"bg-primary size-3 hover:size-4 focus-visible:size-4",
|
|
865
|
-
"
|
|
961
|
+
"top-2! transition-[width,height]",
|
|
866
962
|
"focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none"
|
|
867
963
|
] : [
|
|
868
964
|
"size-4 border border-ring bg-white",
|
|
@@ -1066,12 +1162,41 @@ function AudioPlayerManager({ children }) {
|
|
|
1066
1162
|
|
|
1067
1163
|
//#endregion
|
|
1068
1164
|
//#region src/components/alert-dialog.tsx
|
|
1165
|
+
/**
|
|
1166
|
+
* Root of a modal alert dialog that interrupts the user to confirm or
|
|
1167
|
+
* acknowledge a critical action. Manages open/close state and renders no DOM
|
|
1168
|
+
* element — place `AlertDialogTrigger` and `AlertDialogContent` inside it.
|
|
1169
|
+
*
|
|
1170
|
+
* Supports controlled (`open` + `onOpenChange`) and uncontrolled
|
|
1171
|
+
* (`defaultOpen`) modes.
|
|
1172
|
+
*
|
|
1173
|
+
* @example
|
|
1174
|
+
* ```tsx
|
|
1175
|
+
* <AlertDialog>
|
|
1176
|
+
* <AlertDialogTrigger render={<Button>Delete</Button>} />
|
|
1177
|
+
* <AlertDialogContent>
|
|
1178
|
+
* <AlertDialogHeader>
|
|
1179
|
+
* <AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
1180
|
+
* <AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
|
|
1181
|
+
* </AlertDialogHeader>
|
|
1182
|
+
* <AlertDialogFooter>
|
|
1183
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
1184
|
+
* <AlertDialogAction>Confirm</AlertDialogAction>
|
|
1185
|
+
* </AlertDialogFooter>
|
|
1186
|
+
* </AlertDialogContent>
|
|
1187
|
+
* </AlertDialog>
|
|
1188
|
+
* ```
|
|
1189
|
+
*/
|
|
1069
1190
|
function AlertDialog(componentProps) {
|
|
1070
1191
|
return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
|
|
1071
1192
|
"data-slot": "alert-dialog",
|
|
1072
1193
|
...componentProps
|
|
1073
1194
|
});
|
|
1074
1195
|
}
|
|
1196
|
+
/**
|
|
1197
|
+
* The element that opens the alert dialog when activated. Renders a `<button>`
|
|
1198
|
+
* element.
|
|
1199
|
+
*/
|
|
1075
1200
|
const AlertDialogTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
1076
1201
|
const { ...props } = componentProps;
|
|
1077
1202
|
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
@@ -1081,12 +1206,22 @@ const AlertDialogTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1081
1206
|
});
|
|
1082
1207
|
});
|
|
1083
1208
|
AlertDialogTrigger.displayName = "AlertDialogTrigger";
|
|
1209
|
+
/**
|
|
1210
|
+
* Renders the alert dialog's overlay and content into a portal outside the DOM
|
|
1211
|
+
* hierarchy. Renders no DOM element itself; used internally by
|
|
1212
|
+
* `AlertDialogContent`.
|
|
1213
|
+
*/
|
|
1084
1214
|
function AlertDialogPortal(componentProps) {
|
|
1085
1215
|
return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
|
|
1086
1216
|
"data-slot": "alert-dialog-portal",
|
|
1087
1217
|
...componentProps
|
|
1088
1218
|
});
|
|
1089
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* The dimmed, blurred backdrop shown behind the alert dialog content. Renders a
|
|
1222
|
+
* fixed-position `<div>` covering the viewport; rendered automatically by
|
|
1223
|
+
* `AlertDialogContent`.
|
|
1224
|
+
*/
|
|
1090
1225
|
const AlertDialogOverlay = React.forwardRef((componentProps, forwardRef) => {
|
|
1091
1226
|
const { className, ...props } = componentProps;
|
|
1092
1227
|
return /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
@@ -1097,6 +1232,14 @@ const AlertDialogOverlay = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1097
1232
|
});
|
|
1098
1233
|
});
|
|
1099
1234
|
AlertDialogOverlay.displayName = "AlertDialogOverlay";
|
|
1235
|
+
/**
|
|
1236
|
+
* The centered popup panel holding the alert dialog's content. Renders the
|
|
1237
|
+
* portal, overlay, and a `<div>` popup element positioned in the middle of the
|
|
1238
|
+
* viewport.
|
|
1239
|
+
*
|
|
1240
|
+
* @prop size - Controls the max width of the panel: `'sm'` stays compact while
|
|
1241
|
+
* `'default'` widens on larger screens. Default: `'default'`.
|
|
1242
|
+
*/
|
|
1100
1243
|
const AlertDialogContent = React.forwardRef((componentProps, forwardRef) => {
|
|
1101
1244
|
const { className, size = "default", ...props } = componentProps;
|
|
1102
1245
|
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
@@ -1108,6 +1251,10 @@ const AlertDialogContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1108
1251
|
})] });
|
|
1109
1252
|
});
|
|
1110
1253
|
AlertDialogContent.displayName = "AlertDialogContent";
|
|
1254
|
+
/**
|
|
1255
|
+
* Groups the title, description, and optional media at the top of the dialog.
|
|
1256
|
+
* Renders a `<div>` with a responsive grid layout.
|
|
1257
|
+
*/
|
|
1111
1258
|
const AlertDialogHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
1112
1259
|
const { className, ...props } = componentProps;
|
|
1113
1260
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1118,16 +1265,25 @@ const AlertDialogHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1118
1265
|
});
|
|
1119
1266
|
});
|
|
1120
1267
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
1268
|
+
/**
|
|
1269
|
+
* Container for the dialog's action buttons, pinned to the bottom. Renders a
|
|
1270
|
+
* `<div>` that stacks buttons on mobile and aligns them to the right on larger
|
|
1271
|
+
* screens.
|
|
1272
|
+
*/
|
|
1121
1273
|
const AlertDialogFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
1122
1274
|
const { className, ...props } = componentProps;
|
|
1123
1275
|
return /* @__PURE__ */ jsx("div", {
|
|
1124
1276
|
ref: forwardRef,
|
|
1125
1277
|
"data-slot": "alert-dialog-footer",
|
|
1126
|
-
className: cn("
|
|
1278
|
+
className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
1127
1279
|
...props
|
|
1128
1280
|
});
|
|
1129
1281
|
});
|
|
1130
1282
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
1283
|
+
/**
|
|
1284
|
+
* Optional decorative slot for an icon or illustration shown alongside the
|
|
1285
|
+
* title in the header. Renders a `<div>` sized for a small icon.
|
|
1286
|
+
*/
|
|
1131
1287
|
const AlertDialogMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
1132
1288
|
const { className, ...props } = componentProps;
|
|
1133
1289
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1138,6 +1294,10 @@ const AlertDialogMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1138
1294
|
});
|
|
1139
1295
|
});
|
|
1140
1296
|
AlertDialogMedia.displayName = "AlertDialogMedia";
|
|
1297
|
+
/**
|
|
1298
|
+
* The accessible title of the alert dialog. Renders an `<h2>` element and is
|
|
1299
|
+
* announced to assistive technology when the dialog opens.
|
|
1300
|
+
*/
|
|
1141
1301
|
const AlertDialogTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
1142
1302
|
const { className, ...props } = componentProps;
|
|
1143
1303
|
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
@@ -1148,6 +1308,10 @@ const AlertDialogTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1148
1308
|
});
|
|
1149
1309
|
});
|
|
1150
1310
|
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
1311
|
+
/**
|
|
1312
|
+
* Supporting body text explaining the consequences of the action. Renders a
|
|
1313
|
+
* `<p>` element linked to the dialog for assistive technology.
|
|
1314
|
+
*/
|
|
1151
1315
|
const AlertDialogDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
1152
1316
|
const { className, ...props } = componentProps;
|
|
1153
1317
|
return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
@@ -1158,6 +1322,10 @@ const AlertDialogDescription = React.forwardRef((componentProps, forwardRef) =>
|
|
|
1158
1322
|
});
|
|
1159
1323
|
});
|
|
1160
1324
|
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
1325
|
+
/**
|
|
1326
|
+
* The primary confirmation button that carries out the dialog's action. Renders
|
|
1327
|
+
* the DS `Button` (a `<button>`); accepts all `Button` props.
|
|
1328
|
+
*/
|
|
1161
1329
|
const AlertDialogAction = React.forwardRef((componentProps, forwardRef) => {
|
|
1162
1330
|
const { className, ...props } = componentProps;
|
|
1163
1331
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -1168,6 +1336,13 @@ const AlertDialogAction = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1168
1336
|
});
|
|
1169
1337
|
});
|
|
1170
1338
|
AlertDialogAction.displayName = "AlertDialogAction";
|
|
1339
|
+
/**
|
|
1340
|
+
* The dismiss button that closes the dialog without performing the action.
|
|
1341
|
+
* Renders the DS `Button` (a `<button>`) via the primitive's `Close`.
|
|
1342
|
+
*
|
|
1343
|
+
* @prop variant - Button visual variant. Default: `'outline'`.
|
|
1344
|
+
* @prop size - Button size. Default: `'default'`.
|
|
1345
|
+
*/
|
|
1171
1346
|
const AlertDialogCancel = React.forwardRef((componentProps, forwardRef) => {
|
|
1172
1347
|
const { className, variant = "outline", size = "default", ...props } = componentProps;
|
|
1173
1348
|
return /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
@@ -1185,6 +1360,11 @@ AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
|
1185
1360
|
|
|
1186
1361
|
//#endregion
|
|
1187
1362
|
//#region src/components/alert.tsx
|
|
1363
|
+
/**
|
|
1364
|
+
* `class-variance-authority` config for the {@link Alert} container. The
|
|
1365
|
+
* `variant` option (`default` | `info` | `success` | `warning` | `error`,
|
|
1366
|
+
* default `default`) sets the background, border, and icon colour scheme.
|
|
1367
|
+
*/
|
|
1188
1368
|
const alertVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-3xl border px-4 py-4 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*6)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*6)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-4 [&>svg]:size-6", {
|
|
1189
1369
|
defaultVariants: { variant: "default" },
|
|
1190
1370
|
variants: { variant: {
|
|
@@ -1195,6 +1375,23 @@ const alertVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 ro
|
|
|
1195
1375
|
warning: "bg-warning-background border-warning/35 [&>svg]:text-warning"
|
|
1196
1376
|
} }
|
|
1197
1377
|
});
|
|
1378
|
+
/**
|
|
1379
|
+
* Callout that draws attention to an important, contextual message.
|
|
1380
|
+
*
|
|
1381
|
+
* Renders a `<div role="alert">` laid out as a grid for an optional leading
|
|
1382
|
+
* icon, `AlertTitle`, `AlertDescription`, and `AlertAction`.
|
|
1383
|
+
*
|
|
1384
|
+
* @prop variant - Colour scheme: `default` | `info` | `success` | `warning` | `error`. Default: `'default'`.
|
|
1385
|
+
*
|
|
1386
|
+
* @example
|
|
1387
|
+
* ```tsx
|
|
1388
|
+
* <Alert variant="info">
|
|
1389
|
+
* <InfoIcon />
|
|
1390
|
+
* <AlertTitle>Heads up</AlertTitle>
|
|
1391
|
+
* <AlertDescription>Your trial ends in 3 days.</AlertDescription>
|
|
1392
|
+
* </Alert>
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1198
1395
|
const Alert = React.forwardRef((componentProps, forwardRef) => {
|
|
1199
1396
|
const { className, variant, ...props } = componentProps;
|
|
1200
1397
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1206,6 +1403,14 @@ const Alert = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1206
1403
|
});
|
|
1207
1404
|
});
|
|
1208
1405
|
Alert.displayName = "Alert";
|
|
1406
|
+
/**
|
|
1407
|
+
* Short heading for an {@link Alert}. Renders a `<div>`.
|
|
1408
|
+
*
|
|
1409
|
+
* @example
|
|
1410
|
+
* ```tsx
|
|
1411
|
+
* <AlertTitle>Payment failed</AlertTitle>
|
|
1412
|
+
* ```
|
|
1413
|
+
*/
|
|
1209
1414
|
const AlertTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
1210
1415
|
const { className, ...props } = componentProps;
|
|
1211
1416
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1216,6 +1421,15 @@ const AlertTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1216
1421
|
});
|
|
1217
1422
|
});
|
|
1218
1423
|
AlertTitle.displayName = "AlertTitle";
|
|
1424
|
+
/**
|
|
1425
|
+
* Body copy for an {@link Alert}. Renders a `<div>` in muted foreground colour
|
|
1426
|
+
* that stacks its children vertically.
|
|
1427
|
+
*
|
|
1428
|
+
* @example
|
|
1429
|
+
* ```tsx
|
|
1430
|
+
* <AlertDescription>Update your card to keep your subscription.</AlertDescription>
|
|
1431
|
+
* ```
|
|
1432
|
+
*/
|
|
1219
1433
|
const AlertDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
1220
1434
|
const { className, ...props } = componentProps;
|
|
1221
1435
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1226,6 +1440,19 @@ const AlertDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1226
1440
|
});
|
|
1227
1441
|
});
|
|
1228
1442
|
AlertDescription.displayName = "AlertDescription";
|
|
1443
|
+
/**
|
|
1444
|
+
* Container for action controls (e.g. buttons) inside an {@link Alert}.
|
|
1445
|
+
*
|
|
1446
|
+
* Renders a `<div>` positioned by the alert grid to the trailing side on wide
|
|
1447
|
+
* layouts and below the content on narrow ones.
|
|
1448
|
+
*
|
|
1449
|
+
* @example
|
|
1450
|
+
* ```tsx
|
|
1451
|
+
* <AlertAction>
|
|
1452
|
+
* <Button size="sm">Update</Button>
|
|
1453
|
+
* </AlertAction>
|
|
1454
|
+
* ```
|
|
1455
|
+
*/
|
|
1229
1456
|
const AlertAction = React.forwardRef((componentProps, forwardRef) => {
|
|
1230
1457
|
const { className, ...props } = componentProps;
|
|
1231
1458
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1239,17 +1466,21 @@ AlertAction.displayName = "AlertAction";
|
|
|
1239
1466
|
|
|
1240
1467
|
//#endregion
|
|
1241
1468
|
//#region src/components/attachment.tsx
|
|
1242
|
-
const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1469
|
+
const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
|
|
1470
|
+
variants: {
|
|
1471
|
+
size: {
|
|
1472
|
+
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
1473
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
1474
|
+
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
1475
|
+
},
|
|
1476
|
+
orientation: {
|
|
1477
|
+
horizontal: "min-w-40 items-center",
|
|
1478
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
1479
|
+
},
|
|
1480
|
+
block: { true: "w-full" }
|
|
1247
1481
|
},
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
1251
|
-
}
|
|
1252
|
-
} });
|
|
1482
|
+
defaultVariants: { block: false }
|
|
1483
|
+
});
|
|
1253
1484
|
/**
|
|
1254
1485
|
* Card displaying a single file or image attachment with its metadata,
|
|
1255
1486
|
* upload state, and actions. Renders a `<div>`; compose it from
|
|
@@ -1275,7 +1506,7 @@ const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full
|
|
|
1275
1506
|
* ```
|
|
1276
1507
|
*/
|
|
1277
1508
|
const Attachment = React.forwardRef((componentProps, forwardRef) => {
|
|
1278
|
-
const { className, state = "done", size = "default", orientation = "horizontal", ...props } = componentProps;
|
|
1509
|
+
const { className, state = "done", size = "default", orientation = "horizontal", block = false, ...props } = componentProps;
|
|
1279
1510
|
return /* @__PURE__ */ jsx("div", {
|
|
1280
1511
|
ref: forwardRef,
|
|
1281
1512
|
"data-slot": "attachment",
|
|
@@ -1284,7 +1515,8 @@ const Attachment = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1284
1515
|
"data-orientation": orientation,
|
|
1285
1516
|
className: cn(attachmentVariants({
|
|
1286
1517
|
size,
|
|
1287
|
-
orientation
|
|
1518
|
+
orientation,
|
|
1519
|
+
block
|
|
1288
1520
|
}), className),
|
|
1289
1521
|
...props
|
|
1290
1522
|
});
|
|
@@ -1435,6 +1667,19 @@ AttachmentGroup.displayName = "AttachmentGroup";
|
|
|
1435
1667
|
|
|
1436
1668
|
//#endregion
|
|
1437
1669
|
//#region src/components/avatar.tsx
|
|
1670
|
+
/**
|
|
1671
|
+
* Circular container that displays a user or entity image with a text/icon fallback.
|
|
1672
|
+
* Renders the Base UI `Avatar.Root` element; place `AvatarImage`, `AvatarFallback`, and
|
|
1673
|
+
* an optional `AvatarBadge` inside it.
|
|
1674
|
+
*
|
|
1675
|
+
* @example
|
|
1676
|
+
* ```tsx
|
|
1677
|
+
* <Avatar>
|
|
1678
|
+
* <AvatarImage src="/jane.jpg" alt="Jane Doe" />
|
|
1679
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
1680
|
+
* </Avatar>
|
|
1681
|
+
* ```
|
|
1682
|
+
*/
|
|
1438
1683
|
const Avatar = React.forwardRef((componentProps, forwardRef) => {
|
|
1439
1684
|
const { className, size = "default", ...props } = componentProps;
|
|
1440
1685
|
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
@@ -1446,6 +1691,10 @@ const Avatar = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1446
1691
|
});
|
|
1447
1692
|
});
|
|
1448
1693
|
Avatar.displayName = "Avatar";
|
|
1694
|
+
/**
|
|
1695
|
+
* The avatar's image. Renders the Base UI `Avatar.Image` (`<img>`) and is hidden
|
|
1696
|
+
* automatically when the source fails to load, revealing the `AvatarFallback`.
|
|
1697
|
+
*/
|
|
1449
1698
|
const AvatarImage = React.forwardRef((componentProps, forwardRef) => {
|
|
1450
1699
|
const { className, ...props } = componentProps;
|
|
1451
1700
|
return /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
@@ -1456,6 +1705,10 @@ const AvatarImage = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1456
1705
|
});
|
|
1457
1706
|
});
|
|
1458
1707
|
AvatarImage.displayName = "AvatarImage";
|
|
1708
|
+
/**
|
|
1709
|
+
* Content shown while the image is loading or when it fails to load (typically initials).
|
|
1710
|
+
* Renders the Base UI `Avatar.Fallback` element.
|
|
1711
|
+
*/
|
|
1459
1712
|
const AvatarFallback = React.forwardRef((componentProps, forwardRef) => {
|
|
1460
1713
|
const { className, ...props } = componentProps;
|
|
1461
1714
|
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
@@ -1466,6 +1719,10 @@ const AvatarFallback = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1466
1719
|
});
|
|
1467
1720
|
});
|
|
1468
1721
|
AvatarFallback.displayName = "AvatarFallback";
|
|
1722
|
+
/**
|
|
1723
|
+
* Small status indicator overlaid on the bottom-right of an `Avatar` (e.g. presence dot).
|
|
1724
|
+
* Renders a `<span>`; its size and inner icon visibility scale with the parent avatar size.
|
|
1725
|
+
*/
|
|
1469
1726
|
const AvatarBadge = React.forwardRef((componentProps, forwardRef) => {
|
|
1470
1727
|
const { className, ...props } = componentProps;
|
|
1471
1728
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -1476,6 +1733,19 @@ const AvatarBadge = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1476
1733
|
});
|
|
1477
1734
|
});
|
|
1478
1735
|
AvatarBadge.displayName = "AvatarBadge";
|
|
1736
|
+
/**
|
|
1737
|
+
* Row of overlapping avatars with a ring separating each one. Renders a `<div>`;
|
|
1738
|
+
* wrap several `Avatar` elements (and an optional `AvatarGroupCount`) inside it.
|
|
1739
|
+
*
|
|
1740
|
+
* @example
|
|
1741
|
+
* ```tsx
|
|
1742
|
+
* <AvatarGroup>
|
|
1743
|
+
* <Avatar>…</Avatar>
|
|
1744
|
+
* <Avatar>…</Avatar>
|
|
1745
|
+
* <AvatarGroupCount>+3</AvatarGroupCount>
|
|
1746
|
+
* </AvatarGroup>
|
|
1747
|
+
* ```
|
|
1748
|
+
*/
|
|
1479
1749
|
const AvatarGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
1480
1750
|
const { className, ...props } = componentProps;
|
|
1481
1751
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1486,6 +1756,10 @@ const AvatarGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1486
1756
|
});
|
|
1487
1757
|
});
|
|
1488
1758
|
AvatarGroup.displayName = "AvatarGroup";
|
|
1759
|
+
/**
|
|
1760
|
+
* Trailing counter shown at the end of an `AvatarGroup` for the overflow of hidden avatars.
|
|
1761
|
+
* Renders a circular `<div>` sized to match the group's avatars.
|
|
1762
|
+
*/
|
|
1489
1763
|
const AvatarGroupCount = React.forwardRef((componentProps, forwardRef) => {
|
|
1490
1764
|
const { className, ...props } = componentProps;
|
|
1491
1765
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1499,6 +1773,10 @@ AvatarGroupCount.displayName = "AvatarGroupCount";
|
|
|
1499
1773
|
|
|
1500
1774
|
//#endregion
|
|
1501
1775
|
//#region src/components/counter-badge.tsx
|
|
1776
|
+
/**
|
|
1777
|
+
* `class-variance-authority` config for {@link CounterBadge}. `variant`
|
|
1778
|
+
* (`default` | `secondary` | `ghost`, default `default`) sets the colour scheme.
|
|
1779
|
+
*/
|
|
1502
1780
|
const counterBadgeVariants = cva("group/counter-badge inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border border-transparent px-1 text-xs font-medium leading-none whitespace-nowrap transition-[color,box-shadow]", {
|
|
1503
1781
|
variants: { variant: {
|
|
1504
1782
|
default: "bg-destructive text-primary-foreground hover:bg-destructive/80 focus-visible:border-ring focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-ring/50",
|
|
@@ -1507,6 +1785,17 @@ const counterBadgeVariants = cva("group/counter-badge inline-flex h-5 min-w-5 sh
|
|
|
1507
1785
|
} },
|
|
1508
1786
|
defaultVariants: { variant: "default" }
|
|
1509
1787
|
});
|
|
1788
|
+
/**
|
|
1789
|
+
* Small pill for surfacing a count or short status, e.g. an unread indicator.
|
|
1790
|
+
* Renders a `<span>` (override the element via the `render` prop).
|
|
1791
|
+
*
|
|
1792
|
+
* @prop variant - Colour scheme: `default` | `secondary` | `ghost`. Default: `'default'`.
|
|
1793
|
+
*
|
|
1794
|
+
* @example
|
|
1795
|
+
* ```tsx
|
|
1796
|
+
* <CounterBadge>3</CounterBadge>
|
|
1797
|
+
* ```
|
|
1798
|
+
*/
|
|
1510
1799
|
const CounterBadge = React.forwardRef((componentProps, forwardRef) => {
|
|
1511
1800
|
const { className, variant = "default", render, ...props } = componentProps;
|
|
1512
1801
|
return useRender({
|
|
@@ -1530,6 +1819,7 @@ const OVERLAY_DARK = "bg-[linear-gradient(0deg,var(--badge-film-10)_0%,var(--bad
|
|
|
1530
1819
|
const OVERLAY_MEDIUM_DARK = "bg-[linear-gradient(0deg,var(--badge-film-40)_0%,var(--badge-film-40)_100%)]";
|
|
1531
1820
|
const OVERLAY_MEDIUM_LIGHT = "bg-[linear-gradient(0deg,var(--badge-film-60)_0%,var(--badge-film-60)_100%)]";
|
|
1532
1821
|
const OVERLAY_LIGHT = "bg-[linear-gradient(0deg,var(--badge-film-80)_0%,var(--badge-film-80)_100%)]";
|
|
1822
|
+
/** `cva` recipe for the Badge/Chip container — drives the `size`, `color`, and `tone` classes. */
|
|
1533
1823
|
const badgeVariants = cva("group/badge inline-flex w-fit max-w-36 shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md font-medium whitespace-nowrap transition-all focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:shrink-0 [&>svg]:pointer-events-none", {
|
|
1534
1824
|
variants: {
|
|
1535
1825
|
size: {
|
|
@@ -1738,6 +2028,10 @@ const Badge = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1738
2028
|
});
|
|
1739
2029
|
});
|
|
1740
2030
|
Badge.displayName = "Badge";
|
|
2031
|
+
/**
|
|
2032
|
+
* Lays out a set of `Badge`s in a wrapping horizontal row. Renders a `<div>`
|
|
2033
|
+
* (`flex flex-wrap`, `gap-2`); pair with `BadgeGroupCount` to show an overflow tally.
|
|
2034
|
+
*/
|
|
1741
2035
|
const BadgeGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
1742
2036
|
const { className, ...props } = componentProps;
|
|
1743
2037
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1755,6 +2049,10 @@ const badgeGroupCountVariants = cva("rounded-md", {
|
|
|
1755
2049
|
} },
|
|
1756
2050
|
defaultVariants: { size: "default" }
|
|
1757
2051
|
});
|
|
2052
|
+
/**
|
|
2053
|
+
* Trailing "+N" overflow counter for a `BadgeGroup`. Renders a ghost `CounterBadge`
|
|
2054
|
+
* sized to match the group's badges (`size` mirrors `Badge`'s `default` / `lg`).
|
|
2055
|
+
*/
|
|
1758
2056
|
const BadgeGroupCount = React.forwardRef((componentProps, forwardRef) => {
|
|
1759
2057
|
const { className, size = "default", ...props } = componentProps;
|
|
1760
2058
|
return /* @__PURE__ */ jsx(CounterBadge, {
|
|
@@ -1766,6 +2064,7 @@ const BadgeGroupCount = React.forwardRef((componentProps, forwardRef) => {
|
|
|
1766
2064
|
});
|
|
1767
2065
|
});
|
|
1768
2066
|
BadgeGroupCount.displayName = "BadgeGroupCount";
|
|
2067
|
+
/** Design-approved mapping from a legacy stored tag hex (lowercased) to a DS `color` + `tone`. */
|
|
1769
2068
|
const LEGACY_TAG_COLOR_MAP = {
|
|
1770
2069
|
"#003d4b": {
|
|
1771
2070
|
color: "charcoal",
|
|
@@ -1832,6 +2131,12 @@ function resolveTagColor(hex) {
|
|
|
1832
2131
|
|
|
1833
2132
|
//#endregion
|
|
1834
2133
|
//#region src/components/banner.tsx
|
|
2134
|
+
/**
|
|
2135
|
+
* `class-variance-authority` config for the {@link Banner} container. `variant`
|
|
2136
|
+
* (`default` | `info` | `success` | `warning` | `error`, default `default`)
|
|
2137
|
+
* sets the colour scheme; `borderDirection` (`top` | `bottom`) chooses which
|
|
2138
|
+
* edge gets the accent border.
|
|
2139
|
+
*/
|
|
1835
2140
|
const bannerVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 px-4 py-4 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*6)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*6)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-4 [&>svg]:size-6", {
|
|
1836
2141
|
defaultVariants: { variant: "default" },
|
|
1837
2142
|
variants: {
|
|
@@ -1848,6 +2153,25 @@ const bannerVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 p
|
|
|
1848
2153
|
}
|
|
1849
2154
|
}
|
|
1850
2155
|
});
|
|
2156
|
+
/**
|
|
2157
|
+
* Full-width contextual message, typically pinned to the top or bottom of a
|
|
2158
|
+
* view. Like {@link Alert} but edge-to-edge with a single accent border.
|
|
2159
|
+
*
|
|
2160
|
+
* Renders a `<div role="alert">` laid out as a grid for an optional leading
|
|
2161
|
+
* icon, `BannerTitle`, `BannerDescription`, and `BannerAction`.
|
|
2162
|
+
*
|
|
2163
|
+
* @prop variant - Colour scheme: `default` | `info` | `success` | `warning` | `error`. Default: `'default'`.
|
|
2164
|
+
* @prop borderDirection - Which edge carries the accent border: `top` | `bottom`.
|
|
2165
|
+
*
|
|
2166
|
+
* @example
|
|
2167
|
+
* ```tsx
|
|
2168
|
+
* <Banner variant="warning" borderDirection="top">
|
|
2169
|
+
* <WarningIcon />
|
|
2170
|
+
* <BannerTitle>Scheduled maintenance</BannerTitle>
|
|
2171
|
+
* <BannerDescription>The app may be briefly unavailable tonight.</BannerDescription>
|
|
2172
|
+
* </Banner>
|
|
2173
|
+
* ```
|
|
2174
|
+
*/
|
|
1851
2175
|
const Banner = React.forwardRef((componentProps, forwardRef) => {
|
|
1852
2176
|
const { className, variant, borderDirection, ...props } = componentProps;
|
|
1853
2177
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1927,6 +2251,20 @@ function getSlotQueue(state, slot) {
|
|
|
1927
2251
|
return diff !== 0 ? diff : b.registeredAt - a.registeredAt;
|
|
1928
2252
|
});
|
|
1929
2253
|
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Provides the notification queue store (state + dispatch) to descendants so the
|
|
2256
|
+
* `useNotification`/`useNotificationQueue` hooks and `NotificationSlot`s can share it.
|
|
2257
|
+
* Renders no DOM element — wrap your app (or a subtree) and place `NotificationSlot`s
|
|
2258
|
+
* where notifications should appear.
|
|
2259
|
+
*
|
|
2260
|
+
* @example
|
|
2261
|
+
* ```tsx
|
|
2262
|
+
* <NotificationQueueProvider>
|
|
2263
|
+
* <App />
|
|
2264
|
+
* <NotificationSlot slot="page" />
|
|
2265
|
+
* </NotificationQueueProvider>
|
|
2266
|
+
* ```
|
|
2267
|
+
*/
|
|
1930
2268
|
function NotificationQueueProvider(componentProps) {
|
|
1931
2269
|
const { children } = componentProps;
|
|
1932
2270
|
const [state, dispatch] = React.useReducer(reducer, {
|
|
@@ -1942,6 +2280,13 @@ function NotificationQueueProvider(componentProps) {
|
|
|
1942
2280
|
children
|
|
1943
2281
|
});
|
|
1944
2282
|
}
|
|
2283
|
+
/**
|
|
2284
|
+
* Imperative notification API for event-driven notifications (a user action occurred,
|
|
2285
|
+
* an async operation completed, a message arrived). Must run under `NotificationQueueProvider`.
|
|
2286
|
+
*
|
|
2287
|
+
* @returns `{ push, dismiss }` — `push(options)` registers a notification and returns a
|
|
2288
|
+
* `NotificationHandle` with a bound `dismiss`; `dismiss(id, slot)` removes one by id + slot.
|
|
2289
|
+
*/
|
|
1945
2290
|
function useNotificationQueue() {
|
|
1946
2291
|
const { dispatch } = useNotificationQueueContext();
|
|
1947
2292
|
return {
|
|
@@ -1970,6 +2315,13 @@ function useNotificationQueue() {
|
|
|
1970
2315
|
}), [dispatch])
|
|
1971
2316
|
};
|
|
1972
2317
|
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Declarative, lifecycle-bound notification for persistent state (visible as long as a
|
|
2320
|
+
* condition holds): registers on mount and unregisters on unmount. Must run under
|
|
2321
|
+
* `NotificationQueueProvider`.
|
|
2322
|
+
*
|
|
2323
|
+
* @returns a `NotificationHandle` with a `dismiss` bound to this notification.
|
|
2324
|
+
*/
|
|
1973
2325
|
function useNotification({ id, slot, priority, render }) {
|
|
1974
2326
|
const { dispatch } = useNotificationQueueContext();
|
|
1975
2327
|
const dismiss = React.useCallback(() => dispatch({
|
|
@@ -2009,6 +2361,16 @@ function useNotification({ id, slot, priority, render }) {
|
|
|
2009
2361
|
]);
|
|
2010
2362
|
return { dismiss };
|
|
2011
2363
|
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Renders the highest-priority active notification for a given `slot`, or nothing when
|
|
2366
|
+
* the slot is empty. Renders a `<div>` wrapper around the notification content; place it
|
|
2367
|
+
* wherever output should appear (a top-level banner area, or inline in a form/card).
|
|
2368
|
+
*
|
|
2369
|
+
* @example
|
|
2370
|
+
* ```tsx
|
|
2371
|
+
* <NotificationSlot slot="page" />
|
|
2372
|
+
* ```
|
|
2373
|
+
*/
|
|
2012
2374
|
const NotificationSlot = React.forwardRef((componentProps, forwardRef) => {
|
|
2013
2375
|
const { slot, className } = componentProps;
|
|
2014
2376
|
const { state } = useNotificationQueueContext();
|
|
@@ -2025,6 +2387,17 @@ NotificationSlot.displayName = "NotificationSlot";
|
|
|
2025
2387
|
|
|
2026
2388
|
//#endregion
|
|
2027
2389
|
//#region src/components/separator.tsx
|
|
2390
|
+
/**
|
|
2391
|
+
* Visual and semantic divider between content. Renders Base UI's `Separator`
|
|
2392
|
+
* primitive as a `<div role="separator">` line.
|
|
2393
|
+
*
|
|
2394
|
+
* @prop orientation - Line direction: `horizontal` | `vertical`. Default: `'horizontal'`.
|
|
2395
|
+
*
|
|
2396
|
+
* @example
|
|
2397
|
+
* ```tsx
|
|
2398
|
+
* <Separator orientation="vertical" />
|
|
2399
|
+
* ```
|
|
2400
|
+
*/
|
|
2028
2401
|
const Separator = React.forwardRef((componentProps, forwardRef) => {
|
|
2029
2402
|
const { className, orientation = "horizontal", ...props } = componentProps;
|
|
2030
2403
|
return /* @__PURE__ */ jsx(Separator$1, {
|
|
@@ -2040,6 +2413,7 @@ Separator.displayName = "Separator";
|
|
|
2040
2413
|
|
|
2041
2414
|
//#endregion
|
|
2042
2415
|
//#region src/components/button-group.tsx
|
|
2416
|
+
/** `cva` variant definitions for {@link ButtonGroup} — resolves `orientation` (horizontal / vertical) into class names. */
|
|
2043
2417
|
const buttonGroupVariants = cva("flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
2044
2418
|
variants: { orientation: {
|
|
2045
2419
|
horizontal: "*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
|
|
@@ -2047,6 +2421,18 @@ const buttonGroupVariants = cva("flex w-fit items-stretch *:focus-visible:relati
|
|
|
2047
2421
|
} },
|
|
2048
2422
|
defaultVariants: { orientation: "horizontal" }
|
|
2049
2423
|
});
|
|
2424
|
+
/**
|
|
2425
|
+
* Groups related buttons into a single visual unit with shared borders and merged corners.
|
|
2426
|
+
* Renders a `<div role="group">` and normalizes the radii/borders of its children.
|
|
2427
|
+
*
|
|
2428
|
+
* @example
|
|
2429
|
+
* ```tsx
|
|
2430
|
+
* <ButtonGroup>
|
|
2431
|
+
* <Button variant="outline">Prev</Button>
|
|
2432
|
+
* <Button variant="outline">Next</Button>
|
|
2433
|
+
* </ButtonGroup>
|
|
2434
|
+
* ```
|
|
2435
|
+
*/
|
|
2050
2436
|
const ButtonGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
2051
2437
|
const { className, orientation, ...props } = componentProps;
|
|
2052
2438
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2059,6 +2445,10 @@ const ButtonGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2059
2445
|
});
|
|
2060
2446
|
});
|
|
2061
2447
|
ButtonGroup.displayName = "ButtonGroup";
|
|
2448
|
+
/**
|
|
2449
|
+
* Non-interactive text or label segment inside a {@link ButtonGroup}.
|
|
2450
|
+
* Renders a `<div>` by default (overridable via `render`), styled to match adjacent buttons.
|
|
2451
|
+
*/
|
|
2062
2452
|
const ButtonGroupText = React.forwardRef((componentProps, forwardRef) => {
|
|
2063
2453
|
const { className, render, ...props } = componentProps;
|
|
2064
2454
|
return useRender({
|
|
@@ -2072,6 +2462,10 @@ const ButtonGroupText = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2072
2462
|
});
|
|
2073
2463
|
});
|
|
2074
2464
|
ButtonGroupText.displayName = "ButtonGroupText";
|
|
2465
|
+
/**
|
|
2466
|
+
* Divider between items in a {@link ButtonGroup}. Renders a `Separator` (defaulting to
|
|
2467
|
+
* `orientation="vertical"`) sized to stretch across the group.
|
|
2468
|
+
*/
|
|
2075
2469
|
const ButtonGroupSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
2076
2470
|
const { className, orientation = "vertical", ...props } = componentProps;
|
|
2077
2471
|
return /* @__PURE__ */ jsx(Separator, {
|
|
@@ -2086,6 +2480,16 @@ ButtonGroupSeparator.displayName = "ButtonGroupSeparator";
|
|
|
2086
2480
|
|
|
2087
2481
|
//#endregion
|
|
2088
2482
|
//#region src/components/calendar.tsx
|
|
2483
|
+
/**
|
|
2484
|
+
* Date picker calendar, a themed wrapper around react-day-picker's `DayPicker`.
|
|
2485
|
+
* Renders DayPicker's grid inside a `<div data-slot="calendar">`, styled with DS
|
|
2486
|
+
* tokens and Button-styled nav controls.
|
|
2487
|
+
*
|
|
2488
|
+
* @example
|
|
2489
|
+
* ```tsx
|
|
2490
|
+
* <Calendar mode="single" selected={date} onSelect={setDate} />
|
|
2491
|
+
* ```
|
|
2492
|
+
*/
|
|
2089
2493
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
|
|
2090
2494
|
const defaultClassNames = getDefaultClassNames();
|
|
2091
2495
|
return /* @__PURE__ */ jsx(DayPicker, {
|
|
@@ -2166,6 +2570,11 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
|
2166
2570
|
...props
|
|
2167
2571
|
});
|
|
2168
2572
|
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Single day cell within the calendar grid. Renders a ghost icon `Button`
|
|
2575
|
+
* (`<button>`) carrying selection/range data attributes, and auto-focuses
|
|
2576
|
+
* itself when react-day-picker marks the day as focused.
|
|
2577
|
+
*/
|
|
2169
2578
|
function CalendarDayButton({ className: dayClassName, day, modifiers, locale, ...props }) {
|
|
2170
2579
|
const defaultClassNames = getDefaultClassNames();
|
|
2171
2580
|
const ref = React.useRef(null);
|
|
@@ -2188,6 +2597,22 @@ function CalendarDayButton({ className: dayClassName, day, modifiers, locale, ..
|
|
|
2188
2597
|
|
|
2189
2598
|
//#endregion
|
|
2190
2599
|
//#region src/components/card.tsx
|
|
2600
|
+
/**
|
|
2601
|
+
* Root container for a card. Renders a `<div data-slot="card">` with border, background, and
|
|
2602
|
+
* vertical spacing; child parts (`CardHeader`, `CardContent`, `CardFooter`, …) compose inside it.
|
|
2603
|
+
*
|
|
2604
|
+
* @example
|
|
2605
|
+
* ```tsx
|
|
2606
|
+
* <Card>
|
|
2607
|
+
* <CardHeader>
|
|
2608
|
+
* <CardTitle>Title</CardTitle>
|
|
2609
|
+
* <CardDescription>Description</CardDescription>
|
|
2610
|
+
* </CardHeader>
|
|
2611
|
+
* <CardContent>Body</CardContent>
|
|
2612
|
+
* <CardFooter>Footer</CardFooter>
|
|
2613
|
+
* </Card>
|
|
2614
|
+
* ```
|
|
2615
|
+
*/
|
|
2191
2616
|
const Card = React.forwardRef((componentProps, forwardRef) => {
|
|
2192
2617
|
const { className, size = "default", ...props } = componentProps;
|
|
2193
2618
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2199,6 +2624,10 @@ const Card = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2199
2624
|
});
|
|
2200
2625
|
});
|
|
2201
2626
|
Card.displayName = "Card";
|
|
2627
|
+
/**
|
|
2628
|
+
* Header region of a card. Renders a `<div data-slot="card-header">` that lays out the title,
|
|
2629
|
+
* description, and an optional `CardAction` in a grid.
|
|
2630
|
+
*/
|
|
2202
2631
|
const CardHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
2203
2632
|
const { className, ...props } = componentProps;
|
|
2204
2633
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2209,6 +2638,9 @@ const CardHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2209
2638
|
});
|
|
2210
2639
|
});
|
|
2211
2640
|
CardHeader.displayName = "CardHeader";
|
|
2641
|
+
/**
|
|
2642
|
+
* Card title. Renders a `<div data-slot="card-title">` with emphasized title typography.
|
|
2643
|
+
*/
|
|
2212
2644
|
const CardTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
2213
2645
|
const { className, ...props } = componentProps;
|
|
2214
2646
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2219,6 +2651,10 @@ const CardTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2219
2651
|
});
|
|
2220
2652
|
});
|
|
2221
2653
|
CardTitle.displayName = "CardTitle";
|
|
2654
|
+
/**
|
|
2655
|
+
* Secondary descriptive text for a card. Renders a `<div data-slot="card-description">` in muted
|
|
2656
|
+
* foreground color.
|
|
2657
|
+
*/
|
|
2222
2658
|
const CardDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
2223
2659
|
const { className, ...props } = componentProps;
|
|
2224
2660
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2229,6 +2665,10 @@ const CardDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2229
2665
|
});
|
|
2230
2666
|
});
|
|
2231
2667
|
CardDescription.displayName = "CardDescription";
|
|
2668
|
+
/**
|
|
2669
|
+
* Action slot pinned to the top-right of `CardHeader` (e.g. a button or menu). Renders a
|
|
2670
|
+
* `<div data-slot="card-action">` positioned in the header grid.
|
|
2671
|
+
*/
|
|
2232
2672
|
const CardAction = React.forwardRef((componentProps, forwardRef) => {
|
|
2233
2673
|
const { className, ...props } = componentProps;
|
|
2234
2674
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2239,6 +2679,9 @@ const CardAction = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2239
2679
|
});
|
|
2240
2680
|
});
|
|
2241
2681
|
CardAction.displayName = "CardAction";
|
|
2682
|
+
/**
|
|
2683
|
+
* Main body region of a card. Renders a `<div data-slot="card-content">` with horizontal padding.
|
|
2684
|
+
*/
|
|
2242
2685
|
const CardContent = React.forwardRef((componentProps, forwardRef) => {
|
|
2243
2686
|
const { className, ...props } = componentProps;
|
|
2244
2687
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2249,6 +2692,10 @@ const CardContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2249
2692
|
});
|
|
2250
2693
|
});
|
|
2251
2694
|
CardContent.displayName = "CardContent";
|
|
2695
|
+
/**
|
|
2696
|
+
* Footer region of a card. Renders a `<div data-slot="card-footer">` with a top border and muted
|
|
2697
|
+
* background.
|
|
2698
|
+
*/
|
|
2252
2699
|
const CardFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
2253
2700
|
const { className, ...props } = componentProps;
|
|
2254
2701
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2268,6 +2715,22 @@ function useCarousel() {
|
|
|
2268
2715
|
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
2269
2716
|
return context;
|
|
2270
2717
|
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Carousel root that sets up Embla and shares state via context with its parts.
|
|
2720
|
+
* Renders a `<div role="region">` and handles left/right arrow-key navigation.
|
|
2721
|
+
*
|
|
2722
|
+
* @example
|
|
2723
|
+
* ```tsx
|
|
2724
|
+
* <Carousel>
|
|
2725
|
+
* <CarouselContent>
|
|
2726
|
+
* <CarouselItem>Slide 1</CarouselItem>
|
|
2727
|
+
* <CarouselItem>Slide 2</CarouselItem>
|
|
2728
|
+
* </CarouselContent>
|
|
2729
|
+
* <CarouselPrevious />
|
|
2730
|
+
* <CarouselNext />
|
|
2731
|
+
* </Carousel>
|
|
2732
|
+
* ```
|
|
2733
|
+
*/
|
|
2271
2734
|
const Carousel = React.forwardRef((componentProps, forwardRef) => {
|
|
2272
2735
|
const { orientation = "horizontal", opts, setApi, plugins, className, children, ...props } = componentProps;
|
|
2273
2736
|
const [carouselRef, api] = useEmblaCarousel({
|
|
@@ -2333,6 +2796,10 @@ const Carousel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2333
2796
|
});
|
|
2334
2797
|
});
|
|
2335
2798
|
Carousel.displayName = "Carousel";
|
|
2799
|
+
/**
|
|
2800
|
+
* Scrollable viewport wrapping the slides. Renders an overflow-hidden `<div>`
|
|
2801
|
+
* (the Embla ref holder) containing a flex `<div>` that lays out the items.
|
|
2802
|
+
*/
|
|
2336
2803
|
const CarouselContent = React.forwardRef((componentProps, forwardRef) => {
|
|
2337
2804
|
const { className, ...props } = componentProps;
|
|
2338
2805
|
const { carouselRef, orientation } = useCarousel();
|
|
@@ -2348,6 +2815,10 @@ const CarouselContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2348
2815
|
});
|
|
2349
2816
|
});
|
|
2350
2817
|
CarouselContent.displayName = "CarouselContent";
|
|
2818
|
+
/**
|
|
2819
|
+
* A single slide. Renders a full-basis `<div role="group">` that adjusts its
|
|
2820
|
+
* padding based on the carousel orientation.
|
|
2821
|
+
*/
|
|
2351
2822
|
const CarouselItem = React.forwardRef((componentProps, forwardRef) => {
|
|
2352
2823
|
const { className, ...props } = componentProps;
|
|
2353
2824
|
const { orientation } = useCarousel();
|
|
@@ -2361,6 +2832,10 @@ const CarouselItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2361
2832
|
});
|
|
2362
2833
|
});
|
|
2363
2834
|
CarouselItem.displayName = "CarouselItem";
|
|
2835
|
+
/**
|
|
2836
|
+
* Button that scrolls to the previous slide, auto-disabled at the start.
|
|
2837
|
+
* Renders a rounded icon `Button` (`<button>`) positioned outside the viewport.
|
|
2838
|
+
*/
|
|
2364
2839
|
const CarouselPrevious = React.forwardRef((componentProps, forwardRef) => {
|
|
2365
2840
|
const { className, variant = "outline", size = "sm", ...props } = componentProps;
|
|
2366
2841
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
@@ -2380,6 +2855,10 @@ const CarouselPrevious = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2380
2855
|
});
|
|
2381
2856
|
});
|
|
2382
2857
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
2858
|
+
/**
|
|
2859
|
+
* Button that scrolls to the next slide, auto-disabled at the end.
|
|
2860
|
+
* Renders a rounded icon `Button` (`<button>`) positioned outside the viewport.
|
|
2861
|
+
*/
|
|
2383
2862
|
const CarouselNext = React.forwardRef((componentProps, forwardRef) => {
|
|
2384
2863
|
const { className, variant = "outline", size = "sm", ...props } = componentProps;
|
|
2385
2864
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
@@ -2402,12 +2881,22 @@ CarouselNext.displayName = "CarouselNext";
|
|
|
2402
2881
|
|
|
2403
2882
|
//#endregion
|
|
2404
2883
|
//#region src/components/checkbox.tsx
|
|
2884
|
+
/**
|
|
2885
|
+
* A checkbox for toggling a single value, wrapping Base UI's `Checkbox.Root`.
|
|
2886
|
+
* Renders a `<button role="checkbox">` containing a check (checked) or minus
|
|
2887
|
+
* (indeterminate) indicator.
|
|
2888
|
+
*
|
|
2889
|
+
* @example
|
|
2890
|
+
* ```tsx
|
|
2891
|
+
* <Checkbox defaultChecked />
|
|
2892
|
+
* ```
|
|
2893
|
+
*/
|
|
2405
2894
|
const Checkbox = React.forwardRef((componentProps, forwardRef) => {
|
|
2406
2895
|
const { className, ...props } = componentProps;
|
|
2407
2896
|
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
2408
2897
|
ref: forwardRef,
|
|
2409
2898
|
"data-slot": "checkbox",
|
|
2410
|
-
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-[color,box-shadow,opacity] outline-none active:opacity-60 group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80 aria-invalid:border-destructive focus-visible:aria-invalid:ring-3 focus-visible:aria-invalid:ring-destructive/20 hover:aria-invalid:data-unchecked:bg-destructive-background focus-visible:aria-invalid:data-unchecked:bg-destructive-background bg-background dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:focus-visible:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive dark:data-checked:bg-primary dark:data-indeterminate:bg-primary", className),
|
|
2899
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-[color,box-shadow,opacity] outline-none active:opacity-60 group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:bg-input/50 data-disabled:opacity-50 dark:data-disabled:bg-input/80 aria-invalid:border-destructive focus-visible:aria-invalid:ring-3 focus-visible:aria-invalid:ring-destructive/20 hover:aria-invalid:data-unchecked:bg-destructive-background focus-visible:aria-invalid:data-unchecked:bg-destructive-background bg-background dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:focus-visible:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive dark:data-checked:bg-primary dark:data-indeterminate:bg-primary", className),
|
|
2411
2900
|
...props,
|
|
2412
2901
|
children: /* @__PURE__ */ jsxs(Checkbox$1.Indicator, {
|
|
2413
2902
|
"data-slot": "checkbox-indicator",
|
|
@@ -2527,6 +3016,18 @@ Chip.displayName = "Chip";
|
|
|
2527
3016
|
|
|
2528
3017
|
//#endregion
|
|
2529
3018
|
//#region src/components/scroll-area.tsx
|
|
3019
|
+
/**
|
|
3020
|
+
* Custom-scrollbar container. Renders the Base UI `ScrollArea.Root` `<div>`
|
|
3021
|
+
* (with `min-h-0` so it can shrink in flex layouts) wrapping a scrollable
|
|
3022
|
+
* viewport, vertical/horizontal scrollbars, and a corner.
|
|
3023
|
+
*
|
|
3024
|
+
* @example
|
|
3025
|
+
* ```tsx
|
|
3026
|
+
* <ScrollArea className="h-72">
|
|
3027
|
+
* <div>Long content…</div>
|
|
3028
|
+
* </ScrollArea>
|
|
3029
|
+
* ```
|
|
3030
|
+
*/
|
|
2530
3031
|
const ScrollArea = React.forwardRef((componentProps, forwardRef) => {
|
|
2531
3032
|
const { className, children, scrollFade = false, scrollbarGutter = false, ...props } = componentProps;
|
|
2532
3033
|
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
@@ -2546,6 +3047,10 @@ const ScrollArea = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2546
3047
|
});
|
|
2547
3048
|
});
|
|
2548
3049
|
ScrollArea.displayName = "ScrollArea";
|
|
3050
|
+
/**
|
|
3051
|
+
* Draggable scrollbar for one axis, shown on hover/scroll. Renders the Base UI
|
|
3052
|
+
* `ScrollArea.Scrollbar` `<div>` containing a rounded `Thumb`.
|
|
3053
|
+
*/
|
|
2549
3054
|
const ScrollBar = React.forwardRef((componentProps, forwardRef) => {
|
|
2550
3055
|
const { className, orientation = "vertical", ...props } = componentProps;
|
|
2551
3056
|
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, {
|
|
@@ -2633,6 +3138,21 @@ FilterClearAllButton.displayName = "FilterClearAllButton";
|
|
|
2633
3138
|
|
|
2634
3139
|
//#endregion
|
|
2635
3140
|
//#region src/components/collapsible.tsx
|
|
3141
|
+
/**
|
|
3142
|
+
* Root container for a Collapsible. Manages the open/closed state of a single
|
|
3143
|
+
* expandable region and renders a `<div>` wrapping the trigger and content.
|
|
3144
|
+
*
|
|
3145
|
+
* Supports controlled (`open` + `onOpenChange`) and uncontrolled (`defaultOpen`)
|
|
3146
|
+
* modes.
|
|
3147
|
+
*
|
|
3148
|
+
* @example
|
|
3149
|
+
* ```tsx
|
|
3150
|
+
* <Collapsible>
|
|
3151
|
+
* <CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
3152
|
+
* <CollapsibleContent>Hidden content</CollapsibleContent>
|
|
3153
|
+
* </Collapsible>
|
|
3154
|
+
* ```
|
|
3155
|
+
*/
|
|
2636
3156
|
const Collapsible = React.forwardRef((componentProps, forwardRef) => {
|
|
2637
3157
|
return /* @__PURE__ */ jsx(Collapsible$1.Root, {
|
|
2638
3158
|
ref: forwardRef,
|
|
@@ -2641,6 +3161,10 @@ const Collapsible = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2641
3161
|
});
|
|
2642
3162
|
});
|
|
2643
3163
|
Collapsible.displayName = "Collapsible";
|
|
3164
|
+
/**
|
|
3165
|
+
* The button that toggles the Collapsible open and closed. Renders a
|
|
3166
|
+
* `<button>` element.
|
|
3167
|
+
*/
|
|
2644
3168
|
const CollapsibleTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
2645
3169
|
return /* @__PURE__ */ jsx(Collapsible$1.Trigger, {
|
|
2646
3170
|
ref: forwardRef,
|
|
@@ -2649,6 +3173,10 @@ const CollapsibleTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2649
3173
|
});
|
|
2650
3174
|
});
|
|
2651
3175
|
CollapsibleTrigger.displayName = "CollapsibleTrigger";
|
|
3176
|
+
/**
|
|
3177
|
+
* The collapsible region revealed when the trigger is toggled open. Renders a
|
|
3178
|
+
* `<div>` panel that is hidden while collapsed.
|
|
3179
|
+
*/
|
|
2652
3180
|
const CollapsibleContent = React.forwardRef((componentProps, forwardRef) => {
|
|
2653
3181
|
return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
|
|
2654
3182
|
ref: forwardRef,
|
|
@@ -2661,13 +3189,26 @@ CollapsibleContent.displayName = "CollapsibleContent";
|
|
|
2661
3189
|
//#endregion
|
|
2662
3190
|
//#region src/components/input.tsx
|
|
2663
3191
|
const inputVariants = cva("text-foreground file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-background px-3 py-2 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:disabled:bg-input/80 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:border-destructive focus-visible:aria-invalid:ring-destructive/20 focus-visible:aria-invalid:ring-3 dark:focus-visible:aria-invalid:ring-destructive/40", { variants: { block: { true: "w-full" } } });
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
3192
|
+
/**
|
|
3193
|
+
* Single-line text field styled to the design system.
|
|
3194
|
+
*
|
|
3195
|
+
* Renders a native `<input>` with focus ring and `aria-invalid` error styling;
|
|
3196
|
+
* accepts any input `type`.
|
|
3197
|
+
*
|
|
3198
|
+
* @prop block - When `true`, stretches to fill the full width of its container. Default: `false`.
|
|
3199
|
+
*
|
|
3200
|
+
* @example
|
|
3201
|
+
* ```tsx
|
|
3202
|
+
* <Input type="email" placeholder="you@example.com" />
|
|
3203
|
+
* ```
|
|
3204
|
+
*/
|
|
3205
|
+
const Input = React.forwardRef((componentProps, forwardRef) => {
|
|
3206
|
+
const { className, type, block, ...props } = componentProps;
|
|
3207
|
+
return /* @__PURE__ */ jsx("input", {
|
|
3208
|
+
type,
|
|
3209
|
+
"data-slot": "input",
|
|
3210
|
+
className: cn(inputVariants({
|
|
3211
|
+
block,
|
|
2671
3212
|
className
|
|
2672
3213
|
})),
|
|
2673
3214
|
...props,
|
|
@@ -2678,6 +3219,18 @@ Input.displayName = "Input";
|
|
|
2678
3219
|
|
|
2679
3220
|
//#endregion
|
|
2680
3221
|
//#region src/components/textarea.tsx
|
|
3222
|
+
/**
|
|
3223
|
+
* Multi-line text field styled to the design system.
|
|
3224
|
+
*
|
|
3225
|
+
* Renders a native `<textarea>` that auto-grows with its content
|
|
3226
|
+
* (`field-sizing: content`) and shows focus-ring and `aria-invalid` error
|
|
3227
|
+
* styling.
|
|
3228
|
+
*
|
|
3229
|
+
* @example
|
|
3230
|
+
* ```tsx
|
|
3231
|
+
* <Textarea placeholder="Leave a comment…" rows={4} />
|
|
3232
|
+
* ```
|
|
3233
|
+
*/
|
|
2681
3234
|
const Textarea = React.forwardRef((componentProps, forwardRef) => {
|
|
2682
3235
|
const { className, ...props } = componentProps;
|
|
2683
3236
|
return /* @__PURE__ */ jsx("textarea", {
|
|
@@ -2698,6 +3251,23 @@ Textarea.displayName = "Textarea";
|
|
|
2698
3251
|
* identical container without nesting inside `InputGroup`.
|
|
2699
3252
|
*/
|
|
2700
3253
|
const inputGroupShellClassName = cn("group/input-group bg-background border-input dark:bg-input/30 relative flex h-10 w-full items-center rounded-md border transition-[color,box-shadow] outline-none has-[>textarea]:h-auto", "has-[input:disabled]:bg-input/50 has-[textarea:disabled]:bg-input/50 has-[input:disabled]:opacity-50 has-[textarea:disabled]:opacity-50 dark:has-[input:disabled]:bg-input/80 dark:has-[textarea:disabled]:bg-input/80", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-3", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]:focus-visible]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]:focus-visible]:ring-destructive/40");
|
|
3254
|
+
/**
|
|
3255
|
+
* Bordered flex-row container that groups an input with leading/trailing addons
|
|
3256
|
+
* (icons, buttons, text). Renders a `<div role="group">` and owns the shared
|
|
3257
|
+
* border, height, hover/focus ring, disabled fade, and error halo; place an
|
|
3258
|
+
* `InputGroupInput`/`InputGroupTextarea` control plus `InputGroupAddon`,
|
|
3259
|
+
* `InputGroupButton`, or `InputGroupText` children inside it.
|
|
3260
|
+
*
|
|
3261
|
+
* @example
|
|
3262
|
+
* ```tsx
|
|
3263
|
+
* <InputGroup>
|
|
3264
|
+
* <InputGroupAddon>
|
|
3265
|
+
* <SearchIcon />
|
|
3266
|
+
* </InputGroupAddon>
|
|
3267
|
+
* <InputGroupInput placeholder="Search…" />
|
|
3268
|
+
* </InputGroup>
|
|
3269
|
+
* ```
|
|
3270
|
+
*/
|
|
2701
3271
|
const InputGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
2702
3272
|
const { className, ...props } = componentProps;
|
|
2703
3273
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2778,13 +3348,38 @@ InputGroupTextarea.displayName = "InputGroupTextarea";
|
|
|
2778
3348
|
|
|
2779
3349
|
//#endregion
|
|
2780
3350
|
//#region src/components/combobox.tsx
|
|
3351
|
+
/**
|
|
3352
|
+
* Root of the combobox, aliasing Base UI's `Combobox.Root`. Manages selection, open state, and
|
|
3353
|
+
* filtering, and renders no DOM element — compose the input, content, and items inside it.
|
|
3354
|
+
*
|
|
3355
|
+
* @example
|
|
3356
|
+
* ```tsx
|
|
3357
|
+
* <Combobox items={items}>
|
|
3358
|
+
* <ComboboxInput placeholder="Search…" />
|
|
3359
|
+
* <ComboboxContent>
|
|
3360
|
+
* <ComboboxList>
|
|
3361
|
+
* {(item) => <ComboboxItem key={item} value={item}>{item}</ComboboxItem>}
|
|
3362
|
+
* </ComboboxList>
|
|
3363
|
+
* <ComboboxEmpty>No results</ComboboxEmpty>
|
|
3364
|
+
* </ComboboxContent>
|
|
3365
|
+
* </Combobox>
|
|
3366
|
+
* ```
|
|
3367
|
+
*/
|
|
2781
3368
|
const Combobox = Combobox$1.Root;
|
|
3369
|
+
/**
|
|
3370
|
+
* Displays the current selected value(s), wrapping Base UI's `Combobox.Value`. Renders no DOM
|
|
3371
|
+
* element of its own — its children (or render function) produce the output.
|
|
3372
|
+
*/
|
|
2782
3373
|
function ComboboxValue(componentProps) {
|
|
2783
3374
|
return /* @__PURE__ */ jsx(Combobox$1.Value, {
|
|
2784
3375
|
"data-slot": "combobox-value",
|
|
2785
3376
|
...componentProps
|
|
2786
3377
|
});
|
|
2787
3378
|
}
|
|
3379
|
+
/**
|
|
3380
|
+
* Toggles the combobox popup, wrapping Base UI's `Combobox.Trigger`. Renders a `<button>` with a
|
|
3381
|
+
* trailing chevron icon.
|
|
3382
|
+
*/
|
|
2788
3383
|
const ComboboxTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
2789
3384
|
const { className, children, ...props } = componentProps;
|
|
2790
3385
|
return /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
|
|
@@ -2796,6 +3391,10 @@ const ComboboxTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2796
3391
|
});
|
|
2797
3392
|
});
|
|
2798
3393
|
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
3394
|
+
/**
|
|
3395
|
+
* Clears the current selection, wrapping Base UI's `Combobox.Clear`. Renders a ghost icon
|
|
3396
|
+
* `<button>` with an X icon.
|
|
3397
|
+
*/
|
|
2799
3398
|
const ComboboxClear = React.forwardRef((componentProps, forwardRef) => {
|
|
2800
3399
|
const { className, ...props } = componentProps;
|
|
2801
3400
|
return /* @__PURE__ */ jsx(Combobox$1.Clear, {
|
|
@@ -2811,6 +3410,10 @@ const ComboboxClear = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2811
3410
|
});
|
|
2812
3411
|
});
|
|
2813
3412
|
ComboboxClear.displayName = "ComboboxClear";
|
|
3413
|
+
/**
|
|
3414
|
+
* Text input for filtering combobox items, wrapping Base UI's `Combobox.Input`. Renders a
|
|
3415
|
+
* `<div>` `InputGroup` containing the input plus optional trigger and clear addon buttons.
|
|
3416
|
+
*/
|
|
2814
3417
|
const ComboboxInput = React.forwardRef((componentProps, forwardRef) => {
|
|
2815
3418
|
const { className, children, disabled = false, showTrigger = true, showClear = false, ...props } = componentProps;
|
|
2816
3419
|
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -2837,6 +3440,10 @@ const ComboboxInput = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2837
3440
|
});
|
|
2838
3441
|
});
|
|
2839
3442
|
ComboboxInput.displayName = "ComboboxInput";
|
|
3443
|
+
/**
|
|
3444
|
+
* Floating popup holding the combobox list, wrapping Base UI's `Combobox.Popup` inside a
|
|
3445
|
+
* `Portal` and `Positioner`. Renders a positioned `<div>`.
|
|
3446
|
+
*/
|
|
2840
3447
|
const ComboboxContent = React.forwardRef((componentProps, forwardRef) => {
|
|
2841
3448
|
const { className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props } = componentProps;
|
|
2842
3449
|
return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
|
|
@@ -2856,6 +3463,10 @@ const ComboboxContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2856
3463
|
}) });
|
|
2857
3464
|
});
|
|
2858
3465
|
ComboboxContent.displayName = "ComboboxContent";
|
|
3466
|
+
/**
|
|
3467
|
+
* Scrollable list wrapper for combobox items, wrapping Base UI's `Combobox.List`. Renders a
|
|
3468
|
+
* scrollable `<div>`.
|
|
3469
|
+
*/
|
|
2859
3470
|
const ComboboxList = React.forwardRef((componentProps, forwardRef) => {
|
|
2860
3471
|
const { className, ...props } = componentProps;
|
|
2861
3472
|
return /* @__PURE__ */ jsx(Combobox$1.List, {
|
|
@@ -2866,6 +3477,10 @@ const ComboboxList = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2866
3477
|
});
|
|
2867
3478
|
});
|
|
2868
3479
|
ComboboxList.displayName = "ComboboxList";
|
|
3480
|
+
/**
|
|
3481
|
+
* Selectable option in the combobox list, wrapping Base UI's `Combobox.Item`. Renders a `<div>`
|
|
3482
|
+
* row with a trailing check indicator when selected.
|
|
3483
|
+
*/
|
|
2869
3484
|
const ComboboxItem = React.forwardRef((componentProps, forwardRef) => {
|
|
2870
3485
|
const { className, children, ...props } = componentProps;
|
|
2871
3486
|
return /* @__PURE__ */ jsxs(Combobox$1.Item, {
|
|
@@ -2881,6 +3496,10 @@ const ComboboxItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2881
3496
|
});
|
|
2882
3497
|
});
|
|
2883
3498
|
ComboboxItem.displayName = "ComboboxItem";
|
|
3499
|
+
/**
|
|
3500
|
+
* Groups related combobox items under a shared label, wrapping Base UI's `Combobox.Group`.
|
|
3501
|
+
* Renders a `<div>`.
|
|
3502
|
+
*/
|
|
2884
3503
|
const ComboboxGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
2885
3504
|
const { className, ...props } = componentProps;
|
|
2886
3505
|
return /* @__PURE__ */ jsx(Combobox$1.Group, {
|
|
@@ -2891,6 +3510,10 @@ const ComboboxGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2891
3510
|
});
|
|
2892
3511
|
});
|
|
2893
3512
|
ComboboxGroup.displayName = "ComboboxGroup";
|
|
3513
|
+
/**
|
|
3514
|
+
* Label for a `ComboboxGroup`, wrapping Base UI's `Combobox.GroupLabel`. Renders a muted `<div>`
|
|
3515
|
+
* heading.
|
|
3516
|
+
*/
|
|
2894
3517
|
const ComboboxLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
2895
3518
|
const { className, ...props } = componentProps;
|
|
2896
3519
|
return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
|
|
@@ -2901,12 +3524,20 @@ const ComboboxLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2901
3524
|
});
|
|
2902
3525
|
});
|
|
2903
3526
|
ComboboxLabel.displayName = "ComboboxLabel";
|
|
3527
|
+
/**
|
|
3528
|
+
* Maps a set of items into combobox items, wrapping Base UI's `Combobox.Collection`. Renders no
|
|
3529
|
+
* DOM element of its own — it only iterates over the provided items.
|
|
3530
|
+
*/
|
|
2904
3531
|
function ComboboxCollection(componentProps) {
|
|
2905
3532
|
return /* @__PURE__ */ jsx(Combobox$1.Collection, {
|
|
2906
3533
|
"data-slot": "combobox-collection",
|
|
2907
3534
|
...componentProps
|
|
2908
3535
|
});
|
|
2909
3536
|
}
|
|
3537
|
+
/**
|
|
3538
|
+
* Message shown when no items match the current query, wrapping Base UI's `Combobox.Empty`.
|
|
3539
|
+
* Renders a `<div>` that is only visible when the list is empty.
|
|
3540
|
+
*/
|
|
2910
3541
|
const ComboboxEmpty = React.forwardRef((componentProps, forwardRef) => {
|
|
2911
3542
|
const { className, ...props } = componentProps;
|
|
2912
3543
|
return /* @__PURE__ */ jsx(Combobox$1.Empty, {
|
|
@@ -2917,6 +3548,10 @@ const ComboboxEmpty = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2917
3548
|
});
|
|
2918
3549
|
});
|
|
2919
3550
|
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
3551
|
+
/**
|
|
3552
|
+
* Visual divider between combobox items or groups, wrapping Base UI's `Combobox.Separator`.
|
|
3553
|
+
* Renders a thin `<div>` line.
|
|
3554
|
+
*/
|
|
2920
3555
|
const ComboboxSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
2921
3556
|
const { className, ...props } = componentProps;
|
|
2922
3557
|
return /* @__PURE__ */ jsx(Combobox$1.Separator, {
|
|
@@ -2927,6 +3562,10 @@ const ComboboxSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2927
3562
|
});
|
|
2928
3563
|
});
|
|
2929
3564
|
ComboboxSeparator.displayName = "ComboboxSeparator";
|
|
3565
|
+
/**
|
|
3566
|
+
* Container for the selected chips in a multi-select combobox, wrapping Base UI's
|
|
3567
|
+
* `Combobox.Chips`. Renders a bordered, wrapping `<div>` that also holds the chip input.
|
|
3568
|
+
*/
|
|
2930
3569
|
const ComboboxChips = React.forwardRef((componentProps, forwardRef) => {
|
|
2931
3570
|
const { className, ...props } = componentProps;
|
|
2932
3571
|
return /* @__PURE__ */ jsx(Combobox$1.Chips, {
|
|
@@ -2937,6 +3576,10 @@ const ComboboxChips = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2937
3576
|
});
|
|
2938
3577
|
});
|
|
2939
3578
|
ComboboxChips.displayName = "ComboboxChips";
|
|
3579
|
+
/**
|
|
3580
|
+
* A single selected value rendered inside `ComboboxChips`, wrapping Base UI's `Combobox.Chip`.
|
|
3581
|
+
* Renders a `Chip` `<div>` with an optional remove button.
|
|
3582
|
+
*/
|
|
2940
3583
|
const ComboboxChip = React.forwardRef(function ComboboxChip(componentProps, forwardRef) {
|
|
2941
3584
|
const { className, children, showRemove = true, color, tone, legacyColor, ...props } = componentProps;
|
|
2942
3585
|
return /* @__PURE__ */ jsxs(Combobox$1.Chip, {
|
|
@@ -2951,6 +3594,10 @@ const ComboboxChip = React.forwardRef(function ComboboxChip(componentProps, forw
|
|
|
2951
3594
|
children: [children, showRemove && /* @__PURE__ */ jsx(Combobox$1.ChipRemove, { render: /* @__PURE__ */ jsx(ChipRemove, {}) })]
|
|
2952
3595
|
});
|
|
2953
3596
|
});
|
|
3597
|
+
/**
|
|
3598
|
+
* Text input placed inside `ComboboxChips` for filtering and adding chips, wrapping Base UI's
|
|
3599
|
+
* `Combobox.Input`. Renders an `<input>`.
|
|
3600
|
+
*/
|
|
2954
3601
|
const ComboboxChipsInput = React.forwardRef(function ComboboxChipsInput(componentProps, forwardRef) {
|
|
2955
3602
|
const { className, ...props } = componentProps;
|
|
2956
3603
|
return /* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
@@ -2961,18 +3608,43 @@ const ComboboxChipsInput = React.forwardRef(function ComboboxChipsInput(componen
|
|
|
2961
3608
|
});
|
|
2962
3609
|
});
|
|
2963
3610
|
ComboboxChipsInput.displayName = "ComboboxChipsInput";
|
|
3611
|
+
/**
|
|
3612
|
+
* Returns a stable ref to attach to `ComboboxChips` and pass as `ComboboxContent`'s `anchor`, so
|
|
3613
|
+
* the popup is positioned against the chips container rather than the input.
|
|
3614
|
+
*/
|
|
2964
3615
|
function useComboboxAnchor() {
|
|
2965
3616
|
return React.useRef(null);
|
|
2966
3617
|
}
|
|
2967
3618
|
|
|
2968
3619
|
//#endregion
|
|
2969
3620
|
//#region src/components/dialog.tsx
|
|
3621
|
+
/**
|
|
3622
|
+
* Root of the dialog, wrapping Base UI's `Dialog.Root`. Manages open/close state and renders no DOM
|
|
3623
|
+
* element — place `DialogTrigger` and `DialogContent` inside it.
|
|
3624
|
+
*
|
|
3625
|
+
* @example
|
|
3626
|
+
* ```tsx
|
|
3627
|
+
* <Dialog>
|
|
3628
|
+
* <DialogTrigger render={<Button />}>Open</DialogTrigger>
|
|
3629
|
+
* <DialogContent>
|
|
3630
|
+
* <DialogHeader>
|
|
3631
|
+
* <DialogTitle>Title</DialogTitle>
|
|
3632
|
+
* <DialogDescription>Description</DialogDescription>
|
|
3633
|
+
* </DialogHeader>
|
|
3634
|
+
* </DialogContent>
|
|
3635
|
+
* </Dialog>
|
|
3636
|
+
* ```
|
|
3637
|
+
*/
|
|
2970
3638
|
function Dialog(componentProps) {
|
|
2971
3639
|
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
2972
3640
|
"data-slot": "dialog",
|
|
2973
3641
|
...componentProps
|
|
2974
3642
|
});
|
|
2975
3643
|
}
|
|
3644
|
+
/**
|
|
3645
|
+
* Button that opens the dialog, wrapping Base UI's `Dialog.Trigger`. Renders a `<button>` by
|
|
3646
|
+
* default (override with `render`).
|
|
3647
|
+
*/
|
|
2976
3648
|
const DialogTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
2977
3649
|
const { ...props } = componentProps;
|
|
2978
3650
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
@@ -2982,12 +3654,20 @@ const DialogTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2982
3654
|
});
|
|
2983
3655
|
});
|
|
2984
3656
|
DialogTrigger.displayName = "DialogTrigger";
|
|
3657
|
+
/**
|
|
3658
|
+
* Portals dialog content into the document body, wrapping Base UI's `Dialog.Portal`. Renders no DOM
|
|
3659
|
+
* element of its own.
|
|
3660
|
+
*/
|
|
2985
3661
|
function DialogPortal(componentProps) {
|
|
2986
3662
|
return /* @__PURE__ */ jsx(Dialog$1.Portal, {
|
|
2987
3663
|
"data-slot": "dialog-portal",
|
|
2988
3664
|
...componentProps
|
|
2989
3665
|
});
|
|
2990
3666
|
}
|
|
3667
|
+
/**
|
|
3668
|
+
* Button that closes the dialog, wrapping Base UI's `Dialog.Close`. Renders a `<button>` by default
|
|
3669
|
+
* (override with `render`).
|
|
3670
|
+
*/
|
|
2991
3671
|
const DialogClose = React.forwardRef((componentProps, forwardRef) => {
|
|
2992
3672
|
const { ...props } = componentProps;
|
|
2993
3673
|
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
@@ -2997,6 +3677,10 @@ const DialogClose = React.forwardRef((componentProps, forwardRef) => {
|
|
|
2997
3677
|
});
|
|
2998
3678
|
});
|
|
2999
3679
|
DialogClose.displayName = "DialogClose";
|
|
3680
|
+
/**
|
|
3681
|
+
* Dimming backdrop rendered behind the dialog, wrapping Base UI's `Dialog.Backdrop`. Renders a
|
|
3682
|
+
* fixed, full-viewport `<div>`. Included automatically by `DialogContent`.
|
|
3683
|
+
*/
|
|
3000
3684
|
const DialogOverlay = React.forwardRef((componentProps, forwardRef) => {
|
|
3001
3685
|
const { className, ...props } = componentProps;
|
|
3002
3686
|
return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
@@ -3007,6 +3691,10 @@ const DialogOverlay = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3007
3691
|
});
|
|
3008
3692
|
});
|
|
3009
3693
|
DialogOverlay.displayName = "DialogOverlay";
|
|
3694
|
+
/**
|
|
3695
|
+
* Centered dialog panel, wrapping Base UI's `Dialog.Popup`. Renders a fixed `<div>` and
|
|
3696
|
+
* automatically includes its own `DialogPortal` and `DialogOverlay`.
|
|
3697
|
+
*/
|
|
3010
3698
|
const DialogContent = React.forwardRef((componentProps, forwardRef) => {
|
|
3011
3699
|
const { className, children, showCloseButton = true, ...props } = componentProps;
|
|
3012
3700
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
@@ -3029,6 +3717,10 @@ const DialogContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3029
3717
|
})] });
|
|
3030
3718
|
});
|
|
3031
3719
|
DialogContent.displayName = "DialogContent";
|
|
3720
|
+
/**
|
|
3721
|
+
* Header region of a dialog, grouping the title and description. Renders a
|
|
3722
|
+
* `<div data-slot="dialog-header">` stacking its children vertically.
|
|
3723
|
+
*/
|
|
3032
3724
|
const DialogHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
3033
3725
|
const { className, ...props } = componentProps;
|
|
3034
3726
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -3039,6 +3731,10 @@ const DialogHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3039
3731
|
});
|
|
3040
3732
|
});
|
|
3041
3733
|
DialogHeader.displayName = "DialogHeader";
|
|
3734
|
+
/**
|
|
3735
|
+
* Footer region of a dialog for action buttons. Renders a `<div data-slot="dialog-footer">` that
|
|
3736
|
+
* right-aligns its children on larger screens.
|
|
3737
|
+
*/
|
|
3042
3738
|
const DialogFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
3043
3739
|
const { className, showCloseButton = false, children, ...props } = componentProps;
|
|
3044
3740
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3053,6 +3749,10 @@ const DialogFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3053
3749
|
});
|
|
3054
3750
|
});
|
|
3055
3751
|
DialogFooter.displayName = "DialogFooter";
|
|
3752
|
+
/**
|
|
3753
|
+
* Accessible title of the dialog, wrapping Base UI's `Dialog.Title`. Renders an `<h2>` and is
|
|
3754
|
+
* announced by screen readers as the dialog's label.
|
|
3755
|
+
*/
|
|
3056
3756
|
const DialogTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
3057
3757
|
const { className, ...props } = componentProps;
|
|
3058
3758
|
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
@@ -3063,6 +3763,10 @@ const DialogTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3063
3763
|
});
|
|
3064
3764
|
});
|
|
3065
3765
|
DialogTitle.displayName = "DialogTitle";
|
|
3766
|
+
/**
|
|
3767
|
+
* Accessible supporting text for the dialog, wrapping Base UI's `Dialog.Description`. Renders a
|
|
3768
|
+
* `<p>` and is associated with the dialog for screen readers.
|
|
3769
|
+
*/
|
|
3066
3770
|
const DialogDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
3067
3771
|
const { className, ...props } = componentProps;
|
|
3068
3772
|
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
@@ -3076,6 +3780,23 @@ DialogDescription.displayName = "DialogDescription";
|
|
|
3076
3780
|
|
|
3077
3781
|
//#endregion
|
|
3078
3782
|
//#region src/components/command.tsx
|
|
3783
|
+
/**
|
|
3784
|
+
* Root of a command menu (fast, filterable list of commands built on `cmdk`).
|
|
3785
|
+
* Renders a `<div>` container that holds the input, list, groups, and items.
|
|
3786
|
+
*
|
|
3787
|
+
* @example
|
|
3788
|
+
* ```tsx
|
|
3789
|
+
* <Command>
|
|
3790
|
+
* <CommandInput placeholder="Type a command..." />
|
|
3791
|
+
* <CommandList>
|
|
3792
|
+
* <CommandEmpty>No results found.</CommandEmpty>
|
|
3793
|
+
* <CommandGroup heading="Suggestions">
|
|
3794
|
+
* <CommandItem>Calendar</CommandItem>
|
|
3795
|
+
* </CommandGroup>
|
|
3796
|
+
* </CommandList>
|
|
3797
|
+
* </Command>
|
|
3798
|
+
* ```
|
|
3799
|
+
*/
|
|
3079
3800
|
const Command = React.forwardRef((componentProps, forwardRef) => {
|
|
3080
3801
|
const { className, ...props } = componentProps;
|
|
3081
3802
|
return /* @__PURE__ */ jsx(Command$1, {
|
|
@@ -3086,6 +3807,25 @@ const Command = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3086
3807
|
});
|
|
3087
3808
|
});
|
|
3088
3809
|
Command.displayName = "Command";
|
|
3810
|
+
/**
|
|
3811
|
+
* A `Command` menu rendered inside a modal `Dialog` — the command-palette
|
|
3812
|
+
* pattern. Renders no DOM element of its own; the visually hidden title and
|
|
3813
|
+
* description keep it accessible.
|
|
3814
|
+
*
|
|
3815
|
+
* @prop title - Screen-reader-only dialog title. Default: `'Command Palette'`.
|
|
3816
|
+
* @prop description - Screen-reader-only dialog description.
|
|
3817
|
+
* Default: `'Search for a command to run...'`.
|
|
3818
|
+
*
|
|
3819
|
+
* @example
|
|
3820
|
+
* ```tsx
|
|
3821
|
+
* <CommandDialog open={open} onOpenChange={setOpen}>
|
|
3822
|
+
* <CommandInput placeholder="Type a command..." />
|
|
3823
|
+
* <CommandList>
|
|
3824
|
+
* <CommandItem>Profile</CommandItem>
|
|
3825
|
+
* </CommandList>
|
|
3826
|
+
* </CommandDialog>
|
|
3827
|
+
* ```
|
|
3828
|
+
*/
|
|
3089
3829
|
function CommandDialog(componentProps) {
|
|
3090
3830
|
const { title = "Command Palette", description = "Search for a command to run...", children, ...props } = componentProps;
|
|
3091
3831
|
return /* @__PURE__ */ jsxs(Dialog, {
|
|
@@ -3102,6 +3842,10 @@ function CommandDialog(componentProps) {
|
|
|
3102
3842
|
})]
|
|
3103
3843
|
});
|
|
3104
3844
|
}
|
|
3845
|
+
/**
|
|
3846
|
+
* The search field that filters the command list as the user types. Renders an
|
|
3847
|
+
* `<input>` inside a `<div>` wrapper with a leading search icon.
|
|
3848
|
+
*/
|
|
3105
3849
|
const CommandInput = React.forwardRef((componentProps, forwardRef) => {
|
|
3106
3850
|
const { className, ...props } = componentProps;
|
|
3107
3851
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3116,6 +3860,10 @@ const CommandInput = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3116
3860
|
});
|
|
3117
3861
|
});
|
|
3118
3862
|
CommandInput.displayName = "CommandInput";
|
|
3863
|
+
/**
|
|
3864
|
+
* Scrollable container holding the command groups, items, and empty state.
|
|
3865
|
+
* Renders a `<div>` that scrolls vertically when content overflows.
|
|
3866
|
+
*/
|
|
3119
3867
|
const CommandList = React.forwardRef((componentProps, forwardRef) => {
|
|
3120
3868
|
const { className, ...props } = componentProps;
|
|
3121
3869
|
return /* @__PURE__ */ jsx(Command$1.List, {
|
|
@@ -3126,6 +3874,10 @@ const CommandList = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3126
3874
|
});
|
|
3127
3875
|
});
|
|
3128
3876
|
CommandList.displayName = "CommandList";
|
|
3877
|
+
/**
|
|
3878
|
+
* Message shown when the current search matches no items. Renders a centered
|
|
3879
|
+
* `<div>` that is only visible when the list is empty.
|
|
3880
|
+
*/
|
|
3129
3881
|
const CommandEmpty = React.forwardRef((componentProps, forwardRef) => {
|
|
3130
3882
|
const { ...props } = componentProps;
|
|
3131
3883
|
return /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
@@ -3136,6 +3888,10 @@ const CommandEmpty = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3136
3888
|
});
|
|
3137
3889
|
});
|
|
3138
3890
|
CommandEmpty.displayName = "CommandEmpty";
|
|
3891
|
+
/**
|
|
3892
|
+
* Groups related command items under an optional `heading`. Renders a `<div>`
|
|
3893
|
+
* that hides itself when none of its items match the search.
|
|
3894
|
+
*/
|
|
3139
3895
|
const CommandGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
3140
3896
|
const { className, ...props } = componentProps;
|
|
3141
3897
|
return /* @__PURE__ */ jsx(Command$1.Group, {
|
|
@@ -3146,6 +3902,10 @@ const CommandGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3146
3902
|
});
|
|
3147
3903
|
});
|
|
3148
3904
|
CommandGroup.displayName = "CommandGroup";
|
|
3905
|
+
/**
|
|
3906
|
+
* A thin horizontal divider between command groups or items. Renders a `<div>`
|
|
3907
|
+
* one pixel tall.
|
|
3908
|
+
*/
|
|
3149
3909
|
const CommandSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
3150
3910
|
const { className, ...props } = componentProps;
|
|
3151
3911
|
return /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
@@ -3156,6 +3916,10 @@ const CommandSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3156
3916
|
});
|
|
3157
3917
|
});
|
|
3158
3918
|
CommandSeparator.displayName = "CommandSeparator";
|
|
3919
|
+
/**
|
|
3920
|
+
* A single selectable command in the list. Renders a `<div>` that highlights on
|
|
3921
|
+
* hover/keyboard selection and can be disabled.
|
|
3922
|
+
*/
|
|
3159
3923
|
const CommandItem = React.forwardRef((componentProps, forwardRef) => {
|
|
3160
3924
|
const { className, ...props } = componentProps;
|
|
3161
3925
|
return /* @__PURE__ */ jsx(Command$1.Item, {
|
|
@@ -3166,6 +3930,10 @@ const CommandItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3166
3930
|
});
|
|
3167
3931
|
});
|
|
3168
3932
|
CommandItem.displayName = "CommandItem";
|
|
3933
|
+
/**
|
|
3934
|
+
* Right-aligned hint displaying an item's keyboard shortcut. Renders a `<span>`
|
|
3935
|
+
* with muted, spaced-out text.
|
|
3936
|
+
*/
|
|
3169
3937
|
const CommandShortcut = React.forwardRef((componentProps, forwardRef) => {
|
|
3170
3938
|
const { className, ...props } = componentProps;
|
|
3171
3939
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -3185,6 +3953,18 @@ const sizeMap = {
|
|
|
3185
3953
|
lg: "size-5",
|
|
3186
3954
|
xl: "size-6"
|
|
3187
3955
|
};
|
|
3956
|
+
/**
|
|
3957
|
+
* Renders the flag icon for a given country as an inline `<svg>`.
|
|
3958
|
+
* Falls back to the US flag when the ISO code has no matching flag.
|
|
3959
|
+
*
|
|
3960
|
+
* @prop countryIsoCode - ISO country code selecting the flag to render.
|
|
3961
|
+
* @prop size - Flag dimensions: `sm` (12px) | `md` (16px) | `lg` (20px) | `xl` (24px). Default: `'xl'`.
|
|
3962
|
+
*
|
|
3963
|
+
* @example
|
|
3964
|
+
* ```tsx
|
|
3965
|
+
* <CountryFlag countryIsoCode="FR" size="md" />
|
|
3966
|
+
* ```
|
|
3967
|
+
*/
|
|
3188
3968
|
const CountryFlag = React.forwardRef((componentProps, forwardRef) => {
|
|
3189
3969
|
const { countryIsoCode, size = "xl", className, ...otherProps } = componentProps;
|
|
3190
3970
|
return /* @__PURE__ */ jsx(FLAGS[countryIsoCode.toLowerCase()] ?? FlagUs, {
|
|
@@ -3197,6 +3977,15 @@ CountryFlag.displayName = "CountryFlag";
|
|
|
3197
3977
|
|
|
3198
3978
|
//#endregion
|
|
3199
3979
|
//#region src/components/skeleton.tsx
|
|
3980
|
+
/**
|
|
3981
|
+
* Pulsing placeholder shown while content is loading. Renders a `<div>`;
|
|
3982
|
+
* set its dimensions via `className` to match the content it stands in for.
|
|
3983
|
+
*
|
|
3984
|
+
* @example
|
|
3985
|
+
* ```tsx
|
|
3986
|
+
* <Skeleton className="h-4 w-32" />
|
|
3987
|
+
* ```
|
|
3988
|
+
*/
|
|
3200
3989
|
const Skeleton = React.forwardRef((componentProps, forwardRef) => {
|
|
3201
3990
|
const { className, ...props } = componentProps;
|
|
3202
3991
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -3279,6 +4068,23 @@ function useFetchMoreSentinel(onFetchMore, getRoot, resetKey) {
|
|
|
3279
4068
|
//#region src/components/data-combobox.tsx
|
|
3280
4069
|
const DEFAULT_SKELETON_COUNT$1 = 5;
|
|
3281
4070
|
const EMPTY_KEYS$1 = /* @__PURE__ */ new Set();
|
|
4071
|
+
/**
|
|
4072
|
+
* Searchable dropdown built on the DS Combobox primitives, driven by an `items`
|
|
4073
|
+
* array plus `getItemValue`/`getItemLabel`. Renders an inline input (single) or
|
|
4074
|
+
* a removable-chips field (multiple) — or a custom `trigger` — anchoring a popup
|
|
4075
|
+
* list, with opt-in server-side search, grouping, infinite scroll, and
|
|
4076
|
+
* loading/empty states.
|
|
4077
|
+
*
|
|
4078
|
+
* @example
|
|
4079
|
+
* ```tsx
|
|
4080
|
+
* <DataCombobox
|
|
4081
|
+
* items={users}
|
|
4082
|
+
* getItemValue={user => user.id}
|
|
4083
|
+
* getItemLabel={user => user.name}
|
|
4084
|
+
* onSelectionChange={setSelectedKeys}
|
|
4085
|
+
* />
|
|
4086
|
+
* ```
|
|
4087
|
+
*/
|
|
3282
4088
|
function DataCombobox(componentProps) {
|
|
3283
4089
|
const { items, getItemValue, getItemLabel, renderItem, renderChip, getGroupKey, getGroupLabel, selectionMode = "single", selectedKeys, defaultSelectedKeys, onSelectionChange, onOpenChange, selectedItems, disabledKeys, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT$1, onSearch, onFetchMore, hasMore = false, emptyState, trigger, searchable = true, placeholder, disabled = false, className, contentClassName, "aria-label": ariaLabel } = componentProps;
|
|
3284
4090
|
const t = useDsTranslation("ds");
|
|
@@ -3439,6 +4245,25 @@ function ComboboxSkeleton({ count }) {
|
|
|
3439
4245
|
|
|
3440
4246
|
//#endregion
|
|
3441
4247
|
//#region src/components/table.tsx
|
|
4248
|
+
/**
|
|
4249
|
+
* Root data table. Renders a `<table>` inside a scrollable, bordered `<div>` container.
|
|
4250
|
+
*
|
|
4251
|
+
* @example
|
|
4252
|
+
* ```tsx
|
|
4253
|
+
* <Table>
|
|
4254
|
+
* <TableHeader>
|
|
4255
|
+
* <TableRow>
|
|
4256
|
+
* <TableHead>Name</TableHead>
|
|
4257
|
+
* </TableRow>
|
|
4258
|
+
* </TableHeader>
|
|
4259
|
+
* <TableBody>
|
|
4260
|
+
* <TableRow>
|
|
4261
|
+
* <TableCell>Ada</TableCell>
|
|
4262
|
+
* </TableRow>
|
|
4263
|
+
* </TableBody>
|
|
4264
|
+
* </Table>
|
|
4265
|
+
* ```
|
|
4266
|
+
*/
|
|
3442
4267
|
const Table = React.forwardRef((componentProps, forwardRef) => {
|
|
3443
4268
|
const { className, containerClassName, containerStyle, containerRef, ...props } = componentProps;
|
|
3444
4269
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -3455,6 +4280,7 @@ const Table = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3455
4280
|
});
|
|
3456
4281
|
});
|
|
3457
4282
|
Table.displayName = "Table";
|
|
4283
|
+
/** Table header section. Renders a `<thead>`; place `TableRow`/`TableHead` inside it. */
|
|
3458
4284
|
const TableHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
3459
4285
|
const { className, ...props } = componentProps;
|
|
3460
4286
|
return /* @__PURE__ */ jsx("thead", {
|
|
@@ -3465,6 +4291,7 @@ const TableHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3465
4291
|
});
|
|
3466
4292
|
});
|
|
3467
4293
|
TableHeader.displayName = "TableHeader";
|
|
4294
|
+
/** Table body section. Renders a `<tbody>` holding the data `TableRow`s. */
|
|
3468
4295
|
const TableBody = React.forwardRef((componentProps, forwardRef) => {
|
|
3469
4296
|
const { className, ...props } = componentProps;
|
|
3470
4297
|
return /* @__PURE__ */ jsx("tbody", {
|
|
@@ -3475,6 +4302,7 @@ const TableBody = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3475
4302
|
});
|
|
3476
4303
|
});
|
|
3477
4304
|
TableBody.displayName = "TableBody";
|
|
4305
|
+
/** Table footer section. Renders a muted `<tfoot>`, e.g. for totals or summary rows. */
|
|
3478
4306
|
const TableFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
3479
4307
|
const { className, ...props } = componentProps;
|
|
3480
4308
|
return /* @__PURE__ */ jsx("tfoot", {
|
|
@@ -3485,6 +4313,7 @@ const TableFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3485
4313
|
});
|
|
3486
4314
|
});
|
|
3487
4315
|
TableFooter.displayName = "TableFooter";
|
|
4316
|
+
/** A single table row. Renders a `<tr>`; highlights on hover and when `data-state="selected"`. */
|
|
3488
4317
|
const TableRow = React.forwardRef((componentProps, forwardRef) => {
|
|
3489
4318
|
const { className, ...props } = componentProps;
|
|
3490
4319
|
return /* @__PURE__ */ jsx("tr", {
|
|
@@ -3495,6 +4324,7 @@ const TableRow = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3495
4324
|
});
|
|
3496
4325
|
});
|
|
3497
4326
|
TableRow.displayName = "TableRow";
|
|
4327
|
+
/** A header cell. Renders a `<th>` with medium-weight, left-aligned text. */
|
|
3498
4328
|
const TableHead = React.forwardRef((componentProps, forwardRef) => {
|
|
3499
4329
|
const { className, ...props } = componentProps;
|
|
3500
4330
|
return /* @__PURE__ */ jsx("th", {
|
|
@@ -3505,6 +4335,7 @@ const TableHead = React.forwardRef((componentProps, forwardRef) => {
|
|
|
3505
4335
|
});
|
|
3506
4336
|
});
|
|
3507
4337
|
TableHead.displayName = "TableHead";
|
|
4338
|
+
/** A data cell. Renders a `<td>` with middle-aligned content. */
|
|
3508
4339
|
const TableCell = React.forwardRef((componentProps, forwardRef) => {
|
|
3509
4340
|
const { className, ...props } = componentProps;
|
|
3510
4341
|
return /* @__PURE__ */ jsx("td", {
|
|
@@ -3521,6 +4352,21 @@ TableCell.displayName = "TableCell";
|
|
|
3521
4352
|
const SELECT_COLUMN_ID = "__select";
|
|
3522
4353
|
const DEFAULT_SKELETON_COUNT = 5;
|
|
3523
4354
|
const EMPTY_KEYS = /* @__PURE__ */ new Set();
|
|
4355
|
+
/**
|
|
4356
|
+
* Data grid built on TanStack Table. Renders a `<div>` wrapper around a DS
|
|
4357
|
+
* `<Table>` (`<table>`), driven by `columns` + `data`, with opt-in sorting,
|
|
4358
|
+
* row selection, column resizing, virtualization, infinite scroll, a floating
|
|
4359
|
+
* action bar, and loading/empty states.
|
|
4360
|
+
*
|
|
4361
|
+
* @example
|
|
4362
|
+
* ```tsx
|
|
4363
|
+
* <DataTable
|
|
4364
|
+
* columns={columns}
|
|
4365
|
+
* data={rows}
|
|
4366
|
+
* getRowId={row => row.id}
|
|
4367
|
+
* />
|
|
4368
|
+
* ```
|
|
4369
|
+
*/
|
|
3524
4370
|
function DataTable(componentProps) {
|
|
3525
4371
|
const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, fixedLayout = false, onRowClick, className } = componentProps;
|
|
3526
4372
|
const sortingEnabled = !!onSortingChange;
|
|
@@ -3810,6 +4656,24 @@ const TreeContext = React.createContext({
|
|
|
3810
4656
|
function useTreeContext() {
|
|
3811
4657
|
return React.useContext(TreeContext);
|
|
3812
4658
|
}
|
|
4659
|
+
/**
|
|
4660
|
+
* Root tree container. Renders a flex-column `<div>` and provides the tree
|
|
4661
|
+
* context (indentation + the `useTree` instance) to the rows inside it.
|
|
4662
|
+
*
|
|
4663
|
+
* @example
|
|
4664
|
+
* ```tsx
|
|
4665
|
+
* const tree = useTree<Item>({ ... });
|
|
4666
|
+
* return (
|
|
4667
|
+
* <Tree indent={20} tree={tree}>
|
|
4668
|
+
* {tree.getItems().map(item => (
|
|
4669
|
+
* <TreeItem key={item.getId()} item={item}>
|
|
4670
|
+
* <TreeItemLabel />
|
|
4671
|
+
* </TreeItem>
|
|
4672
|
+
* ))}
|
|
4673
|
+
* </Tree>
|
|
4674
|
+
* );
|
|
4675
|
+
* ```
|
|
4676
|
+
*/
|
|
3813
4677
|
function Tree({ indent = 20, tree, className, ...props }) {
|
|
3814
4678
|
const containerProps = tree && typeof tree.getContainerProps === "function" ? tree.getContainerProps() : {};
|
|
3815
4679
|
const { style: propStyle, ...otherProps } = {
|
|
@@ -3838,6 +4702,11 @@ const ACTIVATION_KEYS = new Set([
|
|
|
3838
4702
|
" ",
|
|
3839
4703
|
"Spacebar"
|
|
3840
4704
|
]);
|
|
4705
|
+
/**
|
|
4706
|
+
* A full-width, highlightable tree row. Renders a `<div role="treeitem">` so a
|
|
4707
|
+
* leading control (e.g. a selection `Checkbox`) shares the row's hover/selected
|
|
4708
|
+
* highlight; drives activation for both mouse and keyboard.
|
|
4709
|
+
*/
|
|
3841
4710
|
function TreeItem({ item, className, children, onActivate, onClick: userOnClick, onKeyDown: userOnKeyDown, style: userStyle, ...props }) {
|
|
3842
4711
|
const { indent } = useTreeContext();
|
|
3843
4712
|
const { style: itemStyle, onClick: _headlessOnClick, ...restItemProps } = typeof item.getProps === "function" ? item.getProps() : {};
|
|
@@ -3892,6 +4761,11 @@ function TreeItem({ item, className, children, onActivate, onClick: userOnClick,
|
|
|
3892
4761
|
})
|
|
3893
4762
|
});
|
|
3894
4763
|
}
|
|
4764
|
+
/**
|
|
4765
|
+
* A tree row's label. Renders a `<span>` with a fixed-width chevron expand
|
|
4766
|
+
* button for folders (or an aligned spacer for leaves) followed by the label
|
|
4767
|
+
* content, falling back to the item's name.
|
|
4768
|
+
*/
|
|
3895
4769
|
function TreeItemLabel({ item: propItem, children, className, ...props }) {
|
|
3896
4770
|
const { currentItem } = useTreeContext();
|
|
3897
4771
|
const t = useDsTranslation("ds");
|
|
@@ -3924,6 +4798,10 @@ function TreeItemLabel({ item: propItem, children, className, ...props }) {
|
|
|
3924
4798
|
}), children || (typeof item.getItemName === "function" ? item.getItemName() : null)]
|
|
3925
4799
|
});
|
|
3926
4800
|
}
|
|
4801
|
+
/**
|
|
4802
|
+
* Drag-and-drop drop indicator. Renders a positioned `<div>` line using the
|
|
4803
|
+
* tree instance's `getDragLineStyle()`; renders nothing when no tree is in context.
|
|
4804
|
+
*/
|
|
3927
4805
|
function TreeDragLine({ className, ...props }) {
|
|
3928
4806
|
const { tree } = useTreeContext();
|
|
3929
4807
|
if (!tree || typeof tree.getDragLineStyle !== "function") {
|
|
@@ -3965,6 +4843,23 @@ function buildIndex(items, getKey, getChildren) {
|
|
|
3965
4843
|
roots: walk(items)
|
|
3966
4844
|
};
|
|
3967
4845
|
}
|
|
4846
|
+
/**
|
|
4847
|
+
* Data-driven tree. Builds and owns the `useTree` state from nested `items` and
|
|
4848
|
+
* renders a `Tree` of `TreeItem`/`TreeItemLabel` rows (with optional icons and
|
|
4849
|
+
* selection checkboxes) — the batteries-included alternative to composing `Tree`
|
|
4850
|
+
* by hand.
|
|
4851
|
+
*
|
|
4852
|
+
* @example
|
|
4853
|
+
* ```tsx
|
|
4854
|
+
* <DataTree
|
|
4855
|
+
* items={data}
|
|
4856
|
+
* getKey={node => node.id}
|
|
4857
|
+
* getLabel={node => node.name}
|
|
4858
|
+
* getChildren={node => node.children}
|
|
4859
|
+
* selectionMode="multiple"
|
|
4860
|
+
* />
|
|
4861
|
+
* ```
|
|
4862
|
+
*/
|
|
3968
4863
|
function DataTree(componentProps) {
|
|
3969
4864
|
const { items, getKey, getLabel, getChildren, getIcon, getTextValue, selectionMode = "none", selectedKeys, defaultSelectedKeys = [], onSelectionChange, expandedKeys, defaultExpandedKeys = [], onExpandedChange, indent = 20, className, "aria-label": ariaLabel } = componentProps;
|
|
3970
4865
|
const selectable = selectionMode !== "none";
|
|
@@ -4063,7 +4958,29 @@ const directionMap = {
|
|
|
4063
4958
|
right: "right",
|
|
4064
4959
|
top: "up"
|
|
4065
4960
|
};
|
|
4961
|
+
/**
|
|
4962
|
+
* Re-export of Coss UI's `Drawer.createHandle`. Creates an imperative handle
|
|
4963
|
+
* that can be passed to `Drawer`'s `handle` prop to open/close it programmatically.
|
|
4964
|
+
*/
|
|
4066
4965
|
const DrawerCreateHandle = DrawerPrimitive.createHandle;
|
|
4966
|
+
/**
|
|
4967
|
+
* Root container for a swipeable drawer (Coss UI's `Drawer.Root`), also
|
|
4968
|
+
* providing drawer `position` via context to its parts. Renders no DOM element
|
|
4969
|
+
* — place `DrawerTrigger` and `DrawerPopup` inside it.
|
|
4970
|
+
*
|
|
4971
|
+
* @example
|
|
4972
|
+
* ```tsx
|
|
4973
|
+
* <Drawer position="right">
|
|
4974
|
+
* <DrawerTrigger render={<Button />}>Open</DrawerTrigger>
|
|
4975
|
+
* <DrawerPopup showCloseButton>
|
|
4976
|
+
* <DrawerHeader>
|
|
4977
|
+
* <DrawerTitle>Title</DrawerTitle>
|
|
4978
|
+
* </DrawerHeader>
|
|
4979
|
+
* <DrawerPanel>Body content</DrawerPanel>
|
|
4980
|
+
* </DrawerPopup>
|
|
4981
|
+
* </Drawer>
|
|
4982
|
+
* ```
|
|
4983
|
+
*/
|
|
4067
4984
|
function Drawer({ swipeDirection, position = "bottom", ...props }) {
|
|
4068
4985
|
return /* @__PURE__ */ jsx(DrawerContext.Provider, {
|
|
4069
4986
|
value: { position },
|
|
@@ -4073,7 +4990,15 @@ function Drawer({ swipeDirection, position = "bottom", ...props }) {
|
|
|
4073
4990
|
})
|
|
4074
4991
|
});
|
|
4075
4992
|
}
|
|
4993
|
+
/**
|
|
4994
|
+
* Re-export of Coss UI's `Drawer.Portal`. Renders the drawer into a different
|
|
4995
|
+
* part of the DOM (or a `container`); renders no DOM element of its own.
|
|
4996
|
+
*/
|
|
4076
4997
|
const DrawerPortal = DrawerPrimitive.Portal;
|
|
4998
|
+
/**
|
|
4999
|
+
* The element that opens the drawer, wrapping `Drawer.Trigger`.
|
|
5000
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
5001
|
+
*/
|
|
4077
5002
|
const DrawerTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
4078
5003
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Trigger, {
|
|
4079
5004
|
ref: forwardRef,
|
|
@@ -4082,6 +5007,10 @@ const DrawerTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4082
5007
|
});
|
|
4083
5008
|
});
|
|
4084
5009
|
DrawerTrigger.displayName = "DrawerTrigger";
|
|
5010
|
+
/**
|
|
5011
|
+
* An element that closes the drawer when activated, wrapping `Drawer.Close`.
|
|
5012
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
5013
|
+
*/
|
|
4085
5014
|
const DrawerClose = React.forwardRef((componentProps, forwardRef) => {
|
|
4086
5015
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Close, {
|
|
4087
5016
|
ref: forwardRef,
|
|
@@ -4090,6 +5019,11 @@ const DrawerClose = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4090
5019
|
});
|
|
4091
5020
|
});
|
|
4092
5021
|
DrawerClose.displayName = "DrawerClose";
|
|
5022
|
+
/**
|
|
5023
|
+
* Edge-anchored gesture zone that opens the drawer on swipe, wrapping
|
|
5024
|
+
* `Drawer.SwipeArea`. Renders a fixed, touch-only `<div>` pinned to the side
|
|
5025
|
+
* matching `position`.
|
|
5026
|
+
*/
|
|
4093
5027
|
const DrawerSwipeArea = React.forwardRef((componentProps, forwardRef) => {
|
|
4094
5028
|
const { className, position: positionProp, ...props } = componentProps;
|
|
4095
5029
|
const { position: contextPosition } = useContext(DrawerContext);
|
|
@@ -4102,6 +5036,10 @@ const DrawerSwipeArea = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4102
5036
|
});
|
|
4103
5037
|
});
|
|
4104
5038
|
DrawerSwipeArea.displayName = "DrawerSwipeArea";
|
|
5039
|
+
/**
|
|
5040
|
+
* Dimmed, blurred overlay rendered behind the drawer, wrapping
|
|
5041
|
+
* `Drawer.Backdrop`. Renders a `<div>` whose opacity tracks the swipe progress.
|
|
5042
|
+
*/
|
|
4105
5043
|
const DrawerBackdrop = React.forwardRef((componentProps, forwardRef) => {
|
|
4106
5044
|
const { className, inContainer, ...props } = componentProps;
|
|
4107
5045
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Backdrop, {
|
|
@@ -4112,6 +5050,11 @@ const DrawerBackdrop = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4112
5050
|
});
|
|
4113
5051
|
});
|
|
4114
5052
|
DrawerBackdrop.displayName = "DrawerBackdrop";
|
|
5053
|
+
/**
|
|
5054
|
+
* Full-screen layout container that positions the drawer popup along the chosen
|
|
5055
|
+
* edge, wrapping `Drawer.Viewport`. Renders a `<div>` (fixed, or `absolute` when
|
|
5056
|
+
* portalled into a `container`).
|
|
5057
|
+
*/
|
|
4115
5058
|
const DrawerViewport = React.forwardRef((componentProps, forwardRef) => {
|
|
4116
5059
|
const { className, position, variant = "default", inContainer, ...props } = componentProps;
|
|
4117
5060
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Viewport, {
|
|
@@ -4122,6 +5065,12 @@ const DrawerViewport = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4122
5065
|
});
|
|
4123
5066
|
});
|
|
4124
5067
|
DrawerViewport.displayName = "DrawerViewport";
|
|
5068
|
+
/**
|
|
5069
|
+
* Body wrapper of the drawer: composes `DrawerPortal → DrawerBackdrop →
|
|
5070
|
+
* DrawerViewport` around `Drawer.Popup` and renders the sliding `<div>` panel
|
|
5071
|
+
* that holds the drawer content. This is the primary content container placed
|
|
5072
|
+
* inside `Drawer`.
|
|
5073
|
+
*/
|
|
4125
5074
|
const DrawerPopup = React.forwardRef((componentProps, forwardRef) => {
|
|
4126
5075
|
const { className, children, showCloseButton = false, position: positionProp, variant = "default", showBar = false, container, ...props } = componentProps;
|
|
4127
5076
|
const t = useDsTranslation("ds");
|
|
@@ -4157,6 +5106,10 @@ const DrawerPopup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4157
5106
|
});
|
|
4158
5107
|
});
|
|
4159
5108
|
DrawerPopup.displayName = "DrawerPopup";
|
|
5109
|
+
/**
|
|
5110
|
+
* Header region of the drawer, typically holding the title and description.
|
|
5111
|
+
* Renders a `<div>` (or the `render` element).
|
|
5112
|
+
*/
|
|
4160
5113
|
const DrawerHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
4161
5114
|
const { className, allowSelection = false, render, ...props } = componentProps;
|
|
4162
5115
|
return useRender({
|
|
@@ -4170,6 +5123,10 @@ const DrawerHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4170
5123
|
});
|
|
4171
5124
|
});
|
|
4172
5125
|
DrawerHeader.displayName = "DrawerHeader";
|
|
5126
|
+
/**
|
|
5127
|
+
* Footer region of the drawer, typically holding actions.
|
|
5128
|
+
* Renders a `<div>` (or the `render` element).
|
|
5129
|
+
*/
|
|
4173
5130
|
const DrawerFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
4174
5131
|
const { className, variant = "default", allowSelection = true, render, ...props } = componentProps;
|
|
4175
5132
|
return useRender({
|
|
@@ -4183,6 +5140,10 @@ const DrawerFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4183
5140
|
});
|
|
4184
5141
|
});
|
|
4185
5142
|
DrawerFooter.displayName = "DrawerFooter";
|
|
5143
|
+
/**
|
|
5144
|
+
* Accessible title for the drawer, wrapping `Drawer.Title`.
|
|
5145
|
+
* Renders an `<h2>` and labels the drawer for assistive technology.
|
|
5146
|
+
*/
|
|
4186
5147
|
const DrawerTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
4187
5148
|
const { className, ...props } = componentProps;
|
|
4188
5149
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Title, {
|
|
@@ -4193,6 +5154,10 @@ const DrawerTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4193
5154
|
});
|
|
4194
5155
|
});
|
|
4195
5156
|
DrawerTitle.displayName = "DrawerTitle";
|
|
5157
|
+
/**
|
|
5158
|
+
* Accessible supporting text for the drawer, wrapping `Drawer.Description`.
|
|
5159
|
+
* Renders a `<p>` and describes the drawer for assistive technology.
|
|
5160
|
+
*/
|
|
4196
5161
|
const DrawerDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
4197
5162
|
const { className, ...props } = componentProps;
|
|
4198
5163
|
return /* @__PURE__ */ jsx(DrawerPrimitive.Description, {
|
|
@@ -4203,6 +5168,10 @@ const DrawerDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4203
5168
|
});
|
|
4204
5169
|
});
|
|
4205
5170
|
DrawerDescription.displayName = "DrawerDescription";
|
|
5171
|
+
/**
|
|
5172
|
+
* Scrollable body region of the drawer holding its main content. Renders a
|
|
5173
|
+
* `<div>` (or the `render` element), by default wrapped in a `ScrollArea`.
|
|
5174
|
+
*/
|
|
4206
5175
|
const DrawerPanel = React.forwardRef((componentProps, forwardRef) => {
|
|
4207
5176
|
const { className, scrollFade = true, scrollable = true, allowSelection = true, render, ...props } = componentProps;
|
|
4208
5177
|
const content = useRender({
|
|
@@ -4222,6 +5191,10 @@ const DrawerPanel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4222
5191
|
return content;
|
|
4223
5192
|
});
|
|
4224
5193
|
DrawerPanel.displayName = "DrawerPanel";
|
|
5194
|
+
/**
|
|
5195
|
+
* Decorative drag-handle bar shown on the drawer's swipe edge.
|
|
5196
|
+
* Renders an `aria-hidden` `<div>` (or the `render` element).
|
|
5197
|
+
*/
|
|
4225
5198
|
const DrawerBar = React.forwardRef((componentProps, forwardRef) => {
|
|
4226
5199
|
const { className, position: positionProp, render, ...props } = componentProps;
|
|
4227
5200
|
const { position: contextPosition } = useContext(DrawerContext);
|
|
@@ -4239,7 +5212,16 @@ const DrawerBar = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4239
5212
|
});
|
|
4240
5213
|
});
|
|
4241
5214
|
DrawerBar.displayName = "DrawerBar";
|
|
5215
|
+
/**
|
|
5216
|
+
* Re-export of Coss UI's `Drawer.Content` — wraps a subtree so its text stays
|
|
5217
|
+
* selectable inside an otherwise non-selectable drawer part. Renders no DOM
|
|
5218
|
+
* element of its own.
|
|
5219
|
+
*/
|
|
4242
5220
|
const DrawerContent = DrawerPrimitive.Content;
|
|
5221
|
+
/**
|
|
5222
|
+
* Vertical menu container for drawer navigation items.
|
|
5223
|
+
* Renders a `<nav>` (or the `render` element).
|
|
5224
|
+
*/
|
|
4243
5225
|
const DrawerMenu = React.forwardRef((componentProps, forwardRef) => {
|
|
4244
5226
|
const { className, render, ...props } = componentProps;
|
|
4245
5227
|
return useRender({
|
|
@@ -4253,6 +5235,10 @@ const DrawerMenu = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4253
5235
|
});
|
|
4254
5236
|
});
|
|
4255
5237
|
DrawerMenu.displayName = "DrawerMenu";
|
|
5238
|
+
/**
|
|
5239
|
+
* Interactive row within a `DrawerMenu`.
|
|
5240
|
+
* Renders a `<button>` (or the `render` element).
|
|
5241
|
+
*/
|
|
4256
5242
|
const DrawerMenuItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4257
5243
|
const { className, variant = "default", render, disabled, ...props } = componentProps;
|
|
4258
5244
|
return useRender({
|
|
@@ -4269,6 +5255,10 @@ const DrawerMenuItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4269
5255
|
});
|
|
4270
5256
|
});
|
|
4271
5257
|
DrawerMenuItem.displayName = "DrawerMenuItem";
|
|
5258
|
+
/**
|
|
5259
|
+
* Thin horizontal divider between drawer menu items.
|
|
5260
|
+
* Renders a `<div>` (or the `render` element).
|
|
5261
|
+
*/
|
|
4272
5262
|
const DrawerMenuSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
4273
5263
|
const { className, render, ...props } = componentProps;
|
|
4274
5264
|
return useRender({
|
|
@@ -4282,6 +5272,10 @@ const DrawerMenuSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4282
5272
|
});
|
|
4283
5273
|
});
|
|
4284
5274
|
DrawerMenuSeparator.displayName = "DrawerMenuSeparator";
|
|
5275
|
+
/**
|
|
5276
|
+
* Groups related drawer menu items together.
|
|
5277
|
+
* Renders a `<div>` (or the `render` element).
|
|
5278
|
+
*/
|
|
4285
5279
|
const DrawerMenuGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
4286
5280
|
const { className, render, ...props } = componentProps;
|
|
4287
5281
|
return useRender({
|
|
@@ -4295,6 +5289,10 @@ const DrawerMenuGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4295
5289
|
});
|
|
4296
5290
|
});
|
|
4297
5291
|
DrawerMenuGroup.displayName = "DrawerMenuGroup";
|
|
5292
|
+
/**
|
|
5293
|
+
* Label heading for a `DrawerMenuGroup`.
|
|
5294
|
+
* Renders a `<div>` (or the `render` element).
|
|
5295
|
+
*/
|
|
4298
5296
|
const DrawerMenuGroupLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
4299
5297
|
const { className, render, ...props } = componentProps;
|
|
4300
5298
|
return useRender({
|
|
@@ -4308,6 +5306,10 @@ const DrawerMenuGroupLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4308
5306
|
});
|
|
4309
5307
|
});
|
|
4310
5308
|
DrawerMenuGroupLabel.displayName = "DrawerMenuGroupLabel";
|
|
5309
|
+
/**
|
|
5310
|
+
* Menu item that opens a (nested) drawer, wrapping `DrawerTrigger` and appending
|
|
5311
|
+
* a trailing chevron. Renders a `<button>`.
|
|
5312
|
+
*/
|
|
4311
5313
|
const DrawerMenuTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
4312
5314
|
const { className, children, ...props } = componentProps;
|
|
4313
5315
|
return /* @__PURE__ */ jsxs(DrawerTrigger, {
|
|
@@ -4319,6 +5321,10 @@ const DrawerMenuTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4319
5321
|
});
|
|
4320
5322
|
});
|
|
4321
5323
|
DrawerMenuTrigger.displayName = "DrawerMenuTrigger";
|
|
5324
|
+
/**
|
|
5325
|
+
* Drawer menu item bound to a boolean state, wrapping `Checkbox.Root`.
|
|
5326
|
+
* Renders a `<button>` with either a checkmark or a switch indicator.
|
|
5327
|
+
*/
|
|
4322
5328
|
const DrawerMenuCheckboxItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4323
5329
|
const { className, children, checked, defaultChecked, onCheckedChange, variant = "default", disabled, render, ...props } = componentProps;
|
|
4324
5330
|
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
@@ -4359,6 +5365,10 @@ const DrawerMenuCheckboxItem = React.forwardRef((componentProps, forwardRef) =>
|
|
|
4359
5365
|
});
|
|
4360
5366
|
});
|
|
4361
5367
|
DrawerMenuCheckboxItem.displayName = "DrawerMenuCheckboxItem";
|
|
5368
|
+
/**
|
|
5369
|
+
* Radio group container for exclusive selection among drawer menu items,
|
|
5370
|
+
* wrapping `RadioGroup`. Renders a `<div>`.
|
|
5371
|
+
*/
|
|
4362
5372
|
const DrawerMenuRadioGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
4363
5373
|
const { className, ...props } = componentProps;
|
|
4364
5374
|
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
@@ -4369,6 +5379,10 @@ const DrawerMenuRadioGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4369
5379
|
});
|
|
4370
5380
|
});
|
|
4371
5381
|
DrawerMenuRadioGroup.displayName = "DrawerMenuRadioGroup";
|
|
5382
|
+
/**
|
|
5383
|
+
* Selectable radio item within a `DrawerMenuRadioGroup`, wrapping `Radio.Root`.
|
|
5384
|
+
* Renders a `<button>` with a checkmark indicator when selected.
|
|
5385
|
+
*/
|
|
4372
5386
|
const DrawerMenuRadioItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4373
5387
|
const { className, children, value, disabled, render, ...props } = componentProps;
|
|
4374
5388
|
return /* @__PURE__ */ jsxs(Radio.Root, {
|
|
@@ -4403,18 +5417,43 @@ DrawerMenuRadioItem.displayName = "DrawerMenuRadioItem";
|
|
|
4403
5417
|
|
|
4404
5418
|
//#endregion
|
|
4405
5419
|
//#region src/components/dropdown-menu.tsx
|
|
5420
|
+
/**
|
|
5421
|
+
* Root container for a dropdown menu, wrapping Base UI's `Menu.Root`. Manages
|
|
5422
|
+
* open/close state and renders no DOM element — place `DropdownMenuTrigger` and
|
|
5423
|
+
* `DropdownMenuContent` inside it.
|
|
5424
|
+
*
|
|
5425
|
+
* @example
|
|
5426
|
+
* ```tsx
|
|
5427
|
+
* <DropdownMenu>
|
|
5428
|
+
* <DropdownMenuTrigger render={<Button />}>Open</DropdownMenuTrigger>
|
|
5429
|
+
* <DropdownMenuContent>
|
|
5430
|
+
* <DropdownMenuItem>Profile</DropdownMenuItem>
|
|
5431
|
+
* <DropdownMenuSeparator />
|
|
5432
|
+
* <DropdownMenuItem variant="destructive">Delete</DropdownMenuItem>
|
|
5433
|
+
* </DropdownMenuContent>
|
|
5434
|
+
* </DropdownMenu>
|
|
5435
|
+
* ```
|
|
5436
|
+
*/
|
|
4406
5437
|
function DropdownMenu(componentProps) {
|
|
4407
5438
|
return /* @__PURE__ */ jsx(Menu.Root, {
|
|
4408
5439
|
"data-slot": "dropdown-menu",
|
|
4409
5440
|
...componentProps
|
|
4410
5441
|
});
|
|
4411
5442
|
}
|
|
5443
|
+
/**
|
|
5444
|
+
* Portals the menu content into a different part of the DOM, wrapping
|
|
5445
|
+
* `Menu.Portal`. Renders no DOM element of its own.
|
|
5446
|
+
*/
|
|
4412
5447
|
function DropdownMenuPortal(componentProps) {
|
|
4413
5448
|
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
4414
5449
|
"data-slot": "dropdown-menu-portal",
|
|
4415
5450
|
...componentProps
|
|
4416
5451
|
});
|
|
4417
5452
|
}
|
|
5453
|
+
/**
|
|
5454
|
+
* The element that opens the dropdown menu, wrapping `Menu.Trigger`.
|
|
5455
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
5456
|
+
*/
|
|
4418
5457
|
const DropdownMenuTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
4419
5458
|
const { ...props } = componentProps;
|
|
4420
5459
|
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
@@ -4424,6 +5463,17 @@ const DropdownMenuTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4424
5463
|
});
|
|
4425
5464
|
});
|
|
4426
5465
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
5466
|
+
/**
|
|
5467
|
+
* The floating menu panel shown when open. Composes
|
|
5468
|
+
* `Menu.Portal → Menu.Positioner → Menu.Popup` into a single part and renders a
|
|
5469
|
+
* `<div>` popup. Positioning props (`side`, `sideOffset`, `align`, `alignOffset`)
|
|
5470
|
+
* are forwarded to the positioner; all other props go to the popup.
|
|
5471
|
+
*
|
|
5472
|
+
* @prop side - Which side of the trigger to place the menu. Default: `'bottom'`.
|
|
5473
|
+
* @prop sideOffset - Gap in pixels between the trigger and the menu. Default: `4`.
|
|
5474
|
+
* @prop align - Alignment along the trigger's cross-axis. Default: `'start'`.
|
|
5475
|
+
* @prop alignOffset - Offset in pixels along the cross-axis. Default: `0`.
|
|
5476
|
+
*/
|
|
4427
5477
|
const DropdownMenuContent = React.forwardRef((componentProps, forwardRef) => {
|
|
4428
5478
|
const { align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, container, ...props } = componentProps;
|
|
4429
5479
|
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
@@ -4444,6 +5494,10 @@ const DropdownMenuContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4444
5494
|
});
|
|
4445
5495
|
});
|
|
4446
5496
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
5497
|
+
/**
|
|
5498
|
+
* Groups related menu items for labelling, wrapping `Menu.Group`.
|
|
5499
|
+
* Renders a `<div>` with `role="group"`; pair with `DropdownMenuLabel`.
|
|
5500
|
+
*/
|
|
4447
5501
|
const DropdownMenuGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
4448
5502
|
const { ...props } = componentProps;
|
|
4449
5503
|
return /* @__PURE__ */ jsx(Menu.Group, {
|
|
@@ -4453,6 +5507,10 @@ const DropdownMenuGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4453
5507
|
});
|
|
4454
5508
|
});
|
|
4455
5509
|
DropdownMenuGroup.displayName = "DropdownMenuGroup";
|
|
5510
|
+
/**
|
|
5511
|
+
* Non-interactive heading for a menu group, wrapping `Menu.GroupLabel`.
|
|
5512
|
+
* Renders a `<div>`.
|
|
5513
|
+
*/
|
|
4456
5514
|
const DropdownMenuLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
4457
5515
|
const { className, inset, ...props } = componentProps;
|
|
4458
5516
|
return /* @__PURE__ */ jsx(Menu.GroupLabel, {
|
|
@@ -4464,6 +5522,10 @@ const DropdownMenuLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4464
5522
|
});
|
|
4465
5523
|
});
|
|
4466
5524
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
5525
|
+
/**
|
|
5526
|
+
* A selectable menu action, wrapping `Menu.Item`.
|
|
5527
|
+
* Renders a `<div>` with `role="menuitem"` that closes the menu when activated.
|
|
5528
|
+
*/
|
|
4467
5529
|
const DropdownMenuItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4468
5530
|
const { className, inset, variant = "default", ...props } = componentProps;
|
|
4469
5531
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
@@ -4476,12 +5538,21 @@ const DropdownMenuItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4476
5538
|
});
|
|
4477
5539
|
});
|
|
4478
5540
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
5541
|
+
/**
|
|
5542
|
+
* Root container for a nested submenu, wrapping `Menu.SubmenuRoot`. Manages the
|
|
5543
|
+
* submenu's open state and renders no DOM element — place a
|
|
5544
|
+
* `DropdownMenuSubTrigger` and `DropdownMenuSubContent` inside it.
|
|
5545
|
+
*/
|
|
4479
5546
|
function DropdownMenuSub(componentProps) {
|
|
4480
5547
|
return /* @__PURE__ */ jsx(Menu.SubmenuRoot, {
|
|
4481
5548
|
"data-slot": "dropdown-menu-sub",
|
|
4482
5549
|
...componentProps
|
|
4483
5550
|
});
|
|
4484
5551
|
}
|
|
5552
|
+
/**
|
|
5553
|
+
* A menu item that opens its submenu, wrapping `Menu.SubmenuTrigger`.
|
|
5554
|
+
* Renders a `<div>` menu item with a trailing chevron icon.
|
|
5555
|
+
*/
|
|
4485
5556
|
const DropdownMenuSubTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
4486
5557
|
const { className, inset, children, ...props } = componentProps;
|
|
4487
5558
|
return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
|
|
@@ -4494,6 +5565,15 @@ const DropdownMenuSubTrigger = React.forwardRef((componentProps, forwardRef) =>
|
|
|
4494
5565
|
});
|
|
4495
5566
|
});
|
|
4496
5567
|
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
5568
|
+
/**
|
|
5569
|
+
* The floating panel for a submenu, building on `DropdownMenuContent` with
|
|
5570
|
+
* submenu-appropriate positioning defaults. Renders a `<div>` popup.
|
|
5571
|
+
*
|
|
5572
|
+
* @prop side - Which side of the trigger to place the submenu. Default: `'right'`.
|
|
5573
|
+
* @prop sideOffset - Gap in pixels between the trigger and the submenu. Default: `0`.
|
|
5574
|
+
* @prop align - Alignment along the trigger's cross-axis. Default: `'start'`.
|
|
5575
|
+
* @prop alignOffset - Offset in pixels along the cross-axis. Default: `-3`.
|
|
5576
|
+
*/
|
|
4497
5577
|
const DropdownMenuSubContent = React.forwardRef((componentProps, forwardRef) => {
|
|
4498
5578
|
const { align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props } = componentProps;
|
|
4499
5579
|
return /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
@@ -4508,6 +5588,10 @@ const DropdownMenuSubContent = React.forwardRef((componentProps, forwardRef) =>
|
|
|
4508
5588
|
});
|
|
4509
5589
|
});
|
|
4510
5590
|
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
5591
|
+
/**
|
|
5592
|
+
* A menu item with a toggleable checked state, wrapping `Menu.CheckboxItem`.
|
|
5593
|
+
* Renders a `<div>` menu item with a trailing check indicator when checked.
|
|
5594
|
+
*/
|
|
4511
5595
|
const DropdownMenuCheckboxItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4512
5596
|
const { className, children, checked, inset, ...props } = componentProps;
|
|
4513
5597
|
return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
|
|
@@ -4525,6 +5609,10 @@ const DropdownMenuCheckboxItem = React.forwardRef((componentProps, forwardRef) =
|
|
|
4525
5609
|
});
|
|
4526
5610
|
});
|
|
4527
5611
|
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
5612
|
+
/**
|
|
5613
|
+
* Groups radio items so only one can be selected, wrapping `Menu.RadioGroup`.
|
|
5614
|
+
* Renders a `<div>`.
|
|
5615
|
+
*/
|
|
4528
5616
|
const DropdownMenuRadioGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
4529
5617
|
const { ...props } = componentProps;
|
|
4530
5618
|
return /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
@@ -4534,7 +5622,11 @@ const DropdownMenuRadioGroup = React.forwardRef((componentProps, forwardRef) =>
|
|
|
4534
5622
|
});
|
|
4535
5623
|
});
|
|
4536
5624
|
DropdownMenuRadioGroup.displayName = "DropdownMenuRadioGroup";
|
|
4537
|
-
|
|
5625
|
+
/**
|
|
5626
|
+
* A single selectable option within a radio group, wrapping `Menu.RadioItem`.
|
|
5627
|
+
* Renders a `<div>` menu item with a trailing check indicator when selected.
|
|
5628
|
+
*/
|
|
5629
|
+
const DropdownMenuRadioItem = React.forwardRef((componentProps, forwardRef) => {
|
|
4538
5630
|
const { className, children, inset, ...props } = componentProps;
|
|
4539
5631
|
return /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
4540
5632
|
ref: forwardRef,
|
|
@@ -4550,6 +5642,10 @@ const DropdownMenuRadioItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4550
5642
|
});
|
|
4551
5643
|
});
|
|
4552
5644
|
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
5645
|
+
/**
|
|
5646
|
+
* A horizontal divider between groups of menu items, wrapping `Menu.Separator`.
|
|
5647
|
+
* Renders a `<div>` with `role="separator"`.
|
|
5648
|
+
*/
|
|
4553
5649
|
const DropdownMenuSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
4554
5650
|
const { className, ...props } = componentProps;
|
|
4555
5651
|
return /* @__PURE__ */ jsx(Menu.Separator, {
|
|
@@ -4560,6 +5656,10 @@ const DropdownMenuSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4560
5656
|
});
|
|
4561
5657
|
});
|
|
4562
5658
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
5659
|
+
/**
|
|
5660
|
+
* Right-aligned slot for a keyboard shortcut hint on a menu item.
|
|
5661
|
+
* Renders a `<span>`.
|
|
5662
|
+
*/
|
|
4563
5663
|
const DropdownMenuShortcut = React.forwardRef((componentProps, forwardRef) => {
|
|
4564
5664
|
const { className, ...props } = componentProps;
|
|
4565
5665
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -4570,6 +5670,10 @@ const DropdownMenuShortcut = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4570
5670
|
});
|
|
4571
5671
|
});
|
|
4572
5672
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
5673
|
+
/**
|
|
5674
|
+
* Right-aligned slot for arbitrary trailing content (e.g. a badge) on a menu
|
|
5675
|
+
* item, with `ml-auto` and `shrink-0` baked in. Renders a `<span>`.
|
|
5676
|
+
*/
|
|
4573
5677
|
const DropdownMenuAddon = React.forwardRef((componentProps, forwardRef) => {
|
|
4574
5678
|
const { className, ...props } = componentProps;
|
|
4575
5679
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -4583,6 +5687,25 @@ DropdownMenuAddon.displayName = "DropdownMenuAddon";
|
|
|
4583
5687
|
|
|
4584
5688
|
//#endregion
|
|
4585
5689
|
//#region src/components/empty.tsx
|
|
5690
|
+
/**
|
|
5691
|
+
* Empty-state container that centers its content (media, text, and actions).
|
|
5692
|
+
* Renders a `<div>`; compose it with `EmptyHeader`, `EmptyMedia`, `EmptyTitle`,
|
|
5693
|
+
* `EmptyDescription`, and `EmptyContent`.
|
|
5694
|
+
*
|
|
5695
|
+
* @example
|
|
5696
|
+
* ```tsx
|
|
5697
|
+
* <Empty>
|
|
5698
|
+
* <EmptyHeader>
|
|
5699
|
+
* <EmptyMedia variant="icon"><InboxIcon /></EmptyMedia>
|
|
5700
|
+
* <EmptyTitle>No messages</EmptyTitle>
|
|
5701
|
+
* <EmptyDescription>You're all caught up.</EmptyDescription>
|
|
5702
|
+
* </EmptyHeader>
|
|
5703
|
+
* <EmptyContent>
|
|
5704
|
+
* <Button>Refresh</Button>
|
|
5705
|
+
* </EmptyContent>
|
|
5706
|
+
* </Empty>
|
|
5707
|
+
* ```
|
|
5708
|
+
*/
|
|
4586
5709
|
const Empty = React.forwardRef((componentProps, forwardRef) => {
|
|
4587
5710
|
const { className, ...props } = componentProps;
|
|
4588
5711
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4593,6 +5716,9 @@ const Empty = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4593
5716
|
});
|
|
4594
5717
|
});
|
|
4595
5718
|
Empty.displayName = "Empty";
|
|
5719
|
+
/**
|
|
5720
|
+
* Groups the media, title, and description of an empty state. Renders a `<div>`.
|
|
5721
|
+
*/
|
|
4596
5722
|
const EmptyHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
4597
5723
|
const { className, ...props } = componentProps;
|
|
4598
5724
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4610,6 +5736,10 @@ const emptyMediaVariants = cva("flex shrink-0 items-center justify-center mb-2 [
|
|
|
4610
5736
|
} },
|
|
4611
5737
|
defaultVariants: { variant: "default" }
|
|
4612
5738
|
});
|
|
5739
|
+
/**
|
|
5740
|
+
* Wrapper for the empty state's icon or illustration. Renders a `<div>`; the `icon`
|
|
5741
|
+
* variant gives it a muted rounded background, while `default` is transparent.
|
|
5742
|
+
*/
|
|
4613
5743
|
const EmptyMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
4614
5744
|
const { className, variant = "default", ...props } = componentProps;
|
|
4615
5745
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4624,6 +5754,9 @@ const EmptyMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4624
5754
|
});
|
|
4625
5755
|
});
|
|
4626
5756
|
EmptyMedia.displayName = "EmptyMedia";
|
|
5757
|
+
/**
|
|
5758
|
+
* Primary heading of the empty state. Renders a `<div>`.
|
|
5759
|
+
*/
|
|
4627
5760
|
const EmptyTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
4628
5761
|
const { className, ...props } = componentProps;
|
|
4629
5762
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4634,6 +5767,10 @@ const EmptyTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4634
5767
|
});
|
|
4635
5768
|
});
|
|
4636
5769
|
EmptyTitle.displayName = "EmptyTitle";
|
|
5770
|
+
/**
|
|
5771
|
+
* Supporting text below the title; styles any nested anchors as links.
|
|
5772
|
+
* Renders a `<div>`.
|
|
5773
|
+
*/
|
|
4637
5774
|
const EmptyDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
4638
5775
|
const { className, ...props } = componentProps;
|
|
4639
5776
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4644,6 +5781,9 @@ const EmptyDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4644
5781
|
});
|
|
4645
5782
|
});
|
|
4646
5783
|
EmptyDescription.displayName = "EmptyDescription";
|
|
5784
|
+
/**
|
|
5785
|
+
* Region below the header for actions or extra content (e.g. buttons). Renders a `<div>`.
|
|
5786
|
+
*/
|
|
4647
5787
|
const EmptyContent = React.forwardRef((componentProps, forwardRef) => {
|
|
4648
5788
|
const { className, ...props } = componentProps;
|
|
4649
5789
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4893,6 +6033,10 @@ const DropzoneIcon = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4893
6033
|
});
|
|
4894
6034
|
});
|
|
4895
6035
|
DropzoneIcon.displayName = "DropzoneIcon";
|
|
6036
|
+
/**
|
|
6037
|
+
* Title line inside a `DropzoneContent`. Wraps DS `EmptyTitle`, pinned to
|
|
6038
|
+
* `text-foreground` so an enclosing invalid `Field` doesn't recolor it.
|
|
6039
|
+
*/
|
|
4896
6040
|
const DropzoneTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
4897
6041
|
const { className, ...props } = componentProps;
|
|
4898
6042
|
return /* @__PURE__ */ jsx(EmptyTitle, {
|
|
@@ -4903,6 +6047,7 @@ const DropzoneTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4903
6047
|
});
|
|
4904
6048
|
});
|
|
4905
6049
|
DropzoneTitle.displayName = "DropzoneTitle";
|
|
6050
|
+
/** Secondary helper text inside a `DropzoneContent`. Wraps DS `EmptyDescription`. */
|
|
4906
6051
|
const DropzoneDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
4907
6052
|
return /* @__PURE__ */ jsx(EmptyDescription, {
|
|
4908
6053
|
ref: forwardRef,
|
|
@@ -4911,6 +6056,11 @@ const DropzoneDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4911
6056
|
});
|
|
4912
6057
|
});
|
|
4913
6058
|
DropzoneDescription.displayName = "DropzoneDescription";
|
|
6059
|
+
/**
|
|
6060
|
+
* Row for action buttons (e.g. a `DropzoneTrigger`) inside a `DropzoneContent`.
|
|
6061
|
+
* Renders a `<div>` (`flex`, `gap-2`) that stops click / keydown propagation so
|
|
6062
|
+
* pressing a button doesn't also open the file picker via the surrounding card.
|
|
6063
|
+
*/
|
|
4914
6064
|
const DropzoneActions = React.forwardRef((componentProps, forwardRef) => {
|
|
4915
6065
|
const { className, ...props } = componentProps;
|
|
4916
6066
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4950,6 +6100,19 @@ DropzoneTrigger.displayName = "DropzoneTrigger";
|
|
|
4950
6100
|
|
|
4951
6101
|
//#endregion
|
|
4952
6102
|
//#region src/components/popover.tsx
|
|
6103
|
+
/**
|
|
6104
|
+
* Root container for a popover, wrapping Base UI's `Popover.Root`. Manages
|
|
6105
|
+
* open/close state and renders no DOM element — place `PopoverTrigger` and
|
|
6106
|
+
* `PopoverContent` inside it.
|
|
6107
|
+
*
|
|
6108
|
+
* @example
|
|
6109
|
+
* ```tsx
|
|
6110
|
+
* <Popover>
|
|
6111
|
+
* <PopoverTrigger render={<Button variant="outline" />}>Open</PopoverTrigger>
|
|
6112
|
+
* <PopoverContent>Popover body</PopoverContent>
|
|
6113
|
+
* </Popover>
|
|
6114
|
+
* ```
|
|
6115
|
+
*/
|
|
4953
6116
|
function Popover(componentProps) {
|
|
4954
6117
|
const { ...props } = componentProps;
|
|
4955
6118
|
return /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
@@ -4957,6 +6120,10 @@ function Popover(componentProps) {
|
|
|
4957
6120
|
...props
|
|
4958
6121
|
});
|
|
4959
6122
|
}
|
|
6123
|
+
/**
|
|
6124
|
+
* The element that toggles the popover, wrapping `Popover.Trigger`.
|
|
6125
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
6126
|
+
*/
|
|
4960
6127
|
const PopoverTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
4961
6128
|
return /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
4962
6129
|
"data-slot": "popover-trigger",
|
|
@@ -4965,6 +6132,17 @@ const PopoverTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4965
6132
|
});
|
|
4966
6133
|
});
|
|
4967
6134
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
6135
|
+
/**
|
|
6136
|
+
* The floating panel shown when the popover is open. Composes
|
|
6137
|
+
* `Popover.Portal → Popover.Positioner → Popover.Popup` into a single part and
|
|
6138
|
+
* renders a `<div>` popup. Positioning props (`side`, `sideOffset`, `align`,
|
|
6139
|
+
* `alignOffset`) are forwarded to the positioner; all other props go to the popup.
|
|
6140
|
+
*
|
|
6141
|
+
* @prop side - Which side of the trigger to place the popover. Default: `'bottom'`.
|
|
6142
|
+
* @prop sideOffset - Gap in pixels between the trigger and the popover. Default: `4`.
|
|
6143
|
+
* @prop align - Alignment along the trigger's cross-axis. Default: `'center'`.
|
|
6144
|
+
* @prop alignOffset - Offset in pixels along the cross-axis. Default: `0`.
|
|
6145
|
+
*/
|
|
4968
6146
|
const PopoverContent = React.forwardRef((componentProps, forwardRef) => {
|
|
4969
6147
|
const { className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props } = componentProps;
|
|
4970
6148
|
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
@@ -4982,6 +6160,10 @@ const PopoverContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4982
6160
|
}) });
|
|
4983
6161
|
});
|
|
4984
6162
|
PopoverContent.displayName = "PopoverContent";
|
|
6163
|
+
/**
|
|
6164
|
+
* Optional header region grouping the popover's title and description.
|
|
6165
|
+
* Renders a `<div>`.
|
|
6166
|
+
*/
|
|
4985
6167
|
const PopoverHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
4986
6168
|
const { className, ...props } = componentProps;
|
|
4987
6169
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4992,6 +6174,10 @@ const PopoverHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
4992
6174
|
});
|
|
4993
6175
|
});
|
|
4994
6176
|
PopoverHeader.displayName = "PopoverHeader";
|
|
6177
|
+
/**
|
|
6178
|
+
* Accessible title for the popover, wrapping `Popover.Title`.
|
|
6179
|
+
* Renders an `<h2>` and labels the popup for assistive technology.
|
|
6180
|
+
*/
|
|
4995
6181
|
const PopoverTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
4996
6182
|
const { className, ...props } = componentProps;
|
|
4997
6183
|
return /* @__PURE__ */ jsx(Popover$1.Title, {
|
|
@@ -5002,6 +6188,10 @@ const PopoverTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5002
6188
|
});
|
|
5003
6189
|
});
|
|
5004
6190
|
PopoverTitle.displayName = "PopoverTitle";
|
|
6191
|
+
/**
|
|
6192
|
+
* Accessible supporting text for the popover, wrapping `Popover.Description`.
|
|
6193
|
+
* Renders a `<p>` and describes the popup for assistive technology.
|
|
6194
|
+
*/
|
|
5005
6195
|
const PopoverDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
5006
6196
|
const { className, ...props } = componentProps;
|
|
5007
6197
|
return /* @__PURE__ */ jsx(Popover$1.Description, {
|
|
@@ -5015,6 +6205,18 @@ PopoverDescription.displayName = "PopoverDescription";
|
|
|
5015
6205
|
|
|
5016
6206
|
//#endregion
|
|
5017
6207
|
//#region src/components/theme-provider.tsx
|
|
6208
|
+
/**
|
|
6209
|
+
* Provides theme context to the app. Wraps next-themes' `ThemeProvider` with DS defaults
|
|
6210
|
+
* (`data-theme` attribute, `system` default, system detection, no transition flash).
|
|
6211
|
+
* Renders no DOM element — wrap your app root with it.
|
|
6212
|
+
*
|
|
6213
|
+
* @example
|
|
6214
|
+
* ```tsx
|
|
6215
|
+
* <ThemeProvider>
|
|
6216
|
+
* <App />
|
|
6217
|
+
* </ThemeProvider>
|
|
6218
|
+
* ```
|
|
6219
|
+
*/
|
|
5018
6220
|
function ThemeProvider(componentProps) {
|
|
5019
6221
|
const { children, ...props } = componentProps;
|
|
5020
6222
|
return /* @__PURE__ */ jsx(ThemeProvider$1, {
|
|
@@ -5029,6 +6231,7 @@ function ThemeProvider(componentProps) {
|
|
|
5029
6231
|
|
|
5030
6232
|
//#endregion
|
|
5031
6233
|
//#region src/components/emoji-picker.tsx
|
|
6234
|
+
/** Emoji category identifiers, for the `categories` prop of `EmojiPickerContent`. */
|
|
5032
6235
|
const EmojiPickerCategories = {
|
|
5033
6236
|
SUGGESTED: Categories.SUGGESTED,
|
|
5034
6237
|
SMILEYS_PEOPLE: Categories.SMILEYS_PEOPLE,
|
|
@@ -5046,6 +6249,19 @@ function useEmojiPickerContext() {
|
|
|
5046
6249
|
if (!context) throw new Error("EmojiPicker compound components must be used inside <EmojiPicker>");
|
|
5047
6250
|
return context;
|
|
5048
6251
|
}
|
|
6252
|
+
/**
|
|
6253
|
+
* Root of the emoji picker: manages open/close state and provides the selection callback
|
|
6254
|
+
* to its parts. Renders the Base UI Popover root (context only — no DOM element). Place
|
|
6255
|
+
* `EmojiPickerTrigger` and `EmojiPickerContent` inside it.
|
|
6256
|
+
*
|
|
6257
|
+
* @example
|
|
6258
|
+
* ```tsx
|
|
6259
|
+
* <EmojiPicker onEmojiSelect={setEmoji}>
|
|
6260
|
+
* <EmojiPickerTrigger />
|
|
6261
|
+
* <EmojiPickerContent />
|
|
6262
|
+
* </EmojiPicker>
|
|
6263
|
+
* ```
|
|
6264
|
+
*/
|
|
5049
6265
|
function EmojiPicker({ onEmojiSelect, children }) {
|
|
5050
6266
|
const [open, setOpen] = React.useState(false);
|
|
5051
6267
|
const onSelect = React.useCallback((emoji) => {
|
|
@@ -5062,6 +6278,16 @@ function EmojiPicker({ onEmojiSelect, children }) {
|
|
|
5062
6278
|
})
|
|
5063
6279
|
});
|
|
5064
6280
|
}
|
|
6281
|
+
/**
|
|
6282
|
+
* Trigger that opens the `EmojiPicker`. Renders a Base UI `PopoverTrigger` as a `<button>` —
|
|
6283
|
+
* by default an outline icon `Button` with a smile icon; override the element via `render`
|
|
6284
|
+
* and the inner content via `children`.
|
|
6285
|
+
*
|
|
6286
|
+
* @example
|
|
6287
|
+
* ```tsx
|
|
6288
|
+
* <EmojiPickerTrigger />
|
|
6289
|
+
* ```
|
|
6290
|
+
*/
|
|
5065
6291
|
const EmojiPickerTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
5066
6292
|
const { render, children, ...props } = componentProps;
|
|
5067
6293
|
const t = useDsTranslation("ds");
|
|
@@ -5077,6 +6303,15 @@ const EmojiPickerTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5077
6303
|
});
|
|
5078
6304
|
});
|
|
5079
6305
|
EmojiPickerTrigger.displayName = "EmojiPickerTrigger";
|
|
6306
|
+
/**
|
|
6307
|
+
* The floating popover panel of the `EmojiPicker`, containing the searchable emoji grid.
|
|
6308
|
+
* Portal-rendered via `PopoverContent`; the picker theme follows the DS theme provider.
|
|
6309
|
+
*
|
|
6310
|
+
* @example
|
|
6311
|
+
* ```tsx
|
|
6312
|
+
* <EmojiPickerContent width={320} categories={[{ category: EmojiPickerCategories.SMILEYS_PEOPLE, name: 'Smileys' }]} />
|
|
6313
|
+
* ```
|
|
6314
|
+
*/
|
|
5080
6315
|
function EmojiPickerContent({ className, align = "start", searchPlaceholder, categories, width = 300, suggestedEmojisMode = SuggestionMode.RECENT, ...props }) {
|
|
5081
6316
|
const { onSelect } = useEmojiPickerContext();
|
|
5082
6317
|
const { resolvedTheme } = useTheme();
|
|
@@ -5107,6 +6342,11 @@ function EmojiPickerContent({ className, align = "start", searchPlaceholder, cat
|
|
|
5107
6342
|
|
|
5108
6343
|
//#endregion
|
|
5109
6344
|
//#region src/components/fab.tsx
|
|
6345
|
+
/**
|
|
6346
|
+
* `class-variance-authority` config for {@link FAB}. `variant` (`default` |
|
|
6347
|
+
* `outline`, default `default`) sets the colour scheme; `size` (`lg` |
|
|
6348
|
+
* `icon-lg`, default `icon-lg`) sets the dimensions.
|
|
6349
|
+
*/
|
|
5110
6350
|
const fabVariants = cva("group/fab inline-flex shrink-0 items-center justify-center rounded-md shadow-lg font-semibold whitespace-nowrap transition-all outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px active:not-aria-[haspopup]:shadow-md [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6", {
|
|
5111
6351
|
variants: {
|
|
5112
6352
|
variant: {
|
|
@@ -5123,6 +6363,20 @@ const fabVariants = cva("group/fab inline-flex shrink-0 items-center justify-cen
|
|
|
5123
6363
|
size: "icon-lg"
|
|
5124
6364
|
}
|
|
5125
6365
|
});
|
|
6366
|
+
/**
|
|
6367
|
+
* Floating action button — a raised, shadowed button for a primary action.
|
|
6368
|
+
* Renders Base UI's `Button` primitive as a `<button>`.
|
|
6369
|
+
*
|
|
6370
|
+
* @prop variant - Colour scheme: `default` | `outline`. Default: `'default'`.
|
|
6371
|
+
* @prop size - Dimensions: `lg` (label + icon) | `icon-lg` (icon only). Default: `'icon-lg'`.
|
|
6372
|
+
*
|
|
6373
|
+
* @example
|
|
6374
|
+
* ```tsx
|
|
6375
|
+
* <FAB aria-label="Add">
|
|
6376
|
+
* <PlusIcon />
|
|
6377
|
+
* </FAB>
|
|
6378
|
+
* ```
|
|
6379
|
+
*/
|
|
5126
6380
|
const FAB = React.forwardRef((componentProps, forwardRef) => {
|
|
5127
6381
|
const { className, variant, size, ...props } = componentProps;
|
|
5128
6382
|
return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -5140,6 +6394,16 @@ FAB.displayName = "FAB";
|
|
|
5140
6394
|
|
|
5141
6395
|
//#endregion
|
|
5142
6396
|
//#region src/components/label.tsx
|
|
6397
|
+
/**
|
|
6398
|
+
* Caption for a form control. Renders a `<label>` element with design-system
|
|
6399
|
+
* typography and disabled styling that reacts to peer/group `data-disabled`
|
|
6400
|
+
* state.
|
|
6401
|
+
*
|
|
6402
|
+
* @example
|
|
6403
|
+
* ```tsx
|
|
6404
|
+
* <Label htmlFor="email">Email</Label>
|
|
6405
|
+
* ```
|
|
6406
|
+
*/
|
|
5143
6407
|
const Label = React.forwardRef((componentProps, forwardRef) => {
|
|
5144
6408
|
const { className, ...props } = componentProps;
|
|
5145
6409
|
return /* @__PURE__ */ jsx("label", {
|
|
@@ -5153,6 +6417,10 @@ Label.displayName = "Label";
|
|
|
5153
6417
|
|
|
5154
6418
|
//#endregion
|
|
5155
6419
|
//#region src/components/field.tsx
|
|
6420
|
+
/**
|
|
6421
|
+
* Groups a set of related fields under a shared `FieldLegend`. Renders a native `<fieldset>` with
|
|
6422
|
+
* vertical spacing between its children.
|
|
6423
|
+
*/
|
|
5156
6424
|
const FieldSet = React.forwardRef((componentProps, forwardRef) => {
|
|
5157
6425
|
const { className, ...props } = componentProps;
|
|
5158
6426
|
return /* @__PURE__ */ jsx("fieldset", {
|
|
@@ -5163,6 +6431,10 @@ const FieldSet = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5163
6431
|
});
|
|
5164
6432
|
});
|
|
5165
6433
|
FieldSet.displayName = "FieldSet";
|
|
6434
|
+
/**
|
|
6435
|
+
* Caption for a `FieldSet`, rendering a native `<legend>`. The `variant` prop switches between
|
|
6436
|
+
* section-heading (`'legend'`) and label-sized (`'label'`) typography.
|
|
6437
|
+
*/
|
|
5166
6438
|
const FieldLegend = React.forwardRef((componentProps, forwardRef) => {
|
|
5167
6439
|
const { className, variant = "legend", ...props } = componentProps;
|
|
5168
6440
|
return /* @__PURE__ */ jsx("legend", {
|
|
@@ -5174,6 +6446,10 @@ const FieldLegend = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5174
6446
|
});
|
|
5175
6447
|
});
|
|
5176
6448
|
FieldLegend.displayName = "FieldLegend";
|
|
6449
|
+
/**
|
|
6450
|
+
* Container that stacks multiple `Field`s or `FieldSet`s and establishes the `@container` context
|
|
6451
|
+
* used by responsive field orientation. Renders a `<div>`.
|
|
6452
|
+
*/
|
|
5177
6453
|
const FieldGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
5178
6454
|
const { className, ...props } = componentProps;
|
|
5179
6455
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -5192,6 +6468,20 @@ const fieldVariants = cva("group/field flex w-full gap-2", {
|
|
|
5192
6468
|
} },
|
|
5193
6469
|
defaultVariants: { orientation: "vertical" }
|
|
5194
6470
|
});
|
|
6471
|
+
/**
|
|
6472
|
+
* Layout wrapper pairing a control with its label, description, and error. Renders a
|
|
6473
|
+
* `<div role="group">`. The `orientation` variant (`'vertical' | 'horizontal' | 'responsive'`)
|
|
6474
|
+
* controls the axis and defaults to `'vertical'`.
|
|
6475
|
+
*
|
|
6476
|
+
* @example
|
|
6477
|
+
* ```tsx
|
|
6478
|
+
* <Field>
|
|
6479
|
+
* <FieldLabel htmlFor="name">Name</FieldLabel>
|
|
6480
|
+
* <Input id="name" />
|
|
6481
|
+
* <FieldDescription>Your full name.</FieldDescription>
|
|
6482
|
+
* </Field>
|
|
6483
|
+
* ```
|
|
6484
|
+
*/
|
|
5195
6485
|
const Field = React.forwardRef((componentProps, forwardRef) => {
|
|
5196
6486
|
const { className, orientation = "vertical", ...props } = componentProps;
|
|
5197
6487
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -5204,6 +6494,10 @@ const Field = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5204
6494
|
});
|
|
5205
6495
|
});
|
|
5206
6496
|
Field.displayName = "Field";
|
|
6497
|
+
/**
|
|
6498
|
+
* Column wrapper for a field's label and description, typically placed beside a control in a
|
|
6499
|
+
* horizontal field. Renders a `<div>`.
|
|
6500
|
+
*/
|
|
5207
6501
|
const FieldContent = React.forwardRef((componentProps, forwardRef) => {
|
|
5208
6502
|
const { className, ...props } = componentProps;
|
|
5209
6503
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -5315,6 +6609,10 @@ const FieldLabelAside = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5315
6609
|
});
|
|
5316
6610
|
});
|
|
5317
6611
|
FieldLabelAside.displayName = "FieldLabelAside";
|
|
6612
|
+
/**
|
|
6613
|
+
* Non-`<label>` title for a field, used when the title is not tied to a single control. Renders a
|
|
6614
|
+
* `<div>` in medium-weight small text.
|
|
6615
|
+
*/
|
|
5318
6616
|
const FieldTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
5319
6617
|
const { className, ...props } = componentProps;
|
|
5320
6618
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -5325,6 +6623,11 @@ const FieldTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5325
6623
|
});
|
|
5326
6624
|
});
|
|
5327
6625
|
FieldTitle.displayName = "FieldTitle";
|
|
6626
|
+
/**
|
|
6627
|
+
* Helper text for a field, rendering a `<p>` in muted text. The `variant` prop selects contextual
|
|
6628
|
+
* vs instructional behavior (see the prop docs); contextual descriptions hide while the field is
|
|
6629
|
+
* invalid so the `FieldError` can take their place.
|
|
6630
|
+
*/
|
|
5328
6631
|
const FieldDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
5329
6632
|
const { className, variant = "contextual", ...props } = componentProps;
|
|
5330
6633
|
return /* @__PURE__ */ jsx("p", {
|
|
@@ -5336,6 +6639,10 @@ const FieldDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5336
6639
|
});
|
|
5337
6640
|
});
|
|
5338
6641
|
FieldDescription.displayName = "FieldDescription";
|
|
6642
|
+
/**
|
|
6643
|
+
* Divider between fields, optionally labelled with centered content. Renders a `<div>` containing a
|
|
6644
|
+
* `Separator` and, when `children` are provided, a centered text label over the line.
|
|
6645
|
+
*/
|
|
5339
6646
|
const FieldSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
5340
6647
|
const { children, className, ...props } = componentProps;
|
|
5341
6648
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -5352,6 +6659,11 @@ const FieldSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5352
6659
|
});
|
|
5353
6660
|
});
|
|
5354
6661
|
FieldSeparator.displayName = "FieldSeparator";
|
|
6662
|
+
/**
|
|
6663
|
+
* Displays a field's validation message(s), rendering a `<div role="alert">` in destructive color.
|
|
6664
|
+
* Renders nothing when there is no `children` or `errors` content; multiple errors render as a
|
|
6665
|
+
* bulleted list with duplicates removed.
|
|
6666
|
+
*/
|
|
5355
6667
|
const FieldError = React.forwardRef((componentProps, forwardRef) => {
|
|
5356
6668
|
const { className, children, errors, ...props } = componentProps;
|
|
5357
6669
|
const content = React.useMemo(() => {
|
|
@@ -5387,6 +6699,16 @@ function getSegmentState(index, value) {
|
|
|
5387
6699
|
if (distanceFromHead === 1) return "trailing";
|
|
5388
6700
|
return "filled";
|
|
5389
6701
|
}
|
|
6702
|
+
/**
|
|
6703
|
+
* Segmented signal-strength meter that fills a fixed set of 8 bars up to `value`.
|
|
6704
|
+
* Renders a `<div role="meter">` containing 8 segment `<div>`s whose opacity
|
|
6705
|
+
* ramps (head / trailing / filled) toward the current value.
|
|
6706
|
+
*
|
|
6707
|
+
* @example
|
|
6708
|
+
* ```tsx
|
|
6709
|
+
* <Gauge value={5} />
|
|
6710
|
+
* ```
|
|
6711
|
+
*/
|
|
5390
6712
|
const Gauge = React.forwardRef((componentProps, forwardRef) => {
|
|
5391
6713
|
const { className, value, ...props } = componentProps;
|
|
5392
6714
|
const clampedValue = Math.max(0, Math.min(value, GAUGES));
|
|
@@ -5520,7 +6842,7 @@ const InlineEditSelectContext = React.createContext({});
|
|
|
5520
6842
|
* Renders the relative container, the absolute bg layer (bleeds 4 px sideways
|
|
5521
6843
|
* for a wider affordance), and the optional prefix icon slot. Not exported.
|
|
5522
6844
|
*/
|
|
5523
|
-
function InlineEditChrome({ readOnly, "aria-invalid": ariaInvalid, className, prefix, children }) {
|
|
6845
|
+
function InlineEditChrome({ readOnly, "aria-invalid": ariaInvalid, className, prefix, children, showFocusRing = true }) {
|
|
5524
6846
|
return /* @__PURE__ */ jsxs("div", {
|
|
5525
6847
|
"data-slot": "inline-edit",
|
|
5526
6848
|
"data-readonly": readOnly || void 0,
|
|
@@ -5530,7 +6852,12 @@ function InlineEditChrome({ readOnly, "aria-invalid": ariaInvalid, className, pr
|
|
|
5530
6852
|
!readOnly && /* @__PURE__ */ jsx("div", {
|
|
5531
6853
|
"aria-hidden": true,
|
|
5532
6854
|
"data-slot": "inline-edit-bg",
|
|
5533
|
-
className: cn("pointer-events-none absolute inset-[0_-4px] rounded-md transition-colors", "group-hover/inline-edit:bg-accent/50",
|
|
6855
|
+
className: cn("pointer-events-none absolute inset-[0_-4px] rounded-md transition-colors", "group-hover/inline-edit:bg-accent/50", showFocusRing && [
|
|
6856
|
+
"group-focus-within/inline-edit:bg-background",
|
|
6857
|
+
"group-focus-within/inline-edit:border group-focus-within/inline-edit:border-ring",
|
|
6858
|
+
"group-focus-within/inline-edit:ring-3 group-focus-within/inline-edit:ring-ring/50",
|
|
6859
|
+
"group-data-[invalid]/inline-edit:group-focus-within/inline-edit:ring-destructive/20"
|
|
6860
|
+
], "group-data-[invalid]/inline-edit:border group-data-[invalid]/inline-edit:border-destructive", "group-data-[invalid]/inline-edit:group-hover/inline-edit:bg-destructive/10")
|
|
5534
6861
|
}),
|
|
5535
6862
|
prefix && /* @__PURE__ */ jsx("span", {
|
|
5536
6863
|
"data-slot": "inline-edit-prefix",
|
|
@@ -5666,6 +6993,326 @@ const InlineEditInput = React.forwardRef((componentProps, forwardRef) => {
|
|
|
5666
6993
|
});
|
|
5667
6994
|
InlineEditInput.displayName = "InlineEditInput";
|
|
5668
6995
|
|
|
6996
|
+
//#endregion
|
|
6997
|
+
//#region src/components/inline-edit-multiselect.tsx
|
|
6998
|
+
/** Context shared between the `InlineEditMultiselect` root and its compound sub-parts. */
|
|
6999
|
+
const InlineEditMultiselectContext = React.createContext({});
|
|
7000
|
+
/**
|
|
7001
|
+
* Wires a commit-on-blur callback that fires once when focus truly leaves the
|
|
7002
|
+
* component - the chips row **and** the portaled popup/listbox. Returns handlers to
|
|
7003
|
+
* spread on a wrapper around the `Combobox`.
|
|
7004
|
+
*
|
|
7005
|
+
* Base UI portals the popup out of the DOM subtree, but React synthetic focus events
|
|
7006
|
+
* bubble through the *React* tree, so a focus move into the popup still bubbles back
|
|
7007
|
+
* to the wrapper's `onFocus` - which lets us treat "focus re-entered the component"
|
|
7008
|
+
* (including Base UI's own trigger→popup focus move on open) as staying within, and
|
|
7009
|
+
* cancel the pending commit. Only a genuine leave, with no re-focus in the same frame,
|
|
7010
|
+
* commits.
|
|
7011
|
+
*/
|
|
7012
|
+
function useCommitOnBlur(rootRef, getValues, onBlur) {
|
|
7013
|
+
const focusWithin = React.useRef(false);
|
|
7014
|
+
const rafId = React.useRef(null);
|
|
7015
|
+
const cancelPending = React.useCallback(() => {
|
|
7016
|
+
if (rafId.current !== null) {
|
|
7017
|
+
cancelAnimationFrame(rafId.current);
|
|
7018
|
+
rafId.current = null;
|
|
7019
|
+
}
|
|
7020
|
+
}, []);
|
|
7021
|
+
React.useEffect(() => cancelPending, [cancelPending]);
|
|
7022
|
+
return {
|
|
7023
|
+
onFocus: React.useCallback(() => {
|
|
7024
|
+
cancelPending();
|
|
7025
|
+
focusWithin.current = true;
|
|
7026
|
+
}, [cancelPending]),
|
|
7027
|
+
onBlur: React.useCallback((event) => {
|
|
7028
|
+
if (!focusWithin.current) return;
|
|
7029
|
+
if (event.relatedTarget && rootRef.current?.contains(event.relatedTarget)) return;
|
|
7030
|
+
cancelPending();
|
|
7031
|
+
rafId.current = requestAnimationFrame(() => {
|
|
7032
|
+
rafId.current = null;
|
|
7033
|
+
focusWithin.current = false;
|
|
7034
|
+
onBlur?.(getValues());
|
|
7035
|
+
});
|
|
7036
|
+
}, [
|
|
7037
|
+
rootRef,
|
|
7038
|
+
getValues,
|
|
7039
|
+
onBlur,
|
|
7040
|
+
cancelPending
|
|
7041
|
+
])
|
|
7042
|
+
};
|
|
7043
|
+
}
|
|
7044
|
+
/**
|
|
7045
|
+
* The chips row of an `InlineEditMultiselect`. Wraps the inline-edit chrome (hover/focus
|
|
7046
|
+
* affordance) around a Base UI `Combobox.Chips` container that lays out the selected
|
|
7047
|
+
* chips and the trailing `InlineEditMultiselectTrigger` in a wrapping flex row.
|
|
7048
|
+
*
|
|
7049
|
+
* @example
|
|
7050
|
+
* ```tsx
|
|
7051
|
+
* <InlineEditMultiselectChips>
|
|
7052
|
+
* <InlineEditMultiselectValue>{…}</InlineEditMultiselectValue>
|
|
7053
|
+
* <InlineEditMultiselectTrigger />
|
|
7054
|
+
* </InlineEditMultiselectChips>
|
|
7055
|
+
* ```
|
|
7056
|
+
*/
|
|
7057
|
+
const InlineEditMultiselectChips = React.forwardRef((componentProps, forwardRef) => {
|
|
7058
|
+
const { "aria-invalid": ariaInvalid, className, id, children } = componentProps;
|
|
7059
|
+
const { readOnly } = React.useContext(InlineEditMultiselectContext);
|
|
7060
|
+
const handleEmptyAreaClick = (e) => {
|
|
7061
|
+
if (readOnly || e.target !== e.currentTarget) return;
|
|
7062
|
+
const trigger = e.currentTarget.querySelector("[data-slot=\"inline-edit-multiselect-trigger\"]");
|
|
7063
|
+
if (trigger && trigger.getAttribute("aria-expanded") !== "true") trigger.click();
|
|
7064
|
+
};
|
|
7065
|
+
return /* @__PURE__ */ jsx(InlineEditChrome, {
|
|
7066
|
+
readOnly,
|
|
7067
|
+
"aria-invalid": ariaInvalid,
|
|
7068
|
+
showFocusRing: false,
|
|
7069
|
+
className: cn("items-start", readOnly && "cursor-default", className),
|
|
7070
|
+
children: /* @__PURE__ */ jsx(Combobox$1.Chips, {
|
|
7071
|
+
ref: forwardRef,
|
|
7072
|
+
"data-slot": "inline-edit-multiselect-chips",
|
|
7073
|
+
id,
|
|
7074
|
+
onClick: handleEmptyAreaClick,
|
|
7075
|
+
className: cn("relative flex flex-1 min-w-0 flex-wrap items-center gap-1", !readOnly && "cursor-pointer"),
|
|
7076
|
+
children
|
|
7077
|
+
})
|
|
7078
|
+
});
|
|
7079
|
+
});
|
|
7080
|
+
InlineEditMultiselectChips.displayName = "InlineEditMultiselectChips";
|
|
7081
|
+
/**
|
|
7082
|
+
* Renders the selected values of an `InlineEditMultiselect`. Pass a render function
|
|
7083
|
+
* that maps the array of selected keys to `InlineEditMultiselectChip`s.
|
|
7084
|
+
*
|
|
7085
|
+
* @example
|
|
7086
|
+
* ```tsx
|
|
7087
|
+
* <InlineEditMultiselectValue>
|
|
7088
|
+
* {(keys: string[]) =>
|
|
7089
|
+
* keys.map(key => <InlineEditMultiselectChip key={key}>{labelOf(key)}</InlineEditMultiselectChip>)}
|
|
7090
|
+
* </InlineEditMultiselectValue>
|
|
7091
|
+
* ```
|
|
7092
|
+
*/
|
|
7093
|
+
function InlineEditMultiselectValue(componentProps) {
|
|
7094
|
+
return /* @__PURE__ */ jsx(ComboboxValue, {
|
|
7095
|
+
"data-slot": "inline-edit-multiselect-value",
|
|
7096
|
+
...componentProps
|
|
7097
|
+
});
|
|
7098
|
+
}
|
|
7099
|
+
/**
|
|
7100
|
+
* A single selected-value chip inside `InlineEditMultiselectValue`. Composes the DS
|
|
7101
|
+
* `Chip` with a trailing remove (X) button that unselects the value via Base UI. The
|
|
7102
|
+
* remove button is hidden in `readOnly` mode.
|
|
7103
|
+
*
|
|
7104
|
+
* Color-aware: `color` + `tone`, `glow`, or a stored `legacyColor` hex forward straight
|
|
7105
|
+
* to the inner `Chip`, so backend tag colors render without a custom chip.
|
|
7106
|
+
*
|
|
7107
|
+
* @example
|
|
7108
|
+
* ```tsx
|
|
7109
|
+
* <InlineEditMultiselectChip color="blue" tone="medium-light">Urgent</InlineEditMultiselectChip>
|
|
7110
|
+
* <InlineEditMultiselectChip legacyColor="#0761B5">Sales</InlineEditMultiselectChip>
|
|
7111
|
+
* ```
|
|
7112
|
+
*/
|
|
7113
|
+
const InlineEditMultiselectChip = React.forwardRef((componentProps, forwardRef) => {
|
|
7114
|
+
const { className, children, color, tone, legacyColor, glow, ...props } = componentProps;
|
|
7115
|
+
const { readOnly } = React.useContext(InlineEditMultiselectContext);
|
|
7116
|
+
const t = useDsTranslation("ds");
|
|
7117
|
+
return /* @__PURE__ */ jsxs(Combobox$1.Chip, {
|
|
7118
|
+
ref: forwardRef,
|
|
7119
|
+
"data-slot": "inline-edit-multiselect-chip",
|
|
7120
|
+
render: /* @__PURE__ */ jsx(Chip, {
|
|
7121
|
+
color,
|
|
7122
|
+
tone,
|
|
7123
|
+
legacyColor,
|
|
7124
|
+
glow
|
|
7125
|
+
}),
|
|
7126
|
+
className,
|
|
7127
|
+
...props,
|
|
7128
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7129
|
+
className: "truncate max-w-[150px]",
|
|
7130
|
+
children
|
|
7131
|
+
}), !readOnly && /* @__PURE__ */ jsx(Combobox$1.ChipRemove, { render: /* @__PURE__ */ jsx(ChipRemove, { "aria-label": t("multiselect.remove") }) })]
|
|
7132
|
+
});
|
|
7133
|
+
});
|
|
7134
|
+
InlineEditMultiselectChip.displayName = "InlineEditMultiselectChip";
|
|
7135
|
+
/**
|
|
7136
|
+
* The "Add item" trigger of an `InlineEditMultiselect`. Renders an outline `Button`
|
|
7137
|
+
* with a leading plus icon that opens the searchable dropdown. Renders nothing in
|
|
7138
|
+
* `readOnly` mode.
|
|
7139
|
+
*
|
|
7140
|
+
* @example
|
|
7141
|
+
* ```tsx
|
|
7142
|
+
* <InlineEditMultiselectTrigger>Add label</InlineEditMultiselectTrigger>
|
|
7143
|
+
* ```
|
|
7144
|
+
*/
|
|
7145
|
+
const InlineEditMultiselectTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
7146
|
+
const { children, "aria-label": ariaLabel, id, className } = componentProps;
|
|
7147
|
+
const { readOnly } = React.useContext(InlineEditMultiselectContext);
|
|
7148
|
+
const t = useDsTranslation("ds");
|
|
7149
|
+
if (readOnly) return null;
|
|
7150
|
+
const label = children ?? t("multiselect.addItem");
|
|
7151
|
+
const accessibleLabel = ariaLabel ?? (typeof label === "string" ? label : void 0);
|
|
7152
|
+
return /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
|
|
7153
|
+
ref: forwardRef,
|
|
7154
|
+
"data-slot": "inline-edit-multiselect-trigger",
|
|
7155
|
+
id,
|
|
7156
|
+
"aria-label": accessibleLabel,
|
|
7157
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
7158
|
+
variant: "outline",
|
|
7159
|
+
size: "sm",
|
|
7160
|
+
className: cn("shrink-0 font-semibold bg-background dark:bg-input", className)
|
|
7161
|
+
}),
|
|
7162
|
+
children: [/* @__PURE__ */ jsx(PlusIcon, {}), label]
|
|
7163
|
+
});
|
|
7164
|
+
});
|
|
7165
|
+
InlineEditMultiselectTrigger.displayName = "InlineEditMultiselectTrigger";
|
|
7166
|
+
/**
|
|
7167
|
+
* The floating dropdown of an `InlineEditMultiselect`: a search input, an empty-state
|
|
7168
|
+
* message, and the scrollable option list. Portal-rendered and anchored to the
|
|
7169
|
+
* `InlineEditMultiselectTrigger`.
|
|
7170
|
+
*
|
|
7171
|
+
* Pass a render function as `children` so the built-in search filters the options (a
|
|
7172
|
+
* static list is rendered unfiltered — see the `children` prop note).
|
|
7173
|
+
*
|
|
7174
|
+
* @example
|
|
7175
|
+
* ```tsx
|
|
7176
|
+
* <InlineEditMultiselectContent>
|
|
7177
|
+
* {(key: string) => <InlineEditMultiselectItem key={key} value={key}>{labelOf(key)}</InlineEditMultiselectItem>}
|
|
7178
|
+
* </InlineEditMultiselectContent>
|
|
7179
|
+
* ```
|
|
7180
|
+
*/
|
|
7181
|
+
const InlineEditMultiselectContent = React.forwardRef((componentProps, forwardRef) => {
|
|
7182
|
+
const { className, searchPlaceholder, emptyMessage, children, ...props } = componentProps;
|
|
7183
|
+
const t = useDsTranslation("ds");
|
|
7184
|
+
return /* @__PURE__ */ jsxs(ComboboxContent, {
|
|
7185
|
+
ref: forwardRef,
|
|
7186
|
+
"data-slot": "inline-edit-multiselect-content",
|
|
7187
|
+
className: cn("w-80", className),
|
|
7188
|
+
...props,
|
|
7189
|
+
children: [
|
|
7190
|
+
/* @__PURE__ */ jsx(ComboboxInput, {
|
|
7191
|
+
showTrigger: false,
|
|
7192
|
+
placeholder: searchPlaceholder ?? t("multiselect.search")
|
|
7193
|
+
}),
|
|
7194
|
+
/* @__PURE__ */ jsx(ComboboxEmpty, { children: emptyMessage ?? t("dataCombobox.noResults") }),
|
|
7195
|
+
/* @__PURE__ */ jsx(ComboboxList, { children })
|
|
7196
|
+
]
|
|
7197
|
+
});
|
|
7198
|
+
});
|
|
7199
|
+
InlineEditMultiselectContent.displayName = "InlineEditMultiselectContent";
|
|
7200
|
+
/**
|
|
7201
|
+
* A single option row inside `InlineEditMultiselectContent`. Shows a checkmark when
|
|
7202
|
+
* selected and toggles selection on click (the dropdown stays open for multi-picking).
|
|
7203
|
+
*
|
|
7204
|
+
* @example
|
|
7205
|
+
* ```tsx
|
|
7206
|
+
* <InlineEditMultiselectItem value="urgent">Urgent</InlineEditMultiselectItem>
|
|
7207
|
+
* ```
|
|
7208
|
+
*/
|
|
7209
|
+
const InlineEditMultiselectItem = React.forwardRef((componentProps, forwardRef) => {
|
|
7210
|
+
return /* @__PURE__ */ jsx(ComboboxItem, {
|
|
7211
|
+
ref: forwardRef,
|
|
7212
|
+
"data-slot": "inline-edit-multiselect-item",
|
|
7213
|
+
...componentProps
|
|
7214
|
+
});
|
|
7215
|
+
});
|
|
7216
|
+
InlineEditMultiselectItem.displayName = "InlineEditMultiselectItem";
|
|
7217
|
+
function InlineEditMultiselectDataDriven(props) {
|
|
7218
|
+
const { value, defaultValue, onValueChange, onBlur, readOnly, items, getItemValue, getItemLabel, renderItem, renderChip, disabledKeys, placeholder, emptyMessage, addLabel, defaultOpen, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, id, className } = props;
|
|
7219
|
+
const contextValue = React.useMemo(() => ({ readOnly }), [readOnly]);
|
|
7220
|
+
const rootRef = React.useRef(null);
|
|
7221
|
+
const latestValues = React.useRef(value ?? defaultValue ?? []);
|
|
7222
|
+
if (value !== void 0) latestValues.current = value;
|
|
7223
|
+
const getValues = React.useCallback(() => latestValues.current, []);
|
|
7224
|
+
const handleValueChange = React.useCallback((next) => {
|
|
7225
|
+
latestValues.current = next;
|
|
7226
|
+
onValueChange?.(next);
|
|
7227
|
+
}, [onValueChange]);
|
|
7228
|
+
const blurHandlers = useCommitOnBlur(rootRef, getValues, onBlur);
|
|
7229
|
+
const keys = React.useMemo(() => items.map(getItemValue), [items, getItemValue]);
|
|
7230
|
+
const itemByKey = React.useMemo(() => new Map(items.map((item) => [getItemValue(item), item])), [items, getItemValue]);
|
|
7231
|
+
const labelOf = React.useCallback((key) => {
|
|
7232
|
+
const item = itemByKey.get(key);
|
|
7233
|
+
return item ? getItemLabel(item) : key;
|
|
7234
|
+
}, [itemByKey, getItemLabel]);
|
|
7235
|
+
return /* @__PURE__ */ jsx(InlineEditMultiselectContext.Provider, {
|
|
7236
|
+
value: contextValue,
|
|
7237
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
7238
|
+
ref: rootRef,
|
|
7239
|
+
className: "contents",
|
|
7240
|
+
onFocus: blurHandlers.onFocus,
|
|
7241
|
+
onBlur: blurHandlers.onBlur,
|
|
7242
|
+
children: /* @__PURE__ */ jsxs(Combobox, {
|
|
7243
|
+
multiple: true,
|
|
7244
|
+
items: keys,
|
|
7245
|
+
value,
|
|
7246
|
+
defaultValue,
|
|
7247
|
+
onValueChange: handleValueChange,
|
|
7248
|
+
itemToStringValue: (key) => key,
|
|
7249
|
+
itemToStringLabel: labelOf,
|
|
7250
|
+
readOnly,
|
|
7251
|
+
defaultOpen,
|
|
7252
|
+
children: [/* @__PURE__ */ jsxs(InlineEditMultiselectChips, {
|
|
7253
|
+
"aria-invalid": ariaInvalid,
|
|
7254
|
+
className,
|
|
7255
|
+
id: readOnly ? id : void 0,
|
|
7256
|
+
children: [/* @__PURE__ */ jsx(InlineEditMultiselectValue, { children: (selectedKeys) => selectedKeys.map((key) => {
|
|
7257
|
+
const item = itemByKey.get(key);
|
|
7258
|
+
return renderChip && item ? /* @__PURE__ */ jsx(React.Fragment, { children: renderChip(item) }, key) : /* @__PURE__ */ jsx(InlineEditMultiselectChip, { children: labelOf(key) }, key);
|
|
7259
|
+
}) }), /* @__PURE__ */ jsx(InlineEditMultiselectTrigger, {
|
|
7260
|
+
"aria-label": ariaLabel,
|
|
7261
|
+
id,
|
|
7262
|
+
children: addLabel
|
|
7263
|
+
})]
|
|
7264
|
+
}), /* @__PURE__ */ jsx(InlineEditMultiselectContent, {
|
|
7265
|
+
searchPlaceholder: placeholder,
|
|
7266
|
+
emptyMessage,
|
|
7267
|
+
children: (key) => /* @__PURE__ */ jsx(InlineEditMultiselectItem, {
|
|
7268
|
+
value: key,
|
|
7269
|
+
disabled: disabledKeys?.has(key),
|
|
7270
|
+
children: renderItem ? renderItem(itemByKey.get(key)) : labelOf(key)
|
|
7271
|
+
}, key)
|
|
7272
|
+
})]
|
|
7273
|
+
})
|
|
7274
|
+
})
|
|
7275
|
+
});
|
|
7276
|
+
}
|
|
7277
|
+
function InlineEditMultiselectCompound(props) {
|
|
7278
|
+
const { value, defaultValue, onValueChange, onBlur, readOnly, defaultOpen, children, items, itemToStringLabel } = props;
|
|
7279
|
+
const contextValue = React.useMemo(() => ({ readOnly }), [readOnly]);
|
|
7280
|
+
const rootRef = React.useRef(null);
|
|
7281
|
+
const latestValues = React.useRef(value ?? defaultValue ?? []);
|
|
7282
|
+
if (value !== void 0) latestValues.current = value;
|
|
7283
|
+
const getValues = React.useCallback(() => latestValues.current, []);
|
|
7284
|
+
const handleValueChange = React.useCallback((next) => {
|
|
7285
|
+
latestValues.current = next;
|
|
7286
|
+
onValueChange?.(next);
|
|
7287
|
+
}, [onValueChange]);
|
|
7288
|
+
const blurHandlers = useCommitOnBlur(rootRef, getValues, onBlur);
|
|
7289
|
+
return /* @__PURE__ */ jsx(InlineEditMultiselectContext.Provider, {
|
|
7290
|
+
value: contextValue,
|
|
7291
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
7292
|
+
ref: rootRef,
|
|
7293
|
+
className: "contents",
|
|
7294
|
+
onFocus: blurHandlers.onFocus,
|
|
7295
|
+
onBlur: blurHandlers.onBlur,
|
|
7296
|
+
children: /* @__PURE__ */ jsx(Combobox, {
|
|
7297
|
+
multiple: true,
|
|
7298
|
+
items,
|
|
7299
|
+
value,
|
|
7300
|
+
defaultValue,
|
|
7301
|
+
onValueChange: handleValueChange,
|
|
7302
|
+
itemToStringValue: (key) => key,
|
|
7303
|
+
itemToStringLabel,
|
|
7304
|
+
readOnly,
|
|
7305
|
+
defaultOpen,
|
|
7306
|
+
children
|
|
7307
|
+
})
|
|
7308
|
+
})
|
|
7309
|
+
});
|
|
7310
|
+
}
|
|
7311
|
+
function InlineEditMultiselect(componentProps) {
|
|
7312
|
+
if ("getItemValue" in componentProps && componentProps.getItemValue !== void 0) return /* @__PURE__ */ jsx(InlineEditMultiselectDataDriven, { ...componentProps });
|
|
7313
|
+
return /* @__PURE__ */ jsx(InlineEditMultiselectCompound, { ...componentProps });
|
|
7314
|
+
}
|
|
7315
|
+
|
|
5669
7316
|
//#endregion
|
|
5670
7317
|
//#region src/components/inline-edit-select.tsx
|
|
5671
7318
|
/**
|
|
@@ -6156,6 +7803,21 @@ NumericInputDecrement.displayName = "NumericInputDecrement";
|
|
|
6156
7803
|
|
|
6157
7804
|
//#endregion
|
|
6158
7805
|
//#region src/components/input-otp.tsx
|
|
7806
|
+
/**
|
|
7807
|
+
* Root one-time-password / verification-code input, built on the `input-otp`
|
|
7808
|
+
* `OTPInput`. Renders a container `<div>` wrapping a hidden `<input>`; the
|
|
7809
|
+
* visible cells are composed from `InputOTPGroup` and `InputOTPSlot` children.
|
|
7810
|
+
* `className` styles the input, `containerClassName` styles the wrapper.
|
|
7811
|
+
*
|
|
7812
|
+
* @example
|
|
7813
|
+
* ```tsx
|
|
7814
|
+
* <InputOTP maxLength={6} render={({ slots }) => (
|
|
7815
|
+
* <InputOTPGroup>
|
|
7816
|
+
* {slots.map((_, i) => <InputOTPSlot key={i} index={i} />)}
|
|
7817
|
+
* </InputOTPGroup>
|
|
7818
|
+
* )} />
|
|
7819
|
+
* ```
|
|
7820
|
+
*/
|
|
6159
7821
|
const InputOTP = React.forwardRef((componentProps, forwardRef) => {
|
|
6160
7822
|
const { className, containerClassName, ...props } = componentProps;
|
|
6161
7823
|
return /* @__PURE__ */ jsx(OTPInput, {
|
|
@@ -6167,6 +7829,9 @@ const InputOTP = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6167
7829
|
});
|
|
6168
7830
|
});
|
|
6169
7831
|
InputOTP.displayName = "InputOTP";
|
|
7832
|
+
/**
|
|
7833
|
+
* Groups a run of `InputOTPSlot` cells. Renders a flex `<div>` container.
|
|
7834
|
+
*/
|
|
6170
7835
|
const InputOTPGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
6171
7836
|
const { className, ...props } = componentProps;
|
|
6172
7837
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6177,6 +7842,10 @@ const InputOTPGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6177
7842
|
});
|
|
6178
7843
|
});
|
|
6179
7844
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
7845
|
+
/**
|
|
7846
|
+
* A single character cell. Renders a `<div>` that reads its character, active
|
|
7847
|
+
* state, and fake-caret from the `OTPInputContext` at the given `index`.
|
|
7848
|
+
*/
|
|
6180
7849
|
const InputOTPSlot = React.forwardRef((componentProps, forwardRef) => {
|
|
6181
7850
|
const { index, className, ...props } = componentProps;
|
|
6182
7851
|
const { char, hasFakeCaret, isActive } = React.useContext(OTPInputContext)?.slots[index] ?? {};
|
|
@@ -6193,6 +7862,10 @@ const InputOTPSlot = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6193
7862
|
});
|
|
6194
7863
|
});
|
|
6195
7864
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
7865
|
+
/**
|
|
7866
|
+
* Visual divider placed between OTP groups. Renders a `<div role="separator">`
|
|
7867
|
+
* containing a minus icon.
|
|
7868
|
+
*/
|
|
6196
7869
|
const InputOTPSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
6197
7870
|
const { className, ...props } = componentProps;
|
|
6198
7871
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6208,6 +7881,10 @@ InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
|
6208
7881
|
|
|
6209
7882
|
//#endregion
|
|
6210
7883
|
//#region src/components/item.tsx
|
|
7884
|
+
/**
|
|
7885
|
+
* Container listing multiple `Item`s, rendering a `<div role="list">`. Set `stackedItems` to
|
|
7886
|
+
* collapse the items into a single bordered stack; otherwise items are spaced apart.
|
|
7887
|
+
*/
|
|
6211
7888
|
const ItemGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
6212
7889
|
const { className, stackedItems = false, ...props } = componentProps;
|
|
6213
7890
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6220,6 +7897,10 @@ const ItemGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6220
7897
|
});
|
|
6221
7898
|
});
|
|
6222
7899
|
ItemGroup.displayName = "ItemGroup";
|
|
7900
|
+
/**
|
|
7901
|
+
* Horizontal divider between items, wrapping the `Separator` component with vertical margin.
|
|
7902
|
+
* Renders a `<div role="separator">`.
|
|
7903
|
+
*/
|
|
6223
7904
|
const ItemSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
6224
7905
|
const { className, ...props } = componentProps;
|
|
6225
7906
|
return /* @__PURE__ */ jsx(Separator, {
|
|
@@ -6249,6 +7930,21 @@ const itemVariants = cva("group/item flex w-full flex-wrap items-center rounded-
|
|
|
6249
7930
|
size: "default"
|
|
6250
7931
|
}
|
|
6251
7932
|
});
|
|
7933
|
+
/**
|
|
7934
|
+
* Flexible list-item container laying out media, content, and actions on one row. Renders a `<div>`
|
|
7935
|
+
* by default (swap the element via `render`). The `variant` (`'default' | 'outline' | 'muted'`) and
|
|
7936
|
+
* `size` (`'default' | 'sm' | 'xs'`) both default to `'default'`.
|
|
7937
|
+
*
|
|
7938
|
+
* @example
|
|
7939
|
+
* ```tsx
|
|
7940
|
+
* <Item>
|
|
7941
|
+
* <ItemContent>
|
|
7942
|
+
* <ItemTitle>Title</ItemTitle>
|
|
7943
|
+
* <ItemDescription>Supporting text</ItemDescription>
|
|
7944
|
+
* </ItemContent>
|
|
7945
|
+
* </Item>
|
|
7946
|
+
* ```
|
|
7947
|
+
*/
|
|
6252
7948
|
const Item = React.forwardRef((componentProps, forwardRef) => {
|
|
6253
7949
|
const { className, variant = "default", size = "default", render, ...props } = componentProps;
|
|
6254
7950
|
return useRender({
|
|
@@ -6278,6 +7974,10 @@ const itemMediaVariants = cva("flex shrink-0 items-center justify-center gap-2 g
|
|
|
6278
7974
|
} },
|
|
6279
7975
|
defaultVariants: { variant: "default" }
|
|
6280
7976
|
});
|
|
7977
|
+
/**
|
|
7978
|
+
* Leading media slot of an `Item` (icon, image, or avatar). Renders a `<div>`. The `variant`
|
|
7979
|
+
* (`'default' | 'icon' | 'image'`) tunes sizing and styling and defaults to `'default'`.
|
|
7980
|
+
*/
|
|
6281
7981
|
const ItemMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
6282
7982
|
const { className, variant = "default", ...props } = componentProps;
|
|
6283
7983
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6292,6 +7992,9 @@ const ItemMedia = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6292
7992
|
});
|
|
6293
7993
|
});
|
|
6294
7994
|
ItemMedia.displayName = "ItemMedia";
|
|
7995
|
+
/**
|
|
7996
|
+
* Main content column of an `Item`, stacking its title and description. Renders a `<div>`.
|
|
7997
|
+
*/
|
|
6295
7998
|
const ItemContent = React.forwardRef((componentProps, forwardRef) => {
|
|
6296
7999
|
const { className, ...props } = componentProps;
|
|
6297
8000
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6302,6 +8005,9 @@ const ItemContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6302
8005
|
});
|
|
6303
8006
|
});
|
|
6304
8007
|
ItemContent.displayName = "ItemContent";
|
|
8008
|
+
/**
|
|
8009
|
+
* Primary title line of an `Item`. Renders a `<div>` in medium-weight text clamped to one line.
|
|
8010
|
+
*/
|
|
6305
8011
|
const ItemTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
6306
8012
|
const { className, ...props } = componentProps;
|
|
6307
8013
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6312,6 +8018,9 @@ const ItemTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6312
8018
|
});
|
|
6313
8019
|
});
|
|
6314
8020
|
ItemTitle.displayName = "ItemTitle";
|
|
8021
|
+
/**
|
|
8022
|
+
* Secondary supporting text of an `Item`. Renders a `<p>` in muted text clamped to two lines.
|
|
8023
|
+
*/
|
|
6315
8024
|
const ItemDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
6316
8025
|
const { className, ...props } = componentProps;
|
|
6317
8026
|
return /* @__PURE__ */ jsx("p", {
|
|
@@ -6322,6 +8031,9 @@ const ItemDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6322
8031
|
});
|
|
6323
8032
|
});
|
|
6324
8033
|
ItemDescription.displayName = "ItemDescription";
|
|
8034
|
+
/**
|
|
8035
|
+
* Trailing actions slot of an `Item` (buttons, menus). Renders a `<div>` laying children in a row.
|
|
8036
|
+
*/
|
|
6325
8037
|
const ItemActions = React.forwardRef((componentProps, forwardRef) => {
|
|
6326
8038
|
const { className, ...props } = componentProps;
|
|
6327
8039
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6332,6 +8044,9 @@ const ItemActions = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6332
8044
|
});
|
|
6333
8045
|
});
|
|
6334
8046
|
ItemActions.displayName = "ItemActions";
|
|
8047
|
+
/**
|
|
8048
|
+
* Full-width header row spanning the top of an `Item`. Renders a `<div>` with space-between layout.
|
|
8049
|
+
*/
|
|
6335
8050
|
const ItemHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
6336
8051
|
const { className, ...props } = componentProps;
|
|
6337
8052
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6342,6 +8057,9 @@ const ItemHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6342
8057
|
});
|
|
6343
8058
|
});
|
|
6344
8059
|
ItemHeader.displayName = "ItemHeader";
|
|
8060
|
+
/**
|
|
8061
|
+
* Full-width footer row spanning the bottom of an `Item`. Renders a `<div>` with space-between layout.
|
|
8062
|
+
*/
|
|
6345
8063
|
const ItemFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
6346
8064
|
const { className, ...props } = componentProps;
|
|
6347
8065
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6391,6 +8109,20 @@ Anchor.displayName = "Anchor";
|
|
|
6391
8109
|
|
|
6392
8110
|
//#endregion
|
|
6393
8111
|
//#region src/components/list.tsx
|
|
8112
|
+
/**
|
|
8113
|
+
* Vertical list container. Renders a `<div>` with a `flex flex-col` layout that
|
|
8114
|
+
* stacks `ListRow` children.
|
|
8115
|
+
*
|
|
8116
|
+
* @example
|
|
8117
|
+
* ```tsx
|
|
8118
|
+
* <List>
|
|
8119
|
+
* <ListRow>
|
|
8120
|
+
* <ListCol>Icon</ListCol>
|
|
8121
|
+
* <ListCol grow>Label</ListCol>
|
|
8122
|
+
* </ListRow>
|
|
8123
|
+
* </List>
|
|
8124
|
+
* ```
|
|
8125
|
+
*/
|
|
6394
8126
|
const List = React.forwardRef((componentProps, forwardRef) => {
|
|
6395
8127
|
const { children, className, ...props } = componentProps;
|
|
6396
8128
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6401,6 +8133,10 @@ const List = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6401
8133
|
});
|
|
6402
8134
|
});
|
|
6403
8135
|
List.displayName = "List";
|
|
8136
|
+
/**
|
|
8137
|
+
* A single row within a `List`. Renders a `<div>` using a two-column CSS grid
|
|
8138
|
+
* (`minmax(0,auto) 1fr`) to lay out its `ListCol` children.
|
|
8139
|
+
*/
|
|
6404
8140
|
const ListRow = React.forwardRef((componentProps, forwardRef) => {
|
|
6405
8141
|
const { children, className, ...props } = componentProps;
|
|
6406
8142
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6411,6 +8147,10 @@ const ListRow = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6411
8147
|
});
|
|
6412
8148
|
});
|
|
6413
8149
|
ListRow.displayName = "ListRow";
|
|
8150
|
+
/**
|
|
8151
|
+
* A cell within a `ListRow`. Renders a `<div>`; by default it is pinned to grid
|
|
8152
|
+
* row 1, unless `wrap` is set, allowing it to flow onto a new row.
|
|
8153
|
+
*/
|
|
6414
8154
|
const ListCol = React.forwardRef((componentProps, forwardRef) => {
|
|
6415
8155
|
const { grow, wrap, children, className, ...props } = componentProps;
|
|
6416
8156
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6424,6 +8164,30 @@ ListCol.displayName = "ListCol";
|
|
|
6424
8164
|
|
|
6425
8165
|
//#endregion
|
|
6426
8166
|
//#region src/components/pagination.tsx
|
|
8167
|
+
/**
|
|
8168
|
+
* Root navigation container for a set of pagination controls.
|
|
8169
|
+
* Renders a `<nav role="navigation">` with a localized `aria-label`.
|
|
8170
|
+
*
|
|
8171
|
+
* @example
|
|
8172
|
+
* ```tsx
|
|
8173
|
+
* <Pagination>
|
|
8174
|
+
* <PaginationContent>
|
|
8175
|
+
* <PaginationItem>
|
|
8176
|
+
* <PaginationPrevious href="#" />
|
|
8177
|
+
* </PaginationItem>
|
|
8178
|
+
* <PaginationItem>
|
|
8179
|
+
* <PaginationLink href="#" isActive>1</PaginationLink>
|
|
8180
|
+
* </PaginationItem>
|
|
8181
|
+
* <PaginationItem>
|
|
8182
|
+
* <PaginationEllipsis />
|
|
8183
|
+
* </PaginationItem>
|
|
8184
|
+
* <PaginationItem>
|
|
8185
|
+
* <PaginationNext href="#" />
|
|
8186
|
+
* </PaginationItem>
|
|
8187
|
+
* </PaginationContent>
|
|
8188
|
+
* </Pagination>
|
|
8189
|
+
* ```
|
|
8190
|
+
*/
|
|
6427
8191
|
const Pagination = React.forwardRef((componentProps, forwardRef) => {
|
|
6428
8192
|
const { className, ...props } = componentProps;
|
|
6429
8193
|
const t = useDsTranslation("ds");
|
|
@@ -6437,6 +8201,9 @@ const Pagination = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6437
8201
|
});
|
|
6438
8202
|
});
|
|
6439
8203
|
Pagination.displayName = "Pagination";
|
|
8204
|
+
/**
|
|
8205
|
+
* Ordered list wrapper for pagination items. Renders a `<ul>`.
|
|
8206
|
+
*/
|
|
6440
8207
|
const PaginationContent = React.forwardRef((componentProps, forwardRef) => {
|
|
6441
8208
|
const { className, ...props } = componentProps;
|
|
6442
8209
|
return /* @__PURE__ */ jsx("ul", {
|
|
@@ -6447,6 +8214,9 @@ const PaginationContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6447
8214
|
});
|
|
6448
8215
|
});
|
|
6449
8216
|
PaginationContent.displayName = "PaginationContent";
|
|
8217
|
+
/**
|
|
8218
|
+
* Single list item holding one pagination control. Renders a `<li>`.
|
|
8219
|
+
*/
|
|
6450
8220
|
const PaginationItem = React.forwardRef((componentProps, forwardRef) => {
|
|
6451
8221
|
const { ...props } = componentProps;
|
|
6452
8222
|
return /* @__PURE__ */ jsx("li", {
|
|
@@ -6456,6 +8226,10 @@ const PaginationItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6456
8226
|
});
|
|
6457
8227
|
});
|
|
6458
8228
|
PaginationItem.displayName = "PaginationItem";
|
|
8229
|
+
/**
|
|
8230
|
+
* Clickable page link styled as a button. Renders an `<a>` via `Button` (outline
|
|
8231
|
+
* when active, ghost otherwise) and sets `aria-current="page"` while active.
|
|
8232
|
+
*/
|
|
6459
8233
|
const PaginationLink = React.forwardRef((componentProps, forwardRef) => {
|
|
6460
8234
|
const { className, isActive, size = "icon", ...props } = componentProps;
|
|
6461
8235
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -6473,6 +8247,10 @@ const PaginationLink = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6473
8247
|
});
|
|
6474
8248
|
});
|
|
6475
8249
|
PaginationLink.displayName = "PaginationLink";
|
|
8250
|
+
/**
|
|
8251
|
+
* "Previous page" control. Renders a `PaginationLink` (`<a>`) with a leading
|
|
8252
|
+
* chevron and a label hidden below the `sm` breakpoint.
|
|
8253
|
+
*/
|
|
6476
8254
|
const PaginationPrevious = React.forwardRef((componentProps, forwardRef) => {
|
|
6477
8255
|
const { className, text, ...props } = componentProps;
|
|
6478
8256
|
const t = useDsTranslation("ds");
|
|
@@ -6490,6 +8268,10 @@ const PaginationPrevious = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6490
8268
|
});
|
|
6491
8269
|
});
|
|
6492
8270
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
8271
|
+
/**
|
|
8272
|
+
* "Next page" control. Renders a `PaginationLink` (`<a>`) with a trailing
|
|
8273
|
+
* chevron and a label hidden below the `sm` breakpoint.
|
|
8274
|
+
*/
|
|
6493
8275
|
const PaginationNext = React.forwardRef((componentProps, forwardRef) => {
|
|
6494
8276
|
const { className, text, ...props } = componentProps;
|
|
6495
8277
|
const t = useDsTranslation("ds");
|
|
@@ -6507,6 +8289,10 @@ const PaginationNext = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6507
8289
|
});
|
|
6508
8290
|
});
|
|
6509
8291
|
PaginationNext.displayName = "PaginationNext";
|
|
8292
|
+
/**
|
|
8293
|
+
* Non-interactive gap indicator for omitted page ranges. Renders an
|
|
8294
|
+
* `aria-hidden` `<span>` with an ellipsis icon and screen-reader-only text.
|
|
8295
|
+
*/
|
|
6510
8296
|
const PaginationEllipsis = React.forwardRef((componentProps, forwardRef) => {
|
|
6511
8297
|
const { className, ...props } = componentProps;
|
|
6512
8298
|
return /* @__PURE__ */ jsxs("span", {
|
|
@@ -6525,6 +8311,18 @@ PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
|
6525
8311
|
|
|
6526
8312
|
//#endregion
|
|
6527
8313
|
//#region src/components/progress.tsx
|
|
8314
|
+
/**
|
|
8315
|
+
* Progress bar root. Renders the Base UI `Progress.Root` `<div>` and wraps its
|
|
8316
|
+
* children, then appends a default `ProgressTrack`/`ProgressIndicator` pair.
|
|
8317
|
+
*
|
|
8318
|
+
* @example
|
|
8319
|
+
* ```tsx
|
|
8320
|
+
* <Progress value={60}>
|
|
8321
|
+
* <ProgressLabel>Uploading</ProgressLabel>
|
|
8322
|
+
* <ProgressValue />
|
|
8323
|
+
* </Progress>
|
|
8324
|
+
* ```
|
|
8325
|
+
*/
|
|
6528
8326
|
const Progress = React.forwardRef((componentProps, forwardRef) => {
|
|
6529
8327
|
const { className, children, value, ...props } = componentProps;
|
|
6530
8328
|
return /* @__PURE__ */ jsxs(Progress$1.Root, {
|
|
@@ -6537,6 +8335,10 @@ const Progress = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6537
8335
|
});
|
|
6538
8336
|
});
|
|
6539
8337
|
Progress.displayName = "Progress";
|
|
8338
|
+
/**
|
|
8339
|
+
* Track (rail) the indicator fills against. Renders the Base UI `Progress.Track`
|
|
8340
|
+
* as a rounded muted `<div>`; place a `ProgressIndicator` inside it.
|
|
8341
|
+
*/
|
|
6540
8342
|
const ProgressTrack = React.forwardRef((componentProps, forwardRef) => {
|
|
6541
8343
|
const { className, ...props } = componentProps;
|
|
6542
8344
|
return /* @__PURE__ */ jsx(Progress$1.Track, {
|
|
@@ -6547,6 +8349,10 @@ const ProgressTrack = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6547
8349
|
});
|
|
6548
8350
|
});
|
|
6549
8351
|
ProgressTrack.displayName = "ProgressTrack";
|
|
8352
|
+
/**
|
|
8353
|
+
* Filled portion of the track, sized to the current value. Renders the Base UI
|
|
8354
|
+
* `Progress.Indicator` as a primary-colored `<div>`.
|
|
8355
|
+
*/
|
|
6550
8356
|
const ProgressIndicator = React.forwardRef((componentProps, forwardRef) => {
|
|
6551
8357
|
const { className, ...props } = componentProps;
|
|
6552
8358
|
return /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
@@ -6557,6 +8363,10 @@ const ProgressIndicator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6557
8363
|
});
|
|
6558
8364
|
});
|
|
6559
8365
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
8366
|
+
/**
|
|
8367
|
+
* Accessible text label for the progress bar. Renders the Base UI
|
|
8368
|
+
* `Progress.Label` as a small medium-weight `<span>`.
|
|
8369
|
+
*/
|
|
6560
8370
|
const ProgressLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
6561
8371
|
const { className, ...props } = componentProps;
|
|
6562
8372
|
return /* @__PURE__ */ jsx(Progress$1.Label, {
|
|
@@ -6567,6 +8377,10 @@ const ProgressLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6567
8377
|
});
|
|
6568
8378
|
});
|
|
6569
8379
|
ProgressLabel.displayName = "ProgressLabel";
|
|
8380
|
+
/**
|
|
8381
|
+
* Formatted numeric readout (e.g. the percentage). Renders the Base UI
|
|
8382
|
+
* `Progress.Value` as a muted, right-aligned tabular `<span>`.
|
|
8383
|
+
*/
|
|
6570
8384
|
const ProgressValue = React.forwardRef((componentProps, forwardRef) => {
|
|
6571
8385
|
const { className, ...props } = componentProps;
|
|
6572
8386
|
return /* @__PURE__ */ jsx(Progress$1.Value, {
|
|
@@ -6580,6 +8394,18 @@ ProgressValue.displayName = "ProgressValue";
|
|
|
6580
8394
|
|
|
6581
8395
|
//#endregion
|
|
6582
8396
|
//#region src/components/radio-group.tsx
|
|
8397
|
+
/**
|
|
8398
|
+
* Root container grouping mutually exclusive radio options, wrapping Base UI's `RadioGroup`.
|
|
8399
|
+
* Renders a `<div role="radiogroup">` that lays out its `RadioGroupItem`s in a vertical grid.
|
|
8400
|
+
*
|
|
8401
|
+
* @example
|
|
8402
|
+
* ```tsx
|
|
8403
|
+
* <RadioGroup defaultValue="a">
|
|
8404
|
+
* <RadioGroupItem value="a" />
|
|
8405
|
+
* <RadioGroupItem value="b" />
|
|
8406
|
+
* </RadioGroup>
|
|
8407
|
+
* ```
|
|
8408
|
+
*/
|
|
6583
8409
|
const RadioGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
6584
8410
|
const { className, ...props } = componentProps;
|
|
6585
8411
|
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
@@ -6590,6 +8416,10 @@ const RadioGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6590
8416
|
});
|
|
6591
8417
|
});
|
|
6592
8418
|
RadioGroup.displayName = "RadioGroup";
|
|
8419
|
+
/**
|
|
8420
|
+
* A single selectable option within a `RadioGroup`, wrapping Base UI's `Radio.Root`.
|
|
8421
|
+
* Renders a `<button role="radio">` with a filled dot indicator shown when selected.
|
|
8422
|
+
*/
|
|
6593
8423
|
const RadioGroupItem = React.forwardRef((componentProps, forwardRef) => {
|
|
6594
8424
|
const { className, ...props } = componentProps;
|
|
6595
8425
|
return /* @__PURE__ */ jsx(Radio.Root, {
|
|
@@ -6608,14 +8438,36 @@ RadioGroupItem.displayName = "RadioGroupItem";
|
|
|
6608
8438
|
|
|
6609
8439
|
//#endregion
|
|
6610
8440
|
//#region src/components/select.tsx
|
|
6611
|
-
|
|
8441
|
+
/** `class-variance-authority` variants for the select trigger; exposes the `size` variant. */
|
|
8442
|
+
const selectTriggerVariants = cva("flex w-fit items-center justify-between rounded-md border border-input bg-transparent py-2 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive focus-visible:aria-invalid:ring-3 focus-visible:aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 bg-background dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:focus-visible:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
6612
8443
|
variants: { size: {
|
|
6613
8444
|
default: "h-10 gap-2 px-3",
|
|
6614
8445
|
sm: "h-8 gap-1.5 px-2"
|
|
6615
8446
|
} },
|
|
6616
8447
|
defaultVariants: { size: "default" }
|
|
6617
8448
|
});
|
|
8449
|
+
/**
|
|
8450
|
+
* Root of the select, aliasing Base UI's `Select.Root`. Manages open state and the selected value,
|
|
8451
|
+
* and renders no DOM element — place `SelectTrigger` and `SelectContent` inside it.
|
|
8452
|
+
*
|
|
8453
|
+
* @example
|
|
8454
|
+
* ```tsx
|
|
8455
|
+
* <Select>
|
|
8456
|
+
* <SelectTrigger>
|
|
8457
|
+
* <SelectValue placeholder="Pick one" />
|
|
8458
|
+
* </SelectTrigger>
|
|
8459
|
+
* <SelectContent>
|
|
8460
|
+
* <SelectItem value="a">Option A</SelectItem>
|
|
8461
|
+
* <SelectItem value="b">Option B</SelectItem>
|
|
8462
|
+
* </SelectContent>
|
|
8463
|
+
* </Select>
|
|
8464
|
+
* ```
|
|
8465
|
+
*/
|
|
6618
8466
|
const Select = Select$1.Root;
|
|
8467
|
+
/**
|
|
8468
|
+
* Groups related items under a shared `SelectLabel`, wrapping Base UI's `Select.Group`. Renders a
|
|
8469
|
+
* `<div role="group">`.
|
|
8470
|
+
*/
|
|
6619
8471
|
const SelectGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
6620
8472
|
const { className, ...props } = componentProps;
|
|
6621
8473
|
return /* @__PURE__ */ jsx(Select$1.Group, {
|
|
@@ -6626,6 +8478,10 @@ const SelectGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6626
8478
|
});
|
|
6627
8479
|
});
|
|
6628
8480
|
SelectGroup.displayName = "SelectGroup";
|
|
8481
|
+
/**
|
|
8482
|
+
* Displays the currently selected value (or a `placeholder`) inside `SelectTrigger`, wrapping Base
|
|
8483
|
+
* UI's `Select.Value`. Renders no element of its own — it forwards its rendered content.
|
|
8484
|
+
*/
|
|
6629
8485
|
function SelectValue(componentProps) {
|
|
6630
8486
|
const { className, ...props } = componentProps;
|
|
6631
8487
|
return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
@@ -6634,6 +8490,11 @@ function SelectValue(componentProps) {
|
|
|
6634
8490
|
...props
|
|
6635
8491
|
});
|
|
6636
8492
|
}
|
|
8493
|
+
/**
|
|
8494
|
+
* Button that opens the select popup and shows the current value, wrapping Base UI's
|
|
8495
|
+
* `Select.Trigger`. Renders a `<button>` with a trailing chevron icon. The `size` variant
|
|
8496
|
+
* (`'default' | 'sm'`) controls height and padding and defaults to `'default'`.
|
|
8497
|
+
*/
|
|
6637
8498
|
const SelectTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
6638
8499
|
const { className, size = "default", children, ...props } = componentProps;
|
|
6639
8500
|
return /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
@@ -6646,6 +8507,12 @@ const SelectTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6646
8507
|
});
|
|
6647
8508
|
});
|
|
6648
8509
|
SelectTrigger.displayName = "SelectTrigger";
|
|
8510
|
+
/**
|
|
8511
|
+
* Popup panel listing the select items, wrapping Base UI's `Select.Popup` (with its own `Portal`
|
|
8512
|
+
* and `Positioner`). Renders a floating `<div>` and includes scroll up/down buttons around the
|
|
8513
|
+
* item list. Positioner-derived props default to: `side` `'bottom'`, `sideOffset` `4`, `align`
|
|
8514
|
+
* `'start'`, `alignOffset` `0`, `alignItemWithTrigger` `false`.
|
|
8515
|
+
*/
|
|
6649
8516
|
const SelectContent = React.forwardRef((componentProps, forwardRef) => {
|
|
6650
8517
|
const { className, children, side = "bottom", sideOffset = 4, align = "start", alignOffset = 0, alignItemWithTrigger = false, ...props } = componentProps;
|
|
6651
8518
|
return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
@@ -6670,6 +8537,10 @@ const SelectContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6670
8537
|
}) });
|
|
6671
8538
|
});
|
|
6672
8539
|
SelectContent.displayName = "SelectContent";
|
|
8540
|
+
/**
|
|
8541
|
+
* Non-interactive heading for a `SelectGroup`, wrapping Base UI's `Select.GroupLabel`. Renders a
|
|
8542
|
+
* `<div>` in muted, small type.
|
|
8543
|
+
*/
|
|
6673
8544
|
const SelectLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
6674
8545
|
const { className, ...props } = componentProps;
|
|
6675
8546
|
return /* @__PURE__ */ jsx(Select$1.GroupLabel, {
|
|
@@ -6680,6 +8551,10 @@ const SelectLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6680
8551
|
});
|
|
6681
8552
|
});
|
|
6682
8553
|
SelectLabel.displayName = "SelectLabel";
|
|
8554
|
+
/**
|
|
8555
|
+
* A selectable option inside `SelectContent`, wrapping Base UI's `Select.Item`. Renders a
|
|
8556
|
+
* `<div role="option">` holding the item text plus a trailing check indicator shown when selected.
|
|
8557
|
+
*/
|
|
6683
8558
|
const SelectItem = React.forwardRef((componentProps, forwardRef) => {
|
|
6684
8559
|
const { className, children, ...props } = componentProps;
|
|
6685
8560
|
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
@@ -6698,6 +8573,10 @@ const SelectItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6698
8573
|
});
|
|
6699
8574
|
});
|
|
6700
8575
|
SelectItem.displayName = "SelectItem";
|
|
8576
|
+
/**
|
|
8577
|
+
* Visual divider between select items or groups, wrapping Base UI's `Select.Separator`. Renders a
|
|
8578
|
+
* `<div>` styled as a thin horizontal rule.
|
|
8579
|
+
*/
|
|
6701
8580
|
const SelectSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
6702
8581
|
const { className, ...props } = componentProps;
|
|
6703
8582
|
return /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
@@ -6708,6 +8587,10 @@ const SelectSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6708
8587
|
});
|
|
6709
8588
|
});
|
|
6710
8589
|
SelectSeparator.displayName = "SelectSeparator";
|
|
8590
|
+
/**
|
|
8591
|
+
* Button at the top of `SelectContent` that scrolls the list upward when it overflows, wrapping
|
|
8592
|
+
* Base UI's `Select.ScrollUpArrow`. Renders a `<div>` containing an up-chevron icon.
|
|
8593
|
+
*/
|
|
6711
8594
|
const SelectScrollUpButton = React.forwardRef((componentProps, forwardRef) => {
|
|
6712
8595
|
const { className, ...props } = componentProps;
|
|
6713
8596
|
return /* @__PURE__ */ jsx(Select$1.ScrollUpArrow, {
|
|
@@ -6719,6 +8602,10 @@ const SelectScrollUpButton = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6719
8602
|
});
|
|
6720
8603
|
});
|
|
6721
8604
|
SelectScrollUpButton.displayName = "SelectScrollUpButton";
|
|
8605
|
+
/**
|
|
8606
|
+
* Button at the bottom of `SelectContent` that scrolls the list downward when it overflows, wrapping
|
|
8607
|
+
* Base UI's `Select.ScrollDownArrow`. Renders a `<div>` containing a down-chevron icon.
|
|
8608
|
+
*/
|
|
6722
8609
|
const SelectScrollDownButton = React.forwardRef((componentProps, forwardRef) => {
|
|
6723
8610
|
const { className, ...props } = componentProps;
|
|
6724
8611
|
return /* @__PURE__ */ jsx(Select$1.ScrollDownArrow, {
|
|
@@ -6733,12 +8620,33 @@ SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
|
6733
8620
|
|
|
6734
8621
|
//#endregion
|
|
6735
8622
|
//#region src/components/sheet.tsx
|
|
8623
|
+
/**
|
|
8624
|
+
* Root container for a sheet (a Dialog that slides in from a screen edge),
|
|
8625
|
+
* wrapping Base UI's `Dialog.Root`. Manages open/close state and renders no DOM
|
|
8626
|
+
* element — place `SheetTrigger` and `SheetContent` inside it.
|
|
8627
|
+
*
|
|
8628
|
+
* @example
|
|
8629
|
+
* ```tsx
|
|
8630
|
+
* <Sheet>
|
|
8631
|
+
* <SheetTrigger render={<Button />}>Open</SheetTrigger>
|
|
8632
|
+
* <SheetContent side="right">
|
|
8633
|
+
* <SheetHeader>
|
|
8634
|
+
* <SheetTitle>Title</SheetTitle>
|
|
8635
|
+
* </SheetHeader>
|
|
8636
|
+
* </SheetContent>
|
|
8637
|
+
* </Sheet>
|
|
8638
|
+
* ```
|
|
8639
|
+
*/
|
|
6736
8640
|
function Sheet(componentProps) {
|
|
6737
8641
|
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
6738
8642
|
"data-slot": "sheet",
|
|
6739
8643
|
...componentProps
|
|
6740
8644
|
});
|
|
6741
8645
|
}
|
|
8646
|
+
/**
|
|
8647
|
+
* The element that opens the sheet, wrapping `Dialog.Trigger`.
|
|
8648
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
8649
|
+
*/
|
|
6742
8650
|
const SheetTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
6743
8651
|
const { ...props } = componentProps;
|
|
6744
8652
|
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
@@ -6748,6 +8656,10 @@ const SheetTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6748
8656
|
});
|
|
6749
8657
|
});
|
|
6750
8658
|
SheetTrigger.displayName = "SheetTrigger";
|
|
8659
|
+
/**
|
|
8660
|
+
* An element that closes the sheet when activated, wrapping `Dialog.Close`.
|
|
8661
|
+
* Renders a `<button>` by default; use `render` to swap the element.
|
|
8662
|
+
*/
|
|
6751
8663
|
const SheetClose = React.forwardRef((componentProps, forwardRef) => {
|
|
6752
8664
|
const { ...props } = componentProps;
|
|
6753
8665
|
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
@@ -6773,6 +8685,11 @@ const SheetOverlay = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6773
8685
|
});
|
|
6774
8686
|
});
|
|
6775
8687
|
SheetOverlay.displayName = "SheetOverlay";
|
|
8688
|
+
/**
|
|
8689
|
+
* The sliding panel shown when the sheet is open. Composes
|
|
8690
|
+
* `Dialog.Portal → Backdrop → Dialog.Popup` into a single part and renders a
|
|
8691
|
+
* `<div>` popup fixed to the chosen screen edge, optionally with a close button.
|
|
8692
|
+
*/
|
|
6776
8693
|
const SheetContent = React.forwardRef((componentProps, forwardRef) => {
|
|
6777
8694
|
const { className, children, side = "right", showCloseButton = true, container, ...props } = componentProps;
|
|
6778
8695
|
return /* @__PURE__ */ jsxs(SheetPortal, {
|
|
@@ -6799,6 +8716,10 @@ const SheetContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6799
8716
|
});
|
|
6800
8717
|
});
|
|
6801
8718
|
SheetContent.displayName = "SheetContent";
|
|
8719
|
+
/**
|
|
8720
|
+
* Header region of the sheet, typically holding the title and description.
|
|
8721
|
+
* Renders a `<div>`.
|
|
8722
|
+
*/
|
|
6802
8723
|
const SheetHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
6803
8724
|
const { className, ...props } = componentProps;
|
|
6804
8725
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6809,6 +8730,10 @@ const SheetHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6809
8730
|
});
|
|
6810
8731
|
});
|
|
6811
8732
|
SheetHeader.displayName = "SheetHeader";
|
|
8733
|
+
/**
|
|
8734
|
+
* Footer region of the sheet, typically holding actions; pinned to the bottom.
|
|
8735
|
+
* Renders a `<div>`.
|
|
8736
|
+
*/
|
|
6812
8737
|
const SheetFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
6813
8738
|
const { className, ...props } = componentProps;
|
|
6814
8739
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -6819,6 +8744,10 @@ const SheetFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6819
8744
|
});
|
|
6820
8745
|
});
|
|
6821
8746
|
SheetFooter.displayName = "SheetFooter";
|
|
8747
|
+
/**
|
|
8748
|
+
* Accessible title for the sheet, wrapping `Dialog.Title`.
|
|
8749
|
+
* Renders an `<h2>` and labels the sheet for assistive technology.
|
|
8750
|
+
*/
|
|
6822
8751
|
const SheetTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
6823
8752
|
const { className, ...props } = componentProps;
|
|
6824
8753
|
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
@@ -6829,6 +8758,10 @@ const SheetTitle = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6829
8758
|
});
|
|
6830
8759
|
});
|
|
6831
8760
|
SheetTitle.displayName = "SheetTitle";
|
|
8761
|
+
/**
|
|
8762
|
+
* Accessible supporting text for the sheet, wrapping `Dialog.Description`.
|
|
8763
|
+
* Renders a `<p>` and describes the sheet for assistive technology.
|
|
8764
|
+
*/
|
|
6832
8765
|
const SheetDescription = React.forwardRef((componentProps, forwardRef) => {
|
|
6833
8766
|
const { className, ...props } = componentProps;
|
|
6834
8767
|
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
@@ -6842,6 +8775,22 @@ SheetDescription.displayName = "SheetDescription";
|
|
|
6842
8775
|
|
|
6843
8776
|
//#endregion
|
|
6844
8777
|
//#region src/components/tooltip.tsx
|
|
8778
|
+
/**
|
|
8779
|
+
* Shares delay timing across all tooltips nested inside it, so moving between
|
|
8780
|
+
* neighbouring triggers reuses the open state instead of re-triggering the delay.
|
|
8781
|
+
*
|
|
8782
|
+
* Renders no DOM element — wrap a subtree of `Tooltip` instances in it.
|
|
8783
|
+
*
|
|
8784
|
+
* @prop delay - Milliseconds to wait before showing a tooltip. Default: `0`.
|
|
8785
|
+
*
|
|
8786
|
+
* @example
|
|
8787
|
+
* ```tsx
|
|
8788
|
+
* <TooltipProvider delay={200}>
|
|
8789
|
+
* <Tooltip>…</Tooltip>
|
|
8790
|
+
* <Tooltip>…</Tooltip>
|
|
8791
|
+
* </TooltipProvider>
|
|
8792
|
+
* ```
|
|
8793
|
+
*/
|
|
6845
8794
|
function TooltipProvider(componentProps) {
|
|
6846
8795
|
const { delay = 0, ...props } = componentProps;
|
|
6847
8796
|
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
@@ -6850,6 +8799,24 @@ function TooltipProvider(componentProps) {
|
|
|
6850
8799
|
...props
|
|
6851
8800
|
});
|
|
6852
8801
|
}
|
|
8802
|
+
/**
|
|
8803
|
+
* Root of a single tooltip. Manages its open/close state and connects the
|
|
8804
|
+
* trigger to the content.
|
|
8805
|
+
*
|
|
8806
|
+
* Renders no DOM element — place `TooltipTrigger` and `TooltipContent` inside
|
|
8807
|
+
* it. Supports controlled (`open` + `onOpenChange`) and uncontrolled
|
|
8808
|
+
* (`defaultOpen`) modes.
|
|
8809
|
+
*
|
|
8810
|
+
* @example
|
|
8811
|
+
* ```tsx
|
|
8812
|
+
* <TooltipProvider>
|
|
8813
|
+
* <Tooltip>
|
|
8814
|
+
* <TooltipTrigger render={<Button />}>Hover me</TooltipTrigger>
|
|
8815
|
+
* <TooltipContent side="top">Helpful hint</TooltipContent>
|
|
8816
|
+
* </Tooltip>
|
|
8817
|
+
* </TooltipProvider>
|
|
8818
|
+
* ```
|
|
8819
|
+
*/
|
|
6853
8820
|
function Tooltip(componentProps) {
|
|
6854
8821
|
const { ...props } = componentProps;
|
|
6855
8822
|
return /* @__PURE__ */ jsx(Tooltip$1.Root, {
|
|
@@ -6857,6 +8824,17 @@ function Tooltip(componentProps) {
|
|
|
6857
8824
|
...props
|
|
6858
8825
|
});
|
|
6859
8826
|
}
|
|
8827
|
+
/**
|
|
8828
|
+
* The element that opens the tooltip on hover or focus.
|
|
8829
|
+
*
|
|
8830
|
+
* Renders a `<button>` by default; pass `render` to project the behaviour onto
|
|
8831
|
+
* another element or component.
|
|
8832
|
+
*
|
|
8833
|
+
* @example
|
|
8834
|
+
* ```tsx
|
|
8835
|
+
* <TooltipTrigger render={<Button variant="ghost" />}>Info</TooltipTrigger>
|
|
8836
|
+
* ```
|
|
8837
|
+
*/
|
|
6860
8838
|
const TooltipTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
6861
8839
|
const { ...props } = componentProps;
|
|
6862
8840
|
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
@@ -6866,6 +8844,25 @@ const TooltipTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6866
8844
|
});
|
|
6867
8845
|
});
|
|
6868
8846
|
TooltipTrigger.displayName = "TooltipTrigger";
|
|
8847
|
+
/**
|
|
8848
|
+
* The floating panel shown while the trigger is hovered or focused.
|
|
8849
|
+
*
|
|
8850
|
+
* Composes `Tooltip.Portal → Tooltip.Positioner → Tooltip.Popup` into a single
|
|
8851
|
+
* part and renders a `<div>` popup (with a small `Tooltip.Arrow`). Positioning
|
|
8852
|
+
* props (`side`, `sideOffset`, `align`, `alignOffset`) are forwarded to the
|
|
8853
|
+
* positioner; all other props (including `className`) go to the popup element.
|
|
8854
|
+
*
|
|
8855
|
+
* @prop side - Which side of the trigger to place the content. Default: `'top'`.
|
|
8856
|
+
* @prop sideOffset - Gap in pixels between the trigger and the content. Default: `4`.
|
|
8857
|
+
* @prop align - Alignment along the cross-axis. Default: `'center'`.
|
|
8858
|
+
* @prop alignOffset - Offset in pixels along the cross-axis. Default: `0`.
|
|
8859
|
+
* @prop container - Portal container the popup is rendered into.
|
|
8860
|
+
*
|
|
8861
|
+
* @example
|
|
8862
|
+
* ```tsx
|
|
8863
|
+
* <TooltipContent side="bottom" align="start">Helpful hint</TooltipContent>
|
|
8864
|
+
* ```
|
|
8865
|
+
*/
|
|
6869
8866
|
const TooltipContent = React.forwardRef((componentProps, forwardRef) => {
|
|
6870
8867
|
const { className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, container, ...props } = componentProps;
|
|
6871
8868
|
return /* @__PURE__ */ jsx(Tooltip$1.Portal, {
|
|
@@ -6914,11 +8911,43 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
6914
8911
|
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
6915
8912
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
6916
8913
|
const SidebarContext = React.createContext(null);
|
|
8914
|
+
/**
|
|
8915
|
+
* Reads the sidebar context. Must be called inside a `SidebarProvider`.
|
|
8916
|
+
* @returns `{ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }`
|
|
8917
|
+
* — the expanded/collapsed state, the desktop and mobile open flags with their
|
|
8918
|
+
* setters, whether the viewport is mobile, and a toggle helper.
|
|
8919
|
+
* @throws if used outside a `SidebarProvider`.
|
|
8920
|
+
*/
|
|
6917
8921
|
function useSidebar() {
|
|
6918
8922
|
const context = React.useContext(SidebarContext);
|
|
6919
8923
|
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
6920
8924
|
return context;
|
|
6921
8925
|
}
|
|
8926
|
+
/**
|
|
8927
|
+
* Root of the sidebar system. Holds open/collapsed state (controlled or
|
|
8928
|
+
* uncontrolled), persists it to a cookie, wires the `Cmd/Ctrl+B` shortcut, and
|
|
8929
|
+
* exposes it via context. Renders a `<div>` wrapper that sets the sidebar CSS
|
|
8930
|
+
* width variables.
|
|
8931
|
+
*
|
|
8932
|
+
* @example
|
|
8933
|
+
* ```tsx
|
|
8934
|
+
* <SidebarProvider>
|
|
8935
|
+
* <Sidebar>
|
|
8936
|
+
* <SidebarContent>
|
|
8937
|
+
* <SidebarMenu>
|
|
8938
|
+
* <SidebarMenuItem>
|
|
8939
|
+
* <SidebarMenuButton>Home</SidebarMenuButton>
|
|
8940
|
+
* </SidebarMenuItem>
|
|
8941
|
+
* </SidebarMenu>
|
|
8942
|
+
* </SidebarContent>
|
|
8943
|
+
* </Sidebar>
|
|
8944
|
+
* <SidebarInset>
|
|
8945
|
+
* <SidebarTrigger />
|
|
8946
|
+
* {children}
|
|
8947
|
+
* </SidebarInset>
|
|
8948
|
+
* </SidebarProvider>
|
|
8949
|
+
* ```
|
|
8950
|
+
*/
|
|
6922
8951
|
const SidebarProvider = React.forwardRef((componentProps, forwardRef) => {
|
|
6923
8952
|
const { defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props } = componentProps;
|
|
6924
8953
|
const isMobile = useIsMobile();
|
|
@@ -6983,6 +9012,11 @@ const SidebarProvider = React.forwardRef((componentProps, forwardRef) => {
|
|
|
6983
9012
|
});
|
|
6984
9013
|
});
|
|
6985
9014
|
SidebarProvider.displayName = "SidebarProvider";
|
|
9015
|
+
/**
|
|
9016
|
+
* Main sidebar container. On desktop renders the fixed sidebar `<div>` (gap +
|
|
9017
|
+
* container + inner) reacting to the collapsible mode; on mobile renders inside
|
|
9018
|
+
* a `Sheet`; with `collapsible="none"` renders a plain static `<div>`.
|
|
9019
|
+
*/
|
|
6986
9020
|
const Sidebar = React.forwardRef((componentProps, forwardRef) => {
|
|
6987
9021
|
const { side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, dir, ...props } = componentProps;
|
|
6988
9022
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
@@ -7040,6 +9074,10 @@ const Sidebar = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7040
9074
|
});
|
|
7041
9075
|
});
|
|
7042
9076
|
Sidebar.displayName = "Sidebar";
|
|
9077
|
+
/**
|
|
9078
|
+
* Ghost icon button that toggles the sidebar open/closed. Renders a `Button`
|
|
9079
|
+
* (`<button>`) with a panel icon.
|
|
9080
|
+
*/
|
|
7043
9081
|
const SidebarTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
7044
9082
|
const { className, onClick, ...props } = componentProps;
|
|
7045
9083
|
const { toggleSidebar } = useSidebar();
|
|
@@ -7063,6 +9101,10 @@ const SidebarTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7063
9101
|
});
|
|
7064
9102
|
});
|
|
7065
9103
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
9104
|
+
/**
|
|
9105
|
+
* Thin draggable-looking rail along the sidebar edge that toggles it on click.
|
|
9106
|
+
* Renders a `<button>`.
|
|
9107
|
+
*/
|
|
7066
9108
|
const SidebarRail = React.forwardRef((componentProps, forwardRef) => {
|
|
7067
9109
|
const { className, ...props } = componentProps;
|
|
7068
9110
|
const { toggleSidebar } = useSidebar();
|
|
@@ -7080,6 +9122,10 @@ const SidebarRail = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7080
9122
|
});
|
|
7081
9123
|
});
|
|
7082
9124
|
SidebarRail.displayName = "SidebarRail";
|
|
9125
|
+
/**
|
|
9126
|
+
* Main content area shown beside the sidebar. Renders a `<main>` that adapts its
|
|
9127
|
+
* margins and rounding for the `inset` variant.
|
|
9128
|
+
*/
|
|
7083
9129
|
const SidebarInset = React.forwardRef((componentProps, forwardRef) => {
|
|
7084
9130
|
const { className, ...props } = componentProps;
|
|
7085
9131
|
return /* @__PURE__ */ jsx("main", {
|
|
@@ -7090,6 +9136,9 @@ const SidebarInset = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7090
9136
|
});
|
|
7091
9137
|
});
|
|
7092
9138
|
SidebarInset.displayName = "SidebarInset";
|
|
9139
|
+
/**
|
|
9140
|
+
* Search/filter input styled for the sidebar. Renders an `Input` (`<input>`).
|
|
9141
|
+
*/
|
|
7093
9142
|
const SidebarInput = React.forwardRef((componentProps, forwardRef) => {
|
|
7094
9143
|
const { className, ...props } = componentProps;
|
|
7095
9144
|
return /* @__PURE__ */ jsx(Input, {
|
|
@@ -7101,6 +9150,9 @@ const SidebarInput = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7101
9150
|
});
|
|
7102
9151
|
});
|
|
7103
9152
|
SidebarInput.displayName = "SidebarInput";
|
|
9153
|
+
/**
|
|
9154
|
+
* Header region at the top of the sidebar. Renders a `<div>`.
|
|
9155
|
+
*/
|
|
7104
9156
|
const SidebarHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
7105
9157
|
const { className, ...props } = componentProps;
|
|
7106
9158
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7112,6 +9164,9 @@ const SidebarHeader = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7112
9164
|
});
|
|
7113
9165
|
});
|
|
7114
9166
|
SidebarHeader.displayName = "SidebarHeader";
|
|
9167
|
+
/**
|
|
9168
|
+
* Footer region at the bottom of the sidebar. Renders a `<div>`.
|
|
9169
|
+
*/
|
|
7115
9170
|
const SidebarFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
7116
9171
|
const { className, ...props } = componentProps;
|
|
7117
9172
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7123,6 +9178,9 @@ const SidebarFooter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7123
9178
|
});
|
|
7124
9179
|
});
|
|
7125
9180
|
SidebarFooter.displayName = "SidebarFooter";
|
|
9181
|
+
/**
|
|
9182
|
+
* Divider between sidebar sections. Renders a `Separator` (`<div role="separator">`).
|
|
9183
|
+
*/
|
|
7126
9184
|
const SidebarSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
7127
9185
|
const { className, ...props } = componentProps;
|
|
7128
9186
|
return /* @__PURE__ */ jsx(Separator, {
|
|
@@ -7134,6 +9192,9 @@ const SidebarSeparator = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7134
9192
|
});
|
|
7135
9193
|
});
|
|
7136
9194
|
SidebarSeparator.displayName = "SidebarSeparator";
|
|
9195
|
+
/**
|
|
9196
|
+
* Scrollable middle region holding the sidebar's groups and menus. Renders a `<div>`.
|
|
9197
|
+
*/
|
|
7137
9198
|
const SidebarContent = React.forwardRef((componentProps, forwardRef) => {
|
|
7138
9199
|
const { className, ...props } = componentProps;
|
|
7139
9200
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7145,6 +9206,9 @@ const SidebarContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7145
9206
|
});
|
|
7146
9207
|
});
|
|
7147
9208
|
SidebarContent.displayName = "SidebarContent";
|
|
9209
|
+
/**
|
|
9210
|
+
* Section wrapper grouping a label, action, and content. Renders a `<div>`.
|
|
9211
|
+
*/
|
|
7148
9212
|
const SidebarGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
7149
9213
|
const { className, ...props } = componentProps;
|
|
7150
9214
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7156,6 +9220,10 @@ const SidebarGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7156
9220
|
});
|
|
7157
9221
|
});
|
|
7158
9222
|
SidebarGroup.displayName = "SidebarGroup";
|
|
9223
|
+
/**
|
|
9224
|
+
* Heading label for a sidebar group; hidden when collapsed to icons. Renders a
|
|
9225
|
+
* `<div>` by default, or the element passed via `render`.
|
|
9226
|
+
*/
|
|
7159
9227
|
const SidebarGroupLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
7160
9228
|
const { className, render, ...props } = componentProps;
|
|
7161
9229
|
return useRender({
|
|
@@ -7172,6 +9240,10 @@ const SidebarGroupLabel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7172
9240
|
});
|
|
7173
9241
|
});
|
|
7174
9242
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
9243
|
+
/**
|
|
9244
|
+
* Action button in the top-right corner of a sidebar group. Renders a
|
|
9245
|
+
* `<button>` by default, or the element passed via `render`.
|
|
9246
|
+
*/
|
|
7175
9247
|
const SidebarGroupAction = React.forwardRef((componentProps, forwardRef) => {
|
|
7176
9248
|
const { className, render, ...props } = componentProps;
|
|
7177
9249
|
return useRender({
|
|
@@ -7188,6 +9260,9 @@ const SidebarGroupAction = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7188
9260
|
});
|
|
7189
9261
|
});
|
|
7190
9262
|
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
9263
|
+
/**
|
|
9264
|
+
* Body of a sidebar group. Renders a `<div>`.
|
|
9265
|
+
*/
|
|
7191
9266
|
const SidebarGroupContent = React.forwardRef((componentProps, forwardRef) => {
|
|
7192
9267
|
const { className, ...props } = componentProps;
|
|
7193
9268
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7199,6 +9274,9 @@ const SidebarGroupContent = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7199
9274
|
});
|
|
7200
9275
|
});
|
|
7201
9276
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
9277
|
+
/**
|
|
9278
|
+
* List container for menu items. Renders a `<ul>`.
|
|
9279
|
+
*/
|
|
7202
9280
|
const SidebarMenu = React.forwardRef((componentProps, forwardRef) => {
|
|
7203
9281
|
const { className, ...props } = componentProps;
|
|
7204
9282
|
return /* @__PURE__ */ jsx("ul", {
|
|
@@ -7210,6 +9288,9 @@ const SidebarMenu = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7210
9288
|
});
|
|
7211
9289
|
});
|
|
7212
9290
|
SidebarMenu.displayName = "SidebarMenu";
|
|
9291
|
+
/**
|
|
9292
|
+
* Single menu row wrapping a button plus optional action/badge. Renders a `<li>`.
|
|
9293
|
+
*/
|
|
7213
9294
|
const SidebarMenuItem = React.forwardRef((componentProps, forwardRef) => {
|
|
7214
9295
|
const { className, ...props } = componentProps;
|
|
7215
9296
|
return /* @__PURE__ */ jsx("li", {
|
|
@@ -7238,6 +9319,11 @@ const sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w
|
|
|
7238
9319
|
size: "default"
|
|
7239
9320
|
}
|
|
7240
9321
|
});
|
|
9322
|
+
/**
|
|
9323
|
+
* Primary clickable row inside a menu item, with variant/size styles and an
|
|
9324
|
+
* optional tooltip shown only when collapsed. Renders a `<button>` by default,
|
|
9325
|
+
* or the element passed via `render` (wrapped in a `Tooltip` when `tooltip` is set).
|
|
9326
|
+
*/
|
|
7241
9327
|
const SidebarMenuButton = React.forwardRef((componentProps, forwardRef) => {
|
|
7242
9328
|
const { render, isActive = false, variant = "default", size = "default", tooltip: tooltipProp, className, ...props } = componentProps;
|
|
7243
9329
|
let tooltip = tooltipProp;
|
|
@@ -7269,6 +9355,10 @@ const SidebarMenuButton = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7269
9355
|
})] });
|
|
7270
9356
|
});
|
|
7271
9357
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
9358
|
+
/**
|
|
9359
|
+
* Secondary action button pinned to the right of a menu item. Renders a
|
|
9360
|
+
* `<button>` by default, or the element passed via `render`.
|
|
9361
|
+
*/
|
|
7272
9362
|
const SidebarMenuAction = React.forwardRef((componentProps, forwardRef) => {
|
|
7273
9363
|
const { className, render, showOnHover = false, ...props } = componentProps;
|
|
7274
9364
|
return useRender({
|
|
@@ -7285,6 +9375,10 @@ const SidebarMenuAction = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7285
9375
|
});
|
|
7286
9376
|
});
|
|
7287
9377
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
9378
|
+
/**
|
|
9379
|
+
* Count/status badge pinned to the right of a menu item; hidden when collapsed
|
|
9380
|
+
* to icons. Renders a `<div>`.
|
|
9381
|
+
*/
|
|
7288
9382
|
const SidebarMenuBadge = React.forwardRef((componentProps, forwardRef) => {
|
|
7289
9383
|
const { className, ...props } = componentProps;
|
|
7290
9384
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -7296,6 +9390,10 @@ const SidebarMenuBadge = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7296
9390
|
});
|
|
7297
9391
|
});
|
|
7298
9392
|
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
9393
|
+
/**
|
|
9394
|
+
* Loading placeholder for a menu row, with a randomized text width. Renders a
|
|
9395
|
+
* `<div>` containing `Skeleton`s.
|
|
9396
|
+
*/
|
|
7299
9397
|
const SidebarMenuSkeleton = React.forwardRef((componentProps, forwardRef) => {
|
|
7300
9398
|
const { className, showIcon = false, width: widthProp, ...props } = componentProps;
|
|
7301
9399
|
const [fallbackWidth] = React.useState(() => {
|
|
@@ -7319,6 +9417,10 @@ const SidebarMenuSkeleton = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7319
9417
|
});
|
|
7320
9418
|
});
|
|
7321
9419
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
9420
|
+
/**
|
|
9421
|
+
* Nested sub-menu list under a menu item; hidden when collapsed to icons.
|
|
9422
|
+
* Renders a `<ul>`.
|
|
9423
|
+
*/
|
|
7322
9424
|
const SidebarMenuSub = React.forwardRef((componentProps, forwardRef) => {
|
|
7323
9425
|
const { className, ...props } = componentProps;
|
|
7324
9426
|
return /* @__PURE__ */ jsx("ul", {
|
|
@@ -7330,6 +9432,9 @@ const SidebarMenuSub = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7330
9432
|
});
|
|
7331
9433
|
});
|
|
7332
9434
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
9435
|
+
/**
|
|
9436
|
+
* Single row within a sub-menu. Renders a `<li>`.
|
|
9437
|
+
*/
|
|
7333
9438
|
const SidebarMenuSubItem = React.forwardRef((componentProps, forwardRef) => {
|
|
7334
9439
|
const { className, ...props } = componentProps;
|
|
7335
9440
|
return /* @__PURE__ */ jsx("li", {
|
|
@@ -7341,6 +9446,10 @@ const SidebarMenuSubItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7341
9446
|
});
|
|
7342
9447
|
});
|
|
7343
9448
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
9449
|
+
/**
|
|
9450
|
+
* Clickable link inside a sub-menu row. Renders an `<a>` by default, or the
|
|
9451
|
+
* element passed via `render`.
|
|
9452
|
+
*/
|
|
7344
9453
|
const SidebarMenuSubButton = React.forwardRef((componentProps, forwardRef) => {
|
|
7345
9454
|
const { render, size = "md", isActive = false, className, ...props } = componentProps;
|
|
7346
9455
|
return useRender({
|
|
@@ -7362,6 +9471,17 @@ SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
|
7362
9471
|
|
|
7363
9472
|
//#endregion
|
|
7364
9473
|
//#region src/components/slider.tsx
|
|
9474
|
+
/**
|
|
9475
|
+
* Range/value slider built on the Base UI Slider primitive. Renders a `<div>`
|
|
9476
|
+
* root containing a track, a range indicator, and one thumb per value (multiple
|
|
9477
|
+
* thumbs when `value`/`defaultValue` is an array). Supports horizontal and
|
|
9478
|
+
* vertical orientation.
|
|
9479
|
+
*
|
|
9480
|
+
* @example
|
|
9481
|
+
* ```tsx
|
|
9482
|
+
* <Slider defaultValue={50} min={0} max={100} />
|
|
9483
|
+
* ```
|
|
9484
|
+
*/
|
|
7365
9485
|
const Slider = React.forwardRef((componentProps, forwardRef) => {
|
|
7366
9486
|
const { className, defaultValue, value, min = 0, max = 100, orientation = "horizontal", ...props } = componentProps;
|
|
7367
9487
|
const _values = React.useMemo(() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max], [
|
|
@@ -7405,12 +9525,24 @@ Slider.displayName = "Slider";
|
|
|
7405
9525
|
|
|
7406
9526
|
//#endregion
|
|
7407
9527
|
//#region src/components/sonner.tsx
|
|
9528
|
+
/**
|
|
9529
|
+
* Toast notification region. Wraps sonner's `Toaster`, syncing its theme with
|
|
9530
|
+
* next-themes and applying DS icons and variant styles (info / success / error / warning).
|
|
9531
|
+
* Mount once near the app root; trigger toasts via the exported `toast` function.
|
|
9532
|
+
*
|
|
9533
|
+
* @example
|
|
9534
|
+
* ```tsx
|
|
9535
|
+
* <Toaster position="bottom-right" />
|
|
9536
|
+
* // elsewhere:
|
|
9537
|
+
* toast.success('Saved');
|
|
9538
|
+
* ```
|
|
9539
|
+
*/
|
|
7408
9540
|
const Toaster = (componentProps) => {
|
|
7409
9541
|
const { ...props } = componentProps;
|
|
7410
9542
|
const { theme = "system" } = useTheme$1();
|
|
7411
9543
|
return /* @__PURE__ */ jsx(Toaster$1, {
|
|
7412
9544
|
theme,
|
|
7413
|
-
className: "toaster group",
|
|
9545
|
+
className: "toaster group !font-sans",
|
|
7414
9546
|
icons: {
|
|
7415
9547
|
success: /* @__PURE__ */ jsx(CircleCheck, { className: "size-4" }),
|
|
7416
9548
|
info: /* @__PURE__ */ jsx(Info, { className: "size-4" }),
|
|
@@ -7440,11 +9572,33 @@ const Toaster = (componentProps) => {
|
|
|
7440
9572
|
//#endregion
|
|
7441
9573
|
//#region src/components/stepper.tsx
|
|
7442
9574
|
const StepperContext = React.createContext(void 0);
|
|
9575
|
+
/**
|
|
9576
|
+
* Reads the current `Stepper` context. Must be called inside a `Stepper`.
|
|
9577
|
+
* @returns `{ activeId, goTo, getIndex, steps }` — the active step id, a setter
|
|
9578
|
+
* to navigate to a step id, an id-to-index lookup, and the full step list.
|
|
9579
|
+
* @throws if used outside a `Stepper`.
|
|
9580
|
+
*/
|
|
7443
9581
|
function useStepper() {
|
|
7444
9582
|
const ctx = React.useContext(StepperContext);
|
|
7445
9583
|
if (!ctx) throw new Error("useStepper must be used within a Stepper");
|
|
7446
9584
|
return ctx;
|
|
7447
9585
|
}
|
|
9586
|
+
/**
|
|
9587
|
+
* Root of a step-based wizard. Provides step state (controlled or uncontrolled)
|
|
9588
|
+
* to its descendants and renders a `<div>` wrapper.
|
|
9589
|
+
*
|
|
9590
|
+
* @example
|
|
9591
|
+
* ```tsx
|
|
9592
|
+
* const steps = [{ id: 'account' }, { id: 'profile' }, { id: 'done' }];
|
|
9593
|
+
*
|
|
9594
|
+
* <Stepper steps={steps} defaultValue="account">
|
|
9595
|
+
* <StepperProgress />
|
|
9596
|
+
* <StepperCounter />
|
|
9597
|
+
* <StepperContent value="account">…</StepperContent>
|
|
9598
|
+
* <StepperContent value="profile">…</StepperContent>
|
|
9599
|
+
* </Stepper>
|
|
9600
|
+
* ```
|
|
9601
|
+
*/
|
|
7448
9602
|
const Stepper = React.forwardRef((componentProps, forwardRef) => {
|
|
7449
9603
|
const { steps, defaultValue, className, children, value, onValueChange, ...props } = componentProps;
|
|
7450
9604
|
const [activeId = "", setActiveId] = useControllableState({
|
|
@@ -7477,6 +9631,11 @@ const Stepper = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7477
9631
|
});
|
|
7478
9632
|
});
|
|
7479
9633
|
Stepper.displayName = "Stepper";
|
|
9634
|
+
/**
|
|
9635
|
+
* Segment-bar progress indicator (the "Step x of y" layout). Renders an
|
|
9636
|
+
* `aria-hidden` `<div>` of `<span>` segments, one per step, marked completed /
|
|
9637
|
+
* active / inactive relative to the active step.
|
|
9638
|
+
*/
|
|
7480
9639
|
const StepperProgress = React.forwardRef((componentProps, forwardRef) => {
|
|
7481
9640
|
const { steps: stepIds, className, ...props } = componentProps;
|
|
7482
9641
|
const { activeId, getIndex, steps } = useStepper();
|
|
@@ -7500,6 +9659,10 @@ const StepperProgress = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7500
9659
|
});
|
|
7501
9660
|
});
|
|
7502
9661
|
StepperProgress.displayName = "StepperProgress";
|
|
9662
|
+
/**
|
|
9663
|
+
* "Step x of y" companion line for `StepperProgress`. Renders a `<p>` whose
|
|
9664
|
+
* position is derived from the stepper context.
|
|
9665
|
+
*/
|
|
7503
9666
|
const StepperCounter = React.forwardRef((componentProps, forwardRef) => {
|
|
7504
9667
|
const { steps: stepIds, className, children, ...props } = componentProps;
|
|
7505
9668
|
const { activeId, steps } = useStepper();
|
|
@@ -7520,6 +9683,10 @@ const StepperCounter = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7520
9683
|
});
|
|
7521
9684
|
});
|
|
7522
9685
|
StepperCounter.displayName = "StepperCounter";
|
|
9686
|
+
/**
|
|
9687
|
+
* Container for the step body, tagged with the active step id via `data-state`.
|
|
9688
|
+
* Renders a `<div>`.
|
|
9689
|
+
*/
|
|
7523
9690
|
const StepperPanel = React.forwardRef((componentProps, forwardRef) => {
|
|
7524
9691
|
const { className, ...props } = componentProps;
|
|
7525
9692
|
const { activeId } = useStepper();
|
|
@@ -7532,6 +9699,10 @@ const StepperPanel = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7532
9699
|
});
|
|
7533
9700
|
});
|
|
7534
9701
|
StepperPanel.displayName = "StepperPanel";
|
|
9702
|
+
/**
|
|
9703
|
+
* Body for one step, shown only when its `value` matches the active step.
|
|
9704
|
+
* Renders a `<div>` (or `null` when inactive and not force-mounted).
|
|
9705
|
+
*/
|
|
7535
9706
|
const StepperContent = React.forwardRef((componentProps, forwardRef) => {
|
|
7536
9707
|
const { value, forceMount, className, ...props } = componentProps;
|
|
7537
9708
|
const { activeId } = useStepper();
|
|
@@ -7550,6 +9721,15 @@ StepperContent.displayName = "StepperContent";
|
|
|
7550
9721
|
|
|
7551
9722
|
//#endregion
|
|
7552
9723
|
//#region src/components/switch.tsx
|
|
9724
|
+
/**
|
|
9725
|
+
* A toggle switch for an on/off setting, wrapping Base UI's `Switch.Root`.
|
|
9726
|
+
* Renders a `<button role="switch">` containing a sliding thumb.
|
|
9727
|
+
*
|
|
9728
|
+
* @example
|
|
9729
|
+
* ```tsx
|
|
9730
|
+
* <Switch defaultChecked />
|
|
9731
|
+
* ```
|
|
9732
|
+
*/
|
|
7553
9733
|
const Switch = React.forwardRef((componentProps, forwardRef) => {
|
|
7554
9734
|
const { className, ...props } = componentProps;
|
|
7555
9735
|
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
@@ -7567,6 +9747,22 @@ Switch.displayName = "Switch";
|
|
|
7567
9747
|
|
|
7568
9748
|
//#endregion
|
|
7569
9749
|
//#region src/components/tabs.tsx
|
|
9750
|
+
/**
|
|
9751
|
+
* Root container for a tabs group, wrapping Base UI's `Tabs.Root`.
|
|
9752
|
+
* Renders a `<div>` that lays out the `TabsList` and `TabsContent` panels.
|
|
9753
|
+
*
|
|
9754
|
+
* @example
|
|
9755
|
+
* ```tsx
|
|
9756
|
+
* <Tabs defaultValue="account">
|
|
9757
|
+
* <TabsList>
|
|
9758
|
+
* <TabsTrigger value="account">Account</TabsTrigger>
|
|
9759
|
+
* <TabsTrigger value="password">Password</TabsTrigger>
|
|
9760
|
+
* </TabsList>
|
|
9761
|
+
* <TabsContent value="account">Account settings</TabsContent>
|
|
9762
|
+
* <TabsContent value="password">Password settings</TabsContent>
|
|
9763
|
+
* </Tabs>
|
|
9764
|
+
* ```
|
|
9765
|
+
*/
|
|
7570
9766
|
const Tabs = React.forwardRef((componentProps, forwardRef) => {
|
|
7571
9767
|
const { className, orientation = "horizontal", ...props } = componentProps;
|
|
7572
9768
|
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
@@ -7578,6 +9774,11 @@ const Tabs = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7578
9774
|
});
|
|
7579
9775
|
});
|
|
7580
9776
|
Tabs.displayName = "Tabs";
|
|
9777
|
+
/**
|
|
9778
|
+
* Container for the tab triggers, wrapping `Tabs.List`.
|
|
9779
|
+
* Renders a `<div>` that arranges the `TabsTrigger` buttons in a row (or column
|
|
9780
|
+
* when the parent `Tabs` is vertical).
|
|
9781
|
+
*/
|
|
7581
9782
|
const TabsList = React.forwardRef((componentProps, forwardRef) => {
|
|
7582
9783
|
const { className, ...props } = componentProps;
|
|
7583
9784
|
return /* @__PURE__ */ jsx(Tabs$1.List, {
|
|
@@ -7588,6 +9789,10 @@ const TabsList = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7588
9789
|
});
|
|
7589
9790
|
});
|
|
7590
9791
|
TabsList.displayName = "TabsList";
|
|
9792
|
+
/**
|
|
9793
|
+
* A single tab button that activates its matching panel, wrapping `Tabs.Tab`.
|
|
9794
|
+
* Renders a `<button>` with an active-state underline indicator.
|
|
9795
|
+
*/
|
|
7591
9796
|
const TabsTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
7592
9797
|
const { className, ...props } = componentProps;
|
|
7593
9798
|
return /* @__PURE__ */ jsx(Tabs$1.Tab, {
|
|
@@ -7598,6 +9803,10 @@ const TabsTrigger = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7598
9803
|
});
|
|
7599
9804
|
});
|
|
7600
9805
|
TabsTrigger.displayName = "TabsTrigger";
|
|
9806
|
+
/**
|
|
9807
|
+
* The panel shown when its matching tab is active, wrapping `Tabs.Panel`.
|
|
9808
|
+
* Renders a `<div>` whose `value` must match the corresponding `TabsTrigger`.
|
|
9809
|
+
*/
|
|
7601
9810
|
const TabsContent = React.forwardRef((componentProps, forwardRef) => {
|
|
7602
9811
|
const { className, ...props } = componentProps;
|
|
7603
9812
|
return /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
@@ -7611,6 +9820,10 @@ TabsContent.displayName = "TabsContent";
|
|
|
7611
9820
|
|
|
7612
9821
|
//#endregion
|
|
7613
9822
|
//#region src/components/toggle.tsx
|
|
9823
|
+
/**
|
|
9824
|
+
* Class-variance-authority variants for {@link Toggle}: `variant` (`default` | `outline`)
|
|
9825
|
+
* and `size` (`default` | `sm` | `lg`).
|
|
9826
|
+
*/
|
|
7614
9827
|
const toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-md bg-transparent text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:pointer-events-none data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7615
9828
|
variants: {
|
|
7616
9829
|
variant: {
|
|
@@ -7628,6 +9841,15 @@ const toggleVariants = cva("group/toggle inline-flex items-center justify-center
|
|
|
7628
9841
|
size: "default"
|
|
7629
9842
|
}
|
|
7630
9843
|
});
|
|
9844
|
+
/**
|
|
9845
|
+
* A two-state button that can be pressed on or off, wrapping Base UI's `Toggle`.
|
|
9846
|
+
* Renders a `<button aria-pressed>` styled via {@link toggleVariants}.
|
|
9847
|
+
*
|
|
9848
|
+
* @example
|
|
9849
|
+
* ```tsx
|
|
9850
|
+
* <Toggle aria-label="Bold">B</Toggle>
|
|
9851
|
+
* ```
|
|
9852
|
+
*/
|
|
7631
9853
|
const Toggle = React.forwardRef((componentProps, forwardRef) => {
|
|
7632
9854
|
const { className, variant = "default", size = "default", ...props } = componentProps;
|
|
7633
9855
|
return /* @__PURE__ */ jsx(Toggle$1, {
|
|
@@ -7652,6 +9874,19 @@ const ToggleGroupContext = React.createContext({
|
|
|
7652
9874
|
orientation: "horizontal",
|
|
7653
9875
|
block: false
|
|
7654
9876
|
});
|
|
9877
|
+
/**
|
|
9878
|
+
* Root container grouping related toggle buttons, wrapping Base UI's `ToggleGroup`.
|
|
9879
|
+
* Renders a `<div role="group">` and shares `variant`, `size` and `spacing` with its
|
|
9880
|
+
* `ToggleGroupItem`s via context.
|
|
9881
|
+
*
|
|
9882
|
+
* @example
|
|
9883
|
+
* ```tsx
|
|
9884
|
+
* <ToggleGroup defaultValue={['left']}>
|
|
9885
|
+
* <ToggleGroupItem value="left">Left</ToggleGroupItem>
|
|
9886
|
+
* <ToggleGroupItem value="center">Center</ToggleGroupItem>
|
|
9887
|
+
* </ToggleGroup>
|
|
9888
|
+
* ```
|
|
9889
|
+
*/
|
|
7655
9890
|
const ToggleGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
7656
9891
|
const { className, variant, size, spacing = 0, orientation = "horizontal", block = false, children, ...props } = componentProps;
|
|
7657
9892
|
return /* @__PURE__ */ jsx(ToggleGroup$1, {
|
|
@@ -7678,6 +9913,10 @@ const ToggleGroup = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7678
9913
|
});
|
|
7679
9914
|
});
|
|
7680
9915
|
ToggleGroup.displayName = "ToggleGroup";
|
|
9916
|
+
/**
|
|
9917
|
+
* A single toggle button within a `ToggleGroup`, wrapping Base UI's `Toggle`.
|
|
9918
|
+
* Renders a `<button aria-pressed>` that inherits `variant` and `size` from the group context.
|
|
9919
|
+
*/
|
|
7681
9920
|
const ToggleGroupItem = React.forwardRef((componentProps, forwardRef) => {
|
|
7682
9921
|
const { className, children, variant = "default", size = "default", ...props } = componentProps;
|
|
7683
9922
|
const context = React.useContext(ToggleGroupContext);
|
|
@@ -7687,7 +9926,7 @@ const ToggleGroupItem = React.forwardRef((componentProps, forwardRef) => {
|
|
|
7687
9926
|
"data-variant": context.variant || variant,
|
|
7688
9927
|
"data-size": context.size || size,
|
|
7689
9928
|
"data-spacing": context.spacing,
|
|
7690
|
-
className: cn("shrink-0 text-foreground group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:border-l-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:border-l group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:border-t group-data-[block=true]/toggle-group:flex-1", toggleVariants({
|
|
9929
|
+
className: cn("shrink-0 text-foreground group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none group-data-[spacing=0]/toggle-group:border group-data-[spacing=0]/toggle-group:border-input focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:border-l-0 group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:border-t-0 group-data-[orientation=horizontal]/toggle-group:data-[spacing=0]:first:border-l group-data-[orientation=vertical]/toggle-group:data-[spacing=0]:first:border-t group-data-[block=true]/toggle-group:flex-1", toggleVariants({
|
|
7691
9930
|
variant: context.variant || variant,
|
|
7692
9931
|
size: context.size || size
|
|
7693
9932
|
}), className),
|
|
@@ -7813,4 +10052,4 @@ function useAudioGauge(options = {}) {
|
|
|
7813
10052
|
}
|
|
7814
10053
|
|
|
7815
10054
|
//#endregion
|
|
7816
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionBar, ActionBarButton, ActionBarContext, ActionBarHeight, Alert, AlertAction, AlertAction as BannerAction, AlertDescription, AlertDescription as BannerDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTitle as BannerTitle, Anchor, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, Audio, AudioPlayerBar, AudioPlayerButton, AudioPlayerCurrentTime, AudioPlayerDuration, AudioPlayerManager, AudioPlayerRow, AudioPlayerSkip, AudioPlayerSpeed, AudioPlayerTime, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BadgeGroup, BadgeGroupCount, Banner, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, ChipRemove, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CounterBadge, CountryFlag, DataCombobox, DataTable, DataTree, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBackdrop, DrawerBar, DrawerClose, DrawerContent, DrawerCreateHandle, DrawerDescription, DrawerFooter, DrawerHeader, DrawerMenu, DrawerMenuCheckboxItem, DrawerMenuGroup, DrawerMenuGroupLabel, DrawerMenuItem, DrawerMenuRadioGroup, DrawerMenuRadioItem, DrawerMenuSeparator, DrawerMenuTrigger, DrawerPanel, DrawerPopup, DrawerPortal, DrawerPrimitive, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DropdownMenu, DropdownMenuAddon, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneActions, DropzoneContent, DropzoneDescription, DropzoneIcon, DropzoneTitle, DropzoneTrigger, DsI18nProvider, EmojiPicker, EmojiPickerCategories, EmojiPickerContent, EmojiPickerTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FAB, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLabelAside, FieldLabelInfo, FieldLabelRow, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterClearAllButton, FilterGroup, Gauge, HoverCard, HoverCardContent, HoverCardTrigger, InlineEditInput, InlineEditSelect, InlineEditSelectContent, InlineEditSelectItem, InlineEditSelectTrigger, InlineEditSelectValue, InlineEditTextarea, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, List, ListCol, ListRow, NotificationQueueProvider, NotificationSlot, NumericInput, NumericInputControl, NumericInputDecrement, NumericInputIncrement, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, SUPPORTED_LANGUAGES, ScrollArea, ScrollAreaPrimitive, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Stepper, StepperContent, StepperCounter, StepperPanel, StepperProgress, Switch, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tree, TreeDragLine, TreeItem, TreeItemLabel, alertVariants, anchorVariants, bannerVariants, buttonGroupVariants, buttonVariants, cn, counterBadgeVariants, detectInitialLanguage, fabVariants, registerI18nNamespace, selectTriggerVariants, spinnerVariants, syncDsLanguage, toast, toggleVariants, useAudioGauge, useAudioPlayer, useAudioPlayerTime, useComboboxAnchor, useDsLocale, useDsTranslation, useNotification, useNotificationQueue, useSidebar, useStepper, useTheme };
|
|
10055
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionBar, ActionBarButton, ActionBarContext, ActionBarHeight, Alert, AlertAction, AlertAction as BannerAction, AlertDescription, AlertDescription as BannerDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTitle as BannerTitle, Anchor, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, Audio, AudioPlayerBar, AudioPlayerButton, AudioPlayerCurrentTime, AudioPlayerDuration, AudioPlayerManager, AudioPlayerRow, AudioPlayerSkip, AudioPlayerSpeed, AudioPlayerTime, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BadgeGroup, BadgeGroupCount, Banner, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, ChipRemove, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CounterBadge, CountryFlag, DataCombobox, DataTable, DataTree, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBackdrop, DrawerBar, DrawerClose, DrawerContent, DrawerCreateHandle, DrawerDescription, DrawerFooter, DrawerHeader, DrawerMenu, DrawerMenuCheckboxItem, DrawerMenuGroup, DrawerMenuGroupLabel, DrawerMenuItem, DrawerMenuRadioGroup, DrawerMenuRadioItem, DrawerMenuSeparator, DrawerMenuTrigger, DrawerPanel, DrawerPopup, DrawerPortal, DrawerPrimitive, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DropdownMenu, DropdownMenuAddon, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneActions, DropzoneContent, DropzoneDescription, DropzoneIcon, DropzoneTitle, DropzoneTrigger, DsI18nProvider, EmojiPicker, EmojiPickerCategories, EmojiPickerContent, EmojiPickerTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FAB, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLabelAside, FieldLabelInfo, FieldLabelRow, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Filter, FilterClearAllButton, FilterGroup, Gauge, HoverCard, HoverCardContent, HoverCardTrigger, InlineEditInput, InlineEditMultiselect, InlineEditMultiselectChip, InlineEditMultiselectChips, InlineEditMultiselectContent, InlineEditMultiselectItem, InlineEditMultiselectTrigger, InlineEditMultiselectValue, InlineEditSelect, InlineEditSelectContent, InlineEditSelectItem, InlineEditSelectTrigger, InlineEditSelectValue, InlineEditTextarea, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, List, ListCol, ListRow, NotificationQueueProvider, NotificationSlot, NumericInput, NumericInputControl, NumericInputDecrement, NumericInputIncrement, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, SUPPORTED_LANGUAGES, ScrollArea, ScrollAreaPrimitive, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Stepper, StepperContent, StepperCounter, StepperPanel, StepperProgress, Switch, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tree, TreeDragLine, TreeItem, TreeItemLabel, alertVariants, anchorVariants, bannerVariants, buttonGroupVariants, buttonVariants, cn, counterBadgeVariants, detectInitialLanguage, fabVariants, registerI18nNamespace, selectTriggerVariants, spinnerVariants, syncDsLanguage, toast, toggleVariants, useAudioGauge, useAudioPlayer, useAudioPlayerTime, useComboboxAnchor, useDsLocale, useDsTranslation, useNotification, useNotificationQueue, useSidebar, useStepper, useTheme };
|