@cfx-dev/ui-components 5.0.32 → 5.0.34

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,27 +1,27 @@
1
- import { jsxs as N, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as s } from "react/jsx-runtime";
2
2
  import H, { useMemo as J, useState as K, useCallback as Q, useEffect as L } from "react";
3
3
  import { Dot as O } from "../Dot/Dot.js";
4
- import u from "../Flex/Flex.js";
5
- import { clsx as h } from "../../utils/clsx.js";
4
+ import i from "../Flex/Flex.js";
5
+ import { clsx as m } from "../../utils/clsx.js";
6
6
  import "../../utils/contexts/MediaQueryContext/MediaQueryContext.js";
7
7
  import "../../utils/contexts/MediaQueryContext/MediaQueryContextProvider.js";
8
8
  import U from "../../utils/contexts/MediaQueryContext/useMediaQuery.js";
9
9
  import { useCarousel as W } from "../../utils/hooks/useCarousel.js";
10
- import { s as i, C as X } from "../../CarouselControls-CJ3tupLr.js";
10
+ import { s as n, C as X } from "../../CarouselControls-Be1j-jxr.js";
11
11
  import Y from "./CarouselItem.js";
12
12
  function R({
13
- showDots: n = !1,
14
- pageCount: a,
13
+ showDots: a = !1,
14
+ pageCount: f,
15
15
  currentPage: t,
16
16
  onPageChange: o,
17
- controlsClassName: m,
18
- controlsRootClassName: d
17
+ controlsClassName: d,
18
+ controlsRootClassName: p
19
19
  }) {
20
- return a <= 1 ? null : /* @__PURE__ */ N(u, { gap: 2, centered: !0, className: h(i.controls, d), children: [
21
- n && /* @__PURE__ */ s(u, { centered: !0, gap: 1, children: Array.from({ length: a }).map((p, c) => /* @__PURE__ */ s(
20
+ return f <= 1 ? null : /* @__PURE__ */ h(i, { gap: 2, centered: !0, className: m(n.controls, p), children: [
21
+ a && /* @__PURE__ */ s(i, { centered: !0, gap: 1, children: Array.from({ length: f }).map((y, c) => /* @__PURE__ */ s(
22
22
  O,
23
23
  {
24
- className: i.dots,
24
+ className: n.dots,
25
25
  color: c === t ? "primary" : "secondary",
26
26
  opacity: c === t ? 1 : 0.2
27
27
  },
@@ -31,21 +31,21 @@ function R({
31
31
  X,
32
32
  {
33
33
  currentPage: t,
34
- pageCount: a,
34
+ pageCount: f,
35
35
  onPageChange: o,
36
- className: m
36
+ className: d
37
37
  }
38
38
  )
39
39
  ] });
40
40
  }
41
41
  function Z({
42
- items: n,
43
- ImageComponent: a,
42
+ items: a,
43
+ ImageComponent: f,
44
44
  visibleItems: t = 4,
45
45
  onItemClick: o,
46
- showControlsBottom: m = !1,
47
- showControlsTop: d = !1,
48
- skipFirstItem: p = !1,
46
+ showControlsBottom: d = !1,
47
+ showControlsTop: p = !1,
48
+ skipFirstItem: y = !1,
49
49
  controlsClassName: c,
50
50
  controlsRootClassName: S,
51
51
  text: x,
@@ -54,22 +54,22 @@ function Z({
54
54
  className: $,
55
55
  rootClassName: q,
56
56
  headerClassName: w,
57
- currentPage: y,
57
+ currentPage: N,
58
58
  onPageChange: l
59
59
  }) {
60
60
  const {
61
61
  isMobile: T,
62
62
  isTablet: j
63
- } = U(), _ = J(() => typeof t == "number" ? t : T ? t.mobile : j ? t.tablet : t.desktop, [t, T, j]), z = p ? n.slice(1) : n, b = Math.ceil(z.length / _), {
63
+ } = U(), _ = J(() => typeof t == "number" ? t : T ? t.mobile : j ? t.tablet : t.desktop, [t, T, j]), z = y ? a.slice(1) : a, b = Math.ceil(z.length / _), {
64
64
  carouselRef: A,
65
65
  carouselApi: e
66
66
  } = W({
67
67
  slidesToScroll: _
68
- }), [D, B] = K(0), E = y ?? D, F = Q(
68
+ }), [D, B] = K(0), E = N ?? D, F = Q(
69
69
  (r) => {
70
- e == null || e.scrollTo(r), l == null || l(r), y == null && B(r);
70
+ e == null || e.scrollTo(r), l == null || l(r), N == null && B(r);
71
71
  },
72
- [e, l, y]
72
+ [e, l, N]
73
73
  ), G = Q(
74
74
  (r) => {
75
75
  o == null || o(r);
@@ -80,16 +80,16 @@ function Z({
80
80
  if (!e)
81
81
  return;
82
82
  const r = () => {
83
- const f = e.selectedScrollSnap();
84
- B(f), l == null || l(f);
83
+ const u = e.selectedScrollSnap();
84
+ B(u), l == null || l(u);
85
85
  };
86
86
  return e.on("select", r), e.on("reInit", r), () => {
87
87
  e.off("select", r), e.off("reInit", r);
88
88
  };
89
- }, [e, l]), /* @__PURE__ */ N("div", { className: q, children: [
90
- x && /* @__PURE__ */ N(u, { spaceBetween: !0, alignItems: "center", className: w, children: [
89
+ }, [e, l]), /* @__PURE__ */ h("div", { className: m(n.root, q), children: [
90
+ x && /* @__PURE__ */ h(i, { spaceBetween: !0, alignItems: "center", className: w, children: [
91
91
  /* @__PURE__ */ s("span", { children: x }),
92
- d && /* @__PURE__ */ s(
92
+ p && /* @__PURE__ */ s(
93
93
  R,
94
94
  {
95
95
  showDots: M,
@@ -101,16 +101,16 @@ function Z({
101
101
  }
102
102
  )
103
103
  ] }),
104
- /* @__PURE__ */ s("div", { className: h(i.carousel, $), ref: A, children: /* @__PURE__ */ s(u, { className: h(i.carouselTrack, V), gap: 1, children: n.map((r, f) => f === 0 && p ? null : /* @__PURE__ */ s("div", { className: i.carouselItem, children: /* @__PURE__ */ s(
104
+ /* @__PURE__ */ s("div", { className: m(n.carousel, $), ref: A, children: /* @__PURE__ */ s(i, { className: m(n.carouselTrack, V), gap: 1, children: a.map((r, u) => u === 0 && y ? null : /* @__PURE__ */ s("div", { className: n.carouselItem, children: /* @__PURE__ */ s(
105
105
  Y,
106
106
  {
107
- index: f,
107
+ index: u,
108
108
  item: r,
109
109
  onClick: G,
110
- ImageComponent: a
110
+ ImageComponent: f
111
111
  }
112
112
  ) }, r.id)) }) }),
113
- m && /* @__PURE__ */ s(u, { justifyContent: "flex-end", children: /* @__PURE__ */ s(
113
+ d && /* @__PURE__ */ s(i, { justifyContent: "flex-end", children: /* @__PURE__ */ s(
114
114
  R,
115
115
  {
116
116
  showDots: M,
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../Flex/Flex.js";
3
3
  import "../../utils/clsx.js";
4
4
  import "../IconButton/IconButton.js";
5
- import { C as a } from "../../CarouselControls-CJ3tupLr.js";
5
+ import { C as a } from "../../CarouselControls-Be1j-jxr.js";
6
6
  export {
7
7
  a as default
8
8
  };
@@ -2,7 +2,7 @@ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as d, useCallback as r } from "react";
3
3
  import l from "../Flex/Flex.js";
4
4
  import u from "./Carousel.js";
5
- import { s as c } from "../../CarouselControls-CJ3tupLr.js";
5
+ import { s as c } from "../../CarouselControls-Be1j-jxr.js";
6
6
  const g = [
7
7
  {
8
8
  id: "1",
@@ -1,5 +1,5 @@
1
1
  import { default as a } from "./Carousel.js";
2
- import { C as s } from "../../CarouselControls-CJ3tupLr.js";
2
+ import { C as s } from "../../CarouselControls-Be1j-jxr.js";
3
3
  export {
4
4
  a as Carousel,
5
5
  s as CarouselControls
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { D as a } from "../../DropdownContent-DCqFWnzj.js";
2
+ import { D as a } from "../../DropdownContent-Cxs3Wve5.js";
3
3
  import "react";
4
4
  import "../../utils/clsx.js";
5
5
  import "../../utils/ui/ui.js";
@@ -1,4 +1,4 @@
1
- import { D as r } from "../../DropdownContent-DCqFWnzj.js";
1
+ import { D as r } from "../../DropdownContent-Cxs3Wve5.js";
2
2
  export {
3
3
  r as DropdownContent
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { R as m, T as c, D as f } from "../../DropdownContent-DCqFWnzj.js";
2
+ import { R as m, T as c, D as f } from "../../DropdownContent-Cxs3Wve5.js";
3
3
  import p from "react";
4
4
  function u(t) {
5
5
  const {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import { R as D, T as W, D as C } from "../../DropdownContent-DCqFWnzj.js";
2
+ import { R as D, T as W, D as C } from "../../DropdownContent-Cxs3Wve5.js";
3
3
  import a, { useRef as R, useState as v, useEffect as b } from "react";
4
4
  import N from "../Flex/Flex.js";
5
5
  import { clsx as T } from "../../utils/clsx.js";
package/dist/main.js CHANGED
@@ -46,7 +46,7 @@ import { Avatar as Do } from "./components/Avatar/Avatar.js";
46
46
  import { BACKDROP_OUTLET_ID as Oo, default as ko } from "./components/BackdropPortal/BackdropPortal.js";
47
47
  import { Badge as bo } from "./components/Badge/Badge.js";
48
48
  import { default as Mo } from "./components/Carousel/Carousel.js";
49
- import { C as vo } from "./CarouselControls-CJ3tupLr.js";
49
+ import { C as vo } from "./CarouselControls-Be1j-jxr.js";
50
50
  import { default as Uo } from "./components/ControlBox/ControlBox.js";
51
51
  import { default as wo } from "./components/Decorate/Decorate.js";
52
52
  import { Dot as Ko } from "./components/Dot/Dot.js";
@@ -443,6 +443,10 @@ $zindexMap: (
443
443
  'second': 2,
444
444
  'flyout': 1000,
445
445
  'max': 9000,
446
+ // Select's content should be above everything except Title
447
+ 'select': 9099,
448
+ // Titles must be above everything
449
+ 'title': 9100,
446
450
  );
447
451
 
448
452
  @function zindex($index) {
@@ -51,7 +51,9 @@ export declare enum ZIndexEnum {
51
51
  zero = "zero",
52
52
  first = "first",
53
53
  second = "second",
54
- max = "max"
54
+ max = "max",
55
+ select = "select",
56
+ title = "title"
55
57
  }
56
58
  export type ZIndexType = keyof typeof ZIndexEnum;
57
59
  export type ResponsiveValueType<T = string | number> = T | {
@@ -1,5 +1,5 @@
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 || {}), x = /* @__PURE__ */ ((l) => (l.xxxsmall = "xxxsmall", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l.xxxxlarge = "xxxxlarge", l))(x || {}), s = /* @__PURE__ */ ((l) => (l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l))(s || {}), r = /* @__PURE__ */ ((l) => (l.none = "none", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.pill = "pill", l))(r || {}), g = /* @__PURE__ */ ((l) => (l.zero = "zero", l.first = "first", l.second = "second", l.max = "max", l))(g || {}), 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 || {}), p = /* @__PURE__ */ ((l) => (l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l.xxxxlarge = "xxxxlarge", l.xxxxxlarge = "xxxxxlarge", l))(p || {}), t = /* @__PURE__ */ ((l) => (l.sp25 = "sp25", l.sp100 = "sp100", l.sp110 = "sp110", l.sp150 = "sp150", l.sp175 = "sp175", l.sp200 = "sp200", l.sp250 = "sp250", l.sp300 = "sp300", l.sp400 = "sp400", l.sp450 = "sp450", l.sp600 = "sp600", l.sp700 = "sp700", l.sp800 = "sp800", l.sp900 = "sp900", l.sp1000 = "sp1000", l.sp1200 = "sp1200", l.sp1600 = "sp1600", l.sp2400 = "sp2400", l))(t || {}), b = /* @__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))(b || {});
2
- const d = {
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 || {}), x = /* @__PURE__ */ ((l) => (l.xxxsmall = "xxxsmall", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l.xxxxlarge = "xxxxlarge", l))(x || {}), s = /* @__PURE__ */ ((l) => (l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l))(s || {}), r = /* @__PURE__ */ ((l) => (l.none = "none", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.pill = "pill", l))(r || {}), e = /* @__PURE__ */ ((l) => (l.zero = "zero", l.first = "first", l.second = "second", l.max = "max", l.select = "select", l.title = "title", l))(e || {}), g = /* @__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))(g || {}), t = /* @__PURE__ */ ((l) => (l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l.xxxxlarge = "xxxxlarge", l.xxxxxlarge = "xxxxxlarge", l))(t || {}), p = /* @__PURE__ */ ((l) => (l.sp25 = "sp25", l.sp100 = "sp100", l.sp110 = "sp110", l.sp150 = "sp150", l.sp175 = "sp175", l.sp200 = "sp200", l.sp250 = "sp250", l.sp300 = "sp300", l.sp400 = "sp400", l.sp450 = "sp450", l.sp600 = "sp600", l.sp700 = "sp700", l.sp800 = "sp800", l.sp900 = "sp900", l.sp1000 = "sp1000", l.sp1200 = "sp1200", l.sp1600 = "sp1600", l.sp2400 = "sp2400", l))(p || {}), b = /* @__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))(b || {});
2
+ const v = {
3
3
  initial: 0,
4
4
  small: 360,
5
5
  "small-medium": 640,
@@ -13,10 +13,10 @@ export {
13
13
  a as ColorEnum,
14
14
  s as IconSizeEnum,
15
15
  b as MediaQueryEnum,
16
- d as MediaQueryValuesMap,
17
- e as OffsetEnum,
18
- p as SpacerEnum,
19
- t as SpacingEnum,
16
+ v as MediaQueryValuesMap,
17
+ g as OffsetEnum,
18
+ t as SpacerEnum,
19
+ p as SpacingEnum,
20
20
  x as TextSizeEnum,
21
- g as ZIndexEnum
21
+ e as ZIndexEnum
22
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
- "version": "5.0.32",
3
+ "version": "5.0.34",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/main.js",
@@ -1,41 +0,0 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import _ from "./components/Flex/Flex.js";
3
- import { clsx as t } from "./utils/clsx.js";
4
- import c from "./components/IconButton/IconButton.js";
5
- const u = "cfxui__Carousel__carousel__5a3d0", i = "cfxui__Carousel__carouselItem__39b03", n = "cfxui__Carousel__carouselTrack__bda11", m = "cfxui__Carousel__controls__afa33", f = {
6
- carousel: u,
7
- carouselItem: i,
8
- carouselTrack: n,
9
- controls: m
10
- };
11
- function p({
12
- currentPage: o,
13
- pageCount: l,
14
- onPageChange: s,
15
- className: e
16
- }) {
17
- return /* @__PURE__ */ a(_, { alignToEnd: !0, className: t(f.controls, e), children: [
18
- /* @__PURE__ */ r(
19
- c,
20
- {
21
- onClick: () => s(o - 1),
22
- disabled: o <= 0,
23
- name: "LeftChevron",
24
- size: "medium"
25
- }
26
- ),
27
- /* @__PURE__ */ r(
28
- c,
29
- {
30
- onClick: () => s(o + 1),
31
- disabled: o >= l - 1,
32
- name: "RightChevron",
33
- size: "medium"
34
- }
35
- )
36
- ] });
37
- }
38
- export {
39
- p as C,
40
- f as s
41
- };