@frontify/fondue-components 18.0.0 → 18.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 +56 -54
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +28 -142
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +141 -34
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +36 -103
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +103 -36
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +30 -40
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +47 -28
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +28 -39
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +34 -16
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +21 -71
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +71 -36
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +34 -53
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +54 -137
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +136 -53
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +54 -28
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +28 -153
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +151 -118
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +120 -31
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +32 -65
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +65 -10
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +10 -55
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +55 -14
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +15 -32
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +7 -4
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +7 -12
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +32 -155
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +5 -118
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +10 -116
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +147 -13
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +116 -30
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +118 -62
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +56 -34
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +20 -129
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +32 -21
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +62 -45
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +129 -7
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +21 -13
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +45 -15
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +8 -60
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +13 -18
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +12 -16
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +60 -5
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +32 -38
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +18 -15
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +18 -4
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +3 -17
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +15 -35
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +4 -4
- package/dist/fondue-components55.js +17 -11
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +35 -5
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +4 -24
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +12 -16
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +4 -146
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +42 -45
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +25 -16
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +16 -76
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +147 -8
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +16 -33
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +75 -47
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +8 -11
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +32 -12
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +48 -12
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +10 -20
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +13 -15
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +46 -51
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +12 -52
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +20 -14
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +15 -26
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +55 -14
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +14 -6
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +23 -4
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +15 -2
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +5 -15
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +6 -39
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +5 -0
- package/dist/fondue-components79.js.map +1 -0
- package/dist/fondue-components8.js +46 -144
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +8 -0
- package/dist/fondue-components80.js.map +1 -0
- package/dist/fondue-components81.js +8 -0
- package/dist/fondue-components81.js.map +1 -0
- package/dist/fondue-components82.js +20 -0
- package/dist/fondue-components82.js.map +1 -0
- package/dist/fondue-components83.js +43 -0
- package/dist/fondue-components83.js.map +1 -0
- package/dist/fondue-components9.js +146 -27
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +70 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,125 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as l } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
1
|
+
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as y, forwardRef as l, useContext as f, useRef as x, useEffect as D, useCallback as O, createElement as w } from "react";
|
|
3
|
+
import { IconDotsHorizontal as V } from "@frontify/fondue-icons";
|
|
4
|
+
import * as c from "@radix-ui/react-tabs";
|
|
5
|
+
import { useControllableState as q } from "./fondue-components60.js";
|
|
6
|
+
import { Button as B } from "./fondue-components6.js";
|
|
7
|
+
import { Dropdown as d } from "./fondue-components11.js";
|
|
8
|
+
import { useTabTriggers as H } from "./fondue-components73.js";
|
|
9
|
+
import r from "./fondue-components74.js";
|
|
10
|
+
const T = y({
|
|
11
|
+
value: "",
|
|
12
|
+
disabled: !1
|
|
13
|
+
}), z = y({
|
|
14
|
+
addTrigger: () => {
|
|
15
|
+
}
|
|
16
|
+
}), E = ({
|
|
17
|
+
padding: a = "compact",
|
|
18
|
+
activeTab: o,
|
|
19
|
+
defaultActiveTab: s,
|
|
20
|
+
size: n = "medium",
|
|
21
|
+
onActiveTabChange: m,
|
|
22
|
+
children: u,
|
|
23
|
+
variant: p = "default",
|
|
24
|
+
...i
|
|
25
|
+
}, P) => {
|
|
26
|
+
var N;
|
|
27
|
+
const [v, g] = q({
|
|
28
|
+
prop: o,
|
|
29
|
+
defaultProp: s,
|
|
30
|
+
onChange: m
|
|
31
|
+
}), C = O(
|
|
32
|
+
(e) => {
|
|
33
|
+
g(e);
|
|
34
|
+
},
|
|
35
|
+
[g]
|
|
36
|
+
), { triggerListRef: S, activeIndicatorRef: j, triggers: h, triggersOutOfView: R, addTrigger: A } = H({
|
|
37
|
+
activeTab: v
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ t(z.Provider, { value: { addTrigger: A }, children: /* @__PURE__ */ b(
|
|
40
|
+
c.Root,
|
|
17
41
|
{
|
|
18
|
-
|
|
19
|
-
className:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
ref: P,
|
|
43
|
+
className: r.root,
|
|
44
|
+
onValueChange: C,
|
|
45
|
+
value: v ?? ((N = h[0]) == null ? void 0 : N.value),
|
|
46
|
+
"data-tabs-content-padding": a,
|
|
47
|
+
"data-tabs-variant": p,
|
|
48
|
+
...i,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ b("div", { className: r.triggerListWrapper, children: [
|
|
51
|
+
/* @__PURE__ */ t(c.List, { ref: S, "data-size": n, className: r.triggerList, children: h.map((e) => /* @__PURE__ */ w(
|
|
52
|
+
c.Trigger,
|
|
53
|
+
{
|
|
54
|
+
...e.props,
|
|
55
|
+
key: e.value,
|
|
56
|
+
value: e.value,
|
|
57
|
+
disabled: e.disabled,
|
|
58
|
+
className: r.trigger,
|
|
59
|
+
ref: e.ref
|
|
60
|
+
},
|
|
61
|
+
e.element
|
|
62
|
+
)) }),
|
|
63
|
+
/* @__PURE__ */ b(d.Root, { children: [
|
|
64
|
+
R.length > 0 && /* @__PURE__ */ t(d.Trigger, { "data-test-id": "overflow-items-dropdown-trigger", children: /* @__PURE__ */ t(B, { emphasis: "default", aspect: "square", size: "small", children: /* @__PURE__ */ t(V, { size: 16 }) }) }),
|
|
65
|
+
/* @__PURE__ */ t(d.Content, { align: "end", "data-test-id": "overflow-items-dropdown-content", children: R.map((e) => /* @__PURE__ */ w(
|
|
66
|
+
d.Item,
|
|
67
|
+
{
|
|
68
|
+
...e.props,
|
|
69
|
+
disabled: e.disabled,
|
|
70
|
+
onSelect: () => C(e.value),
|
|
71
|
+
key: e.value
|
|
72
|
+
},
|
|
73
|
+
e.element
|
|
74
|
+
)) })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
"data-test-id": "active-tab-indicator",
|
|
80
|
+
ref: j,
|
|
81
|
+
className: r.activeIndicator
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }),
|
|
85
|
+
u
|
|
86
|
+
]
|
|
29
87
|
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
88
|
+
) });
|
|
89
|
+
};
|
|
90
|
+
E.displayName = "Tabs.Root";
|
|
91
|
+
const I = ({ children: a, value: o, disabled: s }) => /* @__PURE__ */ t(T.Provider, { value: { value: o, disabled: s }, children: a });
|
|
92
|
+
I.displayName = "Tabs.Tab";
|
|
93
|
+
const L = ({ children: a, ...o }, s) => {
|
|
94
|
+
const { value: n, disabled: m } = f(T), { addTrigger: u } = f(z), p = x(null), i = x();
|
|
95
|
+
return D(() => {
|
|
96
|
+
u({
|
|
97
|
+
ref: p || s,
|
|
98
|
+
value: n ?? "",
|
|
99
|
+
disabled: m,
|
|
100
|
+
props: o,
|
|
101
|
+
element: a,
|
|
102
|
+
previousElement: i.current
|
|
103
|
+
}), i.current = a;
|
|
104
|
+
}, [a]), null;
|
|
105
|
+
};
|
|
106
|
+
L.displayName = "Tabs.Trigger";
|
|
107
|
+
const k = ({ children: a, ...o }, s) => {
|
|
108
|
+
const { value: n } = f(T);
|
|
109
|
+
return /* @__PURE__ */ t(c.Content, { ref: s, ...o, className: r.content, value: n ?? "", children: a });
|
|
110
|
+
};
|
|
111
|
+
k.displayName = "Tabs.Content";
|
|
112
|
+
const X = {
|
|
113
|
+
Root: l(E),
|
|
114
|
+
Tab: l(I),
|
|
115
|
+
Trigger: l(L),
|
|
116
|
+
Content: l(k)
|
|
117
|
+
};
|
|
33
118
|
export {
|
|
34
|
-
|
|
119
|
+
X as Tabs,
|
|
120
|
+
k as TabsContent,
|
|
121
|
+
E as TabsRoot,
|
|
122
|
+
I as TabsTab,
|
|
123
|
+
L as TabsTrigger
|
|
35
124
|
};
|
|
36
125
|
//# sourceMappingURL=fondue-components26.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components26.js","sources":["../src/components/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode, forwardRef, type ForwardedRef, type HTMLAttributeAnchorTarget } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/text.module.scss';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\ntype BoxColor = 'neutral' | 'selected' | 'disabled' | 'positive' | 'negative' | 'warning';\n\ntype TagType = 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';\n\nexport type TextProps<TTag extends TagType = 'span'> = CommonAriaProps &\n TagProps<TTag> & {\n /**\n * Id of the element\n */\n id?: string;\n /**\n * Size of the text\n *\n * @default 'medium'\n */\n size?: TextSize;\n /**\n * Weight of the font\n *\n * @default 'default'\n */\n weight?: TextWeight;\n /**\n * The html element used to render\n *\n * @default 'span'\n */\n as?: TTag;\n /**\n * Color of the text\n *\n * @default 'default'\n */\n color?: TextColor;\n /**\n * The texts color when used within a box\n *\n * @description optional color prop that uses the inverse box color when accessibility contrast is needed\n **/\n boxColor?: BoxColor;\n className?: string;\n children?: ReactNode;\n };\n\ntype TagPropMap = {\n a: { href?: string; target: HTMLAttributeAnchorTarget; rel?: string; title?: string };\n abbr: { title?: string };\n address: object;\n em: object;\n label: { for?: string };\n li: { value?: string };\n p: object;\n span: object;\n strong: object;\n time: { dateTime?: string };\n};\ntype TagProps<TTag extends TagType> = TagPropMap[TTag];\n\ntype TextElementMap = {\n a: HTMLAnchorElement;\n abbr: HTMLElement;\n address: HTMLElement;\n em: HTMLElement;\n label: HTMLLabelElement;\n li: HTMLLIElement;\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n strong: HTMLElement;\n time: HTMLTimeElement;\n};\ntype TextElementType<TTag extends TagType> = TextElementMap[TTag];\n\nexport const Text = forwardRef(\n (\n {\n children,\n as: Tag = 'span',\n size = 'medium',\n weight = 'default',\n color = 'default',\n boxColor,\n className,\n ...props\n },\n ref,\n ) => (\n <Tag\n data-test-id=\"text\"\n className={cn([\n styles.root,\n styles[`size-${size}`],\n styles[`weight-${weight}`],\n styles[boxColor ? `color-box-${boxColor}` : `color-${color}`],\n className,\n ])}\n // @ts-expect-error ref can not be inferred properly by TS\n ref={ref}\n {...props}\n >\n {children}\n </Tag>\n ),\n) as (<TTag extends TagType = 'span'>(\n props: TextProps<TTag> & { ref?: ForwardedRef<TextElementType<TTag>> },\n) => JSX.Element) & { displayName: string };\n\nText.displayName = 'FondueText';\n"],"names":["Text","forwardRef","children","Tag","size","weight","color","boxColor","className","props","ref","jsx","cn","styles"],"mappings":";;;;AAoFO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,UAAAC;AAAA,IACA,IAAIC,IAAM;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,KAEPC,MAEA,gBAAAC;AAAA,IAACR;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,WAAWS,EAAG;AAAA,QACVC,EAAO;AAAA,QACPA,EAAO,QAAQT,CAAI,EAAE;AAAA,QACrBS,EAAO,UAAUR,CAAM,EAAE;AAAA,QACzBQ,EAAON,IAAW,aAAaA,CAAQ,KAAK,SAASD,CAAK,EAAE;AAAA,QAC5DE;AAAA,MAAA,CACH;AAAA,MAED,KAAAE;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGb;AAIAF,EAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components26.js","sources":["../src/components/Tabs/Tabs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconDotsHorizontal } from '@frontify/fondue-icons';\nimport * as RadixTabs from '@radix-ui/react-tabs';\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport { Button } from '../Button/Button';\nimport { Dropdown } from '../Dropdown/Dropdown';\n\nimport { useTabTriggers } from './hooks/useTabTriggers';\nimport styles from './styles/tabs.module.scss';\nimport { type TabTrigger } from './types';\n\nexport type TabsRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The default active tab\n * Used for uncontrolled components\n */\n defaultActiveTab?: string;\n /**\n * The controlled value of the active tab\n */\n activeTab?: string;\n /**\n * The height of the tabs\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /**\n * Event handler called when the active tab changes\n */\n onActiveTabChange?: (value: string) => void;\n /**\n * Select the used variant\n * “default 'default'\n */\n variant?: 'default' | 'pill';\n};\n\nconst TabConfigContext = createContext<{\n value: string;\n disabled?: boolean;\n}>({\n value: '',\n disabled: false,\n});\n\nconst TabTriggerContext = createContext<{\n addTrigger: (trigger: TabTrigger) => void;\n}>({\n addTrigger: () => {},\n});\n\nexport const TabsRoot = (\n {\n padding = 'compact',\n activeTab: propsActiveTab,\n defaultActiveTab,\n size = 'medium',\n onActiveTabChange,\n children,\n variant = 'default',\n ...props\n }: TabsRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [activeTab, setActiveTab] = useControllableState({\n prop: propsActiveTab,\n defaultProp: defaultActiveTab,\n onChange: onActiveTabChange,\n });\n\n const handleSetActiveTab = useCallback(\n (value: string) => {\n setActiveTab(value);\n },\n [setActiveTab],\n );\n\n const { triggerListRef, activeIndicatorRef, triggers, triggersOutOfView, addTrigger } = useTabTriggers({\n activeTab,\n });\n\n return (\n <TabTriggerContext.Provider value={{ addTrigger }}>\n <RadixTabs.Root\n ref={ref}\n className={styles.root}\n onValueChange={handleSetActiveTab}\n value={activeTab ?? triggers[0]?.value}\n data-tabs-content-padding={padding}\n data-tabs-variant={variant}\n {...props}\n >\n <div className={styles.triggerListWrapper}>\n <RadixTabs.List ref={triggerListRef} data-size={size} className={styles.triggerList}>\n {triggers.map((trigger) => (\n <RadixTabs.Trigger\n {...trigger.props}\n key={trigger.value}\n value={trigger.value}\n disabled={trigger.disabled}\n className={styles.trigger}\n ref={trigger.ref}\n >\n {trigger.element}\n </RadixTabs.Trigger>\n ))}\n </RadixTabs.List>\n <Dropdown.Root>\n {triggersOutOfView.length > 0 && (\n <Dropdown.Trigger data-test-id=\"overflow-items-dropdown-trigger\">\n <Button emphasis=\"default\" aspect=\"square\" size=\"small\">\n <IconDotsHorizontal size={16} />\n </Button>\n </Dropdown.Trigger>\n )}\n <Dropdown.Content align=\"end\" data-test-id=\"overflow-items-dropdown-content\">\n {triggersOutOfView.map((trigger) => (\n <Dropdown.Item\n {...trigger.props}\n disabled={trigger.disabled}\n onSelect={() => handleSetActiveTab(trigger.value)}\n key={trigger.value}\n >\n {trigger.element}\n </Dropdown.Item>\n ))}\n </Dropdown.Content>\n </Dropdown.Root>\n <span\n data-test-id=\"active-tab-indicator\"\n ref={activeIndicatorRef}\n className={styles.activeIndicator}\n />\n </div>\n {children}\n </RadixTabs.Root>\n </TabTriggerContext.Provider>\n );\n};\nTabsRoot.displayName = 'Tabs.Root';\n\ntype TabsTabProps = {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n};\n\nexport const TabsTab = ({ children, value, disabled }: TabsTabProps) => (\n <TabConfigContext.Provider value={{ value, disabled }}>{children}</TabConfigContext.Provider>\n);\nTabsTab.displayName = 'Tabs.Tab';\n\ntype TabsTriggerProps = {\n children: ReactNode;\n};\n\nexport const TabsTrigger = ({ children, ...props }: TabsTriggerProps, ref: ForwardedRef<HTMLButtonElement>) => {\n const { value, disabled } = useContext(TabConfigContext);\n\n const { addTrigger } = useContext(TabTriggerContext);\n\n const localRef = useRef<HTMLButtonElement>(null);\n const previousElement = useRef<ReactNode>();\n\n useEffect(() => {\n addTrigger({\n ref: localRef || ref,\n value: value ?? '',\n disabled,\n props,\n element: children,\n previousElement: previousElement.current,\n });\n previousElement.current = children;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [children]);\n\n return null;\n};\nTabsTrigger.displayName = 'Tabs.Trigger';\n\ntype TabsContentProps = {\n children: ReactNode;\n};\n\nexport const TabsContent = ({ children, ...itemProps }: TabsContentProps, ref: ForwardedRef<HTMLDivElement>) => {\n const { value } = useContext(TabConfigContext);\n\n return (\n <RadixTabs.Content ref={ref} {...itemProps} className={styles.content} value={value ?? ''}>\n {children}\n </RadixTabs.Content>\n );\n};\nTabsContent.displayName = 'Tabs.Content';\n\nexport const Tabs = {\n Root: forwardRef<HTMLDivElement, TabsRootProps>(TabsRoot),\n Tab: forwardRef<HTMLDivElement, TabsTabProps>(TabsTab),\n Trigger: forwardRef<HTMLButtonElement, TabsTriggerProps>(TabsTrigger),\n Content: forwardRef<HTMLDivElement, TabsContentProps>(TabsContent),\n};\n"],"names":["TabConfigContext","createContext","TabTriggerContext","TabsRoot","padding","propsActiveTab","defaultActiveTab","size","onActiveTabChange","children","variant","props","ref","activeTab","setActiveTab","useControllableState","handleSetActiveTab","useCallback","value","triggerListRef","activeIndicatorRef","triggers","triggersOutOfView","addTrigger","useTabTriggers","jsxs","RadixTabs","styles","_a","jsx","trigger","createElement","Dropdown","Button","IconDotsHorizontal","TabsTab","disabled","TabsTrigger","useContext","localRef","useRef","previousElement","useEffect","TabsContent","itemProps","Tabs","forwardRef"],"mappings":"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"}
|
|
@@ -1,69 +1,36 @@
|
|
|
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
|
-
ref: R,
|
|
33
|
-
className: r.input,
|
|
34
|
-
"aria-invalid": e === "error"
|
|
35
|
-
}
|
|
36
|
-
),
|
|
37
|
-
e === "success" ? /* @__PURE__ */ s(w, { size: 16, className: r.iconSuccess, "data-test-id": `${a}-success-icon` }) : null,
|
|
38
|
-
e === "error" ? /* @__PURE__ */ s(
|
|
39
|
-
N,
|
|
40
|
-
{
|
|
41
|
-
size: 16,
|
|
42
|
-
className: r.iconError,
|
|
43
|
-
"data-test-id": `${a}-error-icon`
|
|
44
|
-
}
|
|
45
|
-
) : null,
|
|
46
|
-
c
|
|
47
|
-
] });
|
|
48
|
-
};
|
|
49
|
-
f.displayName = "TextField.Root";
|
|
50
|
-
const u = ({ name: c, className: d, ...e }, a) => /* @__PURE__ */ s(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
"data-slot": !0,
|
|
54
|
-
"data-name": c,
|
|
55
|
-
...e,
|
|
56
|
-
ref: a,
|
|
57
|
-
className: m(r.slot, d)
|
|
58
|
-
}
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { cn as c } from "./fondue-components36.js";
|
|
4
|
+
import t from "./fondue-components75.js";
|
|
5
|
+
const x = l(
|
|
6
|
+
({
|
|
7
|
+
children: e,
|
|
8
|
+
as: r = "span",
|
|
9
|
+
size: m = "medium",
|
|
10
|
+
weight: a = "default",
|
|
11
|
+
color: s = "default",
|
|
12
|
+
boxColor: o,
|
|
13
|
+
className: i,
|
|
14
|
+
...d
|
|
15
|
+
}, f) => /* @__PURE__ */ p(
|
|
16
|
+
r,
|
|
17
|
+
{
|
|
18
|
+
"data-test-id": "text",
|
|
19
|
+
className: c([
|
|
20
|
+
t.root,
|
|
21
|
+
t[`size-${m}`],
|
|
22
|
+
t[`weight-${a}`],
|
|
23
|
+
t[o ? `color-box-${o}` : `color-${s}`],
|
|
24
|
+
i
|
|
25
|
+
]),
|
|
26
|
+
ref: f,
|
|
27
|
+
...d,
|
|
28
|
+
children: e
|
|
29
|
+
}
|
|
30
|
+
)
|
|
59
31
|
);
|
|
60
|
-
|
|
61
|
-
const x = n(f), T = n(u), F = x;
|
|
62
|
-
F.Root = x;
|
|
63
|
-
F.Slot = T;
|
|
32
|
+
x.displayName = "FondueText";
|
|
64
33
|
export {
|
|
65
|
-
|
|
66
|
-
u as TextFieldSlot,
|
|
67
|
-
F as TextInput
|
|
34
|
+
x as Text
|
|
68
35
|
};
|
|
69
36
|
//# sourceMappingURL=fondue-components27.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components27.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components27.js","sources":["../src/components/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactNode, forwardRef, type ForwardedRef, type HTMLAttributeAnchorTarget } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { cn } from '#/utilities/styleUtilities';\n\nimport styles from './styles/text.module.scss';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\ntype BoxColor = 'neutral' | 'selected' | 'disabled' | 'positive' | 'negative' | 'warning';\n\ntype TagType = 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';\n\nexport type TextProps<TTag extends TagType = 'span'> = CommonAriaProps &\n TagProps<TTag> & {\n /**\n * Id of the element\n */\n id?: string;\n /**\n * Size of the text\n *\n * @default 'medium'\n */\n size?: TextSize;\n /**\n * Weight of the font\n *\n * @default 'default'\n */\n weight?: TextWeight;\n /**\n * The html element used to render\n *\n * @default 'span'\n */\n as?: TTag;\n /**\n * Color of the text\n *\n * @default 'default'\n */\n color?: TextColor;\n /**\n * The texts color when used within a box\n *\n * @description optional color prop that uses the inverse box color when accessibility contrast is needed\n **/\n boxColor?: BoxColor;\n className?: string;\n children?: ReactNode;\n };\n\ntype TagPropMap = {\n a: { href?: string; target: HTMLAttributeAnchorTarget; rel?: string; title?: string };\n abbr: { title?: string };\n address: object;\n em: object;\n label: { for?: string };\n li: { value?: string };\n p: object;\n span: object;\n strong: object;\n time: { dateTime?: string };\n};\ntype TagProps<TTag extends TagType> = TagPropMap[TTag];\n\ntype TextElementMap = {\n a: HTMLAnchorElement;\n abbr: HTMLElement;\n address: HTMLElement;\n em: HTMLElement;\n label: HTMLLabelElement;\n li: HTMLLIElement;\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n strong: HTMLElement;\n time: HTMLTimeElement;\n};\ntype TextElementType<TTag extends TagType> = TextElementMap[TTag];\n\nexport const Text = forwardRef(\n (\n {\n children,\n as: Tag = 'span',\n size = 'medium',\n weight = 'default',\n color = 'default',\n boxColor,\n className,\n ...props\n },\n ref,\n ) => (\n <Tag\n data-test-id=\"text\"\n className={cn([\n styles.root,\n styles[`size-${size}`],\n styles[`weight-${weight}`],\n styles[boxColor ? `color-box-${boxColor}` : `color-${color}`],\n className,\n ])}\n // @ts-expect-error ref can not be inferred properly by TS\n ref={ref}\n {...props}\n >\n {children}\n </Tag>\n ),\n) as (<TTag extends TagType = 'span'>(\n props: TextProps<TTag> & { ref?: ForwardedRef<TextElementType<TTag>> },\n) => JSX.Element) & { displayName: string };\n\nText.displayName = 'FondueText';\n"],"names":["Text","forwardRef","children","Tag","size","weight","color","boxColor","className","props","ref","jsx","cn","styles"],"mappings":";;;;AAoFO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,UAAAC;AAAA,IACA,IAAIC,IAAM;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,KAEPC,MAEA,gBAAAC;AAAA,IAACR;AAAA,IAAA;AAAA,MACG,gBAAa;AAAA,MACb,WAAWS,EAAG;AAAA,QACVC,EAAO;AAAA,QACPA,EAAO,QAAQT,CAAI,EAAE;AAAA,QACrBS,EAAO,UAAUR,CAAM,EAAE;AAAA,QACzBQ,EAAON,IAAW,aAAaA,CAAQ,KAAK,SAASD,CAAK,EAAE;AAAA,QAC5DE;AAAA,MAAA,CACH;AAAA,MAED,KAAAE;AAAA,MACC,GAAGD;AAAA,MAEH,UAAAP;AAAA,IAAA;AAAA,EAAA;AAGb;AAIAF,EAAK,cAAc;"}
|
|
@@ -1,14 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-components36.js";
|
|
5
|
+
import r from "./fondue-components76.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
|
+
] });
|
|
8
48
|
};
|
|
49
|
+
f.displayName = "TextField.Root";
|
|
50
|
+
const u = ({ name: c, className: d, ...e }, a) => /* @__PURE__ */ s(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": !0,
|
|
54
|
+
"data-name": c,
|
|
55
|
+
...e,
|
|
56
|
+
ref: a,
|
|
57
|
+
className: m(r.slot, d)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
u.displayName = "TextField.Slot";
|
|
61
|
+
const x = n(f), T = n(u), F = x;
|
|
62
|
+
F.Root = x;
|
|
63
|
+
F.Slot = T;
|
|
9
64
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
65
|
+
f as TextFieldRoot,
|
|
66
|
+
u as TextFieldSlot,
|
|
67
|
+
F as TextInput
|
|
13
68
|
};
|
|
14
69
|
//# sourceMappingURL=fondue-components28.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components28.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components28.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 type FocusEvent,\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: FocusEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text input is focused\n */\n onFocus?: (event: FocusEvent<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":";;;;;AA4GO,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,EAAA,GACL;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;AACxC;AAIRiB,EAAc,cAAc;AAE5B,MAAMI,IAA4BC,EAA6CxB,CAAa,GACtFyB,IAA4BD,EAA+CL,CAAa,GAEjFO,IAGTH;AACJG,EAAU,OAAOH;AACjBG,EAAU,OAAOD;"}
|
|
@@ -1,59 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
l.displayName = "Tooltip.Root";
|
|
9
|
-
const p = ({ asChild: o = !1, children: r, "data-test-id": i = "fondue-tooltip-trigger" }, a) => /* @__PURE__ */ t(
|
|
10
|
-
e.Trigger,
|
|
11
|
-
{
|
|
12
|
-
"data-test-id": i,
|
|
13
|
-
type: o ? void 0 : "button",
|
|
14
|
-
asChild: o,
|
|
15
|
-
ref: a,
|
|
16
|
-
children: r
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
p.displayName = "Tooltip.Trigger";
|
|
20
|
-
const m = ({
|
|
21
|
-
children: o,
|
|
22
|
-
className: r,
|
|
23
|
-
maxWidth: i,
|
|
24
|
-
"data-test-id": a = "fondue-tooltip-content",
|
|
25
|
-
padding: n = "spacious",
|
|
26
|
-
...c
|
|
27
|
-
}, T) => {
|
|
28
|
-
const f = h();
|
|
29
|
-
return /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ t(y, { theme: f, children: /* @__PURE__ */ g(
|
|
30
|
-
e.Content,
|
|
31
|
-
{
|
|
32
|
-
"data-test-id": a,
|
|
33
|
-
"data-tooltip-spacing": n,
|
|
34
|
-
className: u(d.root, r),
|
|
35
|
-
style: { maxWidth: i },
|
|
36
|
-
collisionPadding: 16,
|
|
37
|
-
sideOffset: 8,
|
|
38
|
-
ref: T,
|
|
39
|
-
...c,
|
|
40
|
-
children: [
|
|
41
|
-
o,
|
|
42
|
-
/* @__PURE__ */ t(e.Arrow, { "aria-hidden": "true", className: d.arrow })
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
) }) });
|
|
46
|
-
};
|
|
47
|
-
m.displayName = "Tooltip.Content";
|
|
48
|
-
const w = {
|
|
49
|
-
Root: l,
|
|
50
|
-
Trigger: s(p),
|
|
51
|
-
Content: s(m)
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import n from "./fondue-components77.js";
|
|
3
|
+
import { Slot as i } from "@radix-ui/react-slot";
|
|
4
|
+
import { createContext as l, useContext as c } from "react";
|
|
5
|
+
const t = l("light"), f = () => c(t), h = ({ children: r, theme: e = "light", asChild: m = !1 }) => {
|
|
6
|
+
const s = m ? i : "div";
|
|
7
|
+
return /* @__PURE__ */ o(t.Provider, { value: e, children: /* @__PURE__ */ o(s, { className: n[e], children: r }) });
|
|
52
8
|
};
|
|
53
9
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
p as TooltipTrigger
|
|
10
|
+
t as ThemeContext,
|
|
11
|
+
h as ThemeProvider,
|
|
12
|
+
f as useFondueTheme
|
|
58
13
|
};
|
|
59
14
|
//# sourceMappingURL=fondue-components29.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components29.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components29.js","sources":["../src/components/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport styles from '@frontify/fondue-tokens/theme-tokens';\nimport { Slot } from '@radix-ui/react-slot';\nimport { createContext, useContext, type ReactNode } from 'react';\n\ntype AvailableTheme = keyof typeof styles;\n\ntype ThemeProviderProps = {\n children: ReactNode;\n /**\n * The theme to apply\n * @default \"light\"\n * */\n theme: AvailableTheme;\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};\n\nexport const ThemeContext = createContext<AvailableTheme>('light');\n\nexport const useFondueTheme = () => {\n return useContext(ThemeContext);\n};\n\nexport const ThemeProvider = ({ children, theme = 'light', asChild = false }: ThemeProviderProps) => {\n const Comp = asChild ? Slot : 'div';\n return (\n <ThemeContext.Provider value={theme}>\n <Comp className={styles[theme]}>{children}</Comp>\n </ThemeContext.Provider>\n );\n};\n"],"names":["ThemeContext","createContext","useFondueTheme","useContext","ThemeProvider","children","theme","asChild","Comp","Slot","jsx","styles"],"mappings":";;;;AAsBa,MAAAA,IAAeC,EAA8B,OAAO,GAEpDC,IAAiB,MACnBC,EAAWH,CAAY,GAGrBI,IAAgB,CAAC,EAAE,UAAAC,GAAU,OAAAC,IAAQ,SAAS,SAAAC,IAAU,SAAgC;AAC3F,QAAAC,IAAOD,IAAUE,IAAO;AAC9B,SACK,gBAAAC,EAAAV,EAAa,UAAb,EAAsB,OAAOM,GAC1B,UAAC,gBAAAI,EAAAF,GAAA,EAAK,WAAWG,EAAOL,CAAK,GAAI,UAAAD,EAAS,CAAA,GAC9C;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { IconCaretDown as A } from "@frontify/fondue-icons";
|
|
3
3
|
import * as n from "@radix-ui/react-accordion";
|
|
4
|
-
import d from "./fondue-
|
|
4
|
+
import d from "./fondue-components31.js";
|
|
5
5
|
const c = ({
|
|
6
6
|
"data-test-id": t = "fondue-accordion",
|
|
7
7
|
border: o = !0,
|