@serendie/ui 0.1.15 → 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 (156) 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 +10 -9
  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 +7 -6
  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/PasswordField.js +44 -0
  24. package/dist/components/ProgressIndicator.js +4 -4
  25. package/dist/components/RadioButton.js +4 -4
  26. package/dist/components/Search.js +6 -6
  27. package/dist/components/Select.js +4 -4
  28. package/dist/components/Switch.js +4 -4
  29. package/dist/components/TabItem.js +4 -4
  30. package/dist/components/Tabs.js +4 -4
  31. package/dist/components/TextArea.js +4 -4
  32. package/dist/components/TextField.js +4 -4
  33. package/dist/components/Toast.js +3 -3
  34. package/dist/components/TopAppBar.js +4 -4
  35. package/dist/index.d.ts +2 -1
  36. package/dist/index.js +81 -79
  37. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +3 -4
  38. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -5
  39. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +0 -1
  40. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +3 -4
  41. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-root.js +2 -3
  42. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-fallback.js +6 -7
  43. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-image.js +5 -6
  44. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +2 -3
  45. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js +5 -6
  46. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +0 -1
  47. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js +0 -1
  48. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js +4 -5
  49. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +8 -9
  50. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root.js +0 -1
  51. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +3 -4
  52. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-control.js +5 -6
  53. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-input.js +6 -7
  54. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +0 -1
  55. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-text.js +3 -4
  56. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item.js +0 -1
  57. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +5 -6
  58. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +4 -5
  59. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +5 -6
  60. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +4 -5
  61. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +5 -6
  62. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +0 -1
  63. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +0 -1
  64. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js +5 -6
  65. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js +4 -5
  66. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js +0 -1
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +3 -4
  68. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +0 -1
  69. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +2 -3
  70. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js +3 -4
  71. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +2 -3
  72. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js +3 -4
  73. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +3 -4
  74. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js +0 -1
  75. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -5
  76. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +3 -4
  77. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-root.js +3 -4
  78. package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +3 -4
  79. package/dist/node_modules/@ark-ui/react/dist/components/select/select-control.js +6 -7
  80. package/dist/node_modules/@ark-ui/react/dist/components/select/select-item.js +0 -1
  81. package/dist/node_modules/@ark-ui/react/dist/components/select/select-label.js +4 -5
  82. package/dist/node_modules/@ark-ui/react/dist/components/select/select-positioner.js +4 -5
  83. package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +7 -7
  84. package/dist/node_modules/@ark-ui/react/dist/components/select/select-trigger.js +5 -6
  85. package/dist/node_modules/@ark-ui/react/dist/components/select/select-value-text.js +5 -6
  86. package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +35 -31
  87. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-control.js +4 -5
  88. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -5
  89. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-label.js +4 -5
  90. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-root.js +8 -9
  91. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js +4 -5
  92. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-list.js +3 -4
  93. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-trigger.js +3 -4
  94. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +10 -10
  95. package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-root.js +0 -1
  96. package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-title.js +0 -1
  97. package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +4 -4
  98. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +361 -303
  99. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +229 -216
  100. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +19 -19
  101. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +39 -38
  102. package/dist/node_modules/@serendie/design-token/dist/panda-tokens.js +823 -20
  103. package/dist/node_modules/@serendie/design-token/dist/tokens.js +346 -25
  104. package/dist/node_modules/@zag-js/accordion/dist/index.js +12 -12
  105. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +13 -62
  106. package/dist/node_modules/@zag-js/avatar/dist/index.js +12 -10
  107. package/dist/node_modules/@zag-js/checkbox/dist/index.js +99 -92
  108. package/dist/node_modules/@zag-js/collapsible/dist/index.js +5 -5
  109. package/dist/node_modules/@zag-js/collection/dist/index.js +21 -21
  110. package/dist/node_modules/@zag-js/combobox/dist/index.js +30 -31
  111. package/dist/node_modules/@zag-js/core/dist/index.js +285 -320
  112. package/dist/node_modules/@zag-js/dialog/dist/index.js +56 -62
  113. package/dist/node_modules/@zag-js/dismissable/dist/index.js +3 -3
  114. package/dist/node_modules/@zag-js/dom-event/dist/index.js +88 -115
  115. package/dist/node_modules/@zag-js/dom-query/dist/index.js +2 -2
  116. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +73 -0
  117. package/dist/node_modules/@zag-js/interact-outside/dist/index.js +33 -33
  118. package/dist/node_modules/@zag-js/menu/dist/index.js +81 -77
  119. package/dist/node_modules/@zag-js/popper/dist/index.js +86 -79
  120. package/dist/node_modules/@zag-js/radio-group/dist/index.js +116 -109
  121. package/dist/node_modules/@zag-js/react/dist/index.js +44 -43
  122. package/dist/node_modules/@zag-js/select/dist/index.js +203 -231
  123. package/dist/node_modules/@zag-js/store/dist/index.js +110 -110
  124. package/dist/node_modules/@zag-js/switch/dist/index.js +62 -55
  125. package/dist/node_modules/@zag-js/tabs/dist/index.js +64 -61
  126. package/dist/node_modules/@zag-js/toast/dist/index.js +174 -173
  127. package/dist/node_modules/@zag-js/utils/dist/index.js +93 -71
  128. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  129. package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +217 -219
  130. package/dist/preset.d.ts +807 -4
  131. package/dist/{ui/styled-system → styled-system}/css/css.js +5 -6
  132. package/dist/{ui/styled-system → styled-system}/css/cva.js +4 -4
  133. package/dist/{ui/styled-system → styled-system}/css/sva.js +3 -3
  134. package/dist/styled-system/jsx/is-valid-prop.js +6 -0
  135. package/dist/styles.css +1 -1
  136. package/dist/tokens/getToken.d.ts +324 -3
  137. package/dist/tokens/index.d.ts +806 -3
  138. package/package.json +31 -5
  139. package/styled-system/css/css.js +1 -1
  140. package/styled-system/jsx/is-valid-prop.js +1 -1
  141. package/styled-system/themes/theme-asagi.json +1 -1
  142. package/styled-system/themes/theme-kurikawa.json +1 -1
  143. package/styled-system/themes/theme-sumire.json +1 -1
  144. package/styled-system/themes/theme-tsutsuji.json +1 -1
  145. package/styled-system/tokens/index.js +1238 -54
  146. package/styled-system/tokens/tokens.d.ts +3 -3
  147. package/styled-system/types/conditions.d.ts +2 -2
  148. package/styled-system/types/prop-type.d.ts +1 -1
  149. package/dist/ui/styled-system/jsx/is-valid-prop.js +0 -6
  150. /package/dist/{ui/styled-system → styled-system}/css/conditions.js +0 -0
  151. /package/dist/{ui/styled-system → styled-system}/css/cx.js +0 -0
  152. /package/dist/{ui/styled-system → styled-system}/helpers.js +0 -0
  153. /package/dist/{ui/styled-system → styled-system}/jsx/box.js +0 -0
  154. /package/dist/{ui/styled-system → styled-system}/jsx/factory-helper.js +0 -0
  155. /package/dist/{ui/styled-system → styled-system}/jsx/factory.js +0 -0
  156. /package/dist/{ui/styled-system → styled-system}/patterns/box.js +0 -0
@@ -1,68 +1,19 @@
1
- import { raf as w } from "../../dom-query/dist/index.js";
2
- var f = /* @__PURE__ */ new WeakMap(), o = [];
3
- function T(d, u = {}) {
4
- const { rootEl: E } = u, s = d.filter(Boolean);
5
- if (s.length === 0) return;
6
- const l = s[0].ownerDocument || document, r = l.defaultView ?? window, a = new Set(s), c = /* @__PURE__ */ new Set(), p = E ?? l.body;
7
- let g = (e) => {
8
- for (let i of e.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))
9
- a.add(i);
10
- let n = (i) => {
11
- if (a.has(i) || c.has(i.parentElement) && i.parentElement.getAttribute("role") !== "row")
12
- return NodeFilter.FILTER_REJECT;
13
- for (let N of a)
14
- if (i.contains(N))
15
- return NodeFilter.FILTER_SKIP;
16
- return NodeFilter.FILTER_ACCEPT;
17
- }, t = l.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: n }), v = n(e);
18
- if (v === NodeFilter.FILTER_ACCEPT && m(e), v !== NodeFilter.FILTER_REJECT) {
19
- let i = t.nextNode();
20
- for (; i != null; )
21
- m(i), i = t.nextNode();
22
- }
23
- }, m = (e) => {
24
- let n = f.get(e) ?? 0;
25
- e.getAttribute("aria-hidden") === "true" && n === 0 || (n === 0 && e.setAttribute("aria-hidden", "true"), c.add(e), f.set(e, n + 1));
26
- };
27
- o.length && o[o.length - 1].disconnect(), g(p);
28
- const h = new r.MutationObserver((e) => {
29
- for (let n of e)
30
- if (!(n.type !== "childList" || n.addedNodes.length === 0) && ![...a, ...c].some((t) => t.contains(n.target))) {
31
- for (let t of n.removedNodes)
32
- t instanceof r.Element && (a.delete(t), c.delete(t));
33
- for (let t of n.addedNodes)
34
- (t instanceof r.HTMLElement || t instanceof r.SVGElement) && (t.dataset.liveAnnouncer === "true" || t.dataset.zagTopLayer === "true") ? a.add(t) : t instanceof r.Element && g(t);
35
- }
36
- });
37
- h.observe(p, { childList: !0, subtree: !0 });
38
- let b = {
39
- observe() {
40
- h.observe(p, { childList: !0, subtree: !0 });
41
- },
42
- disconnect() {
43
- h.disconnect();
44
- }
45
- };
46
- return o.push(b), () => {
47
- h.disconnect();
48
- for (let e of c) {
49
- let n = f.get(e);
50
- n === 1 ? (e.removeAttribute("aria-hidden"), f.delete(e)) : f.set(e, n - 1);
51
- }
52
- b === o[o.length - 1] ? (o.pop(), o.length && o[o.length - 1].observe()) : o.splice(o.indexOf(b), 1);
53
- };
54
- }
55
- function F(d, u = {}) {
56
- const { defer: E } = u, s = E ? w : (r) => r(), l = [];
57
- return l.push(
58
- s(() => {
59
- const r = typeof d == "function" ? d() : d;
60
- l.push(T(r, u));
1
+ import { hideOthers as s } from "../../../aria-hidden/dist/es2015/index.js";
2
+ var i = (t) => {
3
+ const o = requestAnimationFrame(() => t());
4
+ return () => cancelAnimationFrame(o);
5
+ };
6
+ function m(t, o = {}) {
7
+ const { defer: n = !0 } = o, a = n ? i : (e) => e(), r = [];
8
+ return r.push(
9
+ a(() => {
10
+ const c = (typeof t == "function" ? t() : t).filter(Boolean);
11
+ r.push(s(c));
61
12
  })
62
13
  ), () => {
63
- l.forEach((r) => r == null ? void 0 : r());
14
+ r.forEach((e) => e == null ? void 0 : e());
64
15
  };
65
16
  }
66
17
  export {
67
- F as ariaHidden
18
+ m as ariaHidden
68
19
  };
@@ -1,9 +1,9 @@
1
1
  import { createAnatomy as g } from "../../anatomy/dist/index.js";
2
- import { createScope as l, observeAttributes as m, observeChildren as v } from "../../dom-query/dist/index.js";
2
+ import { createScope as l, observeChildren as m, observeAttributes as v } from "../../dom-query/dist/index.js";
3
3
  import { createMachine as I } from "../../core/dist/index.js";
4
4
  import { compact as p } from "../../utils/dist/index.js";
5
- import { createProps as R } from "../../types/dist/index.js";
6
- var E = g("avatar").parts("root", "image", "fallback"), c = E.build(), o = l({
5
+ import { createProps as E } from "../../types/dist/index.js";
6
+ var R = g("avatar").parts("root", "image", "fallback"), c = R.build(), o = l({
7
7
  getRootId: (t) => {
8
8
  var a;
9
9
  return ((a = t.ids) == null ? void 0 : a.root) ?? `avatar:${t.id}`;
@@ -19,7 +19,7 @@ var E = g("avatar").parts("root", "image", "fallback"), c = E.build(), o = l({
19
19
  getRootEl: (t) => o.getById(t, o.getRootId(t)),
20
20
  getImageEl: (t) => o.getById(t, o.getImageId(t))
21
21
  });
22
- function y(t, a, e) {
22
+ function S(t, a, e) {
23
23
  const r = t.matches("loaded");
24
24
  return {
25
25
  loaded: r,
@@ -120,7 +120,7 @@ function G(t) {
120
120
  activities: {
121
121
  trackSrcChange(e, r, { send: n }) {
122
122
  const i = o.getImageEl(e);
123
- return m(i, {
123
+ return v(i, {
124
124
  attributes: ["src", "srcset"],
125
125
  callback() {
126
126
  n({ type: "SRC.CHANGE" });
@@ -129,9 +129,11 @@ function G(t) {
129
129
  },
130
130
  trackImageRemoval(e, r, { send: n }) {
131
131
  const i = o.getRootEl(e);
132
- return v(i, {
132
+ return m(i, {
133
133
  callback(d) {
134
- Array.from(d[0].removedNodes).find((s) => s.matches("[data-scope=avatar][data-part=image]")) && n({ type: "IMG.UNMOUNT" });
134
+ Array.from(d[0].removedNodes).find(
135
+ (s) => s.nodeType === Node.ELEMENT_NODE && s.matches("[data-scope=avatar][data-part=image]")
136
+ ) && n({ type: "IMG.UNMOUNT" });
135
137
  }
136
138
  });
137
139
  }
@@ -159,9 +161,9 @@ function G(t) {
159
161
  function k(t) {
160
162
  return t.complete && t.naturalWidth !== 0 && t.naturalHeight !== 0;
161
163
  }
162
- R()(["dir", "id", "ids", "onStatusChange", "getRootNode"]);
164
+ E()(["dir", "id", "ids", "onStatusChange", "getRootNode"]);
163
165
  export {
164
- E as anatomy,
165
- y as connect,
166
+ R as anatomy,
167
+ S as connect,
166
168
  G as machine
167
169
  };
@@ -1,11 +1,12 @@
1
- import { createAnatomy as E } from "../../anatomy/dist/index.js";
2
- import { createScope as m, dataAttr as i, visuallyHiddenStyle as b } from "../../dom-query/dist/index.js";
3
- import { createMachine as v, guards as I } from "../../core/dist/index.js";
4
- import { trackPress as y, trackFocusVisible as T } from "../../dom-event/dist/index.js";
5
- import { trackFormControl as H, setElementChecked as D, dispatchInputCheckedEvent as P } from "../../form-utils/dist/index.js";
6
- import { compact as x, isEqual as S } from "../../utils/dist/index.js";
7
- import { createProps as F } from "../../types/dist/index.js";
8
- var O = E("checkbox").parts("root", "label", "control", "indicator"), u = O.build(), o = m({
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({
9
10
  getRootId: (e) => {
10
11
  var d;
11
12
  return ((d = e.ids) == null ? void 0 : d.root) ?? `checkbox:${e.id}`;
@@ -22,103 +23,111 @@ var O = E("checkbox").parts("root", "label", "control", "indicator"), u = O.buil
22
23
  var d;
23
24
  return ((d = e.ids) == null ? void 0 : d.hiddenInput) ?? `checkbox:${e.id}:input`;
24
25
  },
25
- getRootEl: (e) => o.getById(e, o.getRootId(e)),
26
- getHiddenInputEl: (e) => o.getById(e, o.getHiddenInputId(e))
26
+ getRootEl: (e) => n.getById(e, n.getRootId(e)),
27
+ getHiddenInputEl: (e) => n.getById(e, n.getHiddenInputId(e))
27
28
  });
28
- function A(e, d, t) {
29
- const n = e.context.isDisabled, s = !n && e.context.focused, c = e.context.isChecked, a = e.context.isIndeterminate, k = e.context.readOnly, l = {
30
- "data-active": i(e.context.active),
31
- "data-focus": i(s),
32
- "data-readonly": i(k),
33
- "data-hover": i(e.context.hovered),
34
- "data-disabled": i(n),
35
- "data-state": a ? "indeterminate" : e.context.checked ? "checked" : "unchecked",
36
- "data-invalid": i(e.context.invalid)
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)
37
39
  };
38
40
  return {
39
- checked: c,
40
- disabled: n,
41
- indeterminate: a,
42
- focused: s,
41
+ checked: h,
42
+ disabled: o,
43
+ indeterminate: k,
44
+ focused: a,
43
45
  checkedState: e.context.checked,
44
- setChecked(r) {
45
- d({ type: "CHECKED.SET", checked: r, isTrusted: !1 });
46
+ setChecked(i) {
47
+ d({ type: "CHECKED.SET", checked: i, isTrusted: !1 });
46
48
  },
47
49
  toggleChecked() {
48
- d({ type: "CHECKED.TOGGLE", checked: c, isTrusted: !1 });
50
+ d({ type: "CHECKED.TOGGLE", checked: h, isTrusted: !1 });
49
51
  },
50
52
  getRootProps() {
51
53
  return t.label({
52
- ...u.root.attrs,
53
- ...l,
54
+ ...l.root.attrs,
55
+ ...s,
54
56
  dir: e.context.dir,
55
- id: o.getRootId(e.context),
56
- htmlFor: o.getHiddenInputId(e.context),
57
+ id: n.getRootId(e.context),
58
+ htmlFor: n.getHiddenInputId(e.context),
57
59
  onPointerMove() {
58
- n || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
60
+ o || d({ type: "CONTEXT.SET", context: { hovered: !0 } });
59
61
  },
60
62
  onPointerLeave() {
61
- n || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
63
+ o || d({ type: "CONTEXT.SET", context: { hovered: !1 } });
62
64
  },
63
- onClick(r) {
64
- r.target === o.getHiddenInputEl(e.context) && r.stopPropagation();
65
+ onClick(i) {
66
+ i.target === n.getHiddenInputEl(e.context) && i.stopPropagation();
65
67
  }
66
68
  });
67
69
  },
68
70
  getLabelProps() {
69
71
  return t.element({
70
- ...u.label.attrs,
71
- ...l,
72
+ ...l.label.attrs,
73
+ ...s,
72
74
  dir: e.context.dir,
73
- id: o.getLabelId(e.context)
75
+ id: n.getLabelId(e.context)
74
76
  });
75
77
  },
76
78
  getControlProps() {
77
79
  return t.element({
78
- ...u.control.attrs,
79
- ...l,
80
+ ...l.control.attrs,
81
+ ...s,
80
82
  dir: e.context.dir,
81
- id: o.getControlId(e.context),
83
+ id: n.getControlId(e.context),
82
84
  "aria-hidden": !0
83
85
  });
84
86
  },
85
87
  getIndicatorProps() {
86
88
  return t.element({
87
- ...u.indicator.attrs,
88
- ...l,
89
+ ...l.indicator.attrs,
90
+ ...s,
89
91
  dir: e.context.dir,
90
- hidden: !a && !e.context.checked
92
+ hidden: !k && !e.context.checked
91
93
  });
92
94
  },
93
95
  getHiddenInputProps() {
94
96
  return t.input({
95
- id: o.getHiddenInputId(e.context),
97
+ id: n.getHiddenInputId(e.context),
96
98
  type: "checkbox",
97
99
  required: e.context.required,
98
- defaultChecked: c,
99
- disabled: n,
100
- "aria-labelledby": o.getLabelId(e.context),
100
+ defaultChecked: h,
101
+ disabled: o,
102
+ "aria-labelledby": n.getLabelId(e.context),
101
103
  "aria-invalid": e.context.invalid,
102
104
  name: e.context.name,
103
105
  form: e.context.form,
104
106
  value: e.context.value,
105
- style: b,
106
- onClick(r) {
107
- if (k) {
108
- r.preventDefault();
107
+ style: v,
108
+ onFocus() {
109
+ const i = T();
110
+ d({ type: "CONTEXT.SET", context: { focused: !0, focusVisible: i } });
111
+ },
112
+ onBlur() {
113
+ d({ type: "CONTEXT.SET", context: { focused: !1, focusVisible: !1 } });
114
+ },
115
+ onClick(i) {
116
+ if (r) {
117
+ i.preventDefault();
109
118
  return;
110
119
  }
111
- const C = r.currentTarget.checked;
112
- d({ type: "CHECKED.SET", checked: C, isTrusted: !0 });
120
+ const E = i.currentTarget.checked;
121
+ d({ type: "CHECKED.SET", checked: E, isTrusted: !0 });
113
122
  }
114
123
  });
115
124
  }
116
125
  };
117
126
  }
118
- var { not: p } = I;
119
- function B(e) {
120
- const d = x(e);
121
- return v(
127
+ var { not: p } = H;
128
+ function _(e) {
129
+ const d = F(e);
130
+ return y(
122
131
  {
123
132
  id: "checkbox",
124
133
  initial: "ready",
@@ -127,7 +136,8 @@ function B(e) {
127
136
  value: "on",
128
137
  disabled: !1,
129
138
  ...d,
130
- fieldsetDisabled: !1
139
+ fieldsetDisabled: !1,
140
+ focusVisible: !1
131
141
  },
132
142
  watch: {
133
143
  disabled: "removeFocusIfNeeded",
@@ -158,7 +168,7 @@ function B(e) {
158
168
  }
159
169
  },
160
170
  computed: {
161
- isIndeterminate: (t) => h(t.checked),
171
+ isIndeterminate: (t) => f(t.checked),
162
172
  isChecked: (t) => g(t.checked),
163
173
  isDisabled: (t) => !!t.disabled || t.fieldsetDisabled
164
174
  },
@@ -168,15 +178,15 @@ function B(e) {
168
178
  },
169
179
  {
170
180
  guards: {
171
- isTrusted: (t, n) => !!n.isTrusted
181
+ isTrusted: (t, o) => !!o.isTrusted
172
182
  },
173
183
  activities: {
174
184
  trackPressEvent(t) {
175
185
  if (!t.isDisabled)
176
- return y({
177
- pointerNode: o.getRootEl(t),
178
- keyboardNode: o.getHiddenInputEl(t),
179
- isValidKey: (n) => n.key === " ",
186
+ return x({
187
+ pointerNode: n.getRootEl(t),
188
+ keyboardNode: n.getHiddenInputEl(t),
189
+ isValidKey: (o) => o.key === " ",
180
190
  onPress: () => t.active = !1,
181
191
  onPressStart: () => t.active = !0,
182
192
  onPressEnd: () => t.active = !1
@@ -184,65 +194,62 @@ function B(e) {
184
194
  },
185
195
  trackFocusVisible(t) {
186
196
  if (!t.isDisabled)
187
- return T(o.getHiddenInputEl(t), {
188
- onFocus: () => t.focused = !0,
189
- onBlur: () => t.focused = !1
190
- });
197
+ return I({ root: n.getRootNode(t) });
191
198
  },
192
- trackFormControlState(t, n, { send: s, initialContext: c }) {
193
- return H(o.getHiddenInputEl(t), {
194
- onFieldsetDisabledChange(a) {
195
- t.fieldsetDisabled = a;
199
+ trackFormControlState(t, o, { send: r, initialContext: a }) {
200
+ return S(n.getHiddenInputEl(t), {
201
+ onFieldsetDisabledChange(u) {
202
+ t.fieldsetDisabled = u;
196
203
  },
197
204
  onFormReset() {
198
- s({ type: "CHECKED.SET", checked: !!c.checked });
205
+ r({ type: "CHECKED.SET", checked: !!a.checked });
199
206
  }
200
207
  });
201
208
  }
202
209
  },
203
210
  actions: {
204
- setContext(t, n) {
205
- Object.assign(t, n.context);
211
+ setContext(t, o) {
212
+ Object.assign(t, o.context);
206
213
  },
207
214
  syncInputElement(t) {
208
- const n = o.getHiddenInputEl(t);
209
- n && (D(n, t.isChecked), n.indeterminate = t.isIndeterminate);
215
+ const o = n.getHiddenInputEl(t);
216
+ o && (P(o, t.isChecked), o.indeterminate = t.isIndeterminate);
210
217
  },
211
218
  removeFocusIfNeeded(t) {
212
- t.disabled && t.focused && (t.focused = !1);
219
+ t.disabled && t.focused && (t.focused = !1, t.focusVisible = !1);
213
220
  },
214
- setChecked(t, n) {
215
- f.checked(t, n.checked);
221
+ setChecked(t, o) {
222
+ C.checked(t, o.checked);
216
223
  },
217
224
  toggleChecked(t) {
218
- const n = h(t.checked) ? !0 : !t.checked;
219
- f.checked(t, n);
225
+ const o = f(t.checked) ? !0 : !t.checked;
226
+ C.checked(t, o);
220
227
  },
221
228
  dispatchChangeEvent(t) {
222
- const n = o.getHiddenInputEl(t);
223
- P(n, { checked: g(t.checked) });
229
+ const o = n.getHiddenInputEl(t);
230
+ D(o, { checked: g(t.checked) });
224
231
  }
225
232
  }
226
233
  }
227
234
  );
228
235
  }
229
- function h(e) {
236
+ function f(e) {
230
237
  return e === "indeterminate";
231
238
  }
232
239
  function g(e) {
233
- return h(e) ? !1 : !!e;
240
+ return f(e) ? !1 : !!e;
234
241
  }
235
- var N = {
242
+ var R = {
236
243
  change: (e) => {
237
244
  var d;
238
245
  (d = e.onCheckedChange) == null || d.call(e, { checked: e.checked });
239
246
  }
240
- }, f = {
247
+ }, C = {
241
248
  checked: (e, d) => {
242
- S(e.checked, d) || (e.checked = d, N.change(e));
249
+ V(e.checked, d) || (e.checked = d, R.change(e));
243
250
  }
244
251
  };
245
- F()([
252
+ N()([
246
253
  "checked",
247
254
  "dir",
248
255
  "disabled",
@@ -259,6 +266,6 @@ F()([
259
266
  ]);
260
267
  export {
261
268
  O as anatomy,
262
- A as connect,
263
- B as machine
269
+ M as connect,
270
+ _ as machine
264
271
  };
@@ -1,5 +1,5 @@
1
1
  import { createAnatomy as E } from "../../anatomy/dist/index.js";
2
- import { createScope as N, dataAttr as c, raf as O, getComputedStyle as f } from "../../dom-query/dist/index.js";
2
+ import { raf as c, createScope as N, getComputedStyle as f, dataAttr as O } from "../../dom-query/dist/index.js";
3
3
  import { createMachine as h } from "../../core/dist/index.js";
4
4
  import { compact as v } from "../../utils/dist/index.js";
5
5
  import { createProps as y } from "../../types/dist/index.js";
@@ -43,7 +43,7 @@ function T(n, r, e) {
43
43
  ...g.content.attrs,
44
44
  "data-state": d ? void 0 : i ? "open" : "closed",
45
45
  id: l.getContentId(n.context),
46
- "data-disabled": c(a),
46
+ "data-disabled": O(a),
47
47
  hidden: !o,
48
48
  style: {
49
49
  "--height": t != null ? `${t}px` : void 0,
@@ -58,7 +58,7 @@ function T(n, r, e) {
58
58
  dir: n.context.dir,
59
59
  type: "button",
60
60
  "data-state": i ? "open" : "closed",
61
- "data-disabled": c(a),
61
+ "data-disabled": O(a),
62
62
  "aria-controls": l.getContentId(n.context),
63
63
  "aria-expanded": o || !1,
64
64
  onClick(p) {
@@ -160,7 +160,7 @@ function P(n) {
160
160
  activities: {
161
161
  trackAnimationEvents(e, o, { send: i }) {
162
162
  let t;
163
- const s = O(() => {
163
+ const s = c(() => {
164
164
  const a = l.getContentEl(e);
165
165
  if (!a) return;
166
166
  const d = f(a).animationName;
@@ -190,7 +190,7 @@ function P(n) {
190
190
  },
191
191
  computeSize(e, o) {
192
192
  var i;
193
- (i = e._rafCleanup) == null || i.call(e), e._rafCleanup = O(() => {
193
+ (i = e._rafCleanup) == null || i.call(e), e._rafCleanup = c(() => {
194
194
  const t = l.getContentEl(e);
195
195
  if (!t) return;
196
196
  if (e.stylesRef || (e.stylesRef = I({
@@ -1,17 +1,17 @@
1
- import { isEqual as c, isObject as a, hasProp as h } from "../../utils/dist/index.js";
2
- var y = Object.defineProperty, p = (t, e, i) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, I = (t, e, i) => p(t, e + "", i), u = {
1
+ import { isEqual as c, isObject as u, hasProp as h } from "../../utils/dist/index.js";
2
+ var y = Object.defineProperty, I = (t, e, i) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, p = (t, e, i) => I(t, e + "", i), a = {
3
3
  itemToValue(t) {
4
- return typeof t == "string" ? t : a(t) && h(t, "value") ? t.value : "";
4
+ return typeof t == "string" ? t : u(t) && h(t, "value") ? t.value : "";
5
5
  },
6
6
  itemToString(t) {
7
- return typeof t == "string" ? t : a(t) && h(t, "label") ? t.label : u.itemToValue(t);
7
+ return typeof t == "string" ? t : u(t) && h(t, "label") ? t.label : a.itemToValue(t);
8
8
  },
9
9
  isItemDisabled(t) {
10
- return a(t) && h(t, "disabled") ? !!t.disabled : !1;
10
+ return u(t) && h(t, "disabled") ? !!t.disabled : !1;
11
11
  }
12
12
  }, T = class {
13
13
  constructor(t) {
14
- this.options = t, I(this, "items"), this.items = [...t.items];
14
+ this.options = t, p(this, "items"), this.items = [...t.items];
15
15
  }
16
16
  isEqual(t) {
17
17
  return c(this.items, t.items);
@@ -63,21 +63,21 @@ var y = Object.defineProperty, p = (t, e, i) => e in t ? y(t, e, { enumerable: !
63
63
  */
64
64
  getItemValue(t) {
65
65
  var e, i;
66
- return t == null ? null : ((i = (e = this.options).itemToValue) == null ? void 0 : i.call(e, t)) ?? u.itemToValue(t);
66
+ return t == null ? null : ((i = (e = this.options).itemToValue) == null ? void 0 : i.call(e, t)) ?? a.itemToValue(t);
67
67
  }
68
68
  /**
69
69
  * Whether an item is disabled
70
70
  */
71
71
  getItemDisabled(t) {
72
72
  var e, i;
73
- return t == null ? !1 : ((i = (e = this.options).isItemDisabled) == null ? void 0 : i.call(e, t)) ?? u.isItemDisabled(t);
73
+ return t == null ? !1 : ((i = (e = this.options).isItemDisabled) == null ? void 0 : i.call(e, t)) ?? a.isItemDisabled(t);
74
74
  }
75
75
  /**
76
76
  * Convert an item to a string
77
77
  */
78
78
  stringifyItem(t) {
79
79
  var e, i;
80
- return t == null ? null : ((i = (e = this.options).itemToString) == null ? void 0 : i.call(e, t)) ?? u.itemToString(t);
80
+ return t == null ? null : ((i = (e = this.options).itemToString) == null ? void 0 : i.call(e, t)) ?? a.itemToString(t);
81
81
  }
82
82
  /**
83
83
  * Convert a value to a string
@@ -134,20 +134,20 @@ var y = Object.defineProperty, p = (t, e, i) => e in t ? y(t, e, { enumerable: !
134
134
  /**
135
135
  * Returns the next value in the collection
136
136
  */
137
- getNextValue(t) {
138
- let e = this.indexOf(t);
139
- if (e === -1) return null;
140
- for (e++; e <= this.size && this.getItemDisabled(this.at(e)); ) e++;
141
- return this.getItemValue(this.at(e));
137
+ getNextValue(t, e = 1, i = !1) {
138
+ let s = this.indexOf(t);
139
+ if (s === -1) return null;
140
+ for (s = i ? Math.min(s + e, this.size - 1) : s + e; s <= this.size && this.getItemDisabled(this.at(s)); ) s++;
141
+ return this.getItemValue(this.at(s));
142
142
  }
143
143
  /**
144
144
  * Returns the previous value in the collection
145
145
  */
146
- getPreviousValue(t) {
147
- let e = this.indexOf(t);
148
- if (e === -1) return null;
149
- for (e--; e >= 0 && this.getItemDisabled(this.at(e)); ) e--;
150
- return this.getItemValue(this.at(e));
146
+ getPreviousValue(t, e = 1, i = !1) {
147
+ let s = this.indexOf(t);
148
+ if (s === -1) return null;
149
+ for (s = i ? Math.max(s - e, 0) : s - e; s >= 0 && this.getItemDisabled(this.at(s)); ) s--;
150
+ return this.getItemValue(this.at(s));
151
151
  }
152
152
  /**
153
153
  * Get the index of an item based on its key
@@ -190,7 +190,7 @@ var y = Object.defineProperty, p = (t, e, i) => e in t ? y(t, e, { enumerable: !
190
190
  const [i] = this.items.splice(t, 1);
191
191
  this.items.splice(e, 0, i);
192
192
  }
193
- toJSON() {
193
+ json() {
194
194
  return {
195
195
  size: this.size,
196
196
  first: this.firstValue,
@@ -199,5 +199,5 @@ var y = Object.defineProperty, p = (t, e, i) => e in t ? y(t, e, { enumerable: !
199
199
  }
200
200
  }, V = (t, e) => !!(t != null && t.toLowerCase().startsWith(e.toLowerCase())), x = (t, e) => t.map((i, s) => t[(Math.max(e, 0) + s) % t.length]);
201
201
  export {
202
- T as Collection
202
+ T as ListCollection
203
203
  };