@frontify/fondue-components 17.1.0 → 18.0.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-components10.js +83 -73
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components12.js +9 -9
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components39.js +32 -22
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components48.js +12 -12
- package/dist/fondue-components50.js +11 -11
- package/dist/fondue-components61.js +1 -1
- package/dist/fondue-components64.js +1 -1
- package/dist/fondue-components71.js +1 -1
- package/dist/fondue-components77.js +16 -39
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +39 -16
- package/dist/fondue-components78.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,137 +1,147 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { IconCaretRight as
|
|
1
|
+
import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretRight as M } from "@frontify/fondue-icons";
|
|
3
3
|
import * as d from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { forwardRef as i, useMemo as
|
|
5
|
-
import { useFondueTheme as
|
|
6
|
-
import { useProcessedChildren as
|
|
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-components28.js";
|
|
6
|
+
import { useProcessedChildren as h } from "./fondue-components47.js";
|
|
7
7
|
import s from "./fondue-components48.js";
|
|
8
|
-
const
|
|
8
|
+
const N = ({
|
|
9
9
|
children: o,
|
|
10
10
|
open: t,
|
|
11
11
|
modal: e = !1,
|
|
12
12
|
onOpenChange: r,
|
|
13
13
|
"data-test-id": a = "fondue-dropdown"
|
|
14
14
|
}) => /* @__PURE__ */ n(d.Root, { open: t, modal: e, onOpenChange: r, "data-test-id": a, children: o });
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
N.displayName = "Dropdown.Root";
|
|
16
|
+
const S = ({
|
|
17
17
|
asChild: o = !0,
|
|
18
18
|
children: t,
|
|
19
19
|
"data-test-id": e = "fondue-dropdown-trigger",
|
|
20
20
|
...r
|
|
21
21
|
}, a) => /* @__PURE__ */ n(d.Trigger, { asChild: o, "data-test-id": e, ref: a, ...r, children: t });
|
|
22
|
-
|
|
23
|
-
const
|
|
22
|
+
S.displayName = "Dropdown.Trigger";
|
|
23
|
+
const x = {
|
|
24
24
|
compact: 8,
|
|
25
25
|
comfortable: 12,
|
|
26
26
|
spacious: 16
|
|
27
|
-
},
|
|
27
|
+
}, O = {
|
|
28
28
|
compact: 8,
|
|
29
29
|
spacious: 24
|
|
30
|
-
},
|
|
30
|
+
}, C = ({
|
|
31
31
|
side: o = "bottom",
|
|
32
32
|
align: t = "start",
|
|
33
33
|
triggerOffset: e = "compact",
|
|
34
34
|
children: r,
|
|
35
35
|
preventTriggerFocusOnClose: a,
|
|
36
|
-
viewportCollisionPadding:
|
|
37
|
-
"data-test-id":
|
|
38
|
-
},
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ n(d.Portal, { children: /* @__PURE__ */ n(
|
|
36
|
+
viewportCollisionPadding: u = "compact",
|
|
37
|
+
"data-test-id": p = "fondue-dropdown-content"
|
|
38
|
+
}, l) => {
|
|
39
|
+
const m = D();
|
|
40
|
+
return /* @__PURE__ */ n(d.Portal, { children: /* @__PURE__ */ n(b, { theme: m, children: /* @__PURE__ */ n(
|
|
41
41
|
d.Content,
|
|
42
42
|
{
|
|
43
43
|
align: t,
|
|
44
|
-
collisionPadding:
|
|
45
|
-
sideOffset:
|
|
44
|
+
collisionPadding: O[u],
|
|
45
|
+
sideOffset: x[e],
|
|
46
46
|
side: o,
|
|
47
47
|
className: s.content,
|
|
48
|
-
"data-test-id":
|
|
49
|
-
ref:
|
|
50
|
-
onCloseAutoFocus: (
|
|
51
|
-
a &&
|
|
48
|
+
"data-test-id": p,
|
|
49
|
+
ref: l,
|
|
50
|
+
onCloseAutoFocus: (w) => {
|
|
51
|
+
a && w.preventDefault();
|
|
52
52
|
},
|
|
53
53
|
children: r
|
|
54
54
|
}
|
|
55
55
|
) }) });
|
|
56
56
|
};
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
() =>
|
|
57
|
+
C.displayName = "Dropdown.Content";
|
|
58
|
+
const R = ({ children: o, heading: t, "data-test-id": e = "fondue-dropdown-group" }, r) => G(
|
|
59
|
+
() => A.toArray(o).filter((u) => u !== null).length > 0,
|
|
60
60
|
[o]
|
|
61
|
-
) ? /* @__PURE__ */
|
|
61
|
+
) ? /* @__PURE__ */ g(d.Group, { className: s.group, "data-test-id": e, ref: r, children: [
|
|
62
62
|
t ? /* @__PURE__ */ n("div", { className: s.groupHeading, children: /* @__PURE__ */ n("span", { "aria-label": t, children: t }) }) : null,
|
|
63
63
|
o
|
|
64
64
|
] }) : null;
|
|
65
|
-
|
|
66
|
-
const
|
|
65
|
+
R.displayName = "Dropdown.Group";
|
|
66
|
+
const T = ({
|
|
67
67
|
children: o,
|
|
68
68
|
"data-test-id": t = "fondue-dropdown-submenu"
|
|
69
69
|
}) => /* @__PURE__ */ n(d.Sub, { "data-test-id": t, children: o });
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
const { content: r } =
|
|
73
|
-
return /* @__PURE__ */
|
|
70
|
+
T.displayName = "Dropdown.SubMenu";
|
|
71
|
+
const I = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, e) => {
|
|
72
|
+
const { content: r } = h(o);
|
|
73
|
+
return /* @__PURE__ */ g(d.SubTrigger, { className: s.subTrigger, "data-test-id": t, ref: e, children: [
|
|
74
74
|
r,
|
|
75
|
-
/* @__PURE__ */ n(
|
|
75
|
+
/* @__PURE__ */ n(M, { className: s.subMenuIndicator, size: 16 })
|
|
76
76
|
] });
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
const r =
|
|
81
|
-
return /* @__PURE__ */ n(d.Portal, { children: /* @__PURE__ */ n(
|
|
78
|
+
I.displayName = "Dropdown.SubTrigger";
|
|
79
|
+
const F = ({ children: o, "data-test-id": t = "fondue-dropdown-subcontent" }, e) => {
|
|
80
|
+
const r = D();
|
|
81
|
+
return /* @__PURE__ */ n(d.Portal, { children: /* @__PURE__ */ n(b, { theme: r, children: /* @__PURE__ */ n(d.SubContent, { className: s.subContent, "data-test-id": t, ref: e, children: o }) }) });
|
|
82
82
|
};
|
|
83
|
-
|
|
84
|
-
const
|
|
83
|
+
F.displayName = "Dropdown.SubContent";
|
|
84
|
+
const y = ({
|
|
85
85
|
children: o,
|
|
86
86
|
disabled: t,
|
|
87
87
|
textValue: e,
|
|
88
88
|
onSelect: r,
|
|
89
89
|
emphasis: a = "default",
|
|
90
|
-
asChild:
|
|
91
|
-
"data-test-id":
|
|
92
|
-
...
|
|
93
|
-
},
|
|
94
|
-
const { content:
|
|
90
|
+
asChild: u = !1,
|
|
91
|
+
"data-test-id": p = "fondue-dropdown-subtrigger",
|
|
92
|
+
...l
|
|
93
|
+
}, m) => {
|
|
94
|
+
const { content: w } = h(o), c = v(!1);
|
|
95
95
|
return /* @__PURE__ */ n(
|
|
96
96
|
d.Item,
|
|
97
97
|
{
|
|
98
98
|
onSelect: r,
|
|
99
99
|
className: s.item,
|
|
100
100
|
textValue: e,
|
|
101
|
-
"data-test-id":
|
|
101
|
+
"data-test-id": p,
|
|
102
102
|
"data-emphasis": a,
|
|
103
|
-
ref:
|
|
103
|
+
ref: m,
|
|
104
104
|
disabled: t,
|
|
105
|
-
asChild:
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
asChild: u,
|
|
106
|
+
"data-show-focus-ring": c.current,
|
|
107
|
+
onMouseEnter: () => {
|
|
108
|
+
c.current = !0;
|
|
109
|
+
},
|
|
110
|
+
onFocus: (f) => {
|
|
111
|
+
c.current || (f.target.dataset.showFocusRing = "true");
|
|
112
|
+
},
|
|
113
|
+
onBlur: (f) => {
|
|
114
|
+
f.target.dataset.showFocusRing = "false", c.current = !1;
|
|
115
|
+
},
|
|
116
|
+
...l,
|
|
117
|
+
children: w
|
|
108
118
|
}
|
|
109
119
|
);
|
|
110
120
|
};
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
Root:
|
|
116
|
-
Trigger:
|
|
117
|
-
Content:
|
|
118
|
-
Group:
|
|
119
|
-
SubMenu:
|
|
120
|
-
SubTrigger:
|
|
121
|
-
SubContent:
|
|
122
|
-
Item:
|
|
123
|
-
Slot:
|
|
121
|
+
y.displayName = "Dropdown.Item";
|
|
122
|
+
const P = ({ children: o, name: t, "data-test-id": e = "fondue-dropdown-slot" }, r) => /* @__PURE__ */ n("div", { "data-name": t, className: s.slot, "data-test-id": e, ref: r, children: o });
|
|
123
|
+
P.displayName = "Dropdown.Slot";
|
|
124
|
+
const _ = i(S), j = i(C), E = i(R), L = i(I), z = i(F), B = i(y), H = i(P), Q = {
|
|
125
|
+
Root: N,
|
|
126
|
+
Trigger: _,
|
|
127
|
+
Content: j,
|
|
128
|
+
Group: E,
|
|
129
|
+
SubMenu: T,
|
|
130
|
+
SubTrigger: L,
|
|
131
|
+
SubContent: z,
|
|
132
|
+
Item: B,
|
|
133
|
+
Slot: H
|
|
124
134
|
};
|
|
125
135
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
Q as Dropdown,
|
|
137
|
+
C as DropdownContent,
|
|
138
|
+
R as DropdownGroup,
|
|
139
|
+
y as DropdownItem,
|
|
140
|
+
N as DropdownRoot,
|
|
141
|
+
P as DropdownSlot,
|
|
142
|
+
F as DropdownSubContent,
|
|
143
|
+
T as DropdownSubMenu,
|
|
144
|
+
I as DropdownSubTrigger,
|
|
145
|
+
S as DropdownTrigger
|
|
136
146
|
};
|
|
137
147
|
//# sourceMappingURL=fondue-components10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components10.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, 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\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 {...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","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,EA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,EACT,YAAYiB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
1
|
+
{"version":3,"file":"fondue-components10.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,EACL,CAAA;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,IAA2B;AAAA,EAC3B,gBAAgBd,IAAa;AACjC,GACAM,MACC;AACD,QAAMS,IAAQC,EAAe;AAE7B,2BACKd,EAAc,QAAd,EACG,UAAA,gBAAAD,EAACgB,KAAc,OAAAF,GACX,UAAA,gBAAAd;AAAA,IAACC,EAAc;AAAA,IAAd;AAAA,MACG,OAAAS;AAAA,MACA,kBAAkBH,EAA+BM,CAAwB;AAAA,MACzE,YAAYP,EAAY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AAuB;AAAA,IAAA;AAAA,EACL;AAER;AACAI,EAAa,cAAc;AAId,MAAAS,IAAe,CACxB,EAAE,UAAA7C,GAAU,MAAA8C,GAAM,gBAAgB1C,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAWyC,GAAM,WAAWxB,EAAO,MAAM,gBAAclB,GAAY,KAAAM,GACnE,UAAAV,EACL,CAAA;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;"}
|
|
@@ -5,9 +5,9 @@ import { forwardRef as r } from "react";
|
|
|
5
5
|
import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-components44.js";
|
|
6
6
|
import { useFondueTheme as A, ThemeProvider as T } from "./fondue-components28.js";
|
|
7
7
|
import s from "./fondue-components50.js";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
8
|
+
const n = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
|
|
9
|
+
n.displayName = "Flyout.Root";
|
|
10
|
+
const c = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...d }, l) => /* @__PURE__ */ a(
|
|
11
11
|
i.Trigger,
|
|
12
12
|
{
|
|
13
13
|
onMouseDown: w,
|
|
@@ -20,7 +20,7 @@ const n = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-tr
|
|
|
20
20
|
children: o
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
|
-
|
|
23
|
+
c.displayName = "Flyout.Trigger";
|
|
24
24
|
const I = {
|
|
25
25
|
compact: 8,
|
|
26
26
|
comfortable: 12,
|
|
@@ -43,7 +43,7 @@ const I = {
|
|
|
43
43
|
}, C) => {
|
|
44
44
|
const R = A();
|
|
45
45
|
return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ u(T, { theme: R, children: [
|
|
46
|
-
/* @__PURE__ */ a("div", { className: s.overlay }),
|
|
46
|
+
/* @__PURE__ */ a("div", { "data-test-id": "fondue-flyout-overlay", className: s.overlay }),
|
|
47
47
|
/* @__PURE__ */ a(
|
|
48
48
|
i.Content,
|
|
49
49
|
{
|
|
@@ -88,8 +88,8 @@ const p = ({ children: t, "data-test-id": o = "fondue-flyout-body", scrollable:
|
|
|
88
88
|
);
|
|
89
89
|
p.displayName = "Flyout.Body";
|
|
90
90
|
const j = {
|
|
91
|
-
Root:
|
|
92
|
-
Trigger: r(
|
|
91
|
+
Root: n,
|
|
92
|
+
Trigger: r(c),
|
|
93
93
|
Content: r(m),
|
|
94
94
|
Header: r(y),
|
|
95
95
|
Footer: r(f),
|
|
@@ -101,7 +101,7 @@ export {
|
|
|
101
101
|
m as FlyoutContent,
|
|
102
102
|
f as FlyoutFooter,
|
|
103
103
|
y as FlyoutHeader,
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
n as FlyoutRoot,
|
|
105
|
+
c as FlyoutTrigger
|
|
106
106
|
};
|
|
107
107
|
//# sourceMappingURL=fondue-components12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components12.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 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;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,IA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AAAC,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-components12.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","Fly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A;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,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { IconDroplet as h, IconCross as I, IconCaretDown as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { IconDroplet as h, IconCross as I, IconCaretDown as v } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as b } from "react";
|
|
4
|
+
import t from "./fondue-components77.js";
|
|
5
5
|
import { getColorWithName as k, colorToCss as y } from "./fondue-components42.js";
|
|
6
|
-
const
|
|
7
|
-
id:
|
|
6
|
+
const c = ({
|
|
7
|
+
id: l,
|
|
8
8
|
currentColor: a,
|
|
9
|
-
isOpen:
|
|
10
|
-
disabled:
|
|
11
|
-
onClear:
|
|
9
|
+
isOpen: d,
|
|
10
|
+
disabled: i = !1,
|
|
11
|
+
onClear: o,
|
|
12
12
|
onClick: m,
|
|
13
13
|
"data-test-id": n = "color-picker-input",
|
|
14
14
|
...r
|
|
15
15
|
}, p) => {
|
|
16
16
|
const N = (a == null ? void 0 : a.name) ?? (a ? k(a, "RGBA").name : "");
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ s("div", { id: l, className: t.root, ref: p, "data-test-id": n, children: [
|
|
18
|
+
/* @__PURE__ */ s(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: t.button,
|
|
22
22
|
...r,
|
|
23
|
-
disabled:
|
|
23
|
+
disabled: i,
|
|
24
24
|
onClick: m,
|
|
25
25
|
type: "button",
|
|
26
26
|
"data-color-input-select": !0,
|
|
@@ -29,27 +29,37 @@ const o = ({
|
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
31
|
"aria-hidden": !0,
|
|
32
|
-
className:
|
|
32
|
+
className: t.colorIndicator,
|
|
33
33
|
style: { "--active-color": y(a) }
|
|
34
34
|
}
|
|
35
|
-
) : /* @__PURE__ */
|
|
35
|
+
) : /* @__PURE__ */ s(f, { children: [
|
|
36
36
|
/* @__PURE__ */ e(h, { size: 16 }),
|
|
37
37
|
/* @__PURE__ */ e("span", { children: "Select Color" })
|
|
38
38
|
] }),
|
|
39
|
-
/* @__PURE__ */ e("span", { className:
|
|
39
|
+
/* @__PURE__ */ e("span", { className: t.colorName, children: N })
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/* @__PURE__ */ s("div", { className: t.actions, children: [
|
|
44
|
+
o && /* @__PURE__ */ e(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-label": "Clear color",
|
|
49
|
+
onClick: o,
|
|
50
|
+
className: t.clear,
|
|
51
|
+
disabled: i,
|
|
52
|
+
children: /* @__PURE__ */ e(I, { size: 16 })
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ e("div", { className: t.caret, "data-state": d ? "open" : "closed", children: /* @__PURE__ */ e(v, { size: 16, className: t.caret }) })
|
|
46
56
|
] })
|
|
47
57
|
] });
|
|
48
58
|
};
|
|
49
|
-
|
|
50
|
-
const g =
|
|
59
|
+
c.displayName = "ColorPicker.Input";
|
|
60
|
+
const g = b(c);
|
|
51
61
|
export {
|
|
52
|
-
|
|
62
|
+
c as ColorPickerInput,
|
|
53
63
|
g as ForwardedRefColorPickerInput
|
|
54
64
|
};
|
|
55
65
|
//# sourceMappingURL=fondue-components39.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components39.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCross, IconDroplet } from '@frontify/fondue-icons';\nimport { type CSSProperties, type ForwardedRef, forwardRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss, getColorWithName } from './utils';\n\ntype ColorPickerInputProps = {\n id?: string;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to determine arrow state\n */\n isOpen?: boolean;\n /**\n * Whether the color picker input is disabled\n */\n disabled?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * Event handler called when the color picker input is clicked\n */\n onClick?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n {\n id,\n currentColor,\n isOpen,\n disabled = false,\n onClear,\n onClick,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const colorName = currentColor?.name ?? (currentColor ? getColorWithName(currentColor, 'RGBA').name : '');\n return (\n <div id={id} className={styles.root} ref={forwardedRef} data-test-id={dataTestId}>\n <button\n className={styles.button}\n {...props}\n disabled={disabled}\n onClick={onClick}\n type=\"button\"\n data-color-input-select\n >\n {currentColor?.red !== undefined ? (\n <div\n aria-hidden\n className={styles.colorIndicator}\n style={{ '--active-color': colorToCss(currentColor) } as CSSProperties}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span className={styles.colorName}>{colorName}</span>\n </button>\n <div className={styles.actions}>\n {onClear && (\n <button
|
|
1
|
+
{"version":3,"file":"fondue-components39.js","sources":["../src/components/ColorPicker/ColorPickerInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCross, IconDroplet } from '@frontify/fondue-icons';\nimport { type CSSProperties, type ForwardedRef, forwardRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/colorInput.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss, getColorWithName } from './utils';\n\ntype ColorPickerInputProps = {\n id?: string;\n /**\n * The active color in the color picker\n */\n currentColor?: RgbaColor;\n /**\n * The open state of the color picker used to determine arrow state\n */\n isOpen?: boolean;\n /**\n * Whether the color picker input is disabled\n */\n disabled?: boolean;\n /**\n * callback for clearing the color\n */\n onClear?: () => void;\n /**\n * Event handler called when the color picker input is clicked\n */\n onClick?: () => void;\n /**\n * The test id of the color picker input\n */\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nexport const ColorPickerInput = (\n {\n id,\n currentColor,\n isOpen,\n disabled = false,\n onClear,\n onClick,\n 'data-test-id': dataTestId = 'color-picker-input',\n ...props\n }: ColorPickerInputProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const colorName = currentColor?.name ?? (currentColor ? getColorWithName(currentColor, 'RGBA').name : '');\n return (\n <div id={id} className={styles.root} ref={forwardedRef} data-test-id={dataTestId}>\n <button\n className={styles.button}\n {...props}\n disabled={disabled}\n onClick={onClick}\n type=\"button\"\n data-color-input-select\n >\n {currentColor?.red !== undefined ? (\n <div\n aria-hidden\n className={styles.colorIndicator}\n style={{ '--active-color': colorToCss(currentColor) } as CSSProperties}\n />\n ) : (\n <>\n <IconDroplet size={16} />\n <span>Select Color</span>\n </>\n )}\n\n <span className={styles.colorName}>{colorName}</span>\n </button>\n <div className={styles.actions}>\n {onClear && (\n <button\n type=\"button\"\n aria-label=\"Clear color\"\n onClick={onClear}\n className={styles.clear}\n disabled={disabled}\n >\n <IconCross size={16} />\n </button>\n )}\n <div className={styles.caret} data-state={isOpen ? 'open' : 'closed'}>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n </div>\n );\n};\nColorPickerInput.displayName = 'ColorPicker.Input';\n\nexport const ForwardedRefColorPickerInput = forwardRef<HTMLDivElement, ColorPickerInputProps>(ColorPickerInput);\n"],"names":["ColorPickerInput","id","currentColor","isOpen","disabled","onClear","onClick","dataTestId","props","forwardedRef","colorName","getColorWithName","jsxs","styles","jsx","colorToCss","Fragment","IconDroplet","IconCross","IconCaretDown","ForwardedRefColorPickerInput","forwardRef"],"mappings":";;;;;AAuCO,MAAMA,IAAmB,CAC5B;AAAA,EACI,IAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACK,QAAAC,KAAYR,KAAA,gBAAAA,EAAc,UAASA,IAAeS,EAAiBT,GAAc,MAAM,EAAE,OAAO;AAElG,SAAA,gBAAAU,EAAC,SAAI,IAAAX,GAAQ,WAAWY,EAAO,MAAM,KAAKJ,GAAc,gBAAcF,GAClE,UAAA;AAAA,IAAA,gBAAAK;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAWC,EAAO;AAAA,QACjB,GAAGL;AAAA,QACJ,UAAAJ;AAAA,QACA,SAAAE;AAAA,QACA,MAAK;AAAA,QACL,2BAAuB;AAAA,QAEtB,UAAA;AAAA,WAAAJ,KAAA,gBAAAA,EAAc,SAAQ,SACnB,gBAAAY;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,eAAW;AAAA,cACX,WAAWD,EAAO;AAAA,cAClB,OAAO,EAAE,kBAAkBE,EAAWb,CAAY,EAAE;AAAA,YAAA;AAAA,UAAA,IAIpD,gBAAAU,EAAAI,GAAA,EAAA,UAAA;AAAA,YAAC,gBAAAF,EAAAG,GAAA,EAAY,MAAM,GAAI,CAAA;AAAA,YACvB,gBAAAH,EAAC,UAAK,UAAY,eAAA,CAAA;AAAA,UAAA,GACtB;AAAA,UAGH,gBAAAA,EAAA,QAAA,EAAK,WAAWD,EAAO,WAAY,UAAUH,EAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAClD;AAAA,IACC,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAO,SAClB,UAAA;AAAA,MACGR,KAAA,gBAAAS;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,cAAW;AAAA,UACX,SAAST;AAAA,UACT,WAAWQ,EAAO;AAAA,UAClB,UAAAT;AAAA,UAEA,UAAA,gBAAAU,EAACI,GAAU,EAAA,MAAM,GAAI,CAAA;AAAA,QAAA;AAAA,MACzB;AAAA,wBAEH,OAAI,EAAA,WAAWL,EAAO,OAAO,cAAYV,IAAS,SAAS,UACxD,UAAA,gBAAAW,EAACK,KAAc,MAAM,IAAI,WAAWN,EAAO,OAAO,EACtD,CAAA;AAAA,IAAA,EACJ,CAAA;AAAA,EAAA,GACJ;AAER;AACAb,EAAiB,cAAc;AAElB,MAAAoB,IAA+BC,EAAkDrB,CAAgB;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_content_1s2bq_7", s = "_subContent_1s2bq_8", n = "_item_1s2bq_21", o = "_subTrigger_1s2bq_22", _ = "_subMenuIndicator_1s2bq_129", e = "_group_1s2bq_135", u = "_groupHeading_1s2bq_142", b = "_slot_1s2bq_153", r = {
|
|
2
2
|
content: t,
|
|
3
|
-
subContent:
|
|
4
|
-
item:
|
|
5
|
-
subTrigger:
|
|
3
|
+
subContent: s,
|
|
4
|
+
item: n,
|
|
5
|
+
subTrigger: o,
|
|
6
6
|
subMenuIndicator: _,
|
|
7
7
|
group: e,
|
|
8
|
-
groupHeading:
|
|
9
|
-
slot:
|
|
8
|
+
groupHeading: u,
|
|
9
|
+
slot: b
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
t as content,
|
|
13
|
-
|
|
13
|
+
r as default,
|
|
14
14
|
e as group,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
u as groupHeading,
|
|
16
|
+
n as item,
|
|
17
|
+
b as slot,
|
|
18
|
+
s as subContent,
|
|
19
19
|
_ as subMenuIndicator,
|
|
20
|
-
|
|
20
|
+
o as subTrigger
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=fondue-components48.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_xgv97_6", e = "_overlay_xgv97_51", _ = "_header_xgv97_67", t = "_body_xgv97_88", r = "_footer_xgv97_113", s = "_close_xgv97_134", c = {
|
|
2
2
|
root: o,
|
|
3
|
-
overlay:
|
|
4
|
-
header:
|
|
5
|
-
body:
|
|
6
|
-
footer:
|
|
7
|
-
close:
|
|
3
|
+
overlay: e,
|
|
4
|
+
header: _,
|
|
5
|
+
body: t,
|
|
6
|
+
footer: r,
|
|
7
|
+
close: s
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
t as body,
|
|
11
|
+
s as close,
|
|
12
12
|
c as default,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
r as footer,
|
|
14
|
+
_ as header,
|
|
15
|
+
e as overlay,
|
|
16
16
|
o as root
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components50.js.map
|
|
@@ -4,7 +4,7 @@ import { Slot as C } from "@radix-ui/react-slot";
|
|
|
4
4
|
import { isValidElement as V } from "react";
|
|
5
5
|
import { useFondueTheme as g, ThemeProvider as A } from "./fondue-components28.js";
|
|
6
6
|
import n from "./fondue-components63.js";
|
|
7
|
-
import { recursiveMap as D, getSelectOptionValue as M } from "./fondue-
|
|
7
|
+
import { recursiveMap as D, getSelectOptionValue as M } from "./fondue-components78.js";
|
|
8
8
|
const T = ({
|
|
9
9
|
highlightedIndex: p,
|
|
10
10
|
getMenuProps: l,
|
|
@@ -3,7 +3,7 @@ import { IconCross as x } from "@frontify/fondue-icons";
|
|
|
3
3
|
import { useState as B, useMemo as i, Children as f, isValidElement as a, cloneElement as E, useCallback as v } from "react";
|
|
4
4
|
import { ForwardedRefSelectItem as F } from "./fondue-components60.js";
|
|
5
5
|
import { ForwardedRefSelectSlot as c } from "./fondue-components62.js";
|
|
6
|
-
import { getSelectOptionValue as I } from "./fondue-
|
|
6
|
+
import { getSelectOptionValue as I } from "./fondue-components78.js";
|
|
7
7
|
const S = (r) => {
|
|
8
8
|
const t = [];
|
|
9
9
|
return f.forEach(r, (o) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_triggerListWrapper_1qrbj_5", r = "_trigger_1qrbj_5", e = "_activeIndicator_1qrbj_53", i = "_triggerList_1qrbj_5", o = "_root_1qrbj_140", g = "_content_1qrbj_163", _ = {
|
|
2
2
|
triggerListWrapper: t,
|
|
3
3
|
trigger: r,
|
|
4
4
|
activeIndicator: e,
|