@trsys-tech/matrix-library 0.6.0 → 1.0.0-canary.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/accordion.es.js +27 -27
- package/dist/accordion.es.js.map +1 -1
- package/dist/avatar.es.js +28 -14
- package/dist/avatar.es.js.map +1 -1
- package/dist/badge.es.js +24 -24
- package/dist/badge.es.js.map +1 -1
- package/dist/breadcrumb.es.js +34 -24
- package/dist/breadcrumb.es.js.map +1 -1
- package/dist/button.es.js +28 -28
- package/dist/button.es.js.map +1 -1
- package/dist/calendar.es.js +64 -61
- package/dist/calendar.es.js.map +1 -1
- package/dist/card.es.js +21 -21
- package/dist/card.es.js.map +1 -1
- package/dist/checkbox.es.js +15 -15
- package/dist/checkbox.es.js.map +1 -1
- package/dist/chip.es.js +24 -24
- package/dist/chip.es.js.map +1 -1
- package/dist/collapsible.es.js +17 -17
- package/dist/collapsible.es.js.map +1 -1
- package/dist/combobox.es.js +79 -70
- package/dist/combobox.es.js.map +1 -1
- package/dist/command.es.js +62 -59
- package/dist/command.es.js.map +1 -1
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/badge/Badge.d.ts +2 -2
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/command/Command.d.ts.map +1 -1
- package/dist/components/confirm/Confirm.d.ts.map +1 -1
- package/dist/components/context-menu/ContextMenu.d.ts.map +1 -1
- package/dist/components/data-grid/DataGrid.d.ts.map +1 -1
- package/dist/components/date-picker/TimePickerContent.d.ts.map +1 -1
- package/dist/components/date-picker/calendar.d.ts.map +1 -1
- package/dist/components/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/SwipableDrawer.d.ts.map +1 -1
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/icon-botton/IconButton.d.ts +2 -2
- package/dist/components/icon-botton/IconButton.d.ts.map +1 -1
- package/dist/components/label/Label.d.ts +1 -1
- package/dist/components/label/Label.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.d.ts +2 -2
- package/dist/components/progress/Progress.d.ts.map +1 -1
- package/dist/components/rating/Rating.d.ts +2 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/sheet/Sheet.d.ts +2 -2
- package/dist/components/sheet/Sheet.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/switch/Switch.d.ts +2 -2
- package/dist/components/text-field/TextField.d.ts.map +1 -1
- package/dist/components/toast/toast-components.d.ts +4 -4
- package/dist/components/toast/toast-components.d.ts.map +1 -1
- package/dist/confirm.es.js +18 -8
- package/dist/confirm.es.js.map +1 -1
- package/dist/contextmenu.es.js +77 -70
- package/dist/contextmenu.es.js.map +1 -1
- package/dist/datagrid.es.js +101 -97
- package/dist/datagrid.es.js.map +1 -1
- package/dist/desktopdatepicker.es.js +30 -30
- package/dist/desktopdatepicker.es.js.map +1 -1
- package/dist/desktopdaterangepicker.es.js +44 -44
- package/dist/desktopdaterangepicker.es.js.map +1 -1
- package/dist/desktoptimepicker.es.js +24 -24
- package/dist/desktoptimepicker.es.js.map +1 -1
- package/dist/dialog.es.js +43 -43
- package/dist/dialog.es.js.map +1 -1
- package/dist/drawer.es.js +27 -27
- package/dist/drawer.es.js.map +1 -1
- package/dist/duration.es.js +34 -34
- package/dist/duration.es.js.map +1 -1
- package/dist/form.es.js +20 -20
- package/dist/form.es.js.map +1 -1
- package/dist/formcheckbox.es.js +13 -13
- package/dist/formcheckbox.es.js.map +1 -1
- package/dist/formcombobox.es.js +17 -17
- package/dist/formcombobox.es.js.map +1 -1
- package/dist/formdatepicker.es.js +12 -12
- package/dist/formdatepicker.es.js.map +1 -1
- package/dist/formdaterangepicker.es.js +16 -16
- package/dist/formdaterangepicker.es.js.map +1 -1
- package/dist/formduration.es.js +13 -13
- package/dist/formduration.es.js.map +1 -1
- package/dist/forminput.es.js +10 -10
- package/dist/forminput.es.js.map +1 -1
- package/dist/formmultiselect.es.js +7 -7
- package/dist/formmultiselect.es.js.map +1 -1
- package/dist/formrating.es.js +21 -21
- package/dist/formrating.es.js.map +1 -1
- package/dist/formselect.es.js +28 -28
- package/dist/formselect.es.js.map +1 -1
- package/dist/formswitch.es.js +14 -14
- package/dist/formswitch.es.js.map +1 -1
- package/dist/formtextarea.es.js +12 -12
- package/dist/formtextarea.es.js.map +1 -1
- package/dist/formtimepicker.es.js +12 -12
- package/dist/formtimepicker.es.js.map +1 -1
- package/dist/iconbutton.es.js +22 -22
- package/dist/iconbutton.es.js.map +1 -1
- package/dist/label.es.js +6 -6
- package/dist/label.es.js.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/mobiledatepicker.es.js +42 -42
- package/dist/mobiledatepicker.es.js.map +1 -1
- package/dist/mobiledaterangepicker.es.js +50 -50
- package/dist/mobiledaterangepicker.es.js.map +1 -1
- package/dist/mobiletimepicker.es.js +30 -30
- package/dist/mobiletimepicker.es.js.map +1 -1
- package/dist/modal.es.js +48 -44
- package/dist/modal.es.js.map +1 -1
- package/dist/multiselect.es.js +120 -120
- package/dist/multiselect.es.js.map +1 -1
- package/dist/popover.es.js +16 -16
- package/dist/popover.es.js.map +1 -1
- package/dist/progress.es.js +29 -21
- package/dist/progress.es.js.map +1 -1
- package/dist/radiogroup.es.js +16 -16
- package/dist/radiogroup.es.js.map +1 -1
- package/dist/rating.es.js +76 -76
- package/dist/rating.es.js.map +1 -1
- package/dist/select.es.js +82 -63
- package/dist/select.es.js.map +1 -1
- package/dist/separator.es.js +13 -13
- package/dist/separator.es.js.map +1 -1
- package/dist/sheet.es.js +44 -44
- package/dist/sheet.es.js.map +1 -1
- package/dist/sidebar.es.js +245 -233
- package/dist/sidebar.es.js.map +1 -1
- package/dist/skeleton.es.js +6 -6
- package/dist/skeleton.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/swipabledrawer.es.js +41 -38
- package/dist/swipabledrawer.es.js.map +1 -1
- package/dist/switch.es.js +16 -16
- package/dist/switch.es.js.map +1 -1
- package/dist/tabs.es.js +22 -22
- package/dist/tabs.es.js.map +1 -1
- package/dist/textarea.es.js +12 -12
- package/dist/textarea.es.js.map +1 -1
- package/dist/textfield.es.js +37 -37
- package/dist/textfield.es.js.map +1 -1
- package/dist/timepickercontent.es.js +63 -56
- package/dist/timepickercontent.es.js.map +1 -1
- package/dist/toast-components.es.js +47 -44
- package/dist/toast-components.es.js.map +1 -1
- package/dist/toast.es.js +24 -24
- package/dist/toast.es.js.map +1 -1
- package/dist/tooltip.es.js +16 -16
- package/dist/tooltip.es.js.map +1 -1
- package/dist/utils.es.js +6 -5
- package/dist/utils.es.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Drawer as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
|
|
1
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Drawer as r } from "vaul";
|
|
4
|
+
import { cn as l } from "./utils.es.js";
|
|
5
|
+
const w = ({ shouldScaleBackground: e = !0, ...t }) => /* @__PURE__ */ a(r.Root, { shouldScaleBackground: e, ...t });
|
|
6
|
+
w.displayName = "SwipableDrawer";
|
|
7
|
+
const p = r.Trigger;
|
|
8
|
+
p.displayName = "SwipableDrawerTrigger";
|
|
9
|
+
const d = r.Portal, n = r.Close;
|
|
10
|
+
n.displayName = "SwipableDrawerClose";
|
|
11
|
+
const x = i.forwardRef(({ className: e, ...t }, m) => /* @__PURE__ */ a(r.Overlay, { ref: m, className: l("mtx-fixed mtx-inset-0 mtx-z-50 mtx-bg-black/80", e), ...t }));
|
|
12
|
+
x.displayName = "SwipableDrawerOverlay";
|
|
13
|
+
const c = i.forwardRef(({ className: e, children: t, ...m }, s) => /* @__PURE__ */ o(d, { children: [
|
|
14
|
+
/* @__PURE__ */ a(x, {}),
|
|
15
|
+
/* @__PURE__ */ o(
|
|
16
|
+
r.Content,
|
|
17
17
|
{
|
|
18
|
-
ref:
|
|
19
|
-
className:
|
|
20
|
-
|
|
18
|
+
ref: s,
|
|
19
|
+
className: l(
|
|
20
|
+
"mtx-fixed mtx-inset-x-0 mtx-bottom-0 mtx-z-50 mtx-mt-24 mtx-flex mtx-h-auto mtx-flex-col mtx-rounded-t-[10px] mtx-border mtx-bg-background",
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
...m,
|
|
21
24
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
25
|
+
/* @__PURE__ */ a("div", { className: "mtx-mx-auto mtx-my-2 mtx-h-1.5 mtx-w-[100px] mtx-rounded-full mtx-bg-muted" }),
|
|
26
|
+
t
|
|
24
27
|
]
|
|
25
28
|
}
|
|
26
29
|
)
|
|
27
30
|
] }));
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
31
|
+
c.displayName = "SwipableDrawerContent";
|
|
32
|
+
const b = ({ className: e, ...t }) => /* @__PURE__ */ a("div", { className: l("mtx-grid mtx-gap-1.5 mtx-p-4 mtx-text-center sm:mtx-text-left", e), ...t });
|
|
33
|
+
b.displayName = "SwipableDrawerHeader";
|
|
34
|
+
const D = ({ className: e, ...t }) => /* @__PURE__ */ a("div", { className: l("mtx-mt-auto mtx-flex mtx-flex-col mtx-gap-2 mtx-p-4", e), ...t });
|
|
35
|
+
D.displayName = "SwipableDrawerFooter";
|
|
36
|
+
const f = i.forwardRef(({ className: e, ...t }, m) => /* @__PURE__ */ a(r.Title, { ref: m, className: l("mtx-text-lg mtx-font-semibold mtx-leading-none mtx-tracking-tight", e), ...t }));
|
|
37
|
+
f.displayName = "SwipableDrawerTitle";
|
|
38
|
+
const S = i.forwardRef(({ className: e, ...t }, m) => /* @__PURE__ */ a(r.Description, { ref: m, className: l("mtx-text-sm mtx-text-muted-foreground", e), ...t }));
|
|
39
|
+
S.displayName = "SwipableDrawerDescription";
|
|
37
40
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
w as SwipableDrawer,
|
|
42
|
+
n as SwipableDrawerClose,
|
|
43
|
+
c as SwipableDrawerContent,
|
|
44
|
+
S as SwipableDrawerDescription,
|
|
45
|
+
D as SwipableDrawerFooter,
|
|
46
|
+
b as SwipableDrawerHeader,
|
|
47
|
+
f as SwipableDrawerTitle,
|
|
48
|
+
p as SwipableDrawerTrigger
|
|
46
49
|
};
|
|
47
50
|
//# sourceMappingURL=swipabledrawer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipabledrawer.es.js","sources":["../src/components/drawer/SwipableDrawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Drawer as DrawerPrimitive } from \"vaul\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst SwipableDrawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\r\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\r\n);\r\nSwipableDrawer.displayName = \"SwipableDrawer\";\r\ntype SwipableDrawerProps = React.ComponentProps<typeof SwipableDrawer>;\r\n\r\nconst SwipableDrawerTrigger = DrawerPrimitive.Trigger;\r\nSwipableDrawerTrigger.displayName = \"SwipableDrawerTrigger\";\r\ntype SwipableDrawerTriggerProps = React.ComponentProps<typeof SwipableDrawerTrigger>;\r\n\r\nconst SwipableDrawerPortal = DrawerPrimitive.Portal;\r\n\r\nconst SwipableDrawerClose = DrawerPrimitive.Close;\r\nSwipableDrawerClose.displayName = \"SwipableDrawerClose\";\r\ntype SwipableDrawerCloseProps = React.ComponentProps<typeof SwipableDrawerClose>;\r\n\r\nconst SwipableDrawerOverlay = React.forwardRef<\r\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\r\n>(({ className, ...props }, ref) => <DrawerPrimitive.Overlay ref={ref} className={cn(\"fixed inset-0 z-50 bg-black/80\", className)} {...props}
|
|
1
|
+
{"version":3,"file":"swipabledrawer.es.js","sources":["../src/components/drawer/SwipableDrawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Drawer as DrawerPrimitive } from \"vaul\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst SwipableDrawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\r\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\r\n);\r\nSwipableDrawer.displayName = \"SwipableDrawer\";\r\ntype SwipableDrawerProps = React.ComponentProps<typeof SwipableDrawer>;\r\n\r\nconst SwipableDrawerTrigger = DrawerPrimitive.Trigger;\r\nSwipableDrawerTrigger.displayName = \"SwipableDrawerTrigger\";\r\ntype SwipableDrawerTriggerProps = React.ComponentProps<typeof SwipableDrawerTrigger>;\r\n\r\nconst SwipableDrawerPortal = DrawerPrimitive.Portal;\r\n\r\nconst SwipableDrawerClose = DrawerPrimitive.Close;\r\nSwipableDrawerClose.displayName = \"SwipableDrawerClose\";\r\ntype SwipableDrawerCloseProps = React.ComponentProps<typeof SwipableDrawerClose>;\r\n\r\nconst SwipableDrawerOverlay = React.forwardRef<\r\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\r\n>(({ className, ...props }, ref) => (\r\n <DrawerPrimitive.Overlay ref={ref} className={cn(\"mtx-fixed mtx-inset-0 mtx-z-50 mtx-bg-black/80\", className)} {...props} />\r\n));\r\nSwipableDrawerOverlay.displayName = \"SwipableDrawerOverlay\";\r\n\r\nconst SwipableDrawerContent = React.forwardRef<\r\n React.ElementRef<typeof DrawerPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\r\n>(({ className, children, ...props }, ref) => (\r\n <SwipableDrawerPortal>\r\n <SwipableDrawerOverlay />\r\n <DrawerPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"mtx-fixed mtx-inset-x-0 mtx-bottom-0 mtx-z-50 mtx-mt-24 mtx-flex mtx-h-auto mtx-flex-col mtx-rounded-t-[10px] mtx-border mtx-bg-background\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <div className=\"mtx-mx-auto mtx-my-2 mtx-h-1.5 mtx-w-[100px] mtx-rounded-full mtx-bg-muted\" />\r\n {children}\r\n </DrawerPrimitive.Content>\r\n </SwipableDrawerPortal>\r\n));\r\nSwipableDrawerContent.displayName = \"SwipableDrawerContent\";\r\ntype SwipableDrawerContentProps = React.ComponentProps<typeof SwipableDrawerContent>;\r\n\r\nconst SwipableDrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div className={cn(\"mtx-grid mtx-gap-1.5 mtx-p-4 mtx-text-center sm:mtx-text-left\", className)} {...props} />\r\n);\r\nSwipableDrawerHeader.displayName = \"SwipableDrawerHeader\";\r\ntype SwipableDrawerHeaderProps = React.ComponentProps<typeof SwipableDrawerHeader>;\r\n\r\nconst SwipableDrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div className={cn(\"mtx-mt-auto mtx-flex mtx-flex-col mtx-gap-2 mtx-p-4\", className)} {...props} />\r\n);\r\nSwipableDrawerFooter.displayName = \"SwipableDrawerFooter\";\r\ntype SwipableDrawerFooterProps = React.ComponentProps<typeof SwipableDrawerFooter>;\r\n\r\nconst SwipableDrawerTitle = React.forwardRef<\r\n React.ElementRef<typeof DrawerPrimitive.Title>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\r\n>(({ className, ...props }, ref) => (\r\n <DrawerPrimitive.Title ref={ref} className={cn(\"mtx-text-lg mtx-font-semibold mtx-leading-none mtx-tracking-tight\", className)} {...props} />\r\n));\r\nSwipableDrawerTitle.displayName = \"SwipableDrawerTitle\";\r\ntype SwipableDrawerTitleProps = React.ComponentProps<typeof SwipableDrawerTitle>;\r\n\r\nconst SwipableDrawerDescription = React.forwardRef<\r\n React.ElementRef<typeof DrawerPrimitive.Description>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\r\n>(({ className, ...props }, ref) => (\r\n <DrawerPrimitive.Description ref={ref} className={cn(\"mtx-text-sm mtx-text-muted-foreground\", className)} {...props} />\r\n));\r\nSwipableDrawerDescription.displayName = \"SwipableDrawerDescription\";\r\ntype SwipableDrawerDescriptionProps = React.ComponentProps<typeof SwipableDrawerDescription>;\r\n\r\nexport {\r\n SwipableDrawer,\r\n SwipableDrawerTrigger,\r\n SwipableDrawerClose,\r\n SwipableDrawerContent,\r\n SwipableDrawerHeader,\r\n SwipableDrawerFooter,\r\n SwipableDrawerTitle,\r\n SwipableDrawerDescription,\r\n type SwipableDrawerProps,\r\n type SwipableDrawerTriggerProps,\r\n type SwipableDrawerCloseProps,\r\n type SwipableDrawerContentProps,\r\n type SwipableDrawerHeaderProps,\r\n type SwipableDrawerFooterProps,\r\n type SwipableDrawerTitleProps,\r\n type SwipableDrawerDescriptionProps,\r\n};\r\n"],"names":["SwipableDrawer","shouldScaleBackground","props","jsx","DrawerPrimitive","SwipableDrawerTrigger","SwipableDrawerPortal","SwipableDrawerClose","SwipableDrawerOverlay","React","className","ref","cn","SwipableDrawerContent","children","jsxs","SwipableDrawerHeader","SwipableDrawerFooter","SwipableDrawerTitle","SwipableDrawerDescription"],"mappings":";;;;AAOA,MAAMA,IAAiB,CAAC,EAAE,uBAAAC,IAAwB,IAAM,GAAGC,EAAA,MACzD,gBAAAC,EAACC,EAAgB,MAAhB,EAAqB,uBAAAH,GAA+C,GAAGC,EAAA,CAAO;AAEjFF,EAAe,cAAc;AAG7B,MAAMK,IAAwBD,EAAgB;AAC9CC,EAAsB,cAAc;AAGpC,MAAMC,IAAuBF,EAAgB,QAEvCG,IAAsBH,EAAgB;AAC5CG,EAAoB,cAAc;AAGlC,MAAMC,IAAwBC,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGR,EAAA,GAASS,MAC1B,gBAAAR,EAACC,EAAgB,SAAhB,EAAwB,KAAAO,GAAU,WAAWC,EAAG,kDAAkDF,CAAS,GAAI,GAAGR,EAAA,CAAO,CAC3H;AACDM,EAAsB,cAAc;AAEpC,MAAMK,IAAwBJ,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,UAAAI,GAAU,GAAGZ,EAAA,GAASS,MACpC,gBAAAI,EAACT,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAH,EAACK,GAAA,EAAsB;AAAA,EACvB,gBAAAO;AAAA,IAACX,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAO;AAAA,MACA,WAAWC;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGR;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,6EAAA,CAA6E;AAAA,QAC3FW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AACH,GACF,CACD;AACDD,EAAsB,cAAc;AAGpC,MAAMG,IAAuB,CAAC,EAAE,WAAAN,GAAW,GAAGR,EAAA,MAC5C,gBAAAC,EAAC,OAAA,EAAI,WAAWS,EAAG,iEAAiEF,CAAS,GAAI,GAAGR,EAAA,CAAO;AAE7Gc,EAAqB,cAAc;AAGnC,MAAMC,IAAuB,CAAC,EAAE,WAAAP,GAAW,GAAGR,EAAA,MAC5C,gBAAAC,EAAC,OAAA,EAAI,WAAWS,EAAG,uDAAuDF,CAAS,GAAI,GAAGR,EAAA,CAAO;AAEnGe,EAAqB,cAAc;AAGnC,MAAMC,IAAsBT,EAAM,WAGhC,CAAC,EAAE,WAAAC,GAAW,GAAGR,EAAA,GAASS,MAC1B,gBAAAR,EAACC,EAAgB,OAAhB,EAAsB,KAAAO,GAAU,WAAWC,EAAG,qEAAqEF,CAAS,GAAI,GAAGR,GAAO,CAC5I;AACDgB,EAAoB,cAAc;AAGlC,MAAMC,IAA4BV,EAAM,WAGtC,CAAC,EAAE,WAAAC,GAAW,GAAGR,EAAA,GAASS,MAC1B,gBAAAR,EAACC,EAAgB,aAAhB,EAA4B,KAAAO,GAAU,WAAWC,EAAG,yCAAyCF,CAAS,GAAI,GAAGR,GAAO,CACtH;AACDiB,EAA0B,cAAc;"}
|
package/dist/switch.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { tv as
|
|
6
|
-
const
|
|
7
|
-
base: "peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-switch";
|
|
4
|
+
import { cn as m } from "./utils.es.js";
|
|
5
|
+
import { tv as x } from "tailwind-variants";
|
|
6
|
+
const o = x({
|
|
7
|
+
base: "mtx-peer mtx-inline-flex mtx-h-4 mtx-w-7 mtx-shrink-0 mtx-cursor-pointer mtx-items-center mtx-rounded-full mtx-border-2 mtx-border-transparent mtx-shadow-sm mtx-transition-colors focus-visible:mtx-outline-none focus-visible:mtx-ring-2 focus-visible:mtx-ring-ring focus-visible:mtx-ring-offset-2 focus-visible:mtx-ring-offset-background disabled:mtx-cursor-not-allowed disabled:mtx-opacity-50 data-[state=checked]:mtx-bg-primary data-[state=unchecked]:mtx-bg-input",
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
10
|
-
sm: "h-4 w-7 [&>span]:h-3 [&>span]:w-3 [&>span]:data-[state=checked]:translate-x-3",
|
|
11
|
-
md: "h-5 w-9 [&>span]:h-4 [&>span]:w-4 [&>span]:data-[state=checked]:translate-x-4",
|
|
12
|
-
lg: "h-6 w-11 [&>span]:h-5 [&>span]:w-5 [&>span]:data-[state=checked]:translate-x-5"
|
|
10
|
+
sm: "mtx-h-4 mtx-w-7 [&>span]:mtx-h-3 [&>span]:mtx-w-3 [&>span]:data-[state=checked]:mtx-translate-x-3",
|
|
11
|
+
md: "mtx-h-5 mtx-w-9 [&>span]:mtx-h-4 [&>span]:mtx-w-4 [&>span]:data-[state=checked]:mtx-translate-x-4",
|
|
12
|
+
lg: "mtx-h-6 mtx-w-11 [&>span]:mtx-h-5 [&>span]:mtx-w-5 [&>span]:data-[state=checked]:mtx-translate-x-5"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
16
16
|
size: "md"
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
19
|
-
|
|
18
|
+
}), c = i.forwardRef(({ className: s, size: e, ...r }, n) => /* @__PURE__ */ a(t.Root, { className: m(o({ size: e, className: s })), ...r, ref: n, children: /* @__PURE__ */ a(
|
|
19
|
+
t.Thumb,
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
22
|
-
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0"
|
|
21
|
+
className: m(
|
|
22
|
+
"mtx-pointer-events-none mtx-block mtx-rounded-full mtx-bg-background mtx-shadow-lg mtx-ring-0 mtx-transition-transform data-[state=unchecked]:mtx-translate-x-0"
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
) }));
|
|
26
|
-
|
|
26
|
+
c.displayName = t.Root.displayName;
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
c as Switch
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=switch.es.js.map
|
package/dist/switch.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.es.js","sources":["../src/components/switch/Switch.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { tv, VariantProps } from \"tailwind-variants\";\r\n\r\nconst switchVariants = tv({\r\n base: \"peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\r\n variants: {\r\n size: {\r\n sm: \"h-4 w-7 [&>span]:h-3 [&>span]:w-3 [&>span]:data-[state=checked]:translate-x-3\",\r\n md: \"h-5 w-9 [&>span]:h-4 [&>span]:w-4 [&>span]:data-[state=checked]:translate-x-4\",\r\n lg: \"h-6 w-11 [&>span]:h-5 [&>span]:w-5 [&>span]:data-[state=checked]:translate-x-5\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"md\",\r\n },\r\n});\r\n\r\ninterface SwitchProps extends SwitchPrimitives.SwitchProps, VariantProps<typeof switchVariants> {}\r\n\r\nconst Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>(({ className, size, ...props }, ref) => (\r\n <SwitchPrimitives.Root className={cn(switchVariants({ size, className }))} {...props} ref={ref}>\r\n <SwitchPrimitives.Thumb\r\n className={cn(\r\n \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0\",\r\n )}\r\n />\r\n </SwitchPrimitives.Root>\r\n));\r\nSwitch.displayName = SwitchPrimitives.Root.displayName;\r\n\r\nexport { Switch, type SwitchProps };\r\n"],"names":["switchVariants","tv","Switch","React","className","size","props","ref","jsx","SwitchPrimitives","cn"],"mappings":";;;;;AAQA,MAAMA,IAAiBC,EAAG;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GAIKC,IAASC,EAAM,WAAwE,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAC3H,gBAAAC,EAACC,EAAiB,MAAjB,EAAsB,WAAWC,EAAGV,EAAe,EAAE,MAAAK,GAAM,WAAAD,GAAW,CAAC,GAAI,GAAGE,GAAO,KAAAC,GACpF,UAAA,gBAAAC;AAAA,EAACC,EAAiB;AAAA,EAAjB;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AACF,GACF,CACD;AACDR,EAAO,cAAcO,EAAiB,KAAK;"}
|
|
1
|
+
{"version":3,"file":"switch.es.js","sources":["../src/components/switch/Switch.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { tv, VariantProps } from \"tailwind-variants\";\r\n\r\nconst switchVariants = tv({\r\n base: \"mtx-peer mtx-inline-flex mtx-h-4 mtx-w-7 mtx-shrink-0 mtx-cursor-pointer mtx-items-center mtx-rounded-full mtx-border-2 mtx-border-transparent mtx-shadow-sm mtx-transition-colors focus-visible:mtx-outline-none focus-visible:mtx-ring-2 focus-visible:mtx-ring-ring focus-visible:mtx-ring-offset-2 focus-visible:mtx-ring-offset-background disabled:mtx-cursor-not-allowed disabled:mtx-opacity-50 data-[state=checked]:mtx-bg-primary data-[state=unchecked]:mtx-bg-input\",\r\n variants: {\r\n size: {\r\n sm: \"mtx-h-4 mtx-w-7 [&>span]:mtx-h-3 [&>span]:mtx-w-3 [&>span]:data-[state=checked]:mtx-translate-x-3\",\r\n md: \"mtx-h-5 mtx-w-9 [&>span]:mtx-h-4 [&>span]:mtx-w-4 [&>span]:data-[state=checked]:mtx-translate-x-4\",\r\n lg: \"mtx-h-6 mtx-w-11 [&>span]:mtx-h-5 [&>span]:mtx-w-5 [&>span]:data-[state=checked]:mtx-translate-x-5\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"md\",\r\n },\r\n});\r\n\r\ninterface SwitchProps extends SwitchPrimitives.SwitchProps, VariantProps<typeof switchVariants> {}\r\n\r\nconst Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitives.Root>, SwitchProps>(({ className, size, ...props }, ref) => (\r\n <SwitchPrimitives.Root className={cn(switchVariants({ size, className }))} {...props} ref={ref}>\r\n <SwitchPrimitives.Thumb\r\n className={cn(\r\n \"mtx-pointer-events-none mtx-block mtx-rounded-full mtx-bg-background mtx-shadow-lg mtx-ring-0 mtx-transition-transform data-[state=unchecked]:mtx-translate-x-0\",\r\n )}\r\n />\r\n </SwitchPrimitives.Root>\r\n));\r\nSwitch.displayName = SwitchPrimitives.Root.displayName;\r\n\r\nexport { Switch, type SwitchProps };\r\n"],"names":["switchVariants","tv","Switch","React","className","size","props","ref","jsx","SwitchPrimitives","cn"],"mappings":";;;;;AAQA,MAAMA,IAAiBC,EAAG;AAAA,EACxB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GAIKC,IAASC,EAAM,WAAwE,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAC3H,gBAAAC,EAACC,EAAiB,MAAjB,EAAsB,WAAWC,EAAGV,EAAe,EAAE,MAAAK,GAAM,WAAAD,GAAW,CAAC,GAAI,GAAGE,GAAO,KAAAC,GACpF,UAAA,gBAAAC;AAAA,EAACC,EAAiB;AAAA,EAAjB;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AACF,GACF,CACD;AACDR,EAAO,cAAcO,EAAiB,KAAK;"}
|
package/dist/tabs.es.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Root as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { Root as n, Content as o, List as x, Trigger as i } from "@radix-ui/react-tabs";
|
|
4
|
+
import { cn as r } from "./utils.es.js";
|
|
5
|
+
const y = n, d = s.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ m(
|
|
6
|
+
x,
|
|
7
7
|
{
|
|
8
8
|
ref: a,
|
|
9
|
-
className:
|
|
10
|
-
"inline-flex h-12 w-full overflow-auto thin-scrollbar items-center justify-start bg-background p-0 text-muted-foreground md:[box-shadow:inset_0_-1px_0_hsl(var(--gray-300))]",
|
|
9
|
+
className: r(
|
|
10
|
+
"mtx-inline-flex mtx-h-12 mtx-w-full mtx-overflow-auto mtx-thin-scrollbar mtx-items-center mtx-justify-start mtx-bg-background mtx-p-0 mtx-text-muted-foreground md:mtx-[box-shadow:inset_0_-1px_0_hsl(var(--gray-300))]",
|
|
11
11
|
t
|
|
12
12
|
),
|
|
13
13
|
...e
|
|
14
14
|
}
|
|
15
15
|
));
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
({ className: t, ...e }, a) => /* @__PURE__ */
|
|
19
|
-
|
|
16
|
+
d.displayName = x.displayName;
|
|
17
|
+
const l = s.forwardRef(
|
|
18
|
+
({ className: t, ...e }, a) => /* @__PURE__ */ m(
|
|
19
|
+
i,
|
|
20
20
|
{
|
|
21
21
|
ref: a,
|
|
22
|
-
className:
|
|
23
|
-
"inline-flex items-center justify-center whitespace-nowrap h-full px-3 py-1 text-sm font-medium disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-foreground data-[state=active]:font-bold data-[state=active]:border-b-2 data-[state=active]:border-primary",
|
|
22
|
+
className: r(
|
|
23
|
+
"mtx-inline-flex mtx-items-center mtx-justify-center mtx-whitespace-nowrap mtx-h-full mtx-px-3 mtx-py-1 mtx-text-sm mtx-font-medium disabled:mtx-pointer-events-none disabled:mtx-opacity-50 data-[state=active]:mtx-text-foreground data-[state=active]:mtx-font-bold data-[state=active]:mtx-border-b-2 data-[state=active]:mtx-border-primary",
|
|
24
24
|
t
|
|
25
25
|
),
|
|
26
26
|
...e
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
({ className: t, ...e }, a) => /* @__PURE__ */
|
|
30
|
+
l.displayName = i.displayName;
|
|
31
|
+
const f = s.forwardRef(
|
|
32
|
+
({ className: t, ...e }, a) => /* @__PURE__ */ m(o, { ref: a, className: r("mtx-mt-2", t), ...e })
|
|
33
33
|
);
|
|
34
|
-
|
|
34
|
+
f.displayName = o.displayName;
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
y as Tabs,
|
|
37
|
+
f as TabsContent,
|
|
38
|
+
d as TabsList,
|
|
39
|
+
l as TabsTrigger
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=tabs.es.js.map
|
package/dist/tabs.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.es.js","sources":["../src/components/tabs/Tabs.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Content, List, Root, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, Trigger } from \"@radix-ui/react-tabs\";\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst Tabs = Root;\r\n\r\nconst TabsList = React.forwardRef<React.ElementRef<typeof List>, React.ComponentPropsWithoutRef<typeof List>>(({ className, ...props }, ref) => (\r\n <List\r\n ref={ref}\r\n className={cn(\r\n \"inline-flex h-12 w-full overflow-auto thin-scrollbar items-center justify-start bg-background p-0 text-muted-foreground md:[box-shadow:inset_0_-1px_0_hsl(var(--gray-300))]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nTabsList.displayName = List.displayName;\r\n\r\nconst TabsTrigger = React.forwardRef<React.ElementRef<typeof Trigger>, React.ComponentPropsWithoutRef<typeof Trigger>>(\r\n ({ className, ...props }, ref) => (\r\n <Trigger\r\n ref={ref}\r\n className={cn(\r\n \"inline-flex items-center justify-center whitespace-nowrap h-full px-3 py-1 text-sm font-medium disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-foreground data-[state=active]:font-bold data-[state=active]:border-b-2 data-[state=active]:border-primary\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\nTabsTrigger.displayName = Trigger.displayName;\r\n\r\nconst TabsContent = React.forwardRef<React.ElementRef<typeof Content>, React.ComponentPropsWithoutRef<typeof Content>>(\r\n ({ className, ...props }, ref) => <Content ref={ref} className={cn(\"mt-2\", className)} {...props} />,\r\n);\r\nTabsContent.displayName = Content.displayName;\r\n\r\nexport { Tabs, TabsList, TabsTrigger, TabsContent, type TabsProps, type TabsListProps, type TabsTriggerProps, type TabsContentProps };\r\n"],"names":["Tabs","Root","TabsList","React","className","props","ref","jsx","List","cn","TabsTrigger","Trigger","TabsContent","Content"],"mappings":";;;;AAMA,MAAMA,IAAOC,GAEPC,IAAWC,EAAM,WAAuF,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACtI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAS,cAAcM,EAAK;AAE5B,MAAME,IAAcP,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAK,EAAY,cAAcC,EAAQ;AAElC,MAAMC,IAAcT,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAAQ,gBAAAC,EAACM,GAAA,EAAQ,KAAAP,GAAU,WAAWG,EAAG,
|
|
1
|
+
{"version":3,"file":"tabs.es.js","sources":["../src/components/tabs/Tabs.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Content, List, Root, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, Trigger } from \"@radix-ui/react-tabs\";\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst Tabs = Root;\r\n\r\nconst TabsList = React.forwardRef<React.ElementRef<typeof List>, React.ComponentPropsWithoutRef<typeof List>>(({ className, ...props }, ref) => (\r\n <List\r\n ref={ref}\r\n className={cn(\r\n \"mtx-inline-flex mtx-h-12 mtx-w-full mtx-overflow-auto mtx-thin-scrollbar mtx-items-center mtx-justify-start mtx-bg-background mtx-p-0 mtx-text-muted-foreground md:mtx-[box-shadow:inset_0_-1px_0_hsl(var(--gray-300))]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nTabsList.displayName = List.displayName;\r\n\r\nconst TabsTrigger = React.forwardRef<React.ElementRef<typeof Trigger>, React.ComponentPropsWithoutRef<typeof Trigger>>(\r\n ({ className, ...props }, ref) => (\r\n <Trigger\r\n ref={ref}\r\n className={cn(\r\n \"mtx-inline-flex mtx-items-center mtx-justify-center mtx-whitespace-nowrap mtx-h-full mtx-px-3 mtx-py-1 mtx-text-sm mtx-font-medium disabled:mtx-pointer-events-none disabled:mtx-opacity-50 data-[state=active]:mtx-text-foreground data-[state=active]:mtx-font-bold data-[state=active]:mtx-border-b-2 data-[state=active]:mtx-border-primary\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\nTabsTrigger.displayName = Trigger.displayName;\r\n\r\nconst TabsContent = React.forwardRef<React.ElementRef<typeof Content>, React.ComponentPropsWithoutRef<typeof Content>>(\r\n ({ className, ...props }, ref) => <Content ref={ref} className={cn(\"mtx-mt-2\", className)} {...props} />,\r\n);\r\nTabsContent.displayName = Content.displayName;\r\n\r\nexport { Tabs, TabsList, TabsTrigger, TabsContent, type TabsProps, type TabsListProps, type TabsTriggerProps, type TabsContentProps };\r\n"],"names":["Tabs","Root","TabsList","React","className","props","ref","jsx","List","cn","TabsTrigger","Trigger","TabsContent","Content"],"mappings":";;;;AAMA,MAAMA,IAAOC,GAEPC,IAAWC,EAAM,WAAuF,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACtI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAS,cAAcM,EAAK;AAE5B,MAAME,IAAcP,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAK,EAAY,cAAcC,EAAQ;AAElC,MAAMC,IAAcT,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAAQ,gBAAAC,EAACM,GAAA,EAAQ,KAAAP,GAAU,WAAWG,EAAG,YAAYL,CAAS,GAAI,GAAGC,EAAA,CAAO;AACxG;AACAO,EAAY,cAAcC,EAAQ;"}
|
package/dist/textarea.es.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { cn as a } from "./utils.es.js";
|
|
4
|
+
const o = r.forwardRef(({ className: t, ...e }, x) => /* @__PURE__ */ m(
|
|
5
5
|
"textarea",
|
|
6
6
|
{
|
|
7
|
-
className:
|
|
8
|
-
"flex min-h-[60px] w-full rounded-sm border border-input bg-transparent px-3 py-2 text-xs font-medium text-text",
|
|
9
|
-
"placeholder:text-text-300 focus-visible:outline-none focus-visible:border-primary disabled:opacity-50 disabled:text-text-300 disabled:bg-gray-100 disabled:border-gray-100",
|
|
10
|
-
|
|
7
|
+
className: a(
|
|
8
|
+
"mtx-flex mtx-min-h-[60px] mtx-w-full mtx-rounded-sm mtx-border mtx-border-input mtx-bg-transparent mtx-px-3 mtx-py-2 mtx-text-xs mtx-font-medium mtx-text-text",
|
|
9
|
+
"placeholder:mtx-text-text-300 focus-visible:mtx-outline-none focus-visible:mtx-border-primary disabled:mtx-opacity-50 disabled:mtx-text-text-300 disabled:mtx-bg-gray-100 disabled:mtx-border-gray-100",
|
|
10
|
+
t
|
|
11
11
|
),
|
|
12
|
-
ref:
|
|
13
|
-
...
|
|
12
|
+
ref: x,
|
|
13
|
+
...e
|
|
14
14
|
}
|
|
15
15
|
));
|
|
16
|
-
|
|
16
|
+
o.displayName = "Textarea";
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
o as Textarea
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=textarea.es.js.map
|
package/dist/textarea.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.es.js","sources":["../src/components/textarea/Textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"flex min-h-[60px] w-full rounded-sm border border-input bg-transparent px-3 py-2 text-xs font-medium text-text\",\n \"placeholder:text-text-300 focus-visible:outline-none focus-visible:border-primary disabled:opacity-50 disabled:text-text-300 disabled:bg-gray-100 disabled:border-gray-100\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","props","ref","jsx","cn"],"mappings":";;;AAMA,MAAMA,IAAWC,EAAM,WAA+C,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAE5F,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACA;AAAA,MACAJ;AAAA,IAAA;AAAA,IAEF,KAAAE;AAAA,IACC,GAAGD;AAAA,EAAA;AAAA,CAGT;AACDH,EAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"textarea.es.js","sources":["../src/components/textarea/Textarea.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"mtx-flex mtx-min-h-[60px] mtx-w-full mtx-rounded-sm mtx-border mtx-border-input mtx-bg-transparent mtx-px-3 mtx-py-2 mtx-text-xs mtx-font-medium mtx-text-text\",\n \"placeholder:mtx-text-text-300 focus-visible:mtx-outline-none focus-visible:mtx-border-primary disabled:mtx-opacity-50 disabled:mtx-text-text-300 disabled:mtx-bg-gray-100 disabled:mtx-border-gray-100\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"],"names":["Textarea","React","className","props","ref","jsx","cn"],"mappings":";;;AAMA,MAAMA,IAAWC,EAAM,WAA+C,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAE5F,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACA;AAAA,MACAJ;AAAA,IAAA;AAAA,IAEF,KAAAE;AAAA,IACC,GAAGD;AAAA,EAAA;AAAA,CAGT;AACDH,EAAS,cAAc;"}
|
package/dist/textfield.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as v, jsx as
|
|
1
|
+
import { jsxs as v, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
3
|
import { tv as F } from "tailwind-variants";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as o } from "./utils.es.js";
|
|
5
5
|
const j = F({
|
|
6
6
|
base: [
|
|
7
|
-
"flex items-center w-full rounded-sm border border-input text-text bg-transparent p-0 text-xs [&_input]:text-xs font-medium transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
8
|
-
"placeholder:text-text-300 hover:border-primary-400 focus-within:border-primary-400 focus-within:outline-none focus-within:ring focus-within:ring-primary-100",
|
|
9
|
-
"aria-disabled:text-text-300 aria-disabled:bg-gray-100 aria-disabled:border-gray-100"
|
|
7
|
+
"mtx-flex mtx-items-center mtx-w-full mtx-rounded-sm mtx-border mtx-border-input mtx-text-text mtx-bg-transparent mtx-p-0 mtx-text-xs [&_input]:mtx-text-xs mtx-font-medium mtx-transition-colors file:mtx-border-0 file:mtx-bg-transparent file:mtx-text-sm file:mtx-font-medium file:mtx-text-foreground",
|
|
8
|
+
"placeholder:mtx-text-text-300 hover:mtx-border-primary-400 focus-within:mtx-border-primary-400 focus-within:mtx-outline-none focus-within:mtx-ring focus-within:mtx-ring-primary-100",
|
|
9
|
+
"aria-disabled:mtx-text-text-300 aria-disabled:mtx-bg-gray-100 aria-disabled:mtx-border-gray-100"
|
|
10
10
|
],
|
|
11
11
|
variants: {
|
|
12
12
|
size: {
|
|
13
|
-
sm: "h-7",
|
|
14
|
-
md: "h-8",
|
|
15
|
-
lg: "h-11"
|
|
13
|
+
sm: "mtx-h-7",
|
|
14
|
+
md: "mtx-h-8",
|
|
15
|
+
lg: "mtx-h-11"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
@@ -20,51 +20,51 @@ const j = F({
|
|
|
20
20
|
}
|
|
21
21
|
}), z = N.forwardRef(
|
|
22
22
|
({
|
|
23
|
-
className:
|
|
24
|
-
slotProps:
|
|
25
|
-
suffix:
|
|
26
|
-
endAdornment:
|
|
27
|
-
startAdornment:
|
|
28
|
-
size:
|
|
29
|
-
value:
|
|
30
|
-
onChange:
|
|
31
|
-
defaultValue:
|
|
32
|
-
type:
|
|
33
|
-
disabled:
|
|
34
|
-
onWheel:
|
|
23
|
+
className: s,
|
|
24
|
+
slotProps: e,
|
|
25
|
+
suffix: t,
|
|
26
|
+
endAdornment: d,
|
|
27
|
+
startAdornment: m,
|
|
28
|
+
size: l,
|
|
29
|
+
value: f,
|
|
30
|
+
onChange: p,
|
|
31
|
+
defaultValue: u,
|
|
32
|
+
type: r,
|
|
33
|
+
disabled: x,
|
|
34
|
+
onWheel: i,
|
|
35
35
|
id: b,
|
|
36
36
|
"aria-describedby": c,
|
|
37
37
|
"aria-invalid": h,
|
|
38
38
|
...g
|
|
39
39
|
}, y) => {
|
|
40
|
-
const w = (
|
|
41
|
-
|
|
40
|
+
const w = (a) => {
|
|
41
|
+
r === "number" && a.target.blur(), i && i(a);
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ v("div", { ...g, className:
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ v("div", { ...g, className: o(j({ size: l, className: s })), "aria-disabled": x, children: [
|
|
44
|
+
m,
|
|
45
|
+
/* @__PURE__ */ n(
|
|
46
46
|
"input",
|
|
47
47
|
{
|
|
48
|
-
type:
|
|
48
|
+
type: r,
|
|
49
49
|
onWheel: w,
|
|
50
50
|
ref: y,
|
|
51
51
|
id: b,
|
|
52
52
|
"aria-describedby": c,
|
|
53
53
|
"aria-invalid": h,
|
|
54
|
-
onChange:
|
|
55
|
-
value:
|
|
56
|
-
defaultValue:
|
|
57
|
-
disabled:
|
|
58
|
-
...
|
|
59
|
-
className:
|
|
60
|
-
"focus:outline-none w-full h-full py-1 rounded-sm file:border-0 bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-text-300",
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
onChange: p,
|
|
55
|
+
value: f,
|
|
56
|
+
defaultValue: u,
|
|
57
|
+
disabled: x,
|
|
58
|
+
...e?.inputProps ?? {},
|
|
59
|
+
className: o(
|
|
60
|
+
"focus:mtx-outline-none mtx-w-full mtx-h-full mtx-py-1 mtx-rounded-sm file:mtx-border-0 mtx-bg-transparent file:mtx-text-sm file:mtx-font-medium file:mtx-text-foreground placeholder:mtx-text-text-300",
|
|
61
|
+
m ? "mtx-ps-1 mtx-pe-3" : "mtx-px-3",
|
|
62
|
+
e?.inputProps?.className
|
|
63
63
|
)
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
|
-
typeof
|
|
67
|
-
|
|
66
|
+
typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ n("span", { className: "mtx-inline-flex mtx-items-center mtx-px-2 mtx-text-xs mtx-font-medium mtx-text-primary mtx-bg-primary-50 mtx-m-0.5 mtx-rounded-sm", children: t }) : t,
|
|
67
|
+
d
|
|
68
68
|
] });
|
|
69
69
|
}
|
|
70
70
|
);
|
package/dist/textfield.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textfield.es.js","sources":["../src/components/text-field/TextField.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { tv, VariantProps } from \"tailwind-variants\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst textFieldVariants = tv({\r\n base: [\r\n \"flex items-center w-full rounded-sm border border-input text-text bg-transparent p-0 text-xs [&_input]:text-xs font-medium transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground\",\r\n \"placeholder:text-text-300 hover:border-primary-400 focus-within:border-primary-400 focus-within:outline-none focus-within:ring focus-within:ring-primary-100\",\r\n \"aria-disabled:text-text-300 aria-disabled:bg-gray-100 aria-disabled:border-gray-100\",\r\n ],\r\n variants: {\r\n size: {\r\n sm: \"h-7\",\r\n md: \"h-8\",\r\n lg: \"h-11\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"md\",\r\n },\r\n});\r\n\r\ninterface TextFieldProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof textFieldVariants> {\r\n type?: React.HTMLInputTypeAttribute;\r\n disabled?: boolean;\r\n suffix?: React.ReactNode;\r\n endAdornment?: React.ReactNode;\r\n startAdornment?: React.ReactNode;\r\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\r\n value?: string | number;\r\n defaultValue?: string | number;\r\n slotProps?: {\r\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\r\n };\r\n}\r\n\r\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\r\n (\r\n {\r\n className,\r\n slotProps,\r\n suffix,\r\n endAdornment,\r\n startAdornment,\r\n size,\r\n value,\r\n onChange,\r\n defaultValue,\r\n type,\r\n disabled,\r\n onWheel,\r\n id,\r\n \"aria-describedby\": ariaDescribedby,\r\n \"aria-invalid\": ariaInvalid,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const handleWheel = (event: React.WheelEvent<HTMLInputElement>) => {\r\n if (type === \"number\") {\r\n // Prevents the number input from changing value when scrolling\r\n (event.target as HTMLInputElement).blur();\r\n }\r\n if (onWheel) {\r\n onWheel(event);\r\n }\r\n };\r\n\r\n return (\r\n <div {...props} className={cn(textFieldVariants({ size, className }))} aria-disabled={disabled}>\r\n {startAdornment}\r\n <input\r\n type={type}\r\n onWheel={handleWheel}\r\n ref={ref}\r\n id={id}\r\n aria-describedby={ariaDescribedby}\r\n aria-invalid={ariaInvalid}\r\n onChange={onChange}\r\n value={value}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n {...(slotProps?.inputProps ?? {})}\r\n className={cn(\r\n \"focus:outline-none w-full h-full py-1 rounded-sm file:border-0 bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-text-300\",\r\n !startAdornment ? \"px-3\" : \"ps-1 pe-3\",\r\n slotProps?.inputProps?.className,\r\n )}\r\n />\r\n {typeof suffix === \"string\" || typeof suffix === \"number\" ? (\r\n <span className=\"inline-flex items-center px-2 text-xs font-medium text-primary bg-primary-50 m-0.5 rounded-sm\"
|
|
1
|
+
{"version":3,"file":"textfield.es.js","sources":["../src/components/text-field/TextField.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { tv, VariantProps } from \"tailwind-variants\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst textFieldVariants = tv({\r\n base: [\r\n \"mtx-flex mtx-items-center mtx-w-full mtx-rounded-sm mtx-border mtx-border-input mtx-text-text mtx-bg-transparent mtx-p-0 mtx-text-xs [&_input]:mtx-text-xs mtx-font-medium mtx-transition-colors file:mtx-border-0 file:mtx-bg-transparent file:mtx-text-sm file:mtx-font-medium file:mtx-text-foreground\",\r\n \"placeholder:mtx-text-text-300 hover:mtx-border-primary-400 focus-within:mtx-border-primary-400 focus-within:mtx-outline-none focus-within:mtx-ring focus-within:mtx-ring-primary-100\",\r\n \"aria-disabled:mtx-text-text-300 aria-disabled:mtx-bg-gray-100 aria-disabled:mtx-border-gray-100\",\r\n ],\r\n variants: {\r\n size: {\r\n sm: \"mtx-h-7\",\r\n md: \"mtx-h-8\",\r\n lg: \"mtx-h-11\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"md\",\r\n },\r\n});\r\n\r\ninterface TextFieldProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof textFieldVariants> {\r\n type?: React.HTMLInputTypeAttribute;\r\n disabled?: boolean;\r\n suffix?: React.ReactNode;\r\n endAdornment?: React.ReactNode;\r\n startAdornment?: React.ReactNode;\r\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\r\n value?: string | number;\r\n defaultValue?: string | number;\r\n slotProps?: {\r\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\r\n };\r\n}\r\n\r\nconst TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\r\n (\r\n {\r\n className,\r\n slotProps,\r\n suffix,\r\n endAdornment,\r\n startAdornment,\r\n size,\r\n value,\r\n onChange,\r\n defaultValue,\r\n type,\r\n disabled,\r\n onWheel,\r\n id,\r\n \"aria-describedby\": ariaDescribedby,\r\n \"aria-invalid\": ariaInvalid,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const handleWheel = (event: React.WheelEvent<HTMLInputElement>) => {\r\n if (type === \"number\") {\r\n // Prevents the number input from changing value when scrolling\r\n (event.target as HTMLInputElement).blur();\r\n }\r\n if (onWheel) {\r\n onWheel(event);\r\n }\r\n };\r\n\r\n return (\r\n <div {...props} className={cn(textFieldVariants({ size, className }))} aria-disabled={disabled}>\r\n {startAdornment}\r\n <input\r\n type={type}\r\n onWheel={handleWheel}\r\n ref={ref}\r\n id={id}\r\n aria-describedby={ariaDescribedby}\r\n aria-invalid={ariaInvalid}\r\n onChange={onChange}\r\n value={value}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n {...(slotProps?.inputProps ?? {})}\r\n className={cn(\r\n \"focus:mtx-outline-none mtx-w-full mtx-h-full mtx-py-1 mtx-rounded-sm file:mtx-border-0 mtx-bg-transparent file:mtx-text-sm file:mtx-font-medium file:mtx-text-foreground placeholder:mtx-text-text-300\",\r\n !startAdornment ? \"mtx-px-3\" : \"mtx-ps-1 mtx-pe-3\",\r\n slotProps?.inputProps?.className,\r\n )}\r\n />\r\n {typeof suffix === \"string\" || typeof suffix === \"number\" ? (\r\n <span className=\"mtx-inline-flex mtx-items-center mtx-px-2 mtx-text-xs mtx-font-medium mtx-text-primary mtx-bg-primary-50 mtx-m-0.5 mtx-rounded-sm\">\r\n {suffix}\r\n </span>\r\n ) : (\r\n suffix\r\n )}\r\n {endAdornment}\r\n </div>\r\n );\r\n },\r\n);\r\nTextField.displayName = \"TextField\";\r\n\r\nexport { TextField, type TextFieldProps };\r\n"],"names":["textFieldVariants","tv","TextField","React","className","slotProps","suffix","endAdornment","startAdornment","size","value","onChange","defaultValue","type","disabled","onWheel","id","ariaDescribedby","ariaInvalid","props","ref","handleWheel","event","jsxs","cn","jsx"],"mappings":";;;;AAOA,MAAMA,IAAoBC,EAAG;AAAA,EAC3B,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GAgBKC,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,IAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,gBAAgBC;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAc,CAACC,MAA8C;AACjE,MAAIT,MAAS,YAEVS,EAAM,OAA4B,KAAA,GAEjCP,KACFA,EAAQO,CAAK;AAAA,IAEjB;AAEA,WACE,gBAAAC,EAAC,OAAA,EAAK,GAAGJ,GAAO,WAAWK,EAAGxB,EAAkB,EAAE,MAAAS,GAAM,WAAAL,EAAA,CAAW,CAAC,GAAG,iBAAeU,GACnF,UAAA;AAAA,MAAAN;AAAA,MACD,gBAAAiB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAAZ;AAAA,UACA,SAASQ;AAAA,UACT,KAAAD;AAAA,UACA,IAAAJ;AAAA,UACA,oBAAkBC;AAAA,UAClB,gBAAcC;AAAA,UACd,UAAAP;AAAA,UACA,OAAAD;AAAA,UACA,cAAAE;AAAA,UACA,UAAAE;AAAA,UACC,GAAIT,GAAW,cAAc,CAAA;AAAA,UAC9B,WAAWmB;AAAA,YACT;AAAA,YACChB,IAA8B,sBAAb;AAAA,YAClBH,GAAW,YAAY;AAAA,UAAA;AAAA,QACzB;AAAA,MAAA;AAAA,MAED,OAAOC,KAAW,YAAY,OAAOA,KAAW,WAC/C,gBAAAmB,EAAC,QAAA,EAAK,WAAU,qIACb,UAAAnB,EAAA,CACH,IAEAA;AAAA,MAEDC;AAAA,IAAA,GACH;AAAA,EAEJ;AACF;AACAL,EAAU,cAAc;"}
|
|
@@ -1,71 +1,78 @@
|
|
|
1
|
-
import { jsxs as N, jsx as
|
|
2
|
-
import { useState as S, useRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
const w = () => ({ hour: (/* @__PURE__ */ new Date()).getHours() % 12, minute: (/* @__PURE__ */ new Date()).getMinutes(), ampm: (/* @__PURE__ */ new Date()).getHours() < 12 ? "AM" : "PM" }), k = ({ isOpen:
|
|
5
|
-
const [r,
|
|
6
|
-
|
|
7
|
-
top: t * (
|
|
1
|
+
import { jsxs as N, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useRef as i, useEffect as g } from "react";
|
|
3
|
+
import { cn as c } from "./utils.es.js";
|
|
4
|
+
const w = () => ({ hour: (/* @__PURE__ */ new Date()).getHours() % 12, minute: (/* @__PURE__ */ new Date()).getMinutes(), ampm: (/* @__PURE__ */ new Date()).getHours() < 12 ? "AM" : "PM" }), k = ({ isOpen: l, time: s, onTimeChange: u, slotsProps: f }) => {
|
|
5
|
+
const [r, x] = S(s ?? w()), e = i(r), d = i(null), h = i(null), o = 32, n = 8, b = (t) => {
|
|
6
|
+
d?.current?.scrollTo({
|
|
7
|
+
top: t * (o + n),
|
|
8
8
|
behavior: "smooth"
|
|
9
9
|
});
|
|
10
10
|
}, y = (t) => {
|
|
11
|
-
|
|
12
|
-
top: t * (
|
|
11
|
+
h?.current?.scrollTo({
|
|
12
|
+
top: t * (o + n),
|
|
13
13
|
behavior: "smooth"
|
|
14
14
|
});
|
|
15
15
|
}, p = (t) => {
|
|
16
|
-
e.current = { ...r, hour: t },
|
|
16
|
+
e.current = { ...r, hour: t }, x(e.current), u(e.current);
|
|
17
17
|
}, v = (t) => {
|
|
18
|
-
e.current = { ...r, minute: t },
|
|
18
|
+
e.current = { ...r, minute: t }, x(e.current), u(e.current);
|
|
19
19
|
}, M = (t) => {
|
|
20
|
-
e.current = { ...r, ampm: t },
|
|
20
|
+
e.current = { ...r, ampm: t }, x(e.current), u(e.current);
|
|
21
21
|
};
|
|
22
22
|
return g(() => {
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
|
|
23
|
+
l && x(s ?? w());
|
|
24
|
+
}, [l, s]), g(() => {
|
|
25
|
+
l && setTimeout(() => {
|
|
26
26
|
b(e.current.hour - 1), y(e.current.minute);
|
|
27
27
|
});
|
|
28
|
-
}, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
28
|
+
}, [l]), /* @__PURE__ */ N(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
...f?.content ?? {},
|
|
32
|
+
className: c("mtx-py-2 mtx-px-0 mtx-h-52 mtx-w-full mtx-flex mtx-justify-center mtx-gap-1", f?.content?.className),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ m("div", { className: "mtx-w-24 mtx-px-2 mtx-h-full mtx-relative mtx-overflow-auto mtx-thin-scrollbar", ref: d, children: Array.from({ length: 12 }, (t, a) => a).map((t) => /* @__PURE__ */ m(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
style: { height: o, marginBottom: n },
|
|
38
|
+
className: c(
|
|
39
|
+
"mtx-w-full mtx-flex mtx-justify-center mtx-items-center mtx-rounded-full mtx-text-xs mtx-font-bold mtx-text-text-400",
|
|
40
|
+
t + 1 === r.hour && "mtx-bg-secondary"
|
|
41
|
+
),
|
|
42
|
+
onClick: () => p(t + 1),
|
|
43
|
+
children: (t + 1).toString().padStart(2, "0")
|
|
44
|
+
},
|
|
45
|
+
t + 1
|
|
46
|
+
)) }),
|
|
47
|
+
/* @__PURE__ */ m("div", { className: "mtx-h-full mtx-w-24 mtx-px-2 mtx-relative mtx-overflow-auto mtx-thin-scrollbar", ref: h, children: Array.from({ length: 60 }, (t, a) => a).map((t) => /* @__PURE__ */ m(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
style: { height: o, marginBottom: n },
|
|
51
|
+
className: c(
|
|
52
|
+
"mtx-w-full mtx-flex mtx-justify-center mtx-items-center mtx-rounded-full mtx-text-xs mtx-font-bold mtx-text-text-400",
|
|
53
|
+
t === r.minute && "mtx-bg-secondary"
|
|
54
|
+
),
|
|
55
|
+
onClick: () => v(t),
|
|
56
|
+
children: t.toString().padStart(2, "0")
|
|
57
|
+
},
|
|
58
|
+
t
|
|
59
|
+
)) }),
|
|
60
|
+
/* @__PURE__ */ m("div", { className: "mtx-h-full mtx-w-24 mtx-px-2 mtx-relative mtx-overflow-auto mtx-thin-scrollbar", children: ["AM", "PM"].map((t) => /* @__PURE__ */ m(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
style: { height: o, marginBottom: n },
|
|
64
|
+
className: c(
|
|
65
|
+
"mtx-w-full mtx-flex mtx-justify-center mtx-items-center mtx-rounded-full mtx-text-xs mtx-font-bold mtx-text-text-400",
|
|
66
|
+
t === r.ampm && "mtx-bg-secondary"
|
|
67
|
+
),
|
|
68
|
+
onClick: () => M(t),
|
|
69
|
+
children: t
|
|
70
|
+
},
|
|
71
|
+
t
|
|
72
|
+
)) })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
69
76
|
};
|
|
70
77
|
export {
|
|
71
78
|
k as TimePickerContent
|