@mechane-ai/elements 0.35.1 → 0.36.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/ai.js +4 -4
- package/dist/chart-frame-C0UBu4ku.js +213 -0
- package/dist/{chart-input-CN8PMrni.js → chart-input-Ccr2NJ6J.js} +2 -2
- package/dist/{categorical-values-DpnNvPkc.js → chart-theme-Bwr9YSP1.js} +56 -5
- package/dist/charts/cartesian.js +613 -616
- package/dist/charts/distribution.js +77 -76
- package/dist/charts/graph.js +29 -28
- package/dist/charts/hierarchy.js +32 -31
- package/dist/charts/matrix.js +48 -47
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +3 -1
- package/dist/collections.js +314 -267
- package/dist/elements.css +14 -0
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +86 -63
- package/dist/forms.js +2 -2
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +1 -1
- package/dist/packages/charts/src/categorical-values.d.ts +1 -1
- package/dist/packages/charts/src/chart-series-marker.d.ts +7 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -2
- package/dist/packages/charts/src/distribution/ecdf.d.ts +1 -1
- package/dist/packages/charts/src/distribution/histogram.d.ts +1 -1
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +1 -1
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +1 -1
- package/dist/packages/charts/src/graph/relation-graph.d.ts +1 -1
- package/dist/packages/charts/src/index.d.ts +4 -2
- package/dist/packages/collections/src/data-table.d.ts +6 -4
- package/dist/packages/feedback/src/progress.d.ts +8 -2
- package/dist/packages/forms/src/dates/civil.d.ts +6 -4
- package/dist/packages/forms/src/dates/index.d.ts +1 -0
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/select-control.d.ts +26 -0
- package/dist/packages/foundations/src/chart-tones.d.ts +2 -0
- package/dist/{src-BYKjPC-0.js → src-CoFxE4Cj.js} +282 -227
- package/dist/{src-BHllGfI8.js → src-DXdsMc_Z.js} +415 -307
- package/package.json +1 -1
- package/dist/chart-frame-BV0IPZtQ.js +0 -270
package/dist/elements.css
CHANGED
|
@@ -765,6 +765,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
|
|
|
765
765
|
background-clip: text;
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
+
.xtwfq29 {
|
|
769
|
+
background-color: currentColor;
|
|
770
|
+
}
|
|
771
|
+
|
|
768
772
|
.xjbqb8w {
|
|
769
773
|
background-color: #0000;
|
|
770
774
|
}
|
|
@@ -2886,6 +2890,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
|
|
|
2886
2890
|
width: 44px;
|
|
2887
2891
|
}
|
|
2888
2892
|
|
|
2893
|
+
.x1useyqa {
|
|
2894
|
+
width: 48px;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2889
2897
|
.xl3ry0p {
|
|
2890
2898
|
width: 4ch;
|
|
2891
2899
|
}
|
|
@@ -3404,6 +3412,12 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
|
|
|
3404
3412
|
}
|
|
3405
3413
|
}
|
|
3406
3414
|
|
|
3415
|
+
@media (width <= 600px) {
|
|
3416
|
+
.x1251vi3.x1251vi3 {
|
|
3417
|
+
width: 24px;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3407
3421
|
@container workbench (width <= 860px) {
|
|
3408
3422
|
.x1vx4hiz.x1vx4hiz {
|
|
3409
3423
|
width: 100%;
|
package/dist/feedback.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AsyncRegion,
|
|
1
|
+
export { t as AsyncRegion, l as ButtonPlaceholder, n as ContentReveal, m as EmptyState, u as FieldPlaceholder, r as LoadingScope, o as Meter, h as Notice, s as Progress, d as Skeleton, f as SkeletonText, p as Spinner, i as Toaster, a as toast } from "./src-DXdsMc_Z.js";
|
package/dist/forms/dates.js
CHANGED
|
@@ -45,9 +45,11 @@ function S(e) {
|
|
|
45
45
|
return e.year * y.monthsPerYear + e.month;
|
|
46
46
|
}
|
|
47
47
|
function C(e) {
|
|
48
|
+
if (!x(e)) throw RangeError("Cannot serialize an invalid calendar date.");
|
|
48
49
|
return `${w(e)}-${String(e.day).padStart(y.componentDigits, "0")}`;
|
|
49
50
|
}
|
|
50
51
|
function w(e) {
|
|
52
|
+
if (!b(e)) throw RangeError("Cannot serialize an invalid calendar month.");
|
|
51
53
|
return `${String(e.year).padStart(y.yearDigits, "0")}-${String(e.month).padStart(y.componentDigits, "0")}`;
|
|
52
54
|
}
|
|
53
55
|
function T(e) {
|
|
@@ -66,13 +68,34 @@ function E(e) {
|
|
|
66
68
|
return b(r) && w(r) === e ? r : void 0;
|
|
67
69
|
}
|
|
68
70
|
function D(e, t) {
|
|
71
|
+
if (!x(e) || !Number.isInteger(t)) throw RangeError("Calendar-day arithmetic requires a valid date and integer offset.");
|
|
72
|
+
let n = /* @__PURE__ */ new Date(`${C(e)}T00:00:00Z`);
|
|
73
|
+
n.setUTCDate(n.getUTCDate() + t);
|
|
74
|
+
let r = {
|
|
75
|
+
year: n.getUTCFullYear(),
|
|
76
|
+
month: n.getUTCMonth() + 1,
|
|
77
|
+
day: n.getUTCDate()
|
|
78
|
+
};
|
|
79
|
+
if (!x(r)) throw RangeError("Calendar-day arithmetic exceeds the supported years 1–9999.");
|
|
80
|
+
return r;
|
|
81
|
+
}
|
|
82
|
+
function O(e, t) {
|
|
83
|
+
if (!b(e) || !Number.isInteger(t)) throw RangeError("Calendar-month arithmetic requires a valid month and integer offset.");
|
|
84
|
+
let n = (e.year - 1) * y.monthsPerYear + e.month - 1 + t, r = {
|
|
85
|
+
year: Math.floor(n / y.monthsPerYear) + 1,
|
|
86
|
+
month: n % y.monthsPerYear + 1
|
|
87
|
+
};
|
|
88
|
+
if (!b(r)) throw RangeError("Calendar-month arithmetic exceeds the supported years 1–9999.");
|
|
89
|
+
return r;
|
|
90
|
+
}
|
|
91
|
+
function k(e, t) {
|
|
69
92
|
return x(e) ? new Intl.DateTimeFormat(t, {
|
|
70
93
|
dateStyle: "medium",
|
|
71
94
|
timeZone: "UTC",
|
|
72
95
|
calendar: "gregory"
|
|
73
96
|
}).format(Date.parse(`${C(e)}T12:00:00Z`)) : "Invalid date";
|
|
74
97
|
}
|
|
75
|
-
function
|
|
98
|
+
function A(e, t) {
|
|
76
99
|
return b(e) ? new Intl.DateTimeFormat(t, {
|
|
77
100
|
month: "short",
|
|
78
101
|
year: "numeric",
|
|
@@ -80,29 +103,29 @@ function O(e, t) {
|
|
|
80
103
|
calendar: "gregory"
|
|
81
104
|
}).format(Date.parse(`${w(e)}-01T12:00:00Z`)) : "Invalid month";
|
|
82
105
|
}
|
|
83
|
-
function
|
|
106
|
+
function j(e, t, n) {
|
|
84
107
|
if (!x(e)) return "Select a valid date.";
|
|
85
108
|
if (t !== void 0 && C(e) < C(t)) return `Select a date on or after ${C(t)}.`;
|
|
86
109
|
if (n !== void 0 && C(e) > C(n)) return `Select a date on or before ${C(n)}.`;
|
|
87
110
|
}
|
|
88
|
-
function
|
|
111
|
+
function M(e, t, n) {
|
|
89
112
|
if (!b(e)) return "Select a valid month.";
|
|
90
113
|
if (t !== void 0 && S(e) < S(t)) return `Select a month on or after ${w(t)}.`;
|
|
91
114
|
if (n !== void 0 && S(e) > S(n)) return `Select a month on or before ${w(n)}.`;
|
|
92
115
|
}
|
|
93
116
|
// packages/forms/src/dates/calendar.tsx
|
|
94
|
-
function
|
|
117
|
+
function N(e, t) {
|
|
95
118
|
let n = new v(0, t);
|
|
96
119
|
return n.setFullYear(e.year, e.month - 1, e.day), n.setHours(12, 0, 0, 0), n;
|
|
97
120
|
}
|
|
98
|
-
function
|
|
121
|
+
function P(e) {
|
|
99
122
|
return {
|
|
100
123
|
year: e.getFullYear(),
|
|
101
124
|
month: e.getMonth() + 1,
|
|
102
125
|
day: e.getDate()
|
|
103
126
|
};
|
|
104
127
|
}
|
|
105
|
-
function
|
|
128
|
+
function F({ className: e, modifiers: t, ...n }) {
|
|
106
129
|
let r = {
|
|
107
130
|
0: { className: "x9f619 x9c6wpo x1ff4b4a x1f9pz31 x992rv9 x1717udv xmkeg23 x1y0btm7 x9r1u3d x1ok0vyi xjbqb8w xbixft x1hz01jw xj57cvi xtqrqnz x1778rvt xss6m8b x1ypdohk xqqsu6m xzro3xz x13qnu6 x9v5kkp x19rmrnh x1bqaal x19tlqzf xtgyt42" },
|
|
108
131
|
8: { className: "x9f619 x9c6wpo x1ff4b4a x1f9pz31 x992rv9 x1717udv xmkeg23 x1y0btm7 x9r1u3d x1ok0vyi xjbqb8w x1hz01jw xj57cvi xtqrqnz x1778rvt xss6m8b x1ypdohk xqqsu6m xzro3xz x13qnu6 x9v5kkp x19rmrnh x1bqaal x19tlqzf xtgyt42 x153jb6y" },
|
|
@@ -127,25 +150,25 @@ function N({ className: e, modifiers: t, ...n }) {
|
|
|
127
150
|
className: [e, r.className].filter(Boolean).join(" ")
|
|
128
151
|
});
|
|
129
152
|
}
|
|
130
|
-
function
|
|
153
|
+
function I(e) {
|
|
131
154
|
let { locale: t, timeZone: n, weekStartsOn: r = 1, label: i } = e, a = x(e.today) ? e.today : {
|
|
132
155
|
year: 2e3,
|
|
133
156
|
month: 1,
|
|
134
157
|
day: 1
|
|
135
158
|
}, o = x(e.initialMonth) ? e.initialMonth : a, s = e.minimum !== void 0 && x(e.minimum) ? e.minimum : void 0, c = e.maximum !== void 0 && x(e.maximum) ? e.maximum : void 0, l = [];
|
|
136
|
-
s !== void 0 && l.push({ before:
|
|
159
|
+
s !== void 0 && l.push({ before: N(s, n) }), c !== void 0 && l.push({ after: N(c, n) });
|
|
137
160
|
let u = {
|
|
138
161
|
"aria-label": i,
|
|
139
162
|
timeZone: n,
|
|
140
163
|
noonSafe: !0,
|
|
141
164
|
autoFocus: e.autoFocus ?? !1,
|
|
142
165
|
weekStartsOn: r,
|
|
143
|
-
today:
|
|
144
|
-
defaultMonth:
|
|
145
|
-
startMonth: s === void 0 ? void 0 :
|
|
166
|
+
today: N(a, n),
|
|
167
|
+
defaultMonth: N(o, n),
|
|
168
|
+
startMonth: s === void 0 ? void 0 : N(s, n),
|
|
146
169
|
disabled: l,
|
|
147
170
|
showOutsideDays: !0,
|
|
148
|
-
components: { DayButton:
|
|
171
|
+
components: { DayButton: F },
|
|
149
172
|
classNames: {
|
|
150
173
|
root: { className: "xbixft xpvm0e4 x1hz01jw xj57cvi xtqrqnz x1778rvt x1717udv xezivpi x193iq5w xw2csxc" }.className ?? "",
|
|
151
174
|
months: { className: "x78zum5 x1a02dak x1n2onr6 x1j825kq" }.className ?? "",
|
|
@@ -176,15 +199,15 @@ function P(e) {
|
|
|
176
199
|
}).format(e)
|
|
177
200
|
}
|
|
178
201
|
};
|
|
179
|
-
if (c !== void 0 && (u.endMonth =
|
|
202
|
+
if (c !== void 0 && (u.endMonth = N(c, n)), e.mode === "single") return /* @__PURE__ */ d(_, {
|
|
180
203
|
...u,
|
|
181
204
|
mode: "single",
|
|
182
|
-
selected: e.value !== void 0 && x(e.value) ?
|
|
183
|
-
onSelect: (t) => e.onValueChange(t === void 0 ? void 0 :
|
|
205
|
+
selected: e.value !== void 0 && x(e.value) ? N(e.value, n) : void 0,
|
|
206
|
+
onSelect: (t) => e.onValueChange(t === void 0 ? void 0 : P(t))
|
|
184
207
|
}, n);
|
|
185
208
|
let f = e.value === void 0 || !x(e.value.from) ? void 0 : {
|
|
186
|
-
from:
|
|
187
|
-
to: e.value.to !== void 0 && x(e.value.to) ?
|
|
209
|
+
from: N(e.value.from, n),
|
|
210
|
+
to: e.value.to !== void 0 && x(e.value.to) ? N(e.value.to, n) : void 0
|
|
188
211
|
};
|
|
189
212
|
return /* @__PURE__ */ d(_, {
|
|
190
213
|
...u,
|
|
@@ -192,45 +215,45 @@ function P(e) {
|
|
|
192
215
|
resetOnSelect: !0,
|
|
193
216
|
selected: f,
|
|
194
217
|
onSelect: (t) => e.onValueChange(t?.from === void 0 ? void 0 : {
|
|
195
|
-
from:
|
|
196
|
-
to: t.to === void 0 ? void 0 :
|
|
218
|
+
from: P(t.from),
|
|
219
|
+
to: t.to === void 0 ? void 0 : P(t.to)
|
|
197
220
|
})
|
|
198
221
|
}, n);
|
|
199
222
|
}
|
|
200
223
|
// packages/forms/src/dates/date-inputs.tsx
|
|
201
|
-
var
|
|
224
|
+
var L = { input: {
|
|
202
225
|
kzqmXN: "xh8yej3",
|
|
203
226
|
k7Eaqz: "xeuugli",
|
|
204
227
|
$$css: !0
|
|
205
228
|
} };
|
|
206
|
-
function
|
|
229
|
+
function R({ label: n, value: r, minimum: i, maximum: a, onValueChange: o }) {
|
|
207
230
|
return /* @__PURE__ */ f(t.Root, { children: [/* @__PURE__ */ d(t.Label, { children: n }), /* @__PURE__ */ d(e, {
|
|
208
231
|
type: "date",
|
|
209
232
|
value: r === void 0 ? "" : C(r),
|
|
210
233
|
min: i === void 0 ? "0001-01-01" : C(i),
|
|
211
234
|
max: a === void 0 ? "9999-12-31" : C(a),
|
|
212
235
|
onChange: (e) => o(T(e.target.value)),
|
|
213
|
-
xstyle:
|
|
236
|
+
xstyle: L.input
|
|
214
237
|
})] });
|
|
215
238
|
}
|
|
216
|
-
function
|
|
239
|
+
function z({ label: n, value: r, minimum: i, maximum: a, onValueChange: o }) {
|
|
217
240
|
return /* @__PURE__ */ f(t.Root, { children: [/* @__PURE__ */ d(t.Label, { children: n }), /* @__PURE__ */ d(e, {
|
|
218
241
|
type: "month",
|
|
219
242
|
value: r === void 0 ? "" : w(r),
|
|
220
243
|
min: i === void 0 ? "0001-01" : w(i),
|
|
221
244
|
max: a === void 0 ? "9999-12" : w(a),
|
|
222
245
|
onChange: (e) => o(E(e.target.value)),
|
|
223
|
-
xstyle:
|
|
246
|
+
xstyle: L.input
|
|
224
247
|
})] });
|
|
225
248
|
}
|
|
226
|
-
function
|
|
249
|
+
function B({ children: e }) {
|
|
227
250
|
return /* @__PURE__ */ d("div", {
|
|
228
251
|
className: "xrvj5dj xnby9oq x1hnptsi",
|
|
229
252
|
children: e
|
|
230
253
|
});
|
|
231
254
|
}
|
|
232
255
|
// packages/forms/src/dates/picker-popover.tsx
|
|
233
|
-
function
|
|
256
|
+
function V({ label: e, value: t, onValueChange: r, formatValue: o, validateValue: c, presets: u = [], density: m = "standard", disabled: h, isClearable: g = !0, timeZone: _, children: v }) {
|
|
234
257
|
let [y, b] = l(!1), [x, S] = l(t), C = s(), w = x === void 0 ? void 0 : c(x);
|
|
235
258
|
function T(e) {
|
|
236
259
|
r(e), b(!1);
|
|
@@ -316,24 +339,24 @@ function z({ label: e, value: t, onValueChange: r, formatValue: o, validateValue
|
|
|
316
339
|
});
|
|
317
340
|
}
|
|
318
341
|
// packages/forms/src/dates/date-picker.tsx
|
|
319
|
-
function
|
|
320
|
-
return /* @__PURE__ */ d(
|
|
342
|
+
function H({ label: e, value: t, onValueChange: n, formatValue: r, density: i, disabled: a, isClearable: o, ...s }) {
|
|
343
|
+
return /* @__PURE__ */ d(V, {
|
|
321
344
|
label: e,
|
|
322
345
|
value: t,
|
|
323
346
|
onValueChange: n,
|
|
324
|
-
formatValue: r ?? ((e) =>
|
|
325
|
-
validateValue: (e) =>
|
|
347
|
+
formatValue: r ?? ((e) => k(e, s.locale)),
|
|
348
|
+
validateValue: (e) => j(e, s.minimum, s.maximum),
|
|
326
349
|
density: i,
|
|
327
350
|
disabled: a,
|
|
328
351
|
isClearable: o,
|
|
329
352
|
timeZone: s.timeZone,
|
|
330
|
-
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
353
|
+
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(R, {
|
|
331
354
|
label: "Date",
|
|
332
355
|
value: t,
|
|
333
356
|
minimum: s.minimum,
|
|
334
357
|
maximum: s.maximum,
|
|
335
358
|
onValueChange: n
|
|
336
|
-
}), /* @__PURE__ */ d(
|
|
359
|
+
}), /* @__PURE__ */ d(I, {
|
|
337
360
|
...s,
|
|
338
361
|
label: e,
|
|
339
362
|
mode: "single",
|
|
@@ -345,24 +368,24 @@ function B({ label: e, value: t, onValueChange: n, formatValue: r, density: i, d
|
|
|
345
368
|
});
|
|
346
369
|
}
|
|
347
370
|
// packages/forms/src/dates/date-range-picker.tsx
|
|
348
|
-
function
|
|
371
|
+
function U({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, validateRange: a, density: o, disabled: s, isClearable: c, ...l }) {
|
|
349
372
|
function p(e) {
|
|
350
373
|
if (e.to === void 0) return "Select a start and end date.";
|
|
351
|
-
let t =
|
|
374
|
+
let t = j(e.from, l.minimum, l.maximum) ?? j(e.to, l.minimum, l.maximum);
|
|
352
375
|
return t === void 0 ? C(e.from) > C(e.to) ? "End date must be on or after start date." : a?.({
|
|
353
376
|
from: e.from,
|
|
354
377
|
to: e.to
|
|
355
378
|
}) : t;
|
|
356
379
|
}
|
|
357
380
|
function m(e) {
|
|
358
|
-
if (e.to === void 0) return
|
|
381
|
+
if (e.to === void 0) return k(e.from, l.locale);
|
|
359
382
|
let t = {
|
|
360
383
|
from: e.from,
|
|
361
384
|
to: e.to
|
|
362
385
|
};
|
|
363
|
-
return r?.(t) ?? `${
|
|
386
|
+
return r?.(t) ?? `${k(t.from, l.locale)} – ${k(t.to, l.locale)}`;
|
|
364
387
|
}
|
|
365
|
-
return /* @__PURE__ */ d(
|
|
388
|
+
return /* @__PURE__ */ d(V, {
|
|
366
389
|
label: e,
|
|
367
390
|
value: t,
|
|
368
391
|
formatValue: m,
|
|
@@ -378,7 +401,7 @@ function V({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
378
401
|
to: e.to
|
|
379
402
|
});
|
|
380
403
|
},
|
|
381
|
-
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(
|
|
404
|
+
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(B, { children: [/* @__PURE__ */ d(R, {
|
|
382
405
|
label: "Start date",
|
|
383
406
|
value: t?.from,
|
|
384
407
|
minimum: l.minimum,
|
|
@@ -387,7 +410,7 @@ function V({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
387
410
|
from: e,
|
|
388
411
|
to: t?.to
|
|
389
412
|
})
|
|
390
|
-
}), /* @__PURE__ */ d(
|
|
413
|
+
}), /* @__PURE__ */ d(R, {
|
|
391
414
|
label: "End date",
|
|
392
415
|
value: t?.to,
|
|
393
416
|
minimum: l.minimum,
|
|
@@ -401,7 +424,7 @@ function V({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
401
424
|
to: e
|
|
402
425
|
});
|
|
403
426
|
}
|
|
404
|
-
})] }), /* @__PURE__ */ d(
|
|
427
|
+
})] }), /* @__PURE__ */ d(I, {
|
|
405
428
|
...l,
|
|
406
429
|
label: e,
|
|
407
430
|
mode: "range",
|
|
@@ -413,19 +436,19 @@ function V({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
413
436
|
});
|
|
414
437
|
}
|
|
415
438
|
// packages/forms/src/dates/month-calendar.tsx
|
|
416
|
-
var
|
|
439
|
+
var W = { month: {
|
|
417
440
|
kzqmXN: "xh8yej3",
|
|
418
441
|
$$css: !0
|
|
419
442
|
} };
|
|
420
|
-
function
|
|
443
|
+
function G(e, t, n) {
|
|
421
444
|
let r = b(e) ? e : {
|
|
422
445
|
year: 2e3,
|
|
423
446
|
month: 1
|
|
424
447
|
};
|
|
425
448
|
return t !== void 0 && S(r) < S(t) ? t : n !== void 0 && S(r) > S(n) ? n : r;
|
|
426
449
|
}
|
|
427
|
-
function
|
|
428
|
-
let _ =
|
|
450
|
+
function K({ label: e, selection: t, onSelect: n, locale: a, today: s, initialMonth: u, minimum: p, maximum: g }) {
|
|
451
|
+
let _ = G(u, p, g), [v, y] = l(_.year), [b, x] = l(_), C = c(/* @__PURE__ */ new Map()), w = c(!1);
|
|
429
452
|
o(() => {
|
|
430
453
|
w.current && (w.current = !1, C.current.get(b.month)?.focus());
|
|
431
454
|
}, [b]);
|
|
@@ -440,14 +463,14 @@ function W({ label: e, selection: t, onSelect: n, locale: a, today: s, initialMo
|
|
|
440
463
|
}[e.key];
|
|
441
464
|
if (e.key === "Home" && (n = 1 - t.month), e.key === "End" && (n = 12 - t.month), n === void 0) return;
|
|
442
465
|
e.preventDefault();
|
|
443
|
-
let r = Math.max(12, Math.min(119999, S(t) - 1 + n)), i =
|
|
466
|
+
let r = Math.max(12, Math.min(119999, S(t) - 1 + n)), i = G({
|
|
444
467
|
year: Math.floor(r / 12),
|
|
445
468
|
month: r % 12 + 1
|
|
446
469
|
}, p, g);
|
|
447
470
|
w.current = !0, y(i.year), x(i);
|
|
448
471
|
}
|
|
449
472
|
function E(e) {
|
|
450
|
-
let t =
|
|
473
|
+
let t = G({
|
|
451
474
|
year: e,
|
|
452
475
|
month: b.month
|
|
453
476
|
}, p, g);
|
|
@@ -487,7 +510,7 @@ function W({ label: e, selection: t, onSelect: n, locale: a, today: s, initialMo
|
|
|
487
510
|
}, c = S(o), l = t === void 0 ? void 0 : S(t.from), u = t?.to === void 0 ? void 0 : S(t.to), f = c === l || c === u, m = l !== void 0 && u !== void 0 && c > l && c < u, h = p !== void 0 && c < S(p), _ = g !== void 0 && c > S(g), y = h || _;
|
|
488
511
|
return /* @__PURE__ */ d(i, {
|
|
489
512
|
variant: f || m ? "solid" : "ghost",
|
|
490
|
-
"aria-label":
|
|
513
|
+
"aria-label": A(o, a),
|
|
491
514
|
"aria-pressed": f || m,
|
|
492
515
|
"aria-current": v === s.year && o.month === s.month ? "date" : void 0,
|
|
493
516
|
disabled: y,
|
|
@@ -498,7 +521,7 @@ function W({ label: e, selection: t, onSelect: n, locale: a, today: s, initialMo
|
|
|
498
521
|
onFocus: () => x(o),
|
|
499
522
|
onKeyDown: (e) => T(e, o),
|
|
500
523
|
onClick: () => n(o),
|
|
501
|
-
xstyle:
|
|
524
|
+
xstyle: W.month,
|
|
502
525
|
children: new Intl.DateTimeFormat(a, {
|
|
503
526
|
month: "short",
|
|
504
527
|
timeZone: "UTC",
|
|
@@ -510,24 +533,24 @@ function W({ label: e, selection: t, onSelect: n, locale: a, today: s, initialMo
|
|
|
510
533
|
});
|
|
511
534
|
}
|
|
512
535
|
// packages/forms/src/dates/month-picker.tsx
|
|
513
|
-
function
|
|
514
|
-
return /* @__PURE__ */ d(
|
|
536
|
+
function q({ label: e, value: t, onValueChange: n, formatValue: r, density: i, disabled: a, isClearable: o, ...s }) {
|
|
537
|
+
return /* @__PURE__ */ d(V, {
|
|
515
538
|
label: e,
|
|
516
539
|
value: t,
|
|
517
540
|
onValueChange: n,
|
|
518
|
-
formatValue: r ?? ((e) =>
|
|
519
|
-
validateValue: (e) =>
|
|
541
|
+
formatValue: r ?? ((e) => A(e, s.locale)),
|
|
542
|
+
validateValue: (e) => M(e, s.minimum, s.maximum),
|
|
520
543
|
density: i,
|
|
521
544
|
disabled: a,
|
|
522
545
|
isClearable: o,
|
|
523
546
|
timeZone: s.timeZone,
|
|
524
|
-
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
547
|
+
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(z, {
|
|
525
548
|
label: "Month",
|
|
526
549
|
value: t,
|
|
527
550
|
minimum: s.minimum,
|
|
528
551
|
maximum: s.maximum,
|
|
529
552
|
onValueChange: n
|
|
530
|
-
}), /* @__PURE__ */ d(
|
|
553
|
+
}), /* @__PURE__ */ d(K, {
|
|
531
554
|
...s,
|
|
532
555
|
label: e,
|
|
533
556
|
selection: t === void 0 ? void 0 : { from: t },
|
|
@@ -537,24 +560,24 @@ function G({ label: e, value: t, onValueChange: n, formatValue: r, density: i, d
|
|
|
537
560
|
});
|
|
538
561
|
}
|
|
539
562
|
// packages/forms/src/dates/month-range-picker.tsx
|
|
540
|
-
function
|
|
563
|
+
function J({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, validateRange: a, density: o, disabled: s, isClearable: c, ...l }) {
|
|
541
564
|
function p(e) {
|
|
542
565
|
if (e.to === void 0) return "Select a start and end month.";
|
|
543
|
-
let t =
|
|
566
|
+
let t = M(e.from, l.minimum, l.maximum) ?? M(e.to, l.minimum, l.maximum);
|
|
544
567
|
return t === void 0 ? S(e.from) > S(e.to) ? "End month must be on or after start month." : a?.({
|
|
545
568
|
from: e.from,
|
|
546
569
|
to: e.to
|
|
547
570
|
}) : t;
|
|
548
571
|
}
|
|
549
572
|
function m(e) {
|
|
550
|
-
if (e.to === void 0) return
|
|
573
|
+
if (e.to === void 0) return A(e.from, l.locale);
|
|
551
574
|
let t = {
|
|
552
575
|
from: e.from,
|
|
553
576
|
to: e.to
|
|
554
577
|
};
|
|
555
|
-
return r?.(t) ?? `${
|
|
578
|
+
return r?.(t) ?? `${A(t.from, l.locale)} – ${A(t.to, l.locale)}`;
|
|
556
579
|
}
|
|
557
|
-
return /* @__PURE__ */ d(
|
|
580
|
+
return /* @__PURE__ */ d(V, {
|
|
558
581
|
label: e,
|
|
559
582
|
value: t,
|
|
560
583
|
formatValue: m,
|
|
@@ -570,7 +593,7 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
570
593
|
to: e.to
|
|
571
594
|
});
|
|
572
595
|
},
|
|
573
|
-
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(
|
|
596
|
+
children: (t, n) => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(B, { children: [/* @__PURE__ */ d(z, {
|
|
574
597
|
label: "Start month",
|
|
575
598
|
value: t?.from,
|
|
576
599
|
minimum: l.minimum,
|
|
@@ -579,7 +602,7 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
579
602
|
from: e,
|
|
580
603
|
to: t?.to
|
|
581
604
|
})
|
|
582
|
-
}), /* @__PURE__ */ d(
|
|
605
|
+
}), /* @__PURE__ */ d(z, {
|
|
583
606
|
label: "End month",
|
|
584
607
|
value: t?.to,
|
|
585
608
|
minimum: l.minimum,
|
|
@@ -593,7 +616,7 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
593
616
|
to: e
|
|
594
617
|
});
|
|
595
618
|
}
|
|
596
|
-
})] }), /* @__PURE__ */ d(
|
|
619
|
+
})] }), /* @__PURE__ */ d(K, {
|
|
597
620
|
...l,
|
|
598
621
|
label: e,
|
|
599
622
|
selection: t,
|
|
@@ -610,4 +633,4 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
610
633
|
})] })
|
|
611
634
|
});
|
|
612
635
|
}
|
|
613
|
-
export {
|
|
636
|
+
export { I as Calendar, H as DatePicker, U as DateRangePicker, q as MonthPicker, J as MonthRangePicker, D as addCalendarDays, O as addCalendarMonths, T as parseCalendarDate, E as parseCalendarMonth, C as serializeCalendarDate, w as serializeCalendarMonth };
|
package/dist/forms.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "./forms-BQQFas9g.js";
|
|
2
|
-
import { a as r, c as i, d as a, f as o,
|
|
3
|
-
export {
|
|
2
|
+
import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "./src-CoFxE4Cj.js";
|
|
3
|
+
export { c as AgentAvatarPicker, h as Checkbox, s as Combobox, n as Field, v as Fieldset, a as FilePicker, u as FormActions, e as Input, o as InputGroup, m as NumberField, l as RadioGroup, i as Select, g as SelectControl, f as SettingsRow, _ as SettingsSection, d as Slider, r as Switch, t as Textarea, p as ToggleGroup };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
export type ScatterPoint = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly label: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartSelection } from './chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from './chart-theme.ts';
|
|
4
4
|
export type BreakdownItem = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly label: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
3
|
+
export type ChartSeriesMarkerProps = {
|
|
4
|
+
readonly tone: ChartTone;
|
|
5
|
+
readonly children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function ChartSeriesMarker({ tone, children }: ChartSeriesMarkerProps): ReactNode;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as stylex from '@stylexjs/stylex';
|
|
2
|
-
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
3
3
|
export type ChartLegendItem = {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly label: string;
|
|
6
6
|
readonly tone: ChartTone;
|
|
7
7
|
};
|
|
8
|
-
export declare const chartToneColors: Readonly<Record<ChartTone, string>>;
|
|
9
8
|
export declare const chartStyles: Readonly<{
|
|
10
9
|
readonly plot: Readonly<{
|
|
11
10
|
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
import type { NumericDomain } from './distribution-input.ts';
|
|
5
5
|
export type ECDFPoint = {
|
|
6
6
|
readonly id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
import type { NumericDomain } from './distribution-input.ts';
|
|
5
5
|
export type HistogramBin = {
|
|
6
6
|
readonly id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
import type { NumericDomain } from './distribution-input.ts';
|
|
5
5
|
export type IntervalDatum = {
|
|
6
6
|
readonly id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
import type { NumericDomain } from './distribution-input.ts';
|
|
5
5
|
export type RankedBarDatum = {
|
|
6
6
|
readonly id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
3
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
|
-
import type { ChartTone } from '../chart-theme.ts';
|
|
4
4
|
export type RelationNode = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly label: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { BreakdownItem } from './categorical-values.tsx';
|
|
2
2
|
export type { ChartReport, ChartSeriesReport, ChartSelection, ChartFrameProps, ChartLegendItem, ChartLegendProps, } from './chart-frame.tsx';
|
|
3
3
|
export { ChartFrame, ChartLegend } from './chart-frame.tsx';
|
|
4
|
-
export type { ChartTone } from '
|
|
5
|
-
export { chartToneColors } from '
|
|
4
|
+
export type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
5
|
+
export { chartToneColors } from '../../foundations/src/chart-tones.ts';
|
|
6
|
+
export type { ChartSeriesMarkerProps } from './chart-series-marker.tsx';
|
|
7
|
+
export { ChartSeriesMarker } from './chart-series-marker.tsx';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
type TableSizing = 'content' | 'fill';
|
|
3
3
|
type RowSizing = 'fixed' | 'content';
|
|
4
4
|
export type DataTableColumnRole = 'primary' | 'text' | 'status' | 'number' | 'timestamp' | 'actions';
|
|
@@ -48,10 +48,11 @@ export type DataTableRowAction<Row> = {
|
|
|
48
48
|
} & ({
|
|
49
49
|
readonly href: (row: Row) => string;
|
|
50
50
|
readonly onActivate?: (row: Row) => void;
|
|
51
|
-
|
|
51
|
+
readonly disabled?: never;
|
|
52
|
+
} | ({
|
|
52
53
|
readonly href?: never;
|
|
53
54
|
readonly onActivate: (row: Row) => void;
|
|
54
|
-
});
|
|
55
|
+
} & Pick<ComponentProps<'button'>, 'disabled'>));
|
|
55
56
|
type SortProperties<Row> = {
|
|
56
57
|
readonly columns: ReadonlyArray<DataTableColumn<Row>>;
|
|
57
58
|
readonly sort: DataTableSort | undefined;
|
|
@@ -81,6 +82,7 @@ export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> &
|
|
|
81
82
|
readonly rowAction?: DataTableRowAction<Row>;
|
|
82
83
|
readonly activeRowId?: string | undefined;
|
|
83
84
|
readonly focusRowId?: string | undefined;
|
|
85
|
+
readonly onRowHighlightChange?: ((rowId: string | undefined) => void) | undefined;
|
|
84
86
|
readonly hideCaption?: boolean;
|
|
85
87
|
readonly hideHeaders?: boolean;
|
|
86
88
|
readonly rowSizing?: RowSizing;
|
|
@@ -89,5 +91,5 @@ export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> &
|
|
|
89
91
|
readonly onEndReached?: () => void;
|
|
90
92
|
readonly footer?: ReactNode;
|
|
91
93
|
};
|
|
92
|
-
export declare function DataTable<Row extends object>({ rows, columns: suppliedColumns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, rowAction, activeRowId, focusRowId, hideCaption, hideHeaders, rowSizing, window, endContent, onEndReached, footer, }: DataTableProps<Row>): ReactNode;
|
|
94
|
+
export declare function DataTable<Row extends object>({ rows, columns: suppliedColumns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, rowAction, activeRowId, focusRowId, onRowHighlightChange, hideCaption, hideHeaders, rowSizing, window, endContent, onEndReached, footer, }: DataTableProps<Row>): ReactNode;
|
|
93
95
|
export {};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
2
3
|
export type ProgressProps = {
|
|
3
4
|
readonly label: string;
|
|
4
5
|
readonly value: number | null;
|
|
5
6
|
readonly max: number;
|
|
6
7
|
readonly valueLabel: string;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type MeterLayout = 'stacked' | 'inline';
|
|
10
|
+
export type MeterProps = ProgressProps & {
|
|
11
|
+
readonly layout?: MeterLayout;
|
|
12
|
+
readonly tone?: ChartTone;
|
|
13
|
+
};
|
|
9
14
|
export declare function Progress({ label, value, max, valueLabel }: ProgressProps): ReactNode;
|
|
10
|
-
export declare function Meter({ label, value, max, valueLabel }: MeterProps): ReactNode;
|
|
15
|
+
export declare function Meter({ label, value, max, valueLabel, layout, tone }: MeterProps): ReactNode;
|
|
16
|
+
export {};
|