@frontify/fondue-components 21.0.0 → 22.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,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import s from "./fondue-components85.js";
3
- import { colorToCss as e } from "./fondue-components86.js";
2
+ import s from "./fondue-components88.js";
3
+ import { colorToCss as e } from "./fondue-components89.js";
4
4
  const a = ["default", "positive", "highlight", "warning", "negative"], i = (t) => typeof t == "string" && a.includes(t), p = ({ status: t }) => {
5
5
  const o = i(t) ? { "data-status": t } : { style: { backgroundColor: typeof t == "string" ? t : e(t) || "transparent" } };
6
6
  return /* @__PURE__ */ r("div", { "data-test-id": "badge-status", className: s.root, ...o });
@@ -1,4 +1,4 @@
1
- import { FOCUS_OUTLINE as t } from "./fondue-components87.js";
1
+ import { FOCUS_OUTLINE as t } from "./fondue-components85.js";
2
2
  import { sv as e } from "./fondue-components38.js";
3
3
  const o = e({
4
4
  base: `tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium tw-box-border tw-whitespace-nowrap tw-transition-colors ${t}`,
@@ -1,4 +1,4 @@
1
- import { FOCUS_OUTLINE as t } from "./fondue-components87.js";
1
+ import { FOCUS_OUTLINE as t } from "./fondue-components85.js";
2
2
  import { sv as e } from "./fondue-components38.js";
3
3
  const s = e({
4
4
  base: `tw-peer tw-relative tw-inline-flex tw-bg-base tw-text-white tw-shrink-0 tw-rounded tw-border tw-border-line-x-strong group-hover:tw-border-line-xx-strong hover:tw-border-line-xx-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-base disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-box-disabled-strong data-[readonly="true"]:tw-pointer-events-none ${t}`,
@@ -2,7 +2,7 @@ import { jsxs as t, jsx as a, Fragment as f } from "react/jsx-runtime";
2
2
  import { IconDroplet as h, IconCross as I, IconCaretDown as v } from "@frontify/fondue-icons";
3
3
  import { forwardRef as k } from "react";
4
4
  import { Button as w } from "./fondue-components6.js";
5
- import s from "./fondue-components88.js";
5
+ import s from "./fondue-components90.js";
6
6
  import { getColorWithName as y, colorToCss as z } from "./fondue-components47.js";
7
7
  const c = ({
8
8
  id: m,
@@ -1,8 +1,8 @@
1
- const t = "_root_1yzu4_5", e = "_item_1yzu4_30", a = "_itemLabel_1yzu4_50", i = "_itemLabelActive_1yzu4_70", o = "_itemLabelInactive_1yzu4_100", _ = "_activeIndicator_1yzu4_130", c = "_separator_1yzu4_227", n = {
1
+ const t = "_root_12yi8_5", e = "_item_12yi8_29", i = "_itemLabel_12yi8_50", a = "_itemLabelActive_12yi8_72", o = "_itemLabelInactive_12yi8_102", _ = "_activeIndicator_12yi8_132", c = "_separator_12yi8_229", n = {
2
2
  root: t,
3
3
  item: e,
4
- itemLabel: a,
5
- itemLabelActive: i,
4
+ itemLabel: i,
5
+ itemLabelActive: a,
6
6
  itemLabelInactive: o,
7
7
  activeIndicator: _,
8
8
  separator: c
@@ -11,8 +11,8 @@ export {
11
11
  _ as activeIndicator,
12
12
  n as default,
13
13
  e as item,
14
- a as itemLabel,
15
- i as itemLabelActive,
14
+ i as itemLabel,
15
+ a as itemLabelActive,
16
16
  o as itemLabelInactive,
17
17
  t as root,
18
18
  c as separator
@@ -4,7 +4,7 @@ import { Slot as V } from "@radix-ui/react-slot";
4
4
  import { isValidElement as g } from "react";
5
5
  import { useFondueTheme as A, ThemeProvider as D } from "./fondue-components31.js";
6
6
  import s from "./fondue-components70.js";
7
- import { recursiveMap as M, getSelectOptionValue as T } from "./fondue-components89.js";
7
+ import { recursiveMap as M, getSelectOptionValue as T } from "./fondue-components86.js";
8
8
  const E = ({
9
9
  highlightedIndex: p,
10
10
  getMenuProps: c,
@@ -1,9 +1,9 @@
1
1
  import { jsx as E } from "react/jsx-runtime";
2
2
  import { useState as S, useMemo as b, Children as v, isValidElement as C, cloneElement as w, useCallback as B, useEffect as x } from "react";
3
- import { SelectClear as F } from "./fondue-components90.js";
3
+ import { SelectClear as F } from "./fondue-components87.js";
4
4
  import { ForwardedRefSelectItem as L } from "./fondue-components67.js";
5
5
  import { ForwardedRefSelectSlot as y } from "./fondue-components69.js";
6
- import { getSelectOptionValue as I } from "./fondue-components89.js";
6
+ import { getSelectOptionValue as I } from "./fondue-components86.js";
7
7
  const O = (n, s) => {
8
8
  const [e, r] = S(!1), [m, i] = S(null), [l, f] = S({
9
9
  menuComponents: [],
@@ -1,8 +1,5 @@
1
- const o = "_root_e5fqt_2", t = {
2
- root: o
3
- };
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";
4
2
  export {
5
- t as default,
6
- o as root
3
+ t as FOCUS_OUTLINE
7
4
  };
8
5
  //# sourceMappingURL=fondue-components85.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components85.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"fondue-components85.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,8 +1,43 @@
1
- const r = (e) => {
2
- if (e)
3
- return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
1
+ import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
+ import { ForwardedRefSelectItem as E } from "./fondue-components67.js";
3
+ const g = ({
4
+ children: o,
5
+ value: r,
6
+ label: s
7
+ }) => o && typeof o == "string" ? {
8
+ value: r || o,
9
+ label: s || o
10
+ } : {
11
+ value: r || "",
12
+ label: s || r || "",
13
+ ...o ? { children: o } : null
14
+ }, w = (o, r) => u(o) && o.type === r, y = (o, r, s, p = 0) => {
15
+ const n = [];
16
+ let t = 0;
17
+ return a.forEach(o, (e) => {
18
+ if (w(e, E) && u(e))
19
+ g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
20
+ else if (u(e) && (e != null && e.props.children)) {
21
+ const { parsedChildren: m, subElementCount: C } = y(
22
+ e.props.children,
23
+ r,
24
+ "",
25
+ p + t
26
+ );
27
+ e = f(e, {
28
+ children: m,
29
+ key: `group-${p + t}`
30
+ }), n.push(e), t += C;
31
+ } else
32
+ n.push(e);
33
+ }), {
34
+ parsedChildren: n,
35
+ subElementCount: t
36
+ };
4
37
  };
5
38
  export {
6
- r as colorToCss
39
+ g as getSelectOptionValue,
40
+ w as isReactLeaf,
41
+ y as recursiveMap
7
42
  };
8
43
  //# sourceMappingURL=fondue-components86.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components86.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
1
+ {"version":3,"file":"fondue-components86.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, children?: ReactNode }} 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 children?: ReactNode;\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 ...(children ? { children } : null),\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,MAKQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAAA,IAIxB;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AAAA,EAChC,GAAID,IAAW,EAAE,UAAAA,MAAa;AAAA,GAmBzBG,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AAClB,SAAAC,EAAS,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;AAChF,YAAM,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GAC5BQ,KAAeI;AAAA,IACnB;AACI,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAEpC,CAAC,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}
@@ -1,5 +1,9 @@
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
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { IconCross as s } from "@frontify/fondue-icons";
3
+ import { Button as o } from "./fondue-components6.js";
4
+ import t from "./fondue-components70.js";
5
+ const c = ({ onClear: r }) => /* @__PURE__ */ e(o, { "aria-label": "clear input", type: "button", size: "small", emphasis: "weak", aspect: "square", onPress: r, children: /* @__PURE__ */ e(s, { className: t.clearIcon, size: 16 }) });
2
6
  export {
3
- t as FOCUS_OUTLINE
7
+ c as SelectClear
4
8
  };
5
9
  //# sourceMappingURL=fondue-components87.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components87.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-components87.js","sources":["../src/components/Select/SelectClear.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\n\nimport { Button } from '../Button/Button';\n\nimport styles from './styles/select.module.scss';\n\nexport const SelectClear = ({ onClear }: { onClear?: () => void }) => {\n return (\n <Button aria-label=\"clear input\" type=\"button\" size=\"small\" emphasis=\"weak\" aspect=\"square\" onPress={onClear}>\n <IconCross className={styles.clearIcon} size={16} />\n </Button>\n );\n};\n"],"names":["SelectClear","onClear","jsx","Button","IconCross","styles"],"mappings":";;;;AAQO,MAAMA,IAAc,CAAC,EAAE,SAAAC,QAEtB,gBAAAC,EAACC,KAAO,cAAW,eAAc,MAAK,UAAS,MAAK,SAAQ,UAAS,QAAO,QAAO,UAAS,SAASF,GACjG,UAAA,gBAAAC,EAACE,GAAA,EAAU,WAAWC,EAAO,WAAW,MAAM,GAAA,CAAI,EAAA,CACtD;"}
@@ -1,20 +1,8 @@
1
- const o = "_root_x0mxj_5", c = "_clearIcon_x0mxj_35", t = "_caret_x0mxj_52", _ = "_colorName_x0mxj_70", n = "_button_x0mxj_91", r = "_colorIndicator_x0mxj_104", a = "_actions_x0mxj_123", x = {
2
- root: o,
3
- clearIcon: c,
4
- caret: t,
5
- colorName: _,
6
- button: n,
7
- colorIndicator: r,
8
- actions: a
1
+ const o = "_root_e5fqt_2", t = {
2
+ root: o
9
3
  };
10
4
  export {
11
- a as actions,
12
- n as button,
13
- t as caret,
14
- c as clearIcon,
15
- r as colorIndicator,
16
- _ as colorName,
17
- x as default,
5
+ t as default,
18
6
  o as root
19
7
  };
20
8
  //# sourceMappingURL=fondue-components88.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components88.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components88.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,43 +1,8 @@
1
- import { Children as a, isValidElement as u, cloneElement as f } from "react";
2
- import { ForwardedRefSelectItem as E } from "./fondue-components67.js";
3
- const g = ({
4
- children: o,
5
- value: r,
6
- label: s
7
- }) => o && typeof o == "string" ? {
8
- value: r || o,
9
- label: s || o
10
- } : {
11
- value: r || "",
12
- label: s || r || "",
13
- ...o ? { children: o } : null
14
- }, w = (o, r) => u(o) && o.type === r, y = (o, r, s, p = 0) => {
15
- const n = [];
16
- let t = 0;
17
- return a.forEach(o, (e) => {
18
- if (w(e, E) && u(e))
19
- g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
20
- else if (u(e) && (e != null && e.props.children)) {
21
- const { parsedChildren: m, subElementCount: C } = y(
22
- e.props.children,
23
- r,
24
- "",
25
- p + t
26
- );
27
- e = f(e, {
28
- children: m,
29
- key: `group-${p + t}`
30
- }), n.push(e), t += C;
31
- } else
32
- n.push(e);
33
- }), {
34
- parsedChildren: n,
35
- subElementCount: t
36
- };
1
+ const r = (e) => {
2
+ if (e)
3
+ return `rgba(${e.red}, ${e.green}, ${e.blue}, ${e.alpha ?? 1})`;
37
4
  };
38
5
  export {
39
- g as getSelectOptionValue,
40
- w as isReactLeaf,
41
- y as recursiveMap
6
+ r as colorToCss
42
7
  };
43
8
  //# sourceMappingURL=fondue-components89.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components89.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, children?: ReactNode }} 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 children?: ReactNode;\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 ...(children ? { children } : null),\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,MAKQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,KAAgBD;AAAA,EACvB,OAAOE,KAAgBF;AAAA,IAIxB;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,KAAgBD,KAAS;AAAA,EAChC,GAAID,IAAW,EAAE,UAAAA,MAAa;AAAA,GAmBzBG,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AAClB,SAAAC,EAAS,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;AAChF,YAAM,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GAC5BQ,KAAeI;AAAA,IACnB;AACI,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAEpC,CAAC,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}
1
+ {"version":3,"file":"fondue-components89.js","sources":["../src/components/Badge/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type RgbaColor } from './types';\n\nexport const DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1, name: '' };\n\n/**\n * Converts a color object to a CSS color string.\n * @param {RgbaColor} color - The color object to be converted.\n * @returns {string}\n * @example\n * colorToCss({ red: 255, green: 255, blue: 255, alpha: 1 }); // 'rgba(255, 255, 255, 1)'\n * @example\n * colorToCss({ red: 255, green: 87, blue: 51, alpha: 1 }); // 'rgba(255, 87, 51, 1)'\n * @example\n * colorToCss({ red: 0, green: 0, blue: 0, alpha: 0 }); // 'rgba(0, 0, 0, 0)'\n */\nexport const colorToCss = (color?: RgbaColor) => {\n if (!color) {\n return undefined;\n }\n return `rgba(${color.red}, ${color.green}, ${color.blue}, ${color.alpha ?? 1})`;\n};\n"],"names":["colorToCss","color"],"mappings":"AAiBO,MAAMA,IAAa,CAACC,MAAsB;AAC7C,MAAKA;AAGL,WAAO,QAAQA,EAAM,GAAG,KAAKA,EAAM,KAAK,KAAKA,EAAM,IAAI,KAAKA,EAAM,SAAS,CAAC;AAChF;"}
@@ -1,9 +1,20 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { IconCross as s } from "@frontify/fondue-icons";
3
- import { Button as o } from "./fondue-components6.js";
4
- import t from "./fondue-components70.js";
5
- const c = ({ onClear: r }) => /* @__PURE__ */ e(o, { "aria-label": "clear input", type: "button", size: "small", emphasis: "weak", aspect: "square", onPress: r, children: /* @__PURE__ */ e(s, { className: t.clearIcon, size: 16 }) });
1
+ const o = "_root_x0mxj_5", c = "_clearIcon_x0mxj_35", t = "_caret_x0mxj_52", _ = "_colorName_x0mxj_70", n = "_button_x0mxj_91", r = "_colorIndicator_x0mxj_104", a = "_actions_x0mxj_123", x = {
2
+ root: o,
3
+ clearIcon: c,
4
+ caret: t,
5
+ colorName: _,
6
+ button: n,
7
+ colorIndicator: r,
8
+ actions: a
9
+ };
6
10
  export {
7
- c as SelectClear
11
+ a as actions,
12
+ n as button,
13
+ t as caret,
14
+ c as clearIcon,
15
+ r as colorIndicator,
16
+ _ as colorName,
17
+ x as default,
18
+ o as root
8
19
  };
9
20
  //# sourceMappingURL=fondue-components90.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components90.js","sources":["../src/components/Select/SelectClear.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\n\nimport { Button } from '../Button/Button';\n\nimport styles from './styles/select.module.scss';\n\nexport const SelectClear = ({ onClear }: { onClear?: () => void }) => {\n return (\n <Button aria-label=\"clear input\" type=\"button\" size=\"small\" emphasis=\"weak\" aspect=\"square\" onPress={onClear}>\n <IconCross className={styles.clearIcon} size={16} />\n </Button>\n );\n};\n"],"names":["SelectClear","onClear","jsx","Button","IconCross","styles"],"mappings":";;;;AAQO,MAAMA,IAAc,CAAC,EAAE,SAAAC,QAEtB,gBAAAC,EAACC,KAAO,cAAW,eAAc,MAAK,UAAS,MAAK,SAAQ,UAAS,QAAO,QAAO,UAAS,SAASF,GACjG,UAAA,gBAAAC,EAACE,GAAA,EAAU,WAAWC,EAAO,WAAW,MAAM,GAAA,CAAI,EAAA,CACtD;"}
1
+ {"version":3,"file":"fondue-components90.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}