@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,9 +1,10 @@
1
1
  import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
- import A, { createContext as v, useState as f, useContext as w, useEffect as D } from "react";
2
+ import A, { createContext as v, useState as p, useContext as w, useEffect as D } from "react";
3
3
  import { Icon as x } from "../Icon/Icon.js";
4
4
  import { Flex as C } from "../Layout/Flex/Flex.js";
5
5
  import { Text as b } from "../Text/Text.js";
6
- import { clsx as p } from "../../utils/clsx.js";
6
+ import "../ui.js";
7
+ import { clsx as f } from "../../utils/clsx.js";
7
8
  const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c", N = "cfxui__Accordion__header__cbd69", U = "cfxui__Accordion__triggerContainer__b92c1", T = "cfxui__Accordion__iconFlip__367de", R = "cfxui__Accordion__iconUp__28d27", $ = "cfxui__Accordion__iconDown__b9e95", k = "cfxui__Accordion__iconLeft__e348b", E = "cfxui__Accordion__iconRight__bbf0c", L = "cfxui__Accordion__content__5ecaf", O = "cfxui__Accordion__open__ed604", n = {
8
9
  root: y,
9
10
  item: F,
@@ -16,11 +17,11 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
16
17
  iconRight: E,
17
18
  content: L,
18
19
  open: O
19
- }, h = v(void 0), P = function({
20
+ }, h = v(void 0), V = function({
20
21
  children: c,
21
22
  className: o
22
23
  }) {
23
- const [t, s] = f(/* @__PURE__ */ new Set()), _ = A.useCallback((r) => {
24
+ const [t, s] = p(/* @__PURE__ */ new Set()), _ = A.useCallback((r) => {
24
25
  s((u) => {
25
26
  const i = new Set(u);
26
27
  return i.has(r) ? i.delete(r) : i.add(r), i;
@@ -29,17 +30,17 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
29
30
  openItems: t,
30
31
  toggleItem: _
31
32
  }), [t, _]);
32
- return /* @__PURE__ */ e(h.Provider, { value: l, children: /* @__PURE__ */ e("div", { className: p(n.root, o), role: "presentation", children: c }) });
33
- }, V = function({
33
+ return /* @__PURE__ */ e(h.Provider, { value: l, children: /* @__PURE__ */ e("div", { className: f(n.root, o), role: "presentation", children: c }) });
34
+ }, q = function({
34
35
  children: c,
35
36
  id: o
36
37
  }) {
37
38
  return /* @__PURE__ */ e("div", { className: n.item, id: o, role: "region", "aria-labelledby": `${o}-header`, children: c });
38
- }, q = function({
39
+ }, B = function({
39
40
  children: c
40
41
  }) {
41
42
  return /* @__PURE__ */ e("div", { className: n.header, children: c });
42
- }, B = function({
43
+ }, G = function({
43
44
  text: c,
44
45
  id: o,
45
46
  iconLeft: t
@@ -50,7 +51,7 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
50
51
  const {
51
52
  toggleItem: _,
52
53
  openItems: l
53
- } = s, r = l.has(o), [u, i] = f(!1), [m, I] = f(r ? "UpChevron" : "DownChevron");
54
+ } = s, r = l.has(o), [u, i] = p(!1), [m, I] = p(r ? "UpChevron" : "DownChevron");
54
55
  return D(() => {
55
56
  const d = setTimeout(() => {
56
57
  I(r ? "UpChevron" : "DownChevron"), i(!1);
@@ -77,7 +78,7 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
77
78
  /* @__PURE__ */ e(C, { centered: !0, children: /* @__PURE__ */ e(
78
79
  x,
79
80
  {
80
- className: p(n.iconRight, {
81
+ className: f(n.iconRight, {
81
82
  [n.iconFlip]: u,
82
83
  [n.iconUp]: m === "UpChevron",
83
84
  [n.iconDown]: m === "DownChevron"
@@ -88,7 +89,7 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
88
89
  ]
89
90
  }
90
91
  );
91
- }, G = function({
92
+ }, J = function({
92
93
  children: c,
93
94
  id: o
94
95
  }) {
@@ -101,7 +102,7 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
101
102
  return /* @__PURE__ */ e(
102
103
  "div",
103
104
  {
104
- className: p(n.content, { [n.open]: s.has(o) }),
105
+ className: f(n.content, { [n.open]: s.has(o) }),
105
106
  id: `${o}-content`,
106
107
  role: "region",
107
108
  "aria-labelledby": `${o}-header`,
@@ -110,9 +111,9 @@ const y = "cfxui__Accordion__root__23c5d", F = "cfxui__Accordion__item__88b4c",
110
111
  );
111
112
  };
112
113
  export {
113
- P as Accordion,
114
- G as AccordionContent,
115
- q as AccordionHeader,
116
- V as AccordionItem,
117
- B as AccordionTrigger
114
+ V as Accordion,
115
+ J as AccordionContent,
116
+ B as AccordionHeader,
117
+ q as AccordionItem,
118
+ G as AccordionTrigger
118
119
  };
@@ -2,6 +2,7 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import a from "react";
3
3
  import { Flex as c } from "../Layout/Flex/Flex.js";
4
4
  import { Text as d } from "../Text/Text.js";
5
+ import "../ui.js";
5
6
  import { Accordion as h, AccordionItem as i, AccordionHeader as o, AccordionTrigger as n, AccordionContent as r } from "./Accordion.js";
6
7
  function l() {
7
8
  return /* @__PURE__ */ e(c, { fullWidth: !0, vertical: !0, children: /* @__PURE__ */ t(c, { fullWidth: !0, vertical: !0, children: [
@@ -58,7 +59,7 @@ function l() {
58
59
  ] })
59
60
  ] }) });
60
61
  }
61
- const b = a.memo(l);
62
+ const g = a.memo(l);
62
63
  export {
63
- b as default
64
+ g as default
64
65
  };
@@ -2,6 +2,7 @@ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import a from "react";
3
3
  import { Flex as l } from "../Layout/Flex/Flex.js";
4
4
  import { Text as t } from "../Text/Text.js";
5
+ import "../ui.js";
5
6
  import { Avatar as i } from "./Avatar.js";
6
7
  function u() {
7
8
  return /* @__PURE__ */ r(l, { fullWidth: !0, vertical: !0, children: [
@@ -27,7 +28,7 @@ function u() {
27
28
  ] })
28
29
  ] });
29
30
  }
30
- const s = a.memo(u);
31
+ const m = a.memo(u);
31
32
  export {
32
- s as default
33
+ m as default
33
34
  };
@@ -1,9 +1,10 @@
1
1
  import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import n from "react";
2
+ import o from "react";
3
3
  import { Flex as l } from "../Layout/Flex/Flex.js";
4
4
  import { Text as i } from "../Text/Text.js";
5
+ import "../ui.js";
5
6
  import { Badge as c } from "./Badge.js";
6
- function o() {
7
+ function n() {
7
8
  return /* @__PURE__ */ e(l, { gap: "large", vertical: !0, children: [
8
9
  /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
9
10
  /* @__PURE__ */ r(i, { children: "Success" }),
@@ -72,7 +73,7 @@ function o() {
72
73
  ] })
73
74
  ] });
74
75
  }
75
- const s = n.memo(o);
76
+ const u = o.memo(n);
76
77
  export {
77
- s as default
78
+ u as default
78
79
  };
@@ -2,6 +2,7 @@ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import l from "react";
3
3
  import { Flex as n } from "../Layout/Flex/Flex.js";
4
4
  import { Text as i } from "../Text/Text.js";
5
+ import "../ui.js";
5
6
  import { Button as r } from "./Button.js";
6
7
  import { ButtonBar as o } from "./ButtonBar.js";
7
8
  import { LinkButton as c } from "./LinkButton.js";
@@ -140,7 +141,7 @@ function a() {
140
141
  ] })
141
142
  ] });
142
143
  }
143
- const x = l.memo(a);
144
+ const v = l.memo(a);
144
145
  export {
145
- x as default
146
+ v as default
146
147
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as _, jsxs as D } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
3
  import $ from "react";
4
- import { c as y, u as z, a as L, b as j } from "../../index-BCnz73Lm.js";
4
+ import { b as y, u as z, a as L } from "../../index-Cf5Yu9oD.js";
5
+ import { u as j } from "../../index-BZPx6jYI.js";
5
6
  import { r as B } from "../../index-2hJuj4UN.js";
6
7
  import { P as E } from "../../index-BlbvKsmN.js";
7
8
  import "../Icons/cfx-icons/Close.js";
@@ -186,7 +187,7 @@ function ee(e) {
186
187
  let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
187
188
  return o ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
188
189
  }
189
- var S = "Checkbox", [te, lt] = G(S), [oe, ne] = te(S), M = c.forwardRef(
190
+ var S = "Checkbox", [te, ht] = G(S), [oe, ne] = te(S), M = c.forwardRef(
190
191
  (e, t) => {
191
192
  const {
192
193
  __scopeCheckbox: o,
@@ -265,7 +266,7 @@ var I = "CheckboxIndicator", T = c.forwardRef(
265
266
  );
266
267
  T.displayName = I;
267
268
  var re = (e) => {
268
- const { control: t, checked: o, bubbles: n = !0, ...r } = e, u = c.useRef(null), p = L(o), m = j(t);
269
+ const { control: t, checked: o, bubbles: n = !0, ...r } = e, u = c.useRef(null), p = j(o), m = L(t);
269
270
  return c.useEffect(() => {
270
271
  const s = u.current, i = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(i, "checked").set;
271
272
  if (p !== o && a) {
@@ -326,7 +327,7 @@ function me(e) {
326
327
  ), a = K(e);
327
328
  return /* @__PURE__ */ _(ie, { ...i, id: t, style: { color: a }, className: d, children: /* @__PURE__ */ _(ce, { className: g(P.indicator, r), children: /* @__PURE__ */ _(W, {}) }) });
328
329
  }
329
- const ht = $.memo(me);
330
+ const Ct = $.memo(me);
330
331
  export {
331
- ht as default
332
+ Ct as default
332
333
  };
@@ -1,13 +1,16 @@
1
1
  import { default as React } from 'react';
2
+ import { IconSize } from '../Icon';
2
3
  import { InputSize } from '../Input';
3
4
  import { SelectOption } from '../Select';
5
+ import { ResponsiveValueType } from '../ui';
4
6
 
7
+ export declare const ICON_SIZE_MAP: Record<InputSize, IconSize>;
5
8
  export interface DropdownSelectProps<T = string> {
6
9
  options: SelectOption<T>[];
7
10
  value?: T;
8
11
  onChange: (value: T) => void;
9
12
  placeholder?: React.ReactNode;
10
- size?: InputSize;
13
+ size?: ResponsiveValueType<InputSize>;
11
14
  disabled?: boolean;
12
15
  fullWidth?: boolean;
13
16
  onlight?: boolean;