@frontify/fondue-components 7.0.1 → 8.0.1

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 (87) hide show
  1. package/dist/fondue-components10.js +1 -1
  2. package/dist/fondue-components11.js +65 -75
  3. package/dist/fondue-components11.js.map +1 -1
  4. package/dist/fondue-components12.js +1 -1
  5. package/dist/fondue-components14.js +1 -1
  6. package/dist/fondue-components15.js +1 -1
  7. package/dist/fondue-components16.js +1 -1
  8. package/dist/fondue-components17.js +2 -2
  9. package/dist/fondue-components18.js +6 -6
  10. package/dist/fondue-components19.js +1 -1
  11. package/dist/fondue-components20.js +1 -1
  12. package/dist/fondue-components21.js +46 -46
  13. package/dist/fondue-components21.js.map +1 -1
  14. package/dist/fondue-components22.js +3 -3
  15. package/dist/fondue-components23.js +1 -1
  16. package/dist/fondue-components24.js +1 -1
  17. package/dist/fondue-components25.js +8 -8
  18. package/dist/fondue-components25.js.map +1 -1
  19. package/dist/fondue-components28.js +1 -1
  20. package/dist/fondue-components31.js +1 -1
  21. package/dist/fondue-components33.js +1 -1
  22. package/dist/fondue-components37.js +10 -25
  23. package/dist/fondue-components37.js.map +1 -1
  24. package/dist/fondue-components40.js +17 -14
  25. package/dist/fondue-components40.js.map +1 -1
  26. package/dist/fondue-components41.js +17 -18
  27. package/dist/fondue-components41.js.map +1 -1
  28. package/dist/fondue-components42.js +4 -16
  29. package/dist/fondue-components42.js.map +1 -1
  30. package/dist/fondue-components43.js +13 -3
  31. package/dist/fondue-components43.js.map +1 -1
  32. package/dist/fondue-components44.js +3 -13
  33. package/dist/fondue-components44.js.map +1 -1
  34. package/dist/fondue-components45.js +35 -5
  35. package/dist/fondue-components45.js.map +1 -1
  36. package/dist/fondue-components46.js +13 -35
  37. package/dist/fondue-components46.js.map +1 -1
  38. package/dist/fondue-components47.js +4 -12
  39. package/dist/fondue-components47.js.map +1 -1
  40. package/dist/fondue-components48.js +24 -4
  41. package/dist/fondue-components48.js.map +1 -1
  42. package/dist/fondue-components49.js +16 -24
  43. package/dist/fondue-components49.js.map +1 -1
  44. package/dist/fondue-components50.js +139 -16
  45. package/dist/fondue-components50.js.map +1 -1
  46. package/dist/fondue-components51.js +16 -140
  47. package/dist/fondue-components51.js.map +1 -1
  48. package/dist/fondue-components52.js +70 -16
  49. package/dist/fondue-components52.js.map +1 -1
  50. package/dist/fondue-components53.js +8 -72
  51. package/dist/fondue-components53.js.map +1 -1
  52. package/dist/fondue-components54.js +33 -8
  53. package/dist/fondue-components54.js.map +1 -1
  54. package/dist/fondue-components55.js +48 -32
  55. package/dist/fondue-components55.js.map +1 -1
  56. package/dist/fondue-components56.js +10 -48
  57. package/dist/fondue-components56.js.map +1 -1
  58. package/dist/fondue-components57.js +10 -8
  59. package/dist/fondue-components57.js.map +1 -1
  60. package/dist/fondue-components58.js +7 -12
  61. package/dist/fondue-components58.js.map +1 -1
  62. package/dist/fondue-components59.js +12 -7
  63. package/dist/fondue-components59.js.map +1 -1
  64. package/dist/fondue-components60.js +20 -12
  65. package/dist/fondue-components60.js.map +1 -1
  66. package/dist/fondue-components61.js +15 -19
  67. package/dist/fondue-components61.js.map +1 -1
  68. package/dist/fondue-components62.js +52 -14
  69. package/dist/fondue-components62.js.map +1 -1
  70. package/dist/fondue-components63.js +14 -52
  71. package/dist/fondue-components63.js.map +1 -1
  72. package/dist/fondue-components64.js +17 -14
  73. package/dist/fondue-components64.js.map +1 -1
  74. package/dist/fondue-components65.js +6 -17
  75. package/dist/fondue-components65.js.map +1 -1
  76. package/dist/fondue-components66.js +2 -7
  77. package/dist/fondue-components66.js.map +1 -1
  78. package/dist/fondue-components67.js +15 -2
  79. package/dist/fondue-components67.js.map +1 -1
  80. package/dist/fondue-components68.js +1 -1
  81. package/dist/fondue-components9.js +91 -101
  82. package/dist/fondue-components9.js.map +1 -1
  83. package/dist/index.d.ts +6 -8
  84. package/dist/style.css +1 -1
  85. package/package.json +3 -3
  86. package/dist/fondue-components69.js +0 -18
  87. package/dist/fondue-components69.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
3
  import { propsToCssVariables as y } from "./fondue-components25.js";
4
- import x from "./fondue-components43.js";
4
+ import x from "./fondue-components42.js";
5
5
  const u = n(
6
6
  ({
7
7
  as: a = "div",
@@ -1,94 +1,84 @@
1
- import { jsx as a, jsxs as y, Fragment as C } from "react/jsx-runtime";
2
- import { IconCross as b } from "@frontify/fondue-icons";
1
+ import { jsx as a, jsxs as l, Fragment as R } from "react/jsx-runtime";
2
+ import { IconCross as w } from "@frontify/fondue-icons";
3
3
  import * as i from "@radix-ui/react-popover";
4
- import { forwardRef as r, useRef as A } from "react";
5
- import { usePreventDropdownOverflow as H } from "./fondue-components40.js";
6
- import { addAutoFocusAttribute as P, syncRefs as c, addShowFocusRing as B } from "./fondue-components37.js";
7
- import d from "./fondue-components44.js";
8
- const f = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
9
- f.displayName = "Flyout.Root";
10
- const m = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...s }, l) => /* @__PURE__ */ a(
4
+ import { forwardRef as s } from "react";
5
+ import { addAutoFocusAttribute as x, addShowFocusRing as C } from "./fondue-components37.js";
6
+ import d from "./fondue-components43.js";
7
+ const n = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
8
+ n.displayName = "Flyout.Root";
9
+ const y = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...r }, u) => /* @__PURE__ */ a(
11
10
  i.Trigger,
12
11
  {
13
- onMouseDown: P,
12
+ onMouseDown: x,
14
13
  "data-auto-focus-visible": "true",
15
14
  "data-auto-focus-trigger": !0,
16
15
  "data-test-id": e,
17
16
  asChild: t,
18
- ref: l,
19
- ...s,
17
+ ref: u,
18
+ ...r,
20
19
  children: o
21
20
  }
22
21
  );
23
- m.displayName = "Flyout.Trigger";
24
- const p = ({
22
+ y.displayName = "Flyout.Trigger";
23
+ const c = ({
25
24
  align: t = "start",
26
25
  maxWidth: o = "360px",
27
26
  padding: e = "compact",
28
- rounded: s = "medium",
29
- width: l = "fit-content",
30
- shadow: h = "medium",
31
- "data-test-id": v = "fondue-flyout-content",
32
- children: R,
33
- ...w
34
- }, n) => {
35
- const u = A(null), { setMaxHeight: x } = H(u);
36
- return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ y(C, { children: [
37
- /* @__PURE__ */ a("div", { className: d.overlay }),
38
- /* @__PURE__ */ a(
39
- i.Content,
40
- {
41
- style: {
42
- "--flyout-max-width": o,
43
- "--flyout-width": l
44
- },
45
- ref: u,
46
- align: t,
47
- collisionPadding: 8,
48
- sideOffset: 8,
49
- onOpenAutoFocus: () => {
50
- x(), c(u, n);
51
- },
52
- onCloseAutoFocus: () => {
53
- c(u, n);
54
- },
55
- className: d.root,
56
- "data-flyout-spacing": e,
57
- "data-rounded": s,
58
- "data-shadow": h,
59
- "data-test-id": v,
60
- onFocus: B,
61
- ...w,
62
- children: R
63
- }
64
- )
65
- ] }) });
66
- };
67
- p.displayName = "Flyout.Content";
68
- const F = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ y("div", { "data-test-id": e, ref: s, className: d.header, children: [
27
+ rounded: r = "medium",
28
+ width: u = "fit-content",
29
+ shadow: p = "medium",
30
+ "data-test-id": g = "fondue-flyout-content",
31
+ children: N,
32
+ ...h
33
+ }, v) => /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ l(R, { children: [
34
+ /* @__PURE__ */ a("div", { className: d.overlay }),
35
+ /* @__PURE__ */ a(
36
+ i.Content,
37
+ {
38
+ style: {
39
+ "--flyout-max-width": o,
40
+ "--flyout-width": u
41
+ },
42
+ ref: v,
43
+ align: t,
44
+ collisionPadding: 8,
45
+ sideOffset: 8,
46
+ className: d.root,
47
+ "data-flyout-spacing": e,
48
+ "data-rounded": r,
49
+ "data-shadow": p,
50
+ "data-test-id": g,
51
+ onFocus: C,
52
+ ...h,
53
+ children: N
54
+ }
55
+ )
56
+ ] }) });
57
+ c.displayName = "Flyout.Content";
58
+ const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, r) => /* @__PURE__ */ l("div", { "data-test-id": e, ref: r, className: d.header, children: [
69
59
  /* @__PURE__ */ a("div", { children: o }),
70
- t && /* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(b, { size: 20 }) })
60
+ t && /* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(w, { size: 20 }) })
71
61
  ] });
72
- F.displayName = "Flyout.Header";
73
- const g = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
74
- g.displayName = "Flyout.Footer";
75
- const N = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: d.body, children: t });
76
- N.displayName = "Flyout.Body";
77
- const S = {
78
- Root: f,
79
- Trigger: r(m),
80
- Content: r(p),
81
- Header: r(F),
82
- Footer: r(g),
83
- Body: r(N)
62
+ m.displayName = "Flyout.Header";
63
+ const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
64
+ f.displayName = "Flyout.Footer";
65
+ const F = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: d.body, children: t });
66
+ F.displayName = "Flyout.Body";
67
+ const j = {
68
+ Root: n,
69
+ Trigger: s(y),
70
+ Content: s(c),
71
+ Header: s(m),
72
+ Footer: s(f),
73
+ Body: s(F)
84
74
  };
85
75
  export {
86
- S as Flyout,
87
- N as FlyoutBody,
88
- p as FlyoutContent,
89
- g as FlyoutFooter,
90
- F as FlyoutHeader,
91
- f as FlyoutRoot,
92
- m as FlyoutTrigger
76
+ j as Flyout,
77
+ F as FlyoutBody,
78
+ c as FlyoutContent,
79
+ f as FlyoutFooter,
80
+ m as FlyoutHeader,
81
+ n as FlyoutRoot,
82
+ y as FlyoutTrigger
93
83
  };
94
84
  //# sourceMappingURL=fondue-components11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, useRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { addAutoFocusAttribute, addShowFocusRing, syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef<HTMLDivElement>(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixPopover.Portal>\n <>\n <div className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={localRef}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n onOpenAutoFocus={() => {\n setMaxHeight();\n syncRefs(localRef, ref);\n }}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n }}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className={styles.close}>\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body' }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} data-flyout-spacing=\"compact\" className={styles.body}>\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","jsxs","Fragment","styles","syncRefs","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA6BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,GAAS;AAEnDD,EAAW,cAAc;AAYlB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAa;AAAA,EAAb;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AA0CrB,MAAMM,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,gBAAgBV,IAAa;AAAA,EAC7B,UAAAL;AAAA,EACA,GAAGC;AACP,GACAK,MACC;AACK,QAAAU,IAAWC,EAAuB,IAAI,GAEtC,EAAE,cAAAC,EAAA,IAAiBC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I,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWgB,EAAO,QACtD,UAAAtB,GACL;AAGR4B,EAAa,cAAc;AAId,MAAAC,IAAa,CACtB,EAAE,UAAA7B,GAAU,gBAAgBK,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWgB,EAAO,MACpF,UAAAtB,EACL,CAAA;AAGR6B,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAM/B;AAAA,EACN,SAASgC,EAAkD5B,CAAa;AAAA,EACxE,SAAS4B,EAA+CtB,CAAa;AAAA,EACrE,QAAQsB,EAA8CN,CAAY;AAAA,EAClE,QAAQM,EAA8CH,CAAY;AAAA,EAClE,MAAMG,EAA4CF,CAAU;AAChE;"}
1
+ {"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixPopover.Portal>\n <>\n <div className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className={styles.close}>\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body' }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} data-flyout-spacing=\"compact\" className={styles.body}>\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","jsxs","Fragment","styles","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;AA4BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,GAAS;AAEnDD,EAAW,cAAc;AAYlB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAa;AAAA,EAAb;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AA0CrB,MAAMM,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,gBAAgBV,IAAa;AAAA,EAC7B,UAAAL;AAAA,EACA,GAAGC;AACP,GACAK,MAGK,gBAAAC,EAAAL,EAAa,QAAb,EACG,UACI,gBAAAc,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAC,gBAAAV,EAAA,OAAA,EAAI,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MAAMC,IAAS;AAAA,EAClB,MAAM1B;AAAA,EACN,SAAS2B,EAAkDvB,CAAa;AAAA,EACxE,SAASuB,EAA+CjB,CAAa;AAAA,EACrE,QAAQiB,EAA8CN,CAAY;AAAA,EAClE,QAAQM,EAA8CH,CAAY;AAAA,EAClE,MAAMG,EAA4CF,CAAU;AAChE;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as f } from "react";
3
3
  import { propsToCssVariables as y } from "./fondue-components25.js";
4
- import n from "./fondue-components45.js";
4
+ import n from "./fondue-components44.js";
5
5
  const u = f(
6
6
  ({
7
7
  as: a = "div",
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-progress";
3
3
  import { forwardRef as m } from "react";
4
- import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components46.js";
4
+ import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components45.js";
5
5
  const p = m(
6
6
  ({
7
7
  value: a,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-scroll-area";
3
3
  import { forwardRef as b } from "react";
4
- import a from "./fondue-components47.js";
4
+ import a from "./fondue-components46.js";
5
5
  const h = ({
6
6
  type: t,
7
7
  maxHeight: e = "100%",
@@ -1,7 +1,7 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
3
  import { propsToCssVariables as m } from "./fondue-components25.js";
4
- import c from "./fondue-components48.js";
4
+ import c from "./fondue-components47.js";
5
5
  const f = n(
6
6
  ({
7
7
  "data-test-id": a = "fondue-section",
@@ -1,8 +1,8 @@
1
1
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import * as i from "@radix-ui/react-toggle-group";
3
3
  import { forwardRef as n } from "react";
4
- import { useControllableState as N } from "./fondue-components49.js";
5
- import e from "./fondue-components50.js";
4
+ import { useControllableState as N } from "./fondue-components48.js";
5
+ import e from "./fondue-components49.js";
6
6
  const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
7
7
  const [g, C] = N({
8
8
  prop: o,
@@ -4,12 +4,12 @@ import * as S from "@radix-ui/react-popover";
4
4
  import { Slot as H } from "@radix-ui/react-slot";
5
5
  import { useSelect as T } from "downshift";
6
6
  import { forwardRef as V, useRef as $, useState as A } from "react";
7
- import { ForwardedRefCombobox as q } from "./fondue-components51.js";
8
- import { ForwardedRefSelectItem as J, ForwardedRefSelectItemGroup as K } from "./fondue-components52.js";
9
- import { SelectMenu as L } from "./fondue-components53.js";
10
- import { ForwardedRefSelectSlot as Q } from "./fondue-components54.js";
11
- import a from "./fondue-components55.js";
12
- import { useSelectData as U } from "./fondue-components56.js";
7
+ import { ForwardedRefCombobox as q } from "./fondue-components50.js";
8
+ import { ForwardedRefSelectItem as J, ForwardedRefSelectItemGroup as K } from "./fondue-components51.js";
9
+ import { SelectMenu as L } from "./fondue-components52.js";
10
+ import { ForwardedRefSelectSlot as Q } from "./fondue-components53.js";
11
+ import a from "./fondue-components54.js";
12
+ import { useSelectData as U } from "./fondue-components55.js";
13
13
  const g = ({
14
14
  children: h,
15
15
  onSelect: i,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
2
  import * as e from "@radix-ui/react-slider";
3
3
  import { forwardRef as h, useRef as R } from "react";
4
- import r from "./fondue-components57.js";
4
+ import r from "./fondue-components56.js";
5
5
  const g = ({
6
6
  value: a,
7
7
  defaultValue: n = [0],
@@ -2,7 +2,7 @@ import { jsx as e } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-switch";
3
3
  import { forwardRef as l } from "react";
4
4
  import { cn as f } from "./fondue-components27.js";
5
- import t from "./fondue-components58.js";
5
+ import t from "./fondue-components57.js";
6
6
  const n = ({
7
7
  value: a,
8
8
  defaultValue: i,
@@ -1,39 +1,39 @@
1
1
  import { jsx as n, jsxs as k } from "react/jsx-runtime";
2
- import { IconArrowUp as B, IconArrowDown as h, IconArrowBidirectional as A } from "@frontify/fondue-icons";
3
- import { forwardRef as u, useRef as y, useMemo as K } from "react";
4
- import { useSyncRefs as p } from "./fondue-components59.js";
5
- import { useTextTruncation as w } from "./fondue-components60.js";
6
- import o from "./fondue-components61.js";
7
- import { handleKeyDown as z } from "./fondue-components62.js";
8
- const N = u(
9
- ({ layout: e = "auto", sticky: a, children: l, ...r }, t) => /* @__PURE__ */ n("div", { onKeyDown: z, role: "grid", tabIndex: -1, children: /* @__PURE__ */ n("table", { ref: t, className: o.table, "data-layout": e, "data-sticky": a, ...r, children: l }) })
2
+ import { IconArrowUp as B, IconArrowDown as A, IconArrowBidirectional as K } from "@frontify/fondue-icons";
3
+ import { forwardRef as m, useRef as y, useMemo as h } from "react";
4
+ import { useSyncRefs as p } from "./fondue-components58.js";
5
+ import { useTextTruncation as w } from "./fondue-components59.js";
6
+ import o from "./fondue-components60.js";
7
+ import { handleKeyDown as z } from "./fondue-components61.js";
8
+ const N = m(
9
+ ({ layout: e = "auto", sticky: a, children: l, ...i }, t) => /* @__PURE__ */ n("div", { onKeyDown: z, role: "grid", tabIndex: -1, children: /* @__PURE__ */ n("table", { ref: t, className: o.table, "data-layout": e, "data-sticky": a, ...i, children: l }) })
10
10
  );
11
11
  N.displayName = "Table.Root";
12
- const g = u(({ children: e }, a) => /* @__PURE__ */ n("caption", { ref: a, className: o.caption, children: e }));
12
+ const g = m(({ children: e }, a) => /* @__PURE__ */ n("caption", { ref: a, className: o.caption, children: e }));
13
13
  g.displayName = "Table.Caption";
14
- const R = u(
15
- ({ children: e, "aria-label": a, "aria-busy": l }, r) => /* @__PURE__ */ n("thead", { ref: r, className: o.header, "aria-label": a, "aria-busy": l, children: e })
14
+ const R = m(
15
+ ({ children: e, "aria-label": a, "aria-busy": l }, i) => /* @__PURE__ */ n("thead", { ref: i, className: o.header, "aria-label": a, "aria-busy": l, children: e })
16
16
  );
17
17
  R.displayName = "Table.Header";
18
- const C = u(
18
+ const C = m(
19
19
  ({
20
20
  noShrink: e = !1,
21
21
  truncate: a = !1,
22
22
  align: l = "left",
23
- scope: r = "col",
23
+ scope: i = "col",
24
24
  sortTranslations: t,
25
25
  sortDirection: d,
26
26
  colSpan: c,
27
27
  width: b,
28
- onSortChange: i,
29
- children: s
30
- }, m) => {
28
+ onSortChange: s,
29
+ children: r
30
+ }, u) => {
31
31
  const f = y(null);
32
- p(f, m), w(f);
33
- const x = K(() => typeof s == "string" ? d === "ascending" ? (t == null ? void 0 : t.sortDescending) ?? `Sort by ${s} descending` : (t == null ? void 0 : t.sortAscending) ?? `Sort by ${s} ascending` : d === "ascending" ? "Sort descending" : "Sort ascending", [s, d, t]), H = () => {
34
- if (!i)
32
+ p(f, u), w(f);
33
+ const I = h(() => typeof r == "string" ? d === "ascending" ? (t == null ? void 0 : t.sortDescending) ?? `Sort by ${r} descending` : (t == null ? void 0 : t.sortAscending) ?? `Sort by ${r} ascending` : d === "ascending" ? "Sort descending" : "Sort ascending", [r, d, t]), H = () => {
34
+ if (!s)
35
35
  return;
36
- i(d === void 0 || d === "descending" ? "ascending" : "descending");
36
+ s(d === void 0 || d === "descending" ? "ascending" : "descending");
37
37
  };
38
38
  return /* @__PURE__ */ n(
39
39
  "th",
@@ -41,41 +41,41 @@ const C = u(
41
41
  ref: f,
42
42
  style: { width: b },
43
43
  className: o.headerCell,
44
- scope: r,
44
+ scope: i,
45
45
  colSpan: c,
46
46
  "data-align": l,
47
47
  "data-truncate": a,
48
48
  "data-no-shrink": e,
49
- "data-sortable": !!i,
50
- "aria-sort": i ? d || "none" : void 0,
51
- children: i ? /* @__PURE__ */ k(
49
+ "data-sortable": !!s,
50
+ "aria-sort": s ? d || "none" : void 0,
51
+ children: s ? /* @__PURE__ */ n("div", { className: o.cellContent, children: /* @__PURE__ */ k(
52
52
  "button",
53
53
  {
54
54
  className: o.sortButton,
55
- "aria-label": x,
55
+ "aria-label": I,
56
56
  "data-active": !!d,
57
57
  onClick: H,
58
58
  children: [
59
- s,
60
- d === "ascending" ? /* @__PURE__ */ n(B, { size: "12" }) : d === "descending" ? /* @__PURE__ */ n(h, { size: "12" }) : /* @__PURE__ */ n(A, { className: o.sortIndicator, size: "12" })
59
+ typeof r == "string" && a ? /* @__PURE__ */ n("span", { className: o.buttonText, children: r }) : r,
60
+ d === "ascending" ? /* @__PURE__ */ n(B, { size: "12" }) : d === "descending" ? /* @__PURE__ */ n(A, { size: "12" }) : /* @__PURE__ */ n(K, { className: o.sortIndicator, size: "12" })
61
61
  ]
62
62
  }
63
- ) : s
63
+ ) }) : r
64
64
  }
65
65
  );
66
66
  }
67
67
  );
68
68
  C.displayName = "Table.HeaderCell";
69
- const v = u(
69
+ const v = m(
70
70
  ({ children: e, "aria-busy": a }, l) => /* @__PURE__ */ n("tbody", { ref: l, className: o.body, "aria-busy": a, children: e })
71
71
  );
72
72
  v.displayName = "Table.Body";
73
- const I = u(
74
- ({ disabled: e = !1, selected: a = !1, onClick: l, children: r, "aria-label": t, "data-test-id": d }, c) => {
75
- const b = l !== void 0 && !e, i = () => {
73
+ const T = m(
74
+ ({ disabled: e = !1, selected: a = !1, onClick: l, children: i, "aria-label": t, "data-test-id": d }, c) => {
75
+ const b = l !== void 0 && !e, s = () => {
76
76
  e || l && l(a);
77
- }, s = (m) => {
78
- b && (m.key === "Enter" || m.key === " ") && (m.preventDefault(), i());
77
+ }, r = (u) => {
78
+ b && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), s());
79
79
  };
80
80
  return /* @__PURE__ */ n(
81
81
  "tr",
@@ -90,17 +90,17 @@ const I = u(
90
90
  "aria-disabled": e,
91
91
  "aria-label": t,
92
92
  "aria-selected": a,
93
- onClick: b ? i : void 0,
94
- onKeyDown: b ? s : void 0,
93
+ onClick: b ? s : void 0,
94
+ onKeyDown: b ? r : void 0,
95
95
  "data-test-id": d,
96
- children: r
96
+ children: i
97
97
  }
98
98
  );
99
99
  }
100
100
  );
101
- I.displayName = "Table.Row";
102
- const T = u(
103
- ({ colSpan: e, truncate: a, align: l = "left", children: r, "aria-label": t }, d) => {
101
+ T.displayName = "Table.Row";
102
+ const x = m(
103
+ ({ colSpan: e, truncate: a, align: l = "left", children: i, "aria-label": t }, d) => {
104
104
  const c = y(null);
105
105
  return p(c, d), w(c), /* @__PURE__ */ n(
106
106
  "td",
@@ -111,20 +111,20 @@ const T = u(
111
111
  "data-align": l,
112
112
  "data-truncate": a,
113
113
  "aria-label": t,
114
- children: r
114
+ children: i
115
115
  }
116
116
  );
117
117
  }
118
118
  );
119
- T.displayName = "Table.RowCell";
119
+ x.displayName = "Table.RowCell";
120
120
  const q = {
121
121
  Root: N,
122
122
  Caption: g,
123
123
  Header: R,
124
124
  HeaderCell: C,
125
125
  Body: v,
126
- Row: I,
127
- RowCell: T
126
+ Row: T,
127
+ RowCell: x
128
128
  };
129
129
  export {
130
130
  q as Table,
@@ -133,7 +133,7 @@ export {
133
133
  R as TableHeader,
134
134
  C as TableHeaderCell,
135
135
  N as TableRoot,
136
- I as TableRow,
137
- T as TableRowCell
136
+ T as TableRow,
137
+ x as TableRowCell
138
138
  };
139
139
  //# sourceMappingURL=fondue-components21.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components21.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowDown, IconArrowUp, IconArrowBidirectional } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useMemo,\n useRef,\n type ReactNode,\n type KeyboardEvent,\n type CSSProperties,\n type ReactElement,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', sticky, children, ...props }, ref) => {\n return (\n <div onKeyDown={handleKeyDown} role=\"grid\" tabIndex={-1}>\n <table ref={ref} className={styles.table} data-layout={layout} data-sticky={sticky} {...props}>\n {children}\n </table>\n </div>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {onSortChange ? (\n <button\n className={styles.sortButton}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n >\n {children}\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </button>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype BaseTableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\ntype ClickableTableRowProps = BaseTableRowProps & {\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick: (selected: boolean) => void;\n onNavigate?: never;\n href?: never;\n};\n\ntype NavigableTableRowProps = BaseTableRowProps & {\n onClick?: never;\n /**\n * Handler called when the row is clicked or activated via keyboard for navigation\n * Must be provided together with href\n */\n onNavigate: (href: string) => void;\n /**\n * URL associated with this row for navigation\n * Must be provided together with onNavigate\n */\n href: string;\n};\n\ntype NonInteractiveTableRowProps = BaseTableRowProps & {\n onClick?: never;\n onNavigate?: never;\n href?: never;\n};\n\ntype TableRowProps = ClickableTableRowProps | NavigableTableRowProps | NonInteractiveTableRowProps;\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = () => {\n if (disabled) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={selected}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={selected}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","sticky","children","props","ref","jsx","handleKeyDown","styles","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","TableRowCell","Table"],"mappings":";;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AA;AAAA,IACL;AAAA,EAAA;AAGZ;AACAwC,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAM7C;AAAA,EACN,SAASU;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMqB;AAAA,EACN,KAAKC;AAAA,EACL,SAASQ;AACb;"}
1
+ {"version":3,"file":"fondue-components21.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowDown, IconArrowUp, IconArrowBidirectional } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useMemo,\n useRef,\n type ReactNode,\n type KeyboardEvent,\n type CSSProperties,\n type ReactElement,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', sticky, children, ...props }, ref) => {\n return (\n <div onKeyDown={handleKeyDown} role=\"grid\" tabIndex={-1}>\n <table ref={ref} className={styles.table} data-layout={layout} data-sticky={sticky} {...props}>\n {children}\n </table>\n </div>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {onSortChange ? (\n <div className={styles.cellContent}>\n <button\n className={styles.sortButton}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n >\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </button>\n </div>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype BaseTableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\ntype ClickableTableRowProps = BaseTableRowProps & {\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick: (selected: boolean) => void;\n onNavigate?: never;\n href?: never;\n};\n\ntype NavigableTableRowProps = BaseTableRowProps & {\n onClick?: never;\n /**\n * Handler called when the row is clicked or activated via keyboard for navigation\n * Must be provided together with href\n */\n onNavigate: (href: string) => void;\n /**\n * URL associated with this row for navigation\n * Must be provided together with onNavigate\n */\n href: string;\n};\n\ntype NonInteractiveTableRowProps = BaseTableRowProps & {\n onClick?: never;\n onNavigate?: never;\n href?: never;\n};\n\ntype TableRowProps = ClickableTableRowProps | NavigableTableRowProps | NonInteractiveTableRowProps;\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = () => {\n if (disabled) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={selected}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={selected}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","sticky","children","props","ref","jsx","handleKeyDown","styles","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","TableRowCell","Table"],"mappings":";;;;;;;AAiCO,MAAMA,IAAYC;AAAA,EACrB,CAAC,EAAE,QAAAC,IAAS,QAAQ,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAM,GAAGC,MAE1C,gBAAAC,EAAC,SAAI,WAAWC,GAAe,MAAK,QAAO,UAAU,IACjD,UAAC,gBAAAD,EAAA,SAAA,EAAM,KAAAD,GAAU,WAAWG,EAAO,OAAO,eAAaP,GAAQ,eAAaC,GAAS,GAAGE,GACnF,UAAAD,EAAA,CACL,EACJ,CAAA;AAGZ;AACAJ,EAAU,cAAc;AAEjB,MAAMU,IAAeT,EAA6D,CAAC,EAAE,UAAAG,EAAA,GAAYE,wBAE/F,WAAQ,EAAA,KAAAA,GAAU,WAAWG,EAAO,SAChC,UAAAL,GACL,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Q,SACvCA,EAAM,eAAe,GACTD,EAAA;AAAA,IAEpB;AAGI,WAAA,gBAAAnC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAD;AAAA,QACA,WAAWG,EAAO;AAAA,QAClB,UAAU;AAAA,QACV,MAAMgC,IAAgB,WAAW;AAAA,QACjC,iBAAeJ;AAAA,QACf,oBAAkBI;AAAA,QAClB,iBAAeH;AAAA,QACf,iBAAeD;AAAA,QACf,cAAYzB;AAAA,QACZ,iBAAe0B;AAAA,QACf,SAASG,IAAgBC,IAAc;AAAA,QACvC,WAAWD,IAAgBjC,IAAgB;AAAA,QAC3C,gBAAcgC;AAAA,QAEb,UAAApC;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGZ;AACAgC,EAAS,cAAc;AAqBhB,MAAMQ,IAAe3C;AAAA,EACxB,CAAC,EAAE,SAAAoB,GAAS,UAAAL,GAAU,OAAAC,IAAQ,QAAQ,UAAAb,GAAU,cAAcQ,EAAU,GAAGN,MAAsB;AACvF,UAAAkB,IAAUC,EAA6B,IAAI;AACjD,WAAAC,EAAkCF,GAASlB,CAAG,GAE9CqB,EAAkBH,CAAO,GAGrB,gBAAAjB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKiB;AAAA,QACL,WAAWf,EAAO;AAAA,QAClB,SAAAY;AAAA,QACA,cAAYJ;AAAA,QACZ,iBAAeD;AAAA,QACf,cAAYJ;AAAA,QAEX,UAAAR;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGZ;AACAwC,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAM7C;AAAA,EACN,SAASU;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMqB;AAAA,EACN,KAAKC;AAAA,EACL,SAASQ;AACb;"}
@@ -2,11 +2,11 @@ import { jsx as a, jsxs as p } from "react/jsx-runtime";
2
2
  import { createContext as x, forwardRef as i, useCallback as j, createElement as N, useContext as T, useRef as A, useEffect as D } from "react";
3
3
  import { IconDotsHorizontal as E } from "@frontify/fondue-icons";
4
4
  import * as d from "@radix-ui/react-tabs";
5
- import { useControllableState as O } from "./fondue-components49.js";
5
+ import { useControllableState as O } from "./fondue-components48.js";
6
6
  import { Button as V } from "./fondue-components4.js";
7
7
  import { Dropdown as l } from "./fondue-components9.js";
8
- import { useTabTriggers as q } from "./fondue-components63.js";
9
- import r from "./fondue-components64.js";
8
+ import { useTabTriggers as q } from "./fondue-components62.js";
9
+ import r from "./fondue-components63.js";
10
10
  const b = x({
11
11
  value: "",
12
12
  disabled: !1
@@ -2,7 +2,7 @@ import { jsxs as g, jsx as s } from "react/jsx-runtime";
2
2
  import { IconCheckMark as w, IconExclamationMarkTriangle as N } from "@frontify/fondue-icons";
3
3
  import { forwardRef as n, useRef as S } from "react";
4
4
  import { cn as m } from "./fondue-components27.js";
5
- import r from "./fondue-components65.js";
5
+ import r from "./fondue-components64.js";
6
6
  const f = ({
7
7
  children: c,
8
8
  className: d,
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as g } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-tooltip";
3
3
  import { forwardRef as n } from "react";
4
4
  import { cn as T } from "./fondue-components27.js";
5
- import d from "./fondue-components66.js";
5
+ import d from "./fondue-components65.js";
6
6
  const l = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: e, ...s }) => /* @__PURE__ */ a(o.Provider, { children: /* @__PURE__ */ a(o.Root, { delayDuration: r, open: i, onOpenChange: e, ...s, children: t }) });
7
7
  l.displayName = "Tooltip.Root";
8
8
  const p = ({ asChild: t = !1, children: r, "data-test-id": i = "fondue-tooltip-trigger" }, e) => /* @__PURE__ */ a(o.Trigger, { "data-test-id": i, asChild: t, ref: e, children: r });