@lerianstudio/sindarian-ui 1.0.0-beta.3 → 1.0.0-beta.30
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/breadcrumb/index.js +2 -2
- package/dist/components/card/account-card/index.d.ts +32 -0
- package/dist/components/card/account-card/index.d.ts.map +1 -0
- package/dist/components/card/account-card/index.js +69 -0
- package/dist/components/card/basic-card/index.d.ts +6 -0
- package/dist/components/card/basic-card/index.d.ts.map +1 -0
- package/dist/components/card/basic-card/index.js +20 -0
- package/dist/components/card/dashboard-card/index.d.ts +5 -0
- package/dist/components/card/dashboard-card/index.d.ts.map +1 -0
- package/dist/components/card/dashboard-card/index.js +20 -0
- package/dist/components/card/entity-card/index.d.ts +21 -0
- package/dist/components/card/entity-card/index.d.ts.map +1 -0
- package/dist/components/card/entity-card/index.js +60 -0
- package/dist/components/card/index.d.ts +5 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js +20 -0
- package/dist/components/dialog/confirmation-dialog/index.d.ts +15 -0
- package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/confirmation-dialog/index.js +28 -0
- package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts +31 -0
- package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts.map +1 -0
- package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.js +55 -0
- package/dist/components/dialog/index.d.ts +4 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/index.js +19 -0
- package/dist/components/dialog/large-dialog/index.d.ts +11 -0
- package/dist/components/dialog/large-dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/large-dialog/index.js +21 -0
- package/dist/components/form/date-picker-field/index.d.ts +19 -0
- package/dist/components/form/date-picker-field/index.d.ts.map +1 -0
- package/dist/components/form/date-picker-field/index.js +22 -0
- package/dist/components/form/date-range-field/index.d.ts +20 -0
- package/dist/components/form/date-range-field/index.d.ts.map +1 -0
- package/dist/components/form/date-range-field/index.js +22 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +2 -0
- package/dist/components/form/input-field/index.d.ts +4 -1
- package/dist/components/form/input-field/index.d.ts.map +1 -1
- package/dist/components/form/input-field/index.js +3 -3
- package/dist/components/form/pagination-limit-field/index.d.ts +2 -1
- package/dist/components/form/pagination-limit-field/index.d.ts.map +1 -1
- package/dist/components/form/pagination-limit-field/index.js +2 -2
- package/dist/components/form/password-field/index.d.ts +5 -4
- package/dist/components/form/password-field/index.d.ts.map +1 -1
- package/dist/components/form/password-field/index.js +8 -7
- package/dist/components/form/select-field/index.d.ts +1 -0
- package/dist/components/form/select-field/index.d.ts.map +1 -1
- package/dist/components/form/select-field/index.js +1 -1
- package/dist/components/form/switch-field/index.d.ts +2 -1
- package/dist/components/form/switch-field/index.d.ts.map +1 -1
- package/dist/components/form/switch-field/index.js +2 -2
- package/dist/components/page/index.d.ts.map +1 -1
- package/dist/components/page/index.js +3 -3
- package/dist/components/page-header/index.d.ts.map +1 -1
- package/dist/components/page-header/index.js +6 -4
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/table/id-table-cell.d.ts +3 -2
- package/dist/components/table/id-table-cell.d.ts.map +1 -1
- package/dist/components/table/id-table-cell.js +2 -2
- package/dist/components/table/locked-table-actions.js +1 -1
- package/dist/components/ui/alert/index.d.ts +5 -1
- package/dist/components/ui/alert/index.d.ts.map +1 -1
- package/dist/components/ui/alert/index.js +22 -8
- package/dist/components/ui/alert/styles.css +68 -0
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/index.js +5 -5
- package/dist/components/ui/breadcrumb/styles.css +27 -0
- package/dist/components/ui/button/index.d.ts +8 -3
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/button/index.js +21 -29
- package/dist/components/ui/button/styles.css +64 -0
- package/dist/components/ui/calendar/index.d.ts +9 -0
- package/dist/components/ui/calendar/index.d.ts.map +1 -0
- package/dist/components/ui/calendar/index.js +115 -0
- package/dist/components/ui/card/index.js +1 -1
- package/dist/components/ui/command/index.d.ts +1 -1
- package/dist/components/ui/command/index.d.ts.map +1 -1
- package/dist/components/ui/command/index.js +52 -2
- package/dist/components/ui/dialog/index.d.ts.map +1 -1
- package/dist/components/ui/dialog/index.js +6 -6
- package/dist/components/ui/dialog/styles.css +34 -0
- package/dist/components/ui/field/index.d.ts +25 -0
- package/dist/components/ui/field/index.d.ts.map +1 -0
- package/dist/components/ui/field/index.js +79 -0
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +1 -0
- package/dist/components/ui/icon-button/index.d.ts +13 -0
- package/dist/components/ui/icon-button/index.d.ts.map +1 -0
- package/dist/components/ui/icon-button/index.js +35 -0
- package/dist/components/ui/icon-button/styles.css +33 -0
- package/dist/components/ui/input/adornment.d.ts +9 -0
- package/dist/components/ui/input/adornment.d.ts.map +1 -0
- package/dist/components/ui/input/adornment.js +21 -0
- package/dist/components/ui/input/index.d.ts +16 -2
- package/dist/components/ui/input/index.d.ts.map +1 -1
- package/dist/components/ui/input/index.js +90 -2
- package/dist/components/ui/input/styles.css +68 -0
- package/dist/components/ui/multiple-select/index.d.ts +6 -6
- package/dist/components/ui/paper-collapsible/index.d.ts +9 -0
- package/dist/components/ui/paper-collapsible/index.d.ts.map +1 -0
- package/dist/components/ui/paper-collapsible/index.js +24 -0
- package/dist/components/ui/progress/index.d.ts +1 -1
- package/dist/components/ui/progress/index.d.ts.map +1 -1
- package/dist/components/ui/select/index.d.ts +1 -2
- package/dist/components/ui/select/index.d.ts.map +1 -1
- package/dist/components/ui/select/index.js +9 -18
- package/dist/components/ui/select/styles.css +57 -0
- package/dist/components/ui/sidebar/index.d.ts +10 -0
- package/dist/components/ui/sidebar/index.d.ts.map +1 -0
- package/dist/components/ui/sidebar/index.js +25 -0
- package/dist/components/ui/sidebar/sidebar-back-button.d.ts +3 -0
- package/dist/components/ui/sidebar/sidebar-back-button.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-back-button.js +8 -0
- package/dist/components/ui/sidebar/sidebar-components.d.ts +23 -0
- package/dist/components/ui/sidebar/sidebar-components.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-components.js +23 -0
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +6 -0
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-expand-button.js +19 -0
- package/dist/components/ui/sidebar/sidebar-item-button.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-item-button.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item-button.js +23 -0
- package/dist/components/ui/sidebar/sidebar-item-collapsible.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-item-collapsible.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item-collapsible.js +52 -0
- package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item-icon-button.js +20 -0
- package/dist/components/ui/sidebar/sidebar-item.d.ts +13 -0
- package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-item.js +19 -0
- package/dist/components/ui/sidebar/sidebar-provider.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-provider.js +59 -0
- package/dist/components/ui/sidebar/sidebar-provider.test.d.ts +2 -0
- package/dist/components/ui/sidebar/sidebar-provider.test.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-provider.test.js +167 -0
- package/dist/components/ui/sidebar/sidebar-root.d.ts +3 -0
- package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-root.js +24 -0
- package/dist/components/ui/stepper/index.d.ts.map +1 -1
- package/dist/components/ui/stepper/index.js +4 -4
- package/dist/components/ui/stepper/styles.css +41 -0
- package/dist/components/ui/tabs/index.d.ts.map +1 -1
- package/dist/components/ui/tabs/index.js +4 -4
- package/dist/components/ui/tabs/styles.css +31 -0
- package/dist/components/ui/toast/toaster.js +1 -1
- package/dist/globals.css +218 -0
- package/dist/hooks/use-time.d.ts +6 -0
- package/dist/hooks/use-time.d.ts.map +1 -0
- package/dist/hooks/use-time.js +20 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/lib/storage/get-storage-object.d.ts +2 -0
- package/dist/lib/storage/get-storage-object.d.ts.map +1 -0
- package/dist/lib/storage/get-storage-object.js +19 -0
- package/dist/lib/storage/get-storage.d.ts +2 -0
- package/dist/lib/storage/get-storage.d.ts.map +1 -0
- package/dist/lib/storage/get-storage.js +17 -0
- package/dist/lib/storage/index.d.ts +3 -0
- package/dist/lib/storage/index.d.ts.map +1 -0
- package/dist/lib/storage/index.js +18 -0
- package/dist/public/arm.gif +0 -0
- package/dist/public/clap.gif +0 -0
- package/dist/public/confetti-ball.gif +0 -0
- package/dist/public/countries.json +21200 -21200
- package/dist/public/dizzy.gif +0 -0
- package/dist/public/electricity.gif +0 -0
- package/dist/public/gear.gif +0 -0
- package/dist/public/gem.gif +0 -0
- package/dist/public/pencil.gif +0 -0
- package/dist/public/robot.gif +0 -0
- package/dist/public/rocket.gif +0 -0
- package/dist/public/software.gif +0 -0
- package/dist/public/solar-system.gif +0 -0
- package/dist/public/unicorn.gif +0 -0
- package/package.json +32 -29
- package/dist/components/ui/input-with-icon/index.d.ts +0 -12
- package/dist/components/ui/input-with-icon/index.d.ts.map +0 -1
- package/dist/components/ui/input-with-icon/index.js +0 -57
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
--color-breadcrumb-link-foreground: var(--color-zinc-700);
|
|
3
|
+
--color-breadcrumb-link-foreground-hover: var(--color-zinc-900);
|
|
4
|
+
--color-breadcrumb-muted-foreground: var(--color-shadcn-400);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@layer components {
|
|
8
|
+
.breadcrumb-list {
|
|
9
|
+
@apply flex flex-wrap items-center gap-2 text-xs font-medium break-words sm:gap-2.5;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.breadcrumb-item {
|
|
13
|
+
@apply inline-flex items-center gap-1.5;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.breadcrumb-link {
|
|
17
|
+
@apply text-breadcrumb-link-foreground underline cursor-pointer hover:text-breadcrumb-link-foreground-hover transition-colors;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.breadcrumb-page {
|
|
21
|
+
@apply text-breadcrumb-muted-foreground;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.breadcrumb-separator {
|
|
25
|
+
@apply text-breadcrumb-muted-foreground [&>svg]:size-2.5;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
5
|
-
|
|
4
|
+
variant?: "default" | "plain" | "hoverLink" | "primary" | "secondary" | "tertiary" | "outline" | "link" | null | undefined;
|
|
5
|
+
fullWidth?: boolean | null | undefined;
|
|
6
|
+
size?: "default" | "small" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const iconVariants: (props?: ({
|
|
9
|
+
position?: "start" | "end" | "far-end" | null | undefined;
|
|
10
|
+
size?: "default" | "small" | null | undefined;
|
|
6
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
12
|
export type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
8
13
|
asChild?: boolean;
|
|
@@ -13,5 +18,5 @@ export type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof b
|
|
|
13
18
|
readOnly?: boolean;
|
|
14
19
|
};
|
|
15
20
|
declare function Button({ className, variant, size, asChild, icon, iconPlacement, fullWidth, readOnly, onClick, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export { Button, buttonVariants };
|
|
21
|
+
export { Button, buttonVariants, iconVariants };
|
|
17
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;;8EA0BlB,CAAA;AAEF,QAAA,MAAM,YAAY;;;8EAgBhB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GACtD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG;IACF,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAA;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAEH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,IAAI,EACJ,aAAuB,EACvB,SAAiB,EACjB,QAAgB,EAChB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,WAAW,2CAgCb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttonVariants = void 0;
|
|
3
|
+
exports.iconVariants = exports.buttonVariants = void 0;
|
|
4
4
|
exports.Button = Button;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_slot_1 = require("@radix-ui/react-slot");
|
|
7
7
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
8
8
|
const utils_1 = require("../../../lib/utils");
|
|
9
|
-
const buttonVariants = (0, class_variance_authority_1.cva)('
|
|
9
|
+
const buttonVariants = (0, class_variance_authority_1.cva)('button-base button-disabled button-read-only', {
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
plain: '',
|
|
13
|
-
white: 'bg-white text-black font-semibold',
|
|
14
|
-
activeLink: 'bg-shadcn-100 text-black font-medium',
|
|
12
|
+
plain: 'button-plain',
|
|
15
13
|
hoverLink: 'hover:bg-accent text-black hover:text-accent-foreground font-normal',
|
|
16
|
-
default: '
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
link: '
|
|
14
|
+
default: 'button-primary',
|
|
15
|
+
primary: 'button-primary',
|
|
16
|
+
secondary: 'button-secondary',
|
|
17
|
+
tertiary: 'button-tertiary',
|
|
18
|
+
outline: 'button-outline',
|
|
19
|
+
link: 'button-link'
|
|
20
|
+
},
|
|
21
|
+
fullWidth: {
|
|
22
|
+
true: 'w-full',
|
|
23
|
+
false: 'w-fit'
|
|
22
24
|
},
|
|
23
25
|
size: {
|
|
24
|
-
default: '
|
|
25
|
-
|
|
26
|
-
lg: 'h-12 rounded-md px-8',
|
|
27
|
-
icon: 'h-10 w-10',
|
|
28
|
-
link: 'p-0 w-auto h-auto',
|
|
29
|
-
xl: 'h-14 p-4'
|
|
26
|
+
default: '',
|
|
27
|
+
small: 'button-small'
|
|
30
28
|
}
|
|
31
29
|
},
|
|
32
30
|
defaultVariants: {
|
|
@@ -43,18 +41,16 @@ const iconVariants = (0, class_variance_authority_1.cva)('', {
|
|
|
43
41
|
'far-end': 'absolute right-2'
|
|
44
42
|
},
|
|
45
43
|
size: {
|
|
46
|
-
default: '
|
|
47
|
-
|
|
48
|
-
lg: 'h-12',
|
|
49
|
-
icon: 'h-10',
|
|
50
|
-
link: 'h-6',
|
|
51
|
-
xl: 'h-14'
|
|
44
|
+
default: '[&>*]:size-6',
|
|
45
|
+
small: '[&>*]:size-4'
|
|
52
46
|
}
|
|
53
47
|
},
|
|
54
48
|
defaultVariants: {
|
|
55
|
-
position: 'start'
|
|
49
|
+
position: 'start',
|
|
50
|
+
size: 'default'
|
|
56
51
|
}
|
|
57
52
|
});
|
|
53
|
+
exports.iconVariants = iconVariants;
|
|
58
54
|
function Button({ className, variant, size, asChild = false, icon, iconPlacement = 'start', fullWidth = false, readOnly = false, onClick, ...props }) {
|
|
59
55
|
const Comp = asChild ? react_slot_1.Slot : 'button';
|
|
60
56
|
const handleClick = (e) => {
|
|
@@ -64,9 +60,5 @@ function Button({ className, variant, size, asChild = false, icon, iconPlacement
|
|
|
64
60
|
}
|
|
65
61
|
onClick?.(e);
|
|
66
62
|
};
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)(Comp, { className: (0, utils_1.cn)(buttonVariants({ variant, size, className }), {
|
|
68
|
-
'w-full': fullWidth
|
|
69
|
-
}, {
|
|
70
|
-
'data-read-only:bg-shadcn-200 data-read-only:text-shadcn-600 data-read-only:cursor-default data-read-only:opacity-50 data-read-only:focus:ring-0 data-read-only:focus:outline-hidden': readOnly
|
|
71
|
-
}), "data-read-only": readOnly, "data-slot": "button", ...props, onClick: handleClick, children: [icon && iconPlacement === 'start' && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(iconVariants({ position: iconPlacement })), children: icon })), props.children, icon && iconPlacement !== 'start' && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(iconVariants({ position: iconPlacement })), children: icon }))] }));
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)(Comp, { className: (0, utils_1.cn)(buttonVariants({ variant, size, fullWidth }), className), "data-read-only": readOnly, "data-slot": "button", ...props, onClick: handleClick, children: [icon && iconPlacement === 'start' && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(iconVariants({ position: iconPlacement, size })), children: icon })), props.children, icon && iconPlacement !== 'start' && ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(iconVariants({ position: iconPlacement, size })), children: icon }))] }));
|
|
72
64
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
/* Button */
|
|
3
|
+
--text-button: var(--font-size-sm);
|
|
4
|
+
--spacing-button-px: calc(var(--spacing) * 4);
|
|
5
|
+
--spacing-button-py: calc(var(--spacing) * 3);
|
|
6
|
+
--spacing-button-px-small: calc(var(--spacing) * 3);
|
|
7
|
+
--spacing-button-py-small: calc(var(--spacing) * 2);
|
|
8
|
+
--spacing-button-h: calc(var(--spacing) * 10);
|
|
9
|
+
--spacing-button-h-small: calc(var(--spacing) * 8);
|
|
10
|
+
|
|
11
|
+
--color-button-primary: var(--color-shadcn-600);
|
|
12
|
+
--color-button-primary-foreground: var(--color-white);
|
|
13
|
+
--color-button-primary-disabled: var(--color-shadcn-200);
|
|
14
|
+
--color-button-primary-foreground-disabled: var(--color-shadcn-600);
|
|
15
|
+
--color-button-secondary: var(--color-white);
|
|
16
|
+
--color-button-secondary-hover: var(--color-shadcn-100);
|
|
17
|
+
--color-button-secondary-foreground: var(--color-zinc-600);
|
|
18
|
+
--color-button-border: var(--color-shadcn-300);
|
|
19
|
+
--color-button-tertiary: var(--color-accent);
|
|
20
|
+
--color-button-tertiary-foreground: var(--color-accent-foreground);
|
|
21
|
+
--color-button-outline-foreground: var(--color-zinc-600);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@layer components {
|
|
25
|
+
.button-base {
|
|
26
|
+
@apply relative inline-flex items-center justify-center rounded-lg shadow-sm text-sm font-medium transition-colors cursor-pointer whitespace-nowrap h-button-h px-button-px py-button-py;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.button-plain {
|
|
30
|
+
@apply bg-transparent text-inherit shadow-none hover:bg-black/5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.button-primary {
|
|
34
|
+
@apply bg-button-primary text-button-primary-foreground hover:bg-button-primary/80 disabled:bg-button-primary-disabled disabled:text-button-primary-foreground-disabled;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.button-secondary {
|
|
38
|
+
@apply bg-button-secondary text-button-secondary-foreground border border-button-border hover:bg-button-secondary-hover disabled:bg-button-secondary-hover;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.button-tertiary {
|
|
42
|
+
@apply bg-button-tertiary text-button-tertiary-foreground hover:bg-button-tertiary/70;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.button-outline {
|
|
46
|
+
@apply text-button-outline-foreground shadow-none border border-transparent hover:border-button-border;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.button-link {
|
|
50
|
+
@apply !p-0 !px-0 !py-0 !h-4 !text-[13px] underline shadow-none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.button-disabled {
|
|
54
|
+
@apply disabled:pointer-events-none disabled:opacity-50 disabled:border-transparent disabled:shadow-none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button-read-only {
|
|
58
|
+
@apply data-[read-only=true]:cursor-default data-[read-only=true]:opacity-50 data-[read-only=true]:focus:ring-0 data-[read-only=true]:focus:outline-hidden data-[read-only=true]:border-transparent data-[read-only=true]:shadow-none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.button-small {
|
|
62
|
+
@apply h-button-h-small px-button-px-small py-button-py-small;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DayPicker, type DayButton } from 'react-day-picker';
|
|
3
|
+
import { Button } from '../../../components/ui/button';
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Calendar, CalendarDayButton };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/calendar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,SAAS,EAET,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAA;AAO/D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;CAC/D,2CA0JA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,2CA0CxC;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Calendar = Calendar;
|
|
38
|
+
exports.CalendarDayButton = CalendarDayButton;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const react_day_picker_1 = require("react-day-picker");
|
|
42
|
+
const utils_1 = require("../../../lib/utils");
|
|
43
|
+
const button_1 = require("../../../components/ui/button");
|
|
44
|
+
const lucide_react_1 = require("lucide-react");
|
|
45
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'plain', formatters, components, ...props }) {
|
|
46
|
+
const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, className: (0, utils_1.cn)('bg-background group/calendar p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
|
|
48
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
49
|
+
...formatters
|
|
50
|
+
}, classNames: {
|
|
51
|
+
root: (0, utils_1.cn)('w-fit', defaultClassNames.root),
|
|
52
|
+
months: (0, utils_1.cn)('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
53
|
+
month: (0, utils_1.cn)('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
54
|
+
nav: (0, utils_1.cn)('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
55
|
+
button_previous: (0, utils_1.cn)((0, button_1.buttonVariants)({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
56
|
+
button_next: (0, utils_1.cn)((0, button_1.buttonVariants)({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
57
|
+
month_caption: (0, utils_1.cn)('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
58
|
+
dropdowns: (0, utils_1.cn)('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
59
|
+
dropdown_root: (0, utils_1.cn)('relative cn-calendar-dropdown-root rounded-(--cell-radius)', defaultClassNames.dropdown_root),
|
|
60
|
+
dropdown: (0, utils_1.cn)('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
61
|
+
caption_label: (0, utils_1.cn)('select-none font-medium', captionLayout === 'label'
|
|
62
|
+
? 'text-sm'
|
|
63
|
+
: 'cn-calendar-caption-label rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
|
|
64
|
+
table: 'w-full border-collapse',
|
|
65
|
+
weekdays: (0, utils_1.cn)('flex', defaultClassNames.weekdays),
|
|
66
|
+
weekday: (0, utils_1.cn)('text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
67
|
+
week: (0, utils_1.cn)('flex w-full mt-2', defaultClassNames.week),
|
|
68
|
+
week_number_header: (0, utils_1.cn)('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
69
|
+
week_number: (0, utils_1.cn)('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
70
|
+
day: (0, utils_1.cn)('relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none', props.showWeekNumber
|
|
71
|
+
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
72
|
+
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)', defaultClassNames.day),
|
|
73
|
+
range_start: (0, utils_1.cn)('rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate', defaultClassNames.range_start),
|
|
74
|
+
range_middle: (0, utils_1.cn)('rounded-none', defaultClassNames.range_middle),
|
|
75
|
+
range_end: (0, utils_1.cn)('rounded-r-(--cell-radius) bg-muted relative after:bg-muted-200 after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate', defaultClassNames.range_end),
|
|
76
|
+
today: (0, utils_1.cn)('bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
77
|
+
outside: (0, utils_1.cn)('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
78
|
+
disabled: (0, utils_1.cn)('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
79
|
+
hidden: (0, utils_1.cn)('invisible', defaultClassNames.hidden),
|
|
80
|
+
...classNames
|
|
81
|
+
}, components: {
|
|
82
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "calendar", ref: rootRef, className: (0, utils_1.cn)(className), ...props }));
|
|
84
|
+
},
|
|
85
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
86
|
+
if (orientation === 'left') {
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeftIcon, { className: (0, utils_1.cn)('size-4', className), ...props }));
|
|
88
|
+
}
|
|
89
|
+
if (orientation === 'right') {
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightIcon, { className: (0, utils_1.cn)('size-4', className), ...props }));
|
|
91
|
+
}
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: (0, utils_1.cn)('size-4', className), ...props }));
|
|
93
|
+
},
|
|
94
|
+
DayButton: CalendarDayButton,
|
|
95
|
+
WeekNumber: ({ children, ...props }) => {
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...props, children: (0, jsx_runtime_1.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
97
|
+
},
|
|
98
|
+
...components
|
|
99
|
+
}, ...props }));
|
|
100
|
+
}
|
|
101
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
102
|
+
const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
|
|
103
|
+
const ref = React.useRef(null);
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (modifiers.focused)
|
|
106
|
+
ref.current?.focus();
|
|
107
|
+
}, [modifiers.focused]);
|
|
108
|
+
const dayNumber = day.date.getDate();
|
|
109
|
+
const monthName = day.date.toLocaleDateString('en', { month: 'long' });
|
|
110
|
+
const year = day.date.getFullYear();
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "plain", size: "small", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
112
|
+
!modifiers.range_start &&
|
|
113
|
+
!modifiers.range_end &&
|
|
114
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, "aria-label": `${monthName} ${dayNumber}, ${year}`, "aria-selected": modifiers.selected, "aria-current": modifiers.today ? 'date' : undefined, "aria-disabled": modifiers.disabled, role: "gridcell", tabIndex: modifiers.focused ? 0 : -1, className: (0, utils_1.cn)('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
115
|
+
}
|
|
@@ -16,7 +16,7 @@ function CardHeader({ className, ...props }) {
|
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-header", className: (0, utils_1.cn)('flex flex-col space-y-1.5', className), ...props }));
|
|
17
17
|
}
|
|
18
18
|
function CardTitle({ className, ...props }) {
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("h3", { "data-slot": "card-title", className: (0, utils_1.cn)('text-sm leading-none font-medium tracking-tight
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("h3", { "data-slot": "card-title", className: (0, utils_1.cn)('text-sm leading-none font-medium tracking-tight', className), ...props }));
|
|
20
20
|
}
|
|
21
21
|
function CardDescription({ className, ...props }) {
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)("p", { "data-slot": "card-description", className: (0, utils_1.cn)('text-muted-foreground text-sm', className), ...props }));
|
|
@@ -4,7 +4,7 @@ import { Command as CommandPrimitive } from 'cmdk';
|
|
|
4
4
|
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const CommandDialog: ({ children, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CommandList({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare function CommandEmpty(props: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/command/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAMlD,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,2CAW/C;AAED,QAAA,MAAM,aAAa,GAAI,wBAAwB,WAAW,4CAUzD,CAAA;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAiBrD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/command/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE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5 +1,38 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.CommandDialog = void 0;
|
|
5
38
|
exports.Command = Command;
|
|
@@ -11,6 +44,7 @@ exports.CommandItem = CommandItem;
|
|
|
11
44
|
exports.CommandShortcut = CommandShortcut;
|
|
12
45
|
exports.CommandSeparator = CommandSeparator;
|
|
13
46
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
47
|
+
const React = __importStar(require("react"));
|
|
14
48
|
const cmdk_1 = require("cmdk");
|
|
15
49
|
const lucide_react_1 = require("lucide-react");
|
|
16
50
|
const utils_1 = require("../../../lib/utils");
|
|
@@ -25,8 +59,24 @@ exports.CommandDialog = CommandDialog;
|
|
|
25
59
|
function CommandInput({ className, ...props }) {
|
|
26
60
|
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "command-input-wrapper", className: "flex items-center border-b px-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), (0, jsx_runtime_1.jsx)(cmdk_1.Command.Input, { "data-slot": "command-input", className: (0, utils_1.cn)('flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400', className), ...props })] }));
|
|
27
61
|
}
|
|
28
|
-
function CommandList({ className, ...props }) {
|
|
29
|
-
|
|
62
|
+
function CommandList({ className, children, ...props }) {
|
|
63
|
+
const listRef = React.useRef(null);
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
const listElement = listRef.current;
|
|
66
|
+
if (!listElement)
|
|
67
|
+
return;
|
|
68
|
+
const handleWheel = (event) => {
|
|
69
|
+
const { scrollTop, scrollHeight, clientHeight } = listElement;
|
|
70
|
+
const isAtTop = scrollTop === 0 && event.deltaY < 0;
|
|
71
|
+
const isAtBottom = scrollTop + clientHeight >= scrollHeight && event.deltaY > 0;
|
|
72
|
+
if (!isAtTop && !isAtBottom) {
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
listElement.addEventListener('wheel', handleWheel, { passive: true });
|
|
77
|
+
return () => listElement.removeEventListener('wheel', handleWheel);
|
|
78
|
+
}, []);
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.List, { ref: listRef, "data-slot": "command-list", className: (0, utils_1.cn)('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props, children: children }));
|
|
30
80
|
}
|
|
31
81
|
function CommandEmpty(props) {
|
|
32
82
|
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK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AAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,2CAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,CAAA"}
|
|
@@ -61,20 +61,20 @@ function DialogClose({ ...props }) {
|
|
|
61
61
|
return (0, jsx_runtime_1.jsx)(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
62
62
|
}
|
|
63
63
|
function DialogOverlay({ className, ...props }) {
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: (0, utils_1.cn)('
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: (0, utils_1.cn)('dialog-overlay', className), ...props }));
|
|
65
65
|
}
|
|
66
66
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { "data-slot": "dialog-content", className: (0, utils_1.cn)('
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { "data-slot": "dialog-content", className: (0, utils_1.cn)('dialog-content', !showCloseButton && '*:data-radix-dialog-close:hidden', className), ...props, children: [children, (0, jsx_runtime_1.jsxs)(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "dialog-close", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "size-4" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
68
68
|
}
|
|
69
69
|
function DialogHeader({ className, ...props }) {
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "dialog-header", className: (0, utils_1.cn)('
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "dialog-header", className: (0, utils_1.cn)('dialog-header', className), ...props }));
|
|
71
71
|
}
|
|
72
72
|
function DialogFooter({ className, ...props }) {
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "dialog-footer", className: (0, utils_1.cn)('
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "dialog-footer", className: (0, utils_1.cn)('dialog-footer', className), ...props }));
|
|
74
74
|
}
|
|
75
75
|
function DialogTitle({ className, ...props }) {
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Title, { "data-slot": "dialog-title", className: (0, utils_1.cn)('
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Title, { "data-slot": "dialog-title", className: (0, utils_1.cn)('dialog-title', className), ...props }));
|
|
77
77
|
}
|
|
78
78
|
function DialogDescription({ className, ...props }) {
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Description, { "data-slot": "dialog-description", className: (0, utils_1.cn)('
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(DialogPrimitive.Description, { "data-slot": "dialog-description", className: (0, utils_1.cn)('dialog-description', className), ...props }));
|
|
80
80
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@theme inline {
|
|
2
|
+
--color-dialog-title-text: var(--color-zinc-600);
|
|
3
|
+
--color-dialog-description-text: var(--color-shadcn-400);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@layer components {
|
|
7
|
+
.dialog-overlay {
|
|
8
|
+
@apply data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dialog-content {
|
|
12
|
+
@apply bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-8 border p-6 shadow-lg duration-200 sm:max-w-[425px] sm:rounded-lg;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dialog-close {
|
|
16
|
+
@apply data-[state=open]:bg-accent absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:text-gray-400;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dialog-header {
|
|
20
|
+
@apply flex flex-col gap-4 space-y-1.5 text-center sm:text-left;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dialog-footer {
|
|
24
|
+
@apply flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dialog-title {
|
|
28
|
+
@apply text-lg leading-none font-bold tracking-tight text-dialog-title-text;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dialog-description {
|
|
32
|
+
@apply text-dialog-description-text text-sm font-medium;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Label } from '../../../components/ui/label';
|
|
3
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<'legend'> & {
|
|
5
|
+
variant?: 'legend' | 'label';
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const fieldVariants: (props?: ({
|
|
9
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<'div'> & {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<'div'> & {
|
|
20
|
+
errors?: Array<{
|
|
21
|
+
message?: string;
|
|
22
|
+
} | undefined>;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle };
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/field/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG7C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAW1E;AAED,iBAAS,WAA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