@frontify/fondue-components 19.1.0 → 19.3.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.
- package/dist/fondue-components.js +10 -8
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +24 -20
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +3 -3
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +36 -26
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +2 -2
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +2 -2
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +1 -1
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +1 -1
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +1 -1
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +2 -2
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +2 -2
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +8 -8
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +2 -2
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +63 -62
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +77 -70
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +2 -2
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +30 -37
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +101 -10
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +93 -73
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +12 -55
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +55 -14
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +20 -7
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +7 -6
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +7 -32
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +32 -5
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +5 -12
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +10 -153
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +59 -22
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +17 -17
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +33 -32
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +112 -15
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +19 -30
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +32 -62
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +53 -121
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +129 -20
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +21 -45
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +45 -8
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +8 -13
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +13 -15
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +15 -60
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +5 -18
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +60 -19
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +18 -5
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +18 -14
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +1 -1
- package/dist/fondue-components55.js +12 -16
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +5 -35
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +18 -4
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +35 -13
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +12 -24
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +4 -16
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +23 -145
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +17 -19
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +148 -74
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +19 -8
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +76 -34
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +8 -49
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +34 -10
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +70 -12
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +36 -30
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +10 -12
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +12 -20
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +13 -29
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +20 -55
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +34 -15
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +55 -25
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +14 -14
- package/dist/fondue-components77.js +25 -6
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +13 -5
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +23 -2
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +6 -4
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +6 -4
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +3 -15
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +4 -39
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +5 -0
- package/dist/fondue-components84.js.map +1 -0
- package/dist/fondue-components85.js +43 -0
- package/dist/fondue-components85.js.map +1 -0
- package/dist/fondue-components86.js +20 -0
- package/dist/fondue-components86.js.map +1 -0
- package/dist/fondue-components9.js +99 -83
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +141 -51
- package/dist/style.css +1 -1
- package/package.json +60 -60
|
@@ -3,7 +3,7 @@ import { Accordion as t } from "./fondue-components3.js";
|
|
|
3
3
|
import { Badge as m } from "./fondue-components4.js";
|
|
4
4
|
import { Box as f } from "./fondue-components5.js";
|
|
5
5
|
import { Button as l } from "./fondue-components6.js";
|
|
6
|
-
import { Checkbox as
|
|
6
|
+
import { Checkbox as d } from "./fondue-components7.js";
|
|
7
7
|
import { ColorPicker as c } from "./fondue-components8.js";
|
|
8
8
|
import { Dialog as g } from "./fondue-components9.js";
|
|
9
9
|
import { Divider as h } from "./fondue-components10.js";
|
|
@@ -25,14 +25,15 @@ import { Table as V } from "./fondue-components25.js";
|
|
|
25
25
|
import { Tabs as X } from "./fondue-components26.js";
|
|
26
26
|
import { Text as Z } from "./fondue-components27.js";
|
|
27
27
|
import { TextInput as $ } from "./fondue-components28.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import { Textarea as ro } from "./fondue-components29.js";
|
|
29
|
+
import { ThemeContext as to, ThemeProvider as xo, useFondueTheme as mo } from "./fondue-components30.js";
|
|
30
|
+
import { Tooltip as fo } from "./fondue-components31.js";
|
|
30
31
|
export {
|
|
31
32
|
t as Accordion,
|
|
32
33
|
m as Badge,
|
|
33
34
|
f as Box,
|
|
34
35
|
l as Button,
|
|
35
|
-
|
|
36
|
+
d as Checkbox,
|
|
36
37
|
c as ColorPicker,
|
|
37
38
|
g as Dialog,
|
|
38
39
|
h as Divider,
|
|
@@ -54,9 +55,10 @@ export {
|
|
|
54
55
|
X as Tabs,
|
|
55
56
|
Z as Text,
|
|
56
57
|
$ as TextInput,
|
|
57
|
-
ro as
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
ro as Textarea,
|
|
59
|
+
to as ThemeContext,
|
|
60
|
+
xo as ThemeProvider,
|
|
61
|
+
fo as Tooltip,
|
|
62
|
+
mo as useFondueTheme
|
|
61
63
|
};
|
|
62
64
|
//# 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,41 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "@radix-ui/react-separator";
|
|
3
3
|
import { forwardRef as f } from "react";
|
|
4
|
-
import { cn as l } from "./fondue-
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import { cn as l } from "./fondue-components37.js";
|
|
5
|
+
import v from "./fondue-components50.js";
|
|
6
|
+
import { dividerStyles as c } from "./fondue-components51.js";
|
|
7
|
+
const h = f(
|
|
7
8
|
({
|
|
8
|
-
"data-test-id":
|
|
9
|
-
direction:
|
|
10
|
-
className:
|
|
11
|
-
variant:
|
|
12
|
-
as:
|
|
13
|
-
decorative:
|
|
9
|
+
"data-test-id": i = "fondue-divider",
|
|
10
|
+
direction: r = "horizontal",
|
|
11
|
+
className: a,
|
|
12
|
+
variant: o,
|
|
13
|
+
as: e = "div",
|
|
14
|
+
decorative: d,
|
|
14
15
|
...m
|
|
15
16
|
}, s) => {
|
|
16
|
-
const n =
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
const n = e;
|
|
18
|
+
return /* @__PURE__ */ t(
|
|
18
19
|
p.Root,
|
|
19
20
|
{
|
|
20
21
|
ref: s,
|
|
21
22
|
className: l(
|
|
22
23
|
c({
|
|
23
|
-
direction:
|
|
24
|
-
variant:
|
|
24
|
+
direction: r,
|
|
25
|
+
variant: o,
|
|
25
26
|
...m
|
|
26
27
|
}),
|
|
27
|
-
|
|
28
|
+
v.root,
|
|
29
|
+
a
|
|
28
30
|
),
|
|
29
|
-
"data-
|
|
30
|
-
|
|
31
|
+
"data-variant": o,
|
|
32
|
+
"data-test-id": i,
|
|
33
|
+
decorative: d,
|
|
34
|
+
"data-orientation": r,
|
|
31
35
|
asChild: !0,
|
|
32
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ t(n, {})
|
|
33
37
|
}
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
40
|
);
|
|
37
|
-
|
|
41
|
+
h.displayName = "Divider";
|
|
38
42
|
export {
|
|
39
|
-
|
|
43
|
+
h as Divider
|
|
40
44
|
};
|
|
41
45
|
//# sourceMappingURL=fondue-components10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components10.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n /**\n * The html element to be used\n * @default \"div\"\n */\n as?: 'div' | 'li';\n /**\n * When `true`, signifies that it is purely visual, carries no semantic\n * meaning, and ensures it is not present in the accessibility tree.\n * @default false\n */\n decorative?: boolean;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n as = 'div',\n decorative,\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n const Component = as;\n\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n decorative={decorative}\n asChild\n >\n <Component />\n </Separator.Root>\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","as","decorative","props","ref","Component","jsx","Separator","cn","dividerStyles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components10.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport borderStyles from './styles/borderStyles.module.scss';\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n /**\n * The html element to be used\n * @default \"div\"\n */\n as?: 'div' | 'li';\n /**\n * When `true`, signifies that it is purely visual, carries no semantic\n * meaning, and ensures it is not present in the accessibility tree.\n * @default false\n */\n decorative?: boolean;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n as = 'div',\n decorative,\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n const Component = as;\n\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n borderStyles.root,\n className,\n )}\n data-variant={variant}\n data-test-id={dataTestId}\n decorative={decorative}\n data-orientation={direction}\n asChild\n >\n <Component />\n </Separator.Root>\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","as","decorative","props","ref","Component","jsx","Separator","cn","dividerStyles","borderStyles"],"mappings":";;;;;;AAmDO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,IAAAC,IAAK;AAAA,IACL,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEPC,MACe;AACf,UAAMC,IAAYJ;AAElB,WACI,gBAAAK;AAAA,MAACC,EAAU;AAAA,MAAV;AAAA,QACG,KAAAH;AAAA,QACA,WAAWI;AAAA,UACPC,EAAc;AAAA,YACV,WAAAX;AAAA,YACA,SAAAE;AAAA,YACA,GAAGG;AAAA,UAAA,CACN;AAAA,UACDO,EAAa;AAAA,UACbX;AAAA,QAAA;AAAA,QAEJ,gBAAcC;AAAA,QACd,gBAAcH;AAAA,QACd,YAAAK;AAAA,QACA,oBAAkBJ;AAAA,QAClB,SAAO;AAAA,QAEP,4BAACO,GAAA,CAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EAGvB;AACJ;AAEAV,EAAQ,cAAc;"}
|
|
@@ -2,9 +2,9 @@ import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconCaretRight as M } from "@frontify/fondue-icons";
|
|
3
3
|
import * as d from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { forwardRef as i, useMemo as G, Children as A, useRef as v } from "react";
|
|
5
|
-
import { useFondueTheme as D, ThemeProvider as b } from "./fondue-
|
|
6
|
-
import { useProcessedChildren as h } from "./fondue-
|
|
7
|
-
import s from "./fondue-
|
|
5
|
+
import { useFondueTheme as D, ThemeProvider as b } from "./fondue-components30.js";
|
|
6
|
+
import { useProcessedChildren as h } from "./fondue-components52.js";
|
|
7
|
+
import s from "./fondue-components53.js";
|
|
8
8
|
const N = ({
|
|
9
9
|
children: o,
|
|
10
10
|
open: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components11.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 { Children, forwardRef, useMemo, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean;\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\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n modal = false,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} modal={modal} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\ntype DropdownSpacing = 'compact' | 'comfortable' | 'spacious';\ntype DropdownViewportCollisionPadding = 'compact' | 'spacious';\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: DropdownSpacing;\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n /**\n * Define the minimum distance between the dropdown and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: DropdownViewportCollisionPadding;\n};\n\nconst SPACING_MAP: Record<DropdownSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<DropdownViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n align = 'start',\n triggerOffset = 'compact',\n children,\n preventTriggerFocusOnClose,\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.Content\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={side}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; heading?: string; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, heading, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const hasChildren = useMemo(\n () => Children.toArray(children).filter((child) => child !== null).length > 0,\n [children],\n );\n\n if (!hasChildren) {\n return null;\n }\n\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span aria-label={heading}>{heading}</span>\n </div>\n ) : null}\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 const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </ThemeProvider>\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 * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n /**\n * If true, the item props will be passed to the child element.\n * @default false\n */\n asChild?: boolean;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n asChild = false,\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n const wasMouseInteracted = useRef(false);\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild={asChild}\n data-show-focus-ring={wasMouseInteracted.current}\n onMouseEnter={() => {\n wasMouseInteracted.current = true;\n }}\n onFocus={(focusEvent) => {\n if (!wasMouseInteracted.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasMouseInteracted.current = false;\n }}\n {...props}\n >\n {content}\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","modal","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","DropdownContent","side","align","triggerOffset","preventTriggerFocusOnClose","viewportCollisionPadding","theme","useFondueTheme","ThemeProvider","styles","event","DropdownGroup","heading","useMemo","Children","child","jsxs","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","wasMouseInteracted","useRef","focusEvent","blurEvent","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;AA8BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAL,GAAY,OAAAC,GAAc,cAAAC,G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FqC,IAA4BF,EAA+CxB,CAAa,GACxF2B,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDb,CAAkB,GACvGkB,IAA2BL,EAA8CZ,CAAY,GACrFkB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAMxD;AAAA,EACN,SAASgD;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
1
|
+
{"version":3,"file":"fondue-components11.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 { Children, forwardRef, useMemo, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean;\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\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n modal = false,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} modal={modal} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\ntype DropdownSpacing = 'compact' | 'comfortable' | 'spacious';\ntype DropdownViewportCollisionPadding = 'compact' | 'spacious';\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: DropdownSpacing;\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n /**\n * Define the minimum distance between the dropdown and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: DropdownViewportCollisionPadding;\n};\n\nconst SPACING_MAP: Record<DropdownSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<DropdownViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n align = 'start',\n triggerOffset = 'compact',\n children,\n preventTriggerFocusOnClose,\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.Content\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={side}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; heading?: string; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, heading, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const hasChildren = useMemo(\n () => Children.toArray(children).filter((child) => child !== null).length > 0,\n [children],\n );\n\n if (!hasChildren) {\n return null;\n }\n\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span aria-label={heading}>{heading}</span>\n </div>\n ) : null}\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 const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </ThemeProvider>\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 * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n /**\n * If true, the item props will be passed to the child element.\n * @default false\n */\n asChild?: boolean;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n asChild = false,\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n const wasMouseInteracted = useRef(false);\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild={asChild}\n data-show-focus-ring={wasMouseInteracted.current}\n onMouseEnter={() => {\n wasMouseInteracted.current = true;\n }}\n onFocus={(focusEvent) => {\n if (!wasMouseInteracted.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasMouseInteracted.current = false;\n }}\n {...props}\n >\n {content}\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","modal","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","DropdownContent","side","align","triggerOffset","preventTriggerFocusOnClose","viewportCollisionPadding","theme","useFondueTheme","ThemeProvider","styles","event","DropdownGroup","heading","useMemo","Children","child","jsxs","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","wasMouseInteracted","useRef","focusEvent","blurEvent","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;AA8BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,cAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAL,GAAY,OAAAC,GAAc,cAAAC,GAA4B,gBAAcC,GACnF,UAAAJ,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMQ,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAR;AAAA,EACA,gBAAgBI,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAT,EAAA,CACL;AAGRO,EAAgB,cAAc;AAiC9B,MAAMI,IAA+C;AAAA,EACjD,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACd,GAEMC,IAAmF;AAAA,EACrF,SAAS;AAAA,EACT,UAAU;AACd,GAEaC,IAAkB,CAC3B;AAAA,EACI,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,eAAAC,IAAgB;AAAA,EAChB,UAAAhB;AAAA,EACA,4BAAAiB;AAAA,EACA,0BAAAC,I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AM;AAChB,QAAAA,EAAmB,UAAU;AAAA,MACjC;AAAA,MACA,SAAS,CAACE,MAAe;AACrB,QAAKF,EAAmB,YACpBE,EAAW,OAAO,QAAQ,gBAAgB;AAAA,MAElD;AAAA,MACA,QAAQ,CAACC,MAAc;AACnB,QAAAA,EAAU,OAAO,QAAQ,gBAAgB,SACzCH,EAAmB,UAAU;AAAA,MACjC;AAAA,MACC,GAAGhC;AAAA,MAEH,UAAAuB;AAAA,IAAA;AAAA,EAAA;AAGb;AACAI,EAAa,cAAc;AAIpB,MAAMS,IAAe,CACxB,EAAE,UAAA7C,GAAU,MAAA8C,GAAM,gBAAgB1C,IAAa,uBAAA,GAC/CM,MAGI,gBAAAL,EAAC,OAAA,EAAI,aAAWyC,GAAM,WAAWxB,EAAO,MAAM,gBAAclB,GAAY,KAAAM,GACnE,UAAAV,EAAA,CACL;AAGR6C,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoDzC,CAAe,GACjG0C,IAA8BD,EAAiDnC,CAAe,GAC9FqC,IAA4BF,EAA+CxB,CAAa,GACxF2B,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDb,CAAkB,GACvGkB,IAA2BL,EAA8CZ,CAAY,GACrFkB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAMxD;AAAA,EACN,SAASgD;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import { propsToCssVariables as y } from "./fondue-
|
|
4
|
-
import x from "./fondue-
|
|
3
|
+
import { propsToCssVariables as y } from "./fondue-components35.js";
|
|
4
|
+
import x from "./fondue-components54.js";
|
|
5
5
|
const u = n(
|
|
6
6
|
({
|
|
7
7
|
as: a = "div",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components12.js","sources":["../src/components/Flex/Flex.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/flex.module.scss';\n\nexport type FlexProps = LayoutComponentProps & {\n /**\n * The element to render the Flex component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'flex'\n */\n display?: Responsive<'none' | 'flex' | 'inline-flex'>;\n /**\n * The direction of the children.\n * @default 'row'\n */\n direction?: Responsive<'row' | 'row-reverse' | 'column' | 'column-reverse'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;\n /**\n * The wrap property.\n */\n wrap?: Responsive<'nowrap' | 'wrap' | 'wrap-reverse'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-flex',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-content' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nFlex.displayName = 'Flex';\n"],"names":["Flex","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAuDO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components12.js","sources":["../src/components/Flex/Flex.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/flex.module.scss';\n\nexport type FlexProps = LayoutComponentProps & {\n /**\n * The element to render the Flex component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'flex'\n */\n display?: Responsive<'none' | 'flex' | 'inline-flex'>;\n /**\n * The direction of the children.\n * @default 'row'\n */\n direction?: Responsive<'row' | 'row-reverse' | 'column' | 'column-reverse'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;\n /**\n * The wrap property.\n */\n wrap?: Responsive<'nowrap' | 'wrap' | 'wrap-reverse'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-flex',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-content' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nFlex.displayName = 'Flex';\n"],"names":["Flex","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAuDO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,GAAO,EAAE,SAAS,mBAAmB;AAAA,MAChE,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAIjB;AACAJ,EAAK,cAAc;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { IconCross as
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-
|
|
6
|
-
import { useFondueTheme as A, ThemeProvider as T } from "./fondue-
|
|
7
|
-
import s from "./fondue-
|
|
8
|
-
const n = ({ children: t, ...o }) => /* @__PURE__ */ a(
|
|
2
|
+
import { IconCross as R } from "@frontify/fondue-icons";
|
|
3
|
+
import * as l from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as i } from "react";
|
|
5
|
+
import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-components48.js";
|
|
6
|
+
import { useFondueTheme as A, ThemeProvider as T } from "./fondue-components30.js";
|
|
7
|
+
import s from "./fondue-components55.js";
|
|
8
|
+
const n = ({ children: t, ...o }) => /* @__PURE__ */ a(l.Root, { ...o, children: t });
|
|
9
9
|
n.displayName = "Flyout.Root";
|
|
10
|
-
const c = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...d },
|
|
11
|
-
|
|
10
|
+
const c = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...d }, r) => /* @__PURE__ */ a(
|
|
11
|
+
l.Trigger,
|
|
12
12
|
{
|
|
13
13
|
onMouseDown: w,
|
|
14
14
|
"data-auto-focus-visible": "true",
|
|
15
15
|
"data-auto-focus-trigger": !0,
|
|
16
16
|
"data-test-id": e,
|
|
17
17
|
asChild: t,
|
|
18
|
-
ref:
|
|
18
|
+
ref: r,
|
|
19
19
|
...d,
|
|
20
20
|
children: o
|
|
21
21
|
}
|
|
@@ -33,25 +33,25 @@ const I = {
|
|
|
33
33
|
maxWidth: o = "360px",
|
|
34
34
|
padding: e = "compact",
|
|
35
35
|
rounded: d = "medium",
|
|
36
|
-
width:
|
|
36
|
+
width: r = "fit-content",
|
|
37
37
|
shadow: F = "medium",
|
|
38
38
|
triggerOffset: g = "compact",
|
|
39
39
|
viewportCollisionPadding: N = "compact",
|
|
40
40
|
"data-test-id": h = "fondue-flyout-content",
|
|
41
41
|
children: v,
|
|
42
|
-
...
|
|
43
|
-
},
|
|
44
|
-
const
|
|
45
|
-
return /* @__PURE__ */ a(
|
|
42
|
+
...C
|
|
43
|
+
}, P) => {
|
|
44
|
+
const b = A();
|
|
45
|
+
return /* @__PURE__ */ a(l.Portal, { children: /* @__PURE__ */ u(T, { theme: b, children: [
|
|
46
46
|
/* @__PURE__ */ a("div", { "data-test-id": "fondue-flyout-overlay", className: s.overlay }),
|
|
47
47
|
/* @__PURE__ */ a(
|
|
48
|
-
|
|
48
|
+
l.Content,
|
|
49
49
|
{
|
|
50
50
|
style: {
|
|
51
51
|
"--flyout-max-width": o,
|
|
52
|
-
"--flyout-width":
|
|
52
|
+
"--flyout-width": r
|
|
53
53
|
},
|
|
54
|
-
ref:
|
|
54
|
+
ref: P,
|
|
55
55
|
align: t,
|
|
56
56
|
collisionPadding: O[N],
|
|
57
57
|
sideOffset: I[g],
|
|
@@ -61,16 +61,26 @@ const I = {
|
|
|
61
61
|
"data-shadow": F,
|
|
62
62
|
"data-test-id": h,
|
|
63
63
|
onFocus: x,
|
|
64
|
-
...
|
|
64
|
+
...C,
|
|
65
65
|
children: v
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
] }) });
|
|
69
69
|
};
|
|
70
70
|
m.displayName = "Flyout.Content";
|
|
71
|
-
const y = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" },
|
|
71
|
+
const y = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header", closeProps: d }, r) => /* @__PURE__ */ u("div", { "data-test-id": e, ref: r, className: s.header, children: [
|
|
72
72
|
/* @__PURE__ */ a("div", { children: o }),
|
|
73
|
-
t && /* @__PURE__ */ a(
|
|
73
|
+
t && /* @__PURE__ */ a(
|
|
74
|
+
l.Close,
|
|
75
|
+
{
|
|
76
|
+
role: "button",
|
|
77
|
+
"data-test-id": `${e}-close`,
|
|
78
|
+
className: s.close,
|
|
79
|
+
"aria-label": "Close",
|
|
80
|
+
...d,
|
|
81
|
+
children: /* @__PURE__ */ a(R, { size: 20 })
|
|
82
|
+
}
|
|
83
|
+
)
|
|
74
84
|
] });
|
|
75
85
|
y.displayName = "Flyout.Header";
|
|
76
86
|
const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: s.footer, children: t });
|
|
@@ -89,11 +99,11 @@ const p = ({ children: t, "data-test-id": o = "fondue-flyout-body", scrollable:
|
|
|
89
99
|
p.displayName = "Flyout.Body";
|
|
90
100
|
const j = {
|
|
91
101
|
Root: n,
|
|
92
|
-
Trigger:
|
|
93
|
-
Content:
|
|
94
|
-
Header:
|
|
95
|
-
Footer:
|
|
96
|
-
Body:
|
|
102
|
+
Trigger: i(c),
|
|
103
|
+
Content: i(m),
|
|
104
|
+
Header: i(y),
|
|
105
|
+
Footer: i(f),
|
|
106
|
+
Body: i(p)
|
|
97
107
|
};
|
|
98
108
|
export {
|
|
99
109
|
j as Flyout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components13.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\ntype FlyoutSpacing = 'compact' | 'comfortable' | 'spacious';\ntype FlyoutViewportCollisionPadding = 'compact' | 'spacious';\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: FlyoutSpacing;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n /**\n * Define the minimum distance between the flyout and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: FlyoutViewportCollisionPadding;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nconst SPACING_MAP: Record<FlyoutSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<FlyoutViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n triggerOffset = 'compact',\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme}>\n <div data-test-id=\"fondue-flyout-overlay\" className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className={styles.close}>\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Allow the body to scroll if the max height of the flyout is reached\n * @default false\n */\n scrollable?: boolean;\n};\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body', scrollable = false }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n data-flyout-spacing=\"compact\"\n data-scrollable={scrollable}\n className={styles.body}\n >\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","triggerOffset","viewportCollisionPadding","theme","useFondueTheme","jsxs","ThemeProvider","styles","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","scrollable","Flyout","forwardRef"],"mappings":";;;;;;;AA8BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,GAAS;AAEnDD,EAAW,cAAc;AAYlB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAa;AAAA,EAAb;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AAsD5B,MAAMM,IAA6C;AAAA,EAC/C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACd,GAEMC,IAAiF;AAAA,EACnF,SAAS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Ab,EAAmB,MAAK,UAAS,gBAAc,GAAGG,CAAU,UAAU,WAAWmB,EAAO,OACrF,4BAACI,GAAU,EAAA,MAAM,IAAI,EACzB,CAAA;AAAA,GAER;AAGRF,EAAa,cAAc;AAId,MAAAG,IAAe,CACxB,EAAE,UAAA7B,GAAU,gBAAgBK,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWkB,EAAO,QACtD,UAAAxB,GACL;AAGR6B,EAAa,cAAc;AAYd,MAAAC,IAAa,CACtB,EAAE,UAAA9B,GAAU,gBAAgBK,IAAa,sBAAsB,YAAA0B,IAAa,GAAM,GAClFzB,MAGI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,gBAAcF;AAAA,IACd,KAAAC;AAAA,IACA,uBAAoB;AAAA,IACpB,mBAAiByB;AAAA,IACjB,WAAWP,EAAO;AAAA,IAEjB,UAAAxB;AAAA,EAAA;AACL;AAGR8B,EAAW,cAAc;AAElB,MAAME,IAAS;AAAA,EAClB,MAAMjC;AAAA,EACN,SAASkC,EAAkD9B,CAAa;AAAA,EACxE,SAAS8B,EAA+CtB,CAAa;AAAA,EACrE,QAAQsB,EAA8CP,CAAY;AAAA,EAClE,QAAQO,EAA8CJ,CAAY;AAAA,EAClE,MAAMI,EAA4CH,CAAU;AAChE;"}
|
|
1
|
+
{"version":3,"file":"fondue-components13.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 { type CommonAriaProps } from '#/helpers/aria';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\ntype FlyoutSpacing = 'compact' | 'comfortable' | 'spacious';\ntype FlyoutViewportCollisionPadding = 'compact' | 'spacious';\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: FlyoutSpacing;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n /**\n * Define the minimum distance between the flyout and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: FlyoutViewportCollisionPadding;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nconst SPACING_MAP: Record<FlyoutSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<FlyoutViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n triggerOffset = 'compact',\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme}>\n <div data-test-id=\"fondue-flyout-overlay\" className={styles.overlay} />\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n closeProps?: CommonAriaProps;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header', closeProps }: 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\n role=\"button\"\n data-test-id={`${dataTestId}-close`}\n className={styles.close}\n aria-label=\"Close\"\n {...closeProps}\n >\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Allow the body to scroll if the max height of the flyout is reached\n * @default false\n */\n scrollable?: boolean;\n};\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body', scrollable = false }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n data-flyout-spacing=\"compact\"\n data-scrollable={scrollable}\n className={styles.body}\n >\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","triggerOffset","viewportCollisionPadding","theme","useFondueTheme","jsxs","ThemeProvider","styles","addShowFocusRing","FlyoutHeader","showCloseButton","closeProps","IconCross","FlyoutFooter","FlyoutBody","scrollable","Flyout","forwardRef"],"mappings":";;;;;;;AA+BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,GAAS;AAEnDD,EAAW,cAAc;AAYlB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAA,GACrFK,MAGI,gBAAAC;AAAA,EAACL,EAAa;AAAA,EAAb;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AAAA;AAIbG,EAAc,cAAc;AAsD5B,MAAMM,IAA6C;AAAA,EAC/C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AACd,GAEMC,IAAiF;AAAA,EACnF,SAAS;AAAA,EACT,UAAU;AACd,GAEaC,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,eAAAC,IAAgB;AAAA,EAChB,0BAAAC,IAA2B;AAAA,EAC3B,gBAAgBd,IAAa;A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IAAe,CACxB,EAAE,UAAA9B,GAAU,gBAAgBK,IAAa,uBAAA,GACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWkB,EAAO,QACtD,UAAAxB,GACL;AAGR8B,EAAa,cAAc;AAYpB,MAAMC,IAAa,CACtB,EAAE,UAAA/B,GAAU,gBAAgBK,IAAa,sBAAsB,YAAA2B,IAAa,GAAA,GAC5E1B,MAGI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,gBAAcF;AAAA,IACd,KAAAC;AAAA,IACA,uBAAoB;AAAA,IACpB,mBAAiB0B;AAAA,IACjB,WAAWR,EAAO;AAAA,IAEjB,UAAAxB;AAAA,EAAA;AAAA;AAIb+B,EAAW,cAAc;AAElB,MAAME,IAAS;AAAA,EAClB,MAAMlC;AAAA,EACN,SAASmC,EAAkD/B,CAAa;AAAA,EACxE,SAAS+B,EAA+CvB,CAAa;AAAA,EACrE,QAAQuB,EAA8CR,CAAY;AAAA,EAClE,QAAQQ,EAA8CJ,CAAY;AAAA,EAClE,MAAMI,EAA4CH,CAAU;AAChE;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y } from "react";
|
|
3
|
-
import { propsToCssVariables as n } from "./fondue-
|
|
4
|
-
import u from "./fondue-
|
|
3
|
+
import { propsToCssVariables as n } from "./fondue-components35.js";
|
|
4
|
+
import u from "./fondue-components56.js";
|
|
5
5
|
const c = y(
|
|
6
6
|
({
|
|
7
7
|
as: a = "div",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components14.js","sources":["../src/components/Grid/Grid.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/grid.module.scss';\n\nexport type GridProps = LayoutComponentProps & {\n /**\n * The element to render the Grid component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n\n /**\n * The display property.\n * @default 'grid'\n */\n display?: 'none' | 'grid' | 'inline-grid';\n /**\n * The columns property.\n */\n columns?: Responsive<string | number>;\n /**\n * The rows property.\n */\n rows?: Responsive<string | number>;\n /**\n * The flow property.\n */\n flow?: Responsive<'row' | 'column' | 'dense' | 'row-dense' | 'column-dense'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'start' | 'center' | 'end' | 'baseline' | 'stretch'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'start' | 'center' | 'end' | 'between'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-grid',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-items' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nGrid.displayName = 'Grid';\n"],"names":["Grid","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AA2DO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components14.js","sources":["../src/components/Grid/Grid.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/grid.module.scss';\n\nexport type GridProps = LayoutComponentProps & {\n /**\n * The element to render the Grid component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n\n /**\n * The display property.\n * @default 'grid'\n */\n display?: 'none' | 'grid' | 'inline-grid';\n /**\n * The columns property.\n */\n columns?: Responsive<string | number>;\n /**\n * The rows property.\n */\n rows?: Responsive<string | number>;\n /**\n * The flow property.\n */\n flow?: Responsive<'row' | 'column' | 'dense' | 'row-dense' | 'column-dense'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'start' | 'center' | 'end' | 'baseline' | 'stretch'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'start' | 'center' | 'end' | 'between'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-grid',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-items' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nGrid.displayName = 'Grid';\n"],"names":["Grid","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AA2DO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,GAAO,EAAE,SAAS,iBAAiB;AAAA,MAC9D,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAIjB;AACAJ,EAAK,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as y } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g } from "react";
|
|
3
|
-
import { cn as x } from "./fondue-
|
|
4
|
-
import a from "./fondue-
|
|
3
|
+
import { cn as x } from "./fondue-components37.js";
|
|
4
|
+
import a from "./fondue-components57.js";
|
|
5
5
|
const $ = g(
|
|
6
6
|
({
|
|
7
7
|
as: e = "span",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components15.js","sources":["../src/components/Heading/Heading.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ElementType, type ForwardedRef, forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/heading.module.scss';\n\ntype HeadingWeight = 'default' | 'strong';\ntype HeadingSize = 'medium' | 'large' | 'x-large' | 'xx-large';\ntype HeadingColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\n\ntype TagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';\n\nexport type HeadingProps<TTag extends TagType = 'span'> = CommonAriaProps & {\n 'data-test-id'?: string;\n as?: TTag;\n children?: ReactNode;\n color?: HeadingColor;\n size?: HeadingSize;\n weight?: HeadingWeight;\n className?: string;\n};\n\ntype HeadingElementType<TTag extends TagType> = TTag extends 'span'\n ? HTMLSpanElement\n : TTag extends 'p'\n ? HTMLParagraphElement\n : HTMLHeadingElement;\n\nexport const Heading = forwardRef(\n (\n {\n as: Tag = 'span' as ElementType,\n children,\n className,\n color = 'default',\n role,\n size = 'medium',\n weight = 'default',\n 'data-test-id': dataTestId = 'fondue-heading',\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-hidden': ariaHidden,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref,\n ) => {\n return (\n <Tag\n className={cn([\n styles.root,\n styles[`size-${size}`],\n styles[`weight-${weight}`],\n styles[`color-${color}`],\n className,\n ])}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n data-test-id={dataTestId}\n ref={ref}\n {...props}\n >\n {children}\n </Tag>\n );\n },\n) as (<TTag extends TagType = 'span'>(\n props: HeadingProps<TTag> & { ref?: ForwardedRef<HeadingElementType<TTag>> },\n) => JSX.Element) & { displayName: string };\n\nHeading.displayName = 'Heading';\n"],"names":["Heading","forwardRef","Tag","children","className","color","role","size","weight","dataTestId","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaHidden","ariaLabel","ariaLabelledBy","props","ref","jsx","cn","styles"],"mappings":";;;;AA+BO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,IAAIC,IAAM;AAAA,IACV,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,gBAAgBC,IAAa;AAAA,IAC7B,oBAAoBC;AAAA,IACpB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,eAAeC;AAAA,IACf,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,GAAGC;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components15.js","sources":["../src/components/Heading/Heading.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ElementType, type ForwardedRef, forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/heading.module.scss';\n\ntype HeadingWeight = 'default' | 'strong';\ntype HeadingSize = 'medium' | 'large' | 'x-large' | 'xx-large';\ntype HeadingColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\n\ntype TagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';\n\nexport type HeadingProps<TTag extends TagType = 'span'> = CommonAriaProps & {\n 'data-test-id'?: string;\n as?: TTag;\n children?: ReactNode;\n color?: HeadingColor;\n size?: HeadingSize;\n weight?: HeadingWeight;\n className?: string;\n};\n\ntype HeadingElementType<TTag extends TagType> = TTag extends 'span'\n ? HTMLSpanElement\n : TTag extends 'p'\n ? HTMLParagraphElement\n : HTMLHeadingElement;\n\nexport const Heading = forwardRef(\n (\n {\n as: Tag = 'span' as ElementType,\n children,\n className,\n color = 'default',\n role,\n size = 'medium',\n weight = 'default',\n 'data-test-id': dataTestId = 'fondue-heading',\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-hidden': ariaHidden,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref,\n ) => {\n return (\n <Tag\n className={cn([\n styles.root,\n styles[`size-${size}`],\n styles[`weight-${weight}`],\n styles[`color-${color}`],\n className,\n ])}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n data-test-id={dataTestId}\n ref={ref}\n {...props}\n >\n {children}\n </Tag>\n );\n },\n) as (<TTag extends TagType = 'span'>(\n props: HeadingProps<TTag> & { ref?: ForwardedRef<HeadingElementType<TTag>> },\n) => JSX.Element) & { displayName: string };\n\nHeading.displayName = 'Heading';\n"],"names":["Heading","forwardRef","Tag","children","className","color","role","size","weight","dataTestId","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaHidden","ariaLabel","ariaLabelledBy","props","ref","jsx","cn","styles"],"mappings":";;;;AA+BO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,IAAIC,IAAM;AAAA,IACV,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,gBAAgBC,IAAa;AAAA,IAC7B,oBAAoBC;AAAA,IACpB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,eAAeC;AAAA,IACf,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAAChB;AAAA,IAAA;AAAA,MACG,WAAWiB,EAAG;AAAA,QACVC,EAAO;AAAA,QACPA,EAAO,QAAQb,CAAI,EAAE;AAAA,QACrBa,EAAO,UAAUZ,CAAM,EAAE;AAAA,QACzBY,EAAO,SAASf,CAAK,EAAE;AAAA,QACvBD;AAAA,MAAA,CACH;AAAA,MACD,MAAAE;AAAA,MACA,cAAYQ;AAAA,MACZ,eAAaD;AAAA,MACb,oBAAkBH;AAAA,MAClB,mBAAiBK;AAAA,MACjB,iBAAeJ;AAAA,MACf,iBAAeC;AAAA,MACf,gBAAcH;AAAA,MACd,KAAAQ;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAb;AAAA,IAAA;AAAA,EAAA;AAIjB;AAIAH,EAAQ,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "@radix-ui/react-label";
|
|
3
3
|
import { forwardRef as s } from "react";
|
|
4
|
-
import { cn as w } from "./fondue-
|
|
4
|
+
import { cn as w } from "./fondue-components37.js";
|
|
5
5
|
const m = ({ className: r, "data-test-id": d = "fondue-label", ...a }, i) => /* @__PURE__ */ l(
|
|
6
6
|
n.Root,
|
|
7
7
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components16.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 MouseEventHandler, 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 onClick?: MouseEventHandler<HTMLLabelElement>;\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-body--stack 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-body--stack 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 onClick={(event) => {\n // Add support of Select component, Radix only allows native `select`\n // but we use `div[role=combobox]` because of downshift\n // https://github.com/radix-ui/primitives/blob/6e75e117977c9e6ffa939e6951a707f16ba0f95e/packages/react/label/src/label.tsx#L22\n const targetId = (event.target as HTMLElement).getAttribute('for');\n const target = targetId ? document.getElementById(targetId) : null;\n\n if (target && target.getAttribute('role') === 'combobox') {\n event.preventDefault();\n event.stopPropagation();\n target.click();\n }\n }}\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","event","targetId","target","Label","forwardRef"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"fondue-components16.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 MouseEventHandler, 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 onClick?: MouseEventHandler<HTMLLabelElement>;\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-body--stack 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-body--stack 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 onClick={(event) => {\n // Add support of Select component, Radix only allows native `select`\n // but we use `div[role=combobox]` because of downshift\n // https://github.com/radix-ui/primitives/blob/6e75e117977c9e6ffa939e6951a707f16ba0f95e/packages/react/label/src/label.tsx#L22\n const targetId = (event.target as HTMLElement).getAttribute('for');\n const target = targetId ? document.getElementById(targetId) : null;\n\n if (target && target.getAttribute('role') === 'combobox') {\n event.preventDefault();\n event.stopPropagation();\n target.click();\n }\n }}\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","event","targetId","target","Label","forwardRef"],"mappings":";;;;AAwBO,MAAMA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,GAAGC,EAAA,GAC7DC,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,IAAA;AAAA,IAEJ,gBAAcC;AAAA,IACd,SAAS,CAACM,MAAU;AAIhB,YAAMC,IAAYD,EAAM,OAAuB,aAAa,KAAK,GAC3DE,IAASD,IAAW,SAAS,eAAeA,CAAQ,IAAI;AAE9D,MAAIC,KAAUA,EAAO,aAAa,MAAM,MAAM,eAC1CF,EAAM,eAAA,GACNA,EAAM,gBAAA,GACNE,EAAO,MAAA;AAAA,IAEf;AAAA,IACC,GAAGP;AAAA,EAAA;AAAA,GAKHQ,IAAQC,EAAyCZ,CAAc;AAC5EW,EAAM,cAAc;"}
|
|
@@ -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-
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components58.js";
|
|
5
5
|
const p = m(
|
|
6
6
|
({
|
|
7
7
|
value: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components17.js","sources":["../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ProgressRadixPrimitive from '@radix-ui/react-progress';\nimport { forwardRef, type CSSProperties, type ElementRef, type ForwardedRef } from 'react';\n\nimport { loadingBarContainerStyles, loadingBarStyles } from './styles/loadingBarStyles';\n\nexport type LoadingBarProps = {\n /**\n * The current value of the loading bar. If `null`, the loading bar will be in an indeterminate state.\n * @default null\n */\n value: number | null;\n /**\n * The maximum value of the loading bar\n * @default 100\n */\n max?: number;\n /**\n * @default 'fondue-loading-bar'\n */\n 'data-test-id'?: string;\n /**\n * Add rounded corners to the loading bar\n * @default true\n */\n rounded?: boolean;\n /**\n * The style of the loading bar\n * @default \"default\"\n */\n variant?: 'default' | 'positive' | 'negative';\n /**\n * The size of the loading bar\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large' | 'x-large';\n /**\n * The label of the loading bar for accessibility purposes\n */\n getValueLabel?: (value: number, max: number) => string;\n} & ({ 'aria-label': string } | { 'aria-labelledby': string });\n\nexport const LoadingBar = forwardRef<ElementRef<typeof ProgressRadixPrimitive.Root>, LoadingBarProps>(\n (\n {\n value,\n max = 100,\n rounded = true,\n variant = 'default',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-bar',\n ...props\n }: LoadingBarProps,\n ref: ForwardedRef<ElementRef<typeof ProgressRadixPrimitive.Root>>,\n ) => {\n return (\n <ProgressRadixPrimitive.Root\n ref={ref}\n data-test-id={dataTestId}\n className={loadingBarContainerStyles({ rounded, size, variant })}\n aria-busy={value !== max}\n value={value}\n max={max}\n style={\n {\n '--loading-bar-value': value,\n '--loading-bar-max': max,\n '--loading-bar-proportion': 'calc(var(--loading-bar-value) / var(--loading-bar-max))',\n } as CSSProperties\n }\n {...props}\n >\n <ProgressRadixPrimitive.Indicator\n className={loadingBarStyles({ variant, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","variant","size","dataTestId","props","ref","jsx","ProgressRadixPrimitive","loadingBarContainerStyles","loadingBarStyles"],"mappings":";;;;AA2CO,MAAMA,IAAaC;AAAA,EACtB,CACI;AAAA,IACI,OAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,GAAGC;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components17.js","sources":["../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ProgressRadixPrimitive from '@radix-ui/react-progress';\nimport { forwardRef, type CSSProperties, type ElementRef, type ForwardedRef } from 'react';\n\nimport { loadingBarContainerStyles, loadingBarStyles } from './styles/loadingBarStyles';\n\nexport type LoadingBarProps = {\n /**\n * The current value of the loading bar. If `null`, the loading bar will be in an indeterminate state.\n * @default null\n */\n value: number | null;\n /**\n * The maximum value of the loading bar\n * @default 100\n */\n max?: number;\n /**\n * @default 'fondue-loading-bar'\n */\n 'data-test-id'?: string;\n /**\n * Add rounded corners to the loading bar\n * @default true\n */\n rounded?: boolean;\n /**\n * The style of the loading bar\n * @default \"default\"\n */\n variant?: 'default' | 'positive' | 'negative';\n /**\n * The size of the loading bar\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large' | 'x-large';\n /**\n * The label of the loading bar for accessibility purposes\n */\n getValueLabel?: (value: number, max: number) => string;\n} & ({ 'aria-label': string } | { 'aria-labelledby': string });\n\nexport const LoadingBar = forwardRef<ElementRef<typeof ProgressRadixPrimitive.Root>, LoadingBarProps>(\n (\n {\n value,\n max = 100,\n rounded = true,\n variant = 'default',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-bar',\n ...props\n }: LoadingBarProps,\n ref: ForwardedRef<ElementRef<typeof ProgressRadixPrimitive.Root>>,\n ) => {\n return (\n <ProgressRadixPrimitive.Root\n ref={ref}\n data-test-id={dataTestId}\n className={loadingBarContainerStyles({ rounded, size, variant })}\n aria-busy={value !== max}\n value={value}\n max={max}\n style={\n {\n '--loading-bar-value': value,\n '--loading-bar-max': max,\n '--loading-bar-proportion': 'calc(var(--loading-bar-value) / var(--loading-bar-max))',\n } as CSSProperties\n }\n {...props}\n >\n <ProgressRadixPrimitive.Indicator\n className={loadingBarStyles({ variant, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","variant","size","dataTestId","props","ref","jsx","ProgressRadixPrimitive","loadingBarContainerStyles","loadingBarStyles"],"mappings":";;;;AA2CO,MAAMA,IAAaC;AAAA,EACtB,CACI;AAAA,IACI,OAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAuB;AAAA,IAAvB;AAAA,MACG,KAAAF;AAAA,MACA,gBAAcF;AAAA,MACd,WAAWK,EAA0B,EAAE,SAAAR,GAAS,MAAAE,GAAM,SAAAD,GAAS;AAAA,MAC/D,aAAWH,MAAUC;AAAA,MACrB,OAAAD;AAAA,MACA,KAAAC;AAAA,MACA,OACI;AAAA,QACI,uBAAuBD;AAAA,QACvB,qBAAqBC;AAAA,QACrB,4BAA4B;AAAA,MAAA;AAAA,MAGnC,GAAGK;AAAA,MAEJ,UAAA,gBAAAE;AAAA,QAACC,EAAuB;AAAA,QAAvB;AAAA,UACG,WAAWE,EAAiB,EAAE,SAAAR,GAAS,oBAAoBH,MAAU,MAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/E;AAAA,EAAA;AAIhB;AACAF,EAAW,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components18.js","sources":["../src/components/LoadingCircle/LoadingCircle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport styles from './styles/loadingCircleStyles.module.scss';\n\nexport type LoadingCircleProps = {\n /**\n * The variant of the loading circle.\n * @default 'progress'\n */\n variant?: 'progress' | 'success' | 'danger';\n /**\n * The size of the loading circle\n * @default \"medium\"\n */\n size?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n 'data-test-id'?: string;\n};\n\nexport const LoadingCircle = forwardRef<HTMLDivElement, LoadingCircleProps>(\n (\n {\n variant = 'progress',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-circle-content',\n }: LoadingCircleProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n data-variant={variant}\n data-size={size}\n className={styles.root}\n ></div>\n );\n },\n);\nLoadingCircle.displayName = 'LoadingCircle';\n"],"names":["LoadingCircle","forwardRef","variant","size","dataTestId","ref","jsx","styles"],"mappings":";;;AAoBO,MAAMA,IAAgBC;AAAA,EACzB,CACI;AAAA,IACI,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components18.js","sources":["../src/components/LoadingCircle/LoadingCircle.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef } from 'react';\n\nimport styles from './styles/loadingCircleStyles.module.scss';\n\nexport type LoadingCircleProps = {\n /**\n * The variant of the loading circle.\n * @default 'progress'\n */\n variant?: 'progress' | 'success' | 'danger';\n /**\n * The size of the loading circle\n * @default \"medium\"\n */\n size?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n 'data-test-id'?: string;\n};\n\nexport const LoadingCircle = forwardRef<HTMLDivElement, LoadingCircleProps>(\n (\n {\n variant = 'progress',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-circle-content',\n }: LoadingCircleProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n data-variant={variant}\n data-size={size}\n className={styles.root}\n ></div>\n );\n },\n);\nLoadingCircle.displayName = 'LoadingCircle';\n"],"names":["LoadingCircle","forwardRef","variant","size","dataTestId","ref","jsx","styles"],"mappings":";;;AAoBO,MAAMA,IAAgBC;AAAA,EACzB,CACI;AAAA,IACI,SAAAC,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,EAAA,GAEjCC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAD;AAAA,MACA,gBAAcD;AAAA,MACd,gBAAcF;AAAA,MACd,aAAWC;AAAA,MACX,WAAWI,EAAO;AAAA,IAAA;AAAA,EAAA;AAIlC;AACAP,EAAc,cAAc;"}
|