@godxjp/ui 13.2.0 → 13.3.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/app/index.js +4 -4
- package/dist/{checkbox-DKaBna6z.d.ts → checkbox-YzUqZTuZ.d.ts} +1 -1
- package/dist/{chunk-HBOL5LSC.js → chunk-2XH6QAOC.js} +1 -1
- package/dist/{chunk-FJBVDJGL.js → chunk-36ORTEGC.js} +1 -1
- package/dist/{chunk-SISAM4JZ.js → chunk-3JIPRB2T.js} +1 -1
- package/dist/{chunk-QD3YG56T.js → chunk-46UVXYPU.js} +1 -1
- package/dist/{chunk-H2TX3OPW.js → chunk-6EBULOWM.js} +1 -1
- package/dist/{chunk-XY2QN4VR.js → chunk-BIC6D4EL.js} +2 -2
- package/dist/{chunk-XGXI52Z7.js → chunk-BTTKHJMC.js} +1 -1
- package/dist/{chunk-E6J7ZTDM.js → chunk-CA247VOA.js} +25 -3
- package/dist/{chunk-NXF64JCT.js → chunk-CLEBTIY3.js} +2 -2
- package/dist/{chunk-ZFBIKJSJ.js → chunk-E2CTBKYL.js} +1 -1
- package/dist/{chunk-GDHDJAVB.js → chunk-HOQSAUHZ.js} +1 -1
- package/dist/{chunk-BABHI2W7.js → chunk-IHNZCBES.js} +8 -8
- package/dist/{chunk-Z37463ZK.js → chunk-IRPZJKLU.js} +19 -3
- package/dist/{chunk-JEIUEOTJ.js → chunk-ITOHGSPS.js} +12 -0
- package/dist/chunk-IYSGELQC.js +467 -0
- package/dist/{chunk-SSNPCHG6.js → chunk-JCDLEXBB.js} +3 -3
- package/dist/{chunk-LEVFHRHU.js → chunk-LCKET5WL.js} +3 -3
- package/dist/{chunk-C6OEAQTO.js → chunk-LIOHE3RU.js} +1 -1
- package/dist/{chunk-74OPJG3N.js → chunk-PXOPMYPJ.js} +4 -4
- package/dist/{chunk-ZKUB7DHO.js → chunk-QEHMSZBQ.js} +3 -3
- package/dist/{chunk-UVJE3FYT.js → chunk-QHS4U3SS.js} +3 -3
- package/dist/{chunk-QATON677.js → chunk-QRCLMU35.js} +2 -2
- package/dist/{chunk-JAEA2IBC.js → chunk-QVLCFPKF.js} +3 -3
- package/dist/{chunk-33AJDSML.js → chunk-RR2SSSQS.js} +2 -2
- package/dist/{chunk-4ADB5EKN.js → chunk-UVMHSC5Q.js} +4 -4
- package/dist/{chunk-Z652BSX7.js → chunk-WW47N4ID.js} +3 -3
- package/dist/{chunk-5NIGHXT5.js → chunk-YY5PUFBL.js} +4 -4
- package/dist/components/admin/index.d.ts +9 -9
- package/dist/components/admin/index.js +28 -28
- package/dist/components/data-display/badge.d.ts +1 -1
- package/dist/components/data-display/badge.js +3 -3
- package/dist/components/data-display/card.d.ts +2 -2
- package/dist/components/data-display/carousel.js +3 -3
- package/dist/components/data-display/index.d.ts +4 -4
- package/dist/components/data-display/index.js +8 -8
- package/dist/components/data-entry/calendar.d.ts +3 -3
- package/dist/components/data-entry/calendar.js +2 -2
- package/dist/components/data-entry/cascader.d.ts +3 -3
- package/dist/components/data-entry/cascader.js +4 -4
- package/dist/components/data-entry/checkbox.d.ts +4 -4
- package/dist/components/data-entry/color-picker.d.ts +3 -3
- package/dist/components/data-entry/color-picker.js +3 -3
- package/dist/components/data-entry/date-picker.d.ts +3 -3
- package/dist/components/data-entry/date-picker.js +5 -5
- package/dist/components/data-entry/date-range-picker.d.ts +3 -3
- package/dist/components/data-entry/date-range-picker.js +5 -5
- package/dist/components/data-entry/index.d.ts +23 -12
- package/dist/components/data-entry/index.js +20 -20
- package/dist/components/data-entry/radio.d.ts +3 -3
- package/dist/components/data-entry/select.d.ts +3 -3
- package/dist/components/data-entry/select.js +4 -4
- package/dist/components/data-entry/slider.d.ts +3 -3
- package/dist/components/data-entry/switch.d.ts +3 -3
- package/dist/components/data-entry/time-input.js +2 -2
- package/dist/components/data-entry/time-picker.d.ts +3 -3
- package/dist/components/data-entry/time-picker.js +4 -4
- package/dist/components/data-entry/transfer.d.ts +4 -4
- package/dist/components/data-entry/transfer.js +5 -5
- package/dist/components/data-entry/tree-select.d.ts +3 -3
- package/dist/components/data-entry/tree-select.js +4 -4
- package/dist/components/data-entry/upload.d.ts +4 -4
- package/dist/components/data-entry/upload.js +7 -7
- package/dist/components/data-grid/index.js +6 -6
- package/dist/components/feedback/alert.d.ts +3 -3
- package/dist/components/feedback/alert.js +5 -5
- package/dist/components/feedback/dialog.d.ts +2 -2
- package/dist/components/feedback/dialog.js +5 -5
- package/dist/components/feedback/index.d.ts +2 -2
- package/dist/components/feedback/index.js +8 -8
- package/dist/components/feedback/sheet.d.ts +1 -1
- package/dist/components/general/button.d.ts +5 -3
- package/dist/components/general/button.js +1 -1
- package/dist/components/general/index.d.ts +3 -3
- package/dist/components/general/index.js +1 -1
- package/dist/components/layout/index.js +4 -4
- package/dist/components/navigation/index.d.ts +6 -6
- package/dist/components/navigation/index.js +9 -9
- package/dist/components/navigation/pagination.d.ts +3 -3
- package/dist/components/navigation/pagination.js +5 -5
- package/dist/components/navigation/steps.d.ts +4 -4
- package/dist/components/navigation/steps.js +3 -3
- package/dist/components/query/index.d.ts +3 -3
- package/dist/components/query/index.js +5 -5
- package/dist/components/ui/index.d.ts +7 -7
- package/dist/components/ui/index.js +28 -28
- package/dist/{data-display.prop-BCC2zOTq.d.ts → data-display.prop-CT0nVMdp.d.ts} +2 -2
- package/dist/{data-entry.prop-BGlwRXlJ.d.ts → data-entry.prop-DA61KfFl.d.ts} +39 -3
- package/dist/{data-table-B6HC3EFK.d.ts → data-table-DRr70ULe.d.ts} +3 -3
- package/dist/{data.prop-H9nROsUg.d.ts → data.prop-D0UEEczj.d.ts} +1 -1
- package/dist/{feedback.prop-sEx89LTF.d.ts → feedback.prop-CHlHDYZK.d.ts} +1 -1
- package/dist/{filter-bar-DPMQmIpX.d.ts → filter-bar-DoDtwYrr.d.ts} +1 -1
- package/dist/{general.prop-4ERae5Sj.d.ts → general.prop-CBQ_KVtR.d.ts} +11 -4
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +38 -38
- package/dist/{interaction.prop-B44hePpl.d.ts → interaction.prop-DD46aTro.d.ts} +4 -3
- package/dist/lib/datetime/index.js +1 -1
- package/dist/{navigation.prop-DMbjEig7.d.ts → navigation.prop-FCsOVGrP.d.ts} +1 -1
- package/dist/props/components/index.d.ts +8 -8
- package/dist/props/index.d.ts +8 -8
- package/dist/props/index.js +1 -1
- package/dist/props/registry.d.ts +8 -3
- package/dist/props/registry.js +1 -1
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/{query.prop-cp6fEgOD.d.ts → query.prop-CsRuaXNb.d.ts} +1 -1
- package/dist/{search-input-CxGW8_7q.d.ts → search-input-BNOUeTiM.d.ts} +1 -1
- package/dist/styles/control.css +64 -0
- package/dist/styles/text-layout.css +12 -3
- package/dist/tokens/foundation.css +4 -3
- package/package.json +1 -1
- package/dist/chunk-ZPHIXXTK.js +0 -257
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { Input } from './chunk-BNXPDUO4.js';
|
|
2
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
3
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
4
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { ChevronUp, ChevronDown, EyeOff, Eye, Minus, Star, X } from 'lucide-react';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
9
|
+
|
|
10
|
+
function decimalsOf(n) {
|
|
11
|
+
if (!Number.isFinite(n)) return 0;
|
|
12
|
+
const s = String(n);
|
|
13
|
+
const dot = s.indexOf(".");
|
|
14
|
+
return dot === -1 ? 0 : s.length - dot - 1;
|
|
15
|
+
}
|
|
16
|
+
function clamp(n, min, max) {
|
|
17
|
+
let out = n;
|
|
18
|
+
if (min != null && out < min) out = min;
|
|
19
|
+
if (max != null && out > max) out = max;
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
function roundTo(n, precision) {
|
|
23
|
+
if (!Number.isFinite(n)) return n;
|
|
24
|
+
const factor = 10 ** precision;
|
|
25
|
+
return Math.round((n + Number.EPSILON) * factor) / factor;
|
|
26
|
+
}
|
|
27
|
+
var NumberInput = React.forwardRef(
|
|
28
|
+
({
|
|
29
|
+
value: controlledValue,
|
|
30
|
+
defaultValue = null,
|
|
31
|
+
onValueChange,
|
|
32
|
+
min,
|
|
33
|
+
max,
|
|
34
|
+
step = 1,
|
|
35
|
+
precision,
|
|
36
|
+
disabled,
|
|
37
|
+
readOnly,
|
|
38
|
+
size = "md",
|
|
39
|
+
placeholder,
|
|
40
|
+
prefix,
|
|
41
|
+
suffix,
|
|
42
|
+
name,
|
|
43
|
+
id,
|
|
44
|
+
className,
|
|
45
|
+
"aria-label": ariaLabel,
|
|
46
|
+
"aria-labelledby": ariaLabelledby,
|
|
47
|
+
"aria-describedby": ariaDescribedby,
|
|
48
|
+
"data-testid": dataTestId
|
|
49
|
+
}, ref) => {
|
|
50
|
+
const { t, locale } = useTranslation();
|
|
51
|
+
const isControlled = controlledValue !== void 0;
|
|
52
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
53
|
+
const numericValue = isControlled ? controlledValue ?? null : internal;
|
|
54
|
+
const effectivePrecision = precision ?? decimalsOf(step);
|
|
55
|
+
const formatter = React.useMemo(
|
|
56
|
+
() => new Intl.NumberFormat(locale, {
|
|
57
|
+
minimumFractionDigits: 0,
|
|
58
|
+
maximumFractionDigits: Math.max(effectivePrecision, 0),
|
|
59
|
+
useGrouping: false
|
|
60
|
+
}),
|
|
61
|
+
[locale, effectivePrecision]
|
|
62
|
+
);
|
|
63
|
+
const formatAtRest = React.useCallback(
|
|
64
|
+
(n) => n == null ? "" : formatter.format(n),
|
|
65
|
+
[formatter]
|
|
66
|
+
);
|
|
67
|
+
const [draft, setDraft] = React.useState(() => formatAtRest(numericValue));
|
|
68
|
+
const [focused, setFocused] = React.useState(false);
|
|
69
|
+
React.useEffect(() => {
|
|
70
|
+
if (focused) return;
|
|
71
|
+
setDraft(formatAtRest(numericValue));
|
|
72
|
+
}, [numericValue, focused, formatAtRest]);
|
|
73
|
+
const commit = React.useCallback(
|
|
74
|
+
(next) => {
|
|
75
|
+
const normalized = next == null || Number.isNaN(next) ? null : roundTo(clamp(next, min, max), effectivePrecision);
|
|
76
|
+
if (!isControlled) setInternal(normalized);
|
|
77
|
+
onValueChange?.(normalized);
|
|
78
|
+
if (!focused) setDraft(formatAtRest(normalized));
|
|
79
|
+
return normalized;
|
|
80
|
+
},
|
|
81
|
+
[effectivePrecision, focused, formatAtRest, isControlled, max, min, onValueChange]
|
|
82
|
+
);
|
|
83
|
+
const stepBy = React.useCallback(
|
|
84
|
+
(direction, multiplier = 1) => {
|
|
85
|
+
const base = numericValue ?? min ?? 0;
|
|
86
|
+
const next = base + direction * step * multiplier;
|
|
87
|
+
const committed = commit(next);
|
|
88
|
+
setDraft(formatAtRest(committed));
|
|
89
|
+
},
|
|
90
|
+
[commit, formatAtRest, min, numericValue, step]
|
|
91
|
+
);
|
|
92
|
+
const atMin = min != null && numericValue != null && numericValue <= min;
|
|
93
|
+
const atMax = max != null && numericValue != null && numericValue >= max;
|
|
94
|
+
const interactive = !disabled && !readOnly;
|
|
95
|
+
const handleChange = (event) => {
|
|
96
|
+
const raw = event.target.value;
|
|
97
|
+
setDraft(raw);
|
|
98
|
+
if (readOnly) return;
|
|
99
|
+
const trimmed = raw.trim();
|
|
100
|
+
if (trimmed === "" || trimmed === "-") {
|
|
101
|
+
if (trimmed === "") commit(null);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const parsed = Number(trimmed);
|
|
105
|
+
if (Number.isNaN(parsed)) return;
|
|
106
|
+
if (!isControlled) setInternal(parsed);
|
|
107
|
+
onValueChange?.(parsed);
|
|
108
|
+
};
|
|
109
|
+
const handleBlur = () => {
|
|
110
|
+
setFocused(false);
|
|
111
|
+
const trimmed = draft.trim();
|
|
112
|
+
if (trimmed === "" || trimmed === "-") {
|
|
113
|
+
commit(null);
|
|
114
|
+
setDraft(formatAtRest(null));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const parsed = Number(trimmed);
|
|
118
|
+
const committed = commit(Number.isNaN(parsed) ? null : parsed);
|
|
119
|
+
setDraft(formatAtRest(committed));
|
|
120
|
+
};
|
|
121
|
+
const handleKeyDown = (event) => {
|
|
122
|
+
if (!interactive) return;
|
|
123
|
+
if (event.key === "ArrowUp") {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
stepBy(1, event.shiftKey ? 10 : 1);
|
|
126
|
+
} else if (event.key === "ArrowDown") {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
stepBy(-1, event.shiftKey ? 10 : 1);
|
|
129
|
+
} else if (event.key === "Enter") {
|
|
130
|
+
const trimmed = draft.trim();
|
|
131
|
+
const parsed = Number(trimmed);
|
|
132
|
+
const committed = commit(trimmed === "" || Number.isNaN(parsed) ? null : parsed);
|
|
133
|
+
setDraft(formatAtRest(committed));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "number-input", "data-size": size, className: cn("ui-number-input", className), children: [
|
|
137
|
+
prefix != null ? /* @__PURE__ */ jsx(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
"data-slot": "number-input-prefix",
|
|
141
|
+
className: "ui-number-input-affix",
|
|
142
|
+
"aria-hidden": "true",
|
|
143
|
+
children: prefix
|
|
144
|
+
}
|
|
145
|
+
) : null,
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
Input,
|
|
148
|
+
{
|
|
149
|
+
ref,
|
|
150
|
+
id,
|
|
151
|
+
name,
|
|
152
|
+
type: "text",
|
|
153
|
+
inputMode: "decimal",
|
|
154
|
+
autoComplete: "off",
|
|
155
|
+
role: "spinbutton",
|
|
156
|
+
"data-slot": "number-input-field",
|
|
157
|
+
"data-testid": dataTestId,
|
|
158
|
+
className: "ui-number-input-field",
|
|
159
|
+
value: draft,
|
|
160
|
+
placeholder,
|
|
161
|
+
disabled,
|
|
162
|
+
readOnly,
|
|
163
|
+
"aria-label": ariaLabel,
|
|
164
|
+
"aria-labelledby": ariaLabelledby,
|
|
165
|
+
"aria-describedby": ariaDescribedby,
|
|
166
|
+
"aria-valuenow": numericValue ?? void 0,
|
|
167
|
+
"aria-valuemin": min,
|
|
168
|
+
"aria-valuemax": max,
|
|
169
|
+
"aria-valuetext": numericValue != null ? formatAtRest(numericValue) : void 0,
|
|
170
|
+
onChange: handleChange,
|
|
171
|
+
onFocus: () => setFocused(true),
|
|
172
|
+
onBlur: handleBlur,
|
|
173
|
+
onKeyDown: handleKeyDown
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
suffix != null ? /* @__PURE__ */ jsx(
|
|
177
|
+
"span",
|
|
178
|
+
{
|
|
179
|
+
"data-slot": "number-input-suffix",
|
|
180
|
+
className: "ui-number-input-affix",
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
children: suffix
|
|
183
|
+
}
|
|
184
|
+
) : null,
|
|
185
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "number-input-steppers", className: "ui-number-input-steppers", children: [
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
Button,
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
variant: "outline",
|
|
191
|
+
size: "icon-xs",
|
|
192
|
+
className: "ui-number-input-step ui-number-input-step-up",
|
|
193
|
+
tabIndex: -1,
|
|
194
|
+
disabled: !interactive || atMax,
|
|
195
|
+
"aria-label": t("ui.numberInput.increment"),
|
|
196
|
+
onClick: () => stepBy(1),
|
|
197
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { "aria-hidden": "true" })
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
Button,
|
|
202
|
+
{
|
|
203
|
+
type: "button",
|
|
204
|
+
variant: "outline",
|
|
205
|
+
size: "icon-xs",
|
|
206
|
+
className: "ui-number-input-step ui-number-input-step-down",
|
|
207
|
+
tabIndex: -1,
|
|
208
|
+
disabled: !interactive || atMin,
|
|
209
|
+
"aria-label": t("ui.numberInput.decrement"),
|
|
210
|
+
onClick: () => stepBy(-1),
|
|
211
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true" })
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] })
|
|
215
|
+
] });
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
NumberInput.displayName = "NumberInput";
|
|
219
|
+
var PasswordInput = React.forwardRef(
|
|
220
|
+
({ className, ...props }, ref) => {
|
|
221
|
+
const { t } = useTranslation();
|
|
222
|
+
const [visible, setVisible] = React.useState(false);
|
|
223
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-password-input", "data-slot": "password-input", children: [
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
Input,
|
|
226
|
+
{
|
|
227
|
+
ref,
|
|
228
|
+
type: visible ? "text" : "password",
|
|
229
|
+
className: cn("ui-password-input-field", className),
|
|
230
|
+
...props
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
/* @__PURE__ */ jsx(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
type: "button",
|
|
237
|
+
className: "ui-password-input-toggle",
|
|
238
|
+
onClick: () => setVisible((v) => !v),
|
|
239
|
+
"aria-label": visible ? t("ui.passwordInput.hide") : t("ui.passwordInput.show"),
|
|
240
|
+
"aria-pressed": visible,
|
|
241
|
+
children: visible ? /* @__PURE__ */ jsx(EyeOff, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Eye, { "aria-hidden": "true" })
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] });
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
PasswordInput.displayName = "PasswordInput";
|
|
248
|
+
var InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
249
|
+
OTPInput,
|
|
250
|
+
{
|
|
251
|
+
ref,
|
|
252
|
+
"data-slot": "input-otp",
|
|
253
|
+
containerClassName: cn("ui-otp-container", containerClassName),
|
|
254
|
+
className: cn("ui-otp-input", className),
|
|
255
|
+
...props
|
|
256
|
+
}
|
|
257
|
+
));
|
|
258
|
+
InputOTP.displayName = "InputOTP";
|
|
259
|
+
var InputOTPGroup = React.forwardRef(
|
|
260
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
ref,
|
|
264
|
+
"data-slot": "input-otp-group",
|
|
265
|
+
className: cn("ui-otp-group", className),
|
|
266
|
+
...props
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
);
|
|
270
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
271
|
+
var InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
|
|
272
|
+
const context = React.useContext(OTPInputContext);
|
|
273
|
+
const slot = context.slots[index] ?? { char: null, hasFakeCaret: false, isActive: false };
|
|
274
|
+
return /* @__PURE__ */ jsxs(
|
|
275
|
+
"div",
|
|
276
|
+
{
|
|
277
|
+
ref,
|
|
278
|
+
"data-slot": "input-otp-slot",
|
|
279
|
+
"data-active": slot.isActive || void 0,
|
|
280
|
+
className: cn("ui-otp-slot", className),
|
|
281
|
+
...props,
|
|
282
|
+
children: [
|
|
283
|
+
slot.char,
|
|
284
|
+
slot.hasFakeCaret ? /* @__PURE__ */ jsx("div", { className: "ui-otp-caret-wrapper", "aria-hidden": "true", children: /* @__PURE__ */ jsx("div", { className: "ui-otp-caret" }) }) : null
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
});
|
|
289
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
290
|
+
var InputOTPSeparator = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(Minus, { className: "ui-otp-separator-icon", "aria-hidden": "true" }) }));
|
|
291
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
292
|
+
var Rating = React.forwardRef(
|
|
293
|
+
({
|
|
294
|
+
value,
|
|
295
|
+
defaultValue = 0,
|
|
296
|
+
onValueChange,
|
|
297
|
+
max = 5,
|
|
298
|
+
readOnly,
|
|
299
|
+
disabled,
|
|
300
|
+
name,
|
|
301
|
+
className,
|
|
302
|
+
...rest
|
|
303
|
+
}, ref) => {
|
|
304
|
+
const { t } = useTranslation();
|
|
305
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
306
|
+
const current = value ?? internal;
|
|
307
|
+
const [hover, setHover] = React.useState(null);
|
|
308
|
+
const display = hover ?? current;
|
|
309
|
+
const interactive = !readOnly && !disabled;
|
|
310
|
+
const select = (next) => {
|
|
311
|
+
if (!interactive) return;
|
|
312
|
+
if (value === void 0) setInternal(next);
|
|
313
|
+
onValueChange?.(next);
|
|
314
|
+
};
|
|
315
|
+
const focusableStar = current > 0 ? current : 1;
|
|
316
|
+
const onKeyDown = (e, star) => {
|
|
317
|
+
if (!interactive) return;
|
|
318
|
+
let next = null;
|
|
319
|
+
switch (e.key) {
|
|
320
|
+
case "ArrowRight":
|
|
321
|
+
case "ArrowUp":
|
|
322
|
+
next = Math.min(max, star + 1);
|
|
323
|
+
break;
|
|
324
|
+
case "ArrowLeft":
|
|
325
|
+
case "ArrowDown":
|
|
326
|
+
next = Math.max(1, star - 1);
|
|
327
|
+
break;
|
|
328
|
+
case "Home":
|
|
329
|
+
next = 1;
|
|
330
|
+
break;
|
|
331
|
+
case "End":
|
|
332
|
+
next = max;
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
e.preventDefault();
|
|
338
|
+
select(next);
|
|
339
|
+
};
|
|
340
|
+
return /* @__PURE__ */ jsxs(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
ref,
|
|
344
|
+
role: "radiogroup",
|
|
345
|
+
"data-slot": "rating",
|
|
346
|
+
className: cn("ui-rating", className),
|
|
347
|
+
"aria-label": rest["aria-label"] ?? t("ui.rating.ariaLabel"),
|
|
348
|
+
children: [
|
|
349
|
+
Array.from({ length: max }, (_, i) => i + 1).map((star) => /* @__PURE__ */ jsx(
|
|
350
|
+
"button",
|
|
351
|
+
{
|
|
352
|
+
type: "button",
|
|
353
|
+
role: "radio",
|
|
354
|
+
"aria-checked": current === star,
|
|
355
|
+
"aria-label": t("ui.rating.starLabel", { star, max }),
|
|
356
|
+
disabled: disabled || readOnly,
|
|
357
|
+
tabIndex: interactive && star === focusableStar ? 0 : -1,
|
|
358
|
+
className: cn("ui-rating-star", star <= display && "ui-rating-star-filled"),
|
|
359
|
+
onMouseEnter: () => interactive && setHover(star),
|
|
360
|
+
onMouseLeave: () => setHover(null),
|
|
361
|
+
onClick: () => select(star),
|
|
362
|
+
onKeyDown: (e) => onKeyDown(e, star),
|
|
363
|
+
children: /* @__PURE__ */ jsx(Star, { "aria-hidden": "true" })
|
|
364
|
+
},
|
|
365
|
+
star
|
|
366
|
+
)),
|
|
367
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: current }) : null
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
Rating.displayName = "Rating";
|
|
374
|
+
var TagInput = React.forwardRef(
|
|
375
|
+
({
|
|
376
|
+
value,
|
|
377
|
+
defaultValue = [],
|
|
378
|
+
onValueChange,
|
|
379
|
+
placeholder,
|
|
380
|
+
disabled,
|
|
381
|
+
name,
|
|
382
|
+
className,
|
|
383
|
+
id,
|
|
384
|
+
"aria-label": ariaLabel
|
|
385
|
+
}, ref) => {
|
|
386
|
+
const { t } = useTranslation();
|
|
387
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
388
|
+
const tags = value ?? internal;
|
|
389
|
+
const [draft, setDraft] = React.useState("");
|
|
390
|
+
const commit = (next) => {
|
|
391
|
+
if (value === void 0) setInternal(next);
|
|
392
|
+
onValueChange?.(next);
|
|
393
|
+
};
|
|
394
|
+
const add = (raw) => {
|
|
395
|
+
const tag = raw.trim();
|
|
396
|
+
if (!tag || tags.includes(tag)) return;
|
|
397
|
+
commit([...tags, tag]);
|
|
398
|
+
};
|
|
399
|
+
const removeAt = (i) => commit(tags.filter((_, idx) => idx !== i));
|
|
400
|
+
const onKeyDown = (e) => {
|
|
401
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
402
|
+
e.preventDefault();
|
|
403
|
+
add(draft);
|
|
404
|
+
setDraft("");
|
|
405
|
+
} else if (e.key === "Backspace" && draft === "" && tags.length > 0) {
|
|
406
|
+
removeAt(tags.length - 1);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
return /* @__PURE__ */ jsxs(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
"data-slot": "tag-input",
|
|
413
|
+
className: cn("ui-tag-input", disabled && "ui-tag-input-disabled", className),
|
|
414
|
+
children: [
|
|
415
|
+
tags.length > 0 ? /* @__PURE__ */ jsx("ul", { role: "list", className: "ui-tag-input-list", "data-slot": "tag-input-list", children: tags.map((tag, i) => /* @__PURE__ */ jsxs(
|
|
416
|
+
"li",
|
|
417
|
+
{
|
|
418
|
+
role: "listitem",
|
|
419
|
+
className: "ui-tag-input-chip",
|
|
420
|
+
"data-slot": "tag-input-chip",
|
|
421
|
+
children: [
|
|
422
|
+
tag,
|
|
423
|
+
!disabled ? /* @__PURE__ */ jsx(
|
|
424
|
+
"button",
|
|
425
|
+
{
|
|
426
|
+
type: "button",
|
|
427
|
+
className: "ui-tag-input-remove",
|
|
428
|
+
"aria-label": t("ui.tagInput.removeTag", { tag }),
|
|
429
|
+
onClick: () => removeAt(i),
|
|
430
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
431
|
+
}
|
|
432
|
+
) : null
|
|
433
|
+
]
|
|
434
|
+
},
|
|
435
|
+
tag
|
|
436
|
+
)) }) : null,
|
|
437
|
+
/* @__PURE__ */ jsx(
|
|
438
|
+
"input",
|
|
439
|
+
{
|
|
440
|
+
ref,
|
|
441
|
+
id,
|
|
442
|
+
type: "text",
|
|
443
|
+
className: "ui-tag-input-field",
|
|
444
|
+
value: draft,
|
|
445
|
+
placeholder: tags.length === 0 ? placeholder : void 0,
|
|
446
|
+
disabled,
|
|
447
|
+
"aria-label": ariaLabel ?? t("ui.tagInput.inputLabel"),
|
|
448
|
+
onChange: (e) => setDraft(e.target.value),
|
|
449
|
+
onKeyDown,
|
|
450
|
+
onBlur: () => {
|
|
451
|
+
if (draft.trim()) {
|
|
452
|
+
add(draft);
|
|
453
|
+
setDraft("");
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", "data-slot": "tag-input-status", children: t("ui.tagInput.tagCount", { count: tags.length }) }),
|
|
459
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: tags.join(",") }) : null
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
TagInput.displayName = "TagInput";
|
|
466
|
+
|
|
467
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, NumberInput, PasswordInput, Rating, TagInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EmptyState } from './chunk-YD7V2HGZ.js';
|
|
2
|
-
import { Checkbox } from './chunk-BE6GJGKJ.js';
|
|
3
2
|
import { Flex, densityClass } from './chunk-INIIF7F7.js';
|
|
4
|
-
import {
|
|
3
|
+
import { Checkbox } from './chunk-BE6GJGKJ.js';
|
|
4
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
5
5
|
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-IJ5ALJGA.js';
|
|
6
6
|
import { tableCellPaddingClass, tableRowHeightClass, controlIconSmClass } from './chunk-B4K4BXEF.js';
|
|
7
|
-
import { useTranslation } from './chunk-
|
|
7
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
8
8
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
import * as React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { useTranslation } from './chunk-
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CLEBTIY3.js';
|
|
2
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
3
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
4
4
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { MoreHorizontal, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Calendar } from './chunk-
|
|
1
|
+
import { Calendar } from './chunk-2XH6QAOC.js';
|
|
2
2
|
import { Input } from './chunk-BNXPDUO4.js';
|
|
3
|
-
import { Button } from './chunk-
|
|
3
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
4
4
|
import { Popover, PopoverAnchor, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
5
|
-
import { useTranslation, usePickerLocales } from './chunk-
|
|
6
|
-
import { toIsoDate, parseDateInput } from './chunk-
|
|
5
|
+
import { useTranslation, usePickerLocales } from './chunk-6EBULOWM.js';
|
|
6
|
+
import { toIsoDate, parseDateInput } from './chunk-ITOHGSPS.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { CalendarIcon } from 'lucide-react';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Input } from './chunk-BNXPDUO4.js';
|
|
2
|
-
import { Button } from './chunk-
|
|
2
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
3
3
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
4
|
-
import { useTranslation, usePickerLocales } from './chunk-
|
|
5
|
-
import { normalizeHhmm, isValidHhmm } from './chunk-
|
|
4
|
+
import { useTranslation, usePickerLocales } from './chunk-6EBULOWM.js';
|
|
5
|
+
import { normalizeHhmm, isValidHhmm } from './chunk-ITOHGSPS.js';
|
|
6
6
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { Clock } from 'lucide-react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { humanError } from './chunk-
|
|
1
|
+
import { humanError } from './chunk-HOQSAUHZ.js';
|
|
2
2
|
import { Flex } from './chunk-INIIF7F7.js';
|
|
3
|
-
import { Button } from './chunk-
|
|
4
|
-
import { useTranslation } from './chunk-
|
|
3
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
4
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
5
5
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { Info, CheckCircle2, TriangleAlert, AlertCircle, X, RefreshCw } from 'lucide-react';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuTrigger } from './chunk-LMKUKCTN.js';
|
|
2
1
|
import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-32WO3YLB.js';
|
|
2
|
+
import { DropdownMenu, DropdownMenuTrigger } from './chunk-LMKUKCTN.js';
|
|
3
3
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './chunk-DV52WNXO.js';
|
|
4
4
|
import { densityClass, pageContainerVariantClass } from './chunk-INIIF7F7.js';
|
|
5
5
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
6
|
-
import { useTranslation } from './chunk-
|
|
6
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
8
8
|
import { ChevronRight, ChevronDown, PanelLeftOpen, PanelLeftClose, Search, Bell, SlidersHorizontal } from 'lucide-react';
|
|
9
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { SearchInput } from './chunk-E2CTBKYL.js';
|
|
1
2
|
import { reactNodeText } from './chunk-SMLKNECP.js';
|
|
2
|
-
import { SearchInput } from './chunk-ZFBIKJSJ.js';
|
|
3
3
|
import { Checkbox } from './chunk-BE6GJGKJ.js';
|
|
4
|
-
import { Button } from './chunk-
|
|
4
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
5
5
|
import { ScrollArea } from './chunk-3KPEZ5CF.js';
|
|
6
|
-
import { useTranslation } from './chunk-
|
|
6
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { ChevronRight, ChevronLeft } from 'lucide-react';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { normalizeTreeOptions, formatPathLabels, getNodeByPath, filterTreeOptions, pathsEqual, pathKey } from './chunk-SMLKNECP.js';
|
|
2
2
|
import { Command, CommandInput } from './chunk-3R3QVJCB.js';
|
|
3
|
-
import { Button } from './chunk-
|
|
3
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
4
4
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
5
5
|
import { ScrollArea, ScrollBar } from './chunk-3KPEZ5CF.js';
|
|
6
6
|
import { controlOpenRingClass } from './chunk-B4K4BXEF.js';
|
|
7
|
-
import { useTranslation } from './chunk-
|
|
7
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
8
8
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { Check, X, ChevronsUpDown, ChevronRight, Minus } from 'lucide-react';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { formatBytes } from './chunk-HOQSAUHZ.js';
|
|
2
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-WW47N4ID.js';
|
|
1
3
|
import { Slider } from './chunk-TBJBVEIP.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-Z652BSX7.js';
|
|
4
|
-
import { Button } from './chunk-E6J7ZTDM.js';
|
|
4
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
5
5
|
import { controlIconClass } from './chunk-B4K4BXEF.js';
|
|
6
|
-
import { useTranslation } from './chunk-
|
|
6
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
8
8
|
import * as React2 from 'react';
|
|
9
9
|
import { Upload as Upload$1, ImagePlus, Camera, Trash2, RotateCcw, X } from 'lucide-react';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Input } from './chunk-BNXPDUO4.js';
|
|
2
1
|
import { overlayHeaderToneClass } from './chunk-VU4GFGDG.js';
|
|
3
|
-
import {
|
|
2
|
+
import { Input } from './chunk-BNXPDUO4.js';
|
|
3
|
+
import { buttonVariants, Button } from './chunk-CA247VOA.js';
|
|
4
4
|
import { Label } from './chunk-7PWBC4BY.js';
|
|
5
|
-
import { useTranslation } from './chunk-
|
|
5
|
+
import { useTranslation } from './chunk-6EBULOWM.js';
|
|
6
6
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import { useOptionalAppContext, useTranslation, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel, resolveTimezonePickerOptions, getTimezoneLabel, APP_LOCALES } from './chunk-
|
|
4
|
-
import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CLEBTIY3.js';
|
|
2
|
+
import { Button } from './chunk-CA247VOA.js';
|
|
3
|
+
import { useOptionalAppContext, useTranslation, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel, resolveTimezonePickerOptions, getTimezoneLabel, APP_LOCALES } from './chunk-6EBULOWM.js';
|
|
4
|
+
import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-ITOHGSPS.js';
|
|
5
5
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { useId } from 'react';
|