@clubmed/trident-ui 1.0.0-beta.13 → 1.0.0-beta.15
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/fonts/Actions/tui-actions.css +6 -6
- package/fonts/Actions/tui-actions.eot +0 -0
- package/fonts/Actions/tui-actions.less +6 -6
- package/fonts/Actions/tui-actions.module.less +6 -6
- package/fonts/Actions/tui-actions.scss +6 -6
- package/fonts/Actions/tui-actions.styl +6 -6
- package/fonts/Actions/tui-actions.ttf +0 -0
- package/fonts/Actions/tui-actions.woff +0 -0
- package/fonts/Actions/tui-actions.woff2 +0 -0
- package/fonts/Activities/tui-activities.css +6 -6
- package/fonts/Activities/tui-activities.eot +0 -0
- package/fonts/Activities/tui-activities.less +6 -6
- package/fonts/Activities/tui-activities.module.less +6 -6
- package/fonts/Activities/tui-activities.scss +6 -6
- package/fonts/Activities/tui-activities.styl +6 -6
- package/fonts/Activities/tui-activities.ttf +0 -0
- package/fonts/Activities/tui-activities.woff +0 -0
- package/fonts/Activities/tui-activities.woff2 +0 -0
- package/fonts/Brand/tui-brand.css +6 -6
- package/fonts/Brand/tui-brand.eot +0 -0
- package/fonts/Brand/tui-brand.less +6 -6
- package/fonts/Brand/tui-brand.module.less +6 -6
- package/fonts/Brand/tui-brand.scss +6 -6
- package/fonts/Brand/tui-brand.styl +6 -6
- package/fonts/Brand/tui-brand.ttf +0 -0
- package/fonts/Brand/tui-brand.woff +0 -0
- package/fonts/Brand/tui-brand.woff2 +0 -0
- package/fonts/Covid/tui-covid.css +6 -6
- package/fonts/Covid/tui-covid.eot +0 -0
- package/fonts/Covid/tui-covid.less +6 -6
- package/fonts/Covid/tui-covid.module.less +6 -6
- package/fonts/Covid/tui-covid.scss +6 -6
- package/fonts/Covid/tui-covid.styl +6 -6
- package/fonts/Covid/tui-covid.ttf +0 -0
- package/fonts/Covid/tui-covid.woff +0 -0
- package/fonts/Covid/tui-covid.woff2 +0 -0
- package/fonts/Food/tui-food.css +6 -6
- package/fonts/Food/tui-food.eot +0 -0
- package/fonts/Food/tui-food.less +6 -6
- package/fonts/Food/tui-food.module.less +6 -6
- package/fonts/Food/tui-food.scss +6 -6
- package/fonts/Food/tui-food.styl +6 -6
- package/fonts/Food/tui-food.ttf +0 -0
- package/fonts/Food/tui-food.woff +0 -0
- package/fonts/Food/tui-food.woff2 +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
- package/fonts/Places/tui-places.css +6 -6
- package/fonts/Places/tui-places.eot +0 -0
- package/fonts/Places/tui-places.less +6 -6
- package/fonts/Places/tui-places.module.less +6 -6
- package/fonts/Places/tui-places.scss +6 -6
- package/fonts/Places/tui-places.styl +6 -6
- package/fonts/Places/tui-places.ttf +0 -0
- package/fonts/Places/tui-places.woff +0 -0
- package/fonts/Places/tui-places.woff2 +0 -0
- package/fonts/Room/tui-room.css +6 -6
- package/fonts/Room/tui-room.eot +0 -0
- package/fonts/Room/tui-room.less +6 -6
- package/fonts/Room/tui-room.module.less +6 -6
- package/fonts/Room/tui-room.scss +6 -6
- package/fonts/Room/tui-room.styl +6 -6
- package/fonts/Room/tui-room.ttf +0 -0
- package/fonts/Room/tui-room.woff +0 -0
- package/fonts/Room/tui-room.woff2 +0 -0
- package/fonts/Services/tui-services.css +6 -6
- package/fonts/Services/tui-services.eot +0 -0
- package/fonts/Services/tui-services.less +6 -6
- package/fonts/Services/tui-services.module.less +6 -6
- package/fonts/Services/tui-services.scss +6 -6
- package/fonts/Services/tui-services.styl +6 -6
- package/fonts/Services/tui-services.ttf +0 -0
- package/fonts/Services/tui-services.woff +0 -0
- package/fonts/Services/tui-services.woff2 +0 -0
- package/fonts/Socials/tui-socials.css +6 -6
- package/fonts/Socials/tui-socials.eot +0 -0
- package/fonts/Socials/tui-socials.less +6 -6
- package/fonts/Socials/tui-socials.module.less +6 -6
- package/fonts/Socials/tui-socials.scss +6 -6
- package/fonts/Socials/tui-socials.styl +6 -6
- package/fonts/Socials/tui-socials.ttf +0 -0
- package/fonts/Socials/tui-socials.woff +0 -0
- package/fonts/Socials/tui-socials.woff2 +0 -0
- package/fonts/Transports/tui-transports.css +6 -6
- package/fonts/Transports/tui-transports.eot +0 -0
- package/fonts/Transports/tui-transports.less +6 -6
- package/fonts/Transports/tui-transports.module.less +6 -6
- package/fonts/Transports/tui-transports.scss +6 -6
- package/fonts/Transports/tui-transports.styl +6 -6
- package/fonts/Transports/tui-transports.ttf +0 -0
- package/fonts/Transports/tui-transports.woff +0 -0
- package/fonts/Transports/tui-transports.woff2 +0 -0
- package/fonts/Utilities/tui-utilities.css +6 -6
- package/fonts/Utilities/tui-utilities.eot +0 -0
- package/fonts/Utilities/tui-utilities.less +6 -6
- package/fonts/Utilities/tui-utilities.module.less +6 -6
- package/fonts/Utilities/tui-utilities.scss +6 -6
- package/fonts/Utilities/tui-utilities.styl +6 -6
- package/fonts/Utilities/tui-utilities.ttf +0 -0
- package/fonts/Utilities/tui-utilities.woff +0 -0
- package/fonts/Utilities/tui-utilities.woff2 +0 -0
- package/hooks/useKeyboardControls.d.ts +1 -1
- package/hooks/useKeyboardControls.js +31 -27
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +2 -11
- package/molecules/Forms/Checkboxes/Checkbox.js +90 -65
- package/molecules/Forms/Checkboxes/Checkboxes.js +1 -1
- package/molecules/Tabs/TabsHeading.js +73 -74
- package/molecules/Tabs/context/TabControl.js +21 -21
- package/package.json +1 -1
@@ -1,11 +1,11 @@
|
|
1
1
|
@font-face {
|
2
2
|
font-family: "tui-utilities";
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
src: url('tui-utilities.eot?t=
|
5
|
-
url("tui-utilities.woff2?t=
|
6
|
-
url("tui-utilities.woff?t=
|
7
|
-
url('tui-utilities.ttf?t=
|
8
|
-
url('tui-utilities.svg?t=
|
3
|
+
src: url('tui-utilities.eot?t=1719835623725'); /* IE9*/
|
4
|
+
src: url('tui-utilities.eot?t=1719835623725#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
5
|
+
url("tui-utilities.woff2?t=1719835623725") format("woff2"),
|
6
|
+
url("tui-utilities.woff?t=1719835623725") format("woff"),
|
7
|
+
url('tui-utilities.ttf?t=1719835623725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
8
|
+
url('tui-utilities.svg?t=1719835623725#tui-utilities') format('svg'); /* iOS 4.1- */
|
9
9
|
}
|
10
10
|
|
11
11
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1719835623725'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1719835623725#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1719835623725") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1719835623725") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1719835623725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1719835623725#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1719835623725'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1719835623725#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1719835623725") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1719835623725") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1719835623725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1719835623725#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1719835623725'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1719835623725#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1719835623725") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1719835623725") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1719835623725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1719835623725#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1719835623725'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1719835623725#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1719835623725") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1719835623725") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1719835623725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1719835623725#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,30 +1,34 @@
|
|
1
1
|
"use client";
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
2
|
+
import { useCallback as d } from "react";
|
3
|
+
import { CODE as u, KEY as c } from "./keyboard.constants.js";
|
4
|
+
const t = (o) => o.key === c.ENTER || o.key === c.SPACE || o.key === c.SPACEBAR || o.code === u.ENTER || o.code === u.SPACE, e = () => {
|
5
|
+
}, p = ({
|
6
|
+
up: o = e,
|
7
|
+
down: f = e,
|
8
|
+
left: E = e,
|
9
|
+
right: R = e,
|
10
|
+
start: i = e,
|
11
|
+
end: l = e,
|
12
|
+
activate: D = e
|
13
|
+
}) => d(
|
14
|
+
(r) => {
|
15
|
+
if (t(r))
|
16
|
+
return D();
|
17
|
+
if (r.code === u.HOME)
|
18
|
+
return r.preventDefault(), i();
|
19
|
+
if (r.code === u.END)
|
20
|
+
return r.preventDefault(), l();
|
21
|
+
if (r.code === u.ARROW_UP)
|
22
|
+
return r.preventDefault(), o();
|
23
|
+
if (r.code === u.ARROW_DOWN)
|
24
|
+
return r.preventDefault(), f();
|
25
|
+
if (r.code === u.ARROW_RIGHT)
|
26
|
+
return r.preventDefault(), R();
|
27
|
+
if (r.code === u.ARROW_LEFT)
|
28
|
+
return r.preventDefault(), E();
|
29
|
+
},
|
30
|
+
[D, f, l, E, R, i, o]
|
31
|
+
);
|
28
32
|
export {
|
29
|
-
|
33
|
+
p as useKeyboardControls
|
30
34
|
};
|
@@ -1,14 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
export interface CheckboxProps<Value = string> extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
4
|
-
/**
|
5
|
-
* The data-testid to apply to the button.
|
6
|
-
* This is used for testing purposes.
|
7
|
-
* */
|
8
|
-
dataTestId?: string;
|
9
|
-
/**
|
10
|
-
* The width of the checkbox.
|
11
|
-
* */
|
1
|
+
import { FormControlProps } from '../FormControl';
|
2
|
+
export interface CheckboxProps<Value = string> extends FormControlProps<Value> {
|
12
3
|
size?: number;
|
13
4
|
onChange?: (name: string, value: Value | null) => void;
|
14
5
|
}
|
@@ -1,72 +1,97 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { useId as
|
4
|
-
import { Icon as
|
1
|
+
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
2
|
+
import { c as p } from "../../../index-Cu0xwYjD.js";
|
3
|
+
import { useId as w } from "react";
|
4
|
+
import { Icon as u } from "../../../atoms/Icons/Icon.js";
|
5
5
|
import "../../../atoms/Icons/contexts/IconsContext.js";
|
6
|
-
import { useValue as
|
6
|
+
import { useValue as S } from "../../../hooks/useValue.js";
|
7
7
|
import "../../../controls-l0sNRNKZ.js";
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
8
|
+
import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
|
9
|
+
function A(h) {
|
10
|
+
const x = w(), {
|
11
|
+
id: n = x,
|
12
|
+
name: o = n,
|
13
|
+
className: f,
|
14
|
+
dataTestId: b,
|
15
|
+
disabled: s = !1,
|
16
|
+
checked: k = !1,
|
17
|
+
value: r,
|
18
|
+
size: l = 24,
|
19
|
+
tabIndex: g = 0,
|
20
|
+
validationStatus: v = "default",
|
21
|
+
errorMessage: c,
|
22
|
+
children: N,
|
23
|
+
onChange: i,
|
24
|
+
...I
|
25
|
+
} = h, { value: d, setValue: y } = S({
|
26
|
+
name: o,
|
27
|
+
initialValue: k,
|
28
|
+
onChange(C, m) {
|
29
|
+
i == null || i(C, m ? r !== void 0 ? r : m : null);
|
27
30
|
}
|
31
|
+
}), e = V({
|
32
|
+
isDisabled: s,
|
33
|
+
validationStatus: v
|
28
34
|
});
|
29
|
-
return /* @__PURE__ */
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
"
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
35
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col gap-y-4", children: [
|
36
|
+
/* @__PURE__ */ t(
|
37
|
+
"label",
|
38
|
+
{
|
39
|
+
className: p(
|
40
|
+
f,
|
41
|
+
"cursor-pointer relative flex gap-8 text-b3 items-center",
|
42
|
+
{
|
43
|
+
"text-grey": e === "disabled",
|
44
|
+
"text-black": e !== "default"
|
45
|
+
}
|
46
|
+
),
|
47
|
+
children: [
|
48
|
+
/* @__PURE__ */ t("span", { className: "relative", children: [
|
49
|
+
/* @__PURE__ */ a(
|
50
|
+
"input",
|
51
|
+
{
|
52
|
+
...I,
|
53
|
+
name: o,
|
54
|
+
"data-testid": b,
|
55
|
+
type: "checkbox",
|
56
|
+
tabIndex: g,
|
57
|
+
onChange: () => {
|
58
|
+
!s && y(!d);
|
59
|
+
},
|
60
|
+
checked: d,
|
61
|
+
"data-name": "Checkbox",
|
62
|
+
disabled: s,
|
63
|
+
value: r
|
64
|
+
}
|
65
|
+
),
|
66
|
+
/* @__PURE__ */ a(
|
67
|
+
"span",
|
68
|
+
{
|
69
|
+
style: { height: l, width: l },
|
70
|
+
className: p({ "!border-red": e === "error" }),
|
71
|
+
"data-testid": `check-container-${n}`,
|
72
|
+
children: /* @__PURE__ */ a(
|
73
|
+
u,
|
74
|
+
{
|
75
|
+
name: "CheckDefault",
|
76
|
+
type: "svg",
|
77
|
+
width: `${l}px`,
|
78
|
+
color: "black",
|
79
|
+
className: "absolute"
|
80
|
+
}
|
81
|
+
)
|
82
|
+
}
|
83
|
+
)
|
84
|
+
] }),
|
85
|
+
N
|
86
|
+
]
|
87
|
+
}
|
88
|
+
),
|
89
|
+
e === "error" && c && /* @__PURE__ */ t("span", { className: "text-red text-b4 flex items-start gap-x-4 ps-20", role: "alert", children: [
|
90
|
+
/* @__PURE__ */ a(u, { name: "Error", width: "20px" }),
|
91
|
+
c
|
92
|
+
] })
|
93
|
+
] });
|
69
94
|
}
|
70
95
|
export {
|
71
|
-
|
96
|
+
A as Checkbox
|
72
97
|
};
|
@@ -33,7 +33,7 @@ function q(m) {
|
|
33
33
|
disabled: f,
|
34
34
|
readOnly: b,
|
35
35
|
tabIndex: V + o + 1,
|
36
|
-
className: E("mb-12 last:mb-0"
|
36
|
+
className: E(e.props.className || "mb-12 last:mb-0"),
|
37
37
|
checked: a.includes(n),
|
38
38
|
onChange($, x) {
|
39
39
|
l(x === null ? a.filter((C) => C !== n) : a.concat(n));
|
@@ -1,101 +1,100 @@
|
|
1
1
|
"use client";
|
2
|
-
import { jsx as
|
3
|
-
import { c } from "../../index-Cu0xwYjD.js";
|
4
|
-
import { useRef as
|
5
|
-
import { b as
|
6
|
-
import { useActiveTab as
|
7
|
-
import { getTheme as
|
8
|
-
import { useSafeBoop as
|
9
|
-
import { useKeyboardControls as
|
10
|
-
const
|
11
|
-
className:
|
12
|
-
label:
|
13
|
-
children:
|
14
|
-
value:
|
15
|
-
onSelect:
|
16
|
-
as:
|
17
|
-
theme:
|
2
|
+
import { jsx as u, jsxs as B } from "react/jsx-runtime";
|
3
|
+
import { c as d } from "../../index-Cu0xwYjD.js";
|
4
|
+
import { useRef as m, useEffect as H, useCallback as r } from "react";
|
5
|
+
import { b as I } from "../../react-spring_web.modern-BPtZcx1z.js";
|
6
|
+
import { useActiveTab as _, useRegisterTabControl as z } from "./hooks/tabControl.js";
|
7
|
+
import { getTheme as G } from "./theme.js";
|
8
|
+
import { useSafeBoop as M } from "../../hooks/useSafeBoop.js";
|
9
|
+
import { useKeyboardControls as O } from "../../hooks/useKeyboardControls.js";
|
10
|
+
const f = "-z-1 rounded-pill absolute inset-0 duration-300", W = ({
|
11
|
+
className: b,
|
12
|
+
label: a,
|
13
|
+
children: y,
|
14
|
+
value: e,
|
15
|
+
onSelect: i,
|
16
|
+
as: g = "h2",
|
17
|
+
theme: h = "yellow"
|
18
18
|
}) => {
|
19
|
-
const p =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
R.div,
|
19
|
+
const p = m(null), o = _(), t = z({ value: e, ref: p }), l = m(o), n = m(o === e);
|
20
|
+
n.current = o === e;
|
21
|
+
const x = { "--tab-index": e }, { textColor: C, textColorActive: T, bgColor: w } = G(h), [A, c] = M({ scale: 1.02 });
|
22
|
+
H(() => {
|
23
|
+
var s;
|
24
|
+
l.current !== o && e === o && ((s = p.current) == null || s.focus(), i == null || i({ value: e, label: a })), l.current !== o && (l.current = o);
|
25
|
+
}, [a, e, i, o]);
|
26
|
+
const v = r(() => {
|
27
|
+
n.current && c();
|
28
|
+
}, [c]), N = r(() => {
|
29
|
+
t({ type: "start" });
|
30
|
+
}, [t]), k = r(() => {
|
31
|
+
t({ type: "end" });
|
32
|
+
}, [t]), L = r(() => {
|
33
|
+
t({ type: "previous" });
|
34
|
+
}, [t]), R = r(() => {
|
35
|
+
t({ type: "next" });
|
36
|
+
}, [t]), E = r(() => {
|
37
|
+
const s = document.documentElement.dir === "rtl";
|
38
|
+
t({ type: s ? "next" : "previous" });
|
39
|
+
}, [t]), K = r(() => {
|
40
|
+
const s = document.documentElement.dir === "rtl";
|
41
|
+
t({ type: s ? "previous" : "next" });
|
42
|
+
}, [t]), D = O({
|
43
|
+
activate: v,
|
44
|
+
start: N,
|
45
|
+
end: k,
|
46
|
+
up: L,
|
47
|
+
down: R,
|
48
|
+
left: E,
|
49
|
+
right: K
|
50
|
+
}), j = r(() => {
|
51
|
+
t({ type: "update", payload: e }), n.current && c();
|
52
|
+
}, [c, t, e]);
|
53
|
+
return /* @__PURE__ */ u(
|
54
|
+
I.div,
|
56
55
|
{
|
57
56
|
"data-name": "TabsHeading",
|
58
|
-
ref:
|
57
|
+
ref: p,
|
59
58
|
role: "tab",
|
60
|
-
"aria-selected":
|
61
|
-
tabIndex:
|
62
|
-
style:
|
63
|
-
className:
|
59
|
+
"aria-selected": n.current,
|
60
|
+
tabIndex: n.current ? 0 : -1,
|
61
|
+
style: A,
|
62
|
+
className: d(
|
64
63
|
"text-b3 group inline-block cursor-pointer overflow-hidden whitespace-nowrap bg-transparent pe-4 align-middle font-semibold outline-none",
|
65
|
-
|
64
|
+
b,
|
66
65
|
{
|
67
|
-
[
|
68
|
-
[
|
66
|
+
[C]: !n.current,
|
67
|
+
[T]: n.current
|
69
68
|
}
|
70
69
|
),
|
71
|
-
onKeyDown:
|
72
|
-
onClick:
|
73
|
-
children: /* @__PURE__ */
|
74
|
-
/* @__PURE__ */
|
70
|
+
onKeyDown: D,
|
71
|
+
onClick: j,
|
72
|
+
children: /* @__PURE__ */ B(g, { className: "relative inline-block px-20 py-12", children: [
|
73
|
+
/* @__PURE__ */ u(
|
75
74
|
"span",
|
76
75
|
{
|
77
|
-
className:
|
76
|
+
className: d(
|
78
77
|
"group-hover:bg-pearl group-focus-within:bg-pearl transition-colors",
|
79
|
-
|
78
|
+
f
|
80
79
|
)
|
81
80
|
}
|
82
81
|
),
|
83
|
-
/* @__PURE__ */
|
82
|
+
/* @__PURE__ */ u(
|
84
83
|
"span",
|
85
84
|
{
|
86
|
-
className:
|
85
|
+
className: d(
|
87
86
|
"tab-focus-pill ease transition-transform/colors",
|
88
|
-
|
89
|
-
|
87
|
+
f,
|
88
|
+
w
|
90
89
|
),
|
91
|
-
style:
|
90
|
+
style: x
|
92
91
|
}
|
93
92
|
),
|
94
|
-
|
93
|
+
y ?? a
|
95
94
|
] })
|
96
95
|
}
|
97
96
|
);
|
98
97
|
};
|
99
98
|
export {
|
100
|
-
|
99
|
+
W as TabsHeading
|
101
100
|
};
|
@@ -1,38 +1,38 @@
|
|
1
1
|
"use client";
|
2
2
|
import { jsx as l } from "react/jsx-runtime";
|
3
3
|
import { createContext as c, useReducer as v, useMemo as u, useCallback as x } from "react";
|
4
|
-
const C = (
|
5
|
-
const
|
4
|
+
const C = (t) => {
|
5
|
+
const e = Math.max(Math.min(t.min, t.max), 0), r = Math.max(Math.min(t.max, 1 / 0), e);
|
6
6
|
return {
|
7
|
-
min:
|
7
|
+
min: e,
|
8
8
|
max: r,
|
9
|
-
clamp: (n) => Math.max(Math.min(n, r),
|
9
|
+
clamp: (n) => Math.max(Math.min(n, r), e)
|
10
10
|
};
|
11
|
-
}, g = (
|
12
|
-
const { clamp:
|
13
|
-
return t
|
14
|
-
}, P = (
|
15
|
-
const { min:
|
11
|
+
}, g = (t) => {
|
12
|
+
const { clamp: e } = C(t);
|
13
|
+
return e(t.value);
|
14
|
+
}, P = (t) => {
|
15
|
+
const { min: e, max: r, clamp: n } = C(t);
|
16
16
|
return (a, o) => {
|
17
17
|
switch (o.type) {
|
18
18
|
case "update":
|
19
19
|
return n(o.payload);
|
20
20
|
case "next":
|
21
|
-
return a + 1 <= r ? a + 1 :
|
21
|
+
return a + 1 <= r ? a + 1 : e;
|
22
22
|
case "previous":
|
23
|
-
return a - 1 >=
|
23
|
+
return a - 1 >= e ? a - 1 : r;
|
24
24
|
case "start":
|
25
|
-
return
|
25
|
+
return e;
|
26
26
|
case "end":
|
27
27
|
return r;
|
28
28
|
}
|
29
29
|
};
|
30
|
-
}, R = (
|
31
|
-
switch (
|
30
|
+
}, R = (t, e) => {
|
31
|
+
switch (e.type) {
|
32
32
|
case "register":
|
33
|
-
return new Map(
|
33
|
+
return new Map(t.set(e.payload.value, e.payload.ref));
|
34
34
|
case "unregister":
|
35
|
-
return
|
35
|
+
return t.delete(e.payload.value), new Map(t);
|
36
36
|
}
|
37
37
|
}, h = c({ value: 0 });
|
38
38
|
h.displayName = "ActiveTabContext";
|
@@ -53,14 +53,14 @@ const b = c({
|
|
53
53
|
});
|
54
54
|
b.displayName = "TabControlContext";
|
55
55
|
const A = ({
|
56
|
-
min:
|
57
|
-
max:
|
58
|
-
selected: r =
|
56
|
+
min: t = 0,
|
57
|
+
max: e,
|
58
|
+
selected: r = t,
|
59
59
|
children: n
|
60
60
|
}) => {
|
61
61
|
const [a, o] = v(
|
62
|
-
P({ min:
|
63
|
-
{ value: r, min:
|
62
|
+
P({ min: t, max: e }),
|
63
|
+
{ value: r, min: t, max: e },
|
64
64
|
g
|
65
65
|
), [i, d] = v(R, /* @__PURE__ */ new Map()), M = u(() => ({ value: a }), [a]), f = u(() => ({ refs: i }), [i]), p = x(
|
66
66
|
(s, w) => {
|