@ponti-studios/ui 2.0.1 → 3.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/README.md +36 -3
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +3 -0
- package/dist/components/data-display/accordion.d.ts +10 -0
- package/dist/components/data-display/accordion.js +53 -0
- package/{src/components/data-display/index.ts → dist/components/data-display/index.d.ts} +1 -10
- package/dist/components/data-display/index.js +8 -0
- package/dist/components/data-display/metric-card.d.ts +9 -0
- package/dist/components/data-display/metric-card.js +25 -0
- package/dist/components/data-display/sort-controls.d.ts +13 -0
- package/dist/components/data-display/sort-controls.js +57 -0
- package/dist/components/data-display/sort-row.d.ts +10 -0
- package/dist/components/data-display/sort-row.js +52 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +57 -0
- package/dist/components/feedback/alert.d.ts +9 -0
- package/dist/components/feedback/alert.js +38 -0
- package/dist/components/feedback/empty-state.d.ts +18 -0
- package/dist/components/feedback/empty-state.js +36 -0
- package/{src/components/feedback/index.ts → dist/components/feedback/index.d.ts} +2 -0
- package/dist/components/feedback/index.js +7 -0
- package/dist/components/feedback/progress.d.ts +6 -0
- package/dist/components/feedback/progress.js +25 -0
- package/dist/components/feedback/skeleton.d.ts +2 -0
- package/dist/components/feedback/skeleton.js +11 -0
- package/dist/components/feedback/spinner.d.ts +14 -0
- package/dist/components/feedback/spinner.js +27 -0
- package/dist/components/feedback/update-guard.d.ts +13 -0
- package/dist/components/feedback/update-guard.js +38 -0
- package/dist/components/filters/active-filters-bar.d.ts +14 -0
- package/dist/components/filters/active-filters-bar.js +44 -0
- package/dist/components/filters/filter-chip.d.ts +11 -0
- package/dist/components/filters/filter-chip.js +33 -0
- package/dist/components/filters/filter-select.d.ts +17 -0
- package/dist/components/filters/filter-select.js +46 -0
- package/dist/components/filters/index.js +4 -0
- package/dist/components/forms/checkbox.d.ts +4 -0
- package/dist/components/forms/checkbox.js +24 -0
- package/dist/components/forms/date-month-select.d.ts +11 -0
- package/dist/components/forms/date-month-select.js +47 -0
- package/dist/components/forms/date-picker.d.ts +60 -0
- package/dist/components/forms/date-picker.js +193 -0
- package/dist/components/forms/date-utils.d.ts +14 -0
- package/dist/components/forms/date-utils.js +18 -0
- package/dist/components/forms/drop-zone.d.ts +42 -0
- package/dist/components/forms/drop-zone.js +184 -0
- package/{src/components/forms/index.ts → dist/components/forms/index.d.ts} +3 -9
- package/dist/components/forms/index.js +17 -0
- package/dist/components/forms/input.d.ts +3 -0
- package/dist/components/forms/input.js +15 -0
- package/dist/components/forms/label.d.ts +3 -0
- package/dist/components/forms/label.js +14 -0
- package/dist/components/forms/passkey-management.d.ts +14 -0
- package/dist/components/forms/passkey-management.js +132 -0
- package/dist/components/forms/radio-group.d.ts +6 -0
- package/dist/components/forms/radio-group.js +28 -0
- package/dist/components/forms/select.d.ts +18 -0
- package/dist/components/forms/select.js +103 -0
- package/dist/components/forms/slider.d.ts +9 -0
- package/dist/components/forms/slider.js +25 -0
- package/dist/components/forms/stepper.d.ts +15 -0
- package/dist/components/forms/stepper.js +41 -0
- package/dist/components/forms/switch.d.ts +6 -0
- package/dist/components/forms/switch.js +21 -0
- package/dist/components/forms/text-field.d.ts +15 -0
- package/dist/components/forms/text-field.js +46 -0
- package/dist/components/forms/text-field.types.d.ts +8 -0
- package/dist/components/forms/textarea.d.ts +3 -0
- package/dist/components/forms/textarea.js +14 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/layout/particle-background.d.ts +19 -0
- package/dist/components/layout/particle-background.js +171 -0
- package/dist/components/layout/scroll-area.d.ts +9 -0
- package/dist/components/layout/scroll-area.js +35 -0
- package/dist/components/layout/section-intro.d.ts +12 -0
- package/dist/components/layout/section-intro.js +28 -0
- package/dist/components/layout/surface-panel.d.ts +7 -0
- package/dist/components/layout/surface-panel.js +11 -0
- package/dist/components/navigation/app-navigation.d.ts +67 -0
- package/dist/components/navigation/app-navigation.js +106 -0
- package/{src/components/navigation/index.ts → dist/components/navigation/index.d.ts} +1 -7
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/pagination-controls.d.ts +7 -0
- package/dist/components/navigation/pagination-controls.js +50 -0
- package/dist/components/navigation/tabs.d.ts +7 -0
- package/dist/components/navigation/tabs.js +35 -0
- package/dist/components/overlays/bottom-sheet.d.ts +20 -0
- package/dist/components/overlays/bottom-sheet.js +101 -0
- package/dist/components/overlays/command.d.ts +29 -0
- package/dist/components/overlays/command.js +123 -0
- package/dist/components/overlays/dialog.d.ts +30 -0
- package/dist/components/overlays/dialog.js +105 -0
- package/dist/components/overlays/dropdown-menu.d.ts +29 -0
- package/dist/components/overlays/dropdown-menu.js +128 -0
- package/dist/components/overlays/index.d.ts +7 -0
- package/dist/components/overlays/index.js +8 -0
- package/dist/components/overlays/popover.d.ts +14 -0
- package/dist/components/overlays/popover.js +56 -0
- package/dist/components/overlays/sheet.d.ts +27 -0
- package/dist/components/overlays/sheet.js +81 -0
- package/dist/components/overlays/tooltip.d.ts +10 -0
- package/dist/components/overlays/tooltip.js +23 -0
- package/dist/components/primitives/avatar.d.ts +14 -0
- package/dist/components/primitives/avatar.js +72 -0
- package/dist/components/primitives/badge.d.ts +7 -0
- package/dist/components/primitives/badge.js +27 -0
- package/dist/components/primitives/button.d.ts +13 -0
- package/dist/components/primitives/button.js +113 -0
- package/{src/components/primitives/button.types.ts → dist/components/primitives/button.types.d.ts} +4 -6
- package/dist/components/primitives/card.d.ts +9 -0
- package/dist/components/primitives/card.js +56 -0
- package/{src/components/primitives/index.ts → dist/components/primitives/index.d.ts} +1 -9
- package/dist/components/primitives/index.js +7 -0
- package/dist/components/primitives/segmented-control.d.ts +20 -0
- package/dist/components/primitives/segmented-control.js +27 -0
- package/dist/components/primitives/separator.d.ts +4 -0
- package/dist/components/primitives/separator.js +16 -0
- package/dist/constants/chart-colors.d.ts +33 -0
- package/dist/constants/chart-colors.js +31 -0
- package/dist/hooks/index.js +9 -0
- package/{src/hooks/sort.types.ts → dist/hooks/sort.types.d.ts} +2 -4
- package/dist/hooks/use-api-client.d.ts +30 -0
- package/dist/hooks/use-api-client.js +106 -0
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-derived-filter-state.d.ts +20 -0
- package/dist/hooks/use-derived-filter-state.js +39 -0
- package/dist/hooks/use-filter-state.d.ts +12 -0
- package/dist/hooks/use-filter-state.js +37 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +27 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/hooks/use-sort.d.ts +11 -0
- package/dist/hooks/use-sort.js +14 -0
- package/{src/index.ts → dist/index.d.ts} +4 -32
- package/dist/index.js +15 -0
- package/dist/integrations/service-worker.d.ts +2 -0
- package/dist/integrations/service-worker.js +2 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/clipboard.d.ts +1 -0
- package/dist/lib/clipboard.js +10 -0
- package/dist/lib/index.js +4 -0
- package/{src/lib/slot.tsx → dist/lib/slot.d.ts} +2 -15
- package/dist/lib/slot.js +14 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/native/components.d.ts +41 -0
- package/dist/native/components.js +135 -0
- package/dist/native/index.js +3 -0
- package/dist/native/theme.d.ts +19 -0
- package/dist/native/theme.js +58 -0
- package/dist/styles/tokens/css-vars.d.ts +7 -0
- package/dist/styles/tokens/css-vars.js +5 -0
- package/dist/styles/tokens/generated/dark.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/dark.colors.generated.js +39 -0
- package/dist/styles/tokens/generated/foundations.generated.d.ts +323 -0
- package/dist/styles/tokens/generated/foundations.generated.js +453 -0
- package/dist/styles/tokens/generated/light.colors.generated.d.ts +40 -0
- package/dist/styles/tokens/generated/light.colors.generated.js +39 -0
- package/dist/styles/tokens/index.d.ts +317 -0
- package/dist/styles/tokens/index.js +14 -0
- package/dist/styles.css +1 -1
- package/dist/translations/en.d.ts +34 -0
- package/dist/translations/index.d.ts +39 -0
- package/dist/translations/ui-provider.d.ts +9 -0
- package/dist/translations/ui-provider.js +16 -0
- package/dist/types/upload.d.ts +36 -0
- package/package.json +50 -33
- package/src/components/data-display/accordion.stories.tsx +0 -57
- package/src/components/data-display/accordion.tsx +0 -86
- package/src/components/data-display/metric-card.stories.tsx +0 -48
- package/src/components/data-display/metric-card.tsx +0 -20
- package/src/components/data-display/sort-controls.stories.tsx +0 -45
- package/src/components/data-display/sort-controls.tsx +0 -96
- package/src/components/data-display/sort-row.tsx +0 -88
- package/src/components/data-display/table.stories.tsx +0 -75
- package/src/components/data-display/table.tsx +0 -80
- package/src/components/feedback/alert.stories.tsx +0 -51
- package/src/components/feedback/alert.tsx +0 -64
- package/src/components/feedback/empty-state.tsx +0 -76
- package/src/components/feedback/progress.stories.tsx +0 -54
- package/src/components/feedback/progress.tsx +0 -41
- package/src/components/feedback/skeleton.stories.tsx +0 -36
- package/src/components/feedback/skeleton.tsx +0 -7
- package/src/components/feedback/spinner.stories.tsx +0 -52
- package/src/components/feedback/spinner.tsx +0 -47
- package/src/components/feedback/update-guard.stories.tsx +0 -28
- package/src/components/feedback/update-guard.tsx +0 -57
- package/src/components/filters/active-filters-bar.stories.tsx +0 -114
- package/src/components/filters/active-filters-bar.tsx +0 -61
- package/src/components/filters/filter-chip.tsx +0 -57
- package/src/components/filters/filter-select.stories.tsx +0 -71
- package/src/components/filters/filter-select.tsx +0 -68
- package/src/components/forms/checkbox.stories.tsx +0 -35
- package/src/components/forms/checkbox.tsx +0 -38
- package/src/components/forms/date-month-select.stories.tsx +0 -26
- package/src/components/forms/date-month-select.tsx +0 -79
- package/src/components/forms/date-picker.stories.tsx +0 -188
- package/src/components/forms/date-picker.tsx +0 -303
- package/src/components/forms/date-utils.ts +0 -37
- package/src/components/forms/drop-zone.stories.tsx +0 -140
- package/src/components/forms/drop-zone.tsx +0 -298
- package/src/components/forms/input.stories.tsx +0 -47
- package/src/components/forms/input.tsx +0 -24
- package/src/components/forms/label.stories.tsx +0 -16
- package/src/components/forms/label.tsx +0 -25
- package/src/components/forms/passkey-management.stories.tsx +0 -85
- package/src/components/forms/passkey-management.tsx +0 -168
- package/src/components/forms/radio-group.stories.tsx +0 -46
- package/src/components/forms/radio-group.tsx +0 -44
- package/src/components/forms/select.stories.tsx +0 -207
- package/src/components/forms/select.tsx +0 -182
- package/src/components/forms/slider.stories.tsx +0 -70
- package/src/components/forms/slider.tsx +0 -50
- package/src/components/forms/stepper.stories.tsx +0 -111
- package/src/components/forms/stepper.tsx +0 -66
- package/src/components/forms/switch.stories.tsx +0 -144
- package/src/components/forms/switch.tsx +0 -39
- package/src/components/forms/text-field.stories.tsx +0 -87
- package/src/components/forms/text-field.tsx +0 -75
- package/src/components/forms/text-field.types.ts +0 -9
- package/src/components/forms/textarea.stories.tsx +0 -150
- package/src/components/forms/textarea.tsx +0 -22
- package/src/components/layout/particle-background.stories.tsx +0 -38
- package/src/components/layout/particle-background.tsx +0 -378
- package/src/components/layout/scroll-area.stories.tsx +0 -91
- package/src/components/layout/scroll-area.tsx +0 -79
- package/src/components/layout/section-intro.stories.tsx +0 -29
- package/src/components/layout/section-intro.tsx +0 -31
- package/src/components/layout/surface-panel.stories.tsx +0 -32
- package/src/components/layout/surface-panel.tsx +0 -23
- package/src/components/navigation/app-navigation.stories.tsx +0 -217
- package/src/components/navigation/app-navigation.tsx +0 -234
- package/src/components/navigation/pagination-controls.stories.tsx +0 -41
- package/src/components/navigation/pagination-controls.tsx +0 -46
- package/src/components/navigation/tabs.stories.tsx +0 -48
- package/src/components/navigation/tabs.tsx +0 -52
- package/src/components/overlays/bottom-sheet.stories.tsx +0 -52
- package/src/components/overlays/bottom-sheet.tsx +0 -179
- package/src/components/overlays/command.stories.tsx +0 -65
- package/src/components/overlays/command.tsx +0 -227
- package/src/components/overlays/dialog.stories.tsx +0 -148
- package/src/components/overlays/dialog.tsx +0 -203
- package/src/components/overlays/dropdown-menu.stories.tsx +0 -74
- package/src/components/overlays/dropdown-menu.tsx +0 -236
- package/src/components/overlays/index.ts +0 -56
- package/src/components/overlays/popover.stories.tsx +0 -51
- package/src/components/overlays/popover.tsx +0 -78
- package/src/components/overlays/sheet.stories.tsx +0 -68
- package/src/components/overlays/sheet.tsx +0 -155
- package/src/components/overlays/tooltip.stories.tsx +0 -29
- package/src/components/overlays/tooltip.tsx +0 -41
- package/src/components/primitives/avatar-placeholder.svg +0 -13
- package/src/components/primitives/avatar.stories.tsx +0 -72
- package/src/components/primitives/avatar.tsx +0 -136
- package/src/components/primitives/badge.stories.tsx +0 -43
- package/src/components/primitives/badge.tsx +0 -43
- package/src/components/primitives/button.stories.tsx +0 -113
- package/src/components/primitives/button.tsx +0 -131
- package/src/components/primitives/card.stories.tsx +0 -59
- package/src/components/primitives/card.tsx +0 -66
- package/src/components/primitives/segmented-control.stories.tsx +0 -54
- package/src/components/primitives/segmented-control.tsx +0 -73
- package/src/components/primitives/separator.stories.tsx +0 -34
- package/src/components/primitives/separator.tsx +0 -27
- package/src/constants/chart-colors.ts +0 -39
- package/src/env.d.ts +0 -9
- package/src/hooks/use-api-client.ts +0 -122
- package/src/hooks/use-debounced-value.ts +0 -12
- package/src/hooks/use-derived-filter-state.ts +0 -70
- package/src/hooks/use-filter-state.ts +0 -66
- package/src/hooks/use-media-query.ts +0 -69
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-sort.ts +0 -20
- package/src/lib/auth.ts +0 -5
- package/src/lib/clipboard.ts +0 -8
- package/src/lib/utils.ts +0 -6
- package/src/native/components.tsx +0 -198
- package/src/native/theme.tsx +0 -69
- package/src/storybook/controls.ts +0 -117
- package/src/storybook/options.ts +0 -52
- package/src/styles/build.ts +0 -1
- package/src/styles/index.css +0 -423
- package/src/styles/nokia.css +0 -36
- package/src/styles/package.css +0 -3
- package/src/styles/tokens/chart-colors.stories.tsx +0 -189
- package/src/styles/tokens/color-systems.stories.tsx +0 -190
- package/src/styles/tokens/css-vars.ts +0 -15
- package/src/styles/tokens/generated/dark-class.css +0 -39
- package/src/styles/tokens/generated/dark.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/dark.css +0 -39
- package/src/styles/tokens/generated/foundations.css +0 -149
- package/src/styles/tokens/generated/foundations.generated.ts +0 -454
- package/src/styles/tokens/generated/light.colors.generated.ts +0 -39
- package/src/styles/tokens/generated/light.css +0 -39
- package/src/styles/tokens/index.ts +0 -70
- package/src/styles/tokens/layout.stories.tsx +0 -50
- package/src/styles/tokens/scripts/check-foundations.mjs +0 -126
- package/src/styles/tokens/scripts/check-source.mjs +0 -53
- package/src/styles/tokens/source/dark.tokens.json +0 -138
- package/src/styles/tokens/source/foundations.tokens.json +0 -344
- package/src/styles/tokens/source/light.tokens.json +0 -138
- package/src/styles/tokens/style-dictionary.dark-class.json +0 -16
- package/src/styles/tokens/style-dictionary.dark-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.dark.json +0 -21
- package/src/styles/tokens/style-dictionary.foundations.json +0 -21
- package/src/styles/tokens/style-dictionary.light-storybook.json +0 -16
- package/src/styles/tokens/style-dictionary.light.json +0 -21
- package/src/styles/tokens/typography.stories.tsx +0 -157
- package/src/translations/en.ts +0 -34
- package/src/translations/index.ts +0 -32
- package/src/types/upload.ts +0 -42
- /package/{src/components/filters/index.ts → dist/components/filters/index.d.ts} +0 -0
- /package/{src/components/layout/index.ts → dist/components/layout/index.d.ts} +0 -0
- /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
- /package/{src/lib/index.ts → dist/lib/index.d.ts} +0 -0
- /package/{src/native/index.ts → dist/native/index.d.ts} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AppNavigation as e, Navigation as t } from "./app-navigation.js";
|
|
2
|
+
import { PaginationControls as n } from "./pagination-controls.js";
|
|
3
|
+
import { Tabs as r, TabsContent as i, TabsList as a, TabsTrigger as o } from "./tabs.js";
|
|
4
|
+
export { e as AppNavigation, t as Navigation, n as PaginationControls, r as Tabs, i as TabsContent, a as TabsList, o as TabsTrigger };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface PaginationControlsProps {
|
|
2
|
+
currentPage: number;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
onPageChange: (page: number) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Zero-indexed prev/next pagination control. */
|
|
7
|
+
export declare function PaginationControls({ currentPage, totalPages, onPageChange, }: PaginationControlsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useUiText as e } from "../../translations/ui-provider.js";
|
|
3
|
+
import { Button as t } from "../primitives/button.js";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronLeft as i, ChevronRight as a } from "lucide-react";
|
|
6
|
+
//#region src/components/navigation/pagination-controls.tsx
|
|
7
|
+
function o({ currentPage: o, totalPages: s, onPageChange: c }) {
|
|
8
|
+
let l = e("pagination.previous", "Previous page"), u = e("pagination.next", "Next page");
|
|
9
|
+
return /* @__PURE__ */ r("div", {
|
|
10
|
+
className: "border-border bg-background text-foreground inline-flex w-fit shrink-0 items-center self-start overflow-hidden rounded-full border text-sm",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ n(t, {
|
|
13
|
+
type: "button",
|
|
14
|
+
variant: "outline",
|
|
15
|
+
size: "icon",
|
|
16
|
+
className: "rounded-none border-0 border-r bg-transparent shadow-none",
|
|
17
|
+
onClick: () => c(o - 1),
|
|
18
|
+
disabled: o === 0,
|
|
19
|
+
"aria-label": l,
|
|
20
|
+
children: /* @__PURE__ */ n(i, {
|
|
21
|
+
className: "size-4",
|
|
22
|
+
"aria-hidden": !0
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ r("span", {
|
|
26
|
+
className: "min-w-20 px-3 text-center text-xs tabular-nums",
|
|
27
|
+
children: [
|
|
28
|
+
o + 1,
|
|
29
|
+
" of ",
|
|
30
|
+
s
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ n(t, {
|
|
34
|
+
type: "button",
|
|
35
|
+
variant: "outline",
|
|
36
|
+
size: "icon",
|
|
37
|
+
className: "rounded-none border-0 border-l bg-transparent shadow-none",
|
|
38
|
+
onClick: () => c(o + 1),
|
|
39
|
+
disabled: o >= s - 1,
|
|
40
|
+
"aria-label": u,
|
|
41
|
+
children: /* @__PURE__ */ n(a, {
|
|
42
|
+
className: "size-4",
|
|
43
|
+
"aria-hidden": !0
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { o as PaginationControls };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Tabs({ ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
|
5
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>): React.JSX.Element;
|
|
6
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>): React.JSX.Element;
|
|
7
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
import { Tabs as n } from "@base-ui/react/tabs";
|
|
6
|
+
//#region src/components/navigation/tabs.tsx
|
|
7
|
+
function r({ ...e }) {
|
|
8
|
+
return /* @__PURE__ */ t(n.Root, {
|
|
9
|
+
"data-slot": "tabs",
|
|
10
|
+
...e
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function i({ className: r, ...i }) {
|
|
14
|
+
return /* @__PURE__ */ t(n.List, {
|
|
15
|
+
"data-slot": "tabs-list",
|
|
16
|
+
className: e("bg-muted flex h-auto w-full items-center gap-1 rounded-full border p-1", r),
|
|
17
|
+
...i
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function a({ className: r, ...i }) {
|
|
21
|
+
return /* @__PURE__ */ t(n.Tab, {
|
|
22
|
+
"data-slot": "tabs-trigger",
|
|
23
|
+
className: e("text-foreground flex flex-1 items-center justify-center gap-2 rounded-full px-3 py-2 text-sm font-medium whitespace-nowrap transition-all", "disabled:pointer-events-none disabled:opacity-50", "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none", "data-active:ring-1 data-active:ring-inset data-active:bg-background data-active:text-foreground data-active:ring-border", r),
|
|
24
|
+
...i
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function o({ className: r, ...i }) {
|
|
28
|
+
return /* @__PURE__ */ t(n.Panel, {
|
|
29
|
+
"data-slot": "tabs-content",
|
|
30
|
+
className: e("focus-visible:bg-muted/10 mt-2 rounded-md focus-visible:border focus-visible:outline-none", r),
|
|
31
|
+
...i
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { r as Tabs, o as TabsContent, i as TabsList, a as TabsTrigger };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type BottomSheetProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Controlled expanded state. */
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
/** Uncontrolled initial state. @default false */
|
|
7
|
+
defaultExpanded?: boolean;
|
|
8
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
9
|
+
/** Visible stub height when collapsed. @default 48 */
|
|
10
|
+
peek?: number;
|
|
11
|
+
/** Accessible name for the panel region. @default "Details panel" */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Positioning/sizing (app-owned). */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Applied to the scrollable content wrapper alongside its defaults. */
|
|
16
|
+
scrollClassName?: string;
|
|
17
|
+
/** Applied to the drag handle button alongside its defaults. */
|
|
18
|
+
handleClassName?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function BottomSheet({ children, expanded: controlledExpanded, defaultExpanded, onExpandedChange, peek, label: providedLabel, className, scrollClassName, handleClassName, }: BottomSheetProps): React.JSX.Element;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMediaQuery as e } from "../../hooks/use-media-query.js";
|
|
3
|
+
import { cn as t } from "../../lib/utils.js";
|
|
4
|
+
import { useUiText as n } from "../../translations/ui-provider.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/overlays/bottom-sheet.tsx
|
|
8
|
+
var o = .4, s = .25;
|
|
9
|
+
function c({ children: c, expanded: l, defaultExpanded: u = !1, onExpandedChange: d, peek: f = 48, label: p, className: m, scrollClassName: h, handleClassName: g }) {
|
|
10
|
+
let _ = n("bottomSheet.label", "Details panel"), v = p ?? _, y = r.useRef(null), b = r.useRef(null), [x, S] = r.useState(0), [C, w] = r.useState(0), [T, E] = r.useState(u), D = r.useRef(!1), O = r.useRef(!1), k = r.useRef(null), A = e("(prefers-reduced-motion: reduce)"), j = r.useId(), M = l ?? T, N = r.useCallback(() => y.current?.offsetHeight ?? 400, []), P = r.useCallback(() => Math.max(0, N() - f), [N, f]), F = r.useCallback((e) => {
|
|
11
|
+
d?.(e), l === void 0 && E(e);
|
|
12
|
+
}, [l, d]), I = r.useCallback((e) => {
|
|
13
|
+
S(e), w(0);
|
|
14
|
+
}, []);
|
|
15
|
+
r.useEffect(() => {
|
|
16
|
+
I(M ? 0 : P());
|
|
17
|
+
}, [
|
|
18
|
+
M,
|
|
19
|
+
P,
|
|
20
|
+
I
|
|
21
|
+
]), r.useEffect(() => {
|
|
22
|
+
b.current && (b.current.inert = !M);
|
|
23
|
+
}, [M]), r.useEffect(() => {
|
|
24
|
+
let e = y.current;
|
|
25
|
+
if (!e || M || typeof ResizeObserver > "u") return;
|
|
26
|
+
let t = new ResizeObserver(() => I(P()));
|
|
27
|
+
return t.observe(e), () => t.disconnect();
|
|
28
|
+
}, [
|
|
29
|
+
P,
|
|
30
|
+
M,
|
|
31
|
+
I
|
|
32
|
+
]);
|
|
33
|
+
let L = r.useCallback(() => F(!0), [F]), R = r.useCallback(() => F(!1), [F]), z = r.useCallback((e) => {
|
|
34
|
+
D.current = !0, O.current = !1, k.current = {
|
|
35
|
+
startY: e.clientY,
|
|
36
|
+
startTime: Date.now()
|
|
37
|
+
}, e.currentTarget.setPointerCapture(e.pointerId);
|
|
38
|
+
}, []), B = r.useCallback((e) => {
|
|
39
|
+
if (!D.current || !k.current) return;
|
|
40
|
+
let t = e.clientY - k.current.startY;
|
|
41
|
+
Math.abs(t) > 4 && (O.current = !0), w(Math.max(-x, t));
|
|
42
|
+
}, [x]), V = r.useCallback((e) => {
|
|
43
|
+
if (!D.current || !k.current) return;
|
|
44
|
+
D.current = !1;
|
|
45
|
+
let t = e.clientY - k.current.startY, n = Date.now() - k.current.startTime, r = n > 0 ? t / n : 0;
|
|
46
|
+
if (k.current = null, w(0), O.current) {
|
|
47
|
+
let e = N(), n = Math.max(0, x + t), i = e > 0 ? n / e : 0;
|
|
48
|
+
r > o ? R() : r < -.4 ? L() : i > s ? R() : L();
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
x,
|
|
52
|
+
N,
|
|
53
|
+
L,
|
|
54
|
+
R
|
|
55
|
+
]), H = r.useCallback(() => {
|
|
56
|
+
O.current || (M ? R() : L());
|
|
57
|
+
}, [
|
|
58
|
+
M,
|
|
59
|
+
L,
|
|
60
|
+
R
|
|
61
|
+
]), U = Math.max(0, x + C);
|
|
62
|
+
return /* @__PURE__ */ a("section", {
|
|
63
|
+
ref: y,
|
|
64
|
+
"data-slot": "bottom-sheet",
|
|
65
|
+
"aria-label": v,
|
|
66
|
+
className: t("flex flex-col overflow-hidden", m),
|
|
67
|
+
style: {
|
|
68
|
+
transform: M ? `translateY(${U}px)` : `translateY(calc(100% - ${f}px))`,
|
|
69
|
+
transition: D.current || A ? "none" : "transform 0.35s cubic-bezier(0.32, 0.72, 0, 1)"
|
|
70
|
+
},
|
|
71
|
+
children: [/* @__PURE__ */ i("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
"data-slot": "button bottom-sheet-handle",
|
|
74
|
+
"aria-expanded": M,
|
|
75
|
+
"aria-controls": j,
|
|
76
|
+
"aria-label": M ? "Collapse panel" : "Expand panel",
|
|
77
|
+
onPointerDown: z,
|
|
78
|
+
onPointerMove: B,
|
|
79
|
+
onPointerUp: V,
|
|
80
|
+
onPointerCancel: V,
|
|
81
|
+
onClick: H,
|
|
82
|
+
onKeyDown: (e) => {
|
|
83
|
+
e.key === "Escape" && R();
|
|
84
|
+
},
|
|
85
|
+
className: t("ui-bottom-sheet-handle flex w-full shrink-0 cursor-grab justify-center py-3.5 active:cursor-grabbing", g),
|
|
86
|
+
children: /* @__PURE__ */ i("span", {
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
className: "bg-border h-1 w-9 rounded-full"
|
|
89
|
+
})
|
|
90
|
+
}), /* @__PURE__ */ i("div", {
|
|
91
|
+
ref: b,
|
|
92
|
+
"data-slot": "bottom-sheet-scroll",
|
|
93
|
+
id: j,
|
|
94
|
+
"aria-hidden": !M || void 0,
|
|
95
|
+
className: t("flex-1 overflow-y-auto", h),
|
|
96
|
+
children: c
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { c as BottomSheet };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Combobox as CommandPrimitive } from "@base-ui/react/combobox";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Dialog } from "./dialog";
|
|
4
|
+
declare function Command({ className, children, ...props }: Omit<React.ComponentProps<typeof CommandPrimitive.Root<string>>, "className"> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function CommandDialog({ title, description, children, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
showCloseButton?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
type CommandInputProps = React.ComponentProps<typeof CommandPrimitive.Input> & {
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
declare function CommandInput({ className, onValueChange, onChange, "aria-label": ariaLabel, ...props }: CommandInputProps): React.JSX.Element;
|
|
17
|
+
declare function CommandList({ children, className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
18
|
+
declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
19
|
+
declare function CommandGroup({ className, heading, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Group> & {
|
|
20
|
+
heading?: React.ReactNode;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
type CommandItemProps = React.ComponentProps<typeof CommandPrimitive.Item> & {
|
|
23
|
+
onSelect?: () => void;
|
|
24
|
+
};
|
|
25
|
+
declare function CommandItem({ className, onSelect, onClick, ...props }: CommandItemProps): React.JSX.Element;
|
|
26
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
27
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
28
|
+
declare function CommandListLoading({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
29
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandListLoading, CommandSeparator, CommandShortcut, };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Dialog as t, DialogContent as n, DialogDescription as r, DialogHeader as i, DialogTitle as a } from "./dialog.js";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { SearchIcon as l } from "lucide-react";
|
|
7
|
+
import { Combobox as u } from "@base-ui/react/combobox";
|
|
8
|
+
//#region src/components/overlays/command.tsx
|
|
9
|
+
function d({ className: t, children: n, ...r }) {
|
|
10
|
+
return /* @__PURE__ */ s("div", {
|
|
11
|
+
"data-slot": "command",
|
|
12
|
+
className: e("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", t),
|
|
13
|
+
children: /* @__PURE__ */ s(u.Root, {
|
|
14
|
+
...r,
|
|
15
|
+
children: n
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function f({ title: e = "Command Palette", description: o = "Search for a command to run...", children: l, showCloseButton: u = !0, ...f }) {
|
|
20
|
+
return /* @__PURE__ */ c(t, {
|
|
21
|
+
...f,
|
|
22
|
+
children: [/* @__PURE__ */ c(i, {
|
|
23
|
+
className: "sr-only",
|
|
24
|
+
children: [/* @__PURE__ */ s(a, { children: e }), /* @__PURE__ */ s(r, { children: o })]
|
|
25
|
+
}), /* @__PURE__ */ s(n, {
|
|
26
|
+
className: "overflow-hidden p-0",
|
|
27
|
+
showCloseButton: u,
|
|
28
|
+
children: /* @__PURE__ */ s(d, { children: l })
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function p({ className: t, onValueChange: n, onChange: r, "aria-label": i = "Search commands", ...a }) {
|
|
33
|
+
return /* @__PURE__ */ c("div", {
|
|
34
|
+
"data-slot": "command-input-wrapper",
|
|
35
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
36
|
+
children: [/* @__PURE__ */ s(l, { className: "size-4 shrink-0 opacity-50" }), /* @__PURE__ */ s(u.Input, {
|
|
37
|
+
"data-slot": "command-input",
|
|
38
|
+
"aria-label": i,
|
|
39
|
+
className: e("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden", "disabled:cursor-not-allowed disabled:opacity-50", t),
|
|
40
|
+
onChange: (e) => {
|
|
41
|
+
r?.(e), n?.(e.currentTarget.value);
|
|
42
|
+
},
|
|
43
|
+
...a
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function m({ children: t, className: n, ...r }) {
|
|
48
|
+
if (typeof t == "function") return /* @__PURE__ */ s(u.List, {
|
|
49
|
+
"data-slot": "command-list",
|
|
50
|
+
"aria-label": "Command results",
|
|
51
|
+
tabIndex: 0,
|
|
52
|
+
className: e("max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto", n),
|
|
53
|
+
...r,
|
|
54
|
+
children: t
|
|
55
|
+
});
|
|
56
|
+
let i = [], a = [];
|
|
57
|
+
return o.Children.forEach(t, (e) => {
|
|
58
|
+
o.isValidElement(e) && e.type === h ? a.push(e) : i.push(e);
|
|
59
|
+
}), /* @__PURE__ */ c("div", {
|
|
60
|
+
"data-slot": "command-list-container",
|
|
61
|
+
className: "relative",
|
|
62
|
+
children: [/* @__PURE__ */ s(u.List, {
|
|
63
|
+
"data-slot": "command-list",
|
|
64
|
+
"aria-label": "Command results",
|
|
65
|
+
tabIndex: 0,
|
|
66
|
+
className: e("max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto", n),
|
|
67
|
+
...r,
|
|
68
|
+
children: i
|
|
69
|
+
}), a]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function h({ className: t, ...n }) {
|
|
73
|
+
return /* @__PURE__ */ s(u.Empty, {
|
|
74
|
+
"data-slot": "command-empty",
|
|
75
|
+
className: e("py-6 text-center text-sm", t),
|
|
76
|
+
...n
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function g({ className: t, heading: n, children: r, ...i }) {
|
|
80
|
+
return /* @__PURE__ */ c(u.Group, {
|
|
81
|
+
"data-slot": "command-group",
|
|
82
|
+
className: e("text-foreground overflow-hidden p-1", t),
|
|
83
|
+
...i,
|
|
84
|
+
children: [n ? /* @__PURE__ */ s(u.GroupLabel, {
|
|
85
|
+
className: "text-muted-foreground px-2 py-1.5 text-xs font-medium",
|
|
86
|
+
children: n
|
|
87
|
+
}) : null, r]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function _({ className: t, onSelect: n, onClick: r, ...i }) {
|
|
91
|
+
return /* @__PURE__ */ s(u.Item, {
|
|
92
|
+
"data-slot": "command-item",
|
|
93
|
+
className: e("data-highlighted:bg-muted data-highlighted:text-muted-foreground relative flex cursor-pointer items-center gap-3 rounded-md px-3 py-2.5 text-sm outline-hidden select-none", "data-disabled:pointer-events-none data-disabled:opacity-50", t),
|
|
94
|
+
onClick: (e) => {
|
|
95
|
+
r?.(e), n?.();
|
|
96
|
+
},
|
|
97
|
+
...i
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function v({ className: t, ...n }) {
|
|
101
|
+
return /* @__PURE__ */ s("div", {
|
|
102
|
+
"data-slot": "command-separator",
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
className: e("bg-border -mx-1 h-px", t),
|
|
105
|
+
...n
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function y({ className: t, ...n }) {
|
|
109
|
+
return /* @__PURE__ */ s("span", {
|
|
110
|
+
"data-slot": "command-shortcut",
|
|
111
|
+
className: e("text-muted-foreground ml-auto text-xs tracking-widest", t),
|
|
112
|
+
...n
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function b({ className: t, ...n }) {
|
|
116
|
+
return /* @__PURE__ */ s("div", {
|
|
117
|
+
"data-slot": "command-list-loading",
|
|
118
|
+
className: e("py-6 text-center text-sm", t),
|
|
119
|
+
...n
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { d as Command, f as CommandDialog, h as CommandEmpty, g as CommandGroup, p as CommandInput, _ as CommandItem, m as CommandList, b as CommandListLoading, v as CommandSeparator, y as CommandShortcut };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* `alert: true` swaps the root primitive for Base UI's `AlertDialog.Root`:
|
|
5
|
+
* `role="alertdialog"`, forced `modal`, and no dismiss via outside click or
|
|
6
|
+
* Escape — for confirmations that need explicit acknowledgment. Every other
|
|
7
|
+
* part (`Trigger`, `Popup`, `Close`, `Title`, `Description`, ...) is a plain
|
|
8
|
+
* re-export shared by both Base UI primitives, so only the root needs to
|
|
9
|
+
* branch; `DialogContent` reads `DialogAlertContext` to default its close
|
|
10
|
+
* button off in alert mode.
|
|
11
|
+
*/
|
|
12
|
+
declare function Dialog({ alert, modal, disablePointerDismissal, ...props }: Omit<React.ComponentProps<typeof BaseDialog.Root>, "handle"> & {
|
|
13
|
+
alert?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DialogTrigger({ asChild, children, ...props }: React.ComponentProps<typeof BaseDialog.Trigger> & {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof BaseDialog.Portal>): React.JSX.Element;
|
|
19
|
+
declare function DialogClose({ asChild, children, ...props }: React.ComponentProps<typeof BaseDialog.Close> & {
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof BaseDialog.Backdrop>): React.JSX.Element;
|
|
23
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof BaseDialog.Popup> & {
|
|
24
|
+
showCloseButton?: boolean;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
27
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
28
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof BaseDialog.Title>): React.JSX.Element;
|
|
29
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof BaseDialog.Description>): React.JSX.Element;
|
|
30
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useUiText as t } from "../../translations/ui-provider.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { XIcon as a } from "lucide-react";
|
|
7
|
+
import { AlertDialog as o } from "@base-ui/react/alert-dialog";
|
|
8
|
+
import { Dialog as s } from "@base-ui/react/dialog";
|
|
9
|
+
//#region src/components/overlays/dialog.tsx
|
|
10
|
+
var c = n.createContext(!1);
|
|
11
|
+
function l({ alert: e = !1, modal: t, disablePointerDismissal: n, ...i }) {
|
|
12
|
+
return /* @__PURE__ */ r(c, {
|
|
13
|
+
value: e,
|
|
14
|
+
children: e ? /* @__PURE__ */ r(o.Root, { ...i }) : /* @__PURE__ */ r(s.Root, {
|
|
15
|
+
modal: t,
|
|
16
|
+
disablePointerDismissal: n,
|
|
17
|
+
...i
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function u({ asChild: e, children: t, ...i }) {
|
|
22
|
+
return e && n.isValidElement(t) ? /* @__PURE__ */ r(s.Trigger, {
|
|
23
|
+
"data-slot": "dialog-trigger",
|
|
24
|
+
render: (e) => n.cloneElement(t, e),
|
|
25
|
+
...i
|
|
26
|
+
}) : /* @__PURE__ */ r(s.Trigger, {
|
|
27
|
+
"data-slot": "dialog-trigger",
|
|
28
|
+
...i,
|
|
29
|
+
children: t
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function d({ ...e }) {
|
|
33
|
+
return /* @__PURE__ */ r(s.Portal, {
|
|
34
|
+
"data-slot": "dialog-portal",
|
|
35
|
+
...e
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function f({ asChild: e, children: t, ...i }) {
|
|
39
|
+
return e && n.isValidElement(t) ? /* @__PURE__ */ r(s.Close, {
|
|
40
|
+
"data-slot": "dialog-close",
|
|
41
|
+
render: (e) => n.cloneElement(t, e),
|
|
42
|
+
...i
|
|
43
|
+
}) : /* @__PURE__ */ r(s.Close, {
|
|
44
|
+
"data-slot": "dialog-close",
|
|
45
|
+
...i,
|
|
46
|
+
children: t
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function p({ className: t, ...n }) {
|
|
50
|
+
return /* @__PURE__ */ r(s.Backdrop, {
|
|
51
|
+
"data-slot": "dialog-overlay",
|
|
52
|
+
className: e("fixed inset-0 z-50 bg-black/80", t),
|
|
53
|
+
...n
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var m = "bg-popover text-popover-foreground fixed inset-x-0 bottom-0 z-50 grid max-h-[90dvh] w-full gap-6 overflow-y-auto rounded-t-xl border p-4 outline-none sm:top-[50%] sm:bottom-auto sm:left-[50%] sm:w-[calc(100%-2rem)] sm:max-w-[30rem] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:p-6";
|
|
57
|
+
function h({ className: o, children: l, showCloseButton: u, ...d }) {
|
|
58
|
+
let f = n.useContext(c), h = t("dialog.close", "Close"), g = u ?? !f;
|
|
59
|
+
return /* @__PURE__ */ i(s.Portal, {
|
|
60
|
+
"data-slot": "dialog-portal",
|
|
61
|
+
children: [/* @__PURE__ */ r(p, {}), /* @__PURE__ */ i(s.Popup, {
|
|
62
|
+
"data-slot": "dialog-content",
|
|
63
|
+
className: e(m, o),
|
|
64
|
+
...d,
|
|
65
|
+
children: [l, g && /* @__PURE__ */ i(s.Close, {
|
|
66
|
+
"data-slot": "dialog-close",
|
|
67
|
+
className: "text-muted-foreground hover:bg-muted hover:text-muted-foreground focus-visible:outline-ring absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-md border border-transparent opacity-100 transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none sm:top-4 sm:right-4 [&_svg]:pointer-events-none [&_svg]:size-4.5 [&_svg]:shrink-0",
|
|
68
|
+
children: [/* @__PURE__ */ r(a, {}), /* @__PURE__ */ r("span", {
|
|
69
|
+
className: "sr-only",
|
|
70
|
+
children: h
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function g({ className: t, ...n }) {
|
|
77
|
+
return /* @__PURE__ */ r("div", {
|
|
78
|
+
"data-slot": "dialog-header",
|
|
79
|
+
className: e("flex flex-col gap-2 text-left", t),
|
|
80
|
+
...n
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function _({ className: t, ...n }) {
|
|
84
|
+
return /* @__PURE__ */ r("div", {
|
|
85
|
+
"data-slot": "dialog-footer",
|
|
86
|
+
className: e("flex flex-col-reverse gap-3 sm:flex-row sm:justify-end", t),
|
|
87
|
+
...n
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function v({ className: t, ...n }) {
|
|
91
|
+
return /* @__PURE__ */ r(s.Title, {
|
|
92
|
+
"data-slot": "dialog-title",
|
|
93
|
+
className: e("text-lg leading-none font-semibold tracking-tight", t),
|
|
94
|
+
...n
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function y({ className: t, ...n }) {
|
|
98
|
+
return /* @__PURE__ */ r(s.Description, {
|
|
99
|
+
"data-slot": "dialog-description",
|
|
100
|
+
className: e("text-muted-foreground max-w-prose text-sm", t),
|
|
101
|
+
...n
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { l as Dialog, f as DialogClose, h as DialogContent, y as DialogDescription, _ as DialogFooter, g as DialogHeader, p as DialogOverlay, d as DialogPortal, v as DialogTitle, u as DialogTrigger };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Menu as DropdownMenuPrimitive } from "@base-ui/react/menu";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal(props: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ asChild, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup> & {
|
|
9
|
+
sideOffset?: number;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.GroupLabel> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
variant?: "default" | "destructive";
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuRadioGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSub(props: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup>): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|