@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,169 +1,154 @@
1
- import { createAnatomy as g } from "../../anatomy/dist/index.js";
2
- import { createScope as l, observeChildren as m, observeAttributes as v } from "../../dom-query/dist/index.js";
3
- import { createMachine as I } from "../../core/dist/index.js";
4
- import { compact as p } from "../../utils/dist/index.js";
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
- getRootId: (t) => {
8
- var a;
9
- return ((a = t.ids) == null ? void 0 : a.root) ?? `avatar:${t.id}`;
10
- },
11
- getImageId: (t) => {
12
- var a;
13
- return ((a = t.ids) == null ? void 0 : a.image) ?? `avatar:${t.id}:image`;
14
- },
15
- getFallbackId: (t) => {
16
- var a;
17
- return ((a = t.ids) == null ? void 0 : a.fallback) ?? `avatar:${t.id}:fallback`;
18
- },
19
- getRootEl: (t) => o.getById(t, o.getRootId(t)),
20
- getImageEl: (t) => o.getById(t, o.getImageId(t))
21
- });
22
- function S(t, a, e) {
23
- const r = t.matches("loaded");
1
+ import { createAnatomy as v } from "../../anatomy/dist/index.js";
2
+ import { observeAttributes as p, observeChildren as u } from "../../dom-query/dist/index.js";
3
+ import { createMachine as h } from "../../core/dist/index.js";
4
+ import { createProps as k } from "../../types/dist/index.js";
5
+ var f = v("avatar").parts("root", "image", "fallback"), s = f.build(), m = (e) => {
6
+ var r;
7
+ return ((r = e.ids) == null ? void 0 : r.root) ?? `avatar:${e.id}`;
8
+ }, g = (e) => {
9
+ var r;
10
+ return ((r = e.ids) == null ? void 0 : r.image) ?? `avatar:${e.id}:image`;
11
+ }, b = (e) => {
12
+ var r;
13
+ return ((r = e.ids) == null ? void 0 : r.fallback) ?? `avatar:${e.id}:fallback`;
14
+ }, y = (e) => e.getById(m(e)), c = (e) => e.getById(g(e));
15
+ function O(e, r) {
16
+ const { state: t, send: a, prop: n, scope: d } = e, o = t.matches("loaded");
24
17
  return {
25
- loaded: r,
26
- setSrc(n) {
27
- a({ type: "SRC.SET", src: n });
18
+ loaded: o,
19
+ setSrc(l) {
20
+ const i = c(d);
21
+ i == null || i.setAttribute("src", l);
28
22
  },
29
23
  setLoaded() {
30
- a({ type: "IMG.LOADED", src: "api" });
24
+ a({ type: "img.loaded", src: "api" });
31
25
  },
32
26
  setError() {
33
- a({ type: "IMG.ERROR", src: "api" });
27
+ a({ type: "img.error", src: "api" });
34
28
  },
35
29
  getRootProps() {
36
- return e.element({
37
- ...c.root.attrs,
38
- dir: t.context.dir,
39
- id: o.getRootId(t.context)
30
+ return r.element({
31
+ ...s.root.attrs,
32
+ dir: n("dir"),
33
+ id: m(d)
40
34
  });
41
35
  },
42
36
  getImageProps() {
43
- return e.img({
44
- ...c.image.attrs,
45
- hidden: !r,
46
- dir: t.context.dir,
47
- id: o.getImageId(t.context),
48
- "data-state": r ? "visible" : "hidden",
37
+ return r.img({
38
+ ...s.image.attrs,
39
+ hidden: !o,
40
+ dir: n("dir"),
41
+ id: g(d),
42
+ "data-state": o ? "visible" : "hidden",
49
43
  onLoad() {
50
- a({ type: "IMG.LOADED", src: "element" });
44
+ a({ type: "img.loaded", src: "element" });
51
45
  },
52
46
  onError() {
53
- a({ type: "IMG.ERROR", src: "element" });
47
+ a({ type: "img.error", src: "element" });
54
48
  }
55
49
  });
56
50
  },
57
51
  getFallbackProps() {
58
- return e.element({
59
- ...c.fallback.attrs,
60
- dir: t.context.dir,
61
- id: o.getFallbackId(t.context),
62
- hidden: r,
63
- "data-state": r ? "hidden" : "visible"
52
+ return r.element({
53
+ ...s.fallback.attrs,
54
+ dir: n("dir"),
55
+ id: b(d),
56
+ hidden: o,
57
+ "data-state": o ? "hidden" : "visible"
64
58
  });
65
59
  }
66
60
  };
67
61
  }
68
- function G(t) {
69
- const a = p(t);
70
- return I(
71
- {
72
- id: "avatar",
73
- initial: "loading",
74
- activities: ["trackImageRemoval"],
75
- context: a,
62
+ var C = h({
63
+ initialState() {
64
+ return "loading";
65
+ },
66
+ effects: ["trackImageRemoval", "trackSrcChange"],
67
+ on: {
68
+ "src.change": {
69
+ target: "loading"
70
+ },
71
+ "img.unmount": {
72
+ target: "error"
73
+ }
74
+ },
75
+ states: {
76
+ loading: {
77
+ entry: ["checkImageStatus"],
76
78
  on: {
77
- "SRC.CHANGE": {
78
- target: "loading"
79
+ "img.loaded": {
80
+ target: "loaded",
81
+ actions: ["invokeOnLoad"]
79
82
  },
80
- "IMG.UNMOUNT": {
81
- target: "error"
83
+ "img.error": {
84
+ target: "error",
85
+ actions: ["invokeOnError"]
82
86
  }
83
- },
84
- states: {
85
- loading: {
86
- activities: ["trackSrcChange"],
87
- entry: ["checkImageStatus"],
88
- on: {
89
- "IMG.LOADED": {
90
- target: "loaded",
91
- actions: ["invokeOnLoad"]
92
- },
93
- "IMG.ERROR": {
94
- target: "error",
95
- actions: ["invokeOnError"]
96
- }
97
- }
98
- },
99
- error: {
100
- activities: ["trackSrcChange"],
101
- on: {
102
- "IMG.LOADED": {
103
- target: "loaded",
104
- actions: ["invokeOnLoad"]
105
- }
106
- }
107
- },
108
- loaded: {
109
- activities: ["trackSrcChange"],
110
- on: {
111
- "IMG.ERROR": {
112
- target: "error",
113
- actions: ["invokeOnError"]
114
- }
115
- }
87
+ }
88
+ },
89
+ error: {
90
+ on: {
91
+ "img.loaded": {
92
+ target: "loaded",
93
+ actions: ["invokeOnLoad"]
116
94
  }
117
95
  }
118
96
  },
119
- {
120
- activities: {
121
- trackSrcChange(e, r, { send: n }) {
122
- const i = o.getImageEl(e);
123
- return v(i, {
124
- attributes: ["src", "srcset"],
125
- callback() {
126
- n({ type: "SRC.CHANGE" });
127
- }
128
- });
129
- },
130
- trackImageRemoval(e, r, { send: n }) {
131
- const i = o.getRootEl(e);
132
- return m(i, {
133
- callback(d) {
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" });
137
- }
138
- });
97
+ loaded: {
98
+ on: {
99
+ "img.error": {
100
+ target: "error",
101
+ actions: ["invokeOnError"]
139
102
  }
103
+ }
104
+ }
105
+ },
106
+ implementations: {
107
+ actions: {
108
+ invokeOnLoad({ prop: e }) {
109
+ var r;
110
+ (r = e("onStatusChange")) == null || r({ status: "loaded" });
140
111
  },
141
- actions: {
142
- invokeOnLoad(e) {
143
- var r;
144
- (r = e.onStatusChange) == null || r.call(e, { status: "loaded" });
145
- },
146
- invokeOnError(e) {
147
- var r;
148
- (r = e.onStatusChange) == null || r.call(e, { status: "error" });
149
- },
150
- checkImageStatus(e, r, { send: n }) {
151
- const i = o.getImageEl(e);
152
- if (i != null && i.complete) {
153
- const d = k(i) ? "IMG.LOADED" : "IMG.ERROR";
154
- n({ type: d, src: "ssr" });
112
+ invokeOnError({ prop: e }) {
113
+ var r;
114
+ (r = e("onStatusChange")) == null || r({ status: "error" });
115
+ },
116
+ checkImageStatus({ send: e, scope: r }) {
117
+ const t = c(r);
118
+ if (!(t != null && t.complete)) return;
119
+ const a = E(t) ? "img.loaded" : "img.error";
120
+ e({ type: a, src: "ssr" });
121
+ }
122
+ },
123
+ effects: {
124
+ trackImageRemoval({ send: e, scope: r }) {
125
+ const t = y(r);
126
+ return u(t, {
127
+ callback(a) {
128
+ Array.from(a[0].removedNodes).find(
129
+ (o) => o.nodeType === Node.ELEMENT_NODE && o.matches("[data-scope=avatar][data-part=image]")
130
+ ) && e({ type: "img.unmount" });
155
131
  }
156
- }
132
+ });
133
+ },
134
+ trackSrcChange({ send: e, scope: r }) {
135
+ const t = c(r);
136
+ return p(t, {
137
+ attributes: ["src", "srcset"],
138
+ callback() {
139
+ e({ type: "src.change" });
140
+ }
141
+ });
157
142
  }
158
143
  }
159
- );
160
- }
161
- function k(t) {
162
- return t.complete && t.naturalWidth !== 0 && t.naturalHeight !== 0;
144
+ }
145
+ });
146
+ function E(e) {
147
+ return e.complete && e.naturalWidth !== 0 && e.naturalHeight !== 0;
163
148
  }
164
- E()(["dir", "id", "ids", "onStatusChange", "getRootNode"]);
149
+ k()(["dir", "id", "ids", "onStatusChange", "getRootNode"]);
165
150
  export {
166
- R as anatomy,
167
- S as connect,
168
- G as machine
151
+ f as anatomy,
152
+ O as connect,
153
+ C as machine
169
154
  };