@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,11 +1,11 @@
1
1
  @font-face {
2
2
  font-family: "tui-utilities";
3
- src: url('tui-utilities.eot?t=1717077244183'); /* IE9*/
4
- src: url('tui-utilities.eot?t=1717077244183#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
- url("tui-utilities.woff2?t=1717077244183") format("woff2"),
6
- url("tui-utilities.woff?t=1717077244183") format("woff"),
7
- url('tui-utilities.ttf?t=1717077244183') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
8
- url('tui-utilities.svg?t=1717077244183#tui-utilities') format('svg'); /* iOS 4.1- */
3
+ src: url('tui-utilities.eot?t=1717574137605'); /* IE9*/
4
+ src: url('tui-utilities.eot?t=1717574137605#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
+ url("tui-utilities.woff2?t=1717574137605") format("woff2"),
6
+ url("tui-utilities.woff?t=1717574137605") format("woff"),
7
+ url('tui-utilities.ttf?t=1717574137605') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
8
+ url('tui-utilities.svg?t=1717574137605#tui-utilities') format('svg'); /* iOS 4.1- */
9
9
  }
10
10
 
11
11
  [class^="tui-utilities-"], [class*=" tui-utilities-"] {
Binary file
@@ -1,10 +1,10 @@
1
1
  @font-face {font-family: "tui-utilities";
2
- src: url('tui-utilities.eot?t=1717077244183'); /* IE9*/
3
- src: url('tui-utilities.eot?t=1717077244183#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
- url("tui-utilities.woff2?t=1717077244183") format("woff2"),
5
- url("tui-utilities.woff?t=1717077244183") format("woff"),
6
- url('tui-utilities.ttf?t=1717077244183') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
- url('tui-utilities.svg?t=1717077244183#tui-utilities') format('svg'); /* iOS 4.1- */
2
+ src: url('tui-utilities.eot?t=1717574137605'); /* IE9*/
3
+ src: url('tui-utilities.eot?t=1717574137605#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
+ url("tui-utilities.woff2?t=1717574137605") format("woff2"),
5
+ url("tui-utilities.woff?t=1717574137605") format("woff"),
6
+ url('tui-utilities.ttf?t=1717574137605') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
+ url('tui-utilities.svg?t=1717574137605#tui-utilities') format('svg'); /* iOS 4.1- */
8
8
  }
9
9
 
10
10
  [class^="tui-utilities-"], [class*=" tui-utilities-"] {
@@ -1,10 +1,10 @@
1
1
  @font-face {font-family: "tui-utilities";
2
- src: url('tui-utilities.eot?t=1717077244183'); /* IE9*/
3
- src: url('tui-utilities.eot?t=1717077244183#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
- url("tui-utilities.woff2?t=1717077244183") format("woff2"),
5
- url("tui-utilities.woff?t=1717077244183") format("woff"),
6
- url('tui-utilities.ttf?t=1717077244183') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
- url('tui-utilities.svg?t=1717077244183#tui-utilities') format('svg'); /* iOS 4.1- */
2
+ src: url('tui-utilities.eot?t=1717574137605'); /* IE9*/
3
+ src: url('tui-utilities.eot?t=1717574137605#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
+ url("tui-utilities.woff2?t=1717574137605") format("woff2"),
5
+ url("tui-utilities.woff?t=1717574137605") format("woff"),
6
+ url('tui-utilities.ttf?t=1717574137605') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
+ url('tui-utilities.svg?t=1717574137605#tui-utilities') format('svg'); /* iOS 4.1- */
8
8
  }
9
9
 
10
10
  [class^="tui-utilities-"], [class*=" tui-utilities-"] {
@@ -1,10 +1,10 @@
1
1
  @font-face {font-family: "tui-utilities";
2
- src: url('tui-utilities.eot?t=1717077244183'); /* IE9*/
3
- src: url('tui-utilities.eot?t=1717077244183#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
- url("tui-utilities.woff2?t=1717077244183") format("woff2"),
5
- url("tui-utilities.woff?t=1717077244183") format("woff"),
6
- url('tui-utilities.ttf?t=1717077244183') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
- url('tui-utilities.svg?t=1717077244183#tui-utilities') format('svg'); /* iOS 4.1- */
2
+ src: url('tui-utilities.eot?t=1717574137605'); /* IE9*/
3
+ src: url('tui-utilities.eot?t=1717574137605#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
+ url("tui-utilities.woff2?t=1717574137605") format("woff2"),
5
+ url("tui-utilities.woff?t=1717574137605") format("woff"),
6
+ url('tui-utilities.ttf?t=1717574137605') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
+ url('tui-utilities.svg?t=1717574137605#tui-utilities') format('svg'); /* iOS 4.1- */
8
8
  }
9
9
 
10
10
  [class^="tui-utilities-"], [class*=" tui-utilities-"] {
@@ -1,10 +1,10 @@
1
1
  @font-face {font-family: "tui-utilities";
2
- src: url('tui-utilities.eot?t=1717077244183'); /* IE9*/
3
- src: url('tui-utilities.eot?t=1717077244183#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
- url("tui-utilities.woff2?t=1717077244183") format("woff2"),
5
- url("tui-utilities.woff?t=1717077244183") format("woff"),
6
- url('tui-utilities.ttf?t=1717077244183') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
- url('tui-utilities.svg?t=1717077244183#tui-utilities') format('svg'); /* iOS 4.1- */
2
+ src: url('tui-utilities.eot?t=1717574137605'); /* IE9*/
3
+ src: url('tui-utilities.eot?t=1717574137605#iefix') format('embedded-opentype'), /* IE6-IE8 */
4
+ url("tui-utilities.woff2?t=1717574137605") format("woff2"),
5
+ url("tui-utilities.woff?t=1717574137605") format("woff"),
6
+ url('tui-utilities.ttf?t=1717574137605') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7
+ url('tui-utilities.svg?t=1717574137605#tui-utilities') format('svg'); /* iOS 4.1- */
8
8
  }
9
9
 
10
10
  [class^="tui-utilities-"], [class*=" tui-utilities-"] {
Binary file
Binary file
Binary file
@@ -1,11 +1,11 @@
1
- import { jsx as m, jsxs as y } from "react/jsx-runtime";
1
+ import { jsx as m, jsxs as x } from "react/jsx-runtime";
2
2
  import { c as E } from "../../index-Cu0xwYjD.js";
3
- import { useId as V, useRef as _ } from "react";
3
+ import { useId as _, useRef as z } from "react";
4
4
  import { Icon as I } from "../../atoms/Icons/Icon.js";
5
5
  import "../../atoms/Icons/contexts/IconsContext.js";
6
- import { useValue as z } from "../../hooks/useValue.js";
7
- import { useInternalStatus as G } from "../../hooks/useInternalStatus.js";
8
- import { FormControl as Z } from "./FormControl.js";
6
+ import { useValue as G } from "../../hooks/useValue.js";
7
+ import { useInternalStatus as Z } from "../../hooks/useInternalStatus.js";
8
+ import { FormControl as $ } from "./FormControl.js";
9
9
  function T(t) {
10
10
  "@babel/helpers - typeof";
11
11
  return T = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -18,7 +18,7 @@ function F(t, e) {
18
18
  if (e.length < t)
19
19
  throw new TypeError(t + " argument" + (t > 1 ? "s" : "") + " required, but only " + e.length + " present");
20
20
  }
21
- function $(t) {
21
+ function q(t) {
22
22
  F(1, arguments);
23
23
  var e = Object.prototype.toString.call(t);
24
24
  return t instanceof Date || T(t) === "object" && e === "[object Date]" ? new Date(t.getTime()) : typeof t == "number" || e === "[object Number]" ? new Date(t) : ((typeof t == "string" || e === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
@@ -31,7 +31,7 @@ function l(t, e) {
31
31
  function A(t, e) {
32
32
  var i, a;
33
33
  F(1, arguments);
34
- var o = $(t);
34
+ var o = q(t);
35
35
  if (isNaN(o.getTime()))
36
36
  throw new RangeError("Invalid time value");
37
37
  var d = String((i = e == null ? void 0 : e.format) !== null && i !== void 0 ? i : "extended"), c = String((a = e == null ? void 0 : e.representation) !== null && a !== void 0 ? a : "complete");
@@ -39,25 +39,25 @@ function A(t, e) {
39
39
  throw new RangeError("format must be 'extended' or 'basic'");
40
40
  if (c !== "date" && c !== "time" && c !== "complete")
41
41
  throw new RangeError("representation must be 'date', 'time', or 'complete'");
42
- var s = "", f = "", g = d === "extended" ? "-" : "", x = d === "extended" ? ":" : "";
42
+ var s = "", f = "", g = d === "extended" ? "-" : "", w = d === "extended" ? ":" : "";
43
43
  if (c !== "time") {
44
- var r = l(o.getDate(), 2), w = l(o.getMonth() + 1, 2), D = l(o.getFullYear(), 4);
45
- s = "".concat(D).concat(g).concat(w).concat(g).concat(r);
44
+ var r = l(o.getDate(), 2), v = l(o.getMonth() + 1, 2), D = l(o.getFullYear(), 4);
45
+ s = "".concat(D).concat(g).concat(v).concat(g).concat(r);
46
46
  }
47
47
  if (c !== "date") {
48
48
  var p = o.getTimezoneOffset();
49
49
  if (p !== 0) {
50
- var v = Math.abs(p), b = l(Math.floor(v / 60), 2), S = l(v % 60, 2), h = p < 0 ? "+" : "-";
51
- f = "".concat(h).concat(b, ":").concat(S);
50
+ var h = Math.abs(p), S = l(Math.floor(h / 60), 2), b = l(h % 60, 2), N = p < 0 ? "+" : "-";
51
+ f = "".concat(N).concat(S, ":").concat(b);
52
52
  } else
53
53
  f = "Z";
54
- var n = l(o.getHours(), 2), N = l(o.getMinutes(), 2), k = l(o.getSeconds(), 2), j = s === "" ? "" : "T", C = [n, N, k].join(x);
54
+ var y = l(o.getHours(), 2), n = l(o.getMinutes(), 2), k = l(o.getSeconds(), 2), j = s === "" ? "" : "T", C = [y, n, k].join(w);
55
55
  s = "".concat(s).concat(j).concat(C).concat(f);
56
56
  }
57
57
  return s;
58
58
  }
59
- const M = (t) => t ? A(t, { representation: "date" }) : "", U = (t) => {
60
- const e = V(), {
59
+ const M = (t) => t ? A(t, { representation: "date" }) : "", W = (t) => {
60
+ const e = _(), {
61
61
  id: i = e,
62
62
  name: a = i,
63
63
  label: o,
@@ -66,44 +66,46 @@ const M = (t) => t ? A(t, { representation: "date" }) : "", U = (t) => {
66
66
  validationStatus: s = "default",
67
67
  icon: f = "CalendarDefault",
68
68
  iconType: g,
69
- errorMessage: x,
69
+ errorMessage: w,
70
70
  disabled: r = !1,
71
- dataTestId: w = "DateField",
72
- value: D,
73
- min: p,
74
- max: v,
71
+ required: v = !1,
72
+ dataTestId: D = "DateField",
73
+ value: p,
74
+ min: h,
75
+ max: S,
75
76
  onChange: b,
76
- ...S
77
- } = t, h = _(null), n = G({
77
+ ...N
78
+ } = t, y = z(null), n = Z({
78
79
  isDisabled: r,
79
80
  validationStatus: s
80
- }), { setValue: N, value: k } = z({
81
+ }), { setValue: k, value: j } = G({
81
82
  name: a,
82
83
  formatter: M,
83
- initialValue: D,
84
- onChange: (u, P) => b == null ? void 0 : b(u, new Date(P))
85
- }), j = M(p), C = M(v), O = (u) => {
86
- N(u.target.value);
87
- }, R = () => {
84
+ initialValue: p,
85
+ onChange: (u, V) => b == null ? void 0 : b(u, new Date(V))
86
+ }), C = M(h), O = M(S), R = (u) => {
87
+ k(u.target.value);
88
+ }, P = () => {
88
89
  var u;
89
- (u = h.current) == null || u.showPicker();
90
+ (u = y.current) == null || u.showPicker();
90
91
  };
91
92
  return /* @__PURE__ */ m(
92
- Z,
93
+ $,
93
94
  {
94
95
  id: i,
95
96
  label: o,
96
97
  description: d,
97
98
  dataName: "DateField",
98
- dataTestId: w,
99
+ dataTestId: D,
99
100
  disabled: r,
101
+ required: v,
100
102
  validationStatus: s,
101
- errorMessage: x,
102
- children: /* @__PURE__ */ y("div", { className: "relative", children: [
103
+ errorMessage: w,
104
+ children: /* @__PURE__ */ x("div", { className: "relative", children: [
103
105
  /* @__PURE__ */ m(
104
106
  "input",
105
107
  {
106
- ...S,
108
+ ...N,
107
109
  type: "date",
108
110
  className: E(
109
111
  "text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none",
@@ -118,14 +120,15 @@ const M = (t) => t ? A(t, { representation: "date" }) : "", U = (t) => {
118
120
  ),
119
121
  id: i,
120
122
  disabled: r,
121
- ref: h,
122
- value: k,
123
- min: j,
124
- max: C,
125
- onChange: O
123
+ required: v,
124
+ ref: y,
125
+ value: j,
126
+ min: C,
127
+ max: O,
128
+ onChange: R
126
129
  }
127
130
  ),
128
- /* @__PURE__ */ y(
131
+ /* @__PURE__ */ x(
129
132
  "div",
130
133
  {
131
134
  className: E(
@@ -137,11 +140,11 @@ const M = (t) => t ? A(t, { representation: "date" }) : "", U = (t) => {
137
140
  }
138
141
  ),
139
142
  children: [
140
- /* @__PURE__ */ y("button", { className: "pointer-events-auto leading-none", onClick: R, children: [
143
+ /* @__PURE__ */ x("button", { className: "pointer-events-auto leading-none", onClick: P, children: [
141
144
  /* @__PURE__ */ m(I, { name: f, iconType: g, width: "24px" }),
142
145
  /* @__PURE__ */ m("span", { className: "sr-only", children: c })
143
146
  ] }),
144
- /* @__PURE__ */ y("span", { className: "ms-auto flex gap-x-8", children: [
147
+ /* @__PURE__ */ x("span", { className: "ms-auto flex gap-x-8", children: [
145
148
  n === "error" && /* @__PURE__ */ m(I, { name: "CrossDefault", width: "24px" }),
146
149
  n === "success" && /* @__PURE__ */ m(I, { name: "CheckDefault", width: "24px" })
147
150
  ] })
@@ -153,5 +156,5 @@ const M = (t) => t ? A(t, { representation: "date" }) : "", U = (t) => {
153
156
  );
154
157
  };
155
158
  export {
156
- U as DateField
159
+ W as DateField
157
160
  };
@@ -1,12 +1,13 @@
1
- import { HTMLAttributes, InputHTMLAttributes, PropsWithChildren } from 'react';
1
+ import { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { ValidationStatus } from '../../hooks/useInternalStatus';
3
3
  import { FormLabelProps } from './FormLabel';
4
4
  export type FormControlProps<Value = unknown, Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>> = {
5
5
  value?: Value;
6
+ label?: ReactNode;
6
7
  validationStatus?: ValidationStatus;
7
8
  onChange?: (name: string, value: Value) => void;
8
9
  dataTestId?: string;
9
10
  dataName?: string;
10
11
  errorMessage?: string;
11
- } & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;
12
- export declare const FormControl: <Value = string>({ id, label, description, disabled, className, validationStatus, children, errorMessage, dataTestId, dataName, layout, }: PropsWithChildren<FormControlProps<Value, InputHTMLAttributes<HTMLInputElement>>>) => import("react/jsx-runtime").JSX.Element;
12
+ } & Omit<Attributes, 'onChange' | 'value'> & Partial<FormLabelProps>;
13
+ export declare const FormControl: <Value = string>({ id, label, description, disabled, required, className, validationStatus, children, errorMessage, dataTestId, dataName, layout, }: FormControlProps<Value, InputHTMLAttributes<HTMLInputElement>>) => import("react/jsx-runtime").JSX.Element;
@@ -1,37 +1,38 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import { useInternalStatus as f } from "../../hooks/useInternalStatus.js";
3
- import { FormLabel as u } from "./FormLabel.js";
4
- import { Icon as h } from "../../atoms/Icons/Icon.js";
2
+ import { useInternalStatus as u } from "../../hooks/useInternalStatus.js";
3
+ import { FormLabel as h } from "./FormLabel.js";
4
+ import { Icon as b } from "../../atoms/Icons/Icon.js";
5
5
  import "../../atoms/Icons/contexts/IconsContext.js";
6
- import { c as b } from "../../index-Cu0xwYjD.js";
7
- const v = ({
6
+ import { c as j } from "../../index-Cu0xwYjD.js";
7
+ const w = ({
8
8
  id: t,
9
9
  label: r,
10
10
  description: s,
11
11
  disabled: m,
12
- className: n,
13
- validationStatus: i = "default",
14
- children: l,
12
+ required: n,
13
+ className: i,
14
+ validationStatus: l = "default",
15
+ children: p,
15
16
  errorMessage: a,
16
- dataTestId: p,
17
- dataName: c,
18
- layout: x
17
+ dataTestId: c,
18
+ dataName: x,
19
+ layout: d
19
20
  }) => {
20
- const d = f({
21
+ const f = u({
21
22
  isDisabled: !!m,
22
- validationStatus: i
23
+ validationStatus: l
23
24
  });
24
25
  return /* @__PURE__ */ e(
25
26
  "div",
26
27
  {
27
- className: b("flex flex-col gap-4", n),
28
- "data-name": c,
29
- "data-testid": p,
28
+ className: j("flex flex-col gap-4", i),
29
+ "data-name": x,
30
+ "data-testid": c,
30
31
  children: [
31
- r && t && /* @__PURE__ */ o(u, { description: s, id: t, layout: x, children: r }),
32
- l,
33
- d === "error" && a && /* @__PURE__ */ e("span", { className: "text-red text-b4 flex items-start gap-x-4 px-20", children: [
34
- /* @__PURE__ */ o(h, { name: "Error", width: "20px" }),
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: [
35
+ /* @__PURE__ */ o(b, { name: "Error", width: "20px" }),
35
36
  a
36
37
  ] })
37
38
  ]
@@ -39,5 +40,5 @@ const v = ({
39
40
  );
40
41
  };
41
42
  export {
42
- v as FormControl
43
+ w as FormControl
43
44
  };
@@ -1,20 +1,7 @@
1
- import { FunctionComponent, LabelHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
- export interface FormLabelProps extends PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>> {
3
- /**
4
- * Label text or use Children
5
- */
6
- label?: string | ReactNode | undefined;
7
- /**
8
- * Description text
9
- */
1
+ import { LabelHTMLAttributes } from 'react';
2
+ export interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
10
3
  description?: string;
11
- /**
12
- * Layout of the label
13
- */
14
4
  layout?: 'horizontal' | 'vertical';
15
- /**
16
- * Additional class names
17
- */
18
- className?: string;
5
+ required?: boolean;
19
6
  }
20
- export declare const FormLabel: FunctionComponent<FormLabelProps>;
7
+ export declare const FormLabel: ({ id, description, layout, required, className, children, ...rest }: FormLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,34 @@
1
- import { jsxs as n, jsx as m } from "react/jsx-runtime";
2
- import { c as x } from "../../index-Cu0xwYjD.js";
3
- const c = {
4
- horizontal: "flex flex-wrap items-center gap-x-12 px-20",
5
- vertical: "flex flex-col items-start"
6
- }, f = ({
7
- children: t,
8
- label: l,
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
+ import { c } from "../../index-Cu0xwYjD.js";
3
+ const b = ({
4
+ id: l,
9
5
  description: e,
10
- id: a,
11
- layout: o = "horizontal",
12
- className: r,
13
- ...s
14
- }) => /* @__PURE__ */ n(
6
+ layout: t = "horizontal",
7
+ required: r,
8
+ className: s,
9
+ children: m,
10
+ ...n
11
+ }) => /* @__PURE__ */ o(
15
12
  "label",
16
13
  {
17
- ...s,
18
- htmlFor: a,
19
- className: x("text-b3 font-semibold text-black", c[o], r),
14
+ ...n,
15
+ htmlFor: l,
16
+ className: c(
17
+ "text-b3 font-semibold text-black flex",
18
+ {
19
+ "flex-wrap items-center ps-20": t === "horizontal",
20
+ "flex-col items-start": t === "vertical"
21
+ },
22
+ s
23
+ ),
20
24
  "data-name": "InputLabel",
21
25
  children: [
22
- l || t,
23
- e && /* @__PURE__ */ m("span", { className: "text-b4 text-middleGrey inline-block font-normal", children: e })
26
+ m,
27
+ r && /* @__PURE__ */ a("span", { children: "*" }),
28
+ e && /* @__PURE__ */ a("span", { className: "ms-12 text-b4 text-grey font-normal", children: e })
24
29
  ]
25
30
  }
26
31
  );
27
32
  export {
28
- f as FormLabel
33
+ b as FormLabel
29
34
  };
@@ -15,6 +15,7 @@ export declare function useNumberField(props: NumberFieldProps): {
15
15
  handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
16
16
  increase: () => void;
17
17
  decrease: () => void;
18
+ label?: import("react").ReactNode;
18
19
  validationStatus?: import("../../hooks/useInternalStatus").ValidationStatus | undefined;
19
20
  dataName?: string | undefined;
20
21
  errorMessage?: string | undefined;
@@ -28,7 +29,6 @@ export declare function useNumberField(props: NumberFieldProps): {
28
29
  form?: string | undefined;
29
30
  list?: string | undefined;
30
31
  role?: import("react").AriaRole | undefined;
31
- label?: import("react").ReactNode;
32
32
  slot?: string | undefined;
33
33
  title?: string | undefined;
34
34
  pattern?: string | undefined;
@@ -310,9 +310,9 @@ export declare function useNumberField(props: NumberFieldProps): {
310
310
  required?: boolean | undefined;
311
311
  size?: number | undefined;
312
312
  step?: string | number | undefined;
313
- htmlFor?: string | undefined;
314
- layout?: "horizontal" | "vertical" | undefined;
315
313
  description?: string | undefined;
314
+ layout?: "horizontal" | "vertical" | undefined;
315
+ htmlFor?: string | undefined;
316
316
  };
317
317
  export declare const NumberField: (props: NumberFieldProps) => import("react/jsx-runtime").JSX.Element;
318
318
  export {};
@@ -1,23 +1,23 @@
1
- import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
- import { c as v } from "../../index-Cu0xwYjD.js";
3
- import { useId as C } from "react";
4
- import { useValue as y } from "../../hooks/useValue.js";
5
- import { Button as x } from "../Buttons/Button.js";
6
- import { FormControl as I } from "./FormControl.js";
7
- const w = { width: "28px", height: "28px" };
8
- function F(m) {
9
- const e = C(), {
1
+ import { jsx as o, jsxs as v } from "react/jsx-runtime";
2
+ import { c as C } from "../../index-Cu0xwYjD.js";
3
+ import { useId as y } from "react";
4
+ import { useValue as I } from "../../hooks/useValue.js";
5
+ import { Button as N } from "../Buttons/Button.js";
6
+ import { FormControl as w } from "./FormControl.js";
7
+ const F = { width: "28px", height: "28px" };
8
+ function V(m) {
9
+ const e = y(), {
10
10
  id: n = e,
11
- name: l = n,
11
+ name: r = n,
12
12
  value: c = 0,
13
13
  onChange: d,
14
14
  min: t = 0,
15
- max: r = 10,
15
+ max: l = 10,
16
16
  disabled: i = !1,
17
17
  dataTestId: u = "NumberField",
18
18
  ...f
19
- } = m, { value: a, setValue: s } = y({
20
- name: l,
19
+ } = m, { value: a, setValue: s } = I({
20
+ name: r,
21
21
  defaultValue: c,
22
22
  formatter: Number,
23
23
  onChange: d
@@ -26,17 +26,17 @@ function F(m) {
26
26
  ...f,
27
27
  id: n,
28
28
  min: t,
29
- max: r,
30
- name: l,
29
+ max: l,
30
+ name: r,
31
31
  value: a,
32
32
  dataTestId: u,
33
33
  disabled: i,
34
- handleChange: (N) => {
35
- const b = Number(N.target.value);
36
- b >= t && b <= r && s(Number(b));
34
+ handleChange: (g) => {
35
+ const h = Number(g.target.value);
36
+ h >= t && h <= l && s(Number(h));
37
37
  },
38
38
  increase: () => {
39
- a < r && s(a + 1);
39
+ a < l && s(a + 1);
40
40
  },
41
41
  decrease: () => {
42
42
  a > t && s(a - 1);
@@ -47,35 +47,37 @@ const k = (m) => {
47
47
  const {
48
48
  disabled: e,
49
49
  min: n,
50
- max: l,
50
+ max: r,
51
51
  label: c,
52
52
  description: d,
53
53
  id: t,
54
- dataTestId: r,
54
+ dataTestId: l,
55
55
  value: i,
56
56
  handleChange: u,
57
57
  increase: f,
58
58
  decrease: a,
59
59
  errorMessage: s,
60
- validationStatus: h,
61
- ...p
62
- } = F(m);
60
+ validationStatus: p,
61
+ required: b,
62
+ ...x
63
+ } = V(m);
63
64
  return /* @__PURE__ */ o(
64
- I,
65
+ w,
65
66
  {
66
67
  id: t,
67
68
  label: c,
68
69
  description: d,
69
70
  className: "flex items-center justify-between",
70
71
  dataName: "NumberField",
71
- dataTestId: r,
72
+ dataTestId: l,
72
73
  errorMessage: s,
73
- validationStatus: h,
74
+ validationStatus: p,
74
75
  disabled: e,
76
+ required: b,
75
77
  layout: "vertical",
76
- children: /* @__PURE__ */ g("div", { className: "flex items-center gap-x-8", children: [
78
+ children: /* @__PURE__ */ v("div", { className: "flex items-center gap-x-8", children: [
77
79
  /* @__PURE__ */ o(
78
- x,
80
+ N,
79
81
  {
80
82
  theme: "yellow",
81
83
  onClick: a,
@@ -88,27 +90,28 @@ const k = (m) => {
88
90
  /* @__PURE__ */ o(
89
91
  "input",
90
92
  {
91
- ...p,
92
- className: v("text-b2 text-center font-normal outline-none", {
93
+ ...x,
94
+ className: C("text-b2 text-center font-normal outline-none", {
93
95
  "bg-pearl text-grey": e
94
96
  }),
95
- style: w,
97
+ style: F,
96
98
  type: "number",
97
99
  id: t,
98
100
  onChange: u,
99
101
  disabled: e,
102
+ required: b,
100
103
  value: i,
101
104
  min: n,
102
- max: l
105
+ max: r
103
106
  }
104
107
  ),
105
108
  /* @__PURE__ */ o(
106
- x,
109
+ N,
107
110
  {
108
111
  theme: "yellow",
109
112
  onClick: f,
110
113
  variant: "icon",
111
- disabled: i >= l || e,
114
+ disabled: i >= r || e,
112
115
  icon: "PlusDefault",
113
116
  label: "PLUS"
114
117
  }
@@ -119,5 +122,5 @@ const k = (m) => {
119
122
  };
120
123
  export {
121
124
  k as NumberField,
122
- F as useNumberField
125
+ V as useNumberField
123
126
  };