@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.
- package/CHANGELOG.md +20 -0
- package/fonts/Actions/tui-actions.css +6 -6
- package/fonts/Actions/tui-actions.eot +0 -0
- package/fonts/Actions/tui-actions.less +6 -6
- package/fonts/Actions/tui-actions.module.less +6 -6
- package/fonts/Actions/tui-actions.scss +6 -6
- package/fonts/Actions/tui-actions.styl +6 -6
- package/fonts/Actions/tui-actions.ttf +0 -0
- package/fonts/Actions/tui-actions.woff +0 -0
- package/fonts/Actions/tui-actions.woff2 +0 -0
- package/fonts/Activities/tui-activities.css +6 -6
- package/fonts/Activities/tui-activities.eot +0 -0
- package/fonts/Activities/tui-activities.less +6 -6
- package/fonts/Activities/tui-activities.module.less +6 -6
- package/fonts/Activities/tui-activities.scss +6 -6
- package/fonts/Activities/tui-activities.styl +6 -6
- package/fonts/Activities/tui-activities.ttf +0 -0
- package/fonts/Activities/tui-activities.woff +0 -0
- package/fonts/Activities/tui-activities.woff2 +0 -0
- package/fonts/Brand/tui-brand.css +6 -6
- package/fonts/Brand/tui-brand.eot +0 -0
- package/fonts/Brand/tui-brand.less +6 -6
- package/fonts/Brand/tui-brand.module.less +6 -6
- package/fonts/Brand/tui-brand.scss +6 -6
- package/fonts/Brand/tui-brand.styl +6 -6
- package/fonts/Brand/tui-brand.ttf +0 -0
- package/fonts/Brand/tui-brand.woff +0 -0
- package/fonts/Brand/tui-brand.woff2 +0 -0
- package/fonts/Covid/tui-covid.css +6 -6
- package/fonts/Covid/tui-covid.eot +0 -0
- package/fonts/Covid/tui-covid.less +6 -6
- package/fonts/Covid/tui-covid.module.less +6 -6
- package/fonts/Covid/tui-covid.scss +6 -6
- package/fonts/Covid/tui-covid.styl +6 -6
- package/fonts/Covid/tui-covid.ttf +0 -0
- package/fonts/Covid/tui-covid.woff +0 -0
- package/fonts/Covid/tui-covid.woff2 +0 -0
- package/fonts/Food/tui-food.css +6 -6
- package/fonts/Food/tui-food.eot +0 -0
- package/fonts/Food/tui-food.less +6 -6
- package/fonts/Food/tui-food.module.less +6 -6
- package/fonts/Food/tui-food.scss +6 -6
- package/fonts/Food/tui-food.styl +6 -6
- package/fonts/Food/tui-food.ttf +0 -0
- package/fonts/Food/tui-food.woff +0 -0
- package/fonts/Food/tui-food.woff2 +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
- package/fonts/Places/tui-places.css +6 -6
- package/fonts/Places/tui-places.eot +0 -0
- package/fonts/Places/tui-places.less +6 -6
- package/fonts/Places/tui-places.module.less +6 -6
- package/fonts/Places/tui-places.scss +6 -6
- package/fonts/Places/tui-places.styl +6 -6
- package/fonts/Places/tui-places.ttf +0 -0
- package/fonts/Places/tui-places.woff +0 -0
- package/fonts/Places/tui-places.woff2 +0 -0
- package/fonts/Room/tui-room.css +6 -6
- package/fonts/Room/tui-room.eot +0 -0
- package/fonts/Room/tui-room.less +6 -6
- package/fonts/Room/tui-room.module.less +6 -6
- package/fonts/Room/tui-room.scss +6 -6
- package/fonts/Room/tui-room.styl +6 -6
- package/fonts/Room/tui-room.ttf +0 -0
- package/fonts/Room/tui-room.woff +0 -0
- package/fonts/Room/tui-room.woff2 +0 -0
- package/fonts/Services/tui-services.css +6 -6
- package/fonts/Services/tui-services.eot +0 -0
- package/fonts/Services/tui-services.less +6 -6
- package/fonts/Services/tui-services.module.less +6 -6
- package/fonts/Services/tui-services.scss +6 -6
- package/fonts/Services/tui-services.styl +6 -6
- package/fonts/Services/tui-services.ttf +0 -0
- package/fonts/Services/tui-services.woff +0 -0
- package/fonts/Services/tui-services.woff2 +0 -0
- package/fonts/Socials/tui-socials.css +6 -6
- package/fonts/Socials/tui-socials.eot +0 -0
- package/fonts/Socials/tui-socials.less +6 -6
- package/fonts/Socials/tui-socials.module.less +6 -6
- package/fonts/Socials/tui-socials.scss +6 -6
- package/fonts/Socials/tui-socials.styl +6 -6
- package/fonts/Socials/tui-socials.ttf +0 -0
- package/fonts/Socials/tui-socials.woff +0 -0
- package/fonts/Socials/tui-socials.woff2 +0 -0
- package/fonts/Transports/tui-transports.css +6 -6
- package/fonts/Transports/tui-transports.eot +0 -0
- package/fonts/Transports/tui-transports.less +6 -6
- package/fonts/Transports/tui-transports.module.less +6 -6
- package/fonts/Transports/tui-transports.scss +6 -6
- package/fonts/Transports/tui-transports.styl +6 -6
- package/fonts/Transports/tui-transports.ttf +0 -0
- package/fonts/Transports/tui-transports.woff +0 -0
- package/fonts/Transports/tui-transports.woff2 +0 -0
- package/fonts/Utilities/tui-utilities.css +6 -6
- package/fonts/Utilities/tui-utilities.eot +0 -0
- package/fonts/Utilities/tui-utilities.less +6 -6
- package/fonts/Utilities/tui-utilities.module.less +6 -6
- package/fonts/Utilities/tui-utilities.scss +6 -6
- package/fonts/Utilities/tui-utilities.styl +6 -6
- package/fonts/Utilities/tui-utilities.ttf +0 -0
- package/fonts/Utilities/tui-utilities.woff +0 -0
- package/fonts/Utilities/tui-utilities.woff2 +0 -0
- package/molecules/Forms/DateField.js +46 -43
- package/molecules/Forms/FormControl.d.ts +4 -3
- package/molecules/Forms/FormControl.js +22 -21
- package/molecules/Forms/FormLabel.d.ts +4 -17
- package/molecules/Forms/FormLabel.js +24 -19
- package/molecules/Forms/NumberField.d.ts +3 -3
- package/molecules/Forms/NumberField.js +39 -36
- package/molecules/Forms/Password/Password.js +35 -32
- package/molecules/Forms/Select.d.ts +10 -0
- package/molecules/Forms/Select.js +102 -0
- package/molecules/Forms/TextField.d.ts +0 -1
- package/molecules/Forms/TextField.js +47 -47
- package/package.json +1 -1
- 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=
|
4
|
-
src: url('tui-utilities.eot?t=
|
5
|
-
url("tui-utilities.woff2?t=
|
6
|
-
url("tui-utilities.woff?t=
|
7
|
-
url('tui-utilities.ttf?t=
|
8
|
-
url('tui-utilities.svg?t=
|
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=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
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=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
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=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
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=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
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
|
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
|
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
|
7
|
-
import { useInternalStatus as
|
8
|
-
import { FormControl as
|
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
|
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 =
|
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" ? "-" : "",
|
42
|
+
var s = "", f = "", g = d === "extended" ? "-" : "", w = d === "extended" ? ":" : "";
|
43
43
|
if (c !== "time") {
|
44
|
-
var r = l(o.getDate(), 2),
|
45
|
-
s = "".concat(D).concat(g).concat(
|
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
|
51
|
-
f = "".concat(
|
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
|
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" }) : "",
|
60
|
-
const e =
|
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:
|
69
|
+
errorMessage: w,
|
70
70
|
disabled: r = !1,
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
required: v = !1,
|
72
|
+
dataTestId: D = "DateField",
|
73
|
+
value: p,
|
74
|
+
min: h,
|
75
|
+
max: S,
|
75
76
|
onChange: b,
|
76
|
-
...
|
77
|
-
} = t,
|
77
|
+
...N
|
78
|
+
} = t, y = z(null), n = Z({
|
78
79
|
isDisabled: r,
|
79
80
|
validationStatus: s
|
80
|
-
}), { setValue:
|
81
|
+
}), { setValue: k, value: j } = G({
|
81
82
|
name: a,
|
82
83
|
formatter: M,
|
83
|
-
initialValue:
|
84
|
-
onChange: (u,
|
85
|
-
}),
|
86
|
-
|
87
|
-
},
|
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 =
|
90
|
+
(u = y.current) == null || u.showPicker();
|
90
91
|
};
|
91
92
|
return /* @__PURE__ */ m(
|
92
|
-
|
93
|
+
$,
|
93
94
|
{
|
94
95
|
id: i,
|
95
96
|
label: o,
|
96
97
|
description: d,
|
97
98
|
dataName: "DateField",
|
98
|
-
dataTestId:
|
99
|
+
dataTestId: D,
|
99
100
|
disabled: r,
|
101
|
+
required: v,
|
100
102
|
validationStatus: s,
|
101
|
-
errorMessage:
|
102
|
-
children: /* @__PURE__ */
|
103
|
+
errorMessage: w,
|
104
|
+
children: /* @__PURE__ */ x("div", { className: "relative", children: [
|
103
105
|
/* @__PURE__ */ m(
|
104
106
|
"input",
|
105
107
|
{
|
106
|
-
...
|
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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
required: v,
|
124
|
+
ref: y,
|
125
|
+
value: j,
|
126
|
+
min: C,
|
127
|
+
max: O,
|
128
|
+
onChange: R
|
126
129
|
}
|
127
130
|
),
|
128
|
-
/* @__PURE__ */
|
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__ */
|
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__ */
|
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
|
-
|
159
|
+
W as DateField
|
157
160
|
};
|
@@ -1,12 +1,13 @@
|
|
1
|
-
import { HTMLAttributes, InputHTMLAttributes,
|
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
|
12
|
-
export declare const FormControl: <Value = string>({ id, label, description, disabled, className, validationStatus, children, errorMessage, dataTestId, dataName, layout, }:
|
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
|
3
|
-
import { FormLabel as
|
4
|
-
import { Icon as
|
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
|
7
|
-
const
|
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
|
-
|
13
|
-
|
14
|
-
|
12
|
+
required: n,
|
13
|
+
className: i,
|
14
|
+
validationStatus: l = "default",
|
15
|
+
children: p,
|
15
16
|
errorMessage: a,
|
16
|
-
dataTestId:
|
17
|
-
dataName:
|
18
|
-
layout:
|
17
|
+
dataTestId: c,
|
18
|
+
dataName: x,
|
19
|
+
layout: d
|
19
20
|
}) => {
|
20
|
-
const
|
21
|
+
const f = u({
|
21
22
|
isDisabled: !!m,
|
22
|
-
validationStatus:
|
23
|
+
validationStatus: l
|
23
24
|
});
|
24
25
|
return /* @__PURE__ */ e(
|
25
26
|
"div",
|
26
27
|
{
|
27
|
-
className:
|
28
|
-
"data-name":
|
29
|
-
"data-testid":
|
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(
|
32
|
-
|
33
|
-
|
34
|
-
/* @__PURE__ */ o(
|
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
|
-
|
43
|
+
w as FormControl
|
43
44
|
};
|
@@ -1,20 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
export interface FormLabelProps extends
|
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:
|
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
|
2
|
-
import { c
|
3
|
-
const
|
4
|
-
|
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
|
-
|
11
|
-
|
12
|
-
className:
|
13
|
-
|
14
|
-
|
6
|
+
layout: t = "horizontal",
|
7
|
+
required: r,
|
8
|
+
className: s,
|
9
|
+
children: m,
|
10
|
+
...n
|
11
|
+
}) => /* @__PURE__ */ o(
|
15
12
|
"label",
|
16
13
|
{
|
17
|
-
...
|
18
|
-
htmlFor:
|
19
|
-
className:
|
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
|
-
|
23
|
-
|
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
|
-
|
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
|
2
|
-
import { c as
|
3
|
-
import { useId as
|
4
|
-
import { useValue as
|
5
|
-
import { Button as
|
6
|
-
import { FormControl as
|
7
|
-
const
|
8
|
-
function
|
9
|
-
const e =
|
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:
|
11
|
+
name: r = n,
|
12
12
|
value: c = 0,
|
13
13
|
onChange: d,
|
14
14
|
min: t = 0,
|
15
|
-
max:
|
15
|
+
max: l = 10,
|
16
16
|
disabled: i = !1,
|
17
17
|
dataTestId: u = "NumberField",
|
18
18
|
...f
|
19
|
-
} = m, { value: a, setValue: s } =
|
20
|
-
name:
|
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:
|
30
|
-
name:
|
29
|
+
max: l,
|
30
|
+
name: r,
|
31
31
|
value: a,
|
32
32
|
dataTestId: u,
|
33
33
|
disabled: i,
|
34
|
-
handleChange: (
|
35
|
-
const
|
36
|
-
|
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 <
|
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:
|
50
|
+
max: r,
|
51
51
|
label: c,
|
52
52
|
description: d,
|
53
53
|
id: t,
|
54
|
-
dataTestId:
|
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:
|
61
|
-
|
62
|
-
|
60
|
+
validationStatus: p,
|
61
|
+
required: b,
|
62
|
+
...x
|
63
|
+
} = V(m);
|
63
64
|
return /* @__PURE__ */ o(
|
64
|
-
|
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:
|
72
|
+
dataTestId: l,
|
72
73
|
errorMessage: s,
|
73
|
-
validationStatus:
|
74
|
+
validationStatus: p,
|
74
75
|
disabled: e,
|
76
|
+
required: b,
|
75
77
|
layout: "vertical",
|
76
|
-
children: /* @__PURE__ */
|
78
|
+
children: /* @__PURE__ */ v("div", { className: "flex items-center gap-x-8", children: [
|
77
79
|
/* @__PURE__ */ o(
|
78
|
-
|
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
|
-
...
|
92
|
-
className:
|
93
|
+
...x,
|
94
|
+
className: C("text-b2 text-center font-normal outline-none", {
|
93
95
|
"bg-pearl text-grey": e
|
94
96
|
}),
|
95
|
-
style:
|
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:
|
105
|
+
max: r
|
103
106
|
}
|
104
107
|
),
|
105
108
|
/* @__PURE__ */ o(
|
106
|
-
|
109
|
+
N,
|
107
110
|
{
|
108
111
|
theme: "yellow",
|
109
112
|
onClick: f,
|
110
113
|
variant: "icon",
|
111
|
-
disabled: i >=
|
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
|
-
|
125
|
+
V as useNumberField
|
123
126
|
};
|