@clubmed/trident-ui 1.0.1 → 1.1.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) 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/DateField.js +45 -43
  111. package/molecules/Forms/DateField.js.map +1 -1
  112. package/molecules/Forms/FormControl.d.ts +1 -1
  113. package/molecules/Forms/FormControl.js +37 -26
  114. package/molecules/Forms/FormControl.js.map +1 -1
  115. package/molecules/Forms/FormLabel.d.ts +2 -1
  116. package/molecules/Forms/FormLabel.js +20 -19
  117. package/molecules/Forms/FormLabel.js.map +1 -1
  118. package/molecules/Forms/NumberField.d.ts +1 -0
  119. package/molecules/Forms/NumberField.js +42 -40
  120. package/molecules/Forms/NumberField.js.map +1 -1
  121. package/molecules/Forms/Password/Password.js +23 -21
  122. package/molecules/Forms/Password/Password.js.map +1 -1
  123. package/molecules/Forms/Select.js +18 -16
  124. package/molecules/Forms/Select.js.map +1 -1
  125. package/molecules/Forms/TextField.js +37 -35
  126. package/molecules/Forms/TextField.js.map +1 -1
  127. package/package.json +6 -6
@@ -1,42 +1,42 @@
1
1
  import { jsx as m, jsxs as C } from "react/jsx-runtime";
2
- import { c as p } from "../../index-Cu0xwYjD.js";
2
+ import { c as g } from "../../index-Cu0xwYjD.js";
3
3
  import { useId as y } from "react";
4
4
  import { useValue as I } from "../../hooks/useValue.js";
5
- import { Button as g } from "../Buttons/Button.js";
5
+ import { Button as v } from "../Buttons/Button.js";
6
6
  import { FormControl as w } from "./FormControl.js";
7
7
  const F = { width: "28px", height: "28px" };
8
- function V(o) {
8
+ function S(o) {
9
9
  const e = y(), {
10
10
  id: n = e,
11
- name: l = n,
12
- value: c = 0,
13
- onChange: d,
11
+ name: r = n,
12
+ value: d = 0,
13
+ onChange: c,
14
14
  min: t = 0,
15
- max: r = 10,
16
- disabled: i = !1,
15
+ max: i = 10,
16
+ disabled: l = !1,
17
17
  dataTestId: u = "NumberField",
18
18
  ...f
19
19
  } = o, { value: a, setValue: s } = I({
20
- name: l,
21
- defaultValue: c,
20
+ name: r,
21
+ defaultValue: d,
22
22
  formatter: Number,
23
- onChange: d
23
+ onChange: c
24
24
  });
25
25
  return {
26
26
  ...f,
27
27
  id: n,
28
28
  min: t,
29
- max: r,
30
- name: l,
29
+ max: i,
30
+ name: r,
31
31
  value: a,
32
32
  dataTestId: u,
33
- disabled: i,
34
- handleChange: (v) => {
35
- const h = Number(v.target.value);
36
- h >= t && h <= r && s(Number(h));
33
+ disabled: l,
34
+ handleChange: (h) => {
35
+ const N = Number(h.target.value);
36
+ N >= t && N <= i && s(Number(N));
37
37
  },
38
38
  increase: () => {
39
- a < r && s(a + 1);
39
+ a < i && s(a + 1);
40
40
  },
41
41
  decrease: () => {
42
42
  a > t && s(a - 1);
@@ -47,42 +47,44 @@ const k = (o) => {
47
47
  const {
48
48
  disabled: e,
49
49
  min: n,
50
- max: l,
51
- label: c,
52
- description: d,
50
+ max: r,
51
+ label: d,
52
+ description: c,
53
53
  id: t,
54
- dataTestId: r,
55
- value: i,
54
+ dataTestId: i,
55
+ value: l,
56
56
  handleChange: u,
57
57
  increase: f,
58
58
  decrease: a,
59
59
  errorMessage: s,
60
- validationStatus: N,
60
+ validationStatus: x,
61
+ hideRequiredStar: p,
61
62
  required: b,
62
- ...x
63
- } = V(o);
63
+ ...h
64
+ } = S(o);
64
65
  return /* @__PURE__ */ m(
65
66
  w,
66
67
  {
67
68
  id: t,
68
- label: c,
69
- description: d,
70
- className: p("flex items-center justify-between", o.className),
69
+ label: d,
70
+ description: c,
71
+ className: g("flex items-center justify-between", o.className),
71
72
  dataName: "NumberField",
72
- dataTestId: r,
73
+ dataTestId: i,
73
74
  errorMessage: s,
74
- validationStatus: N,
75
+ validationStatus: x,
75
76
  disabled: e,
76
77
  required: b,
78
+ hideRequiredStar: p,
77
79
  layout: "vertical",
78
80
  children: /* @__PURE__ */ C("div", { className: "flex items-center gap-x-8", children: [
79
81
  /* @__PURE__ */ m(
80
- g,
82
+ v,
81
83
  {
82
84
  theme: "yellow",
83
85
  onClick: a,
84
86
  variant: "icon",
85
- disabled: i <= n || e,
87
+ disabled: l <= n || e,
86
88
  icon: "MinusDefault",
87
89
  label: "MINUS"
88
90
  }
@@ -90,8 +92,8 @@ const k = (o) => {
90
92
  /* @__PURE__ */ m(
91
93
  "input",
92
94
  {
93
- ...x,
94
- className: p("text-b2 text-center font-normal outline-none", {
95
+ ...h,
96
+ className: g("text-b2 text-center font-normal outline-none", {
95
97
  "bg-pearl text-grey": e
96
98
  }),
97
99
  style: F,
@@ -100,18 +102,18 @@ const k = (o) => {
100
102
  onChange: u,
101
103
  disabled: e,
102
104
  required: b,
103
- value: i,
105
+ value: l,
104
106
  min: n,
105
- max: l
107
+ max: r
106
108
  }
107
109
  ),
108
110
  /* @__PURE__ */ m(
109
- g,
111
+ v,
110
112
  {
111
113
  theme: "yellow",
112
114
  onClick: f,
113
115
  variant: "icon",
114
- disabled: i >= l || e,
116
+ disabled: l >= r || e,
115
117
  icon: "PlusDefault",
116
118
  label: "PLUS"
117
119
  }
@@ -122,6 +124,6 @@ const k = (o) => {
122
124
  };
123
125
  export {
124
126
  k as NumberField,
125
- V as useNumberField
127
+ S as useNumberField
126
128
  };
127
129
  //# sourceMappingURL=NumberField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.js","sources":["../../../lib/molecules/Forms/NumberField.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { ChangeEvent, useId } from 'react';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { Button } from '../Buttons/Button';\nimport { FormControl, FormControlProps } from './FormControl.js';\n\ninterface NumberFieldProps extends FormControlProps<number> {\n min?: number;\n max?: number;\n}\n\nconst INPUT_STYLE = { width: '28px', height: '28px' };\n\nexport function useNumberField(props: NumberFieldProps) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n value: initialValue = 0,\n onChange,\n min = 0,\n max = 10,\n disabled = false,\n dataTestId = 'NumberField',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<number, string | number | boolean>({\n name: name!,\n defaultValue: initialValue,\n formatter: Number,\n onChange,\n });\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number(e.target.value);\n\n if (newValue >= min && newValue <= max) {\n setValue(Number(newValue));\n }\n };\n\n const increase = () => {\n if (value < max) {\n setValue(value + 1);\n }\n };\n\n const decrease = () => {\n if (value > min) {\n setValue(value - 1);\n }\n };\n\n return {\n ...rest,\n id,\n min,\n max,\n name,\n value,\n dataTestId,\n disabled,\n handleChange,\n increase,\n decrease,\n };\n}\n\nexport const NumberField = (props: NumberFieldProps) => {\n const {\n disabled,\n min,\n max,\n label,\n description,\n id,\n dataTestId,\n value,\n handleChange,\n increase,\n decrease,\n errorMessage,\n validationStatus,\n required,\n ...rest\n } = useNumberField(props);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n className={classnames('flex items-center justify-between', props.className)}\n dataName=\"NumberField\"\n dataTestId={dataTestId}\n errorMessage={errorMessage}\n validationStatus={validationStatus}\n disabled={disabled}\n required={required}\n layout=\"vertical\"\n >\n <div className=\"flex items-center gap-x-8\">\n <Button\n theme=\"yellow\"\n onClick={decrease}\n variant=\"icon\"\n disabled={value <= min || disabled}\n icon=\"MinusDefault\"\n // TODO have this from prop at some time\n label=\"MINUS\"\n />\n <input\n {...rest}\n className={classnames('text-b2 text-center font-normal outline-none', {\n 'bg-pearl text-grey': disabled,\n })}\n style={INPUT_STYLE}\n type=\"number\"\n id={id}\n onChange={handleChange}\n disabled={disabled}\n required={required}\n value={value}\n min={min}\n max={max}\n />\n <Button\n theme=\"yellow\"\n onClick={increase}\n variant=\"icon\"\n disabled={value >= max || disabled}\n icon=\"PlusDefault\"\n // TODO have this from prop at some time\n label=\"PLUS\"\n />\n </div>\n </FormControl>\n );\n};\n"],"names":["INPUT_STYLE","useNumberField","props","internalId","useId","id","name","initialValue","onChange","min","max","disabled","dataTestId","rest","value","setValue","useValue","e","newValue","NumberField","label","description","handleChange","increase","decrease","errorMessage","validationStatus","required","jsx","FormControl","classnames","jsxs","Button"],"mappings":";;;;;;AAaA,MAAMA,IAAc,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAE7C,SAASC,EAAeC,GAAyB;AACtD,QAAMC,IAA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eC,CAAK;AAGtB,SAAA,gBAAA0B;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAxB;AAAA,MACA,OAAAe;AAAA,MACA,aAAAC;AAAA,MACA,WAAWS,EAAW,qCAAqC5B,EAAM,SAAS;AAAA,MAC1E,UAAS;AAAA,MACT,YAAAU;AAAA,MACA,cAAAa;AAAA,MACA,kBAAAC;AAAA,MACA,UAAAf;AAAA,MACA,UAAAgB;AAAA,MACA,QAAO;AAAA,MAEP,UAAA,gBAAAI,EAAC,OAAI,EAAA,WAAU,6BACb,UAAA;AAAA,QAAA,gBAAAH;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAASR;AAAA,YACT,SAAQ;AAAA,YACR,UAAUV,KAASL,KAAOE;AAAA,YAC1B,MAAK;AAAA,YAEL,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,QACA,gBAAAiB;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGf;AAAA,YACJ,WAAWiB,EAAW,gDAAgD;AAAA,cACpE,sBAAsBnB;AAAA,YAAA,CACvB;AAAA,YACD,OAAOX;AAAA,YACP,MAAK;AAAA,YACL,IAAAK;AAAA,YACA,UAAUiB;AAAA,YACV,UAAAX;AAAA,YACA,UAAAgB;AAAA,YACA,OAAAb;AAAA,YACA,KAAAL;AAAA,YACA,KAAAC;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAkB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAAST;AAAA,YACT,SAAQ;AAAA,YACR,UAAUT,KAASJ,KAAOC;AAAA,YAC1B,MAAK;AAAA,YAEL,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"NumberField.js","sources":["../../../lib/molecules/Forms/NumberField.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { ChangeEvent, useId } from 'react';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { Button } from '../Buttons/Button';\nimport { FormControl, FormControlProps } from './FormControl.js';\n\ninterface NumberFieldProps extends FormControlProps<number> {\n min?: number;\n max?: number;\n}\n\nconst INPUT_STYLE = { width: '28px', height: '28px' };\n\nexport function useNumberField(props: NumberFieldProps) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n value: initialValue = 0,\n onChange,\n min = 0,\n max = 10,\n disabled = false,\n dataTestId = 'NumberField',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<number, string | number | boolean>({\n name: name!,\n defaultValue: initialValue,\n formatter: Number,\n onChange,\n });\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number(e.target.value);\n\n if (newValue >= min && newValue <= max) {\n setValue(Number(newValue));\n }\n };\n\n const increase = () => {\n if (value < max) {\n setValue(value + 1);\n }\n };\n\n const decrease = () => {\n if (value > min) {\n setValue(value - 1);\n }\n };\n\n return {\n ...rest,\n id,\n min,\n max,\n name,\n value,\n dataTestId,\n disabled,\n handleChange,\n increase,\n decrease,\n };\n}\n\nexport const NumberField = (props: NumberFieldProps) => {\n const {\n disabled,\n min,\n max,\n label,\n description,\n id,\n dataTestId,\n value,\n handleChange,\n increase,\n decrease,\n errorMessage,\n validationStatus,\n hideRequiredStar,\n required,\n ...rest\n } = useNumberField(props);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n className={classnames('flex items-center justify-between', props.className)}\n dataName=\"NumberField\"\n dataTestId={dataTestId}\n errorMessage={errorMessage}\n validationStatus={validationStatus}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n layout=\"vertical\"\n >\n <div className=\"flex items-center gap-x-8\">\n <Button\n theme=\"yellow\"\n onClick={decrease}\n variant=\"icon\"\n disabled={value <= min || disabled}\n icon=\"MinusDefault\"\n // TODO have this from prop at some time\n label=\"MINUS\"\n />\n <input\n {...rest}\n className={classnames('text-b2 text-center font-normal outline-none', {\n 'bg-pearl text-grey': disabled,\n })}\n style={INPUT_STYLE}\n type=\"number\"\n id={id}\n onChange={handleChange}\n disabled={disabled}\n required={required}\n value={value}\n min={min}\n max={max}\n />\n <Button\n theme=\"yellow\"\n onClick={increase}\n variant=\"icon\"\n disabled={value >= max || disabled}\n icon=\"PlusDefault\"\n // TODO have this from prop at some time\n label=\"PLUS\"\n />\n </div>\n </FormControl>\n );\n};\n"],"names":["INPUT_STYLE","useNumberField","props","internalId","useId","id","name","initialValue","onChange","min","max","disabled","dataTestId","rest","value","setValue","useValue","e","newValue","NumberField","label","description","handleChange","increase","decrease","errorMessage","validationStatus","hideRequiredStar","required","jsx","FormControl","classnames","jsxs","Button"],"mappings":";;;;;;AAaA,MAAMA,IAAc,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAE7C,SAASC,EAAeC,GAAyB;AACtD,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAOE,IAAe;AAAA,IACtB,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,KAAAC,IAAM;AAAA,IACN,UAAAC,IAAW;AAAA,IACX,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAX,GAEE,EAAE,OAAAY,GAAO,UAAAC,EAAS,IAAIC,EAA4C;AAAA,IACtE,MAAAV;AAAA,IACA,cAAcC;AAAA,IACd,WAAW;AAAA,IACX,UAAAC;AAAA,EAAA,CACD;AAsBM,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,IAAAR;AAAA,IACA,KAAAI;AAAA,IACA,KAAAC;AAAA,IACA,MAAAJ;AAAA,IACA,OAAAQ;AAAA,IACA,YAAAF;AAAA,IACA,UAAAD;AAAA,IACA,cA7BmB,CAACM,MAAqC;AACzD,YAAMC,IAAW,OAAOD,EAAE,OAAO,KAAK;AAElC,MAAAC,KAAYT,KAAOS,KAAYR,KACxBK,EAAA,OAAOG,CAAQ,CAAC;AAAA,IAC3B;AAAA,IAyBA,UAtB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AAAA,YACD,OAAOX;AAAA,YACP,MAAK;AAAA,YACL,IAAAK;AAAA,YACA,UAAUiB;AAAA,YACV,UAAAX;AAAA,YACA,UAAAiB;AAAA,YACA,OAAAd;AAAA,YACA,KAAAL;AAAA,YACA,KAAAC;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAmB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAASV;AAAA,YACT,SAAQ;AAAA,YACR,UAAUT,KAASJ,KAAOC;AAAA,YAC1B,MAAK;AAAA,YAEL,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import { c as m } from "../../../index-Cu0xwYjD.js";
3
- import { useId as M, useState as P, useEffect as S } from "react";
4
- import { useValue as T } from "../../../hooks/useValue.js";
3
+ import { useId as M, useState as P, useEffect as T } from "react";
4
+ import { useValue as q } from "../../../hooks/useValue.js";
5
5
  import { FormControl as D } from "../FormControl.js";
6
6
  import { Icon as n } from "../../../atoms/Icons/Icon.js";
7
7
  import "../../../atoms/Icons/contexts/IconsContext.js";
@@ -11,49 +11,51 @@ function K(f) {
11
11
  id: r = b,
12
12
  name: o = r,
13
13
  label: x,
14
- value: g,
14
+ value: h,
15
15
  disabled: d = !1,
16
16
  required: c = !1,
17
+ hideRequiredStar: g,
17
18
  validationStatus: e = "default",
18
- errorMessage: h,
19
+ errorMessage: v,
19
20
  validationMessages: p = [],
20
21
  withoutFieldValidation: s = !1,
21
- className: v,
22
- onChange: w,
23
- dataTestId: y = "Password",
24
- ...N
25
- } = f, { value: C, setValue: V } = T({
22
+ className: w,
23
+ onChange: y,
24
+ dataTestId: N = "Password",
25
+ ...C
26
+ } = f, { value: V, setValue: k } = q({
26
27
  name: o,
27
- initialValue: g,
28
- onChange: w
28
+ initialValue: h,
29
+ onChange: y
29
30
  }), [t, u] = P("password");
30
- S(() => u(t), [t]);
31
- const k = () => u(t === "password" ? "text" : "password");
31
+ T(() => u(t), [t]);
32
+ const I = () => u(t === "password" ? "text" : "password");
32
33
  return /* @__PURE__ */ i(
33
34
  D,
34
35
  {
35
- className: v,
36
+ className: w,
36
37
  id: r,
37
38
  label: x,
38
39
  dataName: "Password",
39
- dataTestId: y,
40
+ dataTestId: N,
40
41
  disabled: d,
41
42
  required: c,
43
+ hideRequiredStar: g,
42
44
  validationStatus: s ? "default" : e,
43
- errorMessage: h,
45
+ errorMessage: v,
44
46
  children: [
45
47
  /* @__PURE__ */ i("div", { className: "relative", children: [
46
48
  /* @__PURE__ */ a(
47
49
  "input",
48
50
  {
49
- ...N,
51
+ ...C,
50
52
  id: r,
51
53
  name: o,
52
54
  type: t,
53
- value: C,
55
+ value: V,
54
56
  disabled: d,
55
57
  required: c,
56
- onChange: (l) => V(l.target.value),
58
+ onChange: (l) => k(l.target.value),
57
59
  className: m(
58
60
  "text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black",
59
61
  {
@@ -80,7 +82,7 @@ function K(f) {
80
82
  {
81
83
  type: "button",
82
84
  className: "pointer-events-auto size-24 inline-flex",
83
- onClick: k,
85
+ onClick: I,
84
86
  children: /* @__PURE__ */ a(n, { name: t === "password" ? "Invisible" : "Visible", width: "24px", type: "svg" })
85
87
  }
86
88
  )
@@ -88,7 +90,7 @@ function K(f) {
88
90
  }
89
91
  )
90
92
  ] }),
91
- p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: I }, j) => /* @__PURE__ */ a(F, { label: l, status: I }, j)) })
93
+ p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: S }, j) => /* @__PURE__ */ a(F, { label: l, status: S }, j)) })
92
94
  ]
93
95
  }
94
96
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => setType(type), [type]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n withoutFieldValidation || validationStatus === 'default',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon name={type === 'password' ? 'Invisible' : 'Visible'} width=\"24px\" type=\"svg\" />\n </button>\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAcO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,oBAAAC,IAAqB,CAAC;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACzB,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAhB,GAEE,EAAE,OAAAiB,GAAO,UAAAC,EAAS,IAAIC,EAAgB;AAAA,IAC1C,MAAAf;AAAA,IACA,cAAAE;AAAA,IACA,UAAAQ;AAAA,EAAA,CACD,GACK,CAACM,GAAMC,CAAO,IAAIC,EAAiC,UAA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AqB,aAC/C,gBAAAkB,EAACG,GAAK,EAAA,MAAK,gBAAe,OAAM,SAAQ,OAAM,OAAO,CAAA;AAAA,gBAGvD,gBAAAH;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,SAASH;AAAA,oBAET,UAAA,gBAAAG,EAACG,GAAK,EAAA,MAAMV,MAAS,aAAa,cAAc,WAAW,OAAM,QAAO,MAAK,MAAM,CAAA;AAAA,kBAAA;AAAA,gBACrF;AAAA,cAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,QAECT,EAAmB,SAAS,KAC3B,gBAAAgB,EAAC,SAAI,WAAU,iCACZ,UAAmBhB,EAAA,IAAI,CAAC,EAAE,OAAAN,GAAO,QAAA0B,EAAU,GAAAC,MACzC,gBAAAL,EAAAM,GAAA,EAAkB,OAAO5B,GAAO,QAAA0B,EAAA,GAAqBC,CAAO,CAC9D,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n hideRequiredStar,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => setType(type), [type]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n withoutFieldValidation || validationStatus === 'default',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon name={type === 'password' ? 'Invisible' : 'Visible'} width=\"24px\" type=\"svg\" />\n </button>\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","hideRequiredStar","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAcO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,oBAAAC,IAAqB,CAAC;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACzB,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAjB,GAEE,EAAE,OAAAkB,GAAO,UAAAC,EAAS,IAAIC,EAAgB;AAAA,IAC1C,MAAAhB;AAAA,IACA,cAAAE;AAAA,IACA,UAAAS;AAAA,EAAA,CACD,GACK,CAACM,GAAMC,CAAO,IAAIC,EAAiC,UAAU;AAEnE,EAAAC,EAAU,MAAMF,EAAQD,CAAI,GAAG,CAACA,CAAI,CAAC;AAErC,QAAMI,IAAa,MAAMH,EAAQD,MAAS,aAAa,SAAS,UAAU;AAGxE,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAb;AAAA,MACA,IAAAX;AAAA,MACA,OAAAE;AAAA,MACA,UAAS;AAAA,MACT,YAAAW;AAAA,MACA,UAAAT;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAkBI,IAAyB,YAAYH;AAAA,MACvD,cAAAC;AAAA,MAEA,UAAA;AAAA,QAAC,gBAAAe,EAAA,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,UAAA,gBAAAE;AAAA,YA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,EAAA,IAAI,CAAC,EAAE,OAAAP,GAAO,QAAA2B,EAAU,GAAAC,MACzC,gBAAAL,EAAAM,GAAA,EAAkB,OAAO7B,GAAO,QAAA2B,EAAA,GAAqBC,CAAO,CAC9D,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1,13 +1,13 @@
1
1
  import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
2
  import { c as l } from "../../index-Cu0xwYjD.js";
3
- import { useValue as D } from "../../hooks/useValue.js";
4
- import { useInternalStatus as I } from "../../hooks/useInternalStatus.js";
5
- import { FormControl as S } from "./FormControl.js";
3
+ import { useValue as I } from "../../hooks/useValue.js";
4
+ import { useInternalStatus as S } from "../../hooks/useInternalStatus.js";
5
+ import { FormControl as j } from "./FormControl.js";
6
6
  import { Icon as n } from "../../atoms/Icons/Icon.js";
7
7
  import "../../atoms/Icons/contexts/IconsContext.js";
8
- import { useId as j } from "react";
8
+ import { useId as T } from "react";
9
9
  const B = (p) => {
10
- const u = j(), {
10
+ const u = T(), {
11
11
  id: t = u,
12
12
  name: a = t,
13
13
  label: m,
@@ -18,26 +18,28 @@ const B = (p) => {
18
18
  errorMessage: x,
19
19
  disabled: s = !1,
20
20
  required: d = !1,
21
+ hideRequiredStar: h,
21
22
  className: g,
22
- dataTestId: h = t,
23
- onChange: v,
24
- children: y,
25
- ...w
26
- } = p, { value: N, setValue: k } = D({ name: a, initialValue: b, onChange: v }), e = I({
23
+ dataTestId: v = t,
24
+ onChange: y,
25
+ children: w,
26
+ ...N
27
+ } = p, { value: k, setValue: C } = I({ name: a, initialValue: b, onChange: y }), e = S({
27
28
  isDisabled: s,
28
29
  validationStatus: o
29
30
  });
30
31
  return /* @__PURE__ */ r(
31
- S,
32
+ j,
32
33
  {
33
34
  id: t,
34
35
  className: g,
35
36
  label: m,
36
37
  description: f,
37
38
  dataName: "TextField",
38
- dataTestId: h,
39
+ dataTestId: v,
39
40
  disabled: s,
40
41
  required: d,
42
+ hideRequiredStar: h,
41
43
  validationStatus: o,
42
44
  errorMessage: x,
43
45
  children: /* @__PURE__ */ c(
@@ -51,13 +53,13 @@ const B = (p) => {
51
53
  /* @__PURE__ */ r(
52
54
  "select",
53
55
  {
54
- ...w,
56
+ ...N,
55
57
  id: t,
56
58
  name: a,
57
59
  disabled: s,
58
60
  required: d,
59
- value: N,
60
- onChange: (C) => k(C.target.value),
61
+ value: k,
62
+ onChange: (D) => C(D.target.value),
61
63
  className: l(
62
64
  "text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent",
63
65
  {
@@ -70,7 +72,7 @@ const B = (p) => {
70
72
  }
71
73
  ),
72
74
  "aria-label": a,
73
- children: y
75
+ children: w
74
76
  }
75
77
  ),
76
78
  /* @__PURE__ */ r(
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, FormControlProps } from './FormControl.js';\nimport { Icon, IconicTypes } from '@/atoms/Icons';\nimport { SelectHTMLAttributes, useId } from 'react';\n\nexport interface SelectProps<Value>\n extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {\n description?: string;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const Select = <Value = string,>(props: SelectProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n className,\n dataTestId = id,\n onChange,\n children,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n className={className}\n label={label}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div\n className={classnames('relative rounded-pill z-0', {\n 'bg-white': internalStatus !== 'disabled',\n 'bg-pearl': internalStatus === 'disabled',\n })}\n >\n <select\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n internalStatus === 'default',\n 'pe-[84px]': internalStatus === 'error' || internalStatus === 'success',\n 'text-black': internalStatus !== 'disabled',\n 'text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n >\n {children}\n </select>\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n\n <button className=\"pointer-events-auto inline-flex\">\n <Icon name=\"ArrowDefaultDown\" type=\"svg\" width=\"24px\" color=\"black\" />\n </button>\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["Select","props","internalId","useId","id","name","label","initialValue","description","validationStatus","iconType","errorMessage","disabled","required","className","dataTestId","onChange","children","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","classnames","e","Icon"],"mappings":";;;;;;;;AAea,MAAAA,IAAS,CAAkBC,MAA8B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA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oBAChC,cAAcA,MAAmB;AAAA,oBACjC,gBAAgBA,MAAmB;AAAA,kBACrC;AAAA,gBACF;AAAA,gBACA,cAAYjB;AAAA,gBAEX,UAAAY;AAAA,cAAA;AAAA,YACH;AAAA,YAEA,gBAAAO;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWG;AAAA,kBACT;AAAA,kBACA;AAAA,oBACE,aAAaL,MAAmB;AAAA,oBAChC,YAAYA,MAAmB;AAAA,oBAC/B,cAAcA,MAAmB;AAAA,kBACnC;AAAA,gBACF;AAAA,gBAEA,UAAA,gBAAAI,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,kBAAmBJ,MAAA,6BACjBO,GAAK,EAAA,MAAK,gBAAe,OAAM,QAAO,MAAMnB,EAAU,CAAA;AAAA,kBAGxDY,MAAmB,aACjB,gBAAAE,EAAAK,GAAA,EAAK,MAAK,gBAAe,OAAM,QAAO,MAAMnB,EAAU,CAAA;AAAA,kBAGxD,gBAAAc,EAAA,UAAA,EAAO,WAAU,mCAChB,4BAACK,GAAK,EAAA,MAAK,oBAAmB,MAAK,OAAM,OAAM,QAAO,OAAM,QAAQ,CAAA,GACtE;AAAA,gBAAA,GACF;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../lib/molecules/Forms/Select.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, FormControlProps } from './FormControl.js';\nimport { Icon, IconicTypes } from '@/atoms/Icons';\nimport { SelectHTMLAttributes, useId } from 'react';\n\nexport interface SelectProps<Value>\n extends FormControlProps<Value, SelectHTMLAttributes<HTMLSelectElement>> {\n description?: string;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const Select = <Value = string,>(props: SelectProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = id,\n onChange,\n children,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n className={className}\n label={label}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div\n className={classnames('relative rounded-pill z-0', {\n 'bg-white': internalStatus !== 'disabled',\n 'bg-pearl': internalStatus === 'disabled',\n })}\n >\n <select\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none appearance-none bg-transparent',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n internalStatus === 'default',\n 'pe-[84px]': internalStatus === 'error' || internalStatus === 'success',\n 'text-black': internalStatus !== 'disabled',\n 'text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n >\n {children}\n </select>\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12 -z-1',\n {\n 'text-grey': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n\n <button className=\"pointer-events-auto inline-flex\">\n <Icon name=\"ArrowDefaultDown\" type=\"svg\" width=\"24px\" color=\"black\" />\n </button>\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["Select","props","internalId","useId","id","name","label","initialValue","description","validationStatus","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","children","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","classnames","e","Icon"],"mappings":";;;;;;;;AAea,MAAAA,IAAS,CAAkBC,MAA8B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAaZ;AAAA,IACb,UAAAa;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAlB,GAEE,EAAE,OAAAmB,GAAO,UAAAC,MAAaC,EAAgB,EAAE,MAAAjB,GAAM,cAAAE,GAAc,UAAAU,EAAA,CAAU,GACtEM,IAAiBC,EAAkB;AAAA,IACvC,YAAYZ;AAAA,IACZ,kBAAAH;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAtB;AAAA,MACA,WAAAW;AAAA,MACA,OAAAT;AAAA,MACA,aAAAE;AAAA,MACA,UAAS;AAAA,MACT,YAAAQ;AAAA,MACA,UAAAJ;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAL;AAAA,MACA,cAAAE;AAAA,MAEA,UAAA,gBAAAgB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWC,EAAW,6BAA6B;AAAA,YACjD,YAAYL,MAAmB;AAAA,YAC/B,YAAYA,MAAmB;AA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AAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,57 +1,59 @@
1
- import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
- import { c as m } from "../../index-Cu0xwYjD.js";
3
- import { useValue as T } from "../../hooks/useValue.js";
4
- import { useInternalStatus as k } from "../../hooks/useInternalStatus.js";
5
- import { FormControl as F } from "./FormControl.js";
6
- import { Icon as i } from "../../atoms/Icons/Icon.js";
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { c as u } from "../../index-Cu0xwYjD.js";
3
+ import { useValue as k } from "../../hooks/useValue.js";
4
+ import { useInternalStatus as F } from "../../hooks/useInternalStatus.js";
5
+ import { FormControl as S } from "./FormControl.js";
6
+ import { Icon as o } from "../../atoms/Icons/Icon.js";
7
7
  import "../../atoms/Icons/contexts/IconsContext.js";
8
8
  import { useId as j } from "react";
9
- const B = (p) => {
10
- const u = j(), {
11
- id: r = u,
12
- name: a = r,
9
+ const B = (m) => {
10
+ const p = j(), {
11
+ id: t = p,
12
+ name: a = t,
13
13
  label: x,
14
14
  value: b,
15
15
  description: f,
16
16
  validationStatus: n = "default",
17
17
  icon: s,
18
18
  iconType: d,
19
- errorMessage: g,
19
+ errorMessage: h,
20
20
  disabled: l = !1,
21
21
  required: c = !1,
22
- className: h,
23
- dataTestId: v = "TextField",
24
- onChange: y,
25
- ...w
26
- } = p, { value: N, setValue: C } = T({ name: a, initialValue: b, onChange: y }), e = k({
22
+ hideRequiredStar: g,
23
+ className: v,
24
+ dataTestId: y = "TextField",
25
+ onChange: w,
26
+ ...N
27
+ } = m, { value: C, setValue: I } = k({ name: a, initialValue: b, onChange: w }), e = F({
27
28
  isDisabled: l,
28
29
  validationStatus: n
29
30
  });
30
- return /* @__PURE__ */ t(
31
- F,
31
+ return /* @__PURE__ */ r(
32
+ S,
32
33
  {
33
- id: r,
34
+ id: t,
34
35
  label: x,
35
- className: h,
36
+ className: v,
36
37
  description: f,
37
38
  dataName: "TextField",
38
- dataTestId: v,
39
+ dataTestId: y,
39
40
  disabled: l,
40
41
  required: c,
42
+ hideRequiredStar: g,
41
43
  validationStatus: n,
42
- errorMessage: g,
43
- children: /* @__PURE__ */ o("div", { className: "relative", children: [
44
- /* @__PURE__ */ t(
44
+ errorMessage: h,
45
+ children: /* @__PURE__ */ i("div", { className: "relative", children: [
46
+ /* @__PURE__ */ r(
45
47
  "input",
46
48
  {
47
- ...w,
48
- id: r,
49
+ ...N,
50
+ id: t,
49
51
  name: a,
50
52
  disabled: l,
51
53
  required: c,
52
- value: N,
53
- onChange: (I) => C(I.target.value),
54
- className: m(
54
+ value: C,
55
+ onChange: (T) => I(T.target.value),
56
+ className: u(
55
57
  "text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none",
56
58
  {
57
59
  "border-lightGrey focus:border-black active:border-black": e === "default",
@@ -66,10 +68,10 @@ const B = (p) => {
66
68
  "aria-label": a
67
69
  }
68
70
  ),
69
- /* @__PURE__ */ o(
71
+ /* @__PURE__ */ i(
70
72
  "div",
71
73
  {
72
- className: m(
74
+ className: u(
73
75
  "pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12",
74
76
  {
75
77
  "text-grey": e === "disabled",
@@ -78,10 +80,10 @@ const B = (p) => {
78
80
  }
79
81
  ),
80
82
  children: [
81
- s && /* @__PURE__ */ t(i, { name: s, width: "24px" }),
82
- /* @__PURE__ */ o("span", { className: "ms-auto flex gap-x-8", children: [
83
- e === "error" && /* @__PURE__ */ t(i, { name: "CrossDefault", width: "24px", type: d }),
84
- e === "success" && /* @__PURE__ */ t(i, { name: "CheckDefault", width: "24px", type: d })
83
+ s && /* @__PURE__ */ r(o, { name: s, width: "24px" }),
84
+ /* @__PURE__ */ i("span", { className: "ms-auto flex gap-x-8", children: [
85
+ e === "error" && /* @__PURE__ */ r(o, { name: "CrossDefault", width: "24px", type: d }),
86
+ e === "success" && /* @__PURE__ */ r(o, { name: "CheckDefault", width: "24px", type: d })
85
87
  ] })
86
88
  ]
87
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, FormControlProps } from './FormControl.js';\nimport { Icon, IconicNames, IconicTypes } from '@/atoms/Icons';\nimport { useId } from 'react';\n\nexport interface TextFieldProps<Value> extends FormControlProps<Value> {\n description?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const TextField = <Value = string,>(props: TextFieldProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n icon,\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n className,\n dataTestId = 'TextField',\n onChange,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n label={label}\n className={className}\n description={description}\n dataName=\"TextField\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n validationStatus={validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'ps-[52px]': icon,\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n />\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': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n {icon && <Icon name={icon} width=\"24px\" />}\n\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["TextField","props","internalId","useId","id","name","label","initialValue","description","validationStatus","icon","iconType","errorMessage","disabled","required","className","dataTestId","onChange","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","e","classnames","Icon"],"mappings":";;;;;;;;AAea,MAAAA,IAAY,CAAkBC,MAAiC;AAC1E,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAjB,GAEE,EAAE,OAAAkB,GAAO,UAAAC,MAAaC,EAAgB,EAAE,MAAAhB,GAAM,cAAAE,GAAc,UAAAU,EAAA,CAAU,GACtEK,IAAiBC,EAAkB;AAAA,IACvC,YAAYV;AAAA,IACZ,kBAAAJ;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAe;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAArB;AAAA,MACA,OAAAE;AAAA,MACA,WAAAS;AAAA,MACA,aAAAP;AAAA,MACA,UAAS;AAAA,MACT,YAAAQ;AAAA,MACA,UAAAH;AAAA,MACA,UAAAC;AAAA,MACA,kBAAAL;AAAA,M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"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../lib/molecules/Forms/TextField.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { useValue } from '@/hooks/useValue';\nimport { useInternalStatus } from '@/hooks/useInternalStatus';\nimport { FormControl, FormControlProps } from './FormControl.js';\nimport { Icon, IconicNames, IconicTypes } from '@/atoms/Icons';\nimport { useId } from 'react';\n\nexport interface TextFieldProps<Value> extends FormControlProps<Value> {\n description?: string;\n icon?: IconicNames;\n iconType?: IconicTypes;\n errorMessage?: string;\n dataTestId?: string;\n}\n\nexport const TextField = <Value = string,>(props: TextFieldProps<Value>) => {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n description,\n validationStatus = 'default',\n icon,\n iconType,\n errorMessage,\n disabled = false,\n required = false,\n hideRequiredStar,\n className,\n dataTestId = 'TextField',\n onChange,\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({ name, initialValue, onChange });\n const internalStatus = useInternalStatus({\n isDisabled: disabled,\n validationStatus,\n });\n\n return (\n <FormControl\n id={id}\n label={label}\n className={className}\n description={description}\n dataName=\"TextField\"\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 id={id}\n name={name}\n disabled={disabled}\n required={required}\n value={value as any}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border px-20 py-12 font-normal outline-none',\n {\n 'border-lightGrey focus:border-black active:border-black':\n internalStatus === 'default',\n 'ps-[52px]': icon,\n 'pe-[52px]': internalStatus === 'error' || internalStatus === 'success',\n 'bg-white text-black': internalStatus !== 'disabled',\n 'bg-pearl text-grey': internalStatus === 'disabled',\n 'border-red': internalStatus === 'error',\n 'border-green': internalStatus === 'success',\n },\n )}\n aria-label={name}\n />\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': internalStatus === 'disabled',\n 'text-red': internalStatus === 'error',\n 'text-green': internalStatus === 'success',\n },\n )}\n >\n {icon && <Icon name={icon} width=\"24px\" />}\n\n <span className=\"ms-auto flex gap-x-8\">\n {internalStatus === 'error' && (\n <Icon name=\"CrossDefault\" width=\"24px\" type={iconType} />\n )}\n\n {internalStatus === 'success' && (\n <Icon name=\"CheckDefault\" width=\"24px\" type={iconType} />\n )}\n </span>\n </div>\n </div>\n </FormControl>\n );\n};\n"],"names":["TextField","props","internalId","useId","id","name","label","initialValue","description","validationStatus","icon","iconType","errorMessage","disabled","required","hideRequiredStar","className","dataTestId","onChange","rest","value","setValue","useValue","internalStatus","useInternalStatus","jsx","FormControl","jsxs","e","classnames","Icon"],"mappings":";;;;;;;;AAea,MAAAA,IAAY,CAAkBC,MAAiC;AAC1E,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,aAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAlB,GAEE,EAAE,OAAAmB,GAAO,UAAAC,MAAaC,EAAgB,EAAE,MAAAjB,GAAM,cAAAE,GAAc,UAAAW,EAAA,CAAU,GACtEK,IAAiBC,EAAkB;AAAA,IACvC,YAAYX;AAAA,IACZ,kBAAAJ;AAAA,EAAA,CACD;AAGC,SAAA,gBAAAgB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAAtB;AAAA,MACA,OAAAE;AAAA,MACA,WAAAU;AAAA,MACA,aAAAR;AAAA,MACA,UAAS;AAAA,MACT,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E3D;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubmed/trident-ui",
3
- "version": "1.0.1",
3
+ "version": "1.1.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "Shared ClubMed React UI components",
6
6
  "keywords": [
@@ -31,11 +31,6 @@
31
31
  "import": "./atoms/Icons/index.js",
32
32
  "default": "./atoms/Icons/index.js"
33
33
  },
34
- "./atoms/Icons/fonts": {
35
- "types": "./atoms/Icons/fonts/index.d.ts",
36
- "import": "./atoms/Icons/fonts/index.js",
37
- "default": "./atoms/Icons/fonts/index.js"
38
- },
39
34
  "./atoms/Icons/svg": {
40
35
  "types": "./atoms/Icons/svg/index.d.ts",
41
36
  "import": "./atoms/Icons/svg/index.js",
@@ -46,6 +41,11 @@
46
41
  "import": "./atoms/Icons/svg-use/index.js",
47
42
  "default": "./atoms/Icons/svg-use/index.js"
48
43
  },
44
+ "./atoms/Icons/fonts": {
45
+ "types": "./atoms/Icons/fonts/index.d.ts",
46
+ "import": "./atoms/Icons/fonts/index.js",
47
+ "default": "./atoms/Icons/fonts/index.js"
48
+ },
49
49
  "./molecules/Tabs": {
50
50
  "types": "./molecules/Tabs/index.d.ts",
51
51
  "import": "./molecules/Tabs/index.js",