@frontify/fondue-components 1.3.4 → 1.4.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-components.js +15 -11
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +36 -44
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +46 -72
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +76 -45
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +65 -11
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +45 -154
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +10 -116
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +59 -22
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +111 -14
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +112 -24
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +15 -54
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +15 -17
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +51 -26
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +16 -24
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +17 -9
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +35 -6
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +24 -14
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +9 -2
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +106 -2356
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +12 -143
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +38 -29
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +20 -18
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +11 -0
- package/dist/fondue-components30.js.map +1 -0
- package/dist/fondue-components31.js +24 -0
- package/dist/fondue-components31.js.map +1 -0
- package/dist/fondue-components32.js +59 -0
- package/dist/fondue-components32.js.map +1 -0
- package/dist/fondue-components33.js +21 -0
- package/dist/fondue-components33.js.map +1 -0
- package/dist/fondue-components34.js +18 -0
- package/dist/fondue-components34.js.map +1 -0
- package/dist/fondue-components35.js +5 -0
- package/dist/fondue-components35.js.map +1 -0
- package/dist/fondue-components36.js +2363 -0
- package/dist/fondue-components36.js.map +1 -0
- package/dist/fondue-components37.js +146 -0
- package/dist/fondue-components37.js.map +1 -0
- package/dist/fondue-components38.js +42 -0
- package/dist/fondue-components38.js.map +1 -0
- package/dist/fondue-components39.js +32 -0
- package/dist/fondue-components39.js.map +1 -0
- package/dist/fondue-components4.js +2 -2
- package/dist/fondue-components5.js +54 -50
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components6.js +2 -2
- package/dist/fondue-components7.js +77 -50
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +56 -22
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +24 -39
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +251 -7
- package/dist/style.css +1 -1
- package/package.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components29.js","sources":["
|
|
1
|
+
{"version":3,"file":"fondue-components29.js","sources":["../src/components/Select/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n};\n\nexport const SelectMenu = ({ highlightedIndex, getMenuProps, getItemProps, children, filterText }: SelectMenuProps) => {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n }}\n className={styles.portal}\n >\n <ul className={styles.menu} {...getMenuProps()} role=\"dialog\">\n {\n recursiveMap(\n children,\n (child, index) => {\n const isValid = <TProps,>(\n child: ReactNode,\n ): child is ReactElement<TProps> & { ref: ForwardedRef<HTMLElement> } => {\n // @ts-expect-error - We are explicitly checking for ref\n return isValidElement<TProps>(child) && child.ref !== undefined;\n };\n\n if (isValid<SelectItemProps>(child)) {\n return (\n <RadixSlot\n className={styles.item}\n data-highlighted={highlightedIndex === index}\n key={`${child.props.value}`}\n {...getItemProps({\n item: getSelectOptionValue(child.props),\n index,\n ...(child.ref ? { ref: child.ref } : {}),\n })}\n >\n {child}\n </RadixSlot>\n );\n }\n },\n filterText,\n ).parsedChildren\n }\n </ul>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n};\nSelectMenu.displayName = 'Select.Menu';\n"],"names":["SelectMenu","highlightedIndex","getMenuProps","getItemProps","children","filterText","jsx","RadixPopover","event","styles","recursiveMap","child","index","isValidElement","RadixSlot","getSelectOptionValue"],"mappings":";;;;;;AAuCa,MAAAA,IAAa,CAAC,EAAE,kBAAAC,GAAkB,cAAAC,GAAc,cAAAC,GAAc,UAAAC,GAAU,YAAAC,QAE7E,gBAAAC,EAACC,EAAa,QAAb,EACG,UAAA,gBAAAD;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACG,iBAAiB,CAACC,MAAU;AACxB,MAAAA,EAAM,eAAe;AAAA,IACzB;AAAA,IACA,WAAWC,EAAO;AAAA,IAElB,UAAA,gBAAAH,EAAC,QAAG,WAAWG,EAAO,MAAO,GAAGP,EAAA,GAAgB,MAAK,UAE7C,UAAAQ;AAAA,MACIN;AAAA,MACA,CAACO,GAAOC,MAAU;AAQV,aAPY,CACZD,MAGOE,EAAuBF,CAAK,KAAKA,EAAM,QAAQ,QAG7BA,CAAK;AAE1B,iBAAA,gBAAAL;AAAA,YAACQ;AAAAA,YAAA;AAAA,cACG,WAAWL,EAAO;AAAA,cAClB,oBAAkBR,MAAqBW;AAAA,cAEtC,GAAGT,EAAa;AAAA,gBACb,MAAMY,EAAqBJ,EAAM,KAAK;AAAA,gBACtC,OAAAC;AAAA,gBACA,GAAID,EAAM,MAAM,EAAE,KAAKA,EAAM,IAAA,IAAQ,CAAC;AAAA,cAAA,CACzC;AAAA,cAEA,UAAAA;AAAA,YAAA;AAAA,YAPI,GAAGA,EAAM,MAAM,KAAK;AAAA,UAAA;AAAA,MAWzC;AAAA,MACAN;AAAA,MACF,eAEV,CAAA;AAAA,EAAA;AAER,EAAA,CAAA;AAGRL,EAAW,cAAc;"}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as d } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { buttonStyles as
|
|
5
|
-
import { iconStyles as
|
|
6
|
-
import { textStyles as l } from "./fondue-
|
|
7
|
-
const
|
|
3
|
+
import { cn as c } from "./fondue-components15.js";
|
|
4
|
+
import { buttonStyles as s } from "./fondue-components16.js";
|
|
5
|
+
import { iconStyles as b } from "./fondue-components17.js";
|
|
6
|
+
import { textStyles as l } from "./fondue-components18.js";
|
|
7
|
+
const x = d(
|
|
8
8
|
({
|
|
9
9
|
children: m,
|
|
10
|
+
type: r = "button",
|
|
10
11
|
style: o,
|
|
11
|
-
size:
|
|
12
|
-
"data-test-id":
|
|
12
|
+
size: i = "medium",
|
|
13
|
+
"data-test-id": n = "fondue-button",
|
|
13
14
|
className: e = "",
|
|
14
|
-
onPress:
|
|
15
|
+
onPress: a = () => {
|
|
15
16
|
},
|
|
16
17
|
...t
|
|
17
|
-
},
|
|
18
|
+
}, f) => /* @__PURE__ */ u(
|
|
18
19
|
"button",
|
|
19
20
|
{
|
|
20
|
-
ref:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
ref: f,
|
|
22
|
+
type: r,
|
|
23
|
+
"data-test-id": n,
|
|
24
|
+
className: c(
|
|
25
|
+
s({ size: i, style: o, ...t }),
|
|
24
26
|
l({ style: o, ...t }),
|
|
25
|
-
|
|
27
|
+
b({ style: o, ...t }),
|
|
26
28
|
e
|
|
27
29
|
),
|
|
28
|
-
onClick:
|
|
30
|
+
onClick: a,
|
|
29
31
|
...t,
|
|
30
32
|
children: m
|
|
31
33
|
}
|
|
32
34
|
)
|
|
33
35
|
);
|
|
34
|
-
|
|
36
|
+
x.displayName = "Button";
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
x as Button
|
|
37
39
|
};
|
|
38
40
|
//# sourceMappingURL=fondue-components3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components3.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type MouseEvent, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { buttonStyles } from './styles/buttonStyles';\nimport { iconStyles } from './styles/iconStyles';\nimport { textStyles } from './styles/textStyles';\n\ntype ButtonRounding = 'medium' | 'full';\n\ntype ButtonStyle = 'default' | 'positive' | 'negative' | 'danger' | 'loud';\n\ntype ButtonSize = 'small' | 'medium' | 'large';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\ntype ButtonEmphasis = 'default' | 'weak' | 'strong';\n\ntype ButtonAspect = 'default' | 'square';\n\nexport type ButtonProps = {\n /**\n * @default
|
|
1
|
+
{"version":3,"file":"fondue-components3.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type MouseEvent, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { buttonStyles } from './styles/buttonStyles';\nimport { iconStyles } from './styles/iconStyles';\nimport { textStyles } from './styles/textStyles';\n\ntype ButtonRounding = 'medium' | 'full';\n\ntype ButtonStyle = 'default' | 'positive' | 'negative' | 'danger' | 'loud';\n\ntype ButtonSize = 'small' | 'medium' | 'large';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\n\ntype ButtonEmphasis = 'default' | 'weak' | 'strong';\n\ntype ButtonAspect = 'default' | 'square';\n\nexport type ButtonProps = {\n /**\n * @default \"button\"\n */\n type?: ButtonType;\n /**\n * @default null\n */\n title?: string;\n /**\n * @default \"default\"\n */\n style?: ButtonStyle;\n /**\n * @default \"strong\"\n */\n emphasis?: ButtonEmphasis;\n /**\n * @default \"medium\"\n */\n size?: ButtonSize;\n /**\n * @default \"medium\"\n */\n rounding?: ButtonRounding;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * @default \"default\"\n */\n aspect?: ButtonAspect;\n /**\n * @default true\n */\n hugWidth?: boolean;\n children?: ReactNode;\n onPress?: (event?: MouseEvent<HTMLButtonElement>) => void;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Button = forwardRef<HTMLButtonElement | null, ButtonProps>(\n (\n {\n children,\n type = 'button',\n style,\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-button',\n className = '',\n onPress = () => {},\n ...props\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement | null>,\n ) => {\n return (\n <button\n ref={ref}\n type={type}\n data-test-id={dataTestId}\n className={cn(\n buttonStyles({ size, style, ...props }),\n textStyles({ style, ...props }),\n iconStyles({ style, ...props }),\n className,\n )}\n onClick={onPress}\n {...props}\n >\n {children}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n"],"names":["Button","forwardRef","children","type","style","size","dataTestId","className","onPress","props","ref","jsx","cn","buttonStyles","textStyles","iconStyles"],"mappings":";;;;;;AAmEO,MAAMA,IAASC;AAAA,EAClB,CACI;AAAA,IACI,UAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU,MAAM;AAAA,IAAC;AAAA,IACjB,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAD;AAAA,MACA,MAAAP;AAAA,MACA,gBAAcG;AAAA,MACd,WAAWM;AAAA,QACPC,EAAa,EAAE,MAAAR,GAAM,OAAAD,GAAO,GAAGK,GAAO;AAAA,QACtCK,EAAW,EAAE,OAAAV,GAAO,GAAGK,GAAO;AAAA,QAC9BM,EAAW,EAAE,OAAAX,GAAO,GAAGK,GAAO;AAAA,QAC9BF;AAAA,MACJ;AAAA,MACA,SAASC;AAAA,MACR,GAAGC;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAIjB;AAEAF,EAAO,cAAc;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import m from "./fondue-components31.js";
|
|
4
|
+
const t = ({ children: e, name: o, "data-test-id": r = "fondue-select-slot", ...a }, s) => /* @__PURE__ */ l("div", { "data-test-id": r, ref: s, className: m.slot, "data-name": o, ...a, children: e });
|
|
5
|
+
t.displayName = "Select.Slot";
|
|
6
|
+
const S = d(t);
|
|
7
|
+
export {
|
|
8
|
+
S as ForwardedRefSelectSlot,
|
|
9
|
+
t as SelectSlot
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=fondue-components30.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components30.js","sources":["../src/components/Select/SelectSlot.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectSlotProps = {\n /**\n * The children of the select slot. This can be a custom component.\n */\n children?: ReactNode;\n /**\n * The slot name that is used to determine the placement.\n */\n name: 'menu' | 'left' | 'right' | 'clear';\n /**\n * The data test id of the select slot.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-select-slot', ...props }: SelectSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={forwardedRef} className={styles.slot} data-name={name} {...props}>\n {children}\n </div>\n );\n};\nSelectSlot.displayName = 'Select.Slot';\n\nexport const ForwardedRefSelectSlot = forwardRef<HTMLDivElement, SelectSlotProps>(SelectSlot);\n"],"names":["SelectSlot","children","name","dataTestId","props","forwardedRef","jsx","styles","ForwardedRefSelectSlot","forwardRef"],"mappings":";;;AAqBa,MAAAA,IAAa,CACtB,EAAE,UAAAC,GAAU,MAAAC,GAAM,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9EC,MAGK,gBAAAC,EAAA,OAAA,EAAI,gBAAcH,GAAY,KAAKE,GAAc,WAAWE,EAAO,MAAM,aAAWL,GAAO,GAAGE,GAC1F,UAAAH,EACL,CAAA;AAGRD,EAAW,cAAc;AAEZ,MAAAQ,IAAyBC,EAA4CT,CAAU;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const t = "_root_1j875_5", _ = "_input_1j875_57", o = "_slot_1j875_76", c = "_clear_1j875_125", n = "_caret_1j875_138", r = "_menu_1j875_158", s = "_portal_1j875_171", e = "_item_1j875_175", a = "_group_1j875_193", l = {
|
|
2
|
+
root: t,
|
|
3
|
+
input: _,
|
|
4
|
+
slot: o,
|
|
5
|
+
clear: c,
|
|
6
|
+
caret: n,
|
|
7
|
+
menu: r,
|
|
8
|
+
portal: s,
|
|
9
|
+
item: e,
|
|
10
|
+
group: a
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
n as caret,
|
|
14
|
+
c as clear,
|
|
15
|
+
l as default,
|
|
16
|
+
a as group,
|
|
17
|
+
_ as input,
|
|
18
|
+
e as item,
|
|
19
|
+
r as menu,
|
|
20
|
+
s as portal,
|
|
21
|
+
t as root,
|
|
22
|
+
o as slot
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=fondue-components31.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components31.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as w } from "@frontify/fondue-icons";
|
|
3
|
+
import { useState as x, useMemo as S, Children as f, isValidElement as u, cloneElement as B, useCallback as E } from "react";
|
|
4
|
+
import { ForwardedRefSelectItem as I } from "./fondue-components28.js";
|
|
5
|
+
import { ForwardedRefSelectSlot as c } from "./fondue-components30.js";
|
|
6
|
+
import { getSelectOptionValue as v } from "./fondue-components38.js";
|
|
7
|
+
const i = (s) => {
|
|
8
|
+
const t = [];
|
|
9
|
+
return f.forEach(s, (o) => {
|
|
10
|
+
if (u(o) && o.type === I)
|
|
11
|
+
t.push(v(o.props));
|
|
12
|
+
else if (u(o) && o.props.children) {
|
|
13
|
+
const l = i(o.props.children);
|
|
14
|
+
for (const a of l)
|
|
15
|
+
t.push(a);
|
|
16
|
+
}
|
|
17
|
+
}), t;
|
|
18
|
+
}, k = (s) => {
|
|
19
|
+
const [t, o] = x(""), { inputSlots: l, menuSlots: a, itemValues: p, clearButton: V } = S(() => {
|
|
20
|
+
const r = [], n = [];
|
|
21
|
+
let m;
|
|
22
|
+
return f.toArray(s).some(
|
|
23
|
+
(e) => u(e) && e.type === c
|
|
24
|
+
) ? (f.forEach(s, (e) => {
|
|
25
|
+
u(e) && e.type === c && (e.props.name === "menu" ? n.push(e.props.children) : e.props.name === "left" || e.props.name === "right" ? r.push(e) : e.props.name === "clear" && (e.props.children ? m = e : m = B(e, { children: /* @__PURE__ */ g(w, { size: 16 }) })));
|
|
26
|
+
}), {
|
|
27
|
+
inputSlots: r,
|
|
28
|
+
menuSlots: n,
|
|
29
|
+
clearButton: m,
|
|
30
|
+
itemValues: i(n)
|
|
31
|
+
}) : {
|
|
32
|
+
menuSlots: s,
|
|
33
|
+
inputSlots: [],
|
|
34
|
+
itemValues: i(s)
|
|
35
|
+
};
|
|
36
|
+
}, [s]), y = S(
|
|
37
|
+
() => p.filter(
|
|
38
|
+
(r) => t === "" || r.label.toLowerCase().includes(t.toLowerCase())
|
|
39
|
+
),
|
|
40
|
+
[p, t]
|
|
41
|
+
), C = E(
|
|
42
|
+
(r) => r ? p.find((n) => n.value === r) : void 0,
|
|
43
|
+
[p]
|
|
44
|
+
);
|
|
45
|
+
return {
|
|
46
|
+
inputSlots: l,
|
|
47
|
+
menuSlots: a,
|
|
48
|
+
clearButton: V,
|
|
49
|
+
setFilterText: o,
|
|
50
|
+
filterText: t,
|
|
51
|
+
items: y,
|
|
52
|
+
getItemByValue: C
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
i as getRecursiveOptionValues,
|
|
57
|
+
k as useSelectData
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=fondue-components32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components32.js","sources":["../src/components/Select/useSelectData.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport { Children, cloneElement, isValidElement, useCallback, useMemo, useState, type ReactNode } from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './SelectItem';\nimport { ForwardedRefSelectSlot, type SelectSlotProps } from './SelectSlot';\nimport { getSelectOptionValue } from './utils';\n\nexport type SelectItemType = {\n value: string;\n label: string;\n};\n\nexport const getRecursiveOptionValues = (children: ReactNode): { value: string; label: string }[] => {\n const values: { value: string; label: string }[] = [];\n Children.forEach(children, (child) => {\n if (isValidElement<SelectItemProps>(child) && child.type === ForwardedRefSelectItem) {\n values.push(getSelectOptionValue(child.props));\n } else if (isValidElement<{ children: ReactNode }>(child) && child.props.children) {\n const optionValues = getRecursiveOptionValues(child.props.children);\n for (const optionValue of optionValues) {\n values.push(optionValue);\n }\n }\n });\n return values;\n};\n\nexport const useSelectData = (children: ReactNode) => {\n const [filterText, setFilterText] = useState('');\n const { inputSlots, menuSlots, itemValues, clearButton } = useMemo(() => {\n const inputSlots: ReactNode[] = [];\n const menuSlots: ReactNode[] = [];\n let clearButton: ReactNode;\n const hasSlots = Children.toArray(children).some(\n (child) => isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot,\n );\n\n if (hasSlots) {\n Children.forEach(children, (child) => {\n if (isValidElement<SelectSlotProps>(child) && child.type === ForwardedRefSelectSlot) {\n if (child.props.name === 'menu') {\n menuSlots.push(child.props.children);\n } else if (child.props.name === 'left' || child.props.name === 'right') {\n inputSlots.push(child);\n } else if (child.props.name === 'clear') {\n if (child.props.children) {\n clearButton = child;\n } else {\n clearButton = cloneElement(child, { children: <IconCross size={16} /> });\n }\n }\n }\n });\n\n return {\n inputSlots,\n menuSlots,\n clearButton,\n itemValues: getRecursiveOptionValues(menuSlots),\n };\n } else {\n return {\n menuSlots: children,\n inputSlots: [],\n itemValues: getRecursiveOptionValues(children),\n };\n }\n }, [children]);\n\n const filteredItems = useMemo(\n () =>\n itemValues.filter(\n (item) => filterText === '' || item.label.toLowerCase().includes(filterText.toLowerCase()),\n ),\n [itemValues, filterText],\n );\n\n const getItemByValue = useCallback(\n (value?: string) => (value ? itemValues.find((item) => item.value === value) : undefined),\n [itemValues],\n );\n\n return {\n inputSlots,\n menuSlots,\n clearButton,\n setFilterText,\n filterText,\n items: filteredItems,\n getItemByValue,\n };\n};\n"],"names":["getRecursiveOptionValues","children","values","Children","child","isValidElement","ForwardedRefSelectItem","getSelectOptionValue","optionValues","optionValue","useSelectData","filterText","setFilterText","useState","inputSlots","menuSlots","itemValues","clearButton","useMemo","ForwardedRefSelectSlot","cloneElement","IconCross","filteredItems","item","getItemByValue","useCallback","value"],"mappings":";;;;;;AAca,MAAAA,IAA2B,CAACC,MAA4D;AACjG,QAAMC,IAA6C,CAAA;AAC1C,SAAAC,EAAA,QAAQF,GAAU,CAACG,MAAU;AAClC,QAAIC,EAAgCD,CAAK,KAAKA,EAAM,SAASE;AACzD,MAAAJ,EAAO,KAAKK,EAAqBH,EAAM,KAAK,CAAC;AAAA,aACtCC,EAAwCD,CAAK,KAAKA,EAAM,MAAM,UAAU;AAC/E,YAAMI,IAAeR,EAAyBI,EAAM,MAAM,QAAQ;AAClE,iBAAWK,KAAeD;AACtB,QAAAN,EAAO,KAAKO,CAAW;AAAA,IAE/B;AAAA,EAAA,CACH,GACMP;AACX,GAEaQ,IAAgB,CAACT,MAAwB;AAClD,QAAM,CAACU,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzC,EAAE,YAAAC,GAAY,WAAAC,GAAW,YAAAC,GAAY,aAAAC,EAAY,IAAIC,EAAQ,MAAM;AACrE,UAAMJ,IAA0B,CAAA,GAC1BC,IAAyB,CAAA;AAC3BE,QAAAA;AAKJ,WAJiBd,EAAS,QAAQF,CAAQ,EAAE;AAAA,MACxC,CAACG,MAAUC,EAAgCD,CAAK,KAAKA,EAAM,SAASe;AAAA,IAAA,KAI3DhB,EAAA,QAAQF,GAAU,CAACG,MAAU;AAClC,MAAIC,EAAgCD,CAAK,KAAKA,EAAM,SAASe,MACrDf,EAAM,MAAM,SAAS,SACrBW,EAAU,KAAKX,EAAM,MAAM,QAAQ,IAC5BA,EAAM,MAAM,SAAS,UAAUA,EAAM,MAAM,SAAS,UAC3DU,EAAW,KAAKV,CAAK,IACdA,EAAM,MAAM,SAAS,YACxBA,EAAM,MAAM,WACZa,IAAcb,IAEda,IAAcG,EAAahB,GAAO,EAAE,4BAAWiB,GAAU,EAAA,MAAM,GAAI,CAAA,EAAI,CAAA;AAAA,IAGnF,CACH,GAEM;AAAA,MACH,YAAAP;AAAAA,MACA,WAAAC;AAAAA,MACA,aAAAE;AAAAA,MACA,YAAYjB,EAAyBe,CAAS;AAAA,IAAA,KAG3C;AAAA,MACH,WAAWd;AAAA,MACX,YAAY,CAAC;AAAA,MACb,YAAYD,EAAyBC,CAAQ;AAAA,IAAA;AAAA,EAErD,GACD,CAACA,CAAQ,CAAC,GAEPqB,IAAgBJ;AAAA,IAClB,MACIF,EAAW;AAAA,MACP,CAACO,MAASZ,MAAe,MAAMY,EAAK,MAAM,YAAA,EAAc,SAASZ,EAAW,aAAa;AAAA,IAC7F;AAAA,IACJ,CAACK,GAAYL,CAAU;AAAA,EAAA,GAGrBa,IAAiBC;AAAA,IACnB,CAACC,MAAoBA,IAAQV,EAAW,KAAK,CAACO,MAASA,EAAK,UAAUG,CAAK,IAAI;AAAA,IAC/E,CAACV,CAAU;AAAA,EAAA;AAGR,SAAA;AAAA,IACH,YAAAF;AAAA,IACA,WAAAC;AAAA,IACA,aAAAE;AAAA,IACA,eAAAL;AAAA,IACA,YAAAD;AAAA,IACA,OAAOW;AAAA,IACP,gBAAAE;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const o = "_root_1gp0a_5", t = "_input_1gp0a_53", s = "_slot_1gp0a_72", _ = "_iconSuccess_1gp0a_122", n = "_iconError_1gp0a_130", c = "_loadingStatus_1gp0a_138", a = "_spin_1gp0a_1", i = {
|
|
2
|
+
root: o,
|
|
3
|
+
input: t,
|
|
4
|
+
slot: s,
|
|
5
|
+
iconSuccess: _,
|
|
6
|
+
iconError: n,
|
|
7
|
+
loadingStatus: c,
|
|
8
|
+
spin: a,
|
|
9
|
+
"tw-dark": "_tw-dark_1gp0a_170"
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
i as default,
|
|
13
|
+
n as iconError,
|
|
14
|
+
_ as iconSuccess,
|
|
15
|
+
t as input,
|
|
16
|
+
c as loadingStatus,
|
|
17
|
+
o as root,
|
|
18
|
+
s as slot,
|
|
19
|
+
a as spin
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=fondue-components33.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components33.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { sv as t } from "./fondue-components15.js";
|
|
2
|
+
const o = t({
|
|
3
|
+
base: "tw-bg-box-neutral-mighty tw-text-box-neutral-mighty-inverse tw-rounded tw-max-w-48 tw-text-sm tw-overflow-hidden",
|
|
4
|
+
variants: {
|
|
5
|
+
padding: {
|
|
6
|
+
spacious: "tw-px-3 tw-py-2",
|
|
7
|
+
compact: "tw-px-2 tw-py-1"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
defaultVariants: {
|
|
11
|
+
padding: "spacious"
|
|
12
|
+
}
|
|
13
|
+
}), e = "tw-w-2 tw-h-2 tw-bg-box-neutral-mighty tw-border-r tw-border-b tw-border-r-line-mighty tw-border-b-line-mighty tw-rotate-45 -tw-translate-y-1 tw-rounded-br-small";
|
|
14
|
+
export {
|
|
15
|
+
e as tooltipArrowStyles,
|
|
16
|
+
o as tooltipContentStyles
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=fondue-components34.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components34.js","sources":["../src/components/Tooltip/styles/tooltipStyles.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const tooltipContentStyles = sv({\n base: 'tw-bg-box-neutral-mighty tw-text-box-neutral-mighty-inverse tw-rounded tw-max-w-48 tw-text-sm tw-overflow-hidden',\n variants: {\n padding: {\n spacious: 'tw-px-3 tw-py-2',\n compact: 'tw-px-2 tw-py-1',\n },\n },\n defaultVariants: {\n padding: 'spacious',\n },\n});\n\nexport const tooltipArrowStyles =\n 'tw-w-2 tw-h-2 tw-bg-box-neutral-mighty tw-border-r tw-border-b tw-border-r-line-mighty tw-border-b-line-mighty tw-rotate-45 -tw-translate-y-1 tw-rounded-br-small';\n"],"names":["tooltipContentStyles","sv","tooltipArrowStyles"],"mappings":";AAIO,MAAMA,IAAuBC,EAAG;AAAA,EACnC,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,IACb;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,SAAS;AAAA,EACb;AACJ,CAAC,GAEYC,IACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components35.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';\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
|