@clubmed/trident-ui 1.0.0-beta.9 → 1.0.0-rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. package/CHANGELOG.md +401 -0
  2. package/atoms/Icons/svg/SvgIcon.js +12 -12
  3. package/atoms/Icons/svg-use/SvgUseIcon.js +12 -12
  4. package/fonts/Actions/tui-actions.css +6 -6
  5. package/fonts/Actions/tui-actions.eot +0 -0
  6. package/fonts/Actions/tui-actions.less +6 -6
  7. package/fonts/Actions/tui-actions.module.less +6 -6
  8. package/fonts/Actions/tui-actions.scss +6 -6
  9. package/fonts/Actions/tui-actions.styl +6 -6
  10. package/fonts/Actions/tui-actions.ttf +0 -0
  11. package/fonts/Actions/tui-actions.woff +0 -0
  12. package/fonts/Actions/tui-actions.woff2 +0 -0
  13. package/fonts/Activities/tui-activities.css +6 -6
  14. package/fonts/Activities/tui-activities.eot +0 -0
  15. package/fonts/Activities/tui-activities.less +6 -6
  16. package/fonts/Activities/tui-activities.module.less +6 -6
  17. package/fonts/Activities/tui-activities.scss +6 -6
  18. package/fonts/Activities/tui-activities.styl +6 -6
  19. package/fonts/Activities/tui-activities.ttf +0 -0
  20. package/fonts/Activities/tui-activities.woff +0 -0
  21. package/fonts/Activities/tui-activities.woff2 +0 -0
  22. package/fonts/Brand/tui-brand.css +6 -6
  23. package/fonts/Brand/tui-brand.eot +0 -0
  24. package/fonts/Brand/tui-brand.less +6 -6
  25. package/fonts/Brand/tui-brand.module.less +6 -6
  26. package/fonts/Brand/tui-brand.scss +6 -6
  27. package/fonts/Brand/tui-brand.styl +6 -6
  28. package/fonts/Brand/tui-brand.ttf +0 -0
  29. package/fonts/Brand/tui-brand.woff +0 -0
  30. package/fonts/Brand/tui-brand.woff2 +0 -0
  31. package/fonts/Covid/tui-covid.css +6 -6
  32. package/fonts/Covid/tui-covid.eot +0 -0
  33. package/fonts/Covid/tui-covid.less +6 -6
  34. package/fonts/Covid/tui-covid.module.less +6 -6
  35. package/fonts/Covid/tui-covid.scss +6 -6
  36. package/fonts/Covid/tui-covid.styl +6 -6
  37. package/fonts/Covid/tui-covid.ttf +0 -0
  38. package/fonts/Covid/tui-covid.woff +0 -0
  39. package/fonts/Covid/tui-covid.woff2 +0 -0
  40. package/fonts/Food/tui-food.css +6 -6
  41. package/fonts/Food/tui-food.eot +0 -0
  42. package/fonts/Food/tui-food.less +6 -6
  43. package/fonts/Food/tui-food.module.less +6 -6
  44. package/fonts/Food/tui-food.scss +6 -6
  45. package/fonts/Food/tui-food.styl +6 -6
  46. package/fonts/Food/tui-food.ttf +0 -0
  47. package/fonts/Food/tui-food.woff +0 -0
  48. package/fonts/Food/tui-food.woff2 +0 -0
  49. package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
  50. package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
  51. package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
  52. package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
  53. package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
  54. package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
  55. package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
  56. package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
  57. package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
  58. package/fonts/Places/tui-places.css +6 -6
  59. package/fonts/Places/tui-places.eot +0 -0
  60. package/fonts/Places/tui-places.less +6 -6
  61. package/fonts/Places/tui-places.module.less +6 -6
  62. package/fonts/Places/tui-places.scss +6 -6
  63. package/fonts/Places/tui-places.styl +6 -6
  64. package/fonts/Places/tui-places.ttf +0 -0
  65. package/fonts/Places/tui-places.woff +0 -0
  66. package/fonts/Places/tui-places.woff2 +0 -0
  67. package/fonts/Room/tui-room.css +6 -6
  68. package/fonts/Room/tui-room.eot +0 -0
  69. package/fonts/Room/tui-room.less +6 -6
  70. package/fonts/Room/tui-room.module.less +6 -6
  71. package/fonts/Room/tui-room.scss +6 -6
  72. package/fonts/Room/tui-room.styl +6 -6
  73. package/fonts/Room/tui-room.ttf +0 -0
  74. package/fonts/Room/tui-room.woff +0 -0
  75. package/fonts/Room/tui-room.woff2 +0 -0
  76. package/fonts/Services/tui-services.css +6 -6
  77. package/fonts/Services/tui-services.eot +0 -0
  78. package/fonts/Services/tui-services.less +6 -6
  79. package/fonts/Services/tui-services.module.less +6 -6
  80. package/fonts/Services/tui-services.scss +6 -6
  81. package/fonts/Services/tui-services.styl +6 -6
  82. package/fonts/Services/tui-services.ttf +0 -0
  83. package/fonts/Services/tui-services.woff +0 -0
  84. package/fonts/Services/tui-services.woff2 +0 -0
  85. package/fonts/Socials/tui-socials.css +6 -6
  86. package/fonts/Socials/tui-socials.eot +0 -0
  87. package/fonts/Socials/tui-socials.less +6 -6
  88. package/fonts/Socials/tui-socials.module.less +6 -6
  89. package/fonts/Socials/tui-socials.scss +6 -6
  90. package/fonts/Socials/tui-socials.styl +6 -6
  91. package/fonts/Socials/tui-socials.ttf +0 -0
  92. package/fonts/Socials/tui-socials.woff +0 -0
  93. package/fonts/Socials/tui-socials.woff2 +0 -0
  94. package/fonts/Transports/tui-transports.css +6 -6
  95. package/fonts/Transports/tui-transports.eot +0 -0
  96. package/fonts/Transports/tui-transports.less +6 -6
  97. package/fonts/Transports/tui-transports.module.less +6 -6
  98. package/fonts/Transports/tui-transports.scss +6 -6
  99. package/fonts/Transports/tui-transports.styl +6 -6
  100. package/fonts/Transports/tui-transports.ttf +0 -0
  101. package/fonts/Transports/tui-transports.woff +0 -0
  102. package/fonts/Transports/tui-transports.woff2 +0 -0
  103. package/fonts/Utilities/tui-utilities.css +6 -6
  104. package/fonts/Utilities/tui-utilities.eot +0 -0
  105. package/fonts/Utilities/tui-utilities.less +6 -6
  106. package/fonts/Utilities/tui-utilities.module.less +6 -6
  107. package/fonts/Utilities/tui-utilities.scss +6 -6
  108. package/fonts/Utilities/tui-utilities.styl +6 -6
  109. package/fonts/Utilities/tui-utilities.ttf +0 -0
  110. package/fonts/Utilities/tui-utilities.woff +0 -0
  111. package/fonts/Utilities/tui-utilities.woff2 +0 -0
  112. package/hooks/useKeyboardControls.d.ts +1 -1
  113. package/hooks/useKeyboardControls.js +31 -27
  114. package/molecules/Breadcrumb.d.ts +9 -5
  115. package/molecules/Breadcrumb.js +20 -15
  116. package/molecules/Buttons/ButtonAnchor.d.ts +2 -1
  117. package/molecules/Buttons/ButtonAnchor.js +17 -16
  118. package/molecules/Forms/Checkboxes/Checkbox.d.ts +2 -11
  119. package/molecules/Forms/Checkboxes/Checkbox.js +90 -60
  120. package/molecules/Forms/Checkboxes/Checkboxes.js +14 -14
  121. package/molecules/Forms/FormControl.js +26 -20
  122. package/molecules/Link.d.ts +5 -1
  123. package/molecules/Link.js +17 -16
  124. package/molecules/Popin.d.ts +12 -4
  125. package/molecules/Popin.js +38 -34
  126. package/molecules/Tabs/TabsHeading.js +73 -74
  127. package/molecules/Tabs/context/TabControl.js +21 -21
  128. package/package.json +1 -1
  129. package/styles/globals.css +4 -0
@@ -1,47 +1,51 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { c as m, b as d, d as p } from "../react-spring_web.modern-BPtZcx1z.js";
3
- import { Backdrop as f } from "./Backdrop.js";
4
- import { Button as h } from "./Buttons/Button.js";
5
- const g = ({
6
- title: o,
7
- children: c,
8
- closeLabel: n,
9
- onClose: a,
10
- isVisible: t
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 = m(t, {
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: t ? { tension: 120, friction: 20 } : p.gentle
29
+ config: a ? { tension: 120, friction: 20 } : x.gentle
17
30
  });
18
- return /* @__PURE__ */ e(f, { isVisible: t, onClose: a, children: i(
19
- (s, l) => l && /* @__PURE__ */ e(
20
- d.div,
31
+ return /* @__PURE__ */ t(h, { isVisible: a, onClose: r, children: i(
32
+ (m, l) => l && /* @__PURE__ */ t(
33
+ p.div,
21
34
  {
22
- className: "border-lightGrey rounded-16 sm:w-360 pointer-events-auto mx-20 w-full border bg-white",
23
- style: s,
24
- children: /* @__PURE__ */ r("div", { className: "space-y-40 p-40 text-center", children: [
25
- /* @__PURE__ */ r("div", { className: "space-y-12 text-start", children: [
26
- /* @__PURE__ */ e("div", { className: "text-h5 font-serif", children: o }),
27
- c
28
- ] }),
29
- /* @__PURE__ */ e(
30
- h,
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
- g as Popin
50
+ j as Popin
47
51
  };
@@ -1,101 +1,100 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as N } from "react/jsx-runtime";
3
- import { c } from "../../index-Cu0xwYjD.js";
4
- import { useRef as d, useEffect as L } from "react";
5
- import { b as R } from "../../react-spring_web.modern-BPtZcx1z.js";
6
- import { useActiveTab as k, useRegisterTabControl as E } from "./hooks/tabControl.js";
7
- import { getTheme as K } from "./theme.js";
8
- import { useSafeBoop as D } from "../../hooks/useSafeBoop.js";
9
- import { useKeyboardControls as j } from "../../hooks/useKeyboardControls.js";
10
- const m = "-z-1 rounded-pill absolute inset-0 duration-300", P = ({
11
- className: u,
12
- label: n,
13
- children: f,
14
- value: o,
15
- onSelect: r,
16
- as: b = "h2",
17
- theme: y = "yellow"
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 = d(!1), s = d(null), g = k(), e = E({ value: o, ref: s }), t = g === o, h = { "--tab-index": o }, { textColor: x, textColorActive: C, bgColor: T } = K(y), [w, l] = D({ scale: 1.02 });
20
- L(() => {
21
- if (!p.current) {
22
- p.current = !0;
23
- return;
24
- }
25
- t && (r == null || r({ value: o, label: n })), s.current && t && s.current.focus();
26
- }, [t, n, o, r]);
27
- const v = j({
28
- activate: () => {
29
- t && l();
30
- },
31
- start: () => {
32
- e({ type: "start" });
33
- },
34
- end: () => {
35
- e({ type: "end" });
36
- },
37
- up: () => {
38
- e({ type: "previous" });
39
- },
40
- down: () => {
41
- e({ type: "next" });
42
- },
43
- left: () => {
44
- const i = document.documentElement.dir === "rtl";
45
- e({ type: i ? "next" : "previous" });
46
- },
47
- right: () => {
48
- const i = document.documentElement.dir === "rtl";
49
- e({ type: i ? "previous" : "next" });
50
- }
51
- }), A = () => {
52
- e({ type: "update", payload: o }), t && l();
53
- };
54
- return /* @__PURE__ */ a(
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: s,
57
+ ref: p,
59
58
  role: "tab",
60
- "aria-selected": t,
61
- tabIndex: t ? 0 : -1,
62
- style: w,
63
- className: c(
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
- u,
64
+ b,
66
65
  {
67
- [x]: !t,
68
- [C]: t
66
+ [C]: !n.current,
67
+ [T]: n.current
69
68
  }
70
69
  ),
71
- onKeyDown: v,
72
- onClick: A,
73
- children: /* @__PURE__ */ N(b, { className: "relative inline-block px-20 py-12", children: [
74
- /* @__PURE__ */ a(
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: c(
76
+ className: d(
78
77
  "group-hover:bg-pearl group-focus-within:bg-pearl transition-colors",
79
- m
78
+ f
80
79
  )
81
80
  }
82
81
  ),
83
- /* @__PURE__ */ a(
82
+ /* @__PURE__ */ u(
84
83
  "span",
85
84
  {
86
- className: c(
85
+ className: d(
87
86
  "tab-focus-pill ease transition-transform/colors",
88
- m,
89
- T
87
+ f,
88
+ w
90
89
  ),
91
- style: h
90
+ style: x
92
91
  }
93
92
  ),
94
- f ?? n
93
+ y ?? a
95
94
  ] })
96
95
  }
97
96
  );
98
97
  };
99
98
  export {
100
- P as TabsHeading
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 = (e) => {
5
- const t = Math.max(Math.min(e.min, e.max), 0), r = Math.max(Math.min(e.max, 1 / 0), t);
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: t,
7
+ min: e,
8
8
  max: r,
9
- clamp: (n) => Math.max(Math.min(n, r), t)
9
+ clamp: (n) => Math.max(Math.min(n, r), e)
10
10
  };
11
- }, g = (e) => {
12
- const { clamp: t } = C(e);
13
- return t(e.value);
14
- }, P = (e) => {
15
- const { min: t, max: r, clamp: n } = C(e);
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 : t;
21
+ return a + 1 <= r ? a + 1 : e;
22
22
  case "previous":
23
- return a - 1 >= t ? a - 1 : r;
23
+ return a - 1 >= e ? a - 1 : r;
24
24
  case "start":
25
- return t;
25
+ return e;
26
26
  case "end":
27
27
  return r;
28
28
  }
29
29
  };
30
- }, R = (e, t) => {
31
- switch (t.type) {
30
+ }, R = (t, e) => {
31
+ switch (e.type) {
32
32
  case "register":
33
- return new Map(e.set(t.payload.value, t.payload.ref));
33
+ return new Map(t.set(e.payload.value, e.payload.ref));
34
34
  case "unregister":
35
- return e.delete(t.payload.value) ? new Map(e) : e;
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: e = 0,
57
- max: t,
58
- selected: r = e,
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: e, max: t }),
63
- { value: r, min: e, max: t },
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubmed/trident-ui",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0-rc.1",
4
4
  "type": "module",
5
5
  "description": "Shared ClubMed React UI components",
6
6
  "keywords": [
@@ -84,6 +84,10 @@
84
84
  appearance: none;
85
85
  }
86
86
 
87
+ input[type='password']::-ms-reveal {
88
+ display: none;
89
+ }
90
+
87
91
  select:invalid {
88
92
  @apply text-middleGrey;
89
93
  }