@eintrek/erp-theme 1.0.1 → 1.0.3
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/command-block.d.ts +3 -0
- package/dist/components/data-table/data-table-action-bar.d.ts +20 -0
- package/dist/components/data-table/data-table-advanced-toolbar.d.ts +7 -0
- package/dist/components/data-table/data-table-column-header.d.ts +8 -0
- package/dist/components/data-table/data-table-date-filter.d.ts +8 -0
- package/dist/components/data-table/data-table-faceted-filter.d.ts +10 -0
- package/dist/components/data-table/data-table-filter-list.d.ts +11 -0
- package/dist/components/data-table/data-table-filter-menu.d.ts +11 -0
- package/dist/components/data-table/data-table-pagination.d.ts +7 -0
- package/dist/components/data-table/data-table-range-filter.d.ts +11 -0
- package/dist/components/data-table/data-table-skeleton.d.ts +11 -0
- package/dist/components/data-table/data-table-slider-filter.d.ts +7 -0
- package/dist/components/data-table/data-table-sort-list.d.ts +8 -0
- package/dist/components/data-table/data-table-toolbar.d.ts +7 -0
- package/dist/components/data-table/data-table-view-options.d.ts +6 -0
- package/dist/components/data-table/data-table.d.ts +8 -0
- package/dist/components/footer.d.ts +1 -0
- package/dist/components/header.d.ts +1 -0
- package/dist/components/registry_item_row.d.ts +10 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +14 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/chart.d.ts +40 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/context-menu.d.ts +25 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/drawer.d.ts +13 -0
- package/dist/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/faceted.d.ts +33 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +26 -0
- package/dist/components/ui/navigation-menu.d.ts +14 -0
- package/dist/components/ui/pagination.d.ts +13 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +13 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sortable.d.ts +53 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle-group.d.ts +7 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/config/data-table.d.ts +124 -0
- package/dist/config/flag.d.ts +16 -0
- package/dist/config/site.d.ts +9 -0
- package/dist/hooks/use-callback-ref.d.ts +9 -0
- package/dist/hooks/use-data-table.d.ts +23 -0
- package/dist/hooks/use-debounced-callback.d.ts +4 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +65 -8
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +47738 -10309
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +48034 -10354
- package/dist/index.js.map +1 -1
- package/dist/lib/composition.d.ts +23 -0
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/data-table.d.ts +12 -0
- package/dist/lib/export.d.ts +6 -0
- package/dist/lib/filter-columns.d.ts +8 -0
- package/dist/lib/fonts.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/handle-error.d.ts +1 -0
- package/dist/lib/id.d.ts +7 -0
- package/dist/lib/parsers.d.ts +25 -0
- package/dist/lib/unstable-cache.d.ts +10 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/registry/alert.stories.d.ts +34 -0
- package/dist/registry/aspect-ratio.stories.d.ts +24 -0
- package/dist/registry/badge.stories.d.ts +42 -0
- package/dist/registry/breadcrumb.stories.d.ts +26 -0
- package/dist/registry/button.stories.d.ts +82 -0
- package/dist/registry/calendar.stories.d.ts +43 -0
- package/dist/registry/card.stories.d.ts +24 -0
- package/dist/registry/carousel.stories.d.ts +17 -0
- package/dist/registry/chart.stories.d.ts +32 -0
- package/dist/registry/checkbox.stories.d.ts +17 -0
- package/dist/registry/command.stories.d.ts +41 -0
- package/dist/registry/data-table.stories.d.ts +59 -0
- package/dist/registry/date-picker.stories.d.ts +32 -0
- package/dist/registry/drawer.stories.d.ts +27 -0
- package/dist/registry/form.stories.d.ts +14 -0
- package/dist/registry/input-otp.stories.d.ts +41 -0
- package/dist/registry/input.stories.d.ts +47 -0
- package/dist/registry/label.stories.d.ts +27 -0
- package/dist/registry/pagination.stories.d.ts +91 -0
- package/dist/registry/progress.stories.d.ts +31 -0
- package/dist/registry/resizable.stories.d.ts +12 -0
- package/dist/registry/scroll-area.stories.d.ts +41 -0
- package/dist/registry/select.stories.d.ts +13 -0
- package/dist/registry/separator.stories.d.ts +21 -0
- package/dist/registry/sheet.stories.d.ts +16 -0
- package/dist/registry/sidebar.stories.d.ts +336 -0
- package/dist/registry/skeleton.stories.d.ts +20 -0
- package/dist/registry/slider.stories.d.ts +30 -0
- package/dist/registry/sonner.stories.d.ts +14 -0
- package/dist/registry/table.stories.d.ts +104 -0
- package/dist/registry/textarea.stories.d.ts +40 -0
- package/dist/registry/toggle.stories.d.ts +35 -0
- package/dist/registry/tokens/color.stories.d.ts +23 -0
- package/dist/registry/tokens/radius.stories.d.ts +17 -0
- package/dist/registry/tokens/typography.stories.d.ts +28 -0
- package/dist/registry/tooltip.stories.d.ts +26 -0
- package/dist/types/data-table.d.ts +33 -0
- package/dist/types/doc.d.ts +195 -0
- package/dist/types/index.d.ts +26 -0
- package/package.json +53 -40
- package/dist/components/ui/Buttons.d.ts +0 -15
- package/dist/components/ui/Buttons.stories.d.ts +0 -25
- package/dist/components/ui/Cards.d.ts +0 -8
- package/dist/components/ui/Cards.stories.d.ts +0 -8
- package/dist/components/ui/Form.d.ts +0 -25
- package/dist/components/ui/Form.stories.d.ts +0 -8
- package/dist/components/ui/Input.d.ts +0 -17
- package/dist/components/ui/Input.stories.d.ts +0 -10
- package/dist/components/ui/InputDropdown.d.ts +0 -19
- package/dist/components/ui/InputDropdown.stories.d.ts +0 -9
- package/dist/components/ui/Label.d.ts +0 -8
- package/dist/components/ui/Label.stories.d.ts +0 -8
- package/dist/components/ui/Modal.d.ts +0 -12
- package/dist/components/ui/Modal.stories.d.ts +0 -13
- package/dist/components/ui/table/Table.d.ts +0 -6
- package/dist/components/ui/table/Table.stories.d.ts +0 -6
- package/dist/components/ui/table/TableBody.d.ts +0 -3
- package/dist/components/ui/table/TableBody.stories.d.ts +0 -7
- package/dist/components/ui/table/TableFilter.d.ts +0 -3
- package/dist/components/ui/table/TableFilter.stories.d.ts +0 -6
- package/dist/components/ui/table/TablePagination.d.ts +0 -10
- package/dist/components/ui/table/TablePagination.stories.d.ts +0 -6
- package/dist/components/ui/table/index.d.ts +0 -13
- package/dist/components/ui/table/types.d.ts +0 -54
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A utility to compose multiple event handlers into a single event handler.
|
|
4
|
+
* Call originalEventHandler first, then ourEventHandler unless prevented.
|
|
5
|
+
*/
|
|
6
|
+
declare function composeEventHandlers<E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
7
|
+
checkForDefaultPrevented?: boolean | undefined;
|
|
8
|
+
}): (event: E) => void;
|
|
9
|
+
/**
|
|
10
|
+
* @see https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
|
|
11
|
+
*/
|
|
12
|
+
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A utility to compose multiple refs together.
|
|
15
|
+
* Accepts callback refs and RefObject(s).
|
|
16
|
+
*/
|
|
17
|
+
declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
18
|
+
/**
|
|
19
|
+
* A custom hook that composes multiple refs.
|
|
20
|
+
* Accepts callback refs and RefObject(s).
|
|
21
|
+
*/
|
|
22
|
+
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
23
|
+
export { composeEventHandlers, composeRefs, useComposedRefs };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExtendedColumnFilter, FilterOperator, FilterVariant } from "@/types/data-table";
|
|
2
|
+
import type { Column } from "@tanstack/react-table";
|
|
3
|
+
export declare function getCommonPinningStyles<TData>({ column, withBorder, }: {
|
|
4
|
+
column: Column<TData>;
|
|
5
|
+
withBorder?: boolean;
|
|
6
|
+
}): React.CSSProperties;
|
|
7
|
+
export declare function getFilterOperators(filterVariant: FilterVariant): {
|
|
8
|
+
label: string;
|
|
9
|
+
value: FilterOperator;
|
|
10
|
+
}[];
|
|
11
|
+
export declare function getDefaultFilterOperator(filterVariant: FilterVariant): "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
12
|
+
export declare function getValidFilters<TData>(filters: ExtendedColumnFilter<TData>[]): ExtendedColumnFilter<TData>[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ExtendedColumnFilter, JoinOperator } from "@/types/data-table";
|
|
2
|
+
import { type AnyColumn, type SQL, type Table } from "drizzle-orm";
|
|
3
|
+
export declare function filterColumns<T extends Table>({ table, filters, joinOperator, }: {
|
|
4
|
+
table: T;
|
|
5
|
+
filters: ExtendedColumnFilter<T>[];
|
|
6
|
+
joinOperator: JoinOperator;
|
|
7
|
+
}): SQL | undefined;
|
|
8
|
+
export declare function getColumn<T extends Table>(table: T, columnKey: keyof T): AnyColumn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatDate(date: Date | string | number | undefined, opts?: Intl.DateTimeFormatOptions): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getErrorMessage(err: unknown): string;
|
package/dist/lib/id.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const prefixes: Record<string, unknown>;
|
|
2
|
+
interface GenerateIdOptions {
|
|
3
|
+
length?: number;
|
|
4
|
+
separator?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateId(prefixOrOptions?: keyof typeof prefixes | GenerateIdOptions, inputOptions?: GenerateIdOptions): string;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ExtendedColumnFilter, ExtendedColumnSort } from "@/types/data-table";
|
|
3
|
+
export declare const getSortingStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs").ParserBuilder<ExtendedColumnSort<TData>[]>;
|
|
4
|
+
declare const filterItemSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
7
|
+
variant: z.ZodEnum<["text", "number", "range", "date", "dateRange", "boolean", "select", "multiSelect"]>;
|
|
8
|
+
operator: z.ZodEnum<["iLike", "notILike", "eq", "ne", "inArray", "notInArray", "isEmpty", "isNotEmpty", "lt", "lte", "gt", "gte", "isBetween", "isRelativeToToday"]>;
|
|
9
|
+
filterId: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
id: string;
|
|
12
|
+
value: string | string[];
|
|
13
|
+
operator: "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
14
|
+
variant: "number" | "boolean" | "select" | "text" | "date" | "range" | "dateRange" | "multiSelect";
|
|
15
|
+
filterId: string;
|
|
16
|
+
}, {
|
|
17
|
+
id: string;
|
|
18
|
+
value: string | string[];
|
|
19
|
+
operator: "iLike" | "notILike" | "eq" | "ne" | "isEmpty" | "isNotEmpty" | "lt" | "lte" | "gt" | "gte" | "isBetween" | "isRelativeToToday" | "inArray" | "notInArray";
|
|
20
|
+
variant: "number" | "boolean" | "select" | "text" | "date" | "range" | "dateRange" | "multiSelect";
|
|
21
|
+
filterId: string;
|
|
22
|
+
}>;
|
|
23
|
+
export type FilterItemSchema = z.infer<typeof filterItemSchema>;
|
|
24
|
+
export declare const getFiltersStateParser: <TData>(columnIds?: string[] | Set<string>) => import("nuqs").ParserBuilder<ExtendedColumnFilter<TData>[]>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://github.com/ethanniser/NextMaster/blob/main/src/lib/unstable-cache.ts
|
|
3
|
+
*/
|
|
4
|
+
export declare const unstable_cache: <Inputs extends unknown[], Output>(cb: (...args: Inputs) => Promise<Output>, keyParts: string[], options?: {
|
|
5
|
+
/**
|
|
6
|
+
* The revalidation interval in seconds.
|
|
7
|
+
*/
|
|
8
|
+
revalidate?: number | false;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
}) => (...args: Inputs) => Promise<Output>;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Alert } from "@/components/ui/alert";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a callout for user attention.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Alert;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
variant: {
|
|
12
|
+
options: string[];
|
|
13
|
+
control: {
|
|
14
|
+
type: "radio";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
args: {
|
|
19
|
+
variant: "default";
|
|
20
|
+
};
|
|
21
|
+
render: (args: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("class-variance-authority").VariantProps<(props?: ({
|
|
22
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
/**
|
|
28
|
+
* The default form of the alert.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Default: Story;
|
|
31
|
+
/**
|
|
32
|
+
* Use the `destructive` alert to indicate a destructive action.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Destructive: Story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { AspectRatio } from "@/components/ui/aspect-ratio";
|
|
3
|
+
/**
|
|
4
|
+
* Displays content within a desired ratio.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof AspectRatio>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
/**
|
|
10
|
+
* The default form of the aspect ratio.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Use the `1:1` aspect ratio to display a square image.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Square: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Use the `4:3` aspect ratio to display a landscape image.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Landscape: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Use the `2.35:1` aspect ratio to display a cinemascope image.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Cinemascope: Story;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Badge } from "@/components/ui/badge";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a badge or a component that looks like a badge.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Badge;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "text";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: {
|
|
16
|
+
children: string;
|
|
17
|
+
};
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
/**
|
|
25
|
+
* The default form of the badge.
|
|
26
|
+
*/
|
|
27
|
+
export declare const Default: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Use the `secondary` badge to call for less urgent information, blending
|
|
30
|
+
* into the interface while still signaling minor updates or statuses.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Secondary: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Use the `destructive` badge to indicate errors, alerts, or the need for
|
|
35
|
+
* immediate attention.
|
|
36
|
+
*/
|
|
37
|
+
export declare const Destructive: Story;
|
|
38
|
+
/**
|
|
39
|
+
* Use the `outline` badge for overlaying without obscuring interface details,
|
|
40
|
+
* emphasizing clarity and subtlety..
|
|
41
|
+
*/
|
|
42
|
+
export declare const Outline: Story;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Breadcrumb } from "@/components/ui/breadcrumb";
|
|
3
|
+
/**
|
|
4
|
+
* Displays the path to the current resource using a hierarchy of links.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Breadcrumb;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {};
|
|
12
|
+
render: (args: import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
/**
|
|
20
|
+
* Displays the path of links to the current resource.
|
|
21
|
+
*/
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Displays the path with a custom icon for the separator.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WithCustomSeparator: Story;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a button or a component that looks like a button.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Button;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "text";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: string;
|
|
17
|
+
};
|
|
18
|
+
args: {
|
|
19
|
+
variant: "default";
|
|
20
|
+
size: "default";
|
|
21
|
+
children: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
/**
|
|
27
|
+
* The default form of the button, used for primary actions and commands.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Default: Story;
|
|
30
|
+
/**
|
|
31
|
+
* Use the `outline` button to reduce emphasis on secondary actions, such as
|
|
32
|
+
* canceling or dismissing a dialog.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Outline: Story;
|
|
35
|
+
/**
|
|
36
|
+
* Use the `ghost` button is minimalistic and subtle, for less intrusive
|
|
37
|
+
* actions.
|
|
38
|
+
*/
|
|
39
|
+
export declare const Ghost: Story;
|
|
40
|
+
/**
|
|
41
|
+
* Use the `secondary` button to call for less emphasized actions, styled to
|
|
42
|
+
* complement the primary button while being less conspicuous.
|
|
43
|
+
*/
|
|
44
|
+
export declare const Secondary: Story;
|
|
45
|
+
/**
|
|
46
|
+
* Use the `destructive` button to indicate errors, alerts, or the need for
|
|
47
|
+
* immediate attention.
|
|
48
|
+
*/
|
|
49
|
+
export declare const Destructive: Story;
|
|
50
|
+
/**
|
|
51
|
+
* Use the `link` button to reduce emphasis on tertiary actions, such as
|
|
52
|
+
* hyperlink or navigation, providing a text-only interactive element.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Link: Story;
|
|
55
|
+
/**
|
|
56
|
+
* Add the `disabled` prop to a button to prevent interactions and add a
|
|
57
|
+
* loading indicator, such as a spinner, to signify an in-progress action.
|
|
58
|
+
*/
|
|
59
|
+
export declare const Loading: Story;
|
|
60
|
+
/**
|
|
61
|
+
* Add an icon element to a button to enhance visual communication and
|
|
62
|
+
* providing additional context for the action.
|
|
63
|
+
*/
|
|
64
|
+
export declare const WithIcon: Story;
|
|
65
|
+
/**
|
|
66
|
+
* Use the `sm` size for a smaller button, suitable for interfaces needing
|
|
67
|
+
* compact elements without sacrificing usability.
|
|
68
|
+
*/
|
|
69
|
+
export declare const Small: Story;
|
|
70
|
+
/**
|
|
71
|
+
* Use the `lg` size for a larger button, offering better visibility and
|
|
72
|
+
* easier interaction for users.
|
|
73
|
+
*/
|
|
74
|
+
export declare const Large: Story;
|
|
75
|
+
/**
|
|
76
|
+
* Use the "icon" size for a button with only an icon.
|
|
77
|
+
*/
|
|
78
|
+
export declare const Icon: Story;
|
|
79
|
+
/**
|
|
80
|
+
* Add the `disabled` prop to prevent interactions with the button.
|
|
81
|
+
*/
|
|
82
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Calendar } from "@/components/ui/calendar";
|
|
3
|
+
/**
|
|
4
|
+
* A date field component that allows users to enter and edit date.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Calendar;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
mode: "single";
|
|
13
|
+
selected: Date;
|
|
14
|
+
onSelect: import("storybook/internal/actions").HandlerFunction;
|
|
15
|
+
className: string;
|
|
16
|
+
};
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
/**
|
|
24
|
+
* The default form of the calendar.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Default: Story;
|
|
27
|
+
/**
|
|
28
|
+
* Use the `multiple` mode to select multiple dates.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Multiple: Story;
|
|
31
|
+
/**
|
|
32
|
+
* Use the `range` mode to select a range of dates.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Range: Story;
|
|
35
|
+
/**
|
|
36
|
+
* Use the `disabled` prop to disable specific dates.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Disabled: Story;
|
|
39
|
+
/**
|
|
40
|
+
* Use the `numberOfMonths` prop to display multiple months.
|
|
41
|
+
*/
|
|
42
|
+
export declare const MultipleMonths: Story;
|
|
43
|
+
export declare const ShouldChangeMonths: Story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Card } from "@/components/ui/card";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a card with header, content, and footer.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Card;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
className: string;
|
|
13
|
+
};
|
|
14
|
+
render: (args: import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
/**
|
|
22
|
+
* The default form of the card.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Carousel } from "@/components/ui/carousel";
|
|
3
|
+
/**
|
|
4
|
+
* A carousel with motion and swipe built using Embla.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Carousel>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
/**
|
|
10
|
+
* The default form of the carousel.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Use the `basis` utility class to change the size of the carousel.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Size: Story;
|
|
17
|
+
export declare const ShouldNavigate: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { ChartContainer } from "@/components/ui/chart";
|
|
3
|
+
/**
|
|
4
|
+
* Beautiful charts. Built using Recharts. Copy and paste into your apps.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof ChartContainer;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
children: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
/**
|
|
18
|
+
* Combine multiple Area components to create a stacked area chart.
|
|
19
|
+
*/
|
|
20
|
+
export declare const StackedAreaChart: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Combine multiple Bar components to create a stacked bar chart.
|
|
23
|
+
*/
|
|
24
|
+
export declare const StackedBarChart: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Combine multiple Line components to create a single line chart.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MultiLineChart: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Combine Pie and Label components to create a doughnut chart.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DoughnutChart: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
3
|
+
/**
|
|
4
|
+
* A control that allows the user to toggle between checked and not checked.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
/**
|
|
10
|
+
* The default form of the checkbox.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
/**
|
|
14
|
+
* Use the `disabled` prop to disable the checkbox.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Disabled: Story;
|
|
17
|
+
export declare const ShouldToggleCheck: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Command } from "@/components/ui/command";
|
|
3
|
+
/**
|
|
4
|
+
* Fast, composable, unstyled command menu for React.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Command;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
className: string;
|
|
13
|
+
};
|
|
14
|
+
render: (args: {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
} & {
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
}, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
21
|
+
label?: string;
|
|
22
|
+
shouldFilter?: boolean;
|
|
23
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
onValueChange?: (value: string) => void;
|
|
27
|
+
loop?: boolean;
|
|
28
|
+
disablePointerSelection?: boolean;
|
|
29
|
+
vimBindings?: boolean;
|
|
30
|
+
} & import("react").RefAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
parameters: {
|
|
32
|
+
layout: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
/**
|
|
38
|
+
* The default form of the command.
|
|
39
|
+
*/
|
|
40
|
+
export declare const Default: Story;
|
|
41
|
+
export declare const TypingInCombobox: Story;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import type { Supplier } from "@/types";
|
|
3
|
+
interface DataTableStoryArgs {
|
|
4
|
+
enableAdvancedFilter?: boolean;
|
|
5
|
+
filterFlag?: "advancedFilters" | "filterMenu";
|
|
6
|
+
showActionBar?: boolean;
|
|
7
|
+
data?: Supplier[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ต้องเขียนเชื่อมกับ API ด้วยเพื่อที่จะดึงข้อมูลมาแสดงในตาราง.
|
|
11
|
+
*
|
|
12
|
+
* ตัวอย่างตรงนี้คือแสดงแค่หน้าตาเฉยๆ ของตาราง ไม่มีการเชื่อมกับ API จริง ต้องไปเขียนเชื่อม api ด้วยเองในฝั่งfrontend
|
|
13
|
+
*/
|
|
14
|
+
declare const meta: {
|
|
15
|
+
title: string;
|
|
16
|
+
tags: string[];
|
|
17
|
+
argTypes: {
|
|
18
|
+
enableAdvancedFilter: {
|
|
19
|
+
control: "boolean";
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
filterFlag: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "select";
|
|
25
|
+
};
|
|
26
|
+
options: string[];
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
showActionBar: {
|
|
30
|
+
control: "boolean";
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
parameters: {
|
|
35
|
+
layout: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
type Story = StoryObj<DataTableStoryArgs>;
|
|
40
|
+
/**
|
|
41
|
+
* DataTable with advanced filtering, sorting, and toolbar features.
|
|
42
|
+
*/
|
|
43
|
+
export declare const AdvancedFilter: Story;
|
|
44
|
+
/**
|
|
45
|
+
* DataTable with simple toolbar - basic filtering and sorting.
|
|
46
|
+
*/
|
|
47
|
+
export declare const SimpleToolbar: Story;
|
|
48
|
+
/**
|
|
49
|
+
* Minimal DataTable without any toolbars - just the table with data.
|
|
50
|
+
*/
|
|
51
|
+
export declare const Minimal: Story;
|
|
52
|
+
/**
|
|
53
|
+
* DataTable with filter menu instead of advanced filters.
|
|
54
|
+
*/
|
|
55
|
+
export declare const FilterMenu: Story;
|
|
56
|
+
/**
|
|
57
|
+
* Empty state - DataTable with no data.
|
|
58
|
+
*/
|
|
59
|
+
export declare const EmptyState: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Calendar } from "@/components/ui/calendar";
|
|
3
|
+
/**
|
|
4
|
+
* A window overlaid on either the primary window or another dialog window,
|
|
5
|
+
* rendering the content underneath inert.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: {
|
|
8
|
+
title: string;
|
|
9
|
+
component: typeof Calendar;
|
|
10
|
+
tags: string[];
|
|
11
|
+
argTypes: {};
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
/**
|
|
19
|
+
* Combination of the calendar and a button that opens a popover.
|
|
20
|
+
*/
|
|
21
|
+
export declare const WithPopover: Story;
|
|
22
|
+
export declare const ShouldOpenPopover: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Combination of the calendar and an input field that allows typing a date.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WithInput: Story;
|
|
27
|
+
export declare const ShouldEnterTextDate: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Combination of the calendar and an input field that allows changing the time.
|
|
30
|
+
*/
|
|
31
|
+
export declare const WithDateTime: Story;
|
|
32
|
+
export declare const ShouldOpenCalendar: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Drawer } from "@/components/ui/drawer";
|
|
3
|
+
/**
|
|
4
|
+
* A drawer component for React.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: typeof Drawer;
|
|
9
|
+
tags: string[];
|
|
10
|
+
args: {
|
|
11
|
+
onOpenChange: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
12
|
+
onClose: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
13
|
+
onAnimationEnd: import("storybook/internal/test").Mock<(...args: any[]) => any>;
|
|
14
|
+
};
|
|
15
|
+
render: (args: import("vaul").DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
/**
|
|
23
|
+
* The default form of the drawer.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Default: Story;
|
|
26
|
+
export declare const ShouldOpenCloseWithSubmit: Story;
|
|
27
|
+
export declare const ShouldOpenCloseWithCancel: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Form } from "@/components/ui/form";
|
|
3
|
+
/**
|
|
4
|
+
* Building forms with React Hook Form and Zod.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<typeof Form>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
/**
|
|
10
|
+
* The default form of the form.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const ShouldSucceedOnSubmit: Story;
|
|
14
|
+
export declare const ShouldWarnOnSubmit: Story;
|