@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
|
@@ -3,7 +3,7 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { badgeStyles } from "../../config/badge";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
6
|
-
import { Skeleton } from "../skeleton
|
|
6
|
+
import { Skeleton } from "../skeleton";
|
|
7
7
|
const badgeVariants = cva(badgeStyles.base, {
|
|
8
8
|
variants: badgeStyles.variants,
|
|
9
9
|
defaultVariants: badgeStyles.defaultVariants,
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
* Provides zero-CLS skeleton state that matches actual banner layout.
|
|
7
7
|
*/
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
|
-
import { Skeleton } from "../skeleton
|
|
9
|
+
import { Skeleton } from "../skeleton";
|
|
10
10
|
import { SkeletonCircle } from "../skeleton/skeleton-patterns";
|
|
11
11
|
/**
|
|
12
12
|
* Banner skeleton component
|
|
@@ -12,7 +12,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
12
12
|
import type * as React from "react";
|
|
13
13
|
import type { BannerSkeletonConfig } from "../skeleton/skeleton.types";
|
|
14
14
|
declare const bannerVariants: (props?: ({
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "success" | "warning" | "info" | "error" | null | undefined;
|
|
16
16
|
position?: "fixed" | "static" | null | undefined;
|
|
17
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
18
|
export interface BannerProps extends React.ComponentProps<"div">, VariantProps<typeof bannerVariants> {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface BoxProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
8
|
+
export { Box };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const Box = React.forwardRef(({ className, asChild = false, as: Tag = "div", ...props }, ref) => {
|
|
6
|
+
const Comp = asChild ? Slot : Tag;
|
|
7
|
+
return _jsx(Comp, { className: cn(className), ref: ref, ...props });
|
|
8
|
+
});
|
|
9
|
+
Box.displayName = "Box";
|
|
10
|
+
export { Box };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Box } from "./box";
|
|
3
|
+
declare const meta: Meta<typeof Box>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Box>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCustomStyles: Story;
|
|
8
|
+
export declare const AsChild: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Components/Box",
|
|
5
|
+
component: Box,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
argTypes: {
|
|
8
|
+
asChild: {
|
|
9
|
+
control: "boolean",
|
|
10
|
+
description: "Change the default rendered element for the one passed as a child, merging their props and behavior.",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Default = {
|
|
16
|
+
args: {
|
|
17
|
+
children: "This is a box",
|
|
18
|
+
className: "p-4 bg-gray-100 rounded border border-gray-200",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const WithCustomStyles = {
|
|
22
|
+
args: {
|
|
23
|
+
children: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "font-bold mb-2", children: "Box with custom styles" }), _jsx("p", { children: "You can use any Tailwind utility classes on the Box component." })] })),
|
|
24
|
+
className: "p-6 bg-blue-50 text-blue-900 rounded-lg shadow-sm",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const AsChild = {
|
|
28
|
+
args: {
|
|
29
|
+
asChild: true,
|
|
30
|
+
children: (_jsx("button", { type: "button", className: "px-4 py-2 bg-primary text-primary-foreground rounded hover:opacity-90 transition-opacity", children: "I am a button rendered via Box asChild" })),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./box";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./box";
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
7
7
|
*/
|
|
8
8
|
import { Fragment } from "react";
|
|
9
9
|
import { cn } from "../../lib/utils";
|
|
10
|
-
import { Skeleton } from "../skeleton
|
|
10
|
+
import { Skeleton } from "../skeleton";
|
|
11
11
|
/**
|
|
12
12
|
* Breadcrumbs skeleton component
|
|
13
13
|
*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface BurgerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** State of the burger */
|
|
4
|
+
opened?: boolean;
|
|
5
|
+
/** Size of the burger */
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
|
+
}
|
|
8
|
+
export declare const Burger: React.ForwardRefExoticComponent<BurgerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
export const Burger = React.forwardRef(({ className, opened, size = "md", ...props }, ref) => {
|
|
5
|
+
const sizeClasses = {
|
|
6
|
+
xs: "h-3 w-4",
|
|
7
|
+
sm: "h-4 w-5",
|
|
8
|
+
md: "h-5 w-6",
|
|
9
|
+
lg: "h-6 w-8",
|
|
10
|
+
xl: "h-8 w-10",
|
|
11
|
+
};
|
|
12
|
+
const lineSizeClasses = {
|
|
13
|
+
xs: "h-0.5",
|
|
14
|
+
sm: "h-0.5",
|
|
15
|
+
md: "h-0.5",
|
|
16
|
+
lg: "h-1",
|
|
17
|
+
xl: "h-1",
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs("button", { ref: ref, type: "button", className: cn("relative flex flex-col justify-between cursor-pointer transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", sizeClasses[size], className), "aria-label": opened ? "Close navigation" : "Open navigation", "aria-expanded": opened, ...props, children: [_jsx("div", { className: cn("bg-foreground w-full rounded transition-transform origin-top-left", lineSizeClasses[size], opened && "translate-x-[3px] rotate-45") }), _jsx("div", { className: cn("bg-foreground w-full rounded transition-opacity", lineSizeClasses[size], opened && "opacity-0") }), _jsx("div", { className: cn("bg-foreground w-full rounded transition-transform origin-bottom-left", lineSizeClasses[size], opened && "translate-x-[3px] -rotate-45") })] }));
|
|
20
|
+
});
|
|
21
|
+
Burger.displayName = "Burger";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Burger } from "./burger";
|
|
3
|
+
declare const meta: Meta<typeof Burger>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Burger>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Interactive: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDisclosure } from "@kala-ui/react-hooks";
|
|
3
|
+
import { Flex } from "../flex";
|
|
4
|
+
import { Burger } from "./burger";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Burger",
|
|
7
|
+
component: Burger,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
opened: { control: "boolean" },
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
options: ["xs", "sm", "md", "lg", "xl"],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
export const Default = {
|
|
19
|
+
args: {
|
|
20
|
+
opened: false,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export const Interactive = {
|
|
24
|
+
render: () => {
|
|
25
|
+
const [opened, { toggle }] = useDisclosure(false);
|
|
26
|
+
return _jsx(Burger, { opened: opened, onClick: toggle });
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export const Sizes = {
|
|
30
|
+
render: () => (_jsxs(Flex, { align: "center", gap: 4, children: [_jsx(Burger, { size: "xs" }), _jsx(Burger, { size: "sm" }), _jsx(Burger, { size: "md" }), _jsx(Burger, { size: "lg" }), _jsx(Burger, { size: "xl" })] })),
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./burger";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./burger";
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import type { ButtonProps } from "./button.types";
|
|
7
7
|
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "
|
|
9
|
-
size?: "default" | "icon" | "
|
|
8
|
+
variant?: "link" | "default" | "dark" | "light" | "primary" | "secondary" | "success" | "danger" | "destructive" | "warning" | "info" | "outline" | "muted" | "ghost" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-warning" | "outline-danger" | "outline-info" | "outline-dark" | "outline-light" | "outline-muted" | null | undefined;
|
|
9
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | null | undefined;
|
|
10
10
|
fullWidth?: boolean | null | undefined;
|
|
11
11
|
rounded?: boolean | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { fn } from "@storybook/test";
|
|
3
|
-
import {
|
|
3
|
+
import { Box } from "../box";
|
|
4
|
+
import { Flex } from "../flex";
|
|
5
|
+
import { Stack } from "../stack";
|
|
6
|
+
import { Skeleton } from "../skeleton";
|
|
4
7
|
import { Button } from "./button";
|
|
5
8
|
const meta = {
|
|
6
9
|
title: "Buttons/Button",
|
|
@@ -63,19 +66,19 @@ export const Default = {
|
|
|
63
66
|
},
|
|
64
67
|
};
|
|
65
68
|
export const Variants = {
|
|
66
|
-
render: (args) => (_jsx(
|
|
69
|
+
render: (args) => (_jsx(Stack, { gap: 4, children: _jsxs(Flex, { wrap: "wrap", gap: 2, children: [_jsx(Button, { ...args, variant: "primary", children: "Primary" }), _jsx(Button, { ...args, variant: "secondary", children: "Secondary" }), _jsx(Button, { ...args, variant: "success", children: "Success" }), _jsx(Button, { ...args, variant: "warning", children: "Warning" }), _jsx(Button, { ...args, variant: "danger", children: "Danger" }), _jsx(Button, { ...args, variant: "info", children: "Info" }), _jsx(Button, { ...args, variant: "light", children: "Light" }), _jsx(Button, { ...args, variant: "dark", children: "Dark" }), _jsx(Button, { ...args, variant: "link", children: "Link" }), _jsx(Button, { ...args, variant: "ghost", children: "Ghost" })] }) })),
|
|
67
70
|
};
|
|
68
71
|
export const OutlineVariants = {
|
|
69
|
-
render: (args) => (_jsx(
|
|
72
|
+
render: (args) => (_jsx(Stack, { gap: 4, children: _jsxs(Flex, { wrap: "wrap", gap: 2, children: [_jsx(Button, { ...args, variant: "outline", children: "Default Outline" }), _jsx(Button, { ...args, variant: "outline-primary", children: "Primary" }), _jsx(Button, { ...args, variant: "outline-secondary", children: "Secondary" }), _jsx(Button, { ...args, variant: "outline-success", children: "Success" }), _jsx(Button, { ...args, variant: "outline-warning", children: "Warning" }), _jsx(Button, { ...args, variant: "outline-danger", children: "Danger" }), _jsx(Button, { ...args, variant: "outline-info", children: "Info" }), _jsx(Button, { ...args, variant: "outline-light", children: "Light" }), _jsx(Button, { ...args, variant: "outline-dark", children: "Dark" })] }) })),
|
|
70
73
|
};
|
|
71
74
|
export const Sizes = {
|
|
72
|
-
render: (args) => (_jsxs(
|
|
75
|
+
render: (args) => (_jsxs(Flex, { align: "center", gap: 2, children: [_jsx(Button, { ...args, size: "xs", children: "Extra Small" }), _jsx(Button, { ...args, size: "sm", children: "Small" }), _jsx(Button, { ...args, size: "default", children: "Default" }), _jsx(Button, { ...args, size: "lg", children: "Large" }), _jsx(Button, { ...args, size: "icon", children: _jsx(Box, { as: "span", className: "h-4 w-4", children: "\uD83D\uDE80" }) })] })),
|
|
73
76
|
};
|
|
74
77
|
export const States = {
|
|
75
|
-
render: (args) => (_jsxs(
|
|
78
|
+
render: (args) => (_jsxs(Flex, { wrap: "wrap", gap: 2, children: [_jsx(Button, { ...args, children: "Normal" }), _jsx(Button, { ...args, disabled: true, children: "Disabled" }), _jsx(Button, { ...args, isLoading: true, children: "Loading" })] })),
|
|
76
79
|
};
|
|
77
80
|
export const Shapes = {
|
|
78
|
-
render: (args) => (_jsxs(
|
|
81
|
+
render: (args) => (_jsxs(Flex, { wrap: "wrap", gap: 2, children: [_jsx(Button, { ...args, children: "Default" }), _jsx(Button, { ...args, rounded: true, children: "Rounded Pill" })] })),
|
|
79
82
|
};
|
|
80
83
|
export const FullWidth = {
|
|
81
84
|
args: {
|
|
@@ -87,7 +90,7 @@ export const FullWidth = {
|
|
|
87
90
|
},
|
|
88
91
|
};
|
|
89
92
|
export const LoadingSkeleton = {
|
|
90
|
-
render: () => (_jsxs(
|
|
93
|
+
render: () => (_jsxs(Flex, { wrap: "wrap", gap: 2, children: [_jsx(Skeleton, { className: "h-10 w-24 rounded-md" }), _jsx(Skeleton, { className: "h-10 w-32 rounded-md" }), _jsx(Skeleton, { className: "h-10 w-28 rounded-md" })] })),
|
|
91
94
|
parameters: {
|
|
92
95
|
docs: {
|
|
93
96
|
description: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronDown, Minus, Plus } from "lucide-react";
|
|
3
3
|
import { Button } from "../button";
|
|
4
|
-
import { Skeleton } from "../skeleton
|
|
4
|
+
import { Skeleton } from "../skeleton";
|
|
5
5
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, } from "./button-group";
|
|
6
6
|
const meta = {
|
|
7
7
|
title: "Buttons/ButtonGroup",
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
* Displays month header and calendar grid.
|
|
7
7
|
*/
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
|
-
import { Skeleton } from "../skeleton
|
|
9
|
+
import { Skeleton } from "../skeleton";
|
|
10
10
|
/**
|
|
11
11
|
* Calendar skeleton component
|
|
12
12
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type DayButton, DayPicker } from "react-day-picker";
|
|
3
|
-
import { Button } from "../button
|
|
3
|
+
import { Button } from "../button";
|
|
4
4
|
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
5
5
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
6
|
isLoading?: boolean;
|
|
@@ -4,7 +4,7 @@ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-reac
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { DayPicker, getDefaultClassNames, } from "react-day-picker";
|
|
6
6
|
import { cn } from "../../lib/utils";
|
|
7
|
-
import { Button, buttonVariants } from "../button
|
|
7
|
+
import { Button, buttonVariants } from "../button";
|
|
8
8
|
import { CalendarSkeleton } from "./calendar-skeleton";
|
|
9
9
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, isLoading = false, skeletonConfig, skeleton, ...props }) {
|
|
10
10
|
if (isLoading) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DayPicker } from "react-day-picker";
|
|
2
1
|
import type * as React from "react";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { DayPicker } from "react-day-picker";
|
|
3
|
+
import type { Button } from "../button";
|
|
4
|
+
import type { CalendarSkeletonConfig } from "./calendar-skeleton";
|
|
5
5
|
export type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
6
6
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
7
7
|
isLoading?: boolean;
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
* Provides zero-CLS skeleton states that match actual card layouts.
|
|
7
7
|
*/
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
|
-
import { Skeleton } from "../skeleton
|
|
9
|
+
import { Skeleton } from "../skeleton";
|
|
10
10
|
import { SkeletonText } from "../skeleton/skeleton-patterns";
|
|
11
11
|
/**
|
|
12
12
|
* Card skeleton component with multiple variants
|
|
@@ -19,7 +19,7 @@ import { SkeletonText } from "../skeleton/skeleton-patterns";
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export function CardSkeleton({ variant = "default", hasHeader = true, hasFooter = false, imagePosition = "top", contentRows = 3, showActions = false, className, "data-testid": dataTestId, }) {
|
|
22
|
-
return (_jsxs("div", { "data-testid": dataTestId || "card-skeleton", className: cn("rounded-md border bg-card overflow-hidden", className), children: [variant === "default" && (_jsx(DefaultCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withImage" && (_jsx(WithImageCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withImageTop" && (_jsx(WithImageTopCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "horizontal" && (_jsx(HorizontalCardSkeleton, { imagePosition: imagePosition, hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withFooter" && (_jsx(WithFooterCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, showActions: showActions })), variant === "minimal" && _jsx(MinimalCardSkeleton, { contentRows: contentRows })] }));
|
|
22
|
+
return (_jsxs("div", { "data-testid": dataTestId || "card-skeleton", className: cn("rounded-md border bg-card overflow-hidden", className), children: [variant === "default" && (_jsx(DefaultCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withImage" && (_jsx(WithImageCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withImageTop" && (_jsx(WithImageTopCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "horizontal" && (_jsx(HorizontalCardSkeleton, { imagePosition: imagePosition, hasHeader: hasHeader, contentRows: contentRows, hasFooter: hasFooter, showActions: showActions })), variant === "withFooter" && (_jsx(WithFooterCardSkeleton, { hasHeader: hasHeader, contentRows: contentRows, showActions: showActions })), variant === "minimal" && (_jsx(MinimalCardSkeleton, { contentRows: contentRows }))] }));
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Default variant: header + content rows
|
|
@@ -3,45 +3,48 @@ import * as React from "react";
|
|
|
3
3
|
import { cardStyles } from "../../config/card";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
import { CardSkeleton } from "./card-skeleton";
|
|
6
|
+
import { Box } from "../box";
|
|
7
|
+
import { Heading } from "../heading";
|
|
8
|
+
import { Text } from "../text";
|
|
6
9
|
const Card = React.forwardRef(({ className, isLoading = false, skeletonConfig, skeleton, children, ...props }, ref) => {
|
|
7
10
|
if (isLoading) {
|
|
8
11
|
if (skeleton) {
|
|
9
|
-
return (_jsx(
|
|
12
|
+
return (_jsx(Box, { ref: ref, className: cn(cardStyles.base, className), children: skeleton }));
|
|
10
13
|
}
|
|
11
14
|
return _jsx(CardSkeleton, { ...skeletonConfig });
|
|
12
15
|
}
|
|
13
|
-
return (_jsx(
|
|
16
|
+
return (_jsx(Box, { ref: ref, className: cn(cardStyles.base, className), ...props, children: children }));
|
|
14
17
|
});
|
|
15
18
|
Card.displayName = "Card";
|
|
16
19
|
function CardHeader({ className, ...props }) {
|
|
17
|
-
return _jsx(
|
|
20
|
+
return _jsx(Box, { className: cn(cardStyles.header, className), ...props });
|
|
18
21
|
}
|
|
19
22
|
function CardTitle({ className, ...props }) {
|
|
20
|
-
return _jsx("h5",
|
|
23
|
+
return _jsx(Heading, { as: "h5", className: cn(cardStyles.title, className), ...props });
|
|
21
24
|
}
|
|
22
25
|
function CardSubtitle({ className, ...props }) {
|
|
23
|
-
return _jsx("h6",
|
|
26
|
+
return _jsx(Heading, { as: "h6", className: cn(cardStyles.subtitle, className), ...props });
|
|
24
27
|
}
|
|
25
28
|
function CardDescription({ className, ...props }) {
|
|
26
|
-
return _jsx(
|
|
29
|
+
return _jsx(Text, { className: cn(cardStyles.description, className), ...props });
|
|
27
30
|
}
|
|
28
31
|
function CardAction({ className, ...props }) {
|
|
29
|
-
return _jsx(
|
|
32
|
+
return _jsx(Box, { className: cn("ml-auto", className), ...props });
|
|
30
33
|
}
|
|
31
34
|
function CardContent({ className, ...props }) {
|
|
32
|
-
return _jsx(
|
|
35
|
+
return _jsx(Box, { className: cn(cardStyles.content, className), ...props });
|
|
33
36
|
}
|
|
34
37
|
function CardFooter({ className, ...props }) {
|
|
35
|
-
return _jsx(
|
|
38
|
+
return _jsx(Box, { className: cn(cardStyles.footer, className), ...props });
|
|
36
39
|
}
|
|
37
40
|
function CardImage({ className, alt = "", ...props }) {
|
|
38
41
|
if (!alt) {
|
|
39
42
|
console.warn("CardImage: Missing alt text. Images should have descriptive alt text for accessibility.");
|
|
40
43
|
}
|
|
41
|
-
return (_jsx("img",
|
|
44
|
+
return (_jsx(Box, { as: "img", alt: alt, className: cn(cardStyles.image, className), ...props }));
|
|
42
45
|
}
|
|
43
46
|
function CardImageOverlay({ className, ...props }) {
|
|
44
|
-
return _jsx(
|
|
47
|
+
return _jsx(Box, { className: cn(cardStyles.overlay, className), ...props });
|
|
45
48
|
}
|
|
46
49
|
function CardMarker({ className, position = "top-left", variant = "default", color = "default", children, ...props }) {
|
|
47
50
|
const positionClasses = {
|
|
@@ -60,17 +63,17 @@ function CardMarker({ className, position = "top-left", variant = "default", col
|
|
|
60
63
|
};
|
|
61
64
|
// Base marker styles
|
|
62
65
|
if (variant === "default") {
|
|
63
|
-
return (_jsx(
|
|
66
|
+
return (_jsx(Box, { className: cn("absolute z-10 rounded px-2 py-1 text-xs font-semibold shadow-sm", positionClasses[position], colorClasses[color], className), ...props, children: children }));
|
|
64
67
|
}
|
|
65
68
|
// Icon marker - larger, rounded, typically just an icon
|
|
66
69
|
if (variant === "icon") {
|
|
67
|
-
return (_jsx(
|
|
70
|
+
return (_jsx(Box, { className: cn("absolute z-10 flex h-10 w-10 items-center justify-center rounded-full shadow-lg", position === "top-left" && "top-2 left-2", position === "top-right" && "top-2 right-2", position === "bottom-left" && "bottom-2 left-2", position === "bottom-right" && "bottom-2 right-2", colorClasses[color], className), ...props, children: children }));
|
|
68
71
|
}
|
|
69
72
|
// Ribbon marker - diagonal corner ribbon
|
|
70
73
|
if (variant === "ribbon") {
|
|
71
74
|
const ribbonPosition = position.startsWith("top") ? "top" : "bottom";
|
|
72
75
|
const ribbonSide = position.endsWith("left") ? "left" : "right";
|
|
73
|
-
return (_jsx(
|
|
76
|
+
return (_jsx(Box, { className: cn("absolute z-10 px-8 py-1 text-xs font-semibold shadow-lg", ribbonPosition === "top" &&
|
|
74
77
|
ribbonSide === "left" &&
|
|
75
78
|
"top-3 -left-8 -rotate-45 origin-top-left", ribbonPosition === "top" &&
|
|
76
79
|
ribbonSide === "right" &&
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardImage, CardImageOverlay, CardMarker, type CardMarkerProps, CardSubtitle, CardTitle,
|
|
1
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardImage, CardImageOverlay, CardMarker, type CardMarkerProps, type CardProps, CardSubtitle, CardTitle, } from "./card";
|
|
2
2
|
export { CardSkeleton } from "./card-skeleton";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CenterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const Center: React.ForwardRefExoticComponent<CenterProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Center };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
const Center = React.forwardRef(({ className, inline = false, asChild = false, ...props }, ref) => {
|
|
6
|
+
const Comp = asChild ? Slot : "div";
|
|
7
|
+
return (_jsx(Comp, { className: cn("flex items-center justify-center", inline ? "inline-flex" : "flex", className), ref: ref, ...props }));
|
|
8
|
+
});
|
|
9
|
+
Center.displayName = "Center";
|
|
10
|
+
export { Center };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Center } from "./center";
|
|
3
|
+
declare const meta: Meta<typeof Center>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Center>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Inline: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Center } from "./center";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: "Components/Center",
|
|
4
|
+
component: Center,
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
argTypes: {
|
|
7
|
+
inline: {
|
|
8
|
+
control: "boolean",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export const Default = {
|
|
14
|
+
args: {
|
|
15
|
+
className: "h-20 bg-primary/20 rounded",
|
|
16
|
+
children: "Centered content",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const Inline = {
|
|
20
|
+
args: {
|
|
21
|
+
inline: true,
|
|
22
|
+
className: "h-10 w-20 bg-primary/20 rounded",
|
|
23
|
+
children: "Inline",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./center";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./center";
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Chart } from "./chart";
|
|
10
|
-
import { getDefaultChartOptions } from "./utils";
|
|
11
10
|
import { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
11
|
+
import { getDefaultChartOptions } from "./utils";
|
|
12
12
|
export function AreaChart({ series, categories, colors, height = 350, width = "100%", className, title, subtitle, toolbar = false, animations = true, curve = "smooth", stacked = false, dataLabels = false, yAxisLabel, referenceLines = [], options: customOptions, }) {
|
|
13
13
|
const { colors: themeColors } = useThemeAwareChart();
|
|
14
14
|
const chartOptions = useMemo(() => {
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Chart } from "./chart";
|
|
10
|
-
import { getDefaultChartOptions } from "./utils";
|
|
11
10
|
import { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
11
|
+
import { getDefaultChartOptions } from "./utils";
|
|
12
12
|
export function BarChart({ series, categories, colors, height = 350, width = "100%", className, title, subtitle, toolbar = false, animations = true, horizontal = false, stacked = false, dataLabels = false, barWidth = 70, options: customOptions, }) {
|
|
13
13
|
const { colors: themeColors } = useThemeAwareChart();
|
|
14
14
|
const chartOptions = useMemo(() => {
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Chart } from "./chart";
|
|
10
|
-
import { getDefaultChartOptions } from "./utils";
|
|
11
10
|
import { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
11
|
+
import { getDefaultChartOptions } from "./utils";
|
|
12
12
|
export function DonutChart({ series, labels, colors, height = 350, width = "100%", className, title, subtitle, animations = true, donut = true, donutSize = 65, dataLabels = true, legend = true, options: customOptions, }) {
|
|
13
13
|
const { colors: themeColors } = useThemeAwareChart();
|
|
14
14
|
const chartOptions = useMemo(() => {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
export { AreaChart } from "./area-chart";
|
|
6
6
|
export { BarChart } from "./bar-chart";
|
|
7
7
|
export { Chart, ChartSkeleton } from "./chart";
|
|
8
|
+
export * from "./chart.types";
|
|
8
9
|
export { DonutChart, PieChart } from "./donut-chart";
|
|
9
10
|
export { LineChart } from "./line-chart";
|
|
10
11
|
export { RadialBarChart } from "./radial-bar-chart";
|
|
11
|
-
export * from "./chart.types";
|
|
12
|
-
export * from "./utils";
|
|
13
12
|
export * from "./theme-utils";
|
|
14
13
|
export { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
14
|
+
export * from "./utils";
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
export { AreaChart } from "./area-chart";
|
|
6
6
|
export { BarChart } from "./bar-chart";
|
|
7
7
|
export { Chart, ChartSkeleton } from "./chart";
|
|
8
|
+
export * from "./chart.types";
|
|
8
9
|
export { DonutChart, PieChart } from "./donut-chart";
|
|
9
10
|
export { LineChart } from "./line-chart";
|
|
10
11
|
export { RadialBarChart } from "./radial-bar-chart";
|
|
11
|
-
export * from "./chart.types";
|
|
12
|
-
export * from "./utils";
|
|
13
12
|
export * from "./theme-utils";
|
|
14
13
|
export { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
14
|
+
export * from "./utils";
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Chart } from "./chart";
|
|
10
|
-
import { getDefaultChartOptions } from "./utils";
|
|
11
10
|
import { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
11
|
+
import { getDefaultChartOptions } from "./utils";
|
|
12
12
|
export function LineChart({ series, categories, colors, height = 350, width = "100%", className, title, subtitle, toolbar = false, animations = true, curve = "smooth", strokeWidth = 2, markers = true, yAxisLabel, options: customOptions, }) {
|
|
13
13
|
const { colors: themeColors } = useThemeAwareChart();
|
|
14
14
|
const chartOptions = useMemo(() => {
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useMemo } from "react";
|
|
8
8
|
import { cn } from "../../lib/utils";
|
|
9
9
|
import { Chart } from "./chart";
|
|
10
|
-
import { getDefaultChartOptions } from "./utils";
|
|
11
10
|
import { useThemeAwareChart } from "./use-theme-aware-chart";
|
|
11
|
+
import { getDefaultChartOptions } from "./utils";
|
|
12
12
|
export function RadialBarChart({ series, labels, colors, height = 350, width = "100%", className, title, subtitle, animations = true, dataLabels = true, hollowSize = "50%", options: customOptions, }) {
|
|
13
13
|
const { colors: themeColors } = useThemeAwareChart();
|
|
14
14
|
const chartOptions = useMemo(() => {
|