@clubmed/trident-ui 1.0.0-beta.2 → 1.0.0-beta.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/atoms/Icons/Iconics.d.ts +1 -1
  3. package/atoms/Icons/fonts/Utilities.js +0 -6
  4. package/atoms/Icons/svg/SvgIcon.js +12 -12
  5. package/atoms/Icons/svg/Utilities.js +0 -8
  6. package/atoms/Icons/svg-use/SvgUseIcon.js +12 -12
  7. package/atoms/Icons/svg-use/Utilities.js +58 -68
  8. package/fonts/Actions/tui-actions.css +6 -6
  9. package/fonts/Actions/tui-actions.eot +0 -0
  10. package/fonts/Actions/tui-actions.less +6 -6
  11. package/fonts/Actions/tui-actions.module.less +6 -6
  12. package/fonts/Actions/tui-actions.scss +6 -6
  13. package/fonts/Actions/tui-actions.styl +6 -6
  14. package/fonts/Actions/tui-actions.ttf +0 -0
  15. package/fonts/Actions/tui-actions.woff +0 -0
  16. package/fonts/Actions/tui-actions.woff2 +0 -0
  17. package/fonts/Activities/tui-activities.css +6 -6
  18. package/fonts/Activities/tui-activities.eot +0 -0
  19. package/fonts/Activities/tui-activities.less +6 -6
  20. package/fonts/Activities/tui-activities.module.less +6 -6
  21. package/fonts/Activities/tui-activities.scss +6 -6
  22. package/fonts/Activities/tui-activities.styl +6 -6
  23. package/fonts/Activities/tui-activities.ttf +0 -0
  24. package/fonts/Activities/tui-activities.woff +0 -0
  25. package/fonts/Activities/tui-activities.woff2 +0 -0
  26. package/fonts/Brand/tui-brand.css +6 -6
  27. package/fonts/Brand/tui-brand.eot +0 -0
  28. package/fonts/Brand/tui-brand.less +6 -6
  29. package/fonts/Brand/tui-brand.module.less +6 -6
  30. package/fonts/Brand/tui-brand.scss +6 -6
  31. package/fonts/Brand/tui-brand.styl +6 -6
  32. package/fonts/Brand/tui-brand.ttf +0 -0
  33. package/fonts/Brand/tui-brand.woff +0 -0
  34. package/fonts/Brand/tui-brand.woff2 +0 -0
  35. package/fonts/Covid/tui-covid.css +6 -6
  36. package/fonts/Covid/tui-covid.eot +0 -0
  37. package/fonts/Covid/tui-covid.less +6 -6
  38. package/fonts/Covid/tui-covid.module.less +6 -6
  39. package/fonts/Covid/tui-covid.scss +6 -6
  40. package/fonts/Covid/tui-covid.styl +6 -6
  41. package/fonts/Covid/tui-covid.ttf +0 -0
  42. package/fonts/Covid/tui-covid.woff +0 -0
  43. package/fonts/Covid/tui-covid.woff2 +0 -0
  44. package/fonts/Food/tui-food.css +6 -6
  45. package/fonts/Food/tui-food.eot +0 -0
  46. package/fonts/Food/tui-food.less +6 -6
  47. package/fonts/Food/tui-food.module.less +6 -6
  48. package/fonts/Food/tui-food.scss +6 -6
  49. package/fonts/Food/tui-food.styl +6 -6
  50. package/fonts/Food/tui-food.ttf +0 -0
  51. package/fonts/Food/tui-food.woff +0 -0
  52. package/fonts/Food/tui-food.woff2 +0 -0
  53. package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
  54. package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
  55. package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
  56. package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
  57. package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
  58. package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
  59. package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
  60. package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
  61. package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
  62. package/fonts/Places/tui-places.css +6 -6
  63. package/fonts/Places/tui-places.eot +0 -0
  64. package/fonts/Places/tui-places.less +6 -6
  65. package/fonts/Places/tui-places.module.less +6 -6
  66. package/fonts/Places/tui-places.scss +6 -6
  67. package/fonts/Places/tui-places.styl +6 -6
  68. package/fonts/Places/tui-places.ttf +0 -0
  69. package/fonts/Places/tui-places.woff +0 -0
  70. package/fonts/Places/tui-places.woff2 +0 -0
  71. package/fonts/Room/tui-room.css +6 -6
  72. package/fonts/Room/tui-room.eot +0 -0
  73. package/fonts/Room/tui-room.less +6 -6
  74. package/fonts/Room/tui-room.module.less +6 -6
  75. package/fonts/Room/tui-room.scss +6 -6
  76. package/fonts/Room/tui-room.styl +6 -6
  77. package/fonts/Room/tui-room.ttf +0 -0
  78. package/fonts/Room/tui-room.woff +0 -0
  79. package/fonts/Room/tui-room.woff2 +0 -0
  80. package/fonts/Services/tui-services.css +6 -6
  81. package/fonts/Services/tui-services.eot +0 -0
  82. package/fonts/Services/tui-services.less +6 -6
  83. package/fonts/Services/tui-services.module.less +6 -6
  84. package/fonts/Services/tui-services.scss +6 -6
  85. package/fonts/Services/tui-services.styl +6 -6
  86. package/fonts/Services/tui-services.ttf +0 -0
  87. package/fonts/Services/tui-services.woff +0 -0
  88. package/fonts/Services/tui-services.woff2 +0 -0
  89. package/fonts/Socials/tui-socials.css +6 -6
  90. package/fonts/Socials/tui-socials.eot +0 -0
  91. package/fonts/Socials/tui-socials.less +6 -6
  92. package/fonts/Socials/tui-socials.module.less +6 -6
  93. package/fonts/Socials/tui-socials.scss +6 -6
  94. package/fonts/Socials/tui-socials.styl +6 -6
  95. package/fonts/Socials/tui-socials.ttf +0 -0
  96. package/fonts/Socials/tui-socials.woff +0 -0
  97. package/fonts/Socials/tui-socials.woff2 +0 -0
  98. package/fonts/Transports/tui-transports.css +6 -6
  99. package/fonts/Transports/tui-transports.eot +0 -0
  100. package/fonts/Transports/tui-transports.less +6 -6
  101. package/fonts/Transports/tui-transports.module.less +6 -6
  102. package/fonts/Transports/tui-transports.scss +6 -6
  103. package/fonts/Transports/tui-transports.styl +6 -6
  104. package/fonts/Transports/tui-transports.ttf +0 -0
  105. package/fonts/Transports/tui-transports.woff +0 -0
  106. package/fonts/Transports/tui-transports.woff2 +0 -0
  107. package/fonts/Utilities/tui-utilities.css +36 -38
  108. package/fonts/Utilities/tui-utilities.eot +0 -0
  109. package/fonts/Utilities/tui-utilities.less +36 -38
  110. package/fonts/Utilities/tui-utilities.module.less +36 -38
  111. package/fonts/Utilities/tui-utilities.scss +66 -70
  112. package/fonts/Utilities/tui-utilities.styl +36 -38
  113. package/fonts/Utilities/tui-utilities.svg +30 -36
  114. package/fonts/Utilities/tui-utilities.symbol.svg +0 -4
  115. package/fonts/Utilities/tui-utilities.ttf +0 -0
  116. package/fonts/Utilities/tui-utilities.woff +0 -0
  117. package/fonts/Utilities/tui-utilities.woff2 +0 -0
  118. package/hooks/useKeyboardControls.d.ts +1 -1
  119. package/hooks/useKeyboardControls.js +31 -27
  120. package/molecules/Backdrop.js +13 -12
  121. package/molecules/Buttons/ButtonAnchor.d.ts +2 -1
  122. package/molecules/Buttons/ButtonAnchor.js +17 -16
  123. package/molecules/Forms/Checkboxes/Checkbox.d.ts +3 -12
  124. package/molecules/Forms/Checkboxes/Checkbox.js +90 -60
  125. package/molecules/Forms/Checkboxes/Checkboxes.d.ts +1 -1
  126. package/molecules/Forms/Checkboxes/Checkboxes.js +33 -34
  127. package/molecules/Forms/DateField.d.ts +1 -17
  128. package/molecules/Forms/DateField.js +99 -97
  129. package/molecules/Forms/Filter.d.ts +1 -1
  130. package/molecules/Forms/Filter.js +38 -38
  131. package/molecules/Forms/FormControl.d.ts +3 -2
  132. package/molecules/Forms/FormControl.js +30 -23
  133. package/molecules/Forms/FormLabel.d.ts +4 -17
  134. package/molecules/Forms/FormLabel.js +24 -19
  135. package/molecules/Forms/NumberField.d.ts +4 -4
  136. package/molecules/Forms/NumberField.js +75 -72
  137. package/molecules/Forms/Password/Password.d.ts +1 -0
  138. package/molecules/Forms/Password/Password.js +77 -52
  139. package/molecules/Forms/Password/ValidationMessage.js +1 -1
  140. package/molecules/Forms/Radios/Radio.d.ts +1 -1
  141. package/molecules/Forms/Radios/Radio.js +31 -31
  142. package/molecules/Forms/Radios/RadioGroup.d.ts +1 -1
  143. package/molecules/Forms/Radios/RadioGroup.js +28 -29
  144. package/molecules/Forms/Range.d.ts +2 -2
  145. package/molecules/Forms/Range.js +181 -183
  146. package/molecules/Forms/Select.d.ts +10 -0
  147. package/molecules/Forms/Select.js +102 -0
  148. package/molecules/Forms/Switch.d.ts +1 -1
  149. package/molecules/Forms/Switch.js +28 -28
  150. package/molecules/Forms/TextField.d.ts +0 -4
  151. package/molecules/Forms/TextField.js +52 -52
  152. package/molecules/Link.d.ts +5 -1
  153. package/molecules/Link.js +17 -16
  154. package/molecules/Popin.d.ts +12 -4
  155. package/molecules/Popin.js +38 -34
  156. package/molecules/Tabs/TabsHeading.js +73 -74
  157. package/molecules/Tabs/context/TabControl.js +21 -21
  158. package/package.json +1 -1
  159. package/styles/globals.css +8 -0
  160. package/EyeClosed-vWGtzMgE.js +0 -5
  161. package/EyeOpened-CsQwqVMl.js +0 -5
  162. package/assets/icons/Utilities/EyeClosed.svg +0 -12
  163. package/assets/icons/Utilities/EyeOpened.svg +0 -11
@@ -0,0 +1,102 @@
1
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-Cu0xwYjD.js";
3
+ import { useValue as D } from "../../hooks/useValue.js";
4
+ import { useInternalStatus as I } from "../../hooks/useInternalStatus.js";
5
+ import { FormControl as S } from "./FormControl.js";
6
+ import { Icon as n } from "../../atoms/Icons/Icon.js";
7
+ import "../../atoms/Icons/contexts/IconsContext.js";
8
+ import { useId as j } from "react";
9
+ const B = (p) => {
10
+ const u = j(), {
11
+ id: t = u,
12
+ name: a = t,
13
+ label: m,
14
+ value: b,
15
+ description: f,
16
+ validationStatus: o = "default",
17
+ iconType: i,
18
+ errorMessage: x,
19
+ disabled: s = !1,
20
+ required: d = !1,
21
+ className: g,
22
+ dataTestId: h = t,
23
+ onChange: v,
24
+ children: y,
25
+ ...w
26
+ } = p, { value: N, setValue: k } = D({ name: a, initialValue: b, onChange: v }), e = I({
27
+ isDisabled: s,
28
+ validationStatus: o
29
+ });
30
+ return /* @__PURE__ */ r(
31
+ S,
32
+ {
33
+ id: t,
34
+ label: m,
35
+ description: f,
36
+ dataName: "TextField",
37
+ dataTestId: h,
38
+ disabled: s,
39
+ required: d,
40
+ validationStatus: o,
41
+ errorMessage: x,
42
+ children: /* @__PURE__ */ c(
43
+ "div",
44
+ {
45
+ className: l("relative rounded-pill z-0", {
46
+ "bg-white": e !== "disabled",
47
+ "bg-pearl": e === "disabled"
48
+ }),
49
+ children: [
50
+ /* @__PURE__ */ r(
51
+ "select",
52
+ {
53
+ ...w,
54
+ id: t,
55
+ name: a,
56
+ disabled: s,
57
+ required: d,
58
+ value: N,
59
+ onChange: (C) => k(C.target.value),
60
+ className: l(
61
+ "text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent",
62
+ {
63
+ "border-lightGrey focus:border-black active:border-black pe-[52px]": e === "default",
64
+ "pe-[84px]": e === "error" || e === "success",
65
+ "text-black": e !== "disabled",
66
+ "text-grey": e === "disabled",
67
+ "border-red": e === "error",
68
+ "border-green": e === "success"
69
+ },
70
+ g
71
+ ),
72
+ "aria-label": a,
73
+ children: y
74
+ }
75
+ ),
76
+ /* @__PURE__ */ r(
77
+ "div",
78
+ {
79
+ className: l(
80
+ "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1",
81
+ {
82
+ "text-grey": e === "disabled",
83
+ "text-red": e === "error",
84
+ "text-green": e === "success"
85
+ }
86
+ ),
87
+ children: /* @__PURE__ */ c("span", { className: "ms-auto flex gap-x-8", children: [
88
+ e === "error" && /* @__PURE__ */ r(n, { name: "CrossDefault", width: "24px", type: i }),
89
+ e === "success" && /* @__PURE__ */ r(n, { name: "CheckDefault", width: "24px", type: i }),
90
+ /* @__PURE__ */ r("button", { className: "pointer-events-auto inline-flex", children: /* @__PURE__ */ r(n, { name: "ArrowDefaultDown", type: "svg", width: "24px", color: "black" }) })
91
+ ] })
92
+ }
93
+ )
94
+ ]
95
+ }
96
+ )
97
+ }
98
+ );
99
+ };
100
+ export {
101
+ B as Select
102
+ };
@@ -2,4 +2,4 @@ import { FormControlProps } from './FormControl.js';
2
2
  export interface SwitchProps extends FormControlProps<boolean> {
3
3
  width?: number;
4
4
  }
5
- export declare function Switch({ id, name, className, checked: initialChecked, disabled, width, onChange, tabIndex, children, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -1,30 +1,30 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { c as m } from "../../index-Cu0xwYjD.js";
3
- import { useValue as x } from "../../hooks/useValue.js";
2
+ import { c as x } from "../../index-Cu0xwYjD.js";
3
+ import { useValue as f } from "../../hooks/useValue.js";
4
4
  import "../../controls-l0sNRNKZ.js";
5
- let f = 0;
6
- function d({
7
- id: a = `switch-${++f}`,
8
- name: r = a,
9
- className: s,
10
- checked: o,
11
- disabled: c,
12
- width: t = 56,
13
- onChange: n,
14
- tabIndex: h = 0,
15
- children: p
16
- }) {
17
- const { value: i, setValue: u } = x({
18
- initialValue: o,
19
- name: r,
20
- onChange: n
5
+ import { useId as w } from "react";
6
+ function k(r) {
7
+ const s = w(), {
8
+ id: n = s,
9
+ name: a = n,
10
+ className: o,
11
+ checked: h,
12
+ disabled: t,
13
+ width: i = 56,
14
+ onChange: d,
15
+ tabIndex: m = 0,
16
+ children: p
17
+ } = r, { value: c, setValue: u } = f({
18
+ initialValue: h,
19
+ name: a,
20
+ onChange: d
21
21
  });
22
22
  return /* @__PURE__ */ l(
23
23
  "label",
24
24
  {
25
- className: m(s, "relative flex items-center gap-[10px]", {
26
- "text-grey": c,
27
- "cursor-pointer": !c
25
+ className: x(o, "relative flex items-center gap-[10px]", {
26
+ "text-grey": t,
27
+ "cursor-pointer": !t
28
28
  }),
29
29
  "data-testid": "SwitchContainer",
30
30
  children: [
@@ -33,19 +33,19 @@ function d({
33
33
  "input",
34
34
  {
35
35
  type: "checkbox",
36
- name: r,
37
- tabIndex: h,
38
- checked: i,
39
- disabled: c,
36
+ name: a,
37
+ tabIndex: m,
38
+ checked: c,
39
+ disabled: t,
40
40
  role: "switch",
41
41
  className: "absolute w-full h-full opacity-0 cursor-pointer",
42
42
  onChange: () => {
43
- !c && u(!i);
43
+ !t && u(!c);
44
44
  },
45
45
  "data-name": "Switch"
46
46
  }
47
47
  ),
48
- /* @__PURE__ */ e("span", { style: { height: t * 4 / 7, width: t }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: t * 3 / 7, children: /* @__PURE__ */ l("g", { children: [
48
+ /* @__PURE__ */ e("span", { style: { height: i * 4 / 7, width: i }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: i * 3 / 7, children: /* @__PURE__ */ l("g", { children: [
49
49
  /* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 12, fill: "hsl(var(--color-white))" }),
50
50
  /* @__PURE__ */ e("circle", { cx: 12, cy: 12, r: 4, fill: "hsl(var(--color-grey))" })
51
51
  ] }) }) })
@@ -56,5 +56,5 @@ function d({
56
56
  );
57
57
  }
58
58
  export {
59
- d as Switch
59
+ k as Switch
60
60
  };
@@ -1,11 +1,7 @@
1
1
  import { FormControlProps } from './FormControl.js';
2
2
  import { IconicNames, IconicTypes } from '../../atoms/Icons';
3
3
  export interface TextFieldProps<Value> extends FormControlProps<Value> {
4
- /**
5
- * Description text
6
- */
7
4
  description?: string;
8
- hasDropdown?: boolean;
9
5
  icon?: IconicNames;
10
6
  iconType?: IconicTypes;
11
7
  errorMessage?: string;
@@ -1,60 +1,61 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import { c as p } from "../../index-Cu0xwYjD.js";
3
- import { useValue as k } from "../../hooks/useValue.js";
4
- import { useInternalStatus as C } from "../../hooks/useInternalStatus.js";
5
- import { FormControl as T } from "./FormControl.js";
6
- import { Icon as r } from "../../atoms/Icons/Icon.js";
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
+ import { c as m } from "../../index-Cu0xwYjD.js";
3
+ import { useValue as T } from "../../hooks/useValue.js";
4
+ import { useInternalStatus as k } from "../../hooks/useInternalStatus.js";
5
+ import { FormControl as F } from "./FormControl.js";
6
+ import { Icon as i } from "../../atoms/Icons/Icon.js";
7
7
  import "../../atoms/Icons/contexts/IconsContext.js";
8
- let F = 0;
9
- const $ = (u) => {
10
- const {
11
- id: a = `text-field-${++F}`,
12
- name: s = a,
13
- label: m,
14
- value: x,
15
- description: b,
16
- validationStatus: c = "default",
17
- hasDropdown: l = !1,
18
- icon: o,
19
- iconType: i,
20
- errorMessage: f,
21
- disabled: n = !1,
8
+ import { useId as j } from "react";
9
+ const B = (p) => {
10
+ const u = j(), {
11
+ id: r = u,
12
+ name: a = r,
13
+ label: x,
14
+ value: b,
15
+ description: f,
16
+ validationStatus: n = "default",
17
+ icon: s,
18
+ iconType: d,
19
+ errorMessage: g,
20
+ disabled: l = !1,
21
+ required: c = !1,
22
22
  className: h,
23
- dataTestId: g = "TextField",
24
- onChange: v,
23
+ dataTestId: v = "TextField",
24
+ onChange: y,
25
25
  ...w
26
- } = u, { value: y, setValue: N } = k({ name: s, initialValue: x, onChange: v }), e = C({
27
- isDisabled: n,
28
- validationStatus: c
26
+ } = p, { value: N, setValue: C } = T({ name: a, initialValue: b, onChange: y }), e = k({
27
+ isDisabled: l,
28
+ validationStatus: n
29
29
  });
30
30
  return /* @__PURE__ */ t(
31
- T,
31
+ F,
32
32
  {
33
- id: a,
34
- label: m,
35
- description: b,
33
+ id: r,
34
+ label: x,
35
+ description: f,
36
36
  dataName: "TextField",
37
- dataTestId: g,
38
- disabled: n,
39
- validationStatus: c,
40
- errorMessage: f,
41
- children: /* @__PURE__ */ d("div", { className: "relative", children: [
37
+ dataTestId: v,
38
+ disabled: l,
39
+ required: c,
40
+ validationStatus: n,
41
+ errorMessage: g,
42
+ children: /* @__PURE__ */ o("div", { className: "relative", children: [
42
43
  /* @__PURE__ */ t(
43
44
  "input",
44
45
  {
45
46
  ...w,
46
- id: a,
47
- name: s,
48
- disabled: n,
49
- value: y,
50
- onChange: (D) => N(D.target.value),
51
- className: p(
47
+ id: r,
48
+ name: a,
49
+ disabled: l,
50
+ required: c,
51
+ value: N,
52
+ onChange: (I) => C(I.target.value),
53
+ className: m(
52
54
  "text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none",
53
55
  {
54
56
  "border-lightGrey focus:border-black active:border-black": e === "default",
55
- "ps-[52px]": o,
56
- "pe-[52px]": l || e === "error" || e === "success",
57
- "pe-[84px]": l && (e === "error" || e === "success"),
57
+ "ps-[52px]": s,
58
+ "pe-[52px]": e === "error" || e === "success",
58
59
  "bg-white text-black": e !== "disabled",
59
60
  "bg-pearl text-grey": e === "disabled",
60
61
  "border-red": e === "error",
@@ -62,13 +63,13 @@ const $ = (u) => {
62
63
  },
63
64
  h
64
65
  ),
65
- "aria-label": s
66
+ "aria-label": a
66
67
  }
67
68
  ),
68
- /* @__PURE__ */ d(
69
+ /* @__PURE__ */ o(
69
70
  "div",
70
71
  {
71
- className: p(
72
+ className: m(
72
73
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
73
74
  {
74
75
  "text-grey": e === "disabled",
@@ -77,11 +78,10 @@ const $ = (u) => {
77
78
  }
78
79
  ),
79
80
  children: [
80
- o && /* @__PURE__ */ t(r, { name: o, width: "24px" }),
81
- /* @__PURE__ */ d("span", { className: "ms-auto flex gap-x-8", children: [
82
- e === "error" && /* @__PURE__ */ t(r, { name: "CrossDefault", width: "24px", type: i }),
83
- e === "success" && /* @__PURE__ */ t(r, { name: "CheckDefault", width: "24px", type: i }),
84
- l && /* @__PURE__ */ t("button", { className: "pointer-events-auto", children: /* @__PURE__ */ t(r, { name: "ArrowDefaultDown", width: "24px", color: "black", type: i }) })
81
+ s && /* @__PURE__ */ t(i, { name: s, width: "24px" }),
82
+ /* @__PURE__ */ o("span", { className: "ms-auto flex gap-x-8", children: [
83
+ e === "error" && /* @__PURE__ */ t(i, { name: "CrossDefault", width: "24px", type: d }),
84
+ e === "success" && /* @__PURE__ */ t(i, { name: "CheckDefault", width: "24px", type: d })
85
85
  ] })
86
86
  ]
87
87
  }
@@ -91,5 +91,5 @@ const $ = (u) => {
91
91
  );
92
92
  };
93
93
  export {
94
- $ as TextField
94
+ B as TextField
95
95
  };
@@ -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 {};
@@ -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
  };