@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,86 +1,86 @@
|
|
|
1
|
-
import { createScope as Y, MachineStatus as V, INIT_STATE as
|
|
2
|
-
import { mergeProps as
|
|
1
|
+
import { createScope as Y, MachineStatus as V, INIT_STATE as L } from "../../core/dist/index.js";
|
|
2
|
+
import { mergeProps as bt } from "../../core/dist/index.js";
|
|
3
3
|
import { compact as Z, ensure as h, identity as tt, isFunction as j, warn as H, toArray as et, isString as rt } from "../../utils/dist/index.js";
|
|
4
|
-
import { useMemo as nt, useRef as
|
|
5
|
-
import { flushSync as
|
|
4
|
+
import { useMemo as nt, useRef as d, useLayoutEffect as ut, useEffect as w, useState as K } from "react";
|
|
5
|
+
import { flushSync as O } from "react-dom";
|
|
6
6
|
import { createNormalizer as ot } from "../../types/dist/index.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
var U = typeof globalThis.document < "u" ? ut : w;
|
|
9
|
-
function
|
|
10
|
-
const o = t().value ?? t().defaultValue,
|
|
11
|
-
|
|
12
|
-
const R =
|
|
9
|
+
function $(t) {
|
|
10
|
+
const o = t().value ?? t().defaultValue, s = t().isEqual ?? Object.is, [l] = K(o), [S, b] = K(l), z = t().value !== void 0, y = d(S);
|
|
11
|
+
y.current = z ? t().value : S;
|
|
12
|
+
const R = d(y.current);
|
|
13
13
|
U(() => {
|
|
14
|
-
R.current =
|
|
15
|
-
}, [
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
t().debug && console.log(`[bindable > ${t().debug}] setValue`, { next:
|
|
14
|
+
R.current = y.current;
|
|
15
|
+
}, [S, t().value]);
|
|
16
|
+
const E = (g) => {
|
|
17
|
+
var M, m;
|
|
18
|
+
const i = R.current, f = j(g) ? g(i) : g;
|
|
19
|
+
t().debug && console.log(`[bindable > ${t().debug}] setValue`, { next: f, prev: i }), z || b(f), s(f, i) || (m = (M = t()).onChange) == null || m.call(M, f, i);
|
|
20
20
|
};
|
|
21
21
|
function C() {
|
|
22
|
-
return z ? t().value :
|
|
22
|
+
return z ? t().value : S;
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
|
-
initial:
|
|
26
|
-
ref:
|
|
25
|
+
initial: l,
|
|
26
|
+
ref: y,
|
|
27
27
|
get: C,
|
|
28
|
-
set(
|
|
29
|
-
(t().sync ?
|
|
28
|
+
set(g) {
|
|
29
|
+
(t().sync ? O : tt)(() => E(g));
|
|
30
30
|
},
|
|
31
|
-
invoke(
|
|
32
|
-
var
|
|
33
|
-
(
|
|
31
|
+
invoke(g, i) {
|
|
32
|
+
var f, M;
|
|
33
|
+
(M = (f = t()).onChange) == null || M.call(f, g, i);
|
|
34
34
|
},
|
|
35
|
-
hash(
|
|
36
|
-
var
|
|
37
|
-
return ((
|
|
35
|
+
hash(g) {
|
|
36
|
+
var i, f;
|
|
37
|
+
return ((f = (i = t()).hash) == null ? void 0 : f.call(i, g)) ?? String(g);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
$.cleanup = (t) => {
|
|
42
42
|
w(() => t, []);
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
const o =
|
|
44
|
+
$.ref = (t) => {
|
|
45
|
+
const o = d(t);
|
|
46
46
|
return {
|
|
47
47
|
get: () => o.current,
|
|
48
|
-
set: (
|
|
49
|
-
o.current =
|
|
48
|
+
set: (s) => {
|
|
49
|
+
o.current = s;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
const o =
|
|
53
|
+
function ct(t) {
|
|
54
|
+
const o = d(t);
|
|
55
55
|
return {
|
|
56
|
-
get(
|
|
57
|
-
return o.current[
|
|
56
|
+
get(s) {
|
|
57
|
+
return o.current[s];
|
|
58
58
|
},
|
|
59
|
-
set(
|
|
60
|
-
o.current[
|
|
59
|
+
set(s, l) {
|
|
60
|
+
o.current[s] = l;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
const
|
|
64
|
+
var st = (t, o) => {
|
|
65
|
+
const s = d(!1), l = d(!1);
|
|
66
66
|
w(() => {
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
}, [...(t ?? []).map((
|
|
70
|
-
|
|
67
|
+
if (s.current && l.current) return o();
|
|
68
|
+
l.current = !0;
|
|
69
|
+
}, [...(t ?? []).map((S) => typeof S == "function" ? S() : S)]), w(() => (s.current = !0, () => {
|
|
70
|
+
s.current = !1;
|
|
71
71
|
}), []);
|
|
72
72
|
};
|
|
73
|
-
function
|
|
73
|
+
function vt(t, o = {}) {
|
|
74
74
|
var P, _, D, G;
|
|
75
|
-
const
|
|
75
|
+
const s = nt(() => {
|
|
76
76
|
const { id: r, ids: e, getRootNode: n } = o;
|
|
77
77
|
return Y({ id: r, ids: e, getRootNode: n });
|
|
78
|
-
}, [o]),
|
|
78
|
+
}, [o]), l = (...r) => {
|
|
79
79
|
t.debug && console.log(...r);
|
|
80
|
-
},
|
|
81
|
-
prop:
|
|
82
|
-
bindable:
|
|
83
|
-
scope:
|
|
80
|
+
}, S = ((P = t.props) == null ? void 0 : P.call(t, { props: Z(o), scope: s })) ?? o, b = it(S), z = (_ = t.context) == null ? void 0 : _.call(t, {
|
|
81
|
+
prop: b,
|
|
82
|
+
bindable: $,
|
|
83
|
+
scope: s,
|
|
84
84
|
flush: Q,
|
|
85
85
|
getContext() {
|
|
86
86
|
return R;
|
|
@@ -90,34 +90,37 @@ function St(t, o = {}) {
|
|
|
90
90
|
},
|
|
91
91
|
getRefs() {
|
|
92
92
|
return m;
|
|
93
|
+
},
|
|
94
|
+
getEvent() {
|
|
95
|
+
return f();
|
|
93
96
|
}
|
|
94
|
-
}),
|
|
97
|
+
}), y = W(z), R = {
|
|
95
98
|
get(r) {
|
|
96
99
|
var e;
|
|
97
|
-
return (e =
|
|
100
|
+
return (e = y.current) == null ? void 0 : e[r].ref.current;
|
|
98
101
|
},
|
|
99
102
|
set(r, e) {
|
|
100
103
|
var n;
|
|
101
|
-
(n =
|
|
104
|
+
(n = y.current) == null || n[r].set(e);
|
|
102
105
|
},
|
|
103
106
|
initial(r) {
|
|
104
107
|
var e;
|
|
105
|
-
return (e =
|
|
108
|
+
return (e = y.current) == null ? void 0 : e[r].initial;
|
|
106
109
|
},
|
|
107
110
|
hash(r) {
|
|
108
111
|
var n, u;
|
|
109
|
-
const e = (n =
|
|
110
|
-
return (u =
|
|
112
|
+
const e = (n = y.current) == null ? void 0 : n[r].get();
|
|
113
|
+
return (u = y.current) == null ? void 0 : u[r].hash(e);
|
|
111
114
|
}
|
|
112
|
-
},
|
|
113
|
-
...
|
|
115
|
+
}, E = d(/* @__PURE__ */ new Map()), C = d(null), g = d(null), i = d({ type: "" }), f = () => ({
|
|
116
|
+
...i.current,
|
|
114
117
|
current() {
|
|
115
|
-
return
|
|
118
|
+
return i.current;
|
|
116
119
|
},
|
|
117
120
|
previous() {
|
|
118
|
-
return
|
|
121
|
+
return g.current;
|
|
119
122
|
}
|
|
120
|
-
}),
|
|
123
|
+
}), M = () => ({
|
|
121
124
|
...p,
|
|
122
125
|
matches(...r) {
|
|
123
126
|
return r.includes(p.ref.current);
|
|
@@ -126,141 +129,141 @@ function St(t, o = {}) {
|
|
|
126
129
|
var e, n;
|
|
127
130
|
return !!((n = (e = t.states[p.ref.current]) == null ? void 0 : e.tags) != null && n.includes(r));
|
|
128
131
|
}
|
|
129
|
-
}), m =
|
|
130
|
-
state:
|
|
132
|
+
}), m = ct(((D = t.refs) == null ? void 0 : D.call(t, { prop: b, context: R })) ?? {}), N = () => ({
|
|
133
|
+
state: M(),
|
|
131
134
|
context: R,
|
|
132
|
-
event:
|
|
133
|
-
prop:
|
|
135
|
+
event: f(),
|
|
136
|
+
prop: b,
|
|
134
137
|
send: B,
|
|
135
138
|
action: q,
|
|
136
139
|
guard: A,
|
|
137
|
-
track:
|
|
140
|
+
track: st,
|
|
138
141
|
refs: m,
|
|
139
142
|
computed: k,
|
|
140
143
|
flush: Q,
|
|
141
|
-
scope:
|
|
144
|
+
scope: s,
|
|
142
145
|
choose: I
|
|
143
146
|
}), q = (r) => {
|
|
144
|
-
const e = j(r) ? r(
|
|
147
|
+
const e = j(r) ? r(N()) : r;
|
|
145
148
|
if (!e) return;
|
|
146
149
|
const n = e.map((u) => {
|
|
147
|
-
var
|
|
148
|
-
const
|
|
149
|
-
return
|
|
150
|
+
var a, x;
|
|
151
|
+
const c = (x = (a = t.implementations) == null ? void 0 : a.actions) == null ? void 0 : x[u];
|
|
152
|
+
return c || H(`[zag-js] No implementation found for action "${JSON.stringify(u)}"`), c;
|
|
150
153
|
});
|
|
151
154
|
for (const u of n)
|
|
152
|
-
u == null || u(
|
|
155
|
+
u == null || u(N());
|
|
153
156
|
}, A = (r) => {
|
|
154
157
|
var e, n;
|
|
155
|
-
return j(r) ? r(
|
|
158
|
+
return j(r) ? r(N()) : (n = (e = t.implementations) == null ? void 0 : e.guards) == null ? void 0 : n[r](N());
|
|
156
159
|
}, F = (r) => {
|
|
157
|
-
const e = j(r) ? r(
|
|
160
|
+
const e = j(r) ? r(N()) : r;
|
|
158
161
|
if (!e) return;
|
|
159
|
-
const n = e.map((
|
|
160
|
-
var x,
|
|
161
|
-
const
|
|
162
|
-
return
|
|
162
|
+
const n = e.map((c) => {
|
|
163
|
+
var x, v;
|
|
164
|
+
const a = (v = (x = t.implementations) == null ? void 0 : x.effects) == null ? void 0 : v[c];
|
|
165
|
+
return a || H(`[zag-js] No implementation found for effect "${JSON.stringify(c)}"`), a;
|
|
163
166
|
}), u = [];
|
|
164
|
-
for (const
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
+
for (const c of n) {
|
|
168
|
+
const a = c == null ? void 0 : c(N());
|
|
169
|
+
a && u.push(a);
|
|
167
170
|
}
|
|
168
|
-
return () => u.forEach((
|
|
171
|
+
return () => u.forEach((c) => c == null ? void 0 : c());
|
|
169
172
|
}, I = (r) => et(r).find((e) => {
|
|
170
173
|
let n = !e.guard;
|
|
171
|
-
return rt(e.guard) ? n = !!A(e.guard) : j(e.guard) && (n = e.guard(
|
|
174
|
+
return rt(e.guard) ? n = !!A(e.guard) : j(e.guard) && (n = e.guard(N())), n;
|
|
172
175
|
}), k = (r) => {
|
|
173
176
|
h(t.computed, () => "[zag-js] No computed object found on machine");
|
|
174
177
|
const e = t.computed[r];
|
|
175
178
|
return e({
|
|
176
179
|
context: R,
|
|
177
|
-
event:
|
|
178
|
-
prop:
|
|
180
|
+
event: f(),
|
|
181
|
+
prop: b,
|
|
179
182
|
refs: m,
|
|
180
|
-
scope:
|
|
183
|
+
scope: s,
|
|
181
184
|
computed: k
|
|
182
185
|
});
|
|
183
|
-
}, p =
|
|
184
|
-
defaultValue: t.initialState({ prop:
|
|
186
|
+
}, p = $(() => ({
|
|
187
|
+
defaultValue: t.initialState({ prop: b }),
|
|
185
188
|
onChange(r, e) {
|
|
186
|
-
var u,
|
|
189
|
+
var u, c, a, x;
|
|
187
190
|
if (e) {
|
|
188
|
-
const
|
|
189
|
-
|
|
191
|
+
const v = E.current.get(e);
|
|
192
|
+
v == null || v(), E.current.delete(e);
|
|
190
193
|
}
|
|
191
|
-
e && q((u = t.states[e]) == null ? void 0 : u.exit), q((
|
|
192
|
-
const n = F((
|
|
193
|
-
if (n &&
|
|
194
|
+
e && q((u = t.states[e]) == null ? void 0 : u.exit), q((c = C.current) == null ? void 0 : c.actions);
|
|
195
|
+
const n = F((a = t.states[r]) == null ? void 0 : a.effects);
|
|
196
|
+
if (n && E.current.set(r, n), e === L) {
|
|
194
197
|
q(t.entry);
|
|
195
|
-
const
|
|
196
|
-
|
|
198
|
+
const v = F(t.effects);
|
|
199
|
+
v && E.current.set(L, v);
|
|
197
200
|
}
|
|
198
201
|
q((x = t.states[r]) == null ? void 0 : x.entry);
|
|
199
202
|
}
|
|
200
|
-
})), J =
|
|
203
|
+
})), J = d(void 0), T = d(V.NotStarted);
|
|
201
204
|
U(() => {
|
|
202
205
|
queueMicrotask(() => {
|
|
203
206
|
const n = T.current === V.Started;
|
|
204
|
-
T.current = V.Started,
|
|
207
|
+
T.current = V.Started, l(n ? "rehydrating..." : "initializing...");
|
|
205
208
|
const u = J.current ?? p.initial;
|
|
206
|
-
p.invoke(u, n ? p.get() :
|
|
209
|
+
p.invoke(u, n ? p.get() : L);
|
|
207
210
|
});
|
|
208
|
-
const r =
|
|
211
|
+
const r = E.current, e = p.ref.current;
|
|
209
212
|
return () => {
|
|
210
|
-
|
|
213
|
+
l("unmounting..."), J.current = e, T.current = V.Stopped, r.forEach((n) => n == null ? void 0 : n()), E.current = /* @__PURE__ */ new Map(), C.current = null, queueMicrotask(() => {
|
|
211
214
|
q(t.exit);
|
|
212
215
|
});
|
|
213
216
|
};
|
|
214
217
|
}, []);
|
|
215
218
|
const X = () => "ref" in p ? p.ref.current : p.get(), B = (r) => {
|
|
216
219
|
queueMicrotask(() => {
|
|
217
|
-
var x,
|
|
220
|
+
var x, v;
|
|
218
221
|
if (T.current !== V.Started) return;
|
|
219
|
-
|
|
222
|
+
g.current = i.current, i.current = r;
|
|
220
223
|
let e = X();
|
|
221
224
|
const n = (
|
|
222
225
|
// @ts-ignore
|
|
223
226
|
((x = t.states[e].on) == null ? void 0 : x[r.type]) ?? // @ts-ignore
|
|
224
|
-
((
|
|
227
|
+
((v = t.on) == null ? void 0 : v[r.type])
|
|
225
228
|
), u = I(n);
|
|
226
229
|
if (!u) return;
|
|
227
230
|
C.current = u;
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
231
|
+
const c = u.target ?? e;
|
|
232
|
+
l("transition", r.type, u.target || e, `(${u.actions})`);
|
|
233
|
+
const a = c !== e;
|
|
234
|
+
a ? O(() => p.set(c)) : u.reenter && !a ? p.invoke(e, e) : q(u.actions ?? []);
|
|
232
235
|
});
|
|
233
236
|
};
|
|
234
|
-
return (G = t.watch) == null || G.call(t,
|
|
235
|
-
state:
|
|
237
|
+
return (G = t.watch) == null || G.call(t, N()), {
|
|
238
|
+
state: M(),
|
|
236
239
|
send: B,
|
|
237
240
|
context: R,
|
|
238
|
-
prop:
|
|
239
|
-
scope:
|
|
241
|
+
prop: b,
|
|
242
|
+
scope: s,
|
|
240
243
|
refs: m,
|
|
241
244
|
computed: k,
|
|
242
|
-
event:
|
|
245
|
+
event: f(),
|
|
243
246
|
getStatus: () => T.current
|
|
244
247
|
};
|
|
245
248
|
}
|
|
246
249
|
function W(t) {
|
|
247
|
-
const o =
|
|
250
|
+
const o = d(t);
|
|
248
251
|
return o.current = t, o;
|
|
249
252
|
}
|
|
250
|
-
function
|
|
253
|
+
function it(t) {
|
|
251
254
|
const o = W(t);
|
|
252
|
-
return function(
|
|
253
|
-
return o.current[
|
|
255
|
+
return function(l) {
|
|
256
|
+
return o.current[l];
|
|
254
257
|
};
|
|
255
258
|
}
|
|
256
259
|
function Q(t) {
|
|
257
260
|
queueMicrotask(() => {
|
|
258
|
-
|
|
261
|
+
O(() => t());
|
|
259
262
|
});
|
|
260
263
|
}
|
|
261
|
-
var
|
|
264
|
+
var St = ot((t) => t);
|
|
262
265
|
export {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
bt as mergeProps,
|
|
267
|
+
St as normalizeProps,
|
|
268
|
+
vt as useMachine
|
|
266
269
|
};
|