@frontify/fondue-components 3.2.0 → 3.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 +18 -16
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +2 -2
- package/dist/fondue-components11.js +42 -30
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components15.js +64 -6
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +6 -47
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +42 -50
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +112 -29
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +53 -110
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +27 -64
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +64 -41
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +43 -32
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +32 -5
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +5 -12
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +10 -153
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +59 -22
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +17 -17
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +112 -15
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +19 -30
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +2 -2
- package/dist/fondue-components30.js +32 -28
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +23 -125
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +129 -20
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +21 -45
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +45 -15
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +28 -60
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +15 -15
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +60 -19
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +15 -17
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +16 -4
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +4 -4
- package/dist/fondue-components40.js +3 -11
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +11 -3
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +5 -35
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +35 -5
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +12 -24
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +4 -16
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +24 -10
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +16 -12
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +2 -2
- package/dist/fondue-components53.js +1 -1
- package/dist/fondue-components54.js +9 -16
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +12 -6
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +18 -2
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +4 -8
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +2 -39
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +14 -0
- package/dist/fondue-components59.js.map +1 -0
- package/dist/fondue-components6.js +5 -5
- package/dist/fondue-components60.js +42 -0
- package/dist/fondue-components60.js.map +1 -0
- package/dist/fondue-components7.js +78 -68
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +2 -2
- package/dist/fondue-components9.js +3 -3
- package/dist/index.d.ts +27 -3
- package/dist/style.css +1 -1
- package/package.json +39 -38
|
@@ -3,7 +3,7 @@ import { Box as t } from "./fondue-components3.js";
|
|
|
3
3
|
import { Button as x } from "./fondue-components4.js";
|
|
4
4
|
import { Checkbox as f } from "./fondue-components5.js";
|
|
5
5
|
import { ColorPicker as l } from "./fondue-components6.js";
|
|
6
|
-
import { Dialog as
|
|
6
|
+
import { Dialog as c } from "./fondue-components7.js";
|
|
7
7
|
import { Divider as S } from "./fondue-components8.js";
|
|
8
8
|
import { Dropdown as g } from "./fondue-components9.js";
|
|
9
9
|
import { Flex as B } from "./fondue-components10.js";
|
|
@@ -11,19 +11,20 @@ import { Flyout as D } from "./fondue-components11.js";
|
|
|
11
11
|
import { Grid as h } from "./fondue-components12.js";
|
|
12
12
|
import { Label as w } from "./fondue-components13.js";
|
|
13
13
|
import { LoadingBar as L } from "./fondue-components14.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
14
|
+
import { ScrollArea as v } from "./fondue-components15.js";
|
|
15
|
+
import { Section as A } from "./fondue-components16.js";
|
|
16
|
+
import { SegmentedControl as I } from "./fondue-components17.js";
|
|
17
|
+
import { Select as j } from "./fondue-components18.js";
|
|
18
|
+
import { Slider as s } from "./fondue-components19.js";
|
|
19
|
+
import { Switch as E } from "./fondue-components20.js";
|
|
20
|
+
import { TextInput as J } from "./fondue-components21.js";
|
|
21
|
+
import { Tooltip as M } from "./fondue-components22.js";
|
|
21
22
|
export {
|
|
22
23
|
t as Box,
|
|
23
24
|
x as Button,
|
|
24
25
|
f as Checkbox,
|
|
25
26
|
l as ColorPicker,
|
|
26
|
-
|
|
27
|
+
c as Dialog,
|
|
27
28
|
S as Divider,
|
|
28
29
|
g as Dropdown,
|
|
29
30
|
B as Flex,
|
|
@@ -31,12 +32,13 @@ export {
|
|
|
31
32
|
h as Grid,
|
|
32
33
|
w as Label,
|
|
33
34
|
L as LoadingBar,
|
|
34
|
-
v as
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
E as
|
|
40
|
-
J as
|
|
35
|
+
v as ScrollArea,
|
|
36
|
+
A as Section,
|
|
37
|
+
I as SegmentedControl,
|
|
38
|
+
j as Select,
|
|
39
|
+
s as Slider,
|
|
40
|
+
E as Switch,
|
|
41
|
+
J as TextInput,
|
|
42
|
+
M as Tooltip
|
|
41
43
|
};
|
|
42
44
|
//# sourceMappingURL=fondue-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { propsToCssVariables as a } from "./fondue-
|
|
3
|
-
import i from "./fondue-
|
|
2
|
+
import { propsToCssVariables as a } from "./fondue-components23.js";
|
|
3
|
+
import i from "./fondue-components40.js";
|
|
4
4
|
const l = ({
|
|
5
5
|
as: t = "div",
|
|
6
6
|
"data-test-id": s = "fondue-flex",
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { IconCross as
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { usePreventDropdownOverflow as w } from "./fondue-
|
|
6
|
-
import { syncRefs as
|
|
7
|
-
import d from "./fondue-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
1
|
+
import { jsx as a, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as C } from "@frontify/fondue-icons";
|
|
3
|
+
import * as r from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as s, useRef as x } from "react";
|
|
5
|
+
import { usePreventDropdownOverflow as w } from "./fondue-components38.js";
|
|
6
|
+
import { addAutoFocusAttribute as b, syncRefs as n, addShowFocusRing as A } from "./fondue-components35.js";
|
|
7
|
+
import d from "./fondue-components41.js";
|
|
8
|
+
const c = ({ children: t, ...o }) => /* @__PURE__ */ a(r.Root, { ...o, children: t });
|
|
9
|
+
c.displayName = "Flyout.Root";
|
|
10
|
+
const y = ({ children: t, "data-test-id": o = "fondue-flyout-trigger" }, e) => /* @__PURE__ */ a(
|
|
11
|
+
r.Trigger,
|
|
12
|
+
{
|
|
13
|
+
onMouseDown: b,
|
|
14
|
+
"data-auto-focus-visible": "true",
|
|
15
|
+
"data-auto-focus-trigger": !0,
|
|
16
|
+
"data-test-id": o,
|
|
17
|
+
asChild: !0,
|
|
18
|
+
ref: e,
|
|
19
|
+
children: t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
y.displayName = "Flyout.Trigger";
|
|
12
23
|
const f = ({
|
|
13
24
|
align: t = "start",
|
|
14
25
|
maxWidth: o = "360px",
|
|
@@ -17,58 +28,59 @@ const f = ({
|
|
|
17
28
|
children: g,
|
|
18
29
|
rounded: N,
|
|
19
30
|
...R
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */ a(
|
|
23
|
-
|
|
31
|
+
}, l) => {
|
|
32
|
+
const u = x(null), { setMaxHeight: h } = w(u);
|
|
33
|
+
return /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
|
|
34
|
+
r.Content,
|
|
24
35
|
{
|
|
25
36
|
style: {
|
|
26
37
|
"--flyout-max-width": o
|
|
27
38
|
},
|
|
28
|
-
ref:
|
|
39
|
+
ref: u,
|
|
29
40
|
align: t,
|
|
30
41
|
collisionPadding: 8,
|
|
31
42
|
sideOffset: 8,
|
|
32
43
|
onOpenAutoFocus: () => {
|
|
33
|
-
h(), u
|
|
44
|
+
h(), n(u, l);
|
|
34
45
|
},
|
|
35
46
|
onCloseAutoFocus: () => {
|
|
36
|
-
u
|
|
47
|
+
n(u, l);
|
|
37
48
|
},
|
|
38
49
|
className: d.root,
|
|
39
50
|
"data-flyout-spacing": e,
|
|
40
51
|
"data-rounded": N,
|
|
41
52
|
"data-test-id": i,
|
|
53
|
+
onFocus: A,
|
|
42
54
|
...R,
|
|
43
55
|
children: g
|
|
44
56
|
}
|
|
45
57
|
) });
|
|
46
58
|
};
|
|
47
59
|
f.displayName = "Flyout.Content";
|
|
48
|
-
const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, i) => /* @__PURE__ */
|
|
60
|
+
const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, i) => /* @__PURE__ */ v("div", { "data-test-id": e, ref: i, className: d.header, children: [
|
|
49
61
|
/* @__PURE__ */ a("div", { children: o }),
|
|
50
|
-
t && /* @__PURE__ */ a(
|
|
62
|
+
t && /* @__PURE__ */ a(r.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(C, { size: 20 }) })
|
|
51
63
|
] });
|
|
52
64
|
m.displayName = "Flyout.Header";
|
|
53
65
|
const p = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
|
|
54
66
|
p.displayName = "Flyout.Footer";
|
|
55
67
|
const F = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: d.body, children: t });
|
|
56
68
|
F.displayName = "Flyout.Body";
|
|
57
|
-
const
|
|
58
|
-
Root:
|
|
59
|
-
Trigger:
|
|
60
|
-
Content:
|
|
61
|
-
Header:
|
|
62
|
-
Footer:
|
|
63
|
-
Body:
|
|
69
|
+
const D = {
|
|
70
|
+
Root: c,
|
|
71
|
+
Trigger: s(y),
|
|
72
|
+
Content: s(f),
|
|
73
|
+
Header: s(m),
|
|
74
|
+
Footer: s(p),
|
|
75
|
+
Body: s(F)
|
|
64
76
|
};
|
|
65
77
|
export {
|
|
66
|
-
|
|
78
|
+
D as Flyout,
|
|
67
79
|
F as FlyoutBody,
|
|
68
80
|
f as FlyoutContent,
|
|
69
81
|
p as FlyoutFooter,
|
|
70
82
|
m as FlyoutHeader,
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
c as FlyoutRoot,
|
|
84
|
+
y as FlyoutTrigger
|
|
73
85
|
};
|
|
74
86
|
//# sourceMappingURL=fondue-components11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, useRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport const FlyoutTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-trigger' }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger
|
|
1
|
+
{"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, useRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { addAutoFocusAttribute, addShowFocusRing, syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutTriggerProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport const FlyoutTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-trigger' }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild\n ref={ref}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n rounded,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n } as CSSProperties\n }\n ref={localRef}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n onOpenAutoFocus={() => {\n setMaxHeight();\n syncRefs(localRef, ref);\n }}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n }}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className={styles.close}>\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body' }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} data-flyout-spacing=\"compact\" className={styles.body}>\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","dataTestId","ref","jsx","addAutoFocusAttribute","FlyoutContent","align","maxWidth","padding","rounded","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","syncRefs","styles","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA2EO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAEZ,MAAAI,IAAgB,CACzB,EAAE,UAAAH,GAAU,gBAAgBI,IAAa,2BACzCC,MAGI,gBAAAC;AAAA,EAACJ,EAAa;AAAA,EAAb;AAAA,IACG,aAAaK;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAO;AAAA,IACP,KAAAC;AAAA,IAEC,UAAAL;AAAA,EAAA;AAAA;AAIbG,EAAc,cAAc;AAErB,MAAMK,IAAgB,CACzB;AAAA,EACI,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,SAAAC,IAAU;AAAA,EACV,gBAAgBP,IAAa;AAAA,EAC7B,UAAAJ;AAAA,EACA,SAAAY;AAAA,EACA,GAAGX;AACP,GACAI,MACC;AACK,QAAAQ,IAAWC,EAAO,IAAI,GAEtB,EAAE,cAAAC,EAAA,IAAiBC,EAA2BH,CAAQ;AAGxD,SAAA,gBAAAP,EAACJ,EAAa,QAAb,EACG,UAAA,gBAAAI;AAAA,IAACJ,EAAa;AAAA,IAAb;AAAA,MACG,OACI;AAAA,QACI,sBAAsBQ;AAAA,MAC1B;AAAA,MAEJ,KAAKG;AAAA,MACL,OAAAJ;AAAA,MACA,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,iBAAiB,MAAM;AACN,QAAAM,KACbE,EAASJ,GAAUR,CAAG;AAAA,MAC1B;AAAA,MACA,kBAAkB,MAAM;AACpB,QAAAY,EAASJ,GAAUR,CAAG;AAAA,MAC1B;AAAA,MACA,WAAWa,EAAO;AAAA,MAClB,uBAAqBP;AAAA,MACrB,gBAAcC;AAAA,MACd,gBAAcR;AAAA,MACd,SAASe;AAAA,MACR,GAAGlB;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAET,EAAA,CAAA;AAER;AACAQ,EAAc,cAAc;AAEf,MAAAY,IAAe,CACxB,EAAE,iBAAAC,GAAiB,UAAArB,GAAU,gBAAgBI,IAAa,uBAAuB,GACjFC,wBAGK,OAAI,EAAA,gBAAcD,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACvD,UAAA;AAAA,EAAA,gBAAAZ,EAAC,SAAK,UAAAN,GAAS;AAAA,EACdqB,KACI,gBAAAf,EAAAJ,EAAa,OAAb,EAAmB,MAAK,UAAS,gBAAc,GAAGE,CAAU,UAAU,WAAWc,EAAO,OACrF,4BAACI,GAAU,EAAA,MAAM,GAAI,CAAA,GACzB;AAER,EAAA,CAAA;AAGRF,EAAa,cAAc;AAEd,MAAAG,IAAe,CACxB,EAAE,UAAAvB,GAAU,gBAAgBI,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACtD,UAAAlB,EACL,CAAA;AAGRuB,EAAa,cAAc;AAEd,MAAAC,IAAa,CACtB,EAAE,UAAAxB,GAAU,gBAAgBI,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWa,EAAO,MACpF,UAAAlB,EACL,CAAA;AAGRwB,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAM1B;AAAA,EACN,SAAS2B,EAAkDvB,CAAa;AAAA,EACxE,SAASuB,EAA+ClB,CAAa;AAAA,EACrE,QAAQkB,EAA8CN,CAAY;AAAA,EAClE,QAAQM,EAA8CH,CAAY;AAAA,EAClE,MAAMG,EAA4CF,CAAU;AAChE;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { propsToCssVariables as a } from "./fondue-
|
|
3
|
-
import e from "./fondue-
|
|
2
|
+
import { propsToCssVariables as a } from "./fondue-components23.js";
|
|
3
|
+
import e from "./fondue-components42.js";
|
|
4
4
|
const d = ({
|
|
5
5
|
as: s = "div",
|
|
6
6
|
"data-test-id": t = "fondue-grid",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "@radix-ui/react-label";
|
|
3
3
|
import { forwardRef as i } from "react";
|
|
4
|
-
import { cn as n } from "./fondue-
|
|
4
|
+
import { cn as n } from "./fondue-components25.js";
|
|
5
5
|
const s = ({ className: e, "data-test-id": a = "fondue-label", ...t }, r) => /* @__PURE__ */ o(
|
|
6
6
|
d.Root,
|
|
7
7
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "@radix-ui/react-progress";
|
|
3
3
|
import { forwardRef as m } from "react";
|
|
4
|
-
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components43.js";
|
|
5
5
|
const p = m(
|
|
6
6
|
({
|
|
7
7
|
value: a,
|
|
@@ -1,9 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-scroll-area";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import l from "./fondue-components44.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
type: t,
|
|
7
|
+
maxHeight: e = "100%",
|
|
8
|
+
maxWidth: s = "100%",
|
|
9
|
+
children: c,
|
|
10
|
+
"data-test-id": r = "fondue-scroll-area"
|
|
11
|
+
}, i) => /* @__PURE__ */ m(
|
|
12
|
+
o.Root,
|
|
13
|
+
{
|
|
14
|
+
type: t,
|
|
15
|
+
className: l.root,
|
|
16
|
+
style: { maxWidth: s },
|
|
17
|
+
"data-test-id": r,
|
|
18
|
+
ref: i,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ a(
|
|
21
|
+
o.Viewport,
|
|
22
|
+
{
|
|
23
|
+
className: l.viewport,
|
|
24
|
+
style: { maxHeight: e },
|
|
25
|
+
"data-test-id": `${r}-viewport`,
|
|
26
|
+
children: c
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
|
+
o.Scrollbar,
|
|
31
|
+
{
|
|
32
|
+
className: l.scrollbar,
|
|
33
|
+
orientation: "vertical",
|
|
34
|
+
"data-test-id": `${r}-vertical-scrollbar`,
|
|
35
|
+
children: /* @__PURE__ */ a(
|
|
36
|
+
o.Thumb,
|
|
37
|
+
{
|
|
38
|
+
className: l.thumb,
|
|
39
|
+
"data-test-id": `${r}-vertical-scrollbar-thumb`
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ a(
|
|
45
|
+
o.Scrollbar,
|
|
46
|
+
{
|
|
47
|
+
className: l.scrollbar,
|
|
48
|
+
orientation: "horizontal",
|
|
49
|
+
"data-test-id": `${r}-horizontal-scrollbar`,
|
|
50
|
+
children: /* @__PURE__ */ a(
|
|
51
|
+
o.Thumb,
|
|
52
|
+
{
|
|
53
|
+
className: l.thumb,
|
|
54
|
+
"data-test-id": `${r}-horizontal-scrollbar-thumb`
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ a(o.Corner, { className: l.corner, "data-test-id": `${r}-corner` })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
), h = n(b);
|
|
63
|
+
h.displayName = "ScrollArea";
|
|
6
64
|
export {
|
|
7
|
-
|
|
65
|
+
h as ScrollArea
|
|
8
66
|
};
|
|
9
67
|
//# sourceMappingURL=fondue-components15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components15.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components15.js","sources":["../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixScrollArea from '@radix-ui/react-scroll-area';\nimport { type ForwardedRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport styles from './styles/scrollArea.module.scss';\n\nexport type ScrollAreaProps = {\n /**\n * \"auto\" visible when content is overflowing on the corresponding orientation.\n * \"always\" always visible regardless of whether the content is overflowing.\n * \"scroll\" visible when the user is scrolling along its corresponding orientation.\n * \"hover\" when the user is hovering over the scroll area.\n * @default 'hover'\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover';\n /**\n * Maximum height of the scroll area\n * @default '100%'\n */\n maxHeight?: string | number;\n /**\n * Minimum width of the scroll area\n * @default '100%'\n */\n maxWidth?: string | number;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nconst ScrollAreaComponent = (\n {\n type,\n maxHeight = '100%',\n maxWidth = '100%',\n children,\n 'data-test-id': dataTestId = 'fondue-scroll-area',\n }: ScrollAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement => {\n return (\n <RadixScrollArea.Root\n type={type}\n className={styles.root}\n style={{ maxWidth }}\n data-test-id={dataTestId}\n ref={ref}\n >\n <RadixScrollArea.Viewport\n className={styles.viewport}\n style={{ maxHeight }}\n data-test-id={`${dataTestId}-viewport`}\n >\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"vertical\"\n data-test-id={`${dataTestId}-vertical-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-vertical-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"horizontal\"\n data-test-id={`${dataTestId}-horizontal-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-horizontal-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Corner className={styles.corner} data-test-id={`${dataTestId}-corner`} />\n </RadixScrollArea.Root>\n );\n};\n\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(ScrollAreaComponent);\nScrollArea.displayName = 'ScrollArea';\n"],"names":["ScrollAreaComponent","type","maxHeight","maxWidth","children","dataTestId","ref","jsxs","RadixScrollArea","styles","jsx","ScrollArea","forwardRef"],"mappings":";;;;AA8BA,MAAMA,IAAsB,CACxB;AAAA,EACI,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,GACAC,MAGI,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACG,MAAAP;AAAA,IACA,WAAWQ,EAAO;AAAA,IAClB,OAAO,EAAE,UAAAN,EAAS;AAAA,IAClB,gBAAcE;AAAA,IACd,KAAAC;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,OAAO,EAAE,WAAAP,EAAU;AAAA,UACnB,gBAAc,GAAGG,CAAU;AAAA,UAE1B,UAAAD;AAAA,QAAA;AAAA,MACL;AAAA,MACA,gBAAAM;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAC/B;AAAA,QAAA;AAAA,MACJ;AAAA,MACA,gBAAAK;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAC/B;AAAA,QAAA;AAAA,MACJ;AAAA,MACA,gBAAAK,EAACF,EAAgB,QAAhB,EAAuB,WAAWC,EAAO,QAAQ,gBAAc,GAAGJ,CAAU,UAAW,CAAA;AAAA,IAAA;AAAA,EAAA;AAAA,GAKvFM,IAAaC,EAA4CZ,CAAmB;AACzFW,EAAW,cAAc;"}
|
|
@@ -1,50 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
|
|
7
|
-
const [g, C] = N({
|
|
8
|
-
prop: o,
|
|
9
|
-
defaultProp: s,
|
|
10
|
-
onChange: p
|
|
11
|
-
});
|
|
12
|
-
return /* @__PURE__ */ l(
|
|
13
|
-
i.Root,
|
|
14
|
-
{
|
|
15
|
-
ref: f,
|
|
16
|
-
...m,
|
|
17
|
-
className: e.root,
|
|
18
|
-
onValueChange: (r) => {
|
|
19
|
-
r && C(r);
|
|
20
|
-
},
|
|
21
|
-
value: g,
|
|
22
|
-
type: "single",
|
|
23
|
-
asChild: !1,
|
|
24
|
-
"aria-disabled": m.disabled,
|
|
25
|
-
children: [
|
|
26
|
-
a,
|
|
27
|
-
/* @__PURE__ */ t("div", { className: e.activeIndicator })
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
d.displayName = "SegmentedControl.Root";
|
|
33
|
-
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(i.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
34
|
-
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
35
|
-
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
36
|
-
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
37
|
-
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
38
|
-
] })
|
|
39
|
-
] });
|
|
40
|
-
c.displayName = "SegmentedControl.Item";
|
|
41
|
-
const I = {
|
|
42
|
-
Root: n(d),
|
|
43
|
-
Item: n(c)
|
|
44
|
-
};
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { propsToCssVariables as r } from "./fondue-components23.js";
|
|
3
|
+
import i from "./fondue-components45.js";
|
|
4
|
+
const a = ({ "data-test-id": t = "fondue-section", children: o, ...s }) => /* @__PURE__ */ e("section", { className: i.root, "data-test-id": t, style: r(s), children: o });
|
|
5
|
+
a.displayName = "Section";
|
|
45
6
|
export {
|
|
46
|
-
|
|
47
|
-
c as SegmentedControlItem,
|
|
48
|
-
d as SegmentedControlRoot
|
|
7
|
+
a as Section
|
|
49
8
|
};
|
|
50
9
|
//# sourceMappingURL=fondue-components16.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components16.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components16.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/section.module.scss';\n\nexport type SectionProps = LayoutComponentProps & {\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Section = ({ 'data-test-id': dataTestId = 'fondue-section', children, ...props }: SectionProps) => {\n return (\n <section className={styles.root} data-test-id={dataTestId} style={propsToCssVariables(props)}>\n {children}\n </section>\n );\n};\nSection.displayName = 'Section';\n"],"names":["Section","dataTestId","children","props","jsx","styles","propsToCssVariables"],"mappings":";;;AAqBa,MAAAA,IAAU,CAAC,EAAE,gBAAgBC,IAAa,kBAAkB,UAAAC,GAAU,GAAGC,QAE9E,gBAAAC,EAAC,WAAQ,EAAA,WAAWC,EAAO,MAAM,gBAAcJ,GAAY,OAAOK,EAAoBH,CAAK,GACtF,UAAAD,EACL,CAAA;AAGRF,EAAQ,cAAc;"}
|
|
@@ -1,58 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return /* @__PURE__ */ f(
|
|
15
|
-
e.Root,
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { useControllableState as N } from "./fondue-components46.js";
|
|
5
|
+
import e from "./fondue-components47.js";
|
|
6
|
+
const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
|
|
7
|
+
const [g, C] = N({
|
|
8
|
+
prop: o,
|
|
9
|
+
defaultProp: s,
|
|
10
|
+
onChange: p
|
|
11
|
+
});
|
|
12
|
+
return /* @__PURE__ */ l(
|
|
13
|
+
i.Root,
|
|
16
14
|
{
|
|
17
|
-
ref:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
ref: f,
|
|
16
|
+
...m,
|
|
17
|
+
className: e.root,
|
|
18
|
+
onValueChange: (r) => {
|
|
19
|
+
r && C(r);
|
|
20
|
+
},
|
|
21
|
+
value: g,
|
|
22
|
+
type: "single",
|
|
23
|
+
asChild: !1,
|
|
24
|
+
"aria-disabled": m.disabled,
|
|
25
25
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
onPointerDown: () => {
|
|
30
|
-
o.current && (o.current.dataset.showFocusRing = "false");
|
|
31
|
-
},
|
|
32
|
-
className: r.track,
|
|
33
|
-
children: /* @__PURE__ */ s(e.Range, { className: r.range })
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
(a || n).map((w, u) => /* @__PURE__ */ s(
|
|
37
|
-
e.Thumb,
|
|
38
|
-
{
|
|
39
|
-
ref: o,
|
|
40
|
-
className: r.thumb,
|
|
41
|
-
onPointerDown: (t) => {
|
|
42
|
-
t.currentTarget.dataset.showFocusRing = "false";
|
|
43
|
-
},
|
|
44
|
-
onBlur: (t) => {
|
|
45
|
-
t.currentTarget.dataset.showFocusRing = "true";
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
u
|
|
49
|
-
))
|
|
26
|
+
a,
|
|
27
|
+
/* @__PURE__ */ t("div", { className: e.activeIndicator })
|
|
50
28
|
]
|
|
51
29
|
}
|
|
52
30
|
);
|
|
53
|
-
}
|
|
54
|
-
|
|
31
|
+
};
|
|
32
|
+
d.displayName = "SegmentedControl.Root";
|
|
33
|
+
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(i.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
34
|
+
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
35
|
+
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
36
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
c.displayName = "SegmentedControl.Item";
|
|
41
|
+
const I = {
|
|
42
|
+
Root: n(d),
|
|
43
|
+
Item: n(c)
|
|
44
|
+
};
|
|
55
45
|
export {
|
|
56
|
-
|
|
46
|
+
I as SegmentedControl,
|
|
47
|
+
c as SegmentedControlItem,
|
|
48
|
+
d as SegmentedControlRoot
|
|
57
49
|
};
|
|
58
50
|
//# sourceMappingURL=fondue-components17.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components17.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components17.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport styles from './styles/segmentedControl.module.scss';\n\nexport type SegmentedControlRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: string;\n /**\n * The controlled value of the segmented control\n */\n value?: string;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const SegmentedControlRoot = (\n { children, value: propsValue, defaultValue, onValueChange, ...rootProps }: SegmentedControlRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={styles.root}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={styles.activeIndicator} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={styles.item} asChild={false}>\n {/* Separator */}\n <span className={styles.separator} />\n <span className={styles.itemLabel}>\n {/* Active children */}\n <span className={styles.itemLabelActive}>{children}</span>\n\n {/* Inactive children */}\n <span className={styles.itemLabelInactive}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","SegmentedControl","forwardRef"],"mappings":";;;;;AAgCa,MAAAA,IAAuB,CAChC,EAAE,UAAAC,GAAU,OAAOC,GAAY,cAAAC,GAAc,eAAAC,GAAe,GAAGC,EAAU,GACzEC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMP;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAGG,SAAA,gBAAAM;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACG,KAAAL;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWO,EAAO;AAAA,MAClB,eAAe,CAACL,MAAU;AACtB,QAAIA,KACAC,EAASD,CAAK;AAAA,MAEtB;AAAA,MACA,OAAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACT,iBAAeF,EAAU;AAAA,MAExB,UAAA;AAAA,QAAAJ;AAAA,QAEA,gBAAAY,EAAA,OAAA,EAAI,WAAWD,EAAO,gBAAiB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;AACAZ,EAAqB,cAAc;AAO5B,MAAMc,IAAuB,CAChC,EAAE,UAAAb,GAAU,GAAGc,EAAA,GACfT,MAEA,gBAAAI,EAACC,EAAqB,MAArB,EAA0B,KAAAL,GAAW,GAAGS,GAAW,WAAWH,EAAO,MAAM,SAAS,IAEjF,UAAA;AAAA,EAAC,gBAAAC,EAAA,QAAA,EAAK,WAAWD,EAAO,UAAW,CAAA;AAAA,EAClC,gBAAAF,EAAA,QAAA,EAAK,WAAWE,EAAO,WAEpB,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAK,EAAA,WAAWD,EAAO,iBAAkB,UAAAX,GAAS;AAAA,IAGlD,gBAAAY,EAAA,QAAA,EAAK,WAAWD,EAAO,mBAAoB,UAAAX,GAAS;AAAA,EAAA,GACzD;AAAA,GACJ;AAEJa,EAAqB,cAAc;AAE5B,MAAME,IAAmB;AAAA,EAC5B,MAAMC,EAAsDjB,CAAoB;AAAA,EAChF,MAAMiB,EAAyDH,CAAoB;AACvF;"}
|