@rinzai/zen 0.11.0 → 0.13.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/README.md +37 -7
- package/dist/accordion/index.d.ts +41 -0
- package/dist/accordion/index.d.ts.map +1 -0
- package/dist/accordion/index.js +81 -0
- package/dist/animated-number/index.d.ts +3 -2
- package/dist/animated-number/index.d.ts.map +1 -1
- package/dist/animated-number/index.js +40 -38
- package/dist/avatar/index.d.ts +7 -2
- package/dist/avatar/index.d.ts.map +1 -1
- package/dist/avatar/index.js +17 -11
- package/dist/backdrop/index.d.ts +4 -4
- package/dist/backdrop/index.d.ts.map +1 -1
- package/dist/backdrop/index.js +41 -39
- package/dist/badge/index.d.ts +4 -2
- package/dist/badge/index.d.ts.map +1 -1
- package/dist/badge/index.js +20 -11
- package/dist/base.css +4 -0
- package/dist/breadcrumbs/index.d.ts +1 -1
- package/dist/breadcrumbs/index.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +25 -24
- package/dist/button/index.d.ts +3 -3
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +16 -11
- package/dist/button-group/index.d.ts +13 -0
- package/dist/button-group/index.d.ts.map +1 -0
- package/dist/button-group/index.js +14 -0
- package/dist/calendar/index.d.ts +15 -8
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +97 -91
- package/dist/calendar-heatmap/index.d.ts +7 -5
- package/dist/calendar-heatmap/index.d.ts.map +1 -1
- package/dist/calendar-heatmap/index.js +32 -30
- package/dist/canvas/geometry.js +0 -1
- package/dist/canvas/index.d.ts +6 -6
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas/index.js +135 -133
- package/dist/carousel/index.d.ts +27 -0
- package/dist/carousel/index.d.ts.map +1 -0
- package/dist/carousel/index.js +162 -0
- package/dist/chart/index.d.ts +5 -4
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.js +137 -135
- package/dist/chart/palette.js +0 -1
- package/dist/checkbox/index.d.ts +3 -3
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +33 -30
- package/dist/chip/index.js +1 -1
- package/dist/code-block/index.d.ts.map +1 -1
- package/dist/code-block/index.js +27 -25
- package/dist/code-input/index.d.ts.map +1 -1
- package/dist/code-input/index.js +30 -24
- package/dist/collapse/index.d.ts +4 -3
- package/dist/collapse/index.d.ts.map +1 -1
- package/dist/collapse/index.js +42 -39
- package/dist/color-picker/index.d.ts +14 -7
- package/dist/color-picker/index.d.ts.map +1 -1
- package/dist/color-picker/index.js +139 -128
- package/dist/combobox/index.d.ts +14 -6
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.js +158 -146
- package/dist/command-palette/index.d.ts +4 -3
- package/dist/command-palette/index.d.ts.map +1 -1
- package/dist/command-palette/index.js +60 -57
- package/dist/confirm-dialog/index.d.ts +6 -7
- package/dist/confirm-dialog/index.d.ts.map +1 -1
- package/dist/confirm-dialog/index.js +20 -16
- package/dist/date-picker/index.d.ts +23 -14
- package/dist/date-picker/index.d.ts.map +1 -1
- package/dist/date-picker/index.js +109 -93
- package/dist/dialog/index.d.ts +3 -4
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +58 -55
- package/dist/disclosure/index.d.ts +8 -0
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/disclosure/index.js +31 -32
- package/dist/editable-cell/index.d.ts +4 -5
- package/dist/editable-cell/index.d.ts.map +1 -1
- package/dist/editable-cell/index.js +23 -22
- package/dist/field/index.d.ts +8 -8
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +20 -18
- package/dist/filter-bar/index.d.ts +2 -2
- package/dist/filter-bar/index.d.ts.map +1 -1
- package/dist/filter-bar/index.js +38 -36
- package/dist/header/index.d.ts +1 -1
- package/dist/header/index.d.ts.map +1 -1
- package/dist/header/index.js +13 -11
- package/dist/hover-card/index.d.ts +32 -0
- package/dist/hover-card/index.d.ts.map +1 -0
- package/dist/hover-card/index.js +84 -0
- package/dist/icon-picker/index.d.ts +16 -5
- package/dist/icon-picker/index.d.ts.map +1 -1
- package/dist/icon-picker/index.js +42 -47
- package/dist/icons/micro/plus.d.ts +3 -0
- package/dist/icons/micro/plus.d.ts.map +1 -0
- package/dist/icons/micro/plus.js +17 -0
- package/dist/index.d.ts +37 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/input/index.d.ts +5 -1
- package/dist/input/index.d.ts.map +1 -1
- package/dist/input/index.js +9 -9
- package/dist/input-group/index.d.ts +4 -1
- package/dist/input-group/index.d.ts.map +1 -1
- package/dist/input-group/index.js +14 -14
- package/dist/keypad/index.d.ts +9 -7
- package/dist/keypad/index.d.ts.map +1 -1
- package/dist/keypad/index.js +22 -19
- package/dist/lib.js +112 -97
- package/dist/load-more/index.d.ts +4 -2
- package/dist/load-more/index.d.ts.map +1 -1
- package/dist/load-more/index.js +26 -23
- package/dist/locale-provider/index.d.ts +23 -0
- package/dist/locale-provider/index.d.ts.map +1 -0
- package/dist/locale-provider/index.js +35 -0
- package/dist/menu/index.d.ts +62 -9
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +371 -128
- package/dist/meter/index.d.ts +2 -2
- package/dist/meter/index.d.ts.map +1 -1
- package/dist/meter/index.js +4 -4
- package/dist/money-input/index.d.ts +20 -10
- package/dist/money-input/index.d.ts.map +1 -1
- package/dist/money-input/index.js +199 -190
- package/dist/month-picker/index.d.ts +17 -10
- package/dist/month-picker/index.d.ts.map +1 -1
- package/dist/month-picker/index.js +97 -86
- package/dist/navigation-menu/index.d.ts +42 -0
- package/dist/navigation-menu/index.d.ts.map +1 -0
- package/dist/navigation-menu/index.js +144 -0
- package/dist/number-field/index.d.ts +34 -0
- package/dist/number-field/index.d.ts.map +1 -0
- package/dist/number-field/index.js +119 -0
- package/dist/page-header/index.d.ts +4 -3
- package/dist/page-header/index.d.ts.map +1 -1
- package/dist/page-header/index.js +2 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/index.d.ts.map +1 -1
- package/dist/pagination/index.js +35 -33
- package/dist/progress-ring/index.d.ts +4 -3
- package/dist/progress-ring/index.d.ts.map +1 -1
- package/dist/progress-ring/index.js +11 -10
- package/dist/radio-cards/index.d.ts +9 -5
- package/dist/radio-cards/index.d.ts.map +1 -1
- package/dist/radio-cards/index.js +26 -24
- package/dist/radio-group/index.d.ts +9 -8
- package/dist/radio-group/index.d.ts.map +1 -1
- package/dist/radio-group/index.js +35 -34
- package/dist/range-slider/index.d.ts +10 -4
- package/dist/range-slider/index.d.ts.map +1 -1
- package/dist/range-slider/index.js +43 -31
- package/dist/repeat-picker/index.d.ts +13 -6
- package/dist/repeat-picker/index.d.ts.map +1 -1
- package/dist/repeat-picker/index.js +73 -61
- package/dist/resizable/index.d.ts +29 -0
- package/dist/resizable/index.d.ts.map +1 -0
- package/dist/resizable/index.js +135 -0
- package/dist/segmented/index.d.ts +8 -5
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/segmented/index.js +36 -34
- package/dist/select/index.d.ts +9 -3
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.js +99 -96
- package/dist/separator/index.d.ts +14 -0
- package/dist/separator/index.d.ts.map +1 -0
- package/dist/separator/index.js +15 -0
- package/dist/side-nav/index.js +1 -1
- package/dist/skeleton/index.d.ts +4 -4
- package/dist/skeleton/index.d.ts.map +1 -1
- package/dist/skeleton/index.js +4 -3
- package/dist/slider/index.d.ts +6 -3
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +29 -23
- package/dist/sortable/index.d.ts +10 -20
- package/dist/sortable/index.d.ts.map +1 -1
- package/dist/sortable/index.js +72 -134
- package/dist/sortable/shared.d.ts +56 -0
- package/dist/sortable/shared.d.ts.map +1 -0
- package/dist/sortable/shared.js +104 -0
- package/dist/sortable/tree-model.d.ts +46 -0
- package/dist/sortable/tree-model.d.ts.map +1 -0
- package/dist/sortable/tree-model.js +87 -0
- package/dist/sortable/tree.d.ts +31 -0
- package/dist/sortable/tree.d.ts.map +1 -0
- package/dist/sortable/tree.js +150 -0
- package/dist/sparkline/index.d.ts +1 -1
- package/dist/sparkline/index.d.ts.map +1 -1
- package/dist/sparkline/index.js +26 -25
- package/dist/spinner/index.d.ts +4 -3
- package/dist/spinner/index.d.ts.map +1 -1
- package/dist/spinner/index.js +2 -1
- package/dist/status-pill/index.d.ts.map +1 -1
- package/dist/status-pill/index.js +1 -1
- package/dist/stepper/index.d.ts +1 -1
- package/dist/stepper/index.d.ts.map +1 -1
- package/dist/stepper/index.js +31 -30
- package/dist/tab-bar/index.js +1 -1
- package/dist/table/index.d.ts +5 -5
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +66 -64
- package/dist/table/selection.d.ts +2 -2
- package/dist/table/selection.d.ts.map +1 -1
- package/dist/table/selection.js +41 -38
- package/dist/table/swipe.d.ts +1 -1
- package/dist/table/swipe.d.ts.map +1 -1
- package/dist/table/swipe.js +1 -1
- package/dist/table-of-contents/index.d.ts +4 -2
- package/dist/table-of-contents/index.d.ts.map +1 -1
- package/dist/table-of-contents/index.js +27 -25
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +90 -88
- package/dist/tag-input/index.d.ts +3 -1
- package/dist/tag-input/index.d.ts.map +1 -1
- package/dist/tag-input/index.js +61 -52
- package/dist/theme-toggle/index.d.ts +9 -8
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +30 -28
- package/dist/theme.css +90 -12
- package/dist/time-field/index.d.ts +31 -0
- package/dist/time-field/index.d.ts.map +1 -0
- package/dist/time-field/index.js +175 -0
- package/dist/timeline/index.js +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +127 -125
- package/dist/toggle/index.d.ts +2 -2
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/toggle/index.js +8 -6
- package/dist/toggle-group/index.d.ts +35 -0
- package/dist/toggle-group/index.d.ts.map +1 -0
- package/dist/toggle-group/index.js +53 -0
- package/dist/toolbar/index.d.ts +19 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/toolbar/index.js +36 -0
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +40 -74
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +105 -102
- package/dist/trend/index.d.ts +2 -2
- package/dist/trend/index.d.ts.map +1 -1
- package/dist/trend/index.js +20 -19
- package/dist/utils/color.js +0 -1
- package/dist/utils/cva.js +0 -1
- package/dist/utils/cx.js +0 -1
- package/dist/utils/date.d.ts +6 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -2
- package/dist/utils/direction.d.ts +7 -0
- package/dist/utils/direction.d.ts.map +1 -0
- package/dist/utils/direction.js +6 -0
- package/dist/utils/form-value.d.ts +15 -0
- package/dist/utils/form-value.d.ts.map +1 -0
- package/dist/utils/form-value.js +29 -0
- package/dist/utils/fx.js +0 -1
- package/dist/utils/merge.js +0 -1
- package/dist/utils/messages.d.ts +137 -0
- package/dist/utils/messages.d.ts.map +1 -0
- package/dist/utils/messages.js +133 -0
- package/dist/utils/money.js +0 -1
- package/dist/utils/month.js +0 -1
- package/dist/utils/motion.js +0 -1
- package/dist/utils/refs.d.ts +6 -0
- package/dist/utils/refs.d.ts.map +1 -0
- package/dist/utils/refs.js +13 -0
- package/dist/utils/repeat.d.ts +3 -1
- package/dist/utils/repeat.d.ts.map +1 -1
- package/dist/utils/repeat.js +28 -25
- package/dist/utils/roving.d.ts +17 -0
- package/dist/utils/roving.d.ts.map +1 -0
- package/dist/utils/roving.js +35 -0
- package/dist/utils/section-link.js +0 -1
- package/dist/utils/slot.d.ts.map +1 -1
- package/dist/utils/slot.js +7 -11
- package/dist/utils/status-icons.js +7 -7
- package/dist/utils/styles.d.ts +9 -2
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/styles.js +6 -3
- package/dist/utils/theme-wave.js +0 -1
- package/dist/utils/theme.js +0 -1
- package/dist/utils/useAnchoredPopup.d.ts +7 -4
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -1
- package/dist/utils/useAnchoredPopup.js +18 -11
- package/dist/utils/useControllable.d.ts +9 -0
- package/dist/utils/useControllable.d.ts.map +1 -0
- package/dist/utils/useControllable.js +15 -0
- package/dist/utils/useHoverPopup.d.ts +39 -0
- package/dist/utils/useHoverPopup.d.ts.map +1 -0
- package/dist/utils/useHoverPopup.js +64 -0
- package/dist/zen.css +1 -1
- package/package.json +1 -1
package/dist/keypad/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx as e } from "../utils/cx.js";
|
|
3
|
-
import t from "../
|
|
4
|
-
import {
|
|
3
|
+
import { useControllable as t } from "../utils/useControllable.js";
|
|
4
|
+
import { useMessages as n } from "../locale-provider/index.js";
|
|
5
|
+
import r from "../icons/arrow-left.js";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
7
|
//#region packages/keypad/index.tsx
|
|
6
|
-
var
|
|
8
|
+
var a = [
|
|
7
9
|
"1",
|
|
8
10
|
"2",
|
|
9
11
|
"3",
|
|
@@ -17,26 +19,27 @@ var r = [
|
|
|
17
19
|
"0",
|
|
18
20
|
"back"
|
|
19
21
|
];
|
|
20
|
-
function
|
|
21
|
-
let d = (e) => {
|
|
22
|
-
if (e === "back") return
|
|
23
|
-
let t =
|
|
24
|
-
if (e === ".") return
|
|
25
|
-
t !== -1 &&
|
|
22
|
+
function o({ value: o, defaultValue: s = "", onValueChange: c, decimals: l = 2, maxLength: u = 12, deleteLabel: d, "aria-label": f, className: p, ...m }) {
|
|
23
|
+
let h = n(), g = d ?? h.delete, _ = f ?? h.keypad, [v, y] = t(o, s, c), b = (e) => {
|
|
24
|
+
if (e === "back") return y(v.slice(0, -1));
|
|
25
|
+
let t = v.indexOf(".");
|
|
26
|
+
if (e === ".") return l === 0 || t !== -1 ? void 0 : y((v || "0") + ".");
|
|
27
|
+
t !== -1 && v.length - t > l || v.length >= u || y(v === "0" ? e : v + e);
|
|
26
28
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ i("div", {
|
|
28
30
|
role: "group",
|
|
29
|
-
"aria-label":
|
|
30
|
-
className: e("zen__keypad grid grid-cols-3 gap-2",
|
|
31
|
-
|
|
31
|
+
"aria-label": _,
|
|
32
|
+
className: e("zen__keypad grid grid-cols-3 gap-2", p),
|
|
33
|
+
...m,
|
|
34
|
+
children: a.map((e) => /* @__PURE__ */ i("button", {
|
|
32
35
|
type: "button",
|
|
33
|
-
"aria-label": e === "back" ?
|
|
34
|
-
disabled: e === "." &&
|
|
35
|
-
onClick: () =>
|
|
36
|
-
className: "bg-tint/[0.05] hover:bg-tint/[0.09] focus-
|
|
37
|
-
children: e === "back" ? /* @__PURE__ */
|
|
36
|
+
"aria-label": e === "back" ? g : void 0,
|
|
37
|
+
disabled: e === "." && l === 0,
|
|
38
|
+
onClick: () => b(e),
|
|
39
|
+
className: "bg-tint/[0.05] hover:bg-tint/[0.09] focus-ring grid h-14 cursor-pointer place-items-center rounded-xl text-xl font-medium tabular-nums outline-hidden transition-[background-color,scale] duration-150 select-none active:scale-95 disabled:invisible",
|
|
40
|
+
children: e === "back" ? /* @__PURE__ */ i(r, { className: "size-5 rtl:-scale-x-100" }) : e
|
|
38
41
|
}, e))
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
//#endregion
|
|
42
|
-
export {
|
|
45
|
+
export { o as default };
|
package/dist/lib.js
CHANGED
|
@@ -1,101 +1,116 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
/* empty css */
|
|
3
2
|
import { cx as e } from "./utils/cx.js";
|
|
4
3
|
import { applyGraphicsMode as t, detectGraphicsMode as n } from "./utils/graphics.js";
|
|
5
4
|
import { useAnchoredPopup as r } from "./utils/useAnchoredPopup.js";
|
|
6
|
-
import i, {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import xe, {
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import {
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import {
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import
|
|
68
|
-
import {
|
|
69
|
-
import fn from "./table
|
|
70
|
-
import
|
|
71
|
-
import {
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import {
|
|
76
|
-
import
|
|
77
|
-
import Bn
|
|
78
|
-
import {
|
|
79
|
-
import Wn,
|
|
80
|
-
import
|
|
81
|
-
import
|
|
82
|
-
import
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import
|
|
88
|
-
import
|
|
89
|
-
import
|
|
90
|
-
import
|
|
91
|
-
import
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import {
|
|
100
|
-
import
|
|
101
|
-
|
|
5
|
+
import i, { MenuCheckboxItem as a, MenuContent as o, MenuContextTrigger as s, MenuHeader as c, MenuItem as l, MenuRadioGroup as u, MenuRadioItem as d, MenuSeparator as f, MenuSub as p, MenuSubContent as m, MenuSubTrigger as h, MenuTrigger as g, Menubar as _ } from "./menu/index.js";
|
|
6
|
+
import { ENGLISH as v } from "./utils/messages.js";
|
|
7
|
+
import y, { useLocale as b, useMessages as x } from "./locale-provider/index.js";
|
|
8
|
+
import { MoneyParseError as S, currencySymbol as C, formatAmount as w, formatMoney as T, minorDigits as E, parseMoney as D, parseMoneyInput as O } from "./utils/money.js";
|
|
9
|
+
import { reducedMotion as k } from "./utils/motion.js";
|
|
10
|
+
import A, { AnimatedMoney as j } from "./animated-number/index.js";
|
|
11
|
+
import M, { ImageCropError as N, cropImageToSquare as P } from "./avatar/index.js";
|
|
12
|
+
import F from "./backdrop/index.js";
|
|
13
|
+
import { cva as I } from "./utils/cva.js";
|
|
14
|
+
import L from "./badge/index.js";
|
|
15
|
+
import R, { StatusPillAction as z } from "./status-pill/index.js";
|
|
16
|
+
import B from "./spinner/index.js";
|
|
17
|
+
import V, { buttonVariants as H } from "./button/index.js";
|
|
18
|
+
import U, { CardDescription as W, CardHeader as G, CardTitle as K, Stat as q, StatRow as J } from "./card/index.js";
|
|
19
|
+
import { Canvas as Y, CanvasItem as X } from "./canvas/index.js";
|
|
20
|
+
import { useCopyToClipboard as Z } from "./utils/useCopyToClipboard.js";
|
|
21
|
+
import Q from "./code-block/index.js";
|
|
22
|
+
import $ from "./alert/index.js";
|
|
23
|
+
import ee, { FormMessage as te, useField as ne, useFieldProps as re } from "./field/index.js";
|
|
24
|
+
import ie from "./input/index.js";
|
|
25
|
+
import ae from "./slider/index.js";
|
|
26
|
+
import { hexToOklch as oe, oklchToHex as se } from "./utils/color.js";
|
|
27
|
+
import { FieldChevron as ce } from "./utils/field-chevron.js";
|
|
28
|
+
import le, { ColorPanel as ue } from "./color-picker/index.js";
|
|
29
|
+
import de from "./chip/index.js";
|
|
30
|
+
import fe, { PopoverClose as pe, PopoverContent as me, PopoverTrigger as he } from "./popover/index.js";
|
|
31
|
+
import ge from "./collapse/index.js";
|
|
32
|
+
import _e, { InputGroupAddon as ve, InputGroupInput as ye } from "./input-group/index.js";
|
|
33
|
+
import { useVirtualList as be } from "./utils/useVirtualList.js";
|
|
34
|
+
import xe, { ComboboxCreate as Se, ComboboxEmpty as Ce, ComboboxItem as we, ComboboxList as Te, ComboboxPopup as Ee, ComboboxSearch as De, ComboboxTrigger as Oe } from "./combobox/index.js";
|
|
35
|
+
import ke, { useToast as Ae, useToastHost as je } from "./toast/index.js";
|
|
36
|
+
import Me, { DialogClose as Ne, DialogFooter as Pe, useModal as Fe } from "./dialog/index.js";
|
|
37
|
+
import Ie from "./confirm-dialog/index.js";
|
|
38
|
+
import Le from "./editable-cell/index.js";
|
|
39
|
+
import Re, { DisclosureContent as ze, DisclosureTrigger as Be, useDisclosure as Ve } from "./disclosure/index.js";
|
|
40
|
+
import He from "./header/index.js";
|
|
41
|
+
import Ue, { AccordionContent as We, AccordionItem as Ge, AccordionTrigger as Ke } from "./accordion/index.js";
|
|
42
|
+
import qe from "./inset/index.js";
|
|
43
|
+
import Je from "./meter/index.js";
|
|
44
|
+
import { addMonths as Ye, currentMonth as Xe, formatMonth as Ze, fromMonthIndex as Qe, isMonth as $e, monthIndex as et, monthNames as tt, monthRange as nt, monthsBetween as rt } from "./utils/month.js";
|
|
45
|
+
import it from "./month-picker/index.js";
|
|
46
|
+
import at from "./checkbox/index.js";
|
|
47
|
+
import { paletteColor as ot } from "./chart/palette.js";
|
|
48
|
+
import { ChartTooltipCard as st } from "./chart/tooltip.js";
|
|
49
|
+
import ct from "./chart/allocation.js";
|
|
50
|
+
import lt from "./chart/donut.js";
|
|
51
|
+
import ut, { ChartArea as dt, ChartBar as ft, ChartLine as pt, ChartReference as mt, niceTicks as ht } from "./chart/index.js";
|
|
52
|
+
import gt, { Radio as _t } from "./radio-group/index.js";
|
|
53
|
+
import { addDays as vt, addMonthsToDate as yt, commonRanges as bt, dayIndex as xt, dayOfWeek as St, daysBetween as Ct, daysInMonth as wt, formatDate as Tt, formatDateRange as Et, fromDayIndex as Dt, isDate as Ot, today as kt, weekStart as At, weekdayNames as jt } from "./utils/date.js";
|
|
54
|
+
import { useHydrated as Mt } from "./utils/useHydrated.js";
|
|
55
|
+
import Nt from "./calendar/index.js";
|
|
56
|
+
import Pt, { DateRangePicker as Ft } from "./date-picker/index.js";
|
|
57
|
+
import { RateUnavailableError as It, convertMinor as Lt, isRateTable as Rt, rateBetween as zt } from "./utils/fx.js";
|
|
58
|
+
import Bt, { MoneyConversionHint as Vt, MoneyCurrencyMenu as Ht, useMoneyInput as Ut } from "./money-input/index.js";
|
|
59
|
+
import Wt, { RadioCard as Gt } from "./radio-cards/index.js";
|
|
60
|
+
import Kt, { Pill as qt, PillIndicator as Jt } from "./pills/index.js";
|
|
61
|
+
import Yt from "./page-header/index.js";
|
|
62
|
+
import Xt from "./progress-ring/index.js";
|
|
63
|
+
import Zt, { SegmentedItem as Qt } from "./segmented/index.js";
|
|
64
|
+
import $t, { SelectGroup as en, SelectItem as tn, SelectSeparator as nn } from "./select/index.js";
|
|
65
|
+
import rn, { SideNavGroup as an, SideNavLink as on } from "./side-nav/index.js";
|
|
66
|
+
import sn from "./skeleton/index.js";
|
|
67
|
+
import cn, { TabBarItem as ln } from "./tab-bar/index.js";
|
|
68
|
+
import { SelectionBar as un, TableSelectCell as dn, TableSelectHead as fn, useSelection as pn } from "./table/selection.js";
|
|
69
|
+
import { TableSwipeAction as mn, TableSwipeRow as hn } from "./table/swipe.js";
|
|
70
|
+
import gn, { TableBody as _n, TableCell as vn, TableContainer as yn, TableEmpty as bn, TableFooter as xn, TableFooterCell as Sn, TableHead as Cn, TableHeader as wn, TableRow as Tn, TableSpacerRow as En, useSort as Dn } from "./table/index.js";
|
|
71
|
+
import { followSectionLink as On } from "./utils/section-link.js";
|
|
72
|
+
import kn from "./table-of-contents/index.js";
|
|
73
|
+
import An, { Tab as jn, TabList as Mn, TabPanel as Nn } from "./tabs/index.js";
|
|
74
|
+
import { TreeCell as Pn, TreeLabel as Fn, TreeRow as In, TreeToggle as Ln, useTree as Rn } from "./tree/index.js";
|
|
75
|
+
import zn from "./textarea/index.js";
|
|
76
|
+
import Bn from "./toggle/index.js";
|
|
77
|
+
import Vn, { TooltipContent as Hn, TooltipTrigger as Un } from "./tooltip/index.js";
|
|
78
|
+
import { DEFAULT_THEME as Wn, INTENSITIES as Gn, PRESETS as Kn, applyPreset as qn, applyTheme as Jn, contrastRatio as Yn, customize as Xn, normalizeTheme as Zn, oklchToLinearRgb as Qn, resetTheme as $n, themeVars as er } from "./utils/theme.js";
|
|
79
|
+
import { prepareThemeWave as tr, themeWave as nr } from "./utils/theme-wave.js";
|
|
80
|
+
import rr, { ThemeScript as ir, themeScript as ar } from "./theme-toggle/index.js";
|
|
81
|
+
import or, { Breadcrumb as sr } from "./breadcrumbs/index.js";
|
|
82
|
+
import cr from "./code-input/index.js";
|
|
83
|
+
import lr, { useCommandPaletteShortcut as ur } from "./command-palette/index.js";
|
|
84
|
+
import dr from "./empty-state/index.js";
|
|
85
|
+
import fr, { accepts as pr } from "./file-drop/index.js";
|
|
86
|
+
import mr, { pageRange as hr } from "./pagination/index.js";
|
|
87
|
+
import gr from "./sparkline/index.js";
|
|
88
|
+
import _r, { Step as vr } from "./stepper/index.js";
|
|
89
|
+
import yr from "./tag-input/index.js";
|
|
90
|
+
import br, { TimelineItem as xr } from "./timeline/index.js";
|
|
91
|
+
import Sr from "./kbd/index.js";
|
|
92
|
+
import Cr from "./range-slider/index.js";
|
|
93
|
+
import wr, { FilterChip as Tr } from "./filter-bar/index.js";
|
|
94
|
+
import Er from "./keypad/index.js";
|
|
95
|
+
import Dr from "./calendar-heatmap/index.js";
|
|
96
|
+
import Or from "./trend/index.js";
|
|
97
|
+
import kr, { ICON_COLORS as Ar } from "./icon-picker/index.js";
|
|
98
|
+
import { describeRepeat as jr, nextOccurrences as Mr } from "./utils/repeat.js";
|
|
99
|
+
import Nr from "./repeat-picker/index.js";
|
|
100
|
+
import Pr from "./load-more/index.js";
|
|
101
|
+
import { SortableHandle as Fr, SortableItem as Ir } from "./sortable/shared.js";
|
|
102
|
+
import { flattenTree as Lr } from "./sortable/tree-model.js";
|
|
103
|
+
import Rr from "./sortable/tree.js";
|
|
104
|
+
import { SortableList as zr } from "./sortable/index.js";
|
|
105
|
+
import Br from "./page-transition/index.js";
|
|
106
|
+
import Vr from "./separator/index.js";
|
|
107
|
+
import Hr, { ToolbarSeparator as Ur, useInToolbar as Wr, useToolbarOrientation as Gr } from "./toolbar/index.js";
|
|
108
|
+
import Kr, { ToggleGroupItem as qr } from "./toggle-group/index.js";
|
|
109
|
+
import Jr from "./button-group/index.js";
|
|
110
|
+
import Yr, { HoverCardContent as Xr, HoverCardTrigger as Zr } from "./hover-card/index.js";
|
|
111
|
+
import Qr from "./number-field/index.js";
|
|
112
|
+
import $r from "./time-field/index.js";
|
|
113
|
+
import ei, { CarouselContent as ti, CarouselControls as ni, CarouselDots as ri, CarouselItem as ii, CarouselNext as ai, CarouselPrevious as oi } from "./carousel/index.js";
|
|
114
|
+
import si, { ResizableHandle as ci, ResizablePanel as li } from "./resizable/index.js";
|
|
115
|
+
import ui, { NavigationMenuContent as di, NavigationMenuItem as fi, NavigationMenuLink as pi, NavigationMenuTrigger as mi } from "./navigation-menu/index.js";
|
|
116
|
+
export { Ue as Accordion, We as AccordionContent, Ge as AccordionItem, Ke as AccordionTrigger, $ as Alert, ct as AllocationBar, j as AnimatedMoney, A as AnimatedNumber, M as Avatar, F as Backdrop, L as Badge, sr as Breadcrumb, or as Breadcrumbs, V as Button, Jr as ButtonGroup, Nt as Calendar, Dr as CalendarHeatmap, Y as Canvas, X as CanvasItem, U as Card, W as CardDescription, G as CardHeader, K as CardTitle, ei as Carousel, ti as CarouselContent, ni as CarouselControls, ri as CarouselDots, ii as CarouselItem, ai as CarouselNext, oi as CarouselPrevious, ut as Chart, dt as ChartArea, ft as ChartBar, pt as ChartLine, mt as ChartReference, st as ChartTooltipCard, at as Checkbox, de as Chip, Q as CodeBlock, cr as CodeInput, ge as Collapse, ue as ColorPanel, le as ColorPicker, xe as Combobox, Se as ComboboxCreate, Ce as ComboboxEmpty, we as ComboboxItem, Te as ComboboxList, Ee as ComboboxPopup, De as ComboboxSearch, Oe as ComboboxTrigger, lr as CommandPalette, Ie as ConfirmDialog, Wn as DEFAULT_THEME, Pt as DatePicker, Ft as DateRangePicker, Me as Dialog, Ne as DialogClose, Pe as DialogFooter, Re as Disclosure, ze as DisclosureContent, Be as DisclosureTrigger, lt as DonutChart, v as ENGLISH, Le as EditableCell, dr as EmptyState, ee as Field, ce as FieldChevron, fr as FileDrop, wr as FilterBar, Tr as FilterChip, te as FormMessage, He as Header, Yr as HoverCard, Xr as HoverCardContent, Zr as HoverCardTrigger, Ar as ICON_COLORS, Gn as INTENSITIES, kr as IconPicker, N as ImageCropError, ie as Input, _e as InputGroup, ve as InputGroupAddon, ye as InputGroupInput, qe as Inset, Sr as Kbd, Er as Keypad, Pr as LoadMore, y as LocaleProvider, i as Menu, a as MenuCheckboxItem, o as MenuContent, s as MenuContextTrigger, c as MenuHeader, l as MenuItem, u as MenuRadioGroup, d as MenuRadioItem, f as MenuSeparator, p as MenuSub, m as MenuSubContent, h as MenuSubTrigger, g as MenuTrigger, _ as Menubar, Je as Meter, Vt as MoneyConversionHint, Ht as MoneyCurrencyMenu, Bt as MoneyInput, S as MoneyParseError, it as MonthPicker, ui as NavigationMenu, di as NavigationMenuContent, fi as NavigationMenuItem, pi as NavigationMenuLink, mi as NavigationMenuTrigger, Qr as NumberField, Kn as PRESETS, Yt as PageHeader, Br as PageTransition, mr as Pagination, qt as Pill, Jt as PillIndicator, Kt as Pills, fe as Popover, pe as PopoverClose, me as PopoverContent, he as PopoverTrigger, Xt as ProgressRing, _t as Radio, Gt as RadioCard, Wt as RadioCards, gt as RadioGroup, Cr as RangeSlider, It as RateUnavailableError, Nr as RepeatPicker, ci as ResizableHandle, li as ResizablePanel, si as ResizablePanelGroup, Zt as Segmented, Qt as SegmentedItem, $t as Select, en as SelectGroup, tn as SelectItem, nn as SelectSeparator, un as SelectionBar, Vr as Separator, rn as SideNav, an as SideNavGroup, on as SideNavLink, sn as Skeleton, ae as Slider, Fr as SortableHandle, Ir as SortableItem, zr as SortableList, Rr as SortableTree, gr as Sparkline, B as Spinner, q as Stat, J as StatRow, R as StatusPill, z as StatusPillAction, vr as Step, _r as Stepper, jn as Tab, cn as TabBar, ln as TabBarItem, Mn as TabList, Nn as TabPanel, gn as Table, _n as TableBody, vn as TableCell, yn as TableContainer, bn as TableEmpty, xn as TableFooter, Sn as TableFooterCell, Cn as TableHead, wn as TableHeader, kn as TableOfContents, Tn as TableRow, dn as TableSelectCell, fn as TableSelectHead, En as TableSpacerRow, mn as TableSwipeAction, hn as TableSwipeRow, An as Tabs, yr as TagInput, zn as TextArea, ir as ThemeScript, rr as ThemeToggle, $r as TimeField, br as Timeline, xr as TimelineItem, ke as ToastProvider, Bn as Toggle, Kr as ToggleGroup, qr as ToggleGroupItem, Hr as Toolbar, Ur as ToolbarSeparator, Vn as Tooltip, Hn as TooltipContent, Un as TooltipTrigger, Pn as TreeCell, Fn as TreeLabel, In as TreeRow, Ln as TreeToggle, Or as Trend, pr as accepts, vt as addDays, Ye as addMonths, yt as addMonthsToDate, t as applyGraphicsMode, qn as applyPreset, Jn as applyTheme, H as buttonVariants, bt as commonRanges, Yn as contrastRatio, Lt as convertMinor, P as cropImageToSquare, C as currencySymbol, Xe as currentMonth, Xn as customize, I as cva, e as cx, xt as dayIndex, St as dayOfWeek, Ct as daysBetween, wt as daysInMonth, jr as describeRepeat, n as detectGraphicsMode, Lr as flattenTree, On as followSectionLink, w as formatAmount, Tt as formatDate, Et as formatDateRange, T as formatMoney, Ze as formatMonth, Dt as fromDayIndex, Qe as fromMonthIndex, oe as hexToOklch, Ot as isDate, $e as isMonth, Rt as isRateTable, E as minorDigits, et as monthIndex, tt as monthNames, nt as monthRange, rt as monthsBetween, Mr as nextOccurrences, ht as niceTicks, Zn as normalizeTheme, se as oklchToHex, Qn as oklchToLinearRgb, hr as pageRange, ot as paletteColor, D as parseMoney, O as parseMoneyInput, tr as prepareThemeWave, zt as rateBetween, k as reducedMotion, $n as resetTheme, ar as themeScript, er as themeVars, nr as themeWave, kt as today, r as useAnchoredPopup, ur as useCommandPaletteShortcut, Z as useCopyToClipboard, Ve as useDisclosure, ne as useField, re as useFieldProps, Mt as useHydrated, Wr as useInToolbar, b as useLocale, x as useMessages, Fe as useModal, Ut as useMoneyInput, pn as useSelection, Dn as useSort, Ae as useToast, je as useToastHost, Gr as useToolbarOrientation, Rn as useTree, be as useVirtualList, At as weekStart, jt as weekdayNames };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* The end of a long list that has more: a "Load more" button, which also
|
|
3
4
|
* presses itself when it scrolls into view (`auto`, default). While `loading`
|
|
4
5
|
* it shows a spinner and won't ask again; once there's nothing left
|
|
5
6
|
* (`hasMore` false) it's gone. Put it after the list, or in a table's last row.
|
|
6
7
|
*/
|
|
7
|
-
export default function LoadMore({ onLoadMore, hasMore, loading, auto, label, loadingLabel, className, }: LoadMoreProps): import('react').JSX.Element | null;
|
|
8
|
-
|
|
8
|
+
export default function LoadMore({ onLoadMore, hasMore, loading, auto, label: labelProp, loadingLabel: loadingLabelProp, className, ref: refProp, ...rest }: LoadMoreProps): import('react').JSX.Element | null;
|
|
9
|
+
/** Other props (data-*, an id) go on the row around the button. */
|
|
10
|
+
export interface LoadMoreProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
9
11
|
onLoadMore: () => void;
|
|
10
12
|
hasMore: boolean;
|
|
11
13
|
/** While true, it shows a spinner and won't ask for more. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/load-more/index.tsx"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC7B,UAAU,EACV,OAAO,EACP,OAAe,EACf,IAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/load-more/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC7B,UAAU,EACV,OAAO,EACP,OAAe,EACf,IAAW,EACX,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EACT,GAAG,EAAE,OAAO,EACZ,GAAG,IAAI,EACV,EAAE,aAAa,sCAuCf;AAED,mEAAmE;AACnE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC1E,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/load-more/index.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx as e } from "../utils/cx.js";
|
|
3
|
-
import t from "../
|
|
4
|
-
import n from "../
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { useMergedRefs as t } from "../utils/refs.js";
|
|
4
|
+
import { useMessages as n } from "../locale-provider/index.js";
|
|
5
|
+
import r from "../spinner/index.js";
|
|
6
|
+
import i from "../button/index.js";
|
|
7
|
+
import { useEffect as a, useRef as o } from "react";
|
|
8
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
9
|
//#region packages/load-more/index.tsx
|
|
8
|
-
function
|
|
9
|
-
let h =
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
}),
|
|
13
|
-
let e =
|
|
14
|
-
if (!
|
|
10
|
+
function u({ onLoadMore: u, hasMore: d, loading: f = !1, auto: p = !0, label: m, loadingLabel: h, className: g, ref: _, ...v }) {
|
|
11
|
+
let y = n(), b = m ?? y.loadMore, x = h ?? y.loadingMore, S = o(null), C = t(S, _), w = o(u);
|
|
12
|
+
return a(() => {
|
|
13
|
+
w.current = u;
|
|
14
|
+
}), a(() => {
|
|
15
|
+
let e = S.current;
|
|
16
|
+
if (!p || !d || f || !e || typeof IntersectionObserver > "u") return;
|
|
15
17
|
let t = new IntersectionObserver((e) => {
|
|
16
|
-
e.some((e) => e.isIntersecting) && (t.disconnect(),
|
|
18
|
+
e.some((e) => e.isIntersecting) && (t.disconnect(), w.current());
|
|
17
19
|
});
|
|
18
20
|
return t.observe(e), () => t.disconnect();
|
|
19
21
|
}, [
|
|
22
|
+
p,
|
|
20
23
|
d,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ref:
|
|
25
|
-
className: e("zen__load-more flex justify-center py-3",
|
|
26
|
-
children: /* @__PURE__ */
|
|
24
|
+
f
|
|
25
|
+
]), d ? /* @__PURE__ */ c("div", {
|
|
26
|
+
...v,
|
|
27
|
+
ref: C,
|
|
28
|
+
className: e("zen__load-more flex justify-center py-3", g),
|
|
29
|
+
children: /* @__PURE__ */ c(i, {
|
|
27
30
|
variant: "ghost",
|
|
28
31
|
size: "sm",
|
|
29
|
-
"aria-busy":
|
|
30
|
-
disabled:
|
|
31
|
-
onClick:
|
|
32
|
-
children:
|
|
32
|
+
"aria-busy": f,
|
|
33
|
+
disabled: f,
|
|
34
|
+
onClick: u,
|
|
35
|
+
children: f ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(r, { className: "size-3.5" }), x] }) : b
|
|
33
36
|
})
|
|
34
37
|
}) : null;
|
|
35
38
|
}
|
|
36
39
|
//#endregion
|
|
37
|
-
export {
|
|
40
|
+
export { u as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Messages } from '../utils/messages';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The language for everything inside: `locale` formats dates, numbers and
|
|
5
|
+
* money and picks month and weekday names and the week's first day (a
|
|
6
|
+
* component's own `locale` prop still wins), and `messages` replaces any of the
|
|
7
|
+
* words components show or announce (see ENGLISH for them all; the rest stay
|
|
8
|
+
* English). Without it, components use "en-US" and English. Nest one to change
|
|
9
|
+
* part of the page.
|
|
10
|
+
*/
|
|
11
|
+
export default function LocaleProvider({ locale, messages, children }: LocaleProviderProps): import('react').JSX.Element;
|
|
12
|
+
/** The locale from the nearest LocaleProvider ("en-US" without one), or `own` when given. */
|
|
13
|
+
export declare function useLocale(own?: string): string;
|
|
14
|
+
/** The words components use, from the nearest LocaleProvider (English without one). */
|
|
15
|
+
export declare function useMessages(): Messages;
|
|
16
|
+
export interface LocaleProviderProps {
|
|
17
|
+
/** e.g. "en-IN", "fr-FR". Defaults to the enclosing provider's, or "en-US". */
|
|
18
|
+
locale?: string;
|
|
19
|
+
/** Any of the words to replace; the others are kept. */
|
|
20
|
+
messages?: Partial<Messages>;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/locale-provider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAStE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAUzF;AAED,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED,uFAAuF;AACvF,wBAAgB,WAAW,IAAI,QAAQ,CAEtC;AAED,MAAM,WAAW,mBAAmB;IAChC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;CACvB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ENGLISH as e } from "../utils/messages.js";
|
|
3
|
+
import { createContext as t, useContext as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/locale-provider/index.tsx
|
|
6
|
+
var a = t({
|
|
7
|
+
locale: "en-US",
|
|
8
|
+
messages: e
|
|
9
|
+
});
|
|
10
|
+
function o({ locale: e, messages: t, children: o }) {
|
|
11
|
+
let s = n(a), c = r(() => ({
|
|
12
|
+
locale: e ?? s.locale,
|
|
13
|
+
messages: t ? {
|
|
14
|
+
...s.messages,
|
|
15
|
+
...t
|
|
16
|
+
} : s.messages
|
|
17
|
+
}), [
|
|
18
|
+
e,
|
|
19
|
+
t,
|
|
20
|
+
s
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ i(a.Provider, {
|
|
23
|
+
value: c,
|
|
24
|
+
children: o
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function s(e) {
|
|
28
|
+
let { locale: t } = n(a);
|
|
29
|
+
return e ?? t;
|
|
30
|
+
}
|
|
31
|
+
function c() {
|
|
32
|
+
return n(a).messages;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as default, s as useLocale, c as useMessages };
|
package/dist/menu/index.d.ts
CHANGED
|
@@ -9,16 +9,18 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
9
9
|
*/
|
|
10
10
|
export default function Menu({ onOpenChange, children }: MenuProps): import('react').JSX.Element;
|
|
11
11
|
/**
|
|
12
|
-
* The button that opens the menu
|
|
13
|
-
*
|
|
12
|
+
* The button that opens the menu (↓ or ↑ opens it at its first or last item).
|
|
13
|
+
* Give it an `aria-label` when it shows only an icon or avatar; the menu is
|
|
14
|
+
* named after it. In a Menubar it's one of the bar's items, and looks it. With
|
|
15
|
+
* `asChild`, your own button instead.
|
|
14
16
|
*/
|
|
15
|
-
export declare function MenuTrigger({ asChild, style, children, ...rest }: MenuTriggerProps): import('react').JSX.Element;
|
|
17
|
+
export declare function MenuTrigger({ asChild, style, onKeyDown, onPointerEnter, children, ...rest }: MenuTriggerProps): import('react').JSX.Element;
|
|
16
18
|
/**
|
|
17
19
|
* The menu panel: glass, below the button (above it if there's no room), lined
|
|
18
|
-
* up with its end edge by default. A context menu opens from the pointer
|
|
20
|
+
* up with its end edge by default (its start edge in a Menubar). A context menu opens from the pointer
|
|
19
21
|
* instead; name it with `aria-label`.
|
|
20
22
|
*/
|
|
21
|
-
export declare function MenuContent({ align, offset, className, style, children, ...rest }: MenuContentProps): import('react').JSX.Element;
|
|
23
|
+
export declare function MenuContent({ align, offset, ref, className, style, children, ...rest }: MenuContentProps): import('react').JSX.Element;
|
|
22
24
|
/**
|
|
23
25
|
* What a context menu is for, e.g. a row or a card: right-click (or the
|
|
24
26
|
* keyboard's menu key, or Shift+F10) opens the Menu where the pointer is, and
|
|
@@ -29,11 +31,38 @@ export declare function MenuContent({ align, offset, className, style, children,
|
|
|
29
31
|
export declare function MenuContextTrigger({ asChild, disabled, className, onContextMenu, onPointerDown, onClickCapture, children, ...rest }: MenuContextTriggerProps): import('react').JSX.Element;
|
|
30
32
|
/**
|
|
31
33
|
* One choice in a Menu: closes the menu, then runs `onSelect`. An `icon` sits
|
|
32
|
-
* before the label (muted, or red with the label when `
|
|
34
|
+
* before the label (muted, or red with the label when `tone` is negative). With
|
|
33
35
|
* `asChild`, the item's role and styles go onto your own element instead, such
|
|
34
36
|
* as a router's Link.
|
|
35
37
|
*/
|
|
36
|
-
export declare function MenuItem({ icon,
|
|
38
|
+
export declare function MenuItem({ icon, tone, onSelect, asChild, className, children, onClick, ...rest }: MenuItemProps): import('react').JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* A choice that's on or off, e.g. a column to show: choosing it flips
|
|
41
|
+
* `checked` and leaves the menu open, so several can be set at once. A tick
|
|
42
|
+
* shows while it's on.
|
|
43
|
+
*/
|
|
44
|
+
export declare function MenuCheckboxItem({ checked: checkedProp, defaultChecked, onCheckedChange, className, children, onClick, ...rest }: MenuCheckboxItemProps): import('react').JSX.Element;
|
|
45
|
+
/** One choice out of several, e.g. how to sort: put MenuRadioItems inside. Choosing one leaves the menu open. */
|
|
46
|
+
export declare function MenuRadioGroup({ value: valueProp, defaultValue, onValueChange, ...rest }: MenuRadioGroupProps): import('react').JSX.Element;
|
|
47
|
+
/** One of a MenuRadioGroup's choices; a dot marks the chosen one. */
|
|
48
|
+
export declare function MenuRadioItem({ value, className, children, onClick, ...rest }: MenuRadioItemProps): import('react').JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* A menu inside a menu, opening beside its item: on hover, or with Enter,
|
|
51
|
+
* Space or the arrow towards it; the arrow back (or Escape) closes it. Put a
|
|
52
|
+
* MenuSubTrigger and a MenuSubContent inside, in a MenuContent.
|
|
53
|
+
*/
|
|
54
|
+
export declare function MenuSub({ onOpenChange, children }: MenuProps): import('react').JSX.Element;
|
|
55
|
+
/** The item a submenu opens from; a chevron after its label points the way. */
|
|
56
|
+
export declare function MenuSubTrigger({ icon, ref, className, children, onClick, onKeyDown, onPointerEnter, onPointerLeave, style, ...rest }: MenuSubTriggerProps): import('react').JSX.Element;
|
|
57
|
+
/** The submenu's panel, beside its item (on the other side if there's no room), its first item level with it. */
|
|
58
|
+
export declare function MenuSubContent({ offset, ref, className, style, onKeyDown, onPointerEnter, onPointerLeave, children, ...rest }: MenuSubContentProps): import('react').JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* A row of menus, as at the top of an app (File, Edit, View): put a Menu for
|
|
61
|
+
* each inside, its MenuTrigger a label. One Tab stop: ←→ move between the
|
|
62
|
+
* menus, ↓ or Enter opens one; while one is open, ←→ open the one beside it
|
|
63
|
+
* and pointing at another switches to it. Name it with `aria-label`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function Menubar({ ref, className, onKeyDown, children, ...rest }: MenubarProps): import('react').JSX.Element;
|
|
37
66
|
/** A hairline between groups of items. */
|
|
38
67
|
export declare function MenuSeparator({ className }: {
|
|
39
68
|
className?: string;
|
|
@@ -64,11 +93,35 @@ export interface MenuContentProps extends ComponentProps<'div'> {
|
|
|
64
93
|
export interface MenuItemProps extends Omit<ComponentProps<'button'>, 'onSelect'> {
|
|
65
94
|
/** Shown before the label; size it yourself (e.g. size-4). */
|
|
66
95
|
icon?: ReactNode;
|
|
67
|
-
/**
|
|
68
|
-
|
|
96
|
+
/** `negative` for a destructive choice: red. */
|
|
97
|
+
tone?: 'default' | 'negative';
|
|
69
98
|
/** Runs after the menu closes. */
|
|
70
99
|
onSelect?: () => void;
|
|
71
100
|
/** Put the item's role and styles on the single child element (a link) instead of a button. */
|
|
72
101
|
asChild?: boolean;
|
|
73
102
|
}
|
|
103
|
+
export interface MenuCheckboxItemProps extends ComponentProps<'button'> {
|
|
104
|
+
/** On (ticked); give it to control the item, or `defaultChecked` to start it. */
|
|
105
|
+
checked?: boolean;
|
|
106
|
+
defaultChecked?: boolean;
|
|
107
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
108
|
+
}
|
|
109
|
+
export interface MenuRadioGroupProps extends Omit<ComponentProps<'div'>, 'defaultValue'> {
|
|
110
|
+
/** The chosen item's `value`; give it to control the group, or `defaultValue` to start it. */
|
|
111
|
+
value?: string | null;
|
|
112
|
+
defaultValue?: string | null;
|
|
113
|
+
onValueChange?: (value: string) => void;
|
|
114
|
+
}
|
|
115
|
+
export interface MenuRadioItemProps extends Omit<ComponentProps<'button'>, 'value'> {
|
|
116
|
+
value: string;
|
|
117
|
+
}
|
|
118
|
+
export interface MenuSubTriggerProps extends ComponentProps<'button'> {
|
|
119
|
+
/** Shown before the label; size it yourself (e.g. size-4). */
|
|
120
|
+
icon?: ReactNode;
|
|
121
|
+
}
|
|
122
|
+
export interface MenuSubContentProps extends ComponentProps<'div'> {
|
|
123
|
+
/** Gap between the item and the submenu, in px (counting the menu's own padding). */
|
|
124
|
+
offset?: number;
|
|
125
|
+
}
|
|
126
|
+
export type MenubarProps = ComponentProps<'div'>;
|
|
74
127
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/menu/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/menu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/menu/index.tsx"],"names":[],"mappings":"AAYA,OAAO,EACH,cAAc,EAKd,SAAS,EAQZ,MAAM,OAAO,CAAC;AAsCf;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,SAAS,+BA2EjE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,+BAoC7G;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAA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