xiod-ui 1.0.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/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { createContext, useContext, useMemo } from "react";
|
|
7
|
+
import { Cancel } from "xiod-icons/icons/Cancel";
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
+
import { ChevronRight } from "xiod-icons/icons/ChevronRight";
|
|
11
|
+
import { Checkbox } from "@base-ui/react/checkbox";
|
|
12
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
13
|
+
import { Radio } from "@base-ui/react/radio";
|
|
14
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
15
|
+
//#region src/components/drawer.tsx
|
|
16
|
+
const DrawerContext = createContext({ position: "bottom" });
|
|
17
|
+
const directionMap = {
|
|
18
|
+
bottom: "down",
|
|
19
|
+
left: "left",
|
|
20
|
+
right: "right",
|
|
21
|
+
top: "up"
|
|
22
|
+
};
|
|
23
|
+
const DrawerCreateHandle = DrawerPrimitive.createHandle;
|
|
24
|
+
function Drawer({ swipeDirection, position = "bottom", ...props }) {
|
|
25
|
+
const contextValue = useMemo(() => ({ position }), [position]);
|
|
26
|
+
return /* @__PURE__ */ jsx(DrawerContext.Provider, {
|
|
27
|
+
value: contextValue,
|
|
28
|
+
children: /* @__PURE__ */ jsx(DrawerPrimitive.Root, {
|
|
29
|
+
swipeDirection: swipeDirection ?? directionMap[position],
|
|
30
|
+
...props
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const DrawerPortal = DrawerPrimitive.Portal;
|
|
35
|
+
function DrawerTrigger(props) {
|
|
36
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Trigger, {
|
|
37
|
+
"data-slot": "drawer-trigger",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function DrawerClose(props) {
|
|
42
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Close, {
|
|
43
|
+
"data-slot": "drawer-close",
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function DrawerSwipeArea({ className, position: positionProp, ...props }) {
|
|
48
|
+
const { position: contextPosition } = useContext(DrawerContext);
|
|
49
|
+
const position = positionProp ?? contextPosition;
|
|
50
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.SwipeArea, {
|
|
51
|
+
className: cn("fixed z-50 touch-none", position === "bottom" && "inset-x-0 bottom-0 h-8", position === "top" && "inset-x-0 top-0 h-8", position === "left" && "inset-y-0 left-0 w-8", position === "right" && "inset-y-0 right-0 w-8", className),
|
|
52
|
+
"data-slot": "drawer-swipe-area",
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function DrawerBackdrop({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Backdrop, {
|
|
58
|
+
className: cn("fixed inset-0 z-50 bg-black/32 opacity-[calc(1-var(--drawer-swipe-progress))] backdrop-blur-sm transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*0.4s)] data-swiping:duration-0 supports-[-webkit-touch-callout:none]:absolute", className),
|
|
59
|
+
"data-slot": "drawer-backdrop",
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function DrawerViewport({ className, position, variant = "default", ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Viewport, {
|
|
65
|
+
className: cn("fixed inset-0 z-50 [--bleed:--spacing(12)] [--inset:--spacing(0)]", "touch-none", position === "bottom" && "grid grid-rows-[1fr_auto] pt-12", position === "top" && "grid grid-rows-[auto_1fr] pb-12", position === "left" && "flex justify-start", position === "right" && "flex justify-end", variant === "inset" && "px-(--inset) sm:[--inset:--spacing(4)]", variant === "inset" && position !== "bottom" && "pt-(--inset)", variant === "inset" && position !== "top" && "pb-(--inset)", className),
|
|
66
|
+
"data-slot": "drawer-viewport",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function DrawerPopup({ className, children, showCloseButton = false, position: positionProp, variant = "default", showBar = false, ...props }) {
|
|
71
|
+
const { position: contextPosition } = useContext(DrawerContext);
|
|
72
|
+
const position = positionProp ?? contextPosition;
|
|
73
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { children: [/* @__PURE__ */ jsx(DrawerBackdrop, {}), /* @__PURE__ */ jsx(DrawerViewport, {
|
|
74
|
+
position,
|
|
75
|
+
variant,
|
|
76
|
+
children: /* @__PURE__ */ jsxs(DrawerPrimitive.Popup, {
|
|
77
|
+
className: cn("relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[transform,box-shadow,height,background-color] duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] will-change-transform [--peek:calc(--spacing(6)-1px)] [--scale-base:calc(max(0,1-(var(--nested-drawers)*var(--stack-step))))] [--scale:clamp(0,calc(var(--scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--shrink:calc(1-var(--scale))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-step:0.05] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] after:pointer-events-none after:absolute after:bg-popover data-swiping:select-none data-nested-drawer-open:overflow-hidden data-nested-drawer-open:bg-[color-mix(in_srgb,var(--popover),var(--color-black)_calc(2%*(var(--nested-drawers)-var(--stack-progress))))] data-ending-style:shadow-transparent data-starting-style:shadow-transparent data-ending-style:duration-[calc(var(--drawer-swipe-strength)*0.4s)] dark:data-nested-drawer-open:bg-[color-mix(in_srgb,var(--popover),var(--color-black)_calc(6%*(var(--nested-drawers)-var(--stack-progress))))] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", "touch-none", position === "bottom" && "transform-[translateY(calc(var(--drawer-snap-point-offset)+var(--drawer-swipe-movement-y)))] data-ending-style:transform-[translateY(calc(100%+env(safe-area-inset-bottom,0px)+var(--inset)))] data-starting-style:transform-[translateY(calc(100%+env(safe-area-inset-bottom,0px)+var(--inset)))] row-start-2 -mb-[max(0,calc(var(--drawer-snap-point-offset,0)+clamp(0,1,var(--drawer-snap-point-offset,0)/1px)*var(--drawer-swipe-movement-y,0)))] border-t pb-[max(0px,calc(env(safe-area-inset-bottom,0px)+var(--drawer-snap-point-offset,0px)+clamp(0,1,var(--drawer-snap-point-offset,0px)/1px)*var(--drawer-swipe-movement-y,0px)))] not-data-starting-style:not-data-ending-style:transition-[transform,box-shadow,height,background-color,margin,padding] after:inset-x-0 after:top-full after:h-(--bleed) has-data-[slot=drawer-bar]:pt-2 data-ending-style:mb-0 data-starting-style:mb-0 data-ending-style:pb-0 data-starting-style:pb-0", position === "top" && "data-starting-style:transform-[translateY(calc(-100%-var(--inset)))] data-ending-style:transform-[translateY(calc(-100%-var(--inset)))] transform-[translateY(var(--drawer-swipe-movement-y))] border-b after:inset-x-0 after:bottom-full after:h-(--bleed) has-data-[slot=drawer-bar]:pb-2", position === "left" && "data-starting-style:transform-[translateX(calc(-100%-var(--inset)))] data-ending-style:transform-[translateX(calc(-100%-var(--inset)))] transform-[translateX(var(--drawer-swipe-movement-x))] w-[calc(100%-(--spacing(12)))] max-w-md border-e after:inset-y-0 after:inset-e-full after:w-(--bleed) has-data-[slot=drawer-bar]:pe-2", position === "right" && "transform-[translateX(var(--drawer-swipe-movement-x))] data-ending-style:transform-[translateX(calc(100%+var(--inset)))] data-starting-style:transform-[translateX(calc(100%+var(--inset)))] col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s after:inset-y-0 after:inset-s-full after:w-(--bleed) has-data-[slot=drawer-bar]:ps-2", variant !== "straight" && cn(position === "bottom" && "rounded-t-2xl", position === "top" && "rounded-b-2xl **:data-[slot=drawer-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]", position === "left" && "rounded-e-2xl **:data-[slot=drawer-footer]:rounded-ee-[calc(var(--radius-2xl)-1px)]", position === "right" && "rounded-s-2xl **:data-[slot=drawer-footer]:rounded-es-[calc(var(--radius-2xl)-1px)]"), variant === "default" && cn(position === "bottom" && "before:rounded-t-[calc(var(--radius-2xl)-1px)]", position === "top" && "before:rounded-b-[calc(var(--radius-2xl)-1px)]", position === "left" && "before:rounded-e-[calc(var(--radius-2xl)-1px)]", position === "right" && "before:rounded-s-[calc(var(--radius-2xl)-1px)]"), variant === "inset" && "before:hidden sm:rounded-2xl sm:border sm:after:bg-transparent sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=drawer-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]", variant === "straight" && "[--stack-step:0]", (position === "bottom" || position === "top") && "h-(--drawer-height,auto) [--height:max(0px,calc(var(--drawer-frontmost-height,var(--drawer-height))))] data-nested-drawer-open:h-(--height)", position === "bottom" && "data-nested-drawer-open:transform-[translateY(calc(var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--shrink)*var(--height))))_scale(var(--scale))] origin-[50%_calc(100%-var(--inset))]", position === "top" && "data-nested-drawer-open:transform-[translateY(calc(var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--shrink)*var(--height))))_scale(var(--scale))] origin-[50%_var(--inset)]", position === "left" && "data-nested-drawer-open:transform-[translateX(calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)))_scale(var(--scale))] origin-right", position === "right" && "data-nested-drawer-open:transform-[translateX(calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)))_scale(var(--scale))] origin-left", className),
|
|
78
|
+
"data-slot": "drawer-popup",
|
|
79
|
+
...props,
|
|
80
|
+
children: [
|
|
81
|
+
children,
|
|
82
|
+
showCloseButton && /* @__PURE__ */ jsx(DrawerPrimitive.Close, {
|
|
83
|
+
"aria-label": "Close",
|
|
84
|
+
className: "absolute inset-e-2 top-2",
|
|
85
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
86
|
+
size: "icon",
|
|
87
|
+
className: "rounded-xl",
|
|
88
|
+
variant: "outline"
|
|
89
|
+
}),
|
|
90
|
+
children: /* @__PURE__ */ jsx(Cancel, {})
|
|
91
|
+
}),
|
|
92
|
+
showBar && /* @__PURE__ */ jsx(DrawerBar, {})
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
})] });
|
|
96
|
+
}
|
|
97
|
+
function DrawerHeader({ className, allowSelection = false, render, ...props }) {
|
|
98
|
+
const defaultProps = {
|
|
99
|
+
className: cn("flex flex-col gap-2 p-6 in-[[data-slot=drawer-popup]:has([data-slot=drawer-panel])]:pb-3 max-sm:pb-4", !allowSelection && "cursor-default", className),
|
|
100
|
+
"data-slot": "drawer-header"
|
|
101
|
+
};
|
|
102
|
+
return useRender({
|
|
103
|
+
defaultTagName: "div",
|
|
104
|
+
props: mergeProps(defaultProps, props),
|
|
105
|
+
render: allowSelection ? /* @__PURE__ */ jsx(DrawerContent, { render }) : render
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function DrawerFooter({ className, variant = "default", allowSelection = true, render, ...props }) {
|
|
109
|
+
const defaultProps = {
|
|
110
|
+
className: cn("flex flex-col-reverse gap-2 px-6 pb-(--safe-area-inset-bottom,0px) sm:flex-row sm:justify-end", !allowSelection && "cursor-default", variant === "default" && "border-t bg-muted/72 pt-4 pb-[calc(env(safe-area-inset-bottom,0px)+--spacing(4))]", variant === "bare" && "in-[[data-slot=drawer-popup]:has([data-slot=drawer-panel])]:pt-3 pt-4 pb-[calc(env(safe-area-inset-bottom,0px)+--spacing(6))]", className),
|
|
111
|
+
"data-slot": "drawer-footer"
|
|
112
|
+
};
|
|
113
|
+
return useRender({
|
|
114
|
+
defaultTagName: "div",
|
|
115
|
+
props: mergeProps(defaultProps, props),
|
|
116
|
+
render: allowSelection ? /* @__PURE__ */ jsx(DrawerContent, { render }) : render
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function DrawerTitle({ className, ...props }) {
|
|
120
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Title, {
|
|
121
|
+
className: cn("font-heading font-semibold text-xl leading-none", className),
|
|
122
|
+
"data-slot": "drawer-title",
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function DrawerDescription({ className, ...props }) {
|
|
127
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Description, {
|
|
128
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
129
|
+
"data-slot": "drawer-description",
|
|
130
|
+
...props
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function DrawerPanel({ className, scrollFade = true, scrollable = true, allowSelection = true, render, ...props }) {
|
|
134
|
+
const defaultProps = {
|
|
135
|
+
className: cn("p-6 in-[[data-slot=drawer-popup]:has([data-slot=drawer-header])]:pt-1 in-[[data-slot=drawer-popup]:has([data-slot=drawer-footer]:not(.border-t))]:pb-1", !allowSelection && "cursor-default", className),
|
|
136
|
+
"data-slot": "drawer-panel"
|
|
137
|
+
};
|
|
138
|
+
const content = useRender({
|
|
139
|
+
defaultTagName: "div",
|
|
140
|
+
props: mergeProps(defaultProps, props),
|
|
141
|
+
render: allowSelection ? /* @__PURE__ */ jsx(DrawerContent, { render }) : render
|
|
142
|
+
});
|
|
143
|
+
if (scrollable) return /* @__PURE__ */ jsx(ScrollArea, {
|
|
144
|
+
className: "touch-auto",
|
|
145
|
+
scrollFade,
|
|
146
|
+
children: content
|
|
147
|
+
});
|
|
148
|
+
return content;
|
|
149
|
+
}
|
|
150
|
+
function DrawerBar({ className, position: positionProp, render, ...props }) {
|
|
151
|
+
const { position: contextPosition } = useContext(DrawerContext);
|
|
152
|
+
const position = positionProp ?? contextPosition;
|
|
153
|
+
const defaultProps = {
|
|
154
|
+
"aria-hidden": true,
|
|
155
|
+
className: cn("absolute flex touch-none items-center justify-center p-3 before:rounded-full before:bg-input", position === "left" || position === "right" ? "inset-y-0 before:h-12 before:w-1" : "inset-x-0 before:h-1 before:w-12", position === "top" && "bottom-0", position === "bottom" && "top-0", position === "left" && "right-0", position === "right" && "left-0", className),
|
|
156
|
+
"data-slot": "drawer-bar"
|
|
157
|
+
};
|
|
158
|
+
return useRender({
|
|
159
|
+
defaultTagName: "div",
|
|
160
|
+
props: mergeProps(defaultProps, props),
|
|
161
|
+
render
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const DrawerContent = DrawerPrimitive.Content;
|
|
165
|
+
function DrawerMenu({ className, render, ...props }) {
|
|
166
|
+
const defaultProps = {
|
|
167
|
+
className: cn("-m-2 flex flex-col", className),
|
|
168
|
+
"data-slot": "drawer-menu"
|
|
169
|
+
};
|
|
170
|
+
return useRender({
|
|
171
|
+
defaultTagName: "nav",
|
|
172
|
+
props: mergeProps(defaultProps, props),
|
|
173
|
+
render
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function DrawerMenuItem({ className, variant = "default", render, disabled, ...props }) {
|
|
177
|
+
const defaultProps = {
|
|
178
|
+
className: cn("relative flex min-h-9 w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-64 data-[variant=destructive]:text-destructive-foreground sm:min-h-8 sm:text-sm [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11", className),
|
|
179
|
+
"data-slot": "drawer-menu-item",
|
|
180
|
+
"data-variant": variant,
|
|
181
|
+
disabled,
|
|
182
|
+
type: "button"
|
|
183
|
+
};
|
|
184
|
+
return useRender({
|
|
185
|
+
defaultTagName: "button",
|
|
186
|
+
props: mergeProps(defaultProps, props),
|
|
187
|
+
render
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function DrawerMenuSeparator({ className, render, ...props }) {
|
|
191
|
+
const defaultProps = {
|
|
192
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
193
|
+
"data-slot": "drawer-menu-separator"
|
|
194
|
+
};
|
|
195
|
+
return useRender({
|
|
196
|
+
defaultTagName: "div",
|
|
197
|
+
props: mergeProps(defaultProps, props),
|
|
198
|
+
render
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function DrawerMenuGroup({ className, render, ...props }) {
|
|
202
|
+
const defaultProps = {
|
|
203
|
+
className: cn("flex flex-col", className),
|
|
204
|
+
"data-slot": "drawer-menu-group"
|
|
205
|
+
};
|
|
206
|
+
return useRender({
|
|
207
|
+
defaultTagName: "div",
|
|
208
|
+
props: mergeProps(defaultProps, props),
|
|
209
|
+
render
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function DrawerMenuGroupLabel({ className, render, ...props }) {
|
|
213
|
+
const defaultProps = {
|
|
214
|
+
className: cn("px-2 py-1.5 font-medium text-muted-foreground text-xs", className),
|
|
215
|
+
"data-slot": "drawer-menu-group-label"
|
|
216
|
+
};
|
|
217
|
+
return useRender({
|
|
218
|
+
defaultTagName: "div",
|
|
219
|
+
props: mergeProps(defaultProps, props),
|
|
220
|
+
render
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
function DrawerMenuTrigger({ className, children, ...props }) {
|
|
224
|
+
return /* @__PURE__ */ jsxs(DrawerTrigger, {
|
|
225
|
+
className: cn("flex min-h-9 w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none hover:bg-accent hover:text-accent-foreground sm:min-h-8 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
226
|
+
"data-slot": "drawer-menu-trigger",
|
|
227
|
+
...props,
|
|
228
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRight, { className: "ms-auto -me-0.5 opacity-80" })]
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function DrawerMenuCheckboxItem({ className, children, checked, defaultChecked, onCheckedChange, variant = "default", disabled, render, ...props }) {
|
|
232
|
+
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
233
|
+
checked,
|
|
234
|
+
className: cn("grid min-h-9 w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none hover:bg-accent hover:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0", variant === "switch" ? "grid-cols-[1fr_auto] gap-4 pe-1.5" : "grid-cols-[1rem_1fr] pe-4", className),
|
|
235
|
+
"data-slot": "drawer-menu-checkbox-item",
|
|
236
|
+
defaultChecked,
|
|
237
|
+
disabled,
|
|
238
|
+
onCheckedChange,
|
|
239
|
+
render,
|
|
240
|
+
...props,
|
|
241
|
+
children: variant === "switch" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
242
|
+
className: "col-start-1",
|
|
243
|
+
children
|
|
244
|
+
}), /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
245
|
+
className: "inset-shadow-[0_1px_--theme(--color-black/4%)] col-start-2 inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(4)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:opacity-64 sm:[--thumb-size:--spacing(3)]",
|
|
246
|
+
keepMounted: true,
|
|
247
|
+
children: /* @__PURE__ */ jsx("span", { className: "pointer-events-none block aspect-square h-full in-[[data-slot=drawer-menu-checkbox-item][data-checked]]:origin-[var(--thumb-size)_50%] origin-left in-[[data-slot=drawer-menu-checkbox-item][data-checked]]:translate-x-[calc(var(--thumb-size)-4px)] in-[[data-slot=drawer-menu-checkbox-item]:active]:not-data-disabled:scale-x-110 in-[[data-slot=drawer-menu-checkbox-item]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.10)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s]" })
|
|
248
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
249
|
+
className: "col-start-1",
|
|
250
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
251
|
+
fill: "none",
|
|
252
|
+
height: "24",
|
|
253
|
+
stroke: "currentColor",
|
|
254
|
+
strokeLinecap: "round",
|
|
255
|
+
strokeLinejoin: "round",
|
|
256
|
+
strokeWidth: "2",
|
|
257
|
+
viewBox: "0 0 24 24",
|
|
258
|
+
width: "24",
|
|
259
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
260
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
261
|
+
})
|
|
262
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
263
|
+
className: "col-start-2",
|
|
264
|
+
children
|
|
265
|
+
})] })
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
function DrawerMenuRadioGroup({ className, ...props }) {
|
|
269
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
270
|
+
className: cn("flex flex-col", className),
|
|
271
|
+
"data-slot": "drawer-menu-radio-group",
|
|
272
|
+
...props
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function DrawerMenuRadioItem({ className, children, value, disabled, render, ...props }) {
|
|
276
|
+
return /* @__PURE__ */ jsxs(Radio.Root, {
|
|
277
|
+
className: cn("grid min-h-9 w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-base text-foreground outline-none hover:bg-accent hover:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0", "grid-cols-[1rem_1fr] items-center pe-4", className),
|
|
278
|
+
"data-slot": "drawer-menu-radio-item",
|
|
279
|
+
disabled,
|
|
280
|
+
render,
|
|
281
|
+
value,
|
|
282
|
+
...props,
|
|
283
|
+
children: [/* @__PURE__ */ jsx(Radio.Indicator, {
|
|
284
|
+
className: "col-start-1",
|
|
285
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
286
|
+
fill: "none",
|
|
287
|
+
height: "24",
|
|
288
|
+
stroke: "currentColor",
|
|
289
|
+
strokeLinecap: "round",
|
|
290
|
+
strokeLinejoin: "round",
|
|
291
|
+
strokeWidth: "2",
|
|
292
|
+
viewBox: "0 0 24 24",
|
|
293
|
+
width: "24",
|
|
294
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
295
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
296
|
+
})
|
|
297
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
298
|
+
className: "col-start-2",
|
|
299
|
+
children
|
|
300
|
+
})]
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
export { 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 };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/empty.d.ts
|
|
4
|
+
declare function Empty({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
5
|
+
declare function EmptyHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
6
|
+
export declare const emptyMediaVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "icon" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare function EmptyMedia({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): React$1.JSX.Element;
|
|
10
|
+
declare function EmptyTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
declare function EmptyDescription({ className, ...props }: React$1.ComponentProps<"p">): React$1.JSX.Element;
|
|
12
|
+
declare function EmptyContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/components/empty.tsx
|
|
5
|
+
function Empty({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance p-6 text-center md:p-12", className),
|
|
8
|
+
"data-slot": "empty",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function EmptyHeader({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: cn("flex max-w-sm flex-col items-center text-center", className),
|
|
15
|
+
"data-slot": "empty-header",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const emptyMediaVariants = cva("flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
20
|
+
defaultVariants: { variant: "default" },
|
|
21
|
+
variants: { variant: {
|
|
22
|
+
default: "bg-transparent",
|
|
23
|
+
icon: "relative flex size-9 shrink-0 items-center justify-center rounded-md border bg-card not-dark:bg-clip-padding text-foreground shadow-sm/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5"
|
|
24
|
+
} }
|
|
25
|
+
});
|
|
26
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: cn("relative mb-6", className),
|
|
29
|
+
"data-slot": "empty-media",
|
|
30
|
+
"data-variant": variant,
|
|
31
|
+
...props,
|
|
32
|
+
children: [variant === "icon" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: cn(emptyMediaVariants({
|
|
35
|
+
className,
|
|
36
|
+
variant
|
|
37
|
+
}), "-translate-x-0.5 -rotate-10 pointer-events-none absolute bottom-px origin-bottom-left scale-84 shadow-none")
|
|
38
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
className: cn(emptyMediaVariants({
|
|
41
|
+
className,
|
|
42
|
+
variant
|
|
43
|
+
}), "pointer-events-none absolute bottom-px origin-bottom-right translate-x-0.5 rotate-10 scale-84 shadow-none")
|
|
44
|
+
})] }), /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: cn(emptyMediaVariants({
|
|
46
|
+
className,
|
|
47
|
+
variant
|
|
48
|
+
})),
|
|
49
|
+
...props
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function EmptyTitle({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: cn("font-heading font-semibold text-xl", className),
|
|
56
|
+
"data-slot": "empty-title",
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function EmptyDescription({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: cn("text-muted-foreground text-sm [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-slot=empty-title]+&]:mt-1", className),
|
|
63
|
+
"data-slot": "empty-description",
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function EmptyContent({ className, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: cn("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm", className),
|
|
70
|
+
"data-slot": "empty-content",
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyMediaVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
3
|
+
//#region src/components/field.d.ts
|
|
4
|
+
declare function Field({ className, ...props }: Field$1.Root.Props): React$1.JSX.Element;
|
|
5
|
+
declare function FieldLabel({ className, ...props }: Field$1.Label.Props): React$1.JSX.Element;
|
|
6
|
+
declare function FieldItem({ className, ...props }: Field$1.Item.Props): React$1.JSX.Element;
|
|
7
|
+
declare function FieldDescription({ className, ...props }: Field$1.Description.Props): React$1.JSX.Element;
|
|
8
|
+
declare function FieldError({ className, ...props }: Field$1.Error.Props): React$1.JSX.Element;
|
|
9
|
+
declare const FieldControl: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").FieldControlProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
10
|
+
declare const FieldValidity: React$1.FC<import("@base-ui/react").FieldValidityProps>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
5
|
+
//#region src/components/field.tsx
|
|
6
|
+
function Field({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Field$1.Root, {
|
|
8
|
+
className: cn("flex flex-col items-start gap-2", className),
|
|
9
|
+
"data-slot": "field",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function FieldLabel({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Field$1.Label, {
|
|
15
|
+
className: cn("inline-flex items-center gap-2 font-medium text-base/4.5 text-foreground data-disabled:opacity-64 sm:text-sm/4", className),
|
|
16
|
+
"data-slot": "field-label",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function FieldItem({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Field$1.Item, {
|
|
22
|
+
className: cn("flex", className),
|
|
23
|
+
"data-slot": "field-item",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function FieldDescription({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Field$1.Description, {
|
|
29
|
+
className: cn("text-muted-foreground text-xs data-disabled:opacity-64", className),
|
|
30
|
+
"data-slot": "field-description",
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function FieldError({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Field$1.Error, {
|
|
36
|
+
className: cn("text-destructive-foreground text-xs", className),
|
|
37
|
+
"data-slot": "field-error",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const FieldControl = Field$1.Control;
|
|
42
|
+
const FieldValidity = Field$1.Validity;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
3
|
+
//#region src/components/fieldset.d.ts
|
|
4
|
+
declare function Fieldset({ className, ...props }: Fieldset$1.Root.Props): React$1.JSX.Element;
|
|
5
|
+
declare function FieldsetLegend({ className, ...props }: Fieldset$1.Legend.Props): React$1.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Fieldset, FieldsetLegend };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
5
|
+
//#region src/components/fieldset.tsx
|
|
6
|
+
function Fieldset({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Fieldset$1.Root, {
|
|
8
|
+
className: cn("flex w-full max-w-64 flex-col gap-6", className),
|
|
9
|
+
"data-slot": "fieldset",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function FieldsetLegend({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Fieldset$1.Legend, {
|
|
15
|
+
className: cn("font-semibold text-foreground", className),
|
|
16
|
+
"data-slot": "fieldset-legend",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Fieldset, FieldsetLegend };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/file-upload.d.ts
|
|
6
|
+
export type FileStatus = "idle" | "uploading" | "success" | "error";
|
|
7
|
+
export interface FileItem {
|
|
8
|
+
id: string;
|
|
9
|
+
file: File;
|
|
10
|
+
progress: number;
|
|
11
|
+
status: FileStatus;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FileUploadProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
files?: FileItem[];
|
|
16
|
+
onFilesChange?: (files: FileItem[]) => void;
|
|
17
|
+
onFilesAdded?: (files: File[]) => void;
|
|
18
|
+
onFileRemove?: (id: string) => void;
|
|
19
|
+
maxFiles?: number;
|
|
20
|
+
maxSizeMB?: number;
|
|
21
|
+
accept?: string;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
children?: React$1.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function formatFileSize(bytes: number): string;
|
|
26
|
+
export declare function FileUpload({ files: filesProp, onFilesChange, onFilesAdded, onFileRemove, maxFiles, maxSizeMB, accept, disabled, children, ...props }: FileUploadProps): React$1.JSX.Element;
|
|
27
|
+
export declare function FileUploadTrigger({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
28
|
+
export declare function FileUploadInput({ className, ...props }: React$1.ComponentPropsWithoutRef<"input">): React$1.JSX.Element;
|
|
29
|
+
export declare function FileUploadList({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
30
|
+
interface FileUploadItemProps extends useRender.ComponentProps<"div"> {
|
|
31
|
+
fileItem: FileItem;
|
|
32
|
+
}
|
|
33
|
+
export declare function FileUploadItem({ className, render, fileItem, ...props }: FileUploadItemProps): React$1.JSX.Element;
|
|
34
|
+
export declare function FileUploadItemIcon({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
35
|
+
export declare function FileUploadItemName({ className, render, ...props }: useRender.ComponentProps<"p">): React$1.ReactElement;
|
|
36
|
+
export declare function FileUploadItemSize({ className, render, ...props }: useRender.ComponentProps<"span">): React$1.ReactElement;
|
|
37
|
+
export declare function FileUploadItemProgress({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement | null;
|
|
38
|
+
export declare function FileUploadItemStatus({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement | null;
|
|
39
|
+
export declare function FileUploadItemRemove({ className, render, ...props }: useRender.ComponentProps<"button">): React$1.ReactElement;
|
|
40
|
+
export type AttachmentState = "idle" | "uploading" | "processing" | "error" | "done";
|
|
41
|
+
export declare const attachmentVariants: (props?: ({
|
|
42
|
+
size?: "sm" | "xs" | "default" | null | undefined;
|
|
43
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
44
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
45
|
+
export interface AttachmentProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof attachmentVariants> {
|
|
46
|
+
state?: AttachmentState;
|
|
47
|
+
}
|
|
48
|
+
export declare function Attachment({ className, state, size, orientation, ...props }: AttachmentProps): React$1.JSX.Element;
|
|
49
|
+
export declare const attachmentMediaVariants: (props?: ({
|
|
50
|
+
variant?: "icon" | "image" | null | undefined;
|
|
51
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
52
|
+
export interface AttachmentMediaProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof attachmentMediaVariants> {}
|
|
53
|
+
export declare function AttachmentMedia({ className, variant, ...props }: AttachmentMediaProps): React$1.JSX.Element;
|
|
54
|
+
export declare function AttachmentContent({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
55
|
+
export declare function AttachmentTitle({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
|
|
56
|
+
export declare function AttachmentDescription({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
|
|
57
|
+
export declare function AttachmentActions({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
58
|
+
export declare function AttachmentAction({ className, variant, size, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
59
|
+
export declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React$1.ReactElement;
|
|
60
|
+
export declare function AttachmentGroup({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
61
|
+
//#endregion
|