@serendie/ui 0.1.16 → 0.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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -9
  3. package/dist/components/{Accordion.d.ts → Accordion/Accordion.d.ts} +2 -2
  4. package/dist/components/{Accordion.js → Accordion/Accordion.js} +10 -10
  5. package/dist/components/Accordion/index.d.ts +1 -0
  6. package/dist/components/AccordionGroup.js +4 -4
  7. package/dist/components/Avatar.js +4 -4
  8. package/dist/components/Badge.js +4 -4
  9. package/dist/components/Banner.js +4 -4
  10. package/dist/components/BottomNavigation.js +3 -3
  11. package/dist/components/BottomNavigationItem.js +4 -4
  12. package/dist/components/Button.js +7 -7
  13. package/dist/components/CheckBox.js +4 -4
  14. package/dist/components/ChoiceBox.js +10 -10
  15. package/dist/components/DashboardWidget.js +4 -4
  16. package/dist/components/Divider.js +4 -4
  17. package/dist/components/Drawer.js +4 -4
  18. package/dist/components/DropdownMenu.js +4 -4
  19. package/dist/components/IconButton.js +4 -4
  20. package/dist/components/ListItem.js +4 -4
  21. package/dist/components/ModalDialog.js +4 -4
  22. package/dist/components/NotificationBadge.js +4 -4
  23. package/dist/components/ProgressIndicator.js +4 -4
  24. package/dist/components/RadioButton.js +4 -4
  25. package/dist/components/Search.js +6 -6
  26. package/dist/components/Select.js +4 -4
  27. package/dist/components/Switch.js +4 -4
  28. package/dist/components/TabItem.js +4 -4
  29. package/dist/components/Tabs.js +4 -4
  30. package/dist/components/TextArea.js +4 -4
  31. package/dist/components/TextField.js +4 -4
  32. package/dist/components/Toast.js +3 -3
  33. package/dist/components/TopAppBar.js +4 -4
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.js +89 -89
  36. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +3 -4
  37. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -5
  38. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +0 -1
  39. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +3 -4
  40. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-root.js +2 -3
  41. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-fallback.js +6 -7
  42. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-image.js +5 -6
  43. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +2 -3
  44. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js +5 -6
  45. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +0 -1
  46. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js +0 -1
  47. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js +4 -5
  48. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +8 -9
  49. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root.js +0 -1
  50. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +3 -4
  51. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-control.js +5 -6
  52. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-input.js +6 -7
  53. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +0 -1
  54. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-text.js +3 -4
  55. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item.js +0 -1
  56. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +5 -6
  57. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +4 -5
  58. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +5 -6
  59. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +4 -5
  60. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +5 -6
  61. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +0 -1
  62. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +0 -1
  63. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js +5 -6
  64. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js +4 -5
  65. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js +0 -1
  66. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +3 -4
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +0 -1
  68. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +2 -3
  69. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js +3 -4
  70. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +2 -3
  71. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js +3 -4
  72. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +3 -4
  73. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js +0 -1
  74. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -5
  75. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +3 -4
  76. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-root.js +3 -4
  77. package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +3 -4
  78. package/dist/node_modules/@ark-ui/react/dist/components/select/select-control.js +6 -7
  79. package/dist/node_modules/@ark-ui/react/dist/components/select/select-item.js +0 -1
  80. package/dist/node_modules/@ark-ui/react/dist/components/select/select-label.js +4 -5
  81. package/dist/node_modules/@ark-ui/react/dist/components/select/select-positioner.js +4 -5
  82. package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +7 -7
  83. package/dist/node_modules/@ark-ui/react/dist/components/select/select-trigger.js +5 -6
  84. package/dist/node_modules/@ark-ui/react/dist/components/select/select-value-text.js +5 -6
  85. package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +35 -31
  86. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-control.js +4 -5
  87. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -5
  88. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-label.js +4 -5
  89. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-root.js +8 -9
  90. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js +4 -5
  91. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-list.js +3 -4
  92. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-trigger.js +3 -4
  93. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +10 -10
  94. package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-root.js +0 -1
  95. package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-title.js +0 -1
  96. package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +4 -4
  97. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +361 -303
  98. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +229 -216
  99. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +19 -19
  100. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +39 -38
  101. package/dist/node_modules/@serendie/design-token/dist/panda-tokens.js +823 -20
  102. package/dist/node_modules/@serendie/design-token/dist/tokens.js +346 -25
  103. package/dist/node_modules/@zag-js/accordion/dist/index.js +12 -12
  104. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +13 -62
  105. package/dist/node_modules/@zag-js/avatar/dist/index.js +12 -10
  106. package/dist/node_modules/@zag-js/checkbox/dist/index.js +99 -92
  107. package/dist/node_modules/@zag-js/collapsible/dist/index.js +5 -5
  108. package/dist/node_modules/@zag-js/collection/dist/index.js +21 -21
  109. package/dist/node_modules/@zag-js/combobox/dist/index.js +30 -31
  110. package/dist/node_modules/@zag-js/core/dist/index.js +285 -320
  111. package/dist/node_modules/@zag-js/dialog/dist/index.js +56 -62
  112. package/dist/node_modules/@zag-js/dismissable/dist/index.js +3 -3
  113. package/dist/node_modules/@zag-js/dom-event/dist/index.js +88 -115
  114. package/dist/node_modules/@zag-js/dom-query/dist/index.js +2 -2
  115. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +73 -0
  116. package/dist/node_modules/@zag-js/interact-outside/dist/index.js +33 -33
  117. package/dist/node_modules/@zag-js/menu/dist/index.js +81 -77
  118. package/dist/node_modules/@zag-js/popper/dist/index.js +86 -79
  119. package/dist/node_modules/@zag-js/radio-group/dist/index.js +116 -109
  120. package/dist/node_modules/@zag-js/react/dist/index.js +44 -43
  121. package/dist/node_modules/@zag-js/select/dist/index.js +203 -231
  122. package/dist/node_modules/@zag-js/store/dist/index.js +110 -110
  123. package/dist/node_modules/@zag-js/switch/dist/index.js +62 -55
  124. package/dist/node_modules/@zag-js/tabs/dist/index.js +64 -61
  125. package/dist/node_modules/@zag-js/toast/dist/index.js +174 -173
  126. package/dist/node_modules/@zag-js/utils/dist/index.js +93 -71
  127. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  128. package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +217 -219
  129. package/dist/preset.d.ts +807 -4
  130. package/dist/{ui/styled-system → styled-system}/css/css.js +5 -6
  131. package/dist/{ui/styled-system → styled-system}/css/cva.js +4 -4
  132. package/dist/{ui/styled-system → styled-system}/css/sva.js +3 -3
  133. package/dist/styled-system/jsx/is-valid-prop.js +6 -0
  134. package/dist/styles.css +1 -1
  135. package/dist/tokens/getToken.d.ts +324 -3
  136. package/dist/tokens/index.d.ts +806 -3
  137. package/package.json +31 -5
  138. package/styled-system/css/css.js +1 -1
  139. package/styled-system/jsx/is-valid-prop.js +1 -1
  140. package/styled-system/themes/theme-asagi.json +1 -1
  141. package/styled-system/themes/theme-kurikawa.json +1 -1
  142. package/styled-system/themes/theme-sumire.json +1 -1
  143. package/styled-system/themes/theme-tsutsuji.json +1 -1
  144. package/styled-system/tokens/index.js +1238 -54
  145. package/styled-system/tokens/tokens.d.ts +3 -3
  146. package/styled-system/types/conditions.d.ts +2 -2
  147. package/styled-system/types/prop-type.d.ts +1 -1
  148. package/dist/ui/styled-system/jsx/is-valid-prop.js +0 -6
  149. /package/dist/{ui/styled-system → styled-system}/css/conditions.js +0 -0
  150. /package/dist/{ui/styled-system → styled-system}/css/cx.js +0 -0
  151. /package/dist/{ui/styled-system → styled-system}/helpers.js +0 -0
  152. /package/dist/{ui/styled-system → styled-system}/jsx/box.js +0 -0
  153. /package/dist/{ui/styled-system → styled-system}/jsx/factory-helper.js +0 -0
  154. /package/dist/{ui/styled-system → styled-system}/jsx/factory.js +0 -0
  155. /package/dist/{ui/styled-system → styled-system}/patterns/box.js +0 -0
@@ -1,18 +1,19 @@
1
1
  import { createAnatomy as p } from "../../anatomy/dist/index.js";
2
- import { createScope as m, queryAll as E, dataAttr as c, visuallyHiddenStyle as h, nextTick as y } from "../../dom-query/dist/index.js";
3
- import { createMachine as b, guards as T } from "../../core/dist/index.js";
4
- import { trackElementRect as R } from "../../element-rect/dist/index.js";
5
- import { trackFormControl as C, dispatchInputCheckedEvent as S } from "../../form-utils/dist/index.js";
6
- import { compact as V, isString as k, isEqual as A } from "../../utils/dist/index.js";
7
- import { createProps as f } from "../../types/dist/index.js";
8
- var D = p("radio-group").parts(
2
+ import { createScope as m, dataAttr as c, visuallyHiddenStyle as E, queryAll as h, nextTick as b } from "../../dom-query/dist/index.js";
3
+ import { trackFocusVisible as y, isFocusVisible as T } from "../../focus-visible/dist/index.js";
4
+ import { createMachine as V, guards as R } from "../../core/dist/index.js";
5
+ import { trackElementRect as C } from "../../element-rect/dist/index.js";
6
+ import { dispatchInputCheckedEvent as S, trackFormControl as k } from "../../form-utils/dist/index.js";
7
+ import { compact as A, isString as F, isEqual as D } from "../../utils/dist/index.js";
8
+ import { createProps as I } from "../../types/dist/index.js";
9
+ var _ = p("radio-group").parts(
9
10
  "root",
10
11
  "label",
11
12
  "item",
12
13
  "itemText",
13
14
  "itemControl",
14
15
  "indicator"
15
- ), v = D.build(), o = m({
16
+ ), v = _.build(), n = m({
16
17
  getRootId: (e) => {
17
18
  var i;
18
19
  return ((i = e.ids) == null ? void 0 : i.root) ?? `radio-group:${e.id}`;
@@ -41,24 +42,24 @@ var D = p("radio-group").parts(
41
42
  var i;
42
43
  return ((i = e.ids) == null ? void 0 : i.indicator) ?? `radio-group:${e.id}:indicator`;
43
44
  },
44
- getRootEl: (e) => o.getById(e, o.getRootId(e)),
45
- getItemHiddenInputEl: (e, i) => o.getById(e, o.getItemHiddenInputId(e, i)),
46
- getIndicatorEl: (e) => o.getById(e, o.getIndicatorId(e)),
45
+ getRootEl: (e) => n.getById(e, n.getRootId(e)),
46
+ getItemHiddenInputEl: (e, i) => n.getById(e, n.getItemHiddenInputId(e, i)),
47
+ getIndicatorEl: (e) => n.getById(e, n.getIndicatorId(e)),
47
48
  getFirstEnabledInputEl: (e) => {
48
49
  var i;
49
- return (i = o.getRootEl(e)) == null ? void 0 : i.querySelector("input:not(:disabled)");
50
+ return (i = n.getRootEl(e)) == null ? void 0 : i.querySelector("input:not(:disabled)");
50
51
  },
51
52
  getFirstEnabledAndCheckedInputEl: (e) => {
52
53
  var i;
53
- return (i = o.getRootEl(e)) == null ? void 0 : i.querySelector("input:not(:disabled):checked");
54
+ return (i = n.getRootEl(e)) == null ? void 0 : i.querySelector("input:not(:disabled):checked");
54
55
  },
55
56
  getInputEls: (e) => {
56
- const t = `input[type=radio][data-ownedby='${CSS.escape(o.getRootId(e))}']:not([disabled])`;
57
- return E(o.getRootEl(e), t);
57
+ const t = `input[type=radio][data-ownedby='${CSS.escape(n.getRootId(e))}']:not([disabled])`;
58
+ return h(n.getRootEl(e), t);
58
59
  },
59
60
  getActiveRadioEl: (e) => {
60
61
  if (e.value)
61
- return o.getById(e, o.getItemId(e, e.value));
62
+ return n.getById(e, n.getItemId(e, e.value));
62
63
  },
63
64
  getOffsetRect: (e) => ({
64
65
  left: (e == null ? void 0 : e.offsetLeft) ?? 0,
@@ -67,9 +68,9 @@ var D = p("radio-group").parts(
67
68
  height: (e == null ? void 0 : e.offsetHeight) ?? 0
68
69
  }),
69
70
  getRectById: (e, i) => {
70
- const t = o.getById(e, o.getItemId(e, i));
71
+ const t = n.getById(e, n.getItemId(e, i));
71
72
  if (t)
72
- return o.resolveRect(o.getOffsetRect(t));
73
+ return n.resolveRect(n.getOffsetRect(t));
73
74
  },
74
75
  resolveRect: (e) => ({
75
76
  width: `${e.width}px`,
@@ -78,24 +79,25 @@ var D = p("radio-group").parts(
78
79
  top: `${e.top}px`
79
80
  })
80
81
  });
81
- function B(e, i, t) {
82
- const a = e.context.isDisabled, d = e.context.readOnly;
83
- function u(n) {
82
+ function M(e, i, t) {
83
+ const a = e.context.isDisabled, l = e.context.readOnly;
84
+ function u(o) {
84
85
  return {
85
- invalid: !!n.invalid,
86
- disabled: !!n.disabled || a,
87
- checked: e.context.value === n.value,
88
- focused: e.context.focusedValue === n.value,
89
- hovered: e.context.hoveredValue === n.value,
90
- active: e.context.activeValue === n.value
86
+ invalid: !!o.invalid,
87
+ disabled: !!o.disabled || a,
88
+ checked: e.context.value === o.value,
89
+ focused: e.context.focusedValue === o.value,
90
+ hovered: e.context.hoveredValue === o.value,
91
+ active: e.context.activeValue === o.value
91
92
  };
92
93
  }
93
- function s(n) {
94
- const r = u(n);
94
+ function s(o) {
95
+ const r = u(o);
95
96
  return {
96
97
  "data-focus": c(r.focused),
98
+ "data-focus-visible": c(r.focused && e.context.focusVisible),
97
99
  "data-disabled": c(r.disabled),
98
- "data-readonly": c(d),
100
+ "data-readonly": c(l),
99
101
  "data-state": r.checked ? "checked" : "unchecked",
100
102
  "data-hover": c(r.hovered),
101
103
  "data-invalid": c(r.invalid),
@@ -103,20 +105,20 @@ function B(e, i, t) {
103
105
  "data-ssr": c(e.context.ssr)
104
106
  };
105
107
  }
106
- const g = () => {
107
- const n = o.getFirstEnabledAndCheckedInputEl(e.context);
108
- if (n) {
109
- n.focus();
108
+ const f = () => {
109
+ const o = n.getFirstEnabledAndCheckedInputEl(e.context);
110
+ if (o) {
111
+ o.focus();
110
112
  return;
111
113
  }
112
- const r = o.getFirstEnabledInputEl(e.context);
114
+ const r = n.getFirstEnabledInputEl(e.context);
113
115
  r == null || r.focus();
114
116
  };
115
117
  return {
116
- focus: g,
118
+ focus: f,
117
119
  value: e.context.value,
118
- setValue(n) {
119
- i({ type: "SET_VALUE", value: n, isTrusted: !1 });
120
+ setValue(o) {
121
+ i({ type: "SET_VALUE", value: o, isTrusted: !1 });
120
122
  },
121
123
  clearValue() {
122
124
  i({ type: "SET_VALUE", value: null, isTrusted: !1 });
@@ -125,8 +127,8 @@ function B(e, i, t) {
125
127
  return t.element({
126
128
  ...v.root.attrs,
127
129
  role: "radiogroup",
128
- id: o.getRootId(e.context),
129
- "aria-labelledby": o.getLabelId(e.context),
130
+ id: n.getRootId(e.context),
131
+ "aria-labelledby": n.getLabelId(e.context),
130
132
  "data-orientation": e.context.orientation,
131
133
  "data-disabled": c(a),
132
134
  "aria-orientation": e.context.orientation,
@@ -142,89 +144,90 @@ function B(e, i, t) {
142
144
  dir: e.context.dir,
143
145
  "data-orientation": e.context.orientation,
144
146
  "data-disabled": c(a),
145
- id: o.getLabelId(e.context),
146
- onClick: g
147
+ id: n.getLabelId(e.context),
148
+ onClick: f
147
149
  });
148
150
  },
149
151
  getItemState: u,
150
- getItemProps(n) {
151
- const r = u(n);
152
+ getItemProps(o) {
153
+ const r = u(o);
152
154
  return t.label({
153
155
  ...v.item.attrs,
154
156
  dir: e.context.dir,
155
- id: o.getItemId(e.context, n.value),
156
- htmlFor: o.getItemHiddenInputId(e.context, n.value),
157
- ...s(n),
157
+ id: n.getItemId(e.context, o.value),
158
+ htmlFor: n.getItemHiddenInputId(e.context, o.value),
159
+ ...s(o),
158
160
  onPointerMove() {
159
- r.disabled || r.hovered || i({ type: "SET_HOVERED", value: n.value, hovered: !0 });
161
+ r.disabled || r.hovered || i({ type: "SET_HOVERED", value: o.value, hovered: !0 });
160
162
  },
161
163
  onPointerLeave() {
162
164
  r.disabled || i({ type: "SET_HOVERED", value: null });
163
165
  },
164
- onPointerDown(l) {
165
- r.disabled || (r.focused && l.pointerType === "mouse" && l.preventDefault(), i({ type: "SET_ACTIVE", value: n.value, active: !0 }));
166
+ onPointerDown(d) {
167
+ r.disabled || (r.focused && d.pointerType === "mouse" && d.preventDefault(), i({ type: "SET_ACTIVE", value: o.value, active: !0 }));
166
168
  },
167
169
  onPointerUp() {
168
170
  r.disabled || i({ type: "SET_ACTIVE", value: null });
169
171
  }
170
172
  });
171
173
  },
172
- getItemTextProps(n) {
174
+ getItemTextProps(o) {
173
175
  return t.element({
174
176
  ...v.itemText.attrs,
175
177
  dir: e.context.dir,
176
- id: o.getItemLabelId(e.context, n.value),
177
- ...s(n)
178
+ id: n.getItemLabelId(e.context, o.value),
179
+ ...s(o)
178
180
  });
179
181
  },
180
- getItemControlProps(n) {
181
- const r = u(n);
182
+ getItemControlProps(o) {
183
+ const r = u(o);
182
184
  return t.element({
183
185
  ...v.itemControl.attrs,
184
186
  dir: e.context.dir,
185
- id: o.getItemControlId(e.context, n.value),
187
+ id: n.getItemControlId(e.context, o.value),
186
188
  "data-active": c(r.active),
187
189
  "aria-hidden": !0,
188
- ...s(n)
190
+ ...s(o)
189
191
  });
190
192
  },
191
- getItemHiddenInputProps(n) {
192
- const r = u(n);
193
+ getItemHiddenInputProps(o) {
194
+ const r = u(o);
193
195
  return t.input({
194
- "data-ownedby": o.getRootId(e.context),
195
- id: o.getItemHiddenInputId(e.context, n.value),
196
+ "data-ownedby": n.getRootId(e.context),
197
+ id: n.getItemHiddenInputId(e.context, o.value),
196
198
  type: "radio",
197
199
  name: e.context.name || e.context.id,
198
200
  form: e.context.form,
199
- value: n.value,
200
- onClick(l) {
201
- if (d) {
202
- l.preventDefault();
201
+ value: o.value,
202
+ onClick(d) {
203
+ if (l) {
204
+ d.preventDefault();
203
205
  return;
204
206
  }
205
- l.currentTarget.checked && i({ type: "SET_VALUE", value: n.value, isTrusted: !0 });
207
+ d.currentTarget.checked && i({ type: "SET_VALUE", value: o.value, isTrusted: !0 });
206
208
  },
207
209
  onBlur() {
208
- i({ type: "SET_FOCUSED", value: null });
210
+ i({ type: "SET_FOCUSED", value: null, focused: !1, focusVisible: !1 });
209
211
  },
210
212
  onFocus() {
211
- i({ type: "SET_FOCUSED", value: n.value, focused: !0 });
213
+ const d = T();
214
+ i({ type: "SET_FOCUSED", value: o.value, focused: !0, focusVisible: d });
212
215
  },
213
- onKeyDown(l) {
214
- l.defaultPrevented || l.key === " " && i({ type: "SET_ACTIVE", value: n.value, active: !0 });
216
+ onKeyDown(d) {
217
+ d.defaultPrevented || d.key === " " && i({ type: "SET_ACTIVE", value: o.value, active: !0 });
215
218
  },
216
- onKeyUp(l) {
217
- l.defaultPrevented || l.key === " " && i({ type: "SET_ACTIVE", value: null });
219
+ onKeyUp(d) {
220
+ d.defaultPrevented || d.key === " " && i({ type: "SET_ACTIVE", value: null });
218
221
  },
219
222
  disabled: r.disabled,
220
223
  defaultChecked: r.checked,
221
- style: h
224
+ style: E
222
225
  });
223
226
  },
224
227
  getIndicatorProps() {
225
- var n, r, l, I;
228
+ var o, r, d, g;
226
229
  return t.element({
227
- id: o.getIndicatorId(e.context),
230
+ id: n.getIndicatorId(e.context),
228
231
  ...v.indicator.attrs,
229
232
  dir: e.context.dir,
230
233
  hidden: e.context.value == null,
@@ -232,10 +235,10 @@ function B(e, i, t) {
232
235
  "data-orientation": e.context.orientation,
233
236
  style: {
234
237
  "--transition-property": "left, top, width, height",
235
- "--left": (n = e.context.indicatorRect) == null ? void 0 : n.left,
238
+ "--left": (o = e.context.indicatorRect) == null ? void 0 : o.left,
236
239
  "--top": (r = e.context.indicatorRect) == null ? void 0 : r.top,
237
- "--width": (l = e.context.indicatorRect) == null ? void 0 : l.width,
238
- "--height": (I = e.context.indicatorRect) == null ? void 0 : I.height,
240
+ "--width": (d = e.context.indicatorRect) == null ? void 0 : d.width,
241
+ "--height": (g = e.context.indicatorRect) == null ? void 0 : g.height,
239
242
  position: "absolute",
240
243
  willChange: "var(--transition-property)",
241
244
  transitionProperty: "var(--transition-property)",
@@ -247,10 +250,10 @@ function B(e, i, t) {
247
250
  }
248
251
  };
249
252
  }
250
- var { not: _ } = T;
251
- function q(e) {
252
- const i = V(e);
253
- return b(
253
+ var { not: $ } = R;
254
+ function N(e) {
255
+ const i = A(e);
256
+ return V(
254
257
  {
255
258
  id: "radio",
256
259
  initial: "idle",
@@ -265,6 +268,7 @@ function q(e) {
265
268
  indicatorRect: {},
266
269
  canIndicatorTransition: !1,
267
270
  fieldsetDisabled: !1,
271
+ focusVisible: !1,
268
272
  ssr: !0
269
273
  },
270
274
  computed: {
@@ -272,14 +276,14 @@ function q(e) {
272
276
  },
273
277
  entry: ["syncIndicatorRect", "syncSsr"],
274
278
  exit: ["cleanupObserver"],
275
- activities: ["trackFormControlState"],
279
+ activities: ["trackFormControlState", "trackFocusVisible"],
276
280
  watch: {
277
281
  value: ["setIndicatorTransition", "syncIndicatorRect", "syncInputElements"]
278
282
  },
279
283
  on: {
280
284
  SET_VALUE: [
281
285
  {
282
- guard: _("isTrusted"),
286
+ guard: $("isTrusted"),
283
287
  actions: ["setValue", "dispatchChangeEvent"]
284
288
  },
285
289
  {
@@ -305,20 +309,23 @@ function q(e) {
305
309
  isTrusted: (t, a) => !!a.isTrusted
306
310
  },
307
311
  activities: {
308
- trackFormControlState(t, a, { send: d, initialContext: u }) {
309
- return C(o.getRootEl(t), {
312
+ trackFormControlState(t, a, { send: l, initialContext: u }) {
313
+ return k(n.getRootEl(t), {
310
314
  onFieldsetDisabledChange(s) {
311
315
  t.fieldsetDisabled = s;
312
316
  },
313
317
  onFormReset() {
314
- d({ type: "SET_VALUE", value: u.value });
318
+ l({ type: "SET_VALUE", value: u.value });
315
319
  }
316
320
  });
321
+ },
322
+ trackFocusVisible(t) {
323
+ return y({ root: n.getRootNode(t) });
317
324
  }
318
325
  },
319
326
  actions: {
320
327
  setValue(t, a) {
321
- $.value(t, a.value);
328
+ w.value(t, a.value);
322
329
  },
323
330
  setHovered(t, a) {
324
331
  t.hoveredValue = a.value;
@@ -327,15 +334,15 @@ function q(e) {
327
334
  t.activeValue = a.value;
328
335
  },
329
336
  setFocused(t, a) {
330
- t.focusedValue = a.value;
337
+ t.focusedValue = a.value, t.focusVisible = a.focusVisible;
331
338
  },
332
339
  syncInputElements(t) {
333
- o.getInputEls(t).forEach((d) => {
334
- d.checked = d.value === t.value;
340
+ n.getInputEls(t).forEach((l) => {
341
+ l.checked = l.value === t.value;
335
342
  });
336
343
  },
337
344
  setIndicatorTransition(t) {
338
- t.canIndicatorTransition = k(t.value);
345
+ t.canIndicatorTransition = F(t.value);
339
346
  },
340
347
  cleanupObserver(t) {
341
348
  var a;
@@ -346,44 +353,44 @@ function q(e) {
346
353
  },
347
354
  syncIndicatorRect(t) {
348
355
  var u;
349
- if ((u = t.indicatorCleanup) == null || u.call(t), !o.getIndicatorEl(t)) return;
350
- const a = t.value, d = o.getActiveRadioEl(t);
351
- if (a == null || !d) {
356
+ if ((u = t.indicatorCleanup) == null || u.call(t), !n.getIndicatorEl(t)) return;
357
+ const a = t.value, l = n.getActiveRadioEl(t);
358
+ if (a == null || !l) {
352
359
  t.indicatorRect = {};
353
360
  return;
354
361
  }
355
- t.indicatorCleanup = R(d, {
362
+ t.indicatorCleanup = C(l, {
356
363
  getRect(s) {
357
- return o.getOffsetRect(s);
364
+ return n.getOffsetRect(s);
358
365
  },
359
366
  onChange(s) {
360
- t.indicatorRect = o.resolveRect(s), y(() => {
367
+ t.indicatorRect = n.resolveRect(s), b(() => {
361
368
  t.canIndicatorTransition = !1;
362
369
  });
363
370
  }
364
371
  });
365
372
  },
366
373
  dispatchChangeEvent(t) {
367
- o.getInputEls(t).forEach((d) => {
368
- const u = d.value === t.value;
369
- u !== d.checked && S(d, { checked: u });
374
+ n.getInputEls(t).forEach((l) => {
375
+ const u = l.value === t.value;
376
+ u !== l.checked && S(l, { checked: u });
370
377
  });
371
378
  }
372
379
  }
373
380
  }
374
381
  );
375
382
  }
376
- var F = {
383
+ var P = {
377
384
  change: (e) => {
378
385
  var i;
379
386
  e.value != null && ((i = e.onValueChange) == null || i.call(e, { value: e.value }));
380
387
  }
381
- }, $ = {
388
+ }, w = {
382
389
  value: (e, i) => {
383
- A(e.value, i) || (e.value = i, F.change(e));
390
+ D(e.value, i) || (e.value = i, P.change(e));
384
391
  }
385
392
  };
386
- f()([
393
+ I()([
387
394
  "dir",
388
395
  "disabled",
389
396
  "form",
@@ -396,9 +403,9 @@ f()([
396
403
  "readOnly",
397
404
  "value"
398
405
  ]);
399
- f()(["value", "disabled", "invalid"]);
406
+ I()(["value", "disabled", "invalid"]);
400
407
  export {
401
- D as anatomy,
402
- B as connect,
403
- q as machine
408
+ _ as anatomy,
409
+ M as connect,
410
+ N as machine
404
411
  };
@@ -1,35 +1,36 @@
1
1
  import { createNormalizer as C } from "../../types/dist/index.js";
2
- import A, { useRef as f, useSyncExternalStore as O, useCallback as _, useMemo as E, useEffect as i, useLayoutEffect as M } from "react";
2
+ import O, { useRef as f, useLayoutEffect as A, useEffect as i, useSyncExternalStore as _, useCallback as j, useMemo as S } from "react";
3
3
  import "react-dom";
4
4
  import "react/jsx-runtime";
5
- import { makeGlobal as j, subscribe as w, snapshot as S } from "../../store/dist/index.js";
5
+ import { subscribe as M, snapshot as g, makeGlobal as w } from "../../store/dist/index.js";
6
6
  import { isChanged as R, createProxy as W } from "../../../proxy-compare/dist/index.js";
7
- var X = C((t) => t), g = (t) => (t == null ? void 0 : t.constructor.name) === "Array", z = (t, e) => {
7
+ var Y = C((t) => t), E = (t) => (t == null ? void 0 : t.constructor.name) === "Array", z = (t, e) => {
8
8
  if (t.length !== e.length) return !1;
9
9
  for (let r = 0; r < t.length; r++)
10
- if (!y(t[r], e[r])) return !1;
10
+ if (!p(t[r], e[r])) return !1;
11
11
  return !0;
12
- }, y = (t, e) => {
12
+ }, p = (t, e) => {
13
13
  if (Object.is(t, e)) return !0;
14
14
  if (t == null && e != null || t != null && e == null) return !1;
15
15
  if (typeof (t == null ? void 0 : t.isEqual) == "function" && typeof (e == null ? void 0 : e.isEqual) == "function")
16
16
  return t.isEqual(e);
17
17
  if (typeof t == "function" && typeof e == "function")
18
18
  return t.toString() === e.toString();
19
- if (g(t) && g(e))
19
+ if (E(t) && E(e))
20
20
  return z(Array.from(t), Array.from(e));
21
21
  if (typeof t != "object" || typeof e != "object") return !1;
22
22
  const r = Object.keys(e ?? /* @__PURE__ */ Object.create(null)), o = r.length;
23
23
  for (let n = 0; n < o; n++)
24
24
  if (!Reflect.has(t, r[n])) return !1;
25
25
  for (let n = 0; n < o; n++) {
26
- const s = r[n];
27
- if (!y(t[s], e[s])) return !1;
26
+ const c = r[n];
27
+ if (!p(t[c], e[c])) return !1;
28
28
  }
29
29
  return !0;
30
- }, K = () => process.env.NODE_ENV !== "production";
30
+ }, K = () => process.env.NODE_ENV !== "production", L = Function.prototype.toString;
31
+ L.call(Object);
31
32
  function k(t) {
32
- if (!L(t) || t === void 0)
33
+ if (!N(t) || t === void 0)
33
34
  return t;
34
35
  const e = Reflect.ownKeys(t).filter((o) => typeof o == "string"), r = {};
35
36
  for (const o of e) {
@@ -38,8 +39,8 @@ function k(t) {
38
39
  }
39
40
  return r;
40
41
  }
41
- var L = (t) => t && typeof t == "object" && t.constructor === Object;
42
- function N(t, e) {
42
+ var N = (t) => t && typeof t == "object" && t.constructor === Object;
43
+ function P(t, e) {
43
44
  const r = f(!1), o = f(!1);
44
45
  i(() => {
45
46
  if (r.current && o.current)
@@ -49,65 +50,65 @@ function N(t, e) {
49
50
  r.current = !1;
50
51
  }), []);
51
52
  }
52
- var { use: x } = A, P = j("__zag__targetCache", () => /* @__PURE__ */ new WeakMap());
53
+ var { use: x } = O, D = w("__zag__targetCache", () => /* @__PURE__ */ new WeakMap());
53
54
  function q(t, e) {
54
- const { actions: r, context: o, sync: n } = e ?? {}, s = f(), c = f(), d = O(
55
- _((u) => w(t.state, u, n), [n]),
55
+ const { actions: r, context: o, sync: n } = e ?? {}, c = f(), s = f(), y = _(
56
+ j((u) => M(t.state, u, n), [n]),
56
57
  () => {
57
- const u = S(t.state, x);
58
+ const u = g(t.state, x);
58
59
  try {
59
- if (s.current && c.current && !R(s.current, u, c.current, /* @__PURE__ */ new WeakMap()))
60
- return s.current;
60
+ if (c.current && s.current && !R(c.current, u, s.current, /* @__PURE__ */ new WeakMap()))
61
+ return c.current;
61
62
  } catch {
62
63
  }
63
64
  return u;
64
65
  },
65
- () => S(t.state, x)
66
+ () => g(t.state, x)
66
67
  );
67
68
  t.setOptions({ actions: r });
68
- const l = E(() => k(o ?? {}), [o]);
69
- N(() => {
70
- const u = Object.entries(l), p = t.contextSnapshot ?? {};
69
+ const l = S(() => k(o ?? {}), [o]);
70
+ P(() => {
71
+ const u = Object.entries(l), h = t.contextSnapshot ?? {};
71
72
  u.map(([a, m]) => ({
72
73
  key: a,
73
74
  curr: m,
74
- prev: p[a],
75
- equal: y(p[a], m)
75
+ prev: h[a],
76
+ equal: p(h[a], m)
76
77
  })).every(({ equal: a }) => a) || t.setContext(l);
77
78
  }, [l]);
78
- const h = /* @__PURE__ */ new WeakMap();
79
+ const d = /* @__PURE__ */ new WeakMap();
79
80
  i(() => {
80
- s.current = d, c.current = h;
81
+ c.current = y, s.current = d;
81
82
  });
82
- const v = E(() => /* @__PURE__ */ new WeakMap(), []);
83
- return W(d, h, v, P);
83
+ const v = S(() => /* @__PURE__ */ new WeakMap(), []);
84
+ return W(y, d, v, D);
84
85
  }
85
- function Y(t) {
86
+ function Z(t) {
86
87
  return [q(t), t.send];
87
88
  }
88
- function D(t) {
89
+ function I(t) {
89
90
  const e = f();
90
91
  return e.current || (e.current = { v: t() }), e.current.v;
91
92
  }
92
- var I = typeof document < "u" ? M : i;
93
+ var F = typeof document < "u" ? A : i;
93
94
  function G(t, e) {
94
- const { state: r, context: o } = e ?? {}, n = D(() => {
95
- const c = typeof t == "function" ? t() : t;
96
- return o && c.setContext(o), c._created(), c;
97
- }), s = f();
98
- return I(() => {
99
- const c = r ?? s.current;
100
- return n.start(c), () => {
101
- K() && (s.current = n.getHydrationState()), n.stop();
95
+ const { state: r, context: o } = e ?? {}, n = I(() => {
96
+ const s = typeof t == "function" ? t() : t;
97
+ return o && s.setContext(o), s._created(), s;
98
+ }), c = f();
99
+ return F(() => {
100
+ const s = r ?? c.current;
101
+ return n.start(s), () => {
102
+ K() && (c.current = n.getHydrationState()), n.stop();
102
103
  };
103
104
  }, []), n;
104
105
  }
105
- function Z(t, e) {
106
+ function $(t, e) {
106
107
  const r = G(t, e);
107
108
  return [q(r, e), r.send, r];
108
109
  }
109
110
  export {
110
- X as normalizeProps,
111
- Y as useActor,
112
- Z as useMachine
111
+ Y as normalizeProps,
112
+ Z as useActor,
113
+ $ as useMachine
113
114
  };