@frontify/fondue-components 3.1.0 → 3.2.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 +38 -24
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +18 -38
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +64 -40
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +19 -77
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +22 -64
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +39 -46
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +6 -12
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +46 -154
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +54 -117
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +28 -117
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +111 -20
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +65 -14
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +42 -59
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +32 -15
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +5 -19
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +12 -17
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +150 -12
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +110 -27
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +117 -24
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +21 -9
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +31 -109
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +11 -40
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +28 -12
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +127 -40
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +21 -8
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +45 -21
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +14 -55
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +60 -18
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +15 -15
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +19 -2
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +16 -38
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +8 -0
- package/dist/fondue-components39.js.map +1 -0
- package/dist/fondue-components4.js +39 -45
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +16 -0
- package/dist/fondue-components40.js.map +1 -0
- package/dist/fondue-components41.js +8 -0
- package/dist/fondue-components41.js.map +1 -0
- package/dist/fondue-components42.js +38 -0
- package/dist/fondue-components42.js.map +1 -0
- package/dist/fondue-components43.js +8 -0
- package/dist/fondue-components43.js.map +1 -0
- package/dist/fondue-components44.js +28 -0
- package/dist/fondue-components44.js.map +1 -0
- package/dist/fondue-components45.js +20 -0
- package/dist/fondue-components45.js.map +1 -0
- package/dist/fondue-components46.js +14 -0
- package/dist/fondue-components46.js.map +1 -0
- package/dist/fondue-components47.js +16 -0
- package/dist/fondue-components47.js.map +1 -0
- package/dist/fondue-components48.js +133 -0
- package/dist/fondue-components48.js.map +1 -0
- package/dist/fondue-components49.js +15 -0
- package/dist/fondue-components49.js.map +1 -0
- package/dist/fondue-components5.js +46 -82
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +46 -0
- package/dist/fondue-components50.js.map +1 -0
- package/dist/fondue-components51.js +11 -0
- package/dist/fondue-components51.js.map +1 -0
- package/dist/fondue-components52.js +30 -0
- package/dist/fondue-components52.js.map +1 -0
- package/dist/fondue-components53.js +52 -0
- package/dist/fondue-components53.js.map +1 -0
- package/dist/fondue-components54.js +21 -0
- package/dist/fondue-components54.js.map +1 -0
- package/dist/fondue-components55.js +10 -0
- package/dist/fondue-components55.js.map +1 -0
- package/dist/fondue-components56.js +5 -0
- package/dist/fondue-components56.js.map +1 -0
- package/dist/fondue-components57.js +14 -0
- package/dist/fondue-components57.js.map +1 -0
- package/dist/fondue-components58.js +42 -0
- package/dist/fondue-components58.js.map +1 -0
- package/dist/fondue-components6.js +48 -30
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components7.js +77 -98
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +28 -56
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +101 -22
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +481 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
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
|
-
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Root: d,
|
|
40
|
-
Trigger: a(s),
|
|
41
|
-
Content: a(p)
|
|
42
|
-
};
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-progress";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { loadingBarContainerStyles as g, loadingBarStyles as f } from "./fondue-components42.js";
|
|
5
|
+
const p = m(
|
|
6
|
+
({
|
|
7
|
+
value: a,
|
|
8
|
+
max: r = 100,
|
|
9
|
+
rounded: d = !0,
|
|
10
|
+
variant: o = "default",
|
|
11
|
+
size: e = "medium",
|
|
12
|
+
"data-test-id": n = "fondue-loading-bar",
|
|
13
|
+
...l
|
|
14
|
+
}, s) => /* @__PURE__ */ i(
|
|
15
|
+
t.Root,
|
|
16
|
+
{
|
|
17
|
+
ref: s,
|
|
18
|
+
"data-test-id": n,
|
|
19
|
+
className: g({ rounded: d, size: e, variant: 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))"
|
|
27
|
+
},
|
|
28
|
+
...l,
|
|
29
|
+
children: /* @__PURE__ */ i(
|
|
30
|
+
t.Indicator,
|
|
31
|
+
{
|
|
32
|
+
className: f({ variant: o, indeterminateState: a === null })
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
p.displayName = "LoadingBar";
|
|
43
39
|
export {
|
|
44
|
-
|
|
45
|
-
p as TooltipContent,
|
|
46
|
-
d as TooltipRoot,
|
|
47
|
-
s as TooltipTrigger
|
|
40
|
+
p as LoadingBar
|
|
48
41
|
};
|
|
49
42
|
//# sourceMappingURL=fondue-components14.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components14.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components14.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 variant?: '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 variant = '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, variant })}\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({ variant, indeterminateState: value === null })}\n />\n </ProgressRadixPrimitive.Root>\n );\n },\n);\nLoadingBar.displayName = 'LoadingBar';\n"],"names":["LoadingBar","forwardRef","value","max","rounded","variant","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,SAAAC,IAAU;AAAA,IACV,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,SAAAD,GAAS;AAAA,MAC/D,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,SAAAR,GAAS,oBAAoBH,MAAU,MAAM;AAAA,QAAA;AAAA,MAC/E;AAAA,IAAA;AAAA,EAAA;AAIhB;AACAF,EAAW,cAAc;"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
classGroups: {
|
|
7
|
-
"font-size": ["text-body-x-small", "text-body-small", "text-body-medium", "text-body-large"]
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}), m = (...t) => r(...t), x = (t) => o(t);
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { propsToCssVariables as r } from "./fondue-components22.js";
|
|
3
|
+
import i from "./fondue-components43.js";
|
|
4
|
+
const a = ({ "data-test-id": t = "fondue-section", children: o, ...s }) => /* @__PURE__ */ e("section", { className: i.root, "data-test-id": t, style: r(s), children: o });
|
|
5
|
+
a.displayName = "Section";
|
|
11
6
|
export {
|
|
12
|
-
|
|
13
|
-
x as sv
|
|
7
|
+
a as Section
|
|
14
8
|
};
|
|
15
9
|
//# sourceMappingURL=fondue-components15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components15.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components15.js","sources":["../src/components/Section/Section.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { 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 = ({ 'data-test-id': dataTestId = 'fondue-section', children, ...props }: SectionProps) => {\n return (\n <section className={styles.root} data-test-id={dataTestId} style={propsToCssVariables(props)}>\n {children}\n </section>\n );\n};\nSection.displayName = 'Section';\n"],"names":["Section","dataTestId","children","props","jsx","styles","propsToCssVariables"],"mappings":";;;AAqBa,MAAAA,IAAU,CAAC,EAAE,gBAAgBC,IAAa,kBAAkB,UAAAC,GAAU,GAAGC,QAE9E,gBAAAC,EAAC,WAAQ,EAAA,WAAWC,EAAO,MAAM,gBAAcJ,GAAY,OAAOK,EAAoBH,CAAK,GACtF,UAAAD,EACL,CAAA;AAGRF,EAAQ,cAAc;"}
|
|
@@ -1,158 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
variant: {
|
|
31
|
-
default: "",
|
|
32
|
-
positive: "",
|
|
33
|
-
negative: "",
|
|
34
|
-
danger: "",
|
|
35
|
-
loud: ""
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { useControllableState as N } from "./fondue-components44.js";
|
|
5
|
+
import e from "./fondue-components45.js";
|
|
6
|
+
const d = ({ children: a, value: o, defaultValue: s, onValueChange: p, ...m }, f) => {
|
|
7
|
+
const [g, C] = N({
|
|
8
|
+
prop: o,
|
|
9
|
+
defaultProp: s,
|
|
10
|
+
onChange: p
|
|
11
|
+
});
|
|
12
|
+
return /* @__PURE__ */ l(
|
|
13
|
+
i.Root,
|
|
14
|
+
{
|
|
15
|
+
ref: f,
|
|
16
|
+
...m,
|
|
17
|
+
className: e.root,
|
|
18
|
+
onValueChange: (r) => {
|
|
19
|
+
r && C(r);
|
|
20
|
+
},
|
|
21
|
+
value: g,
|
|
22
|
+
type: "single",
|
|
23
|
+
asChild: !1,
|
|
24
|
+
"aria-disabled": m.disabled,
|
|
25
|
+
children: [
|
|
26
|
+
a,
|
|
27
|
+
/* @__PURE__ */ t("div", { className: e.activeIndicator })
|
|
28
|
+
]
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
disabled: !1,
|
|
53
|
-
variant: "default",
|
|
54
|
-
emphasis: "strong",
|
|
55
|
-
class: "tw-bg-button-strong-background tw-border-button-strong-border hover:tw-bg-button-strong-background-hover active:tw-bg-button-strong-background-pressed"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
disabled: !1,
|
|
59
|
-
variant: "positive",
|
|
60
|
-
emphasis: "default",
|
|
61
|
-
class: "tw-bg-button-positive-background tw-border-button-positive-border hover:tw-bg-button-positive-background-hover active:tw-bg-button-positive-background-pressed"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
disabled: !1,
|
|
65
|
-
variant: "positive",
|
|
66
|
-
emphasis: "weak",
|
|
67
|
-
class: "tw-border-transparent hover:tw-bg-button-positive-background-hover hover:tw-border-button-positive-border active:tw-bg-button-positive-background-pressed"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
disabled: !1,
|
|
71
|
-
variant: "positive",
|
|
72
|
-
emphasis: "strong",
|
|
73
|
-
class: "tw-bg-button-strong-positive-background tw-border-button-strong-positive-border hover:tw-bg-button-strong-positive-background-hover active:tw-bg-button-strong-positive-background-pressed"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
disabled: !1,
|
|
77
|
-
variant: "negative",
|
|
78
|
-
emphasis: "default",
|
|
79
|
-
class: "tw-bg-button-negative-background tw-border-button-negative-border hover:tw-bg-button-negative-background-hover active:tw-bg-button-negative-background-pressed"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
disabled: !1,
|
|
83
|
-
variant: "negative",
|
|
84
|
-
emphasis: "weak",
|
|
85
|
-
class: "tw-border-transparent hover:tw-bg-button-negative-background-hover hover:tw-border-button-negative-border active:tw-bg-button-negative-background-pressed"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
disabled: !1,
|
|
89
|
-
variant: "negative",
|
|
90
|
-
emphasis: "strong",
|
|
91
|
-
class: "tw-bg-button-strong-negative-background tw-border-button-strong-negative-border hover:tw-bg-button-strong-negative-background-hover active:tw-bg-button-strong-negative-background-pressed"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
disabled: !1,
|
|
95
|
-
variant: "danger",
|
|
96
|
-
emphasis: "default",
|
|
97
|
-
class: "tw-bg-button-background tw-border-button-border hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
disabled: !1,
|
|
101
|
-
variant: "danger",
|
|
102
|
-
emphasis: "weak",
|
|
103
|
-
class: "tw-border-transparent hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
disabled: !1,
|
|
107
|
-
variant: "danger",
|
|
108
|
-
emphasis: "strong",
|
|
109
|
-
class: "tw-bg-button-danger-background tw-border-button-danger-border hover:tw-bg-button-danger-background-hover active:tw-bg-button-danger-background-pressed"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
disabled: !1,
|
|
113
|
-
variant: "loud",
|
|
114
|
-
emphasis: "default",
|
|
115
|
-
class: "tw-bg-box-selected tw-border-button-border hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed "
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
disabled: !1,
|
|
119
|
-
variant: "loud",
|
|
120
|
-
emphasis: "weak",
|
|
121
|
-
class: "tw-border-transparent hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
disabled: !1,
|
|
125
|
-
variant: "loud",
|
|
126
|
-
emphasis: "strong",
|
|
127
|
-
class: "tw-bg-box-selected-strong tw-border-box-selected-strong hover:tw-bg-box-selected-strong-hover active:tw-bg-box-selected-strong-pressed "
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
aspect: "default",
|
|
131
|
-
size: "small",
|
|
132
|
-
class: "tw-px-2"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
aspect: "default",
|
|
136
|
-
size: "medium",
|
|
137
|
-
class: "tw-px-4"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
aspect: "default",
|
|
141
|
-
size: "large",
|
|
142
|
-
class: "tw-px-6"
|
|
143
|
-
}
|
|
144
|
-
],
|
|
145
|
-
defaultVariants: {
|
|
146
|
-
variant: "default",
|
|
147
|
-
emphasis: "strong",
|
|
148
|
-
size: "medium",
|
|
149
|
-
rounding: "medium",
|
|
150
|
-
hugWidth: !0,
|
|
151
|
-
aspect: "default",
|
|
152
|
-
disabled: !1
|
|
153
|
-
}
|
|
154
|
-
});
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
d.displayName = "SegmentedControl.Root";
|
|
33
|
+
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(i.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
34
|
+
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
35
|
+
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
36
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
c.displayName = "SegmentedControl.Item";
|
|
41
|
+
const I = {
|
|
42
|
+
Root: n(d),
|
|
43
|
+
Item: n(c)
|
|
44
|
+
};
|
|
155
45
|
export {
|
|
156
|
-
|
|
46
|
+
I as SegmentedControl,
|
|
47
|
+
c as SegmentedControlItem,
|
|
48
|
+
d as SegmentedControlRoot
|
|
157
49
|
};
|
|
158
50
|
//# sourceMappingURL=fondue-components16.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components16.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components16.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 styles from './styles/segmentedControl.module.scss';\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={styles.root}\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={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<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","SegmentedControl","forwardRef"],"mappings":";;;;;AAgCa,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,EAAO;AAAA,MAClB,eAAe,CAACL,MAAU;AACtB,QAAIA,KACAC,EAASD,CAAK;AAAA,MAEtB;AAAA,MACA,OAAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACT,iBAAeF,EAAU;AAAA,MAExB,UAAA;AAAA,QAAAJ;AAAA,QAEA,gBAAAY,EAAA,OAAA,EAAI,WAAWD,EAAO,gBAAiB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;AACAZ,EAAqB,cAAc;AAO5B,MAAMc,IAAuB,CAChC,EAAE,UAAAb,GAAU,GAAGc,EAAA,GACfT,MAEA,gBAAAI,EAACC,EAAqB,MAArB,EAA0B,KAAAL,GAAW,GAAGS,GAAW,WAAWH,EAAO,MAAM,SAAS,IAEjF,UAAA;AAAA,EAAC,gBAAAC,EAAA,QAAA,EAAK,WAAWD,EAAO,UAAW,CAAA;AAAA,EAClC,gBAAAF,EAAA,QAAA,EAAK,WAAWE,EAAO,WAEpB,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAK,EAAA,WAAWD,EAAO,iBAAkB,UAAAX,GAAS;AAAA,IAGlD,gBAAAY,EAAA,QAAA,EAAK,WAAWD,EAAO,mBAAoB,UAAAX,GAAS;AAAA,EAAA,GACzD;AAAA,GACJ;AAEJa,EAAqB,cAAc;AAE5B,MAAME,IAAmB;AAAA,EAC5B,MAAMC,EAAsDjB,CAAoB;AAAA,EAChF,MAAMiB,EAAyDH,CAAoB;AACvF;"}
|
|
@@ -1,121 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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-components46.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,
|
|
16
|
+
{
|
|
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,
|
|
25
|
+
children: [
|
|
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
|
+
))
|
|
50
|
+
]
|
|
18
51
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
disabled: !1,
|
|
23
|
-
variant: "default",
|
|
24
|
-
emphasis: "default",
|
|
25
|
-
class: "[&_svg]:tw-text-button-icon group-hover:[&_svg]:tw-text-button-icon-hover group-active:[&_svg]:tw-text-button-icon-pressed [&_svg]:tw-leading-none"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
disabled: !1,
|
|
29
|
-
variant: "default",
|
|
30
|
-
emphasis: "weak",
|
|
31
|
-
class: "[&_svg]:tw-text-button-icon group-hover:[&_svg]:tw-text-button-icon-hover group-active:[&_svg]:tw-text-button-icon-pressed [&_svg]:tw-leading-none"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
disabled: !1,
|
|
35
|
-
variant: "default",
|
|
36
|
-
emphasis: "strong",
|
|
37
|
-
class: "[&_svg]:tw-text-button-strong-icon group-hover:[&_svg]:tw-text-button-strong-icon-hover group-active:[&_svg]:tw-text-button-strong-icon-pressed [&_svg]:tw-leading-none"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
disabled: !1,
|
|
41
|
-
variant: "positive",
|
|
42
|
-
emphasis: "default",
|
|
43
|
-
class: "[&_svg]:tw-text-button-positive-icon group-hover:[&_svg]:tw-text-button-positive-icon-hover group-active:[&_svg]:tw-text-button-positive-icon-pressed [&_svg]:tw-leading-none"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
disabled: !1,
|
|
47
|
-
variant: "positive",
|
|
48
|
-
emphasis: "weak",
|
|
49
|
-
class: "[&_svg]:tw-text-button-strong-positive-icon group-hover:[&_svg]:tw-text-button-strong-positive-icon-hovergroup-active:[&_svg]:tw-text-button-strong-positive-icon-pressed [&_svg]:tw-leading-none"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
disabled: !1,
|
|
53
|
-
variant: "positive",
|
|
54
|
-
emphasis: "strong",
|
|
55
|
-
class: "[&_svg]:tw-text-button-strong-positive-icon group-hover:[&_svg]:tw-text-button-strong-positive-icon-hover group-active:[&_svg]:tw-text-button-strong-positive-icon-pressed [&_svg]:tw-leading-none"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
disabled: !1,
|
|
59
|
-
variant: "negative",
|
|
60
|
-
emphasis: "default",
|
|
61
|
-
class: "[&_svg]:tw-text-button-negative-icon group-hover:[&_svg]:tw-text-button-negative-icon-hovergroup-active:[&_svg]:tw-text-button-negative-icon-pressed [&_svg]:tw-leading-none"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
disabled: !1,
|
|
65
|
-
variant: "negative",
|
|
66
|
-
emphasis: "weak",
|
|
67
|
-
class: "[&_svg]:tw-text-button-negative-icon group-hover:[&_svg]:tw-text-button-negative-icon-hovergroup-active:[&_svg]:tw-text-button-negative-icon-pressed [&_svg]:tw-leading-none"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
disabled: !1,
|
|
71
|
-
variant: "negative",
|
|
72
|
-
emphasis: "strong",
|
|
73
|
-
class: "[&_svg]:tw-text-button-strong-negative-icon group-hover:[&_svg]:tw-text-button-strong-negative-icon-hovergroup-active:[&_svg]:tw-text-button-strong-negative-icon-pressed [&_svg]:tw-leading-none"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
disabled: !1,
|
|
77
|
-
variant: "danger",
|
|
78
|
-
emphasis: "default",
|
|
79
|
-
class: "[&_svg]:tw-text-button-negative-icon group-hover:[&_svg]:tw-text-button-negative-icon-hovergroup-active:[&_svg]:tw-text-button-negative-icon-pressed [&_svg]:tw-leading-none"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
disabled: !1,
|
|
83
|
-
variant: "danger",
|
|
84
|
-
emphasis: "weak",
|
|
85
|
-
class: "[&_svg]:tw-text-button-negative-icon group-hover:[&_svg]:tw-text-button-negative-icon-hovergroup-active:[&_svg]:tw-text-button-negative-icon-pressed [&_svg]:tw-leading-none"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
disabled: !1,
|
|
89
|
-
variant: "danger",
|
|
90
|
-
emphasis: "strong",
|
|
91
|
-
class: "[&_svg]:tw-text-button-danger-icon group-hover:[&_svg]:tw-text-button-danger-icon-hovergroup-active:[&_svg]:tw-text-button-danger-icon-pressed [&_svg]:tw-leading-none"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
disabled: !1,
|
|
95
|
-
variant: "loud",
|
|
96
|
-
emphasis: "default",
|
|
97
|
-
class: "[&_svg]:tw-text-box-selected-inverse group-hover:[&_svg]:tw-text-box-selected-inverse-hovergroup-active:[&_svg]:tw-text-box-selected-inverse-pressed [&_svg]:tw-leading-none"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
disabled: !1,
|
|
101
|
-
variant: "loud",
|
|
102
|
-
emphasis: "weak",
|
|
103
|
-
class: "[&_svg]:tw-text-box-selected-inverse group-hover:[&_svg]:tw-text-box-selected-inverse-hovergroup-active:[&_svg]:tw-text-box-selected-inverse-pressed [&_svg]:tw-leading-none"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
disabled: !1,
|
|
107
|
-
variant: "loud",
|
|
108
|
-
emphasis: "strong",
|
|
109
|
-
class: "[&_svg]:tw-text-box-selected-strong-inverse group-hover:[&_svg]:tw-text-box-selected-strong-inversegroup-active:[&_svg]:tw-text-box-selected-strong-inverse [&_svg]:tw-leading-none"
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
defaultVariants: {
|
|
113
|
-
emphasis: "strong",
|
|
114
|
-
variant: "default",
|
|
115
|
-
disabled: !1
|
|
116
|
-
}
|
|
117
|
-
});
|
|
52
|
+
);
|
|
53
|
+
}, p = h(g);
|
|
54
|
+
p.displayName = "Slider";
|
|
118
55
|
export {
|
|
119
|
-
|
|
56
|
+
p as Slider
|
|
120
57
|
};
|
|
121
58
|
//# sourceMappingURL=fondue-components17.js.map
|