@kala-ui/react 0.0.1-beta.7 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion-skeleton.js +1 -1
- package/dist/components/accordion/accordion.js +2 -1
- package/dist/components/action-icon/action-icon.d.ts +12 -0
- package/dist/components/action-icon/action-icon.js +35 -0
- package/dist/components/action-icon/action-icon.stories.d.ts +9 -0
- package/dist/components/action-icon/action-icon.stories.js +42 -0
- package/dist/components/action-icon/index.d.ts +1 -0
- package/dist/components/action-icon/index.js +1 -0
- package/dist/components/alert/alert-skeleton.js +4 -3
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/alert/alert.js +8 -6
- package/dist/components/alert/alert.stories.js +13 -9
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +8 -5
- package/dist/components/app-shell/app-shell.d.ts +58 -0
- package/dist/components/app-shell/app-shell.js +111 -0
- package/dist/components/app-shell/app-shell.stories.d.ts +8 -0
- package/dist/components/app-shell/app-shell.stories.js +35 -0
- package/dist/components/app-shell/index.d.ts +1 -0
- package/dist/components/app-shell/index.js +1 -0
- package/dist/components/avatar/avatar.d.ts +2 -2
- package/dist/components/avatar/avatar.stories.js +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge.stories.js +1 -1
- package/dist/components/banner/banner-skeleton.js +1 -1
- package/dist/components/banner/banner.d.ts +1 -1
- package/dist/components/banner/banner.stories.js +1 -1
- package/dist/components/box/box.d.ts +8 -0
- package/dist/components/box/box.js +10 -0
- package/dist/components/box/box.stories.d.ts +8 -0
- package/dist/components/box/box.stories.js +32 -0
- package/dist/components/box/index.d.ts +1 -0
- package/dist/components/box/index.js +1 -0
- package/dist/components/breadcrumbs/breadcrumbs-skeleton.js +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/dist/components/burger/burger.d.ts +8 -0
- package/dist/components/burger/burger.js +21 -0
- package/dist/components/burger/burger.stories.d.ts +8 -0
- package/dist/components/burger/burger.stories.js +31 -0
- package/dist/components/burger/index.d.ts +1 -0
- package/dist/components/burger/index.js +1 -0
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.stories.js +10 -7
- package/dist/components/button-group/button-group.stories.js +1 -1
- package/dist/components/calendar/calendar-skeleton.js +1 -1
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/calendar.types.d.ts +3 -3
- package/dist/components/card/card-skeleton.js +2 -2
- package/dist/components/card/card.js +17 -14
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/center/center.d.ts +7 -0
- package/dist/components/center/center.js +10 -0
- package/dist/components/center/center.stories.d.ts +7 -0
- package/dist/components/center/center.stories.js +25 -0
- package/dist/components/center/index.d.ts +1 -0
- package/dist/components/center/index.js +1 -0
- package/dist/components/charts/area-chart.js +1 -1
- package/dist/components/charts/bar-chart.js +1 -1
- package/dist/components/charts/donut-chart.js +1 -1
- package/dist/components/charts/index.d.ts +2 -2
- package/dist/components/charts/index.js +2 -2
- package/dist/components/charts/line-chart.js +1 -1
- package/dist/components/charts/radial-bar-chart.js +1 -1
- package/dist/components/charts/theme-utils.d.ts +1 -1
- package/dist/components/charts/use-theme-aware-chart.d.ts +1 -1
- package/dist/components/charts/use-theme-aware-chart.js +2 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/checkbox.stories.js +12 -8
- package/dist/components/close-button/close-button.d.ts +7 -0
- package/dist/components/close-button/close-button.js +9 -0
- package/dist/components/close-button/close-button.stories.d.ts +7 -0
- package/dist/components/close-button/close-button.stories.js +18 -0
- package/dist/components/close-button/index.d.ts +1 -0
- package/dist/components/close-button/index.js +1 -0
- package/dist/components/code/code.d.ts +8 -0
- package/dist/components/code/code.js +14 -0
- package/dist/components/code/code.stories.d.ts +8 -0
- package/dist/components/code/code.stories.js +31 -0
- package/dist/components/code/index.d.ts +1 -0
- package/dist/components/code/index.js +1 -0
- package/dist/components/collapse/collapse.d.ts +17 -0
- package/dist/components/collapse/collapse.js +34 -0
- package/dist/components/collapse/index.d.ts +1 -0
- package/dist/components/collapse/index.js +1 -0
- package/dist/components/color-input/color-input.d.ts +28 -0
- package/dist/components/color-input/color-input.js +35 -0
- package/dist/components/color-input/color-input.stories.d.ts +10 -0
- package/dist/components/color-input/color-input.stories.js +41 -0
- package/dist/components/color-input/index.d.ts +1 -0
- package/dist/components/color-input/index.js +1 -0
- package/dist/components/combobox/combobox-skeleton.js +1 -1
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/combobox/combobox.js +17 -8
- package/dist/components/combobox/combobox.stories.js +1 -1
- package/dist/components/command/command.d.ts +2 -2
- package/dist/components/command/command.stories.js +14 -19
- package/dist/components/container/container.d.ts +1 -1
- package/dist/components/container/index.d.ts +1 -1
- package/dist/components/container/index.js +1 -1
- package/dist/components/data-table/column-header-filter.js +11 -6
- package/dist/components/data-table/data-table-skeleton.js +5 -15
- package/dist/components/data-table/data-table.js +18 -15
- package/dist/components/data-table/data-table.stories.js +3 -5
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +3 -3
- package/dist/components/date-picker/date-picker.types.d.ts +1 -1
- package/dist/components/dialog/dialog-skeleton.js +1 -1
- package/dist/components/dialog/dialog.js +6 -4
- package/dist/components/dialog/dialog.stories.js +2 -2
- package/dist/components/dnd/dnd.d.ts +4 -5
- package/dist/components/dnd/dnd.js +5 -5
- package/dist/components/dnd/dnd.stories.js +48 -40
- package/dist/components/drawer/drawer.stories.js +2 -2
- package/dist/components/empty-state/empty-state-skeleton.js +2 -3
- package/dist/components/empty-state/empty-state.d.ts +1 -1
- package/dist/components/field/field-skeleton.js +1 -1
- package/dist/components/field/field.stories.js +1 -1
- package/dist/components/file-upload/file-upload-skeleton.js +1 -1
- package/dist/components/flex/flex.d.ts +7 -5
- package/dist/components/flex/flex.js +2 -2
- package/dist/components/flex/index.d.ts +1 -1
- package/dist/components/flex/index.js +1 -1
- package/dist/components/grid/grid.d.ts +24 -0
- package/dist/components/grid/grid.js +136 -0
- package/dist/components/grid/grid.stories.d.ts +8 -0
- package/dist/components/grid/grid.stories.js +31 -0
- package/dist/components/grid/index.d.ts +1 -0
- package/dist/components/grid/index.js +1 -0
- package/dist/components/group/group.d.ts +2 -2
- package/dist/components/group/group.js +1 -1
- package/dist/components/group/index.d.ts +1 -1
- package/dist/components/group/index.js +1 -1
- package/dist/components/header/header-skeleton.js +1 -1
- package/dist/components/header/header.d.ts +3 -3
- package/dist/components/header/header.js +17 -31
- package/dist/components/header/index.d.ts +1 -1
- package/dist/components/heading/heading.d.ts +4 -2
- package/dist/components/heading/heading.js +3 -7
- package/dist/components/heading/index.d.ts +1 -1
- package/dist/components/heading/index.js +1 -1
- package/dist/components/indicator/index.d.ts +1 -0
- package/dist/components/indicator/index.js +1 -0
- package/dist/components/indicator/indicator.d.ts +30 -0
- package/dist/components/indicator/indicator.js +89 -0
- package/dist/components/indicator/indicator.stories.d.ts +10 -0
- package/dist/components/indicator/indicator.stories.js +75 -0
- package/dist/components/input/input.js +1 -1
- package/dist/components/input/input.stories.js +1 -1
- package/dist/components/input-group/input-group.stories.js +1 -1
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/kbd/kbd.d.ts +6 -0
- package/dist/components/kbd/kbd.js +13 -0
- package/dist/components/kbd/kbd.stories.d.ts +9 -0
- package/dist/components/kbd/kbd.stories.js +28 -0
- package/dist/components/label/label.stories.js +1 -1
- package/dist/components/list/list-skeleton.js +2 -2
- package/dist/components/list/list.js +1 -1
- package/dist/components/list/list.stories.js +1 -1
- package/dist/components/list/list.types.d.ts +2 -2
- package/dist/components/loading-overlay/index.d.ts +1 -0
- package/dist/components/loading-overlay/index.js +1 -0
- package/dist/components/loading-overlay/loading-overlay.d.ts +19 -0
- package/dist/components/loading-overlay/loading-overlay.js +19 -0
- package/dist/components/loading-overlay/loading-overlay.stories.d.ts +8 -0
- package/dist/components/loading-overlay/loading-overlay.stories.js +46 -0
- package/dist/components/metric-card/metric-card-skeleton.js +2 -2
- package/dist/components/metric-card/metric-card.js +1 -1
- package/dist/components/multi-select/multi-select-skeleton.js +1 -1
- package/dist/components/multi-select/multi-select.stories.js +1 -1
- package/dist/components/nav-link/index.d.ts +1 -0
- package/dist/components/nav-link/index.js +1 -0
- package/dist/components/nav-link/nav-link.d.ts +26 -0
- package/dist/components/nav-link/nav-link.js +26 -0
- package/dist/components/nav-link/nav-link.stories.d.ts +9 -0
- package/dist/components/nav-link/nav-link.stories.js +37 -0
- package/dist/components/navigation/navigation-skeleton.js +1 -1
- package/dist/components/number-input/index.d.ts +1 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/number-input/number-input.d.ts +40 -0
- package/dist/components/number-input/number-input.js +69 -0
- package/dist/components/number-input/number-input.stories.d.ts +11 -0
- package/dist/components/number-input/number-input.stories.js +54 -0
- package/dist/components/overlay/index.d.ts +1 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/overlay/overlay.d.ts +22 -0
- package/dist/components/overlay/overlay.js +45 -0
- package/dist/components/overlay/overlay.stories.d.ts +9 -0
- package/dist/components/overlay/overlay.stories.js +47 -0
- package/dist/components/page-transition/page-transition.stories.js +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination-skeleton.js +1 -1
- package/dist/components/pagination/pagination.d.ts +44 -28
- package/dist/components/pagination/pagination.js +53 -79
- package/dist/components/pagination/pagination.stories.d.ts +1 -0
- package/dist/components/pagination/pagination.stories.js +31 -5
- package/dist/components/paper/index.d.ts +1 -0
- package/dist/components/paper/index.js +1 -0
- package/dist/components/paper/paper.d.ts +12 -0
- package/dist/components/paper/paper.js +39 -0
- package/dist/components/paper/paper.stories.d.ts +7 -0
- package/dist/components/paper/paper.stories.js +30 -0
- package/dist/components/password-strength-indicator/password-strength-indicator.stories.js +1 -1
- package/dist/components/popover/popover-skeleton.js +1 -1
- package/dist/components/popover/popover.stories.js +2 -2
- package/dist/components/progress/index.d.ts +1 -1
- package/dist/components/progress/progress.d.ts +1 -1
- package/dist/components/progress/progress.stories.js +1 -1
- package/dist/components/radio-group/radio-group-skeleton.js +1 -1
- package/dist/components/radio-group/radio-group.stories.js +1 -1
- package/dist/components/resizable/resizable.stories.js +8 -8
- package/dist/components/ring-progress/index.d.ts +1 -0
- package/dist/components/ring-progress/index.js +1 -0
- package/dist/components/ring-progress/ring-progress.d.ts +24 -0
- package/dist/components/ring-progress/ring-progress.js +20 -0
- package/dist/components/ring-progress/ring-progress.stories.d.ts +9 -0
- package/dist/components/ring-progress/ring-progress.stories.js +46 -0
- package/dist/components/scroll-area/scroll-area.stories.js +26 -26
- package/dist/components/segmented-control/index.d.ts +1 -0
- package/dist/components/segmented-control/index.js +1 -0
- package/dist/components/segmented-control/segmented-control.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control.js +46 -0
- package/dist/components/segmented-control/segmented-control.stories.d.ts +10 -0
- package/dist/components/segmented-control/segmented-control.stories.js +53 -0
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.stories.js +1 -1
- package/dist/components/separator/separator.stories.js +1 -1
- package/dist/components/session-card/session-card-skeleton.js +2 -2
- package/dist/components/session-card/session-card.js +1 -1
- package/dist/components/sidebar/sidebar-skeleton.js +2 -2
- package/dist/components/skeleton/index.d.ts +3 -3
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +0 -249
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/slider.stories.js +1 -1
- package/dist/components/social-login-button/social-login-button.js +6 -6
- package/dist/components/sparkline-chart/sparkline-chart.js +6 -3
- package/dist/components/sparkline-chart/sparkline-chart.stories.js +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spoiler/index.d.ts +1 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/spoiler/spoiler.d.ts +14 -0
- package/dist/components/spoiler/spoiler.js +20 -0
- package/dist/components/spoiler/spoiler.stories.d.ts +8 -0
- package/dist/components/spoiler/spoiler.stories.js +35 -0
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/stack/stack.d.ts +2 -2
- package/dist/components/stack/stack.js +1 -1
- package/dist/components/steps/steps-skeleton.js +1 -1
- package/dist/components/steps/steps.js +7 -5
- package/dist/components/steps/steps.stories.js +6 -2
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/switch/switch.stories.js +1 -1
- package/dist/components/table/table-skeleton.js +2 -2
- package/dist/components/table/table.js +4 -3
- package/dist/components/table/table.stories.js +10 -7
- package/dist/components/tabs/tabs-skeleton.js +1 -1
- package/dist/components/tabs/tabs.d.ts +3 -3
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tabs/tabs.stories.js +5 -5
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text/text.d.ts +7 -5
- package/dist/components/text/text.js +2 -2
- package/dist/components/text/text.stories.js +34 -3
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/textarea.stories.js +1 -1
- package/dist/components/timeline/index.d.ts +1 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/timeline/timeline.d.ts +35 -0
- package/dist/components/timeline/timeline.js +36 -0
- package/dist/components/timeline/timeline.stories.d.ts +7 -0
- package/dist/components/timeline/timeline.stories.js +21 -0
- package/dist/components/toast/toast.js +6 -6
- package/dist/components/toggle/toggle.stories.js +1 -1
- package/dist/components/tooltip/tooltip.stories.js +1 -1
- package/dist/components/user-menu-dropdown/user-menu-dropdown.js +1 -1
- package/dist/config/tailwind-base.d.ts +10 -0
- package/dist/config/tailwind-base.js +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +25 -10
- package/dist/lib/animations.js +94 -94
- package/dist/primitives/command/Command.js +2 -1
- package/dist/styles/globals.css +415 -82
- package/package.json +101 -24
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { RingProgress } from "./ring-progress";
|
|
3
|
+
declare const meta: Meta<typeof RingProgress>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof RingProgress>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomSize: Story;
|
|
8
|
+
export declare const WithIcon: Story;
|
|
9
|
+
export declare const Sections: Story;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import { RingProgress } from "./ring-progress";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Components/RingProgress",
|
|
6
|
+
component: RingProgress,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
value: { control: { type: "range", min: 0, max: 100 } },
|
|
10
|
+
size: { control: "number" },
|
|
11
|
+
thickness: { control: "number" },
|
|
12
|
+
roundCaps: { control: "boolean" },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
value: 40,
|
|
19
|
+
label: _jsx("span", { className: "font-bold", children: "40%" }),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const CustomSize = {
|
|
23
|
+
args: {
|
|
24
|
+
size: 80,
|
|
25
|
+
thickness: 8,
|
|
26
|
+
value: 75,
|
|
27
|
+
label: _jsx("span", { className: "text-xs", children: "75%" }),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const WithIcon = {
|
|
31
|
+
args: {
|
|
32
|
+
value: 100,
|
|
33
|
+
color: "text-green-500",
|
|
34
|
+
label: _jsx(Check, { className: "h-8 w-8 text-green-500" }),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const Sections = {
|
|
38
|
+
args: {
|
|
39
|
+
label: _jsx("span", { className: "text-sm font-semibold", children: "Usage" }),
|
|
40
|
+
sections: [
|
|
41
|
+
{ value: 40, color: "text-blue-500" },
|
|
42
|
+
{ value: 15, color: "text-orange-500" },
|
|
43
|
+
{ value: 10, color: "text-red-500" },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Separator } from "../separator
|
|
2
|
+
import { Separator } from "../separator";
|
|
3
3
|
import { ScrollArea, ScrollBar } from "./scroll-area";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Layout/ScrollArea",
|
|
@@ -81,31 +81,31 @@ export const Styled = {
|
|
|
81
81
|
*/
|
|
82
82
|
export const CodeBlock = {
|
|
83
83
|
args: {},
|
|
84
|
-
render: () => (_jsxs(ScrollArea, { className: "h-[300px] w-[500px] rounded-md border", children: [_jsx("div", { className: "bg-muted/50 p-4", children: _jsx("pre", { className: "text-sm", children: _jsx("code", { children: `import { ScrollArea } from '@repo/ui/scroll-area';
|
|
85
|
-
|
|
86
|
-
export function Example() {
|
|
87
|
-
return (
|
|
88
|
-
<ScrollArea className="h-72 w-48 rounded-md border">
|
|
89
|
-
<div className="p-4">
|
|
90
|
-
<h4>Title</h4>
|
|
91
|
-
{/* Your scrollable content */}
|
|
92
|
-
</div>
|
|
93
|
-
</ScrollArea>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Advanced usage with horizontal scrolling
|
|
98
|
-
export function HorizontalExample() {
|
|
99
|
-
return (
|
|
100
|
-
<ScrollArea className="w-96 whitespace-nowrap">
|
|
101
|
-
<div className="flex w-max space-x-4 p-4">
|
|
102
|
-
{items.map((item) => (
|
|
103
|
-
<div key={item.id}>{item.content}</div>
|
|
104
|
-
))}
|
|
105
|
-
</div>
|
|
106
|
-
<ScrollBar orientation="horizontal" />
|
|
107
|
-
</ScrollArea>
|
|
108
|
-
);
|
|
84
|
+
render: () => (_jsxs(ScrollArea, { className: "h-[300px] w-[500px] rounded-md border", children: [_jsx("div", { className: "bg-muted/50 p-4", children: _jsx("pre", { className: "text-sm", children: _jsx("code", { children: `import { ScrollArea } from '@repo/ui/scroll-area';
|
|
85
|
+
|
|
86
|
+
export function Example() {
|
|
87
|
+
return (
|
|
88
|
+
<ScrollArea className="h-72 w-48 rounded-md border">
|
|
89
|
+
<div className="p-4">
|
|
90
|
+
<h4>Title</h4>
|
|
91
|
+
{/* Your scrollable content */}
|
|
92
|
+
</div>
|
|
93
|
+
</ScrollArea>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Advanced usage with horizontal scrolling
|
|
98
|
+
export function HorizontalExample() {
|
|
99
|
+
return (
|
|
100
|
+
<ScrollArea className="w-96 whitespace-nowrap">
|
|
101
|
+
<div className="flex w-max space-x-4 p-4">
|
|
102
|
+
{items.map((item) => (
|
|
103
|
+
<div key={item.id}>{item.content}</div>
|
|
104
|
+
))}
|
|
105
|
+
</div>
|
|
106
|
+
<ScrollBar orientation="horizontal" />
|
|
107
|
+
</ScrollArea>
|
|
108
|
+
);
|
|
109
109
|
}` }) }) }), _jsx(ScrollBar, { orientation: "horizontal" })] })),
|
|
110
110
|
};
|
|
111
111
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./segmented-control";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./segmented-control";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SegmentedControlItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type SegmentedControlData = string | SegmentedControlItem;
|
|
8
|
+
export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
9
|
+
data: SegmentedControlData[];
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
name?: string;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
17
|
+
radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
18
|
+
}
|
|
19
|
+
export declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { motion } from "framer-motion";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
export const SegmentedControl = React.forwardRef(({ className, data, value: valueProp, defaultValue, onChange, disabled, name, fullWidth, size = "sm", radius = "sm", ...props }, ref) => {
|
|
6
|
+
const [internalValue, setInternalValue] = React.useState(valueProp ??
|
|
7
|
+
defaultValue ??
|
|
8
|
+
(typeof data[0] === "string" ? data[0] : data[0]?.value) ??
|
|
9
|
+
"");
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (valueProp !== undefined) {
|
|
12
|
+
setInternalValue(valueProp);
|
|
13
|
+
}
|
|
14
|
+
}, [valueProp]);
|
|
15
|
+
const handleChange = (val) => {
|
|
16
|
+
if (disabled)
|
|
17
|
+
return;
|
|
18
|
+
if (valueProp === undefined) {
|
|
19
|
+
setInternalValue(val);
|
|
20
|
+
}
|
|
21
|
+
onChange?.(val);
|
|
22
|
+
};
|
|
23
|
+
const items = data.map((item) => typeof item === "string" ? { label: item, value: item } : item);
|
|
24
|
+
const sizeClasses = {
|
|
25
|
+
xs: "h-6 text-xs",
|
|
26
|
+
sm: "h-8 text-sm",
|
|
27
|
+
md: "h-10 text-sm",
|
|
28
|
+
lg: "h-12 text-base",
|
|
29
|
+
xl: "h-14 text-lg",
|
|
30
|
+
};
|
|
31
|
+
const radiusClasses = {
|
|
32
|
+
xs: "rounded-sm",
|
|
33
|
+
sm: "rounded",
|
|
34
|
+
md: "rounded-md",
|
|
35
|
+
lg: "rounded-lg",
|
|
36
|
+
xl: "rounded-xl",
|
|
37
|
+
full: "rounded-full",
|
|
38
|
+
};
|
|
39
|
+
return (_jsx("div", { ref: ref, className: cn("relative flex bg-muted p-1", radiusClasses[radius], fullWidth ? "w-full" : "w-fit", disabled && "cursor-not-allowed opacity-60", className), ...props, children: items.map((item) => {
|
|
40
|
+
const isActive = internalValue === item.value;
|
|
41
|
+
return (_jsxs("button", { type: "button", disabled: disabled || item.disabled, onClick: () => !item.disabled && handleChange(item.value), className: cn("relative z-10 flex items-center justify-center px-3 font-medium transition-colors", sizeClasses[size], fullWidth ? "flex-1" : "min-w-[70px]", isActive
|
|
42
|
+
? "text-foreground"
|
|
43
|
+
: "text-muted-foreground hover:text-foreground", item.disabled && "cursor-not-allowed opacity-50", radiusClasses[radius]), children: [isActive && (_jsx(motion.div, { layoutId: `indicator-${name ?? "segmented-control"}`, className: cn("absolute inset-0 -z-10 bg-background shadow-sm", radiusClasses[radius]), transition: { type: "spring", bounce: 0.2, duration: 0.3 } })), _jsx("span", { className: "z-20", children: item.label })] }, item.value));
|
|
44
|
+
}) }));
|
|
45
|
+
});
|
|
46
|
+
SegmentedControl.displayName = "SegmentedControl";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { SegmentedControl } from "./segmented-control";
|
|
3
|
+
declare const meta: Meta<typeof SegmentedControl>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SegmentedControl>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const FullWidth: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
9
|
+
export declare const Disabled: Story;
|
|
10
|
+
export declare const DisabledOption: Story;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SegmentedControl } from "./segmented-control";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/SegmentedControl",
|
|
5
|
+
component: SegmentedControl,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["xs", "sm", "md", "lg", "xl"],
|
|
11
|
+
},
|
|
12
|
+
radius: {
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
options: ["xs", "sm", "md", "lg", "xl", "full"],
|
|
15
|
+
},
|
|
16
|
+
fullWidth: { control: "boolean" },
|
|
17
|
+
disabled: { control: "boolean" },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
export const Default = {
|
|
22
|
+
args: {
|
|
23
|
+
data: ["React", "Vue", "Angular", "Svelte"],
|
|
24
|
+
defaultValue: "React",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const FullWidth = {
|
|
28
|
+
args: {
|
|
29
|
+
data: ["Daily", "Weekly", "Monthly"],
|
|
30
|
+
defaultValue: "Weekly",
|
|
31
|
+
fullWidth: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const Sizes = {
|
|
35
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(SegmentedControl, { data: ["xs", "sm", "md"], size: "xs", defaultValue: "xs" }), _jsx(SegmentedControl, { data: ["xs", "sm", "md"], size: "sm", defaultValue: "sm" }), _jsx(SegmentedControl, { data: ["xs", "sm", "md"], size: "md", defaultValue: "md" }), _jsx(SegmentedControl, { data: ["xs", "sm", "md"], size: "lg", defaultValue: "lg" }), _jsx(SegmentedControl, { data: ["xs", "sm", "md"], size: "xl", defaultValue: "xl" })] })),
|
|
36
|
+
};
|
|
37
|
+
export const Disabled = {
|
|
38
|
+
args: {
|
|
39
|
+
data: ["React", "Vue", "Angular"],
|
|
40
|
+
defaultValue: "Vue",
|
|
41
|
+
disabled: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const DisabledOption = {
|
|
45
|
+
args: {
|
|
46
|
+
data: [
|
|
47
|
+
{ label: "React", value: "react" },
|
|
48
|
+
{ label: "Vue", value: "vue", disabled: true },
|
|
49
|
+
{ label: "Angular", value: "angular" },
|
|
50
|
+
],
|
|
51
|
+
defaultValue: "react",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -5,7 +5,7 @@ import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { selectContentStyles, selectItemStyles, selectLabelStyles, selectScrollButtonStyles, selectSeparatorStyles, selectTriggerStyles, } from "../../config/select";
|
|
7
7
|
import { cn } from "../../lib/utils";
|
|
8
|
-
import { Skeleton } from "../skeleton
|
|
8
|
+
import { Skeleton } from "../skeleton";
|
|
9
9
|
function Select(props) {
|
|
10
10
|
return _jsx(SelectPrimitive.Root, { ...props });
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "../skeleton
|
|
2
|
+
import { Skeleton } from "../skeleton";
|
|
3
3
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from "./select";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Forms/Select",
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
*/
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Card, CardContent, CardHeader } from "../card";
|
|
10
|
-
import { Skeleton } from "../skeleton
|
|
10
|
+
import { Skeleton } from "../skeleton";
|
|
11
11
|
import { SkeletonCircle } from "../skeleton/skeleton-patterns";
|
|
12
12
|
/**
|
|
13
13
|
* Session Card skeleton component
|
|
@@ -20,7 +20,7 @@ import { SkeletonCircle } from "../skeleton/skeleton-patterns";
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export function SessionCardSkeleton({ showBadge = false, showRevokeButton = true, className, "data-testid": dataTestId, }) {
|
|
23
|
-
return (_jsxs(Card, { "data-testid": dataTestId || "session-card-skeleton", className: cn("relative", className), children: [_jsx(CardHeader, { className: "pb-3", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex items-start gap-3 flex-1", children: [_jsx(SkeletonCircle, { size: "1.5rem", className: "rounded-md" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Skeleton, { className: "h-4 w-32 mb-1" }), _jsx(Skeleton, { className: "h-3 w-48" })] })] }), showBadge ? (_jsx(Skeleton, { className: "h-5 w-24 rounded-md" })) : (showRevokeButton &&
|
|
23
|
+
return (_jsxs(Card, { "data-testid": dataTestId || "session-card-skeleton", className: cn("relative", className), children: [_jsx(CardHeader, { className: "pb-3", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex items-start gap-3 flex-1", children: [_jsx(SkeletonCircle, { size: "1.5rem", className: "rounded-md" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Skeleton, { className: "h-4 w-32 mb-1" }), _jsx(Skeleton, { className: "h-3 w-48" })] })] }), showBadge ? (_jsx(Skeleton, { className: "h-5 w-24 rounded-md" })) : (showRevokeButton && _jsx(Skeleton, { className: "h-8 w-16 rounded-md" }))] }) }), _jsx(CardContent, { className: "pt-0", children: _jsxs("div", { className: "space-y-1.5", children: [_jsx(Skeleton, { className: "h-4 w-48" }), _jsx(Skeleton, { className: "h-4 w-40" }), _jsx(Skeleton, { className: "h-4 w-56" })] }) })] }));
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Compound component: SessionCard.Skeleton
|
|
@@ -53,7 +53,7 @@ export function SessionCard({ session, onRevoke, isRevoking, className, isLoadin
|
|
|
53
53
|
if (skeleton) {
|
|
54
54
|
return (_jsx(Card, { "data-comp": "session-card", className: cn("relative", className), children: skeleton }));
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return _jsx(SessionCardSkeleton, { className: className, ...skeletonConfig });
|
|
57
57
|
}
|
|
58
58
|
const DeviceIcon = getDeviceIcon(session.device);
|
|
59
59
|
const lastActive = formatTimestamp(session.lastActiveAt);
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
* Supports sections, header, footer, and collapsed state.
|
|
7
7
|
*/
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
|
-
import { Skeleton } from "../skeleton
|
|
9
|
+
import { Skeleton } from "../skeleton";
|
|
10
10
|
/**
|
|
11
11
|
* Sidebar skeleton component
|
|
12
12
|
*
|
|
@@ -18,5 +18,5 @@ import { Skeleton } from "../skeleton/skeleton";
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export function SidebarSkeleton({ collapsed = false, showHeader = true, showFooter = true, sectionCount = 3, itemsPerSection = 4, className, "data-testid": dataTestId, }) {
|
|
21
|
-
return (_jsxs("aside", { "data-testid": dataTestId || "sidebar-skeleton", className: cn("flex flex-col h-full bg-popover border-r", collapsed ? "w-16" : "w-64", className), "aria-label": "Loading sidebar", "aria-busy": "true", children: [showHeader && (_jsx("div", { className: "flex items-center h-16 px-6 border-b", children: collapsed ? (_jsx(Skeleton, { className: "h-8 w-8 mx-auto" })) : (_jsx(Skeleton, { className: "h-8 w-32" })) })), _jsx("div", { className: "flex-1 overflow-y-auto py-4 px-3", children: Array.from({ length: sectionCount }).map((_, sectionIndex) => (_jsxs("div", { className: "mb-6 last:mb-0", children: [!collapsed &&
|
|
21
|
+
return (_jsxs("aside", { "data-testid": dataTestId || "sidebar-skeleton", className: cn("flex flex-col h-full bg-popover border-r", collapsed ? "w-16" : "w-64", className), "aria-label": "Loading sidebar", "aria-busy": "true", children: [showHeader && (_jsx("div", { className: "flex items-center h-16 px-6 border-b", children: collapsed ? (_jsx(Skeleton, { className: "h-8 w-8 mx-auto" })) : (_jsx(Skeleton, { className: "h-8 w-32" })) })), _jsx("div", { className: "flex-1 overflow-y-auto py-4 px-3", children: Array.from({ length: sectionCount }).map((_, sectionIndex) => (_jsxs("div", { className: "mb-6 last:mb-0", children: [!collapsed && _jsx(Skeleton, { className: "h-3 w-20 mb-2 mx-3" }), _jsx("div", { className: "space-y-2", children: Array.from({ length: itemsPerSection }).map((_, itemIndex) => (_jsxs("div", { className: cn("flex items-center px-3 py-2", collapsed ? "justify-center" : "gap-3"), children: [_jsx(Skeleton, { className: "h-5 w-5 flex-shrink-0" }), !collapsed && _jsx(Skeleton, { className: "h-4 flex-1" }), !collapsed && itemIndex === 0 && (_jsx(Skeleton, { className: "h-4 w-4 rounded-full flex-shrink-0" }))] }, itemIndex))) })] }, sectionIndex))) }), showFooter && (_jsx("div", { className: "p-4 border-t", children: _jsxs("div", { className: cn("flex items-center", collapsed ? "justify-center" : "gap-3"), children: [_jsx(Skeleton, { className: "h-10 w-10 rounded-full flex-shrink-0" }), !collapsed && (_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx(Skeleton, { className: "h-4 w-24 mb-1" }), _jsx(Skeleton, { className: "h-3 w-32" })] }))] }) }))] }));
|
|
22
22
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export type { FieldGroupSkeletonConfig, FormFieldConfig, FormFieldType, FormSkeletonConfig, } from "./form-skeleton";
|
|
2
|
+
export { FieldGroupSkeleton, FormSkeleton } from "./form-skeleton";
|
|
1
3
|
export type { SkeletonProps } from "./skeleton";
|
|
2
4
|
export { Skeleton } from "./skeleton";
|
|
5
|
+
export type { AlertSkeletonConfig, BannerSkeletonConfig, BaseSkeletonConfig, CardSkeletonConfig, EmptyStateSkeletonConfig, ExtractSkeletonConfig, FieldSkeletonConfig, ListSkeletonConfig, LoadingStateProps, MetricCardSkeletonConfig, PatternConfig, SessionCardSkeletonConfig, SkeletonVariant, SkeletonWrapperConfig, WithLoadingState, } from "./skeleton.types";
|
|
3
6
|
export type { SkeletonAvatarProps, SkeletonButtonProps, SkeletonCardContentProps, SkeletonCircleProps, SkeletonHeaderProps, SkeletonParagraphProps, SkeletonRectangleProps, SkeletonTextProps, } from "./skeleton-patterns";
|
|
4
7
|
export { SkeletonAvatar, SkeletonButton, SkeletonCardContent, SkeletonCircle, SkeletonHeader, SkeletonParagraph, SkeletonRectangle, SkeletonText, } from "./skeleton-patterns";
|
|
5
8
|
export type { SkeletonWrapperProps } from "./skeleton-wrapper";
|
|
6
9
|
export { SkeletonWrapper } from "./skeleton-wrapper";
|
|
7
|
-
export type { FieldGroupSkeletonConfig, FormFieldConfig, FormFieldType, FormSkeletonConfig, } from "./form-skeleton";
|
|
8
|
-
export { FieldGroupSkeleton, FormSkeleton } from "./form-skeleton";
|
|
9
|
-
export type { AccordionSkeletonConfig, AlertSkeletonConfig, BannerSkeletonConfig, BaseSkeletonConfig, BreadcrumbsSkeletonConfig, CalendarSkeletonConfig, CardSkeletonConfig, DialogSkeletonConfig, DrawerSkeletonConfig, EmptyStateSkeletonConfig, ExtractSkeletonConfig, FieldSkeletonConfig, HeaderSkeletonConfig, ListSkeletonConfig, LoadingStateProps, MetricCardSkeletonConfig, NavigationSkeletonConfig, PaginationSkeletonConfig, PatternConfig, PopoverSkeletonConfig, SessionCardSkeletonConfig, SidebarSkeletonConfig, SkeletonVariant, StepsSkeletonConfig, SkeletonWrapperConfig, TableSkeletonConfig, TabsSkeletonConfig, WithLoadingState, } from "./skeleton.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { FieldGroupSkeleton, FormSkeleton } from "./form-skeleton";
|
|
1
2
|
export { Skeleton } from "./skeleton";
|
|
2
3
|
export { SkeletonAvatar, SkeletonButton, SkeletonCardContent, SkeletonCircle, SkeletonHeader, SkeletonParagraph, SkeletonRectangle, SkeletonText, } from "./skeleton-patterns";
|
|
3
4
|
export { SkeletonWrapper } from "./skeleton-wrapper";
|
|
4
|
-
export { FieldGroupSkeleton, FormSkeleton } from "./form-skeleton";
|
|
@@ -131,39 +131,6 @@ export interface ListSkeletonConfig {
|
|
|
131
131
|
*/
|
|
132
132
|
dense?: boolean;
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Table skeleton configuration
|
|
136
|
-
*/
|
|
137
|
-
export interface TableSkeletonConfig extends BaseSkeletonConfig {
|
|
138
|
-
/**
|
|
139
|
-
* Number of rows to display
|
|
140
|
-
*/
|
|
141
|
-
rows?: number;
|
|
142
|
-
/**
|
|
143
|
-
* Number of columns
|
|
144
|
-
*/
|
|
145
|
-
columns?: number;
|
|
146
|
-
/**
|
|
147
|
-
* Show action column
|
|
148
|
-
*/
|
|
149
|
-
showActions?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Column headers (optional, for matching actual headers)
|
|
152
|
-
*/
|
|
153
|
-
headers?: string[];
|
|
154
|
-
/**
|
|
155
|
-
* Column widths (to match actual table and prevent CLS)
|
|
156
|
-
*/
|
|
157
|
-
columnWidths?: string[];
|
|
158
|
-
/**
|
|
159
|
-
* Show checkbox column for selection
|
|
160
|
-
*/
|
|
161
|
-
showCheckboxes?: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Enable sticky header
|
|
164
|
-
*/
|
|
165
|
-
stickyHeader?: boolean;
|
|
166
|
-
}
|
|
167
134
|
/**
|
|
168
135
|
* Field skeleton configuration
|
|
169
136
|
*/
|
|
@@ -189,222 +156,6 @@ export interface FieldSkeletonConfig {
|
|
|
189
156
|
*/
|
|
190
157
|
variant?: "default" | "error";
|
|
191
158
|
}
|
|
192
|
-
/**
|
|
193
|
-
* Navigation skeleton configuration
|
|
194
|
-
*/
|
|
195
|
-
export interface NavigationSkeletonConfig extends BaseSkeletonConfig {
|
|
196
|
-
/**
|
|
197
|
-
* Navigation orientation
|
|
198
|
-
*/
|
|
199
|
-
orientation?: "horizontal" | "vertical";
|
|
200
|
-
/**
|
|
201
|
-
* Number of navigation items
|
|
202
|
-
*/
|
|
203
|
-
itemCount?: number;
|
|
204
|
-
/**
|
|
205
|
-
* Show icon for each item
|
|
206
|
-
*/
|
|
207
|
-
showIcons?: boolean;
|
|
208
|
-
/**
|
|
209
|
-
* Show badge indicators
|
|
210
|
-
*/
|
|
211
|
-
showBadges?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Show nested items
|
|
214
|
-
*/
|
|
215
|
-
nested?: boolean;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Sidebar skeleton configuration
|
|
219
|
-
*/
|
|
220
|
-
export interface SidebarSkeletonConfig extends BaseSkeletonConfig {
|
|
221
|
-
/**
|
|
222
|
-
* Collapsed state
|
|
223
|
-
*/
|
|
224
|
-
collapsed?: boolean;
|
|
225
|
-
/**
|
|
226
|
-
* Show header section
|
|
227
|
-
*/
|
|
228
|
-
showHeader?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Show footer section
|
|
231
|
-
*/
|
|
232
|
-
showFooter?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Number of navigation sections
|
|
235
|
-
*/
|
|
236
|
-
sectionCount?: number;
|
|
237
|
-
/**
|
|
238
|
-
* Items per section
|
|
239
|
-
*/
|
|
240
|
-
itemsPerSection?: number;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Header skeleton configuration
|
|
244
|
-
*/
|
|
245
|
-
export interface HeaderSkeletonConfig extends BaseSkeletonConfig {
|
|
246
|
-
/**
|
|
247
|
-
* Show navigation items
|
|
248
|
-
*/
|
|
249
|
-
showNavigation?: boolean;
|
|
250
|
-
/**
|
|
251
|
-
* Number of navigation items
|
|
252
|
-
*/
|
|
253
|
-
navItemCount?: number;
|
|
254
|
-
/**
|
|
255
|
-
* Show search input
|
|
256
|
-
*/
|
|
257
|
-
showSearch?: boolean;
|
|
258
|
-
/**
|
|
259
|
-
* Show notifications button
|
|
260
|
-
*/
|
|
261
|
-
showNotifications?: boolean;
|
|
262
|
-
/**
|
|
263
|
-
* Show user menu button
|
|
264
|
-
*/
|
|
265
|
-
showUserMenu?: boolean;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Breadcrumbs skeleton configuration
|
|
269
|
-
*/
|
|
270
|
-
export interface BreadcrumbsSkeletonConfig extends BaseSkeletonConfig {
|
|
271
|
-
/**
|
|
272
|
-
* Number of breadcrumb levels
|
|
273
|
-
*/
|
|
274
|
-
depth?: number;
|
|
275
|
-
/**
|
|
276
|
-
* Show home icon
|
|
277
|
-
*/
|
|
278
|
-
showHome?: boolean;
|
|
279
|
-
/**
|
|
280
|
-
* Separator character
|
|
281
|
-
*/
|
|
282
|
-
separator?: string;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Steps skeleton configuration
|
|
286
|
-
*/
|
|
287
|
-
export interface StepsSkeletonConfig extends BaseSkeletonConfig {
|
|
288
|
-
/**
|
|
289
|
-
* Number of steps
|
|
290
|
-
*/
|
|
291
|
-
stepCount?: number;
|
|
292
|
-
/**
|
|
293
|
-
* Orientation of the stepper
|
|
294
|
-
*/
|
|
295
|
-
orientation?: "horizontal" | "vertical";
|
|
296
|
-
/**
|
|
297
|
-
* Show step labels and descriptions
|
|
298
|
-
*/
|
|
299
|
-
showLabels?: boolean;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Tabs skeleton configuration
|
|
303
|
-
*/
|
|
304
|
-
export interface TabsSkeletonConfig {
|
|
305
|
-
/**
|
|
306
|
-
* Number of tabs
|
|
307
|
-
*/
|
|
308
|
-
tabCount?: number;
|
|
309
|
-
/**
|
|
310
|
-
* Tab variant style
|
|
311
|
-
*/
|
|
312
|
-
variant?: "default" | "pills" | "underline";
|
|
313
|
-
/**
|
|
314
|
-
* Show tab content skeleton
|
|
315
|
-
*/
|
|
316
|
-
showContent?: boolean;
|
|
317
|
-
/**
|
|
318
|
-
* Number of content rows
|
|
319
|
-
*/
|
|
320
|
-
contentRows?: number;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Accordion skeleton configuration
|
|
324
|
-
*/
|
|
325
|
-
export interface AccordionSkeletonConfig extends BaseSkeletonConfig {
|
|
326
|
-
/**
|
|
327
|
-
* Number of accordion items
|
|
328
|
-
*/
|
|
329
|
-
itemCount?: number;
|
|
330
|
-
/**
|
|
331
|
-
* Show expanded content
|
|
332
|
-
*/
|
|
333
|
-
defaultExpanded?: boolean;
|
|
334
|
-
/**
|
|
335
|
-
* Number of content rows when expanded
|
|
336
|
-
*/
|
|
337
|
-
contentRows?: number;
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Calendar skeleton configuration
|
|
341
|
-
*/
|
|
342
|
-
export interface CalendarSkeletonConfig extends BaseSkeletonConfig {
|
|
343
|
-
/**
|
|
344
|
-
* Show month/year header
|
|
345
|
-
*/
|
|
346
|
-
showHeader?: boolean;
|
|
347
|
-
/**
|
|
348
|
-
* Show day labels
|
|
349
|
-
*/
|
|
350
|
-
showDayLabels?: boolean;
|
|
351
|
-
/**
|
|
352
|
-
* Number of weeks to show
|
|
353
|
-
*/
|
|
354
|
-
weekCount?: number;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Pagination skeleton configuration
|
|
358
|
-
*/
|
|
359
|
-
export interface PaginationSkeletonConfig extends BaseSkeletonConfig {
|
|
360
|
-
/**
|
|
361
|
-
* Number of page buttons to show
|
|
362
|
-
*/
|
|
363
|
-
pageCount?: number;
|
|
364
|
-
/**
|
|
365
|
-
* Show prev/next buttons
|
|
366
|
-
*/
|
|
367
|
-
showPrevNext?: boolean;
|
|
368
|
-
/**
|
|
369
|
-
* Show info text
|
|
370
|
-
*/
|
|
371
|
-
showInfo?: boolean;
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Dialog skeleton configuration
|
|
375
|
-
*/
|
|
376
|
-
export interface DialogSkeletonConfig extends BaseSkeletonConfig {
|
|
377
|
-
/**
|
|
378
|
-
* Show dialog header
|
|
379
|
-
*/
|
|
380
|
-
showHeader?: boolean;
|
|
381
|
-
/**
|
|
382
|
-
* Show dialog footer
|
|
383
|
-
*/
|
|
384
|
-
showFooter?: boolean;
|
|
385
|
-
/**
|
|
386
|
-
* Number of content rows
|
|
387
|
-
*/
|
|
388
|
-
contentRows?: number;
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Drawer skeleton configuration (extends Dialog)
|
|
392
|
-
*/
|
|
393
|
-
export interface DrawerSkeletonConfig extends DialogSkeletonConfig {
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Popover skeleton configuration
|
|
397
|
-
*/
|
|
398
|
-
export interface PopoverSkeletonConfig extends BaseSkeletonConfig {
|
|
399
|
-
/**
|
|
400
|
-
* Number of content rows
|
|
401
|
-
*/
|
|
402
|
-
contentRows?: number;
|
|
403
|
-
/**
|
|
404
|
-
* Use compact spacing
|
|
405
|
-
*/
|
|
406
|
-
compact?: boolean;
|
|
407
|
-
}
|
|
408
159
|
/**
|
|
409
160
|
* Metric card skeleton configuration
|
|
410
161
|
*/
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
|
-
import { Skeleton } from "../skeleton
|
|
5
|
+
import { Skeleton } from "../skeleton";
|
|
6
6
|
const Slider = React.forwardRef(({ className, defaultValue, value, isLoading = false, ...props }, ref) => {
|
|
7
7
|
// Show loading skeleton
|
|
8
8
|
if (isLoading) {
|