@frontify/fondue-components 24.0.0-rc.3 → 24.1.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 +48 -52
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +3 -3
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +86 -104
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +57 -58
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +2 -2
- package/dist/fondue-components15.js +2 -2
- package/dist/fondue-components16.js +2 -2
- package/dist/fondue-components17.js +36 -56
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +16 -34
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +73 -18
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +36 -18
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +50 -71
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +138 -36
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +50 -50
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +99 -137
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +26 -48
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +188 -92
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +134 -30
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +126 -191
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +30 -134
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +63 -130
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +114 -31
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +36 -64
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +54 -103
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +20 -36
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +23 -57
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +7 -20
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +6 -23
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +32 -8
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +3 -5
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +3 -3
- package/dist/fondue-components40.js +12 -32
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +155 -5
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +116 -18
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +22 -59
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +14 -111
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +30 -116
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +54 -21
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +131 -32
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +20 -53
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +53 -131
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +7 -20
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +13 -53
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +14 -7
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +5 -13
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +60 -15
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +18 -5
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +19 -60
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +5 -18
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +14 -18
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components60.js +16 -10
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +10 -4
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +35 -18
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +4 -10
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +10 -34
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +5 -35
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +24 -4
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +16 -12
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +151 -4
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +19 -25
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components70.js +78 -16
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +8 -152
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +37 -19
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +69 -77
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +11 -8
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +10 -36
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +12 -70
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +12 -10
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +22 -10
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +34 -13
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +10 -12
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +67 -22
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +15 -34
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +24 -9
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +18 -67
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +22 -12
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +6 -24
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +19 -18
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +5 -21
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +4 -8
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +5 -5
- package/dist/fondue-components90.js +4 -19
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +2 -7
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +40 -2
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +20 -4
- package/dist/fondue-components93.js.map +1 -1
- package/dist/fondue-components94.js +16 -4
- package/dist/fondue-components94.js.map +1 -1
- package/dist/index.d.ts +30 -117
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/fondue-components95.js +0 -20
- package/dist/fondue-components95.js.map +0 -1
- package/dist/fondue-components96.js +0 -43
- package/dist/fondue-components96.js.map +0 -1
- package/dist/fondue-components97.js +0 -24
- package/dist/fondue-components97.js.map +0 -1
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { propsToCssVariables as c } from "./fondue-components38.js";
|
|
4
|
+
import f from "./fondue-components65.js";
|
|
5
|
+
const y = m(
|
|
6
|
+
({
|
|
7
|
+
"data-test-id": a = "fondue-section",
|
|
8
|
+
children: e,
|
|
9
|
+
role: r,
|
|
10
|
+
"aria-label": i,
|
|
11
|
+
"aria-hidden": o,
|
|
12
|
+
"aria-describedby": d,
|
|
13
|
+
"aria-labelledby": s,
|
|
14
|
+
"aria-expanded": t,
|
|
15
|
+
"aria-haspopup": p,
|
|
16
|
+
...l
|
|
17
|
+
}, b) => /* @__PURE__ */ n(
|
|
18
|
+
"section",
|
|
19
|
+
{
|
|
20
|
+
className: f.root,
|
|
21
|
+
"data-test-id": a,
|
|
22
|
+
style: c(l),
|
|
23
|
+
role: r,
|
|
24
|
+
"aria-label": i,
|
|
25
|
+
"aria-hidden": o,
|
|
26
|
+
"aria-describedby": d,
|
|
27
|
+
"aria-labelledby": s,
|
|
28
|
+
"aria-expanded": t,
|
|
29
|
+
"aria-haspopup": p,
|
|
30
|
+
ref: b,
|
|
31
|
+
children: e
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
y.displayName = "Section";
|
|
17
36
|
export {
|
|
18
|
-
|
|
19
|
-
a as useFondueRouter
|
|
37
|
+
y as Section
|
|
20
38
|
};
|
|
21
39
|
//# sourceMappingURL=fondue-components20.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components20.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components20.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/section.module.scss';\n\nexport type SectionProps = LayoutComponentProps & {\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Section = forwardRef<HTMLDivElement, SectionProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-section',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <section\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props)}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </section>\n );\n },\n);\nSection.displayName = 'Section';\n"],"names":["Section","forwardRef","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAqBO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWC,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,CAAK;AAAA,MAChC,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAIjB;AACAH,EAAQ,cAAc;"}
|
|
@@ -1,79 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { forwardRef as i } from "react";
|
|
4
|
+
import { useControllableState as N } from "./fondue-components66.js";
|
|
5
|
+
import e from "./fondue-components67.js";
|
|
6
|
+
const d = ({
|
|
7
|
+
children: a,
|
|
8
|
+
value: o,
|
|
9
|
+
defaultValue: s,
|
|
10
|
+
onValueChange: p,
|
|
11
|
+
hugWidth: f = !0,
|
|
12
|
+
...m
|
|
13
|
+
}, g) => {
|
|
14
|
+
const [C, u] = N({
|
|
15
|
+
prop: o,
|
|
16
|
+
defaultProp: s,
|
|
17
|
+
onChange: p
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
n.Root,
|
|
19
21
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
ref: g,
|
|
23
|
+
...m,
|
|
24
|
+
className: e.root,
|
|
25
|
+
onValueChange: (r) => {
|
|
26
|
+
r && u(r);
|
|
27
|
+
},
|
|
28
|
+
value: C,
|
|
29
|
+
type: "single",
|
|
30
|
+
asChild: !1,
|
|
31
|
+
"data-hug-width": f,
|
|
32
|
+
"aria-disabled": m.disabled,
|
|
26
33
|
children: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
className: o.viewport,
|
|
31
|
-
style: { maxHeight: e },
|
|
32
|
-
"data-scroll-padding": m,
|
|
33
|
-
"data-show-shadow": c,
|
|
34
|
-
"data-scrollbar-type": t,
|
|
35
|
-
"data-scrollbar-gutter": i,
|
|
36
|
-
"data-test-id": `${r}-viewport`,
|
|
37
|
-
children: n
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ l(
|
|
41
|
-
a.Scrollbar,
|
|
42
|
-
{
|
|
43
|
-
className: o.scrollbar,
|
|
44
|
-
orientation: "vertical",
|
|
45
|
-
"data-test-id": `${r}-vertical-scrollbar`,
|
|
46
|
-
children: /* @__PURE__ */ l(
|
|
47
|
-
a.Thumb,
|
|
48
|
-
{
|
|
49
|
-
className: o.thumb,
|
|
50
|
-
"data-test-id": `${r}-vertical-scrollbar-thumb`
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ l(
|
|
56
|
-
a.Scrollbar,
|
|
57
|
-
{
|
|
58
|
-
className: o.scrollbar,
|
|
59
|
-
orientation: "horizontal",
|
|
60
|
-
"data-test-id": `${r}-horizontal-scrollbar`,
|
|
61
|
-
children: /* @__PURE__ */ l(
|
|
62
|
-
a.Thumb,
|
|
63
|
-
{
|
|
64
|
-
className: o.thumb,
|
|
65
|
-
"data-test-id": `${r}-horizontal-scrollbar-thumb`
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ l(a.Corner, { className: o.corner, "data-test-id": `${r}-corner` })
|
|
34
|
+
a,
|
|
35
|
+
/* @__PURE__ */ t("div", { className: e.activeIndicator })
|
|
71
36
|
]
|
|
72
37
|
}
|
|
73
38
|
);
|
|
74
|
-
}
|
|
75
|
-
|
|
39
|
+
};
|
|
40
|
+
d.displayName = "SegmentedControl.Root";
|
|
41
|
+
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(n.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
42
|
+
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
43
|
+
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
44
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
45
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
c.displayName = "SegmentedControl.Item";
|
|
49
|
+
const S = {
|
|
50
|
+
Root: i(d),
|
|
51
|
+
Item: i(c)
|
|
52
|
+
};
|
|
76
53
|
export {
|
|
77
|
-
|
|
54
|
+
S as SegmentedControl,
|
|
55
|
+
c as SegmentedControlItem,
|
|
56
|
+
d as SegmentedControlRoot
|
|
78
57
|
};
|
|
79
58
|
//# sourceMappingURL=fondue-components21.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components21.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components21.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 ReactElement, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport styles from './styles/segmentedControl.module.scss';\n\nexport type SegmentedControlRootProps<TValue extends string = string> = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: TValue;\n /**\n * The controlled value of the segmented control\n */\n value?: TValue;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: TValue) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n /**\n * Specify if the segmented control should only take the width of its content\n * @default true\n */\n hugWidth?: boolean;\n};\n\nexport const SegmentedControlRoot = <TValue extends string = string>(\n {\n children,\n value: propsValue,\n defaultValue,\n onValueChange,\n hugWidth = true,\n ...rootProps\n }: SegmentedControlRootProps<TValue>,\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={styles.root}\n onValueChange={(value) => {\n if (value) {\n setValue(value as TValue);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n data-hug-width={hugWidth}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={styles.activeIndicator} />\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={styles.item} asChild={false}>\n {/* Separator */}\n <span className={styles.separator} />\n <span className={styles.itemLabel}>\n {/* Active children */}\n <span className={styles.itemLabelActive}>{children}</span>\n\n {/* Inactive children */}\n <span className={styles.itemLabelInactive}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef(SegmentedControlRoot) as <TValue extends string = string>(\n props: SegmentedControlRootProps<TValue> & { ref?: ForwardedRef<HTMLDivElement> },\n ) => ReactElement,\n Item: forwardRef(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","hugWidth","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","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AAA,EAAA,CACJ;AAEJc,EAAqB,cAAc;AAE5B,MAAME,IAAmB;AAAA,EAC5B,MAAMC,EAAWlB,CAAoB;AAAA,EAGrC,MAAMkB,EAAWH,CAAoB;AACzC;"}
|
|
@@ -1,39 +1,141 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as T, IconCheckMark as $, IconExclamationMarkTriangle as A } from "@frontify/fondue-icons";
|
|
3
|
+
import * as g from "@radix-ui/react-popover";
|
|
4
|
+
import { Slot as q } from "@radix-ui/react-slot";
|
|
5
|
+
import { useSelect as J } from "downshift";
|
|
6
|
+
import { forwardRef as K, useRef as L, useState as Q } from "react";
|
|
7
|
+
import { ForwardedRefCombobox as U } from "./fondue-components68.js";
|
|
8
|
+
import { ForwardedRefSelectItem as W, ForwardedRefSelectItemGroup as X } from "./fondue-components69.js";
|
|
9
|
+
import { SelectMenu as Y } from "./fondue-components70.js";
|
|
10
|
+
import { ForwardedRefSelectSlot as Z } from "./fondue-components71.js";
|
|
11
|
+
import o from "./fondue-components72.js";
|
|
12
|
+
import { useSelectData as _ } from "./fondue-components73.js";
|
|
13
|
+
const S = ({
|
|
14
|
+
children: h,
|
|
15
|
+
onSelect: s,
|
|
16
|
+
value: b,
|
|
17
|
+
defaultValue: I,
|
|
18
|
+
placeholder: N = "",
|
|
19
|
+
status: n = "neutral",
|
|
20
|
+
disabled: m,
|
|
21
|
+
alignMenu: w = "start",
|
|
22
|
+
side: y = "bottom",
|
|
23
|
+
id: C,
|
|
24
|
+
showStringValue: R = !0,
|
|
25
|
+
"data-test-id": c = "fondue-select",
|
|
26
|
+
viewportCollisionPadding: x = "compact",
|
|
27
|
+
...l
|
|
28
|
+
}, F) => {
|
|
29
|
+
const { inputSlots: v, menuSlots: k, items: B, clearButton: u, getItemByValue: p } = _(h), M = p(I), P = p(b), i = L(!1), [G, f] = Q(!1), { getToggleButtonProps: O, getMenuProps: z, getItemProps: D, reset: V, selectedItem: r, isOpen: j, highlightedIndex: E } = J({
|
|
30
|
+
items: B,
|
|
31
|
+
defaultSelectedItem: M,
|
|
32
|
+
selectedItem: P,
|
|
33
|
+
toggleButtonId: C,
|
|
34
|
+
labelId: "aria-labelledby" in l ? l["aria-labelledby"] : void 0,
|
|
35
|
+
onIsOpenChange: () => {
|
|
36
|
+
f(!1);
|
|
37
|
+
},
|
|
38
|
+
onHighlightedIndexChange: () => {
|
|
39
|
+
f(!0);
|
|
40
|
+
},
|
|
41
|
+
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
42
|
+
s == null || s((e == null ? void 0 : e.value) ?? null);
|
|
43
|
+
},
|
|
44
|
+
itemToString: (e) => e ? e.label : ""
|
|
45
|
+
}), H = r ? !R && r.children || r.label : N;
|
|
46
|
+
return /* @__PURE__ */ d(g.Root, { open: j, children: [
|
|
47
|
+
/* @__PURE__ */ a(
|
|
48
|
+
g.Anchor,
|
|
49
|
+
{
|
|
50
|
+
asChild: !0,
|
|
51
|
+
onMouseDown: (e) => {
|
|
52
|
+
i.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
53
|
+
},
|
|
54
|
+
onFocus: (e) => {
|
|
55
|
+
i.current || (e.target.dataset.showFocusRing = "true");
|
|
56
|
+
},
|
|
57
|
+
onBlur: (e) => {
|
|
58
|
+
e.target.dataset.showFocusRing = "false", i.current = !1;
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ d(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: o.root,
|
|
64
|
+
"data-status": n,
|
|
65
|
+
"data-disabled": m,
|
|
66
|
+
"data-empty": !r,
|
|
67
|
+
"data-test-id": c,
|
|
68
|
+
...m ? {} : O({
|
|
69
|
+
"aria-label": "aria-label" in l ? l["aria-label"] : void 0,
|
|
70
|
+
ref: F
|
|
71
|
+
}),
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ a("span", { className: o.selectedValue, children: H }),
|
|
74
|
+
v,
|
|
75
|
+
u ? /* @__PURE__ */ a(
|
|
76
|
+
q,
|
|
77
|
+
{
|
|
78
|
+
onClick: (e) => {
|
|
79
|
+
e.stopPropagation(), V();
|
|
80
|
+
},
|
|
81
|
+
className: o.clear,
|
|
82
|
+
children: u
|
|
83
|
+
}
|
|
84
|
+
) : null,
|
|
85
|
+
/* @__PURE__ */ d("div", { className: o.icons, children: [
|
|
86
|
+
/* @__PURE__ */ a(T, { size: 16, className: o.caret }),
|
|
87
|
+
n === "success" ? /* @__PURE__ */ a(
|
|
88
|
+
$,
|
|
89
|
+
{
|
|
90
|
+
size: 16,
|
|
91
|
+
className: o.iconSuccess,
|
|
92
|
+
"data-test-id": `${c}-success-icon`
|
|
93
|
+
}
|
|
94
|
+
) : null,
|
|
95
|
+
n === "error" ? /* @__PURE__ */ a(
|
|
96
|
+
A,
|
|
97
|
+
{
|
|
98
|
+
size: 16,
|
|
99
|
+
className: o.iconError,
|
|
100
|
+
"data-test-id": `${c}-error-icon`
|
|
101
|
+
}
|
|
102
|
+
) : null
|
|
103
|
+
] })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ a(
|
|
110
|
+
Y,
|
|
111
|
+
{
|
|
112
|
+
align: w,
|
|
113
|
+
side: y,
|
|
114
|
+
highlightedIndex: E,
|
|
115
|
+
getMenuProps: z,
|
|
116
|
+
getItemProps: D,
|
|
117
|
+
selectedItem: r,
|
|
118
|
+
hasInteractedSinceOpening: G,
|
|
119
|
+
viewportCollisionPadding: x,
|
|
120
|
+
children: k
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] });
|
|
124
|
+
};
|
|
125
|
+
S.displayName = "Select";
|
|
126
|
+
const ee = K(S), t = ee;
|
|
127
|
+
t.displayName = "Select";
|
|
128
|
+
t.Combobox = U;
|
|
129
|
+
t.Combobox.displayName = "Select.Combobox";
|
|
130
|
+
t.Item = W;
|
|
131
|
+
t.Item.displayName = "Select.Item";
|
|
132
|
+
t.Group = X;
|
|
133
|
+
t.Group.displayName = "Select.Group";
|
|
134
|
+
t.Slot = Z;
|
|
135
|
+
t.Slot.displayName = "Select.Slot";
|
|
36
136
|
export {
|
|
37
|
-
|
|
137
|
+
ee as ForwardedRefSelect,
|
|
138
|
+
t as Select,
|
|
139
|
+
S as SelectInput
|
|
38
140
|
};
|
|
39
141
|
//# sourceMappingURL=fondue-components22.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/section.module.scss';\n\nexport type SectionProps = LayoutComponentProps & {\n /**\n * The display property.\n * @default 'block'\n */\n display?: Responsive<'none' | 'block' | 'inline-block' | 'inline'>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Section = forwardRef<HTMLDivElement, SectionProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-section',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <section\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props)}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </section>\n );\n },\n);\nSection.displayName = 'Section';\n"],"names":["Section","forwardRef","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAqBO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWC,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,CAAK;AAAA,MAChC,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAIjB;AACAH,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components22.js","sources":["../src/components/Select/Select.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } 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, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\n\nimport { ForwardedRefCombobox } from './Combobox';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './SelectItem';\nimport { SelectMenu, type SelectMenuViewportCollisionPadding } 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 | null) => void;\n /**\n * The active value in the select component. This is used to control the select externally.\n */\n value?: string | null;\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 * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'left' | 'right' | 'bottom' | 'top';\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n /**\n * Id of the select component\n */\n id?: string;\n /**\n * The value of the select is shown as plain text (from the label prop) when set to true.\n * Items child components are used if set to false\n * @default true\n */\n showStringValue?: boolean;\n /**\n * Define the minimum distance between the select menu and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: SelectMenuViewportCollisionPadding;\n} & CommonAriaProps;\n\nexport const SelectInput = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n alignMenu = 'start',\n side = 'bottom',\n id,\n showStringValue = true,\n 'data-test-id': dataTestId = 'fondue-select',\n viewportCollisionPadding = 'compact',\n ...props\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 wasClicked = useRef(false);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, selectedItem, isOpen, highlightedIndex } =\n useSelect({\n items,\n defaultSelectedItem: defaultItem,\n selectedItem: activeItem,\n toggleButtonId: id,\n labelId: 'aria-labelledby' in props ? props['aria-labelledby'] : undefined,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect?.(selectedItem?.value ?? null);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const displayedValue = selectedItem\n ? (!showStringValue && selectedItem.children) || selectedItem.label\n : placeholder;\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor\n asChild\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n }}\n >\n <div\n className={styles.root}\n data-status={status}\n data-disabled={disabled}\n data-empty={!selectedItem}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : getToggleButtonProps({\n 'aria-label': 'aria-label' in props ? props['aria-label'] : undefined,\n ref: forwardedRef,\n }))}\n >\n <span className={styles.selectedValue}>{displayedValue}</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 ) : null}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n align={alignMenu}\n side={side}\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n viewportCollisionPadding={viewportCollisionPadding}\n >\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","status","disabled","alignMenu","side","id","showStringValue","dataTestId","viewportCollisionPadding","props","forwardedRef","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","defaultItem","activeItem","wasClicked","useRef","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","useSelect","item","displayedValue","jsxs","RadixPopover","jsx","mouseEvent","focusEvent","blurEvent","styles","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefSelect","forwardRef","Select","ForwardedRefCombobox","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;;;;;;;AA8EO,MAAMA,IAAc,CACvB;AAAA,EACI,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,IAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,gBAAgBC,IAAa;AAAA,EAC7B,0BAAAC,IAA2B;AAAA,EAC3B,GAAGC;AACP,GACAC,MACC;AACD,QAAM,EAAE,YAAAC,GAAY,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,gBAAAC,EAAA,IAAmBC,EAAcpB,CAAQ,GAEtFqB,IAAcF,EAAehB,CAAY,GACzCmB,IAAaH,EAAejB,CAAK,GAEjCqB,IAAaC,EAAO,EAAK,GAEzB,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,EAAK,GAE1E,EAAE,sBAAAC,GAAsB,cAAAC,GAAc,cAAAC,GAAc,OAAAC,GAAO,cAAAC,GAAc,QAAAC,GAAQ,kBAAAC,EAAA,IACnFC,EAAU;AAAA,IACN,OAAAlB;AAAA,IACA,qBAAqBI;AAAA,IACrB,cAAcC;AAAA,IACd,gBAAgBb;AAAA,IAChB,SAAS,qBAAqBI,IAA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,KAAK,cAAc;AAC1BA,EAAO,QAAQG;AACfH,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOI;AACdJ,EAAO,KAAK,cAAc;"}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
defaultProp: s,
|
|
17
|
-
onChange: p
|
|
18
|
-
});
|
|
19
|
-
return /* @__PURE__ */ l(
|
|
20
|
-
n.Root,
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-slider";
|
|
3
|
+
import { forwardRef as h, useRef as R } from "react";
|
|
4
|
+
import r from "./fondue-components74.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
value: a,
|
|
7
|
+
defaultValue: n = [0],
|
|
8
|
+
onChange: i,
|
|
9
|
+
onCommit: m,
|
|
10
|
+
"data-test-id": c = "fondue-slider",
|
|
11
|
+
...d
|
|
12
|
+
}, l) => {
|
|
13
|
+
const o = R(null);
|
|
14
|
+
return /* @__PURE__ */ f(
|
|
15
|
+
e.Root,
|
|
21
16
|
{
|
|
22
|
-
ref:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
asChild: !1,
|
|
31
|
-
"data-hug-width": f,
|
|
32
|
-
"aria-disabled": m.disabled,
|
|
17
|
+
ref: l,
|
|
18
|
+
className: r.root,
|
|
19
|
+
value: a,
|
|
20
|
+
defaultValue: n,
|
|
21
|
+
onValueChange: i,
|
|
22
|
+
onValueCommit: m,
|
|
23
|
+
"data-test-id": c,
|
|
24
|
+
...d,
|
|
33
25
|
children: [
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
/* @__PURE__ */ s(
|
|
27
|
+
e.Track,
|
|
28
|
+
{
|
|
29
|
+
onPointerDown: () => {
|
|
30
|
+
o.current && (o.current.dataset.showFocusRing = "false");
|
|
31
|
+
},
|
|
32
|
+
className: r.track,
|
|
33
|
+
children: /* @__PURE__ */ s(e.Range, { className: r.range })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
(a || n).map((w, u) => /* @__PURE__ */ s(
|
|
37
|
+
e.Thumb,
|
|
38
|
+
{
|
|
39
|
+
ref: o,
|
|
40
|
+
className: r.thumb,
|
|
41
|
+
onPointerDown: (t) => {
|
|
42
|
+
t.currentTarget.dataset.showFocusRing = "false";
|
|
43
|
+
},
|
|
44
|
+
onBlur: (t) => {
|
|
45
|
+
t.currentTarget.dataset.showFocusRing = "true";
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
u
|
|
49
|
+
))
|
|
36
50
|
]
|
|
37
51
|
}
|
|
38
52
|
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(n.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
42
|
-
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
43
|
-
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
44
|
-
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
45
|
-
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
46
|
-
] })
|
|
47
|
-
] });
|
|
48
|
-
c.displayName = "SegmentedControl.Item";
|
|
49
|
-
const S = {
|
|
50
|
-
Root: i(d),
|
|
51
|
-
Item: i(c)
|
|
52
|
-
};
|
|
53
|
+
}, p = h(g);
|
|
54
|
+
p.displayName = "Slider";
|
|
53
55
|
export {
|
|
54
|
-
|
|
55
|
-
c as SegmentedControlItem,
|
|
56
|
-
d as SegmentedControlRoot
|
|
56
|
+
p as Slider
|
|
57
57
|
};
|
|
58
58
|
//# sourceMappingURL=fondue-components23.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components23.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components23.js","sources":["../src/components/Slider/Slider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixSlider from '@radix-ui/react-slider';\nimport { type ForwardedRef, forwardRef, useRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/slider.module.scss';\n\nexport type SliderProps = {\n id?: string;\n name?: string;\n /**\n * The default value of the slider\n * Used for uncontrolled components\n * @default [0]\n */\n defaultValue?: number[];\n /**\n * The controlled value of the slider\n * @default [0]\n */\n value?: number[];\n /**\n * Minimum value of the slider\n * @default 0\n */\n min?: number;\n /**\n * Maximum value of the slider\n * @default 100\n */\n max?: number;\n /**\n * The granularity with which the slider can step through values\n * @default 1\n */\n step?: number;\n /**\n * The minimum steps between thumbs in a range slider\n * @default 0\n */\n minStepsBetweenThumbs?: number;\n /**\n * Disable the slider\n * @default false\n */\n disabled?: boolean;\n onChange?: (value: number[]) => void;\n onCommit?: (value: number[]) => void;\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nconst SliderComponent = (\n {\n value,\n defaultValue = [0],\n onChange,\n onCommit,\n 'data-test-id': dataTestId = 'fondue-slider',\n ...props\n }: SliderProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n const sliderThumbRef = useRef<HTMLSpanElement | null>(null);\n return (\n <RadixSlider.Root\n ref={ref}\n className={styles.root}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange}\n onValueCommit={onCommit}\n data-test-id={dataTestId}\n {...props}\n >\n <RadixSlider.Track\n onPointerDown={() => {\n if (sliderThumbRef.current) {\n sliderThumbRef.current.dataset.showFocusRing = 'false';\n }\n }}\n className={styles.track}\n >\n <RadixSlider.Range className={styles.range} />\n </RadixSlider.Track>\n {(value || defaultValue).map((_, index) => (\n <RadixSlider.Thumb\n ref={sliderThumbRef}\n className={styles.thumb}\n onPointerDown={(event) => {\n event.currentTarget.dataset.showFocusRing = 'false';\n }}\n onBlur={(event) => {\n event.currentTarget.dataset.showFocusRing = 'true';\n }}\n key={index}\n />\n ))}\n </RadixSlider.Root>\n );\n};\n\nexport const Slider = forwardRef<HTMLButtonElement, SliderProps>(SliderComponent);\nSlider.displayName = 'Slider';\n"],"names":["SliderComponent","value","defaultValue","onChange","onCommit","dataTestId","props","ref","sliderThumbRef","useRef","jsxs","RadixSlider","styles","jsx","_","index","event","Slider","forwardRef"],"mappings":";;;;AAqDA,MAAMA,IAAkB,CACpB;AAAA,EACI,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAC,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACD,QAAMC,IAAiBC,EAA+B,IAAI;AAC1D,SACI,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACG,KAAAJ;AAAA,MACA,WAAWK,EAAO;AAAA,MAClB,OAAAX;AAAA,MACA,cAAAC;AAAA,MACA,eAAeC;AAAA,MACf,eAAeC;AAAA,MACf,gBAAcC;AAAA,MACb,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,eAAe,MAAM;AACjB,cAAIH,EAAe,YACfA,EAAe,QAAQ,QAAQ,gBAAgB;AAAA,YAEvD;AAAA,YACA,WAAWI,EAAO;AAAA,YAElB,4BAACD,EAAY,OAAZ,EAAkB,WAAWC,EAAO,MAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,SAE9CX,KAASC,GAAc,IAAI,CAACY,GAAGC,MAC7B,gBAAAF;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,KAAKH;AAAA,YACL,WAAWI,EAAO;AAAA,YAClB,eAAe,CAACI,MAAU;AACtB,cAAAA,EAAM,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,YACA,QAAQ,CAACA,MAAU;AACf,cAAAA,EAAM,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UAAA;AAAA,UACKD;AAAA,QAAA,CAEZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb,GAEaE,IAASC,EAA2ClB,CAAe;AAChFiB,EAAO,cAAc;"}
|