@frontify/fondue-components 23.0.0 → 24.0.0-rc.1
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 +50 -46
- 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 +104 -86
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +2 -2
- package/dist/fondue-components13.js +58 -57
- 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 +56 -36
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +34 -16
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +18 -73
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +18 -36
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +71 -50
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +36 -138
- 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 +138 -33
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +52 -193
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +30 -134
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +191 -126
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +134 -30
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +130 -63
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +31 -101
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +64 -30
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +98 -52
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +30 -20
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +56 -23
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +20 -7
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +23 -6
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +8 -32
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +5 -3
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +32 -12
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +3 -3
- package/dist/fondue-components40.js +5 -155
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +18 -116
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +59 -22
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +111 -14
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +116 -30
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +21 -54
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +31 -130
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +53 -20
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +131 -53
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +20 -7
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +53 -13
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +7 -14
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +13 -5
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +15 -60
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +5 -18
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +60 -19
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +18 -5
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +18 -14
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +1 -1
- package/dist/fondue-components59.js +10 -16
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +4 -4
- package/dist/fondue-components60.js +4 -10
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +18 -35
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +10 -4
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +34 -10
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +35 -5
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +4 -24
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +12 -16
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +4 -151
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +25 -19
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +16 -77
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +2 -2
- package/dist/fondue-components70.js +152 -8
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +19 -37
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +76 -69
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +8 -11
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +36 -12
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +70 -12
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +10 -22
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +13 -34
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +12 -10
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +22 -67
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +34 -15
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +9 -24
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +67 -18
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +14 -22
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +24 -6
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +18 -19
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +21 -5
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +8 -4
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +19 -4
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +4 -14
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +5 -5
- package/dist/fondue-components90.js +5 -2
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +4 -39
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +39 -20
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +24 -0
- package/dist/fondue-components93.js.map +1 -0
- package/dist/fondue-components94.js +5 -0
- package/dist/fondue-components94.js.map +1 -0
- package/dist/fondue-components95.js +20 -0
- package/dist/fondue-components95.js.map +1 -0
- package/dist/index.d.ts +116 -3
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,36 +1,140 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as g, jsx as t, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { IconPlus as z, IconCross as B } from "@frontify/fondue-icons";
|
|
3
|
+
import { useState as $, Children as T, isValidElement as x } from "react";
|
|
4
|
+
import s from "./fondue-components81.js";
|
|
5
|
+
const H = ({
|
|
6
|
+
"aria-label": e,
|
|
7
|
+
"data-test-id": n = "tag",
|
|
8
|
+
children: o,
|
|
9
|
+
disabled: a = !1,
|
|
10
|
+
emphasis: c = "strong",
|
|
11
|
+
onAddClick: m,
|
|
12
|
+
onClick: u,
|
|
13
|
+
onDismiss: i,
|
|
14
|
+
size: p = "default",
|
|
15
|
+
title: l,
|
|
16
|
+
variant: C
|
|
17
|
+
}) => {
|
|
18
|
+
const [v, d] = $(!1);
|
|
19
|
+
let r = null;
|
|
20
|
+
const f = T.map(o, (y) => x(y) && y.type === b ? (r = y.props.children, null) : y), S = {
|
|
21
|
+
"data-addable": !!m,
|
|
22
|
+
"data-component": "tag",
|
|
23
|
+
"data-disabled": a,
|
|
24
|
+
"data-dismissable": !!i,
|
|
25
|
+
"data-emphasis": c,
|
|
26
|
+
"data-size": p,
|
|
27
|
+
"data-variant": C,
|
|
28
|
+
className: s.root
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ g("div", { ...S, children: [
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
|
+
j,
|
|
33
|
+
{
|
|
34
|
+
"aria-label": e || l,
|
|
35
|
+
disabled: a,
|
|
36
|
+
hoverContent: r,
|
|
37
|
+
isHover: v,
|
|
38
|
+
onClick: u,
|
|
39
|
+
onMouseEnter: () => d(!0),
|
|
40
|
+
onMouseLeave: () => d(!1),
|
|
41
|
+
title: l,
|
|
42
|
+
"data-test-id": n,
|
|
43
|
+
children: f
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ t(
|
|
47
|
+
P,
|
|
48
|
+
{
|
|
49
|
+
"aria-label": e || l,
|
|
50
|
+
disabled: a,
|
|
51
|
+
onAddClick: m,
|
|
52
|
+
onDismiss: i
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
57
|
+
H.displayName = "Tag";
|
|
58
|
+
const j = ({
|
|
59
|
+
"aria-label": e,
|
|
60
|
+
"data-test-id": n,
|
|
61
|
+
children: o,
|
|
62
|
+
disabled: a = !1,
|
|
63
|
+
hoverContent: c,
|
|
64
|
+
isHover: m = !1,
|
|
65
|
+
onClick: u,
|
|
66
|
+
onMouseEnter: i,
|
|
67
|
+
onMouseLeave: p,
|
|
68
|
+
title: l
|
|
69
|
+
}) => {
|
|
70
|
+
let C = 0;
|
|
71
|
+
const v = T.map(o, (r) => {
|
|
72
|
+
if (x(r) && r.type === N) {
|
|
73
|
+
const f = C++;
|
|
74
|
+
return /* @__PURE__ */ t("div", { className: s.secondaryContent, children: r.props.children }, `secondary-${f}`);
|
|
75
|
+
}
|
|
76
|
+
return r;
|
|
77
|
+
}), d = c ? /* @__PURE__ */ g("div", { "data-hover": m, children: [
|
|
78
|
+
/* @__PURE__ */ t("div", { children: c }),
|
|
79
|
+
/* @__PURE__ */ t("div", { children: v })
|
|
80
|
+
] }) : v;
|
|
81
|
+
return u ? /* @__PURE__ */ t(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
"aria-label": e,
|
|
86
|
+
title: l,
|
|
87
|
+
className: s.mainContent,
|
|
88
|
+
onClick: a ? void 0 : u,
|
|
89
|
+
onMouseEnter: i,
|
|
90
|
+
onMouseLeave: p,
|
|
91
|
+
disabled: a,
|
|
92
|
+
"data-test-id": n,
|
|
93
|
+
children: d
|
|
94
|
+
}
|
|
95
|
+
) : /* @__PURE__ */ t(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
className: s.mainContent,
|
|
99
|
+
onMouseEnter: i,
|
|
100
|
+
onMouseLeave: p,
|
|
101
|
+
"data-test-id": n,
|
|
102
|
+
children: d
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}, P = ({ "aria-label": e, disabled: n, onAddClick: o, onDismiss: a }) => /* @__PURE__ */ g(h, { children: [
|
|
106
|
+
o && /* @__PURE__ */ t(
|
|
107
|
+
"button",
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
"aria-label": `Add ${e || ""}`,
|
|
111
|
+
className: s.actionButton,
|
|
112
|
+
disabled: n,
|
|
113
|
+
onClick: o,
|
|
114
|
+
children: /* @__PURE__ */ t(z, { size: "16" })
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
a && /* @__PURE__ */ t(
|
|
118
|
+
"button",
|
|
17
119
|
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
i
|
|
25
|
-
]),
|
|
26
|
-
ref: f,
|
|
27
|
-
...d,
|
|
28
|
-
children: e
|
|
120
|
+
type: "button",
|
|
121
|
+
"aria-label": `Dismiss ${e || ""}`,
|
|
122
|
+
className: s.actionButton,
|
|
123
|
+
disabled: n,
|
|
124
|
+
onClick: a,
|
|
125
|
+
children: /* @__PURE__ */ t(B, { size: "16" })
|
|
29
126
|
}
|
|
30
127
|
)
|
|
31
|
-
);
|
|
32
|
-
|
|
128
|
+
] }), b = ({ children: e }) => /* @__PURE__ */ t(h, { children: e });
|
|
129
|
+
b.displayName = "Tag.HoverContent";
|
|
130
|
+
const N = ({ children: e }) => /* @__PURE__ */ t(h, { children: e });
|
|
131
|
+
N.displayName = "Tag.SecondaryContent";
|
|
132
|
+
const I = H;
|
|
133
|
+
I.HoverContent = b;
|
|
134
|
+
I.SecondaryContent = N;
|
|
33
135
|
export {
|
|
34
|
-
|
|
136
|
+
I as Tag,
|
|
137
|
+
b as TagHoverContent,
|
|
138
|
+
N as TagSecondaryContent
|
|
35
139
|
};
|
|
36
140
|
//# sourceMappingURL=fondue-components28.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components28.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,EAAA,GAEPC,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-components28.js","sources":["../src/components/Tag/Tag.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross, IconPlus } from '@frontify/fondue-icons';\nimport { Children, isValidElement, useState, type MouseEvent, type ReactNode } from 'react';\n\nimport styles from './styles/tag.module.scss';\n\ntype TagStyle = 'default' | 'highlight';\n\ntype TagEmphasis = 'strong' | 'weak';\n\ntype TagSize = 'default' | 'small';\n\ntype TagProps = {\n /**\n * @default 'strong'\n */\n emphasis?: TagEmphasis;\n /**\n * @default 'default'\n */\n variant?: TagStyle;\n /**\n * @default 'default'\n */\n size?: TagSize;\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * Click handler\n */\n onClick?: (event?: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Click handler on dismiss - providing this will show the dismiss button\n */\n onDismiss?: (event?: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Click handler on add click - providing this will show the add button\n */\n onAddClick?: (event?: MouseEvent<HTMLButtonElement>) => void;\n title?: string;\n 'aria-label'?: string;\n 'data-test-id'?: string;\n children: ReactNode;\n};\n\nexport type TagHoverContentProps = {\n children: ReactNode;\n};\n\nexport type TagSecondaryContentProps = {\n children: ReactNode;\n};\n\nconst TagRoot = ({\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'tag',\n children,\n disabled = false,\n emphasis = 'strong',\n onAddClick,\n onClick,\n onDismiss,\n size = 'default',\n title,\n variant,\n}: TagProps) => {\n const [isHover, setIsHover] = useState(false);\n\n // Extract hover content from slots\n let extractedHoverContent: ReactNode = null;\n const processedChildren = Children.map(children, (child) => {\n if (isValidElement(child) && child.type === TagHoverContent) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n extractedHoverContent = child.props.children;\n return null;\n }\n return child;\n });\n\n const commonProps = {\n 'data-addable': !!onAddClick,\n 'data-component': 'tag',\n 'data-disabled': disabled,\n 'data-dismissable': !!onDismiss,\n 'data-emphasis': emphasis,\n 'data-size': size,\n 'data-variant': variant,\n className: styles.root,\n };\n\n return (\n <div {...commonProps}>\n <TagMainContent\n aria-label={ariaLabel || title}\n disabled={disabled}\n hoverContent={extractedHoverContent}\n isHover={isHover}\n onClick={onClick}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n title={title}\n data-test-id={dataTestId}\n >\n {processedChildren}\n </TagMainContent>\n <TagActionButtons\n aria-label={ariaLabel || title}\n disabled={disabled}\n onAddClick={onAddClick}\n onDismiss={onDismiss}\n />\n </div>\n );\n};\nTagRoot.displayName = 'Tag';\n\nconst TagMainContent = ({\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId,\n children,\n disabled = false,\n hoverContent,\n isHover = false,\n onClick,\n onMouseEnter,\n onMouseLeave,\n title,\n}: {\n 'aria-label'?: string;\n 'data-test-id'?: string;\n children: ReactNode;\n disabled?: boolean;\n hoverContent?: ReactNode;\n isHover?: boolean;\n onClick?: (event?: MouseEvent<HTMLButtonElement>) => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n title?: string;\n}) => {\n // Process children to handle secondary content slots in their natural position\n let secondaryIndex = 0;\n const processedChildren = Children.map(children, (child) => {\n if (isValidElement(child) && child.type === TagSecondaryContent) {\n const currentIndex = secondaryIndex++;\n return (\n <div className={styles.secondaryContent} key={`secondary-${currentIndex}`}>\n {/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */}\n {child.props.children}\n </div>\n );\n }\n return child;\n });\n\n const content = hoverContent ? (\n <div data-hover={isHover}>\n <div>{hoverContent}</div>\n <div>{processedChildren}</div>\n </div>\n ) : (\n processedChildren\n );\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n title={title}\n className={styles.mainContent}\n onClick={disabled ? undefined : onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n disabled={disabled}\n data-test-id={dataTestId}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div\n className={styles.mainContent}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n data-test-id={dataTestId}\n >\n {content}\n </div>\n );\n};\n\ntype TagActionButtonsProps = {\n /**\n * @default false\n */\n disabled?: boolean;\n /**\n * Click handler on dismiss\n */\n onDismiss?: (event?: MouseEvent<HTMLButtonElement>) => void;\n /**\n * Click handler on add click\n */\n onAddClick?: (event?: MouseEvent<HTMLButtonElement>) => void;\n 'aria-label'?: string;\n};\n\nconst TagActionButtons = ({ 'aria-label': ariaLabel, disabled, onAddClick, onDismiss }: TagActionButtonsProps) => {\n return (\n <>\n {onAddClick && (\n <button\n type=\"button\"\n aria-label={`Add ${ariaLabel || ''}`}\n className={styles.actionButton}\n disabled={disabled}\n onClick={onAddClick}\n >\n <IconPlus size=\"16\" />\n </button>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n aria-label={`Dismiss ${ariaLabel || ''}`}\n className={styles.actionButton}\n disabled={disabled}\n onClick={onDismiss}\n >\n <IconCross size=\"16\" />\n </button>\n )}\n </>\n );\n};\n\nexport const TagHoverContent = ({ children }: TagHoverContentProps) => {\n return <>{children}</>;\n};\nTagHoverContent.displayName = 'Tag.HoverContent';\n\nexport const TagSecondaryContent = ({ children }: TagSecondaryContentProps) => {\n return <>{children}</>;\n};\nTagSecondaryContent.displayName = 'Tag.SecondaryContent';\n\nexport const Tag = TagRoot as typeof TagRoot & {\n HoverContent: typeof TagHoverContent;\n SecondaryContent: typeof TagSecondaryContent;\n displayName?: string;\n};\nTag.HoverContent = TagHoverContent;\nTag.SecondaryContent = TagSecondaryContent;\n"],"names":["TagRoot","ariaLabel","dataTestId","children","disabled","emphasis","onAddClick","onClick","onDismiss","size","title","variant","isHover","setIsHover","useState","extractedHoverContent","processedChildren","Children","child","isValidElement","TagHoverContent","commonProps","styles","jsxs","jsx","TagMainContent","TagActionButtons","hoverContent","onMouseEnter","onMouseLeave","secondaryIndex","TagSecondaryContent","currentIndex","content","Fragment","IconPlus","IconCross","Tag"],"mappings":";;;;AAwDA,MAAMA,IAAU,CAAC;AAAA,EACb,cAAcC;AAAA,EACd,gBAAgBC,IAAa;AAAA,EAC7B,UAAAC;AAAA,EACA,UAAAC,IAA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
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
import { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as E, forwardRef as l, useContext as f, useRef as w, useEffect as q, useMemo as I, useCallback as B, createElement as z } from "react";
|
|
3
|
+
import { IconDotsHorizontal as F } from "@frontify/fondue-icons";
|
|
4
|
+
import * as c from "@radix-ui/react-tabs";
|
|
5
|
+
import { useControllableState as H } from "./fondue-components68.js";
|
|
6
|
+
import { Button as M } from "./fondue-components6.js";
|
|
7
|
+
import { Dropdown as d } from "./fondue-components11.js";
|
|
8
|
+
import { useFondueTheme as W } from "./fondue-components33.js";
|
|
9
|
+
import { useTabTriggers as G } from "./fondue-components82.js";
|
|
10
|
+
import n from "./fondue-components83.js";
|
|
11
|
+
const m = E({
|
|
12
|
+
value: "",
|
|
13
|
+
disabled: !1
|
|
14
|
+
});
|
|
15
|
+
m.displayName = "TabConfigContext";
|
|
16
|
+
const v = E({
|
|
17
|
+
addTrigger: () => {
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
v.displayName = "TabTriggerContext";
|
|
21
|
+
const L = ({
|
|
22
|
+
padding: t = "compact",
|
|
23
|
+
activeTab: o,
|
|
24
|
+
defaultActiveTab: s,
|
|
25
|
+
size: r = "medium",
|
|
26
|
+
onActiveTabChange: u,
|
|
27
|
+
children: p,
|
|
28
|
+
variant: T = "default",
|
|
29
|
+
...i
|
|
30
|
+
}, S) => {
|
|
31
|
+
var y;
|
|
32
|
+
const { dir: j } = W(), [g, C] = H({
|
|
33
|
+
prop: o,
|
|
34
|
+
defaultProp: s,
|
|
35
|
+
onChange: u
|
|
36
|
+
}), h = B(
|
|
37
|
+
(e) => {
|
|
38
|
+
C(e);
|
|
39
|
+
},
|
|
40
|
+
[C]
|
|
41
|
+
), { triggerListRef: A, activeIndicatorRef: D, triggers: x, triggersOutOfView: N, addTrigger: R } = G({
|
|
42
|
+
activeTab: g
|
|
43
|
+
}), O = I(() => ({ addTrigger: R }), [R]);
|
|
44
|
+
return /* @__PURE__ */ a(v.Provider, { value: O, children: /* @__PURE__ */ b(
|
|
45
|
+
c.Root,
|
|
46
|
+
{
|
|
47
|
+
ref: S,
|
|
48
|
+
dir: j,
|
|
49
|
+
className: n.root,
|
|
50
|
+
onValueChange: h,
|
|
51
|
+
value: g ?? ((y = x[0]) == null ? void 0 : y.value),
|
|
52
|
+
"data-tabs-content-padding": t,
|
|
53
|
+
"data-tabs-variant": T,
|
|
54
|
+
...i,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ b("div", { className: n.triggerListWrapper, children: [
|
|
57
|
+
/* @__PURE__ */ a(c.List, { ref: A, "data-size": r, className: n.triggerList, children: x.map((e) => /* @__PURE__ */ z(
|
|
58
|
+
c.Trigger,
|
|
59
|
+
{
|
|
60
|
+
...e.props,
|
|
61
|
+
key: e.value,
|
|
62
|
+
value: e.value,
|
|
63
|
+
disabled: e.disabled,
|
|
64
|
+
className: n.trigger,
|
|
65
|
+
ref: e.ref
|
|
66
|
+
},
|
|
67
|
+
e.element
|
|
68
|
+
)) }),
|
|
69
|
+
/* @__PURE__ */ b(d.Root, { children: [
|
|
70
|
+
N.length > 0 && /* @__PURE__ */ a(d.Trigger, { "data-test-id": "overflow-items-dropdown-trigger", children: /* @__PURE__ */ a(M, { emphasis: "default", aspect: "square", size: "small", children: /* @__PURE__ */ a(F, { size: 16 }) }) }),
|
|
71
|
+
/* @__PURE__ */ a(d.Content, { align: "end", "data-test-id": "overflow-items-dropdown-content", children: N.map((e) => /* @__PURE__ */ z(
|
|
72
|
+
d.Item,
|
|
73
|
+
{
|
|
74
|
+
...e.props,
|
|
75
|
+
disabled: e.disabled,
|
|
76
|
+
onSelect: () => h(e.value),
|
|
77
|
+
key: e.value
|
|
78
|
+
},
|
|
79
|
+
e.element
|
|
80
|
+
)) })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ a(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
"data-test-id": "active-tab-indicator",
|
|
86
|
+
ref: D,
|
|
87
|
+
className: n.activeIndicator
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
p
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
};
|
|
96
|
+
L.displayName = "Tabs.Root";
|
|
97
|
+
const V = ({ children: t, value: o, disabled: s }) => {
|
|
98
|
+
const r = I(() => ({ value: o, disabled: s }), [o, s]);
|
|
99
|
+
return /* @__PURE__ */ a(m.Provider, { value: r, children: t });
|
|
100
|
+
};
|
|
101
|
+
V.displayName = "Tabs.Tab";
|
|
102
|
+
const k = ({ children: t, ...o }, s) => {
|
|
103
|
+
const { value: r, disabled: u } = f(m), { addTrigger: p } = f(v), T = w(null), i = w();
|
|
104
|
+
return q(() => {
|
|
105
|
+
p({
|
|
106
|
+
ref: T || s,
|
|
107
|
+
value: r ?? "",
|
|
108
|
+
disabled: u,
|
|
109
|
+
props: o,
|
|
110
|
+
element: t,
|
|
111
|
+
previousElement: i.current
|
|
112
|
+
}), i.current = t;
|
|
113
|
+
}, [t]), null;
|
|
114
|
+
};
|
|
115
|
+
k.displayName = "Tabs.Trigger";
|
|
116
|
+
const P = ({ children: t, ...o }, s) => {
|
|
117
|
+
const { value: r } = f(m);
|
|
118
|
+
return /* @__PURE__ */ a(c.Content, { ref: s, ...o, className: n.content, value: r ?? "", children: t });
|
|
119
|
+
};
|
|
120
|
+
P.displayName = "Tabs.Content";
|
|
121
|
+
const ee = {
|
|
122
|
+
Root: l(L),
|
|
123
|
+
Tab: l(V),
|
|
124
|
+
Trigger: l(k),
|
|
125
|
+
Content: l(P)
|
|
55
126
|
};
|
|
56
|
-
x.displayName = "TextField.Root";
|
|
57
|
-
const F = ({ name: i, className: c, ...e }, t) => /* @__PURE__ */ s("div", { "data-slot": !0, "data-name": i, ...e, ref: t, className: u(a.slot, c) });
|
|
58
|
-
F.displayName = "TextField.Slot";
|
|
59
|
-
const g = f(x), v = f(F), R = g;
|
|
60
|
-
R.Root = g;
|
|
61
|
-
R.Slot = v;
|
|
62
127
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
128
|
+
ee as Tabs,
|
|
129
|
+
P as TabsContent,
|
|
130
|
+
L as TabsRoot,
|
|
131
|
+
V as TabsTab,
|
|
132
|
+
k as TabsTrigger
|
|
66
133
|
};
|
|
67
134
|
//# sourceMappingURL=fondue-components29.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components29.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 'aria-errormessage'?: string;\n};\n\nexport const TextFieldRoot = (\n {\n children,\n className,\n status = 'neutral',\n 'data-test-id': dataTestId = 'fondue-text-input',\n 'aria-errormessage': ariaErrormessage,\n placeholder,\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 <div className={styles.inputWrapper}>\n {placeholder && <div className={styles.placeholder}>{placeholder}</div>}\n <input\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n type=\"text\"\n placeholder={placeholder}\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 aria-errormessage={status === 'error' ? ariaErrormessage : undefined}\n />\n </div>\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 <div data-slot data-name={name} {...slotProps} ref={forwardedRef} className={cn(styles.slot, className)} />;\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","ariaErrormessage","placeholder","inputProps","ref","wasClicked","useRef","jsxs","cn","styles","jsx","mouseEvent","focusEvent","_a","blurEvent","IconCheckMark","IconExclamationMarkTriangle","TextFieldSlot","name","slotProps","forwardedRef","ForwardedRefTextFieldRoot","forwardRef","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AW,UAAUE,IAAmB;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/D,GACJ;AAAA,IAECF,MAAW,YACR,gBAAAW,EAACK,GAAA,EAAc,MAAM,IAAI,WAAWN,EAAO,aAAa,gBAAc,GAAGT,CAAU,iBAAiB,IACpG;AAAA,IAEHD,MAAW,UACR,gBAAAW;AAAA,MAACM;AAAA,MAAA;AAAA,QACG,MAAM;AAAA,QACN,WAAWP,EAAO;AAAA,QAClB,gBAAc,GAAGT,CAAU;AAAA,MAAA;AAAA,IAAA,IAE/B;AAAA,IAEHH;AAAA,EAAA,GACL;AAER;AACAD,EAAc,cAAc;AAQrB,MAAMqB,IAAgB,CACzB,EAAE,MAAAC,GAAM,WAAApB,GAAW,GAAGqB,EAAA,GACtBC,MAEO,gBAAAV,EAAC,OAAA,EAAI,aAAS,IAAC,aAAWQ,GAAO,GAAGC,GAAW,KAAKC,GAAc,WAAWZ,EAAGC,EAAO,MAAMX,CAAS,GAAG;AAGpHmB,EAAc,cAAc;AAE5B,MAAMI,IAA4BC,EAA6C1B,CAAa,GACtF2B,IAA4BD,EAA+CL,CAAa,GAEjFO,IAGTH;AACJG,EAAU,OAAOH;AACjBG,EAAU,OAAOD;"}
|
|
1
|
+
{"version":3,"file":"fondue-components29.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 useMemo,\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';\nimport { useFondueTheme } from '../ThemeProvider/ThemeProvider';\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});\nTabConfigContext.displayName = 'TabConfigContext';\n\nconst TabTriggerContext = createContext<{\n addTrigger: (trigger: TabTrigger) => void;\n}>({\n addTrigger: () => {},\n});\nTabTriggerContext.displayName = 'TabTriggerContext';\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 { dir } = useFondueTheme();\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 const contextValue = useMemo(() => ({ addTrigger }), [addTrigger]);\n\n return (\n <TabTriggerContext.Provider value={contextValue}>\n <RadixTabs.Root\n ref={ref}\n dir={dir}\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 const contextValue = useMemo(() => ({ value, disabled }), [value, disabled]);\n\n return <TabConfigContext.Provider value={contextValue}>{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 asChild?: boolean;\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","dir","useFondueTheme","activeTab","setActiveTab","useControllableState","handleSetActiveTab","useCallback","value","triggerListRef","activeIndicatorRef","triggers","triggersOutOfView","addTrigger","useTabTriggers","contextValue","useMemo","jsx","jsxs","RadixTabs","styles","_a","trigger","createElement","Dropdown","Button","IconDotsHorizontal","TabsTab","disabled","TabsTrigger","useContext","localRef","useRef","previousElement","useEffect","TabsContent","itemProps","Tabs","forwardRef"],"mappings":";;;;;;;;;;AA2DA,MAAMA,IAAmBC,EAGtB;AAAA,EACC,OAAO;AAAA,EACP,UAAU;AACd,CAAC;AACDD,EAAiB,cAAc;AAE/B,MAAME,IAAoBD,EAEvB;AAAA,EACC,YAAY,MAAM;AAAA,EAAC;AACvB,CAAC;AACDC,EAAkB,cAAc;AAEzB,MAAMC,IAAW,CACpB;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,WAAWC;AAAA,EACX,kBAAAC;AAAA,EACA,M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Ac;AAMf,MAAME,IAAc,CAAC,EAAE,UAAAhC,GAAU,GAAGE,EAAA,GAA2BC,MAAyC;AAC3G,QAAM,EAAE,OAAAQ,GAAO,UAAAoB,MAAaE,EAAW1C,CAAgB,GAEjD,EAAE,YAAAyB,EAAA,IAAeiB,EAAWxC,CAAiB,GAE7CyC,IAAWC,EAA0B,IAAI,GACzCC,IAAkBD,EAAA;AAExB,SAAAE,EAAU,MAAM;AACZ,IAAArB,EAAW;AAAA,MACP,KAAKkB,KAAY/B;AAAA,MACjB,OAAOQ,KAAS;AAAA,MAChB,UAAAoB;AAAA,MACA,OAAA7B;AAAA,MACA,SAASF;AAAA,MACT,iBAAiBoC,EAAgB;AAAA,IAAA,CACpC,GACDA,EAAgB,UAAUpC;AAAA,EAE9B,GAAG,CAACA,CAAQ,CAAC,GAEN;AACX;AACAgC,EAAY,cAAc;AAOnB,MAAMM,IAAc,CAAC,EAAE,UAAAtC,GAAU,GAAGuC,EAAA,GAA+BpC,MAAsC;AAC5G,QAAM,EAAE,OAAAQ,EAAA,IAAUsB,EAAW1C,CAAgB;AAE7C,SACI,gBAAA6B,EAACE,EAAU,SAAV,EAAkB,KAAAnB,GAAW,GAAGoC,GAAW,WAAWhB,EAAO,SAAS,OAAOZ,KAAS,IAClF,UAAAX,EAAA,CACL;AAER;AACAsC,EAAY,cAAc;AAEnB,MAAME,KAAO;AAAA,EAChB,MAAMC,EAA0C/C,CAAQ;AAAA,EACxD,KAAK+C,EAAyCX,CAAO;AAAA,EACrD,SAASW,EAAgDT,CAAW;AAAA,EACpE,SAASS,EAA6CH,CAAW;AACrE;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconCaretDown as C } from "@frontify/fondue-icons";
|
|
3
3
|
import * as s from "@radix-ui/react-accordion";
|
|
4
4
|
import { forwardRef as y, useMemo as R, Children as w, isValidElement as T } from "react";
|
|
5
|
-
import d from "./fondue-
|
|
5
|
+
import d from "./fondue-components35.js";
|
|
6
6
|
const g = ({
|
|
7
7
|
"data-test-id": o = "fondue-accordion",
|
|
8
8
|
border: e = !0,
|
|
@@ -1,106 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onEnterPressed: m,
|
|
18
|
-
readOnly: r,
|
|
19
|
-
resizable: y,
|
|
20
|
-
selectable: I = !0,
|
|
21
|
-
status: s = "default",
|
|
22
|
-
value: f,
|
|
23
|
-
...t
|
|
24
|
-
}) => {
|
|
25
|
-
const C = F(null), h = F(!1), [v, g] = x(f ?? u ?? ""), T = (c == null ? void 0 : c.length) !== void 0 || i || ["success", "error"].includes(s), K = () => {
|
|
26
|
-
g("");
|
|
27
|
-
}, j = (a) => {
|
|
28
|
-
var e;
|
|
29
|
-
a.key === "Enter" && (m == null || m(a)), (e = t.onKeyDown) == null || e.call(t, a);
|
|
30
|
-
};
|
|
31
|
-
return B(() => {
|
|
32
|
-
g(f ?? u ?? "");
|
|
33
|
-
}, [u, f]), B(() => {
|
|
34
|
-
var a;
|
|
35
|
-
N && ((a = C.current) == null || a.focus());
|
|
36
|
-
}, [N]), /* @__PURE__ */ z(
|
|
37
|
-
"div",
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { cn as c } from "./fondue-components41.js";
|
|
4
|
+
import t from "./fondue-components84.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,
|
|
38
17
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
style: { "--max-rows": `${k}` },
|
|
51
|
-
children: [
|
|
52
|
-
d ? /* @__PURE__ */ o("div", { className: l.decorator, children: d }) : null,
|
|
53
|
-
/* @__PURE__ */ o(
|
|
54
|
-
"textarea",
|
|
55
|
-
{
|
|
56
|
-
...t,
|
|
57
|
-
onMouseDown: (a) => {
|
|
58
|
-
h.current = !0, a.currentTarget.dataset.showFocusRing = "false";
|
|
59
|
-
},
|
|
60
|
-
onFocus: (a) => {
|
|
61
|
-
var e;
|
|
62
|
-
h.current || (a.target.dataset.showFocusRing = "true"), (e = t.onFocus) == null || e.call(t, a);
|
|
63
|
-
},
|
|
64
|
-
onBlur: (a) => {
|
|
65
|
-
var e;
|
|
66
|
-
a.target.dataset.showFocusRing = "false", h.current = !1, (e = t.onBlur) == null || e.call(t, a);
|
|
67
|
-
},
|
|
68
|
-
autoComplete: D ? "on" : "off",
|
|
69
|
-
className: l.textarea,
|
|
70
|
-
disabled: n,
|
|
71
|
-
onKeyDown: j,
|
|
72
|
-
onInput: (a) => g(a.currentTarget.value),
|
|
73
|
-
onSelect: (a) => {
|
|
74
|
-
I || (a.currentTarget.selectionStart = a.currentTarget.selectionEnd);
|
|
75
|
-
},
|
|
76
|
-
readOnly: r,
|
|
77
|
-
ref: C,
|
|
78
|
-
rows: S,
|
|
79
|
-
value: v
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
s === "loading" && /* @__PURE__ */ o("div", { className: l.loadingStatus, "data-test-id": `${w}-loader` }),
|
|
83
|
-
T && /* @__PURE__ */ z("div", { className: l.tools, children: [
|
|
84
|
-
s === "success" && /* @__PURE__ */ o("div", { className: l.success, children: /* @__PURE__ */ o($, { size: 20 }) }),
|
|
85
|
-
s === "error" && /* @__PURE__ */ o("div", { className: l[s], children: /* @__PURE__ */ o(b, { size: 20 }) }),
|
|
86
|
-
c == null ? void 0 : c.map(({ icon: a, title: e, callback: M }) => /* @__PURE__ */ o(
|
|
87
|
-
"button",
|
|
88
|
-
{
|
|
89
|
-
className: l.toolsButton,
|
|
90
|
-
disabled: n || r,
|
|
91
|
-
onClick: M,
|
|
92
|
-
title: e,
|
|
93
|
-
children: a
|
|
94
|
-
},
|
|
95
|
-
e
|
|
96
|
-
)),
|
|
97
|
-
i && /* @__PURE__ */ o("button", { className: l.toolsButton, onClick: K, disabled: n || r, children: /* @__PURE__ */ o(q, { size: 20, fill: "currentColor" }) })
|
|
98
|
-
] })
|
|
99
|
-
]
|
|
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
|
|
100
29
|
}
|
|
101
|
-
)
|
|
102
|
-
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
x.displayName = "FondueText";
|
|
103
33
|
export {
|
|
104
|
-
|
|
34
|
+
x as Text
|
|
105
35
|
};
|
|
106
36
|
//# sourceMappingURL=fondue-components30.js.map
|