@frontify/fondue-components 3.3.6 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components.js +32 -30
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +2 -2
- package/dist/fondue-components11.js +31 -31
- 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 +1 -1
- package/dist/fondue-components16.js +2 -2
- package/dist/fondue-components17.js +2 -2
- package/dist/fondue-components18.js +39 -37
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components20.js +2 -2
- package/dist/fondue-components21.js +116 -65
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +64 -41
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +43 -32
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +32 -5
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +5 -12
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +10 -153
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +59 -22
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +17 -17
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +112 -15
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +2 -2
- package/dist/fondue-components30.js +19 -30
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +32 -28
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +23 -125
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +129 -20
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +21 -45
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +45 -28
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +28 -15
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +15 -60
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +60 -15
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +15 -17
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +4 -4
- package/dist/fondue-components40.js +18 -4
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +3 -11
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +11 -3
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +5 -35
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +35 -13
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +12 -4
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +4 -24
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +24 -16
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +16 -137
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +140 -16
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +16 -62
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +72 -8
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +8 -29
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +32 -48
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +48 -10
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +8 -10
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +12 -17
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +52 -6
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +13 -9
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +18 -2
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +5 -5
- package/dist/fondue-components60.js +6 -38
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +5 -0
- package/dist/fondue-components61.js.map +1 -0
- package/dist/fondue-components62.js +42 -0
- package/dist/fondue-components62.js.map +1 -0
- package/dist/fondue-components63.js +14 -0
- package/dist/fondue-components63.js.map +1 -0
- package/dist/fondue-components7.js +93 -68
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +2 -2
- package/dist/fondue-components9.js +65 -62
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +96 -1
- package/dist/style.css +1 -1
- package/package.json +4 -3
|
@@ -3,42 +3,44 @@ 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
|
|
7
|
-
import { Divider as
|
|
8
|
-
import { Dropdown as
|
|
9
|
-
import { Flex as
|
|
10
|
-
import { Flyout as
|
|
11
|
-
import { Grid as
|
|
12
|
-
import { Label as
|
|
13
|
-
import { LoadingBar as
|
|
14
|
-
import { ScrollArea as
|
|
15
|
-
import { Section as
|
|
16
|
-
import { SegmentedControl as
|
|
17
|
-
import { Select as
|
|
18
|
-
import { Slider as
|
|
6
|
+
import { Dialog as a } from "./fondue-components7.js";
|
|
7
|
+
import { Divider as d } from "./fondue-components8.js";
|
|
8
|
+
import { Dropdown as b } from "./fondue-components9.js";
|
|
9
|
+
import { Flex as u } from "./fondue-components10.js";
|
|
10
|
+
import { Flyout as C } from "./fondue-components11.js";
|
|
11
|
+
import { Grid as T } from "./fondue-components12.js";
|
|
12
|
+
import { Label as k } from "./fondue-components13.js";
|
|
13
|
+
import { LoadingBar as F } from "./fondue-components14.js";
|
|
14
|
+
import { ScrollArea as s } from "./fondue-components15.js";
|
|
15
|
+
import { Section as y } from "./fondue-components16.js";
|
|
16
|
+
import { SegmentedControl as G } from "./fondue-components17.js";
|
|
17
|
+
import { Select as P } from "./fondue-components18.js";
|
|
18
|
+
import { Slider as q } from "./fondue-components19.js";
|
|
19
19
|
import { Switch as E } from "./fondue-components20.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { Tabs as J } from "./fondue-components21.js";
|
|
21
|
+
import { TextInput as M } from "./fondue-components22.js";
|
|
22
|
+
import { Tooltip as O } from "./fondue-components23.js";
|
|
22
23
|
export {
|
|
23
24
|
t as Box,
|
|
24
25
|
x as Button,
|
|
25
26
|
f as Checkbox,
|
|
26
27
|
l as ColorPicker,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
a as Dialog,
|
|
29
|
+
d as Divider,
|
|
30
|
+
b as Dropdown,
|
|
31
|
+
u as Flex,
|
|
32
|
+
C as Flyout,
|
|
33
|
+
T as Grid,
|
|
34
|
+
k as Label,
|
|
35
|
+
F as LoadingBar,
|
|
36
|
+
s as ScrollArea,
|
|
37
|
+
y as Section,
|
|
38
|
+
G as SegmentedControl,
|
|
39
|
+
P as Select,
|
|
40
|
+
q as Slider,
|
|
40
41
|
E as Switch,
|
|
41
|
-
J as
|
|
42
|
-
M as
|
|
42
|
+
J as Tabs,
|
|
43
|
+
M as TextInput,
|
|
44
|
+
O as Tooltip
|
|
43
45
|
};
|
|
44
46
|
//# 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-components24.js";
|
|
3
|
+
import i from "./fondue-components41.js";
|
|
4
4
|
const l = ({
|
|
5
5
|
as: t = "div",
|
|
6
6
|
"data-test-id": s = "fondue-flex",
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as a, jsxs as v } from "react/jsx-runtime";
|
|
2
|
-
import { IconCross as
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { usePreventDropdownOverflow as w } from "./fondue-
|
|
6
|
-
import { addAutoFocusAttribute as b, syncRefs as n, addShowFocusRing as A } from "./fondue-
|
|
7
|
-
import
|
|
8
|
-
const c = ({ children: t, ...o }) => /* @__PURE__ */ a(
|
|
2
|
+
import { IconCross as x } from "@frontify/fondue-icons";
|
|
3
|
+
import * as d from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as r, useRef as C } from "react";
|
|
5
|
+
import { usePreventDropdownOverflow as w } from "./fondue-components39.js";
|
|
6
|
+
import { addAutoFocusAttribute as b, syncRefs as n, addShowFocusRing as A } from "./fondue-components36.js";
|
|
7
|
+
import u from "./fondue-components42.js";
|
|
8
|
+
const c = ({ children: t, ...o }) => /* @__PURE__ */ a(d.Root, { ...o, children: t });
|
|
9
9
|
c.displayName = "Flyout.Root";
|
|
10
|
-
const y = ({
|
|
11
|
-
|
|
10
|
+
const y = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger" }, s) => /* @__PURE__ */ a(
|
|
11
|
+
d.Trigger,
|
|
12
12
|
{
|
|
13
13
|
onMouseDown: b,
|
|
14
14
|
"data-auto-focus-visible": "true",
|
|
15
15
|
"data-auto-focus-trigger": !0,
|
|
16
|
-
"data-test-id":
|
|
17
|
-
asChild:
|
|
18
|
-
ref:
|
|
19
|
-
children:
|
|
16
|
+
"data-test-id": e,
|
|
17
|
+
asChild: t,
|
|
18
|
+
ref: s,
|
|
19
|
+
children: o
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
y.displayName = "Flyout.Trigger";
|
|
@@ -24,32 +24,32 @@ const f = ({
|
|
|
24
24
|
align: t = "start",
|
|
25
25
|
maxWidth: o = "360px",
|
|
26
26
|
padding: e = "compact",
|
|
27
|
-
"data-test-id":
|
|
27
|
+
"data-test-id": s = "fondue-flyout-content",
|
|
28
28
|
children: g,
|
|
29
29
|
rounded: N,
|
|
30
30
|
...R
|
|
31
31
|
}, l) => {
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */ a(
|
|
34
|
-
|
|
32
|
+
const i = C(null), { setMaxHeight: h } = w(i);
|
|
33
|
+
return /* @__PURE__ */ a(d.Portal, { children: /* @__PURE__ */ a(
|
|
34
|
+
d.Content,
|
|
35
35
|
{
|
|
36
36
|
style: {
|
|
37
37
|
"--flyout-max-width": o
|
|
38
38
|
},
|
|
39
|
-
ref:
|
|
39
|
+
ref: i,
|
|
40
40
|
align: t,
|
|
41
41
|
collisionPadding: 8,
|
|
42
42
|
sideOffset: 8,
|
|
43
43
|
onOpenAutoFocus: () => {
|
|
44
|
-
h(), n(
|
|
44
|
+
h(), n(i, l);
|
|
45
45
|
},
|
|
46
46
|
onCloseAutoFocus: () => {
|
|
47
|
-
n(
|
|
47
|
+
n(i, l);
|
|
48
48
|
},
|
|
49
|
-
className:
|
|
49
|
+
className: u.root,
|
|
50
50
|
"data-flyout-spacing": e,
|
|
51
51
|
"data-rounded": N,
|
|
52
|
-
"data-test-id":
|
|
52
|
+
"data-test-id": s,
|
|
53
53
|
onFocus: A,
|
|
54
54
|
...R,
|
|
55
55
|
children: g
|
|
@@ -57,22 +57,22 @@ const f = ({
|
|
|
57
57
|
) });
|
|
58
58
|
};
|
|
59
59
|
f.displayName = "Flyout.Content";
|
|
60
|
-
const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" },
|
|
60
|
+
const m = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, s) => /* @__PURE__ */ v("div", { "data-test-id": e, ref: s, className: u.header, children: [
|
|
61
61
|
/* @__PURE__ */ a("div", { children: o }),
|
|
62
|
-
t && /* @__PURE__ */ a(
|
|
62
|
+
t && /* @__PURE__ */ a(d.Close, { role: "button", "data-test-id": `${e}-close`, className: u.close, children: /* @__PURE__ */ a(x, { size: 20 }) })
|
|
63
63
|
] });
|
|
64
64
|
m.displayName = "Flyout.Header";
|
|
65
|
-
const p = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className:
|
|
65
|
+
const p = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: u.footer, children: t });
|
|
66
66
|
p.displayName = "Flyout.Footer";
|
|
67
|
-
const F = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className:
|
|
67
|
+
const F = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: u.body, children: t });
|
|
68
68
|
F.displayName = "Flyout.Body";
|
|
69
69
|
const D = {
|
|
70
70
|
Root: c,
|
|
71
|
-
Trigger:
|
|
72
|
-
Content:
|
|
73
|
-
Header:
|
|
74
|
-
Footer:
|
|
75
|
-
Body:
|
|
71
|
+
Trigger: r(y),
|
|
72
|
+
Content: r(f),
|
|
73
|
+
Header: r(m),
|
|
74
|
+
Footer: r(p),
|
|
75
|
+
Body: r(F)
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
78
|
D as Flyout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, useRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { addAutoFocusAttribute, addShowFocusRing, syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"fondue-components11.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, useRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { addAutoFocusAttribute, addShowFocusRing, syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger' }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\nexport type FlyoutContentProps = {\n /**\n * Add rounded corners to the flyout\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n rounded,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n style={\n {\n '--flyout-max-width': maxWidth,\n } as CSSProperties\n }\n ref={localRef}\n align={align}\n collisionPadding={8}\n sideOffset={8}\n onOpenAutoFocus={() => {\n setMaxHeight();\n syncRefs(localRef, ref);\n }}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n }}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header' }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close role=\"button\" data-test-id={`${dataTestId}-close`} className={styles.close}>\n <IconCross size={20} />\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body' }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} data-flyout-spacing=\"compact\" className={styles.body}>\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","FlyoutContent","align","maxWidth","padding","rounded","localRef","useRef","setMaxHeight","usePreventDropdownOverflow","syncRefs","styles","addShowFocusRing","FlyoutHeader","showCloseButton","IconCross","FlyoutFooter","FlyoutBody","Flyout","forwardRef"],"mappings":";;;;;;;AA6BO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAC9BC,EAAa,MAAb,EAAmB,GAAGD,GAAQ,UAAAD,EAAS,CAAA;AAEnDD,EAAW,cAAc;AAYZ,MAAAI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,wBAAwB,GACjFC,MAGI,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,IAEC,UAAAN;AAAA,EAAA;AAAA;AAIbG,EAAc,cAAc;AAg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RF,EAAa,cAAc;AAId,MAAAG,IAAe,CACxB,EAAE,UAAAxB,GAAU,gBAAgBK,IAAa,0BACzCC,MAGI,gBAAAC,EAAC,SAAI,gBAAcF,GAAY,KAAAC,GAAU,WAAWa,EAAO,QACtD,UAAAnB,EACL,CAAA;AAGRwB,EAAa,cAAc;AAId,MAAAC,IAAa,CACtB,EAAE,UAAAzB,GAAU,gBAAgBK,IAAa,wBACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,uBAAoB,WAAU,WAAWa,EAAO,MACpF,UAAAnB,EACL,CAAA;AAGRyB,EAAW,cAAc;AAElB,MAAMC,IAAS;AAAA,EAClB,MAAM3B;AAAA,EACN,SAAS4B,EAAkDxB,CAAa;AAAA,EACxE,SAASwB,EAA+ClB,CAAa;AAAA,EACrE,QAAQkB,EAA8CN,CAAY;AAAA,EAClE,QAAQM,EAA8CH,CAAY;AAAA,EAClE,MAAMG,EAA4CF,CAAU;AAChE;"}
|
|
@@ -1,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-components24.js";
|
|
3
|
+
import e from "./fondue-components43.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-components26.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-components44.js";
|
|
5
5
|
const p = m(
|
|
6
6
|
({
|
|
7
7
|
value: a,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "@radix-ui/react-scroll-area";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
|
-
import l from "./fondue-
|
|
4
|
+
import l from "./fondue-components45.js";
|
|
5
5
|
const b = ({
|
|
6
6
|
type: t,
|
|
7
7
|
maxHeight: e = "100%",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { propsToCssVariables as r } from "./fondue-
|
|
3
|
-
import i from "./fondue-
|
|
2
|
+
import { propsToCssVariables as r } from "./fondue-components24.js";
|
|
3
|
+
import i from "./fondue-components46.js";
|
|
4
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
5
|
a.displayName = "Section";
|
|
6
6
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "@radix-ui/react-toggle-group";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
|
-
import { useControllableState as N } from "./fondue-
|
|
5
|
-
import e from "./fondue-
|
|
4
|
+
import { useControllableState as N } from "./fondue-components47.js";
|
|
5
|
+
import e from "./fondue-components48.js";
|
|
6
6
|
const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
|
|
7
7
|
const [g, C] = N({
|
|
8
8
|
prop: o,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { IconCaretDown as
|
|
2
|
+
import { IconCaretDown as D, IconCheckMark as j, IconExclamationMarkTriangle as E } from "@frontify/fondue-icons";
|
|
3
3
|
import * as S from "@radix-ui/react-popover";
|
|
4
|
-
import { Slot as
|
|
5
|
-
import { useSelect as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { ForwardedRefCombobox as
|
|
8
|
-
import { ForwardedRefSelectItem as
|
|
9
|
-
import { SelectMenu as
|
|
10
|
-
import { ForwardedRefSelectSlot as
|
|
11
|
-
import a from "./fondue-
|
|
12
|
-
import { useSelectData as
|
|
4
|
+
import { Slot as H } from "@radix-ui/react-slot";
|
|
5
|
+
import { useSelect as T } from "downshift";
|
|
6
|
+
import { forwardRef as V, useRef as $, useState as A } from "react";
|
|
7
|
+
import { ForwardedRefCombobox as q } from "./fondue-components49.js";
|
|
8
|
+
import { ForwardedRefSelectItem as J, ForwardedRefSelectItemGroup as K } from "./fondue-components50.js";
|
|
9
|
+
import { SelectMenu as L } from "./fondue-components51.js";
|
|
10
|
+
import { ForwardedRefSelectSlot as Q } from "./fondue-components52.js";
|
|
11
|
+
import a from "./fondue-components53.js";
|
|
12
|
+
import { useSelectData as U } from "./fondue-components54.js";
|
|
13
13
|
const g = ({
|
|
14
14
|
children: h,
|
|
15
15
|
onSelect: i,
|
|
@@ -18,13 +18,14 @@ const g = ({
|
|
|
18
18
|
placeholder: b = "",
|
|
19
19
|
status: s = "neutral",
|
|
20
20
|
disabled: m,
|
|
21
|
-
|
|
21
|
+
alignMenu: C = "start",
|
|
22
|
+
"aria-label": w,
|
|
22
23
|
"data-test-id": l = "fondue-select"
|
|
23
24
|
}, d) => {
|
|
24
|
-
const { inputSlots:
|
|
25
|
-
items:
|
|
26
|
-
defaultSelectedItem:
|
|
27
|
-
selectedItem:
|
|
25
|
+
const { inputSlots: x, menuSlots: R, items: y, clearButton: u, getItemByValue: p } = U(h), F = p(N), k = p(I), c = $(!1), [v, f] = A(!1), { getToggleButtonProps: M, getMenuProps: P, getItemProps: B, reset: G, selectedItem: r, isOpen: O, highlightedIndex: z } = T({
|
|
26
|
+
items: y,
|
|
27
|
+
defaultSelectedItem: F,
|
|
28
|
+
selectedItem: k,
|
|
28
29
|
onIsOpenChange: () => {
|
|
29
30
|
f(!1);
|
|
30
31
|
},
|
|
@@ -36,7 +37,7 @@ const g = ({
|
|
|
36
37
|
},
|
|
37
38
|
itemToString: (e) => e ? e.label : ""
|
|
38
39
|
});
|
|
39
|
-
return /* @__PURE__ */ n(S.Root, { open:
|
|
40
|
+
return /* @__PURE__ */ n(S.Root, { open: O, children: [
|
|
40
41
|
/* @__PURE__ */ o(
|
|
41
42
|
S.Anchor,
|
|
42
43
|
{
|
|
@@ -58,27 +59,27 @@ const g = ({
|
|
|
58
59
|
"data-disabled": m,
|
|
59
60
|
"data-empty": !r,
|
|
60
61
|
"data-test-id": l,
|
|
61
|
-
...m ? {} :
|
|
62
|
-
"aria-label":
|
|
62
|
+
...m ? {} : M({
|
|
63
|
+
"aria-label": w,
|
|
63
64
|
...d ? { ref: d } : {}
|
|
64
65
|
}),
|
|
65
66
|
children: [
|
|
66
|
-
/* @__PURE__ */ o("span", { className: a.
|
|
67
|
-
|
|
67
|
+
/* @__PURE__ */ o("span", { className: a.selectedValue, children: r ? r.label : b }),
|
|
68
|
+
x,
|
|
68
69
|
u && /* @__PURE__ */ o(
|
|
69
|
-
|
|
70
|
+
H,
|
|
70
71
|
{
|
|
71
72
|
onClick: (e) => {
|
|
72
|
-
e.stopPropagation(),
|
|
73
|
+
e.stopPropagation(), G();
|
|
73
74
|
},
|
|
74
75
|
className: a.clear,
|
|
75
76
|
children: u
|
|
76
77
|
}
|
|
77
78
|
),
|
|
78
79
|
/* @__PURE__ */ n("div", { className: a.icons, children: [
|
|
79
|
-
/* @__PURE__ */ o(
|
|
80
|
+
/* @__PURE__ */ o(D, { size: 16, className: a.caret }),
|
|
80
81
|
s === "success" ? /* @__PURE__ */ o(
|
|
81
|
-
|
|
82
|
+
j,
|
|
82
83
|
{
|
|
83
84
|
size: 16,
|
|
84
85
|
className: a.iconSuccess,
|
|
@@ -86,7 +87,7 @@ const g = ({
|
|
|
86
87
|
}
|
|
87
88
|
) : null,
|
|
88
89
|
s === "error" ? /* @__PURE__ */ o(
|
|
89
|
-
|
|
90
|
+
E,
|
|
90
91
|
{
|
|
91
92
|
size: 16,
|
|
92
93
|
className: a.iconError,
|
|
@@ -100,31 +101,32 @@ const g = ({
|
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
103
|
/* @__PURE__ */ o(
|
|
103
|
-
|
|
104
|
+
L,
|
|
104
105
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
align: C,
|
|
107
|
+
highlightedIndex: z,
|
|
108
|
+
getMenuProps: P,
|
|
109
|
+
getItemProps: B,
|
|
108
110
|
selectedItem: r,
|
|
109
|
-
hasInteractedSinceOpening:
|
|
110
|
-
children:
|
|
111
|
+
hasInteractedSinceOpening: v,
|
|
112
|
+
children: R
|
|
111
113
|
}
|
|
112
114
|
)
|
|
113
115
|
] });
|
|
114
116
|
};
|
|
115
117
|
g.displayName = "Select";
|
|
116
|
-
const
|
|
118
|
+
const W = V(g), t = W;
|
|
117
119
|
t.displayName = "Select";
|
|
118
|
-
t.Combobox =
|
|
120
|
+
t.Combobox = q;
|
|
119
121
|
t.Combobox.displayName = "Select.Combobox";
|
|
120
|
-
t.Item =
|
|
122
|
+
t.Item = J;
|
|
121
123
|
t.Item.displayName = "Select.Item";
|
|
122
|
-
t.Group =
|
|
124
|
+
t.Group = K;
|
|
123
125
|
t.Group.displayName = "Select.Group";
|
|
124
|
-
t.Slot =
|
|
126
|
+
t.Slot = Q;
|
|
125
127
|
t.Slot.displayName = "Select.Slot";
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
W as ForwardedRefSelect,
|
|
128
130
|
t as Select,
|
|
129
131
|
g as SelectInput
|
|
130
132
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.input}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AAuDO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC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AAA,IAEA,gBAAA0B;AAAA,MAACU;AAAA,MAAA;AAAA,QACG,kBAAAf;AAAA,QACA,cAAAL;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAP;AAAA,QAEC,UAAAT;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAZ,EAAY,cAAc;AAEb,MAAA8C,IAAqBC,EAAiD/C,CAAW,GAGjFgD,IAKTF;AACJE,EAAO,cAAc;AACrBA,EAAO,WAAWC;AAClBD,EAAO,SAAS,cAAc;AAC9BA,EAAO,OAAOE;AACdF,EAAO,KAAK,cAAc;AAC1BA,EAAO,QAAQG;AACfH,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOI;AACdJ,EAAO,KAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components18.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n alignMenu = 'start',\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.selectedValue}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n align={alignMenu}\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","status","disabled","alignMenu","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AA4DO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,gBAAAC,EAAe,IAAIC,EAAchB,CAAQ,GAEtFiB,IAAcF,EAAeZ,CAAY,GACzCe,IAAaH,EAAeb,CAAK,GAEjCiB,IAAaC,EAAO,EAAK,GAEzB,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,EAAK,GAE1E,EAAE,sBAAAC,GAAsB,cAAAC,GAAc,cAAAC,GAAc,OAAAC,GAAO,cAAAC,GAAc,QAAAC,GAAQ,kBAAAC,EAAiB,IACpGC,EAAU;AAAA,IACN,OAAAlB;AAAA,IACA,qBAAqBI;AAAA,IACrB,cAAcC;AAAA,IACd,gBAAgB,MAAM;AAClB,MAAAI,EAA6B,EAAK;AAAA,IACtC;AAAA,IACA,0BAA0B,MAAM;AAC5B,MAAAA,EAA6B,EAAI;AAA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EH,gBAAAmB,EAAA,OAAA,EAAI,WAAWM,EAAO,OACnB,UAAA;AAAA,gBAAA,gBAAAJ,EAACO,GAAc,EAAA,MAAM,IAAI,WAAWH,EAAO,OAAO;AAAA,gBACjDlC,MAAW,YACR,gBAAA8B;AAAA,kBAACQ;AAAA,kBAAA;AAAA,oBACG,MAAM;AAAA,oBACN,WAAWJ,EAAO;AAAA,oBAClB,gBAAc,GAAG9B,CAAU;AAAA,kBAAA;AAAA,gBAAA,IAE/B;AAAA,gBACHJ,MAAW,UACR,gBAAA8B;AAAA,kBAACS;AAAA,kBAAA;AAAA,oBACG,MAAM;AAAA,oBACN,WAAWL,EAAO;AAAA,oBAClB,gBAAc,GAAG9B,CAAU;AAAA,kBAAA;AAAA,gBAAA,IAE/B;AAAA,cAAA,GACR;AAAA,YAAA;AAAA,UAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IACJ;AAAA,IAEA,gBAAA0B;AAAA,MAACU;AAAA,MAAA;AAAA,QACG,OAAOtC;AAAA,QACP,kBAAAuB;AAAA,QACA,cAAAL;AAAA,QACA,cAAAC;AAAA,QACA,cAAAE;AAAA,QACA,2BAAAP;AAAA,QAEC,UAAAT;AAAA,MAAA;AAAA,IACL;AAAA,EACJ,EAAA,CAAA;AAER;AACAb,EAAY,cAAc;AAEb,MAAA+C,IAAqBC,EAAiDhD,CAAW,GAGjFiD,IAKTF;AACJE,EAAO,cAAc;AACrBA,EAAO,WAAWC;AAClBD,EAAO,SAAS,cAAc;AAC9BA,EAAO,OAAOE;AACdF,EAAO,KAAK,cAAc;AAC1BA,EAAO,QAAQG;AACfH,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOI;AACdJ,EAAO,KAAK,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "@radix-ui/react-slider";
|
|
3
3
|
import { forwardRef as h, useRef as R } from "react";
|
|
4
|
-
import r from "./fondue-
|
|
4
|
+
import r from "./fondue-components55.js";
|
|
5
5
|
const g = ({
|
|
6
6
|
value: a,
|
|
7
7
|
defaultValue: n = [0],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "@radix-ui/react-switch";
|
|
3
3
|
import { forwardRef as l } from "react";
|
|
4
|
-
import { cn as f } from "./fondue-
|
|
5
|
-
import t from "./fondue-
|
|
4
|
+
import { cn as f } from "./fondue-components26.js";
|
|
5
|
+
import t from "./fondue-components56.js";
|
|
6
6
|
const n = ({
|
|
7
7
|
value: a,
|
|
8
8
|
defaultValue: i,
|