@bearmenu/ui 0.5.1 → 0.6.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/{chunk-ERMIA7NP.js → chunk-7PPCH42H.js} +3 -3
- package/dist/{chunk-HLQ2IRE7.js → chunk-BAZFVSSG.js} +3 -3
- package/dist/chunk-D5QHEHXJ.js +26 -0
- package/dist/{chunk-UISA4CIG.js → chunk-N2KNBPAQ.js} +2 -2
- package/dist/{chunk-7H54PTVH.js → chunk-PSR7N36A.js} +38 -10
- package/dist/chunk-RIDXFY6M.js +38 -0
- package/dist/chunk-UUJVXN2O.js +82 -0
- package/dist/chunk-WKMLZDUT.js +122 -0
- package/dist/chunk-XK2ZDQVE.js +122 -0
- package/dist/{chunk-4KOMHDZD.js → chunk-Y5D5LP4A.js} +18 -3
- package/dist/chunk-YJ6OBKZJ.js +32 -0
- package/dist/{chunk-ESO2EM3L.js → chunk-ZBBUKXM5.js} +2 -2
- package/dist/chunk-ZFNOCP6W.js +106 -0
- package/dist/components/accordion.js +11 -5
- package/dist/components/alert-dialog.js +5 -3
- package/dist/components/alert.d.ts +5 -2
- package/dist/components/alert.js +25 -9
- package/dist/components/avatar.d.ts +17 -2
- package/dist/components/avatar.js +91 -12
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.js +5 -2
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +39 -0
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +3 -3
- package/dist/components/card.d.ts +13 -5
- package/dist/components/card.js +2 -2
- package/dist/components/carousel.d.ts +20 -3
- package/dist/components/carousel.js +72 -12
- package/dist/components/checkbox.js +1 -1
- package/dist/components/circular-progress.d.ts +16 -0
- package/dist/components/circular-progress.js +105 -0
- package/dist/components/combobox.d.ts +27 -0
- package/dist/components/combobox.js +102 -0
- package/dist/components/command.d.ts +29 -16
- package/dist/components/command.js +2 -2
- package/dist/components/currency-input.d.ts +1 -0
- package/dist/components/currency-input.js +73 -52
- package/dist/components/date-input.d.ts +10 -0
- package/dist/components/date-input.js +40 -0
- package/dist/components/description-list.d.ts +15 -0
- package/dist/components/description-list.js +67 -0
- package/dist/components/dialog.d.ts +13 -2
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +5 -2
- package/dist/components/drawer.js +47 -9
- package/dist/components/dropdown-menu.d.ts +7 -2
- package/dist/components/dropdown-menu.js +22 -6
- package/dist/components/empty-state.js +2 -2
- package/dist/components/field.d.ts +22 -0
- package/dist/components/field.js +130 -0
- package/dist/components/form.d.ts +2 -1
- package/dist/components/form.js +11 -1
- package/dist/components/haptic-button.js +3 -3
- package/dist/components/input-group.d.ts +18 -0
- package/dist/components/input-group.js +92 -0
- package/dist/components/input.d.ts +8 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.js +120 -0
- package/dist/components/kbd.d.ts +13 -0
- package/dist/components/kbd.js +49 -0
- package/dist/components/lazy-markdown.d.ts +3 -1
- package/dist/components/lazy-markdown.js +7 -7
- package/dist/components/link-button.js +1 -1
- package/dist/components/multi-select-combobox.js +92 -83
- package/dist/components/multi-select-menu.d.ts +0 -4
- package/dist/components/multi-select-menu.js +28 -17
- package/dist/components/native-select.d.ts +12 -0
- package/dist/components/native-select.js +49 -0
- package/dist/components/pagination.d.ts +5 -2
- package/dist/components/pagination.js +66 -7
- package/dist/components/place-about-tab.js +4 -4
- package/dist/components/place-card.js +1 -1
- package/dist/components/place-details-mobile.js +4 -4
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.d.ts +5 -1
- package/dist/components/progress.js +17 -3
- package/dist/components/radio-group.js +12 -3
- package/dist/components/rating.d.ts +2 -0
- package/dist/components/rating.js +88 -70
- package/dist/components/search-bar.d.ts +1 -2
- package/dist/components/search-bar.js +37 -60
- package/dist/components/searchable-select.js +76 -72
- package/dist/components/select.d.ts +5 -1
- package/dist/components/select.js +30 -14
- package/dist/components/selection-bar.d.ts +11 -0
- package/dist/components/selection-bar.js +65 -0
- package/dist/components/separator.js +3 -2
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/skeleton-card.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +21 -4
- package/dist/components/sliding-panels.js +15 -13
- package/dist/components/spinner.d.ts +17 -0
- package/dist/components/spinner.js +50 -0
- package/dist/components/stepper.d.ts +18 -0
- package/dist/components/stepper.js +199 -0
- package/dist/components/sticky-container.js +1 -0
- package/dist/components/switch.js +4 -3
- package/dist/components/table.d.ts +23 -5
- package/dist/components/table.js +121 -35
- package/dist/components/tabs.d.ts +3 -1
- package/dist/components/tabs.js +37 -9
- package/dist/components/tag-group.d.ts +9 -0
- package/dist/components/tag-group.js +26 -0
- package/dist/components/tag.d.ts +17 -0
- package/dist/components/tag.js +61 -0
- package/dist/components/text.d.ts +3 -3
- package/dist/components/text.js +1 -1
- package/dist/components/textarea.js +2 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +3 -2
- package/dist/components/tooltip.js +16 -2
- package/package.json +44 -26
- package/src/components/accordion.tsx +11 -6
- package/src/components/alert-dialog.tsx +4 -2
- package/src/components/alert.tsx +20 -8
- package/src/components/avatar.tsx +106 -13
- package/src/components/badge.tsx +12 -11
- package/src/components/breadcrumb.tsx +5 -2
- package/src/components/button-group.stories.tsx +52 -0
- package/src/components/button-group.tsx +40 -0
- package/src/components/button.test.tsx +174 -0
- package/src/components/button.tsx +42 -19
- package/src/components/calendar.tsx +2 -2
- package/src/components/card.tsx +55 -13
- package/src/components/carousel.tsx +85 -13
- package/src/components/checkbox.test.tsx +58 -0
- package/src/components/checkbox.tsx +8 -3
- package/src/components/circular-progress.stories.tsx +39 -0
- package/src/components/circular-progress.tsx +102 -0
- package/src/components/collapsible.stories.tsx +7 -3
- package/src/components/combobox.stories.tsx +82 -0
- package/src/components/combobox.test.tsx +118 -0
- package/src/components/combobox.tsx +136 -0
- package/src/components/command.test.tsx +91 -0
- package/src/components/command.tsx +38 -15
- package/src/components/currency-input.test.tsx +63 -0
- package/src/components/currency-input.tsx +84 -66
- package/src/components/date-input.stories.tsx +31 -0
- package/src/components/date-input.tsx +43 -0
- package/src/components/description-list.stories.tsx +62 -0
- package/src/components/description-list.tsx +68 -0
- package/src/components/dialog.test.tsx +84 -0
- package/src/components/dialog.tsx +64 -24
- package/src/components/drawer.tsx +72 -23
- package/src/components/dropdown-menu.test.tsx +180 -0
- package/src/components/dropdown-menu.tsx +31 -6
- package/src/components/field.stories.tsx +36 -0
- package/src/components/field.test.tsx +157 -0
- package/src/components/field.tsx +146 -0
- package/src/components/form.stories.tsx +3 -2
- package/src/components/form.test.tsx +95 -0
- package/src/components/form.tsx +9 -0
- package/src/components/haptic-button.tsx +1 -1
- package/src/components/input-group.stories.tsx +61 -0
- package/src/components/input-group.tsx +99 -0
- package/src/components/input.test.tsx +103 -0
- package/src/components/input.tsx +24 -7
- package/src/components/item.stories.tsx +52 -0
- package/src/components/item.tsx +115 -0
- package/src/components/kbd.stories.tsx +33 -0
- package/src/components/kbd.tsx +46 -0
- package/src/components/lazy-markdown.tsx +10 -7
- package/src/components/multi-select-combobox.test.tsx +101 -0
- package/src/components/multi-select-combobox.tsx +85 -82
- package/src/components/multi-select-menu.tsx +49 -41
- package/src/components/native-select.stories.tsx +52 -0
- package/src/components/native-select.tsx +45 -0
- package/src/components/pagination.tsx +64 -5
- package/src/components/popover.tsx +66 -3
- package/src/components/progress.tsx +27 -4
- package/src/components/radio-group.test.tsx +64 -0
- package/src/components/radio-group.tsx +11 -3
- package/src/components/rating.test.tsx +112 -0
- package/src/components/rating.tsx +97 -82
- package/src/components/search-bar.stories.tsx +1 -32
- package/src/components/search-bar.tsx +22 -59
- package/src/components/searchable-select.tsx +69 -73
- package/src/components/select.tsx +34 -19
- package/src/components/selection-bar.stories.tsx +37 -0
- package/src/components/selection-bar.tsx +65 -0
- package/src/components/separator.tsx +5 -2
- package/src/components/sheet.tsx +1 -1
- package/src/components/skeleton.tsx +2 -2
- package/src/components/slider.test.tsx +45 -0
- package/src/components/slider.tsx +31 -12
- package/src/components/sliding-panels.tsx +14 -12
- package/src/components/spinner.stories.tsx +35 -0
- package/src/components/spinner.tsx +50 -0
- package/src/components/stepper.stories.tsx +71 -0
- package/src/components/stepper.tsx +220 -0
- package/src/components/sticky-container.tsx +1 -0
- package/src/components/switch.test.tsx +52 -0
- package/src/components/switch.tsx +4 -3
- package/src/components/table.tsx +140 -35
- package/src/components/tabs.test.tsx +107 -0
- package/src/components/tabs.tsx +70 -23
- package/src/components/tag-group.stories.tsx +39 -0
- package/src/components/tag-group.tsx +28 -0
- package/src/components/tag.stories.tsx +50 -0
- package/src/components/tag.tsx +63 -0
- package/src/components/text.test.tsx +1 -1
- package/src/components/text.tsx +19 -3
- package/src/components/textarea.test.tsx +48 -0
- package/src/components/textarea.tsx +2 -1
- package/src/components/toast.tsx +4 -3
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +12 -2
- package/src/globals.css +142 -90
- package/dist/chunk-2BMJRXQX.js +0 -80
- package/dist/chunk-4AVS6CV4.js +0 -89
- package/dist/chunk-4UO73SKC.js +0 -26
- package/dist/chunk-CW24PLDW.js +0 -24
- package/dist/chunk-IQASCH2V.js +0 -25
- package/dist/chunk-NKHH23YK.js +0 -31
- package/dist/chunk-QJ54Z7TC.js +0 -83
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const SelectionBar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
count: number;
|
|
5
|
+
/** Hide bar when count is 0. Defaults to true. */
|
|
6
|
+
hideWhenEmpty?: boolean;
|
|
7
|
+
onClear?: () => void;
|
|
8
|
+
itemNoun?: string;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
|
|
11
|
+
export { SelectionBar };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var SelectionBar = React.forwardRef(
|
|
8
|
+
(_a, ref) => {
|
|
9
|
+
var _b = _a, {
|
|
10
|
+
className,
|
|
11
|
+
count,
|
|
12
|
+
hideWhenEmpty = true,
|
|
13
|
+
onClear,
|
|
14
|
+
itemNoun = "item",
|
|
15
|
+
children
|
|
16
|
+
} = _b, props = __objRest(_b, [
|
|
17
|
+
"className",
|
|
18
|
+
"count",
|
|
19
|
+
"hideWhenEmpty",
|
|
20
|
+
"onClear",
|
|
21
|
+
"itemNoun",
|
|
22
|
+
"children"
|
|
23
|
+
]);
|
|
24
|
+
if (hideWhenEmpty && count <= 0) return null;
|
|
25
|
+
const noun = count === 1 ? itemNoun : `${itemNoun}s`;
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
__spreadProps(__spreadValues({
|
|
29
|
+
ref,
|
|
30
|
+
role: "region",
|
|
31
|
+
"aria-label": `${count} ${noun} selected`,
|
|
32
|
+
"data-slot": "selection-bar",
|
|
33
|
+
className: cn(
|
|
34
|
+
"flex w-full items-center gap-3 rounded-2xl border border-border bg-card px-4 py-3 shadow-lg",
|
|
35
|
+
className
|
|
36
|
+
)
|
|
37
|
+
}, props), {
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
|
|
40
|
+
onClear && /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-label": "Clear selection",
|
|
45
|
+
onClick: onClear,
|
|
46
|
+
className: "inline-flex size-6 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
47
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4" })
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsxs("span", { "aria-live": "polite", children: [
|
|
51
|
+
count,
|
|
52
|
+
" ",
|
|
53
|
+
noun,
|
|
54
|
+
" selected"
|
|
55
|
+
] })
|
|
56
|
+
] }),
|
|
57
|
+
children && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-2", children })
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
SelectionBar.displayName = "SelectionBar";
|
|
64
|
+
|
|
65
|
+
export { SelectionBar };
|
|
@@ -10,11 +10,12 @@ var Separator = React.forwardRef((_a, ref) => {
|
|
|
10
10
|
SeparatorPrimitive.Root,
|
|
11
11
|
__spreadValues({
|
|
12
12
|
ref,
|
|
13
|
+
"data-slot": "separator",
|
|
13
14
|
decorative,
|
|
14
15
|
orientation,
|
|
15
16
|
className: cn(
|
|
16
|
-
"shrink-0
|
|
17
|
-
orientation === "horizontal" ? "h-
|
|
17
|
+
"shrink-0",
|
|
18
|
+
orientation === "horizontal" ? "h-px w-full bg-gradient-to-r from-transparent via-border to-transparent" : "h-full w-px bg-gradient-to-b from-transparent via-border to-transparent",
|
|
18
19
|
className
|
|
19
20
|
)
|
|
20
21
|
}, props)
|
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.Dialog
|
|
|
10
10
|
declare const SheetPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "left" | "right" | "
|
|
13
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
}
|
package/dist/components/sheet.js
CHANGED
|
@@ -26,7 +26,7 @@ var SheetOverlay = React.forwardRef((_a, ref) => {
|
|
|
26
26
|
});
|
|
27
27
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
28
28
|
var sheetVariants = cva(
|
|
29
|
-
"fixed z-[1000] gap-4
|
|
29
|
+
"fixed z-[1000] gap-4 bg-background border-border p-6 shadow-2xl transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
30
30
|
{
|
|
31
31
|
variants: {
|
|
32
32
|
side: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Skeleton } from '../chunk-
|
|
1
|
+
import { Skeleton } from '../chunk-N2KNBPAQ.js';
|
|
2
2
|
import { AspectRatio } from '../chunk-3VMDCCCX.js';
|
|
3
3
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
4
4
|
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
@@ -5,16 +5,33 @@ import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var Slider = React.forwardRef((_a, ref) => {
|
|
8
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8
|
+
var _b = _a, { className, value, defaultValue } = _b, props = __objRest(_b, ["className", "value", "defaultValue"]);
|
|
9
|
+
const thumbCount = React.useMemo(() => {
|
|
10
|
+
if (Array.isArray(value)) return value.length;
|
|
11
|
+
if (Array.isArray(defaultValue)) return defaultValue.length;
|
|
12
|
+
return 1;
|
|
13
|
+
}, [value, defaultValue]);
|
|
9
14
|
return /* @__PURE__ */ jsxs(
|
|
10
15
|
SliderPrimitive.Root,
|
|
11
16
|
__spreadProps(__spreadValues({
|
|
12
17
|
ref,
|
|
13
|
-
|
|
18
|
+
"data-slot": "slider",
|
|
19
|
+
value,
|
|
20
|
+
defaultValue,
|
|
21
|
+
className: cn(
|
|
22
|
+
"relative flex w-full touch-none select-none items-center data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
23
|
+
className
|
|
24
|
+
)
|
|
14
25
|
}, props), {
|
|
15
26
|
children: [
|
|
16
|
-
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full
|
|
17
|
-
|
|
27
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
28
|
+
Array.from({ length: thumbCount }, (_, i) => /* @__PURE__ */ jsx(
|
|
29
|
+
SliderPrimitive.Thumb,
|
|
30
|
+
{
|
|
31
|
+
className: "block size-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:scale-110"
|
|
32
|
+
},
|
|
33
|
+
i
|
|
34
|
+
))
|
|
18
35
|
]
|
|
19
36
|
})
|
|
20
37
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from '../chunk-
|
|
1
|
+
import { Button } from '../chunk-ZFNOCP6W.js';
|
|
2
2
|
import '../chunk-R47NEOSI.js';
|
|
3
3
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
4
4
|
import '../chunk-3GWWZKX7.js';
|
|
@@ -26,20 +26,22 @@ var SlidingPanels = ({
|
|
|
26
26
|
return () => ro.disconnect();
|
|
27
27
|
}, [currentIndex]);
|
|
28
28
|
const handleBack = () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
29
|
+
const previousPanel = panels[currentIndex - 1];
|
|
30
|
+
if (!previousPanel) return;
|
|
31
|
+
if (currentPanelData == null ? void 0 : currentPanelData.onBack) {
|
|
32
|
+
currentPanelData.onBack();
|
|
33
|
+
} else {
|
|
34
|
+
onPanelChange(previousPanel.id);
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
return /* @__PURE__ */ jsx(
|
|
39
38
|
"div",
|
|
40
39
|
{
|
|
41
|
-
className: cn(
|
|
42
|
-
|
|
40
|
+
className: cn(
|
|
41
|
+
"relative overflow-clip transition-[height] duration-500 ease-[cubic-bezier(0.32,0.72,0,1)]",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
style: { height: containerHeight, overflowClipMargin: "8px" },
|
|
43
45
|
children: panels.map((panel, index) => {
|
|
44
46
|
const isActive = panel.id === currentPanel;
|
|
45
47
|
const isLeft = index < currentIndex;
|
|
@@ -51,10 +53,10 @@ var SlidingPanels = ({
|
|
|
51
53
|
panelRefs.current[index] = el;
|
|
52
54
|
},
|
|
53
55
|
className: cn(
|
|
54
|
-
"absolute top-0 left-0 w-full transition-transform duration-
|
|
56
|
+
"absolute top-0 left-0 w-full transition-transform duration-500 ease-[cubic-bezier(0.32,0.72,0,1)]",
|
|
55
57
|
isActive && "translate-x-0",
|
|
56
|
-
isLeft && "-translate-x-
|
|
57
|
-
isRight && "translate-x-
|
|
58
|
+
isLeft && "-translate-x-[calc(100%+8px)]",
|
|
59
|
+
isRight && "translate-x-[calc(100%+8px)]"
|
|
58
60
|
),
|
|
59
61
|
"aria-hidden": !isActive,
|
|
60
62
|
children: [
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const spinnerVariants: (props?: ({
|
|
6
|
+
size?: "default" | "xs" | "sm" | "lg" | "xl" | null | undefined;
|
|
7
|
+
tone?: "default" | "destructive" | "inherit" | "primary" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const Spinner: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & VariantProps<(props?: ({
|
|
10
|
+
size?: "default" | "xs" | "sm" | "lg" | "xl" | null | undefined;
|
|
11
|
+
tone?: "default" | "destructive" | "inherit" | "primary" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
13
|
+
/** Visually-hidden label for screen readers. Defaults to "Loading". */
|
|
14
|
+
label?: string;
|
|
15
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
|
|
17
|
+
export { Spinner, spinnerVariants };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Loader2 } from 'lucide-react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var spinnerVariants = cva("animate-spin shrink-0", {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
xs: "size-3",
|
|
12
|
+
sm: "size-4",
|
|
13
|
+
default: "size-5",
|
|
14
|
+
lg: "size-6",
|
|
15
|
+
xl: "size-8"
|
|
16
|
+
},
|
|
17
|
+
tone: {
|
|
18
|
+
default: "text-muted-foreground",
|
|
19
|
+
primary: "text-primary",
|
|
20
|
+
destructive: "text-destructive",
|
|
21
|
+
inherit: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
size: "default",
|
|
26
|
+
tone: "default"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var Spinner = React.forwardRef(
|
|
30
|
+
(_a, ref) => {
|
|
31
|
+
var _b = _a, { className, size, tone, label = "Loading" } = _b, props = __objRest(_b, ["className", "size", "tone", "label"]);
|
|
32
|
+
return /* @__PURE__ */ jsxs(
|
|
33
|
+
"span",
|
|
34
|
+
__spreadProps(__spreadValues({
|
|
35
|
+
ref,
|
|
36
|
+
role: "status",
|
|
37
|
+
"data-slot": "spinner",
|
|
38
|
+
className: cn("inline-flex items-center justify-center", className)
|
|
39
|
+
}, props), {
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Loader2, { "aria-hidden": true, className: spinnerVariants({ size, tone }) }),
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label })
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
Spinner.displayName = "Spinner";
|
|
49
|
+
|
|
50
|
+
export { Spinner, spinnerVariants };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface StepperStep {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Stepper: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
9
|
+
steps: StepperStep[];
|
|
10
|
+
activeStep: number;
|
|
11
|
+
/** Highest step the user has reached (enables clicking back). Defaults to activeStep. */
|
|
12
|
+
furthestStep?: number;
|
|
13
|
+
/** When provided, steps render as buttons. */
|
|
14
|
+
onStepClick?: (index: number) => void;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
|
|
18
|
+
export { Stepper, type StepperStep };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var Stepper = React.forwardRef(
|
|
7
|
+
(_a, ref) => {
|
|
8
|
+
var _b = _a, {
|
|
9
|
+
className,
|
|
10
|
+
steps,
|
|
11
|
+
activeStep,
|
|
12
|
+
furthestStep,
|
|
13
|
+
onStepClick,
|
|
14
|
+
ariaLabel = "Progress"
|
|
15
|
+
} = _b, props = __objRest(_b, [
|
|
16
|
+
"className",
|
|
17
|
+
"steps",
|
|
18
|
+
"activeStep",
|
|
19
|
+
"furthestStep",
|
|
20
|
+
"onStepClick",
|
|
21
|
+
"ariaLabel"
|
|
22
|
+
]);
|
|
23
|
+
var _a2;
|
|
24
|
+
const reachable = furthestStep != null ? furthestStep : activeStep;
|
|
25
|
+
const isInteractive = typeof onStepClick === "function";
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"nav",
|
|
28
|
+
__spreadProps(__spreadValues({
|
|
29
|
+
ref,
|
|
30
|
+
"aria-label": ariaLabel,
|
|
31
|
+
className: cn("w-full", className)
|
|
32
|
+
}, props), {
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("ol", { className: "hidden md:flex w-full items-center", "data-slot": "stepper", children: steps.map((step, i) => {
|
|
35
|
+
const status = i < activeStep ? "complete" : i === activeStep ? "current" : "upcoming";
|
|
36
|
+
const isLast = i === steps.length - 1;
|
|
37
|
+
const canClick = isInteractive && i <= reachable;
|
|
38
|
+
const Item = canClick ? "button" : "div";
|
|
39
|
+
const itemProps = canClick ? {
|
|
40
|
+
type: "button",
|
|
41
|
+
onClick: () => onStepClick == null ? void 0 : onStepClick(i),
|
|
42
|
+
disabled: !canClick
|
|
43
|
+
} : {};
|
|
44
|
+
return /* @__PURE__ */ jsxs("li", { className: "contents", "data-status": status, children: [
|
|
45
|
+
/* @__PURE__ */ jsxs(
|
|
46
|
+
Item,
|
|
47
|
+
__spreadProps(__spreadValues({}, itemProps), {
|
|
48
|
+
"aria-current": status === "current" ? "step" : void 0,
|
|
49
|
+
className: cn(
|
|
50
|
+
"group inline-flex items-center gap-2 rounded-full text-sm transition-opacity",
|
|
51
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
52
|
+
canClick && status !== "current" && "hover:opacity-80"
|
|
53
|
+
),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(StepCircle, { index: i, status }),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: cn(
|
|
60
|
+
"whitespace-nowrap transition-colors",
|
|
61
|
+
status === "current" && "font-semibold text-foreground",
|
|
62
|
+
status === "complete" && "font-medium text-foreground/80",
|
|
63
|
+
status === "upcoming" && "text-foreground/40"
|
|
64
|
+
),
|
|
65
|
+
children: step.title
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
),
|
|
71
|
+
!isLast && /* @__PURE__ */ jsx(StepConnector, { filled: i < activeStep })
|
|
72
|
+
] }, step.id);
|
|
73
|
+
}) }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "md:hidden", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("ol", { className: "flex items-center gap-1.5", role: "list", children: steps.map((step, i) => {
|
|
76
|
+
const status = i < activeStep ? "complete" : i === activeStep ? "current" : "upcoming";
|
|
77
|
+
const canClick = isInteractive && i <= reachable;
|
|
78
|
+
return /* @__PURE__ */ jsx("li", { className: "flex-1", children: canClick ? /* @__PURE__ */ jsx(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
type: "button",
|
|
82
|
+
onClick: () => onStepClick == null ? void 0 : onStepClick(i),
|
|
83
|
+
"aria-label": `${i + 1}. ${step.title}`,
|
|
84
|
+
"aria-current": status === "current" ? "step" : void 0,
|
|
85
|
+
className: cn(
|
|
86
|
+
"block w-full h-1.5 rounded-full transition-colors",
|
|
87
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
88
|
+
status === "current" && "bg-foreground",
|
|
89
|
+
status === "complete" && "bg-foreground/50",
|
|
90
|
+
status === "upcoming" && "bg-foreground/15"
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
) : /* @__PURE__ */ jsx(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
"aria-label": `${i + 1}. ${step.title}`,
|
|
97
|
+
"aria-current": status === "current" ? "step" : void 0,
|
|
98
|
+
className: cn(
|
|
99
|
+
"block w-full h-1.5 rounded-full transition-colors",
|
|
100
|
+
status === "current" && "bg-foreground",
|
|
101
|
+
status === "complete" && "bg-foreground/50",
|
|
102
|
+
status === "upcoming" && "bg-foreground/15"
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
) }, step.id);
|
|
106
|
+
}) }),
|
|
107
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 text-xs uppercase tracking-[0.12em] text-foreground/40", children: `${activeStep + 1} / ${steps.length}` }),
|
|
108
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-base font-semibold text-foreground", children: (_a2 = steps[activeStep]) == null ? void 0 : _a2.title })
|
|
109
|
+
] })
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
Stepper.displayName = "Stepper";
|
|
116
|
+
function StepCircle({ index, status }) {
|
|
117
|
+
const isFilled = status !== "upcoming";
|
|
118
|
+
const isComplete = status === "complete";
|
|
119
|
+
return /* @__PURE__ */ jsxs(
|
|
120
|
+
"span",
|
|
121
|
+
{
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
className: "relative inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
className: cn(
|
|
129
|
+
"absolute inset-0 rounded-full border transition-opacity duration-300",
|
|
130
|
+
isFilled ? "opacity-0 border-transparent" : "opacity-100 border-foreground/25"
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
className: cn(
|
|
138
|
+
"absolute inset-0 rounded-full bg-foreground origin-center transition-transform duration-300 ease-out",
|
|
139
|
+
isFilled ? "scale-100" : "scale-0"
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
className: cn(
|
|
147
|
+
"relative text-xs font-semibold transition-opacity duration-200",
|
|
148
|
+
isComplete ? "opacity-0" : "opacity-100",
|
|
149
|
+
status === "current" ? "text-background" : "text-foreground/40"
|
|
150
|
+
),
|
|
151
|
+
children: index + 1
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
"svg",
|
|
156
|
+
{
|
|
157
|
+
className: "pointer-events-none absolute inset-0 m-auto h-3.5 w-3.5 text-background",
|
|
158
|
+
viewBox: "0 0 24 24",
|
|
159
|
+
fill: "none",
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
strokeWidth: "3",
|
|
162
|
+
strokeLinecap: "round",
|
|
163
|
+
strokeLinejoin: "round",
|
|
164
|
+
children: /* @__PURE__ */ jsx(
|
|
165
|
+
"path",
|
|
166
|
+
{
|
|
167
|
+
d: "M5 12 L10 17 L20 7",
|
|
168
|
+
pathLength: 1,
|
|
169
|
+
strokeDasharray: "1",
|
|
170
|
+
strokeDashoffset: isComplete ? 0 : 1,
|
|
171
|
+
style: {
|
|
172
|
+
transition: isComplete ? "stroke-dashoffset 450ms cubic-bezier(0.65, 0, 0.35, 1) 180ms" : "stroke-dashoffset 150ms ease-in"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function StepConnector({ filled }) {
|
|
183
|
+
return /* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
"aria-hidden": "true",
|
|
187
|
+
className: "relative h-1 flex-1 mx-3 overflow-hidden rounded-full bg-foreground/10",
|
|
188
|
+
children: /* @__PURE__ */ jsx(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: "absolute inset-y-0 left-0 rounded-full bg-foreground/50 transition-[width] duration-500 ease-out",
|
|
192
|
+
style: { width: filled ? "100%" : "0%" }
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { Stepper };
|
|
@@ -22,6 +22,7 @@ var StickyContainer = ({
|
|
|
22
22
|
{
|
|
23
23
|
ref,
|
|
24
24
|
id,
|
|
25
|
+
"data-stuck": isSticky ? "true" : void 0,
|
|
25
26
|
className: cn(
|
|
26
27
|
"sticky px-4 transition-all duration-200",
|
|
27
28
|
hideUntilSticky ? isSticky ? "py-4 opacity-100 translate-y-0" : "py-0 opacity-0 -translate-y-2 pointer-events-none" : "py-4",
|
|
@@ -9,17 +9,18 @@ var Switch = React.forwardRef((_a, ref) => {
|
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
10
10
|
SwitchPrimitive.Root,
|
|
11
11
|
__spreadProps(__spreadValues({
|
|
12
|
+
ref,
|
|
13
|
+
"data-slot": "switch",
|
|
12
14
|
className: cn(
|
|
13
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-
|
|
15
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input aria-invalid:ring-2 aria-invalid:ring-destructive/40",
|
|
14
16
|
className
|
|
15
17
|
)
|
|
16
18
|
}, props), {
|
|
17
|
-
ref,
|
|
18
19
|
children: /* @__PURE__ */ jsx(
|
|
19
20
|
SwitchPrimitive.Thumb,
|
|
20
21
|
{
|
|
21
22
|
className: cn(
|
|
22
|
-
"pointer-events-none block
|
|
23
|
+
"pointer-events-none block size-5 rounded-full bg-background shadow-md ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 data-[state=checked]:bg-primary-foreground"
|
|
23
24
|
)
|
|
24
25
|
}
|
|
25
26
|
)
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
|
|
3
|
-
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> &
|
|
4
|
-
|
|
4
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & {
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
} & React.RefAttributes<HTMLTableElement>>;
|
|
7
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & {
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
} & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
10
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
11
|
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
7
|
-
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> &
|
|
8
|
-
|
|
12
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & {
|
|
13
|
+
interactive?: boolean;
|
|
14
|
+
} & React.RefAttributes<HTMLTableRowElement>>;
|
|
15
|
+
type SortDirection = "asc" | "desc" | "none";
|
|
16
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & {
|
|
17
|
+
sortable?: boolean;
|
|
18
|
+
sortDirection?: SortDirection;
|
|
19
|
+
onSort?: () => void;
|
|
20
|
+
} & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
21
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
10
22
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
23
|
+
declare const TableEmpty: {
|
|
24
|
+
({ colSpan, children, className, ...props }: React.ComponentProps<"tr"> & {
|
|
25
|
+
colSpan: number;
|
|
26
|
+
}): react_jsx_runtime.JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
11
29
|
|
|
12
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
30
|
+
export { Table, TableBody, TableCaption, TableCell, TableEmpty, TableFooter, TableHead, TableHeader, TableRow };
|