@frontify/fondue-components 8.0.2 → 10.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-components21.js +35 -24
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +34 -32
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components28.js +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components34.js +6 -6
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +5 -5
- package/dist/fondue-components38.js +14 -14
- package/dist/fondue-components41.js +14 -14
- package/dist/fondue-components57.js +9 -9
- package/dist/fondue-components60.js +16 -16
- package/dist/fondue-components63.js +7 -7
- package/dist/fondue-components64.js +7 -7
- package/dist/fondue-components66.js +15 -2
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +2 -15
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components7.js +94 -81
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components9.js +96 -82
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +54 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,129 +1,143 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { IconCaretRight as
|
|
1
|
+
import { jsx as e, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretRight as x } from "@frontify/fondue-icons";
|
|
3
3
|
import * as n from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { Slot as I } from "@radix-ui/react-slot";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { useProcessedChildren as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
5
|
+
import { forwardRef as i } from "react";
|
|
6
|
+
import { useProcessedChildren as g } from "./fondue-components40.js";
|
|
7
|
+
import s from "./fondue-components41.js";
|
|
8
|
+
const f = ({
|
|
9
9
|
children: o,
|
|
10
10
|
open: t,
|
|
11
|
-
onOpenChange:
|
|
12
|
-
"data-test-id":
|
|
13
|
-
}) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange:
|
|
14
|
-
|
|
15
|
-
const
|
|
11
|
+
onOpenChange: d,
|
|
12
|
+
"data-test-id": r = "fondue-dropdown"
|
|
13
|
+
}) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: d, "data-test-id": r, children: o });
|
|
14
|
+
f.displayName = "Dropdown.Root";
|
|
15
|
+
const D = ({
|
|
16
16
|
asChild: o = !0,
|
|
17
17
|
children: t,
|
|
18
|
-
"data-test-id":
|
|
19
|
-
...
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
const
|
|
18
|
+
"data-test-id": d = "fondue-dropdown-trigger",
|
|
19
|
+
...r
|
|
20
|
+
}, a) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": d, ref: a, ...r, children: t });
|
|
21
|
+
D.displayName = "Dropdown.Trigger";
|
|
22
|
+
const b = ({
|
|
23
23
|
side: o = "bottom",
|
|
24
24
|
padding: t = "comfortable",
|
|
25
|
-
align:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
align: d = "start",
|
|
26
|
+
rounded: r = "medium",
|
|
27
|
+
shadow: a = "medium",
|
|
28
|
+
minWidth: p = "250px",
|
|
29
|
+
maxWidth: u = "350px",
|
|
30
|
+
children: m,
|
|
31
|
+
preventTriggerFocusOnClose: w,
|
|
32
|
+
"data-test-id": c = "fondue-dropdown-content"
|
|
33
|
+
}, l) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
|
|
30
34
|
n.Content,
|
|
31
35
|
{
|
|
32
|
-
|
|
36
|
+
style: {
|
|
37
|
+
"--dropdown-max-width": u,
|
|
38
|
+
"--dropdown-min-width": p
|
|
39
|
+
},
|
|
40
|
+
align: d,
|
|
33
41
|
collisionPadding: 8,
|
|
34
42
|
sideOffset: 8,
|
|
35
43
|
side: o,
|
|
36
|
-
className:
|
|
44
|
+
className: s.content,
|
|
37
45
|
"data-padding": t,
|
|
38
|
-
"data-test-id":
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
"data-test-id": c,
|
|
47
|
+
"data-rounded": r,
|
|
48
|
+
"data-shadow": a,
|
|
49
|
+
ref: l,
|
|
50
|
+
onCloseAutoFocus: (T) => {
|
|
51
|
+
w && T.preventDefault();
|
|
42
52
|
},
|
|
43
|
-
children:
|
|
53
|
+
children: m
|
|
44
54
|
}
|
|
45
55
|
) });
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const
|
|
56
|
+
b.displayName = "Dropdown.Content";
|
|
57
|
+
const S = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, d) => /* @__PURE__ */ e(n.Group, { className: s.group, "data-test-id": t, ref: d, children: o });
|
|
58
|
+
S.displayName = "Dropdown.Group";
|
|
59
|
+
const N = ({
|
|
50
60
|
children: o,
|
|
51
61
|
"data-test-id": t = "fondue-dropdown-submenu"
|
|
52
62
|
}) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const { content:
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */ e(
|
|
63
|
+
N.displayName = "Dropdown.SubMenu";
|
|
64
|
+
const C = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, d) => {
|
|
65
|
+
const { content: r } = g(o);
|
|
66
|
+
return /* @__PURE__ */ F(n.SubTrigger, { className: s.subTrigger, "data-test-id": t, ref: d, children: [
|
|
67
|
+
r,
|
|
68
|
+
/* @__PURE__ */ e(x, { className: s.subMenuIndicator, size: 16 })
|
|
59
69
|
] });
|
|
60
70
|
};
|
|
61
|
-
|
|
62
|
-
const
|
|
71
|
+
C.displayName = "Dropdown.SubTrigger";
|
|
72
|
+
const R = ({
|
|
63
73
|
padding: o = "comfortable",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
rounded: t = "medium",
|
|
75
|
+
shadow: d = "medium",
|
|
76
|
+
children: r,
|
|
77
|
+
"data-test-id": a = "fondue-dropdown-subcontent"
|
|
78
|
+
}, p) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
|
|
67
79
|
n.SubContent,
|
|
68
80
|
{
|
|
69
|
-
className:
|
|
81
|
+
className: s.subContent,
|
|
70
82
|
"data-padding": o,
|
|
71
|
-
"data-
|
|
72
|
-
|
|
73
|
-
|
|
83
|
+
"data-rounded": t,
|
|
84
|
+
"data-shadow": d,
|
|
85
|
+
"data-test-id": a,
|
|
86
|
+
ref: p,
|
|
87
|
+
children: r
|
|
74
88
|
}
|
|
75
89
|
) });
|
|
76
|
-
|
|
77
|
-
const
|
|
90
|
+
R.displayName = "Dropdown.SubContent";
|
|
91
|
+
const h = ({
|
|
78
92
|
children: o,
|
|
79
93
|
disabled: t,
|
|
80
|
-
textValue:
|
|
81
|
-
onSelect:
|
|
82
|
-
emphasis:
|
|
94
|
+
textValue: d,
|
|
95
|
+
onSelect: r,
|
|
96
|
+
emphasis: a = "default",
|
|
83
97
|
"data-test-id": p = "fondue-dropdown-subtrigger",
|
|
84
98
|
...u
|
|
85
|
-
},
|
|
86
|
-
const { content:
|
|
99
|
+
}, m) => {
|
|
100
|
+
const { content: w, isLink: c } = g(o), l = c ? I : "div";
|
|
87
101
|
return /* @__PURE__ */ e(
|
|
88
102
|
n.Item,
|
|
89
103
|
{
|
|
90
|
-
onSelect:
|
|
91
|
-
className:
|
|
92
|
-
textValue:
|
|
104
|
+
onSelect: r,
|
|
105
|
+
className: s.item,
|
|
106
|
+
textValue: d,
|
|
93
107
|
"data-test-id": p,
|
|
94
|
-
"data-emphasis":
|
|
95
|
-
ref:
|
|
108
|
+
"data-emphasis": a,
|
|
109
|
+
ref: m,
|
|
96
110
|
disabled: t,
|
|
97
111
|
asChild: !0,
|
|
98
112
|
...u,
|
|
99
|
-
children: /* @__PURE__ */ e(
|
|
113
|
+
children: /* @__PURE__ */ e(l, { children: w })
|
|
100
114
|
}
|
|
101
115
|
);
|
|
102
116
|
};
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
const G =
|
|
107
|
-
Root:
|
|
117
|
+
h.displayName = "Dropdown.Item";
|
|
118
|
+
const y = ({ children: o, name: t, "data-test-id": d = "fondue-dropdown-slot" }, r) => /* @__PURE__ */ e("div", { "data-name": t, className: s.slot, "data-test-id": d, ref: r, children: o });
|
|
119
|
+
y.displayName = "Dropdown.Slot";
|
|
120
|
+
const G = i(D), M = i(b), P = i(S), v = i(C), j = i(R), k = i(h), z = i(y), E = {
|
|
121
|
+
Root: f,
|
|
108
122
|
Trigger: G,
|
|
109
|
-
Content:
|
|
110
|
-
Group:
|
|
111
|
-
SubMenu:
|
|
112
|
-
SubTrigger:
|
|
113
|
-
SubContent:
|
|
114
|
-
Item:
|
|
115
|
-
Slot:
|
|
123
|
+
Content: M,
|
|
124
|
+
Group: P,
|
|
125
|
+
SubMenu: N,
|
|
126
|
+
SubTrigger: v,
|
|
127
|
+
SubContent: j,
|
|
128
|
+
Item: k,
|
|
129
|
+
Slot: z
|
|
116
130
|
};
|
|
117
131
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
E as Dropdown,
|
|
133
|
+
b as DropdownContent,
|
|
134
|
+
S as DropdownGroup,
|
|
135
|
+
h as DropdownItem,
|
|
136
|
+
f as DropdownRoot,
|
|
137
|
+
y as DropdownSlot,
|
|
138
|
+
R as DropdownSubContent,
|
|
139
|
+
N as DropdownSubMenu,
|
|
140
|
+
C as DropdownSubTrigger,
|
|
141
|
+
D as DropdownTrigger
|
|
128
142
|
};
|
|
129
143
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.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 { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\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\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\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 * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\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 </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n 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 /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * 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 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\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\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","side","padding","align","preventTriggerFocusOnClose","styles","event","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;AAwBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAR,EACL,CAAA;AAGRM,EAAgB,cAAc;AA0BvB,MAAMI,IAAkB,CAC3B;AAAA,EACI,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,UAAAb;AAAA,EACA,4BAAAc;AAAA,EACA,gBAAgBX,IAAa;AACjC,GACAM,MAGI,gBAAAL,EAACC,EAAc,QAAd,EACG,UAAA,gBAAAD;AAAA,EAACC,EAAc;AAAA,EAAd;AAAA,IACG,OAAAQ;AAAA,IACA,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,MAAAF;AAAA,IACA,WAAWI,EAAO;AAAA,IAClB,gBAAcH;AAAA,IACd,gBAAcT;AAAA,IACd,KAAAM;AAAA,IACA,kBAAkB,CAACO,MAAU;AACzB,MAAIF,KACAE,EAAM,eAAe;AAAA,I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cesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type CSSProperties, forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\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\nexport type DropdownContentProps = {\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 a minimum width for the dropdown\n * @default \"250px\"\n */\n minWidth?: string;\n /**\n * Define a maximum width for the dropdown\n * @default \"350px\"\n */\n maxWidth?: string;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\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 * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n rounded = 'medium',\n shadow = 'medium',\n minWidth = '250px',\n maxWidth = '350px',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n style={\n {\n '--dropdown-max-width': maxWidth,\n '--dropdown-min-width': minWidth,\n } as CSSProperties\n }\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\n data-test-id={dataTestId}\n data-rounded={rounded}\n data-shadow={shadow}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n 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 /**\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 * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n rounded = 'medium',\n shadow = 'medium',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * 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 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\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\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","side","padding","align","rounded","shadow","minWidth","maxWidth","preventTriggerFocusOnClose","styles","event","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;AAwBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GA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AEJ,UAAA,gBAAAJ,EAAC+B,KAAS,UAAQX,EAAA,CAAA;AAAA,IAAA;AAAA,EACtB;AAER;AACAK,EAAa,cAAc;AAId,MAAAQ,IAAe,CACxB,EAAE,UAAArC,GAAU,MAAAsC,GAAM,gBAAgBnC,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAWkC,GAAM,WAAWnB,EAAO,MAAM,gBAAchB,GAAY,KAAAM,GACnE,UAAAT,EACL,CAAA;AAGRqC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoDlC,CAAe,GACjGmC,IAA8BD,EAAiD9B,CAAe,GAC9FgC,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAMhD;AAAA,EACN,SAASwC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -349,6 +349,10 @@ declare type DialogAnnouncementProps = {
|
|
|
349
349
|
};
|
|
350
350
|
|
|
351
351
|
declare type DialogBodyProps = {
|
|
352
|
+
/**
|
|
353
|
+
* Define the padding for the dialog body
|
|
354
|
+
*/
|
|
355
|
+
padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';
|
|
352
356
|
children?: ReactNode;
|
|
353
357
|
'data-test-id'?: string;
|
|
354
358
|
};
|
|
@@ -398,6 +402,10 @@ declare type DialogContentProps = {
|
|
|
398
402
|
};
|
|
399
403
|
|
|
400
404
|
declare type DialogFooterProps = {
|
|
405
|
+
/**
|
|
406
|
+
* Define the padding for the dialog footer
|
|
407
|
+
*/
|
|
408
|
+
padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';
|
|
401
409
|
/**
|
|
402
410
|
* Show a border at the top of the footer
|
|
403
411
|
* @default true
|
|
@@ -408,6 +416,10 @@ declare type DialogFooterProps = {
|
|
|
408
416
|
};
|
|
409
417
|
|
|
410
418
|
declare type DialogHeaderProps = {
|
|
419
|
+
/**
|
|
420
|
+
* Define the padding for the dialog header
|
|
421
|
+
*/
|
|
422
|
+
padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';
|
|
411
423
|
/**
|
|
412
424
|
* Show a border at the bottom of the header
|
|
413
425
|
* @default true
|
|
@@ -509,8 +521,26 @@ export declare const Dropdown: {
|
|
|
509
521
|
};
|
|
510
522
|
|
|
511
523
|
declare type DropdownContentProps = {
|
|
512
|
-
|
|
513
|
-
|
|
524
|
+
/**
|
|
525
|
+
* Add a shadow to the flyout
|
|
526
|
+
* @default "medium"
|
|
527
|
+
*/
|
|
528
|
+
shadow?: 'none' | 'medium' | 'large';
|
|
529
|
+
/**
|
|
530
|
+
* Add rounded corners to the flyout
|
|
531
|
+
* @default "medium"
|
|
532
|
+
*/
|
|
533
|
+
rounded?: 'none' | 'medium' | 'large';
|
|
534
|
+
/**
|
|
535
|
+
* Define a minimum width for the dropdown
|
|
536
|
+
* @default "250px"
|
|
537
|
+
*/
|
|
538
|
+
minWidth?: string;
|
|
539
|
+
/**
|
|
540
|
+
* Define a maximum width for the dropdown
|
|
541
|
+
* @default "350px"
|
|
542
|
+
*/
|
|
543
|
+
maxWidth?: string;
|
|
514
544
|
/**
|
|
515
545
|
* The vertical padding around each dropdown item.
|
|
516
546
|
* @default "comfortable"
|
|
@@ -530,6 +560,8 @@ declare type DropdownContentProps = {
|
|
|
530
560
|
* Prevents the focus from being set on the trigger when the dropdown is closed.
|
|
531
561
|
*/
|
|
532
562
|
preventTriggerFocusOnClose?: boolean;
|
|
563
|
+
children?: ReactNode;
|
|
564
|
+
'data-test-id'?: string;
|
|
533
565
|
};
|
|
534
566
|
|
|
535
567
|
declare type DropdownGroupProps = {
|
|
@@ -579,6 +611,16 @@ declare type DropdownSlotProps = {
|
|
|
579
611
|
};
|
|
580
612
|
|
|
581
613
|
declare type DropdownSubContentProps = {
|
|
614
|
+
/**
|
|
615
|
+
* Add a shadow to the flyout
|
|
616
|
+
* @default "medium"
|
|
617
|
+
*/
|
|
618
|
+
shadow?: 'none' | 'medium' | 'large';
|
|
619
|
+
/**
|
|
620
|
+
* Add rounded corners to the flyout
|
|
621
|
+
* @default "medium"
|
|
622
|
+
*/
|
|
623
|
+
rounded?: 'none' | 'medium' | 'large';
|
|
582
624
|
/**
|
|
583
625
|
* The vertical padding around each dropdown item.
|
|
584
626
|
* @default "comfortable"
|
|
@@ -1395,6 +1437,11 @@ declare type TableRootProps = {
|
|
|
1395
1437
|
* @default 'auto'
|
|
1396
1438
|
*/
|
|
1397
1439
|
layout?: 'auto' | 'fixed';
|
|
1440
|
+
/**
|
|
1441
|
+
* Font size of the table content
|
|
1442
|
+
* @default 'small'
|
|
1443
|
+
*/
|
|
1444
|
+
fontSize?: 'small' | 'medium';
|
|
1398
1445
|
/**
|
|
1399
1446
|
* Whether header should stick to the top when scrolling
|
|
1400
1447
|
*/
|
|
@@ -1437,6 +1484,11 @@ declare type TabsContentProps = {
|
|
|
1437
1484
|
declare type TabsRootProps = {
|
|
1438
1485
|
id?: string;
|
|
1439
1486
|
children: ReactNode;
|
|
1487
|
+
/**
|
|
1488
|
+
* Define the padding of the dialog
|
|
1489
|
+
* @default "compact"
|
|
1490
|
+
*/
|
|
1491
|
+
padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';
|
|
1440
1492
|
/**
|
|
1441
1493
|
* The default active tab
|
|
1442
1494
|
* Used for uncontrolled components
|