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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/fonts/Actions/tui-actions.css +6 -6
  3. package/fonts/Actions/tui-actions.eot +0 -0
  4. package/fonts/Actions/tui-actions.less +6 -6
  5. package/fonts/Actions/tui-actions.module.less +6 -6
  6. package/fonts/Actions/tui-actions.scss +6 -6
  7. package/fonts/Actions/tui-actions.styl +6 -6
  8. package/fonts/Actions/tui-actions.ttf +0 -0
  9. package/fonts/Actions/tui-actions.woff +0 -0
  10. package/fonts/Actions/tui-actions.woff2 +0 -0
  11. package/fonts/Activities/tui-activities.css +6 -6
  12. package/fonts/Activities/tui-activities.eot +0 -0
  13. package/fonts/Activities/tui-activities.less +6 -6
  14. package/fonts/Activities/tui-activities.module.less +6 -6
  15. package/fonts/Activities/tui-activities.scss +6 -6
  16. package/fonts/Activities/tui-activities.styl +6 -6
  17. package/fonts/Activities/tui-activities.ttf +0 -0
  18. package/fonts/Activities/tui-activities.woff +0 -0
  19. package/fonts/Activities/tui-activities.woff2 +0 -0
  20. package/fonts/Brand/tui-brand.css +6 -6
  21. package/fonts/Brand/tui-brand.eot +0 -0
  22. package/fonts/Brand/tui-brand.less +6 -6
  23. package/fonts/Brand/tui-brand.module.less +6 -6
  24. package/fonts/Brand/tui-brand.scss +6 -6
  25. package/fonts/Brand/tui-brand.styl +6 -6
  26. package/fonts/Brand/tui-brand.ttf +0 -0
  27. package/fonts/Brand/tui-brand.woff +0 -0
  28. package/fonts/Brand/tui-brand.woff2 +0 -0
  29. package/fonts/Covid/tui-covid.css +6 -6
  30. package/fonts/Covid/tui-covid.eot +0 -0
  31. package/fonts/Covid/tui-covid.less +6 -6
  32. package/fonts/Covid/tui-covid.module.less +6 -6
  33. package/fonts/Covid/tui-covid.scss +6 -6
  34. package/fonts/Covid/tui-covid.styl +6 -6
  35. package/fonts/Covid/tui-covid.ttf +0 -0
  36. package/fonts/Covid/tui-covid.woff +0 -0
  37. package/fonts/Covid/tui-covid.woff2 +0 -0
  38. package/fonts/Food/tui-food.css +6 -6
  39. package/fonts/Food/tui-food.eot +0 -0
  40. package/fonts/Food/tui-food.less +6 -6
  41. package/fonts/Food/tui-food.module.less +6 -6
  42. package/fonts/Food/tui-food.scss +6 -6
  43. package/fonts/Food/tui-food.styl +6 -6
  44. package/fonts/Food/tui-food.ttf +0 -0
  45. package/fonts/Food/tui-food.woff +0 -0
  46. package/fonts/Food/tui-food.woff2 +0 -0
  47. package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
  48. package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
  49. package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
  50. package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
  51. package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
  52. package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
  53. package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
  54. package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
  55. package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
  56. package/fonts/Places/tui-places.css +6 -6
  57. package/fonts/Places/tui-places.eot +0 -0
  58. package/fonts/Places/tui-places.less +6 -6
  59. package/fonts/Places/tui-places.module.less +6 -6
  60. package/fonts/Places/tui-places.scss +6 -6
  61. package/fonts/Places/tui-places.styl +6 -6
  62. package/fonts/Places/tui-places.ttf +0 -0
  63. package/fonts/Places/tui-places.woff +0 -0
  64. package/fonts/Places/tui-places.woff2 +0 -0
  65. package/fonts/Room/tui-room.css +6 -6
  66. package/fonts/Room/tui-room.eot +0 -0
  67. package/fonts/Room/tui-room.less +6 -6
  68. package/fonts/Room/tui-room.module.less +6 -6
  69. package/fonts/Room/tui-room.scss +6 -6
  70. package/fonts/Room/tui-room.styl +6 -6
  71. package/fonts/Room/tui-room.ttf +0 -0
  72. package/fonts/Room/tui-room.woff +0 -0
  73. package/fonts/Room/tui-room.woff2 +0 -0
  74. package/fonts/Services/tui-services.css +6 -6
  75. package/fonts/Services/tui-services.eot +0 -0
  76. package/fonts/Services/tui-services.less +6 -6
  77. package/fonts/Services/tui-services.module.less +6 -6
  78. package/fonts/Services/tui-services.scss +6 -6
  79. package/fonts/Services/tui-services.styl +6 -6
  80. package/fonts/Services/tui-services.ttf +0 -0
  81. package/fonts/Services/tui-services.woff +0 -0
  82. package/fonts/Services/tui-services.woff2 +0 -0
  83. package/fonts/Socials/tui-socials.css +6 -6
  84. package/fonts/Socials/tui-socials.eot +0 -0
  85. package/fonts/Socials/tui-socials.less +6 -6
  86. package/fonts/Socials/tui-socials.module.less +6 -6
  87. package/fonts/Socials/tui-socials.scss +6 -6
  88. package/fonts/Socials/tui-socials.styl +6 -6
  89. package/fonts/Socials/tui-socials.ttf +0 -0
  90. package/fonts/Socials/tui-socials.woff +0 -0
  91. package/fonts/Socials/tui-socials.woff2 +0 -0
  92. package/fonts/Transports/tui-transports.css +6 -6
  93. package/fonts/Transports/tui-transports.eot +0 -0
  94. package/fonts/Transports/tui-transports.less +6 -6
  95. package/fonts/Transports/tui-transports.module.less +6 -6
  96. package/fonts/Transports/tui-transports.scss +6 -6
  97. package/fonts/Transports/tui-transports.styl +6 -6
  98. package/fonts/Transports/tui-transports.ttf +0 -0
  99. package/fonts/Transports/tui-transports.woff +0 -0
  100. package/fonts/Transports/tui-transports.woff2 +0 -0
  101. package/fonts/Utilities/tui-utilities.css +6 -6
  102. package/fonts/Utilities/tui-utilities.eot +0 -0
  103. package/fonts/Utilities/tui-utilities.less +6 -6
  104. package/fonts/Utilities/tui-utilities.module.less +6 -6
  105. package/fonts/Utilities/tui-utilities.scss +6 -6
  106. package/fonts/Utilities/tui-utilities.styl +6 -6
  107. package/fonts/Utilities/tui-utilities.ttf +0 -0
  108. package/fonts/Utilities/tui-utilities.woff +0 -0
  109. package/fonts/Utilities/tui-utilities.woff2 +0 -0
  110. package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -1
  111. package/molecules/Forms/Checkboxes/Checkbox.js +37 -37
  112. package/molecules/Forms/Checkboxes/Checkboxes.d.ts +1 -1
  113. package/molecules/Forms/Checkboxes/Checkboxes.js +30 -31
  114. package/molecules/Forms/DateField.d.ts +1 -17
  115. package/molecules/Forms/DateField.js +98 -99
  116. package/molecules/Forms/Filter.d.ts +1 -1
  117. package/molecules/Forms/Filter.js +38 -38
  118. package/molecules/Forms/NumberField.d.ts +3 -3
  119. package/molecules/Forms/NumberField.js +76 -76
  120. package/molecules/Forms/Password/Password.js +35 -36
  121. package/molecules/Forms/Radios/Radio.d.ts +1 -1
  122. package/molecules/Forms/Radios/Radio.js +31 -31
  123. package/molecules/Forms/Radios/RadioGroup.d.ts +1 -1
  124. package/molecules/Forms/Radios/RadioGroup.js +28 -29
  125. package/molecules/Forms/Range.d.ts +2 -2
  126. package/molecules/Forms/Range.js +181 -183
  127. package/molecules/Forms/Switch.d.ts +1 -1
  128. package/molecules/Forms/Switch.js +28 -28
  129. package/molecules/Forms/TextField.js +38 -38
  130. package/package.json +1 -1
@@ -1,56 +1,56 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { c } from "../../index-Cu0xwYjD.js";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { c as r } from "../../index-Cu0xwYjD.js";
3
+ import { useId as D } from "react";
3
4
  import "../../controls-l0sNRNKZ.js";
4
- import { Icon as m } from "../../atoms/Icons/Icon.js";
5
+ import { Icon as c } from "../../atoms/Icons/Icon.js";
5
6
  import "../../atoms/Icons/contexts/IconsContext.js";
6
- import { useValue as D } from "../../hooks/useValue.js";
7
- let N = 0;
8
- function I({
9
- id: n = "filter-" + N++,
10
- name: a = n,
11
- className: p,
12
- dataTestId: u,
13
- disabled: r,
14
- checked: f = !1,
15
- value: e,
16
- tabIndex: d = 0,
17
- onChange: l,
18
- hasDropdown: x,
19
- children: b,
20
- ...h
21
- }) {
22
- const { value: i, setValue: k } = D({
23
- name: a,
7
+ import { useValue as N } from "../../hooks/useValue.js";
8
+ function T(m) {
9
+ const d = D(), {
10
+ id: p = d,
11
+ name: l = p,
12
+ className: u,
13
+ dataTestId: h,
14
+ disabled: o,
15
+ checked: f = !1,
16
+ value: a,
17
+ tabIndex: b = 0,
18
+ onChange: t,
19
+ hasDropdown: x,
20
+ children: k,
21
+ ...w
22
+ } = m, { value: n, setValue: I } = N({
23
+ name: l,
24
24
  initialValue: f,
25
- onChange(w, o) {
26
- l == null || l(w, o ? e !== void 0 ? e : o : null);
25
+ onChange(v, s) {
26
+ t == null || t(v, s ? a !== void 0 ? a : s : null);
27
27
  }
28
28
  });
29
- return /* @__PURE__ */ s("label", { className: c(p, "relative"), children: [
30
- /* @__PURE__ */ t(
29
+ return /* @__PURE__ */ i("label", { className: r(u, "relative"), children: [
30
+ /* @__PURE__ */ e(
31
31
  "input",
32
32
  {
33
- ...h,
34
- name: a,
35
- "data-testid": u,
33
+ ...w,
34
+ name: l,
35
+ "data-testid": h,
36
36
  type: "checkbox",
37
- tabIndex: d,
37
+ tabIndex: b,
38
38
  onChange: () => {
39
- !r && k(!i);
39
+ !o && I(!n);
40
40
  },
41
- checked: i,
41
+ checked: n,
42
42
  "data-name": "Filter",
43
- disabled: r,
44
- value: e
43
+ disabled: o,
44
+ value: a
45
45
  }
46
46
  ),
47
- /* @__PURE__ */ s("span", { children: [
48
- /* @__PURE__ */ t("span", { className: c("text-b3 font-semibold"), children: b }),
49
- /* @__PURE__ */ t(m, { width: null, name: "CheckDefault", color: "black" }),
50
- x && /* @__PURE__ */ t(m, { name: "ArrowDefaultDown", className: "ml-8", width: "24px", color: "black" })
47
+ /* @__PURE__ */ i("span", { children: [
48
+ /* @__PURE__ */ e("span", { className: r("text-b3 font-semibold"), children: k }),
49
+ /* @__PURE__ */ e(c, { width: null, name: "CheckDefault", color: "black" }),
50
+ x && /* @__PURE__ */ e(c, { name: "ArrowDefaultDown", className: "ml-8", width: "24px", color: "black" })
51
51
  ] })
52
52
  ] });
53
53
  }
54
54
  export {
55
- I as Filter
55
+ T as Filter
56
56
  };
@@ -1,10 +1,10 @@
1
- import { ChangeEvent, FunctionComponent } from 'react';
1
+ import { ChangeEvent } from 'react';
2
2
  import { FormControlProps } from './FormControl.js';
3
3
  interface NumberFieldProps extends FormControlProps<number> {
4
4
  min?: number;
5
5
  max?: number;
6
6
  }
7
- export declare function useNumberField({ id, name, value: initialValue, onChange, min, max, disabled, dataTestId, ...props }: NumberFieldProps): {
7
+ export declare function useNumberField(props: NumberFieldProps): {
8
8
  id: string;
9
9
  min: number;
10
10
  max: number;
@@ -314,5 +314,5 @@ export declare function useNumberField({ id, name, value: initialValue, onChange
314
314
  layout?: "horizontal" | "vertical" | undefined;
315
315
  description?: string | undefined;
316
316
  };
317
- export declare const NumberField: FunctionComponent<NumberFieldProps>;
317
+ export declare const NumberField: (props: NumberFieldProps) => import("react/jsx-runtime").JSX.Element;
318
318
  export {};
@@ -1,114 +1,114 @@
1
- import { jsx as c, jsxs as g } from "react/jsx-runtime";
2
- import { c as x } from "../../index-Cu0xwYjD.js";
3
- import { useValue as v } from "../../hooks/useValue.js";
4
- import { Button as N } from "../Buttons/Button.js";
5
- import { FormControl as y } from "./FormControl.js";
6
- const C = { width: "28px", height: "28px" };
7
- let w = 0;
8
- function F({
9
- id: s = `field-number-${++w}`,
10
- name: e = s,
11
- value: i = 0,
12
- onChange: o,
13
- min: a = 0,
14
- max: l = 10,
15
- disabled: u = !1,
16
- dataTestId: d = "NumberField",
17
- ...r
18
- }) {
19
- const { value: t, setValue: n } = v({
20
- name: e,
21
- defaultValue: i,
1
+ import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
+ import { c as v } from "../../index-Cu0xwYjD.js";
3
+ import { useId as C } from "react";
4
+ import { useValue as y } from "../../hooks/useValue.js";
5
+ import { Button as x } from "../Buttons/Button.js";
6
+ import { FormControl as I } from "./FormControl.js";
7
+ const w = { width: "28px", height: "28px" };
8
+ function F(m) {
9
+ const e = C(), {
10
+ id: n = e,
11
+ name: l = n,
12
+ value: c = 0,
13
+ onChange: d,
14
+ min: t = 0,
15
+ max: r = 10,
16
+ disabled: i = !1,
17
+ dataTestId: u = "NumberField",
18
+ ...f
19
+ } = m, { value: a, setValue: s } = y({
20
+ name: l,
21
+ defaultValue: c,
22
22
  formatter: Number,
23
- onChange: o
23
+ onChange: d
24
24
  });
25
25
  return {
26
- ...r,
27
- id: s,
28
- min: a,
29
- max: l,
30
- name: e,
31
- value: t,
32
- dataTestId: d,
33
- disabled: u,
34
- handleChange: (m) => {
35
- const f = Number(m.target.value);
36
- f >= a && f <= l && n(Number(f));
26
+ ...f,
27
+ id: n,
28
+ min: t,
29
+ max: r,
30
+ name: l,
31
+ value: a,
32
+ dataTestId: u,
33
+ disabled: i,
34
+ handleChange: (N) => {
35
+ const b = Number(N.target.value);
36
+ b >= t && b <= r && s(Number(b));
37
37
  },
38
38
  increase: () => {
39
- t < l && n(t + 1);
39
+ a < r && s(a + 1);
40
40
  },
41
41
  decrease: () => {
42
- t > a && n(t - 1);
42
+ a > t && s(a - 1);
43
43
  }
44
44
  };
45
45
  }
46
- const P = (s) => {
46
+ const k = (m) => {
47
47
  const {
48
48
  disabled: e,
49
- min: i,
50
- max: o,
51
- label: a,
52
- description: l,
53
- id: u,
54
- dataTestId: d,
55
- value: r,
56
- handleChange: t,
57
- increase: n,
58
- decrease: b,
59
- errorMessage: h,
60
- validationStatus: p,
61
- ...m
62
- } = F(s);
63
- return /* @__PURE__ */ c(
64
- y,
49
+ min: n,
50
+ max: l,
51
+ label: c,
52
+ description: d,
53
+ id: t,
54
+ dataTestId: r,
55
+ value: i,
56
+ handleChange: u,
57
+ increase: f,
58
+ decrease: a,
59
+ errorMessage: s,
60
+ validationStatus: h,
61
+ ...p
62
+ } = F(m);
63
+ return /* @__PURE__ */ o(
64
+ I,
65
65
  {
66
- id: u,
67
- label: a,
68
- description: l,
66
+ id: t,
67
+ label: c,
68
+ description: d,
69
69
  className: "flex items-center justify-between",
70
70
  dataName: "NumberField",
71
- dataTestId: d,
72
- errorMessage: h,
73
- validationStatus: p,
71
+ dataTestId: r,
72
+ errorMessage: s,
73
+ validationStatus: h,
74
74
  disabled: e,
75
75
  layout: "vertical",
76
76
  children: /* @__PURE__ */ g("div", { className: "flex items-center gap-x-8", children: [
77
- /* @__PURE__ */ c(
78
- N,
77
+ /* @__PURE__ */ o(
78
+ x,
79
79
  {
80
80
  theme: "yellow",
81
- onClick: b,
81
+ onClick: a,
82
82
  variant: "icon",
83
- disabled: r <= i || e,
83
+ disabled: i <= n || e,
84
84
  icon: "MinusDefault",
85
85
  label: "MINUS"
86
86
  }
87
87
  ),
88
- /* @__PURE__ */ c(
88
+ /* @__PURE__ */ o(
89
89
  "input",
90
90
  {
91
- ...m,
92
- className: x("text-b2 text-center font-normal outline-none", {
91
+ ...p,
92
+ className: v("text-b2 text-center font-normal outline-none", {
93
93
  "bg-pearl text-grey": e
94
94
  }),
95
- style: C,
95
+ style: w,
96
96
  type: "number",
97
- id: u,
98
- onChange: t,
97
+ id: t,
98
+ onChange: u,
99
99
  disabled: e,
100
- value: r,
101
- min: i,
102
- max: o
100
+ value: i,
101
+ min: n,
102
+ max: l
103
103
  }
104
104
  ),
105
- /* @__PURE__ */ c(
106
- N,
105
+ /* @__PURE__ */ o(
106
+ x,
107
107
  {
108
108
  theme: "yellow",
109
- onClick: n,
109
+ onClick: f,
110
110
  variant: "icon",
111
- disabled: r >= o || e,
111
+ disabled: i >= l || e,
112
112
  icon: "PlusDefault",
113
113
  label: "PLUS"
114
114
  }
@@ -118,6 +118,6 @@ const P = (s) => {
118
118
  );
119
119
  };
120
120
  export {
121
- P as NumberField,
121
+ k as NumberField,
122
122
  F as useNumberField
123
123
  };
@@ -1,57 +1,56 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { c as u } from "../../../index-Cu0xwYjD.js";
3
- import { useState as j, useEffect as I } from "react";
4
- import { useValue as M } from "../../../hooks/useValue.js";
5
- import { FormControl as P } from "../FormControl.js";
2
+ import { c as m } from "../../../index-Cu0xwYjD.js";
3
+ import { useId as j, useState as M, useEffect as P } from "react";
4
+ import { useValue as S } from "../../../hooks/useValue.js";
5
+ import { FormControl as T } from "../FormControl.js";
6
6
  import { Icon as n } from "../../../atoms/Icons/Icon.js";
7
7
  import "../../../atoms/Icons/contexts/IconsContext.js";
8
- import { ValidationMessage as S } from "./ValidationMessage.js";
9
- let T = 0;
10
- function B(m) {
11
- const {
12
- id: r = `password-${++T}`,
8
+ import { ValidationMessage as D } from "./ValidationMessage.js";
9
+ function J(u) {
10
+ const f = j(), {
11
+ id: r = f,
13
12
  name: o = r,
14
- label: f,
15
- value: b,
13
+ label: b,
14
+ value: x,
16
15
  disabled: d = !1,
17
16
  validationStatus: e = "default",
18
- errorMessage: x,
19
- validationMessages: p = [],
17
+ errorMessage: g,
18
+ validationMessages: c = [],
20
19
  withoutFieldValidation: s = !1,
21
- className: g,
22
- onChange: h,
23
- dataTestId: v = "Password",
24
- ...w
25
- } = m, { value: y, setValue: N } = M({
20
+ className: h,
21
+ onChange: v,
22
+ dataTestId: w = "Password",
23
+ ...y
24
+ } = u, { value: N, setValue: C } = S({
26
25
  name: o,
27
- initialValue: b,
28
- onChange: h
29
- }), [t, c] = j("password");
30
- I(() => c(t), [t]);
31
- const C = () => c(t === "password" ? "text" : "password");
26
+ initialValue: x,
27
+ onChange: v
28
+ }), [t, p] = M("password");
29
+ P(() => p(t), [t]);
30
+ const V = () => p(t === "password" ? "text" : "password");
32
31
  return /* @__PURE__ */ i(
33
- P,
32
+ T,
34
33
  {
35
34
  id: r,
36
- label: f,
35
+ label: b,
37
36
  dataName: "Password",
38
- dataTestId: v,
37
+ dataTestId: w,
39
38
  disabled: d,
40
39
  validationStatus: s ? "default" : e,
41
- errorMessage: x,
40
+ errorMessage: g,
42
41
  children: [
43
42
  /* @__PURE__ */ i("div", { className: "relative", children: [
44
43
  /* @__PURE__ */ a(
45
44
  "input",
46
45
  {
47
- ...w,
46
+ ...y,
48
47
  id: r,
49
48
  name: o,
50
49
  type: t,
51
- value: y,
50
+ value: N,
52
51
  disabled: d,
53
- onChange: (l) => N(l.target.value),
54
- className: u(
52
+ onChange: (l) => C(l.target.value),
53
+ className: m(
55
54
  "text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black",
56
55
  {
57
56
  "border-lightGrey focus:border-black active:border-black pe-[52px]": s || e === "default",
@@ -59,7 +58,7 @@ function B(m) {
59
58
  "border-red": !s && e === "error",
60
59
  "border-green": !s && e === "success"
61
60
  },
62
- g
61
+ h
63
62
  ),
64
63
  "aria-label": o
65
64
  }
@@ -67,7 +66,7 @@ function B(m) {
67
66
  /* @__PURE__ */ a(
68
67
  "div",
69
68
  {
70
- className: u(
69
+ className: m(
71
70
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12"
72
71
  ),
73
72
  children: /* @__PURE__ */ i("span", { className: "ms-auto flex gap-x-8", children: [
@@ -78,7 +77,7 @@ function B(m) {
78
77
  {
79
78
  type: "button",
80
79
  className: "pointer-events-auto size-24 inline-flex",
81
- onClick: C,
80
+ onClick: V,
82
81
  children: /* @__PURE__ */ a(n, { name: t === "password" ? "Invisible" : "Visible", width: "24px", type: "svg" })
83
82
  }
84
83
  )
@@ -86,11 +85,11 @@ function B(m) {
86
85
  }
87
86
  )
88
87
  ] }),
89
- p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: V }, k) => /* @__PURE__ */ a(S, { label: l, status: V }, k)) })
88
+ c.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: c.map(({ label: l, status: k }, I) => /* @__PURE__ */ a(D, { label: l, status: k }, I)) })
90
89
  ]
91
90
  }
92
91
  );
93
92
  }
94
93
  export {
95
- B as Password
94
+ J as Password
96
95
  };
@@ -12,4 +12,4 @@ export interface RadioProps<Value = string> extends Omit<InputHTMLAttributes<HTM
12
12
  size?: number;
13
13
  onChange?: (name: string, value: Value | null) => void;
14
14
  }
15
- export declare function Radio<Value = string>({ id, name, className, dataTestId, disabled, checked: initialChecked, value, size, tabIndex, children, onChange, ...rest }: RadioProps<Value>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Radio<Value = string>(props: RadioProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -1,57 +1,57 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { c as y } from "../../../index-Cu0xwYjD.js";
2
+ import { c as b } from "../../../index-Cu0xwYjD.js";
3
+ import { useId as k } from "react";
3
4
  import { useValue as w } from "../../../hooks/useValue.js";
4
5
  import "../../../controls-l0sNRNKZ.js";
5
- let k = 0;
6
- function R({
7
- id: o = "radio-" + k++,
8
- name: r = o,
9
- className: d,
10
- dataTestId: m,
11
- disabled: t,
12
- checked: f = !1,
13
- value: i,
14
- size: a = 24,
15
- tabIndex: n = 0,
16
- children: p,
17
- onChange: l,
18
- ...h
19
- }) {
20
- const { value: s, setValue: u } = w({
21
- name: r,
6
+ function R(d) {
7
+ const n = k(), {
8
+ id: o = n,
9
+ name: l = o,
10
+ className: m,
11
+ dataTestId: h,
12
+ disabled: a,
13
+ checked: f = !1,
14
+ value: i,
15
+ size: t = 24,
16
+ tabIndex: p = 0,
17
+ children: u,
18
+ onChange: s,
19
+ ...v
20
+ } = d, { value: r, setValue: x } = w({
21
+ name: l,
22
22
  initialValue: f,
23
- onChange(x, v) {
24
- l == null || l(x, i !== void 0 ? i : v);
23
+ onChange(g, y) {
24
+ s == null || s(g, i !== void 0 ? i : y);
25
25
  }
26
26
  });
27
27
  return /* @__PURE__ */ c(
28
28
  "label",
29
29
  {
30
- className: y(d, "relative flex items-center gap-8", {
31
- "text-grey": t
30
+ className: b(m, "relative flex items-center gap-8", {
31
+ "text-grey": a
32
32
  }),
33
33
  children: [
34
34
  /* @__PURE__ */ c("span", { className: "relative", children: [
35
35
  /* @__PURE__ */ e(
36
36
  "input",
37
37
  {
38
- ...h,
39
- name: r,
40
- "data-testid": m,
38
+ ...v,
39
+ name: l,
40
+ "data-testid": h,
41
41
  type: "radio",
42
- tabIndex: n,
42
+ tabIndex: p,
43
43
  onChange: () => {
44
- !t && u(!s);
44
+ !a && x(!r);
45
45
  },
46
- defaultChecked: s,
46
+ defaultChecked: r,
47
47
  "data-name": "Radio",
48
- disabled: t,
48
+ disabled: a,
49
49
  value: i
50
50
  }
51
51
  ),
52
- /* @__PURE__ */ e("span", { style: { height: a, width: a }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", width: a * 2 / 3, className: "overflow-visible", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "8px", style: { fill: "hsl(var(--color-saffron))" } }) }) })
52
+ /* @__PURE__ */ e("span", { style: { height: t, width: t }, children: /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", width: t * 2 / 3, className: "overflow-visible", children: /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "8px", style: { fill: "hsl(var(--color-saffron))" } }) }) })
53
53
  ] }),
54
- p
54
+ u
55
55
  ]
56
56
  }
57
57
  );
@@ -2,4 +2,4 @@ import { HTMLAttributes } from 'react';
2
2
  import { FormControlProps } from '../FormControl.js';
3
3
  export interface RadioGroupProps<Value = string> extends Pick<FormControlProps<Value>, 'id' | 'name' | 'value' | 'onChange' | 'disabled' | 'readOnly' | 'tabIndex' | 'description' | 'validationStatus' | 'errorMessage'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
4
  }
5
- export declare function RadioGroup<Value = string>({ id, name, children, value: initialValue, defaultValue, onChange, disabled, readOnly, tabIndex, ...rest }: RadioGroupProps<Value>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function RadioGroup<Value = string>(props: RadioGroupProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -1,39 +1,38 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { Children as v, isValidElement as x, cloneElement as V } from "react";
3
- import { useValue as C } from "../../../hooks/useValue.js";
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { useId as x, Children as I, isValidElement as b, cloneElement as C } from "react";
3
+ import { useValue as h } from "../../../hooks/useValue.js";
4
4
  import { c as E } from "../../../index-Cu0xwYjD.js";
5
- let N = 0;
6
- function I({
7
- id: o = "radio-group-" + N++,
8
- name: r = o,
9
- children: s,
10
- value: u,
11
- defaultValue: l,
12
- onChange: m,
13
- disabled: t,
14
- readOnly: n,
15
- tabIndex: i = 0,
16
- ...a
17
- }) {
18
- const { value: c, setValue: f } = C({
5
+ function G(l) {
6
+ const s = x(), {
7
+ id: a = s,
8
+ name: r = a,
9
+ children: t,
10
+ value: i,
11
+ defaultValue: m,
12
+ onChange: u,
13
+ disabled: d,
14
+ readOnly: p,
15
+ tabIndex: c = 0,
16
+ ...n
17
+ } = l, { value: f, setValue: V } = h({
19
18
  name: r,
20
- initialValue: u,
21
- defaultValue: l,
22
- onChange: m
19
+ initialValue: i,
20
+ defaultValue: m,
21
+ onChange: u
23
22
  });
24
- return /* @__PURE__ */ g("div", { ...a, className: E("flex gap-12", a.className), role: "radiogroup", children: v.map(s, (e, p) => x(e) ? V(e, {
23
+ return /* @__PURE__ */ v("div", { ...n, className: E("flex gap-12", n.className), role: "radiogroup", children: I.map(t, (e, o) => b(e) ? C(e, {
25
24
  ...e.props,
26
25
  name: r,
27
- id: `${o}-${p}`,
28
- disabled: t,
29
- readOnly: n,
30
- tabIndex: i + p + 1,
31
- checked: c === e.props.value,
32
- onChange($, d) {
33
- f(d);
26
+ id: `${a}-${o}`,
27
+ disabled: d,
28
+ readOnly: p,
29
+ tabIndex: c + o + 1,
30
+ checked: f === e.props.value,
31
+ onChange(N, g) {
32
+ V(g);
34
33
  }
35
34
  }) : e) });
36
35
  }
37
36
  export {
38
- I as RadioGroup
37
+ G as RadioGroup
39
38
  };
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, InputHTMLAttributes } from 'react';
1
+ import { InputHTMLAttributes } from 'react';
2
2
  import './range.css';
3
3
  interface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
4
4
  /**
@@ -37,5 +37,5 @@ interface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChan
37
37
  label: string;
38
38
  }[];
39
39
  }
40
- export declare const Range: FunctionComponent<RangeProps>;
40
+ export declare const Range: (props: RangeProps) => import("react/jsx-runtime").JSX.Element;
41
41
  export {};