@frontify/fondue-components 3.2.1 → 3.3.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 (101) hide show
  1. package/dist/fondue-components.js +18 -16
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +2 -2
  4. package/dist/fondue-components11.js +42 -30
  5. package/dist/fondue-components11.js.map +1 -1
  6. package/dist/fondue-components12.js +2 -2
  7. package/dist/fondue-components13.js +1 -1
  8. package/dist/fondue-components14.js +1 -1
  9. package/dist/fondue-components15.js +64 -6
  10. package/dist/fondue-components15.js.map +1 -1
  11. package/dist/fondue-components16.js +6 -47
  12. package/dist/fondue-components16.js.map +1 -1
  13. package/dist/fondue-components17.js +42 -50
  14. package/dist/fondue-components17.js.map +1 -1
  15. package/dist/fondue-components18.js +112 -29
  16. package/dist/fondue-components18.js.map +1 -1
  17. package/dist/fondue-components19.js +53 -110
  18. package/dist/fondue-components19.js.map +1 -1
  19. package/dist/fondue-components20.js +27 -64
  20. package/dist/fondue-components20.js.map +1 -1
  21. package/dist/fondue-components21.js +64 -41
  22. package/dist/fondue-components21.js.map +1 -1
  23. package/dist/fondue-components22.js +43 -32
  24. package/dist/fondue-components22.js.map +1 -1
  25. package/dist/fondue-components23.js +32 -5
  26. package/dist/fondue-components23.js.map +1 -1
  27. package/dist/fondue-components24.js +5 -12
  28. package/dist/fondue-components24.js.map +1 -1
  29. package/dist/fondue-components25.js +10 -153
  30. package/dist/fondue-components25.js.map +1 -1
  31. package/dist/fondue-components26.js +59 -22
  32. package/dist/fondue-components26.js.map +1 -1
  33. package/dist/fondue-components27.js +17 -17
  34. package/dist/fondue-components27.js.map +1 -1
  35. package/dist/fondue-components28.js +112 -15
  36. package/dist/fondue-components28.js.map +1 -1
  37. package/dist/fondue-components29.js +19 -30
  38. package/dist/fondue-components29.js.map +1 -1
  39. package/dist/fondue-components3.js +2 -2
  40. package/dist/fondue-components30.js +32 -28
  41. package/dist/fondue-components30.js.map +1 -1
  42. package/dist/fondue-components31.js +23 -125
  43. package/dist/fondue-components31.js.map +1 -1
  44. package/dist/fondue-components32.js +129 -20
  45. package/dist/fondue-components32.js.map +1 -1
  46. package/dist/fondue-components33.js +21 -45
  47. package/dist/fondue-components33.js.map +1 -1
  48. package/dist/fondue-components34.js +45 -15
  49. package/dist/fondue-components34.js.map +1 -1
  50. package/dist/fondue-components35.js +28 -60
  51. package/dist/fondue-components35.js.map +1 -1
  52. package/dist/fondue-components36.js +15 -15
  53. package/dist/fondue-components36.js.map +1 -1
  54. package/dist/fondue-components37.js +60 -19
  55. package/dist/fondue-components37.js.map +1 -1
  56. package/dist/fondue-components38.js +15 -17
  57. package/dist/fondue-components38.js.map +1 -1
  58. package/dist/fondue-components39.js +16 -4
  59. package/dist/fondue-components39.js.map +1 -1
  60. package/dist/fondue-components4.js +4 -4
  61. package/dist/fondue-components40.js +3 -11
  62. package/dist/fondue-components40.js.map +1 -1
  63. package/dist/fondue-components41.js +11 -3
  64. package/dist/fondue-components41.js.map +1 -1
  65. package/dist/fondue-components42.js +5 -35
  66. package/dist/fondue-components42.js.map +1 -1
  67. package/dist/fondue-components43.js +35 -5
  68. package/dist/fondue-components43.js.map +1 -1
  69. package/dist/fondue-components44.js +12 -24
  70. package/dist/fondue-components44.js.map +1 -1
  71. package/dist/fondue-components45.js +4 -16
  72. package/dist/fondue-components45.js.map +1 -1
  73. package/dist/fondue-components46.js +24 -10
  74. package/dist/fondue-components46.js.map +1 -1
  75. package/dist/fondue-components47.js +14 -10
  76. package/dist/fondue-components47.js.map +1 -1
  77. package/dist/fondue-components5.js +2 -2
  78. package/dist/fondue-components50.js +2 -2
  79. package/dist/fondue-components53.js +1 -1
  80. package/dist/fondue-components54.js +9 -16
  81. package/dist/fondue-components54.js.map +1 -1
  82. package/dist/fondue-components55.js +12 -6
  83. package/dist/fondue-components55.js.map +1 -1
  84. package/dist/fondue-components56.js +18 -2
  85. package/dist/fondue-components56.js.map +1 -1
  86. package/dist/fondue-components57.js +4 -8
  87. package/dist/fondue-components57.js.map +1 -1
  88. package/dist/fondue-components58.js +2 -39
  89. package/dist/fondue-components58.js.map +1 -1
  90. package/dist/fondue-components59.js +14 -0
  91. package/dist/fondue-components59.js.map +1 -0
  92. package/dist/fondue-components6.js +5 -5
  93. package/dist/fondue-components60.js +42 -0
  94. package/dist/fondue-components60.js.map +1 -0
  95. package/dist/fondue-components7.js +78 -68
  96. package/dist/fondue-components7.js.map +1 -1
  97. package/dist/fondue-components8.js +2 -2
  98. package/dist/fondue-components9.js +3 -3
  99. package/dist/index.d.ts +27 -3
  100. package/dist/style.css +1 -1
  101. package/package.json +16 -15
@@ -3,7 +3,7 @@ import { Box as t } from "./fondue-components3.js";
3
3
  import { Button as x } from "./fondue-components4.js";
4
4
  import { Checkbox as f } from "./fondue-components5.js";
5
5
  import { ColorPicker as l } from "./fondue-components6.js";
6
- import { Dialog as d } from "./fondue-components7.js";
6
+ import { Dialog as c } from "./fondue-components7.js";
7
7
  import { Divider as S } from "./fondue-components8.js";
8
8
  import { Dropdown as g } from "./fondue-components9.js";
9
9
  import { Flex as B } from "./fondue-components10.js";
@@ -11,19 +11,20 @@ import { Flyout as D } from "./fondue-components11.js";
11
11
  import { Grid as h } from "./fondue-components12.js";
12
12
  import { Label as w } from "./fondue-components13.js";
13
13
  import { LoadingBar as L } from "./fondue-components14.js";
14
- import { Section as v } from "./fondue-components15.js";
15
- import { SegmentedControl as G } from "./fondue-components16.js";
16
- import { Slider as P } from "./fondue-components17.js";
17
- import { Switch as q } from "./fondue-components18.js";
18
- import { Select as z } from "./fondue-components19.js";
19
- import { TextInput as E } from "./fondue-components20.js";
20
- import { Tooltip as J } from "./fondue-components21.js";
14
+ import { ScrollArea as v } from "./fondue-components15.js";
15
+ import { Section as A } from "./fondue-components16.js";
16
+ import { SegmentedControl as I } from "./fondue-components17.js";
17
+ import { Select as j } from "./fondue-components18.js";
18
+ import { Slider as s } from "./fondue-components19.js";
19
+ import { Switch as E } from "./fondue-components20.js";
20
+ import { TextInput as J } from "./fondue-components21.js";
21
+ import { Tooltip as M } from "./fondue-components22.js";
21
22
  export {
22
23
  t as Box,
23
24
  x as Button,
24
25
  f as Checkbox,
25
26
  l as ColorPicker,
26
- d as Dialog,
27
+ c as Dialog,
27
28
  S as Divider,
28
29
  g as Dropdown,
29
30
  B as Flex,
@@ -31,12 +32,13 @@ export {
31
32
  h as Grid,
32
33
  w as Label,
33
34
  L as LoadingBar,
34
- v as Section,
35
- G as SegmentedControl,
36
- z as Select,
37
- P as Slider,
38
- q as Switch,
39
- E as TextInput,
40
- J as Tooltip
35
+ v as ScrollArea,
36
+ A as Section,
37
+ I as SegmentedControl,
38
+ j as Select,
39
+ s as Slider,
40
+ E as Switch,
41
+ J as TextInput,
42
+ M as Tooltip
41
43
  };
42
44
  //# sourceMappingURL=fondue-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { propsToCssVariables as a } from "./fondue-components22.js";
3
- import i from "./fondue-components39.js";
2
+ import { propsToCssVariables as a } from "./fondue-components23.js";
3
+ import i from "./fondue-components40.js";
4
4
  const l = ({
5
5
  as: t = "div",
6
6
  "data-test-id": s = "fondue-flex",
@@ -1,14 +1,25 @@
1
- import { jsx as a, jsxs as C } from "react/jsx-runtime";
2
- import { IconCross as v } from "@frontify/fondue-icons";
3
- import * as s from "@radix-ui/react-popover";
4
- import { forwardRef as r, useRef as x } from "react";
5
- import { usePreventDropdownOverflow as w } from "./fondue-components36.js";
6
- import { syncRefs as u } from "./fondue-components37.js";
7
- import d from "./fondue-components40.js";
8
- const y = ({ children: t, ...o }) => /* @__PURE__ */ a(s.Root, { ...o, children: t });
9
- y.displayName = "Flyout.Root";
10
- const c = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(s.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
11
- c.displayName = "Flyout.Trigger";
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";
5
+ import { usePreventDropdownOverflow as w } from "./fondue-components38.js";
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 });
9
+ c.displayName = "Flyout.Root";
10
+ const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(
11
+ r.Trigger,
12
+ {
13
+ onMouseDown: b,
14
+ "data-auto-focus-visible": "true",
15
+ "data-auto-focus-trigger": !0,
16
+ "data-test-id": o,
17
+ asChild: !0,
18
+ ref: e,
19
+ children: t
20
+ }
21
+ );
22
+ y.displayName = "Flyout.Trigger";
12
23
  const f = ({
13
24
  align: t = "start",
14
25
  maxWidth: o = "360px",
@@ -17,58 +28,59 @@ const f = ({
17
28
  children: g,
18
29
  rounded: N,
19
30
  ...R
20
- }, n) => {
21
- const l = x(null), { setMaxHeight: h } = w(l);
22
- return /* @__PURE__ */ a(s.Portal, { children: /* @__PURE__ */ a(
23
- s.Content,
31
+ }, l) => {
32
+ const u = x(null), { setMaxHeight: h } = w(u);
33
+ return /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
34
+ r.Content,
24
35
  {
25
36
  style: {
26
37
  "--flyout-max-width": o
27
38
  },
28
- ref: l,
39
+ ref: u,
29
40
  align: t,
30
41
  collisionPadding: 8,
31
42
  sideOffset: 8,
32
43
  onOpenAutoFocus: () => {
33
- h(), u(l, n);
44
+ h(), n(u, l);
34
45
  },
35
46
  onCloseAutoFocus: () => {
36
- u(l, n);
47
+ n(u, l);
37
48
  },
38
49
  className: d.root,
39
50
  "data-flyout-spacing": e,
40
51
  "data-rounded": N,
41
52
  "data-test-id": i,
53
+ onFocus: A,
42
54
  ...R,
43
55
  children: g
44
56
  }
45
57
  ) });
46
58
  };
47
59
  f.displayName = "Flyout.Content";
48
- const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, i) => /* @__PURE__ */ C("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" }, i) => /* @__PURE__ */ v("div", { "data-test-id": e, ref: i, className: d.header, children: [
49
61
  /* @__PURE__ */ a("div", { children: o }),
50
- t && /* @__PURE__ */ a(s.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(v, { size: 20 }) })
62
+ t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(C, { size: 20 }) })
51
63
  ] });
52
64
  m.displayName = "Flyout.Header";
53
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 });
54
66
  p.displayName = "Flyout.Footer";
55
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 });
56
68
  F.displayName = "Flyout.Body";
57
- const j = {
58
- Root: y,
59
- Trigger: r(c),
60
- Content: r(f),
61
- Header: r(m),
62
- Footer: r(p),
63
- Body: r(F)
69
+ const D = {
70
+ Root: c,
71
+ Trigger: s(y),
72
+ Content: s(f),
73
+ Header: s(m),
74
+ Footer: s(p),
75
+ Body: s(F)
64
76
  };
65
77
  export {
66
- j as Flyout,
78
+ D as Flyout,
67
79
  F as FlyoutBody,
68
80
  f as FlyoutContent,
69
81
  p as FlyoutFooter,
70
82
  m as FlyoutHeader,
71
- y as FlyoutRoot,
72
- c as FlyoutTrigger
83
+ c as FlyoutRoot,
84
+ y as FlyoutTrigger
73
85
  };
74
86
  //# 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 { 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?: '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 data-test-id={dataTestId} asChild ref={ref}>\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 {...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","FlyoutContent","align","maxWidth","padding","rounded","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","syncRefs","styles","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA2EO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,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AmB,MAAK,UAAS,gBAAc,GAAGE,CAAU,UAAU,WAAWa,EAAO,OACrF,4BAACG,GAAU,EAAA,MAAM,GAAI,CAAA,GACzB;AAER,EAAA,CAAA;AAGRF,EAAa,cAAc;AAEd,MAAAG,IAAe,CACxB,EAAE,UAAArB,GAAU,gBAAgBI,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWY,EAAO,QACtD,UAAAjB,EACL,CAAA;AAGRqB,EAAa,cAAc;AAEd,MAAAC,IAAa,CACtB,EAAE,UAAAtB,GAAU,gBAAgBI,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWY,EAAO,MACpF,UAAAjB,EACL,CAAA;AAGRsB,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAMxB;AAAA,EACN,SAASyB,EAAkDrB,CAAa;AAAA,EACxE,SAASqB,EAA+CjB,CAAa;AAAA,EACrE,QAAQiB,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 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","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA2EO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,gBAAgBI,IAAa,2BACzCC,MAGI,gBAAAC;AAAA,EAACJ,EAAa;AAAA,EAAb;AAAA,IACG,aAAaK;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAO;AAAA,IACP,KAAAC;AAAA,IAEC,UAAAL;AAAA,EAAA;AAAA;AAIbG,EAAc,cAAc;AAErB,MAAMK,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,gBAAgBP,IAAa;AAAA,EAC7B,UAAAJ;AAAA,EACA,SAAAY;AAAA,EACA,GAAGX;AACP,GACAI,MACC;AACK,QAAAQ,IAAWC,EAAO,IAAI,GAEtB,EAAE,cAAAC,EAAA,IAAiBC,EAA2BH,CAAQ;AAGxD,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AAC,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,6 +1,6 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { propsToCssVariables as a } from "./fondue-components22.js";
3
- import e from "./fondue-components41.js";
2
+ import { propsToCssVariables as a } from "./fondue-components23.js";
3
+ import e from "./fondue-components42.js";
4
4
  const d = ({
5
5
  as: s = "div",
6
6
  "data-test-id": t = "fondue-grid",
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import * as d from "@radix-ui/react-label";
3
3
  import { forwardRef as i } from "react";
4
- import { cn as n } from "./fondue-components24.js";
4
+ import { cn as n } from "./fondue-components25.js";
5
5
  const s = ({ className: e, "data-test-id": a = "fondue-label", ...t }, r) => /* @__PURE__ */ o(
6
6
  d.Root,
7
7
  {
@@ -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-components42.js";
4
+ import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components43.js";
5
5
  const p = m(
6
6
  ({
7
7
  value: a,
@@ -1,9 +1,67 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { propsToCssVariables as r } from "./fondue-components22.js";
3
- import i from "./fondue-components43.js";
4
- const a = ({ "data-test-id": t = "fondue-section", children: o, ...s }) => /* @__PURE__ */ e("section", { className: i.root, "data-test-id": t, style: r(s), children: o });
5
- a.displayName = "Section";
1
+ import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
+ import * as o from "@radix-ui/react-scroll-area";
3
+ import { forwardRef as n } from "react";
4
+ import l from "./fondue-components44.js";
5
+ const b = ({
6
+ type: t,
7
+ maxHeight: e = "100%",
8
+ maxWidth: s = "100%",
9
+ children: c,
10
+ "data-test-id": r = "fondue-scroll-area"
11
+ }, i) => /* @__PURE__ */ m(
12
+ o.Root,
13
+ {
14
+ type: t,
15
+ className: l.root,
16
+ style: { maxWidth: s },
17
+ "data-test-id": r,
18
+ ref: i,
19
+ children: [
20
+ /* @__PURE__ */ a(
21
+ o.Viewport,
22
+ {
23
+ className: l.viewport,
24
+ style: { maxHeight: e },
25
+ "data-test-id": `${r}-viewport`,
26
+ children: c
27
+ }
28
+ ),
29
+ /* @__PURE__ */ a(
30
+ o.Scrollbar,
31
+ {
32
+ className: l.scrollbar,
33
+ orientation: "vertical",
34
+ "data-test-id": `${r}-vertical-scrollbar`,
35
+ children: /* @__PURE__ */ a(
36
+ o.Thumb,
37
+ {
38
+ className: l.thumb,
39
+ "data-test-id": `${r}-vertical-scrollbar-thumb`
40
+ }
41
+ )
42
+ }
43
+ ),
44
+ /* @__PURE__ */ a(
45
+ o.Scrollbar,
46
+ {
47
+ className: l.scrollbar,
48
+ orientation: "horizontal",
49
+ "data-test-id": `${r}-horizontal-scrollbar`,
50
+ children: /* @__PURE__ */ a(
51
+ o.Thumb,
52
+ {
53
+ className: l.thumb,
54
+ "data-test-id": `${r}-horizontal-scrollbar-thumb`
55
+ }
56
+ )
57
+ }
58
+ ),
59
+ /* @__PURE__ */ a(o.Corner, { className: l.corner, "data-test-id": `${r}-corner` })
60
+ ]
61
+ }
62
+ ), h = n(b);
63
+ h.displayName = "ScrollArea";
6
64
  export {
7
- a as Section
65
+ h as ScrollArea
8
66
  };
9
67
  //# sourceMappingURL=fondue-components15.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components15.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/section.module.scss';\n\nexport type SectionProps = LayoutComponentProps & {\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Section = ({ 'data-test-id': dataTestId = 'fondue-section', children, ...props }: SectionProps) => {\n return (\n <section className={styles.root} data-test-id={dataTestId} style={propsToCssVariables(props)}>\n {children}\n </section>\n );\n};\nSection.displayName = 'Section';\n"],"names":["Section","dataTestId","children","props","jsx","styles","propsToCssVariables"],"mappings":";;;AAqBa,MAAAA,IAAU,CAAC,EAAE,gBAAgBC,IAAa,kBAAkB,UAAAC,GAAU,GAAGC,QAE9E,gBAAAC,EAAC,WAAQ,EAAA,WAAWC,EAAO,MAAM,gBAAcJ,GAAY,OAAOK,EAAoBH,CAAK,GACtF,UAAAD,EACL,CAAA;AAGRF,EAAQ,cAAc;"}
1
+ {"version":3,"file":"fondue-components15.js","sources":["../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixScrollArea from '@radix-ui/react-scroll-area';\nimport { type ForwardedRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport styles from './styles/scrollArea.module.scss';\n\nexport type ScrollAreaProps = {\n /**\n * \"auto\" visible when content is overflowing on the corresponding orientation.\n * \"always\" always visible regardless of whether the content is overflowing.\n * \"scroll\" visible when the user is scrolling along its corresponding orientation.\n * \"hover\" when the user is hovering over the scroll area.\n * @default 'hover'\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover';\n /**\n * Maximum height of the scroll area\n * @default '100%'\n */\n maxHeight?: string | number;\n /**\n * Minimum width of the scroll area\n * @default '100%'\n */\n maxWidth?: string | number;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nconst ScrollAreaComponent = (\n {\n type,\n maxHeight = '100%',\n maxWidth = '100%',\n children,\n 'data-test-id': dataTestId = 'fondue-scroll-area',\n }: ScrollAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement => {\n return (\n <RadixScrollArea.Root\n type={type}\n className={styles.root}\n style={{ maxWidth }}\n data-test-id={dataTestId}\n ref={ref}\n >\n <RadixScrollArea.Viewport\n className={styles.viewport}\n style={{ maxHeight }}\n data-test-id={`${dataTestId}-viewport`}\n >\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"vertical\"\n data-test-id={`${dataTestId}-vertical-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-vertical-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"horizontal\"\n data-test-id={`${dataTestId}-horizontal-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-horizontal-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Corner className={styles.corner} data-test-id={`${dataTestId}-corner`} />\n </RadixScrollArea.Root>\n );\n};\n\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(ScrollAreaComponent);\nScrollArea.displayName = 'ScrollArea';\n"],"names":["ScrollAreaComponent","type","maxHeight","maxWidth","children","dataTestId","ref","jsxs","RadixScrollArea","styles","jsx","ScrollArea","forwardRef"],"mappings":";;;;AA8BA,MAAMA,IAAsB,CACxB;AAAA,EACI,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,gBAA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- import * as i from "@radix-ui/react-toggle-group";
3
- import { forwardRef as n } from "react";
4
- import { useControllableState as N } from "./fondue-components44.js";
5
- import e from "./fondue-components45.js";
6
- const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
7
- const [g, C] = N({
8
- prop: o,
9
- defaultProp: s,
10
- onChange: p
11
- });
12
- return /* @__PURE__ */ l(
13
- i.Root,
14
- {
15
- ref: f,
16
- ...m,
17
- className: e.root,
18
- onValueChange: (r) => {
19
- r && C(r);
20
- },
21
- value: g,
22
- type: "single",
23
- asChild: !1,
24
- "aria-disabled": m.disabled,
25
- children: [
26
- a,
27
- /* @__PURE__ */ t("div", { className: e.activeIndicator })
28
- ]
29
- }
30
- );
31
- };
32
- d.displayName = "SegmentedControl.Root";
33
- const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(i.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
34
- /* @__PURE__ */ t("span", { className: e.separator }),
35
- /* @__PURE__ */ l("span", { className: e.itemLabel, children: [
36
- /* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
37
- /* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
38
- ] })
39
- ] });
40
- c.displayName = "SegmentedControl.Item";
41
- const I = {
42
- Root: n(d),
43
- Item: n(c)
44
- };
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { propsToCssVariables as r } from "./fondue-components23.js";
3
+ import i from "./fondue-components45.js";
4
+ const a = ({ "data-test-id": t = "fondue-section", children: o, ...s }) => /* @__PURE__ */ e("section", { className: i.root, "data-test-id": t, style: r(s), children: o });
5
+ a.displayName = "Section";
45
6
  export {
46
- I as SegmentedControl,
47
- c as SegmentedControlItem,
48
- d as SegmentedControlRoot
7
+ a as Section
49
8
  };
50
9
  //# sourceMappingURL=fondue-components16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components16.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport styles from './styles/segmentedControl.module.scss';\n\nexport type SegmentedControlRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: string;\n /**\n * The controlled value of the segmented control\n */\n value?: string;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const SegmentedControlRoot = (\n { children, value: propsValue, defaultValue, onValueChange, ...rootProps }: SegmentedControlRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={styles.root}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={styles.activeIndicator} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={styles.item} asChild={false}>\n {/* Separator */}\n <span className={styles.separator} />\n <span className={styles.itemLabel}>\n {/* Active children */}\n <span className={styles.itemLabelActive}>{children}</span>\n\n {/* Inactive children */}\n <span className={styles.itemLabelInactive}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","SegmentedControl","forwardRef"],"mappings":";;;;;AAgCa,MAAAA,IAAuB,CAChC,EAAE,UAAAC,GAAU,OAAOC,GAAY,cAAAC,GAAc,eAAAC,GAAe,GAAGC,EAAU,GACzEC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMP;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAGG,SAAA,gBAAAM;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACG,KAAAL;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWO,EAAO;AAAA,MAClB,eAAe,CAACL,MAAU;AACtB,QAAIA,KACAC,EAASD,CAAK;AAAA,MAEtB;AAAA,MACA,OAAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACT,iBAAeF,EAAU;AAAA,MAExB,UAAA;AAAA,QAAAJ;AAAA,QAEA,gBAAAY,EAAA,OAAA,EAAI,WAAWD,EAAO,gBAAiB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;AACAZ,EAAqB,cAAc;AAO5B,MAAMc,IAAuB,CAChC,EAAE,UAAAb,GAAU,GAAGc,EAAA,GACfT,MAEA,gBAAAI,EAACC,EAAqB,MAArB,EAA0B,KAAAL,GAAW,GAAGS,GAAW,WAAWH,EAAO,MAAM,SAAS,IAEjF,UAAA;AAAA,EAAC,gBAAAC,EAAA,QAAA,EAAK,WAAWD,EAAO,UAAW,CAAA;AAAA,EAClC,gBAAAF,EAAA,QAAA,EAAK,WAAWE,EAAO,WAEpB,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAK,EAAA,WAAWD,EAAO,iBAAkB,UAAAX,GAAS;AAAA,IAGlD,gBAAAY,EAAA,QAAA,EAAK,WAAWD,EAAO,mBAAoB,UAAAX,GAAS;AAAA,EAAA,GACzD;AAAA,GACJ;AAEJa,EAAqB,cAAc;AAE5B,MAAME,IAAmB;AAAA,EAC5B,MAAMC,EAAsDjB,CAAoB;AAAA,EAChF,MAAMiB,EAAyDH,CAAoB;AACvF;"}
1
+ {"version":3,"file":"fondue-components16.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/section.module.scss';\n\nexport type SectionProps = LayoutComponentProps & {\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Section = ({ 'data-test-id': dataTestId = 'fondue-section', children, ...props }: SectionProps) => {\n return (\n <section className={styles.root} data-test-id={dataTestId} style={propsToCssVariables(props)}>\n {children}\n </section>\n );\n};\nSection.displayName = 'Section';\n"],"names":["Section","dataTestId","children","props","jsx","styles","propsToCssVariables"],"mappings":";;;AAqBa,MAAAA,IAAU,CAAC,EAAE,gBAAgBC,IAAa,kBAAkB,UAAAC,GAAU,GAAGC,QAE9E,gBAAAC,EAAC,WAAQ,EAAA,WAAWC,EAAO,MAAM,gBAAcJ,GAAY,OAAOK,EAAoBH,CAAK,GACtF,UAAAD,EACL,CAAA;AAGRF,EAAQ,cAAc;"}
@@ -1,58 +1,50 @@
1
- import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import * as e from "@radix-ui/react-slider";
3
- import { forwardRef as h, useRef as R } from "react";
4
- import r from "./fondue-components46.js";
5
- const g = ({
6
- value: a,
7
- defaultValue: n = [0],
8
- onChange: i,
9
- onCommit: m,
10
- "data-test-id": c = "fondue-slider",
11
- ...d
12
- }, l) => {
13
- const o = R(null);
14
- return /* @__PURE__ */ f(
15
- e.Root,
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import * as i from "@radix-ui/react-toggle-group";
3
+ import { forwardRef as n } from "react";
4
+ import { useControllableState as N } from "./fondue-components46.js";
5
+ import e from "./fondue-components47.js";
6
+ const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
7
+ const [g, C] = N({
8
+ prop: o,
9
+ defaultProp: s,
10
+ onChange: p
11
+ });
12
+ return /* @__PURE__ */ l(
13
+ i.Root,
16
14
  {
17
- ref: l,
18
- className: r.root,
19
- value: a,
20
- defaultValue: n,
21
- onValueChange: i,
22
- onValueCommit: m,
23
- "data-test-id": c,
24
- ...d,
15
+ ref: f,
16
+ ...m,
17
+ className: e.root,
18
+ onValueChange: (r) => {
19
+ r && C(r);
20
+ },
21
+ value: g,
22
+ type: "single",
23
+ asChild: !1,
24
+ "aria-disabled": m.disabled,
25
25
  children: [
26
- /* @__PURE__ */ s(
27
- e.Track,
28
- {
29
- onPointerDown: () => {
30
- o.current && (o.current.dataset.showFocusRing = "false");
31
- },
32
- className: r.track,
33
- children: /* @__PURE__ */ s(e.Range, { className: r.range })
34
- }
35
- ),
36
- (a || n).map((w, u) => /* @__PURE__ */ s(
37
- e.Thumb,
38
- {
39
- ref: o,
40
- className: r.thumb,
41
- onPointerDown: (t) => {
42
- t.currentTarget.dataset.showFocusRing = "false";
43
- },
44
- onBlur: (t) => {
45
- t.currentTarget.dataset.showFocusRing = "true";
46
- }
47
- },
48
- u
49
- ))
26
+ a,
27
+ /* @__PURE__ */ t("div", { className: e.activeIndicator })
50
28
  ]
51
29
  }
52
30
  );
53
- }, p = h(g);
54
- p.displayName = "Slider";
31
+ };
32
+ d.displayName = "SegmentedControl.Root";
33
+ const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(i.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
34
+ /* @__PURE__ */ t("span", { className: e.separator }),
35
+ /* @__PURE__ */ l("span", { className: e.itemLabel, children: [
36
+ /* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
37
+ /* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
38
+ ] })
39
+ ] });
40
+ c.displayName = "SegmentedControl.Item";
41
+ const I = {
42
+ Root: n(d),
43
+ Item: n(c)
44
+ };
55
45
  export {
56
- p as Slider
46
+ I as SegmentedControl,
47
+ c as SegmentedControlItem,
48
+ d as SegmentedControlRoot
57
49
  };
58
50
  //# sourceMappingURL=fondue-components17.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components17.js","sources":["../src/components/Slider/Slider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixSlider from '@radix-ui/react-slider';\nimport { type ForwardedRef, forwardRef, useRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/slider.module.scss';\n\nexport type SliderProps = {\n id?: string;\n name?: string;\n /**\n * The default value of the slider\n * Used for uncontrolled components\n * @default [0]\n */\n defaultValue?: number[];\n /**\n * The controlled value of the slider\n * @default [0]\n */\n value?: number[];\n /**\n * Minimum value of the slider\n * @default 0\n */\n min?: number;\n /**\n * Maximum value of the slider\n * @default 100\n */\n max?: number;\n /**\n * The granularity with which the slider can step through values\n * @default 1\n */\n step?: number;\n /**\n * The minimum steps between thumbs in a range slider\n * @default 0\n */\n minStepsBetweenThumbs?: number;\n /**\n * Disable the slider\n * @default false\n */\n disabled?: boolean;\n onChange?: (value: number[]) => void;\n onCommit?: (value: number[]) => void;\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nconst SliderComponent = (\n {\n value,\n defaultValue = [0],\n onChange,\n onCommit,\n 'data-test-id': dataTestId = 'fondue-slider',\n ...props\n }: SliderProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n const sliderThumbRef = useRef<HTMLSpanElement | null>(null);\n return (\n <RadixSlider.Root\n ref={ref}\n className={styles.root}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange}\n onValueCommit={onCommit}\n data-test-id={dataTestId}\n {...props}\n >\n <RadixSlider.Track\n onPointerDown={() => {\n if (sliderThumbRef.current) {\n sliderThumbRef.current.dataset.showFocusRing = 'false';\n }\n }}\n className={styles.track}\n >\n <RadixSlider.Range className={styles.range} />\n </RadixSlider.Track>\n {(value || defaultValue).map((_, index) => (\n <RadixSlider.Thumb\n ref={sliderThumbRef}\n className={styles.thumb}\n onPointerDown={(event) => {\n event.currentTarget.dataset.showFocusRing = 'false';\n }}\n onBlur={(event) => {\n event.currentTarget.dataset.showFocusRing = 'true';\n }}\n key={index}\n />\n ))}\n </RadixSlider.Root>\n );\n};\n\nexport const Slider = forwardRef<HTMLButtonElement, SliderProps>(SliderComponent);\nSlider.displayName = 'Slider';\n"],"names":["SliderComponent","value","defaultValue","onChange","onCommit","dataTestId","props","ref","sliderThumbRef","useRef","jsxs","RadixSlider","styles","jsx","_","index","event","Slider","forwardRef"],"mappings":";;;;AAqDA,MAAMA,IAAkB,CACpB;AAAA,EACI,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAC,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACK,QAAAC,IAAiBC,EAA+B,IAAI;AAEtD,SAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACG,KAAAJ;AAAA,MACA,WAAWK,EAAO;AAAA,MAClB,OAAAX;AAAA,MACA,cAAAC;AAAA,MACA,eAAeC;AAAA,MACf,eAAeC;AAAA,MACf,gBAAcC;AAAA,MACb,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,eAAe,MAAM;AACjB,cAAIH,EAAe,YACAA,EAAA,QAAQ,QAAQ,gBAAgB;AAAA,YAEvD;AAAA,YACA,WAAWI,EAAO;AAAA,YAElB,4BAACD,EAAY,OAAZ,EAAkB,WAAWC,EAAO,OAAO;AAAA,UAAA;AAAA,QAChD;AAAA,SACEX,KAASC,GAAc,IAAI,CAACY,GAAGC,MAC7B,gBAAAF;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,KAAKH;AAAA,YACL,WAAWI,EAAO;AAAA,YAClB,eAAe,CAACI,MAAU;AAChB,cAAAA,EAAA,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,YACA,QAAQ,CAACA,MAAU;AACT,cAAAA,EAAA,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UAAA;AAAA,UACKD;AAAA,QAAA,CAEZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb,GAEaE,IAASC,EAA2ClB,CAAe;AAChFiB,EAAO,cAAc;"}
1
+ {"version":3,"file":"fondue-components17.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport styles from './styles/segmentedControl.module.scss';\n\nexport type SegmentedControlRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: string;\n /**\n * The controlled value of the segmented control\n */\n value?: string;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const SegmentedControlRoot = (\n { children, value: propsValue, defaultValue, onValueChange, ...rootProps }: SegmentedControlRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={styles.root}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={styles.activeIndicator} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={styles.item} asChild={false}>\n {/* Separator */}\n <span className={styles.separator} />\n <span className={styles.itemLabel}>\n {/* Active children */}\n <span className={styles.itemLabelActive}>{children}</span>\n\n {/* Inactive children */}\n <span className={styles.itemLabelInactive}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","SegmentedControl","forwardRef"],"mappings":";;;;;AAgCa,MAAAA,IAAuB,CAChC,EAAE,UAAAC,GAAU,OAAOC,GAAY,cAAAC,GAAc,eAAAC,GAAe,GAAGC,EAAU,GACzEC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMP;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAGG,SAAA,gBAAAM;AAAA,IAACC,EA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