@frontify/fondue-components 3.3.5 → 4.0.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 (36) hide show
  1. package/dist/fondue-components11.js +29 -29
  2. package/dist/fondue-components11.js.map +1 -1
  3. package/dist/fondue-components18.js +38 -36
  4. package/dist/fondue-components18.js.map +1 -1
  5. package/dist/fondue-components22.js +12 -12
  6. package/dist/fondue-components22.js.map +1 -1
  7. package/dist/fondue-components26.js +1 -1
  8. package/dist/fondue-components29.js +1 -1
  9. package/dist/fondue-components31.js +15 -15
  10. package/dist/fondue-components31.js.map +1 -1
  11. package/dist/fondue-components36.js +13 -13
  12. package/dist/fondue-components39.js +14 -12
  13. package/dist/fondue-components39.js.map +1 -1
  14. package/dist/fondue-components44.js +4 -4
  15. package/dist/fondue-components47.js +10 -10
  16. package/dist/fondue-components48.js +42 -40
  17. package/dist/fondue-components48.js.map +1 -1
  18. package/dist/fondue-components49.js +7 -7
  19. package/dist/fondue-components49.js.map +1 -1
  20. package/dist/fondue-components50.js +57 -47
  21. package/dist/fondue-components50.js.map +1 -1
  22. package/dist/fondue-components52.js +28 -24
  23. package/dist/fondue-components52.js.map +1 -1
  24. package/dist/fondue-components54.js +8 -8
  25. package/dist/fondue-components56.js +9 -9
  26. package/dist/fondue-components58.js +2 -11
  27. package/dist/fondue-components58.js.map +1 -1
  28. package/dist/fondue-components59.js +11 -2
  29. package/dist/fondue-components59.js.map +1 -1
  30. package/dist/fondue-components7.js +92 -67
  31. package/dist/fondue-components7.js.map +1 -1
  32. package/dist/fondue-components9.js +25 -25
  33. package/dist/fondue-components9.js.map +1 -1
  34. package/dist/index.d.ts +42 -1
  35. package/dist/style.css +1 -1
  36. package/package.json +3 -3
@@ -1,22 +1,22 @@
1
1
  import { jsx as a, jsxs as v } from "react/jsx-runtime";
2
- import { IconCross as C } from "@frontify/fondue-icons";
3
- import * as r from "@radix-ui/react-popover";
4
- import { forwardRef as s, useRef as x } from "react";
2
+ import { IconCross as x } from "@frontify/fondue-icons";
3
+ import * as d from "@radix-ui/react-popover";
4
+ import { forwardRef as r, useRef as C } from "react";
5
5
  import { usePreventDropdownOverflow as w } from "./fondue-components38.js";
6
6
  import { addAutoFocusAttribute as b, syncRefs as n, addShowFocusRing as A } from "./fondue-components35.js";
7
- import d from "./fondue-components41.js";
8
- const c = ({ children: t, ...o }) => /* @__PURE__ */ a(r.Root, { ...o, children: t });
7
+ import u from "./fondue-components41.js";
8
+ const c = ({ children: t, ...o }) => /* @__PURE__ */ a(d.Root, { ...o, children: t });
9
9
  c.displayName = "Flyout.Root";
10
- const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(
11
- r.Trigger,
10
+ const y = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger" }, s) => /* @__PURE__ */ a(
11
+ d.Trigger,
12
12
  {
13
13
  onMouseDown: b,
14
14
  "data-auto-focus-visible": "true",
15
15
  "data-auto-focus-trigger": !0,
16
- "data-test-id": o,
17
- asChild: !0,
18
- ref: e,
19
- children: t
16
+ "data-test-id": e,
17
+ asChild: t,
18
+ ref: s,
19
+ children: o
20
20
  }
21
21
  );
22
22
  y.displayName = "Flyout.Trigger";
@@ -24,32 +24,32 @@ const f = ({
24
24
  align: t = "start",
25
25
  maxWidth: o = "360px",
26
26
  padding: e = "compact",
27
- "data-test-id": i = "fondue-flyout-content",
27
+ "data-test-id": s = "fondue-flyout-content",
28
28
  children: g,
29
29
  rounded: N,
30
30
  ...R
31
31
  }, l) => {
32
- const u = x(null), { setMaxHeight: h } = w(u);
33
- return /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
34
- r.Content,
32
+ const i = C(null), { setMaxHeight: h } = w(i);
33
+ return /* @__PURE__ */ a(d.Portal, { children: /* @__PURE__ */ a(
34
+ d.Content,
35
35
  {
36
36
  style: {
37
37
  "--flyout-max-width": o
38
38
  },
39
- ref: u,
39
+ ref: i,
40
40
  align: t,
41
41
  collisionPadding: 8,
42
42
  sideOffset: 8,
43
43
  onOpenAutoFocus: () => {
44
- h(), n(u, l);
44
+ h(), n(i, l);
45
45
  },
46
46
  onCloseAutoFocus: () => {
47
- n(u, l);
47
+ n(i, l);
48
48
  },
49
- className: d.root,
49
+ className: u.root,
50
50
  "data-flyout-spacing": e,
51
51
  "data-rounded": N,
52
- "data-test-id": i,
52
+ "data-test-id": s,
53
53
  onFocus: A,
54
54
  ...R,
55
55
  children: g
@@ -57,22 +57,22 @@ const f = ({
57
57
  ) });
58
58
  };
59
59
  f.displayName = "Flyout.Content";
60
- const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, i) => /* @__PURE__ */ v("div", { "data-test-id": e, ref: i, className: d.header, children: [
60
+ const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ v("div", { "data-test-id": e, ref: s, className: u.header, children: [
61
61
  /* @__PURE__ */ a("div", { children: o }),
62
- t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(C, { size: 20 }) })
62
+ t && /* @__PURE__ */ a(d.Close, { role: "button", "data-test-id": `${e}-close`, className: u.close, children: /* @__PURE__ */ a(x, { size: 20 }) })
63
63
  ] });
64
64
  m.displayName = "Flyout.Header";
65
- const p = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
65
+ const p = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: u.footer, children: t });
66
66
  p.displayName = "Flyout.Footer";
67
- 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 });
67
+ 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: u.body, children: t });
68
68
  F.displayName = "Flyout.Body";
69
69
  const D = {
70
70
  Root: c,
71
- Trigger: s(y),
72
- Content: s(f),
73
- Header: s(m),
74
- Footer: s(p),
75
- Body: s(F)
71
+ Trigger: r(y),
72
+ Content: r(f),
73
+ Header: r(m),
74
+ Footer: r(p),
75
+ Body: r(F)
76
76
  };
77
77
  export {
78
78
  D as Flyout,
@@ -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 type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\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 maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\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 type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport const FlyoutTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-trigger' }: 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\n ref={ref}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n rounded,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\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-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\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 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 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","dataTestId","ref","jsx","addAutoFocusAttribute","FlyoutContent","align","maxWidth","padding","rounded","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","syncRefs","styles","addShowFocus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AAcR;AAAA,MACd,SAASe;AAAA,MACR,GAAGlB;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAER;AACAQ,EAAc,cAAc;AAEf,MAAAY,IAAe,CACxB,EAAE,iBAAAC,GAAiB,UAAArB,GAAU,gBAAgBI,IAAa,uBAAuB,GACjFC,wBAGK,OAAI,EAAA,gBAAcD,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACvD,UAAA;AAAA,EAAA,gBAAAZ,EAAC,SAAK,UAAAN,GAAS;AAAA,EACdqB,KACI,gBAAAf,EAAAJ,EAAa,OAAb,EAAmB,MAAK,UAAS,gBAAc,GAAGE,CAAU,UAAU,WAAWc,EAAO,OACrF,4BAACI,GAAU,EAAA,MAAM,GAAI,CAAA,GACzB;AAER,EAAA,CAAA;AAGRF,EAAa,cAAc;AAEd,MAAAG,IAAe,CACxB,EAAE,UAAAvB,GAAU,gBAAgBI,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACtD,UAAAlB,EACL,CAAA;AAGRuB,EAAa,cAAc;AAEd,MAAAC,IAAa,CACtB,EAAE,UAAAxB,GAAU,gBAAgBI,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWa,EAAO,MACpF,UAAAlB,EACL,CAAA;AAGRwB,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAM1B;AAAA,EACN,SAAS2B,EAAkDvB,CAAa;AAAA,EACxE,SAASuB,EAA+ClB,CAAa;AAAA,EACrE,QAAQkB,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, 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' }: 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 >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\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 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 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n rounded,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\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-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\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","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","syncRefs","styles","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA6BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAYZ,MAAAI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,wBAAwB,GACjFC,MAGI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AAA,gBAAAZ,EAAC,SAAK,UAAAP,GAAS;AAAA,EACdsB,KACI,gBAAAf,EAAAL,EAAa,OAAb,EAAmB,MAAK,UAAS,gBAAc,GAAGG,CAAU,UAAU,WAAWc,EAAO,OACrF,4BAACI,GAAU,EAAA,MAAM,GAAI,CAAA,GACzB;AAER,EAAA,CAAA;AAGRF,EAAa,cAAc;AAId,MAAAG,IAAe,CACxB,EAAE,UAAAxB,GAAU,gBAAgBK,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACtD,UAAAnB,EACL,CAAA;AAGRwB,EAAa,cAAc;AAId,MAAAC,IAAa,CACtB,EAAE,UAAAzB,GAAU,gBAAgBK,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWa,EAAO,MACpF,UAAAnB,EACL,CAAA;AAGRyB,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAM3B;AAAA,EACN,SAAS4B,EAAkDxB,CAAa;AAAA,EACxE,SAASwB,EAA+ClB,CAAa;AAAA,EACrE,QAAQkB,EAA8CN,CAAY;AAAA,EAClE,QAAQM,EAA8CH,CAAY;AAAA,EAClE,MAAMG,EAA4CF,CAAU;AAChE;"}
@@ -1,15 +1,15 @@
1
1
  import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
- import { IconCaretDown as z, IconCheckMark as D, IconExclamationMarkTriangle as j } from "@frontify/fondue-icons";
2
+ import { IconCaretDown as D, IconCheckMark as j, IconExclamationMarkTriangle as E } from "@frontify/fondue-icons";
3
3
  import * as S from "@radix-ui/react-popover";
4
- import { Slot as E } from "@radix-ui/react-slot";
5
- import { useSelect as H } from "downshift";
6
- import { forwardRef as T, useRef as $, useState as A } from "react";
7
- import { ForwardedRefCombobox as V } from "./fondue-components48.js";
8
- import { ForwardedRefSelectItem as q, ForwardedRefSelectItemGroup as J } from "./fondue-components49.js";
9
- import { SelectMenu as K } from "./fondue-components50.js";
10
- import { ForwardedRefSelectSlot as L } from "./fondue-components51.js";
4
+ import { Slot as H } from "@radix-ui/react-slot";
5
+ import { useSelect as T } from "downshift";
6
+ import { forwardRef as V, useRef as $, useState as A } from "react";
7
+ import { ForwardedRefCombobox as q } from "./fondue-components48.js";
8
+ import { ForwardedRefSelectItem as J, ForwardedRefSelectItemGroup as K } from "./fondue-components49.js";
9
+ import { SelectMenu as L } from "./fondue-components50.js";
10
+ import { ForwardedRefSelectSlot as Q } from "./fondue-components51.js";
11
11
  import a from "./fondue-components52.js";
12
- import { useSelectData as Q } from "./fondue-components53.js";
12
+ import { useSelectData as U } from "./fondue-components53.js";
13
13
  const g = ({
14
14
  children: h,
15
15
  onSelect: i,
@@ -18,13 +18,14 @@ const g = ({
18
18
  placeholder: b = "",
19
19
  status: s = "neutral",
20
20
  disabled: m,
21
- "aria-label": C,
21
+ alignMenu: C = "start",
22
+ "aria-label": w,
22
23
  "data-test-id": l = "fondue-select"
23
24
  }, d) => {
24
- const { inputSlots: w, menuSlots: x, items: R, clearButton: u, getItemByValue: p } = Q(h), y = p(N), F = p(I), c = $(!1), [k, f] = A(!1), { getToggleButtonProps: v, getMenuProps: M, getItemProps: P, reset: B, selectedItem: r, isOpen: G, highlightedIndex: O } = H({
25
- items: R,
26
- defaultSelectedItem: y,
27
- selectedItem: F,
25
+ const { inputSlots: x, menuSlots: R, items: y, clearButton: u, getItemByValue: p } = U(h), F = p(N), k = p(I), c = $(!1), [v, f] = A(!1), { getToggleButtonProps: M, getMenuProps: P, getItemProps: B, reset: G, selectedItem: r, isOpen: O, highlightedIndex: z } = T({
26
+ items: y,
27
+ defaultSelectedItem: F,
28
+ selectedItem: k,
28
29
  onIsOpenChange: () => {
29
30
  f(!1);
30
31
  },
@@ -36,7 +37,7 @@ const g = ({
36
37
  },
37
38
  itemToString: (e) => e ? e.label : ""
38
39
  });
39
- return /* @__PURE__ */ n(S.Root, { open: G, children: [
40
+ return /* @__PURE__ */ n(S.Root, { open: O, children: [
40
41
  /* @__PURE__ */ o(
41
42
  S.Anchor,
42
43
  {
@@ -58,27 +59,27 @@ const g = ({
58
59
  "data-disabled": m,
59
60
  "data-empty": !r,
60
61
  "data-test-id": l,
61
- ...m ? {} : v({
62
- "aria-label": C,
62
+ ...m ? {} : M({
63
+ "aria-label": w,
63
64
  ...d ? { ref: d } : {}
64
65
  }),
65
66
  children: [
66
- /* @__PURE__ */ o("span", { className: a.input, children: r ? r.label : b }),
67
- w,
67
+ /* @__PURE__ */ o("span", { className: a.selectedValue, children: r ? r.label : b }),
68
+ x,
68
69
  u && /* @__PURE__ */ o(
69
- E,
70
+ H,
70
71
  {
71
72
  onClick: (e) => {
72
- e.stopPropagation(), B();
73
+ e.stopPropagation(), G();
73
74
  },
74
75
  className: a.clear,
75
76
  children: u
76
77
  }
77
78
  ),
78
79
  /* @__PURE__ */ n("div", { className: a.icons, children: [
79
- /* @__PURE__ */ o(z, { size: 16, className: a.caret }),
80
+ /* @__PURE__ */ o(D, { size: 16, className: a.caret }),
80
81
  s === "success" ? /* @__PURE__ */ o(
81
- D,
82
+ j,
82
83
  {
83
84
  size: 16,
84
85
  className: a.iconSuccess,
@@ -86,7 +87,7 @@ const g = ({
86
87
  }
87
88
  ) : null,
88
89
  s === "error" ? /* @__PURE__ */ o(
89
- j,
90
+ E,
90
91
  {
91
92
  size: 16,
92
93
  className: a.iconError,
@@ -100,31 +101,32 @@ const g = ({
100
101
  }
101
102
  ),
102
103
  /* @__PURE__ */ o(
103
- K,
104
+ L,
104
105
  {
105
- highlightedIndex: O,
106
- getMenuProps: M,
107
- getItemProps: P,
106
+ align: C,
107
+ highlightedIndex: z,
108
+ getMenuProps: P,
109
+ getItemProps: B,
108
110
  selectedItem: r,
109
- hasInteractedSinceOpening: k,
110
- children: x
111
+ hasInteractedSinceOpening: v,
112
+ children: R
111
113
  }
112
114
  )
113
115
  ] });
114
116
  };
115
117
  g.displayName = "Select";
116
- const U = T(g), t = U;
118
+ const W = V(g), t = W;
117
119
  t.displayName = "Select";
118
- t.Combobox = V;
120
+ t.Combobox = q;
119
121
  t.Combobox.displayName = "Select.Combobox";
120
- t.Item = q;
122
+ t.Item = J;
121
123
  t.Item.displayName = "Select.Item";
122
- t.Group = J;
124
+ t.Group = K;
123
125
  t.Group.displayName = "Select.Group";
124
- t.Slot = L;
126
+ t.Slot = Q;
125
127
  t.Slot.displayName = "Select.Slot";
126
128
  export {
127
- U as ForwardedRefSelect,
129
+ W as ForwardedRefSelect,
128
130
  t as Select,
129
131
  g as SelectInput
130
132
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.input}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AAuDO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,gBAAAC,EAAe,IAAIC,EAAcf,CAAQ,GAEtFgB,IAAcF,EAAeX,CAAY,GACzCc,IAAaH,EAAeZ,CAAK,GAEjCgB,IAAaC,EAAO,EAAK,GAEzB,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,EAAK,GAE1E,EAAE,sBAAAC,GAAsB,cAAAC,GAAc,cAAAC,GAAc,OAAAC,GAAO,cAAAC,GAAc,QAAAC,GAAQ,kBAAAC,EAAiB,IACpGC,EAAU;AAAA,IACN,OAAAlB;AAAA,IACA,qBAAqBI;AAAA,IACrB,cAAcC;AAAA,IACd,gBAAgB,MAAM;AAClB,MAAAI,EAA6B,EAAK;AAAA,IACtC;AAAA,IACA,0BAA0B,MAAM;AAC5B,MAAAA,EAA6B,EAAI;AAAA,IACrC;AAAA,IACA,sBAAsB,CAAC,EAAE,cAAAM,QAAmB;AAC5B,MAAA1B,KAAAA,EAAS0B,EAAa,KAAK;AAAA,IAC3C;AAAA,IACA,cAAc,CAACI,MAAUA,IAAOA,EAAK,QAAQ;AAAA,EAAA,CAChD;AAEL,SACK,gBAAAC,EAAAC,EAAa,MAAb,EAAkB,MA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WJ,EAAO;AAAA,oBAClB,gBAAc,GAAG9B,CAAU;AAAA,kBAAA;AAAA,gBAAA,IAE/B;AAAA,gBACHH,MAAW,UACR,gBAAA6B;AAAA,kBAACS;AAAA,kBAAA;AAAA,oBACG,MAAM;AAAA,oBACN,WAAWL,EAAO;AAAA,oBAClB,gBAAc,GAAG9B,CAAU;AAAA,kBAAA;AAAA,gBAAA,IAE/B;AAAA,cAAA,GACR;AAAA,YAAA;AAAA,UAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IACJ;AAAA,IAEA,gBAAA0B;AAAA,MAACU;AAAA,MAAA;AAAA,QACG,kBAAAf;AAAA,QACA,cAAAL;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAP;AAAA,QAEC,UAAAT;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAZ,EAAY,cAAc;AAEb,MAAA8C,IAAqBC,EAAiD/C,CAAW,GAGjFgD,IAKTF;AACJE,EAAO,cAAc;AACrBA,EAAO,WAAWC;AAClBD,EAAO,SAAS,cAAc;AAC9BA,EAAO,OAAOE;AACdF,EAAO,KAAK,cAAc;AAC1BA,EAAO,QAAQG;AACfH,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOI;AACdJ,EAAO,KAAK,cAAc;"}
1
+ {"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n alignMenu = 'start',\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.selectedValue}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n align={alignMenu}\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","alignMenu","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AA4DO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,gBAAAC,EAAe,IAAIC,EAAchB,CAAQ,GAEtFiB,IAAcF,EAAeZ,CAAY,GACzCe,IAAaH,EAAeb,CAAK,GAEjCiB,IAAaC,EAAO,EAAK,GAEzB,CAACC,GAA2BC,CAA4B,I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,SAAS,cAAc;AAC9BA,EAAO,OAAOE;AACdF,EAAO,KAAK,cAAc;AAC1BA,EAAO,QAAQG;AACfH,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOI;AACdJ,EAAO,KAAK,cAAc;"}
@@ -1,44 +1,44 @@
1
- import { jsx as e, jsxs as T } from "react/jsx-runtime";
1
+ 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 s } from "react";
4
- import { cn as f } from "./fondue-components25.js";
4
+ import { cn as T } from "./fondue-components25.js";
5
5
  import n from "./fondue-components57.js";
6
- const d = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ e(o.Provider, { children: /* @__PURE__ */ e(o.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
6
+ const d = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: e }) => /* @__PURE__ */ a(o.Provider, { children: /* @__PURE__ */ a(o.Root, { delayDuration: r, open: i, onOpenChange: e, children: t }) });
7
7
  d.displayName = "Tooltip.Root";
8
- const l = ({ children: t, "data-test-id": r = "fondue-tooltip-trigger" }, i) => /* @__PURE__ */ e(o.Trigger, { "data-test-id": r, asChild: !0, ref: i, children: t });
8
+ const l = ({ 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 });
9
9
  l.displayName = "Tooltip.Trigger";
10
10
  const p = ({
11
11
  children: t,
12
12
  className: r,
13
13
  maxWidth: i,
14
- "data-test-id": a = "fondue-tooltip-content",
14
+ "data-test-id": e = "fondue-tooltip-content",
15
15
  padding: m = "spacious",
16
16
  ...c
17
- }, g) => /* @__PURE__ */ e(o.Portal, { children: /* @__PURE__ */ T(
17
+ }, f) => /* @__PURE__ */ a(o.Portal, { children: /* @__PURE__ */ g(
18
18
  o.Content,
19
19
  {
20
- "data-test-id": a,
20
+ "data-test-id": e,
21
21
  "data-tooltip-spacing": m,
22
- className: f(n.root, r),
22
+ className: T(n.root, r),
23
23
  style: { maxWidth: i },
24
24
  collisionPadding: 16,
25
25
  sideOffset: 8,
26
- ref: g,
26
+ ref: f,
27
27
  ...c,
28
28
  children: [
29
29
  t,
30
- /* @__PURE__ */ e(o.Arrow, { "aria-hidden": "true", className: n.arrow })
30
+ /* @__PURE__ */ a(o.Arrow, { "aria-hidden": "true", className: n.arrow })
31
31
  ]
32
32
  }
33
33
  ) });
34
34
  p.displayName = "Tooltip.Content";
35
- const C = {
35
+ const h = {
36
36
  Root: d,
37
37
  Trigger: s(l),
38
38
  Content: s(p)
39
39
  };
40
40
  export {
41
- C as Tooltip,
41
+ h as Tooltip,
42
42
  p as TooltipContent,
43
43
  d as TooltipRoot,
44
44
  l as TooltipTrigger
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components22.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\nexport type TooltipTriggerProps = { children: ReactNode; 'data-test-id'?: string };\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport const TooltipTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n ...props\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={cn(styles.root, className)}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n {...props}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","dataTestId","ref","TooltipContent","className","maxWidth","padding","props","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;AAyCa,MAAAA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAEvD,gBAAAC,EAAAC,EAAa,UAAb,EACG,UAAC,gBAAAD,EAAAC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,EACJ,CAAA;AAGRD,EAAY,cAAc;AAEb,MAAAO,IAAiB,CAC1B,EAAE,UAAAN,GAAU,gBAAgBO,IAAa,4BACzCC,MAGI,gBAAAJ,EAACC,EAAa,SAAb,EAAqB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GACnD,UAAAR,EACL,CAAA;AAGRM,EAAe,cAAc;AAEtB,MAAMG,IAAiB,CAC1B;AAAA,EACI,UAAAT;AAAA,EACA,WAAAU;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,GAAGC;AACP,GACAL,MAGI,gBAAAJ,EAACC,EAAa,QAAb,EACG,UAAA,gBAAAS;AAAA,EAACT,EAAa;AAAA,EAAb;AAAA,IACG,gBAAcE;AAAA,IACd,wBAAsBK;AAAA,IACtB,WAAWG,EAAGC,EAAO,MAAMN,CAAS;AAAA,IACpC,OAAO,EAAE,UAAAC,EAAS;AAAA,IAClB,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,KAAAH;AAAA,IACC,GAAGK;AAAA,IAEH,UAAA;AAAA,MAAAb;AAAA,MACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWW,EAAO,OAAO;AAAA,IAAA;AAAA,EAAA;AAExE,EAAA,CAAA;AAGRP,EAAe,cAAc;AAEtB,MAAMQ,IAAU;AAAA,EACnB,MAAMlB;AAAA,EACN,SAASmB,EAAmDZ,CAAc;AAAA,EAC1E,SAASY,EAAgDT,CAAc;AAC3E;"}
1
+ {"version":3,"file":"fondue-components22.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport type TooltipTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipTrigger = (\n { asChild = false, children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger data-test-id={dataTestId} asChild={asChild} ref={ref}>\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n ...props\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixTooltip.Portal>\n <RadixTooltip.Content\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={cn(styles.root, className)}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n {...props}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","asChild","dataTestId","ref","TooltipContent","className","maxWidth","padding","props","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;AA0Ba,MAAAA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAEvD,gBAAAC,EAAAC,EAAa,UAAb,EACG,UAAC,gBAAAD,EAAAC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,EACJ,CAAA;AAGRD,EAAY,cAAc;AAYb,MAAAO,IAAiB,CAC1B,EAAE,SAAAC,IAAU,IAAO,UAAAP,GAAU,gBAAgBQ,IAAa,yBAAyB,GACnFC,MAGI,gBAAAL,EAACC,EAAa,SAAb,EAAqB,gBAAcG,GAAY,SAAAD,GAAkB,KAAAE,GAC7D,UAAAT,EACL,CAAA;AAGRM,EAAe,cAAc;AAiBtB,MAAMI,IAAiB,CAC1B;AAAA,EACI,UAAAV;AAAA,EACA,WAAAW;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,GAAGC;AACP,GACAL,MAGI,gBAAAL,EAACC,EAAa,QAAb,EACG,UAAA,gBAAAU;AAAA,EAACV,EAAa;AAAA,EAAb;AAAA,IACG,gBAAcG;AAAA,IACd,wBAAsBK;AAAA,IACtB,WAAWG,EAAGC,EAAO,MAAMN,CAAS;AAAA,IACpC,OAAO,EAAE,UAAAC,EAAS;AAAA,IAClB,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,KAAAH;AAAA,IACC,GAAGK;AAAA,IAEH,UAAA;AAAA,MAAAd;AAAA,MACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWY,EAAO,OAAO;AAAA,IAAA;AAAA,EAAA;AAExE,EAAA,CAAA;AAGRP,EAAe,cAAc;AAEtB,MAAMQ,IAAU;AAAA,EACnB,MAAMnB;AAAA,EACN,SAASoB,EAAmDb,CAAc;AAAA,EAC1E,SAASa,EAAgDT,CAAc;AAC3E;"}
@@ -1,4 +1,4 @@
1
- import { FOCUS_OUTLINE as t } from "./fondue-components59.js";
1
+ import { FOCUS_OUTLINE as t } from "./fondue-components58.js";
2
2
  import { sv as e } from "./fondue-components25.js";
3
3
  const o = e({
4
4
  base: `tw-group tw-border tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium ${t}`,
@@ -1,4 +1,4 @@
1
- import { FOCUS_OUTLINE as t } from "./fondue-components59.js";
1
+ import { FOCUS_OUTLINE as t } from "./fondue-components58.js";
2
2
  import { sv as e } from "./fondue-components25.js";
3
3
  const s = e({
4
4
  base: `tw-peer tw-relative tw-inline-flex tw-bg-base tw-text-white tw-shrink-0 tw-rounded tw-border tw-border-line-x-strong group-hover:tw-border-line-xx-strong hover:tw-border-line-xx-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-base disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-box-disabled-strong ${t}`,
@@ -1,31 +1,31 @@
1
- import { jsxs as d, jsx as a, Fragment as m } from "react/jsx-runtime";
2
- import { IconDroplet as n, IconTrashBin as p, IconCaretDown as f } from "@frontify/fondue-icons";
3
- import { forwardRef as I, useId as N } from "react";
4
- import i from "./fondue-components58.js";
5
- import { colorToCss as h } from "./fondue-components34.js";
6
- const c = ({ currentColor: e, onClear: s, "data-test-id": t = "color-picker-input", ...r }, l) => {
7
- const o = N();
8
- return /* @__PURE__ */ d("div", { className: i.root, ...r, ref: l, "data-test-id": t, children: [
1
+ import { jsxs as d, jsx as a, Fragment as n } from "react/jsx-runtime";
2
+ import { IconDroplet as p, IconTrashBin as f, IconCaretDown as I } from "@frontify/fondue-icons";
3
+ import { forwardRef as N, useId as h } from "react";
4
+ import i from "./fondue-components59.js";
5
+ import { colorToCss as b } from "./fondue-components34.js";
6
+ const c = ({ id: t, currentColor: e, onClear: s, "data-test-id": r = "color-picker-input", ...l }, m) => {
7
+ const o = h();
8
+ return /* @__PURE__ */ d("div", { id: t, className: i.root, ...l, ref: m, "data-test-id": r, children: [
9
9
  (e == null ? void 0 : e.red) !== void 0 ? /* @__PURE__ */ a(
10
10
  "div",
11
11
  {
12
12
  "aria-describedby": o,
13
13
  className: i.colorIndicator,
14
- style: { backgroundColor: h(e) }
14
+ style: { backgroundColor: b(e) }
15
15
  }
16
- ) : /* @__PURE__ */ d(m, { children: [
17
- /* @__PURE__ */ a(n, { size: 16 }),
16
+ ) : /* @__PURE__ */ d(n, { children: [
17
+ /* @__PURE__ */ a(p, { size: 16 }),
18
18
  /* @__PURE__ */ a("span", { children: "Select Color" })
19
19
  ] }),
20
20
  /* @__PURE__ */ a("span", { id: o, className: i.colorName, children: e == null ? void 0 : e.name }),
21
- s && /* @__PURE__ */ a("button", { type: "button", "aria-label": "Clear color", onClick: s, className: i.clear, children: /* @__PURE__ */ a(p, { size: 16 }) }),
22
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(f, { size: 16, className: i.caret }) })
21
+ s && /* @__PURE__ */ a("button", { type: "button", "aria-label": "Clear color", onClick: s, className: i.clear, children: /* @__PURE__ */ a(f, { size: 16 }) }),
22
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(I, { size: 16, className: i.caret }) })
23
23
  ] });
24
24
  };
25
25
  c.displayName = "ColorPicker.Input";
26
- const x = I(c);
26
+ const z = N(c);
27
27
  export {
28
28
  c as ColorPickerInput,
29
- x as ForwardedRefColorPickerInput
29
+ z as ForwardedRefColorPickerInput
30
30
  };
31
31
  //# sourceMappingURL=fondue-components31.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components31.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconDroplet, IconTrashBin } from '@frontify/fondue-icons';\nimport { type ForwardedRef, forwardRef, useId } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype ColorPickerInputProps = {\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to dermine arrow state\n */\n isOpen?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n { currentColor, onClear, 'data-test-id': dataTestId = 'color-picker-input', ...props }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const colorNameId = useId();\n\n return (\n <div className={styles.root} {...props} ref={forwardedRef} data-test-id={dataTestId}>\n {currentColor?.red !== undefined ? (\n <div\n aria-describedby={colorNameId}\n className={styles.colorIndicator}\n style={{ backgroundColor: colorToCss(currentColor) }}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span id={colorNameId} className={styles.colorName}>\n {currentColor?.name}\n </span>\n {onClear && (\n <button type=\"button\" aria-label=\"Clear color\" onClick={onClear} className={styles.clear}>\n <IconTrashBin size={16} />\n </button>\n )}\n <div>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n );\n};\nColorPickerInput.displayName = 'ColorPicker.Input';\n\nexport const ForwardedRefColorPickerInput = forwardRef<HTMLDivElement, ColorPickerInputProps>(ColorPickerInput);\n"],"names":["ColorPickerInput","currentColor","onClear","dataTestId","props","forwardedRef","colorNameId","useId","jsxs","styles","jsx","colorToCss","Fragment","IconDroplet","IconTrashBin","IconCaretDown","ForwardedRefColorPickerInput","forwardRef"],"mappings":";;;;;AA8Ba,MAAAA,IAAmB,CAC5B,EAAE,cAAAC,GAAc,SAAAC,GAAS,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GACrFC,MACC;AACD,QAAMC,IAAcC;AAGhB,SAAA,gBAAAC,EAAC,OAAI,EAAA,WAAWC,EAAO,MAAO,GAAGL,GAAO,KAAKC,GAAc,gBAAcF,GACpE,UAAA;AAAA,KAAAF,KAAA,gBAAAA,EAAc,SAAQ,SACnB,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,oBAAkBJ;AAAA,QAClB,WAAWG,EAAO;AAAA,QAClB,OAAO,EAAE,iBAAiBE,EAAWV,CAAY,EAAE;AAAA,MAAA;AAAA,IAAA,IAInD,gBAAAO,EAAAI,GAAA,EAAA,UAAA;AAAA,MAAC,gBAAAF,EAAAG,GAAA,EAAY,MAAM,GAAI,CAAA;AAAA,MACvB,gBAAAH,EAAC,UAAK,UAAY,eAAA,CAAA;AAAA,IAAA,GACtB;AAAA,IAGJ,gBAAAA,EAAC,UAAK,IAAIJ,GAAa,WAAWG,EAAO,WACpC,iCAAc,KACnB,CAAA;AAAA,IACCP,KACI,gBAAAQ,EAAA,UAAA,EAAO,MAAK,UAAS,cAAW,eAAc,SAASR,GAAS,WAAWO,EAAO,OAC/E,UAAA,gBAAAC,EAACI,GAAa,EAAA,MAAM,GAAI,CAAA,GAC5B;AAAA,IAEJ,gBAAAJ,EAAC,SACG,UAAC,gBAAAA,EAAAK,GAAA,EAAc,MAAM,IAAI,WAAWN,EAAO,MAAA,CAAO,EACtD,CAAA;AAAA,EACJ,EAAA,CAAA;AAER;AACAT,EAAiB,cAAc;AAElB,MAAAgB,IAA+BC,EAAkDjB,CAAgB;"}
1
+ {"version":3,"file":"fondue-components31.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconDroplet, IconTrashBin } from '@frontify/fondue-icons';\nimport { type ForwardedRef, forwardRef, useId } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype ColorPickerInputProps = {\n id?: string;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to dermine arrow state\n */\n isOpen?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n { id, currentColor, onClear, 'data-test-id': dataTestId = 'color-picker-input', ...props }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const colorNameId = useId();\n\n return (\n <div id={id} className={styles.root} {...props} ref={forwardedRef} data-test-id={dataTestId}>\n {currentColor?.red !== undefined ? (\n <div\n aria-describedby={colorNameId}\n className={styles.colorIndicator}\n style={{ backgroundColor: colorToCss(currentColor) }}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span id={colorNameId} className={styles.colorName}>\n {currentColor?.name}\n </span>\n {onClear && (\n <button type=\"button\" aria-label=\"Clear color\" onClick={onClear} className={styles.clear}>\n <IconTrashBin size={16} />\n </button>\n )}\n <div>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n );\n};\nColorPickerInput.displayName = 'ColorPicker.Input';\n\nexport const ForwardedRefColorPickerInput = forwardRef<HTMLDivElement, ColorPickerInputProps>(ColorPickerInput);\n"],"names":["ColorPickerInput","id","currentColor","onClear","dataTestId","props","forwardedRef","colorNameId","useId","jsxs","styles","jsx","colorToCss","Fragment","IconDroplet","IconTrashBin","IconCaretDown","ForwardedRefColorPickerInput","forwardRef"],"mappings":";;;;;AA+BO,MAAMA,IAAmB,CAC5B,EAAE,IAAAC,GAAI,cAAAC,GAAc,SAAAC,GAAS,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GACzFC,MACC;AACD,QAAMC,IAAcC;AAGhB,SAAA,gBAAAC,EAAC,OAAI,EAAA,IAAAR,GAAQ,WAAWS,EAAO,MAAO,GAAGL,GAAO,KAAKC,GAAc,gBAAcF,GAC5E,UAAA;AAAA,KAAAF,KAAA,gBAAAA,EAAc,SAAQ,SACnB,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,oBAAkBJ;AAAA,QAClB,WAAWG,EAAO;AAAA,QAClB,OAAO,EAAE,iBAAiBE,EAAWV,CAAY,EAAE;AAAA,MAAA;AAAA,IAAA,IAInD,gBAAAO,EAAAI,GAAA,EAAA,UAAA;AAAA,MAAC,gBAAAF,EAAAG,GAAA,EAAY,MAAM,GAAI,CAAA;AAAA,MACvB,gBAAAH,EAAC,UAAK,UAAY,eAAA,CAAA;AAAA,IAAA,GACtB;AAAA,IAGJ,gBAAAA,EAAC,UAAK,IAAIJ,GAAa,WAAWG,EAAO,WACpC,iCAAc,KACnB,CAAA;AAAA,IACCP,KACI,gBAAAQ,EAAA,UAAA,EAAO,MAAK,UAAS,cAAW,eAAc,SAASR,GAAS,WAAWO,EAAO,OAC/E,UAAA,gBAAAC,EAACI,GAAa,EAAA,MAAM,GAAI,CAAA,GAC5B;AAAA,IAEJ,gBAAAJ,EAAC,SACG,UAAC,gBAAAA,EAAAK,GAAA,EAAc,MAAM,IAAI,WAAWN,EAAO,MAAA,CAAO,EACtD,CAAA;AAAA,EACJ,EAAA,CAAA;AAER;AACAV,EAAiB,cAAc;AAElB,MAAAiB,IAA+BC,EAAkDlB,CAAgB;"}
@@ -1,18 +1,18 @@
1
- const o = "_content_1nokb_6", n = "_header_1nokb_50", t = "_footer_1nokb_51", e = "_body_1nokb_52", _ = "_underlay_1nokb_77", d = "_sideContent_1nokb_90", s = {
2
- content: o,
3
- header: n,
4
- footer: t,
5
- body: e,
6
- underlay: _,
7
- sideContent: d
1
+ const n = "_content_1dnjb_6", t = "_header_1dnjb_50", e = "_footer_1dnjb_51", o = "_body_1dnjb_52", d = "_underlay_1dnjb_77", _ = "_sideContent_1dnjb_90", s = {
2
+ content: n,
3
+ header: t,
4
+ footer: e,
5
+ body: o,
6
+ underlay: d,
7
+ sideContent: _
8
8
  };
9
9
  export {
10
- e as body,
11
- o as content,
10
+ o as body,
11
+ n as content,
12
12
  s as default,
13
- t as footer,
14
- n as header,
15
- d as sideContent,
16
- _ as underlay
13
+ e as footer,
14
+ t as header,
15
+ _ as sideContent,
16
+ d as underlay
17
17
  };
18
18
  //# sourceMappingURL=fondue-components36.js.map
@@ -1,20 +1,22 @@
1
- const o = "_content_ojnoh_4", n = "_subContent_ojnoh_5", t = "_item_ojnoh_23", s = "_subTrigger_ojnoh_24", _ = "_subMenuIndicator_ojnoh_63", e = "_group_ojnoh_69", u = "_slot_ojnoh_76", c = {
2
- content: o,
1
+ const t = "_content_1m5jw_5", n = "_subContent_1m5jw_6", o = "_item_1m5jw_32", e = "_subTrigger_1m5jw_33", s = "_itemContent_1m5jw_72", _ = "_subMenuIndicator_1m5jw_79", u = "_group_1m5jw_85", c = "_slot_1m5jw_92", m = {
2
+ content: t,
3
3
  subContent: n,
4
- item: t,
5
- subTrigger: s,
4
+ item: o,
5
+ subTrigger: e,
6
+ itemContent: s,
6
7
  subMenuIndicator: _,
7
- group: e,
8
- slot: u
8
+ group: u,
9
+ slot: c
9
10
  };
10
11
  export {
11
- o as content,
12
- c as default,
13
- e as group,
14
- t as item,
15
- u as slot,
12
+ t as content,
13
+ m as default,
14
+ u as group,
15
+ o as item,
16
+ s as itemContent,
17
+ c as slot,
16
18
  n as subContent,
17
19
  _ as subMenuIndicator,
18
- s as subTrigger
20
+ e as subTrigger
19
21
  };
20
22
  //# sourceMappingURL=fondue-components39.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components39.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components39.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}