chop-logic-components 4.0.3 → 4.1.1

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 (171) hide show
  1. package/README.md +23 -8
  2. package/dist/components/atoms/button/Button.d.ts +7 -0
  3. package/dist/components/atoms/button/icon-button/IconButton.d.ts +3 -0
  4. package/dist/components/atoms/button/inner-button/InnerButton.d.ts +3 -0
  5. package/dist/components/atoms/button/primary-button/PrimaryButton.d.ts +3 -0
  6. package/dist/components/atoms/button/secondary-button/SecondaryButton.css +1 -1
  7. package/dist/components/atoms/button/secondary-button/SecondaryButton.d.ts +3 -0
  8. package/dist/components/atoms/editable-text/EditView.d.ts +14 -0
  9. package/dist/components/atoms/editable-text/EditableText.d.ts +4 -0
  10. package/dist/components/atoms/editable-text/ReadView.d.ts +10 -0
  11. package/dist/components/atoms/editable-text/useEditModeState.d.ts +6 -0
  12. package/dist/components/atoms/editable-text/useInputFocus.d.ts +2 -0
  13. package/dist/components/atoms/editable-text/useValueState.d.ts +6 -0
  14. package/dist/components/atoms/error-message/ErrorMessage.d.ts +10 -0
  15. package/dist/components/atoms/header/Header.d.ts +4 -0
  16. package/dist/components/atoms/icon/Icon.d.ts +11 -0
  17. package/dist/components/atoms/icon/Icon2.js +7 -11
  18. package/dist/components/atoms/image/BasicImage.d.ts +13 -0
  19. package/dist/components/atoms/image/FallBackImage.d.ts +2 -0
  20. package/dist/components/atoms/image/Image.d.ts +6 -0
  21. package/dist/components/atoms/image/ResponsivePicture.d.ts +15 -0
  22. package/dist/components/atoms/index.d.ts +11 -0
  23. package/dist/components/atoms/input/Input.d.ts +5 -0
  24. package/dist/components/atoms/label/Label.d.ts +16 -0
  25. package/dist/components/atoms/link/Link.d.ts +4 -0
  26. package/dist/components/atoms/portal/Portal.d.ts +5 -0
  27. package/dist/components/atoms/tooltip/Tooltip.controller.d.ts +19 -0
  28. package/dist/components/atoms/tooltip/Tooltip.d.ts +4 -0
  29. package/dist/components/contexts/form/FormContext.d.ts +7 -0
  30. package/dist/components/contexts/index.d.ts +4 -0
  31. package/dist/components/contexts/theme/ThemeContext.d.ts +8 -0
  32. package/dist/components/contexts/theme/ThemeProvider.d.ts +8 -0
  33. package/dist/components/hocs/index.d.ts +3 -0
  34. package/dist/components/hocs/with-error-boundary/index.js +2 -0
  35. package/dist/components/hocs/with-error-boundary/with-error-boundary.d.ts +6 -0
  36. package/dist/components/hocs/with-error-boundary/with-error-boundary.js +32 -0
  37. package/dist/components/hocs/with-figure-caption/with-figure-caption.d.ts +6 -0
  38. package/dist/components/hocs/with-tooltip/with-tooltip.d.ts +7 -0
  39. package/dist/components/molecules/accordion/Accordion.d.ts +4 -0
  40. package/dist/components/molecules/accordion/AccordionItem.d.ts +3 -0
  41. package/dist/components/molecules/alert/Alert.d.ts +4 -0
  42. package/dist/components/molecules/alert/Alert.helpers.d.ts +3 -0
  43. package/dist/components/molecules/alert/AlertProgressBar.d.ts +4 -0
  44. package/dist/components/molecules/breadcrumbs/BreadcrumbItem.d.ts +7 -0
  45. package/dist/components/molecules/breadcrumbs/BreadcrumbList.d.ts +6 -0
  46. package/dist/components/molecules/breadcrumbs/Breadcrumbs.d.ts +4 -0
  47. package/dist/components/molecules/checkbox/Checkbox.controller.d.ts +9 -0
  48. package/dist/components/molecules/checkbox/Checkbox.d.ts +9 -0
  49. package/dist/components/molecules/checkbox/Checkbox.helpers.d.ts +6 -0
  50. package/dist/components/molecules/checkbox/CheckboxStateful.d.ts +4 -0
  51. package/dist/components/molecules/checkbox/CheckboxStateless.d.ts +4 -0
  52. package/dist/components/molecules/index.d.ts +10 -0
  53. package/dist/components/molecules/multi-select/MultiSelect.Combobox.d.ts +15 -0
  54. package/dist/components/molecules/multi-select/MultiSelect.Dropdown.d.ts +11 -0
  55. package/dist/components/molecules/multi-select/MultiSelect.controller.d.ts +13 -0
  56. package/dist/components/molecules/multi-select/MultiSelect.d.ts +4 -0
  57. package/dist/components/molecules/multi-select/MultiSelect.helpers.d.ts +9 -0
  58. package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.d.ts +8 -0
  59. package/dist/components/molecules/multi-select/Option.d.ts +8 -0
  60. package/dist/components/molecules/multi-select/Option.js +11 -11
  61. package/dist/components/molecules/numeric-input/NumericInput.controller.d.ts +22 -0
  62. package/dist/components/molecules/numeric-input/NumericInput.d.ts +9 -0
  63. package/dist/components/molecules/numeric-input/NumericInput.helpers.d.ts +13 -0
  64. package/dist/components/molecules/numeric-input/NumericInputStateful.d.ts +4 -0
  65. package/dist/components/molecules/numeric-input/NumericInputStateless.d.ts +4 -0
  66. package/dist/components/molecules/search/Search.controller.d.ts +12 -0
  67. package/dist/components/molecules/search/Search.d.ts +4 -0
  68. package/dist/components/molecules/select/Select.controller.d.ts +14 -0
  69. package/dist/components/molecules/select/Select.d.ts +4 -0
  70. package/dist/components/molecules/select/Select.helpers.d.ts +7 -0
  71. package/dist/components/molecules/select/combobox/Combobox.d.ts +15 -0
  72. package/dist/components/molecules/select/dropdown/Dropdown.d.ts +14 -0
  73. package/dist/components/molecules/select/option/Option.d.ts +10 -0
  74. package/dist/components/molecules/select/option/Option2.js +10 -10
  75. package/dist/components/molecules/switch/Switch.controller.d.ts +10 -0
  76. package/dist/components/molecules/switch/Switch.d.ts +4 -0
  77. package/dist/components/molecules/switch/Switch.helpers.d.ts +6 -0
  78. package/dist/components/molecules/switch/Switch2.js +4 -4
  79. package/dist/components/molecules/text-input/TextInput.controller.d.ts +17 -0
  80. package/dist/components/molecules/text-input/TextInput.d.ts +9 -0
  81. package/dist/components/molecules/text-input/TextInput.helpers.d.ts +11 -0
  82. package/dist/components/molecules/text-input/TextInputButtons.d.ts +11 -0
  83. package/dist/components/molecules/text-input/TextInputStateful.d.ts +4 -0
  84. package/dist/components/molecules/text-input/TextInputStateless.d.ts +4 -0
  85. package/dist/components/molecules/text-input/TextInputStateless.js +8 -8
  86. package/dist/components/organisms/dialog/Dialog.css +1 -1
  87. package/dist/components/organisms/dialog/Dialog.d.ts +4 -0
  88. package/dist/components/organisms/form/Form.controller.d.ts +14 -0
  89. package/dist/components/organisms/form/Form.d.ts +4 -0
  90. package/dist/components/organisms/form/Form.helpers.d.ts +4 -0
  91. package/dist/components/organisms/grid/Grid.controller.d.ts +15 -0
  92. package/dist/components/organisms/grid/Grid.d.ts +4 -0
  93. package/dist/components/organisms/grid/Grid.helpers.d.ts +6 -0
  94. package/dist/components/organisms/grid/body/GridBody.d.ts +13 -0
  95. package/dist/components/organisms/grid/checkbox/GridCheckbox.d.ts +6 -0
  96. package/dist/components/organisms/grid/column-group/GridColumnGroup.d.ts +6 -0
  97. package/dist/components/organisms/grid/data-cell/GridDataCell.d.ts +4 -0
  98. package/dist/components/organisms/grid/grid-row/GridRow.d.ts +13 -0
  99. package/dist/components/organisms/grid/head/GridHead.d.ts +13 -0
  100. package/dist/components/organisms/grid/header-cell/HeaderCell.d.ts +5 -0
  101. package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.d.ts +10 -0
  102. package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.d.ts +10 -0
  103. package/dist/components/organisms/index.d.ts +5 -0
  104. package/dist/components/organisms/menu/Menu.d.ts +4 -0
  105. package/dist/components/organisms/menu/leaf/MenuLeaf.d.ts +5 -0
  106. package/dist/components/organisms/menu/list-item/MenuListItem.d.ts +10 -0
  107. package/dist/components/organisms/menu/sub-menu/SubMenu.d.ts +14 -0
  108. package/dist/components/organisms/tabs/Tabs.d.ts +4 -0
  109. package/dist/components/organisms/tabs/button/TabButton.d.ts +18 -0
  110. package/dist/components/organisms/tabs/content/TabContent.d.ts +8 -0
  111. package/dist/components/organisms/tabs/content/TabContent2.js +3 -3
  112. package/dist/components/organisms/tabs/edit-input/TabEditInput.d.ts +14 -0
  113. package/dist/components/organisms/tabs/list/TabList.d.ts +19 -0
  114. package/dist/enums/alert-mode.d.ts +7 -0
  115. package/dist/enums/button-view.d.ts +6 -0
  116. package/dist/enums/element-size.d.ts +8 -0
  117. package/dist/enums/icon-name.d.ts +284 -0
  118. package/dist/enums/index.d.ts +8 -0
  119. package/dist/enums/loader-view.d.ts +11 -0
  120. package/dist/enums/orientation-mode.d.ts +4 -0
  121. package/dist/enums/semantic-color.d.ts +7 -0
  122. package/dist/enums/tooltip-container.d.ts +7 -0
  123. package/dist/hooks/index.d.ts +15 -0
  124. package/dist/hooks/use-auto-close/use-auto-close.d.ts +6 -0
  125. package/dist/hooks/use-click-outside/use-click-outside.d.ts +8 -0
  126. package/dist/hooks/use-container-dimensions/use-container-dimensions.d.ts +8 -0
  127. package/dist/hooks/use-debounce/use-debounce.d.ts +1 -0
  128. package/dist/hooks/use-element-ids/use-element-ids.d.ts +5 -0
  129. package/dist/hooks/use-is-hovered/use-is-hovered.d.ts +2 -0
  130. package/dist/hooks/use-is-mounted/use-is-mounted.d.ts +1 -0
  131. package/dist/hooks/use-is-overflow/use-is-overflow.d.ts +6 -0
  132. package/dist/hooks/use-key-press/use-key-press.d.ts +8 -0
  133. package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.d.ts +7 -0
  134. package/dist/hooks/use-remaining-timer/use-remaining-timer.d.ts +9 -0
  135. package/dist/hooks/use-reset-form-input/use-reset-form-input.d.ts +1 -0
  136. package/dist/hooks/use-theme/use-theme.d.ts +4 -0
  137. package/dist/hooks/use-tooltip-position/use-tooltip-position.d.ts +12 -0
  138. package/dist/hooks/use-window-dimensions/use-window-dimensions.d.ts +2 -0
  139. package/dist/index.d.ts +2 -917
  140. package/dist/index.es.js +42 -41
  141. package/dist/main.d.ts +8 -0
  142. package/dist/styles/main.css +1 -1
  143. package/dist/types/_common.d.ts +35 -0
  144. package/dist/types/accordion.d.ts +8 -0
  145. package/dist/types/alert.d.ts +11 -0
  146. package/dist/types/breadcrumbs.d.ts +10 -0
  147. package/dist/types/button.d.ts +11 -0
  148. package/dist/types/checkbox.d.ts +9 -0
  149. package/dist/types/dialog.d.ts +9 -0
  150. package/dist/types/editable-text.d.ts +12 -0
  151. package/dist/types/form.d.ts +18 -0
  152. package/dist/types/grid.d.ts +27 -0
  153. package/dist/types/header.d.ts +9 -0
  154. package/dist/types/image.d.ts +21 -0
  155. package/dist/types/index.d.ts +23 -0
  156. package/dist/types/link.d.ts +9 -0
  157. package/dist/types/loader.d.ts +6 -0
  158. package/dist/types/menu.d.ts +17 -0
  159. package/dist/types/multi-select.d.ts +7 -0
  160. package/dist/types/numeric.d.ts +19 -0
  161. package/dist/types/search.d.ts +16 -0
  162. package/dist/types/select.d.ts +7 -0
  163. package/dist/types/switch.d.ts +13 -0
  164. package/dist/types/tabs.d.ts +23 -0
  165. package/dist/types/text.d.ts +17 -0
  166. package/dist/types/tooltip.d.ts +11 -0
  167. package/dist/utils/get-class-name.d.ts +5 -0
  168. package/dist/utils/handle-dropdown-list-key-press.d.ts +7 -0
  169. package/dist/utils/index.d.ts +3 -0
  170. package/dist/utils/move-focus-on-element-by-id.d.ts +1 -0
  171. package/package.json +22 -18
@@ -0,0 +1,8 @@
1
+ import { MultiSelectValue } from '../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ value: MultiSelectValue;
5
+ onSelect: (id: string) => void;
6
+ };
7
+ export declare const MultiSelectOption: FC<Props>;
8
+ export {};
@@ -10,22 +10,22 @@ var o = ({ value: o, onSelect: s }) => {
10
10
  "cl-select-option",
11
11
  "cl-select-option_multi",
12
12
  { "cl-select-option_selected": u }
13
- ]), f = (e) => (t) => {
14
- switch (t.key) {
15
- case " ":
16
- case "SpaceBar":
17
- case "Enter":
18
- t.preventDefault(), s(e);
19
- break;
20
- default: break;
21
- }
22
- };
13
+ ]);
23
14
  return /* @__PURE__ */ a("li", {
24
15
  id: c,
25
16
  role: "option",
26
17
  "aria-selected": u,
27
18
  tabIndex: 0,
28
- onKeyDown: f(c),
19
+ onKeyDown: ((e) => (t) => {
20
+ switch (t.key) {
21
+ case " ":
22
+ case "SpaceBar":
23
+ case "Enter":
24
+ t.preventDefault(), s(e);
25
+ break;
26
+ default: break;
27
+ }
28
+ })(c),
29
29
  onClick: () => s(c),
30
30
  className: d,
31
31
  children: [u ? /* @__PURE__ */ i(r, {
@@ -0,0 +1,22 @@
1
+ import { NumericInputValidator } from '../../../types';
2
+ import { ChangeEvent, ChangeEventHandler } from 'react';
3
+ export declare function useNumericInputController({ name, defaultValue, onChange, onDecrement, onIncrement, min, max, step, required, validator, }: {
4
+ name: string;
5
+ defaultValue?: string | number | readonly string[];
6
+ onChange?: ChangeEventHandler<HTMLInputElement>;
7
+ onIncrement?: () => void;
8
+ onDecrement?: () => void;
9
+ min?: string | number;
10
+ max?: string | number;
11
+ step: number;
12
+ required: boolean;
13
+ validator?: NumericInputValidator;
14
+ }): {
15
+ handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
16
+ value: number;
17
+ valid: boolean;
18
+ minValue: number;
19
+ maxValue: number;
20
+ handleIncrement: () => void;
21
+ handleDecrement: () => void;
22
+ };
@@ -0,0 +1,9 @@
1
+ import { NumericInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ /**
4
+ * NumericInput component factory
5
+ * Renders either a stateful or stateless component
6
+ * based on the `stateless` prop.
7
+ */
8
+ declare const NumericInput: FC<NumericInputProps>;
9
+ export default NumericInput;
@@ -0,0 +1,13 @@
1
+ import { FormValues, NumericInputValidator } from '../../../types';
2
+ export declare function getNumericInputInitialValue({ name, initialValues, defaultValue, }: {
3
+ name: string;
4
+ initialValues?: FormValues;
5
+ defaultValue?: string | number | readonly string[];
6
+ }): number;
7
+ export declare function validateNumericInputValue({ value, required, validator, maxValue, minValue, }: {
8
+ value?: number;
9
+ required?: boolean;
10
+ validator?: NumericInputValidator;
11
+ maxValue?: number;
12
+ minValue?: number;
13
+ }): boolean;
@@ -0,0 +1,4 @@
1
+ import { NumericInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const NumericInputStateful: FC<NumericInputProps>;
4
+ export default NumericInputStateful;
@@ -0,0 +1,4 @@
1
+ import { NumericInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const NumericInputStateless: FC<NumericInputProps>;
4
+ export default NumericInputStateless;
@@ -0,0 +1,12 @@
1
+ import { SearchProps } from '../../../types';
2
+ export declare function useSearchController({ onSearch, onClear, maxLength, minLength, searchMode, debounceDelay, }: Omit<SearchProps, 'label' | 'onBlur' | 'onFocus' | 'id' | 'tabIndex' | 'className' | 'name' | 'placeholder' | 'disabled' | 'clearable' | 'spellCheck' | 'autoComplete'>): {
3
+ searchValue: string;
4
+ isSearchButtonVisible: boolean;
5
+ isLabelIconVisible: boolean;
6
+ isClearButtonVisible: boolean;
7
+ isSearchValueValid: boolean;
8
+ handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
9
+ handleClear: () => void;
10
+ handleSearchClick: () => void;
11
+ handleKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
12
+ };
@@ -0,0 +1,4 @@
1
+ import { SearchProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Search: FC<SearchProps>;
4
+ export default Search;
@@ -0,0 +1,14 @@
1
+ import { SelectValue } from '../../../types';
2
+ export declare function useSelectController({ name, defaultValue, onChange, options, }: {
3
+ name: string;
4
+ defaultValue?: string | number | readonly string[];
5
+ onChange?: (value?: SelectValue) => void;
6
+ options: SelectValue[];
7
+ }): {
8
+ selected: SelectValue | undefined;
9
+ opened: boolean;
10
+ handleClear: () => void;
11
+ handleClose: () => void;
12
+ handleToggle: () => void;
13
+ handleSelect: (id: string) => void;
14
+ };
@@ -0,0 +1,4 @@
1
+ import { SelectProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Select: FC<SelectProps>;
4
+ export default Select;
@@ -0,0 +1,7 @@
1
+ import { FormValues, SelectValue } from '../../../types';
2
+ export declare function getSelectInitialValue({ name, options, initialValues, defaultValue, }: {
3
+ name: string;
4
+ options: SelectValue[];
5
+ initialValues?: FormValues;
6
+ defaultValue?: string | number | readonly string[];
7
+ }): SelectValue | undefined;
@@ -0,0 +1,15 @@
1
+ import { SelectValue } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ opened: boolean;
5
+ disabled: boolean;
6
+ required: boolean;
7
+ onClick: () => void;
8
+ comboboxId: string;
9
+ dropdownId: string;
10
+ selected?: SelectValue;
11
+ placeholder?: string;
12
+ name: string;
13
+ };
14
+ export declare const SelectCombobox: FC<Props>;
15
+ export {};
@@ -0,0 +1,14 @@
1
+ import { SelectValue } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ options: SelectValue[];
5
+ opened: boolean;
6
+ dropdownId: string;
7
+ comboboxId: string;
8
+ onClose: () => void;
9
+ selected?: SelectValue;
10
+ onSelect: (id: string) => void;
11
+ onClear: () => void;
12
+ };
13
+ export declare const SelectDropdown: FC<Props>;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import { SelectValue } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ value: SelectValue;
5
+ selected: boolean;
6
+ onSelect: (id: string) => void;
7
+ onClear: () => void;
8
+ };
9
+ export declare const SelectOption: FC<Props>;
10
+ export {};
@@ -8,22 +8,22 @@ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
8
  var o = ({ value: o, selected: s, onSelect: c, onClear: l }) => {
9
9
  let { id: u, label: d } = o, f = e(["cl-select-option", { "cl-select-option_selected": s }]), p = (e) => {
10
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
11
  };
21
12
  return /* @__PURE__ */ a("li", {
22
13
  id: u,
23
14
  role: "option",
24
15
  "aria-selected": s,
25
16
  tabIndex: 0,
26
- onKeyDown: m(u),
17
+ onKeyDown: ((e) => (t) => {
18
+ switch (t.key) {
19
+ case " ":
20
+ case "SpaceBar":
21
+ case "Enter":
22
+ t.preventDefault(), p(e);
23
+ break;
24
+ default: break;
25
+ }
26
+ })(u),
27
27
  onClick: () => p(u),
28
28
  className: f,
29
29
  children: [/* @__PURE__ */ i("span", { children: d }), s && /* @__PURE__ */ i(r, {
@@ -0,0 +1,10 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare function useSwitchController({ name, defaultChecked, onChange, }: {
3
+ name: string;
4
+ defaultChecked?: boolean;
5
+ onChange?: (checked: boolean) => void;
6
+ }): {
7
+ checked: boolean;
8
+ handleChange: (checked: boolean) => void;
9
+ handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
10
+ };
@@ -0,0 +1,4 @@
1
+ import { SwitchProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Switch: FC<SwitchProps>;
4
+ export default Switch;
@@ -0,0 +1,6 @@
1
+ import { FormValues } from '../../../types';
2
+ export declare function getSwitchInitialValue({ defaultChecked, initialValues, name, }: {
3
+ defaultChecked?: boolean;
4
+ initialValues?: FormValues;
5
+ name: string;
6
+ }): boolean;
@@ -15,16 +15,16 @@ var i = ({ checked: i, onChange: a, label: o, disabled: s = !1, className: c, id
15
15
  "cl-switch__checked": p,
16
16
  "cl-switch_disabled": s
17
17
  }
18
- ]), _ = () => {
19
- s || m(!p);
20
- };
18
+ ]);
21
19
  return /* @__PURE__ */ r("div", {
22
20
  role: "switch",
23
21
  "aria-checked": p,
24
22
  "aria-label": o,
25
23
  tabIndex: s ? -1 : 0,
26
24
  className: g,
27
- onClick: _,
25
+ onClick: () => {
26
+ s || m(!p);
27
+ },
28
28
  onKeyDown: h,
29
29
  id: l,
30
30
  children: [
@@ -0,0 +1,17 @@
1
+ import { ChopLogicRegExpWithFlags, TextInputValidator } from '../../../types';
2
+ import { ChangeEvent, ChangeEventHandler } from 'react';
3
+ export declare function useTextInputController({ name, defaultValue, onChange, onClear, required, validator, }: {
4
+ name: string;
5
+ required: boolean;
6
+ validator?: ChopLogicRegExpWithFlags | TextInputValidator;
7
+ defaultValue?: string | number | readonly string[];
8
+ onChange?: ChangeEventHandler<HTMLInputElement>;
9
+ onClear?: () => void;
10
+ }): {
11
+ value: string;
12
+ valid: boolean;
13
+ passwordShown: boolean;
14
+ handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
15
+ handleClear: () => void;
16
+ togglePassword: () => void;
17
+ };
@@ -0,0 +1,9 @@
1
+ import { TextInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ /**
4
+ * TextInput component factory
5
+ * Renders either a stateful or stateless component
6
+ * based on the `stateless` prop.
7
+ */
8
+ declare const TextInput: FC<TextInputProps>;
9
+ export default TextInput;
@@ -0,0 +1,11 @@
1
+ import { ChopLogicRegExpWithFlags, FormValues, TextInputValidator } from '../../../types';
2
+ export declare function validateTextInputValue({ value, required, validator, }: {
3
+ value: string;
4
+ required: boolean;
5
+ validator?: ChopLogicRegExpWithFlags | TextInputValidator;
6
+ }): boolean;
7
+ export declare function getTextInputInitialValue({ name, initialValues, defaultValue, }: {
8
+ name: string;
9
+ initialValues?: FormValues;
10
+ defaultValue?: string | number | readonly string[];
11
+ }): string;
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ declare const TextInputButtons: FC<{
3
+ clearable: boolean;
4
+ isPasswordButtonVisible: boolean;
5
+ handleClear: () => void;
6
+ togglePassword: () => void;
7
+ passwordShown: boolean;
8
+ label: string;
9
+ disabled: boolean;
10
+ }>;
11
+ export default TextInputButtons;
@@ -0,0 +1,4 @@
1
+ import { TextInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const TextInputStateful: FC<TextInputProps>;
4
+ export default TextInputStateful;
@@ -0,0 +1,4 @@
1
+ import { TextInputProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const TextInputStateless: FC<TextInputProps>;
4
+ export default TextInputStateless;
@@ -8,14 +8,10 @@ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
8
  import { useState as s } from "react";
9
9
  //#region src/components/molecules/text-input/TextInputStateless.tsx
10
10
  var c = ({ name: c, label: l, errorMessage: u, value: d, onChange: f, onBlur: p, onFocus: m, onClear: h, maxLength: g, id: _, tabIndex: v, placeholder: y = "Type here...", disabled: b = !1, required: x = !1, clearable: S = !0, readOnly: C = !1, autoComplete: w = "off", type: T = "text", className: E, style: D, defaultValue: O }) => {
11
- let k = _ ?? `text-input-${c}`, A = `${c}-error`, [j, M] = s(!1), N = T === "password", P = e(["cl-text-input", E]), F = () => {
12
- M(!j);
13
- }, I = () => {
14
- f && f({ target: { value: "" } }), h?.();
15
- };
11
+ let k = _ ?? `text-input-${c}`, A = `${c}-error`, [j, M] = s(!1), N = T === "password";
16
12
  return /* @__PURE__ */ o("div", {
17
13
  style: D,
18
- className: P,
14
+ className: e(["cl-text-input", E]),
19
15
  children: [/* @__PURE__ */ a(r, {
20
16
  label: l,
21
17
  required: x,
@@ -42,8 +38,12 @@ var c = ({ name: c, label: l, errorMessage: u, value: d, onChange: f, onBlur: p,
42
38
  children: [/* @__PURE__ */ a(i, {
43
39
  clearable: S,
44
40
  isPasswordButtonVisible: N,
45
- handleClear: I,
46
- togglePassword: F,
41
+ handleClear: () => {
42
+ f && f({ target: { value: "" } }), h?.();
43
+ },
44
+ togglePassword: () => {
45
+ M(!j);
46
+ },
47
47
  passwordShown: j,
48
48
  label: l,
49
49
  disabled: b
@@ -1 +1 @@
1
- .cl-dialog{width:100%;height:100%;z-index:inherit;background-color:#0000004d;justify-content:center;align-items:center;animation:.4s cl-fade-in;display:flex;position:fixed;top:0;left:0}.cl-dialog__layout{z-index:var(--cl-z-index-modal);background-color:var(--cl-base-background-color);box-shadow:var(--cl-box-shadow);color:var(--cl-base-font-color);padding:var(--cl-l-gap);border-top-left-radius:var(--cl-border-radius);border-top-right-radius:var(--cl-border-radius);height:90%;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;position:absolute;bottom:0;left:0}.cl-dialog__button{right:var(--cl-s-gap);top:var(--cl-s-gap);position:absolute}@media (width>=640px){.cl-dialog__layout{font-size:var(--cl-typography-base-tablet)}.cl-dialog__button{right:var(--cl-m-gap);top:var(--cl-m-gap)}}@media (width>=1024px){.cl-dialog__layout{font-size:var(--cl-typography-base-desktop);padding:var(--cl-xl-gap)}.cl-dialog__button{right:var(--cl-l-gap);top:var(--cl-l-gap)}}@media screen and (width>=640px){.cl-dialog__layout{border-bottom-left-radius:var(--cl-border-radius);border-bottom-right-radius:var(--cl-border-radius);width:fit-content;min-width:40%;max-width:90%;height:fit-content;max-height:90%;position:relative}}.cl-dialog_closing{animation:.4s cl-fade-out}
1
+ .cl-dialog{width:100%;height:100%;z-index:inherit;background-color:var(--cl-shadow-background);justify-content:center;align-items:center;animation:.4s cl-fade-in;display:flex;position:fixed;top:0;left:0}.cl-dialog__layout{z-index:var(--cl-z-index-modal);background-color:var(--cl-base-background-color);box-shadow:var(--cl-box-shadow);color:var(--cl-base-font-color);padding:var(--cl-l-gap);border-top-left-radius:var(--cl-border-radius);border-top-right-radius:var(--cl-border-radius);height:90%;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;position:absolute;bottom:0;left:0}.cl-dialog__button{right:var(--cl-s-gap);top:var(--cl-s-gap);position:absolute}@media (width>=640px){.cl-dialog__layout{font-size:var(--cl-typography-base-tablet)}.cl-dialog__button{right:var(--cl-m-gap);top:var(--cl-m-gap)}}@media (width>=1024px){.cl-dialog__layout{font-size:var(--cl-typography-base-desktop);padding:var(--cl-xl-gap)}.cl-dialog__button{right:var(--cl-l-gap);top:var(--cl-l-gap)}}@media screen and (width>=640px){.cl-dialog__layout{border-bottom-left-radius:var(--cl-border-radius);border-bottom-right-radius:var(--cl-border-radius);width:fit-content;min-width:40%;max-width:90%;height:fit-content;max-height:90%;position:relative}}.cl-dialog_closing{animation:.4s cl-fade-out}
@@ -0,0 +1,4 @@
1
+ import { DialogProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Dialog: FC<DialogProps>;
4
+ export default Dialog;
@@ -0,0 +1,14 @@
1
+ import { FormInputParams, FormValues } from '../../../types';
2
+ import { FormEvent, FormEventHandler } from 'react';
3
+ export declare function useFormController({ initialValues, onReset, onSubmit, onClickSubmit, }: {
4
+ initialValues?: FormValues;
5
+ onReset?: FormEventHandler<HTMLFormElement>;
6
+ onSubmit?: FormEventHandler<HTMLFormElement>;
7
+ onClickSubmit?: (data: FormValues) => void;
8
+ }): {
9
+ handleInputChange: (params: FormInputParams) => void;
10
+ handleSubmit: (event: FormEvent<HTMLFormElement>) => void;
11
+ handleReset: (event: FormEvent<HTMLFormElement>) => void;
12
+ resetSignal: number;
13
+ valid: boolean;
14
+ };
@@ -0,0 +1,4 @@
1
+ import { FormProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Form: FC<FormProps>;
4
+ export default Form;
@@ -0,0 +1,4 @@
1
+ import { FormInputParams, FormValidationState, FormValues } from '../../../types';
2
+ export declare function getInitialValidationState(data?: FormValues): FormValidationState;
3
+ export declare function updateValidationState(state: FormValidationState, params: FormInputParams): FormValidationState;
4
+ export declare function isFormDataValid(state: FormValidationState): boolean;
@@ -0,0 +1,15 @@
1
+ import { GridItem } from '../../../types';
2
+ export declare const useGridController: ({ data, id, onSelect, }: {
3
+ data: GridItem[];
4
+ id?: string;
5
+ onSelect?: (ids: string[]) => void;
6
+ }) => {
7
+ elementId: string;
8
+ isAllSelected: boolean;
9
+ isAllCheckboxDisabled: boolean;
10
+ selectedIds: string[];
11
+ handleSelectAll: () => void;
12
+ handleDeselectAll: () => void;
13
+ handleSelectRowById: (id: string) => void;
14
+ handleDeselectRowById: (id: string) => void;
15
+ };
@@ -0,0 +1,4 @@
1
+ import { GridProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Grid: FC<GridProps>;
4
+ export default Grid;
@@ -0,0 +1,6 @@
1
+ import { GridColumn, GridItem, GridRowValue, RenderDataItemCallback } from '../../../types';
2
+ export declare function getGridRowValues({ item, columns, renderDataItem, }: {
3
+ item: GridItem;
4
+ columns: GridColumn[];
5
+ renderDataItem?: RenderDataItemCallback;
6
+ }): GridRowValue[];
@@ -0,0 +1,13 @@
1
+ import { GridColumn, GridItem, RenderDataItemCallback } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ data: GridItem[];
5
+ columns: GridColumn[];
6
+ selectedIds: string[];
7
+ selectRowById: (id: string) => void;
8
+ deselectRowById: (id: string) => void;
9
+ renderDataItem?: RenderDataItemCallback;
10
+ selectable: boolean;
11
+ };
12
+ export declare const GridBody: FC<Props>;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ type Props = InputHTMLAttributes<HTMLInputElement> & {
3
+ label: string;
4
+ };
5
+ export declare const GridCheckbox: FC<Props>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { GridColumn } from '../../../../types';
2
+ import { FC } from 'react';
3
+ export declare const GridColumnGroup: FC<{
4
+ columns: GridColumn[];
5
+ selectable: boolean;
6
+ }>;
@@ -0,0 +1,4 @@
1
+ import { FC, ReactElement } from 'react';
2
+ export declare const GridDataCell: FC<{
3
+ value: ReactElement | string;
4
+ }>;
@@ -0,0 +1,13 @@
1
+ import { GridRowValue } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ rowId: string;
5
+ selectedIds: string[];
6
+ selectRowById: (id: string) => void;
7
+ deselectRowById: (id: string) => void;
8
+ selectable: boolean;
9
+ values: GridRowValue[];
10
+ disabled?: boolean;
11
+ };
12
+ export declare const GridRow: FC<Props>;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import { GridColumn } from '../../../../types';
2
+ import { FC } from 'react';
3
+ type GridHeadProps = {
4
+ columns: GridColumn[];
5
+ gridId: string;
6
+ selectable: boolean;
7
+ isAllSelected: boolean;
8
+ isAllCheckboxDisabled?: boolean;
9
+ selectAll: () => void;
10
+ deselectAll: () => void;
11
+ };
12
+ export declare const GridHead: FC<GridHeadProps>;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare const GridHeaderCell: FC<{
3
+ title?: string;
4
+ component?: React.ReactElement;
5
+ }>;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ type Props = {
3
+ gridId: string;
4
+ isAllSelected: boolean;
5
+ selectAll: () => void;
6
+ deselectAll: () => void;
7
+ disabled?: boolean;
8
+ };
9
+ export declare const SelectAllGridRowsCell: FC<Props>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ type Props = {
3
+ rowId: string;
4
+ isRowSelected: boolean;
5
+ selectRowById: (id: string) => void;
6
+ deselectRowById: (id: string) => void;
7
+ disabled?: boolean;
8
+ };
9
+ export declare const SelectGridRowCell: FC<Props>;
10
+ export {};
@@ -0,0 +1,5 @@
1
+ export { default as Dialog } from './dialog/Dialog';
2
+ export { default as Form } from './form/Form';
3
+ export { default as Grid } from './grid/Grid';
4
+ export { default as Menu } from './menu/Menu';
5
+ export { default as Tabs } from './tabs/Tabs';
@@ -0,0 +1,4 @@
1
+ import { MenuProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Menu: FC<MenuProps>;
4
+ export default Menu;
@@ -0,0 +1,5 @@
1
+ import { MenuItem } from '../../../../types';
2
+ import { ReactElement } from 'react';
3
+ export declare const MenuLeaf: ({ item }: {
4
+ item: MenuItem;
5
+ }) => ReactElement;
@@ -0,0 +1,10 @@
1
+ import { OrientationMode } from '../../../../enums';
2
+ import { MenuItem } from '../../../../types';
3
+ import { FC, PropsWithChildren } from 'react';
4
+ type Props = PropsWithChildren & {
5
+ item: MenuItem;
6
+ mode: OrientationMode;
7
+ openedOn?: 'hover' | 'click';
8
+ };
9
+ export declare const MenuListItem: FC<Props>;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { OrientationMode } from '../../../../enums';
2
+ import { MenuItem } from '../../../../types';
3
+ import { FC, PropsWithChildren } from 'react';
4
+ type Props = PropsWithChildren & {
5
+ item: MenuItem;
6
+ isSubMenuOpened: boolean;
7
+ mode: OrientationMode;
8
+ toggleSubMenu: () => void;
9
+ closeSubMenu: () => void;
10
+ openSubMenu: () => void;
11
+ openedOn?: 'hover' | 'click';
12
+ };
13
+ export declare const SubMenu: FC<Props>;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ import { TabsProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Tabs: FC<TabsProps>;
4
+ export default Tabs;
@@ -0,0 +1,18 @@
1
+ import { OrientationMode } from '../../../../enums';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ title: string;
5
+ tabId: string;
6
+ onTabSelect: (id: string) => void;
7
+ tabPanelId: string;
8
+ isSelected: boolean;
9
+ mode: OrientationMode;
10
+ isDisabled?: boolean;
11
+ stretched?: boolean;
12
+ editable?: boolean;
13
+ onTabTitleChange?: (newTitle: string) => void;
14
+ onTabDelete?: (id: string) => void;
15
+ extendable?: boolean;
16
+ };
17
+ export declare const TabButton: FC<Props>;
18
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ChopLogicTabItem } from '../../../../types';
2
+ import { FC, ReactElement } from 'react';
3
+ export declare const TabContent: FC<{
4
+ tabs: ChopLogicTabItem[];
5
+ selectedTabId: string;
6
+ extendable?: boolean;
7
+ extendedTabContent?: ReactElement;
8
+ }>;