@dimasbaguspm/versaur 0.0.10 → 0.0.12
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/{calendar-DwRERSxq.js → js/calendar-De5dCVnE.js} +149 -137
- package/dist/{enforce-subpath-import.js → js/enforce-subpath-import.js} +29 -13
- package/dist/{feedbacks → js/feedbacks}/index.js +1 -1
- package/dist/{form-layout-COQbtyW5.js → js/form-layout-BBDs1Y8m.js} +12 -12
- package/dist/{forms → js/forms}/index.js +1 -1
- package/dist/{index.js → js/index.js} +7 -7
- package/dist/{layouts → js/layouts}/index.js +1 -1
- package/dist/{menu--hEHXVZf.js → js/menu-Du409VIG.js} +15 -15
- package/dist/js/navigation/index.js +5 -0
- package/dist/{overlays → js/overlays}/index.js +1 -1
- package/dist/{primitive → js/primitive}/index.js +2 -2
- package/dist/{skeleton-DwqjRsF-.js → js/skeleton-BNZyaRjo.js} +19 -19
- package/dist/{styles.css → js/styles.css} +62 -37
- package/dist/{switch-input-DRNFMsqC.js → js/switch-input-B-pwBWbi.js} +266 -262
- package/dist/{tabs-KyFmo5cA.js → js/tabs-BbOkYchB.js} +53 -53
- package/dist/{tile-BinjKW_i.js → js/tile-6SeBYc08.js} +162 -162
- package/dist/types/primitive/anchor/anchor.d.ts +7 -0
- package/dist/types/primitive/anchor/index.d.ts +2 -0
- package/dist/types/primitive/anchor/types.d.ts +19 -0
- package/dist/{primitive → types/primitive}/icon/types.d.ts +1 -1
- package/dist/{primitive → types/primitive}/text/types.d.ts +1 -1
- package/package.json +17 -17
- package/dist/navigation/index.js +0 -5
- /package/dist/{drawer-Cn7sreJG.js → js/drawer-Cn7sreJG.js} +0 -0
- /package/dist/{index-DOdDlCoL.js → js/index-DOdDlCoL.js} +0 -0
- /package/dist/{feedbacks → types/feedbacks}/index.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/loading-indicator/index.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/loading-indicator/loading-indicator.atoms.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/loading-indicator/loading-indicator.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/loading-indicator/types.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/progress-indicator/index.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/progress-indicator/progress-indicator.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/progress-indicator/types.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/skeleton/index.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/skeleton/skeleton.d.ts +0 -0
- /package/dist/{feedbacks → types/feedbacks}/skeleton/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/calculator-input/calculator-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/calculator-input/calculator-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/calculator-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/calculator-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/checkbox-input/checkbox-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/checkbox-input/checkbox-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/checkbox-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/checkbox-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/chip-input/chip-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/chip-input/chip-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/chip-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/chip-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/date-single-picker-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/date-single-picker-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/date-single-picker-input.docked.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/date-single-picker-input.modal.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/date-single-picker-input/use-date-single-picker.d.ts +0 -0
- /package/dist/{forms → types/forms}/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/radio-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/radio-input/radio-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/radio-input/radio-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/radio-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-multiple-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-multiple-input/segment-multiple-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-multiple-input/segment-multiple-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-multiple-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-single-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-single-input/segment-single-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-single-input/segment-single-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/segment-single-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/select-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/select-input/select-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/select-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/switch-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/switch-input/switch-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/switch-input/switch-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/switch-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/text-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/text-input/text-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/text-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/textarea-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/textarea-input/textarea-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/textarea-input/types.d.ts +0 -0
- /package/dist/{forms → types/forms}/time-picker-input/index.d.ts +0 -0
- /package/dist/{forms → types/forms}/time-picker-input/time-picker-input.atoms.d.ts +0 -0
- /package/dist/{forms → types/forms}/time-picker-input/time-picker-input.d.ts +0 -0
- /package/dist/{forms → types/forms}/time-picker-input/types.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{layouts → types/layouts}/app-bar/app-bar.atoms.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/app-bar/app-bar.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/app-bar/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/app-bar/types.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/bottom-bar/bottom-bar.atoms.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/bottom-bar/bottom-bar.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/bottom-bar/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/bottom-bar/types.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/form-layout/form-layout.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/form-layout/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/form-layout/types.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/page-layout/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/page-layout/page-layout.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/page-layout/types.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/top-bar/index.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/top-bar/top-bar.atoms.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/top-bar/top-bar.d.ts +0 -0
- /package/dist/{layouts → types/layouts}/top-bar/types.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/breadcrumbs/breadcrumbs.atoms.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/breadcrumbs/breadcrumbs.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/breadcrumbs/index.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/breadcrumbs/types.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/index.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/tabs/index.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/tabs/tabs.atoms.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/tabs/tabs.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/tabs/types.d.ts +0 -0
- /package/dist/{navigation → types/navigation}/tabs/use-tab-indicator.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/drawer/drawer.atoms.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/drawer/drawer.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/drawer/index.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/drawer/types.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/index.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/menu/index.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/menu/menu.atoms.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/menu/menu.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/menu/types.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/menu/use-menu.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/index.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/modal.atoms.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/modal.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/types.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/use-escape-close.d.ts +0 -0
- /package/dist/{overlays → types/overlays}/modal/use-focus-trap.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/alert/alert.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/alert/alert.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/alert/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/alert/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/avatar/avatar.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/avatar/avatar.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/avatar/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/avatar/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/badge/badge.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/badge/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/badge/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/brand/brand.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/brand/brand.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/brand/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/brand/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button/button.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-float/button-float.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-float/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-float/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-float/use-floating-position.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-icon/button-icon.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-icon/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/button-icon/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calculator/calculator.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calculator/calculator.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calculator/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calculator/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calculator/use-calculator.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calendar/calendar.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calendar/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/calendar/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/icon/icon.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/icon/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/snackbar/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/snackbar/snackbar.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/snackbar/snackbar.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/snackbar/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/table/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/table/table.atoms.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/table/table.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/table/types.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/text/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/text/text.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/tile/index.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/tile/tile.d.ts +0 -0
- /package/dist/{primitive → types/primitive}/tile/types.d.ts +0 -0
|
@@ -34,20 +34,20 @@ const calculatorRootVariants = cva(
|
|
|
34
34
|
disabled: !1
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
), CalculatorButton = forwardRef(({ variant:
|
|
37
|
+
), CalculatorButton = forwardRef(({ variant: r = "default", className: e, ...t }, l) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38
38
|
"button",
|
|
39
39
|
{
|
|
40
40
|
ref: l,
|
|
41
41
|
type: "button",
|
|
42
42
|
className: cn(
|
|
43
|
-
calculatorButtonVariants({ variant:
|
|
43
|
+
calculatorButtonVariants({ variant: r, disabled: t.disabled }),
|
|
44
44
|
e
|
|
45
45
|
),
|
|
46
46
|
...t
|
|
47
47
|
}
|
|
48
48
|
));
|
|
49
|
-
function getIconColorFromVariant(
|
|
50
|
-
const e =
|
|
49
|
+
function getIconColorFromVariant(r = "primary") {
|
|
50
|
+
const e = r.split("-");
|
|
51
51
|
if (e.length === 1)
|
|
52
52
|
switch (e[0]) {
|
|
53
53
|
case "ghost":
|
|
@@ -57,6 +57,7 @@ function getIconColorFromVariant(i = "primary") {
|
|
|
57
57
|
default:
|
|
58
58
|
return "neutral";
|
|
59
59
|
}
|
|
60
|
+
if (e?.[1] === "outline") return "inherit";
|
|
60
61
|
switch (e[0]) {
|
|
61
62
|
case "primary":
|
|
62
63
|
return "primary";
|
|
@@ -86,35 +87,35 @@ const buttonIconVariants = cva(
|
|
|
86
87
|
variants: {
|
|
87
88
|
variant: {
|
|
88
89
|
// Core variants using Versaur color system
|
|
89
|
-
primary: "bg-
|
|
90
|
-
secondary: "bg-
|
|
91
|
-
tertiary: "bg-
|
|
92
|
-
ghost: "bg-white text-foreground hover:bg-
|
|
90
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
91
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
92
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
93
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
|
|
93
94
|
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-soft focus-visible:ring-offset-white shadow-sm",
|
|
94
95
|
// Outline variants
|
|
95
|
-
"primary-outline": "border border-
|
|
96
|
-
"secondary-outline": "border border-
|
|
97
|
-
"tertiary-outline": "border border-
|
|
98
|
-
"ghost-outline": "border border-
|
|
96
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-soft focus-visible:ring-offset-white transition-all",
|
|
97
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-soft focus-visible:ring-offset-white transition-all",
|
|
98
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-soft focus-visible:ring-offset-white transition-all",
|
|
99
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-soft focus-visible:ring-offset-white transition-all",
|
|
99
100
|
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-soft focus-visible:ring-offset-white transition-all",
|
|
100
101
|
// Ghost variants (subtle)
|
|
101
|
-
"primary-ghost": "text-
|
|
102
|
-
"secondary-ghost": "text-
|
|
103
|
-
"tertiary-ghost": "text-
|
|
104
|
-
"neutral-ghost": "text-foreground bg-white hover:bg-neutral
|
|
102
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary-light focus-visible:ring-primary-light focus-visible:ring-offset-white",
|
|
103
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary-light focus-visible:ring-secondary-light focus-visible:ring-offset-white",
|
|
104
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary-light focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
|
|
105
|
+
"neutral-ghost": "text-foreground bg-white hover:bg-neutral-light focus-visible:ring-foreground-light focus-visible:ring-offset-white",
|
|
105
106
|
// Semantic variants
|
|
106
107
|
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
107
108
|
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-soft focus-visible:ring-offset-white transition-all",
|
|
108
|
-
"success-ghost": "text-success bg-white hover:bg-success-
|
|
109
|
+
"success-ghost": "text-success bg-white hover:bg-success-light focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
109
110
|
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
110
111
|
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-soft focus-visible:ring-offset-white transition-all",
|
|
111
|
-
"info-ghost": "text-info bg-white hover:bg-info-
|
|
112
|
+
"info-ghost": "text-info bg-white hover:bg-info-light focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
112
113
|
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
113
114
|
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-soft focus-visible:ring-offset-white transition-all",
|
|
114
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning-
|
|
115
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
115
116
|
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
116
117
|
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
|
|
117
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger-
|
|
118
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
118
119
|
// Utility variants
|
|
119
120
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
120
121
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
@@ -156,20 +157,21 @@ const buttonIconVariants = cva(
|
|
|
156
157
|
success: "text-success",
|
|
157
158
|
info: "text-info",
|
|
158
159
|
warning: "text-warning",
|
|
159
|
-
danger: "text-danger"
|
|
160
|
+
danger: "text-danger",
|
|
161
|
+
inherit: ""
|
|
160
162
|
}
|
|
161
163
|
},
|
|
162
164
|
defaultVariants: {
|
|
163
165
|
size: "md",
|
|
164
166
|
color: "primary"
|
|
165
167
|
}
|
|
166
|
-
}), Icon = React__default.forwardRef(function({ as: e, color: t = "primary", size: l = "md", className:
|
|
168
|
+
}), Icon = React__default.forwardRef(function({ as: e, color: t = "primary", size: l = "md", className: c, ...i }, f) {
|
|
167
169
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
168
170
|
e,
|
|
169
171
|
{
|
|
170
|
-
ref:
|
|
171
|
-
className: iconVariants({ color: t, size: l, className:
|
|
172
|
-
...
|
|
172
|
+
ref: f,
|
|
173
|
+
className: iconVariants({ color: t, size: l, className: c }),
|
|
174
|
+
...i
|
|
173
175
|
}
|
|
174
176
|
);
|
|
175
177
|
}), ButtonIcon = React__default.forwardRef(
|
|
@@ -177,11 +179,11 @@ const buttonIconVariants = cva(
|
|
|
177
179
|
className: e,
|
|
178
180
|
variant: t = "primary",
|
|
179
181
|
size: l = "md",
|
|
180
|
-
shape:
|
|
181
|
-
disabled:
|
|
182
|
-
as:
|
|
183
|
-
"aria-label":
|
|
184
|
-
...
|
|
182
|
+
shape: c = "rounded",
|
|
183
|
+
disabled: i = !1,
|
|
184
|
+
as: f,
|
|
185
|
+
"aria-label": s,
|
|
186
|
+
...g
|
|
185
187
|
}, h) {
|
|
186
188
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
187
189
|
"button",
|
|
@@ -192,19 +194,19 @@ const buttonIconVariants = cva(
|
|
|
192
194
|
buttonIconVariants({
|
|
193
195
|
variant: t,
|
|
194
196
|
size: l,
|
|
195
|
-
shape:
|
|
197
|
+
shape: c
|
|
196
198
|
}),
|
|
197
199
|
e
|
|
198
200
|
),
|
|
199
|
-
disabled:
|
|
200
|
-
"aria-disabled":
|
|
201
|
-
"aria-label":
|
|
202
|
-
inert:
|
|
203
|
-
...
|
|
201
|
+
disabled: i,
|
|
202
|
+
"aria-disabled": i,
|
|
203
|
+
"aria-label": s,
|
|
204
|
+
inert: i ? !0 : void 0,
|
|
205
|
+
...g,
|
|
204
206
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
205
207
|
Icon,
|
|
206
208
|
{
|
|
207
|
-
as:
|
|
209
|
+
as: f,
|
|
208
210
|
size: l,
|
|
209
211
|
color: getIconColorFromVariant(t)
|
|
210
212
|
}
|
|
@@ -231,39 +233,39 @@ function useCalculator({
|
|
|
231
233
|
return "";
|
|
232
234
|
}
|
|
233
235
|
}, []), handleButton = useCallback(
|
|
234
|
-
(
|
|
236
|
+
(r) => {
|
|
235
237
|
if (!disabled)
|
|
236
|
-
if (
|
|
238
|
+
if (r === "C")
|
|
237
239
|
setInput("");
|
|
238
|
-
else if (
|
|
240
|
+
else if (r === "⌫")
|
|
239
241
|
setInput((e) => e.slice(0, -1));
|
|
240
|
-
else if (
|
|
242
|
+
else if (r === "=") {
|
|
241
243
|
const e = evaluate(input);
|
|
242
244
|
setInput(e);
|
|
243
245
|
} else
|
|
244
|
-
setInput((e) => e +
|
|
246
|
+
setInput((e) => e + r);
|
|
245
247
|
},
|
|
246
248
|
[disabled, input, evaluate]
|
|
247
249
|
);
|
|
248
250
|
useEffect(() => {
|
|
249
251
|
if (onChange) {
|
|
250
|
-
const
|
|
251
|
-
onChange(
|
|
252
|
+
const r = evaluate(input);
|
|
253
|
+
onChange(r);
|
|
252
254
|
}
|
|
253
255
|
}, [evaluate, input, onChange]), useEffect(() => {
|
|
254
256
|
if (disabled) return;
|
|
255
|
-
const
|
|
257
|
+
const r = (e) => {
|
|
256
258
|
if (document.activeElement !== inputRef.current && document.activeElement?.tagName !== "BODY")
|
|
257
259
|
return;
|
|
258
260
|
const t = e.key;
|
|
259
261
|
t === "Enter" || t === "=" ? (handleButton("="), e.preventDefault()) : t === "Backspace" ? (handleButton("⌫"), e.preventDefault()) : t === "Escape" || t === "C" || t === "c" ? (handleButton("C"), e.preventDefault()) : (/^[0-9]$/.test(t) || ["/", "*", "-", "+", "."].includes(t)) && (handleButton(t), e.preventDefault());
|
|
260
262
|
};
|
|
261
|
-
return window.addEventListener("keydown",
|
|
263
|
+
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
262
264
|
}, [handleButton, disabled]), useEffect(() => {
|
|
263
265
|
disabled || inputRef.current?.focus();
|
|
264
266
|
}, [disabled]);
|
|
265
|
-
const handleInput = (
|
|
266
|
-
const e =
|
|
267
|
+
const handleInput = (r) => {
|
|
268
|
+
const e = r.target.value.replace(/[^\d+\-*/.]/g, "");
|
|
267
269
|
setInput(e);
|
|
268
270
|
};
|
|
269
271
|
return {
|
|
@@ -280,58 +282,58 @@ const BUTTONS = [
|
|
|
280
282
|
["0", ".", "=", "+"]
|
|
281
283
|
], Calculator = forwardRef(
|
|
282
284
|
({
|
|
283
|
-
initialValue:
|
|
285
|
+
initialValue: r = "",
|
|
284
286
|
onChange: e,
|
|
285
287
|
disabled: t,
|
|
286
288
|
className: l,
|
|
287
|
-
"aria-label":
|
|
288
|
-
},
|
|
289
|
-
const { input:
|
|
290
|
-
initialValue:
|
|
289
|
+
"aria-label": c
|
|
290
|
+
}, i) => {
|
|
291
|
+
const { input: f, inputRef: s, handleButton: g, handleInput: h } = useCalculator({
|
|
292
|
+
initialValue: r,
|
|
291
293
|
disabled: t,
|
|
292
294
|
onChange: e
|
|
293
295
|
});
|
|
294
296
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
295
297
|
"div",
|
|
296
298
|
{
|
|
297
|
-
ref:
|
|
299
|
+
ref: i,
|
|
298
300
|
className: cn(calculatorRootVariants({ disabled: t }), l),
|
|
299
|
-
"aria-label":
|
|
301
|
+
"aria-label": c || "Calculator",
|
|
300
302
|
role: "region",
|
|
301
303
|
children: [
|
|
302
304
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
303
305
|
"input",
|
|
304
306
|
{
|
|
305
|
-
ref:
|
|
307
|
+
ref: s,
|
|
306
308
|
className: "w-full mb-3 px-3 py-2 rounded border border-[var(--color-neutral)] bg-[var(--color-neutral-soft)] text-right text-xl font-mono focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",
|
|
307
|
-
value:
|
|
309
|
+
value: f,
|
|
308
310
|
onChange: h,
|
|
309
311
|
disabled: t,
|
|
310
312
|
inputMode: "decimal",
|
|
311
313
|
"aria-label": "Calculator input"
|
|
312
314
|
}
|
|
313
315
|
),
|
|
314
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((b, v) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: b.map((
|
|
316
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((b, v) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: b.map((u) => u === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
315
317
|
ButtonIcon,
|
|
316
318
|
{
|
|
317
319
|
as: X,
|
|
318
320
|
variant: "danger-ghost",
|
|
319
321
|
"aria-label": "Backspace",
|
|
320
322
|
size: "md",
|
|
321
|
-
onClick: () =>
|
|
323
|
+
onClick: () => g("⌫"),
|
|
322
324
|
disabled: t
|
|
323
325
|
},
|
|
324
326
|
"backspace"
|
|
325
327
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
326
328
|
CalculatorButton,
|
|
327
329
|
{
|
|
328
|
-
variant:
|
|
329
|
-
onClick: () => u
|
|
330
|
+
variant: u === "=" ? "action" : u === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(u) ? "operator" : "default",
|
|
331
|
+
onClick: () => g(u),
|
|
330
332
|
disabled: t,
|
|
331
|
-
"aria-label":
|
|
332
|
-
children:
|
|
333
|
+
"aria-label": u,
|
|
334
|
+
children: u
|
|
333
335
|
},
|
|
334
|
-
|
|
336
|
+
u
|
|
335
337
|
)) }, v)) })
|
|
336
338
|
]
|
|
337
339
|
}
|
|
@@ -345,35 +347,35 @@ const buttonVariants = cva(
|
|
|
345
347
|
variants: {
|
|
346
348
|
variant: {
|
|
347
349
|
// Core variants using Versaur color system
|
|
348
|
-
primary: "bg-
|
|
349
|
-
secondary: "bg-
|
|
350
|
-
tertiary: "bg-
|
|
351
|
-
ghost: "bg-white text-foreground hover:bg-
|
|
350
|
+
primary: "bg-primary text-white hover:bg-primary/90 focus-visible:ring-primary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
351
|
+
secondary: "bg-secondary text-white hover:bg-secondary/90 focus-visible:ring-secondary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
352
|
+
tertiary: "bg-tertiary text-white hover:bg-tertiary/90 focus-visible:ring-tertiary-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
353
|
+
ghost: "bg-white text-foreground hover:bg-ghost-soft focus-visible:ring-ghost-soft focus-visible:ring-offset-white",
|
|
352
354
|
neutral: "bg-neutral text-foreground border border-border hover:bg-neutral/80 focus-visible:ring-foreground-soft focus-visible:ring-offset-white shadow-sm",
|
|
353
355
|
// Outline variants
|
|
354
|
-
"primary-outline": "border border-
|
|
355
|
-
"secondary-outline": "border border-
|
|
356
|
-
"tertiary-outline": "border border-
|
|
357
|
-
"ghost-outline": "border border-
|
|
356
|
+
"primary-outline": "border border-primary text-primary bg-white hover:bg-primary hover:text-white focus-visible:ring-primary-soft focus-visible:ring-offset-white transition-all",
|
|
357
|
+
"secondary-outline": "border border-secondary text-secondary bg-white hover:bg-secondary hover:text-white focus-visible:ring-secondary-soft focus-visible:ring-offset-white transition-all",
|
|
358
|
+
"tertiary-outline": "border border-tertiary text-tertiary bg-white hover:bg-tertiary hover:text-white focus-visible:ring-tertiary-soft focus-visible:ring-offset-white transition-all",
|
|
359
|
+
"ghost-outline": "border border-ghost text-ghost bg-white hover:bg-ghost hover:text-white focus-visible:ring-ghost-soft focus-visible:ring-offset-white transition-all",
|
|
358
360
|
"neutral-outline": "border border-neutral text-foreground bg-white hover:bg-neutral hover:text-foreground focus-visible:ring-foreground-soft focus-visible:ring-offset-white transition-all",
|
|
359
361
|
// Ghost variants (subtle)
|
|
360
|
-
"primary-ghost": "text-
|
|
361
|
-
"secondary-ghost": "text-
|
|
362
|
-
"tertiary-ghost": "text-
|
|
362
|
+
"primary-ghost": "text-primary bg-white hover:bg-primary-light focus-visible:ring-primary-light focus-visible:ring-offset-white",
|
|
363
|
+
"secondary-ghost": "text-secondary bg-white hover:bg-secondary-light focus-visible:ring-secondary-light focus-visible:ring-offset-white",
|
|
364
|
+
"tertiary-ghost": "text-tertiary bg-white hover:bg-tertiary-light focus-visible:ring-tertiary-light focus-visible:ring-offset-white",
|
|
363
365
|
"neutral-ghost": "text-foreground bg-white hover:bg-neutral/70 focus-visible:ring-foreground-soft focus-visible:ring-offset-white",
|
|
364
366
|
// Semantic variants
|
|
365
367
|
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
366
368
|
"success-outline": "border border-success text-success bg-white hover:bg-success hover:text-white focus-visible:ring-success-soft focus-visible:ring-offset-white transition-all",
|
|
367
|
-
"success-ghost": "text-success bg-white hover:bg-success-
|
|
369
|
+
"success-ghost": "text-success bg-white hover:bg-success-light focus-visible:ring-success-light focus-visible:ring-offset-white",
|
|
368
370
|
info: "bg-info text-white hover:bg-info/90 focus-visible:ring-info-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
369
371
|
"info-outline": "border border-info text-info bg-white hover:bg-info hover:text-white focus-visible:ring-info-soft focus-visible:ring-offset-white transition-all",
|
|
370
|
-
"info-ghost": "text-info bg-white hover:bg-info-
|
|
372
|
+
"info-ghost": "text-info bg-white hover:bg-info-light focus-visible:ring-info-light focus-visible:ring-offset-white",
|
|
371
373
|
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
372
374
|
"warning-outline": "border border-warning text-warning bg-white hover:bg-warning hover:text-white focus-visible:ring-warning-soft focus-visible:ring-offset-white transition-all",
|
|
373
|
-
"warning-ghost": "text-warning bg-white hover:bg-warning-
|
|
375
|
+
"warning-ghost": "text-warning bg-white hover:bg-warning-light focus-visible:ring-warning-light focus-visible:ring-offset-white",
|
|
374
376
|
danger: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md",
|
|
375
377
|
"danger-outline": "border border-danger text-danger bg-white hover:bg-danger hover:text-white focus-visible:ring-danger-soft focus-visible:ring-offset-white transition-all",
|
|
376
|
-
"danger-ghost": "text-danger bg-white hover:bg-danger-
|
|
378
|
+
"danger-ghost": "text-danger bg-white hover:bg-danger-light focus-visible:ring-danger-light focus-visible:ring-offset-white",
|
|
377
379
|
// Utility variants
|
|
378
380
|
outline: "border border-border text-foreground bg-white hover:bg-accent-soft focus-visible:ring-accent-soft focus-visible:ring-offset-white transition-all",
|
|
379
381
|
destructive: "bg-danger text-white hover:bg-danger/90 focus-visible:ring-danger-soft focus-visible:ring-offset-white shadow-sm hover:shadow-md"
|
|
@@ -390,26 +392,26 @@ const buttonVariants = cva(
|
|
|
390
392
|
}
|
|
391
393
|
}
|
|
392
394
|
), Button = React__default.forwardRef(
|
|
393
|
-
function
|
|
395
|
+
function r({
|
|
394
396
|
className: e,
|
|
395
397
|
variant: t = "primary",
|
|
396
398
|
size: l = "md",
|
|
397
|
-
disabled:
|
|
398
|
-
type:
|
|
399
|
-
children:
|
|
400
|
-
...
|
|
401
|
-
},
|
|
399
|
+
disabled: c = !1,
|
|
400
|
+
type: i = "button",
|
|
401
|
+
children: f,
|
|
402
|
+
...s
|
|
403
|
+
}, g) {
|
|
402
404
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
403
405
|
"button",
|
|
404
406
|
{
|
|
405
|
-
ref:
|
|
406
|
-
type:
|
|
407
|
+
ref: g,
|
|
408
|
+
type: i,
|
|
407
409
|
className: cn(buttonVariants({ variant: t, size: l }), e),
|
|
408
|
-
disabled:
|
|
409
|
-
"aria-disabled":
|
|
410
|
-
inert:
|
|
411
|
-
...
|
|
412
|
-
children:
|
|
410
|
+
disabled: c,
|
|
411
|
+
"aria-disabled": c,
|
|
412
|
+
inert: c ? !0 : void 0,
|
|
413
|
+
...s,
|
|
414
|
+
children: f
|
|
413
415
|
}
|
|
414
416
|
);
|
|
415
417
|
}
|
|
@@ -424,7 +426,11 @@ const buttonVariants = cva(
|
|
|
424
426
|
success: "text-success",
|
|
425
427
|
info: "text-info",
|
|
426
428
|
warning: "text-warning",
|
|
427
|
-
danger: "text-danger"
|
|
429
|
+
danger: "text-danger",
|
|
430
|
+
inherit: "",
|
|
431
|
+
gray: "text-gray-500",
|
|
432
|
+
black: "text-black",
|
|
433
|
+
white: "text-white"
|
|
428
434
|
},
|
|
429
435
|
hasUnderline: {
|
|
430
436
|
true: "underline",
|
|
@@ -480,19 +486,19 @@ const buttonVariants = cva(
|
|
|
480
486
|
}
|
|
481
487
|
}), Text = forwardRef(
|
|
482
488
|
({
|
|
483
|
-
as:
|
|
489
|
+
as: r = "span",
|
|
484
490
|
color: e = "ghost",
|
|
485
491
|
hasUnderline: t = !1,
|
|
486
492
|
isCapitalize: l = !1,
|
|
487
|
-
align:
|
|
488
|
-
italic:
|
|
489
|
-
clamp:
|
|
490
|
-
ellipsis:
|
|
491
|
-
fontSize:
|
|
493
|
+
align: c = "left",
|
|
494
|
+
italic: i = !1,
|
|
495
|
+
clamp: f = "none",
|
|
496
|
+
ellipsis: s = !1,
|
|
497
|
+
fontSize: g,
|
|
492
498
|
fontWeight: h,
|
|
493
499
|
className: b,
|
|
494
500
|
children: v,
|
|
495
|
-
...
|
|
501
|
+
...u
|
|
496
502
|
}, y) => {
|
|
497
503
|
const a = [
|
|
498
504
|
"h1",
|
|
@@ -504,9 +510,9 @@ const buttonVariants = cva(
|
|
|
504
510
|
"p",
|
|
505
511
|
"span",
|
|
506
512
|
"label"
|
|
507
|
-
].includes(
|
|
513
|
+
].includes(r) ? r : "span", w = g ? `text-${g}` : "", m = h ? `font-${h}` : "";
|
|
508
514
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
509
|
-
|
|
515
|
+
r,
|
|
510
516
|
{
|
|
511
517
|
ref: y,
|
|
512
518
|
className: cn(
|
|
@@ -514,10 +520,10 @@ const buttonVariants = cva(
|
|
|
514
520
|
color: e,
|
|
515
521
|
hasUnderline: t,
|
|
516
522
|
isCapitalize: l,
|
|
517
|
-
align:
|
|
518
|
-
italic:
|
|
519
|
-
clamp:
|
|
520
|
-
ellipsis:
|
|
523
|
+
align: c,
|
|
524
|
+
italic: i,
|
|
525
|
+
clamp: f,
|
|
526
|
+
ellipsis: s,
|
|
521
527
|
// @ts-expect-error - `as` is not a valid variant
|
|
522
528
|
as: a
|
|
523
529
|
}),
|
|
@@ -525,22 +531,22 @@ const buttonVariants = cva(
|
|
|
525
531
|
m,
|
|
526
532
|
b
|
|
527
533
|
),
|
|
528
|
-
...
|
|
534
|
+
...u,
|
|
529
535
|
children: v
|
|
530
536
|
}
|
|
531
537
|
);
|
|
532
538
|
}
|
|
533
539
|
), CalendarRoot = ({
|
|
534
|
-
value:
|
|
540
|
+
value: r,
|
|
535
541
|
onChange: e,
|
|
536
542
|
className: t,
|
|
537
543
|
...l
|
|
538
544
|
}) => {
|
|
539
|
-
const
|
|
540
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "base", fontWeight: "semibold", children:
|
|
545
|
+
const c = /* @__PURE__ */ new Date(), [i, f] = useState(c.getMonth()), [s, g] = useState(c.getFullYear()), h = (n, a) => new Date(n, a + 1, 0).getDate(), b = (n, a) => new Date(n, a, 1).getDay(), v = () => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-4 pt-4 pb-2", children: [
|
|
546
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "base", fontWeight: "semibold", className: "ml-2", children: r ? r.toLocaleDateString(void 0, {
|
|
541
547
|
year: "numeric",
|
|
542
548
|
month: "long"
|
|
543
|
-
}) : `${
|
|
549
|
+
}) : `${s} ${new Date(s, i).toLocaleString(void 0, { month: "long" })}` }),
|
|
544
550
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
|
|
545
551
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
546
552
|
ButtonIcon,
|
|
@@ -550,8 +556,8 @@ const buttonVariants = cva(
|
|
|
550
556
|
size: "sm",
|
|
551
557
|
"aria-label": "Previous month",
|
|
552
558
|
onClick: () => {
|
|
553
|
-
const n =
|
|
554
|
-
|
|
559
|
+
const n = i === 0 ? 11 : i - 1, a = i === 0 ? s - 1 : s;
|
|
560
|
+
f(n), g(a), e?.(new Date(a, n, 1));
|
|
555
561
|
}
|
|
556
562
|
}
|
|
557
563
|
),
|
|
@@ -563,75 +569,81 @@ const buttonVariants = cva(
|
|
|
563
569
|
size: "sm",
|
|
564
570
|
"aria-label": "Next month",
|
|
565
571
|
onClick: () => {
|
|
566
|
-
const n =
|
|
567
|
-
|
|
572
|
+
const n = i === 11 ? 0 : i + 1, a = i === 11 ? s + 1 : s;
|
|
573
|
+
f(n), g(a), e?.(new Date(a, n, 1));
|
|
568
574
|
}
|
|
569
575
|
}
|
|
570
576
|
)
|
|
571
577
|
] })
|
|
572
|
-
] }),
|
|
573
|
-
const n = [], a = b(
|
|
574
|
-
for (let
|
|
575
|
-
const d = m - a +
|
|
578
|
+
] }), u = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 px-4 text-ghost-500 mb-3", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((n) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fontSize: "xs", color: "ghost", align: "center", children: n }, n)) }), y = () => {
|
|
579
|
+
const n = [], a = b(s, i), w = h(s, i), m = h(s, i - 1 < 0 ? 11 : i - 1);
|
|
580
|
+
for (let o = 0; o < a; o++) {
|
|
581
|
+
const d = m - a + o + 1;
|
|
576
582
|
n.push(
|
|
577
583
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
578
584
|
ButtonIcon,
|
|
579
585
|
{
|
|
580
|
-
as: () => d,
|
|
586
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: d }),
|
|
581
587
|
size: "sm",
|
|
582
588
|
"aria-label": "Previous month day",
|
|
583
589
|
variant: "ghost",
|
|
584
|
-
className: "text-slate-300",
|
|
585
590
|
onClick: () => {
|
|
586
|
-
const x =
|
|
587
|
-
e?.(new Date(p, x, R)),
|
|
591
|
+
const x = i === 0 ? 11 : i - 1, p = i === 0 ? s - 1 : s, R = m - a + o + 1;
|
|
592
|
+
e?.(new Date(p, x, R)), f(x), g(p);
|
|
588
593
|
}
|
|
589
594
|
},
|
|
590
|
-
"prev-" +
|
|
595
|
+
"prev-" + o
|
|
591
596
|
)
|
|
592
597
|
);
|
|
593
598
|
}
|
|
594
|
-
for (let
|
|
595
|
-
const d =
|
|
599
|
+
for (let o = 1; o <= w; o++) {
|
|
600
|
+
const d = r && r.getFullYear() === s && r.getMonth() === i && r.getDate() === o;
|
|
596
601
|
n.push(
|
|
597
602
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
598
603
|
ButtonIcon,
|
|
599
604
|
{
|
|
600
|
-
as: () =>
|
|
605
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
606
|
+
Text,
|
|
607
|
+
{
|
|
608
|
+
as: "span",
|
|
609
|
+
fontSize: "sm",
|
|
610
|
+
color: d ? "inherit" : "ghost",
|
|
611
|
+
children: o
|
|
612
|
+
}
|
|
613
|
+
),
|
|
601
614
|
variant: d ? "primary" : "ghost",
|
|
602
615
|
size: "sm",
|
|
603
|
-
"aria-label": `Select ${
|
|
616
|
+
"aria-label": `Select ${s}-${i + 1}-${o}`,
|
|
604
617
|
"aria-current": d ? "date" : void 0,
|
|
605
|
-
onClick: () => e?.(new Date(
|
|
618
|
+
onClick: () => e?.(new Date(s, i, o))
|
|
606
619
|
},
|
|
607
|
-
|
|
620
|
+
o
|
|
608
621
|
)
|
|
609
622
|
);
|
|
610
623
|
}
|
|
611
624
|
const j = a + w;
|
|
612
|
-
for (let
|
|
625
|
+
for (let o = 0; o < (j % 7 === 0 ? 0 : 7 - j % 7); o++)
|
|
613
626
|
n.push(
|
|
614
627
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
615
628
|
ButtonIcon,
|
|
616
629
|
{
|
|
617
|
-
as: () =>
|
|
630
|
+
as: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "sm", color: "tertiary", children: o + 1 }),
|
|
618
631
|
size: "sm",
|
|
619
632
|
"aria-label": "Next month day",
|
|
620
633
|
variant: "ghost",
|
|
621
|
-
className: "text-slate-300",
|
|
622
634
|
onClick: () => {
|
|
623
|
-
const d =
|
|
624
|
-
e?.(new Date(x, d, p)),
|
|
635
|
+
const d = i === 11 ? 0 : i + 1, x = i === 11 ? s + 1 : s, p = o + 1;
|
|
636
|
+
e?.(new Date(x, d, p)), f(d), g(x);
|
|
625
637
|
}
|
|
626
638
|
},
|
|
627
|
-
"next-" +
|
|
639
|
+
"next-" + o
|
|
628
640
|
)
|
|
629
641
|
);
|
|
630
642
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-2 px-4 pb-4", children: n });
|
|
631
643
|
};
|
|
632
644
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("select-none", t), ...l, children: [
|
|
633
645
|
v(),
|
|
634
|
-
|
|
646
|
+
u(),
|
|
635
647
|
y()
|
|
636
648
|
] });
|
|
637
649
|
}, Calendar = Object.assign(CalendarRoot, {});
|