@cfx-dev/ui-components 2.0.10 → 2.1.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.
@@ -1,29 +1,64 @@
1
- var l;
2
- ((e) => {
3
- function n(r = 1) {
1
+ var z = /* @__PURE__ */ ((t) => (t.none = "none", t.hairthin = "hairthin", t.thin = "thin", t.xxsmall = "xxsmall", t.xsmall = "xsmall", t.small = "small", t.normal = "normal", t.medium = "medium", t.large = "large", t.xlarge = "xlarge", t.safezone = "safezone", t))(z || {}), A = /* @__PURE__ */ ((t) => (t.initial = "initial", t.xxsmall = "xxsmall", t.xsmall = "xsmall", t.small = "small", t.medium = "medium", t.large = "large", t.xlarge = "xlarge", t))(A || {}), d;
2
+ ((t) => {
3
+ function i(r = 1) {
4
4
  return `calc(var(--quant) * ${r})`;
5
5
  }
6
- e.q = n;
7
- function o(r) {
6
+ t.q = i;
7
+ function s(r) {
8
8
  return `var(--offset-${r})`;
9
9
  }
10
- e.offset = o;
11
- function f(r = "normal") {
10
+ t.offset = s;
11
+ function u(r = "normal") {
12
12
  return `var(--font-size-${r})`;
13
13
  }
14
- e.fontSize = f;
15
- function a(r = "normal") {
14
+ t.fontSize = u;
15
+ function S(r = "normal") {
16
16
  return `var(--border-radius-${r})`;
17
17
  }
18
- e.borderRadius = a;
19
- function $(r, u, i = 1) {
20
- let t = u;
21
- return t === "pure" && (t = ""), typeof t == "number" && (t = `${t}`), `rgba(var(--color-${r}${t ? `-${t}` : ""}), ${i})`;
18
+ t.borderRadius = S;
19
+ function b(r, l, n = 1) {
20
+ let e = l;
21
+ return e === "pure" && (e = ""), typeof e == "number" && (e = `${e}`), `rgba(var(--color-${r}${e ? `-${e}` : ""}), ${n})`;
22
22
  }
23
- e.color = $, ((r) => {
23
+ t.color = b, ((r) => {
24
24
  r.fullWidth = "util-full-width", r.fullHeight = "util-full-height", r.flexGrow = "util-flex-grow", r.flexNoShrink = "util-flex-no-shrink", r.userSelectableText = "util-text-selectable", r.zIndex9000 = "util-z-index-9000";
25
- })(e.cls || (e.cls = {})), e.pc = (r) => `${r}%`, e.px = (r) => `${r}px`, e.ch = (r) => `${r}ch`, e.em = (r) => `${r}em`, e.rem = (r) => `${r}rem`, e.vh = (r) => `${r}vh`, e.vw = (r) => `${r}vw`, e.url = (r) => `url(${r})`;
26
- })(l || (l = {}));
25
+ })(t.cls || (t.cls = {})), t.pc = (r) => `${r}%`, t.px = (r) => `${r}px`, t.ch = (r) => `${r}ch`, t.em = (r) => `${r}em`, t.rem = (r) => `${r}rem`, t.vh = (r) => `${r}vh`, t.vw = (r) => `${r}vw`, t.url = (r) => `url(${r})`, t.getOffsetAttrs = (r, l) => typeof l == "string" || typeof l == "number" ? {
26
+ [`data-${r}-initial`]: l.toString()
27
+ } : Object.entries(l).reduce((n, [e, o]) => (n[`data-${r}-${e}`] = o.toString(), n), {}), t.getOffsetStyles = (r, l) => typeof l == "string" ? {
28
+ [`--${r}-initial`]: s(l)
29
+ } : typeof l == "number" ? {
30
+ [`--${r}-initial`]: i(l)
31
+ } : Object.entries(l).reduce((n, [e, o]) => (n[`--${r}-${e}`] = typeof o == "number" ? i(o) : s(o), n), {});
32
+ function x(r, l) {
33
+ const {
34
+ m: n,
35
+ mt: e,
36
+ mr: o,
37
+ mb: f,
38
+ ml: $,
39
+ p: m,
40
+ pt: p,
41
+ pr: g,
42
+ pb: a,
43
+ pl: h
44
+ } = r;
45
+ return {
46
+ ...n ? l("m", n) : null,
47
+ ...e ? l("mt", e) : null,
48
+ ...o ? l("mr", o) : null,
49
+ ...f ? l("mb", f) : null,
50
+ ...$ ? l("ml", $) : null,
51
+ ...m ? l("p", m) : null,
52
+ ...p ? l("pt", p) : null,
53
+ ...g ? l("pr", g) : null,
54
+ ...a ? l("pb", a) : null,
55
+ ...h ? l("pl", h) : null
56
+ };
57
+ }
58
+ t.callAllMPProps = x, t.getAllMPStyles = (r) => x(r, t.getOffsetStyles), t.getAllMPAttrs = (r) => x(r, t.getOffsetAttrs);
59
+ })(d || (d = {}));
27
60
  export {
28
- l as ui
61
+ A as MediaQueryEnum,
62
+ z as OffsetEnum,
63
+ d as ui
29
64
  };
@@ -23,6 +23,7 @@ body {
23
23
  @include button-tokens;
24
24
  @include badge-tokens;
25
25
  @include accordion-tokens;
26
+ @include mp-tokens;
26
27
 
27
28
  // initiat fonts
28
29
  @include font-HelveticaNow;
@@ -2,6 +2,31 @@
2
2
  @use "ui";
3
3
  @import "ui";
4
4
 
5
+ $mpMap: (
6
+ m: margin,
7
+ mt: margin-top,
8
+ mr: margin-right,
9
+ mb: margin-bottom,
10
+ ml: margin-left,
11
+ p: padding,
12
+ pt: padding-top,
13
+ pr: padding-right,
14
+ pb: padding-bottom,
15
+ pl: padding-left,
16
+ );
17
+
18
+ @mixin mp-tokens() {
19
+ @each $name, $value in $mediaMap {
20
+ @include media-min($name) {
21
+ @each $mpName, $mpProp in $mpMap {
22
+ [data-#{$mpName}-#{$name}] {
23
+ #{$mpProp}: var(--#{$mpName}-#{$name});
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+
5
30
  @mixin border-radius-tokens() {
6
31
  @include ui.def('border-radius-none', 0);
7
32
  @include ui.def('border-radius-xxsmall', ui.q(.25));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "2.0.10",
4
+ "version": "2.1.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",