@cfx-dev/ui-components 4.0.2 → 4.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/{Combination-BRUj3CHE.js → Combination-Cbiw1XRb.js} +1 -1
- package/dist/assets/css/DropdownSelect.css +1 -1
- package/dist/assets/css/Flex.css +1 -1
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/RichInput.css +1 -1
- package/dist/assets/css/Select.css +1 -1
- package/dist/assets/css/Tabular.css +1 -1
- package/dist/assets/css/ToggleGroup.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Accordion/Accordion.js +18 -17
- package/dist/components/Accordion/AccordionShowcase.js +3 -2
- package/dist/components/Avatar/AvatarShowcase.js +3 -2
- package/dist/components/Badge/BadgeShowcase.js +5 -4
- package/dist/components/Button/ButtonShowcase.js +3 -2
- package/dist/components/Checkbox/Checkbox.js +6 -5
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +4 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +739 -715
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +11 -10
- package/dist/components/Flyout/Flyout.js +1 -1
- package/dist/components/Icon/Icon.d.ts +4 -3
- package/dist/components/Icon/Icon.js +27 -25
- package/dist/components/IconBig/IconBig.js +3 -2
- package/dist/components/InfoPanel/InfoPanelShowcase.js +11 -10
- package/dist/components/Input/Input.d.ts +2 -1
- package/dist/components/Input/Input.js +96 -75
- package/dist/components/Input/InputShowcase.js +6 -5
- package/dist/components/Input/RichInput.d.ts +2 -1
- package/dist/components/Input/RichInput.js +60 -43
- package/dist/components/Layout/Box/Box.d.ts +4 -11
- package/dist/components/Layout/Box/Box.js +58 -96
- package/dist/components/Layout/Flex/Flex.d.ts +7 -3
- package/dist/components/Layout/Flex/Flex.js +70 -62
- package/dist/components/Layout/Flex/Flex.types.d.ts +42 -0
- package/dist/components/Layout/Flex/Flex.types.js +7 -0
- package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -0
- package/dist/components/Link/LinkShowcase.js +1 -0
- package/dist/components/Logos/LogosShowcase.js +3 -2
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/Select/Select.d.ts +2 -3
- package/dist/components/Select/Select.js +1922 -7
- package/dist/components/Select/SelectShowcase.js +4 -3
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +2 -3
- package/dist/components/Separator/Separator.d.ts +2 -2
- package/dist/components/Separator/Separator.js +35 -25
- package/dist/components/Skeleton/Skeleton.d.ts +7 -6
- package/dist/components/Skeleton/Skeleton.js +35 -22
- package/dist/components/Skeleton/SkeletonShowcase.js +14 -13
- package/dist/components/Slider/Slider.js +11 -9
- package/dist/components/Slider/SliderShowcase.js +10 -9
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/Switch/Switch.js +6 -5
- package/dist/components/Table/Table.js +3 -2
- package/dist/components/Table/TableShowcase.js +7 -6
- package/dist/components/Tabular/Tabular.d.ts +6 -1
- package/dist/components/Tabular/Tabular.js +93 -64
- package/dist/components/Tabular/TabularShowcase.js +51 -25
- package/dist/components/Text/Text.d.ts +3 -1
- package/dist/components/Text/Text.js +61 -52
- package/dist/components/Text/Text.types.d.ts +4 -13
- package/dist/components/Text/Text.types.js +1 -4
- package/dist/components/Text/index.d.ts +3 -2
- package/dist/components/Text/index.js +9 -6
- package/dist/components/Title/TitleShowcase.js +4 -3
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +36 -33
- package/dist/components/ToggleGroup/ToggleGroupShowcase.d.ts +5 -0
- package/dist/components/ToggleGroup/ToggleGroupShowcase.js +60 -0
- package/dist/components/ToggleGroup/index.d.ts +2 -0
- package/dist/components/ToggleGroup/index.js +4 -0
- package/dist/components/ui.d.ts +37 -12
- package/dist/components/ui.js +61 -57
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-Cf5Yu9oD.js +67 -0
- package/dist/index-DBus3GoO.js +1342 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +14 -14
- package/dist/{medium-JVtzoF2c.js → medium-BA3EQDZW.js} +2 -2
- package/dist/styles-scss/_ui.scss +10 -1
- package/dist/styles-scss/global.scss +39 -26
- package/dist/styles-scss/themes/theme_cfx.scss +2 -0
- package/dist/styles-scss/themes/theme_fivem.scss +2 -0
- package/dist/styles-scss/themes/theme_redm.scss +2 -0
- package/dist/styles-scss/themes/theme_wireframe.scss +2 -0
- package/dist/styles-scss/themes.scss +4 -4
- package/dist/styles-scss/tokens.scss +30 -17
- package/package.json +1 -1
- package/dist/Select-Ds-fm4CN.js +0 -3245
- package/dist/index-BCnz73Lm.js +0 -72
- package/dist/index-BW3WdIgK.js +0 -14
- package/dist/types/Offset.d.ts +0 -1
- package/dist/types/Offset.js +0 -1
|
@@ -1,94 +1,123 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Dot as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import d, { createElement as N } from "react";
|
|
3
|
+
import { Dot as p } from "../Dot/Dot.js";
|
|
4
|
+
import { ui as C } from "../ui.js";
|
|
5
|
+
import { clsx as n } from "../../utils/clsx.js";
|
|
6
|
+
const v = "cfxui__Tabular__reset__b1dbc", k = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", R = "cfxui__Tabular__active__1ae95", y = "cfxui__Tabular__hasNotification__c372f", j = "cfxui__Tabular__content__3a95a", l = {
|
|
6
7
|
reset: v,
|
|
7
|
-
|
|
8
|
+
"tabular-size-initial-large": "cfxui__Tabular__tabular-size-initial-large__9451f",
|
|
9
|
+
item: k,
|
|
10
|
+
"tabular-size-initial-small": "cfxui__Tabular__tabular-size-initial-small__4dad8",
|
|
11
|
+
"tabular-size-small-large": "cfxui__Tabular__tabular-size-small-large__1390c",
|
|
12
|
+
"tabular-size-small-small": "cfxui__Tabular__tabular-size-small-small__cc6e3",
|
|
13
|
+
"tabular-size-small-medium-large": "cfxui__Tabular__tabular-size-small-medium-large__241e8",
|
|
14
|
+
"tabular-size-small-medium-small": "cfxui__Tabular__tabular-size-small-medium-small__b6c66",
|
|
15
|
+
"tabular-size-medium-large": "cfxui__Tabular__tabular-size-medium-large__2ff04",
|
|
16
|
+
"tabular-size-medium-small": "cfxui__Tabular__tabular-size-medium-small__b397b",
|
|
17
|
+
"tabular-size-medium-large-large": "cfxui__Tabular__tabular-size-medium-large-large__8b35a",
|
|
18
|
+
"tabular-size-medium-large-small": "cfxui__Tabular__tabular-size-medium-large-small__cec0c",
|
|
19
|
+
"tabular-size-large-large": "cfxui__Tabular__tabular-size-large-large__e3c30",
|
|
20
|
+
"tabular-size-large-small": "cfxui__Tabular__tabular-size-large-small__193f0",
|
|
21
|
+
"tabular-size-xlarge-large": "cfxui__Tabular__tabular-size-xlarge-large__e1e19",
|
|
22
|
+
"tabular-size-xlarge-small": "cfxui__Tabular__tabular-size-xlarge-small__9c3b6",
|
|
23
|
+
root: I,
|
|
8
24
|
"theme-dark": "cfxui__Tabular__theme-dark__80b8c",
|
|
9
25
|
"theme-light": "cfxui__Tabular__theme-light__c05b9",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
content: g
|
|
26
|
+
active: R,
|
|
27
|
+
hasNotification: y,
|
|
28
|
+
content: j
|
|
14
29
|
};
|
|
15
|
-
function
|
|
30
|
+
function o(b) {
|
|
16
31
|
const {
|
|
17
|
-
items:
|
|
18
|
-
activeItem:
|
|
19
|
-
onActivate:
|
|
20
|
-
itemClassName:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
items: s,
|
|
33
|
+
activeItem: t,
|
|
34
|
+
onActivate: e,
|
|
35
|
+
itemClassName: i,
|
|
36
|
+
size: u = "medium",
|
|
37
|
+
..._
|
|
38
|
+
} = b, c = d.useCallback((a) => {
|
|
39
|
+
e && e(a);
|
|
40
|
+
}, [e]), r = n(
|
|
41
|
+
l.root,
|
|
42
|
+
_.className
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ m(o.Root, { ..._, className: r, children: s.map((a) => /* @__PURE__ */ N(
|
|
45
|
+
o.Item,
|
|
27
46
|
{
|
|
28
47
|
...a,
|
|
29
|
-
className:
|
|
48
|
+
className: i,
|
|
30
49
|
key: a.id,
|
|
31
|
-
active: a.id ===
|
|
32
|
-
onClick:
|
|
50
|
+
active: a.id === t,
|
|
51
|
+
onClick: c,
|
|
52
|
+
size: u
|
|
33
53
|
}
|
|
34
54
|
)) });
|
|
35
55
|
}
|
|
36
|
-
|
|
56
|
+
o.Root = function(s) {
|
|
37
57
|
const {
|
|
38
|
-
children:
|
|
39
|
-
className:
|
|
40
|
-
ariaLabel:
|
|
41
|
-
tabIndex:
|
|
42
|
-
theme:
|
|
43
|
-
role:
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
children: t,
|
|
59
|
+
className: e,
|
|
60
|
+
ariaLabel: i,
|
|
61
|
+
tabIndex: u,
|
|
62
|
+
theme: _ = "dark",
|
|
63
|
+
role: c = "tablist",
|
|
64
|
+
style: r
|
|
65
|
+
} = s, a = n(l.root, l[`theme-${_}`], e);
|
|
66
|
+
return /* @__PURE__ */ m(
|
|
46
67
|
"div",
|
|
47
68
|
{
|
|
48
|
-
role:
|
|
49
|
-
"aria-label":
|
|
50
|
-
tabIndex:
|
|
51
|
-
className:
|
|
52
|
-
|
|
69
|
+
role: c,
|
|
70
|
+
"aria-label": i,
|
|
71
|
+
tabIndex: u,
|
|
72
|
+
className: a,
|
|
73
|
+
style: r,
|
|
74
|
+
children: t
|
|
53
75
|
}
|
|
54
76
|
);
|
|
55
77
|
};
|
|
56
|
-
|
|
78
|
+
o.Item = function(s) {
|
|
57
79
|
const {
|
|
58
|
-
id:
|
|
59
|
-
label:
|
|
60
|
-
onClick:
|
|
61
|
-
ariaLabel:
|
|
62
|
-
ariaControls:
|
|
63
|
-
className:
|
|
80
|
+
id: t,
|
|
81
|
+
label: e,
|
|
82
|
+
onClick: i,
|
|
83
|
+
ariaLabel: u,
|
|
84
|
+
ariaControls: _,
|
|
85
|
+
className: c,
|
|
64
86
|
active: r = !1,
|
|
65
|
-
disabled:
|
|
66
|
-
hasNotification:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
disabled: a = !1,
|
|
88
|
+
hasNotification: f = !1,
|
|
89
|
+
size: x
|
|
90
|
+
} = s, z = d.useCallback(() => {
|
|
91
|
+
a || i(t);
|
|
92
|
+
}, [a, i, t]), g = n(
|
|
93
|
+
l.reset,
|
|
94
|
+
l.item,
|
|
95
|
+
c,
|
|
96
|
+
C.getResponsiveFlatClassnames("tabular-size", x).map((T) => l[T]),
|
|
97
|
+
{
|
|
98
|
+
[l.active]: r,
|
|
99
|
+
[l.hasNotification]: f
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
return /* @__PURE__ */ m(
|
|
74
103
|
"button",
|
|
75
104
|
{
|
|
76
|
-
disabled:
|
|
105
|
+
disabled: a,
|
|
77
106
|
type: "button",
|
|
78
107
|
role: "tab",
|
|
79
|
-
className:
|
|
80
|
-
onClick:
|
|
81
|
-
"aria-label":
|
|
82
|
-
"aria-controls":
|
|
83
|
-
"data-text":
|
|
108
|
+
className: g,
|
|
109
|
+
onClick: z,
|
|
110
|
+
"aria-label": u,
|
|
111
|
+
"aria-controls": _,
|
|
112
|
+
"data-text": e,
|
|
84
113
|
"aria-selected": r,
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
114
|
+
children: /* @__PURE__ */ h("span", { className: l.content, children: [
|
|
115
|
+
e,
|
|
116
|
+
f && /* @__PURE__ */ m(p, { color: "green", className: l.notification })
|
|
88
117
|
] })
|
|
89
118
|
}
|
|
90
119
|
);
|
|
91
120
|
};
|
|
92
121
|
export {
|
|
93
|
-
|
|
122
|
+
o as Tabular
|
|
94
123
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
3
|
import { Flex as i } from "../Layout/Flex/Flex.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import { Text as l } from "../Text/Text.js";
|
|
5
|
+
import "../ui.js";
|
|
6
|
+
import { Tabular as m } from "./Tabular.js";
|
|
7
|
+
const c = [
|
|
7
8
|
{
|
|
8
9
|
id: "item1",
|
|
9
10
|
label: "Item 1"
|
|
@@ -32,34 +33,59 @@ const l = [
|
|
|
32
33
|
disabled: !0
|
|
33
34
|
}
|
|
34
35
|
];
|
|
35
|
-
function
|
|
36
|
-
const [
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
36
|
+
function n() {
|
|
37
|
+
const [a, r] = o.useState("item1");
|
|
38
|
+
return /* @__PURE__ */ t(i, { gap: "large", vertical: !0, children: [
|
|
39
|
+
/* @__PURE__ */ t(i, { gap: "normal", vertical: !0, children: [
|
|
40
|
+
/* @__PURE__ */ e(l, { children: "Default" }),
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
|
+
m,
|
|
42
43
|
{
|
|
43
|
-
items:
|
|
44
|
-
activeItem:
|
|
45
|
-
onActivate:
|
|
44
|
+
items: c,
|
|
45
|
+
activeItem: a,
|
|
46
|
+
onActivate: r
|
|
46
47
|
}
|
|
47
48
|
)
|
|
48
49
|
] }),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
50
|
+
/* @__PURE__ */ t(i, { gap: "normal", vertical: !0, children: [
|
|
51
|
+
/* @__PURE__ */ e(l, { children: "Size small" }),
|
|
52
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
53
|
+
m,
|
|
53
54
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
size: "small",
|
|
56
|
+
items: c,
|
|
57
|
+
activeItem: a,
|
|
58
|
+
onActivate: r
|
|
57
59
|
}
|
|
58
|
-
)
|
|
60
|
+
) })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ t(i, { gap: "normal", vertical: !0, children: [
|
|
63
|
+
/* @__PURE__ */ e(l, { children: "Size medium" }),
|
|
64
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
65
|
+
m,
|
|
66
|
+
{
|
|
67
|
+
size: "medium",
|
|
68
|
+
items: c,
|
|
69
|
+
activeItem: a,
|
|
70
|
+
onActivate: r
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ t(i, { gap: "normal", vertical: !0, children: [
|
|
75
|
+
/* @__PURE__ */ e(l, { children: "Size large" }),
|
|
76
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
77
|
+
m,
|
|
78
|
+
{
|
|
79
|
+
size: "large",
|
|
80
|
+
items: c,
|
|
81
|
+
activeItem: a,
|
|
82
|
+
onActivate: r
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
59
85
|
] })
|
|
60
86
|
] });
|
|
61
87
|
}
|
|
62
|
-
const
|
|
88
|
+
const I = o.memo(n);
|
|
63
89
|
export {
|
|
64
|
-
|
|
90
|
+
I as default
|
|
65
91
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { TextOpacity, TextProps } from './Text.types';
|
|
2
|
+
import { TextOpacity, TextProps, ResponsiveTextSize } from './Text.types';
|
|
3
3
|
|
|
4
|
+
export declare const textSizeResponsiveValueFormatter: (val: ResponsiveTextSize) => string;
|
|
5
|
+
export declare const lineHeightResponsiveValueFormatter: (val: ResponsiveTextSize) => string;
|
|
4
6
|
export declare const TEXT_OPACITY_MAP: Record<TextOpacity, number | string>;
|
|
5
7
|
export declare const getTextOpacity: (opacity?: TextOpacity, otherwise?: string | number) => string | number;
|
|
6
8
|
export declare const DEFAULT_TEXT_COLOR = "primary";
|
|
@@ -1,73 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
|
-
import { ui as
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { getColor as
|
|
6
|
-
const
|
|
7
|
-
root:
|
|
8
|
-
centered:
|
|
9
|
-
underlined:
|
|
10
|
-
truncated:
|
|
11
|
-
typographic:
|
|
12
|
-
block:
|
|
13
|
-
},
|
|
3
|
+
import { ui as t, TextSizeEnum as _ } from "../ui.js";
|
|
4
|
+
import { clsx as v } from "../../utils/clsx.js";
|
|
5
|
+
import { getColor as z } from "../../utils/color.js";
|
|
6
|
+
const w = "cfxui__Text__root__2fe11", A = "cfxui__Text__centered__4d7bd", E = "cfxui__Text__underlined__5860e", O = "cfxui__Text__truncated__417f4", F = "cfxui__Text__typographic__d8155", H = "cfxui__Text__block__cb1b6", r = {
|
|
7
|
+
root: w,
|
|
8
|
+
centered: A,
|
|
9
|
+
underlined: E,
|
|
10
|
+
truncated: O,
|
|
11
|
+
typographic: F,
|
|
12
|
+
block: H
|
|
13
|
+
}, N = (e) => e in _ ? t.fontSize(e) : typeof e == "number" ? t.q(e) : e, $ = (e) => e in _ ? t.lineHeight(e) : typeof e == "number" ? t.q(e) : e, B = {
|
|
14
14
|
0: 0,
|
|
15
15
|
25: "var(--text-opacity-25)",
|
|
16
16
|
50: "var(--text-opacity-50)",
|
|
17
17
|
75: "var(--text-opacity-75)",
|
|
18
18
|
100: 1
|
|
19
|
-
},
|
|
19
|
+
}, P = {
|
|
20
20
|
h1: "h1",
|
|
21
21
|
h2: "h2",
|
|
22
22
|
h3: "h3",
|
|
23
23
|
h4: "h4",
|
|
24
24
|
h5: "h5",
|
|
25
25
|
h6: "h6"
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
return typeof
|
|
29
|
-
}, D = "primary",
|
|
26
|
+
}, q = (e, n = 1) => {
|
|
27
|
+
const o = typeof e == "string" && B[e];
|
|
28
|
+
return typeof o == "string" || typeof o == "number" ? o : n;
|
|
29
|
+
}, D = "primary", I = l.forwardRef(function(n, o) {
|
|
30
30
|
const {
|
|
31
|
-
family:
|
|
32
|
-
size:
|
|
33
|
-
weight:
|
|
34
|
-
letterSpacing:
|
|
31
|
+
family: s,
|
|
32
|
+
size: i = "normal",
|
|
33
|
+
weight: p = "normal",
|
|
34
|
+
letterSpacing: u = "normal",
|
|
35
35
|
as: c = "span",
|
|
36
|
-
centered:
|
|
36
|
+
centered: m = !1,
|
|
37
37
|
truncated: d = !1,
|
|
38
|
-
typographic:
|
|
39
|
-
uppercase:
|
|
40
|
-
userSelectable:
|
|
41
|
-
underlined:
|
|
42
|
-
children:
|
|
43
|
-
className:
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
typographic: h = !1,
|
|
39
|
+
uppercase: x = !1,
|
|
40
|
+
userSelectable: y = !1,
|
|
41
|
+
underlined: g = !1,
|
|
42
|
+
children: T,
|
|
43
|
+
className: b
|
|
44
|
+
} = n, R = c === "div", S = v(
|
|
45
|
+
r.root,
|
|
46
|
+
b,
|
|
47
|
+
t.getResponsiveClassnames("font-size", i),
|
|
48
|
+
t.getResponsiveClassnames("line-height", i),
|
|
49
|
+
{
|
|
50
|
+
[r.block]: R,
|
|
51
|
+
[r.centered]: m,
|
|
52
|
+
[r.truncated]: d,
|
|
53
|
+
[r.underlined]: g,
|
|
54
|
+
[r.typographic]: h,
|
|
55
|
+
[t.cls.userSelectableText]: y
|
|
56
|
+
}
|
|
57
|
+
), C = z({
|
|
58
|
+
...n,
|
|
59
|
+
color: n.color || D,
|
|
60
|
+
opacity: q(n.opacity)
|
|
61
|
+
}), k = typeof s == "string" ? s : P[c] || "primary", a = {
|
|
62
|
+
color: C,
|
|
57
63
|
fontFamily: `var(--font-family-${k})`,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
lineHeight: `var(--line-height-${i})`,
|
|
65
|
+
letterSpacing: `var(--letter-spacing-${u})`,
|
|
66
|
+
fontWeight: `var(--font-weight-${p})`,
|
|
67
|
+
...t.getResponsiveStyles("font-size", i, N),
|
|
68
|
+
...t.getResponsiveStyles("line-height", i, $)
|
|
62
69
|
};
|
|
63
|
-
return
|
|
64
|
-
}),
|
|
65
|
-
return /* @__PURE__ */
|
|
70
|
+
return x && (a.textTransform = "uppercase"), /* @__PURE__ */ f(c, { ref: o, dir: "auto", className: S, style: a, children: T });
|
|
71
|
+
}), U = l.forwardRef(function(n, o) {
|
|
72
|
+
return /* @__PURE__ */ f(I, { ref: o, ...n, as: "div" });
|
|
66
73
|
});
|
|
67
74
|
export {
|
|
68
75
|
D as DEFAULT_TEXT_COLOR,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
B as TEXT_OPACITY_MAP,
|
|
77
|
+
I as Text,
|
|
78
|
+
U as TextBlock,
|
|
79
|
+
q as getTextOpacity,
|
|
80
|
+
$ as lineHeightResponsiveValueFormatter,
|
|
81
|
+
N as textSizeResponsiveValueFormatter
|
|
73
82
|
};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
+
import { ResponsiveValueType, TextSize as RawTextSize } from '../ui';
|
|
1
2
|
import { GetColorProps } from '../../utils/color';
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
xsmall = "xsmall",
|
|
6
|
-
small = "small",
|
|
7
|
-
normal = "normal",
|
|
8
|
-
medium = "medium",
|
|
9
|
-
large = "large",
|
|
10
|
-
xlarge = "xlarge",
|
|
11
|
-
xxlarge = "xxlarge",
|
|
12
|
-
xxxlarge = "xxxlarge"
|
|
13
|
-
}
|
|
14
|
-
export type TextSize = keyof typeof TextSizeEnum;
|
|
4
|
+
export type TextSize = RawTextSize;
|
|
5
|
+
export type ResponsiveTextSize = TextSize | string | number;
|
|
15
6
|
export type TextWeight = 'thin' | 'normal' | 'bold' | 'bolder';
|
|
16
7
|
export type TextOpacity = '0' | '25' | '50' | '75' | '100';
|
|
17
8
|
export type TextAs = 'span' | 'div' | 'p' | 'label' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -30,7 +21,7 @@ interface TextPropsBase {
|
|
|
30
21
|
userSelectable?: boolean;
|
|
31
22
|
uppercase?: boolean;
|
|
32
23
|
underlined?: boolean;
|
|
33
|
-
size?:
|
|
24
|
+
size?: ResponsiveValueType<ResponsiveTextSize>;
|
|
34
25
|
weight?: TextWeight;
|
|
35
26
|
letterSpacing?: TextLetterSpacing;
|
|
36
27
|
family?: 'primary' | 'secondary';
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
a as TextSizeEnum
|
|
4
|
-
};
|
|
1
|
+
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { Text, TextBlock, TEXT_OPACITY_MAP, DEFAULT_TEXT_COLOR, getTextOpacity, } from './Text';
|
|
2
|
-
export
|
|
1
|
+
export { Text, TextBlock, TEXT_OPACITY_MAP, DEFAULT_TEXT_COLOR, getTextOpacity, textSizeResponsiveValueFormatter, } from './Text';
|
|
2
|
+
export { TextSizeEnum } from '../ui';
|
|
3
|
+
export type { TextSize, TextWeight, TextOpacity, TextAs, TextLetterSpacing, TextProps, TextColorProps, ResponsiveTextSize, } from './Text.types';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { DEFAULT_TEXT_COLOR as
|
|
1
|
+
import { DEFAULT_TEXT_COLOR as T, TEXT_OPACITY_MAP as o, Text as x, TextBlock as r, getTextOpacity as i, textSizeResponsiveValueFormatter as m } from "./Text.js";
|
|
2
|
+
import { TextSizeEnum as E } from "../ui.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
T as DEFAULT_TEXT_COLOR,
|
|
5
|
+
o as TEXT_OPACITY_MAP,
|
|
6
|
+
x as Text,
|
|
7
|
+
r as TextBlock,
|
|
8
|
+
E as TextSizeEnum,
|
|
9
|
+
i as getTextOpacity,
|
|
10
|
+
m as textSizeResponsiveValueFormatter
|
|
8
11
|
};
|
|
@@ -2,8 +2,9 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { Flex as r } from "../Layout/Flex/Flex.js";
|
|
4
4
|
import { Text as o } from "../Text/Text.js";
|
|
5
|
+
import "../ui.js";
|
|
5
6
|
import { Title as l } from "./Title.js";
|
|
6
|
-
function
|
|
7
|
+
function m() {
|
|
7
8
|
return /* @__PURE__ */ e(r, { gap: "large", vertical: !0, children: /* @__PURE__ */ t(r, { gap: "normal", vertical: !0, children: [
|
|
8
9
|
/* @__PURE__ */ e(o, { children: "Hover case" }),
|
|
9
10
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
@@ -16,7 +17,7 @@ function a() {
|
|
|
16
17
|
) })
|
|
17
18
|
] }) });
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
+
const f = i.memo(m);
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
f as default
|
|
22
23
|
};
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
3
|
import { Interactive as C } from "../Interactive/Interactive.js";
|
|
4
|
-
import { clsx as
|
|
5
|
-
const M = "cfxui__ToggleGroup__root__fb460", D = "cfxui__ToggleGroup__disabled__75462", j = "cfxui__ToggleGroup__descripted__8e168", k = "cfxui__ToggleGroup__multiline__6b784", E = "cfxui__ToggleGroup__options__7bc0c", L = "cfxui__ToggleGroup__option__8436c", O = "
|
|
4
|
+
import { clsx as _ } from "../../utils/clsx.js";
|
|
5
|
+
const M = "cfxui__ToggleGroup__root__fb460", D = "cfxui__ToggleGroup__disabled__75462", j = "cfxui__ToggleGroup__descripted__8e168", k = "cfxui__ToggleGroup__multiline__6b784", E = "cfxui__ToggleGroup__options__7bc0c", L = "cfxui__ToggleGroup__option__8436c", O = "cfxui__ToggleGroup__fullWidth__0c589", S = "cfxui__ToggleGroup__description__9429c", w = "cfxui__ToggleGroup__active__84da0", o = {
|
|
6
6
|
root: M,
|
|
7
7
|
disabled: D,
|
|
8
8
|
descripted: j,
|
|
9
9
|
multiline: k,
|
|
10
10
|
options: E,
|
|
11
11
|
option: L,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
fullWidth: O,
|
|
13
|
+
description: S,
|
|
14
|
+
active: w
|
|
15
|
+
}, f = (r, s) => {
|
|
15
16
|
var e;
|
|
16
|
-
return ((e = s.find((i) => i.value ===
|
|
17
|
-
},
|
|
17
|
+
return ((e = s.find((i) => i.value === r)) == null ? void 0 : e.description) || "";
|
|
18
|
+
}, z = n.memo(function(s) {
|
|
18
19
|
const {
|
|
19
20
|
value: e,
|
|
20
21
|
options: i,
|
|
21
|
-
onChange:
|
|
22
|
+
onChange: u,
|
|
22
23
|
className: m = "",
|
|
23
24
|
disabled: g = !1,
|
|
24
|
-
multiline:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
multiline: h = !1,
|
|
26
|
+
fullWidth: a = !1
|
|
27
|
+
} = s, [c, l] = n.useState(f(e, i)), v = n.useMemo(
|
|
28
|
+
() => i.map((t, G) => {
|
|
29
|
+
const T = () => {
|
|
30
|
+
u(t.value);
|
|
31
|
+
}, b = () => {
|
|
32
|
+
l(t.description || "");
|
|
33
|
+
}, N = () => {
|
|
34
|
+
l(f(e, i));
|
|
35
|
+
}, W = _(o.option, {
|
|
34
36
|
[o.active]: t.value === e
|
|
35
37
|
});
|
|
36
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ d(
|
|
37
39
|
C,
|
|
38
40
|
{
|
|
39
|
-
className:
|
|
40
|
-
tabIndex:
|
|
41
|
-
onClick:
|
|
42
|
-
onMouseEnter:
|
|
43
|
-
onMouseLeave:
|
|
41
|
+
className: W,
|
|
42
|
+
tabIndex: G,
|
|
43
|
+
onClick: T,
|
|
44
|
+
onMouseEnter: b,
|
|
45
|
+
onMouseLeave: N,
|
|
44
46
|
children: [
|
|
45
47
|
t.icon || null,
|
|
46
48
|
t.label
|
|
@@ -49,17 +51,18 @@ const M = "cfxui__ToggleGroup__root__fb460", D = "cfxui__ToggleGroup__disabled__
|
|
|
49
51
|
t.value
|
|
50
52
|
);
|
|
51
53
|
}),
|
|
52
|
-
[e, i,
|
|
53
|
-
), x =
|
|
54
|
+
[e, i, u, l]
|
|
55
|
+
), x = _(o.root, m, {
|
|
54
56
|
[o.disabled]: g,
|
|
55
57
|
[o.descripted]: c,
|
|
56
|
-
[o.multiline]:
|
|
58
|
+
[o.multiline]: h,
|
|
59
|
+
[o.fullWidth]: a
|
|
57
60
|
});
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
c && /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ d("div", { className: x, children: [
|
|
62
|
+
/* @__PURE__ */ p("div", { className: _(o.options, { [o.fullWidth]: a }), children: v }),
|
|
63
|
+
c && /* @__PURE__ */ p("div", { className: o.description, children: c })
|
|
61
64
|
] });
|
|
62
65
|
});
|
|
63
66
|
export {
|
|
64
|
-
|
|
67
|
+
z as ToggleGroup
|
|
65
68
|
};
|