@frontify/fondue-components 1.3.5 → 1.5.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 -2360
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +105 -138
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +12 -2
- 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 +4 -4
- 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 +123 -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 +29 -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 +245 -3
- package/dist/style.css +1 -1
- package/package.json +45 -36
|
@@ -3,22 +3,26 @@ import { Button as e } from "./fondue-components3.js";
|
|
|
3
3
|
import { Checkbox as m } from "./fondue-components4.js";
|
|
4
4
|
import { Dialog as f } from "./fondue-components5.js";
|
|
5
5
|
import { Divider as l } from "./fondue-components6.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { Dropdown as a } from "./fondue-components7.js";
|
|
7
|
+
import { Flyout as g } from "./fondue-components8.js";
|
|
8
|
+
import { Label as D } from "./fondue-components9.js";
|
|
9
|
+
import { LoadingBar as c } from "./fondue-components10.js";
|
|
10
|
+
import { SegmentedControl as C } from "./fondue-components11.js";
|
|
11
|
+
import { Select as S } from "./fondue-components12.js";
|
|
12
|
+
import { TextInput as h } from "./fondue-components13.js";
|
|
13
|
+
import { Tooltip as v } from "./fondue-components14.js";
|
|
12
14
|
export {
|
|
13
15
|
e as Button,
|
|
14
16
|
m as Checkbox,
|
|
15
17
|
f as Dialog,
|
|
16
18
|
l as Divider,
|
|
17
|
-
a as
|
|
18
|
-
g as
|
|
19
|
-
|
|
19
|
+
a as Dropdown,
|
|
20
|
+
g as Flyout,
|
|
21
|
+
D as Label,
|
|
22
|
+
c as LoadingBar,
|
|
20
23
|
C as SegmentedControl,
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
S as Select,
|
|
25
|
+
h as TextInput,
|
|
26
|
+
v as Tooltip
|
|
23
27
|
};
|
|
24
28
|
//# sourceMappingURL=fondue-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-progress";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components24.js";
|
|
5
|
+
const p = s(
|
|
6
|
+
({
|
|
7
|
+
value: a,
|
|
8
|
+
max: r = 100,
|
|
9
|
+
rounded: d = !0,
|
|
10
|
+
style: o = "default",
|
|
11
|
+
size: e = "medium",
|
|
12
|
+
"data-test-id": n = "fondue-loading-bar",
|
|
13
|
+
...l
|
|
14
|
+
}, m) => /* @__PURE__ */ i(
|
|
15
|
+
t.Root,
|
|
14
16
|
{
|
|
15
|
-
ref:
|
|
16
|
-
|
|
17
|
-
className:
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
ref: m,
|
|
18
|
+
"data-test-id": n,
|
|
19
|
+
className: g({ rounded: d, size: e, style: o }),
|
|
20
|
+
"aria-busy": a !== r,
|
|
21
|
+
value: a,
|
|
22
|
+
max: r,
|
|
23
|
+
style: {
|
|
24
|
+
"--loading-bar-value": a,
|
|
25
|
+
"--loading-bar-max": r,
|
|
26
|
+
"--loading-bar-proportion": "calc(var(--loading-bar-value) / var(--loading-bar-max))"
|
|
20
27
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]
|
|
28
|
+
...l,
|
|
29
|
+
children: /* @__PURE__ */ i(
|
|
30
|
+
t.Indicator,
|
|
31
|
+
{
|
|
32
|
+
className: f({ style: o, indeterminateState: a === null })
|
|
33
|
+
}
|
|
34
|
+
)
|
|
29
35
|
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const i = ({ children: e, ...o }, s) => /* @__PURE__ */ l(r.Item, { ref: s, ...o, className: y, asChild: !1, children: [
|
|
34
|
-
/* @__PURE__ */ t("span", { className: N }),
|
|
35
|
-
/* @__PURE__ */ l("span", { className: u, children: [
|
|
36
|
-
/* @__PURE__ */ t("span", { className: b, children: e }),
|
|
37
|
-
/* @__PURE__ */ t("span", { className: h, children: e })
|
|
38
|
-
] })
|
|
39
|
-
] });
|
|
40
|
-
i.displayName = "SegmentedControl.Item";
|
|
41
|
-
const j = {
|
|
42
|
-
Root: m(d),
|
|
43
|
-
Item: m(i)
|
|
44
|
-
};
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
p.displayName = "LoadingBar";
|
|
45
39
|
export {
|
|
46
|
-
|
|
47
|
-
i as SegmentedControlItem,
|
|
48
|
-
d as SegmentedControlRoot
|
|
40
|
+
p as LoadingBar
|
|
49
41
|
};
|
|
50
42
|
//# sourceMappingURL=fondue-components10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components10.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components10.js","sources":["../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ProgressRadixPrimitive from '@radix-ui/react-progress';\nimport { forwardRef, type CSSProperties, type ElementRef, type ForwardedRef } from 'react';\n\nimport { loadingBarContainerStyles, loadingBarStyles } from './styles/loadingBarStyles';\n\nexport type LoadingBarProps = {\n /**\n * The current value of the loading bar. If `null`, the loading bar will be in an indeterminate state.\n * @default null\n */\n value: number | null;\n /**\n * The maximum value of the loading bar\n * @default 100\n */\n max?: number;\n /**\n * @default 'fondue-loading-bar'\n */\n 'data-test-id'?: string;\n /**\n * Add rounded corners to the loading bar\n * @default true\n */\n rounded?: boolean;\n /**\n * The style of the loading bar\n * @default \"default\"\n */\n style?: 'default' | 'positive' | 'negative';\n /**\n * The size of the loading bar\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large' | 'x-large';\n /**\n * The label of the loading bar for accessibility purposes\n */\n getValueLabel?: (value: number, max: number) => string;\n} & ({ 'aria-label': string } | { 'aria-labelledby': string });\n\nexport const LoadingBar = forwardRef<ElementRef<typeof ProgressRadixPrimitive.Root>, LoadingBarProps>(\n (\n {\n value,\n max = 100,\n rounded = true,\n style = 'default',\n size = 'medium',\n 'data-test-id': dataTestId = 'fondue-loading-bar',\n ...props\n }: LoadingBarProps,\n ref: ForwardedRef<ElementRef<typeof ProgressRadixPrimitive.Root>>,\n ) => {\n return (\n <ProgressRadixPrimitive.Root\n ref={ref}\n data-test-id={dataTestId}\n className={loadingBarContainerStyles({ rounded, size, style })}\n aria-busy={value !== max}\n value={value}\n max={max}\n style={\n {\n '--loading-bar-value': value,\n '--loading-bar-max': max,\n '--loading-bar-proportion': 'calc(var(--loading-bar-value) / var(--loading-bar-max))',\n } as CSSProperties\n }\n {...props}\n >\n <ProgressRadixPrimitive.Indicator\n className={loadingBarStyles({ style, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","style","size","dataTestId","props","ref","jsx","ProgressRadixPrimitive","loadingBarContainerStyles","loadingBarStyles"],"mappings":";;;;AA2CO,MAAMA,IAAaC;AAAA,EACtB,CACI;AAAA,IACI,OAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,gBAAgBC,IAAa;AAAA,IAC7B,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAuB;AAAA,IAAvB;AAAA,MACG,KAAAF;AAAA,MACA,gBAAcF;AAAA,MACd,WAAWK,EAA0B,EAAE,SAAAR,GAAS,MAAAE,GAAM,OAAAD,GAAO;AAAA,MAC7D,aAAWH,MAAUC;AAAA,MACrB,OAAAD;AAAA,MACA,KAAAC;AAAA,MACA,OACI;AAAA,QACI,uBAAuBD;AAAA,QACvB,qBAAqBC;AAAA,QACrB,4BAA4B;AAAA,MAChC;AAAA,MAEH,GAAGK;AAAA,MAEJ,UAAA,gBAAAE;AAAA,QAACC,EAAuB;AAAA,QAAvB;AAAA,UACG,WAAWE,EAAiB,EAAE,OAAAR,GAAO,oBAAoBH,MAAU,MAAM;AAAA,QAAA;AAAA,MAC7E;AAAA,IAAA;AAAA,EAAA;AAIhB;AACAF,EAAW,cAAc;"}
|
|
@@ -1,76 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
) : null,
|
|
45
|
-
e === "error" ? /* @__PURE__ */ r(
|
|
46
|
-
g,
|
|
47
|
-
{
|
|
48
|
-
size: 16,
|
|
49
|
-
className: "tw-flex tw-text-text-negative tw-h-full tw-items-center tw-ml-3",
|
|
50
|
-
"data-test-id": `${o}-error-icon`
|
|
51
|
-
}
|
|
52
|
-
) : null,
|
|
53
|
-
s
|
|
54
|
-
] });
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { useControllableState as S } from "./fondue-components25.js";
|
|
5
|
+
import { segmentedControlRootStyles as f, segmentedControlActiveIndicatorStyles as I, segmentedControlItemStyles as y, segmentedControlItemSeparatorStyles as N, segmentedControlItemLabelStyles as u, segmentedControlItemLabelActiveStyles as b, segmentedControlItemLabelInactiveStyles as h } from "./fondue-components26.js";
|
|
6
|
+
const d = ({ children: e, value: o, defaultValue: s, onValueChange: c, ...a }, g) => {
|
|
7
|
+
const [p, C] = S({
|
|
8
|
+
prop: o,
|
|
9
|
+
defaultProp: s,
|
|
10
|
+
onChange: c
|
|
11
|
+
});
|
|
12
|
+
return /* @__PURE__ */ l(
|
|
13
|
+
r.Root,
|
|
14
|
+
{
|
|
15
|
+
ref: g,
|
|
16
|
+
...a,
|
|
17
|
+
className: f,
|
|
18
|
+
onValueChange: (n) => {
|
|
19
|
+
n && C(n);
|
|
20
|
+
},
|
|
21
|
+
value: p,
|
|
22
|
+
type: "single",
|
|
23
|
+
asChild: !1,
|
|
24
|
+
"aria-disabled": a.disabled,
|
|
25
|
+
children: [
|
|
26
|
+
e,
|
|
27
|
+
/* @__PURE__ */ t("div", { className: I })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
d.displayName = "SegmentedControl.Root";
|
|
33
|
+
const i = ({ children: e, ...o }, s) => /* @__PURE__ */ l(r.Item, { ref: s, ...o, className: y, asChild: !1, children: [
|
|
34
|
+
/* @__PURE__ */ t("span", { className: N }),
|
|
35
|
+
/* @__PURE__ */ l("span", { className: u, children: [
|
|
36
|
+
/* @__PURE__ */ t("span", { className: b, children: e }),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: h, children: e })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
i.displayName = "SegmentedControl.Item";
|
|
41
|
+
const j = {
|
|
42
|
+
Root: m(d),
|
|
43
|
+
Item: m(i)
|
|
55
44
|
};
|
|
56
|
-
m.displayName = "TextField.Root";
|
|
57
|
-
const f = ({ name: s, className: i, ...e }, o) => /* @__PURE__ */ r(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
"data-slot": !0,
|
|
61
|
-
"data-name": s,
|
|
62
|
-
...e,
|
|
63
|
-
ref: o,
|
|
64
|
-
className: n(T, i)
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
f.displayName = "TextField.Slot";
|
|
68
|
-
const x = d(m), k = d(f), w = x;
|
|
69
|
-
w.Root = x;
|
|
70
|
-
w.Slot = k;
|
|
71
45
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
46
|
+
j as SegmentedControl,
|
|
47
|
+
i as SegmentedControlItem,
|
|
48
|
+
d as SegmentedControlRoot
|
|
75
49
|
};
|
|
76
50
|
//# sourceMappingURL=fondue-components11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components11.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components11.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport {\n segmentedControlActiveIndicatorStyles,\n segmentedControlItemLabelActiveStyles,\n segmentedControlItemLabelInactiveStyles,\n segmentedControlItemLabelStyles,\n segmentedControlItemSeparatorStyles,\n segmentedControlItemStyles,\n segmentedControlRootStyles,\n} from './styles/segmentedControlStyles';\n\nexport type SegmentedControlRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: string;\n /**\n * The controlled value of the segmented control\n */\n value?: string;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const SegmentedControlRoot = (\n { children, value: propsValue, defaultValue, onValueChange, ...rootProps }: SegmentedControlRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={segmentedControlRootStyles}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={segmentedControlActiveIndicatorStyles} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={segmentedControlItemStyles} asChild={false}>\n {/* Separator */}\n <span className={segmentedControlItemSeparatorStyles} />\n <span className={segmentedControlItemLabelStyles}>\n {/* Active children */}\n <span className={segmentedControlItemLabelActiveStyles}>{children}</span>\n\n {/* Inactive children */}\n <span className={segmentedControlItemLabelInactiveStyles}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","segmentedControlRootStyles","jsx","segmentedControlActiveIndicatorStyles","SegmentedControlItem","itemProps","segmentedControlItemStyles","segmentedControlItemSeparatorStyles","segmentedControlItemLabelStyles","segmentedControlItemLabelActiveStyles","segmentedControlItemLabelInactiveStyles","SegmentedControl","forwardRef"],"mappings":";;;;;AAwCa,MAAAA,IAAuB,CAChC,EAAE,UAAAC,GAAU,OAAOC,GAAY,cAAAC,GAAc,eAAAC,GAAe,GAAGC,EAAU,GACzEC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMP;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAGG,SAAA,gBAAAM;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACG,KAAAL;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWO;AAAA,MACX,eAAe,CAACL,MAAU;A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
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as B } from "@frontify/fondue-icons";
|
|
3
|
+
import * as p from "@radix-ui/react-popover";
|
|
4
|
+
import { Slot as j } from "@radix-ui/react-slot";
|
|
5
|
+
import { useSelect as D } from "downshift";
|
|
6
|
+
import { forwardRef as M } from "react";
|
|
7
|
+
import { ForwardedRefCombobox as T } from "./fondue-components27.js";
|
|
8
|
+
import { ForwardedRefSelectItem as k, ForwardedRefSelectItemGroup as z } from "./fondue-components28.js";
|
|
9
|
+
import { SelectMenu as A } from "./fondue-components29.js";
|
|
10
|
+
import { ForwardedRefSelectSlot as O } from "./fondue-components30.js";
|
|
11
|
+
import r from "./fondue-components31.js";
|
|
12
|
+
import { useSelectData as V } from "./fondue-components32.js";
|
|
13
|
+
const n = ({
|
|
14
|
+
children: S,
|
|
15
|
+
onSelect: a,
|
|
16
|
+
value: f,
|
|
17
|
+
defaultValue: u,
|
|
18
|
+
placeholder: I = "",
|
|
19
|
+
disabled: m,
|
|
20
|
+
"aria-label": h,
|
|
21
|
+
"data-test-id": b = "fondue-select"
|
|
22
|
+
}, s) => {
|
|
23
|
+
const { inputSlots: g, menuSlots: N, items: x, clearButton: c, getItemByValue: i } = V(S), y = i(u), C = i(f), { getToggleButtonProps: R, getMenuProps: w, getItemProps: v, reset: F, selectedItem: l, isOpen: P, highlightedIndex: G } = D({
|
|
24
|
+
items: x,
|
|
25
|
+
defaultSelectedItem: y,
|
|
26
|
+
selectedItem: C,
|
|
27
|
+
onSelectedItemChange: ({ selectedItem: t }) => {
|
|
28
|
+
a && a(t.value);
|
|
29
|
+
},
|
|
30
|
+
itemToString: (t) => t ? t.label : ""
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ d(p.Root, { open: P, children: [
|
|
33
|
+
/* @__PURE__ */ o(p.Anchor, { asChild: !0, children: /* @__PURE__ */ d(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: r.root,
|
|
37
|
+
"data-disabled": m,
|
|
38
|
+
"data-empty": !l,
|
|
39
|
+
"data-test-id": b,
|
|
40
|
+
...m ? {} : R({
|
|
41
|
+
"aria-label": h,
|
|
42
|
+
...s ? { ref: s } : {}
|
|
43
|
+
}),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ o("span", { className: r.input, children: l ? l.label : I }),
|
|
46
|
+
g,
|
|
47
|
+
c && /* @__PURE__ */ o(
|
|
48
|
+
j,
|
|
49
|
+
{
|
|
50
|
+
onClick: (t) => {
|
|
51
|
+
t.stopPropagation(), F();
|
|
52
|
+
},
|
|
53
|
+
className: r.clear,
|
|
54
|
+
children: c
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(B, { size: 16, className: r.caret }) })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
/* @__PURE__ */ o(A, { highlightedIndex: G, getMenuProps: w, getItemProps: v, children: N })
|
|
62
|
+
] });
|
|
42
63
|
};
|
|
64
|
+
n.displayName = "Select";
|
|
65
|
+
const q = M(n), e = q;
|
|
66
|
+
e.displayName = "Select";
|
|
67
|
+
e.Combobox = T;
|
|
68
|
+
e.Combobox.displayName = "Select.Combobox";
|
|
69
|
+
e.Item = k;
|
|
70
|
+
e.Item.displayName = "Select.Item";
|
|
71
|
+
e.Group = z;
|
|
72
|
+
e.Group.displayName = "Select.Group";
|
|
73
|
+
e.Slot = O;
|
|
74
|
+
e.Slot.displayName = "Select.Slot";
|
|
43
75
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
d as TooltipTrigger
|
|
76
|
+
q as ForwardedRefSelect,
|
|
77
|
+
e as Select,
|
|
78
|
+
n as SelectInput
|
|
48
79
|
};
|
|
49
80
|
//# sourceMappingURL=fondue-components12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components12.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components12.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useSelect } from 'downshift';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu } from './SelectMenu';\nimport { ForwardedRefSelectSlot } from './SelectSlot';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type SelectComponentProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string;\n /**\n * The default value of the select component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the select component.\n */\n placeholder?: string;\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The aria label of the select component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select',\n }: SelectComponentProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n\n const defaultItem = getItemByValue(defaultValue);\n const activeItem = getItemByValue(value);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect && onSelect(selectedItem.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div\n className={styles.root}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': ariaLabel,\n ...(forwardedRef ? { ref: forwardedRef } : {}),\n }))}\n >\n <span className={styles.input}>{selectedItem ? selectedItem.label : placeholder}</span>\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n >\n {clearButton}\n </RadixSlot>\n )}\n <div>\n <IconCaretDown size={16} className={styles.caret} />\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu highlightedIndex={highlightedIndex} getMenuProps={getMenuProps} getItemProps={getItemProps}>\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectInput.displayName = 'Select';\n\nexport const ForwardedRefSelect = forwardRef<HTMLDivElement, SelectComponentProps>(SelectInput);\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectInput & {\n Combobox: typeof ForwardedRefCombobox;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = ForwardedRefSelect;\nSelect.displayName = 'Select';\nSelect.Combobox = ForwardedRefCombobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["SelectInput","children","onSelect","value","defaultValue","placeholder","disabled","ariaLabel","dataTestId","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","jsxs","RadixPopover","jsx","styles","RadixSlot","event","IconCaretDown","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AAkDO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AACjC,GACAC,MACC;AACK,QAAA,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,gBAAAC,EAAe,IAAIC,EAAcd,CAAQ,GAEtFe,IAAcF,EAAeV,CAAY,GACzCa,IAAaH,EAAeX,CAAK,GAEjC,EAAE,sBAAAe,GAAsB,cAAAC,GAAc,cAAAC,GAAc,OAAAC,GAAO,cAAAC,GAAc,QAAAC,GAAQ,kBAAAC,EAAiB,IACpGC,EAAU;AAAA,IACN,OAAAb;AAAA,IACA,qBAAqBI;AAAA,IACrB,cAAcC;AAAA,IACd,sBAAsB,CAAC,EAAE,cAAAK,QAAmB;AAC5B,MAAApB,KAAAA,EAASoB,EAAa,KAAK;AAAA,IAC3C;AAAA,IACA,cAAc,CAACI,MAAUA,IAAOA,EAAK,QAAQ;AAAA,EAAA,CAChD;AAEL,SACK,gBAAAC,EAAAC,EAAa,MAAb,EAAkB,MAAML,GACrB,UAAA;AAAA,IAAA,gBAAAM,EAACD,EAAa,QAAb,EAAoB,SAAO,I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-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheckMark as w, IconExclamationMarkTriangle as N } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as n, useRef as S } from "react";
|
|
4
|
+
import { cn as m } from "./fondue-components15.js";
|
|
5
|
+
import r from "./fondue-components33.js";
|
|
6
|
+
const f = ({
|
|
7
|
+
children: c,
|
|
8
|
+
className: d,
|
|
9
|
+
status: e = "neutral",
|
|
10
|
+
"data-test-id": a = "fondue-text-input",
|
|
11
|
+
...t
|
|
12
|
+
}, R) => {
|
|
13
|
+
const i = S(!1);
|
|
14
|
+
return /* @__PURE__ */ g("div", { className: m(r.root, d), "data-status": e, "data-test-id": a, children: [
|
|
15
|
+
e === "loading" ? /* @__PURE__ */ s("div", { className: r.loadingStatus, "data-test-id": `${a}-loader` }) : null,
|
|
16
|
+
/* @__PURE__ */ s(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
onMouseDown: (o) => {
|
|
20
|
+
i.current = !0, o.currentTarget.dataset.showFocusRing = "false";
|
|
21
|
+
},
|
|
22
|
+
type: "text",
|
|
23
|
+
...t,
|
|
24
|
+
onFocus: (o) => {
|
|
25
|
+
var l;
|
|
26
|
+
i.current || (o.target.dataset.showFocusRing = "true"), (l = t.onFocus) == null || l.call(t, o);
|
|
27
|
+
},
|
|
28
|
+
onBlur: (o) => {
|
|
29
|
+
var l;
|
|
30
|
+
o.target.dataset.showFocusRing = "false", i.current = !1, (l = t.onBlur) == null || l.call(t, o);
|
|
31
|
+
},
|
|
32
|
+
ref: R,
|
|
33
|
+
className: r.input,
|
|
34
|
+
"aria-invalid": e === "error"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
e === "success" ? /* @__PURE__ */ s(w, { size: 16, className: r.iconSuccess, "data-test-id": `${a}-success-icon` }) : null,
|
|
38
|
+
e === "error" ? /* @__PURE__ */ s(
|
|
39
|
+
N,
|
|
40
|
+
{
|
|
41
|
+
size: 16,
|
|
42
|
+
className: r.iconError,
|
|
43
|
+
"data-test-id": `${a}-error-icon`
|
|
44
|
+
}
|
|
45
|
+
) : null,
|
|
46
|
+
c
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
f.displayName = "TextField.Root";
|
|
50
|
+
const u = ({ name: c, className: d, ...e }, a) => /* @__PURE__ */ s(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": !0,
|
|
54
|
+
"data-name": c,
|
|
55
|
+
...e,
|
|
56
|
+
ref: a,
|
|
57
|
+
className: m(r.slot, d)
|
|
9
58
|
}
|
|
10
|
-
|
|
59
|
+
);
|
|
60
|
+
u.displayName = "TextField.Slot";
|
|
61
|
+
const x = n(f), T = n(u), F = x;
|
|
62
|
+
F.Root = x;
|
|
63
|
+
F.Slot = T;
|
|
11
64
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
65
|
+
f as TextFieldRoot,
|
|
66
|
+
u as TextFieldSlot,
|
|
67
|
+
F as TextInput
|
|
14
68
|
};
|
|
15
69
|
//# sourceMappingURL=fondue-components13.js.map
|