@frontify/fondue-components 9.0.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,5 @@
1
- const o = "_root_1nv86_5", t = "_button_1nv86_56", c = "_colorIndicator_1nv86_69", n = "_actions_1nv86_75", _ = "_clear_1nv86_85", r = "_caret_1nv86_98", a = {
2
- root: o,
3
- button: t,
4
- colorIndicator: c,
5
- actions: n,
6
- clear: _,
7
- caret: r
8
- };
1
+ const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
9
2
  export {
10
- n as actions,
11
- t as button,
12
- r as caret,
13
- _ as clear,
14
- c as colorIndicator,
15
- a as default,
16
- o as root
3
+ t as FOCUS_OUTLINE
17
4
  };
18
5
  //# sourceMappingURL=fondue-components66.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"fondue-components66.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
@@ -1,5 +1,18 @@
1
- const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
1
+ const o = "_root_1nv86_5", t = "_button_1nv86_56", c = "_colorIndicator_1nv86_69", n = "_actions_1nv86_75", _ = "_clear_1nv86_85", r = "_caret_1nv86_98", a = {
2
+ root: o,
3
+ button: t,
4
+ colorIndicator: c,
5
+ actions: n,
6
+ clear: _,
7
+ caret: r
8
+ };
2
9
  export {
3
- t as FOCUS_OUTLINE
10
+ n as actions,
11
+ t as button,
12
+ r as caret,
13
+ _ as clear,
14
+ c as colorIndicator,
15
+ a as default,
16
+ o as root
4
17
  };
5
18
  //# sourceMappingURL=fondue-components67.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components67.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
1
+ {"version":3,"file":"fondue-components67.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -5,76 +5,61 @@ import { Slot as I } from "@radix-ui/react-slot";
5
5
  import { forwardRef as s } from "react";
6
6
  import { useProcessedChildren as w } from "./fondue-components40.js";
7
7
  import a from "./fondue-components41.js";
8
- const m = ({
8
+ const c = ({
9
9
  children: o,
10
10
  open: t,
11
11
  onOpenChange: r,
12
12
  "data-test-id": d = "fondue-dropdown"
13
13
  }) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: r, "data-test-id": d, children: o });
14
- m.displayName = "Dropdown.Root";
15
- const l = ({
14
+ c.displayName = "Dropdown.Root";
15
+ const m = ({
16
16
  asChild: o = !0,
17
17
  children: t,
18
18
  "data-test-id": r = "fondue-dropdown-trigger",
19
19
  ...d
20
20
  }, i) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": r, ref: i, ...d, children: t });
21
- l.displayName = "Dropdown.Trigger";
22
- const g = ({
21
+ m.displayName = "Dropdown.Trigger";
22
+ const l = ({
23
23
  side: o = "bottom",
24
- padding: t = "comfortable",
25
- align: r = "start",
26
- children: d,
27
- preventTriggerFocusOnClose: i,
28
- "data-test-id": p = "fondue-dropdown-content"
29
- }, u) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
24
+ align: t = "start",
25
+ children: r,
26
+ preventTriggerFocusOnClose: d,
27
+ "data-test-id": i = "fondue-dropdown-content"
28
+ }, p) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
30
29
  n.Content,
31
30
  {
32
- align: r,
31
+ align: t,
33
32
  collisionPadding: 8,
34
33
  sideOffset: 8,
35
34
  side: o,
36
35
  className: a.content,
37
- "data-padding": t,
38
- "data-test-id": p,
39
- ref: u,
40
- onCloseAutoFocus: (c) => {
41
- i && c.preventDefault();
36
+ "data-test-id": i,
37
+ ref: p,
38
+ onCloseAutoFocus: (u) => {
39
+ d && u.preventDefault();
42
40
  },
43
- children: d
41
+ children: r
44
42
  }
45
43
  ) });
46
- g.displayName = "Dropdown.Content";
47
- const f = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ e(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
48
- f.displayName = "Dropdown.Group";
49
- const D = ({
44
+ l.displayName = "Dropdown.Content";
45
+ const g = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ e(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
46
+ g.displayName = "Dropdown.Group";
47
+ const f = ({
50
48
  children: o,
51
49
  "data-test-id": t = "fondue-dropdown-submenu"
52
50
  }) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
53
- D.displayName = "Dropdown.SubMenu";
54
- const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
51
+ f.displayName = "Dropdown.SubMenu";
52
+ const D = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
55
53
  const { content: d } = w(o);
56
54
  return /* @__PURE__ */ h(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
57
55
  d,
58
56
  /* @__PURE__ */ e(F, { className: a.subMenuIndicator, size: 16 })
59
57
  ] });
60
58
  };
61
- b.displayName = "Dropdown.SubTrigger";
59
+ D.displayName = "Dropdown.SubTrigger";
60
+ const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subcontent" }, r) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(n.SubContent, { className: a.subContent, "data-test-id": t, ref: r, children: o }) });
61
+ b.displayName = "Dropdown.SubContent";
62
62
  const S = ({
63
- padding: o = "comfortable",
64
- children: t,
65
- "data-test-id": r = "fondue-dropdown-subcontent"
66
- }, d) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
67
- n.SubContent,
68
- {
69
- className: a.subContent,
70
- "data-padding": o,
71
- "data-test-id": r,
72
- ref: d,
73
- children: t
74
- }
75
- ) });
76
- S.displayName = "Dropdown.SubContent";
77
- const N = ({
78
63
  children: o,
79
64
  disabled: t,
80
65
  textValue: r,
@@ -82,7 +67,7 @@ const N = ({
82
67
  emphasis: i = "default",
83
68
  "data-test-id": p = "fondue-dropdown-subtrigger",
84
69
  ...u
85
- }, c) => {
70
+ }, C) => {
86
71
  const { content: R, isLink: T } = w(o), y = T ? I : "div";
87
72
  return /* @__PURE__ */ e(
88
73
  n.Item,
@@ -92,7 +77,7 @@ const N = ({
92
77
  textValue: r,
93
78
  "data-test-id": p,
94
79
  "data-emphasis": i,
95
- ref: c,
80
+ ref: C,
96
81
  disabled: t,
97
82
  asChild: !0,
98
83
  ...u,
@@ -100,15 +85,15 @@ const N = ({
100
85
  }
101
86
  );
102
87
  };
103
- N.displayName = "Dropdown.Item";
104
- const C = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ e("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: d, children: o });
105
- C.displayName = "Dropdown.Slot";
106
- const G = s(l), x = s(g), M = s(f), P = s(b), v = s(S), j = s(N), k = s(C), B = {
107
- Root: m,
88
+ S.displayName = "Dropdown.Item";
89
+ const N = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ e("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: d, children: o });
90
+ N.displayName = "Dropdown.Slot";
91
+ const G = s(m), x = s(l), M = s(g), P = s(D), v = s(b), j = s(S), k = s(N), B = {
92
+ Root: c,
108
93
  Trigger: G,
109
94
  Content: x,
110
95
  Group: M,
111
- SubMenu: D,
96
+ SubMenu: f,
112
97
  SubTrigger: P,
113
98
  SubContent: v,
114
99
  Item: j,
@@ -116,14 +101,14 @@ const G = s(l), x = s(g), M = s(f), P = s(b), v = s(S), j = s(N), k = s(C), B =
116
101
  };
117
102
  export {
118
103
  B as Dropdown,
119
- g as DropdownContent,
120
- f as DropdownGroup,
121
- N as DropdownItem,
122
- m as DropdownRoot,
123
- C as DropdownSlot,
124
- S as DropdownSubContent,
125
- D as DropdownSubMenu,
126
- b as DropdownSubTrigger,
127
- l as DropdownTrigger
104
+ l as DropdownContent,
105
+ g as DropdownGroup,
106
+ S as DropdownItem,
107
+ c as DropdownRoot,
108
+ N as DropdownSlot,
109
+ b as DropdownSubContent,
110
+ f as DropdownSubMenu,
111
+ D as DropdownSubTrigger,
112
+ m as DropdownTrigger
128
113
  };
129
114
  //# 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,c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0B;AAAA,MACf,KAAApB;AAAA,MACA,UAAAiB;AAAA,MACA,SAAO;AAAA,MACN,GAAGlB;AAAA,MAEJ,UAAA,gBAAAJ,EAAC2B,KAAS,UAAQX,EAAA,CAAA;AAAA,IAAA;AAAA,EACtB;AAER;AACAK,EAAa,cAAc;AAId,MAAAQ,IAAe,CACxB,EAAE,UAAAjC,GAAU,MAAAkC,GAAM,gBAAgB/B,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAW8B,GAAM,WAAWnB,EAAO,MAAM,gBAAcZ,GAAY,KAAAM,GACnE,UAAAT,EACL,CAAA;AAGRiC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoD9B,CAAe,GACjG+B,IAA8BD,EAAiD1B,CAAe,GAC9F4B,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM5C;AAAA,EACN,SAASoC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
1
+ {"version":3,"file":"fondue-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 * 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 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-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 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 return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\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","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,gB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AAe,GACjG8B,IAA8BD,EAAiDzB,CAAe,GAC9F2B,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM3C;AAAA,EACN,SAASmC;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
@@ -523,11 +523,6 @@ export declare const Dropdown: {
523
523
  declare type DropdownContentProps = {
524
524
  children?: ReactNode;
525
525
  'data-test-id'?: string;
526
- /**
527
- * The vertical padding around each dropdown item.
528
- * @default "comfortable"
529
- */
530
- padding?: 'comfortable' | 'compact';
531
526
  /**
532
527
  * Defines the alignment of the dropdown.
533
528
  * @default "start"
@@ -591,11 +586,6 @@ declare type DropdownSlotProps = {
591
586
  };
592
587
 
593
588
  declare type DropdownSubContentProps = {
594
- /**
595
- * The vertical padding around each dropdown item.
596
- * @default "comfortable"
597
- */
598
- padding?: 'comfortable' | 'compact';
599
589
  children: ReactNode;
600
590
  'data-test-id'?: string;
601
591
  };
@@ -1134,7 +1124,7 @@ declare type SelectComponentProps = {
1134
1124
  /**
1135
1125
  * Callback function that is called when an item is selected.
1136
1126
  */
1137
- onSelect?: (selectedValue: string) => void;
1127
+ onSelect?: (selectedValue?: string) => void;
1138
1128
  /**
1139
1129
  * The active value in the select component. This is used to control the select externally.
1140
1130
  */
@@ -1407,6 +1397,11 @@ declare type TableRootProps = {
1407
1397
  * @default 'auto'
1408
1398
  */
1409
1399
  layout?: 'auto' | 'fixed';
1400
+ /**
1401
+ * Font size of the table content
1402
+ * @default 'small'
1403
+ */
1404
+ fontSize?: 'small' | 'medium';
1410
1405
  /**
1411
1406
  * Whether header should stick to the top when scrolling
1412
1407
  */