@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.
- package/LICENSE +21 -0
- package/README.md +51 -9
- package/dist/components/{Accordion.d.ts → Accordion/Accordion.d.ts} +2 -2
- package/dist/components/{Accordion.js → Accordion/Accordion.js} +10 -10
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/AccordionGroup.js +4 -4
- package/dist/components/Avatar.js +4 -4
- package/dist/components/Badge.js +4 -4
- package/dist/components/Banner.js +4 -4
- package/dist/components/BottomNavigation.js +3 -3
- package/dist/components/BottomNavigationItem.js +4 -4
- package/dist/components/Button.js +7 -7
- package/dist/components/CheckBox.js +4 -4
- package/dist/components/ChoiceBox.js +10 -10
- package/dist/components/DashboardWidget.js +4 -4
- package/dist/components/Divider.js +4 -4
- package/dist/components/Drawer.js +4 -4
- package/dist/components/DropdownMenu.js +4 -4
- package/dist/components/IconButton.js +4 -4
- package/dist/components/ListItem.js +4 -4
- package/dist/components/ModalDialog.js +4 -4
- package/dist/components/NotificationBadge.js +4 -4
- package/dist/components/ProgressIndicator.js +4 -4
- package/dist/components/RadioButton.js +4 -4
- package/dist/components/Search.js +6 -6
- package/dist/components/Select.js +4 -4
- package/dist/components/Switch.js +4 -4
- package/dist/components/TabItem.js +4 -4
- package/dist/components/Tabs.js +4 -4
- package/dist/components/TextArea.js +4 -4
- package/dist/components/TextField.js +4 -4
- package/dist/components/Toast.js +3 -3
- package/dist/components/TopAppBar.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +89 -89
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-root.js +2 -3
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-fallback.js +6 -7
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-image.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +2 -3
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +8 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-control.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-input.js +6 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-text.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +2 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +2 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-root.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-control.js +6 -7
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-label.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-positioner.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +7 -7
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-trigger.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-value-text.js +5 -6
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +35 -31
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-control.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-label.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-root.js +8 -9
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js +4 -5
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-list.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-trigger.js +3 -4
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +10 -10
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-root.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-title.js +0 -1
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +4 -4
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +361 -303
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +229 -216
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +19 -19
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +39 -38
- package/dist/node_modules/@serendie/design-token/dist/panda-tokens.js +823 -20
- package/dist/node_modules/@serendie/design-token/dist/tokens.js +346 -25
- package/dist/node_modules/@zag-js/accordion/dist/index.js +12 -12
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +13 -62
- package/dist/node_modules/@zag-js/avatar/dist/index.js +12 -10
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +99 -92
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +5 -5
- package/dist/node_modules/@zag-js/collection/dist/index.js +21 -21
- package/dist/node_modules/@zag-js/combobox/dist/index.js +30 -31
- package/dist/node_modules/@zag-js/core/dist/index.js +285 -320
- package/dist/node_modules/@zag-js/dialog/dist/index.js +56 -62
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +3 -3
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +88 -115
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +2 -2
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +73 -0
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +33 -33
- package/dist/node_modules/@zag-js/menu/dist/index.js +81 -77
- package/dist/node_modules/@zag-js/popper/dist/index.js +86 -79
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +116 -109
- package/dist/node_modules/@zag-js/react/dist/index.js +44 -43
- package/dist/node_modules/@zag-js/select/dist/index.js +203 -231
- package/dist/node_modules/@zag-js/store/dist/index.js +110 -110
- package/dist/node_modules/@zag-js/switch/dist/index.js +62 -55
- package/dist/node_modules/@zag-js/tabs/dist/index.js +64 -61
- package/dist/node_modules/@zag-js/toast/dist/index.js +174 -173
- package/dist/node_modules/@zag-js/utils/dist/index.js +93 -71
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +217 -219
- package/dist/preset.d.ts +807 -4
- package/dist/{ui/styled-system → styled-system}/css/css.js +5 -6
- package/dist/{ui/styled-system → styled-system}/css/cva.js +4 -4
- package/dist/{ui/styled-system → styled-system}/css/sva.js +3 -3
- package/dist/styled-system/jsx/is-valid-prop.js +6 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/getToken.d.ts +324 -3
- package/dist/tokens/index.d.ts +806 -3
- package/package.json +31 -5
- package/styled-system/css/css.js +1 -1
- package/styled-system/jsx/is-valid-prop.js +1 -1
- package/styled-system/themes/theme-asagi.json +1 -1
- package/styled-system/themes/theme-kurikawa.json +1 -1
- package/styled-system/themes/theme-sumire.json +1 -1
- package/styled-system/themes/theme-tsutsuji.json +1 -1
- package/styled-system/tokens/index.js +1238 -54
- package/styled-system/tokens/tokens.d.ts +3 -3
- package/styled-system/types/conditions.d.ts +2 -2
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/ui/styled-system/jsx/is-valid-prop.js +0 -6
- /package/dist/{ui/styled-system → styled-system}/css/conditions.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/css/cx.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/helpers.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/jsx/box.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/jsx/factory-helper.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/jsx/factory.js +0 -0
- /package/dist/{ui/styled-system → styled-system}/patterns/box.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createAnatomy as B } from "../../anatomy/dist/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ListCollection as D } from "../../collection/dist/index.js";
|
|
3
3
|
import { createMachine as W, guards as $ } from "../../core/dist/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { createScope as J,
|
|
6
|
-
import {
|
|
4
|
+
import { isContextMenuEvent as Y, getEventKey as U, isLeftClick as q, clickIfLink as j } from "../../dom-event/dist/index.js";
|
|
5
|
+
import { createScope as J, raf as C, observeAttributes as Q, observeChildren as X, scrollIntoView as Z, dataAttr as u, ariaAttr as A, isDownloadingEvent as z, isOpeningInNewTab as x, isComposingEvent as ee, query as te } from "../../dom-query/dist/index.js";
|
|
6
|
+
import { getPlacement as H, getPlacementStyles as ne } from "../../popper/dist/index.js";
|
|
7
7
|
import { ariaHidden as ie } from "../../aria-hidden/dist/index.js";
|
|
8
8
|
import { trackDismissableElement as le } from "../../dismissable/dist/index.js";
|
|
9
|
-
import { compact as oe,
|
|
9
|
+
import { compact as oe, isArray as G, match as R, isBoolean as ae, isEqual as F, addOrRemove as re } from "../../utils/dist/index.js";
|
|
10
10
|
import { ref as M } from "../../store/dist/index.js";
|
|
11
11
|
var se = B("combobox").parts(
|
|
12
12
|
"root",
|
|
@@ -80,7 +80,7 @@ var o = J({
|
|
|
80
80
|
const n = t.highlightedValue;
|
|
81
81
|
if (n == null) return;
|
|
82
82
|
const e = `[role=option][data-value="${CSS.escape(n)}"`;
|
|
83
|
-
return
|
|
83
|
+
return te(o.getContentEl(t), e);
|
|
84
84
|
},
|
|
85
85
|
focusInputEl: (t) => {
|
|
86
86
|
const n = o.getInputEl(t);
|
|
@@ -92,7 +92,7 @@ var o = J({
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
function Ee(t, n, e) {
|
|
95
|
-
const i = t.context.translations, r = t.context.collection, s = t.context.disabled, c = t.context.isInteractive, O = t.context.invalid, V = t.context.readOnly, d = t.hasTag("open"),
|
|
95
|
+
const i = t.context.translations, r = t.context.collection, s = t.context.disabled, c = t.context.isInteractive, O = t.context.invalid, V = t.context.readOnly, d = t.hasTag("open"), f = t.hasTag("focused"), E = t.context.composite, b = t.context.highlightedValue, N = ne({
|
|
96
96
|
...t.context.positioning,
|
|
97
97
|
placement: t.context.currentPlacement
|
|
98
98
|
});
|
|
@@ -106,7 +106,7 @@ function Ee(t, n, e) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
return {
|
|
109
|
-
focused:
|
|
109
|
+
focused: f,
|
|
110
110
|
open: d,
|
|
111
111
|
inputValue: t.context.inputValue,
|
|
112
112
|
highlightedValue: b,
|
|
@@ -162,7 +162,7 @@ function Ee(t, n, e) {
|
|
|
162
162
|
"data-readonly": u(V),
|
|
163
163
|
"data-disabled": u(s),
|
|
164
164
|
"data-invalid": u(O),
|
|
165
|
-
"data-focus": u(
|
|
165
|
+
"data-focus": u(f),
|
|
166
166
|
onClick(l) {
|
|
167
167
|
var a;
|
|
168
168
|
E || (l.preventDefault(), (a = o.getTriggerEl(t.context)) == null || a.focus({ preventScroll: !0 }));
|
|
@@ -175,7 +175,7 @@ function Ee(t, n, e) {
|
|
|
175
175
|
dir: t.context.dir,
|
|
176
176
|
id: o.getControlId(t.context),
|
|
177
177
|
"data-state": d ? "open" : "closed",
|
|
178
|
-
"data-focus": u(
|
|
178
|
+
"data-focus": u(f),
|
|
179
179
|
"data-disabled": u(s),
|
|
180
180
|
"data-invalid": u(O)
|
|
181
181
|
});
|
|
@@ -227,22 +227,22 @@ function Ee(t, n, e) {
|
|
|
227
227
|
n({ type: "INPUT.CHANGE", value: l.currentTarget.value });
|
|
228
228
|
},
|
|
229
229
|
onKeyDown(l) {
|
|
230
|
-
if (l.defaultPrevented || !c || l.ctrlKey || l.shiftKey ||
|
|
230
|
+
if (l.defaultPrevented || !c || l.ctrlKey || l.shiftKey || ee(l)) return;
|
|
231
231
|
const a = t.context.openOnKeyPress, p = l.ctrlKey || l.metaKey || l.shiftKey, h = !0, y = {
|
|
232
|
-
ArrowDown(
|
|
233
|
-
!a && !d || (n({ type:
|
|
232
|
+
ArrowDown(v) {
|
|
233
|
+
!a && !d || (n({ type: v.altKey ? "OPEN" : "INPUT.ARROW_DOWN", keypress: h }), v.preventDefault());
|
|
234
234
|
},
|
|
235
235
|
ArrowUp() {
|
|
236
236
|
!a && !d || (n({ type: l.altKey ? "CLOSE" : "INPUT.ARROW_UP", keypress: h }), l.preventDefault());
|
|
237
237
|
},
|
|
238
|
-
Home(
|
|
239
|
-
p || (n({ type: "INPUT.HOME", keypress: h }), d &&
|
|
238
|
+
Home(v) {
|
|
239
|
+
p || (n({ type: "INPUT.HOME", keypress: h }), d && v.preventDefault());
|
|
240
240
|
},
|
|
241
|
-
End(
|
|
242
|
-
p || (n({ type: "INPUT.END", keypress: h }), d &&
|
|
241
|
+
End(v) {
|
|
242
|
+
p || (n({ type: "INPUT.END", keypress: h }), d && v.preventDefault());
|
|
243
243
|
},
|
|
244
|
-
Enter(
|
|
245
|
-
n({ type: "INPUT.ENTER", keypress: h }), d &&
|
|
244
|
+
Enter(v) {
|
|
245
|
+
n({ type: "INPUT.ENTER", keypress: h }), d && v.preventDefault();
|
|
246
246
|
const K = o.getHighlightedItemEl(t.context);
|
|
247
247
|
j(K);
|
|
248
248
|
},
|
|
@@ -275,7 +275,7 @@ function Ee(t, n, e) {
|
|
|
275
275
|
l.focusable && n({ type: "INPUT.FOCUS", src: "trigger" });
|
|
276
276
|
},
|
|
277
277
|
onClick(a) {
|
|
278
|
-
a.defaultPrevented || c &&
|
|
278
|
+
a.defaultPrevented || c && q(a) && n("TRIGGER.CLICK");
|
|
279
279
|
},
|
|
280
280
|
onPointerDown(a) {
|
|
281
281
|
c && a.pointerType !== "touch" && (a.preventDefault(), queueMicrotask(() => {
|
|
@@ -364,7 +364,7 @@ function Ee(t, n, e) {
|
|
|
364
364
|
l.persistFocus || a.disabled || !t.previousEvent.type.includes("POINTER") || n({ type: "ITEM.POINTER_LEAVE", value: p });
|
|
365
365
|
},
|
|
366
366
|
onClick(h) {
|
|
367
|
-
|
|
367
|
+
z(h) || x(h) || Y(h) || a.disabled || n({ type: "ITEM.CLICK", src: "click", value: p });
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
370
|
},
|
|
@@ -409,7 +409,7 @@ function Ee(t, n, e) {
|
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
411
|
var { and: m, not: P } = $;
|
|
412
|
-
function
|
|
412
|
+
function ve(t) {
|
|
413
413
|
const n = oe(t);
|
|
414
414
|
return W(
|
|
415
415
|
{
|
|
@@ -437,7 +437,6 @@ function fe(t) {
|
|
|
437
437
|
collection: n.collection ?? _.empty(),
|
|
438
438
|
positioning: {
|
|
439
439
|
placement: "bottom",
|
|
440
|
-
flip: !1,
|
|
441
440
|
sameWidth: !0,
|
|
442
441
|
...n.positioning
|
|
443
442
|
},
|
|
@@ -1005,7 +1004,7 @@ function fe(t) {
|
|
|
1005
1004
|
},
|
|
1006
1005
|
// in event the options are fetched (async), we still want to auto-highlight the first option
|
|
1007
1006
|
trackChildNodes(e, i, { send: r }) {
|
|
1008
|
-
return e.autoHighlight ?
|
|
1007
|
+
return e.autoHighlight ? X(() => o.getContentEl(e), {
|
|
1009
1008
|
callback: () => r("CHILDREN_CHANGE"),
|
|
1010
1009
|
defer: !0
|
|
1011
1010
|
}) : void 0;
|
|
@@ -1013,26 +1012,26 @@ function fe(t) {
|
|
|
1013
1012
|
scrollToHighlightedItem(e, i, { getState: r }) {
|
|
1014
1013
|
const s = o.getInputEl(e);
|
|
1015
1014
|
let c = [];
|
|
1016
|
-
const O = (
|
|
1015
|
+
const O = (f) => {
|
|
1017
1016
|
if (r().event.type.includes("POINTER") || !e.highlightedValue) return;
|
|
1018
1017
|
const N = o.getHighlightedItemEl(e), T = o.getContentEl(e);
|
|
1019
1018
|
if (e.scrollToIndexFn) {
|
|
1020
1019
|
const a = e.collection.indexOf(e.highlightedValue);
|
|
1021
|
-
e.scrollToIndexFn({ index: a, immediate:
|
|
1020
|
+
e.scrollToIndexFn({ index: a, immediate: f });
|
|
1022
1021
|
return;
|
|
1023
1022
|
}
|
|
1024
1023
|
const l = C(() => {
|
|
1025
|
-
|
|
1024
|
+
Z(N, { rootEl: T, block: "nearest" });
|
|
1026
1025
|
});
|
|
1027
1026
|
c.push(l);
|
|
1028
1027
|
}, V = C(() => O(!0));
|
|
1029
1028
|
c.push(V);
|
|
1030
|
-
const d =
|
|
1029
|
+
const d = Q(s, {
|
|
1031
1030
|
attributes: ["aria-activedescendant"],
|
|
1032
1031
|
callback: () => O(!1)
|
|
1033
1032
|
});
|
|
1034
1033
|
return c.push(d), () => {
|
|
1035
|
-
c.forEach((
|
|
1034
|
+
c.forEach((f) => f());
|
|
1036
1035
|
};
|
|
1037
1036
|
}
|
|
1038
1037
|
},
|
|
@@ -1134,7 +1133,7 @@ function fe(t) {
|
|
|
1134
1133
|
highlightFirstItem(e) {
|
|
1135
1134
|
C(() => {
|
|
1136
1135
|
const i = e.collection.firstValue;
|
|
1137
|
-
g.highlightedValue(e, i);
|
|
1136
|
+
g.highlightedValue(e, i, !0);
|
|
1138
1137
|
});
|
|
1139
1138
|
},
|
|
1140
1139
|
highlightFirstItemIfNeeded(e) {
|
|
@@ -1262,5 +1261,5 @@ export {
|
|
|
1262
1261
|
se as anatomy,
|
|
1263
1262
|
_ as collection,
|
|
1264
1263
|
Ee as connect,
|
|
1265
|
-
|
|
1264
|
+
ve as machine
|
|
1266
1265
|
};
|