@cfx-dev/ui-components 4.0.1 → 4.0.2

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