@frontify/fondue-components 3.2.1 → 3.3.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 +18 -16
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +2 -2
- package/dist/fondue-components11.js +42 -30
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components15.js +64 -6
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +6 -47
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +42 -50
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +112 -29
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +53 -110
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +27 -64
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +64 -41
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +43 -32
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +32 -5
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +5 -12
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +10 -153
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +59 -22
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +17 -17
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +112 -15
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +19 -30
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +2 -2
- package/dist/fondue-components30.js +32 -28
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +23 -125
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +129 -20
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +21 -45
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +45 -15
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +28 -60
- 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 +60 -19
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +15 -17
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +16 -4
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +4 -4
- package/dist/fondue-components40.js +3 -11
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +11 -3
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +5 -35
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +35 -5
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +12 -24
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +4 -16
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +24 -10
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +14 -10
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +2 -2
- package/dist/fondue-components53.js +1 -1
- package/dist/fondue-components54.js +9 -16
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +12 -6
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +18 -2
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +4 -8
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +2 -39
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +14 -0
- package/dist/fondue-components59.js.map +1 -0
- package/dist/fondue-components6.js +5 -5
- package/dist/fondue-components60.js +42 -0
- package/dist/fondue-components60.js.map +1 -0
- package/dist/fondue-components7.js +78 -68
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components8.js +2 -2
- package/dist/fondue-components9.js +3 -3
- package/dist/index.d.ts +27 -3
- package/dist/style.css +1 -1
- package/package.json +16 -15
|
@@ -1,46 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as n } from "react";
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"data-test-id": a
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheckMark as w, IconExclamationMarkTriangle as N } from "@frontify/fondue-icons";
|
|
3
|
+
import { forwardRef as n, useRef as S } from "react";
|
|
4
|
+
import { cn as m } from "./fondue-components25.js";
|
|
5
|
+
import r from "./fondue-components56.js";
|
|
6
|
+
const f = ({
|
|
7
|
+
children: c,
|
|
8
|
+
className: d,
|
|
9
|
+
status: e = "neutral",
|
|
10
|
+
"data-test-id": a = "fondue-text-input",
|
|
11
|
+
...t
|
|
12
|
+
}, R) => {
|
|
13
|
+
const i = S(!1);
|
|
14
|
+
return /* @__PURE__ */ g("div", { className: m(r.root, d), "data-status": e, "data-test-id": a, children: [
|
|
15
|
+
e === "loading" ? /* @__PURE__ */ s("div", { className: r.loadingStatus, "data-test-id": `${a}-loader` }) : null,
|
|
16
|
+
/* @__PURE__ */ s(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
onMouseDown: (o) => {
|
|
20
|
+
i.current = !0, o.currentTarget.dataset.showFocusRing = "false";
|
|
21
|
+
},
|
|
22
|
+
type: "text",
|
|
23
|
+
...t,
|
|
24
|
+
onFocus: (o) => {
|
|
25
|
+
var l;
|
|
26
|
+
i.current || (o.target.dataset.showFocusRing = "true"), (l = t.onFocus) == null || l.call(t, o);
|
|
27
|
+
},
|
|
28
|
+
onBlur: (o) => {
|
|
29
|
+
var l;
|
|
30
|
+
o.target.dataset.showFocusRing = "false", i.current = !1, (l = t.onBlur) == null || l.call(t, o);
|
|
31
|
+
},
|
|
32
|
+
ref: R,
|
|
33
|
+
className: r.input,
|
|
34
|
+
"aria-invalid": e === "error"
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
e === "success" ? /* @__PURE__ */ s(w, { size: 16, className: r.iconSuccess, "data-test-id": `${a}-success-icon` }) : null,
|
|
38
|
+
e === "error" ? /* @__PURE__ */ s(
|
|
39
|
+
N,
|
|
40
|
+
{
|
|
41
|
+
size: 16,
|
|
42
|
+
className: r.iconError,
|
|
43
|
+
"data-test-id": `${a}-error-icon`
|
|
44
|
+
}
|
|
45
|
+
) : null,
|
|
46
|
+
c
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
f.displayName = "TextField.Root";
|
|
50
|
+
const u = ({ name: c, className: d, ...e }, a) => /* @__PURE__ */ s(
|
|
51
|
+
"div",
|
|
19
52
|
{
|
|
20
|
-
"data-
|
|
21
|
-
"data-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
sideOffset: 8,
|
|
26
|
-
ref: T,
|
|
27
|
-
...m,
|
|
28
|
-
children: [
|
|
29
|
-
t,
|
|
30
|
-
/* @__PURE__ */ e(o.Arrow, { "aria-hidden": "true", className: s.arrow })
|
|
31
|
-
]
|
|
53
|
+
"data-slot": !0,
|
|
54
|
+
"data-name": c,
|
|
55
|
+
...e,
|
|
56
|
+
ref: a,
|
|
57
|
+
className: m(r.slot, d)
|
|
32
58
|
}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Content: n(p)
|
|
39
|
-
};
|
|
59
|
+
);
|
|
60
|
+
u.displayName = "TextField.Slot";
|
|
61
|
+
const x = n(f), T = n(u), F = x;
|
|
62
|
+
F.Root = x;
|
|
63
|
+
F.Slot = T;
|
|
40
64
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
l as TooltipTrigger
|
|
65
|
+
f as TextFieldRoot,
|
|
66
|
+
u as TextFieldSlot,
|
|
67
|
+
F as TextInput
|
|
45
68
|
};
|
|
46
69
|
//# 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/TextInput/TextInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useRef,\n type ChangeEvent,\n type ForwardedRef,\n type KeyboardEvent,\n type ReactNode,\n type SyntheticEvent,\n} from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/text.module.scss';\n\nexport type TextInputProps = {\n id?: string;\n name?: string;\n /**\n * The place where the input slots are placed\n */\n children?: ReactNode;\n /**\n * The default value of the text input\n * Used for uncontrolled components\n */\n defaultValue?: string | number;\n /**\n * The controlled value of the text input\n */\n value?: string | number;\n /**\n * Type of the text input\n * @default \"text\"\n */\n type?: 'date' | 'email' | 'hidden' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url';\n /**\n * The placeholder in the text input\n */\n placeholder?: string;\n /**\n * Disable the text input\n * @default false\n */\n disabled?: boolean;\n /**\n * Make the text input required in form\n * @default false\n */\n required?: boolean;\n /**\n * Make the text input spell-checkable\n * @default true\n */\n spellCheck?: boolean;\n /**\n * Make the text input read-only\n * @default false\n */\n readOnly?: boolean;\n /**\n * Set the type of input so autocomplete can help the user\n * @default \"on\"\n */\n autoComplete?: string;\n /**\n * The maximum length of the text input\n */\n maxLength?: number;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error' | 'loading';\n className?: string;\n /**\n * Event handler called when the text input value changes\n */\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text input is blurred\n */\n onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text input is focused\n */\n onFocus?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when a key is pressed\n */\n onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when a key is released\n */\n onKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text inside of text input is selected\n */\n onSelect?: (event: SyntheticEvent<HTMLInputElement>) => void;\n 'data-test-id'?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n};\n\nexport const TextFieldRoot = (\n {\n children,\n className,\n status = 'neutral',\n 'data-test-id': dataTestId = 'fondue-text-input',\n ...inputProps\n }: TextInputProps,\n ref: ForwardedRef<HTMLInputElement>,\n) => {\n const wasClicked = useRef(false);\n\n return (\n <div className={cn(styles.root, className)} data-status={status} data-test-id={dataTestId}>\n {status === 'loading' ? (\n <div className={styles.loadingStatus} data-test-id={`${dataTestId}-loader`} />\n ) : null}\n <input\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n type=\"text\"\n {...inputProps}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n inputProps.onFocus?.(focusEvent);\n }}\n onBlur={(blurEvent) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n inputProps.onBlur?.(blurEvent);\n }}\n ref={ref}\n className={styles.input}\n aria-invalid={status === 'error'}\n />\n\n {status === 'success' ? (\n <IconCheckMark size={16} className={styles.iconSuccess} data-test-id={`${dataTestId}-success-icon`} />\n ) : null}\n\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n\n {children}\n </div>\n );\n};\nTextFieldRoot.displayName = 'TextField.Root';\n\nexport type TextFieldSlotProps = {\n children: ReactNode;\n name?: 'left' | 'right';\n className?: string;\n};\n\nexport const TextFieldSlot = (\n { name, className, ...slotProps }: TextFieldSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-slot={true}\n data-name={name}\n {...slotProps}\n ref={forwardedRef}\n className={cn(styles.slot, className)}\n />\n );\n};\n\nTextFieldSlot.displayName = 'TextField.Slot';\n\nconst ForwardedRefTextFieldRoot = forwardRef<HTMLInputElement, TextInputProps>(TextFieldRoot);\nconst ForwardedRefTextFieldSlot = forwardRef<HTMLDivElement, TextFieldSlotProps>(TextFieldSlot);\n// @ts-expect-error We support both single component (without slots) and compound components (with slots)\nexport const TextInput: typeof TextFieldRoot & {\n Root: typeof ForwardedRefTextFieldRoot;\n Slot: typeof ForwardedRefTextFieldSlot;\n} = ForwardedRefTextFieldRoot;\nTextInput.Root = ForwardedRefTextFieldRoot;\nTextInput.Slot = ForwardedRefTextFieldSlot;\n"],"names":["TextFieldRoot","children","className","status","dataTestId","inputProps","ref","wasClicked","useRef","jsxs","cn","styles","jsx","mouseEvent","focusEvent","_a","blurEvent","IconCheckMark","IconExclamationMarkTriangle","TextFieldSlot","name","slotProps","forwardedRef","ForwardedRefTextFieldRoot","forwardRef","ForwardedRefTextFieldSlot","TextInput"],"mappings":";;;;;AA2GO,MAAMA,IAAgB,CACzB;AAAA,EACI,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACK,QAAAC,IAAaC,EAAO,EAAK;AAG3B,SAAA,gBAAAC,EAAC,OAAI,EAAA,WAAWC,EAAGC,EAAO,MAAMT,CAAS,GAAG,eAAaC,GAAQ,gBAAcC,GAC1E,UAAA;AAAA,IAAWD,MAAA,YACP,gBAAAS,EAAA,OAAA,EAAI,WAAWD,EAAO,eAAe,gBAAc,GAAGP,CAAU,UAAA,CAAW,IAC5E;AAAA,IACJ,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,aAAa,CAACC,MAAe;AACzB,UAAAN,EAAW,UAAU,IACVM,EAAA,cAAc,QAAQ,gBAAgB;AAAA,QACrD;AAAA,QACA,MAAK;AAAA,QACJ,GAAGR;AAAA,QACJ,SAAS,CAACS,MAAe;;AACjB,UAACP,EAAW,YACDO,EAAA,OAAO,QAAQ,gBAAgB,UAE9CC,IAAAV,EAAW,YAAX,QAAAU,EAAA,KAAAV,GAAqBS;AAAA,QACzB;AAAA,QACA,QAAQ,CAACE,MAAc;;AACT,UAAAA,EAAA,OAAO,QAAQ,gBAAgB,SACzCT,EAAW,UAAU,KACrBQ,IAAAV,EAAW,WAAX,QAAAU,EAAA,KAAAV,GAAoBW;AAAA,QACxB;AAAA,QACA,KAAAV;AAAA,QACA,WAAWK,EAAO;AAAA,QAClB,gBAAcR,MAAW;AAAA,MAAA;AAAA,IAC7B;AAAA,IAECA,MAAW,YACP,gBAAAS,EAAAK,GAAA,EAAc,MAAM,IAAI,WAAWN,EAAO,aAAa,gBAAc,GAAGP,CAAU,gBAAiB,CAAA,IACpG;AAAA,IAEHD,MAAW,UACR,gBAAAS;AAAA,MAACM;AAAA,MAAA;AAAA,QACG,MAAM;AAAA,QACN,WAAWP,EAAO;AAAA,QAClB,gBAAc,GAAGP,CAAU;AAAA,MAAA;AAAA,IAAA,IAE/B;AAAA,IAEHH;AAAA,EACL,EAAA,CAAA;AAER;AACAD,EAAc,cAAc;AAQf,MAAAmB,IAAgB,CACzB,EAAE,MAAAC,GAAM,WAAAlB,GAAW,GAAGmB,KACtBC,MAGI,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,aAAW;AAAA,IACX,aAAWQ;AAAA,IACV,GAAGC;AAAA,IACJ,KAAKC;AAAA,IACL,WAAWZ,EAAGC,EAAO,MAAMT,CAAS;AAAA,EAAA;AAAA;AAKhDiB,EAAc,cAAc;AAE5B,MAAMI,IAA4BC,EAA6CxB,CAAa,GACtFyB,IAA4BD,EAA+CL,CAAa,GAEjFO,IAGTH;AACJG,EAAU,OAAOH;AACjBG,EAAU,OAAOD;"}
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx as e, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-tooltip";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { cn as f } from "./fondue-components25.js";
|
|
5
|
+
import n from "./fondue-components57.js";
|
|
6
|
+
const d = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ e(o.Provider, { children: /* @__PURE__ */ e(o.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
|
|
7
|
+
d.displayName = "Tooltip.Root";
|
|
8
|
+
const l = ({ children: t, "data-test-id": r = "fondue-tooltip-trigger" }, i) => /* @__PURE__ */ e(o.Trigger, { "data-test-id": r, asChild: !0, ref: i, children: t });
|
|
9
|
+
l.displayName = "Tooltip.Trigger";
|
|
10
|
+
const p = ({
|
|
11
|
+
children: t,
|
|
12
|
+
className: r,
|
|
13
|
+
maxWidth: i,
|
|
14
|
+
"data-test-id": a = "fondue-tooltip-content",
|
|
15
|
+
padding: m = "spacious",
|
|
16
|
+
...c
|
|
17
|
+
}, g) => /* @__PURE__ */ e(o.Portal, { children: /* @__PURE__ */ T(
|
|
18
|
+
o.Content,
|
|
19
|
+
{
|
|
20
|
+
"data-test-id": a,
|
|
21
|
+
"data-tooltip-spacing": m,
|
|
22
|
+
className: f(n.root, r),
|
|
23
|
+
style: { maxWidth: i },
|
|
24
|
+
collisionPadding: 16,
|
|
25
|
+
sideOffset: 8,
|
|
26
|
+
ref: g,
|
|
27
|
+
...c,
|
|
28
|
+
children: [
|
|
29
|
+
t,
|
|
30
|
+
/* @__PURE__ */ e(o.Arrow, { "aria-hidden": "true", className: n.arrow })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
) });
|
|
34
|
+
p.displayName = "Tooltip.Content";
|
|
35
|
+
const C = {
|
|
36
|
+
Root: d,
|
|
37
|
+
Trigger: s(l),
|
|
38
|
+
Content: s(p)
|
|
39
|
+
};
|
|
32
40
|
export {
|
|
33
|
-
|
|
41
|
+
C as Tooltip,
|
|
42
|
+
p as TooltipContent,
|
|
43
|
+
d as TooltipRoot,
|
|
44
|
+
l as TooltipTrigger
|
|
34
45
|
};
|
|
35
46
|
//# sourceMappingURL=fondue-components22.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components22.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components22.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 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};\nexport type TooltipTriggerProps = { children: ReactNode; 'data-test-id'?: string };\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 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 const TooltipTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger data-test-id={dataTestId} asChild ref={ref}>\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n ...props\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixTooltip.Portal>\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 {...props}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\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","dataTestId","ref","TooltipContent","className","maxWidth","padding","props","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;AAyCa,MAAAA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAEvD,gBAAAC,EAAAC,EAAa,UAAb,EACG,UAAC,gBAAAD,EAAAC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,EACJ,CAAA;AAGRD,EAAY,cAAc;AAEb,MAAAO,IAAiB,CAC1B,EAAE,UAAAN,GAAU,gBAAgBO,IAAa,4BACzCC,MAGI,gBAAAJ,EAACC,EAAa,SAAb,EAAqB,gBAAcE,GAAY,SAAO,IAAC,KAAAC,GACnD,UAAAR,EACL,CAAA;AAGRM,EAAe,cAAc;AAEtB,MAAMG,IAAiB,CAC1B;AAAA,EACI,UAAAT;AAAA,EACA,WAAAU;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,GAAGC;AACP,GACAL,MAGI,gBAAAJ,EAACC,EAAa,QAAb,EACG,UAAA,gBAAAS;AAAA,EAACT,EAAa;AAAA,EAAb;AAAA,IACG,gBAAcE;AAAA,IACd,wBAAsBK;AAAA,IACtB,WAAWG,EAAGC,EAAO,MAAMN,CAAS;AAAA,IACpC,OAAO,EAAE,UAAAC,EAAS;AAAA,IAClB,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,KAAAH;AAAA,IACC,GAAGK;AAAA,IAEH,UAAA;AAAA,MAAAb;AAAA,MACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWW,EAAO,OAAO;AAAA,IAAA;AAAA,EAAA;AAExE,EAAA,CAAA;AAGRP,EAAe,cAAc;AAEtB,MAAMQ,IAAU;AAAA,EACnB,MAAMlB;AAAA,EACN,SAASmB,EAAmDZ,CAAc;AAAA,EAC1E,SAASY,EAAgDT,CAAc;AAC3E;"}
|
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const g = (t) => t.startsWith("aria-") || t === "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 = (t, n) => (t === "columns" || t === "rows") && typeof n == "number" ? `repeat(${n}, 1fr)` : n, l = (t, n = {}) => Object.entries(t).reduce((i, [r, o]) => {
|
|
22
|
+
if (g(r))
|
|
23
|
+
return i;
|
|
24
|
+
const e = r in n ? n[r] : r in s ? s[r] : r, a = 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, p] of Object.entries(o))
|
|
27
|
+
p !== void 0 && (i[`--${d}-${a}`] = m(r, p));
|
|
28
|
+
else
|
|
29
|
+
i[`--${a}`] = m(r, o);
|
|
30
|
+
return i;
|
|
31
|
+
}, {});
|
|
4
32
|
export {
|
|
5
|
-
|
|
6
|
-
o as root
|
|
33
|
+
l as propsToCssVariables
|
|
7
34
|
};
|
|
8
35
|
//# sourceMappingURL=fondue-components23.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components23.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components23.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 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 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,OACvCH,MAAQ,aAAaA,MAAQ,WACzB,OAAOG,KAAU,WACV,UAAUA,CAAK,WAIvBA,GAGEC,IAAsB,CAC/BC,GACAC,IAAyD,OAElD,OAAO,QAAQD,CAAK,EAAE,OAAO,CAACE,GAAK,CAACP,GAAKG,CAAK,MAAM;AACnD,MAAAJ,EAAWC,CAAG;AACP,WAAAO;AAGL,QAAAC,IACFR,KAAOM,IACDA,EAA+BN,CAAG,IAClCA,KAAOC,IACLA,EAA0BD,CAAG,IAC7BA,GACNS,IAAuBD,KAAA,gBAAAA,EAAa,WAAW,+BAA+B,SAAS;AAEzF,MAAA,OAAOL,KAAU;AACjB,eAAW,CAACO,GAAYC,CAAe,KAAK,OAAO,QAAQR,CAAK;AAC5D,MAAIQ,MAAoB,WAEhBJ,EAAA,KAAKG,CAAU,IAAID,CAAoB,EAAE,IAAIP,EAAyBF,GAAKW,CAAe;AAAA;AAKtG,IAAAJ,EAAI,KAAKE,CAAoB,EAAE,IAAIP,EAAyBF,GAAKG,CAAK;AAGnE,SAAAI;AACX,GAAG,CAAmB,CAAA;"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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);
|
|
1
|
+
const o = "_root_yrjuz_5", t = {
|
|
2
|
+
root: o
|
|
3
|
+
};
|
|
11
4
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
t as default,
|
|
6
|
+
o as root
|
|
14
7
|
};
|
|
15
8
|
//# sourceMappingURL=fondue-components24.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components24.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components24.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,158 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
rounding: {
|
|
10
|
-
medium: "tw-rounded",
|
|
11
|
-
full: "tw-rounded-full"
|
|
12
|
-
},
|
|
13
|
-
size: {
|
|
14
|
-
small: "tw-h-6 tw-text-body-small",
|
|
15
|
-
medium: "tw-h-9 tw-text-body-medium",
|
|
16
|
-
large: "tw-h-12 tw-text-body-large"
|
|
17
|
-
},
|
|
18
|
-
aspect: {
|
|
19
|
-
square: "tw-aspect-square tw-px-0",
|
|
20
|
-
default: ""
|
|
21
|
-
},
|
|
22
|
-
hugWidth: {
|
|
23
|
-
false: "tw-w-full"
|
|
24
|
-
},
|
|
25
|
-
emphasis: {
|
|
26
|
-
default: "",
|
|
27
|
-
weak: "",
|
|
28
|
-
strong: ""
|
|
29
|
-
},
|
|
30
|
-
variant: {
|
|
31
|
-
default: "",
|
|
32
|
-
positive: "",
|
|
33
|
-
negative: "",
|
|
34
|
-
danger: "",
|
|
35
|
-
loud: ""
|
|
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"]
|
|
36
8
|
}
|
|
37
|
-
},
|
|
38
|
-
compoundVariants: [
|
|
39
|
-
{
|
|
40
|
-
disabled: !1,
|
|
41
|
-
variant: "default",
|
|
42
|
-
emphasis: "default",
|
|
43
|
-
class: "tw-bg-button-background tw-border-button-border hover:tw-bg-button-background-hover active:tw-bg-button-background-pressed"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
disabled: !1,
|
|
47
|
-
variant: "default",
|
|
48
|
-
emphasis: "weak",
|
|
49
|
-
class: "tw-border-transparent hover:tw-bg-button-background-hover hover:tw-border-button-border active:tw-bg-button-background-pressed"
|
|
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
9
|
}
|
|
154
|
-
});
|
|
10
|
+
}), m = (...t) => r(...t), x = (t) => o(t);
|
|
155
11
|
export {
|
|
156
|
-
|
|
12
|
+
m as cn,
|
|
13
|
+
x as sv
|
|
157
14
|
};
|
|
158
15
|
//# sourceMappingURL=fondue-components25.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components25.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"fondue-components25.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,IAC/F;AAAA,EACJ;AACJ,CAAC,GAEYC,IAAK,IAAIC,MACXH,EAAc,GAAGG,CAAU,GAGzBC,IAAS,CAACC,MACZC,EAAGD,CAAQ;"}
|