@clubmed/trident-ui 1.0.0-beta.8 → 1.0.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +408 -0
- package/atoms/Icons/svg/SvgIcon.js +12 -12
- package/atoms/Icons/svg-use/SvgUseIcon.js +12 -12
- 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/Breadcrumb.d.ts +9 -5
- package/molecules/Breadcrumb.js +20 -15
- package/molecules/Buttons/ButtonAnchor.d.ts +2 -1
- package/molecules/Buttons/ButtonAnchor.js +17 -16
- package/molecules/Forms/Checkboxes/Checkbox.d.ts +2 -11
- package/molecules/Forms/Checkboxes/Checkbox.js +90 -60
- package/molecules/Forms/Checkboxes/Checkboxes.js +14 -14
- package/molecules/Forms/FormControl.js +26 -20
- package/molecules/Link.d.ts +5 -1
- package/molecules/Link.js +17 -16
- package/molecules/Popin.d.ts +12 -4
- package/molecules/Popin.js +38 -34
- package/molecules/Tabs/TabsHeading.js +73 -74
- package/molecules/Tabs/context/TabControl.js +21 -21
- package/package.json +1 -1
- package/styles/globals.css +4 -0
package/molecules/Popin.js
CHANGED
@@ -1,47 +1,51 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { c as
|
3
|
-
import { Backdrop as
|
4
|
-
import { Button as
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
2
|
+
import { c as f, b as p, d as x } from "../react-spring_web.modern-BPtZcx1z.js";
|
3
|
+
import { Backdrop as h } from "./Backdrop.js";
|
4
|
+
import { Button as u } from "./Buttons/Button.js";
|
5
|
+
import { c as v } from "../index-Cu0xwYjD.js";
|
6
|
+
const b = ({ closeLabel: e, onClose: o }) => /* @__PURE__ */ t(
|
7
|
+
u,
|
8
|
+
{
|
9
|
+
theme: "black",
|
10
|
+
variant: "icon",
|
11
|
+
icon: "CrossDefault",
|
12
|
+
className: "mx-auto",
|
13
|
+
label: e,
|
14
|
+
onClick: o
|
15
|
+
}
|
16
|
+
), j = ({
|
17
|
+
title: e,
|
18
|
+
children: o,
|
19
|
+
closeLabel: s,
|
20
|
+
onClose: r,
|
21
|
+
isVisible: a,
|
22
|
+
className: c = "sm:w-360",
|
23
|
+
Footer: n = b
|
11
24
|
}) => {
|
12
|
-
const i =
|
25
|
+
const i = f(a, {
|
13
26
|
from: { scale: 0.3, opacity: 0.3 },
|
14
27
|
enter: { scale: 1, opacity: 1 },
|
15
28
|
leave: { scale: 0, opacity: 0 },
|
16
|
-
config:
|
29
|
+
config: a ? { tension: 120, friction: 20 } : x.gentle
|
17
30
|
});
|
18
|
-
return /* @__PURE__ */
|
19
|
-
(
|
20
|
-
|
31
|
+
return /* @__PURE__ */ t(h, { isVisible: a, onClose: r, children: i(
|
32
|
+
(m, l) => l && /* @__PURE__ */ t(
|
33
|
+
p.div,
|
21
34
|
{
|
22
|
-
className:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
/* @__PURE__ */
|
30
|
-
|
31
|
-
{
|
32
|
-
theme: "black",
|
33
|
-
variant: "icon",
|
34
|
-
icon: "CrossDefault",
|
35
|
-
className: "mx-auto",
|
36
|
-
label: n,
|
37
|
-
onClick: a
|
38
|
-
}
|
39
|
-
)
|
35
|
+
className: v(
|
36
|
+
"border-lightGrey rounded-16 pointer-events-auto mx-20 w-full border bg-white",
|
37
|
+
c
|
38
|
+
),
|
39
|
+
style: m,
|
40
|
+
children: /* @__PURE__ */ d("div", { className: "p-40 text-center max-h-[90vh] flex flex-col", children: [
|
41
|
+
e && /* @__PURE__ */ t("div", { className: "mt-12 text-h5 text-start font-serif", children: e }),
|
42
|
+
/* @__PURE__ */ t("div", { className: "mt-12 mb-40 last:mb-0 text-start overflow-auto", children: o }),
|
43
|
+
n && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(n, { closeLabel: s, onClose: r }) })
|
40
44
|
] })
|
41
45
|
}
|
42
46
|
)
|
43
47
|
) });
|
44
48
|
};
|
45
49
|
export {
|
46
|
-
|
50
|
+
j as Popin
|
47
51
|
};
|
@@ -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) => {
|
package/package.json
CHANGED