@cfx-dev/ui-components 4.2.21 → 4.2.22

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 (79) hide show
  1. package/dist/assets/css/Badge.css +1 -1
  2. package/dist/assets/css/Link.css +1 -1
  3. package/dist/assets/general/global.css +1 -1
  4. package/dist/components/Accordion/Accordion.js +1 -1
  5. package/dist/components/Accordion/AccordionShowcase.js +1 -1
  6. package/dist/components/Avatar/AvatarShowcase.js +1 -1
  7. package/dist/components/Badge/Badge.d.ts +9 -2
  8. package/dist/components/Badge/Badge.js +52 -25
  9. package/dist/components/Badge/BadgeShowcase.js +1 -1
  10. package/dist/components/BurgerMenu/BurgerMenu.js +1 -1
  11. package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
  12. package/dist/components/Button/ButtonShowcase.js +1 -1
  13. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  14. package/dist/components/DropdownSelect/DropdownSelect.d.ts +1 -1
  15. package/dist/components/DropdownSelect/DropdownSelect.js +5 -5
  16. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
  17. package/dist/components/Icon/Icon.d.ts +1 -1
  18. package/dist/components/Icon/Icon.js +1 -1
  19. package/dist/components/IconBig/IconBig.js +1 -1
  20. package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
  21. package/dist/components/Input/Input.d.ts +1 -1
  22. package/dist/components/Input/Input.js +6 -6
  23. package/dist/components/Input/InputShowcase.js +1 -1
  24. package/dist/components/Input/RichInput.d.ts +1 -1
  25. package/dist/components/Input/RichInput.js +4 -4
  26. package/dist/components/Island/Island.js +4 -4
  27. package/dist/components/Layout/Box/Box.d.ts +1 -1
  28. package/dist/components/Layout/Box/Box.js +1 -1
  29. package/dist/components/Layout/Flex/Flex.d.ts +1 -1
  30. package/dist/components/Layout/Flex/Flex.js +1 -1
  31. package/dist/components/Layout/Flex/index.d.ts +2 -1
  32. package/dist/components/Layout/Flex/index.js +10 -4
  33. package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -1
  34. package/dist/components/Link/ButtonLink.js +23 -18
  35. package/dist/components/Link/Link.d.ts +3 -1
  36. package/dist/components/Link/Link.js +48 -30
  37. package/dist/components/Link/LinkShowcase.js +46 -41
  38. package/dist/components/Link/index.d.ts +1 -1
  39. package/dist/components/Link/index.js +6 -5
  40. package/dist/components/Logos/LogosShowcase.js +1 -1
  41. package/dist/components/Modal/Modal.js +1 -1
  42. package/dist/components/Select/Select.d.ts +1 -1
  43. package/dist/components/Select/Select.js +1 -1
  44. package/dist/components/Select/SelectShowcase.js +1 -1
  45. package/dist/components/Separator/Separator.d.ts +1 -1
  46. package/dist/components/Separator/Separator.js +1 -1
  47. package/dist/components/Shroud/Shroud.js +6 -6
  48. package/dist/components/Skeleton/Skeleton.d.ts +1 -1
  49. package/dist/components/Skeleton/Skeleton.js +1 -1
  50. package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
  51. package/dist/components/Slider/SliderShowcase.js +1 -1
  52. package/dist/components/Spacer/Spacer.d.ts +1 -1
  53. package/dist/components/Table/Table.js +1 -1
  54. package/dist/components/Table/TableShowcase.js +1 -1
  55. package/dist/components/Tabular/Tabular.d.ts +1 -1
  56. package/dist/components/Tabular/Tabular.js +1 -1
  57. package/dist/components/Tabular/TabularShowcase.js +1 -1
  58. package/dist/components/Text/Text.js +13 -12
  59. package/dist/components/Text/Text.types.d.ts +1 -1
  60. package/dist/components/Text/TextShowcase.js +12 -15
  61. package/dist/components/Text/index.d.ts +1 -1
  62. package/dist/components/Text/index.js +9 -8
  63. package/dist/components/Title/TitleShowcase.js +1 -1
  64. package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
  65. package/dist/main.d.ts +7 -6
  66. package/dist/main.js +208 -194
  67. package/dist/styles-scss/global.scss +2 -2
  68. package/dist/styles-scss/tokens.scss +0 -4
  69. package/dist/utils/color.d.ts +3 -1
  70. package/dist/utils/enum.d.ts +1 -0
  71. package/dist/utils/enum.js +6 -0
  72. package/dist/utils/ui/index.d.ts +3 -0
  73. package/dist/utils/ui/index.js +11 -0
  74. package/dist/{components → utils/ui}/ui.d.ts +2 -68
  75. package/dist/utils/ui/ui.js +68 -0
  76. package/dist/utils/ui/ui.types.d.ts +86 -0
  77. package/dist/utils/ui/ui.types.js +9 -0
  78. package/package.json +1 -1
  79. package/dist/components/ui.js +0 -73
@@ -0,0 +1,68 @@
1
+ import { clsx as d } from "../clsx.js";
2
+ var g;
3
+ ((t) => {
4
+ function i(e = 1) {
5
+ return `calc(var(--quant) * ${e})`;
6
+ }
7
+ t.q = i;
8
+ function u(e) {
9
+ return `var(--offset-${e})`;
10
+ }
11
+ t.offset = u;
12
+ function b(e = "normal") {
13
+ return `var(--font-size-${e})`;
14
+ }
15
+ t.fontSize = b;
16
+ function m(e = "first") {
17
+ return `var(--zindex-${e})`;
18
+ }
19
+ t.zindex = m;
20
+ function y(e = "normal") {
21
+ return `var(--line-height-${e})`;
22
+ }
23
+ t.lineHeight = y;
24
+ function h(e = "normal") {
25
+ return `var(--border-radius-${e})`;
26
+ }
27
+ t.borderRadius = h;
28
+ function x(e, r, o = 1) {
29
+ let n = r;
30
+ return n === "pure" && (n = ""), typeof n == "number" && (n = `${n}`), `rgba(var(--color-${e}${n ? `-${n}` : ""}), ${o})`;
31
+ }
32
+ t.color = x, ((e) => {
33
+ e.fullWidth = "util-full-width", e.fullHeight = "util-full-height", e.flexGrow = "util-flex-grow", e.flexNoShrink = "util-flex-no-shrink", e.userSelectableText = "util-text-selectable", e.zIndex9000 = "util-z-index-9000";
34
+ })(t.cls || (t.cls = {})), t.pc = (e) => `${e}%`, t.px = (e) => `${e}px`, t.ch = (e) => `${e}ch`, t.em = (e) => `${e}em`, t.rem = (e) => `${e}rem`, t.vh = (e) => `${e}vh`, t.vw = (e) => `${e}vw`, t.url = (e) => `url(${e})`;
35
+ function f(e) {
36
+ return e == null ? "" : typeof e == "number" ? i(e) : e.toString();
37
+ }
38
+ t.defaultResponsiveValueFormatter = f;
39
+ function $(e, r, o = f) {
40
+ return r == null ? {} : typeof r == "object" && !Array.isArray(r) ? Object.entries(r).reduce((n, [s, l]) => (n[`--${e}-${s}`] = o(l), n), {}) : {
41
+ [`--${e}-initial`]: o(r)
42
+ };
43
+ }
44
+ t.getResponsiveStyles = $;
45
+ function a(e, r) {
46
+ return r == null ? "" : typeof r == "object" && !Array.isArray(r) ? d(Object.keys(r).map((o) => `ui-${e}-${o}`)) : `ui-${e}-initial`;
47
+ }
48
+ t.getResponsiveClassnames = a;
49
+ function R(e, r, o = f) {
50
+ return r == null ? [] : typeof r == "object" && !Array.isArray(r) ? Object.entries(r).reduce((n, [s, l]) => (n.push(`${e}-${s}-${o(l)}`), n), []) : [`${e}-initial-${o(r)}`];
51
+ }
52
+ t.getResponsiveFlatClassnames = R;
53
+ function c(e) {
54
+ return typeof e == "number" ? i(e) : u(e);
55
+ }
56
+ t.offsetResponsiveValueFormatter = c, t.getOffsetStyles = (e, r) => $(e, r, c);
57
+ function p(e, r) {
58
+ return Object.entries(e).reduce((o, [n, s]) => (Object.assign(o, r(n, s)), o), {});
59
+ }
60
+ t.callAllMPProps = p, t.getAllMPStyles = (e) => p(e, t.getOffsetStyles), t.getAllMPClassnames = (e) => d(
61
+ Object.entries(e).map(
62
+ ([r, o]) => a(r, o)
63
+ )
64
+ );
65
+ })(g || (g = {}));
66
+ export {
67
+ g as ui
68
+ };
@@ -0,0 +1,86 @@
1
+ export declare enum ColorEnum {
2
+ accent = "accent",
3
+ primary = "primary",
4
+ secondary = "secondary",
5
+ tertiary = "tertiary",
6
+ green = "green",
7
+ yellow = "yellow",
8
+ red = "red",
9
+ argentum = "argentum",
10
+ aurum = "aurum",
11
+ platinum = "platinum",
12
+ bg = "bg",
13
+ 'bg-light' = "bg-light",
14
+ 'bg-dark' = "bg-dark",
15
+ 'bg-dark-grey' = "bg-dark-grey",
16
+ 'bg-black' = "bg-black"
17
+ }
18
+ export type ColorType = keyof typeof ColorEnum;
19
+ export declare enum TextSizeEnum {
20
+ xxsmall = "xxsmall",
21
+ xsmall = "xsmall",
22
+ small = "small",
23
+ normal = "normal",
24
+ medium = "medium",
25
+ large = "large",
26
+ xlarge = "xlarge",
27
+ xxlarge = "xxlarge",
28
+ xxxlarge = "xxxlarge"
29
+ }
30
+ export type TextSize = keyof typeof TextSizeEnum;
31
+ export declare enum BorderRadiusEnum {
32
+ none = "none",
33
+ xxsmall = "xxsmall",
34
+ xsmall = "xsmall",
35
+ small = "small",
36
+ normal = "normal",
37
+ pill = "pill"
38
+ }
39
+ export type BorderRadiusType = keyof typeof BorderRadiusEnum;
40
+ export declare enum ZIndexEnum {
41
+ zero = "zero",
42
+ first = "first",
43
+ second = "second",
44
+ max = "max"
45
+ }
46
+ export type ZIndexType = keyof typeof ZIndexEnum;
47
+ export declare enum OffsetEnum {
48
+ none = "none",
49
+ hairthin = "hairthin",
50
+ thin = "thin",
51
+ xxsmall = "xxsmall",
52
+ xsmall = "xsmall",
53
+ small = "small",
54
+ normal = "normal",
55
+ medium = "medium",
56
+ large = "large",
57
+ xlarge = "xlarge",
58
+ safezone = "safezone"
59
+ }
60
+ export type OffsetType = keyof typeof OffsetEnum;
61
+ export declare enum MediaQueryEnum {
62
+ initial = "initial",
63
+ small = "small",
64
+ 'small-medium' = "small-medium",
65
+ medium = "medium",
66
+ 'medium-large' = "medium-large",
67
+ large = "large",
68
+ xlarge = "xlarge"
69
+ }
70
+ export type MediaQueryType = keyof typeof MediaQueryEnum;
71
+ export type ResponsiveValueType<T = string | number> = T | {
72
+ [key in MediaQueryType]?: T;
73
+ };
74
+ export type ResponsiveOffsetType = ResponsiveValueType<OffsetType | number>;
75
+ export interface MPProps {
76
+ m?: ResponsiveOffsetType;
77
+ mt?: ResponsiveOffsetType;
78
+ mr?: ResponsiveOffsetType;
79
+ mb?: ResponsiveOffsetType;
80
+ ml?: ResponsiveOffsetType;
81
+ p?: ResponsiveOffsetType;
82
+ pt?: ResponsiveOffsetType;
83
+ pr?: ResponsiveOffsetType;
84
+ pb?: ResponsiveOffsetType;
85
+ pl?: ResponsiveOffsetType;
86
+ }
@@ -0,0 +1,9 @@
1
+ var a = /* @__PURE__ */ ((l) => (l.accent = "accent", l.primary = "primary", l.secondary = "secondary", l.tertiary = "tertiary", l.green = "green", l.yellow = "yellow", l.red = "red", l.argentum = "argentum", l.aurum = "aurum", l.platinum = "platinum", l.bg = "bg", l["bg-light"] = "bg-light", l["bg-dark"] = "bg-dark", l["bg-dark-grey"] = "bg-dark-grey", l["bg-black"] = "bg-black", l))(a || {}), r = /* @__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))(r || {}), g = /* @__PURE__ */ ((l) => (l.none = "none", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.pill = "pill", l))(g || {}), x = /* @__PURE__ */ ((l) => (l.zero = "zero", l.first = "first", l.second = "second", l.max = "max", l))(x || {}), e = /* @__PURE__ */ ((l) => (l.none = "none", l.hairthin = "hairthin", l.thin = "thin", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.safezone = "safezone", l))(e || {}), i = /* @__PURE__ */ ((l) => (l.initial = "initial", l.small = "small", l["small-medium"] = "small-medium", l.medium = "medium", l["medium-large"] = "medium-large", l.large = "large", l.xlarge = "xlarge", l))(i || {});
2
+ export {
3
+ g as BorderRadiusEnum,
4
+ a as ColorEnum,
5
+ i as MediaQueryEnum,
6
+ e as OffsetEnum,
7
+ r as TextSizeEnum,
8
+ x as ZIndexEnum
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "4.2.21",
4
+ "version": "4.2.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",
@@ -1,73 +0,0 @@
1
- import { clsx as $ } from "../utils/clsx.js";
2
- var j = /* @__PURE__ */ ((r) => (r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.medium = "medium", r.large = "large", r.xlarge = "xlarge", r.xxlarge = "xxlarge", r.xxxlarge = "xxxlarge", r))(j || {}), R = /* @__PURE__ */ ((r) => (r.none = "none", r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.pill = "pill", r))(R || {}), u = /* @__PURE__ */ ((r) => (r.zero = "zero", r.first = "first", r.second = "second", r.max = "max", r))(u || {}), F = /* @__PURE__ */ ((r) => (r.none = "none", r.hairthin = "hairthin", r.thin = "thin", r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.medium = "medium", r.large = "large", r.xlarge = "xlarge", r.safezone = "safezone", r))(F || {}), P = /* @__PURE__ */ ((r) => (r.initial = "initial", r.small = "small", r["small-medium"] = "small-medium", r.medium = "medium", r["medium-large"] = "medium-large", r.large = "large", r.xlarge = "xlarge", r))(P || {}), p;
3
- ((r) => {
4
- function s(e = 1) {
5
- return `calc(var(--quant) * ${e})`;
6
- }
7
- r.q = s;
8
- function f(e) {
9
- return `var(--offset-${e})`;
10
- }
11
- r.offset = f;
12
- function h(e = "normal") {
13
- return `var(--font-size-${e})`;
14
- }
15
- r.fontSize = h;
16
- function b(e = "first") {
17
- return `var(--zindex-${e})`;
18
- }
19
- r.zindex = b;
20
- function d(e = "normal") {
21
- return `var(--line-height-${e})`;
22
- }
23
- r.lineHeight = d;
24
- function v(e = "normal") {
25
- return `var(--border-radius-${e})`;
26
- }
27
- r.borderRadius = v;
28
- function y(e, l, n = 1) {
29
- let t = l;
30
- return t === "pure" && (t = ""), typeof t == "number" && (t = `${t}`), `rgba(var(--color-${e}${t ? `-${t}` : ""}), ${n})`;
31
- }
32
- r.color = y, ((e) => {
33
- e.fullWidth = "util-full-width", e.fullHeight = "util-full-height", e.flexGrow = "util-flex-grow", e.flexNoShrink = "util-flex-no-shrink", e.userSelectableText = "util-text-selectable", e.zIndex9000 = "util-z-index-9000";
34
- })(r.cls || (r.cls = {})), r.pc = (e) => `${e}%`, r.px = (e) => `${e}px`, r.ch = (e) => `${e}ch`, r.em = (e) => `${e}em`, r.rem = (e) => `${e}rem`, r.vh = (e) => `${e}vh`, r.vw = (e) => `${e}vw`, r.url = (e) => `url(${e})`;
35
- function a(e) {
36
- return e == null ? "" : typeof e == "number" ? s(e) : e.toString();
37
- }
38
- r.defaultResponsiveValueFormatter = a;
39
- function x(e, l, n = a) {
40
- return l == null ? {} : typeof l == "object" && !Array.isArray(l) ? Object.entries(l).reduce((t, [o, i]) => (t[`--${e}-${o}`] = n(i), t), {}) : {
41
- [`--${e}-initial`]: n(l)
42
- };
43
- }
44
- r.getResponsiveStyles = x;
45
- function g(e, l) {
46
- return l == null ? "" : typeof l == "object" && !Array.isArray(l) ? $(Object.keys(l).map((n) => `ui-${e}-${n}`)) : `ui-${e}-initial`;
47
- }
48
- r.getResponsiveClassnames = g;
49
- function A(e, l, n = a) {
50
- return l == null ? [] : typeof l == "object" && !Array.isArray(l) ? Object.entries(l).reduce((t, [o, i]) => (t.push(`${e}-${o}-${n(i)}`), t), []) : [`${e}-initial-${n(l)}`];
51
- }
52
- r.getResponsiveFlatClassnames = A;
53
- function m(e) {
54
- return typeof e == "number" ? s(e) : f(e);
55
- }
56
- r.offsetResponsiveValueFormatter = m, r.getOffsetStyles = (e, l) => x(e, l, m);
57
- function c(e, l) {
58
- return Object.entries(e).reduce((n, [t, o]) => (Object.assign(n, l(t, o)), n), {});
59
- }
60
- r.callAllMPProps = c, r.getAllMPStyles = (e) => c(e, r.getOffsetStyles), r.getAllMPClassnames = (e) => $(
61
- Object.entries(e).map(
62
- ([l, n]) => g(l, n)
63
- )
64
- );
65
- })(p || (p = {}));
66
- export {
67
- R as BorderRadiusEnum,
68
- P as MediaQueryEnum,
69
- F as OffsetEnum,
70
- j as TextSizeEnum,
71
- u as ZIndexEnum,
72
- p as ui
73
- };