asma-ui-core 3.121.1 → 3.121.3

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.
@@ -1,36 +1,37 @@
1
- import { CloseIcon as w } from "../../icons/close-icon/CloseIcon.js";
2
- import { StyledButton as y } from "../button/StyledButton.js";
1
+ import { CloseIcon as y } from "../../icons/close-icon/CloseIcon.js";
2
+ import { StyledButton as w } from "../button/StyledButton.js";
3
3
  import { usePickerOneRowHeaderMediaQuery as g } from "../../../hooks/useMediaQuery.hook.js";
4
4
  import { StyledDialog as k } from "../../feedback/dialog/StyledDialog.js";
5
5
  import { PickerLiveRegion as N } from "./PickerLiveRegion.js";
6
- import { isKeyboardModality as S, trackInputModality as I } from "./inputModality.js";
7
- import { useVisualViewportHeight as R } from "./useVisualViewportHeight.js";
8
- import { useEffect as p, useRef as x } from "react";
6
+ import { isKeyboardModality as S, trackInputModality as R } from "./inputModality.js";
7
+ import { useReleaseFieldOnKeyboardDismiss as I } from "./useReleaseFieldOnKeyboardDismiss.js";
8
+ import { useVisualViewportHeight as F } from "./useVisualViewportHeight.js";
9
+ import { useEffect as x, useRef as p } from "react";
9
10
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
10
- var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n }) => {
11
- const l = r != null && r !== !1 && r !== "";
12
- return p(I, []), /* @__PURE__ */ e(k, {
13
- open: o,
14
- onClose: (f, s) => i(s),
15
- dataTest: t,
11
+ var E = ({ open: i, onClose: o, dataTest: l, title: r, fallbackName: n, ...c }) => {
12
+ const t = r != null && r !== !1 && r !== "";
13
+ return x(R, []), /* @__PURE__ */ e(k, {
14
+ open: i,
15
+ onClose: (f, s) => o(s),
16
+ dataTest: l,
16
17
  fullScreen: !0,
17
18
  showCloseIcon: !1,
18
- ariaLabel: l ? void 0 : a,
19
+ ariaLabel: t ? void 0 : n,
19
20
  children: /* @__PURE__ */ e(P, {
20
- ...n,
21
- dataTest: t,
22
- title: l ? r : void 0,
23
- onClose: i
21
+ ...c,
22
+ dataTest: l,
23
+ title: t ? r : void 0,
24
+ onClose: o
24
25
  })
25
26
  });
26
- }, P = ({ dataTest: o, title: i, closeLabel: t, search: r, headerRow: a, children: n, announcement: l, onClose: f }) => {
27
- const s = g(), v = R(), c = x(null), u = x(null);
28
- return p(() => {
27
+ }, P = ({ dataTest: i, title: o, closeLabel: l, search: r, headerRow: n, children: c, announcement: t, onClose: f }) => {
28
+ const s = g(), v = F(), a = p(null), u = p(null);
29
+ return I(a), x(() => {
29
30
  const b = requestAnimationFrame(() => {
30
- const h = c.current?.closest("dialog");
31
+ const h = a.current?.closest("dialog");
31
32
  if (!h || document.activeElement !== h || !S()) return;
32
33
  const d = u.current?.querySelector('[role="listbox"]');
33
- (d && d.tabIndex >= 0 ? d : c.current)?.focus({ preventScroll: !0 });
34
+ (d && d.tabIndex >= 0 ? d : a.current)?.focus({ preventScroll: !0 });
34
35
  });
35
36
  return () => cancelAnimationFrame(b);
36
37
  }, []), /* @__PURE__ */ m("div", {
@@ -38,26 +39,26 @@ var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n })
38
39
  style: { height: v },
39
40
  children: [
40
41
  /* @__PURE__ */ m("div", {
41
- "data-testid": `${o}-header`,
42
+ "data-testid": `${i}-header`,
42
43
  className: "flex shrink-0 flex-col border-0 border-b border-solid border-delta-200 bg-white",
43
44
  children: [
44
45
  /* @__PURE__ */ m("div", {
45
46
  className: "flex items-start gap-2",
46
47
  children: [
47
- i !== void 0 && /* @__PURE__ */ e("h2", {
48
+ o !== void 0 && /* @__PURE__ */ e("h2", {
48
49
  className: "m-0 min-w-0 flex-1 break-words pl-4 pt-2 text-[20px] font-semibold leading-7 text-delta-800",
49
- children: i
50
+ children: o
50
51
  }),
51
52
  s && /* @__PURE__ */ e("div", {
52
53
  className: "min-w-0 max-w-[240px] flex-1 pt-2",
53
54
  children: r
54
55
  }),
55
- /* @__PURE__ */ e(y, {
56
- dataTest: `${o}-close`,
57
- refLink: c,
58
- "aria-label": t,
56
+ /* @__PURE__ */ e(w, {
57
+ dataTest: `${i}-close`,
58
+ refLink: a,
59
+ "aria-label": l,
59
60
  variant: "textGray",
60
- startIcon: /* @__PURE__ */ e(w, {
61
+ startIcon: /* @__PURE__ */ e(y, {
61
62
  width: 24,
62
63
  height: 24
63
64
  }),
@@ -70,7 +71,7 @@ var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n })
70
71
  className: "px-4 pt-2",
71
72
  children: r
72
73
  }),
73
- a ?? /* @__PURE__ */ e("div", {
74
+ n ?? /* @__PURE__ */ e("div", {
74
75
  "aria-hidden": "true",
75
76
  className: "h-2"
76
77
  })
@@ -78,17 +79,17 @@ var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n })
78
79
  }),
79
80
  /* @__PURE__ */ e("div", {
80
81
  ref: u,
81
- "data-testid": `${o}-body`,
82
+ "data-testid": `${i}-body`,
82
83
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4",
83
- children: n
84
+ children: c
84
85
  }),
85
86
  /* @__PURE__ */ e(N, {
86
- announcement: l,
87
- dataTest: `${o}-live`
87
+ announcement: t,
88
+ dataTest: `${i}-live`
88
89
  })
89
90
  ]
90
91
  });
91
92
  };
92
93
  export {
93
- B as FullScreenPicker
94
+ E as FullScreenPicker
94
95
  };
@@ -0,0 +1,18 @@
1
+ import { useEffect as c } from "react";
2
+ var l = 150, a = (e) => window.innerHeight - e.height * e.scale >= l, u = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable, f = (e) => {
3
+ c(() => {
4
+ const t = window.visualViewport;
5
+ if (!t) return;
6
+ let s = a(t);
7
+ const n = () => {
8
+ const r = a(t), d = s && !r;
9
+ if (s = r, !d) return;
10
+ const i = e.current?.closest("dialog"), o = document.activeElement;
11
+ i && u(o) && i.contains(o) && i.focus({ preventScroll: !0 });
12
+ };
13
+ return t.addEventListener("resize", n), () => t.removeEventListener("resize", n);
14
+ }, [e]);
15
+ };
16
+ export {
17
+ f as useReleaseFieldOnKeyboardDismiss
18
+ };
@@ -0,0 +1,12 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Moves focus off the sheet's text field once the on-screen keyboard is put away without a blur —
4
+ * Android Back, a swipe down, the iPad hide key. The rows keep focus where it is on a tap (so a
5
+ * search keeps its keyboard mid-list), so a field still focused under a hidden keyboard would call
6
+ * it back up on every tap on a row. Focus goes to the dialog shell, where a tap opening the picker
7
+ * leaves it.
8
+ *
9
+ * Only the keyboard going from up to down counts: a keyboard closing over several resize steps is
10
+ * still caught, while a rotation with the keyboard up and a hardware keyboard (none ever shows) are not.
11
+ */
12
+ export declare const useReleaseFieldOnKeyboardDismiss: (anchorRef: RefObject<HTMLElement | null>) => void;
@@ -94,9 +94,9 @@ export type StyledTableProps<TData, TCustomData> = {
94
94
  getRowClassName?: (row: Row<TData>) => string;
95
95
  /**
96
96
  * The row the user is working with — e.g. the one opened in a side panel or preview — matched
97
- * against `row.id`. Drawn in the Figma table-row **Selected** state: white with a 2px
98
- * `border/selected` (gama-400) frame around the whole row, kept on hover; a ticked row keeps its
99
- * Checked fill inside the frame. Keyboard focus on it still shows the 3px Focused frame. Pass the
97
+ * against `row.id`. Drawn in the Figma table-row **Selected** state: the `table/bg-row-selected`
98
+ * (gama-25) fill with a 2px `border/selected` (gama-400) frame around the whole row, kept on
99
+ * hover. Keyboard focus on it still shows the 3px Focused frame. Pass the
100
100
  * opened row's id (and `null` when nothing is open). Opt-in: tables that do not pass it are unchanged.
101
101
  */
102
102
  activeRowId?: string | null;
@@ -1,59 +1,59 @@
1
- var e = "_tbody_1im3a_124", _ = "_expanded_row_1im3a_177", a = "_selected_1im3a_202", l = "_shadowed_1im3a_227", t = "_resizer_1im3a_284", i = "_isResizing_1im3a_296", o = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_1im3a_1",
3
- "table-wrapper": "_table-wrapper_1im3a_26",
4
- "table-shell": "_table-shell_1im3a_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_1im3a_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_1im3a_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_1im3a_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_1im3a_53",
9
- "table-scroll": "_table-scroll_1im3a_56",
10
- "table-x--fill-height": "_table-x--fill-height_1im3a_65",
11
- "table-x": "_table-x_1im3a_65",
12
- "table-content": "_table-content_1im3a_80",
13
- "table-header--sticky": "_table-header--sticky_1im3a_85",
14
- "table-hscroll": "_table-hscroll_1im3a_90",
15
- "table-hscroll__content": "_table-hscroll__content_1im3a_100",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_1im3a_103",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_1im3a_111",
18
- "styled-table": "_styled-table_1im3a_115",
19
- tbody: e,
20
- "loading-icon": "_loading-icon_1im3a_129",
21
- "t-row": "_t-row_1im3a_136",
22
- "t-cell": "_t-cell_1im3a_136",
23
- "action-cell": "_action-cell_1im3a_149",
24
- "fixed-cell": "_fixed-cell_1im3a_153",
25
- "fixed-right-cell": "_fixed-right-cell_1im3a_156",
26
- expanded_row: _,
27
- "data-cell": "_data-cell_1im3a_189",
28
- "select-cell": "_select-cell_1im3a_199",
29
- selected: a,
30
- "single-selection": "_single-selection_1im3a_205",
31
- "action-cell--no-shadow": "_action-cell--no-shadow_1im3a_223",
32
- shadowed: l,
33
- "shadowed-right": "_shadowed-right_1im3a_263",
34
- "is-loading": "_is-loading_1im3a_268",
35
- "action-cell-default-background": "_action-cell-default-background_1im3a_271",
36
- "fixed-cell-default-background": "_fixed-cell-default-background_1im3a_274",
37
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_1im3a_277",
38
- "sortable-column": "_sortable-column_1im3a_280",
39
- resizer: t,
40
- isResizing: i,
41
- "hide-table-header": "_hide-table-header_1im3a_308",
42
- "show-table-header": "_show-table-header_1im3a_312",
43
- "table-header": "_table-header_1im3a_85",
44
- "hide-header": "_hide-header_1im3a_355",
45
- "t-cell__actions": "_t-cell__actions_1im3a_358",
46
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_1im3a_367",
47
- "t-cell__fixed": "_t-cell__fixed_1im3a_372",
48
- "t-cell__fixed-right": "_t-cell__fixed-right_1im3a_380",
49
- "sort-icon": "_sort-icon_1im3a_388",
50
- "header-content": "_header-content_1im3a_392",
51
- "table-footer--sticky": "_table-footer--sticky_1im3a_435",
52
- "table-footer--inline": "_table-footer--inline_1im3a_446",
53
- "table-bottom": "_table-bottom_1im3a_457",
54
- "table-bottom--sticky": "_table-bottom--sticky_1im3a_471",
55
- "cursor-not-allowed": "_cursor-not-allowed_1im3a_475",
56
- "select-control": "_select-control_1im3a_479"
1
+ var l = "_tbody_shlur_124", e = "_expanded_row_shlur_177", _ = "_selected_shlur_202", t = "_shadowed_shlur_227", r = "_resizer_shlur_284", a = "_isResizing_shlur_296", o = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_shlur_1",
3
+ "table-wrapper": "_table-wrapper_shlur_26",
4
+ "table-shell": "_table-shell_shlur_33",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_shlur_39",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_shlur_42",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_shlur_43",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_shlur_53",
9
+ "table-scroll": "_table-scroll_shlur_56",
10
+ "table-x--fill-height": "_table-x--fill-height_shlur_65",
11
+ "table-x": "_table-x_shlur_65",
12
+ "table-content": "_table-content_shlur_80",
13
+ "table-header--sticky": "_table-header--sticky_shlur_85",
14
+ "table-hscroll": "_table-hscroll_shlur_90",
15
+ "table-hscroll__content": "_table-hscroll__content_shlur_100",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_shlur_103",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_shlur_111",
18
+ "styled-table": "_styled-table_shlur_115",
19
+ tbody: l,
20
+ "loading-icon": "_loading-icon_shlur_129",
21
+ "t-row": "_t-row_shlur_136",
22
+ "t-cell": "_t-cell_shlur_136",
23
+ "action-cell": "_action-cell_shlur_149",
24
+ "fixed-cell": "_fixed-cell_shlur_153",
25
+ "fixed-right-cell": "_fixed-right-cell_shlur_156",
26
+ expanded_row: e,
27
+ "data-cell": "_data-cell_shlur_189",
28
+ "select-cell": "_select-cell_shlur_199",
29
+ selected: _,
30
+ "single-selection": "_single-selection_shlur_205",
31
+ "action-cell--no-shadow": "_action-cell--no-shadow_shlur_223",
32
+ shadowed: t,
33
+ "shadowed-right": "_shadowed-right_shlur_263",
34
+ "is-loading": "_is-loading_shlur_268",
35
+ "action-cell-default-background": "_action-cell-default-background_shlur_271",
36
+ "fixed-cell-default-background": "_fixed-cell-default-background_shlur_274",
37
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_shlur_277",
38
+ "sortable-column": "_sortable-column_shlur_280",
39
+ resizer: r,
40
+ isResizing: a,
41
+ "hide-table-header": "_hide-table-header_shlur_308",
42
+ "show-table-header": "_show-table-header_shlur_312",
43
+ "table-header": "_table-header_shlur_85",
44
+ "hide-header": "_hide-header_shlur_355",
45
+ "t-cell__actions": "_t-cell__actions_shlur_358",
46
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_shlur_367",
47
+ "t-cell__fixed": "_t-cell__fixed_shlur_372",
48
+ "t-cell__fixed-right": "_t-cell__fixed-right_shlur_380",
49
+ "sort-icon": "_sort-icon_shlur_388",
50
+ "header-content": "_header-content_shlur_392",
51
+ "table-footer--sticky": "_table-footer--sticky_shlur_433",
52
+ "table-footer--inline": "_table-footer--inline_shlur_444",
53
+ "table-bottom": "_table-bottom_shlur_455",
54
+ "table-bottom--sticky": "_table-bottom--sticky_shlur_469",
55
+ "cursor-not-allowed": "_cursor-not-allowed_shlur_473",
56
+ "select-control": "_select-control_shlur_477"
57
57
  };
58
58
  export {
59
59
  o as default
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.121.1",
6
+ "version": "3.121.3",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",