asma-ui-core 3.128.2 → 3.130.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 (34) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/widget/widget/StyledWidget.js +4 -4
  3. package/dist/components/data-display/card/Card.js +327 -0
  4. package/dist/components/data-display/card/Card.module.js +7 -0
  5. package/dist/components/data-display/card/Card.types.js +21 -0
  6. package/dist/components/data-display/card/CardList.js +85 -0
  7. package/dist/components/data-display/card/CardParts.js +97 -0
  8. package/dist/components/data-display/card/cardModel.js +46 -0
  9. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +4 -4
  10. package/dist/components/feedback/dialog/StyledDialog.js +5 -5
  11. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +7 -7
  12. package/dist/components/inputs/button/StyledButton.js +1 -1
  13. package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +4 -4
  14. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +1 -1
  15. package/dist/components/inputs/emoji-choice/StyledEmojiChoice.js +184 -150
  16. package/dist/components/inputs/emoji-choice/StyledEmojiChoice.module.js +22 -21
  17. package/dist/components/inputs/phone-field/CountryCodeSelect.js +4 -4
  18. package/dist/components/inputs/select-autocomplete/SelectAutocompletePicker.js +1 -1
  19. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +4 -4
  20. package/dist/components/navigation/menu/StyledMenuList.js +1 -1
  21. package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +9 -9
  22. package/dist/components/utils/popover/PopoverSheet.js +10 -10
  23. package/dist/index.js +632 -619
  24. package/dist/src/components/data-display/card/Card.d.ts +9 -0
  25. package/dist/src/components/data-display/card/Card.types.d.ts +193 -0
  26. package/dist/src/components/data-display/card/CardList.d.ts +45 -0
  27. package/dist/src/components/data-display/card/CardParts.d.ts +44 -0
  28. package/dist/src/components/data-display/card/cardModel.d.ts +61 -0
  29. package/dist/src/components/data-display/card/cardModel.test.d.ts +1 -0
  30. package/dist/src/components/data-display/card/index.d.ts +5 -0
  31. package/dist/src/components/data-display/card/story/cardStoryFixtures.d.ts +95 -0
  32. package/dist/src/components/inputs/emoji-choice/StyledEmojiChoice.d.ts +5 -0
  33. package/dist/src/index.d.ts +1 -0
  34. package/package.json +1 -1
@@ -4,10 +4,10 @@ import { ChevronDownIcon as Nt } from "../../icons/chevron-down-icon/ChevronDown
4
4
  import { CloseIcon as Pt } from "../../icons/close-icon/CloseIcon.js";
5
5
  import { CheckIcon as Ct } from "../../icons/check-icon/CheckIcon.js";
6
6
  import { PlusIconCircle as At } from "../../icons/plus-icon-circle/PlusIconCircle.js";
7
- import { StyledChip as St } from "../../data-display/chip/StyledChip.js";
8
7
  import { StyledCheckbox as ve } from "../checkbox/base-ui/StyledCheckbox.js";
8
+ import { useBackCloses as St } from "../../../hooks/useBackCloses.hook.js";
9
9
  import { useFullScreenPickerMediaQuery as Rt } from "../../../hooks/useMediaQuery.hook.js";
10
- import { useBackCloses as Mt } from "../../../hooks/useBackCloses.hook.js";
10
+ import { StyledChip as Mt } from "../../data-display/chip/StyledChip.js";
11
11
  import { fieldWidthStyle as $t } from "../field-styles.js";
12
12
  import { LoadingIcon as Ft } from "../../../table/shared-components/LoadingIcon.js";
13
13
  import { PickerLiveRegion as _t, useAnnouncer as Lt } from "../full-screen-picker/PickerLiveRegion.js";
@@ -77,7 +77,7 @@ function Dr({ dataTest: r, options: b, renderInput: Ne, value: F, onChange: P, g
77
77
  } })
78
78
  ]
79
79
  }), { getReferenceProps: rt, getFloatingProps: lt, getItemProps: ot } = Jt([Qt(he, { enabled: !y }), Xt(he, { role: "listbox" })]);
80
- Mt({
80
+ St({
81
81
  active: n && !y,
82
82
  requestClose: () => i(!1)
83
83
  });
@@ -131,7 +131,7 @@ function Dr({ dataTest: r, options: b, renderInput: Ne, value: F, onChange: P, g
131
131
  n && s != null && (s === -1 || f[s] !== void 0) && (xe = s === -1 ? `${r}-select-all` : `${r}-option-${s}`);
132
132
  const ft = (e) => {
133
133
  e.preventDefault(), !(A || p) && (E.current?.focus(), i(!n));
134
- }, pt = l ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(St, {
134
+ }, pt = l ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(Mt, {
135
135
  dataTest: `selected-chip-${d(e)}`,
136
136
  label: d(e),
137
137
  readOnly: p,
@@ -1,6 +1,6 @@
1
1
  import { cn as R } from "../../../helpers/cn.js";
2
- import { consumerOverrides as T } from "../../../helpers/classOverride.js";
3
2
  import p from "./StyledMenu.module.js";
3
+ import { consumerOverrides as T } from "../../../helpers/classOverride.js";
4
4
  import { useEffect as M, useLayoutEffect as k, useRef as q } from "react";
5
5
  import { jsx as A } from "react/jsx-runtime";
6
6
  var d = '[role="menu"], [role="listbox"]', y = '[role="menuitem"]', E = (r) => Array.from(r.childNodes).flatMap((t) => t instanceof HTMLElement ? t.hidden ? [] : t.matches(d) ? [null] : t.matches(y) ? [t] : t.querySelector(y) ? E(t) : [null] : t.textContent?.trim() ? [null] : []), h = (r) => r ? Array.from(r.querySelectorAll('[role="menuitem"]')) : [], v = (r) => h(r).filter((t) => t.getAttribute("aria-disabled") !== "true"), x = (r, t) => {
@@ -3,10 +3,10 @@ import { registerOpenModalDialog as z } from "../../../hooks/useTopLayer.hook.js
3
3
  import { CloseIcon as J } from "../../icons/close-icon/CloseIcon.js";
4
4
  import { IndeterminateIcon as W } from "../../icons/indeterminate-icon/IndeterminateIcon.js";
5
5
  import { StyledButton as _ } from "../../inputs/button/StyledButton.js";
6
- import { useShortViewportMediaQuery as Z } from "../../../hooks/useMediaQuery.hook.js";
7
- import { OverlayBackOwnerContext as ee, isOverlayBackEnabled as j, requestCloseTopOverlayBack as y, useBackCloses as te } from "../../../hooks/useBackCloses.hook.js";
8
- import { useDebouncedValue as re } from "../../../hooks/useDebouncedValue.hook.js";
9
- import { useFocusTrap as oe } from "../../../hooks/useFocusTrap.hook.js";
6
+ import { OverlayBackOwnerContext as Z, isOverlayBackEnabled as j, requestCloseTopOverlayBack as y, useBackCloses as ee } from "../../../hooks/useBackCloses.hook.js";
7
+ import { useDebouncedValue as te } from "../../../hooks/useDebouncedValue.hook.js";
8
+ import { useFocusTrap as re } from "../../../hooks/useFocusTrap.hook.js";
9
+ import { useShortViewportMediaQuery as oe } from "../../../hooks/useMediaQuery.hook.js";
10
10
  import { SHEET_TEXT as ne } from "./sheetCopy.js";
11
11
  import { formatResultsLabel as ae } from "./formatResultsLabel.js";
12
12
  import { useBodyScrollLock as se } from "../../../hooks/useBodyScrollLock.hook.js";
@@ -15,14 +15,14 @@ import { useDragToDismiss as le } from "./useDragToDismiss.hook.js";
15
15
  import { useEffect as g, useId as ce, useLayoutEffect as de, useRef as c, useState as ue } from "react";
16
16
  import { jsx as o, jsxs as u } from "react/jsx-runtime";
17
17
  var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLabel: q, children: $, viewResultsAction: E, resetAction: A, footerActions: H, resultCount: S, locale: k = "en", closeLabel: U = ne[k].close, className: V, registerBackClose: K = !0, ownerRef: G }) => {
18
- const N = ce(), i = c(null), R = c(null), B = c(null), L = G ?? i, h = c(!1), [x, C] = ue(!1), Q = Z(), f = c(s), O = c(t);
18
+ const N = ce(), i = c(null), R = c(null), B = c(null), L = G ?? i, h = c(!1), [x, C] = ue(!1), Q = oe(), f = c(s), O = c(t);
19
19
  g(() => {
20
20
  f.current = s, O.current = t;
21
21
  }, [s, t]);
22
22
  const { dragHandleProps: X, dragOffset: I } = le(R, () => {
23
23
  f.current("drag");
24
24
  });
25
- se(t), oe(t, i), g(() => {
25
+ se(t), re(t, i), g(() => {
26
26
  if (!t) return;
27
27
  const e = (r) => {
28
28
  r.key === "Escape" && (h.current = !0, window.setTimeout(() => {
@@ -36,7 +36,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
36
36
  return window.addEventListener("keydown", e, !0), window.addEventListener("keydown", n), () => {
37
37
  window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown", n);
38
38
  };
39
- }, [t]), te({
39
+ }, [t]), ee({
40
40
  active: t && K,
41
41
  requestClose: () => f.current("escape"),
42
42
  ownerRef: L
@@ -65,7 +65,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
65
65
  };
66
66
  return e.addEventListener("close", a), () => e.removeEventListener("close", a);
67
67
  }, [t]);
68
- const D = ae(re(S, me), k);
68
+ const D = ae(te(S, me), k);
69
69
  if (!t) return null;
70
70
  const Y = { close: () => {
71
71
  s("action");
@@ -97,7 +97,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
97
97
  }
98
98
  },
99
99
  className: l(ie.StyledBottomSheet, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none flex-col items-center justify-end overflow-hidden border-0 bg-transparent p-0 outline-none open:flex"),
100
- children: /* @__PURE__ */ u(ee.Provider, {
100
+ children: /* @__PURE__ */ u(Z.Provider, {
101
101
  value: L,
102
102
  children: [/* @__PURE__ */ o("div", {
103
103
  "aria-hidden": "true",
@@ -2,10 +2,10 @@ import { cn as Le } from "../../../helpers/cn.js";
2
2
  import { firstTabbable as ne } from "../../../helpers/focusable.js";
3
3
  import { TOP_LAYER_PROPS as Se, TOP_LAYER_RESET_STYLE as Ce, getOpenModalDialogAncestor as _e, shouldUsePopoverTopLayer as Ie, useTopLayerRef as Me } from "../../../hooks/useTopLayer.hook.js";
4
4
  import { StyledButton as ke } from "../../inputs/button/StyledButton.js";
5
- import { useMobileMediaQuery as He } from "../../../hooks/useMediaQuery.hook.js";
6
- import { OverlayBackOwnerContext as We, requestCloseTopOverlayBack as Be, useBackCloses as De } from "../../../hooks/useBackCloses.hook.js";
7
- import { useDebouncedValue as qe } from "../../../hooks/useDebouncedValue.hook.js";
8
- import { useFocusTrap as Xe } from "../../../hooks/useFocusTrap.hook.js";
5
+ import { OverlayBackOwnerContext as He, requestCloseTopOverlayBack as We, useBackCloses as Be } from "../../../hooks/useBackCloses.hook.js";
6
+ import { useDebouncedValue as De } from "../../../hooks/useDebouncedValue.hook.js";
7
+ import { useFocusTrap as qe } from "../../../hooks/useFocusTrap.hook.js";
8
+ import { useMobileMediaQuery as Xe } from "../../../hooks/useMediaQuery.hook.js";
9
9
  import { SHEET_TEXT as $e } from "../bottom-sheet/sheetCopy.js";
10
10
  import { formatResultsLabel as Ne } from "../bottom-sheet/formatResultsLabel.js";
11
11
  import { StyledBottomSheet as je } from "../bottom-sheet/StyledBottomSheet.js";
@@ -17,7 +17,7 @@ var C = 240, nt = {
17
17
  info: 472,
18
18
  action: 472
19
19
  }, se = 0.6, ae = "calc(100vw - 32px)", Pt = ({ dataTest: p, renderTrigger: _, variant: I = "info", title: E, children: M, viewResultsAction: k, resetAction: H, footerActions: W, resultCount: x, locale: R = "en", closeLabel: B = $e[R].close, ariaLabel: D, onOpenChange: q, className: X, align: $ = "auto", ignoreOutside: N }) => {
20
- const g = Ue(), j = `${g}-title`, [o, ce] = l(!1), [K, le] = l(), [ue, U] = l(), [de, fe] = l("start"), [T, Y] = l(), [me, z] = l(C), u = He(), n = I === "action", pe = u && !n, w = u && n, y = d((e) => {
20
+ const g = Ue(), j = `${g}-title`, [o, ce] = l(!1), [K, le] = l(), [ue, U] = l(), [de, fe] = l("start"), [T, Y] = l(), [me, z] = l(C), u = Xe(), n = I === "action", pe = u && !n, w = u && n, y = d((e) => {
21
21
  ce(e), q?.(e);
22
22
  }, [q]), { refs: b, floatingStyles: ge, context: he, placement: V, isPositioned: ve } = et({
23
23
  open: o,
@@ -70,17 +70,17 @@ var C = 240, nt = {
70
70
  })]), s = d(() => {
71
71
  y(!1);
72
72
  }, [y]);
73
- De({
73
+ Be({
74
74
  active: o,
75
75
  requestClose: s,
76
76
  ownerRef: c
77
77
  }), v(() => {
78
78
  if (!o || w) return;
79
79
  const e = (t) => {
80
- t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(), Be(t));
80
+ t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(), We(t));
81
81
  };
82
82
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
83
- }, [o, w]), Xe(o && n && r !== null, c);
83
+ }, [o, w]), qe(o && n && r !== null, c);
84
84
  const [Z, Te] = l(!1);
85
85
  v(() => {
86
86
  if (!r || n && !Z) return;
@@ -155,7 +155,7 @@ var C = 240, nt = {
155
155
  "aria-haspopup": n ? "dialog" : void 0,
156
156
  "aria-describedby": !n && o ? g : void 0
157
157
  }
158
- }, P = (e) => typeof e == "function" ? e({ close: s }) : e, be = qe(x, 500), Fe = k ?? (x === void 0 ? void 0 : /* @__PURE__ */ m(ke, {
158
+ }, P = (e) => typeof e == "function" ? e({ close: s }) : e, be = De(x, 500), Fe = k ?? (x === void 0 ? void 0 : /* @__PURE__ */ m(ke, {
159
159
  dataTest: `${p}-view-results`,
160
160
  type: "button",
161
161
  variant: "text",
@@ -203,7 +203,7 @@ var C = 240, nt = {
203
203
  maxHeight: ue
204
204
  },
205
205
  className: Le("z-[1300]", "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]", X),
206
- children: /* @__PURE__ */ m(We.Provider, {
206
+ children: /* @__PURE__ */ m(He.Provider, {
207
207
  value: c,
208
208
  children: /* @__PURE__ */ m(Ke, {
209
209
  dataTest: p,