@serendie/ui 2.1.3 → 2.2.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/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { raf as B, contains as
|
|
2
|
-
import { trackInteractOutside as
|
|
3
|
-
import { isFunction as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { raf as B, contains as f, getDocument as k, waitForElement as A, setStyle as N, addDomEvent as T, isHTMLElement as x, getEventTarget as m } from "../../dom-query/dist/index.js";
|
|
2
|
+
import { trackInteractOutside as q } from "../../interact-outside/dist/index.js";
|
|
3
|
+
import { isFunction as v, warn as P } from "../../utils/dist/index.js";
|
|
4
|
+
function S(e, t) {
|
|
5
|
+
const n = (r) => {
|
|
6
6
|
r.key === "Escape" && (r.isComposing || t == null || t(r));
|
|
7
7
|
};
|
|
8
|
-
return
|
|
8
|
+
return T(k(e), "keydown", n, { capture: !0 });
|
|
9
9
|
}
|
|
10
|
-
var c = {
|
|
10
|
+
var E = "layer:request-dismiss", c = {
|
|
11
11
|
layers: [],
|
|
12
12
|
branches: [],
|
|
13
13
|
count() {
|
|
@@ -24,8 +24,8 @@ var c = {
|
|
|
24
24
|
},
|
|
25
25
|
isBelowPointerBlockingLayer(e) {
|
|
26
26
|
var r;
|
|
27
|
-
const t = this.indexOf(e),
|
|
28
|
-
return t <
|
|
27
|
+
const t = this.indexOf(e), n = this.topMostPointerBlockingLayer() ? this.indexOf((r = this.topMostPointerBlockingLayer()) == null ? void 0 : r.node) : -1;
|
|
28
|
+
return t < n;
|
|
29
29
|
},
|
|
30
30
|
isTopMost(e) {
|
|
31
31
|
const t = this.layers[this.count() - 1];
|
|
@@ -35,38 +35,60 @@ var c = {
|
|
|
35
35
|
return Array.from(this.layers).slice(this.indexOf(e) + 1);
|
|
36
36
|
},
|
|
37
37
|
isInNestedLayer(e, t) {
|
|
38
|
-
return this.getNestedLayers(e).some((
|
|
38
|
+
return this.getNestedLayers(e).some((n) => f(n.node, t));
|
|
39
39
|
},
|
|
40
40
|
isInBranch(e) {
|
|
41
|
-
return Array.from(this.branches).some((t) =>
|
|
41
|
+
return Array.from(this.branches).some((t) => f(t, e));
|
|
42
42
|
},
|
|
43
43
|
add(e) {
|
|
44
|
-
|
|
45
|
-
e.node.style.setProperty("--layer-index", `${t}`);
|
|
44
|
+
this.layers.push(e), this.syncLayerIndex();
|
|
46
45
|
},
|
|
47
46
|
addBranch(e) {
|
|
48
47
|
this.branches.push(e);
|
|
49
48
|
},
|
|
50
49
|
remove(e) {
|
|
51
50
|
const t = this.indexOf(e);
|
|
52
|
-
t < 0 || (t < this.count() - 1 && this.getNestedLayers(e).forEach((r) =>
|
|
51
|
+
t < 0 || (t < this.count() - 1 && this.getNestedLayers(e).forEach((r) => c.dismiss(r.node, e)), this.layers.splice(t, 1), this.syncLayerIndex());
|
|
53
52
|
},
|
|
54
53
|
removeBranch(e) {
|
|
55
54
|
const t = this.branches.indexOf(e);
|
|
56
55
|
t >= 0 && this.branches.splice(t, 1);
|
|
57
56
|
},
|
|
57
|
+
syncLayerIndex() {
|
|
58
|
+
this.layers.forEach((e, t) => {
|
|
59
|
+
e.node.style.setProperty("--layer-index", `${t}`);
|
|
60
|
+
});
|
|
61
|
+
},
|
|
58
62
|
indexOf(e) {
|
|
59
63
|
return this.layers.findIndex((t) => t.node === e);
|
|
60
64
|
},
|
|
61
|
-
dismiss(e) {
|
|
62
|
-
|
|
63
|
-
(
|
|
65
|
+
dismiss(e, t) {
|
|
66
|
+
const n = this.indexOf(e);
|
|
67
|
+
if (n === -1) return;
|
|
68
|
+
const r = this.layers[n];
|
|
69
|
+
C(e, E, (a) => {
|
|
70
|
+
var s;
|
|
71
|
+
(s = r.requestDismiss) == null || s.call(r, a), a.defaultPrevented || r == null || r.dismiss();
|
|
72
|
+
}), _(e, E, {
|
|
73
|
+
originalLayer: e,
|
|
74
|
+
targetLayer: t,
|
|
75
|
+
originalIndex: n,
|
|
76
|
+
targetIndex: t ? this.indexOf(t) : -1
|
|
77
|
+
}), this.syncLayerIndex();
|
|
64
78
|
},
|
|
65
79
|
clear() {
|
|
66
80
|
this.remove(this.layers[0].node);
|
|
67
81
|
}
|
|
68
|
-
}
|
|
69
|
-
function
|
|
82
|
+
};
|
|
83
|
+
function _(e, t, n) {
|
|
84
|
+
const r = e.ownerDocument.defaultView || window, a = new r.CustomEvent(t, { cancelable: !0, bubbles: !0, detail: n });
|
|
85
|
+
return e.dispatchEvent(a);
|
|
86
|
+
}
|
|
87
|
+
function C(e, t, n) {
|
|
88
|
+
e.addEventListener(t, n, { once: !0 });
|
|
89
|
+
}
|
|
90
|
+
var b;
|
|
91
|
+
function L() {
|
|
70
92
|
c.layers.forEach(({ node: e }) => {
|
|
71
93
|
e.style.pointerEvents = c.isBelowPointerBlockingLayer(e) ? "none" : "auto";
|
|
72
94
|
});
|
|
@@ -74,90 +96,93 @@ function E() {
|
|
|
74
96
|
function K(e) {
|
|
75
97
|
e.style.pointerEvents = "";
|
|
76
98
|
}
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})), t) {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
function R(e, t) {
|
|
100
|
+
const n = k(e), r = [];
|
|
101
|
+
return c.hasPointerBlockingLayer() && !n.body.hasAttribute("data-inert") && (b = document.body.style.pointerEvents, queueMicrotask(() => {
|
|
102
|
+
n.body.style.pointerEvents = "none", n.body.setAttribute("data-inert", "");
|
|
103
|
+
})), t == null || t.forEach((a) => {
|
|
104
|
+
const [s, h] = A(
|
|
105
|
+
() => {
|
|
106
|
+
const d = a();
|
|
107
|
+
return x(d) ? d : null;
|
|
108
|
+
},
|
|
109
|
+
{ timeout: 1e3 }
|
|
110
|
+
);
|
|
111
|
+
s.then((d) => r.push(N(d, { pointerEvents: "auto" }))), r.push(h);
|
|
112
|
+
}), () => {
|
|
88
113
|
c.hasPointerBlockingLayer() || (queueMicrotask(() => {
|
|
89
|
-
|
|
114
|
+
n.body.style.pointerEvents = b, n.body.removeAttribute("data-inert"), n.body.style.length === 0 && n.body.removeAttribute("style");
|
|
90
115
|
}), r.forEach((a) => a()));
|
|
91
116
|
};
|
|
92
117
|
}
|
|
93
|
-
function
|
|
94
|
-
const { warnOnMissingNode:
|
|
95
|
-
if (
|
|
96
|
-
|
|
118
|
+
function j(e, t) {
|
|
119
|
+
const { warnOnMissingNode: n = !0 } = t;
|
|
120
|
+
if (n && !e) {
|
|
121
|
+
P("[@zag-js/dismissable] node is `null` or `undefined`");
|
|
97
122
|
return;
|
|
98
123
|
}
|
|
99
124
|
if (!e)
|
|
100
125
|
return;
|
|
101
|
-
const { onDismiss: r,
|
|
102
|
-
c.add(
|
|
103
|
-
function
|
|
126
|
+
const { onDismiss: r, onRequestDismiss: a, pointerBlocking: s, exclude: h, debug: d } = t, w = { dismiss: r, node: e, pointerBlocking: s, requestDismiss: a };
|
|
127
|
+
c.add(w), L();
|
|
128
|
+
function I(i) {
|
|
104
129
|
var u, l;
|
|
105
|
-
const o =
|
|
106
|
-
c.isBelowPointerBlockingLayer(e) || c.isInBranch(o) || ((u = t.onPointerDownOutside) == null || u.call(t,
|
|
130
|
+
const o = m(i.detail.originalEvent);
|
|
131
|
+
c.isBelowPointerBlockingLayer(e) || c.isInBranch(o) || ((u = t.onPointerDownOutside) == null || u.call(t, i), (l = t.onInteractOutside) == null || l.call(t, i), !i.defaultPrevented && (d && console.log("onPointerDownOutside:", i.detail.originalEvent), r == null || r()));
|
|
107
132
|
}
|
|
108
|
-
function
|
|
133
|
+
function O(i) {
|
|
109
134
|
var u, l;
|
|
110
|
-
const o =
|
|
111
|
-
c.isInBranch(o) || ((u = t.onFocusOutside) == null || u.call(t,
|
|
135
|
+
const o = m(i.detail.originalEvent);
|
|
136
|
+
c.isInBranch(o) || ((u = t.onFocusOutside) == null || u.call(t, i), (l = t.onInteractOutside) == null || l.call(t, i), !i.defaultPrevented && (d && console.log("onFocusOutside:", i.detail.originalEvent), r == null || r()));
|
|
112
137
|
}
|
|
113
|
-
function
|
|
138
|
+
function p(i) {
|
|
114
139
|
var o;
|
|
115
|
-
c.isTopMost(e) && ((o = t.onEscapeKeyDown) == null || o.call(t,
|
|
140
|
+
c.isTopMost(e) && ((o = t.onEscapeKeyDown) == null || o.call(t, i), !i.defaultPrevented && r && (i.preventDefault(), r()));
|
|
116
141
|
}
|
|
117
|
-
function
|
|
118
|
-
var
|
|
142
|
+
function D(i) {
|
|
143
|
+
var g;
|
|
119
144
|
if (!e) return !1;
|
|
120
|
-
const o = typeof
|
|
121
|
-
return l && u.push(...l), u.some((
|
|
145
|
+
const o = typeof h == "function" ? h() : h, u = Array.isArray(o) ? o : [o], l = (g = t.persistentElements) == null ? void 0 : g.map((y) => y()).filter(x);
|
|
146
|
+
return l && u.push(...l), u.some((y) => f(y, i)) || c.isInNestedLayer(e, i);
|
|
122
147
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
148
|
+
const M = [
|
|
149
|
+
s ? R(e, t.persistentElements) : void 0,
|
|
150
|
+
S(e, p),
|
|
151
|
+
q(e, { exclude: D, onFocusOutside: O, onPointerDownOutside: I, defer: t.defer })
|
|
127
152
|
];
|
|
128
153
|
return () => {
|
|
129
|
-
c.remove(e),
|
|
154
|
+
c.remove(e), L(), K(e), M.forEach((i) => i == null ? void 0 : i());
|
|
130
155
|
};
|
|
131
156
|
}
|
|
132
|
-
function
|
|
133
|
-
const { defer:
|
|
157
|
+
function H(e, t) {
|
|
158
|
+
const { defer: n } = t, r = n ? B : (s) => s(), a = [];
|
|
134
159
|
return a.push(
|
|
135
160
|
r(() => {
|
|
136
|
-
const
|
|
137
|
-
a.push(
|
|
161
|
+
const s = v(e) ? e() : e;
|
|
162
|
+
a.push(j(s, t));
|
|
138
163
|
})
|
|
139
164
|
), () => {
|
|
140
|
-
a.forEach((
|
|
165
|
+
a.forEach((s) => s == null ? void 0 : s());
|
|
141
166
|
};
|
|
142
167
|
}
|
|
143
|
-
function
|
|
144
|
-
const { defer:
|
|
168
|
+
function Q(e, t = {}) {
|
|
169
|
+
const { defer: n } = t, r = n ? B : (s) => s(), a = [];
|
|
145
170
|
return a.push(
|
|
146
171
|
r(() => {
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
|
|
172
|
+
const s = v(e) ? e() : e;
|
|
173
|
+
if (!s) {
|
|
174
|
+
P("[@zag-js/dismissable] branch node is `null` or `undefined`");
|
|
150
175
|
return;
|
|
151
176
|
}
|
|
152
|
-
c.addBranch(
|
|
153
|
-
c.removeBranch(
|
|
177
|
+
c.addBranch(s), a.push(() => {
|
|
178
|
+
c.removeBranch(s);
|
|
154
179
|
});
|
|
155
180
|
})
|
|
156
181
|
), () => {
|
|
157
|
-
a.forEach((
|
|
182
|
+
a.forEach((s) => s == null ? void 0 : s());
|
|
158
183
|
};
|
|
159
184
|
}
|
|
160
185
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
186
|
+
Q as trackDismissableBranch,
|
|
187
|
+
H as trackDismissableElement
|
|
163
188
|
};
|