@frontify/fondue-components 20.0.0-rc.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components.js +46 -50
- 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 +66 -84
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +49 -50
- 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 +71 -21
- 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 +55 -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 +29 -138
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +157 -53
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +137 -29
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +127 -157
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +30 -134
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +58 -128
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +101 -31
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +12 -59
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +52 -97
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +20 -12
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +7 -56
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +6 -20
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +32 -8
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +3 -5
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +12 -32
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +155 -5
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +2 -2
- package/dist/fondue-components40.js +116 -18
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +22 -59
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +14 -111
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +30 -116
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +53 -21
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +129 -31
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +20 -52
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +53 -130
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +7 -20
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +13 -53
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +14 -7
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +5 -13
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +60 -15
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +18 -5
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +19 -59
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +5 -18
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +14 -18
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +1 -1
- package/dist/fondue-components58.js +16 -10
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +10 -4
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components60.js +35 -18
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +4 -10
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +10 -34
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +5 -35
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +24 -4
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +16 -12
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +150 -4
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +19 -25
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +77 -16
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +8 -151
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components70.js +37 -19
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +69 -76
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +11 -8
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +12 -36
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +12 -70
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +20 -10
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +34 -13
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +10 -12
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +55 -20
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +15 -34
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +24 -9
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +14 -55
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +22 -14
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +6 -24
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +5 -13
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +4 -22
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +4 -8
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +2 -7
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +15 -3
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +39 -4
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +4 -4
- package/dist/fondue-components90.js +6 -17
- package/dist/fondue-components90.js.map +1 -1
- package/dist/index.d.ts +4 -117
- package/dist/style.css +1 -1
- package/package.json +5 -6
- package/dist/fondue-components91.js +0 -43
- package/dist/fondue-components91.js.map +0 -1
- package/dist/fondue-components92.js +0 -9
- package/dist/fondue-components92.js.map +0 -1
- package/dist/fondue-components93.js +0 -5
- package/dist/fondue-components93.js.map +0 -1
|
@@ -1,105 +1,60 @@
|
|
|
1
|
-
import {
|
|
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
|
-
g(f ?? u ?? "");
|
|
33
|
-
}, [u, f]), F(() => {
|
|
34
|
-
var a;
|
|
35
|
-
w && ((a = k.current) == null || a.focus());
|
|
36
|
-
}, [w]), /* @__PURE__ */ v(
|
|
37
|
-
"div",
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-tooltip";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { cn as u } from "./fondue-components38.js";
|
|
5
|
+
import { useFondueTheme as h, ThemeProvider as y } from "./fondue-components31.js";
|
|
6
|
+
import d from "./fondue-components84.js";
|
|
7
|
+
const s = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ o(e.Provider, { children: /* @__PURE__ */ o(e.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
|
|
8
|
+
s.displayName = "Tooltip.Root";
|
|
9
|
+
const l = ({ asChild: t = !1, children: r, "data-test-id": i = "fondue-tooltip-trigger" }, a) => /* @__PURE__ */ o(
|
|
10
|
+
e.Trigger,
|
|
11
|
+
{
|
|
12
|
+
"data-tooltip-trigger": !0,
|
|
13
|
+
"data-test-id": i,
|
|
14
|
+
type: t ? void 0 : "button",
|
|
15
|
+
asChild: t,
|
|
16
|
+
ref: a,
|
|
17
|
+
children: r
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
l.displayName = "Tooltip.Trigger";
|
|
21
|
+
const p = ({
|
|
22
|
+
children: t,
|
|
23
|
+
className: r,
|
|
24
|
+
maxWidth: i,
|
|
25
|
+
"data-test-id": a = "fondue-tooltip-content",
|
|
26
|
+
padding: m = "spacious",
|
|
27
|
+
side: c
|
|
28
|
+
}, g) => {
|
|
29
|
+
const T = h();
|
|
30
|
+
return /* @__PURE__ */ o(e.Portal, { children: /* @__PURE__ */ o(y, { theme: T, children: /* @__PURE__ */ f(
|
|
31
|
+
e.Content,
|
|
38
32
|
{
|
|
39
|
-
|
|
40
|
-
"data-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"data-status": s,
|
|
48
|
-
"data-max-rows": !!N,
|
|
49
|
-
style: { "--max-rows": `${N}` },
|
|
33
|
+
"data-test-id": a,
|
|
34
|
+
"data-tooltip-spacing": m,
|
|
35
|
+
className: u(d.root, r),
|
|
36
|
+
style: { maxWidth: i },
|
|
37
|
+
collisionPadding: 16,
|
|
38
|
+
sideOffset: 8,
|
|
39
|
+
ref: g,
|
|
40
|
+
side: c,
|
|
50
41
|
children: [
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */ o(
|
|
53
|
-
"textarea",
|
|
54
|
-
{
|
|
55
|
-
...t,
|
|
56
|
-
onMouseDown: (a) => {
|
|
57
|
-
h.current = !0, a.currentTarget.dataset.showFocusRing = "false";
|
|
58
|
-
},
|
|
59
|
-
onFocus: (a) => {
|
|
60
|
-
var e;
|
|
61
|
-
h.current || (a.target.dataset.showFocusRing = "true"), (e = t.onFocus) == null || e.call(t, a);
|
|
62
|
-
},
|
|
63
|
-
onBlur: (a) => {
|
|
64
|
-
var e;
|
|
65
|
-
a.target.dataset.showFocusRing = "false", h.current = !1, (e = t.onBlur) == null || e.call(t, a);
|
|
66
|
-
},
|
|
67
|
-
autoComplete: D ? "on" : "off",
|
|
68
|
-
className: l.textarea,
|
|
69
|
-
disabled: n,
|
|
70
|
-
onKeyDown: j,
|
|
71
|
-
onInput: (a) => g(a.currentTarget.value),
|
|
72
|
-
onSelect: (a) => {
|
|
73
|
-
y || (a.currentTarget.selectionStart = a.currentTarget.selectionEnd);
|
|
74
|
-
},
|
|
75
|
-
readOnly: r,
|
|
76
|
-
ref: k,
|
|
77
|
-
rows: R,
|
|
78
|
-
value: C
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
s === "loading" && /* @__PURE__ */ o("div", { className: l.loadingStatus, "data-test-id": `${B}-loader` }),
|
|
82
|
-
T && /* @__PURE__ */ v("div", { className: l.tools, children: [
|
|
83
|
-
s === "success" && /* @__PURE__ */ o("div", { className: l.success, children: /* @__PURE__ */ o($, { size: 20 }) }),
|
|
84
|
-
s === "error" && /* @__PURE__ */ o("div", { className: l[s], children: /* @__PURE__ */ o(b, { size: 20 }) }),
|
|
85
|
-
c == null ? void 0 : c.map(({ icon: a, title: e, callback: M }) => /* @__PURE__ */ o(
|
|
86
|
-
"button",
|
|
87
|
-
{
|
|
88
|
-
className: l.toolsButton,
|
|
89
|
-
disabled: n || r,
|
|
90
|
-
onClick: M,
|
|
91
|
-
title: e,
|
|
92
|
-
children: a
|
|
93
|
-
},
|
|
94
|
-
e
|
|
95
|
-
)),
|
|
96
|
-
i && /* @__PURE__ */ o("button", { className: l.toolsButton, onClick: K, disabled: n || r, children: /* @__PURE__ */ o(q, { size: 20, fill: "currentColor" }) })
|
|
97
|
-
] })
|
|
42
|
+
t,
|
|
43
|
+
/* @__PURE__ */ o(e.Arrow, { "aria-hidden": "true", className: d.arrow })
|
|
98
44
|
]
|
|
99
45
|
}
|
|
100
|
-
);
|
|
46
|
+
) }) });
|
|
47
|
+
};
|
|
48
|
+
p.displayName = "Tooltip.Content";
|
|
49
|
+
const w = {
|
|
50
|
+
Root: s,
|
|
51
|
+
Trigger: n(l),
|
|
52
|
+
Content: n(p)
|
|
101
53
|
};
|
|
102
54
|
export {
|
|
103
|
-
|
|
55
|
+
w as Tooltip,
|
|
56
|
+
p as TooltipContent,
|
|
57
|
+
s as TooltipRoot,
|
|
58
|
+
l as TooltipTrigger
|
|
104
59
|
};
|
|
105
60
|
//# sourceMappingURL=fondue-components32.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components32.js","sources":["../src/components/Textarea/Textarea.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconCross, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport {\n useEffect,\n useRef,\n useState,\n type ChangeEventHandler,\n type CSSProperties,\n type FocusEventHandler,\n type KeyboardEventHandler,\n type ReactElement,\n type SyntheticEvent,\n} from 'react';\n\nimport styles from './styles/textarea.module.scss';\n\nexport type ExtraAction = {\n icon: ReactElement;\n title: string;\n callback: () => void;\n};\n\ntype Status = 'default' | 'loading' | 'success' | 'error';\n\ntype TextareaProps = {\n /**\n * The id of the textarea\n */\n id?: string;\n /**\n * If `true`, Textarea will have `autoComplete` functionality\n */\n autocomplete?: boolean;\n /**\n * If `true`, component rendered is a auto sizing Textarea\n */\n autosize?: boolean;\n /**\n * Render `clear` button to clear input on click\n */\n clearable?: boolean;\n /**\n * A `ReactElement` that will be rendered at the start of the `Textarea`\n */\n decorator?: ReactElement;\n /**\n * Initial value\n */\n defaultValue?: string;\n disabled?: boolean;\n /**\n * Collection of extra actions the input can preform\n */\n extraActions?: ExtraAction[];\n /**\n * If `true`, Textarea will be focused on mount\n */\n focusOnMount?: boolean;\n /**\n * If autosize is false, this is used as rows property for default textarea\n * @default 1\n */\n minRows?: number;\n /**\n * If `autosize` is `false`, this property is ignored\n */\n maxRows?: number;\n /**\n * Event handler called when the textarea value changes\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when the text input is blurred\n */\n onBlur?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when the text input is focused\n */\n onFocus?: FocusEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when a key is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when Enter is pressed\n */\n onEnterPressed?: KeyboardEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when a key is released\n */\n onKeyUp?: KeyboardEventHandler<HTMLTextAreaElement>;\n /**\n * Event handler called when the text inside of text input is selected\n */\n onSelect?: (event: SyntheticEvent<HTMLTextAreaElement>) => void;\n /**\n * If `true`, Textarea will be required\n */\n required?: boolean;\n /**\n * The test id of the textarea\n */\n 'data-test-id'?: string;\n placeholder?: string;\n readOnly?: boolean;\n resizable?: boolean;\n selectable?: boolean;\n /**\n * The current status of the input. It will trigger the corresponding icon to be appended to the Textarea.\n * @default 'default'\n */\n status?: Status;\n value?: string;\n};\n\nexport const Textarea = ({\n 'data-test-id': dataTestId = 'fondue-textarea',\n autocomplete,\n autosize,\n clearable,\n decorator,\n defaultValue,\n disabled,\n extraActions,\n focusOnMount,\n minRows: rows = 1,\n maxRows,\n onEnterPressed,\n readOnly,\n resizable,\n selectable = true,\n status = 'default',\n value: inputValue,\n ...props\n}: TextareaProps) => {\n const ref = useRef<HTMLTextAreaElement>(null);\n const wasClicked = useRef(false);\n\n const [value, setValue] = useState(inputValue ?? defaultValue ?? '');\n\n const hasTools = extraActions?.length !== undefined || clearable || ['success', 'error'].includes(status);\n\n const clear = () => {\n setValue('');\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (event) => {\n if (event.key === 'Enter') {\n onEnterPressed?.(event);\n }\n props.onKeyDown?.(event);\n };\n\n useEffect(() => {\n setValue(inputValue ?? defaultValue ?? '');\n }, [defaultValue, inputValue]);\n\n useEffect(() => {\n if (focusOnMount) {\n ref.current?.focus();\n }\n }, [focusOnMount]);\n\n return (\n <div\n className={styles.root}\n data-autosize={autosize}\n data-clearable={clearable}\n data-disabled={disabled || readOnly}\n data-has-decorator={decorator ? true : false}\n data-has-tools={hasTools}\n data-replicated-value={value}\n data-resizable={resizable}\n data-status={status}\n data-max-rows={!!maxRows}\n style={{ '--max-rows': `${maxRows}` } as CSSProperties}\n >\n {decorator ? <div className={styles.decorator}>{decorator}</div> : null}\n <textarea\n {...props}\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 props.onFocus?.(focusEvent);\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n props.onBlur?.(blurEvent);\n }}\n autoComplete={autocomplete ? 'on' : 'off'}\n className={styles.textarea}\n disabled={disabled}\n onKeyDown={handleKeyDown}\n onInput={(event) => setValue(event.currentTarget.value)}\n onSelect={(event) => {\n if (!selectable) {\n event.currentTarget.selectionStart = event.currentTarget.selectionEnd;\n }\n }}\n readOnly={readOnly}\n ref={ref}\n rows={rows}\n value={value}\n ></textarea>\n {status === 'loading' && <div className={styles.loadingStatus} data-test-id={`${dataTestId}-loader`} />}\n {hasTools && (\n <div className={styles.tools}>\n {status === 'success' && (\n <div className={styles.success}>\n <IconCheckMark size={20} />\n </div>\n )}\n {status === 'error' && (\n <div className={styles[status]}>\n <IconExclamationMarkTriangle size={20} />\n </div>\n )}\n {extraActions?.map(({ icon, title, callback }) => (\n <button\n className={styles.toolsButton}\n disabled={disabled || readOnly}\n key={title}\n onClick={callback}\n title={title}\n >\n {icon}\n </button>\n ))}\n {clearable && (\n <button className={styles.toolsButton} onClick={clear} disabled={disabled || readOnly}>\n <IconCross size={20} fill=\"currentColor\" />\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"names":["Textarea","dataTestId","autocomplete","autosize","clearable","decorator","defaultValue","disabled","extraActions","focusOnMount","rows","maxRows","onEnterPressed","readOnly","resizable","selectable","status","inputValue","props","ref","useRef","wasClicked","value","setValue","useState","hasTools","clear","handleKeyDown","event","_a","useEffect","jsxs","styles","jsx","mouseEvent","focusEvent","blurEvent","IconCheckMark","IconExclamationMarkTriangle","icon","title","callback","IconCross"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components32.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport type TooltipTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipTrigger = (\n { asChild = false, children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger\n data-tooltip-trigger\n data-test-id={dataTestId}\n type={!asChild ? 'button' : undefined}\n asChild={asChild}\n ref={ref}\n >\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n side,\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixTooltip.Portal>\n <ThemeProvider theme={theme}>\n <RadixTooltip.Content\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={cn(styles.root, className)}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n side={side}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </ThemeProvider>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","asChild","dataTestId","ref","TooltipContent","className","maxWidth","padding","side","theme","useFondueTheme","ThemeProvider","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;;AA4BO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAExD,gBAAAC,EAACC,EAAa,UAAb,EACG,UAAA,gBAAAD,EAACC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,GACJ;AAGRD,EAAY,cAAc;AAYnB,MAAMO,IAAiB,CAC1B,EAAE,SAAAC,IAAU,IAAO,UAAAP,GAAU,gBAAgBQ,IAAa,yBAAA,GAC1DC,MAGI,gBAAAL;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACG,wBAAoB;AAAA,IACpB,gBAAcG;AAAA,IACd,MAAOD,IAAqB,SAAX;AAAA,IACjB,SAAAA;AAAA,IACA,KAAAE;AAAA,IAEC,UAAAT;AAAA,EAAA;AAAA;AAIbM,EAAe,cAAc;AAiBtB,MAAMI,IAAiB,CAC1B;AAAA,EACI,UAAAV;AAAA,EACA,WAAAW;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,MAAAC;AACJ,GACAL,MACC;AACD,QAAMM,IAAQC,EAAA;AACd,2BACKX,EAAa,QAAb,EACG,UAAA,gBAAAD,EAACa,KAAc,OAAAF,GACX,UAAA,gBAAAG;AAAA,IAACb,EAAa;AAAA,IAAb;AAAA,MACG,gBAAcG;AAAA,MACd,wBAAsBK;AAAA,MACtB,WAAWM,EAAGC,EAAO,MAAMT,CAAS;AAAA,MACpC,OAAO,EAAE,UAAAC,EAAA;AAAA,MACT,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,KAAAH;AAAA,MACA,MAAAK;AAAA,MAEC,UAAA;AAAA,QAAAd;AAAA,QACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWe,EAAO,MAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAExE,EAAA,CACJ;AAER;AACAV,EAAe,cAAc;AAEtB,MAAMW,IAAU;AAAA,EACnB,MAAMtB;AAAA,EACN,SAASuB,EAAmDhB,CAAc;AAAA,EAC1E,SAASgB,EAAgDZ,CAAc;AAC3E;"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const o = "_root_1jhe2_2", c = "_accordionItem_1jhe2_23", n = "_accordionTrigger_1jhe2_29", r = "_accordionHeader_1jhe2_34", t = "_accordionSlot_1jhe2_41", e = "_accordionCaret_1jhe2_66", a = "_accordionTriggerContent_1jhe2_74", i = "_accordionContent_1jhe2_79", d = "_accordionContentText_1jhe2_108", _ = {
|
|
2
|
+
root: o,
|
|
3
|
+
accordionItem: c,
|
|
4
|
+
accordionTrigger: n,
|
|
5
|
+
accordionHeader: r,
|
|
6
|
+
accordionSlot: t,
|
|
7
|
+
accordionCaret: e,
|
|
8
|
+
accordionTriggerContent: a,
|
|
9
|
+
accordionContent: i,
|
|
10
|
+
accordionContentText: d
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
e as
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
e as accordionCaret,
|
|
14
|
+
i as accordionContent,
|
|
15
|
+
d as accordionContentText,
|
|
16
|
+
r as accordionHeader,
|
|
17
|
+
c as accordionItem,
|
|
18
|
+
t as accordionSlot,
|
|
19
|
+
n as accordionTrigger,
|
|
20
|
+
a as accordionTriggerContent,
|
|
21
|
+
_ as default,
|
|
22
|
+
o as root
|
|
15
23
|
};
|
|
16
24
|
//# sourceMappingURL=fondue-components33.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components33.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components33.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,60 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const s = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ o(e.Provider, { children: /* @__PURE__ */ o(e.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
|
|
8
|
-
s.displayName = "Tooltip.Root";
|
|
9
|
-
const l = ({ asChild: t = !1, children: r, "data-test-id": i = "fondue-tooltip-trigger" }, a) => /* @__PURE__ */ o(
|
|
10
|
-
e.Trigger,
|
|
11
|
-
{
|
|
12
|
-
"data-tooltip-trigger": !0,
|
|
13
|
-
"data-test-id": i,
|
|
14
|
-
type: t ? void 0 : "button",
|
|
15
|
-
asChild: t,
|
|
16
|
-
ref: a,
|
|
17
|
-
children: r
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
l.displayName = "Tooltip.Trigger";
|
|
21
|
-
const p = ({
|
|
22
|
-
children: t,
|
|
23
|
-
className: r,
|
|
24
|
-
maxWidth: i,
|
|
25
|
-
"data-test-id": a = "fondue-tooltip-content",
|
|
26
|
-
padding: m = "spacious",
|
|
27
|
-
side: c
|
|
28
|
-
}, g) => {
|
|
29
|
-
const T = h();
|
|
30
|
-
return /* @__PURE__ */ o(e.Portal, { children: /* @__PURE__ */ o(y, { theme: T, children: /* @__PURE__ */ f(
|
|
31
|
-
e.Content,
|
|
32
|
-
{
|
|
33
|
-
"data-test-id": a,
|
|
34
|
-
"data-tooltip-spacing": m,
|
|
35
|
-
className: u(d.root, r),
|
|
36
|
-
style: { maxWidth: i },
|
|
37
|
-
collisionPadding: 16,
|
|
38
|
-
sideOffset: 8,
|
|
39
|
-
ref: g,
|
|
40
|
-
side: c,
|
|
41
|
-
children: [
|
|
42
|
-
t,
|
|
43
|
-
/* @__PURE__ */ o(e.Arrow, { "aria-hidden": "true", className: d.arrow })
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
) }) });
|
|
47
|
-
};
|
|
48
|
-
p.displayName = "Tooltip.Content";
|
|
49
|
-
const w = {
|
|
50
|
-
Root: s,
|
|
51
|
-
Trigger: n(l),
|
|
52
|
-
Content: n(p)
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import s from "./fondue-components85.js";
|
|
3
|
+
import { colorToCss as e } from "./fondue-components86.js";
|
|
4
|
+
const a = ["default", "positive", "highlight", "warning", "negative"], i = (t) => typeof t == "string" && a.includes(t), p = ({ status: t }) => {
|
|
5
|
+
const o = i(t) ? { "data-status": t } : { style: { backgroundColor: typeof t == "string" ? t : e(t) || "transparent" } };
|
|
6
|
+
return /* @__PURE__ */ r("div", { "data-test-id": "badge-status", className: s.root, ...o });
|
|
53
7
|
};
|
|
54
8
|
export {
|
|
55
|
-
|
|
56
|
-
p as TooltipContent,
|
|
57
|
-
s as TooltipRoot,
|
|
58
|
-
l as TooltipTrigger
|
|
9
|
+
p as BadgeStatus
|
|
59
10
|
};
|
|
60
11
|
//# sourceMappingURL=fondue-components34.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components34.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components34.js","sources":["../src/components/Badge/BadgeStatus.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport styles from './styles/badgestatus.module.scss';\nimport { type RgbaColor } from './types';\nimport { colorToCss } from './utils';\n\ntype BadgeStatusType = 'default' | 'positive' | 'highlight' | 'warning' | 'negative';\n\nconst badgeStatusMap = ['default', 'positive', 'highlight', 'warning', 'negative'];\n\nexport type BadgeStatusProps = { status: BadgeStatusType } | { status: RgbaColor | string };\n\nconst isBadgeStatusType = (value: RgbaColor | string): value is BadgeStatusType =>\n typeof value === 'string' && badgeStatusMap.includes(value);\n\nexport const BadgeStatus = ({ status }: BadgeStatusProps) => {\n const colorProps = isBadgeStatusType(status)\n ? { 'data-status': status }\n : { style: { backgroundColor: typeof status === 'string' ? status : colorToCss(status) || 'transparent' } };\n\n return <div data-test-id=\"badge-status\" className={styles.root} {...colorProps}></div>;\n};\n"],"names":["badgeStatusMap","isBadgeStatusType","value","BadgeStatus","status","colorProps","colorToCss","jsx","styles"],"mappings":";;;AAQA,MAAMA,IAAiB,CAAC,WAAW,YAAY,aAAa,WAAW,UAAU,GAI3EC,IAAoB,CAACC,MACvB,OAAOA,KAAU,YAAYF,EAAe,SAASE,CAAK,GAEjDC,IAAc,CAAC,EAAE,QAAAC,QAA+B;AACzD,QAAMC,IAAaJ,EAAkBG,CAAM,IACrC,EAAE,eAAeA,EAAA,IACjB,EAAE,OAAO,EAAE,iBAAiB,OAAOA,KAAW,WAAWA,IAASE,EAAWF,CAAM,KAAK,gBAAc;AAE5G,SAAO,gBAAAG,EAAC,SAAI,gBAAa,gBAAe,WAAWC,EAAO,MAAO,GAAGH,GAAY;AACpF;"}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
|
|
4
|
-
accordionTrigger: n,
|
|
5
|
-
accordionHeader: r,
|
|
6
|
-
accordionSlot: t,
|
|
7
|
-
accordionCaret: e,
|
|
8
|
-
accordionTriggerContent: a,
|
|
9
|
-
accordionContent: i,
|
|
10
|
-
accordionContentText: d
|
|
1
|
+
const s = "_root_frcwu_3", o = "_dismiss_frcwu_154", t = {
|
|
2
|
+
root: s,
|
|
3
|
+
dismiss: o
|
|
11
4
|
};
|
|
12
5
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
r as accordionHeader,
|
|
17
|
-
c as accordionItem,
|
|
18
|
-
t as accordionSlot,
|
|
19
|
-
n as accordionTrigger,
|
|
20
|
-
a as accordionTriggerContent,
|
|
21
|
-
_ as default,
|
|
22
|
-
o as root
|
|
6
|
+
t as default,
|
|
7
|
+
o as dismiss,
|
|
8
|
+
s as root
|
|
23
9
|
};
|
|
24
10
|
//# sourceMappingURL=fondue-components35.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components35.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components35.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const g = (n) => n.startsWith("aria-") || n === "role", s = {
|
|
2
|
+
m: "margin",
|
|
3
|
+
mx: "margin-x",
|
|
4
|
+
my: "margin-y",
|
|
5
|
+
mt: "margin-top",
|
|
6
|
+
mr: "margin-right",
|
|
7
|
+
mb: "margin-bottom",
|
|
8
|
+
ml: "margin-left",
|
|
9
|
+
p: "padding",
|
|
10
|
+
px: "padding-x",
|
|
11
|
+
py: "padding-y",
|
|
12
|
+
pt: "padding-top",
|
|
13
|
+
pr: "padding-right",
|
|
14
|
+
pb: "padding-bottom",
|
|
15
|
+
pl: "padding-left",
|
|
16
|
+
direction: "flex-direction",
|
|
17
|
+
align: "align-items",
|
|
18
|
+
wrap: "flex-wrap",
|
|
19
|
+
columns: "grid-template-columns",
|
|
20
|
+
rows: "grid-template-rows"
|
|
21
|
+
}, m = (n, r) => n === "columns" || n === "rows" ? typeof r == "number" ? `repeat(${r}, 1fr)` : r : typeof r == "number" ? `${r * 0.25}rem` : r, f = (n, r = {}) => Object.entries(n).reduce((i, [t, o]) => {
|
|
22
|
+
if (g(t))
|
|
23
|
+
return i;
|
|
24
|
+
const e = t in r ? r[t] : t in s ? s[t] : t, p = e == null ? void 0 : e.replaceAll(/([\da-z]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
25
|
+
if (typeof o == "object")
|
|
26
|
+
for (const [d, a] of Object.entries(o))
|
|
27
|
+
a !== void 0 && (i[`--${d}-${p}`] = m(t, a));
|
|
28
|
+
else
|
|
29
|
+
i[`--${p}`] = m(t, o);
|
|
30
|
+
return i;
|
|
31
|
+
}, {});
|
|
8
32
|
export {
|
|
9
|
-
|
|
33
|
+
f as propsToCssVariables
|
|
10
34
|
};
|
|
11
35
|
//# sourceMappingURL=fondue-components36.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components36.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components36.js","sources":["../src/helpers/propsToCssVariables.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nimport { type Breakpoint } from './layout';\n\nconst isAriaProp = (key: string): boolean => {\n return key.startsWith('aria-') || key === 'role';\n};\n\nconst abbreviationToCssProperty: Record<string, string> = {\n m: 'margin',\n mx: 'margin-x',\n my: 'margin-y',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n p: 'padding',\n px: 'padding-x',\n py: 'padding-y',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n direction: 'flex-direction',\n align: 'align-items',\n wrap: 'flex-wrap',\n columns: 'grid-template-columns',\n rows: 'grid-template-rows',\n};\n\nconst transformValueBasedOnKey = (key: string, value: string | number): string | number => {\n if (key === 'columns' || key === 'rows') {\n if (typeof value === 'number') {\n return `repeat(${value}, 1fr)`;\n }\n return value;\n }\n\n // Spacing tokens\n if (typeof value === 'number') {\n return `${value * 0.25}rem`;\n }\n\n return value;\n};\n\nexport const propsToCssVariables = (\n props: Record<string, string | number | boolean | { [key in Breakpoint]?: string | number | boolean }>,\n extraAbbreviationToCssProperty: Record<string, string> = {},\n): CSSProperties => {\n return Object.entries(props).reduce((acc, [key, value]) => {\n if (isAriaProp(key)) {\n return acc;\n }\n\n const cssProperty =\n key in extraAbbreviationToCssProperty\n ? extraAbbreviationToCssProperty[key]\n : key in abbreviationToCssProperty\n ? abbreviationToCssProperty[key]\n : key;\n // The lookahead is necessary to split camelCase boundaries; disabling false-positive lint warning\n const cssPropertyKebabCase = cssProperty?.replaceAll(/([\\da-z]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n\n if (typeof value === 'object') {\n for (const [breakpoint, breakpointValue] of Object.entries(value)) {\n if (breakpointValue !== undefined) {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${breakpoint}-${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, breakpointValue);\n }\n }\n } else {\n // @ts-expect-error CSS variables are not typed into `CSSProperties`\n acc[`--${cssPropertyKebabCase}`] = transformValueBasedOnKey(key, value);\n }\n\n return acc;\n }, {} as CSSProperties);\n};\n"],"names":["isAriaProp","key","abbreviationToCssProperty","transformValueBasedOnKey","value","propsToCssVariables","props","extraAbbreviationToCssProperty","acc","cssProperty","cssPropertyKebabCase","breakpoint","breakpointValue"],"mappings":"AAMA,MAAMA,IAAa,CAACC,MACTA,EAAI,WAAW,OAAO,KAAKA,MAAQ,QAGxCC,IAAoD;AAAA,EACtD,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AACV,GAEMC,IAA2B,CAACF,GAAaG,MACvCH,MAAQ,aAAaA,MAAQ,SACzB,OAAOG,KAAU,WACV,UAAUA,CAAK,WAEnBA,IAIP,OAAOA,KAAU,WACV,GAAGA,IAAQ,IAAI,QAGnBA,GAGEC,IAAsB,CAC/BC,GACAC,IAAyD,OAElD,OAAO,QAAQD,CAAK,EAAE,OAAO,CAACE,GAAK,CAACP,GAAKG,CAAK,MAAM;AACvD,MAAIJ,EAAWC,CAAG;AACd,WAAOO;AAGX,QAAMC,IACFR,KAAOM,IACDA,EAA+BN,CAAG,IAClCA,KAAOC,IACLA,EAA0BD,CAAG,IAC7BA,GAENS,IAAuBD,KAAA,gBAAAA,EAAa,WAAW,+BAA+B,SAAS;AAE7F,MAAI,OAAOL,KAAU;AACjB,eAAW,CAACO,GAAYC,CAAe,KAAK,OAAO,QAAQR,CAAK;AAC5D,MAAIQ,MAAoB,WAEpBJ,EAAI,KAAKG,CAAU,IAAID,CAAoB,EAAE,IAAIP,EAAyBF,GAAKW,CAAe;AAAA;AAKtG,IAAAJ,EAAI,KAAKE,CAAoB,EAAE,IAAIP,EAAyBF,GAAKG,CAAK;AAG1E,SAAOI;AACX,GAAG,CAAA,CAAmB;"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
dismiss: o
|
|
1
|
+
const o = "_root_howjn_6", t = {
|
|
2
|
+
root: o
|
|
4
3
|
};
|
|
5
4
|
export {
|
|
6
5
|
t as default,
|
|
7
|
-
o as
|
|
8
|
-
s as root
|
|
6
|
+
o as root
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=fondue-components37.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components37.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components37.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,35 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
py: "padding-y",
|
|
12
|
-
pt: "padding-top",
|
|
13
|
-
pr: "padding-right",
|
|
14
|
-
pb: "padding-bottom",
|
|
15
|
-
pl: "padding-left",
|
|
16
|
-
direction: "flex-direction",
|
|
17
|
-
align: "align-items",
|
|
18
|
-
wrap: "flex-wrap",
|
|
19
|
-
columns: "grid-template-columns",
|
|
20
|
-
rows: "grid-template-rows"
|
|
21
|
-
}, m = (n, r) => n === "columns" || n === "rows" ? typeof r == "number" ? `repeat(${r}, 1fr)` : r : typeof r == "number" ? `${r * 0.25}rem` : r, f = (n, r = {}) => Object.entries(n).reduce((i, [t, o]) => {
|
|
22
|
-
if (g(t))
|
|
23
|
-
return i;
|
|
24
|
-
const e = t in r ? r[t] : t in s ? s[t] : t, p = e == null ? void 0 : e.replaceAll(/([\da-z]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
25
|
-
if (typeof o == "object")
|
|
26
|
-
for (const [d, a] of Object.entries(o))
|
|
27
|
-
a !== void 0 && (i[`--${d}-${p}`] = m(t, a));
|
|
28
|
-
else
|
|
29
|
-
i[`--${p}`] = m(t, o);
|
|
30
|
-
return i;
|
|
31
|
-
}, {});
|
|
1
|
+
import { extendTailwindMerge as e } from "tailwind-merge";
|
|
2
|
+
import { tv as o } from "tailwind-variants";
|
|
3
|
+
const r = e({
|
|
4
|
+
prefix: "tw-",
|
|
5
|
+
extend: {
|
|
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);
|
|
32
11
|
export {
|
|
33
|
-
|
|
12
|
+
m as cn,
|
|
13
|
+
x as sv
|
|
34
14
|
};
|
|
35
15
|
//# sourceMappingURL=fondue-components38.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components38.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components38.js","sources":["../src/utilities/styleUtilities.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { extendTailwindMerge } from 'tailwind-merge';\nimport { tv, type TV } from 'tailwind-variants';\n\ntype ClassNameValue = ClassNameArray | string | null | undefined | 0 | false;\ntype ClassNameArray = ClassNameValue[];\n\nconst customTwMerge = extendTailwindMerge({\n prefix: 'tw-',\n extend: {\n classGroups: {\n 'font-size': ['text-body-x-small', 'text-body-small', 'text-body-medium', 'text-body-large'],\n },\n },\n});\n\nexport const cn = (...classLists: ClassNameValue[]): string => {\n return customTwMerge(...classLists);\n};\n\nexport const sv: TV = (variants) => {\n return tv(variants);\n};\n"],"names":["customTwMerge","extendTailwindMerge","cn","classLists","sv","variants","tv"],"mappings":";;AAQA,MAAMA,IAAgBC,EAAoB;AAAA,EACtC,QAAQ;AAAA,EACR,QAAQ;AAAA,IACJ,aAAa;AAAA,MACT,aAAa,CAAC,qBAAqB,mBAAmB,oBAAoB,iBAAiB;AAAA,IAAA;AAAA,EAC/F;AAER,CAAC,GAEYC,IAAK,IAAIC,MACXH,EAAc,GAAGG,CAAU,GAGzBC,IAAS,CAACC,MACZC,EAAGD,CAAQ;"}
|