@clubmed/trident-ui 1.0.0-beta.5 → 1.0.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/fonts/Actions/tui-actions.css +6 -6
  3. package/fonts/Actions/tui-actions.eot +0 -0
  4. package/fonts/Actions/tui-actions.less +6 -6
  5. package/fonts/Actions/tui-actions.module.less +6 -6
  6. package/fonts/Actions/tui-actions.scss +6 -6
  7. package/fonts/Actions/tui-actions.styl +6 -6
  8. package/fonts/Actions/tui-actions.ttf +0 -0
  9. package/fonts/Actions/tui-actions.woff +0 -0
  10. package/fonts/Actions/tui-actions.woff2 +0 -0
  11. package/fonts/Activities/tui-activities.css +6 -6
  12. package/fonts/Activities/tui-activities.eot +0 -0
  13. package/fonts/Activities/tui-activities.less +6 -6
  14. package/fonts/Activities/tui-activities.module.less +6 -6
  15. package/fonts/Activities/tui-activities.scss +6 -6
  16. package/fonts/Activities/tui-activities.styl +6 -6
  17. package/fonts/Activities/tui-activities.ttf +0 -0
  18. package/fonts/Activities/tui-activities.woff +0 -0
  19. package/fonts/Activities/tui-activities.woff2 +0 -0
  20. package/fonts/Brand/tui-brand.css +6 -6
  21. package/fonts/Brand/tui-brand.eot +0 -0
  22. package/fonts/Brand/tui-brand.less +6 -6
  23. package/fonts/Brand/tui-brand.module.less +6 -6
  24. package/fonts/Brand/tui-brand.scss +6 -6
  25. package/fonts/Brand/tui-brand.styl +6 -6
  26. package/fonts/Brand/tui-brand.ttf +0 -0
  27. package/fonts/Brand/tui-brand.woff +0 -0
  28. package/fonts/Brand/tui-brand.woff2 +0 -0
  29. package/fonts/Covid/tui-covid.css +6 -6
  30. package/fonts/Covid/tui-covid.eot +0 -0
  31. package/fonts/Covid/tui-covid.less +6 -6
  32. package/fonts/Covid/tui-covid.module.less +6 -6
  33. package/fonts/Covid/tui-covid.scss +6 -6
  34. package/fonts/Covid/tui-covid.styl +6 -6
  35. package/fonts/Covid/tui-covid.ttf +0 -0
  36. package/fonts/Covid/tui-covid.woff +0 -0
  37. package/fonts/Covid/tui-covid.woff2 +0 -0
  38. package/fonts/Food/tui-food.css +6 -6
  39. package/fonts/Food/tui-food.eot +0 -0
  40. package/fonts/Food/tui-food.less +6 -6
  41. package/fonts/Food/tui-food.module.less +6 -6
  42. package/fonts/Food/tui-food.scss +6 -6
  43. package/fonts/Food/tui-food.styl +6 -6
  44. package/fonts/Food/tui-food.ttf +0 -0
  45. package/fonts/Food/tui-food.woff +0 -0
  46. package/fonts/Food/tui-food.woff2 +0 -0
  47. package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
  48. package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
  49. package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
  50. package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
  51. package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
  52. package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
  53. package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
  54. package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
  55. package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
  56. package/fonts/Places/tui-places.css +6 -6
  57. package/fonts/Places/tui-places.eot +0 -0
  58. package/fonts/Places/tui-places.less +6 -6
  59. package/fonts/Places/tui-places.module.less +6 -6
  60. package/fonts/Places/tui-places.scss +6 -6
  61. package/fonts/Places/tui-places.styl +6 -6
  62. package/fonts/Places/tui-places.ttf +0 -0
  63. package/fonts/Places/tui-places.woff +0 -0
  64. package/fonts/Places/tui-places.woff2 +0 -0
  65. package/fonts/Room/tui-room.css +6 -6
  66. package/fonts/Room/tui-room.eot +0 -0
  67. package/fonts/Room/tui-room.less +6 -6
  68. package/fonts/Room/tui-room.module.less +6 -6
  69. package/fonts/Room/tui-room.scss +6 -6
  70. package/fonts/Room/tui-room.styl +6 -6
  71. package/fonts/Room/tui-room.ttf +0 -0
  72. package/fonts/Room/tui-room.woff +0 -0
  73. package/fonts/Room/tui-room.woff2 +0 -0
  74. package/fonts/Services/tui-services.css +6 -6
  75. package/fonts/Services/tui-services.eot +0 -0
  76. package/fonts/Services/tui-services.less +6 -6
  77. package/fonts/Services/tui-services.module.less +6 -6
  78. package/fonts/Services/tui-services.scss +6 -6
  79. package/fonts/Services/tui-services.styl +6 -6
  80. package/fonts/Services/tui-services.ttf +0 -0
  81. package/fonts/Services/tui-services.woff +0 -0
  82. package/fonts/Services/tui-services.woff2 +0 -0
  83. package/fonts/Socials/tui-socials.css +6 -6
  84. package/fonts/Socials/tui-socials.eot +0 -0
  85. package/fonts/Socials/tui-socials.less +6 -6
  86. package/fonts/Socials/tui-socials.module.less +6 -6
  87. package/fonts/Socials/tui-socials.scss +6 -6
  88. package/fonts/Socials/tui-socials.styl +6 -6
  89. package/fonts/Socials/tui-socials.ttf +0 -0
  90. package/fonts/Socials/tui-socials.woff +0 -0
  91. package/fonts/Socials/tui-socials.woff2 +0 -0
  92. package/fonts/Transports/tui-transports.css +6 -6
  93. package/fonts/Transports/tui-transports.eot +0 -0
  94. package/fonts/Transports/tui-transports.less +6 -6
  95. package/fonts/Transports/tui-transports.module.less +6 -6
  96. package/fonts/Transports/tui-transports.scss +6 -6
  97. package/fonts/Transports/tui-transports.styl +6 -6
  98. package/fonts/Transports/tui-transports.ttf +0 -0
  99. package/fonts/Transports/tui-transports.woff +0 -0
  100. package/fonts/Transports/tui-transports.woff2 +0 -0
  101. package/fonts/Utilities/tui-utilities.css +6 -6
  102. package/fonts/Utilities/tui-utilities.eot +0 -0
  103. package/fonts/Utilities/tui-utilities.less +6 -6
  104. package/fonts/Utilities/tui-utilities.module.less +6 -6
  105. package/fonts/Utilities/tui-utilities.scss +6 -6
  106. package/fonts/Utilities/tui-utilities.styl +6 -6
  107. package/fonts/Utilities/tui-utilities.ttf +0 -0
  108. package/fonts/Utilities/tui-utilities.woff +0 -0
  109. package/fonts/Utilities/tui-utilities.woff2 +0 -0
  110. package/molecules/Forms/DateField.js +46 -43
  111. package/molecules/Forms/FormControl.d.ts +4 -3
  112. package/molecules/Forms/FormControl.js +22 -21
  113. package/molecules/Forms/FormLabel.d.ts +4 -17
  114. package/molecules/Forms/FormLabel.js +24 -19
  115. package/molecules/Forms/NumberField.d.ts +3 -3
  116. package/molecules/Forms/NumberField.js +39 -36
  117. package/molecules/Forms/Password/Password.js +35 -32
  118. package/molecules/Forms/Select.d.ts +10 -0
  119. package/molecules/Forms/Select.js +102 -0
  120. package/molecules/Forms/TextField.d.ts +0 -1
  121. package/molecules/Forms/TextField.js +47 -47
  122. package/package.json +1 -1
  123. package/styles/globals.css +4 -0
@@ -1,55 +1,58 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import { c as m } from "../../../index-Cu0xwYjD.js";
3
- import { useId as j, useState as M, useEffect as P } from "react";
4
- import { useValue as S } from "../../../hooks/useValue.js";
5
- import { FormControl as T } from "../FormControl.js";
3
+ import { useId as M, useState as P, useEffect as S } from "react";
4
+ import { useValue as T } from "../../../hooks/useValue.js";
5
+ import { FormControl as D } from "../FormControl.js";
6
6
  import { Icon as n } from "../../../atoms/Icons/Icon.js";
7
7
  import "../../../atoms/Icons/contexts/IconsContext.js";
8
- import { ValidationMessage as D } from "./ValidationMessage.js";
9
- function J(u) {
10
- const f = j(), {
11
- id: r = f,
8
+ import { ValidationMessage as F } from "./ValidationMessage.js";
9
+ function K(f) {
10
+ const b = M(), {
11
+ id: r = b,
12
12
  name: o = r,
13
- label: b,
14
- value: x,
13
+ label: x,
14
+ value: g,
15
15
  disabled: d = !1,
16
+ required: c = !1,
16
17
  validationStatus: e = "default",
17
- errorMessage: g,
18
- validationMessages: c = [],
18
+ errorMessage: h,
19
+ validationMessages: p = [],
19
20
  withoutFieldValidation: s = !1,
20
- className: h,
21
- onChange: v,
22
- dataTestId: w = "Password",
23
- ...y
24
- } = u, { value: N, setValue: C } = S({
21
+ className: v,
22
+ onChange: w,
23
+ dataTestId: y = "Password",
24
+ ...N
25
+ } = f, { value: C, setValue: V } = T({
25
26
  name: o,
26
- initialValue: x,
27
- onChange: v
28
- }), [t, p] = M("password");
29
- P(() => p(t), [t]);
30
- const V = () => p(t === "password" ? "text" : "password");
27
+ initialValue: g,
28
+ onChange: w
29
+ }), [t, u] = P("password");
30
+ S(() => u(t), [t]);
31
+ const k = () => u(t === "password" ? "text" : "password");
31
32
  return /* @__PURE__ */ i(
32
- T,
33
+ D,
33
34
  {
34
35
  id: r,
35
- label: b,
36
+ label: x,
36
37
  dataName: "Password",
37
- dataTestId: w,
38
+ dataTestId: y,
38
39
  disabled: d,
40
+ required: c,
39
41
  validationStatus: s ? "default" : e,
40
- errorMessage: g,
42
+ errorMessage: h,
41
43
  children: [
42
44
  /* @__PURE__ */ i("div", { className: "relative", children: [
43
45
  /* @__PURE__ */ a(
44
46
  "input",
45
47
  {
46
- ...y,
48
+ ...N,
47
49
  id: r,
48
50
  name: o,
49
51
  type: t,
50
- value: N,
52
+ value: C,
51
53
  disabled: d,
52
- onChange: (l) => C(l.target.value),
54
+ required: c,
55
+ onChange: (l) => V(l.target.value),
53
56
  className: m(
54
57
  "text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black",
55
58
  {
@@ -58,7 +61,7 @@ function J(u) {
58
61
  "border-red": !s && e === "error",
59
62
  "border-green": !s && e === "success"
60
63
  },
61
- h
64
+ v
62
65
  ),
63
66
  "aria-label": o
64
67
  }
@@ -77,7 +80,7 @@ function J(u) {
77
80
  {
78
81
  type: "button",
79
82
  className: "pointer-events-auto size-24 inline-flex",
80
- onClick: V,
83
+ onClick: k,
81
84
  children: /* @__PURE__ */ a(n, { name: t === "password" ? "Invisible" : "Visible", width: "24px", type: "svg" })
82
85
  }
83
86
  )
@@ -85,11 +88,11 @@ function J(u) {
85
88
  }
86
89
  )
87
90
  ] }),
88
- c.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: c.map(({ label: l, status: k }, I) => /* @__PURE__ */ a(D, { label: l, status: k }, I)) })
91
+ p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: I }, j) => /* @__PURE__ */ a(F, { label: l, status: I }, j)) })
89
92
  ]
90
93
  }
91
94
  );
92
95
  }
93
96
  export {
94
- J as Password
97
+ K as Password
95
98
  };
@@ -0,0 +1,10 @@
1
+ import { FormControlProps } from './FormControl.js';
2
+ import { IconicTypes } from '../../atoms/Icons';
3
+ import { SelectHTMLAttributes } from 'react';
4
+ export interface SelectProps<Value> extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {
5
+ description?: string;
6
+ iconType?: IconicTypes;
7
+ errorMessage?: string;
8
+ dataTestId?: string;
9
+ }
10
+ export declare const Select: <Value = string>(props: SelectProps<Value>) => import("react/jsx-runtime").JSX.Element;
@@ -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
+ };
@@ -5,7 +5,6 @@ export interface TextFieldProps<Value> extends FormControlProps<Value> {
5
5
  * Description text
6
6
  */
7
7
  description?: string;
8
- hasDropdown?: boolean;
9
8
  icon?: IconicNames;
10
9
  iconType?: IconicTypes;
11
10
  errorMessage?: string;
@@ -1,74 +1,75 @@
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 C } from "../../hooks/useValue.js";
4
- import { useInternalStatus as I } 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
- import { useId as F } from "react";
9
- const B = (u) => {
10
- const m = F(), {
11
- id: a = m,
12
- name: s = a,
8
+ import { useId as j } from "react";
9
+ const B = (p) => {
10
+ const u = j(), {
11
+ id: r = u,
12
+ name: a = r,
13
13
  label: x,
14
14
  value: b,
15
15
  description: f,
16
- validationStatus: c = "default",
17
- hasDropdown: o = !1,
18
- icon: l,
19
- iconType: n,
20
- errorMessage: h,
21
- disabled: i = !1,
22
- className: g,
16
+ validationStatus: n = "default",
17
+ icon: s,
18
+ iconType: d,
19
+ errorMessage: g,
20
+ disabled: l = !1,
21
+ required: c = !1,
22
+ className: h,
23
23
  dataTestId: v = "TextField",
24
- onChange: w,
25
- ...y
26
- } = u, { value: N, setValue: D } = C({ name: s, initialValue: b, onChange: w }), e = I({
27
- isDisabled: i,
28
- validationStatus: c
24
+ onChange: y,
25
+ ...w
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,
33
+ id: r,
34
34
  label: x,
35
35
  description: f,
36
36
  dataName: "TextField",
37
37
  dataTestId: v,
38
- disabled: i,
39
- validationStatus: c,
40
- errorMessage: h,
41
- children: /* @__PURE__ */ d("div", { className: "relative", children: [
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
- ...y,
46
- id: a,
47
- name: s,
48
- disabled: i,
46
+ ...w,
47
+ id: r,
48
+ name: a,
49
+ disabled: l,
50
+ required: c,
49
51
  value: N,
50
- onChange: (k) => D(k.target.value),
51
- className: p(
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]": l,
56
- "pe-[52px]": o || e === "error" || e === "success",
57
- "pe-[84px]": o && (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",
61
62
  "border-green": e === "success"
62
63
  },
63
- g
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 B = (u) => {
77
78
  }
78
79
  ),
79
80
  children: [
80
- l && /* @__PURE__ */ t(r, { name: l, 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: n }),
83
- e === "success" && /* @__PURE__ */ t(r, { name: "CheckDefault", width: "24px", type: n }),
84
- o && /* @__PURE__ */ t("button", { className: "pointer-events-auto", children: /* @__PURE__ */ t(r, { name: "ArrowDefaultDown", width: "24px", color: "black", type: n }) })
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubmed/trident-ui",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
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
+ select:invalid {
88
+ @apply text-middleGrey;
89
+ }
90
+
87
91
  .date-field {
88
92
  @apply appearance-none;
89
93
  }