@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.
Files changed (95) hide show
  1. package/dist/{Combination-BRUj3CHE.js → Combination-Cbiw1XRb.js} +1 -1
  2. package/dist/assets/css/DropdownSelect.css +1 -1
  3. package/dist/assets/css/Flex.css +1 -1
  4. package/dist/assets/css/Input.css +1 -1
  5. package/dist/assets/css/RichInput.css +1 -1
  6. package/dist/assets/css/Select.css +1 -1
  7. package/dist/assets/css/Tabular.css +1 -1
  8. package/dist/assets/css/ToggleGroup.css +1 -1
  9. package/dist/assets/general/global.css +1 -1
  10. package/dist/components/Accordion/Accordion.js +18 -17
  11. package/dist/components/Accordion/AccordionShowcase.js +3 -2
  12. package/dist/components/Avatar/AvatarShowcase.js +3 -2
  13. package/dist/components/Badge/BadgeShowcase.js +5 -4
  14. package/dist/components/Button/ButtonShowcase.js +3 -2
  15. package/dist/components/Checkbox/Checkbox.js +6 -5
  16. package/dist/components/DropdownSelect/DropdownSelect.d.ts +4 -1
  17. package/dist/components/DropdownSelect/DropdownSelect.js +739 -715
  18. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +11 -10
  19. package/dist/components/Flyout/Flyout.js +1 -1
  20. package/dist/components/Icon/Icon.d.ts +4 -3
  21. package/dist/components/Icon/Icon.js +27 -25
  22. package/dist/components/IconBig/IconBig.js +3 -2
  23. package/dist/components/InfoPanel/InfoPanelShowcase.js +11 -10
  24. package/dist/components/Input/Input.d.ts +2 -1
  25. package/dist/components/Input/Input.js +96 -75
  26. package/dist/components/Input/InputShowcase.js +6 -5
  27. package/dist/components/Input/RichInput.d.ts +2 -1
  28. package/dist/components/Input/RichInput.js +60 -43
  29. package/dist/components/Layout/Box/Box.d.ts +4 -11
  30. package/dist/components/Layout/Box/Box.js +58 -96
  31. package/dist/components/Layout/Flex/Flex.d.ts +7 -3
  32. package/dist/components/Layout/Flex/Flex.js +70 -62
  33. package/dist/components/Layout/Flex/Flex.types.d.ts +42 -0
  34. package/dist/components/Layout/Flex/Flex.types.js +7 -0
  35. package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -0
  36. package/dist/components/Link/LinkShowcase.js +1 -0
  37. package/dist/components/Logos/LogosShowcase.js +3 -2
  38. package/dist/components/Modal/Modal.js +1 -0
  39. package/dist/components/Overlay/Overlay.js +1 -1
  40. package/dist/components/Select/Select.d.ts +2 -3
  41. package/dist/components/Select/Select.js +1922 -7
  42. package/dist/components/Select/SelectShowcase.js +4 -3
  43. package/dist/components/Select/index.d.ts +1 -1
  44. package/dist/components/Select/index.js +2 -3
  45. package/dist/components/Separator/Separator.d.ts +2 -2
  46. package/dist/components/Separator/Separator.js +35 -25
  47. package/dist/components/Skeleton/Skeleton.d.ts +7 -6
  48. package/dist/components/Skeleton/Skeleton.js +35 -22
  49. package/dist/components/Skeleton/SkeletonShowcase.js +14 -13
  50. package/dist/components/Slider/Slider.js +11 -9
  51. package/dist/components/Slider/SliderShowcase.js +10 -9
  52. package/dist/components/Spacer/Spacer.d.ts +1 -1
  53. package/dist/components/Switch/Switch.js +6 -5
  54. package/dist/components/Table/Table.js +3 -2
  55. package/dist/components/Table/TableShowcase.js +7 -6
  56. package/dist/components/Tabular/Tabular.d.ts +6 -1
  57. package/dist/components/Tabular/Tabular.js +93 -64
  58. package/dist/components/Tabular/TabularShowcase.js +51 -25
  59. package/dist/components/Text/Text.d.ts +3 -1
  60. package/dist/components/Text/Text.js +61 -52
  61. package/dist/components/Text/Text.types.d.ts +4 -13
  62. package/dist/components/Text/Text.types.js +1 -4
  63. package/dist/components/Text/index.d.ts +3 -2
  64. package/dist/components/Text/index.js +9 -6
  65. package/dist/components/Title/TitleShowcase.js +4 -3
  66. package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
  67. package/dist/components/ToggleGroup/ToggleGroup.js +36 -33
  68. package/dist/components/ToggleGroup/ToggleGroupShowcase.d.ts +5 -0
  69. package/dist/components/ToggleGroup/ToggleGroupShowcase.js +60 -0
  70. package/dist/components/ToggleGroup/index.d.ts +2 -0
  71. package/dist/components/ToggleGroup/index.js +4 -0
  72. package/dist/components/ui.d.ts +37 -12
  73. package/dist/components/ui.js +61 -57
  74. package/dist/index-BZPx6jYI.js +8 -0
  75. package/dist/index-ByaXH_ih.js +10 -0
  76. package/dist/index-Cf5Yu9oD.js +67 -0
  77. package/dist/index-DBus3GoO.js +1342 -0
  78. package/dist/index-rKs9bXHr.js +6 -0
  79. package/dist/main.d.ts +1 -1
  80. package/dist/main.js +14 -14
  81. package/dist/{medium-JVtzoF2c.js → medium-BA3EQDZW.js} +2 -2
  82. package/dist/styles-scss/_ui.scss +10 -1
  83. package/dist/styles-scss/global.scss +39 -26
  84. package/dist/styles-scss/themes/theme_cfx.scss +2 -0
  85. package/dist/styles-scss/themes/theme_fivem.scss +2 -0
  86. package/dist/styles-scss/themes/theme_redm.scss +2 -0
  87. package/dist/styles-scss/themes/theme_wireframe.scss +2 -0
  88. package/dist/styles-scss/themes.scss +4 -4
  89. package/dist/styles-scss/tokens.scss +30 -17
  90. package/package.json +1 -1
  91. package/dist/Select-Ds-fm4CN.js +0 -3245
  92. package/dist/index-BCnz73Lm.js +0 -72
  93. package/dist/index-BW3WdIgK.js +0 -14
  94. package/dist/types/Offset.d.ts +0 -1
  95. package/dist/types/Offset.js +0 -1
@@ -1,94 +1,123 @@
1
- import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
- import b, { createElement as T } from "react";
3
- import { Dot as k } from "../Dot/Dot.js";
4
- import { clsx as d } from "../../utils/clsx.js";
5
- const v = "cfxui__Tabular__reset__b1dbc", C = "cfxui__Tabular__root__0ff05", p = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__active__1ae95", R = "cfxui__Tabular__hasNotification__c372f", g = "cfxui__Tabular__content__3a95a", e = {
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
- root: C,
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
- item: p,
11
- active: I,
12
- hasNotification: R,
13
- content: g
26
+ active: R,
27
+ hasNotification: y,
28
+ content: j
14
29
  };
15
- function _(m) {
30
+ function o(b) {
16
31
  const {
17
- items: i,
18
- activeItem: o,
19
- onActivate: t,
20
- itemClassName: c,
21
- ...s
22
- } = m, l = b.useCallback((a) => {
23
- t && t(a);
24
- }, [t]);
25
- return /* @__PURE__ */ n(_.Root, { ...s, children: i.map((a) => /* @__PURE__ */ T(
26
- _.Item,
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: c,
48
+ className: i,
30
49
  key: a.id,
31
- active: a.id === o,
32
- onClick: l
50
+ active: a.id === t,
51
+ onClick: c,
52
+ size: u
33
53
  }
34
54
  )) });
35
55
  }
36
- _.Root = function(i) {
56
+ o.Root = function(s) {
37
57
  const {
38
- children: o,
39
- className: t,
40
- ariaLabel: c,
41
- tabIndex: s,
42
- theme: l = "dark",
43
- role: a = "tablist"
44
- } = i, r = d(e.root, e[`theme-${l}`], t);
45
- return /* @__PURE__ */ n(
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: a,
49
- "aria-label": c,
50
- tabIndex: s,
51
- className: r,
52
- children: o
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
- _.Item = function(i) {
78
+ o.Item = function(s) {
57
79
  const {
58
- id: o,
59
- label: t,
60
- onClick: c,
61
- ariaLabel: s,
62
- ariaControls: l,
63
- className: a,
80
+ id: t,
81
+ label: e,
82
+ onClick: i,
83
+ ariaLabel: u,
84
+ ariaControls: _,
85
+ className: c,
64
86
  active: r = !1,
65
- disabled: f = !1,
66
- hasNotification: u = !1
67
- } = i, h = b.useCallback(() => {
68
- f || c(o);
69
- }, [f, c, o]), N = d(e.reset, e.item, a, {
70
- [e.active]: r,
71
- [e.hasNotification]: u
72
- });
73
- return /* @__PURE__ */ n(
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: f,
105
+ disabled: a,
77
106
  type: "button",
78
107
  role: "tab",
79
- className: N,
80
- onClick: h,
81
- "aria-label": s,
82
- "aria-controls": l,
83
- "data-text": t,
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__ */ x("span", { className: e.content, children: [
86
- t,
87
- u && /* @__PURE__ */ n(k, { color: "green", className: e.notification })
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
- _ as Tabular
122
+ o as Tabular
94
123
  };
@@ -1,9 +1,10 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import a from "react";
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 m } from "../Text/Text.js";
5
- import { Tabular as r } from "./Tabular.js";
6
- const l = [
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 d() {
36
- const [o, c] = a.useState("item1"), [n, s] = a.useState(void 0);
37
- return /* @__PURE__ */ e(i, { gap: "large", vertical: !0, children: [
38
- /* @__PURE__ */ e(i, { gap: "normal", vertical: !0, children: [
39
- /* @__PURE__ */ t(m, { children: "With default activeItem" }),
40
- /* @__PURE__ */ t(
41
- r,
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: l,
44
- activeItem: o,
45
- onActivate: c
44
+ items: c,
45
+ activeItem: a,
46
+ onActivate: r
46
47
  }
47
48
  )
48
49
  ] }),
49
- /* @__PURE__ */ e(i, { gap: "normal", vertical: !0, children: [
50
- /* @__PURE__ */ t(m, { children: "Without activeItem" }),
51
- /* @__PURE__ */ t(
52
- r,
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
- items: l,
55
- activeItem: n,
56
- onActivate: s
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 b = a.memo(d);
88
+ const I = o.memo(n);
63
89
  export {
64
- b as default
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 s } from "react/jsx-runtime";
1
+ import { jsx as f } from "react/jsx-runtime";
2
2
  import l from "react";
3
- import { ui as C } from "../ui.js";
4
- import { clsx as w } from "../../utils/clsx.js";
5
- import { getColor as A } from "../../utils/color.js";
6
- const O = "cfxui__Text__root__2fe11", R = "cfxui__Text__centered__4d7bd", S = "cfxui__Text__underlined__5860e", $ = "cfxui__Text__truncated__417f4", E = "cfxui__Text__typographic__d8155", N = "cfxui__Text__block__cb1b6", o = {
7
- root: O,
8
- centered: R,
9
- underlined: S,
10
- truncated: $,
11
- typographic: E,
12
- block: N
13
- }, z = {
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
- }, B = {
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
- }, P = (r, t = 1) => {
27
- const e = typeof r == "string" && z[r];
28
- return typeof e == "string" || typeof e == "number" ? e : t;
29
- }, D = "primary", F = l.forwardRef(function(t, e) {
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: n,
32
- size: a = "normal",
33
- weight: _ = "normal",
34
- letterSpacing: f = "normal",
31
+ family: s,
32
+ size: i = "normal",
33
+ weight: p = "normal",
34
+ letterSpacing: u = "normal",
35
35
  as: c = "span",
36
- centered: p = !1,
36
+ centered: m = !1,
37
37
  truncated: d = !1,
38
- typographic: u = !1,
39
- uppercase: m = !1,
40
- userSelectable: x = !1,
41
- underlined: h = !1,
42
- children: y,
43
- className: T
44
- } = t, g = c === "div", b = w(o.root, T, {
45
- [o.block]: g,
46
- [o.centered]: p,
47
- [o.truncated]: d,
48
- [o.underlined]: h,
49
- [o.typographic]: u,
50
- [C.cls.userSelectableText]: x
51
- }), v = A({
52
- ...t,
53
- color: t.color || D,
54
- opacity: P(t.opacity)
55
- }), k = typeof n == "string" ? n : B[c] || "primary", i = {
56
- color: v,
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
- fontSize: `var(--font-size-${a})`,
59
- lineHeight: `var(--line-height-${a})`,
60
- letterSpacing: `var(--letter-spacing-${f})`,
61
- fontWeight: `var(--font-weight-${_})`
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 m && (i.textTransform = "uppercase"), /* @__PURE__ */ s(c, { ref: e, dir: "auto", className: b, style: i, children: y });
64
- }), G = l.forwardRef(function(t, e) {
65
- return /* @__PURE__ */ s(F, { ref: e, ...t, as: "div" });
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
- z as TEXT_OPACITY_MAP,
70
- F as Text,
71
- G as TextBlock,
72
- P as getTextOpacity
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 declare enum TextSizeEnum {
4
- xxsmall = "xxsmall",
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?: TextSize;
24
+ size?: ResponsiveValueType<ResponsiveTextSize>;
34
25
  weight?: TextWeight;
35
26
  letterSpacing?: TextLetterSpacing;
36
27
  family?: 'primary' | 'secondary';
@@ -1,4 +1 @@
1
- var a = /* @__PURE__ */ ((l) => (l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l))(a || {});
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 type { TextSize, TextWeight, TextOpacity, TextAs, TextLetterSpacing, TextProps, TextColorProps, } from './Text.types';
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 e, TEXT_OPACITY_MAP as x, Text as O, TextBlock as _, getTextOpacity as o } from "./Text.js";
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
- e as DEFAULT_TEXT_COLOR,
4
- x as TEXT_OPACITY_MAP,
5
- O as Text,
6
- _ as TextBlock,
7
- o as getTextOpacity
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 a() {
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 d = i.memo(a);
20
+ const f = i.memo(m);
20
21
  export {
21
- d as default
22
+ f as default
22
23
  };
@@ -13,5 +13,6 @@ export interface ToggleGroupProps {
13
13
  className?: string;
14
14
  disabled?: boolean;
15
15
  multiline?: boolean;
16
+ fullWidth?: boolean;
16
17
  }
17
18
  export declare const ToggleGroup: React.NamedExoticComponent<ToggleGroupProps>;
@@ -1,46 +1,48 @@
1
- import { jsxs as a, jsx as u } from "react/jsx-runtime";
2
- import l from "react";
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 d } 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__description__9429c", S = "cfxui__ToggleGroup__active__84da0", 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
- description: O,
13
- active: S
14
- }, p = (_, s) => {
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 === _)) == null ? void 0 : e.description) || "";
17
- }, y = l.memo(function(s) {
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: r,
22
+ onChange: u,
22
23
  className: m = "",
23
24
  disabled: g = !1,
24
- multiline: f = !1
25
- } = s, [c, n] = l.useState(p(e, i)), v = l.useMemo(
26
- () => i.map((t, b) => {
27
- const h = () => {
28
- r(t.value);
29
- }, G = () => {
30
- n(t.description || "");
31
- }, T = () => {
32
- n(p(e, i));
33
- }, N = d(o.option, {
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__ */ a(
38
+ return /* @__PURE__ */ d(
37
39
  C,
38
40
  {
39
- className: N,
40
- tabIndex: b,
41
- onClick: h,
42
- onMouseEnter: G,
43
- onMouseLeave: T,
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, r, n]
53
- ), x = d(o.root, m, {
54
+ [e, i, u, l]
55
+ ), x = _(o.root, m, {
54
56
  [o.disabled]: g,
55
57
  [o.descripted]: c,
56
- [o.multiline]: f
58
+ [o.multiline]: h,
59
+ [o.fullWidth]: a
57
60
  });
58
- return /* @__PURE__ */ a("div", { className: x, children: [
59
- /* @__PURE__ */ u("div", { className: o.options, children: v }),
60
- c && /* @__PURE__ */ u("div", { className: o.description, children: c })
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
- y as ToggleGroup
67
+ z as ToggleGroup
65
68
  };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare function ToggleGroupShowcase(): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ToggleGroupShowcase>;
5
+ export default _default;