@frontify/fondue-components 7.0.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components25.js +8 -8
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components44.js +6 -6
- package/dist/fondue-components53.js +1 -1
- package/dist/fondue-components56.js +1 -1
- package/dist/fondue-components68.js +14 -38
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +38 -14
- package/dist/fondue-components69.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const g = (
|
|
1
|
+
const g = (n) => n.startsWith("aria-") || n === "role", s = {
|
|
2
2
|
m: "margin",
|
|
3
3
|
mx: "margin-x",
|
|
4
4
|
my: "margin-y",
|
|
@@ -18,18 +18,18 @@ const g = (t) => t.startsWith("aria-") || t === "role", s = {
|
|
|
18
18
|
wrap: "flex-wrap",
|
|
19
19
|
columns: "grid-template-columns",
|
|
20
20
|
rows: "grid-template-rows"
|
|
21
|
-
}, m = (
|
|
22
|
-
if (g(
|
|
21
|
+
}, m = (n, r) => n === "columns" || n === "rows" ? typeof r == "number" ? `repeat(${r}, 1fr)` : r : typeof r == "number" ? `${r * 0.25}rem` : r, f = (n, r = {}) => Object.entries(n).reduce((i, [t, o]) => {
|
|
22
|
+
if (g(t))
|
|
23
23
|
return i;
|
|
24
|
-
const e =
|
|
24
|
+
const e = t in r ? r[t] : t in s ? s[t] : t, p = e == null ? void 0 : e.replaceAll(/([\da-z]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
25
25
|
if (typeof o == "object")
|
|
26
|
-
for (const [d,
|
|
27
|
-
|
|
26
|
+
for (const [d, a] of Object.entries(o))
|
|
27
|
+
a !== void 0 && (i[`--${d}-${p}`] = m(t, a));
|
|
28
28
|
else
|
|
29
|
-
i[`--${
|
|
29
|
+
i[`--${p}`] = m(t, o);
|
|
30
30
|
return i;
|
|
31
31
|
}, {});
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
f as propsToCssVariables
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=fondue-components25.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components25.js","sources":["../src/helpers/propsToCssVariables.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nimport { type Breakpoint } from './layout';\n\nconst isAriaProp = (key: string): boolean => {\n return key.startsWith('aria-') || key === 'role';\n};\n\nconst abbreviationToCssProperty: Record<string, string> = {\n m: 'margin',\n mx: 'margin-x',\n my: 'margin-y',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n p: 'padding',\n px: 'padding-x',\n py: 'padding-y',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n direction: 'flex-direction',\n align: 'align-items',\n wrap: 'flex-wrap',\n columns: 'grid-template-columns',\n rows: 'grid-template-rows',\n};\n\nconst transformValueBasedOnKey = (key: string, value: string | number): string | number => {\n if (key === 'columns' || key === 'rows') {\n if (typeof value === 'number') {\n return `repeat(${value}, 1fr)`;\n }\n return value;\n }\n return value;\n};\n\nexport const propsToCssVariables = (\n props: Record<string, string | number | boolean | { [key in Breakpoint]?: string | number | boolean }>,\n extraAbbreviationToCssProperty: Record<string, string> = {},\n): CSSProperties => {\n return Object.entries(props).reduce((acc, [key, value]) => {\n if (isAriaProp(key)) {\n return acc;\n }\n\n const cssProperty =\n key in extraAbbreviationToCssProperty\n ? extraAbbreviationToCssProperty[key]\n : key in abbreviationToCssProperty\n ? abbreviationToCssProperty[key]\n : key;\n const cssPropertyKebabCase = cssProperty?.replaceAll(/([\\da-z]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n\n if (typeof value === 'object') {\n for (const [breakpoint, breakpointValue] of Object.entries(value)) {\n if (breakpointValue !== undefined) {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${breakpoint}-${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, breakpointValue);\n }\n }\n } else {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, value);\n }\n\n return acc;\n }, {} as CSSProperties);\n};\n"],"names":["isAriaProp","key","abbreviationToCssProperty","transformValueBasedOnKey","value","propsToCssVariables","props","extraAbbreviationToCssProperty","acc","cssProperty","cssPropertyKebabCase","breakpoint","breakpointValue"],"mappings":"AAMA,MAAMA,IAAa,CAACC,MACTA,EAAI,WAAW,OAAO,KAAKA,MAAQ,QAGxCC,IAAoD;AAAA,EACtD,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AACV,GAEMC,IAA2B,CAACF,GAAaG,
|
|
1
|
+
{"version":3,"file":"fondue-components25.js","sources":["../src/helpers/propsToCssVariables.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nimport { type Breakpoint } from './layout';\n\nconst isAriaProp = (key: string): boolean => {\n return key.startsWith('aria-') || key === 'role';\n};\n\nconst abbreviationToCssProperty: Record<string, string> = {\n m: 'margin',\n mx: 'margin-x',\n my: 'margin-y',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n p: 'padding',\n px: 'padding-x',\n py: 'padding-y',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n direction: 'flex-direction',\n align: 'align-items',\n wrap: 'flex-wrap',\n columns: 'grid-template-columns',\n rows: 'grid-template-rows',\n};\n\nconst transformValueBasedOnKey = (key: string, value: string | number): string | number => {\n if (key === 'columns' || key === 'rows') {\n if (typeof value === 'number') {\n return `repeat(${value}, 1fr)`;\n }\n return value;\n }\n\n // Spacing tokens\n if (typeof value === 'number') {\n return `${value * 0.25}rem`;\n }\n\n return value;\n};\n\nexport const propsToCssVariables = (\n props: Record<string, string | number | boolean | { [key in Breakpoint]?: string | number | boolean }>,\n extraAbbreviationToCssProperty: Record<string, string> = {},\n): CSSProperties => {\n return Object.entries(props).reduce((acc, [key, value]) => {\n if (isAriaProp(key)) {\n return acc;\n }\n\n const cssProperty =\n key in extraAbbreviationToCssProperty\n ? extraAbbreviationToCssProperty[key]\n : key in abbreviationToCssProperty\n ? abbreviationToCssProperty[key]\n : key;\n const cssPropertyKebabCase = cssProperty?.replaceAll(/([\\da-z]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n\n if (typeof value === 'object') {\n for (const [breakpoint, breakpointValue] of Object.entries(value)) {\n if (breakpointValue !== undefined) {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${breakpoint}-${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, breakpointValue);\n }\n }\n } else {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, value);\n }\n\n return acc;\n }, {} as CSSProperties);\n};\n"],"names":["isAriaProp","key","abbreviationToCssProperty","transformValueBasedOnKey","value","propsToCssVariables","props","extraAbbreviationToCssProperty","acc","cssProperty","cssPropertyKebabCase","breakpoint","breakpointValue"],"mappings":"AAMA,MAAMA,IAAa,CAACC,MACTA,EAAI,WAAW,OAAO,KAAKA,MAAQ,QAGxCC,IAAoD;AAAA,EACtD,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AACV,GAEMC,IAA2B,CAACF,GAAaG,MACvCH,MAAQ,aAAaA,MAAQ,SACzB,OAAOG,KAAU,WACV,UAAUA,CAAK,WAEnBA,IAIP,OAAOA,KAAU,WACV,GAAGA,IAAQ,IAAI,QAGnBA,GAGEC,IAAsB,CAC/BC,GACAC,IAAyD,OAElD,OAAO,QAAQD,CAAK,EAAE,OAAO,CAACE,GAAK,CAACP,GAAKG,CAAK,MAAM;AACnD,MAAAJ,EAAWC,CAAG;AACP,WAAAO;AAGL,QAAAC,IACFR,KAAOM,IACDA,EAA+BN,CAAG,IAClCA,KAAOC,IACLA,EAA0BD,CAAG,IAC7BA,GACNS,IAAuBD,KAAA,gBAAAA,EAAa,WAAW,+BAA+B,SAAS;AAEzF,MAAA,OAAOL,KAAU;AACjB,eAAW,CAACO,GAAYC,CAAe,KAAK,OAAO,QAAQR,CAAK;AAC5D,MAAIQ,MAAoB,WAEhBJ,EAAA,KAAKG,CAAU,IAAID,CAAoB,EAAE,IAAIP,EAAyBF,GAAKW,CAAe;AAAA;AAKtG,IAAAJ,EAAI,KAAKE,CAAoB,EAAE,IAAIP,EAAyBF,GAAKG,CAAK;AAGnE,SAAAI;AACX,GAAG,EAAmB;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { IconDroplet as h, IconTrashBin as N, IconCaretDown as f } from "@frontify/fondue-icons";
|
|
3
3
|
import { forwardRef as I } from "react";
|
|
4
|
-
import e from "./fondue-
|
|
4
|
+
import e from "./fondue-components68.js";
|
|
5
5
|
import { colorToCss as b } from "./fondue-components36.js";
|
|
6
6
|
const o = ({
|
|
7
7
|
id: c,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_ngv6y_5", e = "_overlay_ngv6y_41", _ = "_header_ngv6y_58", t = "_body_ngv6y_78", n = "_footer_ngv6y_96", r = "_close_ngv6y_116", s = {
|
|
2
2
|
root: o,
|
|
3
3
|
overlay: e,
|
|
4
4
|
header: _,
|
|
5
5
|
body: t,
|
|
6
|
-
footer:
|
|
7
|
-
close:
|
|
6
|
+
footer: n,
|
|
7
|
+
close: r
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
t as body,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
r as close,
|
|
12
|
+
s as default,
|
|
13
|
+
n as footer,
|
|
14
14
|
_ as header,
|
|
15
15
|
e as overlay,
|
|
16
16
|
o as root
|
|
@@ -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-components40.js";
|
|
6
6
|
import n from "./fondue-components55.js";
|
|
7
|
-
import { recursiveMap as N, getSelectOptionValue as V } from "./fondue-
|
|
7
|
+
import { recursiveMap as N, getSelectOptionValue as V } from "./fondue-components69.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-components52.js";
|
|
5
5
|
import { ForwardedRefSelectSlot as c } from "./fondue-components54.js";
|
|
6
|
-
import { getSelectOptionValue as I } from "./fondue-
|
|
6
|
+
import { getSelectOptionValue as I } from "./fondue-components69.js";
|
|
7
7
|
const S = (r) => {
|
|
8
8
|
const t = [];
|
|
9
9
|
return f.forEach(r, (o) => {
|
|
@@ -1,42 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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_8a8rm_5", t = "_button_8a8rm_56", c = "_colorIndicator_8a8rm_69", r = "_actions_8a8rm_75", a = "_clear_8a8rm_85", _ = "_caret_8a8rm_98", n = {
|
|
2
|
+
root: o,
|
|
3
|
+
button: t,
|
|
4
|
+
colorIndicator: c,
|
|
5
|
+
actions: r,
|
|
6
|
+
clear: a,
|
|
7
|
+
caret: _
|
|
36
8
|
};
|
|
37
9
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
r as actions,
|
|
11
|
+
t as button,
|
|
12
|
+
_ as caret,
|
|
13
|
+
a as clear,
|
|
14
|
+
c as colorIndicator,
|
|
15
|
+
n as default,
|
|
16
|
+
o as root
|
|
41
17
|
};
|
|
42
18
|
//# sourceMappingURL=fondue-components68.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components68.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components68.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Children as a, isValidElement as u, cloneElement as f } from "react";
|
|
2
|
+
import { ForwardedRefSelectItem as E } from "./fondue-components52.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
|
+
};
|
|
8
36
|
};
|
|
9
37
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
a as clear,
|
|
14
|
-
c as colorIndicator,
|
|
15
|
-
n as default,
|
|
16
|
-
o as root
|
|
38
|
+
g as getSelectOptionValue,
|
|
39
|
+
w as isReactLeaf,
|
|
40
|
+
y as recursiveMap
|
|
17
41
|
};
|
|
18
42
|
//# sourceMappingURL=fondue-components69.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components69.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components69.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;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -932,19 +932,19 @@ declare type LayoutComponentProps = {
|
|
|
932
932
|
/**
|
|
933
933
|
* The top property of the component.
|
|
934
934
|
*/
|
|
935
|
-
top?: Responsive<
|
|
935
|
+
top?: Responsive<SpacingValue>;
|
|
936
936
|
/**
|
|
937
937
|
* The right property of the component.
|
|
938
938
|
*/
|
|
939
|
-
right?: Responsive<
|
|
939
|
+
right?: Responsive<SpacingValue>;
|
|
940
940
|
/**
|
|
941
941
|
* The bottom property of the component.
|
|
942
942
|
*/
|
|
943
|
-
bottom?: Responsive<
|
|
943
|
+
bottom?: Responsive<SpacingValue>;
|
|
944
944
|
/**
|
|
945
945
|
* The left property of the component.
|
|
946
946
|
*/
|
|
947
|
-
left?: Responsive<
|
|
947
|
+
left?: Responsive<SpacingValue>;
|
|
948
948
|
};
|
|
949
949
|
|
|
950
950
|
export declare const LoadingBar: ForwardRefExoticComponent<LoadingBarProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -1218,7 +1218,7 @@ declare type SelectSlotProps = {
|
|
|
1218
1218
|
'data-test-id'?: string;
|
|
1219
1219
|
};
|
|
1220
1220
|
|
|
1221
|
-
declare type SizeValue =
|
|
1221
|
+
declare type SizeValue = SpacingValue | 'auto' | 'fit-content' | 'intrinsic' | 'max-content' | 'min-content';
|
|
1222
1222
|
|
|
1223
1223
|
export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLButtonElement>>;
|
|
1224
1224
|
|
|
@@ -1268,7 +1268,7 @@ declare type SliderProps = {
|
|
|
1268
1268
|
|
|
1269
1269
|
declare type SortDirection = 'ascending' | 'descending' | undefined;
|
|
1270
1270
|
|
|
1271
|
-
declare type SpacingValue = (string & {}) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64;
|
|
1271
|
+
declare type SpacingValue = (string & {}) | (number & {}) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64;
|
|
1272
1272
|
|
|
1273
1273
|
export declare const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLButtonElement>>;
|
|
1274
1274
|
|