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

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 +417 -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
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import type { KeyboardEvent } from 'react';
1
+ import { type KeyboardEvent } from 'react';
2
2
  interface Options {
3
3
  up?: VoidFunction;
4
4
  down?: VoidFunction;
@@ -1,30 +1,34 @@
1
1
  "use client";
2
- import { CODE as o, KEY as t } from "./keyboard.constants.js";
3
- const D = (e) => e.key === t.ENTER || e.key === t.SPACE || e.key === t.SPACEBAR || e.code === o.ENTER || e.code === o.SPACE, u = () => {
4
- }, n = ({
5
- up: e = u,
6
- down: c = u,
7
- left: f = u,
8
- right: d = u,
9
- start: i = u,
10
- end: E = u,
11
- activate: R = u
12
- }) => (r) => {
13
- if (D(r))
14
- return R();
15
- if (r.code === o.HOME)
16
- return r.preventDefault(), i();
17
- if (r.code === o.END)
18
- return r.preventDefault(), E();
19
- if (r.code === o.ARROW_UP)
20
- return r.preventDefault(), e();
21
- if (r.code === o.ARROW_DOWN)
22
- return r.preventDefault(), c();
23
- if (r.code === o.ARROW_RIGHT)
24
- return r.preventDefault(), d();
25
- if (r.code === o.ARROW_LEFT)
26
- return r.preventDefault(), f();
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
- n as useKeyboardControls
33
+ p as useKeyboardControls
30
34
  };
@@ -1,10 +1,14 @@
1
- import { FunctionComponent } from 'react';
2
- interface BreadcrumbProps {
3
- items: Array<{
1
+ import { FunctionComponent, PropsWithChildren } from 'react';
2
+ export interface BreadcrumbProps {
3
+ className?: string;
4
+ items: {
4
5
  label: string;
5
6
  href: string;
6
- }>;
7
+ }[];
7
8
  theme?: 'dark' | 'light';
9
+ /**
10
+ * Allow giving a custom component
11
+ */
12
+ component?: FunctionComponent<PropsWithChildren<any>> | string;
8
13
  }
9
14
  export declare const Breadcrumb: FunctionComponent<BreadcrumbProps>;
10
- export {};
@@ -1,8 +1,8 @@
1
- import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
- import { c as b } from "../index-Cu0xwYjD.js";
3
- import { Icon as u } from "../atoms/Icons/Icon.js";
1
+ import { jsx as e, jsxs as k } from "react/jsx-runtime";
2
+ import { c as w } from "../index-Cu0xwYjD.js";
3
+ import { Icon as B } from "../atoms/Icons/Icon.js";
4
4
  import "../atoms/Icons/contexts/IconsContext.js";
5
- const k = {
5
+ const E = {
6
6
  light: {
7
7
  thStart: "text-middleGrey",
8
8
  thEnd: "text-black font-bold"
@@ -11,21 +11,26 @@ const k = {
11
11
  thStart: "text-white",
12
12
  thEnd: "text-white font-bold"
13
13
  }
14
- }, S = ({ items: n, theme: l = "light" }) => {
15
- const [o, i, , ...r] = n, h = r.length ? r[r.length - 1] : n[n.length - 1], m = { label: "...", href: "" }, s = r.length ? [o, i, m, h] : n, { thStart: d, thEnd: x } = k[l];
16
- return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, p) => {
17
- const t = p === s.length - 1, f = c && !t;
18
- return /* @__PURE__ */ g(
14
+ }, L = ({
15
+ className: o,
16
+ items: n,
17
+ theme: l = "light",
18
+ component: i = "a"
19
+ }) => {
20
+ const [m, h, , ...r] = n, d = r.length ? r[r.length - 1] : n[n.length - 1], x = { label: "...", href: "" }, s = r.length ? [m, h, x, d] : n, { thStart: p, thEnd: f } = E[l], g = i;
21
+ return /* @__PURE__ */ e("nav", { "data-name": "Breadcrumb", "aria-label": "Breadcrumb", className: o, children: /* @__PURE__ */ e("ul", { className: "flex items-center", children: s.map(({ label: a, href: c }, b) => {
22
+ const t = b === s.length - 1, u = c && !t;
23
+ return /* @__PURE__ */ k(
19
24
  "li",
20
25
  {
21
- className: b("text-b4 flex items-center", {
22
- [d]: !t,
23
- [x]: t
26
+ className: w("text-b4 flex items-center", {
27
+ [p]: !t,
28
+ [f]: t
24
29
  }),
25
30
  ...t && { "aria-current": "page" },
26
31
  children: [
27
- /* @__PURE__ */ e("span", { children: f ? /* @__PURE__ */ e("a", { href: c, children: a }) : a }),
28
- !t && /* @__PURE__ */ e(u, { name: "Diamond", width: "14px", className: "mx-4" })
32
+ /* @__PURE__ */ e("span", { children: u ? /* @__PURE__ */ e(g, { href: c, children: a }) : a }),
33
+ !t && /* @__PURE__ */ e(B, { name: "Diamond", width: "14px", className: "mx-4" })
29
34
  ]
30
35
  },
31
36
  a
@@ -33,5 +38,5 @@ const k = {
33
38
  }) }) });
34
39
  };
35
40
  export {
36
- S as Breadcrumb
41
+ L as Breadcrumb
37
42
  };
@@ -1,7 +1,8 @@
1
- import type { AnchorHTMLAttributes, FunctionComponent } from 'react';
1
+ import type { AnchorHTMLAttributes, FunctionComponent, PropsWithChildren } from 'react';
2
2
  import './button.css';
3
3
  import { type CommonButtonProps } from './Button';
4
4
  interface ButtonAnchorProps extends CommonButtonProps, AnchorHTMLAttributes<HTMLAnchorElement> {
5
+ component?: FunctionComponent<PropsWithChildren<any>> | string;
5
6
  }
6
7
  export declare const ButtonAnchor: FunctionComponent<ButtonAnchorProps>;
7
8
  export {};
@@ -1,37 +1,38 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { c as x } from "../../index-Cu0xwYjD.js";
2
+ import { c as C } from "../../index-Cu0xwYjD.js";
3
3
  import "../../button-l0sNRNKZ.js";
4
4
  import { variants as y, rootClassName as B } from "./Button.helpers.js";
5
5
  import { themes as w } from "./Button.themes.js";
6
6
  import { ButtonContent as A } from "./ButtonContent.js";
7
- const k = ({
8
- theme: r = "yellow",
7
+ const z = ({
8
+ theme: m = "yellow",
9
+ component: r = "a",
9
10
  backgroundOverride: e,
10
11
  variant: t = "text",
11
- className: m,
12
+ className: n,
12
13
  label: o,
13
- children: n,
14
- title: a,
15
- icon: c,
14
+ children: a,
15
+ title: c,
16
+ icon: p,
16
17
  dataTestId: i,
17
18
  href: l,
18
- groupName: p = "",
19
- ...f
19
+ groupName: f = "",
20
+ ...h
20
21
  }) => {
21
- const h = t === "text", u = y[t], d = w(r, e, p);
22
+ const u = t === "text", d = y[t], x = w(m, e, f);
22
23
  return /* @__PURE__ */ s(
23
- "a",
24
+ r,
24
25
  {
25
26
  "data-name": "ButtonAnchor",
26
27
  "data-testid": i,
27
- className: x(B, d, u, t, m),
28
- title: a || o,
28
+ className: C(B, x, d, t, n),
29
+ title: c || o,
29
30
  href: l,
30
- ...f,
31
- children: /* @__PURE__ */ s(A, { showLabel: h, label: o, icon: c, children: n })
31
+ ...h,
32
+ children: /* @__PURE__ */ s(A, { showLabel: u, label: o, icon: p, children: a })
32
33
  }
33
34
  );
34
35
  };
35
36
  export {
36
- k as ButtonAnchor
37
+ z as ButtonAnchor
37
38
  };
@@ -1,14 +1,5 @@
1
- import { InputHTMLAttributes } from 'react';
2
- import '../controls.css';
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,102 @@
1
- import { jsxs as n, jsx as i } from "react/jsx-runtime";
2
- import { c as g } from "../../../index-Cu0xwYjD.js";
3
- import { useId as C } from "react";
4
- import { Icon as I } from "../../../atoms/Icons/Icon.js";
1
+ import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
+ import { c } from "../../../index-Cu0xwYjD.js";
3
+ import { useId as D } from "react";
4
+ import { Icon as u } from "../../../atoms/Icons/Icon.js";
5
5
  import "../../../atoms/Icons/contexts/IconsContext.js";
6
- import { useValue as y } from "../../../hooks/useValue.js";
6
+ import { useValue as S } from "../../../hooks/useValue.js";
7
7
  import "../../../controls-l0sNRNKZ.js";
8
- function $(c) {
9
- const d = C(), {
10
- id: m = d,
11
- name: l = m,
12
- className: p,
13
- dataTestId: h,
14
- disabled: e,
15
- checked: u = !1,
16
- value: a,
17
- size: t = 24,
18
- tabIndex: x = 0,
19
- children: f,
20
- onChange: s,
21
- ...b
22
- } = c, { value: o, setValue: k } = y({
23
- name: l,
24
- initialValue: u,
25
- onChange(v, r) {
26
- s == null || s(v, r ? a !== void 0 ? a : r : null);
8
+ import { useInternalStatus as V } from "../../../hooks/useInternalStatus.js";
9
+ function B(x) {
10
+ const f = D(), {
11
+ id: s = f,
12
+ name: n = s,
13
+ className: b,
14
+ dataTestId: k,
15
+ disabled: r = !1,
16
+ checked: v = !1,
17
+ value: l,
18
+ size: i = 24,
19
+ tabIndex: N = 0,
20
+ validationStatus: g = "default",
21
+ errorMessage: d,
22
+ children: y,
23
+ onChange: o,
24
+ ...I
25
+ } = x, { value: m, setValue: C } = S({
26
+ name: n,
27
+ initialValue: v,
28
+ onChange(w, h) {
29
+ o == null || o(w, h ? l !== void 0 ? l : h : null);
27
30
  }
28
- });
29
- return /* @__PURE__ */ n(
30
- "label",
31
+ }), e = V({
32
+ isDisabled: r,
33
+ validationStatus: g
34
+ }), p = e === "error" && d;
35
+ return /* @__PURE__ */ t(
36
+ "div",
31
37
  {
32
- className: g(p, "cursor-pointer relative flex gap-8", {
33
- "text-grey": e
38
+ className: c(b, "flex flex-col space-y-2", {
39
+ "mb-24": !p
34
40
  }),
41
+ "data-testid": `checkbox-container-${s}`,
35
42
  children: [
36
- /* @__PURE__ */ n("span", { className: "relative", children: [
37
- /* @__PURE__ */ i(
38
- "input",
39
- {
40
- ...b,
41
- name: l,
42
- "data-testid": h,
43
- type: "checkbox",
44
- tabIndex: x,
45
- onChange: () => {
46
- !e && k(!o);
47
- },
48
- checked: o,
49
- "data-name": "Checkbox",
50
- disabled: e,
51
- value: a
52
- }
53
- ),
54
- /* @__PURE__ */ i("span", { style: { height: t, width: t }, children: /* @__PURE__ */ i(
55
- I,
56
- {
57
- name: "CheckDefault",
58
- type: "svg",
59
- width: `${t}px`,
60
- color: "black",
61
- className: "absolute"
62
- }
63
- ) })
64
- ] }),
65
- f
43
+ /* @__PURE__ */ t(
44
+ "label",
45
+ {
46
+ className: c("cursor-pointer relative flex text-b3 items-center", {
47
+ "text-grey": e === "disabled",
48
+ "text-black": e !== "default"
49
+ }),
50
+ children: [
51
+ /* @__PURE__ */ t("span", { className: "relative self-start me-8", children: [
52
+ /* @__PURE__ */ a(
53
+ "input",
54
+ {
55
+ ...I,
56
+ name: n,
57
+ "data-testid": k,
58
+ type: "checkbox",
59
+ tabIndex: N,
60
+ onChange: () => {
61
+ !r && C(!m);
62
+ },
63
+ checked: m,
64
+ "data-name": "Checkbox",
65
+ disabled: r,
66
+ value: l
67
+ }
68
+ ),
69
+ /* @__PURE__ */ a(
70
+ "span",
71
+ {
72
+ style: { height: i, width: i },
73
+ className: c({ "!border-red": e === "error" }),
74
+ "data-testid": `check-container-${s}`,
75
+ children: /* @__PURE__ */ a(
76
+ u,
77
+ {
78
+ name: "CheckDefault",
79
+ type: "svg",
80
+ width: `${i}px`,
81
+ color: "black",
82
+ className: "absolute"
83
+ }
84
+ )
85
+ }
86
+ )
87
+ ] }),
88
+ y
89
+ ]
90
+ }
91
+ ),
92
+ p && /* @__PURE__ */ t("span", { className: "text-red text-b4 flex items-start space-x-4 ps-20", role: "alert", children: [
93
+ /* @__PURE__ */ a(u, { name: "Error", width: "20px" }),
94
+ d
95
+ ] })
66
96
  ]
67
97
  }
68
98
  );
69
99
  }
70
100
  export {
71
- $ as Checkbox
101
+ B as Checkbox
72
102
  };
@@ -1,21 +1,21 @@
1
1
  import { jsx as I } from "react/jsx-runtime";
2
- import { useId as v, Children as N, isValidElement as g, cloneElement as h } from "react";
2
+ import { useId as N, Children as v, isValidElement as g, cloneElement as h } from "react";
3
3
  import { useValue as k } from "../../../hooks/useValue.js";
4
4
  import { c as E } from "../../../index-Cu0xwYjD.js";
5
5
  function q(m) {
6
- const i = v(), {
6
+ const i = N(), {
7
7
  id: r = i,
8
- name: t = r,
8
+ name: n = r,
9
9
  children: u,
10
10
  value: c,
11
11
  defaultValue: p,
12
12
  onChange: d,
13
13
  disabled: f,
14
- readOnly: b,
15
- tabIndex: V = 0,
14
+ readOnly: V,
15
+ tabIndex: b = 0,
16
16
  ...s
17
17
  } = m, { value: a, setValue: o } = k({
18
- name: t,
18
+ name: n,
19
19
  initialValue: c,
20
20
  formatter(e) {
21
21
  return e !== void 0 ? [].concat(e) : e;
@@ -23,20 +23,20 @@ function q(m) {
23
23
  defaultValue: p || [],
24
24
  onChange: d
25
25
  });
26
- return /* @__PURE__ */ I("div", { ...s, className: s.className, role: "listbox", children: N.map(u, (e, l) => {
26
+ return /* @__PURE__ */ I("div", { ...s, className: s.className, role: "listbox", children: v.map(u, (e, l) => {
27
27
  if (g(e)) {
28
- const n = e.props.value;
28
+ const t = e.props.value;
29
29
  return h(e, {
30
30
  ...e.props,
31
- name: t,
31
+ name: n,
32
32
  id: `${r}-${l}`,
33
33
  disabled: f,
34
- readOnly: b,
35
- tabIndex: V + l + 1,
36
- className: E("mb-12 last:mb-0", e.props),
37
- checked: a.includes(n),
34
+ readOnly: V,
35
+ tabIndex: b + l + 1,
36
+ className: E(e.props.className || "mt-8 first:mt-0"),
37
+ checked: a.includes(t),
38
38
  onChange($, x) {
39
- o(x === null ? a.filter((C) => C !== n) : a.concat(n));
39
+ o(x === null ? a.filter((C) => C !== t) : a.concat(t));
40
40
  }
41
41
  });
42
42
  }
@@ -3,35 +3,41 @@ import { useInternalStatus as u } from "../../hooks/useInternalStatus.js";
3
3
  import { FormLabel as h } from "./FormLabel.js";
4
4
  import { Icon as b } from "../../atoms/Icons/Icon.js";
5
5
  import "../../atoms/Icons/contexts/IconsContext.js";
6
- import { c as j } from "../../index-Cu0xwYjD.js";
7
- const w = ({
6
+ import { c as S } from "../../index-Cu0xwYjD.js";
7
+ const v = ({
8
8
  id: t,
9
9
  label: r,
10
- description: s,
11
- disabled: m,
12
- required: n,
13
- className: i,
14
- validationStatus: l = "default",
15
- children: p,
10
+ description: m,
11
+ disabled: n,
12
+ required: i,
13
+ className: l,
14
+ validationStatus: p = "default",
15
+ children: c,
16
16
  errorMessage: a,
17
- dataTestId: c,
17
+ dataTestId: d,
18
18
  dataName: x,
19
- layout: d
19
+ layout: f
20
20
  }) => {
21
- const f = u({
22
- isDisabled: !!m,
23
- validationStatus: l
24
- });
21
+ const s = u({
22
+ isDisabled: !!n,
23
+ validationStatus: p
24
+ }) === "error" && a;
25
25
  return /* @__PURE__ */ e(
26
26
  "div",
27
27
  {
28
- className: j("flex flex-col gap-4", i),
28
+ className: S(
29
+ "flex flex-col gap-4",
30
+ {
31
+ "mb-24": !s
32
+ },
33
+ l
34
+ ),
29
35
  "data-name": x,
30
- "data-testid": c,
36
+ "data-testid": d,
31
37
  children: [
32
- r && t && /* @__PURE__ */ o(h, { description: s, id: t, layout: d, required: n, children: r }),
33
- p,
34
- f === "error" && a && /* @__PURE__ */ e("span", { className: "text-red text-b4 flex items-start gap-x-4 px-20", children: [
38
+ r && t && /* @__PURE__ */ o(h, { description: m, id: t, layout: f, required: i, children: r }),
39
+ c,
40
+ s && /* @__PURE__ */ e("span", { className: "text-red text-b4 flex items-start gap-x-4 px-20", children: [
35
41
  /* @__PURE__ */ o(b, { name: "Error", width: "20px" }),
36
42
  a
37
43
  ] })
@@ -40,5 +46,5 @@ const w = ({
40
46
  );
41
47
  };
42
48
  export {
43
- w as FormControl
49
+ v as FormControl
44
50
  };
@@ -1,4 +1,4 @@
1
- import { AnchorHTMLAttributes, FunctionComponent } from 'react';
1
+ import { AnchorHTMLAttributes, FunctionComponent, type PropsWithChildren } from 'react';
2
2
  import { IconicNames, IconicTypes } from '../atoms/Icons';
3
3
  interface LinkProps<T extends HTMLAnchorElement = HTMLAnchorElement> extends AnchorHTMLAttributes<T> {
4
4
  /**
@@ -22,6 +22,10 @@ interface LinkProps<T extends HTMLAnchorElement = HTMLAnchorElement> extends Anc
22
22
  * Is the link inert (not itself clickable but part of a clickable element)
23
23
  */
24
24
  inert?: boolean;
25
+ /**
26
+ * Allow giving a custom component
27
+ */
28
+ component?: FunctionComponent<PropsWithChildren<any>> | string;
25
29
  }
26
30
  export declare const Link: FunctionComponent<LinkProps>;
27
31
  export {};
package/molecules/Link.js CHANGED
@@ -1,28 +1,29 @@
1
1
  import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
2
  import { c as a } from "../index-Cu0xwYjD.js";
3
- import { Icon as g } from "../atoms/Icons/Icon.js";
3
+ import { Icon as u } from "../atoms/Icons/Icon.js";
4
4
  import "../atoms/Icons/contexts/IconsContext.js";
5
- const j = ({
5
+ const C = ({
6
6
  label: n,
7
7
  icon: s,
8
- iconType: c,
8
+ component: c = "a",
9
+ iconType: m,
9
10
  underlined: e = !0,
10
- className: m,
11
- inert: l,
12
- ...p
11
+ className: l,
12
+ inert: p,
13
+ ...d
13
14
  }) => {
14
- const r = n.lastIndexOf(" "), i = r === -1 ? n.length : r, d = n.at(0), h = n.substring(1, i + 1), x = n.substring(i);
15
+ const r = n.lastIndexOf(" "), i = r === -1 ? n.length : r, h = n.substring(0, 1), x = n.substring(1, i + 1), g = n.substring(i);
15
16
  return /* @__PURE__ */ t(
16
- l ? "span" : "a",
17
+ p ? "span" : c,
17
18
  {
18
19
  className: a(
19
20
  "text-b3 decoration-none link-container cursor-pointer text-inherit",
20
- m
21
+ l
21
22
  ),
22
23
  "data-name": "Link",
23
- ...p,
24
+ ...d,
24
25
  children: [
25
- /* @__PURE__ */ o("span", { className: a({ "link-underline": e }), children: d }),
26
+ /* @__PURE__ */ o("span", { className: a({ "link-underline": e }), children: h }),
26
27
  /* @__PURE__ */ t(
27
28
  "span",
28
29
  {
@@ -31,14 +32,14 @@ const j = ({
31
32
  "link-underline": e
32
33
  }),
33
34
  children: [
34
- h,
35
+ x,
35
36
  /* @__PURE__ */ t("span", { className: "inline-block", children: [
36
- x,
37
+ g,
37
38
  s && /* @__PURE__ */ o(
38
- g,
39
+ u,
39
40
  {
40
41
  name: s,
41
- iconType: c,
42
+ iconType: m,
42
43
  width: "24px",
43
44
  style: { marginInlineStart: "8px" }
44
45
  }
@@ -52,5 +53,5 @@ const j = ({
52
53
  );
53
54
  };
54
55
  export {
55
- j as Link
56
+ C as Link
56
57
  };
@@ -1,9 +1,17 @@
1
- import { FunctionComponent, PropsWithChildren } from 'react';
2
- interface PopinProps {
3
- title: string;
1
+ import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
2
+ export type ClosePopinCallback = () => void;
3
+ interface PopinFooterProps {
4
4
  closeLabel: string;
5
- onClose: () => void;
5
+ onClose: ClosePopinCallback;
6
+ }
7
+ export interface PopinProps {
8
+ title: ReactNode;
9
+ closeLabel: string;
10
+ onClose: ClosePopinCallback;
6
11
  isVisible: boolean;
12
+ className?: string;
13
+ showCloseButton?: boolean;
14
+ Footer?: FunctionComponent<PopinFooterProps> | false;
7
15
  }
8
16
  export declare const Popin: FunctionComponent<PropsWithChildren<PopinProps>>;
9
17
  export {};