chop-logic-components 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/README.md +5 -0
  2. package/dist/components/atoms/button/Button.css +1 -1
  3. package/dist/components/atoms/button/Button2.js +51 -0
  4. package/dist/components/atoms/button/icon-button/IconButton.css +1 -1
  5. package/dist/components/atoms/button/icon-button/IconButton2.js +18 -0
  6. package/dist/components/atoms/button/inner-button/InnerButton.css +1 -1
  7. package/dist/components/atoms/button/inner-button/InnerButton2.js +21 -0
  8. package/dist/components/atoms/button/primary-button/PrimaryButton.css +1 -1
  9. package/dist/components/atoms/button/primary-button/PrimaryButton2.js +20 -0
  10. package/dist/components/atoms/button/secondary-button/SecondaryButton.css +1 -1
  11. package/dist/components/atoms/button/secondary-button/SecondaryButton2.js +20 -0
  12. package/dist/components/atoms/editable-text/EditView.js +18 -37
  13. package/dist/components/atoms/editable-text/EditableText.css +1 -1
  14. package/dist/components/atoms/editable-text/EditableText2.js +53 -0
  15. package/dist/components/atoms/editable-text/ReadView.js +16 -25
  16. package/dist/components/atoms/editable-text/useEditModeState.js +16 -16
  17. package/dist/components/atoms/editable-text/useInputFocus.js +13 -8
  18. package/dist/components/atoms/editable-text/useValueState.js +20 -20
  19. package/dist/components/atoms/error-message/ErrorMessage.css +1 -1
  20. package/dist/components/atoms/error-message/ErrorMessage2.js +18 -0
  21. package/dist/components/atoms/header/Header.css +1 -1
  22. package/dist/components/atoms/header/Header2.js +23 -0
  23. package/dist/components/atoms/icon/Icon.css +1 -1
  24. package/dist/components/atoms/icon/Icon2.js +29 -0
  25. package/dist/components/atoms/image/BasicImage.js +15 -27
  26. package/dist/components/atoms/image/FallBackImage.js +16 -10
  27. package/dist/components/atoms/image/Image.css +1 -1
  28. package/dist/components/atoms/image/Image2.js +28 -0
  29. package/dist/components/atoms/image/ResponsivePicture.js +13 -17
  30. package/dist/components/atoms/input/Input.css +1 -1
  31. package/dist/components/atoms/input/Input2.js +13 -0
  32. package/dist/components/atoms/label/Label.css +1 -1
  33. package/dist/components/atoms/label/Label2.js +35 -0
  34. package/dist/components/atoms/link/Link.css +1 -1
  35. package/dist/components/atoms/link/Link2.js +36 -0
  36. package/dist/components/atoms/portal/Portal.js +10 -10
  37. package/dist/components/atoms/tooltip/Tooltip.controller.js +42 -34
  38. package/dist/components/atoms/tooltip/Tooltip.css +1 -1
  39. package/dist/components/atoms/tooltip/Tooltip2.js +49 -0
  40. package/dist/components/contexts/form/FormContext.js +5 -5
  41. package/dist/components/contexts/theme/ThemeContext.js +6 -9
  42. package/dist/components/contexts/theme/ThemeProvider.js +23 -20
  43. package/dist/components/hocs/with-figure-caption/Figure.css +1 -1
  44. package/dist/components/hocs/with-figure-caption/with-figure-caption.js +13 -10
  45. package/dist/components/hocs/with-tooltip/with-tooltip.js +10 -6
  46. package/dist/components/molecules/accordion/Accordion.css +1 -1
  47. package/dist/components/molecules/accordion/Accordion2.js +11 -0
  48. package/dist/components/molecules/accordion/AccordionItem.css +1 -1
  49. package/dist/components/molecules/accordion/AccordionItem2.js +24 -0
  50. package/dist/components/molecules/alert/Alert.css +1 -1
  51. package/dist/components/molecules/alert/Alert.helpers.js +24 -38
  52. package/dist/components/molecules/alert/Alert2.js +63 -0
  53. package/dist/components/molecules/alert/AlertProgressBar.js +10 -13
  54. package/dist/components/molecules/breadcrumbs/BreadcrumbItem.js +29 -27
  55. package/dist/components/molecules/breadcrumbs/BreadcrumbList.js +12 -6
  56. package/dist/components/molecules/breadcrumbs/Breadcrumbs.css +1 -1
  57. package/dist/components/molecules/breadcrumbs/Breadcrumbs2.js +20 -0
  58. package/dist/components/molecules/checkbox/Checkbox.controller.js +28 -24
  59. package/dist/components/molecules/checkbox/Checkbox.css +1 -1
  60. package/dist/components/molecules/checkbox/Checkbox.helpers.js +5 -9
  61. package/dist/components/molecules/checkbox/Checkbox2.js +7 -0
  62. package/dist/components/molecules/checkbox/CheckboxStateful.js +46 -59
  63. package/dist/components/molecules/checkbox/CheckboxStateless.js +41 -58
  64. package/dist/components/molecules/multi-select/MultiSelect.Combobox.js +34 -46
  65. package/dist/components/molecules/multi-select/MultiSelect.Dropdown.js +22 -30
  66. package/dist/components/molecules/multi-select/MultiSelect.controller.js +32 -36
  67. package/dist/components/molecules/multi-select/MultiSelect.helpers.js +17 -20
  68. package/dist/components/molecules/multi-select/MultiSelect.js +59 -60
  69. package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.js +7 -7
  70. package/dist/components/molecules/multi-select/Option.js +40 -39
  71. package/dist/components/molecules/numeric-input/NumericInput.controller.js +50 -44
  72. package/dist/components/molecules/numeric-input/NumericInput.css +1 -1
  73. package/dist/components/molecules/numeric-input/NumericInput.helpers.js +7 -18
  74. package/dist/components/molecules/numeric-input/NumericInput2.js +7 -0
  75. package/dist/components/molecules/numeric-input/NumericInputStateful.js +72 -107
  76. package/dist/components/molecules/numeric-input/NumericInputStateless.js +60 -95
  77. package/dist/components/molecules/search/Search.controller.js +31 -41
  78. package/dist/components/molecules/search/Search.css +1 -1
  79. package/dist/components/molecules/search/Search2.js +67 -0
  80. package/dist/components/molecules/select/Select.controller.js +35 -31
  81. package/dist/components/molecules/select/Select.css +1 -1
  82. package/dist/components/molecules/select/Select.helpers.js +10 -15
  83. package/dist/components/molecules/select/Select2.js +62 -0
  84. package/dist/components/molecules/select/combobox/Combobox.css +1 -1
  85. package/dist/components/molecules/select/combobox/Combobox2.js +31 -0
  86. package/dist/components/molecules/select/dropdown/Dropdown.css +1 -1
  87. package/dist/components/molecules/select/dropdown/Dropdown2.js +31 -0
  88. package/dist/components/molecules/select/option/Option.css +1 -1
  89. package/dist/components/molecules/select/option/Option2.js +36 -0
  90. package/dist/components/molecules/switch/Switch.controller.js +32 -32
  91. package/dist/components/molecules/switch/Switch.css +1 -1
  92. package/dist/components/molecules/switch/Switch.helpers.js +5 -9
  93. package/dist/components/molecules/switch/Switch2.js +58 -0
  94. package/dist/components/molecules/text-input/TextInput.controller.js +46 -35
  95. package/dist/components/molecules/text-input/TextInput.css +1 -1
  96. package/dist/components/molecules/text-input/TextInput.helpers.js +7 -16
  97. package/dist/components/molecules/text-input/TextInput2.js +7 -0
  98. package/dist/components/molecules/text-input/TextInputButtons.js +20 -37
  99. package/dist/components/molecules/text-input/TextInputStateful.js +62 -91
  100. package/dist/components/molecules/text-input/TextInputStateless.js +59 -88
  101. package/dist/components/organisms/dialog/Dialog.css +1 -1
  102. package/dist/components/organisms/dialog/Dialog2.js +50 -0
  103. package/dist/components/organisms/form/Form.controller.js +28 -28
  104. package/dist/components/organisms/form/Form.css +1 -1
  105. package/dist/components/organisms/form/Form.helpers.js +9 -11
  106. package/dist/components/organisms/form/Form2.js +52 -0
  107. package/dist/components/organisms/grid/Grid.controller.js +27 -33
  108. package/dist/components/organisms/grid/Grid.css +1 -1
  109. package/dist/components/organisms/grid/Grid.helpers.js +13 -14
  110. package/dist/components/organisms/grid/Grid2.js +52 -0
  111. package/dist/components/organisms/grid/body/GridBody.css +1 -1
  112. package/dist/components/organisms/grid/body/GridBody2.js +26 -0
  113. package/dist/components/organisms/grid/checkbox/GridCheckbox.css +1 -1
  114. package/dist/components/organisms/grid/checkbox/GridCheckbox2.js +35 -0
  115. package/dist/components/organisms/grid/column-group/GridColumnGroup2.js +14 -0
  116. package/dist/components/organisms/grid/data-cell/GridDataCell.js +5 -5
  117. package/dist/components/organisms/grid/grid-row/GridRow2.js +24 -0
  118. package/dist/components/organisms/grid/head/GridHead.css +1 -1
  119. package/dist/components/organisms/grid/head/GridHead2.js +23 -0
  120. package/dist/components/organisms/grid/header-cell/HeaderCell.js +5 -8
  121. package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.js +15 -24
  122. package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.js +14 -23
  123. package/dist/components/organisms/menu/Menu.css +1 -1
  124. package/dist/components/organisms/menu/Menu2.js +24 -0
  125. package/dist/components/organisms/menu/leaf/MenuLeaf.css +1 -1
  126. package/dist/components/organisms/menu/leaf/MenuLeaf2.js +31 -0
  127. package/dist/components/organisms/menu/list-item/MenuListItem.css +1 -1
  128. package/dist/components/organisms/menu/list-item/MenuListItem2.js +38 -0
  129. package/dist/components/organisms/menu/sub-menu/SubMenu.css +1 -1
  130. package/dist/components/organisms/menu/sub-menu/SubMenu2.js +56 -0
  131. package/dist/components/organisms/tabs/Tabs.css +1 -1
  132. package/dist/components/organisms/tabs/Tabs2.js +60 -0
  133. package/dist/components/organisms/tabs/button/TabButton.css +1 -1
  134. package/dist/components/organisms/tabs/button/TabButton2.js +83 -0
  135. package/dist/components/organisms/tabs/content/TabContent.css +1 -1
  136. package/dist/components/organisms/tabs/content/TabContent2.js +16 -0
  137. package/dist/components/organisms/tabs/edit-input/TabEditInput.css +1 -1
  138. package/dist/components/organisms/tabs/edit-input/TabEditInput2.js +45 -0
  139. package/dist/components/organisms/tabs/list/TabList.css +1 -1
  140. package/dist/components/organisms/tabs/list/TabList2.js +51 -0
  141. package/dist/enums/alert-mode.js +6 -4
  142. package/dist/enums/button-view.js +6 -4
  143. package/dist/enums/element-size.js +6 -4
  144. package/dist/enums/icon-name.js +6 -4
  145. package/dist/enums/loader-view.js +6 -4
  146. package/dist/enums/orientation-mode.js +6 -4
  147. package/dist/enums/semantic-color.js +6 -4
  148. package/dist/enums/tooltip-container.js +6 -4
  149. package/dist/hooks/use-auto-close/use-auto-close.js +17 -17
  150. package/dist/hooks/use-click-outside/use-click-outside.js +18 -18
  151. package/dist/hooks/use-container-dimensions/use-container-dimensions.js +15 -15
  152. package/dist/hooks/use-debounce/use-debounce.js +14 -14
  153. package/dist/hooks/use-element-ids/use-element-ids.js +11 -11
  154. package/dist/hooks/use-is-hovered/use-is-hovered.js +14 -14
  155. package/dist/hooks/use-is-mounted/use-is-mounted.js +14 -14
  156. package/dist/hooks/use-is-overflow/use-is-overflow.js +26 -26
  157. package/dist/hooks/use-key-press/use-key-press.js +17 -13
  158. package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.js +15 -19
  159. package/dist/hooks/use-remaining-timer/use-remaining-timer.js +35 -37
  160. package/dist/hooks/use-reset-form-input/use-reset-form-input.js +10 -10
  161. package/dist/hooks/use-theme/use-theme.js +6 -6
  162. package/dist/hooks/use-tooltip-position/use-tooltip-position.js +36 -30
  163. package/dist/hooks/use-window-dimensions/use-window-dimensions.js +18 -15
  164. package/dist/index.es.js +55 -112
  165. package/dist/styles/icons.css +1 -1
  166. package/dist/styles/main.css +1 -1
  167. package/dist/utils/get-class-name.js +13 -15
  168. package/dist/utils/handle-dropdown-list-key-press.js +26 -31
  169. package/dist/utils/move-focus-on-element-by-id.js +6 -6
  170. package/package.json +15 -17
  171. package/dist/components/atoms/button/Button.js +0 -66
  172. package/dist/components/atoms/button/icon-button/IconButton.js +0 -15
  173. package/dist/components/atoms/button/icon-button/index.js +0 -3
  174. package/dist/components/atoms/button/index.js +0 -3
  175. package/dist/components/atoms/button/inner-button/InnerButton.js +0 -28
  176. package/dist/components/atoms/button/inner-button/index.js +0 -3
  177. package/dist/components/atoms/button/primary-button/PrimaryButton.js +0 -18
  178. package/dist/components/atoms/button/primary-button/index.js +0 -3
  179. package/dist/components/atoms/button/secondary-button/SecondaryButton.js +0 -18
  180. package/dist/components/atoms/button/secondary-button/index.js +0 -3
  181. package/dist/components/atoms/editable-text/EditableText.js +0 -71
  182. package/dist/components/atoms/editable-text/index.js +0 -3
  183. package/dist/components/atoms/error-message/ErrorMessage.js +0 -30
  184. package/dist/components/atoms/error-message/index.js +0 -3
  185. package/dist/components/atoms/header/Header.js +0 -22
  186. package/dist/components/atoms/header/index.js +0 -3
  187. package/dist/components/atoms/icon/Icon.js +0 -31
  188. package/dist/components/atoms/icon/index.js +0 -3
  189. package/dist/components/atoms/image/Image.js +0 -24
  190. package/dist/components/atoms/image/index.js +0 -3
  191. package/dist/components/atoms/input/Input.js +0 -10
  192. package/dist/components/atoms/input/index.js +0 -3
  193. package/dist/components/atoms/label/Label.js +0 -30
  194. package/dist/components/atoms/label/index.js +0 -3
  195. package/dist/components/atoms/link/Link.js +0 -39
  196. package/dist/components/atoms/link/index.js +0 -3
  197. package/dist/components/atoms/tooltip/Tooltip.js +0 -70
  198. package/dist/components/atoms/tooltip/index.js +0 -3
  199. package/dist/components/molecules/accordion/Accordion.js +0 -11
  200. package/dist/components/molecules/accordion/AccordionItem.js +0 -24
  201. package/dist/components/molecules/accordion/index.js +0 -3
  202. package/dist/components/molecules/alert/Alert.js +0 -60
  203. package/dist/components/molecules/alert/index.js +0 -3
  204. package/dist/components/molecules/breadcrumbs/Breadcrumbs.js +0 -31
  205. package/dist/components/molecules/breadcrumbs/index.js +0 -3
  206. package/dist/components/molecules/checkbox/Checkbox.js +0 -7
  207. package/dist/components/molecules/checkbox/index.js +0 -3
  208. package/dist/components/molecules/numeric-input/NumericInput.js +0 -7
  209. package/dist/components/molecules/numeric-input/index.js +0 -3
  210. package/dist/components/molecules/search/Search.js +0 -112
  211. package/dist/components/molecules/search/index.js +0 -3
  212. package/dist/components/molecules/select/Select.js +0 -64
  213. package/dist/components/molecules/select/combobox/Combobox.js +0 -46
  214. package/dist/components/molecules/select/combobox/index.js +0 -3
  215. package/dist/components/molecules/select/dropdown/Dropdown.js +0 -46
  216. package/dist/components/molecules/select/dropdown/index.js +0 -3
  217. package/dist/components/molecules/select/index.js +0 -3
  218. package/dist/components/molecules/select/option/Option.js +0 -38
  219. package/dist/components/molecules/select/option/index.js +0 -3
  220. package/dist/components/molecules/switch/Switch.js +0 -68
  221. package/dist/components/molecules/switch/index.js +0 -3
  222. package/dist/components/molecules/text-input/TextInput.js +0 -7
  223. package/dist/components/molecules/text-input/index.js +0 -3
  224. package/dist/components/organisms/dialog/Dialog.js +0 -32
  225. package/dist/components/organisms/dialog/index.js +0 -3
  226. package/dist/components/organisms/form/Form.js +0 -48
  227. package/dist/components/organisms/form/index.js +0 -3
  228. package/dist/components/organisms/grid/Grid.js +0 -60
  229. package/dist/components/organisms/grid/body/GridBody.js +0 -31
  230. package/dist/components/organisms/grid/checkbox/GridCheckbox.js +0 -52
  231. package/dist/components/organisms/grid/column-group/GridColumnGroup.js +0 -26
  232. package/dist/components/organisms/grid/grid-row/GridRow.js +0 -35
  233. package/dist/components/organisms/grid/grid-row/index.js +0 -3
  234. package/dist/components/organisms/grid/head/GridHead.js +0 -35
  235. package/dist/components/organisms/grid/index.js +0 -3
  236. package/dist/components/organisms/menu/Menu.js +0 -22
  237. package/dist/components/organisms/menu/index.js +0 -3
  238. package/dist/components/organisms/menu/leaf/MenuLeaf.js +0 -28
  239. package/dist/components/organisms/menu/list-item/MenuListItem.js +0 -35
  240. package/dist/components/organisms/menu/sub-menu/SubMenu.js +0 -67
  241. package/dist/components/organisms/menu/sub-menu/index.js +0 -3
  242. package/dist/components/organisms/tabs/Tabs.js +0 -80
  243. package/dist/components/organisms/tabs/button/TabButton.js +0 -111
  244. package/dist/components/organisms/tabs/content/TabContent.js +0 -19
  245. package/dist/components/organisms/tabs/edit-input/TabEditInput.js +0 -64
  246. package/dist/components/organisms/tabs/index.js +0 -3
  247. package/dist/components/organisms/tabs/list/TabList.js +0 -67
@@ -1 +1 @@
1
- .cl-select-combobox{text-align:left;cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:var(--cl-m-gap);padding:var(--cl-m-gap);border:var(--cl-light-border);border-radius:var(--cl-border-radius);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;background-color:var(--cl-surface-a10)}.cl-select-combobox>span:nth-child(1){color:var(--cl-base-font-color);overflow:hidden;text-overflow:ellipsis;font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);font-weight:400;line-height:1.5;letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:640px){.cl-select-combobox>span:nth-child(1){font-size:var(--cl-typography-base-tablet)}}@media(min-width:1024px){.cl-select-combobox>span:nth-child(1){font-size:var(--cl-typography-base-desktop)}}.cl-select-combobox:focus-visible{outline:var(--cl-outline-border);outline-offset:2px}.cl-select-combobox[disabled]{pointer-events:none;opacity:.5}.cl-select-combobox__icon{transition:transform .3s ease}.cl-select-combobox__icon_opened{transform:rotate(180deg)}
1
+ .cl-select-combobox{text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:var(--cl-m-gap);padding:var(--cl-m-gap);border:var(--cl-light-border);border-radius:var(--cl-border-radius);white-space:nowrap;text-overflow:ellipsis;background-color:var(--cl-surface-a10);display:flex;overflow:hidden}.cl-select-combobox>span:first-child{color:var(--cl-base-font-color);text-overflow:ellipsis;font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;overflow:hidden}@media (width>=640px){.cl-select-combobox>span:first-child{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-select-combobox>span:first-child{font-size:var(--cl-typography-base-desktop)}}.cl-select-combobox:focus-visible{outline:var(--cl-outline-border);outline-offset:2px}.cl-select-combobox[disabled]{pointer-events:none;opacity:.5}.cl-select-combobox__icon{transition:transform .3s}.cl-select-combobox__icon_opened{transform:rotate(180deg)}
@@ -0,0 +1,31 @@
1
+ import { getClassName as e } from "../../../../utils/get-class-name.js";
2
+ import { ElementSize as t } from "../../../../enums/element-size.js";
3
+ import { IconName as n } from "../../../../enums/icon-name.js";
4
+ import r from "../../../atoms/icon/Icon2.js";
5
+ import './Combobox.css';/* empty css */
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region src/components/molecules/select/combobox/Combobox.tsx
8
+ var o = ({ opened: o, onClick: s, comboboxId: c, dropdownId: l, selected: u, name: d, placeholder: f, disabled: p, required: m }) => {
9
+ let h = e(["cl-select-combobox__icon", { "cl-select-combobox__icon_opened": o }]);
10
+ return /* @__PURE__ */ a("button", {
11
+ type: "button",
12
+ name: d,
13
+ value: u?.id,
14
+ role: "combobox",
15
+ "aria-haspopup": "listbox",
16
+ "aria-expanded": o,
17
+ "aria-controls": l,
18
+ id: c,
19
+ onClick: s,
20
+ disabled: p,
21
+ "aria-required": m,
22
+ className: "cl-select-combobox",
23
+ children: [u?.label ? /* @__PURE__ */ i("span", { children: u?.label }) : /* @__PURE__ */ i("span", { children: f }), /* @__PURE__ */ i(r, {
24
+ name: n.ChevronDown,
25
+ className: h,
26
+ size: t.Small
27
+ })]
28
+ });
29
+ };
30
+ //#endregion
31
+ export { o as SelectCombobox };
@@ -1 +1 @@
1
- .cl-select-dropdown{visibility:hidden;opacity:0;transition:visibility 0s,opacity .3s linear;position:absolute;background:var(--cl-base-background-color);margin:0;padding:0;list-style:none;z-index:var(--cl-z-index-popup);width:100%;border:var(--cl-light-border);border-radius:var(--cl-border-radius);box-shadow:var(--cl-box-shadow);overflow-y:auto;max-height:180px;left:0;top:76px;background-color:var(--cl-surface-a10)}@media screen and (min-width:640px){.cl-select-dropdown{top:82px;max-height:220px}}@media screen and (min-width:1024px){.cl-select-dropdown{top:88px;max-height:260px}}.cl-select-dropdown_opened{visibility:visible;opacity:1}
1
+ .cl-select-dropdown{visibility:hidden;opacity:0;background:var(--cl-base-background-color);z-index:var(--cl-z-index-popup);border:var(--cl-light-border);border-radius:var(--cl-border-radius);width:100%;box-shadow:var(--cl-box-shadow);background-color:var(--cl-surface-a10);max-height:180px;margin:0;padding:0;list-style:none;transition:visibility,opacity .3s linear;position:absolute;top:76px;left:0;overflow-y:auto}@media screen and (width>=640px){.cl-select-dropdown{max-height:220px;top:82px}}@media screen and (width>=1024px){.cl-select-dropdown{max-height:260px;top:88px}}.cl-select-dropdown_opened{visibility:visible;opacity:1}
@@ -0,0 +1,31 @@
1
+ import { getClassName as e } from "../../../../utils/get-class-name.js";
2
+ import { moveFocusOnElementById as t } from "../../../../utils/move-focus-on-element-by-id.js";
3
+ import { handleDropdownListKeyPress as n } from "../../../../utils/handle-dropdown-list-key-press.js";
4
+ import './Dropdown.css';/* empty css */
5
+ import { SelectOption as r } from "../option/Option2.js";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ //#region src/components/molecules/select/dropdown/Dropdown.tsx
8
+ var a = ({ options: a, opened: o, onClose: s, onSelect: c, dropdownId: l, comboboxId: u, selected: d, onClear: f }) => {
9
+ let p = (e) => {
10
+ c(e), s(), t(u);
11
+ };
12
+ return /* @__PURE__ */ i("ul", {
13
+ role: "listbox",
14
+ id: l,
15
+ tabIndex: -1,
16
+ onKeyDown: (e) => n({
17
+ e,
18
+ options: a,
19
+ onClose: s
20
+ }),
21
+ className: e(["cl-select-dropdown", { "cl-select-dropdown_opened": o }]),
22
+ children: a.map((e) => /* @__PURE__ */ i(r, {
23
+ value: e,
24
+ onSelect: () => p(e.id),
25
+ onClear: f,
26
+ selected: e.id === d?.id
27
+ }, e.id))
28
+ });
29
+ };
30
+ //#endregion
31
+ export { a as SelectDropdown };
@@ -1 +1 @@
1
- .cl-select-option{padding:var(--cl-m-gap);cursor:pointer;display:flex;justify-content:space-between;align-items:baseline;gap:var(--cl-m-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);font-weight:400;line-height:1.5;letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:640px){.cl-select-option{font-size:var(--cl-typography-base-tablet)}}@media(min-width:1024px){.cl-select-option{font-size:var(--cl-typography-base-desktop)}}.cl-select-option:hover,.cl-select-option:active{text-shadow:var(--cl-text-shadow)}.cl-select-option:focus-visible{outline:var(--cl-outline-border);outline-offset:-4px}.cl-select-option svg{color:var(--cl-base-font-color);width:var(--cl-icon-size);height:var(--cl-icon-size)}.cl-select-option_selected svg{color:var(--cl-accent-a0)}.cl-select-option_multi{justify-content:flex-start}
1
+ .cl-select-option{padding:var(--cl-m-gap);cursor:pointer;justify-content:space-between;align-items:baseline;gap:var(--cl-m-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;display:flex}@media (width>=640px){.cl-select-option{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-select-option{font-size:var(--cl-typography-base-desktop)}}.cl-select-option:hover,.cl-select-option:active{text-shadow:var(--cl-text-shadow)}.cl-select-option:focus-visible{outline:var(--cl-outline-border);outline-offset:-4px}.cl-select-option svg{color:var(--cl-base-font-color);width:var(--cl-icon-size);height:var(--cl-icon-size)}.cl-select-option_selected svg{color:var(--cl-accent-a0)}.cl-select-option_multi{justify-content:flex-start}
@@ -0,0 +1,36 @@
1
+ import { getClassName as e } from "../../../../utils/get-class-name.js";
2
+ import { ElementSize as t } from "../../../../enums/element-size.js";
3
+ import { IconName as n } from "../../../../enums/icon-name.js";
4
+ import r from "../../../atoms/icon/Icon2.js";
5
+ import './Option.css';/* empty css */
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region src/components/molecules/select/option/Option.tsx
8
+ var o = ({ value: o, selected: s, onSelect: c, onClear: l }) => {
9
+ let { id: u, label: d } = o, f = e(["cl-select-option", { "cl-select-option_selected": s }]), p = (e) => {
10
+ s ? l() : c(e);
11
+ }, m = (e) => (t) => {
12
+ switch (t.key) {
13
+ case " ":
14
+ case "SpaceBar":
15
+ case "Enter":
16
+ t.preventDefault(), p(e);
17
+ break;
18
+ default: break;
19
+ }
20
+ };
21
+ return /* @__PURE__ */ a("li", {
22
+ id: u,
23
+ role: "option",
24
+ "aria-selected": s,
25
+ tabIndex: 0,
26
+ onKeyDown: m(u),
27
+ onClick: () => p(u),
28
+ className: f,
29
+ children: [/* @__PURE__ */ i("span", { children: d }), s && /* @__PURE__ */ i(r, {
30
+ name: n.Check,
31
+ size: t.Small
32
+ })]
33
+ });
34
+ };
35
+ //#endregion
36
+ export { o as SelectOption };
@@ -1,33 +1,33 @@
1
- import { useContext as I, useState as d, useRef as s, useCallback as i } from "react";
2
- import { getSwitchInitialValue as g } from "./Switch.helpers.js";
3
- import { FormContext as k } from "../../contexts/form/FormContext.js";
4
- import { useResetFormInput as F } from "../../../hooks/use-reset-form-input/use-reset-form-input.js";
5
- function S({
6
- name: e,
7
- defaultChecked: p,
8
- onChange: l
9
- }) {
10
- const { onChangeFormInput: a, initialValues: C } = I(k), n = g({ initialValues: C, name: e, defaultChecked: p }), [r, f] = d(n), o = s(a), u = s(n), h = s(l);
11
- o.current = a, u.current = n, h.current = l;
12
- const c = i(
13
- (t) => {
14
- f(t), h.current?.(t), o.current?.({ name: e, value: t });
15
- },
16
- [e]
17
- ), m = i(
18
- (t) => {
19
- (t.key === " " || t.key === "Enter") && (t.preventDefault(), c(!r));
20
- },
21
- [r, c]
22
- ), R = i(() => {
23
- f(u.current), o.current?.({ name: e, value: u.current });
24
- }, [e]);
25
- return F(R), {
26
- checked: r,
27
- handleChange: c,
28
- handleKeyDown: m
29
- };
1
+ import { FormContext as e } from "../../contexts/form/FormContext.js";
2
+ import { useResetFormInput as t } from "../../../hooks/use-reset-form-input/use-reset-form-input.js";
3
+ import { getSwitchInitialValue as n } from "./Switch.helpers.js";
4
+ import { useCallback as r, useContext as i, useRef as a, useState as o } from "react";
5
+ //#region src/components/molecules/switch/Switch.controller.ts
6
+ function s({ name: s, defaultChecked: c, onChange: l }) {
7
+ let { onChangeFormInput: u, initialValues: d } = i(e), f = n({
8
+ initialValues: d,
9
+ name: s,
10
+ defaultChecked: c
11
+ }), [p, m] = o(f), h = a(u), g = a(f), _ = a(l);
12
+ h.current = u, g.current = f, _.current = l;
13
+ let v = r((e) => {
14
+ m(e), _.current?.(e), h.current?.({
15
+ name: s,
16
+ value: e
17
+ });
18
+ }, [s]), y = r((e) => {
19
+ (e.key === " " || e.key === "Enter") && (e.preventDefault(), v(!p));
20
+ }, [p, v]);
21
+ return t(r(() => {
22
+ m(g.current), h.current?.({
23
+ name: s,
24
+ value: g.current
25
+ });
26
+ }, [s])), {
27
+ checked: p,
28
+ handleChange: v,
29
+ handleKeyDown: y
30
+ };
30
31
  }
31
- export {
32
- S as useSwitchController
33
- };
32
+ //#endregion
33
+ export { s as useSwitchController };
@@ -1 +1 @@
1
- .cl-switch{display:inline-flex;justify-content:flex-start;align-items:center;gap:var(--cl-l-gap);padding:var(--cl-m-gap);border:none;background:none;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .2s ease;border-radius:var(--cl-border-radius);outline:none;background-position:center}.cl-switch:hover{text-shadow:var(--cl-text-shadow)}.cl-switch:focus-visible{outline:var(--cl-outline-border)}.cl-switch__input{position:absolute;opacity:0;pointer-events:none}.cl-switch__label{color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);font-weight:400;line-height:1.5;letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:640px){.cl-switch__label{font-size:var(--cl-typography-base-tablet)}}@media(min-width:1024px){.cl-switch__label{font-size:var(--cl-typography-base-desktop)}}.cl-switch__track{position:relative;width:52px;height:28px;background-color:var(--cl-surface-a10);border-radius:14px;transition:background-color .2s ease;order:3;flex-shrink:0}.cl-switch__checked .cl-switch__track{background-color:var(--cl-accent-a0)}.cl-switch__thumb{position:absolute;top:2px;left:2px;width:var(--cl-thumb-size);height:var(--cl-thumb-size);background-color:var(--cl-base-background-color);border-radius:50%;box-shadow:var(--cl-box-shadow);transition:transform .2s ease}.cl-switch__checked .cl-switch__thumb{transform:translate(24px)}.cl-switch__indicator{color:var(--cl-accent-a0);text-transform:uppercase;display:inline-block;width:var(--cl-thumb-size);text-align:center;font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);font-weight:400;line-height:1.5;letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:640px){.cl-switch__indicator{font-size:var(--cl-typography-small-tablet)}}@media(min-width:1024px){.cl-switch__indicator{font-size:var(--cl-typography-small-desktop)}}.cl-switch_disabled{pointer-events:none;opacity:.5}
1
+ .cl-switch{justify-content:flex-start;align-items:center;gap:var(--cl-l-gap);padding:var(--cl-m-gap);cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:var(--cl-border-radius);background:50%;border:none;outline:none;transition:all .2s;display:inline-flex}.cl-switch:hover{text-shadow:var(--cl-text-shadow)}.cl-switch:focus-visible{outline:var(--cl-outline-border)}.cl-switch__input{opacity:0;pointer-events:none;position:absolute}.cl-switch__label{color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}@media (width>=640px){.cl-switch__label{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-switch__label{font-size:var(--cl-typography-base-desktop)}}.cl-switch__track{background-color:var(--cl-surface-a10);border-radius:14px;flex-shrink:0;order:3;width:52px;height:28px;transition:background-color .2s;position:relative}.cl-switch__checked .cl-switch__track{background-color:var(--cl-accent-a0)}.cl-switch__thumb{width:var(--cl-thumb-size);height:var(--cl-thumb-size);background-color:var(--cl-base-background-color);box-shadow:var(--cl-box-shadow);border-radius:50%;transition:transform .2s;position:absolute;top:2px;left:2px}.cl-switch__checked .cl-switch__thumb{transform:translate(24px)}.cl-switch__indicator{color:var(--cl-accent-a0);text-transform:uppercase;width:var(--cl-thumb-size);text-align:center;font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;display:inline-block}@media (width>=640px){.cl-switch__indicator{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-switch__indicator{font-size:var(--cl-typography-small-desktop)}}.cl-switch_disabled{pointer-events:none;opacity:.5}
@@ -1,10 +1,6 @@
1
- function e({
2
- defaultChecked: r,
3
- initialValues: t,
4
- name: o
5
- }) {
6
- return t?.[o] !== void 0 ? !!t?.[o] : !!r;
1
+ //#region src/components/molecules/switch/Switch.helpers.ts
2
+ function e({ defaultChecked: e, initialValues: t, name: n }) {
3
+ return t?.[n] === void 0 ? !!e : !!t?.[n];
7
4
  }
8
- export {
9
- e as getSwitchInitialValue
10
- };
5
+ //#endregion
6
+ export { e as getSwitchInitialValue };
@@ -0,0 +1,58 @@
1
+ import { getClassName as e } from "../../../utils/get-class-name.js";
2
+ import { useSwitchController as t } from "./Switch.controller.js";
3
+ import './Switch.css';/* empty css */
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region src/components/molecules/switch/Switch.tsx
6
+ var i = ({ checked: i, onChange: a, label: o, disabled: s = !1, className: c, id: l, name: u, value: d = "on", hasIndicator: f }) => {
7
+ let { checked: p, handleChange: m, handleKeyDown: h } = t({
8
+ name: u,
9
+ defaultChecked: i,
10
+ onChange: a
11
+ }), g = e([
12
+ "cl-switch",
13
+ c,
14
+ {
15
+ "cl-switch__checked": p,
16
+ "cl-switch_disabled": s
17
+ }
18
+ ]), _ = () => {
19
+ s || m(!p);
20
+ };
21
+ return /* @__PURE__ */ r("div", {
22
+ role: "switch",
23
+ "aria-checked": p,
24
+ "aria-label": o,
25
+ tabIndex: s ? -1 : 0,
26
+ className: g,
27
+ onClick: _,
28
+ onKeyDown: h,
29
+ id: l,
30
+ children: [
31
+ /* @__PURE__ */ n("input", {
32
+ type: "checkbox",
33
+ name: u,
34
+ value: d,
35
+ checked: p,
36
+ disabled: s,
37
+ className: "cl-switch__input",
38
+ readOnly: !0,
39
+ "data-testid": "switch-input"
40
+ }),
41
+ /* @__PURE__ */ n("span", {
42
+ className: "cl-switch__label",
43
+ children: o
44
+ }),
45
+ f && /* @__PURE__ */ n("span", {
46
+ className: "cl-switch__indicator",
47
+ "aria-hidden": "true",
48
+ children: p ? "On" : "Off"
49
+ }),
50
+ /* @__PURE__ */ n("span", {
51
+ className: "cl-switch__track",
52
+ children: /* @__PURE__ */ n("span", { className: "cl-switch__thumb" })
53
+ })
54
+ ]
55
+ });
56
+ };
57
+ //#endregion
58
+ export { i as default };
@@ -1,36 +1,47 @@
1
- import { useContext as T, useState as l, useRef as p, useCallback as P } from "react";
2
- import { getTextInputInitialValue as b, validateTextInputValue as k } from "./TextInput.helpers.js";
3
- import { FormContext as j } from "../../contexts/form/FormContext.js";
4
- import { useResetFormInput as q } from "../../../hooks/use-reset-form-input/use-reset-form-input.js";
5
- function D({
6
- name: t,
7
- defaultValue: v,
8
- onChange: f,
9
- onClear: h,
10
- required: m,
11
- validator: C
12
- }) {
13
- const { onChangeFormInput: e, initialValues: g } = T(j), n = b({ initialValues: g, defaultValue: v, name: t }), [I, o] = l(n), [V, r] = l(!0), [s, x] = l(!1), i = p(e), u = p(n);
14
- i.current = e, u.current = n;
15
- const w = (c) => {
16
- const a = c.target.value, d = k({ value: a, required: m, validator: C });
17
- o(a), r(d), e?.({ name: t, value: a, valid: d }), f?.(c);
18
- }, R = () => {
19
- o(""), r(!0), e?.({ name: t, value: "", valid: !0 }), h?.();
20
- }, F = P(() => {
21
- o(u.current), r(!0), i.current?.({ name: t, value: u.current, valid: !0 });
22
- }, [t]), S = () => {
23
- x(!s);
24
- };
25
- return q(F), {
26
- value: I,
27
- valid: V,
28
- passwordShown: s,
29
- handleChange: w,
30
- handleClear: R,
31
- togglePassword: S
32
- };
1
+ import { FormContext as e } from "../../contexts/form/FormContext.js";
2
+ import { useResetFormInput as t } from "../../../hooks/use-reset-form-input/use-reset-form-input.js";
3
+ import { getTextInputInitialValue as n, validateTextInputValue as r } from "./TextInput.helpers.js";
4
+ import { useCallback as i, useContext as a, useRef as o, useState as s } from "react";
5
+ //#region src/components/molecules/text-input/TextInput.controller.ts
6
+ function c({ name: c, defaultValue: l, onChange: u, onClear: d, required: f, validator: p }) {
7
+ let { onChangeFormInput: m, initialValues: h } = a(e), g = n({
8
+ initialValues: h,
9
+ defaultValue: l,
10
+ name: c
11
+ }), [_, v] = s(g), [y, b] = s(!0), [x, S] = s(!1), C = o(m), w = o(g);
12
+ return C.current = m, w.current = g, t(i(() => {
13
+ v(w.current), b(!0), C.current?.({
14
+ name: c,
15
+ value: w.current,
16
+ valid: !0
17
+ });
18
+ }, [c])), {
19
+ value: _,
20
+ valid: y,
21
+ passwordShown: x,
22
+ handleChange: (e) => {
23
+ let t = e.target.value, n = r({
24
+ value: t,
25
+ required: f,
26
+ validator: p
27
+ });
28
+ v(t), b(n), m?.({
29
+ name: c,
30
+ value: t,
31
+ valid: n
32
+ }), u?.(e);
33
+ },
34
+ handleClear: () => {
35
+ v(""), b(!0), m?.({
36
+ name: c,
37
+ value: "",
38
+ valid: !0
39
+ }), d?.();
40
+ },
41
+ togglePassword: () => {
42
+ S(!x);
43
+ }
44
+ };
33
45
  }
34
- export {
35
- D as useTextInputController
36
- };
46
+ //#endregion
47
+ export { c as useTextInputController };
@@ -1 +1 @@
1
- .cl-text-input{display:flex;flex-direction:column;gap:var(--cl-m-gap);width:100%}.cl-text-input__error-message{position:absolute;right:0;top:44px}@media screen and (min-width:640px){.cl-text-input__error-message{top:48px}}@media screen and (min-width:1024px){.cl-text-input__error-message{top:52px}}
1
+ .cl-text-input{gap:var(--cl-m-gap);flex-direction:column;width:100%;display:flex}.cl-text-input__error-message{position:absolute;top:44px;right:0}@media screen and (width>=640px){.cl-text-input__error-message{top:48px}}@media screen and (width>=1024px){.cl-text-input__error-message{top:52px}}
@@ -1,18 +1,9 @@
1
- function r({
2
- value: e,
3
- required: n,
4
- validator: t
5
- }) {
6
- return n && !t && !e.length ? !1 : t && typeof t == "function" ? t(e) : t && typeof t == "object" ? new RegExp(t.regexp, t?.flags).test(e) : !0;
1
+ //#region src/components/molecules/text-input/TextInput.helpers.ts
2
+ function e({ value: e, required: t, validator: n }) {
3
+ return t && !n && !e.length ? !1 : n && typeof n == "function" ? n(e) : n && typeof n == "object" ? new RegExp(n.regexp, n?.flags).test(e) : !0;
7
4
  }
8
- function f({
9
- name: e,
10
- initialValues: n,
11
- defaultValue: t
12
- }) {
13
- return n?.[e] ? n[e].toString() : t && typeof t == "string" ? t : "";
5
+ function t({ name: e, initialValues: t, defaultValue: n }) {
6
+ return t?.[e] ? t[e].toString() : n && typeof n == "string" ? n : "";
14
7
  }
15
- export {
16
- f as getTextInputInitialValue,
17
- r as validateTextInputValue
18
- };
8
+ //#endregion
9
+ export { t as getTextInputInitialValue, e as validateTextInputValue };
@@ -0,0 +1,7 @@
1
+ import e from "./TextInputStateful.js";
2
+ import t from "./TextInputStateless.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/molecules/text-input/TextInput.tsx
5
+ var r = (r) => r.stateless ? /* @__PURE__ */ n(t, { ...r }) : /* @__PURE__ */ n(e, { ...r });
6
+ //#endregion
7
+ export { r as default };
@@ -1,37 +1,20 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import n from "../../atoms/button/Button.js";
3
- import { IconName as o } from "../../../enums/icon-name.js";
4
- import { ButtonView as r } from "../../../enums/button-view.js";
5
- const I = ({
6
- clearable: i,
7
- isPasswordButtonVisible: l,
8
- handleClear: m,
9
- togglePassword: p,
10
- passwordShown: s,
11
- label: f,
12
- disabled: e
13
- }) => /* @__PURE__ */ a("span", { children: [
14
- i && /* @__PURE__ */ t(
15
- n,
16
- {
17
- view: r.Inner,
18
- onClick: m,
19
- label: `Clear input for ${f}`,
20
- icon: o.Delete,
21
- disabled: e
22
- }
23
- ),
24
- l && /* @__PURE__ */ t(
25
- n,
26
- {
27
- onClick: p,
28
- view: r.Inner,
29
- label: "Toggle password visibility",
30
- icon: s ? o.EyeOff : o.Eye,
31
- disabled: e
32
- }
33
- )
34
- ] });
35
- export {
36
- I as default
37
- };
1
+ import { ButtonView as e } from "../../../enums/button-view.js";
2
+ import { IconName as t } from "../../../enums/icon-name.js";
3
+ import n from "../../atoms/button/Button2.js";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/molecules/text-input/TextInputButtons.tsx
6
+ var a = ({ clearable: a, isPasswordButtonVisible: o, handleClear: s, togglePassword: c, passwordShown: l, label: u, disabled: d }) => /* @__PURE__ */ i("span", { children: [a && /* @__PURE__ */ r(n, {
7
+ view: e.Inner,
8
+ onClick: s,
9
+ label: `Clear input for ${u}`,
10
+ icon: t.Delete,
11
+ disabled: d
12
+ }), o && /* @__PURE__ */ r(n, {
13
+ onClick: c,
14
+ view: e.Inner,
15
+ label: "Toggle password visibility",
16
+ icon: l ? t.EyeOff : t.Eye,
17
+ disabled: d
18
+ })] });
19
+ //#endregion
20
+ export { a as default };
@@ -1,92 +1,63 @@
1
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
- import { getClassName as M } from "../../../utils/get-class-name.js";
3
- import { useTextInputController as V } from "./TextInput.controller.js";
4
- import './TextInput.css';/* empty css */
5
- import k from "./TextInputButtons.js";
6
- import { useElementIds as z } from "../../../hooks/use-element-ids/use-element-ids.js";
7
- import A from "../../atoms/label/Label.js";
8
- import D from "../../atoms/input/Input.js";
9
- import F from "../../atoms/error-message/ErrorMessage.js";
10
- const Y = ({
11
- name: r,
12
- label: s,
13
- errorMessage: u,
14
- defaultValue: d,
15
- onChange: c,
16
- onBlur: x,
17
- onFocus: g,
18
- onClear: h,
19
- validator: I,
20
- maxLength: C,
21
- id: v,
22
- tabIndex: w,
23
- placeholder: T = "Type here...",
24
- disabled: o = !1,
25
- required: t = !1,
26
- clearable: N = !0,
27
- readOnly: a = !1,
28
- autoComplete: j = "off",
29
- type: n = "text",
30
- className: B,
31
- style: E
32
- }) => {
33
- const { value: P, valid: i, handleChange: S, handleClear: _, passwordShown: l, togglePassword: b } = V({
34
- defaultValue: d,
35
- name: r,
36
- onChange: c,
37
- onClear: h,
38
- required: t,
39
- validator: I
40
- }), { elementId: m, errorId: p } = z(v), y = n === "password", L = M(["cl-text-input", B]);
41
- return /* @__PURE__ */ f("div", { style: E, className: L, children: [
42
- /* @__PURE__ */ e(A, { label: s, required: t, inputId: m }),
43
- /* @__PURE__ */ f(
44
- D,
45
- {
46
- id: m,
47
- name: r,
48
- type: l ? "text" : n,
49
- disabled: o,
50
- placeholder: T,
51
- required: t,
52
- readOnly: a,
53
- autoComplete: j,
54
- "aria-invalid": !i,
55
- "aria-errormessage": p,
56
- "aria-readonly": a,
57
- value: P,
58
- onChange: S,
59
- maxLength: C,
60
- onBlur: x,
61
- onFocus: g,
62
- tabIndex: w,
63
- children: [
64
- /* @__PURE__ */ e(
65
- k,
66
- {
67
- clearable: N,
68
- isPasswordButtonVisible: y,
69
- handleClear: _,
70
- togglePassword: b,
71
- passwordShown: l,
72
- label: s,
73
- disabled: o
74
- }
75
- ),
76
- /* @__PURE__ */ e(
77
- F,
78
- {
79
- errorId: p,
80
- message: u,
81
- visible: !i,
82
- className: "cl-text-input__error-message"
83
- }
84
- )
85
- ]
86
- }
87
- )
88
- ] });
89
- };
90
- export {
91
- Y as default
1
+ import { getClassName as e } from "../../../utils/get-class-name.js";
2
+ import t from "../../atoms/error-message/ErrorMessage2.js";
3
+ import n from "../../atoms/input/Input2.js";
4
+ import r from "../../atoms/label/Label2.js";
5
+ import { useElementIds as i } from "../../../hooks/use-element-ids/use-element-ids.js";
6
+ import { useTextInputController as a } from "./TextInput.controller.js";
7
+ import './TextInput.css';/* empty css */
8
+ import o from "./TextInputButtons.js";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ //#region src/components/molecules/text-input/TextInputStateful.tsx
11
+ var l = ({ name: l, label: u, errorMessage: d, defaultValue: f, onChange: p, onBlur: m, onFocus: h, onClear: g, validator: _, maxLength: v, id: y, tabIndex: b, placeholder: x = "Type here...", disabled: S = !1, required: C = !1, clearable: w = !0, readOnly: T = !1, autoComplete: E = "off", type: D = "text", className: O, style: k }) => {
12
+ let { value: A, valid: j, handleChange: M, handleClear: N, passwordShown: P, togglePassword: F } = a({
13
+ defaultValue: f,
14
+ name: l,
15
+ onChange: p,
16
+ onClear: g,
17
+ required: C,
18
+ validator: _
19
+ }), { elementId: I, errorId: L } = i(y), R = D === "password";
20
+ return /* @__PURE__ */ c("div", {
21
+ style: k,
22
+ className: e(["cl-text-input", O]),
23
+ children: [/* @__PURE__ */ s(r, {
24
+ label: u,
25
+ required: C,
26
+ inputId: I
27
+ }), /* @__PURE__ */ c(n, {
28
+ id: I,
29
+ name: l,
30
+ type: P ? "text" : D,
31
+ disabled: S,
32
+ placeholder: x,
33
+ required: C,
34
+ readOnly: T,
35
+ autoComplete: E,
36
+ "aria-invalid": !j,
37
+ "aria-errormessage": L,
38
+ "aria-readonly": T,
39
+ value: A,
40
+ onChange: M,
41
+ maxLength: v,
42
+ onBlur: m,
43
+ onFocus: h,
44
+ tabIndex: b,
45
+ children: [/* @__PURE__ */ s(o, {
46
+ clearable: w,
47
+ isPasswordButtonVisible: R,
48
+ handleClear: N,
49
+ togglePassword: F,
50
+ passwordShown: P,
51
+ label: u,
52
+ disabled: S
53
+ }), /* @__PURE__ */ s(t, {
54
+ errorId: L,
55
+ message: d,
56
+ visible: !j,
57
+ className: "cl-text-input__error-message"
58
+ })]
59
+ })]
60
+ });
92
61
  };
62
+ //#endregion
63
+ export { l as default };