@rinzai/zen 0.14.0 → 0.16.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/CHANGELOG.md +153 -0
- package/README.md +16 -1
- package/dist/animated-number/index.js +14 -14
- package/dist/breadcrumbs/index.js +14 -14
- package/dist/calendar/index.js +29 -29
- package/dist/calendar-heatmap/index.js +12 -12
- package/dist/canvas/index.js +19 -19
- package/dist/carousel/index.d.ts.map +1 -1
- package/dist/carousel/index.js +29 -29
- package/dist/chart/index.js +7 -7
- package/dist/code-block/index.js +5 -5
- package/dist/collapse/index.js +6 -6
- package/dist/color-picker/index.js +10 -10
- package/dist/combobox/index.js +61 -61
- package/dist/command-palette/index.js +5 -5
- package/dist/confirm-dialog/index.js +4 -4
- package/dist/date-picker/index.js +15 -15
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +45 -65
- package/dist/docs/README.md +205 -0
- package/dist/docs/accordion.md +122 -0
- package/dist/docs/alert.md +69 -0
- package/dist/docs/animated-number.md +105 -0
- package/dist/docs/avatar.md +91 -0
- package/dist/docs/backdrop.md +94 -0
- package/dist/docs/badge.md +37 -0
- package/dist/docs/breadcrumbs.md +44 -0
- package/dist/docs/button-group.md +76 -0
- package/dist/docs/button.md +131 -0
- package/dist/docs/calendar-heatmap.md +73 -0
- package/dist/docs/calendar.md +101 -0
- package/dist/docs/canvas.md +584 -0
- package/dist/docs/card.md +180 -0
- package/dist/docs/carousel.md +162 -0
- package/dist/docs/chart.md +325 -0
- package/dist/docs/checkbox.md +88 -0
- package/dist/docs/chip.md +52 -0
- package/dist/docs/code-block.md +116 -0
- package/dist/docs/code-input.md +52 -0
- package/dist/docs/collapse.md +46 -0
- package/dist/docs/color-picker.md +145 -0
- package/dist/docs/combobox.md +208 -0
- package/dist/docs/command-palette.md +65 -0
- package/dist/docs/date-picker.md +167 -0
- package/dist/docs/dialog.md +271 -0
- package/dist/docs/disclosure.md +88 -0
- package/dist/docs/editable-cell.md +90 -0
- package/dist/docs/empty-state.md +46 -0
- package/dist/docs/field.md +82 -0
- package/dist/docs/file-drop.md +44 -0
- package/dist/docs/filter-bar.md +66 -0
- package/dist/docs/header.md +51 -0
- package/dist/docs/hover-card.md +110 -0
- package/dist/docs/icon-picker.md +65 -0
- package/dist/docs/input-group.md +89 -0
- package/dist/docs/input.md +33 -0
- package/dist/docs/inset.md +57 -0
- package/dist/docs/kbd.md +34 -0
- package/dist/docs/keypad.md +51 -0
- package/dist/docs/load-more.md +66 -0
- package/dist/docs/locale-provider.md +99 -0
- package/dist/docs/marquee.md +86 -0
- package/dist/docs/menu.md +456 -0
- package/dist/docs/meter.md +102 -0
- package/dist/docs/money-input.md +169 -0
- package/dist/docs/month-picker.md +80 -0
- package/dist/docs/navigation-menu.md +157 -0
- package/dist/docs/number-field.md +129 -0
- package/dist/docs/page-header.md +44 -0
- package/dist/docs/page-transition.md +93 -0
- package/dist/docs/pagination.md +42 -0
- package/dist/docs/pills.md +85 -0
- package/dist/docs/player-bar.md +158 -0
- package/dist/docs/popover.md +200 -0
- package/dist/docs/progress-ring.md +70 -0
- package/dist/docs/radio-cards.md +82 -0
- package/dist/docs/radio-group.md +86 -0
- package/dist/docs/range-slider.md +64 -0
- package/dist/docs/repeat-picker.md +44 -0
- package/dist/docs/resizable.md +107 -0
- package/dist/docs/seek-bar.md +97 -0
- package/dist/docs/segmented.md +89 -0
- package/dist/docs/select.md +148 -0
- package/dist/docs/separator.md +76 -0
- package/dist/docs/side-nav.md +75 -0
- package/dist/docs/skeleton.md +89 -0
- package/dist/docs/slider.md +87 -0
- package/dist/docs/sortable.md +244 -0
- package/dist/docs/sparkline.md +56 -0
- package/dist/docs/spinner.md +69 -0
- package/dist/docs/status-pill.md +81 -0
- package/dist/docs/stepper.md +59 -0
- package/dist/docs/tab-bar.md +78 -0
- package/dist/docs/table-of-contents.md +43 -0
- package/dist/docs/table.md +714 -0
- package/dist/docs/tabs.md +140 -0
- package/dist/docs/tag-input.md +45 -0
- package/dist/docs/textarea.md +25 -0
- package/dist/docs/theme-toggle.md +85 -0
- package/dist/docs/theming.md +193 -0
- package/dist/docs/time-field.md +71 -0
- package/dist/docs/timeline.md +50 -0
- package/dist/docs/toast.md +53 -0
- package/dist/docs/toggle-group.md +83 -0
- package/dist/docs/toggle.md +38 -0
- package/dist/docs/toolbar.md +97 -0
- package/dist/docs/tooltip.md +102 -0
- package/dist/docs/tree.md +295 -0
- package/dist/docs/trend.md +50 -0
- package/dist/filter-bar/index.js +6 -6
- package/dist/header/index.js +6 -6
- package/dist/icon-picker/index.js +5 -5
- package/dist/icons/arrow-path.d.ts +3 -0
- package/dist/icons/arrow-path.d.ts.map +1 -0
- package/dist/icons/arrows-right-left.d.ts +3 -0
- package/dist/icons/arrows-right-left.d.ts.map +1 -0
- package/dist/icons/backward.d.ts +3 -0
- package/dist/icons/backward.d.ts.map +1 -0
- package/dist/icons/forward.d.ts +3 -0
- package/dist/icons/forward.d.ts.map +1 -0
- package/dist/icons/heart-solid.d.ts +3 -0
- package/dist/icons/heart-solid.d.ts.map +1 -0
- package/dist/icons/heart.d.ts +3 -0
- package/dist/icons/heart.d.ts.map +1 -0
- package/dist/icons/musical-note.d.ts +3 -0
- package/dist/icons/musical-note.d.ts.map +1 -0
- package/dist/icons/pause.d.ts +3 -0
- package/dist/icons/pause.d.ts.map +1 -0
- package/dist/icons/play.d.ts +3 -0
- package/dist/icons/play.d.ts.map +1 -0
- package/dist/icons/queue-list.d.ts +3 -0
- package/dist/icons/queue-list.d.ts.map +1 -0
- package/dist/icons/speaker-wave.d.ts +3 -0
- package/dist/icons/speaker-wave.d.ts.map +1 -0
- package/dist/icons/speaker-x-mark.d.ts +3 -0
- package/dist/icons/speaker-x-mark.d.ts.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/keypad/index.js +5 -5
- package/dist/lib.js +86 -80
- package/dist/load-more/index.js +5 -5
- package/dist/marquee/index.d.ts +15 -0
- package/dist/marquee/index.d.ts.map +1 -0
- package/dist/marquee/index.js +90 -0
- package/dist/menu/index.d.ts +7 -1
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +222 -178
- package/dist/money-input/index.js +54 -54
- package/dist/month-picker/index.js +11 -11
- package/dist/number-field/index.js +5 -5
- package/dist/pagination/index.js +12 -12
- package/dist/player-bar/index.d.ts +11 -0
- package/dist/player-bar/index.d.ts.map +1 -0
- package/dist/player-bar/index.js +17 -0
- package/dist/radio-cards/index.d.ts +2 -1
- package/dist/radio-cards/index.d.ts.map +1 -1
- package/dist/radio-cards/index.js +3 -3
- package/dist/range-slider/index.js +11 -11
- package/dist/repeat-picker/index.js +5 -5
- package/dist/resizable/index.js +22 -22
- package/dist/seek-bar/index.d.ts +26 -0
- package/dist/seek-bar/index.d.ts.map +1 -0
- package/dist/seek-bar/index.js +121 -0
- package/dist/segmented/index.d.ts +3 -2
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/segmented/index.js +19 -18
- package/dist/select/index.js +21 -21
- package/dist/slider/index.d.ts +2 -1
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/sortable/index.d.ts +13 -1
- package/dist/sortable/index.d.ts.map +1 -1
- package/dist/sortable/index.js +74 -55
- package/dist/sortable/shared.js +14 -14
- package/dist/sortable/tree.js +17 -17
- package/dist/sparkline/index.js +4 -4
- package/dist/stepper/index.js +13 -13
- package/dist/tab-bar/index.d.ts +4 -2
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.js +24 -19
- package/dist/table/index.js +26 -26
- package/dist/table/selection.js +9 -9
- package/dist/table-of-contents/index.js +11 -11
- package/dist/tag-input/index.js +5 -5
- package/dist/textarea/index.d.ts +6 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/textarea/index.js +2 -1
- package/dist/theme-toggle/index.js +4 -4
- package/dist/theme.css +143 -0
- package/dist/time-field/index.js +21 -21
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +41 -41
- package/dist/tooltip/index.d.ts +9 -3
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +19 -16
- package/dist/tree/index.js +34 -34
- package/dist/trend/index.js +5 -5
- package/dist/utils/duration.d.ts +3 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +7 -0
- package/dist/utils/messages.d.ts +3 -0
- package/dist/utils/messages.d.ts.map +1 -1
- package/dist/utils/messages.js +4 -1
- package/dist/utils/slot.d.ts +5 -2
- package/dist/utils/slot.d.ts.map +1 -1
- package/dist/utils/slot.js +16 -11
- package/dist/utils/swipe.d.ts +7 -0
- package/dist/utils/swipe.d.ts.map +1 -1
- package/dist/utils/swipe.js +45 -25
- package/dist/utils/useAnchoredPopup.d.ts +2 -1
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +10 -5
- package/dist/utils/useHeightVar.d.ts +7 -0
- package/dist/utils/useHeightVar.d.ts.map +1 -0
- package/dist/utils/useHeightVar.js +17 -0
- package/dist/utils/useMediaPlayer.d.ts +38 -0
- package/dist/utils/useMediaPlayer.d.ts.map +1 -0
- package/dist/utils/useMediaPlayer.js +91 -0
- package/dist/utils/useMediaSession.d.ts +24 -0
- package/dist/utils/useMediaSession.d.ts.map +1 -0
- package/dist/utils/useMediaSession.js +76 -0
- package/dist/utils/useVirtualList.d.ts +6 -1
- package/dist/utils/useVirtualList.d.ts.map +1 -1
- package/dist/utils/useVirtualList.js +12 -12
- package/dist/zen.css +1 -1
- package/package.json +4 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as n } from "../utils/cx.js";
|
|
4
|
+
import { useControllable as r } from "../utils/useControllable.js";
|
|
5
|
+
import i, { MenuContent as a, MenuItem as o, MenuSeparator as s, MenuTrigger as c } from "../menu/index.js";
|
|
6
6
|
import { currencySymbol as l, formatAmount as u, formatMoney as d, minorDigits as f, parseMoneyInput as p } from "../utils/money.js";
|
|
7
7
|
import m from "../spinner/index.js";
|
|
8
8
|
import { AlertIcon as h, InfoIcon as g } from "../utils/status-icons.js";
|
|
@@ -13,10 +13,10 @@ import { convertMinor as S, rateBetween as C } from "../utils/fx.js";
|
|
|
13
13
|
import { useEffect as w, useId as T, useRef as E, useState as D } from "react";
|
|
14
14
|
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
15
15
|
//#region packages/money-input/index.tsx
|
|
16
|
-
function j({ value:
|
|
16
|
+
function j({ value: e, defaultValue: t, onValueChange: r, currency: i, locale: a, allowNegative: o, allowEmpty: s, live: c, onCancel: l, convert: u, start: d, end: f, compact: p = !1, size: m, disabled: g = !1, className: v, onFocus: S, onBlur: C, onKeyDown: w, "aria-describedby": T, name: E, ...D }) {
|
|
17
17
|
let O = P({
|
|
18
|
-
value:
|
|
19
|
-
defaultValue:
|
|
18
|
+
value: e,
|
|
19
|
+
defaultValue: t,
|
|
20
20
|
onValueChange: r,
|
|
21
21
|
currency: i,
|
|
22
22
|
locale: a,
|
|
@@ -27,13 +27,13 @@ function j({ value: t, defaultValue: n, onValueChange: r, currency: i, locale: a
|
|
|
27
27
|
convert: u
|
|
28
28
|
}), j = !!O.conversion?.foreign;
|
|
29
29
|
return /* @__PURE__ */ A("div", {
|
|
30
|
-
className:
|
|
30
|
+
className: n("zen__money-input flex flex-col gap-1", v),
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ A(y, {
|
|
33
33
|
invalid: !!O.error,
|
|
34
34
|
size: m,
|
|
35
35
|
"data-foreign": j || void 0,
|
|
36
|
-
className:
|
|
36
|
+
className: n(p && "h-7", "data-foreign:border-primary/50"),
|
|
37
37
|
children: [
|
|
38
38
|
d ?? (O.conversion && !g ? /* @__PURE__ */ k(M, { money: O }) : /* @__PURE__ */ k(b, {
|
|
39
39
|
"aria-hidden": !0,
|
|
@@ -52,9 +52,9 @@ function j({ value: t, defaultValue: n, onValueChange: r, currency: i, locale: a
|
|
|
52
52
|
onKeyDown: (e) => {
|
|
53
53
|
O.inputProps.onKeyDown(e), w?.(e);
|
|
54
54
|
},
|
|
55
|
-
"aria-describedby":
|
|
55
|
+
"aria-describedby": n(O.inputProps["aria-describedby"], T) || void 0,
|
|
56
56
|
disabled: g,
|
|
57
|
-
className:
|
|
57
|
+
className: n("tabular-nums", p ? "text-end" : "text-start")
|
|
58
58
|
}),
|
|
59
59
|
f
|
|
60
60
|
]
|
|
@@ -73,19 +73,19 @@ function j({ value: t, defaultValue: n, onValueChange: r, currency: i, locale: a
|
|
|
73
73
|
]
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
function M({ money:
|
|
77
|
-
let u =
|
|
78
|
-
return u ? /* @__PURE__ */ A(
|
|
76
|
+
function M({ money: e, className: r }) {
|
|
77
|
+
let u = e.conversion, d = t();
|
|
78
|
+
return u ? /* @__PURE__ */ A(i, { children: [/* @__PURE__ */ A(c, {
|
|
79
79
|
"aria-label": d.changeCurrency(u.currency),
|
|
80
|
-
className:
|
|
81
|
-
children: [u.foreign ? u.currency :
|
|
82
|
-
}), /* @__PURE__ */ A(
|
|
80
|
+
className: n("group/currency hover:bg-tint/[0.07] -ms-1 flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-sm outline-hidden focus-ring", u.foreign ? "text-primary" : "text-muted-foreground", r),
|
|
81
|
+
children: [u.foreign ? u.currency : e.symbol, /* @__PURE__ */ k(v, { className: "text-inherit duration-150 group-data-popup-open/currency:rotate-180" })]
|
|
82
|
+
}), /* @__PURE__ */ A(a, {
|
|
83
83
|
align: "start",
|
|
84
84
|
offset: 8,
|
|
85
85
|
"aria-label": d.currency,
|
|
86
86
|
className: "max-h-72 w-60 overflow-y-auto",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ A(
|
|
88
|
+
/* @__PURE__ */ A(o, {
|
|
89
89
|
onSelect: () => u.pick(u.home),
|
|
90
90
|
className: "gap-2 py-1.5",
|
|
91
91
|
children: [/* @__PURE__ */ k("span", {
|
|
@@ -96,12 +96,12 @@ function M({ money: t, className: s }) {
|
|
|
96
96
|
children: d.yourCurrency
|
|
97
97
|
})]
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */ k(
|
|
99
|
+
/* @__PURE__ */ k(s, {}),
|
|
100
100
|
/* @__PURE__ */ k("div", {
|
|
101
101
|
className: "text-muted-foreground px-3 pt-1 pb-1.5 text-xs",
|
|
102
102
|
children: d.otherCurrencies
|
|
103
103
|
}),
|
|
104
|
-
u.choices.map((e) => /* @__PURE__ */ A(
|
|
104
|
+
u.choices.map((e) => /* @__PURE__ */ A(o, {
|
|
105
105
|
onSelect: () => u.pick(e),
|
|
106
106
|
className: "gap-2 py-1.5",
|
|
107
107
|
children: [/* @__PURE__ */ k("span", {
|
|
@@ -115,63 +115,63 @@ function M({ money: t, className: s }) {
|
|
|
115
115
|
]
|
|
116
116
|
})] }) : null;
|
|
117
117
|
}
|
|
118
|
-
function N({ money:
|
|
119
|
-
let
|
|
120
|
-
if (!
|
|
121
|
-
let { home:
|
|
122
|
-
if (!
|
|
123
|
-
let
|
|
118
|
+
function N({ money: e, className: r }) {
|
|
119
|
+
let i = e.conversion, a = t();
|
|
120
|
+
if (!i || !i.foreign && !i.converted) return null;
|
|
121
|
+
let { home: o, locale: s } = i, c = n("text-muted-foreground flex items-center gap-1.5 text-xs", r);
|
|
122
|
+
if (!i.foreign) {
|
|
123
|
+
let t = i.converted;
|
|
124
124
|
return /* @__PURE__ */ A("p", {
|
|
125
|
-
id:
|
|
125
|
+
id: e.hintId,
|
|
126
126
|
role: "status",
|
|
127
|
-
className:
|
|
128
|
-
children: [/* @__PURE__ */ k(g, { className: "text-primary shrink-0" }),
|
|
127
|
+
className: c,
|
|
128
|
+
children: [/* @__PURE__ */ k(g, { className: "text-primary shrink-0" }), a.convertedFrom(d(t.amount, t.currency, s), I(t.rate))]
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
return /* @__PURE__ */ k("p", {
|
|
132
|
-
id:
|
|
132
|
+
id: e.hintId,
|
|
133
133
|
role: "status",
|
|
134
|
-
className:
|
|
135
|
-
children:
|
|
134
|
+
className: c,
|
|
135
|
+
children: i.status === "idle" || i.status === "loading" ? /* @__PURE__ */ A(O, { children: [
|
|
136
136
|
/* @__PURE__ */ k(m, { className: "size-3" }),
|
|
137
137
|
" ",
|
|
138
|
-
|
|
139
|
-
] }) :
|
|
138
|
+
a.gettingRate
|
|
139
|
+
] }) : i.rate === null ? /* @__PURE__ */ A(O, { children: [
|
|
140
140
|
/* @__PURE__ */ k(h, { className: "text-destructive shrink-0" }),
|
|
141
141
|
" ",
|
|
142
|
-
|
|
142
|
+
a.ratesUnavailable(o)
|
|
143
143
|
] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(g, { className: "text-primary shrink-0" }), /* @__PURE__ */ A("span", { children: [
|
|
144
|
-
|
|
144
|
+
i.preview !== null && /* @__PURE__ */ A("span", {
|
|
145
145
|
className: "text-foreground font-medium",
|
|
146
146
|
children: [
|
|
147
147
|
"≈ ",
|
|
148
|
-
d(
|
|
148
|
+
d(i.preview, o, s),
|
|
149
149
|
" ·",
|
|
150
150
|
" "
|
|
151
151
|
]
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
a.rateOf(i.currency, d(Math.round(i.rate * 10 ** f(o)), o, s)),
|
|
154
154
|
" ",
|
|
155
155
|
"(",
|
|
156
|
-
|
|
157
|
-
L(
|
|
156
|
+
i.source ? `${i.source}, ` : "",
|
|
157
|
+
L(i.date, s),
|
|
158
158
|
")"
|
|
159
159
|
] })] })
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function P({ value:
|
|
163
|
-
let v =
|
|
162
|
+
function P({ value: i, defaultValue: a = null, onValueChange: o, currency: s, locale: c, allowNegative: f = !1, allowEmpty: m = !1, live: h = !1, onCancel: g, convert: _ }) {
|
|
163
|
+
let v = e(c), y = t(), [b, x, E] = r(i, a, o), O = _?.initial ?? null, [k, A] = D(() => O?.currency ?? s), j = !!_ && k !== s, M = F(_?.loadRates, j), N = (e) => e === null ? "" : u(e, s, v), [P, I] = D(() => O ? u(O.amount, O.currency, v) : N(b)), [L, R] = D(null), [z, B] = D(null), [V, H] = D(!1), [U, W] = D(!1), G = T(), K = T();
|
|
164
164
|
w(() => {
|
|
165
165
|
!V && !j && !(h && U) && I(N(b));
|
|
166
166
|
}, [
|
|
167
167
|
b,
|
|
168
|
-
|
|
168
|
+
s,
|
|
169
169
|
v
|
|
170
170
|
]);
|
|
171
171
|
let q = (e) => {
|
|
172
172
|
if (!M.table) return null;
|
|
173
173
|
try {
|
|
174
|
-
return C(M.table, e,
|
|
174
|
+
return C(M.table, e, s);
|
|
175
175
|
} catch {
|
|
176
176
|
return null;
|
|
177
177
|
}
|
|
@@ -209,7 +209,7 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
209
209
|
x(null);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
t ===
|
|
212
|
+
t === s ? (x(i), _?.onForeign?.(null)) : n === null ? x(null) : (x(S(i, n, t, s)), _?.onForeign?.({
|
|
213
213
|
currency: t,
|
|
214
214
|
amount: i,
|
|
215
215
|
rate: n,
|
|
@@ -224,13 +224,13 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
224
224
|
if (e === void 0) return !1;
|
|
225
225
|
if (e !== null && j) {
|
|
226
226
|
if (J === null) return R(M.status === "error" ? y.rateFailed : y.rateLoading), !1;
|
|
227
|
-
let t = S(e, J, k,
|
|
227
|
+
let t = S(e, J, k, s), n = {
|
|
228
228
|
currency: k,
|
|
229
229
|
amount: e,
|
|
230
230
|
rate: J,
|
|
231
231
|
date: M.table.date
|
|
232
232
|
};
|
|
233
|
-
return B(n), A(
|
|
233
|
+
return B(n), A(s), I(N(t)), x(t), _?.onForeign?.(n), !0;
|
|
234
234
|
}
|
|
235
235
|
return I(N(e)), x(e), e !== b && (B(null), _?.onForeign?.(null)), !0;
|
|
236
236
|
}
|
|
@@ -239,12 +239,12 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
239
239
|
e !== void 0 && I(e === null ? "" : u(e, k, v));
|
|
240
240
|
}
|
|
241
241
|
function ee(e) {
|
|
242
|
-
A(e), R(null), h && P.trim() && (W(!0), Z(P, e, e ===
|
|
242
|
+
A(e), R(null), h && P.trim() && (W(!0), Z(P, e, e === s ? null : q(e)));
|
|
243
243
|
}
|
|
244
244
|
let te = (() => {
|
|
245
245
|
if (!j || J === null || !P.trim()) return null;
|
|
246
246
|
try {
|
|
247
|
-
return S(p(P, k), J, k,
|
|
247
|
+
return S(p(P, k), J, k, s);
|
|
248
248
|
} catch {
|
|
249
249
|
return null;
|
|
250
250
|
}
|
|
@@ -257,7 +257,7 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
257
257
|
spellCheck: !1,
|
|
258
258
|
value: P,
|
|
259
259
|
"aria-invalid": L ? !0 : void 0,
|
|
260
|
-
"aria-describedby":
|
|
260
|
+
"aria-describedby": n(L ? G : (j || !!z) && K) || void 0,
|
|
261
261
|
onChange: (e) => {
|
|
262
262
|
I(e.target.value), B(null), h && (W(!0), Z(e.target.value, k, J));
|
|
263
263
|
},
|
|
@@ -266,7 +266,7 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
266
266
|
H(!1), h ? $() : Q();
|
|
267
267
|
},
|
|
268
268
|
onKeyDown: (e) => {
|
|
269
|
-
e.key === "Enter" ? (e.preventDefault(), h ? $() : Q()) : e.key === "Escape" && (e.preventDefault(), A(
|
|
269
|
+
e.key === "Enter" ? (e.preventDefault(), h ? $() : Q()) : e.key === "Escape" && (e.preventDefault(), A(s), I(N(b)), R(null), g?.());
|
|
270
270
|
}
|
|
271
271
|
},
|
|
272
272
|
value: b,
|
|
@@ -278,13 +278,13 @@ function P({ value: n, defaultValue: r = null, onValueChange: i, currency: a, lo
|
|
|
278
278
|
text: P,
|
|
279
279
|
setText: I,
|
|
280
280
|
commit: Q,
|
|
281
|
-
formatted: b === null ? "" : d(b,
|
|
281
|
+
formatted: b === null ? "" : d(b, s, v),
|
|
282
282
|
conversion: _ ? {
|
|
283
|
-
home:
|
|
283
|
+
home: s,
|
|
284
284
|
locale: v,
|
|
285
285
|
currency: k,
|
|
286
286
|
foreign: j,
|
|
287
|
-
choices: _.currencies.filter((e) => e !==
|
|
287
|
+
choices: _.currencies.filter((e) => e !== s && (!M.table || e === M.table.base || e in M.table.rates)),
|
|
288
288
|
pick: ee,
|
|
289
289
|
status: M.status,
|
|
290
290
|
rate: J,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as n } from "../utils/cx.js";
|
|
4
|
+
import { useControllable as r } from "../utils/useControllable.js";
|
|
5
|
+
import { useAnchoredPopup as i } from "../utils/useAnchoredPopup.js";
|
|
6
6
|
import { useFieldProps as a } from "../field/index.js";
|
|
7
7
|
import { FIELD_SIZE as o, PICKER_MONTH as s, PICKER_NAV as c, PLACEHOLDER as l, POPUP as u, TRIGGER as d } from "../utils/styles.js";
|
|
8
8
|
import { FormValue as f } from "../utils/form-value.js";
|
|
@@ -14,7 +14,7 @@ import { useState as v } from "react";
|
|
|
14
14
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
15
|
//#region packages/month-picker/index.tsx
|
|
16
16
|
function S({ value: S, defaultValue: C = null, onValueChange: w, locale: T, min: E, max: D, id: O, className: k, disabled: A = !1, size: j = "default", placeholder: M, clearable: N = !1, clearLabel: P, name: F, style: I, ...L }) {
|
|
17
|
-
let R =
|
|
17
|
+
let R = t(), z = M ?? R.pickMonth, B = P ?? R.clear, V = e(T), [H, U, W] = r(S, C, w), [G, K] = v(() => Number((H ?? (/* @__PURE__ */ new Date()).toISOString()).slice(0, 4))), q = i({ onOpenChange: (e) => e && H && K(Number(H.slice(0, 4))) }), J = a({
|
|
18
18
|
...L,
|
|
19
19
|
id: O
|
|
20
20
|
}), Y = _(V), X = (e) => (!E || e >= E) && (!D || e <= D);
|
|
@@ -30,7 +30,7 @@ function S({ value: S, defaultValue: C = null, onValueChange: w, locale: T, min:
|
|
|
30
30
|
...q.triggerProps.style,
|
|
31
31
|
...I
|
|
32
32
|
},
|
|
33
|
-
className:
|
|
33
|
+
className: n("zen__month-picker group", d, o[j], "w-full", q.open && "border-glow/60 [--glow-border-color:transparent] shadow-glow-focus", k),
|
|
34
34
|
children: [/* @__PURE__ */ b("span", {
|
|
35
35
|
className: H ? void 0 : l,
|
|
36
36
|
children: H ? g(H, V) : z
|
|
@@ -45,7 +45,7 @@ function S({ value: S, defaultValue: C = null, onValueChange: w, locale: T, min:
|
|
|
45
45
|
...q.popupProps,
|
|
46
46
|
role: "dialog",
|
|
47
47
|
"aria-label": R.chooseMonth,
|
|
48
|
-
className:
|
|
48
|
+
className: n("zen__popover", u, "w-64 p-3"),
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ x("div", {
|
|
51
51
|
className: "mb-2 flex items-center justify-between",
|
|
@@ -73,8 +73,8 @@ function S({ value: S, defaultValue: C = null, onValueChange: w, locale: T, min:
|
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ b("div", {
|
|
75
75
|
className: "grid grid-cols-3 gap-1",
|
|
76
|
-
children: Y.map((
|
|
77
|
-
let r = `${G}-${String(
|
|
76
|
+
children: Y.map((e, t) => {
|
|
77
|
+
let r = `${G}-${String(t + 1).padStart(2, "0")}`, i = r === H;
|
|
78
78
|
return /* @__PURE__ */ b("button", {
|
|
79
79
|
type: "button",
|
|
80
80
|
disabled: !X(r),
|
|
@@ -83,8 +83,8 @@ function S({ value: S, defaultValue: C = null, onValueChange: w, locale: T, min:
|
|
|
83
83
|
onClick: () => {
|
|
84
84
|
U(r), q.setOpen(!1);
|
|
85
85
|
},
|
|
86
|
-
className:
|
|
87
|
-
children:
|
|
86
|
+
className: n(s, i && "bg-primary text-primary-foreground hover:bg-primary"),
|
|
87
|
+
children: e
|
|
88
88
|
}, r);
|
|
89
89
|
})
|
|
90
90
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as n } from "../utils/cx.js";
|
|
4
|
+
import { useControllable as r } from "../utils/useControllable.js";
|
|
5
5
|
import { FormValue as i } from "../utils/form-value.js";
|
|
6
6
|
import a, { InputGroupAddon as o, InputGroupInput as s } from "../input-group/index.js";
|
|
7
7
|
import c from "../icons/micro/minus.js";
|
|
@@ -11,7 +11,7 @@ import { useMemo as d, useRef as f, useState as p } from "react";
|
|
|
11
11
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
//#region packages/number-field/index.tsx
|
|
13
13
|
function g({ value: l, defaultValue: g = null, onValueChange: b, onValueCommit: x, min: S, max: C, step: w = 1, largeStep: T = w * 10, formatOptions: E, locale: D, name: O, size: k = "default", invalid: A, disabled: j, className: M, onFocus: N, onBlur: P, onKeyDown: F, ...I }) {
|
|
14
|
-
let L =
|
|
14
|
+
let L = t(), R = e(D), [z, B, V] = r(l, g, void 0), H = d(() => new y(R, E), [R, E]), [U, W] = p(null), G = f(!1), K = (e) => Math.min(C ?? Infinity, Math.max(S ?? -Infinity, e)), q = (e, t) => {
|
|
15
15
|
B(e), b?.(e, t);
|
|
16
16
|
}, J = (e, t) => {
|
|
17
17
|
q(e, t), x?.(e, t), G.current = !1, W(null);
|
|
@@ -29,7 +29,7 @@ function g({ value: l, defaultValue: g = null, onValueChange: b, onValueCommit:
|
|
|
29
29
|
return /* @__PURE__ */ h(a, {
|
|
30
30
|
size: k,
|
|
31
31
|
invalid: A,
|
|
32
|
-
className:
|
|
32
|
+
className: n("zen__number-field px-1", M),
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ m(o, { children: /* @__PURE__ */ m(_, {
|
|
35
35
|
label: L.decrease,
|
package/dist/pagination/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as n } from "../utils/cx.js";
|
|
4
4
|
import { buttonVariants as r } from "../button/index.js";
|
|
5
5
|
import i from "../icons/chevron-left.js";
|
|
6
6
|
import a from "../icons/chevron-right.js";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
//#region packages/pagination/index.tsx
|
|
9
9
|
function c({ page: c, count: u, onPageChange: d, href: f, renderLink: p = (e) => /* @__PURE__ */ o("a", { ...e }), siblings: m = 1, className: h, "aria-label": g }) {
|
|
10
|
-
let _ =
|
|
10
|
+
let _ = t(), v = new Intl.NumberFormat(e()), y = g ?? _.pages;
|
|
11
11
|
if (u < 2) return null;
|
|
12
|
-
let b = (
|
|
13
|
-
let a =
|
|
12
|
+
let b = (e, t, i) => {
|
|
13
|
+
let a = e < 1 || e > u, s = n(r({
|
|
14
14
|
variant: "ghost",
|
|
15
15
|
size: "icon"
|
|
16
16
|
}), "min-w-9 w-auto px-2 tabular-nums", i.current && "bg-primary/15 text-foreground shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.3),0_0_18px_-6px_oklch(var(--glow)/calc(0.6*var(--glow-k)))] hover:bg-primary/20"), c = {
|
|
@@ -20,20 +20,20 @@ function c({ page: c, count: u, onPageChange: d, href: f, renderLink: p = (e) =>
|
|
|
20
20
|
};
|
|
21
21
|
return f && !a ? p({
|
|
22
22
|
...c,
|
|
23
|
-
href: f(
|
|
24
|
-
onClick: d && (() => d(
|
|
25
|
-
children:
|
|
26
|
-
},
|
|
23
|
+
href: f(e),
|
|
24
|
+
onClick: d && (() => d(e)),
|
|
25
|
+
children: t
|
|
26
|
+
}, e) : /* @__PURE__ */ o("button", {
|
|
27
27
|
type: "button",
|
|
28
28
|
...c,
|
|
29
29
|
disabled: a,
|
|
30
|
-
onClick: () => !i.current && d?.(
|
|
31
|
-
children:
|
|
30
|
+
onClick: () => !i.current && d?.(e),
|
|
31
|
+
children: t
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ o("nav", {
|
|
35
35
|
"aria-label": y,
|
|
36
|
-
className:
|
|
36
|
+
className: n("zen__pagination", h),
|
|
37
37
|
children: /* @__PURE__ */ s("ul", {
|
|
38
38
|
className: "flex items-center gap-1",
|
|
39
39
|
children: [
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What's playing, along the bottom of the screen: a glass bar for the cover,
|
|
4
|
+
* the title, the controls and a SeekBar, laid out as you like. It sits on a
|
|
5
|
+
* TabBar beside it (in the same parent), and clears the home indicator where
|
|
6
|
+
* there's none. Its height is kept in `--zen-player-bar-height` on that
|
|
7
|
+
* parent, for the page to pad its end by. Name it with an aria-label ("Now playing"). Drive it with useMediaPlayer.
|
|
8
|
+
*/
|
|
9
|
+
export default function PlayerBar({ className, ref, ...rest }: PlayerBarProps): import('react').JSX.Element;
|
|
10
|
+
export type PlayerBarProps = ComponentProps<'section'>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/player-bar/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAU,MAAM,OAAO,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAe5E;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx as e } from "../utils/cx.js";
|
|
3
|
+
import { useMergedRefs as t } from "../utils/refs.js";
|
|
4
|
+
import { useHeightVar as n } from "../utils/useHeightVar.js";
|
|
5
|
+
import { useRef as r } from "react";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
//#region packages/player-bar/index.tsx
|
|
8
|
+
function a({ className: a, ref: o, ...s }) {
|
|
9
|
+
let c = r(null);
|
|
10
|
+
return n(c, "--zen-player-bar-height"), /* @__PURE__ */ i("section", {
|
|
11
|
+
ref: t(c, o),
|
|
12
|
+
className: e("zen__player-bar glass glass-blur glow-edge fixed inset-x-0 bottom-[var(--zen-tab-bar-height,0px)] z-40 flex items-center gap-4 rounded-none border-x-0! border-b-0! px-4 pt-3", "pb-[calc(0.75rem_+_max(0px,_env(safe-area-inset-bottom)_-_var(--zen-tab-bar-height,_0px)))]", a),
|
|
13
|
+
...s
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as default };
|
|
@@ -14,7 +14,8 @@ export default function RadioCards<V extends string>({ label, value: valueProp,
|
|
|
14
14
|
export declare function RadioCard({ value, disabled, className, style, children }: RadioCardProps): import('react').JSX.Element;
|
|
15
15
|
/** Other props (aria-*, data-*, an id) go on the cards' container, the radiogroup. */
|
|
16
16
|
export interface RadioCardsProps<V extends string> extends Omit<ComponentProps<'div'>, 'defaultValue' | 'children'> {
|
|
17
|
-
label
|
|
17
|
+
/** Shown above the cards, naming the group. Without it, give the group an aria-label or aria-labelledby. */
|
|
18
|
+
label?: string;
|
|
18
19
|
/** The chosen card, when you keep it. */
|
|
19
20
|
value?: V;
|
|
20
21
|
/** The first chosen card, when the group keeps its own. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/radio-cards/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,aAAa,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAUnG;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EACjD,KAAK,EACL,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,eAAe,CAAC,CAAC,CAAC,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/radio-cards/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,aAAa,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAUnG;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EACjD,KAAK,EACL,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,eAAe,CAAC,CAAC,CAAC,+BAmBpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAyBxF;AAED,sFAAsF;AACtF,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IAC/G,4GAA4G;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,2DAA2D;IAC3D,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -9,13 +9,13 @@ function c({ label: e, value: n, defaultValue: r, onValueChange: c, name: l, cla
|
|
|
9
9
|
let [p, m] = t(n, r, c), h = i();
|
|
10
10
|
return /* @__PURE__ */ o("div", {
|
|
11
11
|
className: "zen__radio-cards flex flex-col gap-2",
|
|
12
|
-
children: [/* @__PURE__ */ a("span", {
|
|
12
|
+
children: [e && /* @__PURE__ */ a("span", {
|
|
13
13
|
id: h,
|
|
14
14
|
className: "text-sm font-medium",
|
|
15
15
|
children: e
|
|
16
16
|
}), /* @__PURE__ */ a("div", {
|
|
17
17
|
role: "radiogroup",
|
|
18
|
-
"aria-labelledby": h,
|
|
18
|
+
"aria-labelledby": e ? h : void 0,
|
|
19
19
|
className: u,
|
|
20
20
|
...f,
|
|
21
21
|
children: /* @__PURE__ */ a(s.Provider, {
|
|
@@ -34,7 +34,7 @@ function l({ value: t, disabled: n, className: i, style: c, children: l }) {
|
|
|
34
34
|
if (!u) throw Error("<RadioCard> must be inside <RadioCards>");
|
|
35
35
|
return /* @__PURE__ */ o("label", {
|
|
36
36
|
style: c,
|
|
37
|
-
className: e("zen__radio-card border-tint/10 relative flex items-center gap-3 rounded-xl border p-2.5 text-start text-sm transition-[border-color,box-shadow] duration-200", "hover:has-enabled:border-tint/20 has-checked:border-primary/60 has-checked:shadow-[0_0_0_3px_oklch(var(--primary)/0.15)]", "has-
|
|
37
|
+
className: e("zen__radio-card border-tint/10 relative flex items-center gap-3 rounded-xl border p-2.5 text-start text-sm transition-[border-color,box-shadow] duration-200", "hover:has-enabled:border-tint/20 has-checked:border-primary/60 has-checked:shadow-[0_0_0_3px_oklch(var(--primary)/0.15)]", "has-focus-ring has-disabled:opacity-60", i),
|
|
38
38
|
children: [/* @__PURE__ */ a("input", {
|
|
39
39
|
type: "radio",
|
|
40
40
|
name: u.name,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useMessages as e } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as t } from "../utils/cx.js";
|
|
4
|
+
import { useControllable as n } from "../utils/useControllable.js";
|
|
5
5
|
import { useFormReset as r } from "../utils/form-value.js";
|
|
6
6
|
import { THUMB as i } from "../slider/index.js";
|
|
7
7
|
import { useRef as a } from "react";
|
|
8
8
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
//#region packages/range-slider/index.tsx
|
|
10
10
|
function c({ value: c, defaultValue: l, min: u = 0, max: d = 100, step: f = 1, onValueChange: p, onValueCommit: m, label: h, thumbLabels: g, valueText: _, name: v, disabled: y, className: b, style: x, ...S }) {
|
|
11
|
-
let C =
|
|
11
|
+
let C = e(), w = g ?? [C.minimum, C.maximum], [[T, E], D, O] = n(c, l ?? [u, d], p), k = a(null);
|
|
12
12
|
r(k, O);
|
|
13
13
|
let A = (e) => d > u ? (e - u) / (d - u) * 100 : 0, j = [{
|
|
14
14
|
value: T,
|
|
@@ -21,7 +21,7 @@ function c({ value: c, defaultValue: l, min: u = 0, max: d = 100, step: f = 1, o
|
|
|
21
21
|
role: "group",
|
|
22
22
|
"aria-label": h,
|
|
23
23
|
...S,
|
|
24
|
-
className:
|
|
24
|
+
className: t("zen__range-slider relative h-5 w-full", y && "opacity-50", b),
|
|
25
25
|
style: {
|
|
26
26
|
"--zen-thumb": "oklch(var(--primary))",
|
|
27
27
|
...x
|
|
@@ -30,25 +30,25 @@ function c({ value: c, defaultValue: l, min: u = 0, max: d = 100, step: f = 1, o
|
|
|
30
30
|
"aria-hidden": !0,
|
|
31
31
|
className: "absolute inset-x-0 top-1/2 h-2.5 -translate-y-1/2 rounded-full [--zen-end:right] rtl:[--zen-end:left]",
|
|
32
32
|
style: { background: `linear-gradient(to var(--zen-end), oklch(var(--muted)) ${A(T)}%, oklch(var(--primary)) ${A(T)}% ${A(E)}%, oklch(var(--muted)) ${A(E)}%)` }
|
|
33
|
-
}), j.map((
|
|
33
|
+
}), j.map((e, n) => /* @__PURE__ */ o("input", {
|
|
34
34
|
ref: n === 0 ? k : void 0,
|
|
35
35
|
type: "range",
|
|
36
36
|
name: v,
|
|
37
37
|
min: u,
|
|
38
38
|
max: d,
|
|
39
39
|
step: f,
|
|
40
|
-
value:
|
|
40
|
+
value: e.value,
|
|
41
41
|
disabled: y,
|
|
42
42
|
"aria-label": w[n],
|
|
43
|
-
"aria-valuetext": _?.(
|
|
44
|
-
onChange: (
|
|
45
|
-
let [n, r] =
|
|
43
|
+
"aria-valuetext": _?.(e.value),
|
|
44
|
+
onChange: (t) => {
|
|
45
|
+
let [n, r] = e.set(Number(t.target.value));
|
|
46
46
|
D([n, r]);
|
|
47
47
|
},
|
|
48
48
|
onPointerUp: () => m?.([T, E]),
|
|
49
49
|
onKeyUp: () => m?.([T, E]),
|
|
50
50
|
style: { zIndex: n === 0 && T > (u + d) / 2 ? 2 : 1 },
|
|
51
|
-
className:
|
|
51
|
+
className: t("pointer-events-none absolute inset-0 h-5 w-full cursor-pointer appearance-none bg-transparent outline-hidden disabled:cursor-not-allowed", "[&::-webkit-slider-runnable-track]:h-2.5 [&::-moz-range-track]:h-2.5 [&::-moz-range-track]:bg-transparent", "[&::-webkit-slider-thumb]:pointer-events-auto [&::-moz-range-thumb]:pointer-events-auto", i)
|
|
52
52
|
}, n))]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useLocale as e, useMessages as t } from "../locale-provider/index.js";
|
|
3
|
+
import { cx as n } from "../utils/cx.js";
|
|
4
|
+
import { useControllable as r } from "../utils/useControllable.js";
|
|
5
5
|
import i from "../input/index.js";
|
|
6
6
|
import { FormValue as a } from "../utils/form-value.js";
|
|
7
7
|
import o from "../chip/index.js";
|
|
@@ -21,7 +21,7 @@ function b({ value: b, defaultValue: x = {
|
|
|
21
21
|
every: 1,
|
|
22
22
|
unit: "month"
|
|
23
23
|
}, onValueChange: S, locale: C, start: w, weekStartsOn: T, label: E, name: D, className: O, ...k }) {
|
|
24
|
-
let A =
|
|
24
|
+
let A = t(), j = E ?? A.repeats, M = e(C), N = T ?? l(M), [P, F, I] = r(b, x, S), [L, R] = h(String(P.every));
|
|
25
25
|
Number(L) !== P.every && L !== "" && R(String(P.every));
|
|
26
26
|
let z = u(M), B = Array.from({ length: 7 }, (e, t) => (N + t) % 7), V = P.weekdays ?? (w ? [s(w)] : []), H = P.every !== 1, U = (e) => {
|
|
27
27
|
let t = {
|
|
@@ -31,7 +31,7 @@ function b({ value: b, defaultValue: x = {
|
|
|
31
31
|
e === "week" && w && (t.weekdays = [s(w)]), e === "month" && (t.day = w ? Number(w.slice(8)) : 1), F(t);
|
|
32
32
|
};
|
|
33
33
|
return /* @__PURE__ */ v("fieldset", {
|
|
34
|
-
className:
|
|
34
|
+
className: n("zen__repeat-picker flex flex-col gap-3", O),
|
|
35
35
|
...k,
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ _(a, {
|