@devalok/shilp-sutra 0.8.3 → 0.9.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/_chunks/avatar.js +50 -0
- package/dist/_chunks/button.js +95 -0
- package/dist/_chunks/card.js +40 -0
- package/dist/_chunks/checkbox.js +14 -0
- package/dist/_chunks/form.js +27 -0
- package/dist/_chunks/primitives.js +6965 -0
- package/dist/_chunks/sidebar.js +592 -0
- package/dist/_chunks/spinner.js +34 -0
- package/dist/_chunks/tiptap.js +15254 -0
- package/dist/_chunks/tooltip.js +13 -0
- package/dist/_chunks/tree-view.js +304 -0
- package/dist/_chunks/use-calendar.js +990 -0
- package/dist/_chunks/utils.js +15 -0
- package/dist/_chunks/vendor.js +5823 -0
- package/dist/composed/avatar-group.js +20 -20
- package/dist/composed/command-palette.js +1 -1
- package/dist/composed/confirm-dialog.js +5 -5
- package/dist/composed/content-card.d.ts +1 -1
- package/dist/composed/content-card.js +6 -6
- package/dist/composed/date-picker/index.js +13 -0
- package/dist/composed/empty-state.js +10 -10
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +4 -4
- package/dist/composed/index.js +45 -53
- package/dist/composed/loading-skeleton.js +2 -2
- package/dist/composed/member-picker.js +5 -5
- package/dist/composed/page-header.js +4 -4
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +422 -209
- package/dist/composed/schedule-view.js +1 -1
- package/dist/composed/simple-tooltip.js +6 -6
- package/dist/composed/status-badge.d.ts +1 -1
- package/dist/composed/status-badge.js +2 -2
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/notification-center.js +2 -2
- package/dist/shell/notification-preferences.js +32 -33
- package/dist/shell/sidebar.js +24 -24
- package/dist/shell/top-bar.js +22 -22
- package/dist/ui/accordion.js +17 -17
- package/dist/ui/alert-dialog.js +29 -29
- package/dist/ui/alert.d.ts +2 -2
- package/dist/ui/alert.js +65 -44
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/autocomplete.js +11 -11
- package/dist/ui/avatar.d.ts +1 -1
- package/dist/ui/avatar.js +67 -25
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +115 -91
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.js +5 -5
- package/dist/ui/breadcrumb.js +14 -14
- package/dist/ui/button-group.js +30 -15
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +114 -71
- package/dist/ui/card.js +66 -22
- package/dist/ui/charts/index.js +1221 -18
- package/dist/ui/checkbox.js +25 -5
- package/dist/ui/chip.d.ts +4 -4
- package/dist/ui/chip.js +2 -2
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +5 -5
- package/dist/ui/color-input.js +11 -11
- package/dist/ui/combobox.js +12 -12
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +37 -37
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +2 -2
- package/dist/ui/dialog.js +33 -33
- package/dist/ui/dropdown-menu.js +60 -60
- package/dist/ui/file-upload.js +1 -1
- package/dist/ui/form.js +36 -15
- package/dist/ui/hover-card.js +7 -7
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +523 -325
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +14 -14
- package/dist/ui/input.js +56 -28
- package/dist/ui/label.js +18 -4
- package/dist/ui/lib/utils.js +4 -5
- package/dist/ui/link.js +9 -9
- package/dist/ui/menubar.js +81 -81
- package/dist/ui/navigation-menu.js +42 -42
- package/dist/ui/number-input.js +13 -13
- package/dist/ui/pagination.js +5 -5
- package/dist/ui/popover.js +9 -9
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/progress.js +15 -15
- package/dist/ui/radio.js +10 -10
- package/dist/ui/search-input.js +5 -5
- package/dist/ui/segmented-control.js +91 -83
- package/dist/ui/select.js +52 -52
- package/dist/ui/separator.js +20 -5
- package/dist/ui/sheet.js +28 -28
- package/dist/ui/sidebar.js +36 -560
- package/dist/ui/skeleton.d.ts +1 -1
- package/dist/ui/skeleton.js +9 -9
- package/dist/ui/slider.js +11 -11
- package/dist/ui/spinner.js +37 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +1 -1
- package/dist/ui/stepper.js +15 -15
- package/dist/ui/switch.js +22 -3
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.js +59 -32
- package/dist/ui/text.js +2 -2
- package/dist/ui/textarea.js +7 -7
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +28 -28
- package/dist/ui/toggle-group.js +11 -11
- package/dist/ui/toggle.js +9 -9
- package/dist/ui/tooltip.js +17 -6
- package/dist/ui/transitions.js +68 -58
- package/dist/ui/tree-view/index.js +7 -0
- package/dist/ui/visually-hidden.js +3 -3
- package/llms-full.txt +1 -1
- package/llms.txt +7 -0
- package/package.json +656 -701
- package/dist/_virtual/client.js +0 -5
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/react-dom-client.development.js +0 -5
- package/dist/_virtual/react-dom-client.production.js +0 -5
- package/dist/_virtual/scheduler.development.js +0 -5
- package/dist/_virtual/scheduler.production.js +0 -5
- package/dist/composed/date-picker/calendar-grid.js +0 -194
- package/dist/composed/date-picker/date-picker.js +0 -124
- package/dist/composed/date-picker/date-range-picker.js +0 -167
- package/dist/composed/date-picker/date-time-picker.js +0 -193
- package/dist/composed/date-picker/month-picker.js +0 -53
- package/dist/composed/date-picker/presets.js +0 -84
- package/dist/composed/date-picker/time-picker.js +0 -181
- package/dist/composed/date-picker/use-calendar.js +0 -17
- package/dist/composed/date-picker/year-picker.js +0 -45
- package/dist/composed/extensions/emoji-suggestion.js +0 -119
- package/dist/composed/extensions/file-attachment.js +0 -55
- package/dist/composed/extensions/mention-suggestion.js +0 -79
- package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
- package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
- package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
- package/dist/primitives/_internal/number.js +0 -6
- package/dist/primitives/_internal/primitive.js +0 -9
- package/dist/primitives/_internal/react-arrow.js +0 -13
- package/dist/primitives/_internal/react-collection.js +0 -48
- package/dist/primitives/_internal/react-compose-refs.js +0 -29
- package/dist/primitives/_internal/react-context.js +0 -76
- package/dist/primitives/_internal/react-direction.js +0 -10
- package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
- package/dist/primitives/_internal/react-focus-guards.js +0 -17
- package/dist/primitives/_internal/react-focus-scope.js +0 -137
- package/dist/primitives/_internal/react-id.js +0 -14
- package/dist/primitives/_internal/react-popper.js +0 -137
- package/dist/primitives/_internal/react-portal.js +0 -16
- package/dist/primitives/_internal/react-presence.js +0 -71
- package/dist/primitives/_internal/react-primitive.js +0 -36
- package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
- package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
- package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
- package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
- package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
- package/dist/primitives/_internal/react-use-previous.js +0 -8
- package/dist/primitives/_internal/react-use-size.js +0 -27
- package/dist/primitives/react-accordion.js +0 -239
- package/dist/primitives/react-alert-dialog.js +0 -127
- package/dist/primitives/react-aspect-ratio.js +0 -43
- package/dist/primitives/react-avatar.js +0 -75
- package/dist/primitives/react-checkbox.js +0 -251
- package/dist/primitives/react-collapsible.js +0 -120
- package/dist/primitives/react-context-menu.js +0 -240
- package/dist/primitives/react-dialog.js +0 -262
- package/dist/primitives/react-dropdown-menu.js +0 -227
- package/dist/primitives/react-hover-card.js +0 -187
- package/dist/primitives/react-label.js +0 -20
- package/dist/primitives/react-menu.js +0 -652
- package/dist/primitives/react-menubar.js +0 -355
- package/dist/primitives/react-navigation-menu.js +0 -607
- package/dist/primitives/react-popover.js +0 -243
- package/dist/primitives/react-progress.js +0 -84
- package/dist/primitives/react-radio-group.js +0 -238
- package/dist/primitives/react-roving-focus.js +0 -183
- package/dist/primitives/react-select.js +0 -862
- package/dist/primitives/react-separator.js +0 -24
- package/dist/primitives/react-slider.js +0 -437
- package/dist/primitives/react-slot.js +0 -70
- package/dist/primitives/react-switch.js +0 -132
- package/dist/primitives/react-tabs.js +0 -163
- package/dist/primitives/react-toast.js +0 -446
- package/dist/primitives/react-toggle-group.js +0 -137
- package/dist/primitives/react-toggle.js +0 -33
- package/dist/primitives/react-tooltip.js +0 -338
- package/dist/primitives/react-visually-hidden.js +0 -32
- package/dist/ui/charts/_internal/animation.js +0 -18
- package/dist/ui/charts/_internal/axes.js +0 -42
- package/dist/ui/charts/_internal/colors.js +0 -21
- package/dist/ui/charts/_internal/grid-lines.js +0 -43
- package/dist/ui/charts/_internal/legend.js +0 -29
- package/dist/ui/charts/_internal/tooltip.js +0 -39
- package/dist/ui/charts/_internal/types.js +0 -10
- package/dist/ui/charts/area-chart.js +0 -245
- package/dist/ui/charts/bar-chart.js +0 -153
- package/dist/ui/charts/chart-container.js +0 -27
- package/dist/ui/charts/gauge-chart.js +0 -72
- package/dist/ui/charts/line-chart.js +0 -163
- package/dist/ui/charts/pie-chart.js +0 -132
- package/dist/ui/charts/radar-chart.js +0 -223
- package/dist/ui/charts/sparkline.js +0 -124
- package/dist/ui/lib/motion.js +0 -32
- package/dist/ui/lib/use-reduced-motion.js +0 -15
- package/dist/ui/lib/use-ripple.js +0 -14
- package/dist/ui/tree-view/tree-item.js +0 -139
- package/dist/ui/tree-view/tree-view.js +0 -140
- package/dist/ui/tree-view/use-tree.js +0 -38
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import * as m from "react";
|
|
4
|
-
import { format as U, setHours as y, setMinutes as k, setMonth as W, setYear as X } from "date-fns";
|
|
5
|
-
import { IconCalendarClock as Z } from "@tabler/icons-react";
|
|
6
|
-
import { cn as A } from "../../ui/lib/utils.js";
|
|
7
|
-
import { Popover as _, PopoverTrigger as F, PopoverContent as v } from "../../ui/popover.js";
|
|
8
|
-
import { CalendarGrid as C } from "./calendar-grid.js";
|
|
9
|
-
import { YearPicker as ee } from "./year-picker.js";
|
|
10
|
-
import { MonthPicker as te } from "./month-picker.js";
|
|
11
|
-
function Y(u) {
|
|
12
|
-
return u.toString().padStart(2, "0");
|
|
13
|
-
}
|
|
14
|
-
function w(u, e, s) {
|
|
15
|
-
const l = [];
|
|
16
|
-
for (let c = u; c <= e; c += s)
|
|
17
|
-
l.push(c);
|
|
18
|
-
return l;
|
|
19
|
-
}
|
|
20
|
-
const re = m.forwardRef(
|
|
21
|
-
function({
|
|
22
|
-
value: e,
|
|
23
|
-
onChange: s,
|
|
24
|
-
minDate: l,
|
|
25
|
-
maxDate: c,
|
|
26
|
-
disabledDates: T,
|
|
27
|
-
timeFormat: i = "12h",
|
|
28
|
-
minuteStep: D = 1,
|
|
29
|
-
placeholder: P = "Pick date & time",
|
|
30
|
-
className: R
|
|
31
|
-
}, O) {
|
|
32
|
-
const [b, j] = m.useState(!1), [M, g] = m.useState(e ?? /* @__PURE__ */ new Date()), [N, f] = m.useState("days");
|
|
33
|
-
m.useEffect(() => {
|
|
34
|
-
b || f("days");
|
|
35
|
-
}, [b]);
|
|
36
|
-
const d = e ? e.getHours() : 0, H = e ? e.getMinutes() : 0, S = d >= 12 ? "PM" : "AM", V = d === 0 ? 12 : d > 12 ? d - 12 : d, B = i === "12h" ? w(1, 12, 1) : w(0, 23, 1), E = w(0, 59, D), G = i === "12h" ? V : d, I = (t) => {
|
|
37
|
-
let o = y(t, e ? e.getHours() : d);
|
|
38
|
-
o = k(o, e ? e.getMinutes() : H), s == null || s(o);
|
|
39
|
-
}, $ = () => {
|
|
40
|
-
f((t) => t === "days" ? "months" : "years");
|
|
41
|
-
}, q = (t) => {
|
|
42
|
-
g((o) => W(o, t)), f("days");
|
|
43
|
-
}, z = (t) => {
|
|
44
|
-
g((o) => X(o, t)), f("months");
|
|
45
|
-
}, J = (t) => {
|
|
46
|
-
const o = e ? new Date(e) : /* @__PURE__ */ new Date();
|
|
47
|
-
let n = t;
|
|
48
|
-
i === "12h" && ((e ? S : "AM") === "AM" ? n = t === 12 ? 0 : t : n = t === 12 ? 12 : t + 12);
|
|
49
|
-
const p = y(o, n);
|
|
50
|
-
s == null || s(p);
|
|
51
|
-
}, K = (t) => {
|
|
52
|
-
const o = e ? new Date(e) : /* @__PURE__ */ new Date(), n = k(o, t);
|
|
53
|
-
s == null || s(n);
|
|
54
|
-
}, L = (t) => {
|
|
55
|
-
const o = e ? new Date(e) : /* @__PURE__ */ new Date(), n = o.getHours();
|
|
56
|
-
let p;
|
|
57
|
-
t === "AM" ? p = n >= 12 ? n - 12 : n : p = n < 12 ? n + 12 : n, s == null || s(y(o, p));
|
|
58
|
-
}, h = m.useMemo(() => e ? U(e, i === "12h" ? "MMM d, yyyy h:mm a" : "MMM d, yyyy HH:mm") : null, [e, i]), Q = () => {
|
|
59
|
-
switch (N) {
|
|
60
|
-
case "years":
|
|
61
|
-
return /* @__PURE__ */ r(
|
|
62
|
-
ee,
|
|
63
|
-
{
|
|
64
|
-
currentYear: M.getFullYear(),
|
|
65
|
-
selectedYear: e == null ? void 0 : e.getFullYear(),
|
|
66
|
-
onYearSelect: z,
|
|
67
|
-
minDate: l,
|
|
68
|
-
maxDate: c
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
case "months":
|
|
72
|
-
return /* @__PURE__ */ r(
|
|
73
|
-
te,
|
|
74
|
-
{
|
|
75
|
-
currentYear: M.getFullYear(),
|
|
76
|
-
selectedMonth: e == null ? void 0 : e.getMonth(),
|
|
77
|
-
onMonthSelect: q,
|
|
78
|
-
minDate: l,
|
|
79
|
-
maxDate: c
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
default:
|
|
83
|
-
return /* @__PURE__ */ r(
|
|
84
|
-
C,
|
|
85
|
-
{
|
|
86
|
-
currentMonth: M,
|
|
87
|
-
selected: e,
|
|
88
|
-
onSelect: I,
|
|
89
|
-
onMonthChange: g,
|
|
90
|
-
onHeaderClick: $,
|
|
91
|
-
disabledDates: T,
|
|
92
|
-
minDate: l,
|
|
93
|
-
maxDate: c
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
}, x = "h-ds-sm rounded-ds-md border border-border bg-layer-01 px-ds-02 text-ds-md text-text-primary transition-colors duration-fast-01 ease-productive-standard hover:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus cursor-pointer appearance-none";
|
|
98
|
-
return /* @__PURE__ */ a(_, { open: b, onOpenChange: j, children: [
|
|
99
|
-
/* @__PURE__ */ r(F, { asChild: !0, children: /* @__PURE__ */ a(
|
|
100
|
-
"button",
|
|
101
|
-
{
|
|
102
|
-
ref: O,
|
|
103
|
-
type: "button",
|
|
104
|
-
className: A(
|
|
105
|
-
"inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
|
|
106
|
-
"hover:border-border-strong",
|
|
107
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
|
|
108
|
-
R
|
|
109
|
-
),
|
|
110
|
-
"aria-label": h ? `Selected: ${h}` : P,
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ r(
|
|
113
|
-
Z,
|
|
114
|
-
{
|
|
115
|
-
className: "h-ico-sm w-ico-sm text-text-placeholder",
|
|
116
|
-
stroke: 1.5
|
|
117
|
-
}
|
|
118
|
-
),
|
|
119
|
-
/* @__PURE__ */ r(
|
|
120
|
-
"span",
|
|
121
|
-
{
|
|
122
|
-
className: A(
|
|
123
|
-
"text-ds-md",
|
|
124
|
-
h ? "text-text-primary" : "text-text-placeholder"
|
|
125
|
-
),
|
|
126
|
-
children: h ?? P
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
) }),
|
|
132
|
-
/* @__PURE__ */ r(
|
|
133
|
-
v,
|
|
134
|
-
{
|
|
135
|
-
className: "w-auto border-border bg-layer-01 p-ds-04",
|
|
136
|
-
align: "start",
|
|
137
|
-
sideOffset: 4,
|
|
138
|
-
children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-ds-04", children: [
|
|
139
|
-
Q(),
|
|
140
|
-
N === "days" && /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02 border-t border-border pt-ds-04", children: [
|
|
141
|
-
/* @__PURE__ */ r("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Time" }),
|
|
142
|
-
/* @__PURE__ */ a(
|
|
143
|
-
"select",
|
|
144
|
-
{
|
|
145
|
-
value: G ?? "",
|
|
146
|
-
onChange: (t) => J(Number(t.target.value)),
|
|
147
|
-
className: x,
|
|
148
|
-
"aria-label": "Hour",
|
|
149
|
-
children: [
|
|
150
|
-
!e && /* @__PURE__ */ r("option", { value: "", children: "--" }),
|
|
151
|
-
B.map((t) => /* @__PURE__ */ r("option", { value: t, children: i === "24h" ? Y(t) : t }, t))
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
),
|
|
155
|
-
/* @__PURE__ */ r("span", { className: "text-ds-md font-semibold text-text-placeholder", children: ":" }),
|
|
156
|
-
/* @__PURE__ */ a(
|
|
157
|
-
"select",
|
|
158
|
-
{
|
|
159
|
-
value: e ? H : "",
|
|
160
|
-
onChange: (t) => K(Number(t.target.value)),
|
|
161
|
-
className: x,
|
|
162
|
-
"aria-label": "Minute",
|
|
163
|
-
children: [
|
|
164
|
-
!e && /* @__PURE__ */ r("option", { value: "", children: "--" }),
|
|
165
|
-
E.map((t) => /* @__PURE__ */ r("option", { value: t, children: Y(t) }, t))
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
i === "12h" && /* @__PURE__ */ a(
|
|
170
|
-
"select",
|
|
171
|
-
{
|
|
172
|
-
value: e ? S : "",
|
|
173
|
-
onChange: (t) => L(t.target.value),
|
|
174
|
-
className: x,
|
|
175
|
-
"aria-label": "AM or PM",
|
|
176
|
-
children: [
|
|
177
|
-
!e && /* @__PURE__ */ r("option", { value: "", children: "--" }),
|
|
178
|
-
/* @__PURE__ */ r("option", { value: "AM", children: "AM" }),
|
|
179
|
-
/* @__PURE__ */ r("option", { value: "PM", children: "PM" })
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
] })
|
|
184
|
-
] })
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
] });
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
re.displayName = "DateTimePicker";
|
|
191
|
-
export {
|
|
192
|
-
re as DateTimePicker
|
|
193
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import * as m from "react";
|
|
4
|
-
import { cn as u } from "../../ui/lib/utils.js";
|
|
5
|
-
const g = [
|
|
6
|
-
"Jan",
|
|
7
|
-
"Feb",
|
|
8
|
-
"Mar",
|
|
9
|
-
"Apr",
|
|
10
|
-
"May",
|
|
11
|
-
"Jun",
|
|
12
|
-
"Jul",
|
|
13
|
-
"Aug",
|
|
14
|
-
"Sep",
|
|
15
|
-
"Oct",
|
|
16
|
-
"Nov",
|
|
17
|
-
"Dec"
|
|
18
|
-
], h = m.forwardRef(
|
|
19
|
-
function({
|
|
20
|
-
currentYear: t,
|
|
21
|
-
selectedMonth: i,
|
|
22
|
-
onMonthSelect: c,
|
|
23
|
-
minDate: e,
|
|
24
|
-
maxDate: o
|
|
25
|
-
}, a) {
|
|
26
|
-
return /* @__PURE__ */ p("div", { ref: a, className: "w-[252px]", children: [
|
|
27
|
-
/* @__PURE__ */ r("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-text-primary", children: t }),
|
|
28
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-ds-02", children: g.map((n, s) => {
|
|
29
|
-
const d = s === i, l = e != null && (t < e.getFullYear() || t === e.getFullYear() && s < e.getMonth()) || o != null && (t > o.getFullYear() || t === o.getFullYear() && s > o.getMonth());
|
|
30
|
-
return /* @__PURE__ */ r(
|
|
31
|
-
"button",
|
|
32
|
-
{
|
|
33
|
-
type: "button",
|
|
34
|
-
disabled: l || !1,
|
|
35
|
-
onClick: () => !l && c(s),
|
|
36
|
-
className: u(
|
|
37
|
-
"h-ds-sm-plus rounded-ds-md text-ds-md transition-colors",
|
|
38
|
-
l && "opacity-[0.38] pointer-events-none cursor-not-allowed",
|
|
39
|
-
d && "bg-interactive text-text-on-color",
|
|
40
|
-
!d && !l && "hover:bg-field text-text-primary"
|
|
41
|
-
),
|
|
42
|
-
children: n
|
|
43
|
-
},
|
|
44
|
-
n
|
|
45
|
-
);
|
|
46
|
-
}) })
|
|
47
|
-
] });
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
h.displayName = "MonthPicker";
|
|
51
|
-
export {
|
|
52
|
-
h as MonthPicker
|
|
53
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import * as b from "react";
|
|
4
|
-
import { endOfDay as e, startOfYear as w, subMonths as h, endOfMonth as d, startOfMonth as i, startOfDay as s, subDays as r } from "date-fns";
|
|
5
|
-
import { cn as c } from "../../ui/lib/utils.js";
|
|
6
|
-
const p = {
|
|
7
|
-
today: {
|
|
8
|
-
label: "Today",
|
|
9
|
-
getRange: () => {
|
|
10
|
-
const t = /* @__PURE__ */ new Date();
|
|
11
|
-
return { start: s(t), end: e(t) };
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
yesterday: {
|
|
15
|
-
label: "Yesterday",
|
|
16
|
-
getRange: () => {
|
|
17
|
-
const t = r(/* @__PURE__ */ new Date(), 1);
|
|
18
|
-
return { start: s(t), end: e(t) };
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
last7days: {
|
|
22
|
-
label: "Last 7 days",
|
|
23
|
-
getRange: () => {
|
|
24
|
-
const t = /* @__PURE__ */ new Date();
|
|
25
|
-
return { start: s(r(t, 6)), end: e(t) };
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
last30days: {
|
|
29
|
-
label: "Last 30 days",
|
|
30
|
-
getRange: () => {
|
|
31
|
-
const t = /* @__PURE__ */ new Date();
|
|
32
|
-
return { start: s(r(t, 29)), end: e(t) };
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
thisMonth: {
|
|
36
|
-
label: "This month",
|
|
37
|
-
getRange: () => {
|
|
38
|
-
const t = /* @__PURE__ */ new Date();
|
|
39
|
-
return { start: i(t), end: d(t) };
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
lastMonth: {
|
|
43
|
-
label: "Last month",
|
|
44
|
-
getRange: () => {
|
|
45
|
-
const n = h(/* @__PURE__ */ new Date(), 1);
|
|
46
|
-
return { start: i(n), end: d(n) };
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
thisYear: {
|
|
50
|
-
label: "This year",
|
|
51
|
-
getRange: () => {
|
|
52
|
-
const t = /* @__PURE__ */ new Date();
|
|
53
|
-
return { start: w(t), end: e(t) };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, R = b.forwardRef(
|
|
57
|
-
function({ presets: n, onSelect: u, className: f }, g) {
|
|
58
|
-
return /* @__PURE__ */ l("div", { ref: g, className: c("flex flex-col gap-ds-01", f), children: n.map((o) => {
|
|
59
|
-
const a = p[o];
|
|
60
|
-
return a ? /* @__PURE__ */ l(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
type: "button",
|
|
64
|
-
onClick: () => {
|
|
65
|
-
const { start: m, end: y } = a.getRange();
|
|
66
|
-
u(m, y);
|
|
67
|
-
},
|
|
68
|
-
className: c(
|
|
69
|
-
"h-ds-sm w-full rounded-ds-md px-ds-03 text-left text-ds-sm",
|
|
70
|
-
"text-text-primary transition-colors",
|
|
71
|
-
"hover:bg-field",
|
|
72
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus"
|
|
73
|
-
),
|
|
74
|
-
children: a.label
|
|
75
|
-
},
|
|
76
|
-
o
|
|
77
|
-
) : null;
|
|
78
|
-
}) });
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
R.displayName = "Presets";
|
|
82
|
-
export {
|
|
83
|
-
R as Presets
|
|
84
|
-
};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import * as P from "react";
|
|
4
|
-
import { format as O, setHours as S, setMinutes as $, setSeconds as j } from "date-fns";
|
|
5
|
-
import { IconClock as X } from "@tabler/icons-react";
|
|
6
|
-
import { cn as i } from "../../ui/lib/utils.js";
|
|
7
|
-
import { Popover as Y, PopoverTrigger as Z, PopoverContent as _ } from "../../ui/popover.js";
|
|
8
|
-
function w(f, s, c) {
|
|
9
|
-
const l = [];
|
|
10
|
-
for (let m = f; m <= s; m += c)
|
|
11
|
-
l.push(m);
|
|
12
|
-
return l;
|
|
13
|
-
}
|
|
14
|
-
function p(f) {
|
|
15
|
-
return f.toString().padStart(2, "0");
|
|
16
|
-
}
|
|
17
|
-
const F = P.forwardRef(
|
|
18
|
-
function({
|
|
19
|
-
value: s,
|
|
20
|
-
onChange: c,
|
|
21
|
-
format: l = "12h",
|
|
22
|
-
minuteStep: m = 1,
|
|
23
|
-
secondStep: B = 1,
|
|
24
|
-
showSeconds: x = !1,
|
|
25
|
-
placeholder: A = "Pick a time",
|
|
26
|
-
className: I,
|
|
27
|
-
disabled: T = !1
|
|
28
|
-
}, U) {
|
|
29
|
-
const [q, z] = P.useState(!1), o = s ? s.getHours() : null, v = s ? s.getMinutes() : null, D = s ? s.getSeconds() : null, k = o !== null ? o >= 12 ? "PM" : "AM" : null, E = o !== null ? o === 0 ? 12 : o > 12 ? o - 12 : o : null, G = l === "12h" ? w(1, 12, 1) : w(0, 23, 1), J = w(0, 59, m), K = w(0, 59, B), y = (e) => {
|
|
30
|
-
const t = s ? new Date(s) : /* @__PURE__ */ new Date();
|
|
31
|
-
let a = e.hours ?? t.getHours();
|
|
32
|
-
const H = e.minutes ?? t.getMinutes(), n = e.seconds ?? t.getSeconds();
|
|
33
|
-
l === "12h" && e.hours !== void 0 && ((e.ampm ?? k ?? "AM") === "AM" ? a = e.hours === 12 ? 0 : e.hours : a = e.hours === 12 ? 12 : e.hours + 12);
|
|
34
|
-
let u = S(t, a);
|
|
35
|
-
return u = $(u, H), u = j(u, n), u;
|
|
36
|
-
}, L = (e) => {
|
|
37
|
-
const t = y({ hours: e });
|
|
38
|
-
c == null || c(t);
|
|
39
|
-
}, Q = (e) => {
|
|
40
|
-
const t = y({ minutes: e });
|
|
41
|
-
c == null || c(t);
|
|
42
|
-
}, V = (e) => {
|
|
43
|
-
const t = y({ seconds: e });
|
|
44
|
-
c == null || c(t);
|
|
45
|
-
}, W = (e) => {
|
|
46
|
-
if (!s) {
|
|
47
|
-
const H = e === "AM" ? 0 : 12;
|
|
48
|
-
let n = /* @__PURE__ */ new Date();
|
|
49
|
-
n = S(n, H), n = $(n, 0), n = j(n, 0), c == null || c(n);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const t = s.getHours();
|
|
53
|
-
let a;
|
|
54
|
-
e === "AM" ? a = t >= 12 ? t - 12 : t : a = t < 12 ? t + 12 : t, c == null || c(S(new Date(s), a));
|
|
55
|
-
}, b = P.useMemo(() => s ? l === "12h" ? O(s, x ? "h:mm:ss a" : "h:mm a") : O(s, x ? "HH:mm:ss" : "HH:mm") : null, [s, l, x]), R = l === "12h" ? E : o, M = "flex flex-col gap-ds-01 overflow-y-auto max-h-[200px] px-ds-01", h = "flex h-ds-sm w-full items-center justify-center rounded-ds-md text-ds-md transition-colors duration-fast-01 ease-productive-standard cursor-pointer", N = "bg-interactive text-text-on-color", g = "text-text-primary hover:bg-field";
|
|
56
|
-
return /* @__PURE__ */ d(Y, { open: q, onOpenChange: z, children: [
|
|
57
|
-
/* @__PURE__ */ r(Z, { asChild: !0, children: /* @__PURE__ */ d(
|
|
58
|
-
"button",
|
|
59
|
-
{
|
|
60
|
-
ref: U,
|
|
61
|
-
type: "button",
|
|
62
|
-
disabled: T,
|
|
63
|
-
className: i(
|
|
64
|
-
"inline-flex h-ds-sm-plus items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 px-ds-04 text-left transition-colors duration-fast-01 ease-productive-standard",
|
|
65
|
-
"hover:border-border-strong",
|
|
66
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2",
|
|
67
|
-
T && "opacity-[0.38] pointer-events-none",
|
|
68
|
-
I
|
|
69
|
-
),
|
|
70
|
-
"aria-label": b ? `Selected time: ${b}` : A,
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ r(
|
|
73
|
-
X,
|
|
74
|
-
{
|
|
75
|
-
className: "h-ico-sm w-ico-sm text-text-placeholder",
|
|
76
|
-
stroke: 1.5
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
/* @__PURE__ */ r(
|
|
80
|
-
"span",
|
|
81
|
-
{
|
|
82
|
-
className: i(
|
|
83
|
-
"text-ds-md",
|
|
84
|
-
b ? "text-text-primary" : "text-text-placeholder"
|
|
85
|
-
),
|
|
86
|
-
children: b ?? A
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
) }),
|
|
92
|
-
/* @__PURE__ */ r(
|
|
93
|
-
_,
|
|
94
|
-
{
|
|
95
|
-
className: "w-auto border-border bg-layer-01 p-ds-04",
|
|
96
|
-
align: "start",
|
|
97
|
-
sideOffset: 4,
|
|
98
|
-
children: /* @__PURE__ */ d("div", { className: "flex gap-ds-03", role: "group", "aria-label": "Time picker", children: [
|
|
99
|
-
/* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-ds-02", children: [
|
|
100
|
-
/* @__PURE__ */ r("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Hr" }),
|
|
101
|
-
/* @__PURE__ */ r("div", { className: i(M, "min-w-[48px]"), children: G.map((e) => /* @__PURE__ */ r(
|
|
102
|
-
"button",
|
|
103
|
-
{
|
|
104
|
-
type: "button",
|
|
105
|
-
onClick: () => L(e),
|
|
106
|
-
className: i(
|
|
107
|
-
h,
|
|
108
|
-
R === e ? N : g
|
|
109
|
-
),
|
|
110
|
-
"aria-label": `${e} hours`,
|
|
111
|
-
"aria-selected": R === e || void 0,
|
|
112
|
-
children: l === "24h" ? p(e) : e
|
|
113
|
-
},
|
|
114
|
-
e
|
|
115
|
-
)) })
|
|
116
|
-
] }),
|
|
117
|
-
/* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-ds-02", children: [
|
|
118
|
-
/* @__PURE__ */ r("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Min" }),
|
|
119
|
-
/* @__PURE__ */ r("div", { className: i(M, "min-w-[48px]"), children: J.map((e) => /* @__PURE__ */ r(
|
|
120
|
-
"button",
|
|
121
|
-
{
|
|
122
|
-
type: "button",
|
|
123
|
-
onClick: () => Q(e),
|
|
124
|
-
className: i(
|
|
125
|
-
h,
|
|
126
|
-
v === e ? N : g
|
|
127
|
-
),
|
|
128
|
-
"aria-label": `${p(e)} minutes`,
|
|
129
|
-
"aria-selected": v === e || void 0,
|
|
130
|
-
children: p(e)
|
|
131
|
-
},
|
|
132
|
-
e
|
|
133
|
-
)) })
|
|
134
|
-
] }),
|
|
135
|
-
x && /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-ds-02", children: [
|
|
136
|
-
/* @__PURE__ */ r("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: "Sec" }),
|
|
137
|
-
/* @__PURE__ */ r("div", { className: i(M, "min-w-[48px]"), children: K.map((e) => /* @__PURE__ */ r(
|
|
138
|
-
"button",
|
|
139
|
-
{
|
|
140
|
-
type: "button",
|
|
141
|
-
onClick: () => V(e),
|
|
142
|
-
className: i(
|
|
143
|
-
h,
|
|
144
|
-
D === e ? N : g
|
|
145
|
-
),
|
|
146
|
-
"aria-label": `${p(e)} seconds`,
|
|
147
|
-
"aria-selected": D === e || void 0,
|
|
148
|
-
children: p(e)
|
|
149
|
-
},
|
|
150
|
-
e
|
|
151
|
-
)) })
|
|
152
|
-
] }),
|
|
153
|
-
l === "12h" && /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-ds-02", children: [
|
|
154
|
-
/* @__PURE__ */ r("span", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-placeholder", children: " " }),
|
|
155
|
-
/* @__PURE__ */ r("div", { className: "flex flex-col gap-ds-01 px-ds-01", children: ["AM", "PM"].map((e) => /* @__PURE__ */ r(
|
|
156
|
-
"button",
|
|
157
|
-
{
|
|
158
|
-
type: "button",
|
|
159
|
-
onClick: () => W(e),
|
|
160
|
-
className: i(
|
|
161
|
-
h,
|
|
162
|
-
"min-w-[44px] font-semibold",
|
|
163
|
-
k === e ? N : g
|
|
164
|
-
),
|
|
165
|
-
"aria-label": e,
|
|
166
|
-
"aria-selected": k === e || void 0,
|
|
167
|
-
children: e
|
|
168
|
-
},
|
|
169
|
-
e
|
|
170
|
-
)) })
|
|
171
|
-
] })
|
|
172
|
-
] })
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
] });
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
F.displayName = "TimePicker";
|
|
179
|
-
export {
|
|
180
|
-
F as TimePicker
|
|
181
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState as s } from "react";
|
|
3
|
-
import { setYear as h, setMonth as M, addMonths as u, subMonths as a } from "date-fns";
|
|
4
|
-
function f(e) {
|
|
5
|
-
const [r, t] = s(e ?? /* @__PURE__ */ new Date());
|
|
6
|
-
return {
|
|
7
|
-
currentMonth: r,
|
|
8
|
-
setCurrentMonth: t,
|
|
9
|
-
goToPreviousMonth: () => t((o) => a(o, 1)),
|
|
10
|
-
goToNextMonth: () => t((o) => u(o, 1)),
|
|
11
|
-
goToMonth: (o) => t((n) => M(n, o)),
|
|
12
|
-
goToYear: (o) => t((n) => h(n, o))
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
f as useCalendar
|
|
17
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import * as u from "react";
|
|
4
|
-
import { cn as x } from "../../ui/lib/utils.js";
|
|
5
|
-
const f = u.forwardRef(
|
|
6
|
-
function({
|
|
7
|
-
currentYear: d,
|
|
8
|
-
selectedYear: c,
|
|
9
|
-
onYearSelect: a,
|
|
10
|
-
minDate: o,
|
|
11
|
-
maxDate: l
|
|
12
|
-
}, m) {
|
|
13
|
-
const s = Math.floor(d / 10) * 10, p = Array.from({ length: 12 }, (t, e) => s + e);
|
|
14
|
-
return /* @__PURE__ */ i("div", { ref: m, className: "w-[252px]", children: [
|
|
15
|
-
/* @__PURE__ */ i("div", { className: "text-center pb-ds-04 text-ds-md font-semibold text-text-primary", children: [
|
|
16
|
-
s,
|
|
17
|
-
" – ",
|
|
18
|
-
s + 11
|
|
19
|
-
] }),
|
|
20
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 gap-ds-02", children: p.map((t) => {
|
|
21
|
-
const e = t === c, r = o != null && t < o.getFullYear() || l != null && t > l.getFullYear();
|
|
22
|
-
return /* @__PURE__ */ n(
|
|
23
|
-
"button",
|
|
24
|
-
{
|
|
25
|
-
type: "button",
|
|
26
|
-
disabled: r || !1,
|
|
27
|
-
onClick: () => !r && a(t),
|
|
28
|
-
className: x(
|
|
29
|
-
"h-ds-sm-plus rounded-ds-md text-ds-md transition-colors",
|
|
30
|
-
r && "opacity-[0.38] pointer-events-none cursor-not-allowed",
|
|
31
|
-
e && "bg-interactive text-text-on-color",
|
|
32
|
-
!e && !r && "hover:bg-field text-text-primary"
|
|
33
|
-
),
|
|
34
|
-
children: t
|
|
35
|
-
},
|
|
36
|
-
t
|
|
37
|
-
);
|
|
38
|
-
}) })
|
|
39
|
-
] });
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
f.displayName = "YearPicker";
|
|
43
|
-
export {
|
|
44
|
-
f as YearPicker
|
|
45
|
-
};
|