@serendie/ui 2.0.0 → 2.1.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.
Files changed (118) hide show
  1. package/dist/components/CheckBox/CheckBox.js +36 -35
  2. package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
  3. package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
  4. package/dist/components/DataTable/DataTableComponent.js +38 -36
  5. package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
  6. package/dist/components/Search/Search.d.ts +3 -1
  7. package/dist/components/Search/Search.js +34 -33
  8. package/dist/components/Select/Select.d.ts +2 -1
  9. package/dist/components/Select/Select.js +47 -41
  10. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  11. package/dist/components/Tooltip/Tooltip.js +70 -0
  12. package/dist/components/Tooltip/index.d.ts +1 -0
  13. package/dist/components/Tooltip/index.js +4 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +12 -10
  16. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
  17. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
  18. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
  19. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
  20. package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
  21. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
  22. package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
  23. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
  24. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
  25. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
  26. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
  27. package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
  28. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
  29. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
  30. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
  31. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
  32. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
  33. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
  34. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
  35. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
  36. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
  37. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
  38. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
  39. package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
  40. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
  41. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
  42. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
  43. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
  44. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
  45. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
  47. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
  48. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
  49. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
  50. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
  51. package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
  52. package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
  53. package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
  54. package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
  55. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
  56. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
  57. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
  58. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
  59. package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
  60. package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
  61. package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
  62. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
  63. package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
  64. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
  65. package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
  66. package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
  67. package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
  68. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
  69. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
  70. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
  71. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
  72. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
  73. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
  74. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
  75. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
  76. package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
  77. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
  78. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
  79. package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
  80. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
  81. package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
  82. package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
  83. package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
  84. package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
  85. package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
  86. package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
  87. package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
  88. package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
  89. package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
  90. package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
  91. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
  92. package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
  93. package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
  94. package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
  98. package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
  99. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
  100. package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
  101. package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
  102. package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
  103. package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
  104. package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
  105. package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
  106. package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
  107. package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
  108. package/dist/node_modules/proxy-compare/dist/index.js +4 -106
  109. package/dist/styles.css +1 -1
  110. package/package.json +5 -5
  111. package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
  112. package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
  113. package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
  114. package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
  115. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
  116. package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
  117. package/dist/node_modules/klona/full/index.js +0 -21
  118. package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
@@ -1,255 +1,254 @@
1
- import { createAnatomy as b } from "../../anatomy/dist/index.js";
2
- import { createScope as m, dataAttr as c, visuallyHiddenStyle as v } from "../../dom-query/dist/index.js";
3
- import { trackFocusVisible as I, isFocusVisible as T } from "../../focus-visible/dist/index.js";
4
- import { createMachine as y, guards as H } from "../../core/dist/index.js";
5
- import { trackPress as x } from "../../dom-event/dist/index.js";
6
- import { dispatchInputCheckedEvent as D, setElementChecked as P, trackFormControl as S } from "../../form-utils/dist/index.js";
7
- import { compact as F, isEqual as V } from "../../utils/dist/index.js";
8
- import { createProps as N } from "../../types/dist/index.js";
9
- var O = b("checkbox").parts("root", "label", "control", "indicator"), l = O.build(), n = m({
10
- getRootId: (e) => {
11
- var d;
12
- return ((d = e.ids) == null ? void 0 : d.root) ?? `checkbox:${e.id}`;
13
- },
14
- getLabelId: (e) => {
15
- var d;
16
- return ((d = e.ids) == null ? void 0 : d.label) ?? `checkbox:${e.id}:label`;
17
- },
18
- getControlId: (e) => {
19
- var d;
20
- return ((d = e.ids) == null ? void 0 : d.control) ?? `checkbox:${e.id}:control`;
21
- },
22
- getHiddenInputId: (e) => {
23
- var d;
24
- return ((d = e.ids) == null ? void 0 : d.hiddenInput) ?? `checkbox:${e.id}:input`;
25
- },
26
- getRootEl: (e) => n.getById(e, n.getRootId(e)),
27
- getHiddenInputEl: (e) => n.getById(e, n.getHiddenInputId(e))
28
- });
29
- function M(e, d, t) {
30
- const o = e.context.isDisabled, r = e.context.readOnly, a = !o && e.context.focused, u = !o && e.context.focusVisible, h = e.context.isChecked, k = e.context.isIndeterminate, s = {
31
- "data-active": c(e.context.active),
32
- "data-focus": c(a),
33
- "data-focus-visible": c(u),
34
- "data-readonly": c(r),
35
- "data-hover": c(e.context.hovered),
36
- "data-disabled": c(o),
37
- "data-state": k ? "indeterminate" : e.context.checked ? "checked" : "unchecked",
38
- "data-invalid": c(e.context.invalid)
1
+ import { createAnatomy as I } from "../../anatomy/dist/index.js";
2
+ import { dispatchInputCheckedEvent as P, setElementChecked as S, trackFormControl as F, trackPress as N, dataAttr as o, visuallyHiddenStyle as D, getEventTarget as O } from "../../dom-query/dist/index.js";
3
+ import { trackFocusVisible as H, isFocusVisible as K } from "../../focus-visible/dist/index.js";
4
+ import { createMachine as R, createGuards as x } from "../../core/dist/index.js";
5
+ import { createProps as G } from "../../types/dist/index.js";
6
+ var L = I("checkbox").parts("root", "label", "control", "indicator"), h = L.build(), y = (e) => {
7
+ var t;
8
+ return ((t = e.ids) == null ? void 0 : t.root) ?? `checkbox:${e.id}`;
9
+ }, b = (e) => {
10
+ var t;
11
+ return ((t = e.ids) == null ? void 0 : t.label) ?? `checkbox:${e.id}:label`;
12
+ }, X = (e) => {
13
+ var t;
14
+ return ((t = e.ids) == null ? void 0 : t.control) ?? `checkbox:${e.id}:control`;
15
+ }, g = (e) => {
16
+ var t;
17
+ return ((t = e.ids) == null ? void 0 : t.hiddenInput) ?? `checkbox:${e.id}:input`;
18
+ }, q = (e) => e.getById(y(e)), l = (e) => e.getById(g(e));
19
+ function J(e, t) {
20
+ const { send: d, context: r, prop: a, computed: C, scope: c } = e, i = a("disabled"), v = a("readOnly"), E = a("invalid"), p = !i && r.get("focused"), V = !i && r.get("focusVisible"), n = C("checked"), k = C("indeterminate"), u = {
21
+ "data-active": o(r.get("active")),
22
+ "data-focus": o(p),
23
+ "data-focus-visible": o(V),
24
+ "data-readonly": o(v),
25
+ "data-hover": o(r.get("hovered")),
26
+ "data-disabled": o(i),
27
+ "data-state": k ? "indeterminate" : n ? "checked" : "unchecked",
28
+ "data-invalid": o(E)
39
29
  };
40
30
  return {
41
- checked: h,
42
- disabled: o,
31
+ checked: n,
32
+ disabled: i,
43
33
  indeterminate: k,
44
- focused: a,
45
- checkedState: e.context.checked,
46
- setChecked(i) {
47
- d({ type: "CHECKED.SET", checked: i, isTrusted: !1 });
34
+ focused: p,
35
+ checkedState: n,
36
+ setChecked(s) {
37
+ d({ type: "CHECKED.SET", checked: s, isTrusted: !1 });
48
38
  },
49
39
  toggleChecked() {
50
- d({ type: "CHECKED.TOGGLE", checked: h, isTrusted: !1 });
40
+ d({ type: "CHECKED.TOGGLE", checked: n, isTrusted: !1 });
51
41
  },
52
42
  getRootProps() {
53
43
  return t.label({
54
- ...l.root.attrs,
55
- ...s,
56
- dir: e.context.dir,
57
- id: n.getRootId(e.context),
58
- htmlFor: n.getHiddenInputId(e.context),
44
+ ...h.root.attrs,
45
+ ...u,
46
+ dir: a("dir"),
47
+ id: y(c),
48
+ htmlFor: g(c),
59
49
  onPointerMove() {
60
- o || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
50
+ i || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
61
51
  },
62
52
  onPointerLeave() {
63
- o || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
53
+ i || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
64
54
  },
65
- onClick(i) {
66
- i.target === n.getHiddenInputEl(e.context) && i.stopPropagation();
55
+ onClick(s) {
56
+ O(s) === l(c) && s.stopPropagation();
67
57
  }
68
58
  });
69
59
  },
70
60
  getLabelProps() {
71
61
  return t.element({
72
- ...l.label.attrs,
73
- ...s,
74
- dir: e.context.dir,
75
- id: n.getLabelId(e.context)
62
+ ...h.label.attrs,
63
+ ...u,
64
+ dir: a("dir"),
65
+ id: b(c)
76
66
  });
77
67
  },
78
68
  getControlProps() {
79
69
  return t.element({
80
- ...l.control.attrs,
81
- ...s,
82
- dir: e.context.dir,
83
- id: n.getControlId(e.context),
70
+ ...h.control.attrs,
71
+ ...u,
72
+ dir: a("dir"),
73
+ id: X(c),
84
74
  "aria-hidden": !0
85
75
  });
86
76
  },
87
77
  getIndicatorProps() {
88
78
  return t.element({
89
- ...l.indicator.attrs,
90
- ...s,
91
- dir: e.context.dir,
92
- hidden: !k && !e.context.checked
79
+ ...h.indicator.attrs,
80
+ ...u,
81
+ dir: a("dir"),
82
+ hidden: !k && !n
93
83
  });
94
84
  },
95
85
  getHiddenInputProps() {
96
86
  return t.input({
97
- id: n.getHiddenInputId(e.context),
87
+ id: g(c),
98
88
  type: "checkbox",
99
- required: e.context.required,
100
- defaultChecked: h,
101
- disabled: o,
102
- "aria-labelledby": n.getLabelId(e.context),
103
- "aria-invalid": e.context.invalid,
104
- name: e.context.name,
105
- form: e.context.form,
106
- value: e.context.value,
107
- style: v,
89
+ required: a("required"),
90
+ defaultChecked: n,
91
+ disabled: i,
92
+ "aria-labelledby": b(c),
93
+ "aria-invalid": E,
94
+ name: a("name"),
95
+ form: a("form"),
96
+ value: a("value"),
97
+ style: D,
108
98
  onFocus() {
109
- const i = T();
110
- d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: i } });
99
+ const s = K();
100
+ d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: s } });
111
101
  },
112
102
  onBlur() {
113
103
  d({ type: "CONTEXT.SET", context: { focused: !1, focusVisible: !1 } });
114
104
  },
115
- onClick(i) {
116
- if (r) {
117
- i.preventDefault();
105
+ onClick(s) {
106
+ if (v) {
107
+ s.preventDefault();
118
108
  return;
119
109
  }
120
- const E = i.currentTarget.checked;
121
- d({ type: "CHECKED.SET", checked: E, isTrusted: !0 });
110
+ const m = s.currentTarget.checked;
111
+ d({ type: "CHECKED.SET", checked: m, isTrusted: !0 });
122
112
  }
123
113
  });
124
114
  }
125
115
  };
126
116
  }
127
- var { not: p } = H;
128
- function _(e) {
129
- const d = F(e);
130
- return y(
131
- {
132
- id: "checkbox",
133
- initial: "ready",
134
- context: {
135
- checked: !1,
136
- value: "on",
137
- disabled: !1,
138
- ...d,
139
- fieldsetDisabled: !1,
140
- focusVisible: !1
117
+ var { not: T } = x(), Q = R({
118
+ props({ props: e }) {
119
+ return {
120
+ value: "on",
121
+ ...e,
122
+ defaultChecked: !!e.defaultChecked
123
+ };
124
+ },
125
+ initialState() {
126
+ return "ready";
127
+ },
128
+ context({ prop: e, bindable: t }) {
129
+ return {
130
+ checked: t(() => ({
131
+ defaultValue: e("defaultChecked"),
132
+ value: e("checked"),
133
+ onChange(d) {
134
+ var r;
135
+ (r = e("onCheckedChange")) == null || r({ checked: d });
136
+ }
137
+ })),
138
+ fieldsetDisabled: t(() => ({ defaultValue: !1 })),
139
+ focusVisible: t(() => ({ defaultValue: !1 })),
140
+ active: t(() => ({ defaultValue: !1 })),
141
+ focused: t(() => ({ defaultValue: !1 })),
142
+ hovered: t(() => ({ defaultValue: !1 }))
143
+ };
144
+ },
145
+ watch({ track: e, context: t, prop: d, action: r }) {
146
+ e([() => d("disabled")], () => {
147
+ r(["removeFocusIfNeeded"]);
148
+ }), e([() => t.get("checked")], () => {
149
+ r(["syncInputElement"]);
150
+ });
151
+ },
152
+ effects: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
153
+ on: {
154
+ "CHECKED.TOGGLE": [
155
+ {
156
+ guard: T("isTrusted"),
157
+ actions: ["toggleChecked", "dispatchChangeEvent"]
141
158
  },
142
- watch: {
143
- disabled: "removeFocusIfNeeded",
144
- checked: "syncInputElement"
159
+ {
160
+ actions: ["toggleChecked"]
161
+ }
162
+ ],
163
+ "CHECKED.SET": [
164
+ {
165
+ guard: T("isTrusted"),
166
+ actions: ["setChecked", "dispatchChangeEvent"]
145
167
  },
146
- activities: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
147
- on: {
148
- "CHECKED.TOGGLE": [
149
- {
150
- guard: p("isTrusted"),
151
- actions: ["toggleChecked", "dispatchChangeEvent"]
152
- },
153
- {
154
- actions: ["toggleChecked"]
155
- }
156
- ],
157
- "CHECKED.SET": [
158
- {
159
- guard: p("isTrusted"),
160
- actions: ["setChecked", "dispatchChangeEvent"]
161
- },
162
- {
163
- actions: ["setChecked"]
164
- }
165
- ],
166
- "CONTEXT.SET": {
167
- actions: ["setContext"]
168
- }
168
+ {
169
+ actions: ["setChecked"]
170
+ }
171
+ ],
172
+ "CONTEXT.SET": {
173
+ actions: ["setContext"]
174
+ }
175
+ },
176
+ computed: {
177
+ indeterminate: ({ context: e }) => f(e.get("checked")),
178
+ checked: ({ context: e }) => $(e.get("checked")),
179
+ disabled: ({ context: e, prop: t }) => !!t("disabled") || e.get("fieldsetDisabled")
180
+ },
181
+ states: {
182
+ ready: {}
183
+ },
184
+ implementations: {
185
+ guards: {
186
+ isTrusted: ({ event: e }) => !!e.isTrusted
187
+ },
188
+ effects: {
189
+ trackPressEvent({ context: e, computed: t, scope: d }) {
190
+ if (!t("disabled"))
191
+ return N({
192
+ pointerNode: q(d),
193
+ keyboardNode: l(d),
194
+ isValidKey: (r) => r.key === " ",
195
+ onPress: () => e.set("active", !1),
196
+ onPressStart: () => e.set("active", !0),
197
+ onPressEnd: () => e.set("active", !1)
198
+ });
169
199
  },
170
- computed: {
171
- isIndeterminate: (t) => f(t.checked),
172
- isChecked: (t) => g(t.checked),
173
- isDisabled: (t) => !!t.disabled || t.fieldsetDisabled
200
+ trackFocusVisible({ computed: e, scope: t }) {
201
+ var d;
202
+ if (!e("disabled"))
203
+ return H({ root: (d = t.getRootNode) == null ? void 0 : d.call(t) });
174
204
  },
175
- states: {
176
- ready: {}
205
+ trackFormControlState({ context: e, scope: t }) {
206
+ return F(l(t), {
207
+ onFieldsetDisabledChange(d) {
208
+ e.set("fieldsetDisabled", d);
209
+ },
210
+ onFormReset() {
211
+ e.set("checked", e.initial("checked"));
212
+ }
213
+ });
177
214
  }
178
215
  },
179
- {
180
- guards: {
181
- isTrusted: (t, o) => !!o.isTrusted
216
+ actions: {
217
+ setContext({ context: e, event: t }) {
218
+ for (const d in t.context)
219
+ e.set(d, t.context[d]);
182
220
  },
183
- activities: {
184
- trackPressEvent(t) {
185
- if (!t.isDisabled)
186
- return x({
187
- pointerNode: n.getRootEl(t),
188
- keyboardNode: n.getHiddenInputEl(t),
189
- isValidKey: (o) => o.key === " ",
190
- onPress: () => t.active = !1,
191
- onPressStart: () => t.active = !0,
192
- onPressEnd: () => t.active = !1
193
- });
194
- },
195
- trackFocusVisible(t) {
196
- if (!t.isDisabled)
197
- return I({ root: n.getRootNode(t) });
198
- },
199
- trackFormControlState(t, o, { send: r, initialContext: a }) {
200
- return S(n.getHiddenInputEl(t), {
201
- onFieldsetDisabledChange(u) {
202
- t.fieldsetDisabled = u;
203
- },
204
- onFormReset() {
205
- r({ type: "CHECKED.SET", checked: !!a.checked });
206
- }
207
- });
208
- }
221
+ syncInputElement({ context: e, computed: t, scope: d }) {
222
+ const r = l(d);
223
+ r && (S(r, t("checked")), r.indeterminate = f(e.get("checked")));
209
224
  },
210
- actions: {
211
- setContext(t, o) {
212
- Object.assign(t, o.context);
213
- },
214
- syncInputElement(t) {
215
- const o = n.getHiddenInputEl(t);
216
- o && (P(o, t.isChecked), o.indeterminate = t.isIndeterminate);
217
- },
218
- removeFocusIfNeeded(t) {
219
- t.disabled && t.focused && (t.focused = !1, t.focusVisible = !1);
220
- },
221
- setChecked(t, o) {
222
- C.checked(t, o.checked);
223
- },
224
- toggleChecked(t) {
225
- const o = f(t.checked) ? !0 : !t.checked;
226
- C.checked(t, o);
227
- },
228
- dispatchChangeEvent(t) {
229
- const o = n.getHiddenInputEl(t);
230
- D(o, { checked: g(t.checked) });
231
- }
225
+ removeFocusIfNeeded({ context: e, prop: t }) {
226
+ t("disabled") && e.get("focused") && (e.set("focused", !1), e.set("focusVisible", !1));
227
+ },
228
+ setChecked({ context: e, event: t }) {
229
+ e.set("checked", t.checked);
230
+ },
231
+ toggleChecked({ context: e, computed: t }) {
232
+ const d = f(t("checked")) ? !0 : !t("checked");
233
+ e.set("checked", d);
234
+ },
235
+ dispatchChangeEvent({ computed: e, scope: t }) {
236
+ queueMicrotask(() => {
237
+ const d = l(t);
238
+ P(d, { checked: e("checked") });
239
+ });
232
240
  }
233
241
  }
234
- );
235
- }
242
+ }
243
+ });
236
244
  function f(e) {
237
245
  return e === "indeterminate";
238
246
  }
239
- function g(e) {
247
+ function $(e) {
240
248
  return f(e) ? !1 : !!e;
241
249
  }
242
- var R = {
243
- change: (e) => {
244
- var d;
245
- (d = e.onCheckedChange) == null || d.call(e, { checked: e.checked });
246
- }
247
- }, C = {
248
- checked: (e, d) => {
249
- V(e.checked, d) || (e.checked = d, R.change(e));
250
- }
251
- };
252
- N()([
250
+ G()([
251
+ "defaultChecked",
253
252
  "checked",
254
253
  "dir",
255
254
  "disabled",
@@ -265,7 +264,7 @@ N()([
265
264
  "value"
266
265
  ]);
267
266
  export {
268
- O as anatomy,
269
- M as connect,
270
- _ as machine
267
+ L as anatomy,
268
+ J as connect,
269
+ Q as machine
271
270
  };