@clubmed/trident-ui 1.3.0-beta.4 → 1.3.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/assets/style.css +1 -1
  3. package/chunks/_commonjsHelpers.js +24 -4
  4. package/chunks/_commonjsHelpers.js.map +1 -1
  5. package/chunks/index.js.map +1 -1
  6. package/chunks/plugin.js +53 -0
  7. package/chunks/plugin.js.map +1 -0
  8. package/contexts/Device.d.ts +2 -22
  9. package/contexts/Device.js +5 -59
  10. package/contexts/Device.js.map +1 -1
  11. package/contexts/Devices/Device.d.ts +11 -0
  12. package/contexts/Devices/Device.js +23 -0
  13. package/contexts/Devices/Device.js.map +1 -0
  14. package/contexts/Devices/hooks/useQueries.d.ts +6 -0
  15. package/contexts/Devices/hooks/useQueries.js +24 -0
  16. package/contexts/Devices/hooks/useQueries.js.map +1 -0
  17. package/contexts/Devices/reducers/reducer.d.ts +25 -0
  18. package/contexts/Devices/reducers/reducer.js +50 -0
  19. package/contexts/Devices/reducers/reducer.js.map +1 -0
  20. package/contexts/TridentUIConfig.js +228 -228
  21. package/contexts/TridentUIConfig.js.map +1 -1
  22. package/hooks/keyboard.constants.js.map +1 -1
  23. package/hooks/useInternalStatus.js.map +1 -1
  24. package/hooks/useKeyboardControls.js.map +1 -1
  25. package/hooks/useSafeBoop.js.map +1 -1
  26. package/hooks/useValue.js.map +1 -1
  27. package/molecules/Arrows/Arrows.d.ts +16 -0
  28. package/molecules/Arrows/Arrows.js +66 -0
  29. package/molecules/Arrows/Arrows.js.map +1 -0
  30. package/molecules/Arrows/ArrowsLabels.d.js +2 -0
  31. package/molecules/Arrows/ArrowsLabels.d.js.map +1 -0
  32. package/molecules/Arrows.d.ts +1 -50
  33. package/molecules/Arrows.js +2 -56
  34. package/molecules/Arrows.js.map +1 -1
  35. package/molecules/Avatar.js.map +1 -1
  36. package/molecules/Backdrop.js.map +1 -1
  37. package/molecules/Breadcrumb.js.map +1 -1
  38. package/molecules/Buttons/ArrowButton.d.ts +7 -0
  39. package/molecules/Buttons/ArrowButton.js +14 -0
  40. package/molecules/Buttons/ArrowButton.js.map +1 -0
  41. package/molecules/Buttons/Button.d.ts +13 -34
  42. package/molecules/Buttons/Button.js +50 -42
  43. package/molecules/Buttons/Button.js.map +1 -1
  44. package/molecules/Buttons/ButtonAnchor.d.ts +2 -3
  45. package/molecules/Buttons/ButtonAnchor.js +14 -36
  46. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  47. package/molecules/Buttons/ButtonContent.d.ts +11 -3
  48. package/molecules/Buttons/ButtonContent.js +13 -6
  49. package/molecules/Buttons/ButtonContent.js.map +1 -1
  50. package/molecules/Buttons/FakeButton.d.ts +7 -0
  51. package/molecules/Buttons/FakeButton.js +27 -0
  52. package/molecules/Buttons/FakeButton.js.map +1 -0
  53. package/molecules/Buttons/InertButton.d.ts +4 -0
  54. package/molecules/Buttons/InertButton.js +14 -31
  55. package/molecules/Buttons/InertButton.js.map +1 -1
  56. package/molecules/Buttons/v2/Button.d.ts +10 -0
  57. package/molecules/Buttons/v2/Button.js +32 -0
  58. package/molecules/Buttons/v2/Button.js.map +1 -0
  59. package/molecules/Buttons/v2/Button.type.d.ts +54 -0
  60. package/molecules/Buttons/v2/Button.type.js +42 -0
  61. package/molecules/Buttons/v2/Button.type.js.map +1 -0
  62. package/molecules/Buttons/v2/ButtonAnchor.d.ts +12 -0
  63. package/molecules/Buttons/v2/ButtonAnchor.js +32 -0
  64. package/molecules/Buttons/v2/ButtonAnchor.js.map +1 -0
  65. package/molecules/Card.js.map +1 -1
  66. package/molecules/ElasticHeight.js.map +1 -1
  67. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  68. package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
  69. package/molecules/Forms/DateField.js +142 -115
  70. package/molecules/Forms/DateField.js.map +1 -1
  71. package/molecules/Forms/Filter.js.map +1 -1
  72. package/molecules/Forms/FormControl.js.map +1 -1
  73. package/molecules/Forms/FormLabel.js.map +1 -1
  74. package/molecules/Forms/NumberField.d.ts +15 -15
  75. package/molecules/Forms/NumberField.js +68 -68
  76. package/molecules/Forms/NumberField.js.map +1 -1
  77. package/molecules/Forms/Password/Password.js.map +1 -1
  78. package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
  79. package/molecules/Forms/Radios/Radio.js.map +1 -1
  80. package/molecules/Forms/Radios/RadioGroup.js +2 -2
  81. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  82. package/molecules/Forms/Range.js.map +1 -1
  83. package/molecules/Forms/Select.js.map +1 -1
  84. package/molecules/Forms/Switch.js.map +1 -1
  85. package/molecules/Forms/TextField.js.map +1 -1
  86. package/molecules/HamburgerIcon.js.map +1 -1
  87. package/molecules/Link.js.map +1 -1
  88. package/molecules/Loader.js.map +1 -1
  89. package/molecules/Pagination.d.ts +2 -1
  90. package/molecules/Pagination.helper.js.map +1 -1
  91. package/molecules/Pagination.js +67 -45
  92. package/molecules/Pagination.js.map +1 -1
  93. package/molecules/Popin.js +16 -16
  94. package/molecules/Popin.js.map +1 -1
  95. package/molecules/Spinner.js.map +1 -1
  96. package/molecules/Tabs/Tab.js.map +1 -1
  97. package/molecules/Tabs/TabList.js.map +1 -1
  98. package/molecules/Tabs/TabPanel.js.map +1 -1
  99. package/molecules/Tabs/Tabs.js.map +1 -1
  100. package/molecules/Tabs/TabsBody.js.map +1 -1
  101. package/molecules/Tabs/context/TabControl.js.map +1 -1
  102. package/molecules/Tabs/hooks/tabControl.js.map +1 -1
  103. package/molecules/Tabs/theme.js.map +1 -1
  104. package/package.json +11 -11
  105. package/styles/globals.css +12 -15
  106. package/tailwind/colors.d.ts +38 -0
  107. package/tailwind/colors.js +44 -0
  108. package/tailwind/colors.js.map +1 -0
  109. package/tailwind/plugins/animationDelay.d.ts +4 -0
  110. package/tailwind/plugins/animationDelay.js +15 -0
  111. package/tailwind/plugins/animationDelay.js.map +1 -0
  112. package/tailwind/plugins/hocus.d.ts +4 -0
  113. package/tailwind/plugins/hocus.js +11 -0
  114. package/tailwind/plugins/hocus.js.map +1 -0
  115. package/tailwind/plugins/lineClampFix.d.ts +4 -0
  116. package/tailwind/plugins/lineClampFix.js +13 -0
  117. package/tailwind/plugins/lineClampFix.js.map +1 -0
  118. package/tailwind/plugins/popover.d.ts +4 -0
  119. package/tailwind/plugins/popover.js +8 -0
  120. package/tailwind/plugins/popover.js.map +1 -0
  121. package/tailwind/plugins/startingStyle.d.ts +4 -0
  122. package/tailwind/plugins/startingStyle.js +8 -0
  123. package/tailwind/plugins/startingStyle.js.map +1 -0
  124. package/tailwind/plugins/transitionBehavior.d.ts +4 -0
  125. package/tailwind/plugins/transitionBehavior.js +11 -0
  126. package/tailwind/plugins/transitionBehavior.js.map +1 -0
  127. package/tailwind/tailwind.preset.d.ts +730 -510
  128. package/tailwind/tailwind.preset.js +705 -631
  129. package/tailwind/tailwind.preset.js.map +1 -1
  130. package/types/Colors.d.js +2 -0
  131. package/types/Colors.d.js.map +1 -0
  132. package/types/Devices.d.ts +8 -0
  133. package/types/Devices.js +11 -0
  134. package/types/Devices.js.map +1 -0
  135. package/types/Direction.d.js +2 -0
  136. package/types/Direction.d.js.map +1 -0
  137. package/types/ScrollerLabels.d.js +2 -0
  138. package/types/ScrollerLabels.d.js.map +1 -0
  139. package/molecules/Buttons/Button.helpers.d.ts +0 -8
  140. package/molecules/Buttons/Button.helpers.js +0 -12
  141. package/molecules/Buttons/Button.helpers.js.map +0 -1
  142. package/molecules/Buttons/Button.themes.d.ts +0 -1
  143. package/molecules/Buttons/Button.themes.js +0 -25
  144. package/molecules/Buttons/Button.themes.js.map +0 -1
@@ -1,154 +1,181 @@
1
- import { jsx as m, jsxs as x } from "react/jsx-runtime";
2
- import { c as E } from "../../chunks/index.js";
3
- import { useId as _, useRef as z } from "react";
4
- import { Icon as I } from "../../atoms/Icons/Icon.js";
1
+ import { jsx as p, jsxs as T } from "react/jsx-runtime";
2
+ import { c as q } from "../../chunks/index.js";
3
+ import { useId as A, useRef as B, useState as H, useCallback as L, useEffect as J } from "react";
4
+ import { Icon as E } from "../../atoms/Icons/Icon.js";
5
5
  import "@clubmed/trident-icons";
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
- function T(t) {
6
+ import { useValue as K } from "../../hooks/useValue.js";
7
+ import { useInternalStatus as Q } from "../../hooks/useInternalStatus.js";
8
+ import { FormControl as U } from "./FormControl.js";
9
+ function V(t) {
10
10
  "@babel/helpers - typeof";
11
- return T = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
11
+ return V = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
12
12
  return typeof e;
13
13
  } : function(e) {
14
14
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
15
- }, T(t);
15
+ }, V(t);
16
16
  }
17
- function F(t, e) {
17
+ function P(t, e) {
18
18
  if (e.length < t)
19
- throw new TypeError(t + " argument required, but only " + e.length + " present");
19
+ throw new TypeError(t + " argument" + (t > 1 ? "s" : "") + " required, but only " + e.length + " present");
20
20
  }
21
- function A(t) {
22
- F(1, arguments);
21
+ function z(t) {
22
+ P(1, arguments);
23
23
  var e = Object.prototype.toString.call(t);
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));
24
+ return t instanceof Date || V(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));
25
25
  }
26
- function l(t, e) {
27
- for (var i = t < 0 ? "-" : "", n = Math.abs(t).toString(); n.length < e; )
28
- n = "0" + n;
29
- return i + n;
26
+ function G(t, e) {
27
+ return P(2, arguments), z(t).getTime() - z(e).getTime();
30
28
  }
31
- function H(t, e) {
32
- var i, n;
33
- F(1, arguments);
34
- var o = A(t);
35
- if (isNaN(o.getTime()))
29
+ function m(t, e) {
30
+ for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; )
31
+ r = "0" + r;
32
+ return n + r;
33
+ }
34
+ function W(t, e) {
35
+ var n, r;
36
+ P(1, arguments);
37
+ var a = z(t);
38
+ if (isNaN(a.getTime()))
36
39
  throw new RangeError("Invalid time value");
37
- var d = String((i = e == null ? void 0 : e.format) !== null && i !== void 0 ? i : "extended"), c = String((n = e == null ? void 0 : e.representation) !== null && n !== void 0 ? n : "complete");
38
- if (d !== "extended" && d !== "basic")
40
+ var l = String((n = e == null ? void 0 : e.format) !== null && n !== void 0 ? n : "extended"), i = String((r = e == null ? void 0 : e.representation) !== null && r !== void 0 ? r : "complete");
41
+ if (l !== "extended" && l !== "basic")
39
42
  throw new RangeError("format must be 'extended' or 'basic'");
40
- if (c !== "date" && c !== "time" && c !== "complete")
43
+ if (i !== "date" && i !== "time" && i !== "complete")
41
44
  throw new RangeError("representation must be 'date', 'time', or 'complete'");
42
- var s = "", f = "", g = d === "extended" ? "-" : "", w = d === "extended" ? ":" : "";
43
- if (c !== "time") {
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);
45
+ var f = "", g = "", y = l === "extended" ? "-" : "", j = l === "extended" ? ":" : "";
46
+ if (i !== "time") {
47
+ var o = m(a.getDate(), 2), w = m(a.getMonth() + 1, 2), C = m(a.getFullYear(), 4);
48
+ f = "".concat(C).concat(y).concat(w).concat(y).concat(o);
46
49
  }
47
- if (c !== "date") {
48
- var p = o.getTimezoneOffset();
49
- if (p !== 0) {
50
- var h = Math.abs(p), S = l(Math.floor(h / 60), 2), N = l(h % 60, 2), b = p < 0 ? "+" : "-";
51
- f = "".concat(b).concat(S, ":").concat(N);
50
+ if (i !== "date") {
51
+ var b = a.getTimezoneOffset();
52
+ if (b !== 0) {
53
+ var x = Math.abs(b), u = m(Math.floor(x / 60), 2), d = m(x % 60, 2), v = b < 0 ? "+" : "-";
54
+ g = "".concat(v).concat(u, ":").concat(d);
52
55
  } else
53
- f = "Z";
54
- var k = l(o.getHours(), 2), y = l(o.getMinutes(), 2), a = l(o.getSeconds(), 2), j = s === "" ? "" : "T", C = [k, y, a].join(w);
55
- s = "".concat(s).concat(j).concat(C).concat(f);
56
+ g = "Z";
57
+ var F = m(a.getHours(), 2), S = m(a.getMinutes(), 2), M = m(a.getSeconds(), 2), N = f === "" ? "" : "T", s = [F, S, M].join(j);
58
+ f = "".concat(f).concat(N).concat(s).concat(g);
56
59
  }
57
- return s;
60
+ return f;
58
61
  }
59
- const M = (t) => t ? H(new Date(t), { representation: "date" }) : "", X = (t) => {
60
- const e = _(), {
61
- id: i = e,
62
- name: n = i,
63
- label: o,
64
- description: d,
65
- openDatepicker: c,
66
- validationStatus: s = "default",
67
- icon: f = "CalendarDefault",
68
- iconType: g,
69
- errorMessage: w,
70
- disabled: r = !1,
71
- required: v = !1,
72
- hideRequiredStar: D,
73
- dataTestId: p = "DateField",
74
- value: h,
75
- min: S,
76
- max: N,
77
- onChange: b,
78
- ...k
79
- } = t, y = z(null), a = Z({
80
- isDisabled: r,
81
- validationStatus: s
82
- }), { setValue: j, value: C } = G({
83
- name: n,
84
- formatter: M,
85
- initialValue: h,
86
- onChange: (u, V) => b == null ? void 0 : b(u, new Date(V))
87
- }), R = M(S), O = M(N), q = (u) => {
88
- j(u.target.value);
89
- }, P = () => {
90
- var u;
91
- (u = y.current) == null || u.showPicker();
92
- };
93
- return /* @__PURE__ */ m(
94
- $,
62
+ const O = (t) => t ? W(new Date(t), { representation: "date" }) : "", X = (t, e, n) => {
63
+ if (!t)
64
+ return !0;
65
+ const r = (i) => new Date(i.getFullYear(), i.getMonth(), i.getDate()), a = new Date(t), l = r(a);
66
+ return !(e && l < r(e) || n && l > r(n));
67
+ }, ce = (t) => {
68
+ const e = A(), {
69
+ id: n = e,
70
+ name: r = n,
71
+ label: a,
72
+ description: l,
73
+ openDatepicker: i,
74
+ validationStatus: f = "default",
75
+ icon: g = "CalendarDefault",
76
+ iconType: y,
77
+ errorMessage: j,
78
+ disabled: o = !1,
79
+ required: w = !1,
80
+ hideRequiredStar: C,
81
+ dataTestId: b = "DateField",
82
+ value: x,
83
+ min: u,
84
+ max: d,
85
+ onChange: v,
86
+ ...F
87
+ } = t, S = B(null), [M, N] = H(!1), s = Q({
88
+ isDisabled: o,
89
+ validationStatus: f
90
+ }), { setValue: h, value: D } = K({
91
+ name: r,
92
+ formatter: O,
93
+ initialValue: x,
94
+ onChange: (c, R) => v == null ? void 0 : v(c, new Date(R))
95
+ }), k = O(u), I = O(d), Y = (c) => {
96
+ h(c.target.value);
97
+ }, Z = () => {
98
+ var c;
99
+ (c = S.current) == null || c.showPicker();
100
+ }, _ = L(() => {
101
+ const c = new Date(D);
102
+ if (u && d) {
103
+ const R = Math.abs(G(c, u)), $ = Math.abs(G(c, d));
104
+ h(R <= $ ? k : I);
105
+ return;
106
+ }
107
+ if (u) {
108
+ h(k);
109
+ return;
110
+ }
111
+ if (d) {
112
+ h(I);
113
+ return;
114
+ }
115
+ }, [d, u, I, k, h, D]);
116
+ return J(() => {
117
+ !X(D, u, d) && !M && _();
118
+ }, [_, d, u, M, D]), /* @__PURE__ */ p(
119
+ U,
95
120
  {
96
- id: i,
97
- label: o,
98
- description: d,
121
+ id: n,
122
+ label: a,
123
+ description: l,
99
124
  dataName: "DateField",
100
- dataTestId: p,
101
- disabled: r,
102
- required: v,
103
- hideRequiredStar: D,
104
- validationStatus: s,
105
- errorMessage: w,
106
- children: /* @__PURE__ */ x("div", { className: "relative", children: [
107
- /* @__PURE__ */ m(
125
+ dataTestId: b,
126
+ disabled: o,
127
+ required: w,
128
+ hideRequiredStar: C,
129
+ validationStatus: f,
130
+ errorMessage: j,
131
+ children: /* @__PURE__ */ T("div", { className: "relative", children: [
132
+ /* @__PURE__ */ p(
108
133
  "input",
109
134
  {
110
- ...k,
135
+ ...F,
111
136
  type: "date",
112
- className: E(
137
+ className: q(
113
138
  "text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none",
114
139
  {
115
- "border-lightGrey focus:border-black active:border-black": a === "default",
116
- "pe-[52px]": a === "error" || a === "success",
117
- "bg-pearl text-grey": r,
118
- "bg-white text-black": !r,
119
- "border-red": !r && a === "error",
120
- "border-green": !r && a === "success"
140
+ "border-lightGrey focus:border-black active:border-black": s === "default",
141
+ "pe-[52px]": s === "error" || s === "success",
142
+ "bg-pearl text-grey": o,
143
+ "bg-white text-black": !o,
144
+ "border-red": !o && s === "error",
145
+ "border-green": !o && s === "success"
121
146
  }
122
147
  ),
123
- id: i,
124
- disabled: r,
125
- required: v,
126
- ref: y,
127
- value: C,
128
- min: R,
129
- max: O,
130
- onChange: q
148
+ id: n,
149
+ disabled: o,
150
+ required: w,
151
+ ref: S,
152
+ value: D,
153
+ min: k,
154
+ max: I,
155
+ onChange: Y,
156
+ onFocus: () => N(!0),
157
+ onBlur: () => N(!1)
131
158
  }
132
159
  ),
133
- /* @__PURE__ */ x(
160
+ /* @__PURE__ */ T(
134
161
  "div",
135
162
  {
136
- className: E(
163
+ className: q(
137
164
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
138
165
  {
139
- "text-grey": r,
140
- "text-red": !r && a === "error",
141
- "text-green": !r && a === "success"
166
+ "text-grey": o,
167
+ "text-red": !o && s === "error",
168
+ "text-green": !o && s === "success"
142
169
  }
143
170
  ),
144
171
  children: [
145
- /* @__PURE__ */ x("button", { className: "pointer-events-auto leading-none", onClick: P, children: [
146
- /* @__PURE__ */ m(I, { name: f, iconType: g, width: "24px" }),
147
- /* @__PURE__ */ m("span", { className: "sr-only", children: c })
172
+ /* @__PURE__ */ T("button", { className: "pointer-events-auto leading-none", onClick: Z, children: [
173
+ /* @__PURE__ */ p(E, { name: g, iconType: y, width: "24px" }),
174
+ /* @__PURE__ */ p("span", { className: "sr-only", children: i })
148
175
  ] }),
149
- /* @__PURE__ */ x("span", { className: "ms-auto flex gap-x-8", children: [
150
- a === "error" && /* @__PURE__ */ m(I, { name: "CrossDefault", width: "24px" }),
151
- a === "success" && /* @__PURE__ */ m(I, { name: "CheckDefault", width: "24px" })
176
+ /* @__PURE__ */ T("span", { className: "ms-auto flex gap-x-8", children: [
177
+ s === "error" && /* @__PURE__ */ p(E, { name: "CrossDefault", width: "24px" }),
178
+ s === "success" && /* @__PURE__ */ p(E, { name: "CheckDefault", width: "24px" })
152
179
  ] })
153
180
  ]
154
181
  }
@@ -158,6 +185,6 @@ const M = (t) => t ? H(new Date(t), { representation: "date" }) : "", X = (t) =>
158
185
  );
159
186
  };
160
187
  export {
161
- X as DateField
188
+ ce as DateField
162
189
  };
163
190
  //# sourceMappingURL=DateField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n 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\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { formatISO } from 'date-fns';\nimport { type ChangeEvent, useId, useRef } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","internalStatus","useInternalStatus","setValue","useValue","min","max","handleChange","event","handleClickPicker","_a","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;;AAAe,SAASA,EAAQC,GAAG;AACjC;AAEA,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAChG,WAAO,OAAOA;AAAA,EACf,IAAG,SAAUA,GAAG;AACf,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EACtH,GAAKD,EAAQC,CAAC;AACd;ACRe,SAASC,EAAaC,GAAUC,GAAM;AACnD,MAAIA,EAAK,SAASD;AAChB,UAAM,IAAI,UAAUA,IAAW,kCAAmEC,EAAK,SAAS,UAAU;AAE9H;AC4Be,SAASC,EAAOC,GAAU;AACvC,EAAAJ,EAAa,GAAG,SAAS;AACzB,MAAIK,IAAS,OAAO,UAAU,SAAS,KAAKD,CAAQ;AAGpD,SAAIA,aAAoB,QAAQN,EAAQM,CAAQ,MAAM,YAAYC,MAAW,kBAEpE,IAAI,KAAKD,EAAS,QAAS,CAAA,IACzB,OAAOA,KAAa,YAAYC,MAAW,oBAC7C,IAAI,KAAKD,CAAQ,MAEnB,OAAOA,KAAa,YAAYC,MAAW,sBAAsB,OAAO,UAAY,QAEvF,QAAQ,KAAK,oNAAoN,GAEjO,QAAQ,KAAK,IAAI,MAAO,EAAC,KAAK,IAEzB,oBAAI,KAAK,GAAG;AAEvB;ACnDe,SAASC,EAAgBC,GAAQC,GAAc;AAG5D,WAFIC,IAAOF,IAAS,IAAI,MAAM,IAC1BG,IAAS,KAAK,IAAIH,CAAM,EAAE,SAAQ,GAC/BG,EAAO,SAASF;AACrB,IAAAE,IAAS,MAAMA;AAEjB,SAAOD,IAAOC;AAChB;ACkCe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AWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAavB;AAAA,gBACb,YAAY,CAACA,KAAYU,MAAmB;AAAA,gBAC5C,cAAc,CAACV,KAAYU,MAAmB;AAAA,cAChD;AAAA,YACF;AAAA,YAEA,UAAA;AAAA,cAAA,gBAAAY,EAAC,UAAO,EAAA,WAAU,oCAAmC,SAASJ,GAC5D,UAAA;AAAA,gBAAA,gBAAAE,EAACI,GAAK,EAAA,MAAM3B,GAAM,UAAAC,GAAoB,OAAM,QAAO;AAAA,gBAClD,gBAAAsB,EAAA,QAAA,EAAK,WAAU,WACb,UAEHzB,GAAA;AAAA,cAAA,GACF;AAAA,cACA,gBAAA2B,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAAZ,MAAmB,WAAY,gBAAAU,EAAAI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrEd,MAAmB,aAAa,gBAAAU,EAACI,KAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,cAAA,GAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4]}
1
+ {"version":3,"file":"DateField.js","sources":["../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../../node_modules/date-fns/esm/toDate/index.js","../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","../../../node_modules/date-fns/esm/formatISO/index.js","../../../lib/molecules/Forms/DateField.tsx"],"sourcesContent":["export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n 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\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n while (output.length < targetLength) {\n output = '0' + output;\n }\n return sign + output;\n}","import toDate from \"../toDate/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with local time zone, or both.\n * @returns {String} the formatted date string (in local time zone)\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.representation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport default function formatISO(date, options) {\n var _options$format, _options$representati;\n requiredArgs(1, arguments);\n var originalDate = toDate(date);\n if (isNaN(originalDate.getTime())) {\n throw new RangeError('Invalid time value');\n }\n var format = String((_options$format = options === null || options === void 0 ? void 0 : options.format) !== null && _options$format !== void 0 ? _options$format : 'extended');\n var representation = String((_options$representati = options === null || options === void 0 ? void 0 : options.representation) !== null && _options$representati !== void 0 ? _options$representati : 'complete');\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : '';\n\n // Representation is either 'date' or 'complete'\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n var separator = result === '' ? '' : 'T';\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n var time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n return result;\n}","import classnames from 'classnames';\nimport { differenceInMilliseconds, formatISO } from 'date-fns';\nimport { type ChangeEvent, useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { Icon, type IconicNames, type IconicTypes } from '@/atoms/Icons';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { useInternalStatus } from '@/hooks/useInternalStatus.js';\nimport { FormControl, type FormControlProps } from './FormControl.js';\n\ninterface DateFieldProps extends Omit<FormControlProps<Date | null>, 'max' | 'min'> {\n description?: string;\n /**\n * Open datepicker text\n */\n openDatepicker?: string;\n id?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n /**\n * Minimum Date allowed\n */\n min?: Date | undefined;\n /**\n * Maximum Date allowed\n */\n max?: Date | undefined;\n}\n\nconst formatDate = (value: Date | number | undefined | null): string => {\n if (!value) {\n return '';\n }\n\n return formatISO(new Date(value), { representation: 'date' });\n};\n\nconst validateDateRange = (date: string, min?: Date, max?: Date): boolean => {\n if (!date) {\n return true;\n }\n\n const normalizeDate = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const inputDate = new Date(date);\n const normalizedInputDate = normalizeDate(inputDate);\n\n if (min && normalizedInputDate < normalizeDate(min)) {\n return false;\n }\n if (max && normalizedInputDate > normalizeDate(max)) {\n return false;\n }\n\n return true;\n};\n\nexport const DateField = (props: DateFieldProps) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n description,\n openDatepicker,\n validationStatus = 'default',\n icon = 'CalendarDefault',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n dataTestId = 'DateField',\n value: initialValue,\n min: initialMin,\n max: initialMax,\n onChange,\n ...rest\n } = props;\n\n // NO LOGIC IS IMPLEMENTED YET HERE\n // THIS IS A VISUAL COMPONENT ONLY\n const ref = useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = useState<boolean>(false);\n\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n const { setValue, value } = useValue<string, Date | number | undefined | null>({\n name,\n formatter: formatDate as never,\n initialValue,\n onChange: (name, value) => onChange?.(name, new Date(value)),\n });\n\n const min = formatDate(initialMin);\n const max = formatDate(initialMax);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value);\n };\n\n const handleClickPicker = () => {\n ref.current?.showPicker();\n };\n\n const handleOutOfRangeDate = useCallback(() => {\n const currentDate = new Date(value);\n\n if (initialMin && initialMax) {\n const distanceToMin = Math.abs(differenceInMilliseconds(currentDate, initialMin));\n const distanceToMax = Math.abs(differenceInMilliseconds(currentDate, initialMax));\n setValue(distanceToMin <= distanceToMax ? min : max);\n return;\n }\n\n if (initialMin) {\n setValue(min);\n return;\n }\n\n if (initialMax) {\n setValue(max);\n return;\n }\n }, [initialMax, initialMin, max, min, setValue, value]);\n\n useEffect(() => {\n const isValid = validateDateRange(value, initialMin, initialMax);\n if (!isValid && !isFocused) {\n handleOutOfRangeDate();\n }\n }, [handleOutOfRangeDate, initialMax, initialMin, isFocused, value]);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n dataName=\"DateField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n type=\"date\"\n className={classnames(\n 'text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-pearl text-grey': disabled,\n 'bg-white text-black': !disabled,\n 'border-red': !disabled && internalStatus === 'error',\n 'border-green': !disabled && internalStatus === 'success',\n },\n )}\n id={id}\n disabled={disabled}\n required={required}\n ref={ref}\n value={value}\n min={min}\n max={max}\n onChange={handleChange}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n />\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n {\n 'text-grey': disabled,\n 'text-red': !disabled && internalStatus === 'error',\n 'text-green': !disabled && internalStatus === 'success',\n },\n )}\n >\n <button className=\"pointer-events-auto leading-none\" onClick={handleClickPicker}>\n <Icon name={icon} iconType={iconType} width=\"24px\" />\n <span className=\"sr-only\">\n {openDatepicker}\n {/* REPLACE THAT WITH SOMETHING LIKE \"OPEN DATEPICKER\" SOONER RATHER THAN LATER PLZ */}\n </span>\n </button>\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && <Icon name=\"CrossDefault\" width=\"24px\" />}\n {internalStatus === 'success' && <Icon name=\"CheckDefault\" width=\"24px\" />}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["_typeof","o","requiredArgs","required","args","toDate","argument","argStr","differenceInMilliseconds","dateLeft","dateRight","addLeadingZeros","number","targetLength","sign","output","formatISO","date","options","_options$format","_options$representati","originalDate","format","representation","result","tzOffset","dateDelimiter","timeDelimiter","day","month","year","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","formatDate","value","validateDateRange","min","max","normalizeDate","d","inputDate","normalizedInputDate","DateField","props","internalId","useId","id","name","label","description","openDatepicker","validationStatus","icon","iconType","errorMessage","disabled","hideRequiredStar","dataTestId","initialValue","initialMin","initialMax","onChange","rest","ref","useRef","isFocused","setIsFocused","useState","internalStatus","useInternalStatus","setValue","useValue","handleChange","event","handleClickPicker","_a","handleOutOfRangeDate","useCallback","currentDate","distanceToMin","distanceToMax","useEffect","jsx","FormControl","jsxs","classnames","Icon"],"mappings":";;;;;;;;AAAe,SAASA,EAAQC,GAAG;AACjC;AAEA,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAChG,WAAO,OAAOA;AAAA,EAChB,IAAI,SAAUA,GAAG;AACf,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EACpH,GAAGD,EAAQC,CAAC;AACd;ACRe,SAASC,EAAaC,GAAUC,GAAM;AACnD,MAAIA,EAAK,SAASD;AAChB,UAAM,IAAI,UAAUA,IAAW,eAAeA,IAAW,IAAI,MAAM,MAAM,yBAAyBC,EAAK,SAAS,UAAU;AAE9H;AC4Be,SAASC,EAAOC,GAAU;AACvC,EAAAJ,EAAa,GAAG,SAAS;AACzB,MAAIK,IAAS,OAAO,UAAU,SAAS,KAAKD,CAAQ;AAGpD,SAAIA,aAAoB,QAAQN,EAAQM,CAAQ,MAAM,YAAYC,MAAW,kBAEpE,IAAI,KAAKD,EAAS,SAAS,IACzB,OAAOA,KAAa,YAAYC,MAAW,oBAC7C,IAAI,KAAKD,CAAQ,MAEnB,OAAOA,KAAa,YAAYC,MAAW,sBAAsB,OAAO,UAAY,QAEvF,QAAQ,KAAK,oNAAoN,GAEjO,QAAQ,KAAK,IAAI,MAAK,EAAG,KAAK,IAEzB,oBAAI,KAAK,GAAG;AAEvB;AC3Be,SAASC,EAAyBC,GAAUC,GAAW;AACpE,SAAAR,EAAa,GAAG,SAAS,GAClBG,EAAOI,CAAQ,EAAE,QAAO,IAAKJ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N,EAAa,EAAI;AAAA,YAChC,QAAQ,MAAMA,EAAa,EAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAElC,gBAAAkB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,gBACE,aAAa9B;AAAA,gBACb,YAAY,CAACA,KAAYa,MAAmB;AAAA,gBAC5C,cAAc,CAACb,KAAYa,MAAmB;AAAA,cAAA;AAAA,YAChD;AAAA,YAGF,UAAA;AAAA,cAAA,gBAAAgB,EAAC,UAAA,EAAO,WAAU,oCAAmC,SAASV,GAC5D,UAAA;AAAA,gBAAA,gBAAAQ,EAACI,GAAA,EAAK,MAAMlC,GAAM,UAAAC,GAAoB,OAAM,QAAO;AAAA,gBACnD,gBAAA6B,EAAC,QAAA,EAAK,WAAU,WACb,UAAAhC,EAAA,CAEH;AAAA,cAAA,GACF;AAAA,cACA,gBAAAkC,EAAC,QAAA,EAAK,WAAU,wBACb,UAAA;AAAA,gBAAAhB,MAAmB,WAAW,gBAAAc,EAACI,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO;AAAA,gBACrElB,MAAmB,aAAa,gBAAAc,EAACI,KAAK,MAAK,gBAAe,OAAM,OAAA,CAAO;AAAA,cAAA,EAAA,CAC1E;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '@/atoms/Icons';\nimport { useValue } from '@/hooks/useValue.js';\n\nexport interface FilterProps<Value = string>\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * The data-testid to apply to the button.\n * This is used for testing purposes.\n * */\n dataTestId?: string;\n /**\n * Is it attached to a dropdown?\n */\n hasDropdown?: boolean;\n\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Filter<Value = string>(props: FilterProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled,\n checked: initialChecked = false,\n value,\n tabIndex = 0,\n onChange,\n hasDropdown,\n children,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n\n return (\n <label className={classnames(className, 'relative')}>\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Filter\"\n disabled={disabled}\n value={value}\n />\n <span>\n <span className={classnames('text-b3 font-semibold')}>{children}</span>\n <Icon width={null} name=\"CheckDefault\" color=\"black\" />\n {hasDropdown && (\n <Icon name=\"ArrowDefaultDown\" className=\"ml-8\" width=\"24px\" color=\"black\" />\n )}\n </span>\n </label>\n );\n}\n"],"names":["Filter","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","tabIndex","onChange","hasDropdown","children","rest","checked","setValue","useValue","classnames","jsx","Icon"],"mappings":";;;;;;;AAqBO,SAASA,EAAuBC,GAA2B;AAChE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAd,GAEE,EAAE,OAAOe,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAb;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMW,GAAS;AACtB,MAAAJ,KAAA,QAAAA,EAAWP,GAAMW,IAAYN,MAAU,SAAYA,IAAQM,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD;AAED,2BACG,SAAM,EAAA,WAAWG,EAAWb,GAAW,UAAU,GAChD,UAAA;AAAA,IAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGL;AAAA,QACJ,MAAAV;AAAA,QACA,eAAaE;AAAA,QACb,MAAK;AAAA,QACL,UAAAI;AAAA,QACA,UAAU,MAAM;AACb,WAAAH,KAAYS,EAAS,CAACD,CAAO;AAAA,QAChC;AAAA,QACA,SAAAA;AAAA,QACA,aAAU;AAAA,QACV,UAAAR;AAAA,QACA,OAAAE;AAAA,MAAA;AAAA,IACF;AAAA,sBACC,QACC,EAAA,UAAA;AAAA,MAAA,gBAAAU,EAAC,QAAK,EAAA,WAAWD,EAAW,uBAAuB,GAAI,UAAAL,GAAS;AAAA,wBAC/DO,GAAK,EAAA,OAAO,MAAM,MAAK,gBAAe,OAAM,SAAQ;AAAA,MACpDR,KACE,gBAAAO,EAAAC,GAAA,EAAK,MAAK,oBAAmB,WAAU,QAAO,OAAM,QAAO,OAAM,QAAQ,CAAA;AAAA,IAAA,GAE9E;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Filter.js","sources":["../../../lib/molecules/Forms/Filter.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type InputHTMLAttributes, useId } from 'react';\nimport './controls.css';\nimport { Icon } from '@/atoms/Icons';\nimport { useValue } from '@/hooks/useValue.js';\n\nexport interface FilterProps<Value = string>\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n /**\n * The data-testid to apply to the button.\n * This is used for testing purposes.\n * */\n dataTestId?: string;\n /**\n * Is it attached to a dropdown?\n */\n hasDropdown?: boolean;\n\n onChange?: (name: string, value: Value | null) => void;\n}\n\nexport function Filter<Value = string>(props: FilterProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n className,\n dataTestId,\n disabled,\n checked: initialChecked = false,\n value,\n tabIndex = 0,\n onChange,\n hasDropdown,\n children,\n ...rest\n } = props;\n\n const { value: checked, setValue } = useValue<boolean>({\n name,\n initialValue: initialChecked,\n onChange(name, checked) {\n onChange?.(name, checked ? ((value !== undefined ? value : checked) as Value) : null);\n },\n });\n\n return (\n <label className={classnames(className, 'relative')}>\n <input\n {...rest}\n name={name}\n data-testid={dataTestId}\n type=\"checkbox\"\n tabIndex={tabIndex}\n onChange={() => {\n !disabled && setValue(!checked);\n }}\n checked={checked}\n data-name=\"Filter\"\n disabled={disabled}\n value={value}\n />\n <span>\n <span className={classnames('text-b3 font-semibold')}>{children}</span>\n <Icon width={null} name=\"CheckDefault\" color=\"black\" />\n {hasDropdown && (\n <Icon name=\"ArrowDefaultDown\" className=\"ml-8\" width=\"24px\" color=\"black\" />\n )}\n </span>\n </label>\n );\n}\n"],"names":["Filter","props","internalId","useId","id","name","className","dataTestId","disabled","initialChecked","value","tabIndex","onChange","hasDropdown","children","rest","checked","setValue","useValue","classnames","jsx","Icon"],"mappings":";;;;;;;AAqBO,SAASA,EAAuBC,GAA2B;AAChE,QAAMC,IAAaC,EAAA,GAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,WAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAASC,IAAiB;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDd,GAEE,EAAE,OAAOe,GAAS,UAAAC,EAAA,IAAaC,EAAkB;AAAA,IACrD,MAAAb;AAAA,IACA,cAAcI;AAAA,IACd,SAASJ,GAAMW,GAAS;AACtB,MAAAJ,KAAA,QAAAA,EAAWP,GAAMW,IAAYN,MAAU,SAAYA,IAAQM,IAAqB;AAAA,IAClF;AAAA,EAAA,CACD;AAED,2BACG,SAAA,EAAM,WAAWG,EAAWb,GAAW,UAAU,GAChD,UAAA;AAAA,IAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGL;AAAA,QACJ,MAAAV;AAAA,QACA,eAAaE;AAAA,QACb,MAAK;AAAA,QACL,UAAAI;AAAA,QACA,UAAU,MAAM;AACd,WAACH,KAAYS,EAAS,CAACD,CAAO;AAAA,QAChC;AAAA,QACA,SAAAA;AAAA,QACA,aAAU;AAAA,QACV,UAAAR;AAAA,QACA,OAAAE;AAAA,MAAA;AAAA,IAAA;AAAA,sBAED,QAAA,EACC,UAAA;AAAA,MAAA,gBAAAU,EAAC,QAAA,EAAK,WAAWD,EAAW,uBAAuB,GAAI,UAAAL,GAAS;AAAA,wBAC/DO,GAAA,EAAK,OAAO,MAAM,MAAK,gBAAe,OAAM,SAAQ;AAAA,MACpDR,KACC,gBAAAO,EAACC,GAAA,EAAK,MAAK,oBAAmB,WAAU,QAAO,OAAM,QAAO,OAAM,QAAA,CAAQ;AAAA,IAAA,EAAA,CAE9E;AAAA,EAAA,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '@/atoms/Icons';\nimport classnames from 'classnames';\n\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>,\n> = {\n value?: Value;\n label?: ReactNode;\n validationStatus?: ValidationStatus;\n onChange?: (name: string, value: Value) => void;\n dataTestId?: string;\n dataName?: string;\n errorMessage?: string;\n} & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;\n\nexport const FormControl = <Value = string,>({\n id,\n label,\n description,\n disabled,\n required,\n className,\n validationStatus = 'default',\n children,\n errorMessage,\n dataTestId,\n dataName,\n hideRequiredStar,\n layout,\n}: FormControlProps<Value>) => {\n const internalStatus = useInternalStatus({\n isDisabled: !!disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col gap-4', className)}\n data-name={dataName}\n data-testid={dataTestId}\n >\n {label && id && (\n <FormLabel\n description={description}\n id={id}\n layout={layout}\n required={required}\n hideRequiredStar={hideRequiredStar}\n >\n {label}\n </FormLabel>\n )}\n\n {children}\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start gap-x-4 px-20\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n};\n"],"names":["FormControl","id","label","description","disabled","required","className","validationStatus","children","errorMessage","dataTestId","dataName","hideRequiredStar","layout","shouldDisplayErrorMessage","useInternalStatus","jsxs","classnames","jsx","FormLabel","Icon"],"mappings":";;;;;;AAmBO,MAAMA,IAAc,CAAkB;AAAA,EAC3C,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AACF,MAA+B;AAMvB,QAAAC,IALiBC,EAAkB;AAAA,IACvC,YAAY,CAAC,CAACX;AAAA,IACd,kBAAAG;AAAA,EAAA,CACD,MAEoD,WAAWE;AAG9D,SAAA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuBX,CAAS;AAAA,MACtD,aAAWK;AAAA,MACX,eAAaD;AAAA,MAEZ,UAAA;AAAA,QAAAR,KAASD,KACR,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,aAAAhB;AAAA,YACA,IAAAF;AAAA,YACA,QAAAY;AAAA,YACA,UAAAR;AAAA,YACA,kBAAAO;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QACH;AAAA,QAGDM;AAAA,QAEAM,KACC,gBAAAE,EAAC,QAAK,EAAA,WAAU,mDACd,UAAA;AAAA,UAAA,gBAAAE,EAACE,GAAK,EAAA,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/BX;AAAA,QAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"FormControl.js","sources":["../../../lib/molecules/Forms/FormControl.tsx"],"sourcesContent":["import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { useInternalStatus, type ValidationStatus } from '@/hooks/useInternalStatus';\nimport { FormLabel, type FormLabelProps } from './FormLabel';\nimport { Icon } from '@/atoms/Icons';\nimport classnames from 'classnames';\n\nexport type FormControlProps<\n Value = unknown,\n Attributes extends HTMLAttributes<HTMLElement> = InputHTMLAttributes<HTMLInputElement>,\n> = {\n value?: Value;\n label?: ReactNode;\n validationStatus?: ValidationStatus;\n onChange?: (name: string, value: Value) => void;\n dataTestId?: string;\n dataName?: string;\n errorMessage?: string;\n} & Omit<Attributes & Partial<FormLabelProps>, 'onChange' | 'value'>;\n\nexport const FormControl = <Value = string,>({\n id,\n label,\n description,\n disabled,\n required,\n className,\n validationStatus = 'default',\n children,\n errorMessage,\n dataTestId,\n dataName,\n hideRequiredStar,\n layout,\n}: FormControlProps<Value>) => {\n const internalStatus = useInternalStatus({\n isDisabled: !!disabled,\n validationStatus,\n });\n\n const shouldDisplayErrorMessage = internalStatus === 'error' && errorMessage;\n\n return (\n <div\n className={classnames('flex flex-col gap-4', className)}\n data-name={dataName}\n data-testid={dataTestId}\n >\n {label && id && (\n <FormLabel\n description={description}\n id={id}\n layout={layout}\n required={required}\n hideRequiredStar={hideRequiredStar}\n >\n {label}\n </FormLabel>\n )}\n\n {children}\n\n {shouldDisplayErrorMessage && (\n <span className=\"text-red text-b4 flex items-start gap-x-4 px-20\">\n <Icon name=\"Error\" width=\"20px\" />\n {errorMessage}\n </span>\n )}\n </div>\n );\n};\n"],"names":["FormControl","id","label","description","disabled","required","className","validationStatus","children","errorMessage","dataTestId","dataName","hideRequiredStar","layout","shouldDisplayErrorMessage","useInternalStatus","jsxs","classnames","jsx","FormLabel","Icon"],"mappings":";;;;;;AAmBO,MAAMA,IAAc,CAAkB;AAAA,EAC3C,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AACF,MAA+B;AAM7B,QAAMC,IALiBC,EAAkB;AAAA,IACvC,YAAY,CAAC,CAACX;AAAA,IACd,kBAAAG;AAAA,EAAA,CACD,MAEoD,WAAWE;AAEhE,SACE,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,uBAAuBX,CAAS;AAAA,MACtD,aAAWK;AAAA,MACX,eAAaD;AAAA,MAEZ,UAAA;AAAA,QAAAR,KAASD,KACR,gBAAAiB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,aAAAhB;AAAA,YACA,IAAAF;AAAA,YACA,QAAAY;AAAA,YACA,UAAAR;AAAA,YACA,kBAAAO;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,QAIJM;AAAA,QAEAM,KACC,gBAAAE,EAAC,QAAA,EAAK,WAAU,mDACd,UAAA;AAAA,UAAA,gBAAAE,EAACE,GAAA,EAAK,MAAK,SAAQ,OAAM,QAAO;AAAA,UAC/BX;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormLabel.js","sources":["../../../lib/molecules/Forms/FormLabel.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { LabelHTMLAttributes } from 'react';\n\nexport interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n description?: string;\n layout?: 'horizontal' | 'vertical';\n required?: boolean;\n hideRequiredStar?: boolean;\n}\n\nexport const FormLabel = ({\n id,\n description,\n layout = 'horizontal',\n required,\n className,\n children,\n hideRequiredStar = !required,\n ...rest\n}: FormLabelProps) => {\n return (\n <label\n {...rest}\n htmlFor={id}\n className={classnames(\n 'text-b3 font-semibold text-black flex',\n {\n 'flex-wrap items-center ps-20': layout === 'horizontal',\n 'flex-col items-start': layout === 'vertical',\n },\n className,\n )}\n data-name=\"InputLabel\"\n >\n {children}\n {required && !hideRequiredStar && <span>*</span>}\n {description && <span className=\"ms-12 text-b4 text-grey font-normal\">{description}</span>}\n </label>\n );\n};\n"],"names":["FormLabel","id","description","layout","required","className","children","hideRequiredStar","rest","jsxs","classnames","jsx"],"mappings":";;AAUO,MAAMA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC,IAAmB,CAACH;AAAA,EACpB,GAAGI;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,SAASP;AAAA,IACT,WAAWS;AAAA,MACT;AAAA,MACA;AAAA,QACE,gCAAgCP,MAAW;AAAA,QAC3C,wBAAwBA,MAAW;AAAA,MACrC;AAAA,MACAE;AAAA,IACF;AAAA,IACA,aAAU;AAAA,IAET,UAAA;AAAA,MAAAC;AAAA,MACAF,KAAY,CAACG,KAAoB,gBAAAI,EAAC,UAAK,UAAC,KAAA;AAAA,MACxCT,KAAe,gBAAAS,EAAC,QAAK,EAAA,WAAU,uCAAuC,UAAYT,GAAA;AAAA,IAAA;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"FormLabel.js","sources":["../../../lib/molecules/Forms/FormLabel.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { LabelHTMLAttributes } from 'react';\n\nexport interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n description?: string;\n layout?: 'horizontal' | 'vertical';\n required?: boolean;\n hideRequiredStar?: boolean;\n}\n\nexport const FormLabel = ({\n id,\n description,\n layout = 'horizontal',\n required,\n className,\n children,\n hideRequiredStar = !required,\n ...rest\n}: FormLabelProps) => {\n return (\n <label\n {...rest}\n htmlFor={id}\n className={classnames(\n 'text-b3 font-semibold text-black flex',\n {\n 'flex-wrap items-center ps-20': layout === 'horizontal',\n 'flex-col items-start': layout === 'vertical',\n },\n className,\n )}\n data-name=\"InputLabel\"\n >\n {children}\n {required && !hideRequiredStar && <span>*</span>}\n {description && <span className=\"ms-12 text-b4 text-grey font-normal\">{description}</span>}\n </label>\n );\n};\n"],"names":["FormLabel","id","description","layout","required","className","children","hideRequiredStar","rest","jsxs","classnames","jsx"],"mappings":";;AAUO,MAAMA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC,IAAmB,CAACH;AAAA,EACpB,GAAGI;AACL,MAEI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACE,GAAGD;AAAA,IACJ,SAASP;AAAA,IACT,WAAWS;AAAA,MACT;AAAA,MACA;AAAA,QACE,gCAAgCP,MAAW;AAAA,QAC3C,wBAAwBA,MAAW;AAAA,MAAA;AAAA,MAErCE;AAAA,IAAA;AAAA,IAEF,aAAU;AAAA,IAET,UAAA;AAAA,MAAAC;AAAA,MACAF,KAAY,CAACG,KAAoB,gBAAAI,EAAC,UAAK,UAAA,KAAC;AAAA,MACxCT,KAAe,gBAAAS,EAAC,QAAA,EAAK,WAAU,uCAAuC,UAAAT,EAAA,CAAY;AAAA,IAAA;AAAA,EAAA;AAAA;"}
@@ -21,13 +21,16 @@ export declare function useNumberField(props: NumberFieldProps): {
21
21
  errorMessage?: string | undefined;
22
22
  children?: import("react").ReactNode;
23
23
  defaultValue?: string | number | readonly string[] | undefined;
24
+ color?: string | undefined;
25
+ size?: number | undefined;
24
26
  className?: string | undefined;
25
27
  width?: string | number | undefined;
26
28
  type?: import("react").HTMLInputTypeAttribute | undefined;
27
- onClick?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
28
- tabIndex?: number | undefined;
29
- title?: string | undefined;
30
29
  form?: string | undefined;
30
+ slot?: string | undefined;
31
+ style?: import("react").CSSProperties | undefined;
32
+ title?: string | undefined;
33
+ pattern?: string | undefined;
31
34
  formAction?: string | undefined;
32
35
  formEncType?: string | undefined;
33
36
  formMethod?: string | undefined;
@@ -45,9 +48,8 @@ export declare function useNumberField(props: NumberFieldProps): {
45
48
  hidden?: boolean | undefined;
46
49
  lang?: string | undefined;
47
50
  nonce?: string | undefined;
48
- slot?: string | undefined;
49
51
  spellCheck?: (boolean | "true" | "false") | undefined;
50
- style?: import("react").CSSProperties | undefined;
52
+ tabIndex?: number | undefined;
51
53
  translate?: "yes" | "no" | undefined;
52
54
  radioGroup?: string | undefined;
53
55
  role?: import("react").AriaRole | undefined;
@@ -65,7 +67,6 @@ export declare function useNumberField(props: NumberFieldProps): {
65
67
  autoCapitalize?: string | undefined;
66
68
  autoCorrect?: string | undefined;
67
69
  autoSave?: string | undefined;
68
- color?: string | undefined;
69
70
  itemProp?: string | undefined;
70
71
  itemScope?: boolean | undefined;
71
72
  itemType?: string | undefined;
@@ -78,7 +79,7 @@ export declare function useNumberField(props: NumberFieldProps): {
78
79
  is?: string | undefined;
79
80
  "aria-activedescendant"?: string | undefined;
80
81
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
81
- "aria-autocomplete"?: "none" | "list" | "both" | "inline" | undefined;
82
+ "aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
82
83
  "aria-braillelabel"?: string | undefined;
83
84
  "aria-brailleroledescription"?: string | undefined;
84
85
  "aria-busy"?: (boolean | "true" | "false") | undefined;
@@ -88,17 +89,17 @@ export declare function useNumberField(props: NumberFieldProps): {
88
89
  "aria-colindextext"?: string | undefined;
89
90
  "aria-colspan"?: number | undefined;
90
91
  "aria-controls"?: string | undefined;
91
- "aria-current"?: boolean | "true" | "false" | "time" | "page" | "step" | "location" | "date" | undefined;
92
+ "aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
92
93
  "aria-describedby"?: string | undefined;
93
94
  "aria-description"?: string | undefined;
94
95
  "aria-details"?: string | undefined;
95
96
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
96
- "aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
97
+ "aria-dropeffect"?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
97
98
  "aria-errormessage"?: string | undefined;
98
99
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
99
100
  "aria-flowto"?: string | undefined;
100
101
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
101
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
102
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
102
103
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
103
104
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
104
105
  "aria-keyshortcuts"?: string | undefined;
@@ -115,7 +116,7 @@ export declare function useNumberField(props: NumberFieldProps): {
115
116
  "aria-posinset"?: number | undefined;
116
117
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
117
118
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
118
- "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
119
+ "aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
119
120
  "aria-required"?: (boolean | "true" | "false") | undefined;
120
121
  "aria-roledescription"?: string | undefined;
121
122
  "aria-rowcount"?: number | undefined;
@@ -217,6 +218,7 @@ export declare function useNumberField(props: NumberFieldProps): {
217
218
  onWaitingCapture?: (import("react").ReactEventHandler<HTMLInputElement> & import("react").ReactEventHandler<HTMLLabelElement>) | undefined;
218
219
  onAuxClick?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
219
220
  onAuxClickCapture?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
221
+ onClick?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
220
222
  onClickCapture?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
221
223
  onContextMenu?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
222
224
  onContextMenuCapture?: (import("react").MouseEventHandler<HTMLInputElement> & import("react").MouseEventHandler<HTMLLabelElement>) | undefined;
@@ -293,25 +295,23 @@ export declare function useNumberField(props: NumberFieldProps): {
293
295
  onTransitionEnd?: (import("react").TransitionEventHandler<HTMLInputElement> & import("react").TransitionEventHandler<HTMLLabelElement>) | undefined;
294
296
  onTransitionEndCapture?: (import("react").TransitionEventHandler<HTMLInputElement> & import("react").TransitionEventHandler<HTMLLabelElement>) | undefined;
295
297
  list?: string | undefined;
296
- pattern?: string | undefined;
298
+ step?: string | number | undefined;
297
299
  alt?: string | undefined;
298
300
  src?: string | undefined;
299
301
  height?: string | number | undefined;
300
302
  layout?: "horizontal" | "vertical" | undefined;
301
- size?: number | undefined;
302
303
  multiple?: boolean | undefined;
303
304
  htmlFor?: string | undefined;
304
305
  autoComplete?: import("react").HTMLInputAutoCompleteAttribute | undefined;
305
306
  accept?: string | undefined;
306
307
  capture?: boolean | "user" | "environment" | undefined;
307
308
  checked?: boolean | undefined;
308
- enterKeyHint?: "search" | "next" | "enter" | "previous" | "done" | "go" | "send" | undefined;
309
+ enterKeyHint?: "search" | "next" | "previous" | "enter" | "done" | "go" | "send" | undefined;
309
310
  maxLength?: number | undefined;
310
311
  minLength?: number | undefined;
311
312
  placeholder?: string | undefined;
312
313
  readOnly?: boolean | undefined;
313
314
  required?: boolean | undefined;
314
- step?: string | number | undefined;
315
315
  description?: string | undefined;
316
316
  hideRequiredStar?: boolean | undefined;
317
317
  };