@astra-kit/ui 0.0.0-stage → 0.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/CHANGELOG.md +15 -0
- package/LICENSE.md +21 -0
- package/README.md +384 -2
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/assets/fonts/geist-LICENSE.txt +93 -0
- package/assets/fonts/geist-latin-variable.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
- package/assets/fonts/ibmplexmono-LICENSE.txt +93 -0
- package/assets/fonts/inter-LICENSE.txt +93 -0
- package/assets/fonts/inter-latin-variable.woff2 +0 -0
- package/dist/adapters/unpic-image.d.ts +3 -0
- package/dist/adapters/unpic-image.js +98 -0
- package/dist/components/account-menu.d.ts +67 -0
- package/dist/components/account-menu.js +440 -0
- package/dist/components/action-button.d.ts +25 -0
- package/dist/components/action-button.js +264 -0
- package/dist/components/alert.d.ts +31 -0
- package/dist/components/alert.js +503 -0
- package/dist/components/animated-collapse.d.ts +19 -0
- package/dist/components/animated-collapse.js +170 -0
- package/dist/components/animated-count.d.ts +13 -0
- package/dist/components/animated-count.js +105 -0
- package/dist/components/animated-list-item.d.ts +25 -0
- package/dist/components/animated-list-item.js +134 -0
- package/dist/components/animated-theme-toggler.d.ts +12 -0
- package/dist/components/animated-theme-toggler.js +200 -0
- package/dist/components/avatar.d.ts +65 -0
- package/dist/components/avatar.js +463 -0
- package/dist/components/badge.d.ts +21 -0
- package/dist/components/badge.js +297 -0
- package/dist/components/button-interaction.d.ts +23 -0
- package/dist/components/button-interaction.js +22 -0
- package/dist/components/button-label.d.ts +8 -0
- package/dist/components/button-label.js +203 -0
- package/dist/components/button.d.ts +23 -0
- package/dist/components/button.js +145 -0
- package/dist/components/calendar.d.ts +47 -0
- package/dist/components/calendar.js +155 -0
- package/dist/components/card.d.ts +38 -0
- package/dist/components/card.js +904 -0
- package/dist/components/carousel.d.ts +71 -0
- package/dist/components/carousel.js +585 -0
- package/dist/components/checkbox.d.ts +15 -0
- package/dist/components/checkbox.js +324 -0
- package/dist/components/control-button.d.ts +16 -0
- package/dist/components/control-button.js +215 -0
- package/dist/components/data-table.d.ts +118 -0
- package/dist/components/data-table.js +895 -0
- package/dist/components/dialog-surface.d.ts +49 -0
- package/dist/components/dialog-surface.js +220 -0
- package/dist/components/dialog.d.ts +92 -0
- package/dist/components/dialog.js +320 -0
- package/dist/components/dropdown-menu.d.ts +57 -0
- package/dist/components/dropdown-menu.js +107 -0
- package/dist/components/field.d.ts +53 -0
- package/dist/components/field.js +710 -0
- package/dist/components/file-upload.d.ts +88 -0
- package/dist/components/file-upload.js +776 -0
- package/dist/components/filter-presets-bar.d.ts +73 -0
- package/dist/components/filter-presets-bar.js +510 -0
- package/dist/components/filter-query-bar.d.ts +21 -0
- package/dist/components/filter-query-bar.js +881 -0
- package/dist/components/filter-query-grammar.d.ts +188 -0
- package/dist/components/filter-query-grammar.js +875 -0
- package/dist/components/form.d.ts +29 -0
- package/dist/components/form.js +330 -0
- package/dist/components/highlighter.d.ts +15 -0
- package/dist/components/highlighter.js +152 -0
- package/dist/components/hover-card.d.ts +50 -0
- package/dist/components/hover-card.js +80 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.js +277 -0
- package/dist/components/input.d.ts +17 -0
- package/dist/components/input.js +120 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +43 -0
- package/dist/components/link.d.ts +9 -0
- package/dist/components/link.js +43 -0
- package/dist/components/morph-text.d.ts +14 -0
- package/dist/components/morph-text.js +210 -0
- package/dist/components/pagination.d.ts +59 -0
- package/dist/components/pagination.js +190 -0
- package/dist/components/popover.d.ts +17 -0
- package/dist/components/popover.js +40 -0
- package/dist/components/presence-swap.d.ts +22 -0
- package/dist/components/presence-swap.js +209 -0
- package/dist/components/primitives/alert-dialog.d.ts +68 -0
- package/dist/components/primitives/alert-dialog.js +629 -0
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +265 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +560 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +37 -0
- package/dist/components/primitives/select.js +428 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/progress-ring.d.ts +20 -0
- package/dist/components/progress-ring.js +53 -0
- package/dist/components/radio-group.d.ts +34 -0
- package/dist/components/radio-group.js +392 -0
- package/dist/components/reaction-button.d.ts +30 -0
- package/dist/components/reaction-button.js +189 -0
- package/dist/components/rich-link-editor.d.ts +25 -0
- package/dist/components/rich-link-editor.js +320 -0
- package/dist/components/rich-markdown-content.d.ts +10 -0
- package/dist/components/rich-markdown-content.js +56 -0
- package/dist/components/rich-text-content.d.ts +19 -0
- package/dist/components/rich-text-content.js +26 -0
- package/dist/components/select.d.ts +55 -0
- package/dist/components/select.js +188 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +48 -0
- package/dist/components/sheet.d.ts +19 -0
- package/dist/components/sheet.js +420 -0
- package/dist/components/sidebar-panel-context.d.ts +17 -0
- package/dist/components/sidebar-panel-context.js +14 -0
- package/dist/components/sidebar.d.ts +195 -0
- package/dist/components/sidebar.js +2041 -0
- package/dist/components/skeleton.d.ts +23 -0
- package/dist/components/skeleton.js +334 -0
- package/dist/components/split-button.d.ts +36 -0
- package/dist/components/split-button.js +306 -0
- package/dist/components/svgs/whatsappIcon.d.ts +3 -0
- package/dist/components/svgs/whatsappIcon.js +14 -0
- package/dist/components/switch.d.ts +13 -0
- package/dist/components/switch.js +444 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +298 -0
- package/dist/components/tabs.d.ts +36 -0
- package/dist/components/tabs.js +636 -0
- package/dist/components/textarea.d.ts +16 -0
- package/dist/components/textarea.js +111 -0
- package/dist/components/themed-toaster.d.ts +7 -0
- package/dist/components/themed-toaster.js +86 -0
- package/dist/components/toaster.d.ts +12 -0
- package/dist/components/toaster.js +62 -0
- package/dist/components/tooltip.d.ts +43 -0
- package/dist/components/tooltip.js +65 -0
- package/dist/components/typing-animation.d.ts +34 -0
- package/dist/components/typing-animation.js +389 -0
- package/dist/constants/action-button.d.ts +20 -0
- package/dist/constants/action-button.js +17 -0
- package/dist/constants/alert.d.ts +16 -0
- package/dist/constants/alert.js +13 -0
- package/dist/constants/avatar.d.ts +38 -0
- package/dist/constants/avatar.js +32 -0
- package/dist/constants/badge.d.ts +6 -0
- package/dist/constants/badge.js +6 -0
- package/dist/constants/button.d.ts +16 -0
- package/dist/constants/button.js +16 -0
- package/dist/constants/calendar.d.ts +36 -0
- package/dist/constants/calendar.js +34 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +55 -0
- package/dist/constants/carousel.js +74 -0
- package/dist/constants/checkbox.d.ts +17 -0
- package/dist/constants/checkbox.js +17 -0
- package/dist/constants/dialog.d.ts +11 -0
- package/dist/constants/dialog.js +10 -0
- package/dist/constants/dropdown-menu.d.ts +10 -0
- package/dist/constants/dropdown-menu.js +37 -0
- package/dist/constants/field.d.ts +24 -0
- package/dist/constants/field.js +24 -0
- package/dist/constants/hover-card.d.ts +37 -0
- package/dist/constants/hover-card.js +85 -0
- package/dist/constants/morph-text.d.ts +13 -0
- package/dist/constants/morph-text.js +13 -0
- package/dist/constants/motion.d.ts +12 -0
- package/dist/constants/motion.js +12 -0
- package/dist/constants/pagination.d.ts +20 -0
- package/dist/constants/pagination.js +20 -0
- package/dist/constants/popover.d.ts +7 -0
- package/dist/constants/popover.js +33 -0
- package/dist/constants/radio-group.d.ts +10 -0
- package/dist/constants/radio-group.js +10 -0
- package/dist/constants/select.d.ts +7 -0
- package/dist/constants/select.js +34 -0
- package/dist/constants/sidebar.d.ts +9 -0
- package/dist/constants/sidebar.js +17 -0
- package/dist/constants/skeleton.d.ts +17 -0
- package/dist/constants/skeleton.js +17 -0
- package/dist/constants/split-button.d.ts +7 -0
- package/dist/constants/split-button.js +5 -0
- package/dist/constants/switch.d.ts +33 -0
- package/dist/constants/switch.js +41 -0
- package/dist/constants/tabs.d.ts +17 -0
- package/dist/constants/tabs.js +17 -0
- package/dist/constants/toast.d.ts +3 -0
- package/dist/constants/toast.js +3 -0
- package/dist/constants/tooltip.d.ts +13 -0
- package/dist/constants/tooltip.js +52 -0
- package/dist/hooks/use-horizontal-swipe.d.ts +23 -0
- package/dist/hooks/use-horizontal-swipe.js +80 -0
- package/dist/hooks/use-is-hydrated.d.ts +6 -0
- package/dist/hooks/use-is-hydrated.js +20 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +19 -0
- package/dist/hooks/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/hooks/use-prefers-reduced-motion.js +27 -0
- package/dist/hooks/use-rich-link-editor.d.ts +55 -0
- package/dist/hooks/use-rich-link-editor.js +515 -0
- package/dist/hooks/use-sidebar-persistence.d.ts +6 -0
- package/dist/hooks/use-sidebar-persistence.js +52 -0
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks/use-viewer-time-zone.d.ts +6 -0
- package/dist/hooks/use-viewer-time-zone.js +20 -0
- package/dist/hooks.d.ts +11 -0
- package/dist/hooks.js +11 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +69 -0
- package/dist/lib/browser-clipboard.d.ts +13 -0
- package/dist/lib/browser-clipboard.js +48 -0
- package/dist/lib/column-filter-value.d.ts +12 -0
- package/dist/lib/column-filter-value.js +52 -0
- package/dist/lib/file-acceptance.d.ts +43 -0
- package/dist/lib/file-acceptance.js +107 -0
- package/dist/lib/format-file-size.d.ts +16 -0
- package/dist/lib/format-file-size.js +34 -0
- package/dist/lib/fuzzy-search.d.ts +17 -0
- package/dist/lib/fuzzy-search.js +183 -0
- package/dist/lib/horizontal-swipe.d.ts +23 -0
- package/dist/lib/horizontal-swipe.js +29 -0
- package/dist/lib/image-dimensions.d.ts +2 -0
- package/dist/lib/image-dimensions.js +7 -0
- package/dist/lib/name-initials.d.ts +7 -0
- package/dist/lib/name-initials.js +11 -0
- package/dist/lib/rich-text/link-markdown-constants.d.ts +147 -0
- package/dist/lib/rich-text/link-markdown-constants.js +458 -0
- package/dist/lib/rich-text/link-markdown-types.d.ts +53 -0
- package/dist/lib/rich-text/link-markdown-types.js +1 -0
- package/dist/lib/rich-text/link-markdown.d.ts +193 -0
- package/dist/lib/rich-text/link-markdown.js +592 -0
- package/dist/lib/rich-text/rich-markdown.d.ts +41 -0
- package/dist/lib/rich-text/rich-markdown.js +105 -0
- package/dist/lib/rich-text/rich-text-editor-dom.d.ts +26 -0
- package/dist/lib/rich-text/rich-text-editor-dom.js +79 -0
- package/dist/lib/toast-layer.d.ts +24 -0
- package/dist/lib/toast-layer.js +76 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/year-month-filter.d.ts +16 -0
- package/dist/lib/year-month-filter.js +46 -0
- package/dist/motion/arc-floating-slot.d.ts +40 -0
- package/dist/motion/arc-floating-slot.js +177 -0
- package/dist/motion/arc-press.d.ts +6 -0
- package/dist/motion/arc-press.js +59 -0
- package/dist/motion/arc-swap.d.ts +22 -0
- package/dist/motion/arc-swap.js +49 -0
- package/dist/motion/arc-tokens.d.ts +53 -0
- package/dist/motion/arc-tokens.js +73 -0
- package/dist/motion/glide-indicator.d.ts +69 -0
- package/dist/motion/glide-indicator.js +309 -0
- package/dist/motion/glide-slot.d.ts +9 -0
- package/dist/motion/glide-slot.js +71 -0
- package/dist/motion/motion-slot.d.ts +12 -0
- package/dist/motion/motion-slot.js +376 -0
- package/dist/motion/overlay-warmth.d.ts +24 -0
- package/dist/motion/overlay-warmth.js +70 -0
- package/dist/motion/presence.d.ts +40 -0
- package/dist/motion/presence.js +101 -0
- package/dist/motion/surface-keyframes.d.ts +24 -0
- package/dist/motion/surface-keyframes.js +141 -0
- package/dist/motion/tokens.d.ts +81 -0
- package/dist/motion/tokens.js +67 -0
- package/dist/motion/use-attached-element.d.ts +7 -0
- package/dist/motion/use-attached-element.js +22 -0
- package/dist/motion/use-morph-width.d.ts +13 -0
- package/dist/motion/use-morph-width.js +59 -0
- package/dist/next.d.ts +14 -0
- package/dist/next.js +79 -0
- package/dist/providers/astra-ui-provider.d.ts +27 -0
- package/dist/providers/astra-ui-provider.js +100 -0
- package/dist/providers/native-provider.d.ts +4 -0
- package/dist/providers/native-provider.js +45 -0
- package/dist/sonner.d.ts +7 -0
- package/dist/sonner.js +8 -0
- package/dist/styles.css +2 -0
- package/dist/tanstack.d.ts +11 -0
- package/dist/tanstack.js +50 -0
- package/dist/theme.d.ts +3 -0
- package/dist/theme.js +1 -0
- package/dist/types/data-table.d.ts +27 -0
- package/dist/types/data-table.js +1 -0
- package/fonts.css +5 -0
- package/package.json +450 -4
- package/styles.css +4 -0
- package/theme.css +248 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
function Separator(t0) {
|
|
7
|
+
const $ = _c(10);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let t1;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({className, orientation: t1, ...props} = t0);
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
$[1] = className;
|
|
15
|
+
$[2] = props;
|
|
16
|
+
$[3] = t1;
|
|
17
|
+
} else {
|
|
18
|
+
className = $[1];
|
|
19
|
+
props = $[2];
|
|
20
|
+
t1 = $[3];
|
|
21
|
+
}
|
|
22
|
+
const orientation = t1 === undefined ? "horizontal" : t1;
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[4] !== className) {
|
|
25
|
+
t2 = cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className);
|
|
26
|
+
$[4] = className;
|
|
27
|
+
$[5] = t2;
|
|
28
|
+
} else {
|
|
29
|
+
t2 = $[5];
|
|
30
|
+
}
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[6] !== orientation || $[7] !== props || $[8] !== t2) {
|
|
33
|
+
t3 = /* @__PURE__ */ _jsx(SeparatorPrimitive, {
|
|
34
|
+
"data-slot": "separator",
|
|
35
|
+
orientation,
|
|
36
|
+
className: t2,
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
$[6] = orientation;
|
|
40
|
+
$[7] = props;
|
|
41
|
+
$[8] = t2;
|
|
42
|
+
$[9] = t3;
|
|
43
|
+
} else {
|
|
44
|
+
t3 = $[9];
|
|
45
|
+
}
|
|
46
|
+
return t3;
|
|
47
|
+
}
|
|
48
|
+
export { Separator };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* Constrains top and bottom panels to the dynamic viewport and scrolls long content.
|
|
8
|
+
* @param props - Primitive properties and optional consumer overrides.
|
|
9
|
+
* @returns The styled primitive with its original interaction contract.
|
|
10
|
+
*/
|
|
11
|
+
declare function SheetContent({ className, children, side, showCloseButton, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
12
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
|
18
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
|
19
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
5
|
+
import { MotionSlot } from "../motion/motion-slot.js";
|
|
6
|
+
import { MotionPresence, MotionOpenProvider, useMotionOpenState } from "../motion/presence.js";
|
|
7
|
+
import { cn } from "../lib/utils.js";
|
|
8
|
+
import { keepOpenOnToastInteraction } from "../lib/toast-layer.js";
|
|
9
|
+
import { ControlButton } from "./control-button.js";
|
|
10
|
+
import { XIcon } from "lucide-react";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Sheet(t0) {
|
|
13
|
+
const $ = _c(9);
|
|
14
|
+
let props;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({...props} = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = props;
|
|
19
|
+
} else {
|
|
20
|
+
props = $[1];
|
|
21
|
+
}
|
|
22
|
+
const [motionOpen, setMotionOpen] = useMotionOpenState(props);
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[2] !== motionOpen || $[3] !== props || $[4] !== setMotionOpen) {
|
|
25
|
+
t1 = /* @__PURE__ */ _jsx(SheetPrimitive.Root, {
|
|
26
|
+
"data-slot": "sheet",
|
|
27
|
+
...props,
|
|
28
|
+
open: motionOpen,
|
|
29
|
+
onOpenChange: setMotionOpen
|
|
30
|
+
});
|
|
31
|
+
$[2] = motionOpen;
|
|
32
|
+
$[3] = props;
|
|
33
|
+
$[4] = setMotionOpen;
|
|
34
|
+
$[5] = t1;
|
|
35
|
+
} else {
|
|
36
|
+
t1 = $[5];
|
|
37
|
+
}
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[6] !== motionOpen || $[7] !== t1) {
|
|
40
|
+
t2 = /* @__PURE__ */ _jsx(MotionOpenProvider, {
|
|
41
|
+
scope: "sheet",
|
|
42
|
+
open: motionOpen,
|
|
43
|
+
children: t1
|
|
44
|
+
});
|
|
45
|
+
$[6] = motionOpen;
|
|
46
|
+
$[7] = t1;
|
|
47
|
+
$[8] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[8];
|
|
50
|
+
}
|
|
51
|
+
return t2;
|
|
52
|
+
}
|
|
53
|
+
function SheetTrigger(t0) {
|
|
54
|
+
const $ = _c(4);
|
|
55
|
+
let props;
|
|
56
|
+
if ($[0] !== t0) {
|
|
57
|
+
({...props} = t0);
|
|
58
|
+
$[0] = t0;
|
|
59
|
+
$[1] = props;
|
|
60
|
+
} else {
|
|
61
|
+
props = $[1];
|
|
62
|
+
}
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[2] !== props) {
|
|
65
|
+
t1 = /* @__PURE__ */ _jsx(SheetPrimitive.Trigger, {
|
|
66
|
+
"data-slot": "sheet-trigger",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
$[2] = props;
|
|
70
|
+
$[3] = t1;
|
|
71
|
+
} else {
|
|
72
|
+
t1 = $[3];
|
|
73
|
+
}
|
|
74
|
+
return t1;
|
|
75
|
+
}
|
|
76
|
+
function SheetClose(t0) {
|
|
77
|
+
const $ = _c(4);
|
|
78
|
+
let props;
|
|
79
|
+
if ($[0] !== t0) {
|
|
80
|
+
({...props} = t0);
|
|
81
|
+
$[0] = t0;
|
|
82
|
+
$[1] = props;
|
|
83
|
+
} else {
|
|
84
|
+
props = $[1];
|
|
85
|
+
}
|
|
86
|
+
let t1;
|
|
87
|
+
if ($[2] !== props) {
|
|
88
|
+
t1 = /* @__PURE__ */ _jsx(SheetPrimitive.Close, {
|
|
89
|
+
"data-slot": "sheet-close",
|
|
90
|
+
...props
|
|
91
|
+
});
|
|
92
|
+
$[2] = props;
|
|
93
|
+
$[3] = t1;
|
|
94
|
+
} else {
|
|
95
|
+
t1 = $[3];
|
|
96
|
+
}
|
|
97
|
+
return t1;
|
|
98
|
+
}
|
|
99
|
+
function SheetPortal(t0) {
|
|
100
|
+
const $ = _c(4);
|
|
101
|
+
let props;
|
|
102
|
+
if ($[0] !== t0) {
|
|
103
|
+
({...props} = t0);
|
|
104
|
+
$[0] = t0;
|
|
105
|
+
$[1] = props;
|
|
106
|
+
} else {
|
|
107
|
+
props = $[1];
|
|
108
|
+
}
|
|
109
|
+
let t1;
|
|
110
|
+
if ($[2] !== props) {
|
|
111
|
+
t1 = /* @__PURE__ */ _jsx(SheetPrimitive.Portal, {
|
|
112
|
+
"data-slot": "sheet-portal",
|
|
113
|
+
...props
|
|
114
|
+
});
|
|
115
|
+
$[2] = props;
|
|
116
|
+
$[3] = t1;
|
|
117
|
+
} else {
|
|
118
|
+
t1 = $[3];
|
|
119
|
+
}
|
|
120
|
+
return t1;
|
|
121
|
+
}
|
|
122
|
+
function SheetOverlay(t0) {
|
|
123
|
+
const $ = _c(8);
|
|
124
|
+
let className;
|
|
125
|
+
let props;
|
|
126
|
+
if ($[0] !== t0) {
|
|
127
|
+
({className, ...props} = t0);
|
|
128
|
+
$[0] = t0;
|
|
129
|
+
$[1] = className;
|
|
130
|
+
$[2] = props;
|
|
131
|
+
} else {
|
|
132
|
+
className = $[1];
|
|
133
|
+
props = $[2];
|
|
134
|
+
}
|
|
135
|
+
let t1;
|
|
136
|
+
if ($[3] !== className) {
|
|
137
|
+
t1 = cn("fixed inset-0 z-50 bg-black/30 supports-backdrop-filter:backdrop-blur-md ", className);
|
|
138
|
+
$[3] = className;
|
|
139
|
+
$[4] = t1;
|
|
140
|
+
} else {
|
|
141
|
+
t1 = $[4];
|
|
142
|
+
}
|
|
143
|
+
let t2;
|
|
144
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
145
|
+
t2 = /* @__PURE__ */ _jsx(SheetPrimitive.Overlay, {
|
|
146
|
+
"data-slot": "sheet-overlay",
|
|
147
|
+
className: t1,
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
$[5] = props;
|
|
151
|
+
$[6] = t1;
|
|
152
|
+
$[7] = t2;
|
|
153
|
+
} else {
|
|
154
|
+
t2 = $[7];
|
|
155
|
+
}
|
|
156
|
+
return t2;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Constrains top and bottom panels to the dynamic viewport and scrolls long content.
|
|
160
|
+
* @param props - Primitive properties and optional consumer overrides.
|
|
161
|
+
* @returns The styled primitive with its original interaction contract.
|
|
162
|
+
*/
|
|
163
|
+
function SheetContent(t0) {
|
|
164
|
+
const $ = _c(23);
|
|
165
|
+
let children;
|
|
166
|
+
let className;
|
|
167
|
+
let props;
|
|
168
|
+
let t1;
|
|
169
|
+
let t2;
|
|
170
|
+
if ($[0] !== t0) {
|
|
171
|
+
({className, children, side: t1, showCloseButton: t2, ...props} = t0);
|
|
172
|
+
$[0] = t0;
|
|
173
|
+
$[1] = children;
|
|
174
|
+
$[2] = className;
|
|
175
|
+
$[3] = props;
|
|
176
|
+
$[4] = t1;
|
|
177
|
+
$[5] = t2;
|
|
178
|
+
} else {
|
|
179
|
+
children = $[1];
|
|
180
|
+
className = $[2];
|
|
181
|
+
props = $[3];
|
|
182
|
+
t1 = $[4];
|
|
183
|
+
t2 = $[5];
|
|
184
|
+
}
|
|
185
|
+
const side = t1 === undefined ? "right" : t1;
|
|
186
|
+
const showCloseButton = t2 === undefined ? true : t2;
|
|
187
|
+
const t3 = props.forceMount;
|
|
188
|
+
let t4;
|
|
189
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
190
|
+
t4 = /* @__PURE__ */ _jsx(MotionSlot, {
|
|
191
|
+
kind: "overlay",
|
|
192
|
+
children: /* @__PURE__ */ _jsx(SheetOverlay, { forceMount: true })
|
|
193
|
+
});
|
|
194
|
+
$[6] = t4;
|
|
195
|
+
} else {
|
|
196
|
+
t4 = $[6];
|
|
197
|
+
}
|
|
198
|
+
let t5;
|
|
199
|
+
if ($[7] !== className) {
|
|
200
|
+
t5 = cn("fixed z-50 flex flex-col gap-4 overflow-y-auto overscroll-contain data-[side=bottom]:max-h-dvh data-[side=top]:max-h-dvh bg-background bg-clip-padding text-sm shadow-lg data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm ", className);
|
|
201
|
+
$[7] = className;
|
|
202
|
+
$[8] = t5;
|
|
203
|
+
} else {
|
|
204
|
+
t5 = $[8];
|
|
205
|
+
}
|
|
206
|
+
let t6;
|
|
207
|
+
if ($[9] !== props.onInteractOutside) {
|
|
208
|
+
t6 = keepOpenOnToastInteraction(props.onInteractOutside);
|
|
209
|
+
$[9] = props.onInteractOutside;
|
|
210
|
+
$[10] = t6;
|
|
211
|
+
} else {
|
|
212
|
+
t6 = $[10];
|
|
213
|
+
}
|
|
214
|
+
let t7;
|
|
215
|
+
if ($[11] !== showCloseButton) {
|
|
216
|
+
t7 = showCloseButton && /* @__PURE__ */ _jsx(SheetPrimitive.Close, {
|
|
217
|
+
"data-slot": "sheet-close",
|
|
218
|
+
asChild: true,
|
|
219
|
+
children: /* @__PURE__ */ _jsxs(ControlButton, {
|
|
220
|
+
variant: "ghost",
|
|
221
|
+
className: "absolute top-4 right-4",
|
|
222
|
+
size: "icon-sm",
|
|
223
|
+
children: [/* @__PURE__ */ _jsx(XIcon, {}), /* @__PURE__ */ _jsx("span", {
|
|
224
|
+
className: "sr-only",
|
|
225
|
+
children: "Close"
|
|
226
|
+
})]
|
|
227
|
+
})
|
|
228
|
+
});
|
|
229
|
+
$[11] = showCloseButton;
|
|
230
|
+
$[12] = t7;
|
|
231
|
+
} else {
|
|
232
|
+
t7 = $[12];
|
|
233
|
+
}
|
|
234
|
+
let t8;
|
|
235
|
+
if ($[13] !== children || $[14] !== props || $[15] !== side || $[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
|
|
236
|
+
t8 = /* @__PURE__ */ _jsxs(React.Fragment, { children: [t4, /* @__PURE__ */ _jsx(MotionSlot, {
|
|
237
|
+
kind: "sheet",
|
|
238
|
+
children: /* @__PURE__ */ _jsxs(SheetPrimitive.Content, {
|
|
239
|
+
forceMount: true,
|
|
240
|
+
"data-slot": "sheet-content",
|
|
241
|
+
"data-side": side,
|
|
242
|
+
className: t5,
|
|
243
|
+
...props,
|
|
244
|
+
onInteractOutside: t6,
|
|
245
|
+
children: [children, t7]
|
|
246
|
+
})
|
|
247
|
+
})] });
|
|
248
|
+
$[13] = children;
|
|
249
|
+
$[14] = props;
|
|
250
|
+
$[15] = side;
|
|
251
|
+
$[16] = t5;
|
|
252
|
+
$[17] = t6;
|
|
253
|
+
$[18] = t7;
|
|
254
|
+
$[19] = t8;
|
|
255
|
+
} else {
|
|
256
|
+
t8 = $[19];
|
|
257
|
+
}
|
|
258
|
+
let t9;
|
|
259
|
+
if ($[20] !== props.forceMount || $[21] !== t8) {
|
|
260
|
+
t9 = /* @__PURE__ */ _jsx(SheetPortal, {
|
|
261
|
+
forceMount: true,
|
|
262
|
+
children: /* @__PURE__ */ _jsx(MotionPresence, {
|
|
263
|
+
scope: "sheet",
|
|
264
|
+
forceMount: t3,
|
|
265
|
+
children: t8
|
|
266
|
+
})
|
|
267
|
+
});
|
|
268
|
+
$[20] = props.forceMount;
|
|
269
|
+
$[21] = t8;
|
|
270
|
+
$[22] = t9;
|
|
271
|
+
} else {
|
|
272
|
+
t9 = $[22];
|
|
273
|
+
}
|
|
274
|
+
return t9;
|
|
275
|
+
}
|
|
276
|
+
function SheetHeader(t0) {
|
|
277
|
+
const $ = _c(8);
|
|
278
|
+
let className;
|
|
279
|
+
let props;
|
|
280
|
+
if ($[0] !== t0) {
|
|
281
|
+
({className, ...props} = t0);
|
|
282
|
+
$[0] = t0;
|
|
283
|
+
$[1] = className;
|
|
284
|
+
$[2] = props;
|
|
285
|
+
} else {
|
|
286
|
+
className = $[1];
|
|
287
|
+
props = $[2];
|
|
288
|
+
}
|
|
289
|
+
let t1;
|
|
290
|
+
if ($[3] !== className) {
|
|
291
|
+
t1 = cn("flex flex-col gap-1.5 p-4", className);
|
|
292
|
+
$[3] = className;
|
|
293
|
+
$[4] = t1;
|
|
294
|
+
} else {
|
|
295
|
+
t1 = $[4];
|
|
296
|
+
}
|
|
297
|
+
let t2;
|
|
298
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
299
|
+
t2 = /* @__PURE__ */ _jsx("div", {
|
|
300
|
+
"data-slot": "sheet-header",
|
|
301
|
+
className: t1,
|
|
302
|
+
...props
|
|
303
|
+
});
|
|
304
|
+
$[5] = props;
|
|
305
|
+
$[6] = t1;
|
|
306
|
+
$[7] = t2;
|
|
307
|
+
} else {
|
|
308
|
+
t2 = $[7];
|
|
309
|
+
}
|
|
310
|
+
return t2;
|
|
311
|
+
}
|
|
312
|
+
function SheetFooter(t0) {
|
|
313
|
+
const $ = _c(8);
|
|
314
|
+
let className;
|
|
315
|
+
let props;
|
|
316
|
+
if ($[0] !== t0) {
|
|
317
|
+
({className, ...props} = t0);
|
|
318
|
+
$[0] = t0;
|
|
319
|
+
$[1] = className;
|
|
320
|
+
$[2] = props;
|
|
321
|
+
} else {
|
|
322
|
+
className = $[1];
|
|
323
|
+
props = $[2];
|
|
324
|
+
}
|
|
325
|
+
let t1;
|
|
326
|
+
if ($[3] !== className) {
|
|
327
|
+
t1 = cn("mt-auto flex flex-col gap-2 p-4", className);
|
|
328
|
+
$[3] = className;
|
|
329
|
+
$[4] = t1;
|
|
330
|
+
} else {
|
|
331
|
+
t1 = $[4];
|
|
332
|
+
}
|
|
333
|
+
let t2;
|
|
334
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
335
|
+
t2 = /* @__PURE__ */ _jsx("div", {
|
|
336
|
+
"data-slot": "sheet-footer",
|
|
337
|
+
className: t1,
|
|
338
|
+
...props
|
|
339
|
+
});
|
|
340
|
+
$[5] = props;
|
|
341
|
+
$[6] = t1;
|
|
342
|
+
$[7] = t2;
|
|
343
|
+
} else {
|
|
344
|
+
t2 = $[7];
|
|
345
|
+
}
|
|
346
|
+
return t2;
|
|
347
|
+
}
|
|
348
|
+
function SheetTitle(t0) {
|
|
349
|
+
const $ = _c(8);
|
|
350
|
+
let className;
|
|
351
|
+
let props;
|
|
352
|
+
if ($[0] !== t0) {
|
|
353
|
+
({className, ...props} = t0);
|
|
354
|
+
$[0] = t0;
|
|
355
|
+
$[1] = className;
|
|
356
|
+
$[2] = props;
|
|
357
|
+
} else {
|
|
358
|
+
className = $[1];
|
|
359
|
+
props = $[2];
|
|
360
|
+
}
|
|
361
|
+
let t1;
|
|
362
|
+
if ($[3] !== className) {
|
|
363
|
+
t1 = cn("font-heading font-medium text-foreground", className);
|
|
364
|
+
$[3] = className;
|
|
365
|
+
$[4] = t1;
|
|
366
|
+
} else {
|
|
367
|
+
t1 = $[4];
|
|
368
|
+
}
|
|
369
|
+
let t2;
|
|
370
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
371
|
+
t2 = /* @__PURE__ */ _jsx(SheetPrimitive.Title, {
|
|
372
|
+
"data-slot": "sheet-title",
|
|
373
|
+
className: t1,
|
|
374
|
+
...props
|
|
375
|
+
});
|
|
376
|
+
$[5] = props;
|
|
377
|
+
$[6] = t1;
|
|
378
|
+
$[7] = t2;
|
|
379
|
+
} else {
|
|
380
|
+
t2 = $[7];
|
|
381
|
+
}
|
|
382
|
+
return t2;
|
|
383
|
+
}
|
|
384
|
+
function SheetDescription(t0) {
|
|
385
|
+
const $ = _c(8);
|
|
386
|
+
let className;
|
|
387
|
+
let props;
|
|
388
|
+
if ($[0] !== t0) {
|
|
389
|
+
({className, ...props} = t0);
|
|
390
|
+
$[0] = t0;
|
|
391
|
+
$[1] = className;
|
|
392
|
+
$[2] = props;
|
|
393
|
+
} else {
|
|
394
|
+
className = $[1];
|
|
395
|
+
props = $[2];
|
|
396
|
+
}
|
|
397
|
+
let t1;
|
|
398
|
+
if ($[3] !== className) {
|
|
399
|
+
t1 = cn("text-sm text-muted-foreground", className);
|
|
400
|
+
$[3] = className;
|
|
401
|
+
$[4] = t1;
|
|
402
|
+
} else {
|
|
403
|
+
t1 = $[4];
|
|
404
|
+
}
|
|
405
|
+
let t2;
|
|
406
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
407
|
+
t2 = /* @__PURE__ */ _jsx(SheetPrimitive.Description, {
|
|
408
|
+
"data-slot": "sheet-description",
|
|
409
|
+
className: t1,
|
|
410
|
+
...props
|
|
411
|
+
});
|
|
412
|
+
$[5] = props;
|
|
413
|
+
$[6] = t1;
|
|
414
|
+
$[7] = t2;
|
|
415
|
+
} else {
|
|
416
|
+
t2 = $[7];
|
|
417
|
+
}
|
|
418
|
+
return t2;
|
|
419
|
+
}
|
|
420
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal: panel state shared by the sidebar parts and by components that adapt to the icon rail
|
|
3
|
+
* (such as `AccountMenu`), kept apart so they can read it without importing the sidebar itself.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
export type SidebarPanelState = {
|
|
7
|
+
/** Whether the desktop sidebar is shrunk to its icon rail; always false in the mobile sheet. */
|
|
8
|
+
collapsed: boolean;
|
|
9
|
+
collapsible: "offcanvas" | "icon" | "none";
|
|
10
|
+
side: "left" | "right";
|
|
11
|
+
};
|
|
12
|
+
export declare const SidebarPanelContext: React.Context<SidebarPanelState | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Reads the panel state when rendered inside a `Sidebar`, and `null` anywhere else.
|
|
15
|
+
* @returns The panel state, or `null` outside a sidebar.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useOptionalSidebarPanel(): SidebarPanelState | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* Internal: panel state shared by the sidebar parts and by components that adapt to the icon rail
|
|
4
|
+
* (such as `AccountMenu`), kept apart so they can read it without importing the sidebar itself.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
export const SidebarPanelContext = React.createContext(null);
|
|
8
|
+
/**
|
|
9
|
+
* Reads the panel state when rendered inside a `Sidebar`, and `null` anywhere else.
|
|
10
|
+
* @returns The panel state, or `null` outside a sidebar.
|
|
11
|
+
*/
|
|
12
|
+
export function useOptionalSidebarPanel() {
|
|
13
|
+
return React.use(SidebarPanelContext);
|
|
14
|
+
}
|