@customafk/lunas-ui 0.1.99 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button-6-3G2PiR.mjs +2 -0
- package/dist/{button-C_yZHudZ.mjs.map → button-6-3G2PiR.mjs.map} +1 -1
- package/dist/button-D0WaocKO.cjs +2 -0
- package/dist/button-D0WaocKO.cjs.map +1 -0
- package/dist/{button-Dy39kE9k.d.cts → button-D0YsVKtm.d.cts} +5 -5
- package/dist/{button-8vMj-_no.d.mts → button-L3Ts3X9d.d.mts} +3 -3
- package/dist/button.variants-DuuH1O0_.mjs +2 -0
- package/dist/button.variants-DuuH1O0_.mjs.map +1 -0
- package/dist/button.variants-rdXrPUao.cjs +2 -0
- package/dist/button.variants-rdXrPUao.cjs.map +1 -0
- package/dist/{calendar-DgLMLD8R.cjs → calendar-CO20ceyB.cjs} +2 -2
- package/dist/{calendar-DgLMLD8R.cjs.map → calendar-CO20ceyB.cjs.map} +1 -1
- package/dist/{calendar-e9Pu8pNj.mjs → calendar-D3hTjPxn.mjs} +2 -2
- package/dist/{calendar-e9Pu8pNj.mjs.map → calendar-D3hTjPxn.mjs.map} +1 -1
- package/dist/cards/grid-product-card.cjs +1 -1
- package/dist/cards/grid-product-card.mjs +1 -1
- package/dist/cards/product-card.cjs +1 -1
- package/dist/cards/product-card.mjs +1 -1
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/cards/simple-card.mjs +1 -1
- package/dist/{command-Uq5FAdtW.mjs → command-DhBTNTqz.mjs} +2 -2
- package/dist/{command-Uq5FAdtW.mjs.map → command-DhBTNTqz.mjs.map} +1 -1
- package/dist/{command-Dd4OnuB0.cjs → command-_zpTaaIk.cjs} +2 -2
- package/dist/{command-Dd4OnuB0.cjs.map → command-_zpTaaIk.cjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.mjs +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.mjs +1 -1
- package/dist/data-display/date.cjs +1 -1
- package/dist/data-display/date.mjs +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.mjs +1 -1
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/data-display/user.cjs +1 -1
- package/dist/data-display/user.mjs +1 -1
- package/dist/date-By93kONr.mjs +2 -0
- package/dist/date-By93kONr.mjs.map +1 -0
- package/dist/date-em5f7hCx.cjs +2 -0
- package/dist/date-em5f7hCx.cjs.map +1 -0
- package/dist/{dialog-ArqTBRVT.d.mts → dialog-C3T_1iTB.d.cts} +12 -12
- package/dist/{dialog-BtlJFvlf.d.cts → dialog-COoKGA4Q.d.mts} +12 -12
- package/dist/{dialog-DTz8ngeU.mjs → dialog-CxELDK98.mjs} +2 -2
- package/dist/{dialog-DTz8ngeU.mjs.map → dialog-CxELDK98.mjs.map} +1 -1
- package/dist/{dialog-2N-D9B9o.cjs → dialog-DjRiV5vR.cjs} +2 -2
- package/dist/{dialog-2N-D9B9o.cjs.map → dialog-DjRiV5vR.cjs.map} +1 -1
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.mjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.mjs +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.d.cts +4 -4
- package/dist/features/descriptions/index.mjs +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/search-modal/index.mjs +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.cjs.map +1 -1
- package/dist/features/tanstack-form/index.d.cts +231 -224
- package/dist/features/tanstack-form/index.d.mts +58 -51
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/tanstack-form/index.mjs.map +1 -1
- package/dist/{input-DERBzcV_.d.mts → input-C3M7uZqX.d.cts} +5 -5
- package/dist/{input-DqoSygui.d.cts → input-C9dS5env.d.mts} +6 -6
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.cjs.map +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/cms-layout/index.mjs.map +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.mts +2 -2
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.cjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureDeveloping.mjs +1 -1
- package/dist/pages/FeatureFixing.cjs +1 -1
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.mjs +1 -1
- package/dist/pages/NotAuthorized.cjs +1 -1
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotAuthorized.mjs +1 -1
- package/dist/pages/NotFound.cjs +1 -1
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/NotFound.mjs +1 -1
- package/dist/{paragraph-BBye8n4M.cjs → paragraph-B72bHMf7.cjs} +2 -2
- package/dist/paragraph-B72bHMf7.cjs.map +1 -0
- package/dist/{paragraph-BS88Xdo7.mjs → paragraph-moBSTPmT.mjs} +2 -2
- package/dist/paragraph-moBSTPmT.mjs.map +1 -0
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +6 -6
- package/dist/typography/paragraph.d.mts +6 -6
- package/dist/typography/paragraph.mjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert-dialog.mjs +1 -1
- package/dist/ui/alert.d.cts +6 -6
- package/dist/ui/alert.d.mts +6 -6
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +4 -4
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.mjs +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.mjs +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.mjs +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.mjs +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.mjs +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/calendar.mjs +1 -1
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/card.mjs +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/carousel.mjs +1 -1
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/command.mjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/dialog.mjs +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.mts +24 -24
- package/dist/ui/file-uploader.cjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/file-uploader.mjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +7 -7
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +15 -15
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/multi-select.mjs +1 -1
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/navigation-menu.d.mts +11 -11
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/pagination.mjs +1 -1
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.mts +6 -6
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.d.cts +9 -9
- package/dist/ui/resizable.d.mts +9 -9
- package/dist/ui/scroll-area.d.cts +6 -6
- package/dist/ui/scroll-area.d.mts +3 -3
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.mts +9 -9
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +28 -28
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +18 -18
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +4 -4
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.mts +5 -5
- package/package.json +2 -2
- package/dist/button-8Snjc8iT.cjs +0 -2
- package/dist/button-8Snjc8iT.cjs.map +0 -1
- package/dist/button-C_yZHudZ.mjs +0 -2
- package/dist/button.variants-8QOIR433.cjs +0 -2
- package/dist/button.variants-8QOIR433.cjs.map +0 -1
- package/dist/button.variants-CL2rLGYO.mjs +0 -2
- package/dist/button.variants-CL2rLGYO.mjs.map +0 -1
- package/dist/date-CK7XBqG9.mjs +0 -2
- package/dist/date-CK7XBqG9.mjs.map +0 -1
- package/dist/date-CTmoK8tv.cjs +0 -2
- package/dist/date-CTmoK8tv.cjs.map +0 -1
- package/dist/paragraph-BBye8n4M.cjs.map +0 -1
- package/dist/paragraph-BS88Xdo7.mjs.map +0 -1
package/dist/ui/table.d.cts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime245 from "react/jsx-runtime";
|
|
2
|
+
import * as react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/table.d.ts
|
|
5
|
-
declare const Table:
|
|
5
|
+
declare const Table: react28.MemoExoticComponent<({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<"table">) =>
|
|
9
|
-
declare const TableHeader:
|
|
8
|
+
}: React.ComponentProps<"table">) => react_jsx_runtime245.JSX.Element>;
|
|
9
|
+
declare const TableHeader: react28.MemoExoticComponent<({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<"thead">) =>
|
|
13
|
-
declare const TableBody:
|
|
12
|
+
}: React.ComponentProps<"thead">) => react_jsx_runtime245.JSX.Element>;
|
|
13
|
+
declare const TableBody: react28.MemoExoticComponent<({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<"tbody">) =>
|
|
17
|
-
declare const TableFooter:
|
|
16
|
+
}: React.ComponentProps<"tbody">) => react_jsx_runtime245.JSX.Element>;
|
|
17
|
+
declare const TableFooter: react28.MemoExoticComponent<({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<"tfoot">) =>
|
|
21
|
-
declare const TableRow:
|
|
20
|
+
}: React.ComponentProps<"tfoot">) => react_jsx_runtime245.JSX.Element>;
|
|
21
|
+
declare const TableRow: react28.MemoExoticComponent<({
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
|
-
}: React.ComponentProps<"tr">) =>
|
|
25
|
-
declare const TableHead:
|
|
24
|
+
}: React.ComponentProps<"tr">) => react_jsx_runtime245.JSX.Element>;
|
|
25
|
+
declare const TableHead: react28.MemoExoticComponent<({
|
|
26
26
|
className,
|
|
27
27
|
...props
|
|
28
|
-
}: React.ComponentProps<"th">) =>
|
|
29
|
-
declare const TableCell:
|
|
28
|
+
}: React.ComponentProps<"th">) => react_jsx_runtime245.JSX.Element>;
|
|
29
|
+
declare const TableCell: react28.MemoExoticComponent<({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<"td">) =>
|
|
33
|
-
declare const TableCaption:
|
|
32
|
+
}: React.ComponentProps<"td">) => react_jsx_runtime245.JSX.Element>;
|
|
33
|
+
declare const TableCaption: react28.MemoExoticComponent<({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<"caption">) =>
|
|
36
|
+
}: React.ComponentProps<"caption">) => react_jsx_runtime245.JSX.Element>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
39
39
|
//# sourceMappingURL=table.d.cts.map
|
package/dist/ui/table.d.mts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react13 from "react";
|
|
2
|
+
import * as react_jsx_runtime174 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/table.d.ts
|
|
5
|
-
declare const Table:
|
|
5
|
+
declare const Table: react13.MemoExoticComponent<({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<"table">) =>
|
|
9
|
-
declare const TableHeader:
|
|
8
|
+
}: React.ComponentProps<"table">) => react_jsx_runtime174.JSX.Element>;
|
|
9
|
+
declare const TableHeader: react13.MemoExoticComponent<({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<"thead">) =>
|
|
13
|
-
declare const TableBody:
|
|
12
|
+
}: React.ComponentProps<"thead">) => react_jsx_runtime174.JSX.Element>;
|
|
13
|
+
declare const TableBody: react13.MemoExoticComponent<({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<"tbody">) =>
|
|
17
|
-
declare const TableFooter:
|
|
16
|
+
}: React.ComponentProps<"tbody">) => react_jsx_runtime174.JSX.Element>;
|
|
17
|
+
declare const TableFooter: react13.MemoExoticComponent<({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<"tfoot">) =>
|
|
21
|
-
declare const TableRow:
|
|
20
|
+
}: React.ComponentProps<"tfoot">) => react_jsx_runtime174.JSX.Element>;
|
|
21
|
+
declare const TableRow: react13.MemoExoticComponent<({
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
|
-
}: React.ComponentProps<"tr">) =>
|
|
25
|
-
declare const TableHead:
|
|
24
|
+
}: React.ComponentProps<"tr">) => react_jsx_runtime174.JSX.Element>;
|
|
25
|
+
declare const TableHead: react13.MemoExoticComponent<({
|
|
26
26
|
className,
|
|
27
27
|
...props
|
|
28
|
-
}: React.ComponentProps<"th">) =>
|
|
29
|
-
declare const TableCell:
|
|
28
|
+
}: React.ComponentProps<"th">) => react_jsx_runtime174.JSX.Element>;
|
|
29
|
+
declare const TableCell: react13.MemoExoticComponent<({
|
|
30
30
|
className,
|
|
31
31
|
...props
|
|
32
|
-
}: React.ComponentProps<"td">) =>
|
|
33
|
-
declare const TableCaption:
|
|
32
|
+
}: React.ComponentProps<"td">) => react_jsx_runtime174.JSX.Element>;
|
|
33
|
+
declare const TableCaption: react13.MemoExoticComponent<({
|
|
34
34
|
className,
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<"caption">) =>
|
|
36
|
+
}: React.ComponentProps<"caption">) => react_jsx_runtime174.JSX.Element>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
39
39
|
//# sourceMappingURL=table.d.mts.map
|
package/dist/ui/tabs.d.cts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime253 from "react/jsx-runtime";
|
|
2
2
|
import { Tabs as Tabs$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/tabs.d.ts
|
|
5
5
|
declare function Tabs({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof Tabs$1.Root>):
|
|
8
|
+
}: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime253.JSX.Element;
|
|
9
9
|
declare function TabsList({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<typeof Tabs$1.List>):
|
|
12
|
+
}: React.ComponentProps<typeof Tabs$1.List>): react_jsx_runtime253.JSX.Element;
|
|
13
13
|
declare function TabsTrigger({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Tabs$1.Trigger>):
|
|
16
|
+
}: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime253.JSX.Element;
|
|
17
17
|
declare function TabsContent({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Tabs$1.Content>):
|
|
20
|
+
}: React.ComponentProps<typeof Tabs$1.Content>): react_jsx_runtime253.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
23
23
|
//# sourceMappingURL=tabs.d.cts.map
|
package/dist/ui/tabs.d.mts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime284 from "react/jsx-runtime";
|
|
2
2
|
import { Tabs as Tabs$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/tabs.d.ts
|
|
5
5
|
declare function Tabs({
|
|
6
6
|
className,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof Tabs$1.Root>):
|
|
8
|
+
}: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime284.JSX.Element;
|
|
9
9
|
declare function TabsList({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
12
|
-
}: React.ComponentProps<typeof Tabs$1.List>):
|
|
12
|
+
}: React.ComponentProps<typeof Tabs$1.List>): react_jsx_runtime284.JSX.Element;
|
|
13
13
|
declare function TabsTrigger({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Tabs$1.Trigger>):
|
|
16
|
+
}: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime284.JSX.Element;
|
|
17
17
|
declare function TabsContent({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Tabs$1.Content>):
|
|
20
|
+
}: React.ComponentProps<typeof Tabs$1.Content>): react_jsx_runtime284.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
23
23
|
//# sourceMappingURL=tabs.d.mts.map
|
package/dist/ui/textarea.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime281 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/ui/textarea.d.ts
|
|
4
4
|
declare function Textarea({
|
|
@@ -8,7 +8,7 @@ declare function Textarea({
|
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<'textarea'> & {
|
|
10
10
|
onValueChange?: (value: string) => void;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime281.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Textarea };
|
|
14
14
|
//# sourceMappingURL=textarea.d.cts.map
|
package/dist/ui/textarea.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime182 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region packages/components/ui/textarea.d.ts
|
|
4
4
|
declare function Textarea({
|
|
@@ -8,7 +8,7 @@ declare function Textarea({
|
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<'textarea'> & {
|
|
10
10
|
onValueChange?: (value: string) => void;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime182.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Textarea };
|
|
14
14
|
//# sourceMappingURL=textarea.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toggleVariants } from "./toggle.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime282 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import { ToggleGroup as ToggleGroup$1 } from "radix-ui";
|
|
5
5
|
|
|
@@ -10,14 +10,14 @@ declare function ToggleGroup({
|
|
|
10
10
|
size,
|
|
11
11
|
children,
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>):
|
|
13
|
+
}: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime282.JSX.Element;
|
|
14
14
|
declare function ToggleGroupItem({
|
|
15
15
|
className,
|
|
16
16
|
children,
|
|
17
17
|
variant,
|
|
18
18
|
size,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>):
|
|
20
|
+
}: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime282.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { ToggleGroup, ToggleGroupItem };
|
|
23
23
|
//# sourceMappingURL=toggle-group.d.cts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toggleVariants } from "./toggle.mjs";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime225 from "react/jsx-runtime";
|
|
4
4
|
import { ToggleGroup as ToggleGroup$1 } from "radix-ui";
|
|
5
5
|
|
|
6
6
|
//#region packages/components/ui/toggle-group.d.ts
|
|
@@ -10,14 +10,14 @@ declare function ToggleGroup({
|
|
|
10
10
|
size,
|
|
11
11
|
children,
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>):
|
|
13
|
+
}: React.ComponentProps<typeof ToggleGroup$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime225.JSX.Element;
|
|
14
14
|
declare function ToggleGroupItem({
|
|
15
15
|
className,
|
|
16
16
|
children,
|
|
17
17
|
variant,
|
|
18
18
|
size,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>):
|
|
20
|
+
}: React.ComponentProps<typeof ToggleGroup$1.Item> & VariantProps<typeof toggleVariants>): react_jsx_runtime225.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { ToggleGroup, ToggleGroupItem };
|
|
23
23
|
//# sourceMappingURL=toggle-group.d.mts.map
|
package/dist/ui/toggle.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime257 from "react/jsx-runtime";
|
|
2
|
+
import * as class_variance_authority_types10 from "class-variance-authority/types";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import { Toggle as Toggle$1 } from "radix-ui";
|
|
5
5
|
|
|
@@ -7,13 +7,13 @@ import { Toggle as Toggle$1 } from "radix-ui";
|
|
|
7
7
|
declare const toggleVariants: (props?: ({
|
|
8
8
|
variant?: "default" | "outline" | null | undefined;
|
|
9
9
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
10
|
-
} &
|
|
10
|
+
} & class_variance_authority_types10.ClassProp) | undefined) => string;
|
|
11
11
|
declare function Toggle({
|
|
12
12
|
className,
|
|
13
13
|
variant,
|
|
14
14
|
size,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants>):
|
|
16
|
+
}: React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime257.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { Toggle, toggleVariants };
|
|
19
19
|
//# sourceMappingURL=toggle.d.cts.map
|
package/dist/ui/toggle.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime207 from "react/jsx-runtime";
|
|
3
3
|
import { Toggle as Toggle$1 } from "radix-ui";
|
|
4
4
|
import * as class_variance_authority_types7 from "class-variance-authority/types";
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ declare function Toggle({
|
|
|
13
13
|
variant,
|
|
14
14
|
size,
|
|
15
15
|
...props
|
|
16
|
-
}: React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants>):
|
|
16
|
+
}: React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime207.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { Toggle, toggleVariants };
|
|
19
19
|
//# sourceMappingURL=toggle.d.mts.map
|
package/dist/ui/tooltip.d.cts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime284 from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as Tooltip$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/tooltip.d.ts
|
|
5
5
|
declare function TooltipProvider({
|
|
6
6
|
delayDuration,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof Tooltip$1.Provider>):
|
|
8
|
+
}: React.ComponentProps<typeof Tooltip$1.Provider>): react_jsx_runtime284.JSX.Element;
|
|
9
9
|
declare function Tooltip({
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof Tooltip$1.Root>):
|
|
11
|
+
}: React.ComponentProps<typeof Tooltip$1.Root>): react_jsx_runtime284.JSX.Element;
|
|
12
12
|
declare function TooltipTrigger({
|
|
13
13
|
...props
|
|
14
|
-
}: React.ComponentProps<typeof Tooltip$1.Trigger>):
|
|
14
|
+
}: React.ComponentProps<typeof Tooltip$1.Trigger>): react_jsx_runtime284.JSX.Element;
|
|
15
15
|
declare function TooltipContent({
|
|
16
16
|
className,
|
|
17
17
|
sideOffset,
|
|
18
18
|
children,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Tooltip$1.Content>):
|
|
20
|
+
}: React.ComponentProps<typeof Tooltip$1.Content>): react_jsx_runtime284.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
23
23
|
//# sourceMappingURL=tooltip.d.cts.map
|
package/dist/ui/tooltip.d.mts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime183 from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as Tooltip$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/tooltip.d.ts
|
|
5
5
|
declare function TooltipProvider({
|
|
6
6
|
delayDuration,
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof Tooltip$1.Provider>):
|
|
8
|
+
}: React.ComponentProps<typeof Tooltip$1.Provider>): react_jsx_runtime183.JSX.Element;
|
|
9
9
|
declare function Tooltip({
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof Tooltip$1.Root>):
|
|
11
|
+
}: React.ComponentProps<typeof Tooltip$1.Root>): react_jsx_runtime183.JSX.Element;
|
|
12
12
|
declare function TooltipTrigger({
|
|
13
13
|
...props
|
|
14
|
-
}: React.ComponentProps<typeof Tooltip$1.Trigger>):
|
|
14
|
+
}: React.ComponentProps<typeof Tooltip$1.Trigger>): react_jsx_runtime183.JSX.Element;
|
|
15
15
|
declare function TooltipContent({
|
|
16
16
|
className,
|
|
17
17
|
sideOffset,
|
|
18
18
|
children,
|
|
19
19
|
...props
|
|
20
|
-
}: React.ComponentProps<typeof Tooltip$1.Content>):
|
|
20
|
+
}: React.ComponentProps<typeof Tooltip$1.Content>): react_jsx_runtime183.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
23
23
|
//# sourceMappingURL=tooltip.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customafk/lunas-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "UI library for Lunas Enterprise",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
"@hookform/error-message": "^2.0.0",
|
|
417
417
|
"@react-oauth/google": "^0.12.0",
|
|
418
418
|
"@tailwindcss/vite": "^4.1.0",
|
|
419
|
-
"@tanstack/react-form": "^1.
|
|
419
|
+
"@tanstack/react-form": "^1.29.0",
|
|
420
420
|
"@tanstack/react-table": "^8.21.0",
|
|
421
421
|
"@tanstack/react-virtual": "^3.13.12",
|
|
422
422
|
"class-variance-authority": "^0.7.0",
|
package/dist/button-8Snjc8iT.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./dist-BudM04oj.cjs`),n=require(`./button.variants-8QOIR433.cjs`);let r=require(`@customafk/react-toolkit/utils`),i=require(`react`),a=require(`react/jsx-runtime`),o=require(`lucide-react`);function s({className:e,variant:s,size:c=`default`,color:l,asChild:u=!1,isLoading:d=!1,children:f,disabled:p,type:m=`button`,...h}){return(0,a.jsxs)(u?t.t:`button`,{type:m,"data-slot":`button`,"data-state":d?`loading`:void 0,disabled:p,"aria-disabled":p?!0:void 0,className:(0,r.cn)(n.n({variant:s,size:c,color:l,className:e})),...h,children:[(0,a.jsx)(i.Activity,{mode:d?`hidden`:`visible`,children:f}),(0,a.jsx)(i.Activity,{mode:d?`visible`:`hidden`,children:(0,a.jsx)(`div`,{className:n.t({variant:s,color:l}),children:(0,a.jsx)(o.Loader2Icon,{size:16,className:`animate-spin`})})})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
2
|
-
//# sourceMappingURL=button-8Snjc8iT.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-8Snjc8iT.cjs","names":["Slot","buttonVariants","Activity","buttonLoadingVariant","Loader2Icon"],"sources":["../packages/components/ui/button.tsx"],"sourcesContent":["'use client';\n\nimport { Activity } from 'react';\n\nimport { Loader2Icon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { type ButtonVariantProps, buttonLoadingVariant, buttonVariants } from './button.variants';\n\nexport interface ButtonProps extends Omit<React.ComponentProps<'button'>, 'color'> {\n /**\n * When true, the button will render its children without wrapping them\n */\n asChild?: boolean;\n /**\n * Shows a loading spinner when true\n */\n isLoading?: boolean;\n /**\n * Visual style variant\n */\n variant?: ButtonVariantProps['variant'];\n /**\n * Color theme of the button\n */\n color?: ButtonVariantProps['color'];\n /**\n * Size of the button\n */\n size?: ButtonVariantProps['size'];\n}\n\n/**\n * Button component with variants, loading state and composition support\n */\nfunction Button({\n className,\n variant,\n size = 'default',\n color,\n asChild = false,\n isLoading = false,\n children,\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n type={type}\n data-slot=\"button\"\n data-state={isLoading ? 'loading' : undefined}\n disabled={disabled}\n aria-disabled={disabled ? true : undefined}\n className={cn(\n buttonVariants({\n variant,\n size,\n color: color as ButtonVariantProps['color'],\n className,\n })\n )}\n {...props}\n >\n <Activity mode={isLoading ? 'hidden' : 'visible'}>{children}</Activity>\n <Activity mode={isLoading ? 'visible' : 'hidden'}>\n <div className={buttonLoadingVariant({ variant, color })}>\n <Loader2Icon size={16} className=\"animate-spin\" />\n </div>\n </Activity>\n </Comp>\n );\n}\n\nexport { Button };\n"],"mappings":"iPAqCA,SAAS,EAAO,CACd,YACA,UACA,OAAO,UACP,QACA,UAAU,GACV,YAAY,GACZ,WACA,WACA,OAAO,SACP,GAAG,GACW,CAGd,OACE,EAAA,EAAA,MAHW,EAAUA,EAAAA,EAAO,SAAA,CAIpB,OACN,YAAU,SACV,aAAY,EAAY,UAAY,IAAA,GAC1B,WACV,gBAAe,EAAW,GAAO,IAAA,GACjC,WAAA,EAAA,EAAA,IACEC,EAAAA,EAAe,CACb,UACA,OACO,QACP,YACD,CAAC,CACH,CACD,GAAI,aAEJ,EAAA,EAAA,KAACC,EAAAA,SAAAA,CAAS,KAAM,EAAY,SAAW,UAAY,YAAoB,EACvE,EAAA,EAAA,KAACA,EAAAA,SAAAA,CAAS,KAAM,EAAY,UAAY,mBACtC,EAAA,EAAA,KAAC,MAAA,CAAI,UAAWC,EAAAA,EAAqB,CAAE,UAAS,QAAO,CAAC,WACtD,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAY,KAAM,GAAI,UAAU,gBAAiB,EAC9C,EACG,CAAA,EACN"}
|
package/dist/button-C_yZHudZ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./dist-CvmzZ_6C.mjs";import{n as t,t as n}from"./button.variants-CL2rLGYO.mjs";import{cn as r}from"@customafk/react-toolkit/utils";import{Activity as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Loader2Icon as s}from"lucide-react";function c({className:c,variant:l,size:u=`default`,color:d,asChild:f=!1,isLoading:p=!1,children:m,disabled:h,type:g=`button`,..._}){return o(f?e:`button`,{type:g,"data-slot":`button`,"data-state":p?`loading`:void 0,disabled:h,"aria-disabled":h?!0:void 0,className:r(t({variant:l,size:u,color:d,className:c})),..._,children:[a(i,{mode:p?`hidden`:`visible`,children:m}),a(i,{mode:p?`visible`:`hidden`,children:a(`div`,{className:n({variant:l,color:d}),children:a(s,{size:16,className:`animate-spin`})})})]})}export{c as t};
|
|
2
|
-
//# sourceMappingURL=button-C_yZHudZ.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`class-variance-authority`);const n=(0,t.cva)([`pointer-events-none absolute inset-0 top-0 left-0 z-10 flex cursor-default items-center justify-center rounded-sm`],{variants:{variant:{default:``,outline:``,soft:``,subtle:``,ghost:``,link:``},color:{primary:``,secondary:``,muted:``,success:``,important:``,info:``,warning:``,danger:``}},compoundVariants:[{variant:`default`,color:`primary`,className:`bg-primary-weak`},{variant:`default`,color:`secondary`,className:`bg-secondary-weak`},{variant:`default`,color:`muted`,className:`bg-muted-weak`},{variant:`default`,color:`success`,className:`bg-success-weak`},{variant:`default`,color:`info`,className:`bg-info-weak`},{variant:`default`,color:`warning`,className:`bg-warning-weak`},{variant:`default`,color:`danger`,className:`bg-danger-weak`},{variant:`outline`,color:`primary`,className:`bg-card outline-1 outline-primary-weak`},{variant:`outline`,color:`secondary`,className:`bg-card outline-1 outline-secondary-weak`},{variant:`outline`,color:`muted`,className:`bg-card outline-1 outline-muted-weak`},{variant:`outline`,color:`success`,className:`bg-card outline-1 outline-success-weak`},{variant:`outline`,color:`info`,className:`bg-card outline-1 outline-info-weak`},{variant:`outline`,color:`warning`,className:`bg-card outline-1 outline-warning-weak`},{variant:`outline`,color:`danger`,className:`bg-card outline-1 outline-danger-weak`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle`},{variant:`subtle`,color:`primary`,className:`bg-primary-bg-subtle outline-1 outline-primary-weak`},{variant:`subtle`,color:`secondary`,className:`bg-secondary-bg-subtle outline-1 outline-secondary-weak`},{variant:`subtle`,color:`muted`,className:`bg-muted-bg-subtle outline-1 outline-border-weak`},{variant:`subtle`,color:`success`,className:`bg-success-bg-subtle outline-1 outline-success-weak`},{variant:`subtle`,color:`info`,className:`bg-info-bg-subtle outline-1 outline-info-weak`},{variant:`subtle`,color:`warning`,className:`bg-warning-bg-subtle outline-1 outline-warning-weak`},{variant:`subtle`,color:`danger`,className:`bg-danger-bg-subtle outline-1 outline-danger-weak`},{variant:`ghost`,color:`primary`,className:`bg-primary-bg-subtle`},{variant:`ghost`,color:`secondary`,className:`bg-secondary-bg-subtle`},{variant:`ghost`,color:`muted`,className:`bg-muted-bg-subtle`},{variant:`ghost`,color:`success`,className:`bg-success-bg-subtle`},{variant:`ghost`,color:`info`,className:`bg-info-bg-subtle`},{variant:`ghost`,color:`warning`,className:`bg-warning-bg-subtle`},{variant:`ghost`,color:`danger`,className:`bg-danger-bg-subtle`}]}),r=(0,t.cva)([`relative cursor-pointer rounded-sm transition-all`,`whitespace-normal`,`inline-flex items-center justify-center`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,`disabled:pointer-events-none disabled:cursor-default disabled:opacity-60`,`data-[state=loading]:pointer-events-none data-[state=loading]:cursor-default`],{variants:{variant:{default:`text-text-negative outline-0 outline-offset-0`,outline:`bg-card outline-1 -outline-offset-1`,soft:`outline-none outline-0`,subtle:`outline-1 -outline-offset-1`,ghost:`outline-0`,link:``},color:{primary:``,secondary:``,muted:``,success:``,important:``,info:``,warning:``,danger:``},size:{default:`gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5`,xs:`gap-1 px-2 py-1 font-medium text-xs leading-4`,sm:`gap-1.5 px-2.5 py-1.5 font-medium text-xs leading-4`,md:`gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5`,lg:`gap-1.5 px-3 py-2 font-medium text-sm leading-5`,xl:`gap-2 px-3 py-2 font-medium text-base leading-6`,icon:`size-8`}},defaultVariants:{variant:`default`,color:`primary`,size:`default`},compoundVariants:[{variant:`default`,color:`primary`,className:`bg-primary hover:opacity-80 focus:outline-2 focus:outline-primary focus:outline-offset-2`},{variant:`default`,color:`secondary`,className:`bg-secondary hover:opacity-80 focus:outline-2 focus:outline-secondary focus:outline-offset-2`},{variant:`default`,color:`muted`,className:`bg-muted hover:opacity-80 focus:outline-2 focus:outline-muted focus:outline-offset-2`},{variant:`default`,color:`success`,className:`bg-success hover:opacity-80 focus:outline-2 focus:outline-success focus:outline-offset-2`},{variant:`default`,color:`important`,className:`bg-important hover:opacity-80 focus:outline-2 focus:outline-important focus:outline-offset-2`},{variant:`default`,color:`info`,className:`bg-info hover:opacity-80 focus:outline-2 focus:outline-info focus:outline-offset-2`},{variant:`default`,color:`warning`,className:`bg-warning hover:opacity-80 focus:outline-2 focus:outline-warning focus:outline-offset-2`},{variant:`default`,color:`danger`,className:`bg-danger hover:opacity-80 focus:outline-2 focus:outline-danger focus:outline-offset-2`},{variant:`outline`,color:`primary`,className:`text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary-strong`},{variant:`outline`,color:`secondary`,className:`text-secondary outline-secondary hover:bg-secondary-muted focus:outline-2 focus:outline-secondary`},{variant:`outline`,color:`muted`,className:`text-muted outline-muted-weak hover:bg-muted-muted focus:outline-2 focus:outline-muted-weak`},{variant:`outline`,color:`success`,className:`text-success outline-success hover:bg-success-muted focus:outline-2 focus:outline-success-strong`},{variant:`outline`,color:`info`,className:`text-info outline-info hover:bg-info-muted focus:outline-2 focus:outline-info-strong`},{variant:`outline`,color:`warning`,className:`text-warning outline-warning hover:bg-warning-muted focus:outline-2 focus:outline-warning-strong`},{variant:`outline`,color:`danger`,className:`text-danger outline-danger hover:bg-danger-muted focus:outline-2 focus:outline-danger-strong`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle text-primary hover:bg-primary-muted hover:text-primary-strong focus:bg-primary-weak`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary hover:bg-secondary-muted hover:text-secondary-strong focus:bg-secondary-weak`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle text-muted hover:bg-muted-muted hover:text-muted-strong focus:bg-muted-weak`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle text-success hover:bg-success-muted hover:text-success-strong focus:bg-success-weak`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle text-info hover:bg-info-muted hover:text-info-strong focus:bg-info-weak`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle text-warning hover:bg-warning-muted hover:text-warning-strong focus:bg-warning-weak`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle text-danger hover:bg-danger-muted hover:text-danger-strong focus:bg-danger-weak`},{variant:`subtle`,color:`primary`,className:`bg-primary-bg-subtle text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary`},{variant:`subtle`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary outline-secondary hover:bg-secondary-bg-subtle focus:outline-2 focus:outline-secondary`},{variant:`subtle`,color:`muted`,className:`bg-muted-bg-subtle text-muted outline-border hover:bg-muted-bg-subtle focus:outline-2 focus:outline-border`},{variant:`subtle`,color:`success`,className:`bg-success-bg-subtle text-success outline-success hover:bg-success-bg-subtle focus:outline-2 focus:outline-success`},{variant:`subtle`,color:`info`,className:`bg-info-bg-subtle text-info outline-info hover:bg-info-bg-subtle focus:outline-2 focus:outline-info`},{variant:`subtle`,color:`warning`,className:`bg-warning-bg-subtle text-warning outline-warning hover:bg-warning-bg-subtle focus:outline-2 focus:outline-warning`},{variant:`subtle`,color:`danger`,className:`bg-danger-bg-subtle text-danger outline-danger hover:bg-danger-bg-subtle focus:outline-2 focus:outline-danger`},{variant:`ghost`,color:`primary`,className:`text-primary hover:bg-primary-bg-subtle focus:bg-primary-muted`},{variant:`ghost`,color:`secondary`,className:`text-text-positive-weak hover:bg-secondary-bg-subtle focus:bg-secondary-muted`},{variant:`ghost`,color:`muted`,className:`text-text-positive-weak hover:bg-muted-bg-subtle focus:bg-muted-muted`},{variant:`ghost`,color:`success`,className:`text-success hover:bg-success-bg-subtle focus:bg-success-muted`},{variant:`ghost`,color:`info`,className:`text-info hover:bg-info-bg-subtle focus:bg-info-muted`},{variant:`ghost`,color:`warning`,className:`text-warning hover:bg-warning-bg-subtle focus:bg-warning-muted`},{variant:`ghost`,color:`danger`,className:`text-danger hover:bg-danger-bg-subtle focus:bg-danger-muted`},{variant:`link`,color:`primary`,className:`-outline-offset-2 focus:-outline-offset-2 text-primary focus:outline-2 focus:outline-primary`},{variant:`link`,color:`secondary`,className:`-outline-offset-2 focus:-outline-offset-2 text-secondary focus:outline-2 focus:outline-secondary`},{variant:`link`,color:`muted`,className:`-outline-offset-2 focus:-outline-offset-2 text-muted focus:outline-2 focus:outline-muted`},{variant:`link`,color:`success`,className:`-outline-offset-2 focus:-outline-offset-2 text-success focus:outline-2 focus:outline-success`},{variant:`link`,color:`important`,className:`-outline-offset-2 focus:-outline-offset-2 text-important focus:outline-2 focus:outline-important`},{variant:`link`,color:`info`,className:`-outline-offset-2 focus:-outline-offset-2 text-info focus:outline-2 focus:outline-info`},{variant:`link`,color:`warning`,className:`-outline-offset-2 focus:-outline-offset-2 text-warning focus:outline-2 focus:outline-warning`},{variant:`link`,color:`danger`,className:`-outline-offset-2 focus:-outline-offset-2 text-danger focus:outline-2 focus:outline-danger`}]});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
2
|
-
//# sourceMappingURL=button.variants-8QOIR433.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.variants-8QOIR433.cjs","names":[],"sources":["../packages/components/ui/button.variants.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const buttonLoadingVariant = cva(['pointer-events-none absolute inset-0 top-0 left-0 z-10 flex cursor-default items-center justify-center rounded-sm'], {\n variants: {\n variant: {\n default: '',\n outline: '',\n soft: '',\n subtle: '',\n ghost: '',\n link: '',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n success: '',\n important: '',\n info: '',\n warning: '',\n danger: '',\n },\n },\n compoundVariants: [\n {\n variant: 'default',\n color: 'primary',\n className: 'bg-primary-weak',\n },\n {\n variant: 'default',\n color: 'secondary',\n className: 'bg-secondary-weak',\n },\n { variant: 'default', color: 'muted', className: 'bg-muted-weak' },\n {\n variant: 'default',\n color: 'success',\n className: 'bg-success-weak',\n },\n {\n variant: 'default',\n color: 'info',\n className: 'bg-info-weak',\n },\n {\n variant: 'default',\n color: 'warning',\n className: 'bg-warning-weak',\n },\n {\n variant: 'default',\n color: 'danger',\n className: 'bg-danger-weak',\n },\n {\n variant: 'outline',\n color: 'primary',\n className: 'bg-card outline-1 outline-primary-weak',\n },\n {\n variant: 'outline',\n color: 'secondary',\n className: 'bg-card outline-1 outline-secondary-weak',\n },\n {\n variant: 'outline',\n color: 'muted',\n className: 'bg-card outline-1 outline-muted-weak',\n },\n {\n variant: 'outline',\n color: 'success',\n className: 'bg-card outline-1 outline-success-weak',\n },\n {\n variant: 'outline',\n color: 'info',\n className: 'bg-card outline-1 outline-info-weak',\n },\n {\n variant: 'outline',\n color: 'warning',\n className: 'bg-card outline-1 outline-warning-weak',\n },\n {\n variant: 'outline',\n color: 'danger',\n className: 'bg-card outline-1 outline-danger-weak',\n },\n {\n variant: 'soft',\n color: 'primary',\n className: 'bg-primary-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'muted',\n className: 'bg-muted-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'success',\n className: 'bg-success-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'info',\n className: 'bg-info-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'warning',\n className: 'bg-warning-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'danger',\n className: 'bg-danger-bg-subtle',\n },\n {\n variant: 'subtle',\n color: 'primary',\n className: 'bg-primary-bg-subtle outline-1 outline-primary-weak',\n },\n {\n variant: 'subtle',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle outline-1 outline-secondary-weak',\n },\n {\n variant: 'subtle',\n color: 'muted',\n className: 'bg-muted-bg-subtle outline-1 outline-border-weak',\n },\n {\n variant: 'subtle',\n color: 'success',\n className: 'bg-success-bg-subtle outline-1 outline-success-weak',\n },\n {\n variant: 'subtle',\n color: 'info',\n className: 'bg-info-bg-subtle outline-1 outline-info-weak',\n },\n {\n variant: 'subtle',\n color: 'warning',\n className: 'bg-warning-bg-subtle outline-1 outline-warning-weak',\n },\n {\n variant: 'subtle',\n color: 'danger',\n className: 'bg-danger-bg-subtle outline-1 outline-danger-weak',\n },\n {\n variant: 'ghost',\n color: 'primary',\n className: 'bg-primary-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'muted',\n className: 'bg-muted-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'success',\n className: 'bg-success-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'info',\n className: 'bg-info-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'warning',\n className: 'bg-warning-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'danger',\n className: 'bg-danger-bg-subtle',\n },\n ],\n});\n\n/**\n * Button variants definition for styling using class-variance-authority\n */\nexport const buttonVariants = cva(\n [\n 'relative cursor-pointer rounded-sm transition-all',\n 'whitespace-normal',\n 'inline-flex items-center justify-center',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n 'disabled:pointer-events-none disabled:cursor-default disabled:opacity-60',\n 'data-[state=loading]:pointer-events-none data-[state=loading]:cursor-default',\n ],\n {\n variants: {\n variant: {\n default: 'text-text-negative outline-0 outline-offset-0',\n outline: 'bg-card outline-1 -outline-offset-1',\n soft: 'outline-none outline-0',\n subtle: 'outline-1 -outline-offset-1',\n ghost: 'outline-0',\n link: '',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n success: '',\n important: '',\n info: '',\n warning: '',\n danger: '',\n },\n size: {\n default: 'gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5',\n xs: 'gap-1 px-2 py-1 font-medium text-xs leading-4',\n sm: 'gap-1.5 px-2.5 py-1.5 font-medium text-xs leading-4',\n md: 'gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5',\n lg: 'gap-1.5 px-3 py-2 font-medium text-sm leading-5',\n xl: 'gap-2 px-3 py-2 font-medium text-base leading-6',\n icon: 'size-8',\n },\n },\n defaultVariants: {\n variant: 'default',\n color: 'primary',\n size: 'default',\n },\n compoundVariants: [\n {\n variant: 'default',\n color: 'primary',\n className: 'bg-primary hover:opacity-80 focus:outline-2 focus:outline-primary focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'secondary',\n className: 'bg-secondary hover:opacity-80 focus:outline-2 focus:outline-secondary focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'muted',\n className: 'bg-muted hover:opacity-80 focus:outline-2 focus:outline-muted focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'success',\n className: 'bg-success hover:opacity-80 focus:outline-2 focus:outline-success focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'important',\n className: 'bg-important hover:opacity-80 focus:outline-2 focus:outline-important focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'info',\n className: 'bg-info hover:opacity-80 focus:outline-2 focus:outline-info focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'warning',\n className: 'bg-warning hover:opacity-80 focus:outline-2 focus:outline-warning focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'danger',\n className: 'bg-danger hover:opacity-80 focus:outline-2 focus:outline-danger focus:outline-offset-2',\n },\n {\n variant: 'outline',\n color: 'primary',\n className: 'text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary-strong',\n },\n {\n variant: 'outline',\n color: 'secondary',\n className: 'text-secondary outline-secondary hover:bg-secondary-muted focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'outline',\n color: 'muted',\n className: 'text-muted outline-muted-weak hover:bg-muted-muted focus:outline-2 focus:outline-muted-weak',\n },\n {\n variant: 'outline',\n color: 'success',\n className: 'text-success outline-success hover:bg-success-muted focus:outline-2 focus:outline-success-strong',\n },\n {\n variant: 'outline',\n color: 'info',\n className: 'text-info outline-info hover:bg-info-muted focus:outline-2 focus:outline-info-strong',\n },\n {\n variant: 'outline',\n color: 'warning',\n className: 'text-warning outline-warning hover:bg-warning-muted focus:outline-2 focus:outline-warning-strong',\n },\n {\n variant: 'outline',\n color: 'danger',\n className: 'text-danger outline-danger hover:bg-danger-muted focus:outline-2 focus:outline-danger-strong',\n },\n {\n variant: 'soft',\n color: 'primary',\n className: 'bg-primary-bg-subtle text-primary hover:bg-primary-muted hover:text-primary-strong focus:bg-primary-weak',\n },\n {\n variant: 'soft',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle text-secondary hover:bg-secondary-muted hover:text-secondary-strong focus:bg-secondary-weak',\n },\n {\n variant: 'soft',\n color: 'muted',\n className: 'bg-muted-bg-subtle text-muted hover:bg-muted-muted hover:text-muted-strong focus:bg-muted-weak',\n },\n {\n variant: 'soft',\n color: 'success',\n className: 'bg-success-bg-subtle text-success hover:bg-success-muted hover:text-success-strong focus:bg-success-weak',\n },\n {\n variant: 'soft',\n color: 'info',\n className: 'bg-info-bg-subtle text-info hover:bg-info-muted hover:text-info-strong focus:bg-info-weak',\n },\n {\n variant: 'soft',\n color: 'warning',\n className: 'bg-warning-bg-subtle text-warning hover:bg-warning-muted hover:text-warning-strong focus:bg-warning-weak',\n },\n {\n variant: 'soft',\n color: 'danger',\n className: 'bg-danger-bg-subtle text-danger hover:bg-danger-muted hover:text-danger-strong focus:bg-danger-weak',\n },\n {\n variant: 'subtle',\n color: 'primary',\n className: 'bg-primary-bg-subtle text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary',\n },\n {\n variant: 'subtle',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle text-secondary outline-secondary hover:bg-secondary-bg-subtle focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'subtle',\n color: 'muted',\n className: 'bg-muted-bg-subtle text-muted outline-border hover:bg-muted-bg-subtle focus:outline-2 focus:outline-border',\n },\n {\n variant: 'subtle',\n color: 'success',\n className: 'bg-success-bg-subtle text-success outline-success hover:bg-success-bg-subtle focus:outline-2 focus:outline-success',\n },\n {\n variant: 'subtle',\n color: 'info',\n className: 'bg-info-bg-subtle text-info outline-info hover:bg-info-bg-subtle focus:outline-2 focus:outline-info',\n },\n {\n variant: 'subtle',\n color: 'warning',\n className: 'bg-warning-bg-subtle text-warning outline-warning hover:bg-warning-bg-subtle focus:outline-2 focus:outline-warning',\n },\n {\n variant: 'subtle',\n color: 'danger',\n className: 'bg-danger-bg-subtle text-danger outline-danger hover:bg-danger-bg-subtle focus:outline-2 focus:outline-danger',\n },\n {\n variant: 'ghost',\n color: 'primary',\n className: 'text-primary hover:bg-primary-bg-subtle focus:bg-primary-muted',\n },\n {\n variant: 'ghost',\n color: 'secondary',\n className: 'text-text-positive-weak hover:bg-secondary-bg-subtle focus:bg-secondary-muted',\n },\n {\n variant: 'ghost',\n color: 'muted',\n className: 'text-text-positive-weak hover:bg-muted-bg-subtle focus:bg-muted-muted',\n },\n {\n variant: 'ghost',\n color: 'success',\n className: 'text-success hover:bg-success-bg-subtle focus:bg-success-muted',\n },\n {\n variant: 'ghost',\n color: 'info',\n className: 'text-info hover:bg-info-bg-subtle focus:bg-info-muted',\n },\n {\n variant: 'ghost',\n color: 'warning',\n className: 'text-warning hover:bg-warning-bg-subtle focus:bg-warning-muted',\n },\n {\n variant: 'ghost',\n color: 'danger',\n className: 'text-danger hover:bg-danger-bg-subtle focus:bg-danger-muted',\n },\n {\n variant: 'link',\n color: 'primary',\n className: '-outline-offset-2 focus:-outline-offset-2 text-primary focus:outline-2 focus:outline-primary',\n },\n {\n variant: 'link',\n color: 'secondary',\n className: '-outline-offset-2 focus:-outline-offset-2 text-secondary focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'link',\n color: 'muted',\n className: '-outline-offset-2 focus:-outline-offset-2 text-muted focus:outline-2 focus:outline-muted',\n },\n {\n variant: 'link',\n color: 'success',\n className: '-outline-offset-2 focus:-outline-offset-2 text-success focus:outline-2 focus:outline-success',\n },\n {\n variant: 'link',\n color: 'important',\n className: '-outline-offset-2 focus:-outline-offset-2 text-important focus:outline-2 focus:outline-important',\n },\n {\n variant: 'link',\n color: 'info',\n className: '-outline-offset-2 focus:-outline-offset-2 text-info focus:outline-2 focus:outline-info',\n },\n {\n variant: 'link',\n color: 'warning',\n className: '-outline-offset-2 focus:-outline-offset-2 text-warning focus:outline-2 focus:outline-warning',\n },\n {\n variant: 'link',\n color: 'danger',\n className: '-outline-offset-2 focus:-outline-offset-2 text-danger focus:outline-2 focus:outline-danger',\n },\n ],\n }\n);\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n"],"mappings":"kFAEA,MAAa,GAAA,EAAA,EAAA,KAA2B,CAAC,oHAAoH,CAAE,CAC7J,SAAU,CACR,QAAS,CACP,QAAS,GACT,QAAS,GACT,KAAM,GACN,OAAQ,GACR,MAAO,GACP,KAAM,GACP,CACD,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,QAAS,GACT,UAAW,GACX,KAAM,GACN,QAAS,GACT,OAAQ,GACT,CACF,CACD,iBAAkB,CAChB,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,oBACZ,CACD,CAAE,QAAS,UAAW,MAAO,QAAS,UAAW,gBAAiB,CAClE,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,eACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,iBACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,2CACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,uCACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,sCACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,wCACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,yBACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,qBACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,oBACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,sBACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,YACP,UAAW,0DACZ,CACD,CACE,QAAS,SACT,MAAO,QACP,UAAW,mDACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,OACP,UAAW,gDACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,SACP,UAAW,oDACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,YACP,UAAW,yBACZ,CACD,CACE,QAAS,QACT,MAAO,QACP,UAAW,qBACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,OACP,UAAW,oBACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,SACP,UAAW,sBACZ,CACF,CACF,CAAC,CAKW,GAAA,EAAA,EAAA,KACX,CACE,oDACA,oBACA,0CACA,8BACA,mBACA,uCACA,2EACA,+EACD,CACD,CACE,SAAU,CACR,QAAS,CACP,QAAS,gDACT,QAAS,sCACT,KAAM,yBACN,OAAQ,8BACR,MAAO,YACP,KAAM,GACP,CACD,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,QAAS,GACT,UAAW,GACX,KAAM,GACN,QAAS,GACT,OAAQ,GACT,CACD,KAAM,CACJ,QAAS,sDACT,GAAI,gDACJ,GAAI,sDACJ,GAAI,sDACJ,GAAI,kDACJ,GAAI,kDACJ,KAAM,SACP,CACF,CACD,gBAAiB,CACf,QAAS,UACT,MAAO,UACP,KAAM,UACP,CACD,iBAAkB,CAChB,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,+FACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,uFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,+FACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,qFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,yFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,uGACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,oGACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,8FACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,mGACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,uFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,mGACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,qHACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,iGACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,4FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,sGACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,YACP,UAAW,+HACZ,CACD,CACE,QAAS,SACT,MAAO,QACP,UAAW,6GACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,OACP,UAAW,sGACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,SACP,UAAW,gHACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,YACP,UAAW,gFACZ,CACD,CACE,QAAS,QACT,MAAO,QACP,UAAW,wEACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,OACP,UAAW,wDACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,SACP,UAAW,8DACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,mGACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,2FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,mGACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,yFACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,6FACZ,CACF,CACF,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cva as e}from"class-variance-authority";const t=e([`pointer-events-none absolute inset-0 top-0 left-0 z-10 flex cursor-default items-center justify-center rounded-sm`],{variants:{variant:{default:``,outline:``,soft:``,subtle:``,ghost:``,link:``},color:{primary:``,secondary:``,muted:``,success:``,important:``,info:``,warning:``,danger:``}},compoundVariants:[{variant:`default`,color:`primary`,className:`bg-primary-weak`},{variant:`default`,color:`secondary`,className:`bg-secondary-weak`},{variant:`default`,color:`muted`,className:`bg-muted-weak`},{variant:`default`,color:`success`,className:`bg-success-weak`},{variant:`default`,color:`info`,className:`bg-info-weak`},{variant:`default`,color:`warning`,className:`bg-warning-weak`},{variant:`default`,color:`danger`,className:`bg-danger-weak`},{variant:`outline`,color:`primary`,className:`bg-card outline-1 outline-primary-weak`},{variant:`outline`,color:`secondary`,className:`bg-card outline-1 outline-secondary-weak`},{variant:`outline`,color:`muted`,className:`bg-card outline-1 outline-muted-weak`},{variant:`outline`,color:`success`,className:`bg-card outline-1 outline-success-weak`},{variant:`outline`,color:`info`,className:`bg-card outline-1 outline-info-weak`},{variant:`outline`,color:`warning`,className:`bg-card outline-1 outline-warning-weak`},{variant:`outline`,color:`danger`,className:`bg-card outline-1 outline-danger-weak`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle`},{variant:`subtle`,color:`primary`,className:`bg-primary-bg-subtle outline-1 outline-primary-weak`},{variant:`subtle`,color:`secondary`,className:`bg-secondary-bg-subtle outline-1 outline-secondary-weak`},{variant:`subtle`,color:`muted`,className:`bg-muted-bg-subtle outline-1 outline-border-weak`},{variant:`subtle`,color:`success`,className:`bg-success-bg-subtle outline-1 outline-success-weak`},{variant:`subtle`,color:`info`,className:`bg-info-bg-subtle outline-1 outline-info-weak`},{variant:`subtle`,color:`warning`,className:`bg-warning-bg-subtle outline-1 outline-warning-weak`},{variant:`subtle`,color:`danger`,className:`bg-danger-bg-subtle outline-1 outline-danger-weak`},{variant:`ghost`,color:`primary`,className:`bg-primary-bg-subtle`},{variant:`ghost`,color:`secondary`,className:`bg-secondary-bg-subtle`},{variant:`ghost`,color:`muted`,className:`bg-muted-bg-subtle`},{variant:`ghost`,color:`success`,className:`bg-success-bg-subtle`},{variant:`ghost`,color:`info`,className:`bg-info-bg-subtle`},{variant:`ghost`,color:`warning`,className:`bg-warning-bg-subtle`},{variant:`ghost`,color:`danger`,className:`bg-danger-bg-subtle`}]}),n=e([`relative cursor-pointer rounded-sm transition-all`,`whitespace-normal`,`inline-flex items-center justify-center`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,`disabled:pointer-events-none disabled:cursor-default disabled:opacity-60`,`data-[state=loading]:pointer-events-none data-[state=loading]:cursor-default`],{variants:{variant:{default:`text-text-negative outline-0 outline-offset-0`,outline:`bg-card outline-1 -outline-offset-1`,soft:`outline-none outline-0`,subtle:`outline-1 -outline-offset-1`,ghost:`outline-0`,link:``},color:{primary:``,secondary:``,muted:``,success:``,important:``,info:``,warning:``,danger:``},size:{default:`gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5`,xs:`gap-1 px-2 py-1 font-medium text-xs leading-4`,sm:`gap-1.5 px-2.5 py-1.5 font-medium text-xs leading-4`,md:`gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5`,lg:`gap-1.5 px-3 py-2 font-medium text-sm leading-5`,xl:`gap-2 px-3 py-2 font-medium text-base leading-6`,icon:`size-8`}},defaultVariants:{variant:`default`,color:`primary`,size:`default`},compoundVariants:[{variant:`default`,color:`primary`,className:`bg-primary hover:opacity-80 focus:outline-2 focus:outline-primary focus:outline-offset-2`},{variant:`default`,color:`secondary`,className:`bg-secondary hover:opacity-80 focus:outline-2 focus:outline-secondary focus:outline-offset-2`},{variant:`default`,color:`muted`,className:`bg-muted hover:opacity-80 focus:outline-2 focus:outline-muted focus:outline-offset-2`},{variant:`default`,color:`success`,className:`bg-success hover:opacity-80 focus:outline-2 focus:outline-success focus:outline-offset-2`},{variant:`default`,color:`important`,className:`bg-important hover:opacity-80 focus:outline-2 focus:outline-important focus:outline-offset-2`},{variant:`default`,color:`info`,className:`bg-info hover:opacity-80 focus:outline-2 focus:outline-info focus:outline-offset-2`},{variant:`default`,color:`warning`,className:`bg-warning hover:opacity-80 focus:outline-2 focus:outline-warning focus:outline-offset-2`},{variant:`default`,color:`danger`,className:`bg-danger hover:opacity-80 focus:outline-2 focus:outline-danger focus:outline-offset-2`},{variant:`outline`,color:`primary`,className:`text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary-strong`},{variant:`outline`,color:`secondary`,className:`text-secondary outline-secondary hover:bg-secondary-muted focus:outline-2 focus:outline-secondary`},{variant:`outline`,color:`muted`,className:`text-muted outline-muted-weak hover:bg-muted-muted focus:outline-2 focus:outline-muted-weak`},{variant:`outline`,color:`success`,className:`text-success outline-success hover:bg-success-muted focus:outline-2 focus:outline-success-strong`},{variant:`outline`,color:`info`,className:`text-info outline-info hover:bg-info-muted focus:outline-2 focus:outline-info-strong`},{variant:`outline`,color:`warning`,className:`text-warning outline-warning hover:bg-warning-muted focus:outline-2 focus:outline-warning-strong`},{variant:`outline`,color:`danger`,className:`text-danger outline-danger hover:bg-danger-muted focus:outline-2 focus:outline-danger-strong`},{variant:`soft`,color:`primary`,className:`bg-primary-bg-subtle text-primary hover:bg-primary-muted hover:text-primary-strong focus:bg-primary-weak`},{variant:`soft`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary hover:bg-secondary-muted hover:text-secondary-strong focus:bg-secondary-weak`},{variant:`soft`,color:`muted`,className:`bg-muted-bg-subtle text-muted hover:bg-muted-muted hover:text-muted-strong focus:bg-muted-weak`},{variant:`soft`,color:`success`,className:`bg-success-bg-subtle text-success hover:bg-success-muted hover:text-success-strong focus:bg-success-weak`},{variant:`soft`,color:`info`,className:`bg-info-bg-subtle text-info hover:bg-info-muted hover:text-info-strong focus:bg-info-weak`},{variant:`soft`,color:`warning`,className:`bg-warning-bg-subtle text-warning hover:bg-warning-muted hover:text-warning-strong focus:bg-warning-weak`},{variant:`soft`,color:`danger`,className:`bg-danger-bg-subtle text-danger hover:bg-danger-muted hover:text-danger-strong focus:bg-danger-weak`},{variant:`subtle`,color:`primary`,className:`bg-primary-bg-subtle text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary`},{variant:`subtle`,color:`secondary`,className:`bg-secondary-bg-subtle text-secondary outline-secondary hover:bg-secondary-bg-subtle focus:outline-2 focus:outline-secondary`},{variant:`subtle`,color:`muted`,className:`bg-muted-bg-subtle text-muted outline-border hover:bg-muted-bg-subtle focus:outline-2 focus:outline-border`},{variant:`subtle`,color:`success`,className:`bg-success-bg-subtle text-success outline-success hover:bg-success-bg-subtle focus:outline-2 focus:outline-success`},{variant:`subtle`,color:`info`,className:`bg-info-bg-subtle text-info outline-info hover:bg-info-bg-subtle focus:outline-2 focus:outline-info`},{variant:`subtle`,color:`warning`,className:`bg-warning-bg-subtle text-warning outline-warning hover:bg-warning-bg-subtle focus:outline-2 focus:outline-warning`},{variant:`subtle`,color:`danger`,className:`bg-danger-bg-subtle text-danger outline-danger hover:bg-danger-bg-subtle focus:outline-2 focus:outline-danger`},{variant:`ghost`,color:`primary`,className:`text-primary hover:bg-primary-bg-subtle focus:bg-primary-muted`},{variant:`ghost`,color:`secondary`,className:`text-text-positive-weak hover:bg-secondary-bg-subtle focus:bg-secondary-muted`},{variant:`ghost`,color:`muted`,className:`text-text-positive-weak hover:bg-muted-bg-subtle focus:bg-muted-muted`},{variant:`ghost`,color:`success`,className:`text-success hover:bg-success-bg-subtle focus:bg-success-muted`},{variant:`ghost`,color:`info`,className:`text-info hover:bg-info-bg-subtle focus:bg-info-muted`},{variant:`ghost`,color:`warning`,className:`text-warning hover:bg-warning-bg-subtle focus:bg-warning-muted`},{variant:`ghost`,color:`danger`,className:`text-danger hover:bg-danger-bg-subtle focus:bg-danger-muted`},{variant:`link`,color:`primary`,className:`-outline-offset-2 focus:-outline-offset-2 text-primary focus:outline-2 focus:outline-primary`},{variant:`link`,color:`secondary`,className:`-outline-offset-2 focus:-outline-offset-2 text-secondary focus:outline-2 focus:outline-secondary`},{variant:`link`,color:`muted`,className:`-outline-offset-2 focus:-outline-offset-2 text-muted focus:outline-2 focus:outline-muted`},{variant:`link`,color:`success`,className:`-outline-offset-2 focus:-outline-offset-2 text-success focus:outline-2 focus:outline-success`},{variant:`link`,color:`important`,className:`-outline-offset-2 focus:-outline-offset-2 text-important focus:outline-2 focus:outline-important`},{variant:`link`,color:`info`,className:`-outline-offset-2 focus:-outline-offset-2 text-info focus:outline-2 focus:outline-info`},{variant:`link`,color:`warning`,className:`-outline-offset-2 focus:-outline-offset-2 text-warning focus:outline-2 focus:outline-warning`},{variant:`link`,color:`danger`,className:`-outline-offset-2 focus:-outline-offset-2 text-danger focus:outline-2 focus:outline-danger`}]});export{n,t};
|
|
2
|
-
//# sourceMappingURL=button.variants-CL2rLGYO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.variants-CL2rLGYO.mjs","names":[],"sources":["../packages/components/ui/button.variants.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const buttonLoadingVariant = cva(['pointer-events-none absolute inset-0 top-0 left-0 z-10 flex cursor-default items-center justify-center rounded-sm'], {\n variants: {\n variant: {\n default: '',\n outline: '',\n soft: '',\n subtle: '',\n ghost: '',\n link: '',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n success: '',\n important: '',\n info: '',\n warning: '',\n danger: '',\n },\n },\n compoundVariants: [\n {\n variant: 'default',\n color: 'primary',\n className: 'bg-primary-weak',\n },\n {\n variant: 'default',\n color: 'secondary',\n className: 'bg-secondary-weak',\n },\n { variant: 'default', color: 'muted', className: 'bg-muted-weak' },\n {\n variant: 'default',\n color: 'success',\n className: 'bg-success-weak',\n },\n {\n variant: 'default',\n color: 'info',\n className: 'bg-info-weak',\n },\n {\n variant: 'default',\n color: 'warning',\n className: 'bg-warning-weak',\n },\n {\n variant: 'default',\n color: 'danger',\n className: 'bg-danger-weak',\n },\n {\n variant: 'outline',\n color: 'primary',\n className: 'bg-card outline-1 outline-primary-weak',\n },\n {\n variant: 'outline',\n color: 'secondary',\n className: 'bg-card outline-1 outline-secondary-weak',\n },\n {\n variant: 'outline',\n color: 'muted',\n className: 'bg-card outline-1 outline-muted-weak',\n },\n {\n variant: 'outline',\n color: 'success',\n className: 'bg-card outline-1 outline-success-weak',\n },\n {\n variant: 'outline',\n color: 'info',\n className: 'bg-card outline-1 outline-info-weak',\n },\n {\n variant: 'outline',\n color: 'warning',\n className: 'bg-card outline-1 outline-warning-weak',\n },\n {\n variant: 'outline',\n color: 'danger',\n className: 'bg-card outline-1 outline-danger-weak',\n },\n {\n variant: 'soft',\n color: 'primary',\n className: 'bg-primary-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'muted',\n className: 'bg-muted-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'success',\n className: 'bg-success-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'info',\n className: 'bg-info-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'warning',\n className: 'bg-warning-bg-subtle',\n },\n {\n variant: 'soft',\n color: 'danger',\n className: 'bg-danger-bg-subtle',\n },\n {\n variant: 'subtle',\n color: 'primary',\n className: 'bg-primary-bg-subtle outline-1 outline-primary-weak',\n },\n {\n variant: 'subtle',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle outline-1 outline-secondary-weak',\n },\n {\n variant: 'subtle',\n color: 'muted',\n className: 'bg-muted-bg-subtle outline-1 outline-border-weak',\n },\n {\n variant: 'subtle',\n color: 'success',\n className: 'bg-success-bg-subtle outline-1 outline-success-weak',\n },\n {\n variant: 'subtle',\n color: 'info',\n className: 'bg-info-bg-subtle outline-1 outline-info-weak',\n },\n {\n variant: 'subtle',\n color: 'warning',\n className: 'bg-warning-bg-subtle outline-1 outline-warning-weak',\n },\n {\n variant: 'subtle',\n color: 'danger',\n className: 'bg-danger-bg-subtle outline-1 outline-danger-weak',\n },\n {\n variant: 'ghost',\n color: 'primary',\n className: 'bg-primary-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'muted',\n className: 'bg-muted-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'success',\n className: 'bg-success-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'info',\n className: 'bg-info-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'warning',\n className: 'bg-warning-bg-subtle',\n },\n {\n variant: 'ghost',\n color: 'danger',\n className: 'bg-danger-bg-subtle',\n },\n ],\n});\n\n/**\n * Button variants definition for styling using class-variance-authority\n */\nexport const buttonVariants = cva(\n [\n 'relative cursor-pointer rounded-sm transition-all',\n 'whitespace-normal',\n 'inline-flex items-center justify-center',\n '[&_svg]:pointer-events-none',\n '[&_svg]:shrink-0',\n \"[&_svg:not([class*='size-'])]:size-4\",\n 'disabled:pointer-events-none disabled:cursor-default disabled:opacity-60',\n 'data-[state=loading]:pointer-events-none data-[state=loading]:cursor-default',\n ],\n {\n variants: {\n variant: {\n default: 'text-text-negative outline-0 outline-offset-0',\n outline: 'bg-card outline-1 -outline-offset-1',\n soft: 'outline-none outline-0',\n subtle: 'outline-1 -outline-offset-1',\n ghost: 'outline-0',\n link: '',\n },\n color: {\n primary: '',\n secondary: '',\n muted: '',\n success: '',\n important: '',\n info: '',\n warning: '',\n danger: '',\n },\n size: {\n default: 'gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5',\n xs: 'gap-1 px-2 py-1 font-medium text-xs leading-4',\n sm: 'gap-1.5 px-2.5 py-1.5 font-medium text-xs leading-4',\n md: 'gap-1.5 px-2.5 py-1.5 font-medium text-sm leading-5',\n lg: 'gap-1.5 px-3 py-2 font-medium text-sm leading-5',\n xl: 'gap-2 px-3 py-2 font-medium text-base leading-6',\n icon: 'size-8',\n },\n },\n defaultVariants: {\n variant: 'default',\n color: 'primary',\n size: 'default',\n },\n compoundVariants: [\n {\n variant: 'default',\n color: 'primary',\n className: 'bg-primary hover:opacity-80 focus:outline-2 focus:outline-primary focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'secondary',\n className: 'bg-secondary hover:opacity-80 focus:outline-2 focus:outline-secondary focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'muted',\n className: 'bg-muted hover:opacity-80 focus:outline-2 focus:outline-muted focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'success',\n className: 'bg-success hover:opacity-80 focus:outline-2 focus:outline-success focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'important',\n className: 'bg-important hover:opacity-80 focus:outline-2 focus:outline-important focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'info',\n className: 'bg-info hover:opacity-80 focus:outline-2 focus:outline-info focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'warning',\n className: 'bg-warning hover:opacity-80 focus:outline-2 focus:outline-warning focus:outline-offset-2',\n },\n {\n variant: 'default',\n color: 'danger',\n className: 'bg-danger hover:opacity-80 focus:outline-2 focus:outline-danger focus:outline-offset-2',\n },\n {\n variant: 'outline',\n color: 'primary',\n className: 'text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary-strong',\n },\n {\n variant: 'outline',\n color: 'secondary',\n className: 'text-secondary outline-secondary hover:bg-secondary-muted focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'outline',\n color: 'muted',\n className: 'text-muted outline-muted-weak hover:bg-muted-muted focus:outline-2 focus:outline-muted-weak',\n },\n {\n variant: 'outline',\n color: 'success',\n className: 'text-success outline-success hover:bg-success-muted focus:outline-2 focus:outline-success-strong',\n },\n {\n variant: 'outline',\n color: 'info',\n className: 'text-info outline-info hover:bg-info-muted focus:outline-2 focus:outline-info-strong',\n },\n {\n variant: 'outline',\n color: 'warning',\n className: 'text-warning outline-warning hover:bg-warning-muted focus:outline-2 focus:outline-warning-strong',\n },\n {\n variant: 'outline',\n color: 'danger',\n className: 'text-danger outline-danger hover:bg-danger-muted focus:outline-2 focus:outline-danger-strong',\n },\n {\n variant: 'soft',\n color: 'primary',\n className: 'bg-primary-bg-subtle text-primary hover:bg-primary-muted hover:text-primary-strong focus:bg-primary-weak',\n },\n {\n variant: 'soft',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle text-secondary hover:bg-secondary-muted hover:text-secondary-strong focus:bg-secondary-weak',\n },\n {\n variant: 'soft',\n color: 'muted',\n className: 'bg-muted-bg-subtle text-muted hover:bg-muted-muted hover:text-muted-strong focus:bg-muted-weak',\n },\n {\n variant: 'soft',\n color: 'success',\n className: 'bg-success-bg-subtle text-success hover:bg-success-muted hover:text-success-strong focus:bg-success-weak',\n },\n {\n variant: 'soft',\n color: 'info',\n className: 'bg-info-bg-subtle text-info hover:bg-info-muted hover:text-info-strong focus:bg-info-weak',\n },\n {\n variant: 'soft',\n color: 'warning',\n className: 'bg-warning-bg-subtle text-warning hover:bg-warning-muted hover:text-warning-strong focus:bg-warning-weak',\n },\n {\n variant: 'soft',\n color: 'danger',\n className: 'bg-danger-bg-subtle text-danger hover:bg-danger-muted hover:text-danger-strong focus:bg-danger-weak',\n },\n {\n variant: 'subtle',\n color: 'primary',\n className: 'bg-primary-bg-subtle text-primary outline-primary hover:bg-primary-bg-subtle focus:outline-2 focus:outline-primary',\n },\n {\n variant: 'subtle',\n color: 'secondary',\n className: 'bg-secondary-bg-subtle text-secondary outline-secondary hover:bg-secondary-bg-subtle focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'subtle',\n color: 'muted',\n className: 'bg-muted-bg-subtle text-muted outline-border hover:bg-muted-bg-subtle focus:outline-2 focus:outline-border',\n },\n {\n variant: 'subtle',\n color: 'success',\n className: 'bg-success-bg-subtle text-success outline-success hover:bg-success-bg-subtle focus:outline-2 focus:outline-success',\n },\n {\n variant: 'subtle',\n color: 'info',\n className: 'bg-info-bg-subtle text-info outline-info hover:bg-info-bg-subtle focus:outline-2 focus:outline-info',\n },\n {\n variant: 'subtle',\n color: 'warning',\n className: 'bg-warning-bg-subtle text-warning outline-warning hover:bg-warning-bg-subtle focus:outline-2 focus:outline-warning',\n },\n {\n variant: 'subtle',\n color: 'danger',\n className: 'bg-danger-bg-subtle text-danger outline-danger hover:bg-danger-bg-subtle focus:outline-2 focus:outline-danger',\n },\n {\n variant: 'ghost',\n color: 'primary',\n className: 'text-primary hover:bg-primary-bg-subtle focus:bg-primary-muted',\n },\n {\n variant: 'ghost',\n color: 'secondary',\n className: 'text-text-positive-weak hover:bg-secondary-bg-subtle focus:bg-secondary-muted',\n },\n {\n variant: 'ghost',\n color: 'muted',\n className: 'text-text-positive-weak hover:bg-muted-bg-subtle focus:bg-muted-muted',\n },\n {\n variant: 'ghost',\n color: 'success',\n className: 'text-success hover:bg-success-bg-subtle focus:bg-success-muted',\n },\n {\n variant: 'ghost',\n color: 'info',\n className: 'text-info hover:bg-info-bg-subtle focus:bg-info-muted',\n },\n {\n variant: 'ghost',\n color: 'warning',\n className: 'text-warning hover:bg-warning-bg-subtle focus:bg-warning-muted',\n },\n {\n variant: 'ghost',\n color: 'danger',\n className: 'text-danger hover:bg-danger-bg-subtle focus:bg-danger-muted',\n },\n {\n variant: 'link',\n color: 'primary',\n className: '-outline-offset-2 focus:-outline-offset-2 text-primary focus:outline-2 focus:outline-primary',\n },\n {\n variant: 'link',\n color: 'secondary',\n className: '-outline-offset-2 focus:-outline-offset-2 text-secondary focus:outline-2 focus:outline-secondary',\n },\n {\n variant: 'link',\n color: 'muted',\n className: '-outline-offset-2 focus:-outline-offset-2 text-muted focus:outline-2 focus:outline-muted',\n },\n {\n variant: 'link',\n color: 'success',\n className: '-outline-offset-2 focus:-outline-offset-2 text-success focus:outline-2 focus:outline-success',\n },\n {\n variant: 'link',\n color: 'important',\n className: '-outline-offset-2 focus:-outline-offset-2 text-important focus:outline-2 focus:outline-important',\n },\n {\n variant: 'link',\n color: 'info',\n className: '-outline-offset-2 focus:-outline-offset-2 text-info focus:outline-2 focus:outline-info',\n },\n {\n variant: 'link',\n color: 'warning',\n className: '-outline-offset-2 focus:-outline-offset-2 text-warning focus:outline-2 focus:outline-warning',\n },\n {\n variant: 'link',\n color: 'danger',\n className: '-outline-offset-2 focus:-outline-offset-2 text-danger focus:outline-2 focus:outline-danger',\n },\n ],\n }\n);\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n"],"mappings":"+CAEA,MAAa,EAAuB,EAAI,CAAC,oHAAoH,CAAE,CAC7J,SAAU,CACR,QAAS,CACP,QAAS,GACT,QAAS,GACT,KAAM,GACN,OAAQ,GACR,MAAO,GACP,KAAM,GACP,CACD,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,QAAS,GACT,UAAW,GACX,KAAM,GACN,QAAS,GACT,OAAQ,GACT,CACF,CACD,iBAAkB,CAChB,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,oBACZ,CACD,CAAE,QAAS,UAAW,MAAO,QAAS,UAAW,gBAAiB,CAClE,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,eACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,kBACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,iBACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,2CACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,uCACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,sCACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,yCACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,wCACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,yBACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,qBACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,oBACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,sBACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,YACP,UAAW,0DACZ,CACD,CACE,QAAS,SACT,MAAO,QACP,UAAW,mDACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,OACP,UAAW,gDACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,sDACZ,CACD,CACE,QAAS,SACT,MAAO,SACP,UAAW,oDACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,YACP,UAAW,yBACZ,CACD,CACE,QAAS,QACT,MAAO,QACP,UAAW,qBACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,OACP,UAAW,oBACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,uBACZ,CACD,CACE,QAAS,QACT,MAAO,SACP,UAAW,sBACZ,CACF,CACF,CAAC,CAKW,EAAiB,EAC5B,CACE,oDACA,oBACA,0CACA,8BACA,mBACA,uCACA,2EACA,+EACD,CACD,CACE,SAAU,CACR,QAAS,CACP,QAAS,gDACT,QAAS,sCACT,KAAM,yBACN,OAAQ,8BACR,MAAO,YACP,KAAM,GACP,CACD,MAAO,CACL,QAAS,GACT,UAAW,GACX,MAAO,GACP,QAAS,GACT,UAAW,GACX,KAAM,GACN,QAAS,GACT,OAAQ,GACT,CACD,KAAM,CACJ,QAAS,sDACT,GAAI,gDACJ,GAAI,sDACJ,GAAI,sDACJ,GAAI,kDACJ,GAAI,kDACJ,KAAM,SACP,CACF,CACD,gBAAiB,CACf,QAAS,UACT,MAAO,UACP,KAAM,UACP,CACD,iBAAkB,CAChB,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,+FACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,uFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,+FACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,qFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,2FACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,yFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,uGACZ,CACD,CACE,QAAS,UACT,MAAO,YACP,UAAW,oGACZ,CACD,CACE,QAAS,UACT,MAAO,QACP,UAAW,8FACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,mGACZ,CACD,CACE,QAAS,UACT,MAAO,OACP,UAAW,uFACZ,CACD,CACE,QAAS,UACT,MAAO,UACP,UAAW,mGACZ,CACD,CACE,QAAS,UACT,MAAO,SACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,qHACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,iGACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,4FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,2GACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,sGACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,YACP,UAAW,+HACZ,CACD,CACE,QAAS,SACT,MAAO,QACP,UAAW,6GACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,OACP,UAAW,sGACZ,CACD,CACE,QAAS,SACT,MAAO,UACP,UAAW,qHACZ,CACD,CACE,QAAS,SACT,MAAO,SACP,UAAW,gHACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,YACP,UAAW,gFACZ,CACD,CACE,QAAS,QACT,MAAO,QACP,UAAW,wEACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,OACP,UAAW,wDACZ,CACD,CACE,QAAS,QACT,MAAO,UACP,UAAW,iEACZ,CACD,CACE,QAAS,QACT,MAAO,SACP,UAAW,8DACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,mGACZ,CACD,CACE,QAAS,OACT,MAAO,QACP,UAAW,2FACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,YACP,UAAW,mGACZ,CACD,CACE,QAAS,OACT,MAAO,OACP,UAAW,yFACZ,CACD,CACE,QAAS,OACT,MAAO,UACP,UAAW,+FACZ,CACD,CACE,QAAS,OACT,MAAO,SACP,UAAW,6FACZ,CACF,CACF,CACF"}
|
package/dist/date-CK7XBqG9.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cn as e}from"@customafk/react-toolkit/utils";import{useCallback as t,useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";import{format as i,isThisMonth as a,isThisWeek as o,isThisYear as s,isToday as c,isTomorrow as l,isValid as u,isYesterday as d,parseISO as f}from"@customafk/react-toolkit/date-fns";const p={weekdays:[`Chủ Nhật`,`Thứ Hai`,`Thứ Ba`,`Thứ Tư`,`Thứ Năm`,`Thứ Sáu`,`Thứ Bảy`],weekdaysShort:[`CN`,`T2`,`T3`,`T4`,`T5`,`T6`,`T7`],months:[`Tháng 1`,`Tháng 2`,`Tháng 3`,`Tháng 4`,`Tháng 5`,`Tháng 6`,`Tháng 7`,`Tháng 8`,`Tháng 9`,`Tháng 10`,`Tháng 11`,`Tháng 12`],monthsShort:[`T1`,`T2`,`T3`,`T4`,`T5`,`T6`,`T7`,`T8`,`T9`,`T10`,`T11`,`T12`]},m={"01-01":`Tết Dương lịch`,"03-08":`Quốc tế Phụ nữ`,"04-30":`Ngày Giải phóng miền Nam`,"05-01":`Quốc tế Lao động`,"09-02":`Quốc khánh`,"10-20":`Ngày Phụ nữ Việt Nam`,"11-20":`Ngày Nhà giáo Việt Nam`};Object.freeze({SECOND:1e3,MINUTE:60*1e3,HOUR:3600*1e3,DAY:1440*60*1e3,WEEK:10080*60*1e3,MONTH:720*60*60*1e3,YEAR:365*24*60*60*1e3});const h=Object.freeze({MINUTE:60,HOUR:3600,DAY:1440*60,WEEK:10080*60,MONTH:720*60*60,YEAR:365*24*60*60});Object.freeze({HOUR:60,DAY:1440,WEEK:10080,MONTH:720*60});const g=({date:g,format:_=`medium`,showHoliday:v=!1,showTime:y=!1,className:b=``,title:x})=>{let S=n(()=>{try{if(g instanceof Date)return u(g)?g:null;if(typeof g==`string`){let e=f(g);return u(e)?e:new Date(g)}if(typeof g==`number`){let e=new Date(g);return u(e)?e:null}return null}catch{return null}},[g]),C=t(e=>{let t=new Date,n=Math.floor((t.getTime()-e.getTime())/1e3);return n<60?`Vừa xong`:n<3600?`${Math.floor(n/h.MINUTE)} phút trước`:n<86400?`${Math.floor(n/h.HOUR)} giờ trước`:n<604800?`${Math.floor(n/h.DAY)} ngày trước`:n<2592e3?`${Math.floor(n/h.WEEK)} tuần trước`:n<31536e3?`${Math.floor(n/h.MONTH)} tháng trước`:`${Math.floor(n/h.YEAR)} năm trước`},[]),w=t((e,t=!1)=>{let n=e.getDay();return t?p.weekdaysShort[n]:p.weekdays[n]},[]),T=t((e,t=!1)=>{let n=e.getMonth();return t?p.monthsShort[n]:p.months[n]},[]),E=t(e=>m[i(e,`MM-dd`)]||null,[]),D=t(e=>{if(c(e))return y?`Hôm nay ${i(e,`HH:mm`)}`:`Hôm nay`;if(d(e))return y?`Hôm qua ${i(e,`HH:mm`)}`:`Hôm qua`;if(l(e))return y?`Ngày mai ${i(e,`HH:mm`)}`:`Ngày mai`;if(o(e)){let t=w(e);return y?`${t} ${i(e,`HH:mm`)}`:t}if(a(e)){let t=i(e,`d`);return y?`${t}/${i(e,`M`)} ${i(e,`HH:mm`)}`:`${t}/${i(e,`M`)}`}return s(e)?y?i(e,`d/M HH:mm`):i(e,`d/M`):y?i(e,`d/M/yyyy HH:mm`):i(e,`d/M/yyyy`)},[w,y]),O=t((e,t)=>{let n=y?i(e,`, HH:mm`):``;switch(t){case`short`:return i(e,`d/M/yy`)+n;case`medium`:return i(e,`dd/MM/yyyy`)+n;case`long`:return`${i(e,`d`)} ${T(e)} ${i(e,`yyyy`)}`+n;case`full`:return`${w(e)}, ngày ${i(e,`d`)} ${T(e)} năm ${i(e,`yyyy`)}`+n;case`relative`:return C(e);case`datetime`:return i(e,`d/M/yyyy HH:mm`);case`time`:return i(e,`HH:mm`);case`smart`:return D(e);default:return i(e,`d/M/yyyy`)+n}},[D,T,w,C,y]);if(!S)return r(`span`,{className:e(`text-muted-foreground text-sm`,b),children:`--/--/----`});let k=O(S,_),A=v?E(S):null,j=A?`${k} (${A})`:k,M=x||i(S,`EEEE, d MMMM yyyy HH:mm:ss`);return r(`time`,{dateTime:S.toISOString(),className:e(`text-text-positive-weak text-xs tabular-nums`,b),title:M,children:j})};export{g as t};
|
|
2
|
-
//# sourceMappingURL=date-CK7XBqG9.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-CK7XBqG9.mjs","names":["DateDisplay: React.FC<Props>","date"],"sources":["../packages/constants.tsx","../packages/components/data-display/date.tsx"],"sourcesContent":["// Vietnamese locale configuration\nexport const vietnameseLocale = {\n weekdays: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],\n weekdaysShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],\n months: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],\n monthsShort: ['T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', 'T11', 'T12'],\n};\n\n// Vietnamese holidays\nexport const vietnameseHolidays = {\n '01-01': 'Tết Dương lịch',\n '03-08': 'Quốc tế Phụ nữ',\n '04-30': 'Ngày Giải phóng miền Nam',\n '05-01': 'Quốc tế Lao động',\n '09-02': 'Quốc khánh',\n '10-20': 'Ngày Phụ nữ Việt Nam',\n '11-20': 'Ngày Nhà giáo Việt Nam',\n};\n\n// Time Constants in milliseconds, seconds, and minutes\nexport const TIME_IN_MS = Object.freeze({\n SECOND: 1000,\n MINUTE: 60 * 1000,\n HOUR: 60 * 60 * 1000,\n DAY: 24 * 60 * 60 * 1000,\n WEEK: 7 * 24 * 60 * 60 * 1000,\n MONTH: 30 * 24 * 60 * 60 * 1000, // Approximation for month length = 30 days\n YEAR: 365 * 24 * 60 * 60 * 1000,\n});\n\nexport const TIME_IN_SECONDS = Object.freeze({\n MINUTE: 60,\n HOUR: 60 * 60,\n DAY: 24 * 60 * 60,\n WEEK: 7 * 24 * 60 * 60,\n MONTH: 30 * 24 * 60 * 60,\n YEAR: 365 * 24 * 60 * 60,\n});\n\nexport const TIME_IN_MINUTES = Object.freeze({\n HOUR: 60,\n DAY: 24 * 60,\n WEEK: 7 * 24 * 60,\n MONTH: 30 * 24 * 60,\n});\n","import { useCallback, useMemo } from 'react';\n\nimport { format, isThisMonth, isThisWeek, isThisYear, isToday, isTomorrow, isValid, isYesterday, parseISO } from '@customafk/react-toolkit/date-fns';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { TIME_IN_SECONDS, vietnameseHolidays, vietnameseLocale } from '@/constants';\n\ninterface Props {\n date: Date | string | number;\n format?:\n | 'short' // 15/03/24\n | 'medium' // 15/03/2024\n | 'long' // 15 tháng 3, 2024\n | 'full' // Thứ Sáu, ngày 15 tháng 3 năm 2024\n | 'relative' // 2 giờ trước\n | 'datetime' // 15/03/2024 14:30\n | 'time' // 14:30\n | 'smart'; // Tự động chọn format phù hợp\n showHoliday?: boolean;\n showTime?: boolean;\n className?: string;\n title?: string; // Tooltip khi hover\n}\n\nexport const DateDisplay: React.FC<Props> = ({ date, format: formatType = 'medium', showHoliday = false, showTime = false, className = '', title }) => {\n const parsedDate = useMemo(() => {\n try {\n if (date instanceof Date) {\n return isValid(date) ? date : null;\n }\n if (typeof date === 'string') {\n const parsed = parseISO(date);\n return isValid(parsed) ? parsed : new Date(date);\n }\n if (typeof date === 'number') {\n const parsed = new Date(date);\n return isValid(parsed) ? parsed : null;\n }\n return null;\n } catch {\n return null;\n }\n }, [date]);\n\n // Format relative time in Vietnamese\n const formatRelativeTime = useCallback((date: Date): string => {\n const now = new Date();\n const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n if (diffInSeconds < 60) return 'Vừa xong';\n if (diffInSeconds < 3600) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.MINUTE)} phút trước`;\n if (diffInSeconds < 86400) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.HOUR)} giờ trước`;\n if (diffInSeconds < 604800) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.DAY)} ngày trước`;\n if (diffInSeconds < 2592000) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.WEEK)} tuần trước`;\n if (diffInSeconds < 31536000) return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.MONTH)} tháng trước`;\n return `${Math.floor(diffInSeconds / TIME_IN_SECONDS.YEAR)} năm trước`;\n }, []);\n\n // Vietnamese weekday\n const getVietnameseWeekday = useCallback((date: Date, short: boolean = false): string => {\n const dayIndex = date.getDay();\n return short ? vietnameseLocale.weekdaysShort[dayIndex] : vietnameseLocale.weekdays[dayIndex];\n }, []);\n\n // Vietnamese month\n const getVietnameseMonth = useCallback((date: Date, short: boolean = false): string => {\n const monthIndex = date.getMonth();\n return short ? vietnameseLocale.monthsShort[monthIndex] : vietnameseLocale.months[monthIndex];\n }, []);\n\n // Check holiday\n const getHoliday = useCallback((date: Date): string | null => {\n const monthDay = format(date, 'MM-dd') as keyof typeof vietnameseHolidays;\n return vietnameseHolidays[monthDay] || null;\n }, []);\n\n // Smart format - choose appropriate format based on date\n const getSmartFormat = useCallback(\n (date: Date): string => {\n if (isToday(date)) {\n return showTime ? `Hôm nay ${format(date, 'HH:mm')}` : 'Hôm nay';\n }\n if (isYesterday(date)) {\n return showTime ? `Hôm qua ${format(date, 'HH:mm')}` : 'Hôm qua';\n }\n if (isTomorrow(date)) {\n return showTime ? `Ngày mai ${format(date, 'HH:mm')}` : 'Ngày mai';\n }\n if (isThisWeek(date)) {\n const weekday = getVietnameseWeekday(date);\n return showTime ? `${weekday} ${format(date, 'HH:mm')}` : weekday;\n }\n if (isThisMonth(date)) {\n const day = format(date, 'd');\n return showTime ? `${day}/${format(date, 'M')} ${format(date, 'HH:mm')}` : `${day}/${format(date, 'M')}`;\n }\n if (isThisYear(date)) {\n return showTime ? format(date, 'd/M HH:mm') : format(date, 'd/M');\n }\n return showTime ? format(date, 'd/M/yyyy HH:mm') : format(date, 'd/M/yyyy');\n },\n [getVietnameseWeekday, showTime]\n );\n\n // Main formatting function\n const formatDate = useCallback(\n (date: Date, type: string): string => {\n const timeStr = showTime ? format(date, ', HH:mm') : '';\n\n switch (type) {\n case 'short':\n return format(date, 'd/M/yy') + timeStr;\n\n case 'medium':\n return format(date, 'dd/MM/yyyy') + timeStr;\n\n case 'long':\n return `${format(date, 'd')} ${getVietnameseMonth(date)} ${format(date, 'yyyy')}` + timeStr;\n\n case 'full': {\n const data = `${getVietnameseWeekday(date)}, ngày ${format(date, 'd')} ${getVietnameseMonth(date)} năm ${format(date, 'yyyy')}`;\n return data + timeStr;\n }\n\n case 'relative':\n return formatRelativeTime(date);\n\n case 'datetime':\n return format(date, 'd/M/yyyy HH:mm');\n\n case 'time':\n return format(date, 'HH:mm');\n\n case 'smart':\n return getSmartFormat(date);\n\n default:\n return format(date, 'd/M/yyyy') + timeStr;\n }\n },\n [getSmartFormat, getVietnameseMonth, getVietnameseWeekday, formatRelativeTime, showTime]\n );\n\n if (!parsedDate) {\n return <span className={cn('text-muted-foreground text-sm', className)}>--/--/----</span>;\n }\n\n const formattedDate = formatDate(parsedDate, formatType);\n const holiday = showHoliday ? getHoliday(parsedDate) : null;\n const displayText = holiday ? `${formattedDate} (${holiday})` : formattedDate;\n const tooltipTitle = title || format(parsedDate, 'EEEE, d MMMM yyyy HH:mm:ss');\n\n return (\n <time dateTime={parsedDate.toISOString()} className={cn('text-text-positive-weak text-xs tabular-nums', className)} title={tooltipTitle}>\n {displayText}\n </time>\n );\n};\n"],"mappings":"kUACA,MAAa,EAAmB,CAC9B,SAAU,CAAC,WAAY,UAAW,SAAU,SAAU,UAAW,UAAW,UAAU,CACtF,cAAe,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,CACzD,OAAQ,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,WAAY,WAAY,WAAW,CAC/I,YAAa,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAAO,MAAO,MAAM,CACzF,CAGY,EAAqB,CAChC,QAAS,iBACT,QAAS,iBACT,QAAS,2BACT,QAAS,mBACT,QAAS,aACT,QAAS,uBACT,QAAS,yBACV,CAGyB,OAAO,OAAO,CACtC,OAAQ,IACR,OAAQ,GAAK,IACb,KAAM,KAAU,IAChB,IAAK,KAAU,GAAK,IACpB,KAAM,MAAc,GAAK,IACzB,MAAO,IAAU,GAAK,GAAK,IAC3B,KAAM,IAAM,GAAK,GAAK,GAAK,IAC5B,CAAC,CAEF,MAAa,EAAkB,OAAO,OAAO,CAC3C,OAAQ,GACR,KAAM,KACN,IAAK,KAAU,GACf,KAAM,MAAc,GACpB,MAAO,IAAU,GAAK,GACtB,KAAM,IAAM,GAAK,GAAK,GACvB,CAAC,CAE6B,OAAO,OAAO,CAC3C,KAAM,GACN,IAAK,KACL,KAAM,MACN,MAAO,IAAU,GAClB,CAAC,CCpBF,MAAaA,GAAgC,CAAE,OAAM,OAAQ,EAAa,SAAU,cAAc,GAAO,WAAW,GAAO,YAAY,GAAI,WAAY,CACrJ,IAAM,EAAa,MAAc,CAC/B,GAAI,CACF,GAAI,aAAgB,KAClB,OAAO,EAAQ,EAAK,CAAG,EAAO,KAEhC,GAAI,OAAO,GAAS,SAAU,CAC5B,IAAM,EAAS,EAAS,EAAK,CAC7B,OAAO,EAAQ,EAAO,CAAG,EAAS,IAAI,KAAK,EAAK,CAElD,GAAI,OAAO,GAAS,SAAU,CAC5B,IAAM,EAAS,IAAI,KAAK,EAAK,CAC7B,OAAO,EAAQ,EAAO,CAAG,EAAS,KAEpC,OAAO,UACD,CACN,OAAO,OAER,CAAC,EAAK,CAAC,CAGJ,EAAqB,EAAa,GAAuB,CAC7D,IAAM,EAAM,IAAI,KACV,EAAgB,KAAK,OAAO,EAAI,SAAS,CAAGC,EAAK,SAAS,EAAI,IAAK,CAQzE,OANI,EAAgB,GAAW,WAC3B,EAAgB,KAAa,GAAG,KAAK,MAAM,EAAgB,EAAgB,OAAO,CAAC,aACnF,EAAgB,MAAc,GAAG,KAAK,MAAM,EAAgB,EAAgB,KAAK,CAAC,YAClF,EAAgB,OAAe,GAAG,KAAK,MAAM,EAAgB,EAAgB,IAAI,CAAC,aAClF,EAAgB,OAAgB,GAAG,KAAK,MAAM,EAAgB,EAAgB,KAAK,CAAC,aACpF,EAAgB,QAAiB,GAAG,KAAK,MAAM,EAAgB,EAAgB,MAAM,CAAC,cACnF,GAAG,KAAK,MAAM,EAAgB,EAAgB,KAAK,CAAC,aAC1D,EAAE,CAAC,CAGA,EAAuB,GAAa,EAAY,EAAiB,KAAkB,CACvF,IAAM,EAAWA,EAAK,QAAQ,CAC9B,OAAO,EAAQ,EAAiB,cAAc,GAAY,EAAiB,SAAS,IACnF,EAAE,CAAC,CAGA,EAAqB,GAAa,EAAY,EAAiB,KAAkB,CACrF,IAAM,EAAaA,EAAK,UAAU,CAClC,OAAO,EAAQ,EAAiB,YAAY,GAAc,EAAiB,OAAO,IACjF,EAAE,CAAC,CAGA,EAAa,EAAa,GAEvB,EADU,EAAOA,EAAM,QAAQ,GACC,KACtC,EAAE,CAAC,CAGA,EAAiB,EACpB,GAAuB,CACtB,GAAI,EAAQA,EAAK,CACf,OAAO,EAAW,WAAW,EAAOA,EAAM,QAAQ,GAAK,UAEzD,GAAI,EAAYA,EAAK,CACnB,OAAO,EAAW,WAAW,EAAOA,EAAM,QAAQ,GAAK,UAEzD,GAAI,EAAWA,EAAK,CAClB,OAAO,EAAW,YAAY,EAAOA,EAAM,QAAQ,GAAK,WAE1D,GAAI,EAAWA,EAAK,CAAE,CACpB,IAAM,EAAU,EAAqBA,EAAK,CAC1C,OAAO,EAAW,GAAG,EAAQ,GAAG,EAAOA,EAAM,QAAQ,GAAK,EAE5D,GAAI,EAAYA,EAAK,CAAE,CACrB,IAAM,EAAM,EAAOA,EAAM,IAAI,CAC7B,OAAO,EAAW,GAAG,EAAI,GAAG,EAAOA,EAAM,IAAI,CAAC,GAAG,EAAOA,EAAM,QAAQ,GAAK,GAAG,EAAI,GAAG,EAAOA,EAAM,IAAI,GAKxG,OAHI,EAAWA,EAAK,CACX,EAAW,EAAOA,EAAM,YAAY,CAAG,EAAOA,EAAM,MAAM,CAE5D,EAAW,EAAOA,EAAM,iBAAiB,CAAG,EAAOA,EAAM,WAAW,EAE7E,CAAC,EAAsB,EAAS,CACjC,CAGK,EAAa,GAChB,EAAY,IAAyB,CACpC,IAAM,EAAU,EAAW,EAAOA,EAAM,UAAU,CAAG,GAErD,OAAQ,EAAR,CACE,IAAK,QACH,OAAO,EAAOA,EAAM,SAAS,CAAG,EAElC,IAAK,SACH,OAAO,EAAOA,EAAM,aAAa,CAAG,EAEtC,IAAK,OACH,MAAO,GAAG,EAAOA,EAAM,IAAI,CAAC,GAAG,EAAmBA,EAAK,CAAC,GAAG,EAAOA,EAAM,OAAO,GAAK,EAEtF,IAAK,OAEH,MADa,GAAG,EAAqBA,EAAK,CAAC,SAAS,EAAOA,EAAM,IAAI,CAAC,GAAG,EAAmBA,EAAK,CAAC,OAAO,EAAOA,EAAM,OAAO,GAC/G,EAGhB,IAAK,WACH,OAAO,EAAmBA,EAAK,CAEjC,IAAK,WACH,OAAO,EAAOA,EAAM,iBAAiB,CAEvC,IAAK,OACH,OAAO,EAAOA,EAAM,QAAQ,CAE9B,IAAK,QACH,OAAO,EAAeA,EAAK,CAE7B,QACE,OAAO,EAAOA,EAAM,WAAW,CAAG,IAGxC,CAAC,EAAgB,EAAoB,EAAsB,EAAoB,EAAS,CACzF,CAED,GAAI,CAAC,EACH,OAAO,EAAC,OAAA,CAAK,UAAW,EAAG,gCAAiC,EAAU,UAAE,cAAiB,CAG3F,IAAM,EAAgB,EAAW,EAAY,EAAW,CAClD,EAAU,EAAc,EAAW,EAAW,CAAG,KACjD,EAAc,EAAU,GAAG,EAAc,IAAI,EAAQ,GAAK,EAC1D,EAAe,GAAS,EAAO,EAAY,6BAA6B,CAE9E,OACE,EAAC,OAAA,CAAK,SAAU,EAAW,aAAa,CAAE,UAAW,EAAG,+CAAgD,EAAU,CAAE,MAAO,WACxH,GACI"}
|
package/dist/date-CTmoK8tv.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`@customafk/react-toolkit/utils`),n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@customafk/react-toolkit/date-fns`);const a={weekdays:[`Chủ Nhật`,`Thứ Hai`,`Thứ Ba`,`Thứ Tư`,`Thứ Năm`,`Thứ Sáu`,`Thứ Bảy`],weekdaysShort:[`CN`,`T2`,`T3`,`T4`,`T5`,`T6`,`T7`],months:[`Tháng 1`,`Tháng 2`,`Tháng 3`,`Tháng 4`,`Tháng 5`,`Tháng 6`,`Tháng 7`,`Tháng 8`,`Tháng 9`,`Tháng 10`,`Tháng 11`,`Tháng 12`],monthsShort:[`T1`,`T2`,`T3`,`T4`,`T5`,`T6`,`T7`,`T8`,`T9`,`T10`,`T11`,`T12`]},o={"01-01":`Tết Dương lịch`,"03-08":`Quốc tế Phụ nữ`,"04-30":`Ngày Giải phóng miền Nam`,"05-01":`Quốc tế Lao động`,"09-02":`Quốc khánh`,"10-20":`Ngày Phụ nữ Việt Nam`,"11-20":`Ngày Nhà giáo Việt Nam`},s=Object.freeze({SECOND:1e3,MINUTE:60*1e3,HOUR:3600*1e3,DAY:1440*60*1e3,WEEK:10080*60*1e3,MONTH:720*60*60*1e3,YEAR:365*24*60*60*1e3}),c=Object.freeze({MINUTE:60,HOUR:3600,DAY:1440*60,WEEK:10080*60,MONTH:720*60*60,YEAR:365*24*60*60}),l=Object.freeze({HOUR:60,DAY:1440,WEEK:10080,MONTH:720*60}),u=({date:e,format:s=`medium`,showHoliday:l=!1,showTime:u=!1,className:d=``,title:f})=>{let p=(0,n.useMemo)(()=>{try{if(e instanceof Date)return(0,i.isValid)(e)?e:null;if(typeof e==`string`){let t=(0,i.parseISO)(e);return(0,i.isValid)(t)?t:new Date(e)}if(typeof e==`number`){let t=new Date(e);return(0,i.isValid)(t)?t:null}return null}catch{return null}},[e]),m=(0,n.useCallback)(e=>{let t=new Date,n=Math.floor((t.getTime()-e.getTime())/1e3);return n<60?`Vừa xong`:n<3600?`${Math.floor(n/c.MINUTE)} phút trước`:n<86400?`${Math.floor(n/c.HOUR)} giờ trước`:n<604800?`${Math.floor(n/c.DAY)} ngày trước`:n<2592e3?`${Math.floor(n/c.WEEK)} tuần trước`:n<31536e3?`${Math.floor(n/c.MONTH)} tháng trước`:`${Math.floor(n/c.YEAR)} năm trước`},[]),h=(0,n.useCallback)((e,t=!1)=>{let n=e.getDay();return t?a.weekdaysShort[n]:a.weekdays[n]},[]),g=(0,n.useCallback)((e,t=!1)=>{let n=e.getMonth();return t?a.monthsShort[n]:a.months[n]},[]),_=(0,n.useCallback)(e=>o[(0,i.format)(e,`MM-dd`)]||null,[]),v=(0,n.useCallback)(e=>{if((0,i.isToday)(e))return u?`Hôm nay ${(0,i.format)(e,`HH:mm`)}`:`Hôm nay`;if((0,i.isYesterday)(e))return u?`Hôm qua ${(0,i.format)(e,`HH:mm`)}`:`Hôm qua`;if((0,i.isTomorrow)(e))return u?`Ngày mai ${(0,i.format)(e,`HH:mm`)}`:`Ngày mai`;if((0,i.isThisWeek)(e)){let t=h(e);return u?`${t} ${(0,i.format)(e,`HH:mm`)}`:t}if((0,i.isThisMonth)(e)){let t=(0,i.format)(e,`d`);return u?`${t}/${(0,i.format)(e,`M`)} ${(0,i.format)(e,`HH:mm`)}`:`${t}/${(0,i.format)(e,`M`)}`}return(0,i.isThisYear)(e)?u?(0,i.format)(e,`d/M HH:mm`):(0,i.format)(e,`d/M`):u?(0,i.format)(e,`d/M/yyyy HH:mm`):(0,i.format)(e,`d/M/yyyy`)},[h,u]),y=(0,n.useCallback)((e,t)=>{let n=u?(0,i.format)(e,`, HH:mm`):``;switch(t){case`short`:return(0,i.format)(e,`d/M/yy`)+n;case`medium`:return(0,i.format)(e,`dd/MM/yyyy`)+n;case`long`:return`${(0,i.format)(e,`d`)} ${g(e)} ${(0,i.format)(e,`yyyy`)}`+n;case`full`:return`${h(e)}, ngày ${(0,i.format)(e,`d`)} ${g(e)} năm ${(0,i.format)(e,`yyyy`)}`+n;case`relative`:return m(e);case`datetime`:return(0,i.format)(e,`d/M/yyyy HH:mm`);case`time`:return(0,i.format)(e,`HH:mm`);case`smart`:return v(e);default:return(0,i.format)(e,`d/M/yyyy`)+n}},[v,g,h,m,u]);if(!p)return(0,r.jsx)(`span`,{className:(0,t.cn)(`text-muted-foreground text-sm`,d),children:`--/--/----`});let b=y(p,s),x=l?_(p):null,S=x?`${b} (${x})`:b,C=f||(0,i.format)(p,`EEEE, d MMMM yyyy HH:mm:ss`);return(0,r.jsx)(`time`,{dateTime:p.toISOString(),className:(0,t.cn)(`text-text-positive-weak text-xs tabular-nums`,d),title:C,children:S})};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
2
|
-
//# sourceMappingURL=date-CTmoK8tv.cjs.map
|