@frontify/fondue-components 1.3.4 → 1.4.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 (77) hide show
  1. package/dist/fondue-components.js +15 -11
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +36 -44
  4. package/dist/fondue-components10.js.map +1 -1
  5. package/dist/fondue-components11.js +46 -72
  6. package/dist/fondue-components11.js.map +1 -1
  7. package/dist/fondue-components12.js +76 -45
  8. package/dist/fondue-components12.js.map +1 -1
  9. package/dist/fondue-components13.js +65 -11
  10. package/dist/fondue-components13.js.map +1 -1
  11. package/dist/fondue-components14.js +45 -154
  12. package/dist/fondue-components14.js.map +1 -1
  13. package/dist/fondue-components15.js +10 -116
  14. package/dist/fondue-components15.js.map +1 -1
  15. package/dist/fondue-components16.js +59 -22
  16. package/dist/fondue-components16.js.map +1 -1
  17. package/dist/fondue-components17.js +111 -14
  18. package/dist/fondue-components17.js.map +1 -1
  19. package/dist/fondue-components18.js +112 -24
  20. package/dist/fondue-components18.js.map +1 -1
  21. package/dist/fondue-components19.js +15 -54
  22. package/dist/fondue-components19.js.map +1 -1
  23. package/dist/fondue-components20.js +15 -17
  24. package/dist/fondue-components20.js.map +1 -1
  25. package/dist/fondue-components21.js +51 -26
  26. package/dist/fondue-components21.js.map +1 -1
  27. package/dist/fondue-components22.js +16 -24
  28. package/dist/fondue-components22.js.map +1 -1
  29. package/dist/fondue-components23.js +17 -9
  30. package/dist/fondue-components23.js.map +1 -1
  31. package/dist/fondue-components24.js +35 -6
  32. package/dist/fondue-components24.js.map +1 -1
  33. package/dist/fondue-components25.js +24 -14
  34. package/dist/fondue-components25.js.map +1 -1
  35. package/dist/fondue-components26.js +9 -2
  36. package/dist/fondue-components26.js.map +1 -1
  37. package/dist/fondue-components27.js +106 -2356
  38. package/dist/fondue-components27.js.map +1 -1
  39. package/dist/fondue-components28.js +12 -143
  40. package/dist/fondue-components28.js.map +1 -1
  41. package/dist/fondue-components29.js +38 -29
  42. package/dist/fondue-components29.js.map +1 -1
  43. package/dist/fondue-components3.js +20 -18
  44. package/dist/fondue-components3.js.map +1 -1
  45. package/dist/fondue-components30.js +11 -0
  46. package/dist/fondue-components30.js.map +1 -0
  47. package/dist/fondue-components31.js +24 -0
  48. package/dist/fondue-components31.js.map +1 -0
  49. package/dist/fondue-components32.js +59 -0
  50. package/dist/fondue-components32.js.map +1 -0
  51. package/dist/fondue-components33.js +21 -0
  52. package/dist/fondue-components33.js.map +1 -0
  53. package/dist/fondue-components34.js +18 -0
  54. package/dist/fondue-components34.js.map +1 -0
  55. package/dist/fondue-components35.js +5 -0
  56. package/dist/fondue-components35.js.map +1 -0
  57. package/dist/fondue-components36.js +2363 -0
  58. package/dist/fondue-components36.js.map +1 -0
  59. package/dist/fondue-components37.js +146 -0
  60. package/dist/fondue-components37.js.map +1 -0
  61. package/dist/fondue-components38.js +42 -0
  62. package/dist/fondue-components38.js.map +1 -0
  63. package/dist/fondue-components39.js +32 -0
  64. package/dist/fondue-components39.js.map +1 -0
  65. package/dist/fondue-components4.js +2 -2
  66. package/dist/fondue-components5.js +54 -50
  67. package/dist/fondue-components5.js.map +1 -1
  68. package/dist/fondue-components6.js +2 -2
  69. package/dist/fondue-components7.js +77 -50
  70. package/dist/fondue-components7.js.map +1 -1
  71. package/dist/fondue-components8.js +56 -22
  72. package/dist/fondue-components8.js.map +1 -1
  73. package/dist/fondue-components9.js +24 -39
  74. package/dist/fondue-components9.js.map +1 -1
  75. package/dist/index.d.ts +251 -7
  76. package/dist/style.css +1 -1
  77. package/package.json +9 -4
@@ -1,81 +1,85 @@
1
- import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
- import { IconCross as T } from "@frontify/fondue-icons";
1
+ import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
+ import { IconCross as w } from "@frontify/fondue-icons";
3
3
  import * as i from "@radix-ui/react-dialog";
4
4
  import { forwardRef as d } from "react";
5
- import { dialogUnderlayStyles as v, dialogContentStyles as R, dialogHeaderStyles as w, dialogFooterStyles as B, dialogBodyStyles as F, dialogSideContentStyles as H } from "./fondue-components18.js";
6
- const r = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
7
- r.displayName = "Dialog.Root";
8
- const n = ({ children: t, "data-test-id": o = "fondue-dialog-trigger" }, e) => /* @__PURE__ */ a(i.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
5
+ import l from "./fondue-components20.js";
6
+ const s = ({ children: t, ...a }) => /* @__PURE__ */ o(i.Root, { ...a, children: t });
7
+ s.displayName = "Dialog.Root";
8
+ const n = ({ children: t, "data-test-id": a = "fondue-dialog-trigger" }, e) => /* @__PURE__ */ o(i.Trigger, { "data-test-id": a, asChild: !0, ref: e, children: t });
9
9
  n.displayName = "Dialog.Trigger";
10
10
  const g = ({
11
11
  maxWidth: t = "800px",
12
- minWidth: o = "400px",
12
+ minWidth: a = "400px",
13
13
  minHeight: e = "200px",
14
- padding: N = "compact",
15
- "data-test-id": f = "fondue-dialog-content",
16
- showUnderlay: h = !1,
17
- children: S,
18
- ...l
19
- }, x) => /* @__PURE__ */ s(i.Portal, { children: [
20
- /* @__PURE__ */ a(i.Overlay, { className: v({ showUnderlay: h }) }),
21
- /* @__PURE__ */ a(
14
+ padding: f = "compact",
15
+ verticalAlign: C = "center",
16
+ "data-test-id": h = "fondue-dialog-content",
17
+ showUnderlay: v = !1,
18
+ children: x,
19
+ rounded: T = !0,
20
+ ...R
21
+ }, b) => /* @__PURE__ */ r(i.Portal, { children: [
22
+ /* @__PURE__ */ o(i.Overlay, { "data-visible": v, className: l.underlay }),
23
+ /* @__PURE__ */ o(
22
24
  i.Content,
23
25
  {
24
26
  style: {
25
27
  "--dialog-max-width": t,
26
- "--dialog-min-width": o,
28
+ "--dialog-min-width": a,
27
29
  "--dialog-min-height": e
28
30
  },
29
- ref: x,
30
- className: R({ ...l }),
31
- "data-dialog-spacing": N,
32
- "data-test-id": f,
33
- ...l,
34
- children: S
31
+ ref: b,
32
+ className: l.content,
33
+ "data-dialog-rounded": T,
34
+ "data-dialog-spacing": f,
35
+ "data-test-id": h,
36
+ "data-dialog-vertical-align": C,
37
+ ...R,
38
+ children: x
35
39
  }
36
40
  )
37
41
  ] });
38
42
  g.displayName = "Dialog.Content";
39
- const c = ({ children: t, "data-test-id": o = "fondue-dialog-header" }, e) => /* @__PURE__ */ s("div", { "data-test-id": o, ref: e, className: w, "data-dialog-layout-component": !0, children: [
40
- /* @__PURE__ */ a("div", { children: t }),
41
- /* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${o}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(T, { size: 20 }) })
43
+ const c = ({ children: t, "data-test-id": a = "fondue-dialog-header" }, e) => /* @__PURE__ */ r("div", { "data-test-id": a, ref: e, className: l.header, "data-dialog-layout-component": !0, children: [
44
+ /* @__PURE__ */ o("div", { children: t }),
45
+ /* @__PURE__ */ o(i.Close, { role: "button", "data-test-id": `${a}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ o(w, { size: 20 }) })
42
46
  ] });
43
47
  c.displayName = "Dialog.Header";
44
- const m = ({ children: t, "data-test-id": o = "fondue-dialog-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: B, "data-dialog-layout-component": !0, children: t });
48
+ const m = ({ children: t, "data-test-id": a = "fondue-dialog-footer" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: l.footer, "data-dialog-layout-component": !0, children: t });
45
49
  m.displayName = "Dialog.Footer";
46
- const p = ({ children: t, "data-test-id": o = "fondue-dialog-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: F, "data-dialog-layout-component": !0, children: t });
47
- p.displayName = "Dialog.Body";
48
- const u = ({ children: t, "data-test-id": o = "fondue-dialog-side-content" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: H, "data-dialog-layout-component": !0, children: t });
49
- u.displayName = "Dialog.SideContent";
50
- const y = ({ children: t }) => /* @__PURE__ */ a(i.Close, { asChild: !0, children: t });
51
- y.displayName = "Dialog.Close";
52
- const D = ({ children: t, asChild: o }) => /* @__PURE__ */ a(i.Title, { asChild: o, children: t });
53
- D.displayName = "Dialog.Title";
54
- const C = ({ children: t, asChild: o }) => /* @__PURE__ */ a(i.Description, { asChild: o, children: t });
55
- C.displayName = "Dialog.Description";
56
- const P = {
57
- Root: r,
58
- Title: D,
59
- Description: C,
60
- Close: y,
50
+ const u = ({ children: t, "data-test-id": a = "fondue-dialog-body" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: l.body, "data-dialog-layout-component": !0, children: t });
51
+ u.displayName = "Dialog.Body";
52
+ const p = ({ children: t, "data-test-id": a = "fondue-dialog-side-content" }, e) => /* @__PURE__ */ o("div", { "data-test-id": a, ref: e, className: l.sideContent, "data-dialog-layout-component": !0, children: t });
53
+ p.displayName = "Dialog.SideContent";
54
+ const D = ({ children: t }) => /* @__PURE__ */ o(i.Close, { asChild: !0, children: t });
55
+ D.displayName = "Dialog.Close";
56
+ const y = ({ children: t, asChild: a }) => /* @__PURE__ */ o(i.Title, { asChild: a, children: t });
57
+ y.displayName = "Dialog.Title";
58
+ const N = ({ children: t, asChild: a }) => /* @__PURE__ */ o(i.Description, { asChild: a, children: t });
59
+ N.displayName = "Dialog.Description";
60
+ const j = {
61
+ Root: s,
62
+ Title: y,
63
+ Description: N,
64
+ Close: D,
61
65
  Trigger: d(n),
62
66
  Content: d(g),
63
67
  Header: d(c),
64
68
  Footer: d(m),
65
- Body: d(p),
66
- SideContent: d(u)
69
+ Body: d(u),
70
+ SideContent: d(p)
67
71
  };
68
72
  export {
69
- P as Dialog,
70
- p as DialogBody,
71
- y as DialogClose,
73
+ j as Dialog,
74
+ u as DialogBody,
75
+ D as DialogClose,
72
76
  g as DialogContent,
73
- C as DialogDescription,
77
+ N as DialogDescription,
74
78
  m as DialogFooter,
75
79
  c as DialogHeader,
76
- r as DialogRoot,
77
- u as DialogSideContent,
78
- D as DialogTitle,
80
+ s as DialogRoot,
81
+ p as DialogSideContent,
82
+ y as DialogTitle,
79
83
  n as DialogTrigger
80
84
  };
81
85
  //# sourceMappingURL=fondue-components5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components5.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport {\n dialogBodyStyles,\n dialogContentStyles,\n dialogFooterStyles,\n dialogHeaderStyles,\n dialogSideContentStyles,\n dialogUnderlayStyles,\n} from './styles/dialogStyles';\n\nexport type DialogRootProps = {\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 dialog\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 DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'compact' | 'comfortable' | 'spacious';\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a maximum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogHeaderProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return <RadixDialog.Root {...props}>{children}</RadixDialog.Root>;\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-trigger' }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDialog.Portal>\n <RadixDialog.Overlay className={dialogUnderlayStyles({ showUnderlay })} />\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={ref}\n className={dialogContentStyles({ ...props })}\n data-dialog-spacing={padding}\n data-test-id={dataTestId}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-header' }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogHeaderStyles} data-dialog-layout-component>\n <div>{children}</div>\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogFooterStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogBodyStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={dialogSideContentStyles} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogRoot","children","props","RadixDialog","DialogTrigger","dataTestId","ref","jsx","DialogContent","maxWidth","minWidth","minHeight","padding","showUnderlay","jsxs","dialogUnderlayStyles","dialogContentStyles","DialogHeader","dialogHeaderStyles","IconCross","DialogFooter","dialogFooterStyles","DialogBody","dialogBodyStyles","DialogSideContent","dialogSideContentStyles","DialogClose","DialogTitle","asChild","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;AAqFO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAElDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,gBAAgBI,IAAa,2BACzCC,MAGI,gBAAAC,EAACJ,EAAY,SAAZ,EAAoB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GAClD,UAAAL,EACL,CAAA;AAGRG,EAAc,cAAc;AAErB,MAAMI,IAAgB,CACzB;AAAA,EACI,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,gBAAgBP,IAAa;AAAA,EAC7B,cAAAQ,IAAe;AAAA,EACf,UAAAZ;AAAA,EACA,GAAGC;AACP,GACAI,MAGI,gBAAAQ,EAACX,EAAY,QAAZ,EACG,UAAA;AAAA,EAAC,gBAAAI,EAAAJ,EAAY,SAAZ,EAAoB,WAAWY,EAAqB,EAAE,cAAAF,EAAc,CAAA,GAAG;AAAA,EACxE,gBAAAN;AAAA,IAACJ,EAAY;AAAA,IAAZ;AAAA,MACG,OACI;AAAA,QACI,sBAAsBM;AAAA,QACtB,sBAAsBC;AAAA,Q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AE,UAAAzB,0BAClBE,EAAY,OAAZ,EAAkB,SAAO,IAAE,UAAAF,EAAS,CAAA;AAEhDyB,EAAY,cAAc;AAEnB,MAAMC,IAAc,CAAC,EAAE,UAAA1B,GAAU,SAAA2B,QAC5B,gBAAArB,EAAAJ,EAAY,OAAZ,EAAkB,SAAAyB,GAAmB,UAAA3B,EAAS,CAAA;AAE1D0B,EAAY,cAAc;AAEnB,MAAME,IAAoB,CAAC,EAAE,UAAA5B,GAAU,SAAA2B,QAClC,gBAAArB,EAAAJ,EAAY,aAAZ,EAAwB,SAAAyB,GAAmB,UAAA3B,EAAS,CAAA;AAEhE4B,EAAkB,cAAc;AAEzB,MAAMC,IAAS;AAAA,EAClB,MAAM9B;AAAA,EACN,OAAO2B;AAAA,EACP,aAAaE;AAAA,EACb,OAAOH;AAAA,EACP,SAASK,EAAkD3B,CAAa;AAAA,EACxE,SAAS2B,EAA+CvB,CAAa;AAAA,EACrE,QAAQuB,EAA8Cd,CAAY;AAAA,EAClE,QAAQc,EAA8CX,CAAY;AAAA,EAClE,MAAMW,EAA4CT,CAAU;AAAA,EAC5D,aAAaS,EAAmDP,CAAiB;AACrF;"}
1
+ {"version":3,"file":"fondue-components5.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/dialog.module.scss';\n\nexport type DialogRootProps = {\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 dialog\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 DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a maximum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogHeaderProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return <RadixDialog.Root {...props}>{children}</RadixDialog.Root>;\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-trigger' }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n children,\n rounded = true,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDialog.Portal>\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay} />\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={ref}\n className={styles.content}\n data-dialog-rounded={rounded}\n data-dialog-spacing={padding}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-header' }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header} data-dialog-layout-component>\n <div>{children}</div>\n <RadixDialog.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\n <IconCross size={20} />\n </RadixDialog.Close>\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.body} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.sideContent} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogRoot","children","props","RadixDialog","DialogTrigger","dataTestId","ref","jsx","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","showUnderlay","rounded","jsxs","styles","DialogHeader","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","asChild","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;AAoFO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAElDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,gBAAgBI,IAAa,2BACzCC,MAGI,gBAAAC,EAACJ,EAAY,SAAZ,EAAoB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GAClD,UAAAL,EACL,CAAA;A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A8CR,CAAY;AAAA,EAClE,MAAMQ,EAA4CP,CAAU;AAAA,EAC5D,aAAaO,EAAmDN,CAAiB;AACrF;"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import * as m from "@radix-ui/react-separator";
3
3
  import { forwardRef as s } from "react";
4
- import { cn as p } from "./fondue-components13.js";
5
- import { dividerStyles as f } from "./fondue-components19.js";
4
+ import { cn as p } from "./fondue-components15.js";
5
+ import { dividerStyles as f } from "./fondue-components21.js";
6
6
  const r = ({ "data-test-id": o = "fondue-divider", direction: t = "horizontal", className: i, ...e }, d) => /* @__PURE__ */ a(
7
7
  m.Root,
8
8
  {
@@ -1,61 +1,88 @@
1
- import { jsx as a, jsxs as F } from "react/jsx-runtime";
2
- import { IconCross as g } from "@frontify/fondue-icons";
3
- import * as r from "@radix-ui/react-popover";
4
- import { forwardRef as d } from "react";
5
- import { flyoutContentStyles as N, flyoutHeaderStyles as C, flyoutFooterStyles as h, flyoutBodyStyles as x } from "./fondue-components20.js";
6
- const i = ({ children: t, ...o }) => /* @__PURE__ */ a(r.Root, { ...o, children: t });
7
- i.displayName = "Flyout.Root";
8
- const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(r.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
9
- y.displayName = "Flyout.Trigger";
10
- const n = ({
11
- align: t = "start",
12
- maxWidth: o = "360px",
13
- padding: e = "compact",
14
- "data-test-id": s = "fondue-flyout-content",
15
- children: m,
16
- ...l
17
- }, p) => /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
18
- r.Content,
1
+ import { jsx as r, jsxs as N } from "react/jsx-runtime";
2
+ import { IconCaretRight as R } from "@frontify/fondue-icons";
3
+ import * as e from "@radix-ui/react-dropdown-menu";
4
+ import { forwardRef as a } from "react";
5
+ import n from "./fondue-components22.js";
6
+ const i = ({
7
+ children: o,
8
+ open: t,
9
+ onOpenChange: d,
10
+ "data-test-id": s = "fondue-dropdown"
11
+ }) => /* @__PURE__ */ r(e.Root, { open: t, onOpenChange: d, "data-test-id": s, children: o });
12
+ i.displayName = "Dropdown.Root";
13
+ const p = ({ children: o, "data-test-id": t = "fondue-dropdown-trigger" }, d) => /* @__PURE__ */ r(e.Trigger, { asChild: !0, "data-test-id": t, ref: d, children: o });
14
+ p.displayName = "Dropdown.Trigger";
15
+ const u = ({ children: o, "data-test-id": t = "fondue-dropdown-content" }, d) => /* @__PURE__ */ r(e.Portal, { children: /* @__PURE__ */ r(
16
+ e.Content,
19
17
  {
20
- style: {
21
- "--flyout-max-width": o
22
- },
23
- ref: p,
24
- align: t,
18
+ align: "start",
25
19
  collisionPadding: 8,
26
20
  sideOffset: 8,
27
- className: N({ ...l }),
28
- "data-flyout-spacing": e,
29
- "data-test-id": s,
30
- ...l,
31
- children: m
21
+ className: n.content,
22
+ "data-test-id": t,
23
+ ref: d,
24
+ children: o
32
25
  }
33
26
  ) });
34
- n.displayName = "Flyout.Content";
35
- const u = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ F("div", { "data-test-id": e, ref: s, className: C, children: [
36
- /* @__PURE__ */ a("div", { children: o }),
37
- t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(g, { size: 20 }) })
27
+ u.displayName = "Dropdown.Content";
28
+ const w = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, d) => /* @__PURE__ */ r(e.Group, { className: n.group, "data-test-id": t, ref: d, children: o });
29
+ w.displayName = "Dropdown.Group";
30
+ const m = ({
31
+ children: o,
32
+ "data-test-id": t = "fondue-dropdown-submenu"
33
+ }) => /* @__PURE__ */ r(e.Sub, { "data-test-id": t, children: o });
34
+ m.displayName = "Dropdown.SubMenu";
35
+ const c = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, d) => /* @__PURE__ */ N(e.SubTrigger, { className: n.subTrigger, "data-test-id": t, ref: d, children: [
36
+ o,
37
+ /* @__PURE__ */ r(R, { className: n.subMenuIndicator, size: 16 })
38
38
  ] });
39
- u.displayName = "Flyout.Header";
40
- const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: h, children: t });
41
- f.displayName = "Flyout.Footer";
42
- const c = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: x, children: t });
43
- c.displayName = "Flyout.Body";
44
- const S = {
39
+ c.displayName = "Dropdown.SubTrigger";
40
+ const g = ({ children: o, "data-test-id": t = "fondue-dropdown-subcontent" }, d) => /* @__PURE__ */ r(e.Portal, { children: /* @__PURE__ */ r(e.SubContent, { className: n.subContent, "data-test-id": t, ref: d, children: o }) });
41
+ g.displayName = "Dropdown.SubContent";
42
+ const l = ({
43
+ children: o,
44
+ disabled: t,
45
+ textValue: d,
46
+ onSelect: s,
47
+ "data-test-id": f = "fondue-dropdown-subtrigger",
48
+ ...b
49
+ }, S) => /* @__PURE__ */ r(
50
+ e.Item,
51
+ {
52
+ onSelect: s,
53
+ className: n.item,
54
+ textValue: d,
55
+ "data-test-id": f,
56
+ ref: S,
57
+ disabled: t,
58
+ ...b,
59
+ children: o
60
+ }
61
+ );
62
+ l.displayName = "Dropdown.Item";
63
+ const D = ({ children: o, name: t, "data-test-id": d = "fondue-dropdown-slot" }, s) => /* @__PURE__ */ r("div", { "data-name": t, className: n.slot, "data-test-id": d, ref: s, children: o });
64
+ D.displayName = "Dropdown.Slot";
65
+ const C = a(p), T = a(u), y = a(w), F = a(c), I = a(g), h = a(l), G = a(D), v = {
45
66
  Root: i,
46
- Trigger: d(y),
47
- Content: d(n),
48
- Header: d(u),
49
- Footer: d(f),
50
- Body: d(c)
67
+ Trigger: C,
68
+ Content: T,
69
+ Group: y,
70
+ SubMenu: m,
71
+ SubTrigger: F,
72
+ SubContent: I,
73
+ Item: h,
74
+ Slot: G
51
75
  };
52
76
  export {
53
- S as Flyout,
54
- c as FlyoutBody,
55
- n as FlyoutContent,
56
- f as FlyoutFooter,
57
- u as FlyoutHeader,
58
- i as FlyoutRoot,
59
- y as FlyoutTrigger
77
+ v as Dropdown,
78
+ u as DropdownContent,
79
+ w as DropdownGroup,
80
+ l as DropdownItem,
81
+ i as DropdownRoot,
82
+ D as DropdownSlot,
83
+ g as DropdownSubContent,
84
+ m as DropdownSubMenu,
85
+ c as DropdownSubTrigger,
86
+ p as DropdownTrigger
60
87
  };
61
88
  //# sourceMappingURL=fondue-components7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components7.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { flyoutBodyStyles, flyoutContentStyles, flyoutFooterStyles, flyoutHeaderStyles } from './styles/flyoutStyles';\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?: '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 ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n className={flyoutContentStyles({ ...props })}\n data-flyout-spacing={padding}\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={flyoutHeaderStyles}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\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={flyoutFooterStyles}>\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={flyoutBodyStyles}>\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","flyoutContentStyles","FlyoutHeader","showCloseButton","flyoutHeaderStyles","IconCross","FlyoutFooter","flyoutFooterStyles","FlyoutBody","flyoutBodyStyles","Flyout","forwardRef"],"mappings":";;;;;AAwEO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;A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D,GAAY,KAAAC,GAAU,WAAWY,GAC/C,UAAAjB,EACL,CAAA;AAGRgB,EAAa,cAAc;AAEd,MAAAE,IAAa,CACtB,EAAE,UAAAlB,GAAU,gBAAgBI,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWc,GAC7E,UAAAnB,EACL,CAAA;AAGRkB,EAAW,cAAc;AAElB,MAAME,IAAS;AAAA,EAClB,MAAMrB;AAAA,EACN,SAASsB,EAAkDlB,CAAa;AAAA,EACxE,SAASkB,EAA+Cd,CAAa;AAAA,EACrE,QAAQc,EAA8CT,CAAY;AAAA,EAClE,QAAQS,EAA8CL,CAAY;AAAA,EAClE,MAAMK,EAA4CH,CAAU;AAChE;"}
1
+ {"version":3,"file":"fondue-components7.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-trigger' }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-content' }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align=\"start\"\n collisionPadding={8}\n sideOffset={8}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {children}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * Callback that is called when the item is selected.\n */\n onSelect: (event: Event) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n ref={ref}\n disabled={disabled}\n {...props}\n >\n {children}\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","ref","DropdownContent","styles","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","props","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;AAqBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,EACL,CAAA;AAGRD,EAAa,cAAc;AAId,MAAAO,IAAkB,CAC3B,EAAE,UAAAN,GA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";
3
- import { forwardRef as i } from "react";
4
- import { cn as n } from "./fondue-components13.js";
5
- const s = ({ className: e, "data-test-id": a = "fondue-label", ...t }, r) => /* @__PURE__ */ o(
6
- d.Root,
1
+ import { jsx as a, jsxs as F } from "react/jsx-runtime";
2
+ import { IconCross as g } from "@frontify/fondue-icons";
3
+ import * as r from "@radix-ui/react-popover";
4
+ import { forwardRef as d } from "react";
5
+ import { flyoutContentStyles as N, flyoutHeaderStyles as C, flyoutFooterStyles as h, flyoutBodyStyles as x } from "./fondue-components23.js";
6
+ const i = ({ children: t, ...o }) => /* @__PURE__ */ a(r.Root, { ...o, children: t });
7
+ i.displayName = "Flyout.Root";
8
+ const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(r.Trigger, { "data-test-id": o, asChild: !0, ref: e, children: t });
9
+ y.displayName = "Flyout.Trigger";
10
+ const n = ({
11
+ align: t = "start",
12
+ maxWidth: o = "360px",
13
+ padding: e = "compact",
14
+ "data-test-id": s = "fondue-flyout-content",
15
+ children: m,
16
+ ...l
17
+ }, p) => /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
18
+ r.Content,
7
19
  {
8
- ref: r,
9
- "data-required": t.required,
10
- className: n(
11
- 'tw-group tw-flex tw-gap-1 tw-font-sans tw-font-normal peer-data-[state="checked"]:tw-font-medium peer-data-[state="indeterminate"]:tw-font-medium tw-text-body-medium tw-text-text-weak peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text tw-transition-colors',
12
- // Disabled state if siblings has disabled state
13
- "has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed",
14
- // Required asterisk
15
- 'after:tw-hidden data-[required="true"]:after:tw-flex after:tw-content-["*"] after:-tw-ml-1 after:tw-font-sans after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',
16
- e
17
- ),
18
- "data-test-id": a,
19
- ...t
20
+ style: {
21
+ "--flyout-max-width": o
22
+ },
23
+ ref: p,
24
+ align: t,
25
+ collisionPadding: 8,
26
+ sideOffset: 8,
27
+ className: N({ ...l }),
28
+ "data-flyout-spacing": e,
29
+ "data-test-id": s,
30
+ ...l,
31
+ children: m
20
32
  }
21
- ), w = i(s);
22
- w.displayName = "Label";
33
+ ) });
34
+ n.displayName = "Flyout.Content";
35
+ const u = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ F("div", { "data-test-id": e, ref: s, className: C, children: [
36
+ /* @__PURE__ */ a("div", { children: o }),
37
+ t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: "tw-cursor-pointer", children: /* @__PURE__ */ a(g, { size: 20 }) })
38
+ ] });
39
+ u.displayName = "Flyout.Header";
40
+ const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: h, children: t });
41
+ f.displayName = "Flyout.Footer";
42
+ const c = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: x, children: t });
43
+ c.displayName = "Flyout.Body";
44
+ const S = {
45
+ Root: i,
46
+ Trigger: d(y),
47
+ Content: d(n),
48
+ Header: d(u),
49
+ Footer: d(f),
50
+ Body: d(c)
51
+ };
23
52
  export {
24
- w as Label,
25
- s as LabelComponent
53
+ S as Flyout,
54
+ c as FlyoutBody,
55
+ n as FlyoutContent,
56
+ f as FlyoutFooter,
57
+ u as FlyoutHeader,
58
+ i as FlyoutRoot,
59
+ y as FlyoutTrigger
26
60
  };
27
61
  //# sourceMappingURL=fondue-components8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components8.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(\n 'tw-group tw-flex tw-gap-1 tw-font-sans tw-font-normal peer-data-[state=\"checked\"]:tw-font-medium peer-data-[state=\"indeterminate\"]:tw-font-medium tw-text-body-medium tw-text-text-weak peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text tw-transition-colors',\n // Disabled state if siblings has disabled state\n 'has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed',\n // Required asterisk\n 'after:tw-hidden data-[required=\"true\"]:after:tw-flex after:tw-content-[\"*\"] after:-tw-ml-1 after:tw-font-sans after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',\n className,\n )}\n data-test-id={dataTestId}\n {...props}\n />\n );\n};\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);\nLabel.displayName = 'Label';\n"],"names":["LabelComponent","className","dataTestId","props","ref","jsx","LabelPrimitive","cn","Label","forwardRef"],"mappings":";;;;AAuBa,MAAAA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,GAAGC,EAAM,GACnEC,MAGI,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACG,KAAAF;AAAA,IACA,iBAAeD,EAAM;AAAA,IACrB,WAAWI;AAAA,MACP;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,MACAN;AAAA,IACJ;AAAA,IACA,gBAAcC;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,GAKHK,IAAQC,EAAyCT,CAAc;AAC5EQ,EAAM,cAAc;"}
1
+ {"version":3,"file":"fondue-components8.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { flyoutBodyStyles, flyoutContentStyles, flyoutFooterStyles, flyoutHeaderStyles } from './styles/flyoutStyles';\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?: '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 ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n className={flyoutContentStyles({ ...props })}\n data-flyout-spacing={padding}\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={flyoutHeaderStyles}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\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={flyoutFooterStyles}>\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={flyoutBodyStyles}>\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","flyoutContentStyles","FlyoutHeader","showCloseButton","flyoutHeaderStyles","IconCross","FlyoutFooter","flyoutFooterStyles","FlyoutBody","flyoutBodyStyles","Flyout","forwardRef"],"mappings":";;;;;AAwEO,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,EAACJ,EAAa,SAAb,EAAqB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GACnD,UAAAL,EACL,CAAA;AAGRG,EAAc,cAAc;AAErB,MAAMI,IAAgB,CACzB;AAAA,EACI,OAAAC,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AnB,EACL,CAAA;AAGRkB,EAAW,cAAc;AAElB,MAAME,IAAS;AAAA,EAClB,MAAMrB;AAAA,EACN,SAASsB,EAAkDlB,CAAa;AAAA,EACxE,SAASkB,EAA+Cd,CAAa;AAAA,EACrE,QAAQc,EAA8CT,CAAY;AAAA,EAClE,QAAQS,EAA8CL,CAAY;AAAA,EAClE,MAAMK,EAA4CH,CAAU;AAChE;"}
@@ -1,42 +1,27 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import * as t from "@radix-ui/react-progress";
3
- import { forwardRef as s } from "react";
4
- import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components21.js";
5
- const p = s(
6
- ({
7
- value: a,
8
- max: r = 100,
9
- rounded: d = !0,
10
- style: o = "default",
11
- size: e = "medium",
12
- "data-test-id": n = "fondue-loading-bar",
13
- ...l
14
- }, m) => /* @__PURE__ */ i(
15
- t.Root,
16
- {
17
- ref: m,
18
- "data-test-id": n,
19
- className: g({ rounded: d, size: e, style: o }),
20
- "aria-busy": a !== r,
21
- value: a,
22
- max: r,
23
- style: {
24
- "--loading-bar-value": a,
25
- "--loading-bar-max": r,
26
- "--loading-bar-proportion": "calc(var(--loading-bar-value) / var(--loading-bar-max))"
27
- },
28
- ...l,
29
- children: /* @__PURE__ */ i(
30
- t.Indicator,
31
- {
32
- className: f({ style: o, indeterminateState: a === null })
33
- }
34
- )
35
- }
36
- )
37
- );
38
- p.displayName = "LoadingBar";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as d from "@radix-ui/react-label";
3
+ import { forwardRef as i } from "react";
4
+ import { cn as n } from "./fondue-components15.js";
5
+ const s = ({ className: e, "data-test-id": a = "fondue-label", ...t }, r) => /* @__PURE__ */ o(
6
+ d.Root,
7
+ {
8
+ ref: r,
9
+ "data-required": t.required,
10
+ className: n(
11
+ 'tw-group tw-flex tw-gap-1 tw-font-sans tw-font-normal peer-data-[state="checked"]:tw-font-medium peer-data-[state="indeterminate"]:tw-font-medium tw-text-body-medium tw-text-text-weak peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text tw-transition-colors',
12
+ // Disabled state if siblings has disabled state
13
+ "has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed",
14
+ // Required asterisk
15
+ 'after:tw-hidden data-[required="true"]:after:tw-flex after:tw-content-["*"] after:-tw-ml-1 after:tw-font-sans after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',
16
+ e
17
+ ),
18
+ "data-test-id": a,
19
+ ...t
20
+ }
21
+ ), w = i(s);
22
+ w.displayName = "Label";
39
23
  export {
40
- p as LoadingBar
24
+ w as Label,
25
+ s as LabelComponent
41
26
  };
42
27
  //# sourceMappingURL=fondue-components9.js.map