@frontify/fondue-components 4.0.2 → 5.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.
@@ -1,67 +1,69 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-scroll-area";
3
- import { forwardRef as n } from "react";
4
- import l from "./fondue-components45.js";
5
- const b = ({
3
+ import { forwardRef as b } from "react";
4
+ import a from "./fondue-components45.js";
5
+ const h = ({
6
6
  type: t,
7
7
  maxHeight: e = "100%",
8
8
  maxWidth: s = "100%",
9
- children: c,
9
+ showShadow: c = !1,
10
+ children: i,
10
11
  "data-test-id": r = "fondue-scroll-area"
11
- }, i) => /* @__PURE__ */ m(
12
+ }, m) => /* @__PURE__ */ n(
12
13
  o.Root,
13
14
  {
14
15
  type: t,
15
- className: l.root,
16
+ className: a.root,
16
17
  style: { maxWidth: s },
17
18
  "data-test-id": r,
18
- ref: i,
19
+ ref: m,
19
20
  children: [
20
- /* @__PURE__ */ a(
21
+ /* @__PURE__ */ l(
21
22
  o.Viewport,
22
23
  {
23
- className: l.viewport,
24
+ className: a.viewport,
24
25
  style: { maxHeight: e },
25
26
  "data-test-id": `${r}-viewport`,
26
- children: c
27
+ "data-show-shadow": c,
28
+ children: i
27
29
  }
28
30
  ),
29
- /* @__PURE__ */ a(
31
+ /* @__PURE__ */ l(
30
32
  o.Scrollbar,
31
33
  {
32
- className: l.scrollbar,
34
+ className: a.scrollbar,
33
35
  orientation: "vertical",
34
36
  "data-test-id": `${r}-vertical-scrollbar`,
35
- children: /* @__PURE__ */ a(
37
+ children: /* @__PURE__ */ l(
36
38
  o.Thumb,
37
39
  {
38
- className: l.thumb,
40
+ className: a.thumb,
39
41
  "data-test-id": `${r}-vertical-scrollbar-thumb`
40
42
  }
41
43
  )
42
44
  }
43
45
  ),
44
- /* @__PURE__ */ a(
46
+ /* @__PURE__ */ l(
45
47
  o.Scrollbar,
46
48
  {
47
- className: l.scrollbar,
49
+ className: a.scrollbar,
48
50
  orientation: "horizontal",
49
51
  "data-test-id": `${r}-horizontal-scrollbar`,
50
- children: /* @__PURE__ */ a(
52
+ children: /* @__PURE__ */ l(
51
53
  o.Thumb,
52
54
  {
53
- className: l.thumb,
55
+ className: a.thumb,
54
56
  "data-test-id": `${r}-horizontal-scrollbar-thumb`
55
57
  }
56
58
  )
57
59
  }
58
60
  ),
59
- /* @__PURE__ */ a(o.Corner, { className: l.corner, "data-test-id": `${r}-corner` })
61
+ /* @__PURE__ */ l(o.Corner, { className: a.corner, "data-test-id": `${r}-corner` })
60
62
  ]
61
63
  }
62
- ), h = n(b);
63
- h.displayName = "ScrollArea";
64
+ ), d = b(h);
65
+ d.displayName = "ScrollArea";
64
66
  export {
65
- h as ScrollArea
67
+ d as ScrollArea
66
68
  };
67
69
  //# sourceMappingURL=fondue-components15.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components15.js","sources":["../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixScrollArea from '@radix-ui/react-scroll-area';\nimport { type ForwardedRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport styles from './styles/scrollArea.module.scss';\n\nexport type ScrollAreaProps = {\n /**\n * \"auto\" visible when content is overflowing on the corresponding orientation.\n * \"always\" always visible regardless of whether the content is overflowing.\n * \"scroll\" visible when the user is scrolling along its corresponding orientation.\n * \"hover\" when the user is hovering over the scroll area.\n * @default 'hover'\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover';\n /**\n * Maximum height of the scroll area\n * @default '100%'\n */\n maxHeight?: string | number;\n /**\n * Minimum width of the scroll area\n * @default '100%'\n */\n maxWidth?: string | number;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nconst ScrollAreaComponent = (\n {\n type,\n maxHeight = '100%',\n maxWidth = '100%',\n children,\n 'data-test-id': dataTestId = 'fondue-scroll-area',\n }: ScrollAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement => {\n return (\n <RadixScrollArea.Root\n type={type}\n className={styles.root}\n style={{ maxWidth }}\n data-test-id={dataTestId}\n ref={ref}\n >\n <RadixScrollArea.Viewport\n className={styles.viewport}\n style={{ maxHeight }}\n data-test-id={`${dataTestId}-viewport`}\n >\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"vertical\"\n data-test-id={`${dataTestId}-vertical-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-vertical-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"horizontal\"\n data-test-id={`${dataTestId}-horizontal-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-horizontal-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Corner className={styles.corner} data-test-id={`${dataTestId}-corner`} />\n </RadixScrollArea.Root>\n );\n};\n\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(ScrollAreaComponent);\nScrollArea.displayName = 'ScrollArea';\n"],"names":["ScrollAreaComponent","type","maxHeight","maxWidth","children","dataTestId","ref","jsxs","RadixScrollArea","styles","jsx","ScrollArea","forwardRef"],"mappings":";;;;AA8BA,MAAMA,IAAsB,CACxB;AAAA,EACI,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,GACAC,MAGI,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACG,MAAAP;AAAA,IACA,WAAWQ,EAAO;AAAA,IAClB,OAAO,EAAE,UAAAN,EAAS;AAAA,IAClB,gBAAcE;AAAA,IACd,KAAAC;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,OAAO,EAAE,WAAAP,EAAU;AAAA,UACnB,gBAAc,GAAGG,CAAU;AAAA,UAE1B,UAAAD;AAAA,QAAA;AAAA,MACL;AAAA,MACA,gBAAAM;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACJ;AAAA,MACA,gBAAAK;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACJ;AAAA,MACA,gBAAAK,EAACF,EAAgB,QAAhB,EAAuB,WAAWC,EAAO,QAAQ,gBAAc,GAAGJ,CAAU,UAAW,CAAA;AAAA,IAAA;AAAA,EAAA;AAC5F,GAIKM,IAAaC,EAA4CZ,CAAmB;AACzFW,EAAW,cAAc;"}
1
+ {"version":3,"file":"fondue-components15.js","sources":["../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixScrollArea from '@radix-ui/react-scroll-area';\nimport { type ForwardedRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport styles from './styles/scrollArea.module.scss';\n\nexport type ScrollAreaProps = {\n /**\n * \"auto\" visible when content is overflowing on the corresponding orientation.\n * \"always\" always visible regardless of whether the content is overflowing.\n * \"scroll\" visible when the user is scrolling along its corresponding orientation.\n * \"hover\" when the user is hovering over the scroll area.\n * @default 'hover'\n */\n type?: 'auto' | 'always' | 'scroll' | 'hover';\n /**\n * Maximum height of the scroll area\n * @default '100%'\n */\n maxHeight?: string | number;\n /**\n * Minimum width of the scroll area\n * @default '100%'\n */\n maxWidth?: string | number;\n /**\n * Determines if a inset shadow should be shown the edge of the component\n */\n showShadow?: boolean;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nconst ScrollAreaComponent = (\n {\n type,\n maxHeight = '100%',\n maxWidth = '100%',\n showShadow = false,\n children,\n 'data-test-id': dataTestId = 'fondue-scroll-area',\n }: ScrollAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement => {\n return (\n <RadixScrollArea.Root\n type={type}\n className={styles.root}\n style={{ maxWidth }}\n data-test-id={dataTestId}\n ref={ref}\n >\n <RadixScrollArea.Viewport\n className={styles.viewport}\n style={{ maxHeight }}\n data-test-id={`${dataTestId}-viewport`}\n data-show-shadow={showShadow}\n >\n {children}\n </RadixScrollArea.Viewport>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"vertical\"\n data-test-id={`${dataTestId}-vertical-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-vertical-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Scrollbar\n className={styles.scrollbar}\n orientation=\"horizontal\"\n data-test-id={`${dataTestId}-horizontal-scrollbar`}\n >\n <RadixScrollArea.Thumb\n className={styles.thumb}\n data-test-id={`${dataTestId}-horizontal-scrollbar-thumb`}\n />\n </RadixScrollArea.Scrollbar>\n <RadixScrollArea.Corner className={styles.corner} data-test-id={`${dataTestId}-corner`} />\n </RadixScrollArea.Root>\n );\n};\n\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(ScrollAreaComponent);\nScrollArea.displayName = 'ScrollArea';\n"],"names":["ScrollAreaComponent","type","maxHeight","maxWidth","showShadow","children","dataTestId","ref","jsxs","RadixScrollArea","styles","jsx","ScrollArea","forwardRef"],"mappings":";;;;AAkCA,MAAMA,IAAsB,CACxB;AAAA,EACI,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AACjC,GACAC,MAGI,gBAAAC;AAAA,EAACC,EAAgB;AAAA,EAAhB;AAAA,IACG,MAAAR;AAAA,IACA,WAAWS,EAAO;AAAA,IAClB,OAAO,EAAE,UAAAP,EAAS;AAAA,IAClB,gBAAcG;AAAA,IACd,KAAAC;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,OAAO,EAAE,WAAAR,EAAU;AAAA,UACnB,gBAAc,GAAGI,CAAU;AAAA,UAC3B,oBAAkBF;AAAA,UAEjB,UAAAC;AAAA,QAAA;AAAA,MACL;AAAA,MACA,gBAAAM;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACJ;AAAA,MACA,gBAAAK;AAAA,QAACF,EAAgB;AAAA,QAAhB;AAAA,UACG,WAAWC,EAAO;AAAA,UAClB,aAAY;AAAA,UACZ,gBAAc,GAAGJ,CAAU;AAAA,UAE3B,UAAA,gBAAAK;AAAA,YAACF,EAAgB;AAAA,YAAhB;AAAA,cACG,WAAWC,EAAO;AAAA,cAClB,gBAAc,GAAGJ,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACJ;AAAA,MACA,gBAAAK,EAACF,EAAgB,QAAhB,EAAuB,WAAWC,EAAO,QAAQ,gBAAc,GAAGJ,CAAU,UAAW,CAAA;AAAA,IAAA;AAAA,EAAA;AAC5F,GAIKM,IAAaC,EAA4Cb,CAAmB;AACzFY,EAAW,cAAc;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as d, jsx as a, Fragment as n } from "react/jsx-runtime";
2
2
  import { IconDroplet as p, IconTrashBin as f, IconCaretDown as I } from "@frontify/fondue-icons";
3
3
  import { forwardRef as N, useId as h } from "react";
4
- import i from "./fondue-components62.js";
4
+ import i from "./fondue-components63.js";
5
5
  import { colorToCss as b } from "./fondue-components35.js";
6
6
  const c = ({ id: t, currentColor: e, onClear: s, "data-test-id": r = "color-picker-input", ...l }, m) => {
7
7
  const o = h();
@@ -1,20 +1,20 @@
1
- const t = "_content_8laf8_5", n = "_subContent_8laf8_6", o = "_item_8laf8_19", e = "_subTrigger_8laf8_19", s = "_itemContent_8laf8_87", _ = "_subMenuIndicator_8laf8_98", u = "_group_8laf8_104", c = "_slot_8laf8_111", a = {
1
+ const t = "_content_gavk2_5", n = "_subContent_gavk2_6", o = "_item_gavk2_19", e = "_subTrigger_gavk2_19", s = "_itemContent_gavk2_96", _ = "_subMenuIndicator_gavk2_107", g = "_group_gavk2_113", u = "_slot_gavk2_120", c = {
2
2
  content: t,
3
3
  subContent: n,
4
4
  item: o,
5
5
  subTrigger: e,
6
6
  itemContent: s,
7
7
  subMenuIndicator: _,
8
- group: u,
9
- slot: c
8
+ group: g,
9
+ slot: u
10
10
  };
11
11
  export {
12
12
  t as content,
13
- a as default,
14
- u as group,
13
+ c as default,
14
+ g as group,
15
15
  o as item,
16
16
  s as itemContent,
17
- c as slot,
17
+ u as slot,
18
18
  n as subContent,
19
19
  _ as subMenuIndicator,
20
20
  e as subTrigger
@@ -1,4 +1,4 @@
1
- const o = "_root_16is5_3", r = "_viewport_16is5_10", t = "_scrollbar_16is5_16", s = "_thumb_16is5_48", _ = "_corner_16is5_66", c = {
1
+ const o = "_root_uxsne_3", r = "_viewport_uxsne_10", t = "_scrollbar_uxsne_19", s = "_thumb_uxsne_51", _ = "_corner_uxsne_69", e = {
2
2
  root: o,
3
3
  viewport: r,
4
4
  scrollbar: t,
@@ -7,7 +7,7 @@ const o = "_root_16is5_3", r = "_viewport_16is5_10", t = "_scrollbar_16is5_16",
7
7
  };
8
8
  export {
9
9
  _ as corner,
10
- c as default,
10
+ e as default,
11
11
  o as root,
12
12
  t as scrollbar,
13
13
  s as thumb,
@@ -4,7 +4,7 @@ import { Slot as P } from "@radix-ui/react-slot";
4
4
  import { useRef as S, isValidElement as C } from "react";
5
5
  import { usePreventDropdownOverflow as M } from "./fondue-components39.js";
6
6
  import n from "./fondue-components53.js";
7
- import { recursiveMap as N, getSelectOptionValue as V } from "./fondue-components63.js";
7
+ import { recursiveMap as N, getSelectOptionValue as V } from "./fondue-components62.js";
8
8
  const x = ({
9
9
  highlightedIndex: p,
10
10
  getMenuProps: u,
@@ -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-components50.js";
5
5
  import { ForwardedRefSelectSlot as c } from "./fondue-components52.js";
6
- import { getSelectOptionValue as I } from "./fondue-components63.js";
6
+ import { getSelectOptionValue as I } from "./fondue-components62.js";
7
7
  const S = (r) => {
8
8
  const t = [];
9
9
  return f.forEach(r, (o) => {
@@ -1,14 +1,42 @@
1
- const o = "_root_18q6l_5", c = "_colorName_18q6l_60", t = "_colorIndicator_18q6l_64", r = "_caret_18q6l_70", l = {
2
- root: o,
3
- colorName: c,
4
- colorIndicator: t,
5
- caret: r
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components50.js";
3
+ const g = ({
4
+ children: r,
5
+ value: o,
6
+ label: s
7
+ }) => r && typeof r == "string" ? {
8
+ value: o || r,
9
+ label: s || r
10
+ } : {
11
+ value: o || "",
12
+ label: s || o || ""
13
+ }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
+ const n = [];
15
+ let t = 0;
16
+ return a.forEach(r, (e) => {
17
+ if (w(e, E) && u(e))
18
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
+ else if (u(e) && (e != null && e.props.children)) {
20
+ const { parsedChildren: m, subElementCount: C } = y(
21
+ e.props.children,
22
+ o,
23
+ "",
24
+ p + t
25
+ );
26
+ e = f(e, {
27
+ children: m,
28
+ key: `group-${p + t}`
29
+ }), n.push(e), t += C;
30
+ } else
31
+ n.push(e);
32
+ }), {
33
+ parsedChildren: n,
34
+ subElementCount: t
35
+ };
6
36
  };
7
37
  export {
8
- r as caret,
9
- t as colorIndicator,
10
- c as colorName,
11
- l as default,
12
- o as root
38
+ g as getSelectOptionValue,
39
+ w as isReactLeaf,
40
+ y as recursiveMap
13
41
  };
14
42
  //# sourceMappingURL=fondue-components62.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components62.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"fondue-components62.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAC3B,IAGG;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AACpC,GAkBSE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAC;AACxC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAChB;AACA,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EACrB;AACJ;"}
@@ -1,42 +1,14 @@
1
- import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
- import { ForwardedRefSelectItem as E } from "./fondue-components50.js";
3
- const g = ({
4
- children: r,
5
- value: o,
6
- label: s
7
- }) => r && typeof r == "string" ? {
8
- value: o || r,
9
- label: s || r
10
- } : {
11
- value: o || "",
12
- label: s || o || ""
13
- }, w = (r, o) => u(r) && r.type === o, y = (r, o, s, p = 0) => {
14
- const n = [];
15
- let t = 0;
16
- return a.forEach(r, (e) => {
17
- if (w(e, E) && u(e))
18
- g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(o(e, p + t)), t++);
19
- else if (u(e) && (e != null && e.props.children)) {
20
- const { parsedChildren: m, subElementCount: C } = y(
21
- e.props.children,
22
- o,
23
- "",
24
- p + t
25
- );
26
- e = f(e, {
27
- children: m,
28
- key: `group-${p + t}`
29
- }), n.push(e), t += C;
30
- } else
31
- n.push(e);
32
- }), {
33
- parsedChildren: n,
34
- subElementCount: t
35
- };
1
+ const o = "_root_18q6l_5", c = "_colorName_18q6l_60", t = "_colorIndicator_18q6l_64", r = "_caret_18q6l_70", l = {
2
+ root: o,
3
+ colorName: c,
4
+ colorIndicator: t,
5
+ caret: r
36
6
  };
37
7
  export {
38
- g as getSelectOptionValue,
39
- w as isReactLeaf,
40
- y as recursiveMap
8
+ r as caret,
9
+ t as colorIndicator,
10
+ c as colorName,
11
+ l as default,
12
+ o as root
41
13
  };
42
14
  //# sourceMappingURL=fondue-components63.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components63.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value ? value : children,\n label: label ? label : children,\n };\n }\n\n return {\n value: value || '',\n label: label ? label : value || '',\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAIQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAC3B,IAGG;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AACpC,GAkBSE,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAC;AACxC,MAAIC,IAAc;AACT,SAAAC,EAAA,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAC1E,YAAA,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAChB;AACA,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GACbQ,KAAAI;AAAA,IAAA;AAEf,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAChC,CACH,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EACrB;AACJ;"}
1
+ {"version":3,"file":"fondue-components63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as I } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as I } from "react/jsx-runtime";
2
2
  import { IconCaretRight as h } from "@frontify/fondue-icons";
3
3
  import * as n from "@radix-ui/react-dropdown-menu";
4
4
  import { forwardRef as s, useRef as l } from "react";
@@ -8,66 +8,66 @@ import a from "./fondue-components40.js";
8
8
  const g = ({
9
9
  children: o,
10
10
  open: t,
11
- onOpenChange: r,
11
+ onOpenChange: e,
12
12
  "data-test-id": d = "fondue-dropdown"
13
- }) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: r, "data-test-id": d, children: o });
13
+ }) => /* @__PURE__ */ r(n.Root, { open: t, onOpenChange: e, "data-test-id": d, children: o });
14
14
  g.displayName = "Dropdown.Root";
15
- const D = ({ asChild: o = !0, children: t, "data-test-id": r = "fondue-dropdown-trigger" }, d) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": r, ref: d, children: t });
15
+ const D = ({ asChild: o = !0, children: t, "data-test-id": e = "fondue-dropdown-trigger" }, d) => /* @__PURE__ */ r(n.Trigger, { asChild: o, "data-test-id": e, ref: d, children: t });
16
16
  D.displayName = "Dropdown.Trigger";
17
17
  const b = ({
18
18
  onOpen: o,
19
19
  onClose: t,
20
- side: r = "bottom",
20
+ side: e = "bottom",
21
21
  padding: d = "comfortable",
22
- align: p = "start",
23
- children: u,
24
- "data-test-id": c = "fondue-dropdown-content"
25
- }, m) => {
26
- const i = l(null), w = l(!1), { setMaxHeight: F } = v(i);
27
- return /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
22
+ align: u = "start",
23
+ children: c,
24
+ "data-test-id": w = "fondue-dropdown-content"
25
+ }, i) => {
26
+ const p = l(null), m = l(!1), { setMaxHeight: F } = v(p);
27
+ return /* @__PURE__ */ r(n.Portal, { children: /* @__PURE__ */ r(
28
28
  n.Content,
29
29
  {
30
- align: p,
30
+ align: u,
31
31
  collisionPadding: 8,
32
32
  sideOffset: 8,
33
- side: r,
33
+ side: e,
34
34
  className: a.content,
35
35
  "data-padding": d,
36
- "data-test-id": c,
37
- ref: i,
36
+ "data-test-id": w,
37
+ ref: p,
38
38
  onCloseAutoFocus: () => {
39
- f(i, m), t && t(), w.current = !1;
39
+ f(p, i), t && t(), m.current = !1;
40
40
  },
41
41
  onFocus: () => {
42
- w.current || (F(), f(i, m), o && o(), w.current = !0);
42
+ m.current || (F(), f(p, i), o && o(), m.current = !0);
43
43
  },
44
- children: u
44
+ children: c
45
45
  }
46
46
  ) });
47
47
  };
48
48
  b.displayName = "Dropdown.Content";
49
- const N = ({ 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 });
49
+ const N = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, e) => /* @__PURE__ */ r(n.Group, { className: a.group, "data-test-id": t, ref: e, children: o });
50
50
  N.displayName = "Dropdown.Group";
51
51
  const S = ({
52
52
  children: o,
53
53
  "data-test-id": t = "fondue-dropdown-submenu"
54
- }) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
54
+ }) => /* @__PURE__ */ r(n.Sub, { "data-test-id": t, children: o });
55
55
  S.displayName = "Dropdown.SubMenu";
56
- const R = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => /* @__PURE__ */ I(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
57
- /* @__PURE__ */ e("div", { className: a.itemContent, children: o }),
58
- /* @__PURE__ */ e(h, { className: a.subMenuIndicator, size: 16 })
56
+ const R = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, e) => /* @__PURE__ */ I(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: e, children: [
57
+ /* @__PURE__ */ r("div", { className: a.itemContent, children: o }),
58
+ /* @__PURE__ */ r(h, { className: a.subMenuIndicator, size: 16 })
59
59
  ] });
60
60
  R.displayName = "Dropdown.SubTrigger";
61
61
  const C = ({
62
62
  padding: o = "comfortable",
63
63
  children: t,
64
- "data-test-id": r = "fondue-dropdown-subcontent"
65
- }, d) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
64
+ "data-test-id": e = "fondue-dropdown-subcontent"
65
+ }, d) => /* @__PURE__ */ r(n.Portal, { children: /* @__PURE__ */ r(
66
66
  n.SubContent,
67
67
  {
68
68
  className: a.subContent,
69
69
  "data-padding": o,
70
- "data-test-id": r,
70
+ "data-test-id": e,
71
71
  ref: d,
72
72
  children: t
73
73
  }
@@ -76,25 +76,27 @@ C.displayName = "Dropdown.SubContent";
76
76
  const y = ({
77
77
  children: o,
78
78
  disabled: t,
79
- textValue: r,
79
+ textValue: e,
80
80
  onSelect: d,
81
- "data-test-id": p = "fondue-dropdown-subtrigger",
82
- ...u
83
- }, c) => /* @__PURE__ */ e(
81
+ emphasis: u = "default",
82
+ "data-test-id": c = "fondue-dropdown-subtrigger",
83
+ ...w
84
+ }, i) => /* @__PURE__ */ r(
84
85
  n.Item,
85
86
  {
86
87
  onSelect: d,
87
88
  className: a.item,
88
- textValue: r,
89
- "data-test-id": p,
90
- ref: c,
89
+ textValue: e,
90
+ "data-test-id": c,
91
+ "data-emphasis": u,
92
+ ref: i,
91
93
  disabled: t,
92
- ...u,
93
- children: /* @__PURE__ */ e("div", { className: a.itemContent, children: o })
94
+ ...w,
95
+ children: /* @__PURE__ */ r("div", { className: a.itemContent, children: o })
94
96
  }
95
97
  );
96
98
  y.displayName = "Dropdown.Item";
97
- const T = ({ 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 });
99
+ const T = ({ children: o, name: t, "data-test-id": e = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ r("div", { "data-name": t, className: a.slot, "data-test-id": e, ref: d, children: o });
98
100
  T.displayName = "Dropdown.Slot";
99
101
  const x = s(D), G = s(b), M = s(N), P = s(R), j = s(C), O = s(y), z = s(T), J = {
100
102
  Root: g,
@@ -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 { forwardRef, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\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 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\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 { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dropdown-trigger' }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n onOpen?: () => void;\n onClose?: () => void;\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\nexport const DropdownContent = (\n {\n onOpen,\n onClose,\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n const dropdownIsOpen = useRef(false);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\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={localRef}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n onClose && onClose();\n dropdownIsOpen.current = false;\n }}\n onFocus={() => {\n if (!dropdownIsOpen.current) {\n setMaxHeight();\n syncRefs(localRef, ref);\n onOpen && onOpen();\n dropdownIsOpen.current = true;\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 return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n <div className={styles.itemContent}>{children}</div>\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 * 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 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n ref={ref}\n disabled={disabled}\n {...props}\n >\n <div className={styles.itemContent}>{children}</div>\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","ref","DropdownContent","onOpen","onClose","side","padding","align","localRef","useRef","dropdownIsOpen","setMaxHeight","usePreventDropdownOverflow","styles","syncRefs","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","props","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,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYd,MAAAO,IAAkB,CAC3B,EAAE,SAAAC,IAAU,IAAM,UAAAP,GAAU,gBAAgBG,IAAa,0BAA0B,GACnFK,MAGI,gBAAAJ,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAK,GAC9D,UAAAR,GACL;AAGRM,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gB/B,IAAa,uBAAuB,GACtEK,MAGI,gBAAAJ,EAAC,OAAI,EAAA,aAAW8B,GAAM,WAAWd,EAAO,MAAM,gBAAcjB,GAAY,KAAAK,GACnE,UAAAR,EACL,CAAA;AAGRiC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoD9B,CAAe,GACjG+B,IAA8BD,EAAiD3B,CAAe,GAC9F6B,IAA4BF,EAA+Cd,CAAa,GACxFiB,IAAiCH,EAAoDZ,CAAkB,GACvGgB,IAAiCJ,EAAoDT,CAAkB,GACvGc,IAA2BL,EAA8CR,CAAY,GACrFc,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM5C;AAAA,EACN,SAASoC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASf;AAAA,EACT,YAAYgB;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 { forwardRef, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\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 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\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 { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dropdown-trigger' }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n onOpen?: () => void;\n onClose?: () => void;\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\nexport const DropdownContent = (\n {\n onOpen,\n onClose,\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n const dropdownIsOpen = useRef(false);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\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={localRef}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n onClose && onClose();\n dropdownIsOpen.current = false;\n }}\n onFocus={() => {\n if (!dropdownIsOpen.current) {\n setMaxHeight();\n syncRefs(localRef, ref);\n onOpen && onOpen();\n dropdownIsOpen.current = true;\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 return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n <div className={styles.itemContent}>{children}</div>\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 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 {...props}\n >\n <div className={styles.itemContent}>{children}</div>\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","ref","DropdownContent","onOpen","onClose","side","padding","align","localRef","useRef","dropdownIsOpen","setMaxHeight","usePreventDropdownOverflow","styles","syncRefs","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","props","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,EACA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYd,MAAAO,IAAkB,CAC3B,EAAE,SAAAC,IAAU,IAAM,UAAAP,GAAU,gBAAgBG,IAAa,0BAA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,EAAA,OAAA,EAAI,WAAWgB,EAAO,aAAc,UAAApB,EAAS,CAAA;AAAA,EAAA;AAClD;AAGR4B,EAAa,cAAc;AAId,MAAAM,IAAe,CACxB,EAAE,UAAAlC,GAAU,MAAAmC,GAAM,gBAAgBhC,IAAa,uBAAuB,GACtEK,MAGI,gBAAAJ,EAAC,OAAI,EAAA,aAAW+B,GAAM,WAAWf,EAAO,MAAM,gBAAcjB,GAAY,KAAAK,GACnE,UAAAR,EACL,CAAA;AAGRkC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoD/B,CAAe,GACjGgC,IAA8BD,EAAiD5B,CAAe,GAC9F8B,IAA4BF,EAA+Cf,CAAa,GACxFkB,IAAiCH,EAAoDb,CAAkB,GACvGiB,IAAiCJ,EAAoDV,CAAkB,GACvGe,IAA2BL,EAA8CT,CAAY,GACrFe,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM7C;AAAA,EACN,SAASqC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAAShB;AAAA,EACT,YAAYiB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
package/dist/index.d.ts CHANGED
@@ -514,6 +514,11 @@ declare type DropdownItemProps = {
514
514
  * The text value of the item that is passed to the onSelect callback.
515
515
  */
516
516
  textValue?: string;
517
+ /**
518
+ * The style of the item.
519
+ * @default "default"
520
+ */
521
+ emphasis?: 'default' | 'danger';
517
522
  /**
518
523
  * Callback that is called when the item is selected.
519
524
  */
@@ -1006,6 +1011,10 @@ declare type ScrollAreaProps = {
1006
1011
  * @default '100%'
1007
1012
  */
1008
1013
  maxWidth?: string | number;
1014
+ /**
1015
+ * Determines if a inset shadow should be shown the edge of the component
1016
+ */
1017
+ showShadow?: boolean;
1009
1018
  'data-test-id'?: string;
1010
1019
  children: ReactNode;
1011
1020
  };