gd-design-library 1.0.0 → 1.0.1
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.
- package/components/core/Breadcrumbs/BreadcrumbsStyled.js +11 -11
- package/components/core/Button/Button.js +18 -17
- package/components/domainSpecific/Carousel/Carousel.js +22 -25
- package/components/domainSpecific/ContentCarousel/ContentCarousel.js +25 -28
- package/package.json +1 -1
- package/tokens/breadcrumbs.js +11 -14
- package/tokens/button.d.ts +136 -1
- package/tokens/button.js +25 -27
- package/tokens/colors.d.ts +8 -23
- package/tokens/colors.js +10 -25
- package/tokens/defaultTheme.d.ts +144 -24
- package/tokens/draganddrop.js +30 -30
- package/tokens/index.d.ts +144 -24
- package/tokens/index.js +1 -1
- package/tokens/search.js +9 -9
- package/tokens/stepper.js +24 -24
- package/tokens/tabs.js +20 -20
- package/tokens/values.js +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as d } from "@emotion/react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { getBoxStyles as S, tokensHandler as
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { getBoxStyles as S, tokensHandler as a } from "../../../tokens/utils.js";
|
|
5
5
|
import { get as m } from "../../../utils/helpers.js";
|
|
6
|
-
const x =
|
|
6
|
+
const x = p((e, t) => {
|
|
7
7
|
const {
|
|
8
8
|
theme: {
|
|
9
9
|
breadcrumbs: s,
|
|
@@ -13,10 +13,10 @@ const x = u((e, t) => {
|
|
|
13
13
|
styles: n = {},
|
|
14
14
|
...c
|
|
15
15
|
} = e, {
|
|
16
|
-
boxStyles:
|
|
17
|
-
restProps:
|
|
18
|
-
} = S(c),
|
|
19
|
-
return /* @__PURE__ */ d("div", { css:
|
|
16
|
+
boxStyles: y,
|
|
17
|
+
restProps: u
|
|
18
|
+
} = S(c), l = new Proxy(s || {}, a(r)), b = [m(l, "default", {}), o ? m(l, "bordered", {}) : {}, y, n];
|
|
19
|
+
return /* @__PURE__ */ d("div", { css: b, ...u, ref: t });
|
|
20
20
|
}), B = (e) => {
|
|
21
21
|
const {
|
|
22
22
|
theme: {
|
|
@@ -25,7 +25,7 @@ const x = u((e, t) => {
|
|
|
25
25
|
} = {},
|
|
26
26
|
styles: r = {},
|
|
27
27
|
...o
|
|
28
|
-
} = e, n = new Proxy(t || {},
|
|
28
|
+
} = e, n = new Proxy(t || {}, a(s)), c = [m(n, "item.default", {}), r];
|
|
29
29
|
return /* @__PURE__ */ d("div", { css: c, ...o });
|
|
30
30
|
}, w = (e) => {
|
|
31
31
|
const {
|
|
@@ -35,7 +35,7 @@ const x = u((e, t) => {
|
|
|
35
35
|
} = {},
|
|
36
36
|
styles: r = {},
|
|
37
37
|
...o
|
|
38
|
-
} = e, n = new Proxy(t || {},
|
|
38
|
+
} = e, n = new Proxy(t || {}, a(s)), c = [m(n, "separator.default", {}), r];
|
|
39
39
|
return /* @__PURE__ */ d("div", { css: c, ...o });
|
|
40
40
|
}, v = (e) => {
|
|
41
41
|
const {
|
|
@@ -45,7 +45,7 @@ const x = u((e, t) => {
|
|
|
45
45
|
} = {},
|
|
46
46
|
styles: r = {},
|
|
47
47
|
...o
|
|
48
|
-
} = e, n = new Proxy(t || {},
|
|
48
|
+
} = e, n = new Proxy(t || {}, a(s)), c = [m(n, "item.itemStart", {}), r];
|
|
49
49
|
return /* @__PURE__ */ d("div", { css: c, ...o });
|
|
50
50
|
}, I = (e) => {
|
|
51
51
|
const {
|
|
@@ -55,7 +55,7 @@ const x = u((e, t) => {
|
|
|
55
55
|
} = {},
|
|
56
56
|
styles: r = {},
|
|
57
57
|
...o
|
|
58
|
-
} = e, n = new Proxy(t || {},
|
|
58
|
+
} = e, n = new Proxy(t || {}, a(s)), c = [m(n, "item.itemEnd", {}), r];
|
|
59
59
|
return /* @__PURE__ */ d("div", { css: c, ...o });
|
|
60
60
|
};
|
|
61
61
|
export {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { convertToInlineBoxStyles as
|
|
5
|
-
import { COMPONENT_NAME as
|
|
2
|
+
import { jsxs as S, jsx as o } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as $ } from "react";
|
|
4
|
+
import { convertToInlineBoxStyles as x } from "../../../tokens/utils.js";
|
|
5
|
+
import { COMPONENT_NAME as e } from "./constants.js";
|
|
6
6
|
import { ButtonStyled as T, StartIconStyled as E, ContentStyled as N, EndIconStyled as v } from "./ButtonStyled.js";
|
|
7
7
|
import { ButtonVariant as C, ButtonTypes as P, ButtonRole as j } from "../../../types/button.js";
|
|
8
8
|
import { useTheme as M } from "../../../hooks/useTheme/useTheme.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { get as O } from "../../../utils/helpers.js";
|
|
10
|
+
import { TabIndex as R } from "../../../types/accesability.js";
|
|
11
|
+
const W = $((s, m) => {
|
|
11
12
|
const {
|
|
12
|
-
theme:
|
|
13
|
+
theme: t
|
|
13
14
|
} = M(), {
|
|
14
15
|
variant: u = C.Primary,
|
|
15
|
-
rounded: c = "none",
|
|
16
|
-
children:
|
|
16
|
+
rounded: c = O(t, "button.attrs.bordered", "none"),
|
|
17
|
+
children: n,
|
|
17
18
|
iconStart: r = null,
|
|
18
19
|
iconEnd: a = null,
|
|
19
20
|
type: f = P.Button,
|
|
@@ -23,21 +24,21 @@ const R = x((s, m) => {
|
|
|
23
24
|
ariaPressed: l,
|
|
24
25
|
role: h = j.Button,
|
|
25
26
|
fullWidth: B = !1,
|
|
26
|
-
tabIndex:
|
|
27
|
-
onClick:
|
|
27
|
+
tabIndex: b = R.Default,
|
|
28
|
+
onClick: I,
|
|
28
29
|
...d
|
|
29
30
|
} = s;
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ S(T, { ref: m, $variant: u, $isIcon: y, $fullWidth: B, $rounded: c, disabled: p, onClick: I, type: f, role: h, theme: t, tabIndex: b, "data-testid": e, ...x(d), ...i ? {
|
|
31
32
|
"aria-label": i
|
|
32
33
|
} : {}, ...l ? {
|
|
33
34
|
"aria-pressed": l
|
|
34
35
|
} : {}, ...d, children: [
|
|
35
|
-
r ? /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
a ? /* @__PURE__ */
|
|
36
|
+
r ? /* @__PURE__ */ o(E, { theme: t, "data-testid": `${e}-icon-start`, children: r }) : null,
|
|
37
|
+
n ? /* @__PURE__ */ o(N, { theme: t, "data-testid": `${e}-content`, children: n }) : null,
|
|
38
|
+
a ? /* @__PURE__ */ o(v, { theme: t, "data-testid": `${e}-icon-end`, children: a }) : null
|
|
38
39
|
] });
|
|
39
40
|
});
|
|
40
|
-
|
|
41
|
+
W.displayName = e;
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
W as Button
|
|
43
44
|
};
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import { jsx as t, jsxs as S } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { Fragment as F, forwardRef as q, Children as G, isValidElement as J, cloneElement as K, useRef as Q, useImperativeHandle as U } from "react";
|
|
4
4
|
import { COMPONENT_NAME as o } from "./constants.js";
|
|
5
|
-
import { CarouselSlideStyled as B, CarouselContainerStyled as X, CarouselControlsWrapperStyled as Y, CarouselControlsStyled as Z, CarouselControlsButtonStyled as T, ContentContainerStyled as tt, CarouselViewportStyled as et, CarouselViewportSlideWrapperStyled as rt, CarouselDotsStyled as ot, CarouselDotStyled as at, CarouselThumbsStyled as nt, CarouselThumbsViewportStyled as
|
|
5
|
+
import { CarouselSlideStyled as B, CarouselContainerStyled as X, CarouselControlsWrapperStyled as Y, CarouselControlsStyled as Z, CarouselControlsButtonStyled as T, ContentContainerStyled as tt, CarouselViewportStyled as et, CarouselViewportSlideWrapperStyled as rt, CarouselDotsStyled as ot, CarouselDotStyled as at, CarouselThumbsStyled as nt, CarouselThumbsViewportStyled as lt, CarouselThumbsWrapperStyled as it, CarouselThumbStyled as st } from "./CarouselStyled.js";
|
|
6
6
|
import { useCarousel as dt } from "../../../hooks/useCarousel/useCarousel.js";
|
|
7
|
-
import { LayoutType as ct, ThumbsPosition as
|
|
7
|
+
import { LayoutType as ct, ThumbsPosition as E, CarouselVariantTypes as ut } from "../../../types/carousel.js";
|
|
8
8
|
import { Typography as R } from "../../core/Typography/Typography.js";
|
|
9
|
-
import { TypographyVariant as
|
|
9
|
+
import { TypographyVariant as j } from "../../../types/typography.js";
|
|
10
10
|
import { Image as mt } from "../../core/Image/Image.js";
|
|
11
11
|
import { useTheme as pt } from "../../../hooks/useTheme/useTheme.js";
|
|
12
|
-
import { get as
|
|
12
|
+
import { get as V } from "../../../utils/helpers.js";
|
|
13
13
|
import { TabIndex as A } from "../../../types/accesability.js";
|
|
14
14
|
import { ButtonVariant as g } from "../../../types/button.js";
|
|
15
15
|
import { Icon as I } from "../../core/Icon/Icon.js";
|
|
16
16
|
function ft(r) {
|
|
17
|
-
const
|
|
17
|
+
const i = [];
|
|
18
18
|
function s(x) {
|
|
19
19
|
return G.toArray(x).flatMap((n) => {
|
|
20
20
|
if (!J(n))
|
|
21
21
|
return [n];
|
|
22
22
|
if (n.type === ht.Image)
|
|
23
|
-
return
|
|
23
|
+
return i.push(n), [];
|
|
24
24
|
const {
|
|
25
25
|
children: d,
|
|
26
26
|
...N
|
|
@@ -34,36 +34,33 @@ function ft(r) {
|
|
|
34
34
|
}
|
|
35
35
|
const w = s(r);
|
|
36
36
|
return {
|
|
37
|
-
images:
|
|
37
|
+
images: i,
|
|
38
38
|
content: /* @__PURE__ */ t(F, { children: w })
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
const L = q(({
|
|
42
42
|
layout: r = ct.Horizontal,
|
|
43
|
-
variant:
|
|
43
|
+
variant: i = ut.Cards,
|
|
44
44
|
showArrows: s = !0,
|
|
45
45
|
isFocusable: w = !0,
|
|
46
46
|
showDots: x = !1,
|
|
47
|
-
thumbs: n =
|
|
47
|
+
thumbs: n = E.End,
|
|
48
48
|
styles: d,
|
|
49
49
|
children: N
|
|
50
50
|
}, c) => {
|
|
51
|
-
var
|
|
51
|
+
var D;
|
|
52
52
|
const {
|
|
53
53
|
theme: e
|
|
54
54
|
} = pt(), {
|
|
55
|
-
images:
|
|
55
|
+
images: l,
|
|
56
56
|
content: P
|
|
57
|
-
} = ft(N), {
|
|
58
|
-
active: u,
|
|
59
|
-
disabled: m
|
|
60
|
-
} = j(e, "colors.icon.primary"), {
|
|
57
|
+
} = ft(N), u = V(e, "colors.icon.default"), m = V(e, "colors.icon.disabled"), {
|
|
61
58
|
icons: {
|
|
62
59
|
base: p,
|
|
63
60
|
controlLeft: H,
|
|
64
61
|
controlRight: M
|
|
65
62
|
}
|
|
66
|
-
} =
|
|
63
|
+
} = V(e, "carousel"), k = Q(null), {
|
|
67
64
|
carouselRef: O,
|
|
68
65
|
carouselApi: W,
|
|
69
66
|
thumbsRef: z,
|
|
@@ -78,7 +75,7 @@ const L = q(({
|
|
|
78
75
|
options: {
|
|
79
76
|
axis: r === "vertical" ? "y" : "x"
|
|
80
77
|
},
|
|
81
|
-
targetRef:
|
|
78
|
+
targetRef: k
|
|
82
79
|
});
|
|
83
80
|
return U(c, () => ({
|
|
84
81
|
scrollPrev: C,
|
|
@@ -86,9 +83,9 @@ const L = q(({
|
|
|
86
83
|
scrollTo: h,
|
|
87
84
|
carouselApi: W,
|
|
88
85
|
selectedIndex: f
|
|
89
|
-
}), [C, y, h, f]), /* @__PURE__ */ S(X, { ref:
|
|
86
|
+
}), [C, y, h, f]), /* @__PURE__ */ S(X, { ref: k, theme: e, $layout: r, styles: d, $variant: i, tabIndex: w ? A.Default : A.Disabled, "data-testid": o, children: [
|
|
90
87
|
/* @__PURE__ */ S(Y, { "data-testid": `${o}-controls-wrapper`, theme: e, styles: {
|
|
91
|
-
order: n ===
|
|
88
|
+
order: n === E.Start ? 1 : "inherit"
|
|
92
89
|
}, children: [
|
|
93
90
|
s && /* @__PURE__ */ S(Z, { theme: e, "data-testid": `${o}-controls`, children: [
|
|
94
91
|
/* @__PURE__ */ t(T, { isIcon: !0, theme: e, variant: g.Text, onClick: C, disabled: !$, "data-testid": `${o}-control-previous`, children: /* @__PURE__ */ t(I, { ...p, name: "arrowLeft", fill: $ ? u : m }) }),
|
|
@@ -97,16 +94,16 @@ const L = q(({
|
|
|
97
94
|
}, onClick: y, disabled: !b, "data-testid": `${o}-control-next`, children: /* @__PURE__ */ t(I, { ...p, name: "arrowLeft", fill: b ? u : m }) })
|
|
98
95
|
] }),
|
|
99
96
|
/* @__PURE__ */ t(tt, { theme: e, "data-testid": `${o}-content-container`, children: P }),
|
|
100
|
-
/* @__PURE__ */ t(et, { theme: e, ref: O, "data-testid": `${o}-viewport`, children: /* @__PURE__ */ t(rt, { theme: e, "data-testid": `${o}-slider-wrapper`, children:
|
|
101
|
-
x && /* @__PURE__ */ t(ot, { theme: e, "data-testid": `${o}-dots`, children: (
|
|
97
|
+
/* @__PURE__ */ t(et, { theme: e, ref: O, "data-testid": `${o}-viewport`, children: /* @__PURE__ */ t(rt, { theme: e, "data-testid": `${o}-slider-wrapper`, children: l == null ? void 0 : l.map((v, a) => /* @__PURE__ */ t(B, { theme: e, "data-testid": `${o}-slide-${a}`, children: v }, `viewport-slide-${a}`)) }) }),
|
|
98
|
+
x && /* @__PURE__ */ t(ot, { theme: e, "data-testid": `${o}-dots`, children: (D = Array.from({
|
|
102
99
|
length: _
|
|
103
|
-
})) == null ? void 0 :
|
|
100
|
+
})) == null ? void 0 : D.map((v, a) => /* @__PURE__ */ t(at, { theme: e, $active: a === f, onClick: () => h(a) }, `dot-${a}`)) })
|
|
104
101
|
] }),
|
|
105
102
|
n && /* @__PURE__ */ S(nt, { theme: e, $layout: r, "data-testid": `${o}-thumbnails`, children: [
|
|
106
103
|
/* @__PURE__ */ t(T, { isIcon: !0, theme: e, variant: g.Text, styles: {
|
|
107
104
|
transform: `rotate(${r === "vertical" ? "90" : "0"}deg)`
|
|
108
105
|
}, onClick: C, disabled: !$, "data-testid": `${o}-thumbnail-control-previous`, children: /* @__PURE__ */ t(I, { ...p, ...H, fill: $ ? u : m }) }),
|
|
109
|
-
/* @__PURE__ */ t(
|
|
106
|
+
/* @__PURE__ */ t(lt, { theme: e, $layout: r, "data-testid": `${o}-thumbs-viewport`, ref: z, children: /* @__PURE__ */ t(it, { theme: e, $layout: r, "data-testid": `${o}-thumbs-wrapper`, children: l == null ? void 0 : l.map((v, a) => /* @__PURE__ */ t(st, { theme: e, $layout: r, $active: a === f, onClick: () => h(a), "data-testid": `${o}-thumbnail-${a}`, children: v }, `thumb-${a}`)) }) }),
|
|
110
107
|
/* @__PURE__ */ t(T, { isIcon: !0, theme: e, variant: g.Text, onClick: y, styles: {
|
|
111
108
|
transform: `rotate(${r === "vertical" ? "90" : "0"}deg)`
|
|
112
109
|
}, disabled: !b, "data-testid": `${o}-thumbnail-control-next`, children: /* @__PURE__ */ t(I, { ...p, ...M, fill: b ? u : m }) })
|
|
@@ -120,8 +117,8 @@ const ht = Object.assign(L, {
|
|
|
120
117
|
height: "100%",
|
|
121
118
|
width: "100%"
|
|
122
119
|
}, ...r }),
|
|
123
|
-
Title: (r) => /* @__PURE__ */ t(R, { variant:
|
|
124
|
-
Description: (r) => /* @__PURE__ */ t(R, { variant:
|
|
120
|
+
Title: (r) => /* @__PURE__ */ t(R, { variant: j.H1, ...r }),
|
|
121
|
+
Description: (r) => /* @__PURE__ */ t(R, { variant: j.Body1, ...r }),
|
|
125
122
|
Content: (r) => /* @__PURE__ */ t(R, { styles: {
|
|
126
123
|
flexDirection: "column",
|
|
127
124
|
height: "100%",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as n, jsx as
|
|
2
|
+
import { jsxs as n, jsx as t } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { forwardRef as P, useRef as V, useImperativeHandle as j } from "react";
|
|
4
|
-
import { CarouselContainerStyled as B, CarouselControlsWrapperStyled as E, CarouselViewportStyled as H, CarouselViewportSlideWrapperStyled as L, CarouselDotsStyled as M, CarouselDotStyled as O, CarouselControlsButtonStyled as
|
|
5
|
-
import { COMPONENT_NAME as
|
|
4
|
+
import { CarouselContainerStyled as B, CarouselControlsWrapperStyled as E, CarouselViewportStyled as H, CarouselViewportSlideWrapperStyled as L, CarouselDotsStyled as M, CarouselDotStyled as O, CarouselControlsButtonStyled as $ } from "../Carousel/CarouselStyled.js";
|
|
5
|
+
import { COMPONENT_NAME as o } from "./constants.js";
|
|
6
6
|
import { ContentSlideStyled as W, CarouselFooterStyled as _, CarouselFooterControlsStyled as z } from "./ContentCarouselStyled.js";
|
|
7
7
|
import { useTheme as q } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
-
import { get as
|
|
8
|
+
import { get as c } from "../../../utils/helpers.js";
|
|
9
9
|
import { useCarousel as G } from "../../../hooks/useCarousel/useCarousel.js";
|
|
10
|
-
import { TabIndex as
|
|
10
|
+
import { TabIndex as b } from "../../../types/accesability.js";
|
|
11
11
|
import { CarouselVariantTypes as J, LayoutType as K } from "../../../types/carousel.js";
|
|
12
|
-
import { Icon as
|
|
12
|
+
import { Icon as v } from "../../core/Icon/Icon.js";
|
|
13
13
|
const Q = P((w, I) => {
|
|
14
|
-
var
|
|
14
|
+
var h;
|
|
15
15
|
const {
|
|
16
16
|
theme: e
|
|
17
17
|
} = q(), {
|
|
@@ -21,47 +21,44 @@ const Q = P((w, I) => {
|
|
|
21
21
|
isFocusable: R = !0,
|
|
22
22
|
showDots: T = !0,
|
|
23
23
|
styles: D
|
|
24
|
-
} = w, {
|
|
25
|
-
|
|
26
|
-
disabled: p
|
|
27
|
-
} = $(e, "colors.icon.primary", {}), {
|
|
28
|
-
base: u,
|
|
24
|
+
} = w, u = c(e, "colors.icon.default"), p = c(e, "colors.icon.disabled"), {
|
|
25
|
+
base: m,
|
|
29
26
|
controlLeft: g,
|
|
30
27
|
controlRight: k
|
|
31
|
-
} =
|
|
28
|
+
} = c(e, "carousel.icons", {}), f = V(null), {
|
|
32
29
|
carouselRef: A,
|
|
33
|
-
activeIndex:
|
|
34
|
-
scrollTo:
|
|
30
|
+
activeIndex: s,
|
|
31
|
+
scrollTo: a,
|
|
35
32
|
scrollPrev: i,
|
|
36
33
|
scrollNext: d,
|
|
37
34
|
canScrollPrev: C,
|
|
38
|
-
canScrollNext:
|
|
35
|
+
canScrollNext: y,
|
|
39
36
|
slidesCount: F
|
|
40
37
|
} = G({
|
|
41
38
|
options: {
|
|
42
39
|
axis: "x"
|
|
43
40
|
},
|
|
44
|
-
targetRef:
|
|
41
|
+
targetRef: f
|
|
45
42
|
});
|
|
46
43
|
return j(I, () => ({
|
|
47
44
|
scrollPrev: i,
|
|
48
45
|
scrollNext: d,
|
|
49
|
-
scrollTo:
|
|
50
|
-
selectedIndex:
|
|
51
|
-
}), [i, d,
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */ n(_, { theme: e, "data-testid": `${
|
|
54
|
-
T && /* @__PURE__ */
|
|
46
|
+
scrollTo: a,
|
|
47
|
+
selectedIndex: s
|
|
48
|
+
}), [i, d, a, s]), /* @__PURE__ */ n(B, { ref: f, theme: e, styles: D, $layout: K.Horizontal, $variant: J.Cards, tabIndex: R ? b.Default : b.Disabled, "data-testid": o, children: [
|
|
49
|
+
/* @__PURE__ */ t(E, { "data-testid": `${o}-controls-wrapper`, theme: e, children: /* @__PURE__ */ t(H, { theme: e, ref: A, "data-testid": `${o}-viewport`, children: /* @__PURE__ */ t(L, { theme: e, "data-testid": `${o}-slider-wrapper`, children: l == null ? void 0 : l.map((S, r) => /* @__PURE__ */ t(W, { theme: e, "data-testid": `${o}-content-slide-${r}`, children: x(S, r) }, r)) }) }) }),
|
|
50
|
+
/* @__PURE__ */ n(_, { theme: e, "data-testid": `${o}-footer`, children: [
|
|
51
|
+
T && /* @__PURE__ */ t(M, { theme: e, "data-testid": `${o}-dots`, children: (h = Array.from({
|
|
55
52
|
length: F
|
|
56
|
-
})) == null ? void 0 :
|
|
57
|
-
N && /* @__PURE__ */ n(z, { theme: e, "data-testid": `${
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
53
|
+
})) == null ? void 0 : h.map((S, r) => /* @__PURE__ */ t(O, { theme: e, $active: r === s, onClick: () => a(r) }, r)) }),
|
|
54
|
+
N && /* @__PURE__ */ n(z, { theme: e, "data-testid": `${o}-controls`, children: [
|
|
55
|
+
/* @__PURE__ */ t($, { theme: e, onClick: i, disabled: !C, "data-testid": `${o}-control-previous`, children: /* @__PURE__ */ t(v, { ...m, ...g, fill: C ? u : p }) }),
|
|
56
|
+
/* @__PURE__ */ t($, { theme: e, onClick: d, disabled: !y, "data-testid": `${o}-control-next`, children: /* @__PURE__ */ t(v, { ...m, ...k, fill: y ? u : p }) })
|
|
60
57
|
] })
|
|
61
58
|
] })
|
|
62
59
|
] });
|
|
63
60
|
});
|
|
64
|
-
Q.displayName =
|
|
61
|
+
Q.displayName = o;
|
|
65
62
|
export {
|
|
66
63
|
Q as ContentCarousel
|
|
67
64
|
};
|
package/package.json
CHANGED
package/tokens/breadcrumbs.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
const
|
|
1
|
+
import { get as o } from "../utils/helpers.js";
|
|
2
|
+
const c = {
|
|
3
3
|
default: {
|
|
4
4
|
display: "flex",
|
|
5
5
|
alignItems: "center",
|
|
6
|
-
gap: (e) =>
|
|
6
|
+
gap: (e) => o(e, "spacing.sm", "theme.spacing.sm")
|
|
7
7
|
},
|
|
8
8
|
bordered: {
|
|
9
9
|
padding: (e) => {
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
const t = o(e, "spacing.md", "theme.spacing.md"), l = o(e, "spacing.lg", "theme.spacing.lg");
|
|
11
|
+
return t && l ? `${t} ${l}` : "theme.spacing.md theme.spacing.lg";
|
|
12
12
|
},
|
|
13
|
-
border: (e) => `1px solid ${
|
|
13
|
+
border: (e) => `1px solid ${o(e, "colors.border.default", "theme.colors.border.default")}`
|
|
14
14
|
},
|
|
15
15
|
item: {
|
|
16
|
+
default: {},
|
|
16
17
|
itemStart: {
|
|
17
|
-
|
|
18
|
-
color: (e) => r(e, "colors.icon.primary.default", "theme.colors.icon.primary.default")
|
|
19
|
-
}
|
|
18
|
+
color: (e) => o(e, "colors.icon.default", "theme.colors.icon.default")
|
|
20
19
|
},
|
|
21
20
|
itemEnd: {
|
|
22
|
-
|
|
23
|
-
color: (e) => r(e, "colors.icon.primary.default", "theme.colors.icon.primary.default")
|
|
24
|
-
}
|
|
21
|
+
color: (e) => o(e, "colors.icon.default", "theme.colors.icon.default")
|
|
25
22
|
}
|
|
26
23
|
},
|
|
27
24
|
separator: {
|
|
28
25
|
default: {
|
|
29
26
|
display: "flex",
|
|
30
27
|
alignItems: "center",
|
|
31
|
-
color: (e) =>
|
|
28
|
+
color: (e) => o(e, "colors.icon.default", "theme.colors.icon.default")
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
32
|
export {
|
|
36
|
-
|
|
33
|
+
c as breadcrumbs
|
|
37
34
|
};
|
package/tokens/button.d.ts
CHANGED
|
@@ -1 +1,136 @@
|
|
|
1
|
-
export declare const button:
|
|
1
|
+
export declare const button: {
|
|
2
|
+
default: {
|
|
3
|
+
border: number;
|
|
4
|
+
outline: number;
|
|
5
|
+
fontWeight: (theme: Record<symbol, unknown>) => string;
|
|
6
|
+
padding: (theme: Record<symbol, unknown>) => string;
|
|
7
|
+
display: string;
|
|
8
|
+
alignItems: string;
|
|
9
|
+
gap: (theme: Record<symbol, unknown>) => string;
|
|
10
|
+
transition: (theme: Record<symbol, unknown>) => string;
|
|
11
|
+
cursor: string;
|
|
12
|
+
'&:focus-visible': (theme: Record<symbol, unknown>) => {
|
|
13
|
+
position: string;
|
|
14
|
+
'&::after': {
|
|
15
|
+
content: string;
|
|
16
|
+
position: string;
|
|
17
|
+
top: `${number}px` | `${number}rem` | `${number}%` | `${number}em`;
|
|
18
|
+
right: `${number}px` | `${number}rem` | `${number}%` | `${number}em`;
|
|
19
|
+
bottom: `${number}px` | `${number}rem` | `${number}%` | `${number}em`;
|
|
20
|
+
left: `${number}px` | `${number}rem` | `${number}%` | `${number}em`;
|
|
21
|
+
border: string;
|
|
22
|
+
borderRadius: `${number}px` | `${number}rem` | `${number}%` | `${number}em` | undefined;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
'&:disabled, &:disabled *': {
|
|
26
|
+
cursor: string;
|
|
27
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
attrs: {
|
|
31
|
+
bordered: string;
|
|
32
|
+
};
|
|
33
|
+
icon: {
|
|
34
|
+
padding: (theme: Record<symbol, unknown>) => string;
|
|
35
|
+
'& span': {
|
|
36
|
+
display: string;
|
|
37
|
+
justifyContent: string;
|
|
38
|
+
alignItems: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
content: {
|
|
42
|
+
default: {
|
|
43
|
+
display: string;
|
|
44
|
+
justifyContent: string;
|
|
45
|
+
alignItems: string;
|
|
46
|
+
width: string;
|
|
47
|
+
minWidth: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
fullWidth: {
|
|
51
|
+
width: string;
|
|
52
|
+
};
|
|
53
|
+
startIcon: {
|
|
54
|
+
default: {};
|
|
55
|
+
};
|
|
56
|
+
endIcon: {
|
|
57
|
+
default: {};
|
|
58
|
+
};
|
|
59
|
+
primary: {
|
|
60
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
61
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
62
|
+
'&:hover': {
|
|
63
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
64
|
+
};
|
|
65
|
+
'&:active': {
|
|
66
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
67
|
+
};
|
|
68
|
+
'&:disabled': {
|
|
69
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
secondary: {
|
|
73
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
74
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
75
|
+
'&:hover': {
|
|
76
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
77
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
78
|
+
};
|
|
79
|
+
'&:active': {
|
|
80
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
81
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
82
|
+
};
|
|
83
|
+
'&:disabled': {
|
|
84
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
tertiary: {
|
|
88
|
+
background: string;
|
|
89
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
90
|
+
'&:hover': {
|
|
91
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
92
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
93
|
+
};
|
|
94
|
+
'&:active': {
|
|
95
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
96
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
97
|
+
};
|
|
98
|
+
'&:disabled': {
|
|
99
|
+
background: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
outlined: {
|
|
103
|
+
background: string;
|
|
104
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
105
|
+
border: (theme: Record<symbol, unknown>) => string;
|
|
106
|
+
'&:hover': {
|
|
107
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
108
|
+
};
|
|
109
|
+
'&:active': {
|
|
110
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
111
|
+
background: (theme: Record<symbol, unknown>) => string;
|
|
112
|
+
};
|
|
113
|
+
'&:disabled': {
|
|
114
|
+
background: string;
|
|
115
|
+
borderColor: (theme: Record<symbol, unknown>) => string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
text: {
|
|
119
|
+
background: string;
|
|
120
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
121
|
+
'&:hover': {
|
|
122
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
123
|
+
};
|
|
124
|
+
'&:active': {
|
|
125
|
+
color: (theme: Record<symbol, unknown>) => string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
inherit: {
|
|
129
|
+
fontWeight: string;
|
|
130
|
+
'&:hover': {};
|
|
131
|
+
'&:not(:disabled):active': {
|
|
132
|
+
transform: string;
|
|
133
|
+
};
|
|
134
|
+
'&:disabled': {};
|
|
135
|
+
};
|
|
136
|
+
};
|
package/tokens/button.js
CHANGED
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
import { borders as
|
|
2
|
-
import {
|
|
3
|
-
import { flexAlignItems as r, display as l } from "./display.js";
|
|
4
|
-
import { getFocusStyles as i } from "./utils.js";
|
|
1
|
+
import { borders as t } from "./borders.js";
|
|
2
|
+
import { getFocusStyles as c } from "./utils.js";
|
|
5
3
|
import { get as e } from "../utils/helpers.js";
|
|
6
|
-
const
|
|
4
|
+
const d = {
|
|
7
5
|
default: {
|
|
8
6
|
border: 0,
|
|
9
7
|
outline: 0,
|
|
10
8
|
fontWeight: (o) => e(o, "font.weight.medium", "theme.font.weight.medium"),
|
|
11
9
|
padding: (o) => {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
10
|
+
const r = e(o, "spacing.sm", "theme.spacing.sm"), l = e(o, "spacing.md", "theme.spacing.md");
|
|
11
|
+
return r && l ? `${r} ${l}` : "theme.spacing.sm theme.spacing.lg";
|
|
14
12
|
},
|
|
15
|
-
display:
|
|
16
|
-
alignItems:
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
17
15
|
gap: (o) => e(o, "spacing.sm", "theme.spacing.sm"),
|
|
18
16
|
transition: (o) => e(o, "values.transitions.button.default", "theme.values.transitions.button.default"),
|
|
19
|
-
cursor:
|
|
20
|
-
"&:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"&:focus-visible": (o) => i({
|
|
24
|
-
inset: "-6px",
|
|
25
|
-
border: s.generic({
|
|
17
|
+
cursor: "pointer",
|
|
18
|
+
"&:focus-visible": (o) => c({
|
|
19
|
+
inset: "-4px",
|
|
20
|
+
border: t.generic({
|
|
26
21
|
width: "2px",
|
|
27
22
|
color: e(o, "colors.border.focus", "theme.colors.border.focus")
|
|
28
23
|
})
|
|
29
24
|
}),
|
|
30
25
|
"&:disabled, &:disabled *": {
|
|
31
|
-
cursor:
|
|
26
|
+
cursor: "default",
|
|
32
27
|
color: (o) => e(o, "colors.text.disabled", "theme.colors.text.disabled")
|
|
33
28
|
}
|
|
34
29
|
},
|
|
30
|
+
attrs: {
|
|
31
|
+
bordered: "none"
|
|
32
|
+
},
|
|
35
33
|
icon: {
|
|
36
34
|
padding: (o) => e(o, "spacing.sm", "theme.spacing.sm"),
|
|
37
35
|
"& span": {
|
|
38
|
-
display:
|
|
39
|
-
justifyContent:
|
|
40
|
-
alignItems:
|
|
36
|
+
display: "flex",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center"
|
|
41
39
|
}
|
|
42
40
|
},
|
|
43
41
|
content: {
|
|
44
42
|
default: {
|
|
45
|
-
display:
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
display: "flex",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
alignItems: "center",
|
|
48
46
|
width: "100%",
|
|
49
47
|
minWidth: "0"
|
|
50
48
|
}
|
|
@@ -80,7 +78,7 @@ const f = {
|
|
|
80
78
|
},
|
|
81
79
|
"&:active": {
|
|
82
80
|
color: (o) => e(o, "colors.text.black", "theme.colors.text.black"),
|
|
83
|
-
background: (o) => e(o, "colors.bg.fill.secondary",
|
|
81
|
+
background: (o) => e(o, "colors.bg.fill.secondary", "theme.colors.bg.fill.secondary")
|
|
84
82
|
},
|
|
85
83
|
"&:disabled": {
|
|
86
84
|
background: (o) => e(o, "colors.bg.fill.disabled", "theme.colors.bg.fill.disabled")
|
|
@@ -104,7 +102,7 @@ const f = {
|
|
|
104
102
|
outlined: {
|
|
105
103
|
background: "transparent",
|
|
106
104
|
color: (o) => e(o, "colors.text.default", "theme.colors.text.default"),
|
|
107
|
-
border: (o) =>
|
|
105
|
+
border: (o) => t.generic({
|
|
108
106
|
width: e(o, "values.borderThin", "theme.values.borderThin"),
|
|
109
107
|
color: e(o, "colors.border.black", "theme.colors.border.black")
|
|
110
108
|
}),
|
|
@@ -124,7 +122,7 @@ const f = {
|
|
|
124
122
|
background: "transparent",
|
|
125
123
|
color: (o) => e(o, "colors.text.default", "theme.colors.text.default"),
|
|
126
124
|
"&:hover": {
|
|
127
|
-
color: (o) => e(o, "colors.text.primary
|
|
125
|
+
color: (o) => e(o, "colors.text.primary", "theme.colors.text.primary")
|
|
128
126
|
},
|
|
129
127
|
"&:active": {
|
|
130
128
|
color: (o) => e(o, "colors.text.secondary", "theme.colors.text.secondary")
|
|
@@ -140,5 +138,5 @@ const f = {
|
|
|
140
138
|
}
|
|
141
139
|
};
|
|
142
140
|
export {
|
|
143
|
-
|
|
141
|
+
d as button
|
|
144
142
|
};
|