@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,251 +1,259 @@
1
- import { createAnatomy as k } from "../../anatomy/dist/index.js";
2
- import { createScope as b, dataAttr as n, visuallyHiddenStyle as E } from "../../dom-query/dist/index.js";
3
- import { trackFocusVisible as C, isFocusVisible as m } from "../../focus-visible/dist/index.js";
4
- import { createMachine as v, guards as I } from "../../core/dist/index.js";
5
- import { trackPress as T } from "../../dom-event/dist/index.js";
6
- import { dispatchInputCheckedEvent as y, trackFormControl as H } from "../../form-utils/dist/index.js";
7
- import { compact as D, isEqual as P } from "../../utils/dist/index.js";
8
- import { createProps as S } from "../../types/dist/index.js";
9
- var F = k("switch").parts("root", "label", "control", "thumb"), u = F.build(), i = b({
10
- getRootId: (e) => {
11
- var d;
12
- return ((d = e.ids) == null ? void 0 : d.root) ?? `switch:${e.id}`;
13
- },
14
- getLabelId: (e) => {
15
- var d;
16
- return ((d = e.ids) == null ? void 0 : d.label) ?? `switch:${e.id}:label`;
17
- },
18
- getThumbId: (e) => {
19
- var d;
20
- return ((d = e.ids) == null ? void 0 : d.thumb) ?? `switch:${e.id}:thumb`;
21
- },
22
- getControlId: (e) => {
23
- var d;
24
- return ((d = e.ids) == null ? void 0 : d.control) ?? `switch:${e.id}:control`;
25
- },
26
- getHiddenInputId: (e) => {
27
- var d;
28
- return ((d = e.ids) == null ? void 0 : d.hiddenInput) ?? `switch:${e.id}:input`;
29
- },
30
- getRootEl: (e) => i.getById(e, i.getRootId(e)),
31
- getHiddenInputEl: (e) => i.getById(e, i.getHiddenInputId(e))
32
- });
33
- function $(e, d, t) {
34
- const o = e.context.isDisabled, s = e.context.readOnly, c = e.context.checked, a = !o && e.context.focused, p = !o && e.context.focusVisible, l = {
35
- "data-active": n(e.context.active),
36
- "data-focus": n(a),
37
- "data-focus-visible": n(p),
38
- "data-readonly": n(s),
39
- "data-hover": n(e.context.hovered),
40
- "data-disabled": n(o),
41
- "data-state": e.context.checked ? "checked" : "unchecked",
42
- "data-invalid": n(e.context.invalid)
1
+ import { createAnatomy as T } from "../../anatomy/dist/index.js";
2
+ import { dispatchInputCheckedEvent as y, setElementChecked as V, trackFormControl as I, trackPress as P, dataAttr as c, visuallyHiddenStyle as S, getEventTarget as D, isSafari as F } from "../../dom-query/dist/index.js";
3
+ import { trackFocusVisible as N, isFocusVisible as H } from "../../focus-visible/dist/index.js";
4
+ import { createMachine as O, createGuards as w } from "../../core/dist/index.js";
5
+ import { createProps as K } from "../../types/dist/index.js";
6
+ var R = T("switch").parts("root", "label", "control", "thumb"), h = R.build(), m = (e) => {
7
+ var t;
8
+ return ((t = e.ids) == null ? void 0 : t.root) ?? `switch:${e.id}`;
9
+ }, v = (e) => {
10
+ var t;
11
+ return ((t = e.ids) == null ? void 0 : t.label) ?? `switch:${e.id}:label`;
12
+ }, G = (e) => {
13
+ var t;
14
+ return ((t = e.ids) == null ? void 0 : t.thumb) ?? `switch:${e.id}:thumb`;
15
+ }, L = (e) => {
16
+ var t;
17
+ return ((t = e.ids) == null ? void 0 : t.control) ?? `switch:${e.id}:control`;
18
+ }, f = (e) => {
19
+ var t;
20
+ return ((t = e.ids) == null ? void 0 : t.hiddenInput) ?? `switch:${e.id}:input`;
21
+ }, X = (e) => e.getById(m(e)), n = (e) => e.getById(f(e));
22
+ function x(e, t) {
23
+ const { context: s, send: d, prop: r, scope: a } = e, o = r("disabled"), k = r("readOnly"), l = !!s.get("checked"), g = !o && s.get("focused"), b = !o && s.get("focusVisible"), u = {
24
+ "data-active": c(s.get("active")),
25
+ "data-focus": c(g),
26
+ "data-focus-visible": c(b),
27
+ "data-readonly": c(k),
28
+ "data-hover": c(s.get("hovered")),
29
+ "data-disabled": c(o),
30
+ "data-state": l ? "checked" : "unchecked",
31
+ "data-invalid": c(r("invalid"))
43
32
  };
44
33
  return {
45
- checked: c,
34
+ checked: l,
46
35
  disabled: o,
47
- focused: a,
48
- setChecked(r) {
49
- d({ type: "CHECKED.SET", checked: r, isTrusted: !1 });
36
+ focused: g,
37
+ setChecked(i) {
38
+ d({ type: "CHECKED.SET", checked: i, isTrusted: !1 });
50
39
  },
51
40
  toggleChecked() {
52
- d({ type: "CHECKED.TOGGLE", checked: c, isTrusted: !1 });
41
+ d({ type: "CHECKED.TOGGLE", checked: l, isTrusted: !1 });
53
42
  },
54
43
  getRootProps() {
55
44
  return t.label({
56
- ...u.root.attrs,
57
- ...l,
58
- dir: e.context.dir,
59
- id: i.getRootId(e.context),
60
- htmlFor: i.getHiddenInputId(e.context),
45
+ ...h.root.attrs,
46
+ ...u,
47
+ dir: r("dir"),
48
+ id: m(a),
49
+ htmlFor: f(a),
61
50
  onPointerMove() {
62
51
  o || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
63
52
  },
64
53
  onPointerLeave() {
65
54
  o || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
66
55
  },
67
- onClick(r) {
68
- o || r.target === i.getHiddenInputEl(e.context) && r.stopPropagation();
56
+ onClick(i) {
57
+ var p;
58
+ if (o) return;
59
+ D(i) === n(a) && i.stopPropagation(), F() && ((p = n(a)) == null || p.focus());
69
60
  }
70
61
  });
71
62
  },
72
63
  getLabelProps() {
73
64
  return t.element({
74
- ...u.label.attrs,
75
- ...l,
76
- dir: e.context.dir,
77
- id: i.getLabelId(e.context)
65
+ ...h.label.attrs,
66
+ ...u,
67
+ dir: r("dir"),
68
+ id: v(a)
78
69
  });
79
70
  },
80
71
  getThumbProps() {
81
72
  return t.element({
82
- ...u.thumb.attrs,
83
- ...l,
84
- dir: e.context.dir,
85
- id: i.getThumbId(e.context),
73
+ ...h.thumb.attrs,
74
+ ...u,
75
+ dir: r("dir"),
76
+ id: G(a),
86
77
  "aria-hidden": !0
87
78
  });
88
79
  },
89
80
  getControlProps() {
90
81
  return t.element({
91
- ...u.control.attrs,
92
- ...l,
93
- dir: e.context.dir,
94
- id: i.getControlId(e.context),
82
+ ...h.control.attrs,
83
+ ...u,
84
+ dir: r("dir"),
85
+ id: L(a),
95
86
  "aria-hidden": !0
96
87
  });
97
88
  },
98
89
  getHiddenInputProps() {
99
90
  return t.input({
100
- id: i.getHiddenInputId(e.context),
91
+ id: f(a),
101
92
  type: "checkbox",
102
- required: e.context.required,
103
- defaultChecked: c,
93
+ required: r("required"),
94
+ defaultChecked: l,
104
95
  disabled: o,
105
- "aria-labelledby": i.getLabelId(e.context),
106
- "aria-invalid": e.context.invalid,
107
- name: e.context.name,
108
- form: e.context.form,
109
- value: e.context.value,
110
- style: E,
96
+ "aria-labelledby": v(a),
97
+ "aria-invalid": r("invalid"),
98
+ name: r("name"),
99
+ form: r("form"),
100
+ value: r("value"),
101
+ style: S,
111
102
  onFocus() {
112
- const r = m();
113
- d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: r } });
103
+ const i = H();
104
+ d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: i } });
114
105
  },
115
106
  onBlur() {
116
107
  d({ type: "CONTEXT.SET", context: { focused: !1, focusVisible: !1 } });
117
108
  },
118
- onClick(r) {
119
- if (s) {
120
- r.preventDefault();
109
+ onClick(i) {
110
+ if (k) {
111
+ i.preventDefault();
121
112
  return;
122
113
  }
123
- const g = r.currentTarget.checked;
124
- d({ type: "CHECKED.SET", checked: g, isTrusted: !0 });
114
+ const C = i.currentTarget.checked;
115
+ d({ type: "CHECKED.SET", checked: C, isTrusted: !0 });
125
116
  }
126
117
  });
127
118
  }
128
119
  };
129
120
  }
130
- var { not: h } = I;
131
- function q(e) {
132
- const d = D(e);
133
- return v(
134
- {
135
- id: "switch",
136
- initial: "ready",
137
- context: {
138
- checked: !1,
139
- label: "switch",
140
- value: "on",
141
- disabled: !1,
142
- ...d,
143
- fieldsetDisabled: !1,
144
- focusVisible: !1
121
+ var { not: E } = w(), j = O({
122
+ props({ props: e }) {
123
+ return {
124
+ defaultChecked: !1,
125
+ label: "switch",
126
+ value: "on",
127
+ ...e
128
+ };
129
+ },
130
+ initialState() {
131
+ return "ready";
132
+ },
133
+ context({ prop: e, bindable: t }) {
134
+ return {
135
+ checked: t(() => ({
136
+ defaultValue: e("defaultChecked"),
137
+ value: e("checked"),
138
+ onChange(s) {
139
+ var d;
140
+ (d = e("onCheckedChange")) == null || d({ checked: s });
141
+ }
142
+ })),
143
+ fieldsetDisabled: t(() => ({
144
+ defaultValue: !1
145
+ })),
146
+ focusVisible: t(() => ({
147
+ defaultValue: !1
148
+ })),
149
+ active: t(() => ({
150
+ defaultValue: !1
151
+ })),
152
+ focused: t(() => ({
153
+ defaultValue: !1
154
+ })),
155
+ hovered: t(() => ({
156
+ defaultValue: !1
157
+ }))
158
+ };
159
+ },
160
+ computed: {
161
+ isDisabled: ({ context: e, prop: t }) => t("disabled") || e.get("fieldsetDisabled")
162
+ },
163
+ watch({ track: e, prop: t, context: s, action: d }) {
164
+ e([() => t("disabled")], () => {
165
+ d(["removeFocusIfNeeded"]);
166
+ }), e([() => s.get("checked")], () => {
167
+ d(["syncInputElement"]);
168
+ });
169
+ },
170
+ effects: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
171
+ on: {
172
+ "CHECKED.TOGGLE": [
173
+ {
174
+ guard: E("isTrusted"),
175
+ actions: ["toggleChecked", "dispatchChangeEvent"]
145
176
  },
146
- computed: {
147
- isDisabled: (t) => t.disabled || t.fieldsetDisabled
177
+ {
178
+ actions: ["toggleChecked"]
179
+ }
180
+ ],
181
+ "CHECKED.SET": [
182
+ {
183
+ guard: E("isTrusted"),
184
+ actions: ["setChecked", "dispatchChangeEvent"]
148
185
  },
149
- watch: {
150
- disabled: "removeFocusIfNeeded",
151
- checked: "syncInputElement"
186
+ {
187
+ actions: ["setChecked"]
188
+ }
189
+ ],
190
+ "CONTEXT.SET": {
191
+ actions: ["setContext"]
192
+ }
193
+ },
194
+ states: {
195
+ ready: {}
196
+ },
197
+ implementations: {
198
+ guards: {
199
+ isTrusted: ({ event: e }) => !!e.isTrusted
200
+ },
201
+ effects: {
202
+ trackPressEvent({ computed: e, scope: t, context: s }) {
203
+ if (!e("isDisabled"))
204
+ return P({
205
+ pointerNode: X(t),
206
+ keyboardNode: n(t),
207
+ isValidKey: (d) => d.key === " ",
208
+ onPress: () => s.set("active", !1),
209
+ onPressStart: () => s.set("active", !0),
210
+ onPressEnd: () => s.set("active", !1)
211
+ });
152
212
  },
153
- activities: ["trackFormControlState", "trackPressEvent", "trackFocusVisible"],
154
- on: {
155
- "CHECKED.TOGGLE": [
156
- {
157
- guard: h("isTrusted"),
158
- actions: ["toggleChecked", "dispatchChangeEvent"]
159
- },
160
- {
161
- actions: ["toggleChecked"]
162
- }
163
- ],
164
- "CHECKED.SET": [
165
- {
166
- guard: h("isTrusted"),
167
- actions: ["setChecked", "dispatchChangeEvent"]
213
+ trackFocusVisible({ computed: e, scope: t }) {
214
+ if (!e("isDisabled"))
215
+ return N({ root: t.getRootNode() });
216
+ },
217
+ trackFormControlState({ context: e, send: t, scope: s }) {
218
+ return I(n(s), {
219
+ onFieldsetDisabledChange(d) {
220
+ e.set("fieldsetDisabled", d);
168
221
  },
169
- {
170
- actions: ["setChecked"]
222
+ onFormReset() {
223
+ const d = e.initial("checked");
224
+ t({ type: "CHECKED.SET", checked: !!d, src: "form-reset" });
171
225
  }
172
- ],
173
- "CONTEXT.SET": {
174
- actions: ["setContext"]
175
- }
176
- },
177
- states: {
178
- ready: {}
226
+ });
179
227
  }
180
228
  },
181
- {
182
- guards: {
183
- isTrusted: (t, o) => !!o.isTrusted
229
+ actions: {
230
+ setContext({ context: e, event: t }) {
231
+ for (const s in t.context)
232
+ e.set(s, t.context[s]);
184
233
  },
185
- activities: {
186
- trackPressEvent(t) {
187
- if (!t.isDisabled)
188
- return T({
189
- pointerNode: i.getRootEl(t),
190
- keyboardNode: i.getHiddenInputEl(t),
191
- isValidKey: (o) => o.key === " ",
192
- onPress: () => t.active = !1,
193
- onPressStart: () => t.active = !0,
194
- onPressEnd: () => t.active = !1
195
- });
196
- },
197
- trackFocusVisible(t) {
198
- if (!t.isDisabled)
199
- return C({ root: i.getRootNode(t) });
200
- },
201
- trackFormControlState(t, o, { send: s, initialContext: c }) {
202
- return H(i.getHiddenInputEl(t), {
203
- onFieldsetDisabledChange(a) {
204
- t.fieldsetDisabled = a;
205
- },
206
- onFormReset() {
207
- s({ type: "CHECKED.SET", checked: !!c.checked, src: "form-reset" });
208
- }
209
- });
210
- }
234
+ syncInputElement({ context: e, scope: t }) {
235
+ const s = n(t);
236
+ s && V(s, !!e.get("checked"));
211
237
  },
212
- actions: {
213
- setContext(t, o) {
214
- Object.assign(t, o.context);
215
- },
216
- syncInputElement(t) {
217
- const o = i.getHiddenInputEl(t);
218
- o && (o.checked = !!t.checked);
219
- },
220
- removeFocusIfNeeded(t) {
221
- t.disabled && t.focused && (t.focused = !1);
222
- },
223
- setChecked(t, o) {
224
- f.checked(t, o.checked);
225
- },
226
- toggleChecked(t, o) {
227
- f.checked(t, !t.checked);
228
- },
229
- dispatchChangeEvent(t) {
230
- const o = i.getHiddenInputEl(t);
231
- y(o, { checked: t.checked });
232
- }
238
+ removeFocusIfNeeded({ context: e, prop: t }) {
239
+ t("disabled") && e.set("focused", !1);
240
+ },
241
+ setChecked({ context: e, event: t }) {
242
+ e.set("checked", t.checked);
243
+ },
244
+ toggleChecked({ context: e }) {
245
+ e.set("checked", !e.get("checked"));
246
+ },
247
+ dispatchChangeEvent({ context: e, scope: t }) {
248
+ const s = n(t);
249
+ y(s, { checked: e.get("checked") });
233
250
  }
234
251
  }
235
- );
236
- }
237
- var x = {
238
- change: (e) => {
239
- var d;
240
- (d = e.onCheckedChange) == null || d.call(e, { checked: e.checked });
241
- }
242
- }, f = {
243
- checked: (e, d) => {
244
- P(e.checked, d) || (e.checked = d, x.change(e));
245
252
  }
246
- };
247
- S()([
253
+ });
254
+ K()([
248
255
  "checked",
256
+ "defaultChecked",
249
257
  "dir",
250
258
  "disabled",
251
259
  "form",
@@ -261,7 +269,7 @@ S()([
261
269
  "value"
262
270
  ]);
263
271
  export {
264
- F as anatomy,
265
- $ as connect,
266
- q as machine
272
+ R as anatomy,
273
+ x as connect,
274
+ j as machine
267
275
  };