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
package/README.md CHANGED
@@ -2,25 +2,30 @@
2
2
 
3
3
  ![Chop Logic](public/logo.jpeg)
4
4
 
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![GitHub Pages](https://github.com/ChopLogic/chop-logic-components/actions/workflows/github-pages.yml/badge.svg)](https://github.com/ChopLogic/chop-logic-components/actions/workflows/github-pages.yml)
5
+ #### Code Quality Checks
6
+ [![CI](https://github.com/ChopLogic/chop-logic-components/actions/workflows/ci.yml/badge.svg)](https://github.com/ChopLogic/chop-logic-components/actions/workflows/ci.yml)
7
7
  [![codecov](https://codecov.io/gh/ChopLogic/chop-logic-components/graph/badge.svg?token=0M1IKB16FN)](https://codecov.io/gh/ChopLogic/chop-logic-components)
8
+ [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FChopLogic%2Fchop-logic-components%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/ChopLogic/chop-logic-components/main)
8
9
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ChopLogic_chop-logic-components&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ChopLogic_chop-logic-components)
10
+ [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev)
11
+
12
+ #### Deployments
13
+ [![GitHub Pages](https://github.com/ChopLogic/chop-logic-components/actions/workflows/github-pages.yml/badge.svg)](https://github.com/ChopLogic/chop-logic-components/actions/workflows/github-pages.yml)
9
14
  [![NPM](https://github.com/ChopLogic/chop-logic-components/actions/workflows/npm.yml/badge.svg)](https://github.com/ChopLogic/chop-logic-components/actions/workflows/npm.yml)
15
+
16
+ #### Standards
10
17
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
11
18
  [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
12
- [![Checked with Biome](https://img.shields.io/badge/Checked_with-Biome-60a5fa?style=flat&logo=biome)](https://biomejs.dev)
13
- [![Code Style: Prettier](https://img.shields.io/badge/Code_Style-Prettier-ff69b4.svg?style=flat)](https://prettier.io)
14
19
  [![Keep a changelog](https://img.shields.io/badge/Keep%20a%20changelog-1.1.0-E05735?logo=keep-a-changelog&labelColor)](https://keepachangelog.com/en/1.1.0/)
15
20
  [![Semantic versioning](https://img.shields.io/badge/SemVer-2.0.0-3F4551?logo=semver&labelColor)](https://semver.org/spec/v2.0.0)
16
- [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FChopLogic%2Fchop-logic-components%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/ChopLogic/chop-logic-components/main)
21
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
17
22
 
18
23
  Welcome to **Chop Logic Components**, a React components library packed with a variety of **styled
19
24
  components** and **custom hooks** that are easy to integrate into any React project.
20
25
 
21
26
  ## 📚 About This Library
22
27
 
23
- Chop Logic Components follows **Atomic Design** principles with **Fully Typed TypeScript** components. All styling uses **pure CSS with CSS variables** (BEM naming convention with `cl-` prefix) for consistent theming across light and dark modes. Built for developer productivity with comprehensive Storybook documentation and accessibility-first approach.
28
+ Chop Logic Components follows **Atomic Design** principles with **Fully Typed TypeScript** components. All styling uses **pure CSS with CSS variables** (BEM naming convention with `cl-` prefix) for consistent theming across light and dark modes. Built for developer productivity with comprehensive [Storybook documentation](https://choplogic.github.io/chop-logic-components) and accessibility-first approach.
24
29
 
25
30
  ## ✨ Features
26
31
 
@@ -30,9 +35,18 @@ Components has the tools to make it easier.
30
35
 
31
36
  ## 🔗 Links
32
37
 
33
- - [Storybook Playground](https://choplogic.github.io/chop-logic-components)
34
- - [Changelog](CHANGELOG.md)
35
38
  - [NPM package](https://www.npmjs.com/package/chop-logic-components)
39
+ - [Playground](https://choplogic.github.io/chop-logic-components)
40
+ - [Changelog](CHANGELOG.md)
41
+
42
+ ## Quality assurance
43
+
44
+ Automated checks include [**CI**](https://github.com/ChopLogic/chop-logic-components/actions/workflows/ci.yml)
45
+ (typecheck, lint, unit tests, library build, Storybook test runner), [**Codecov**](https://codecov.io/gh/ChopLogic/chop-logic-components),
46
+ [**SonarCloud**](https://sonarcloud.io/summary/new_code?id=ChopLogic_chop-logic-components), and scheduled
47
+ [**mutation testing**](https://dashboard.stryker-mutator.io/reports/github.com/ChopLogic/chop-logic-components/main).
48
+ Contributor workflow and coverage expectations are described in [CONTRIBUTING.md](CONTRIBUTING.md); architectural
49
+ decisions are recorded under [docs/adr/](docs/adr/).
36
50
 
37
51
  ## 📦 Installation
38
52
 
@@ -64,6 +78,7 @@ yarn add chop-logic-components
64
78
  | `typecheck` | Performs a full type check without emitting output. |
65
79
  | `test` | Runs unit tests using Vitest in watch mode (interactive). |
66
80
  | `test:ci` | Runs tests once in CI mode and allows empty test sets. |
81
+ | `test:integration` | Builds Storybook and runs the Storybook test runner (Playwright) against static output—integration smoke tests. |
67
82
  | `coverage` | Runs tests and generates a coverage report using Vitest. |
68
83
  | `test:mutation` | Runs mutation testing using Stryker to verify test quality. |
69
84
  | `release:version` | Bumps the version (`patch`, `minor`, or `major`), commits the change, creates a Git tag, and pushes to `main`. Usage: `npm run release:version patch` |
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps } from '../../../types';
3
+ declare const Button: FC<ButtonProps & {
4
+ tooltip?: string;
5
+ visibleOn?: "hover" | "click" | "focus" | "contextmenu";
6
+ }>;
7
+ export default Button;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps } from '../../../../types';
3
+ export declare const IconButton: FC<Omit<ButtonProps, 'text'>>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps } from '../../../../types';
3
+ export declare const InnerButton: FC<Omit<ButtonProps, 'text'>>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps } from '../../../../types';
3
+ export declare const PrimaryButton: FC<ButtonProps>;
@@ -1 +1 @@
1
- .cl-secondary-button{background:var(--cl-surface-a10);cursor:pointer;border-radius:var(--cl-border-radius);gap:var(--cl-s-gap);box-shadow:var(--cl-box-shadow);border:none;transition:all .15s}.cl-secondary-button:hover{box-shadow:var(--cl-box-shadow-extended)}.cl-secondary-button:active{box-shadow:var(--cl-box-shadow);transform:scale(.98)}.cl-secondary-button__text{font-family:var(--cl-core-font);font-size:inherit;color:var(--cl-base-font-color);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}.cl-secondary-button__icon:before{color:var(--cl-base-font-color);margin-right:var(--cl-s-gap)}
1
+ .cl-secondary-button{background:var(--cl-surface-a10);cursor:pointer;border-radius:var(--cl-border-radius);border:var(--cl-light-border);gap:var(--cl-s-gap);box-shadow:var(--cl-box-shadow);transition:all .15s}.cl-secondary-button:hover{box-shadow:var(--cl-box-shadow-extended)}.cl-secondary-button:active{box-shadow:var(--cl-box-shadow);transform:scale(.98)}.cl-secondary-button__text{font-family:var(--cl-core-font);font-size:inherit;color:var(--cl-base-font-color);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}.cl-secondary-button__icon:before{color:var(--cl-base-font-color);margin-right:var(--cl-s-gap)}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ButtonProps } from '../../../../types';
3
+ export declare const SecondaryButton: FC<ButtonProps>;
@@ -0,0 +1,14 @@
1
+ import { ChopLogicComponentProps } from '../../../types';
2
+ import { FC, RefObject } from 'react';
3
+ interface EditViewProps extends ChopLogicComponentProps {
4
+ multiline: boolean;
5
+ value: string;
6
+ placeholder: string;
7
+ onChange: (value: string) => void;
8
+ onBlur: () => void;
9
+ onKeyDown: (event: React.KeyboardEvent) => void;
10
+ className: string;
11
+ inputRef: RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
12
+ }
13
+ export declare const EditView: FC<EditViewProps>;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ import { EditableTextProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const EditableText: FC<EditableTextProps>;
4
+ export default EditableText;
@@ -0,0 +1,10 @@
1
+ import { ChopLogicComponentProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ interface ReadViewProps extends ChopLogicComponentProps {
4
+ value: string;
5
+ placeholder: string;
6
+ onClick: (event: React.MouseEvent) => void;
7
+ className: string;
8
+ }
9
+ export declare const ReadView: FC<ReadViewProps>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const useEditModeState: (controlledEditMode?: boolean, readOnly?: boolean) => {
2
+ editMode: boolean;
3
+ enterEditMode: () => void;
4
+ exitEditMode: () => void;
5
+ isControlled: boolean;
6
+ };
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare const useInputFocus: (ref: RefObject<HTMLTextAreaElement | HTMLInputElement | null>, editMode: boolean, autoSelectTextOnEditMode?: boolean, readOnly?: boolean) => void;
@@ -0,0 +1,6 @@
1
+ export declare const useValueState: (value: string, onChange?: (value: string) => void) => {
2
+ internalValue: string;
3
+ updateValue: (newValue: string) => void;
4
+ commitValue: () => void;
5
+ resetValue: () => void;
6
+ };
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ type ErrorMessageProps = {
3
+ errorId: string;
4
+ visible?: boolean;
5
+ message?: string;
6
+ testId?: string;
7
+ className?: string;
8
+ };
9
+ declare const ErrorMessage: FC<ErrorMessageProps>;
10
+ export default ErrorMessage;
@@ -0,0 +1,4 @@
1
+ import { HeaderProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Header: FC<HeaderProps>;
4
+ export default Header;
@@ -0,0 +1,11 @@
1
+ import { ElementSize, IconName } from '../../../enums';
2
+ import { ChopLogicComponentProps } from '../../../types';
3
+ import { FC } from 'react';
4
+ export interface IconProps extends ChopLogicComponentProps {
5
+ name?: IconName;
6
+ testId?: string;
7
+ hidden?: boolean;
8
+ size?: ElementSize;
9
+ }
10
+ declare const Icon: FC<IconProps>;
11
+ export default Icon;
@@ -3,9 +3,9 @@ import { ElementSize as t } from "../../../enums/element-size.js";
3
3
  import './Icon.css';/* empty css */
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  //#region src/components/atoms/icon/Icon.tsx
6
- var r = ({ name: r, testId: i, className: a, hidden: o, size: s = t.Medium, ...c }) => {
7
- if (!r) return null;
8
- let l = e([
6
+ var r = ({ name: r, testId: i, className: a, hidden: o, size: s = t.Medium, ...c }) => r ? /* @__PURE__ */ n("span", {
7
+ "data-testid": i,
8
+ className: e([
9
9
  a,
10
10
  "cl-icon",
11
11
  r,
@@ -17,13 +17,9 @@ var r = ({ name: r, testId: i, className: a, hidden: o, size: s = t.Medium, ...c
17
17
  "cl-icon_xlarge": s === t.ExtraLarge,
18
18
  "cl-icon_2xlarge": s === t.ExtraExtraLarge
19
19
  }
20
- ]);
21
- return /* @__PURE__ */ n("span", {
22
- "data-testid": i,
23
- className: l,
24
- "aria-hidden": o,
25
- ...c
26
- });
27
- };
20
+ ]),
21
+ "aria-hidden": o,
22
+ ...c
23
+ }) : null;
28
24
  //#endregion
29
25
  export { r as default };
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ type Props = {
3
+ src: string;
4
+ alt: string;
5
+ sizes?: string;
6
+ width?: number | string;
7
+ height?: number | string;
8
+ loading?: 'lazy' | 'eager';
9
+ decoding?: 'sync' | 'async' | 'auto';
10
+ onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
11
+ };
12
+ export declare const BasicImage: FC<Props>;
13
+ export {};
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const FallbackImage: FC;
@@ -0,0 +1,6 @@
1
+ import { ImageProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Image: FC<ImageProps & {
4
+ caption?: string;
5
+ }>;
6
+ export default Image;
@@ -0,0 +1,15 @@
1
+ import { ImageSource } from '../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ sources: ImageSource[];
5
+ src: string;
6
+ alt: string;
7
+ sizes?: string;
8
+ width?: number | string;
9
+ height?: number | string;
10
+ loading?: 'lazy' | 'eager';
11
+ decoding?: 'sync' | 'async' | 'auto';
12
+ onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
13
+ };
14
+ export declare const ResponsivePicture: FC<Props>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ export { default as Button } from './button/Button';
2
+ export { default as EditableText } from './editable-text/EditableText';
3
+ export { default as ErrorMessage } from './error-message/ErrorMessage';
4
+ export { default as Header } from './header/Header';
5
+ export { default as Icon } from './icon/Icon';
6
+ export { default as Image } from './image/Image';
7
+ export { default as Input } from './input/Input';
8
+ export { default as Label } from './label/Label';
9
+ export { default as Link } from './link/Link';
10
+ export { default as Portal } from './portal/Portal';
11
+ export { default as Tooltip } from './tooltip/Tooltip';
@@ -0,0 +1,5 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ declare const _default: import('react').ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
3
+ children?: import('react').ReactNode | undefined;
4
+ } & import('react').RefAttributes<HTMLInputElement>>;
5
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { ElementSize, IconName } from '../../../enums';
2
+ import { FC } from 'react';
3
+ type LabelProps = {
4
+ label: string;
5
+ required: boolean;
6
+ inputId: string;
7
+ isTextHidden?: boolean;
8
+ icon?: IconName;
9
+ iconPosition?: 'left' | 'right';
10
+ iconSize?: ElementSize;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ testId?: string;
14
+ };
15
+ declare const Label: FC<LabelProps>;
16
+ export default Label;
@@ -0,0 +1,4 @@
1
+ import { LinkProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Link: FC<LinkProps>;
4
+ export default Link;
@@ -0,0 +1,5 @@
1
+ import { ReactElement, ReactPortal } from 'react';
2
+ declare const Portal: ({ children }: {
3
+ children: ReactElement;
4
+ }) => ReactPortal;
5
+ export default Portal;
@@ -0,0 +1,19 @@
1
+ import { MouseEvent } from 'react';
2
+ type Params = {
3
+ autoClose: boolean;
4
+ autoCloseDelay: number;
5
+ id?: string;
6
+ };
7
+ export declare const useTooltipController: ({ id, autoClose, autoCloseDelay }: Params) => {
8
+ elementId: string;
9
+ openTooltip: () => void;
10
+ closeTooltip: () => void;
11
+ toggleTooltip: () => void;
12
+ handleContextMenu: (e: MouseEvent) => void;
13
+ top: number;
14
+ left: number;
15
+ isOpened: boolean;
16
+ wrapperRef: import('react').RefObject<null>;
17
+ tooltipRef: import('react').RefObject<HTMLDivElement | null>;
18
+ };
19
+ export {};
@@ -0,0 +1,4 @@
1
+ import { TooltipProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Tooltip: FC<TooltipProps>;
4
+ export default Tooltip;
@@ -0,0 +1,7 @@
1
+ import { FormInputParams, FormValues } from '../../../types';
2
+ export interface FormContextProps {
3
+ onChangeFormInput?: (params: FormInputParams) => void;
4
+ initialValues?: FormValues;
5
+ resetSignal?: number;
6
+ }
7
+ export declare const FormContext: import('react').Context<FormContextProps>;
@@ -0,0 +1,4 @@
1
+ export type { FormContextProps } from './form/FormContext';
2
+ export { FormContext } from './form/FormContext';
3
+ export { CL_DARK_THEME_CLASS, CL_LIGHT_THEME_CLASS, ThemeContext } from './theme/ThemeContext';
4
+ export { ThemeProvider } from './theme/ThemeProvider';
@@ -0,0 +1,8 @@
1
+ export declare const CL_LIGHT_THEME_CLASS = "cl-components-light-theme";
2
+ export declare const CL_DARK_THEME_CLASS = "cl-components-dark-theme";
3
+ type ThemeMode = typeof CL_LIGHT_THEME_CLASS | typeof CL_DARK_THEME_CLASS;
4
+ export declare const ThemeContext: import('react').Context<{
5
+ mode?: ThemeMode;
6
+ setMode: (mode: ThemeMode) => void;
7
+ }>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { CL_DARK_THEME_CLASS, CL_LIGHT_THEME_CLASS } from './ThemeContext';
3
+ type ThemeMode = typeof CL_LIGHT_THEME_CLASS | typeof CL_DARK_THEME_CLASS;
4
+ export declare const ThemeProvider: FC<{
5
+ children: ReactNode;
6
+ injectedMode?: ThemeMode;
7
+ }>;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ export { type WithErrorBoundaryProps, withErrorBoundary, } from './with-error-boundary/with-error-boundary';
2
+ export { withFigureCaption } from './with-figure-caption/with-figure-caption';
3
+ export { withTooltip } from './with-tooltip/with-tooltip';
@@ -0,0 +1,2 @@
1
+ export { default } from './with-error-boundary.js';
2
+ export * from './with-error-boundary.js';
@@ -0,0 +1,6 @@
1
+ import { ComponentType, FC } from 'react';
2
+ export type WithErrorBoundaryProps = {
3
+ errorMessage?: string;
4
+ onError?: () => void;
5
+ };
6
+ export declare function withErrorBoundary<P extends object>(ComponentToWrap: ComponentType<P>): FC<P & WithErrorBoundaryProps>;
@@ -0,0 +1,32 @@
1
+ import e from "../../atoms/error-message/ErrorMessage2.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Component as n, useId as r } from "react";
4
+ //#region src/components/hocs/with-error-boundary/with-error-boundary.tsx
5
+ var i = class extends n {
6
+ constructor(e) {
7
+ super(e), this.state = { hasError: !1 };
8
+ }
9
+ static getDerivedStateFromError() {
10
+ return { hasError: !0 };
11
+ }
12
+ componentDidCatch(e, t) {
13
+ this.props.onError?.();
14
+ }
15
+ render() {
16
+ return this.state.hasError ? /* @__PURE__ */ t(e, {
17
+ errorId: this.props.errorId,
18
+ message: this.props.errorMessage,
19
+ visible: !0
20
+ }) : this.props.children;
21
+ }
22
+ };
23
+ function a(e) {
24
+ return ({ errorMessage: n, onError: a, ...o }) => /* @__PURE__ */ t(i, {
25
+ errorId: `cl-error-boundary-${r().replace(/:/g, "")}`,
26
+ errorMessage: n,
27
+ onError: a,
28
+ children: /* @__PURE__ */ t(e, { ...o })
29
+ });
30
+ }
31
+ //#endregion
32
+ export { a as withErrorBoundary };
@@ -0,0 +1,6 @@
1
+ import { ComponentType, FC } from 'react';
2
+ type WithFigureCaptionProps = {
3
+ caption?: string;
4
+ };
5
+ export declare function withFigureCaption<P extends object>(Component: ComponentType<P>): FC<P & WithFigureCaptionProps>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ComponentType, FC } from 'react';
2
+ type WithTooltipProps = {
3
+ tooltip?: string;
4
+ visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
5
+ };
6
+ export declare function withTooltip<P extends object>(Component: ComponentType<P>): FC<P & WithTooltipProps>;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { AccordionProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Accordion: FC<AccordionProps>;
4
+ export default Accordion;
@@ -0,0 +1,3 @@
1
+ import { AccordionItemProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ export declare const AccordionItem: FC<AccordionItemProps>;
@@ -0,0 +1,4 @@
1
+ import { AlertProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Alert: FC<AlertProps>;
4
+ export default Alert;
@@ -0,0 +1,3 @@
1
+ import { AlertMode, IconName } from '../../../enums';
2
+ export declare function getAlertTitle(mode: AlertMode, title?: string): string;
3
+ export declare function getAlertIcon(mode: AlertMode, icon?: IconName): IconName | undefined;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ export declare const AlertProgressBar: FC<{
3
+ remainingPercentage: number;
4
+ }>;
@@ -0,0 +1,7 @@
1
+ import { Breadcrumb } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const BreadcrumbItem: FC<{
4
+ item: Breadcrumb;
5
+ isLastItem: boolean;
6
+ }>;
7
+ export default BreadcrumbItem;
@@ -0,0 +1,6 @@
1
+ import { Breadcrumb } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const BreadcrumbList: FC<{
4
+ items: Breadcrumb[];
5
+ }>;
6
+ export default BreadcrumbList;
@@ -0,0 +1,4 @@
1
+ import { BreadcrumbsProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Breadcrumbs: FC<BreadcrumbsProps>;
4
+ export default Breadcrumbs;
@@ -0,0 +1,9 @@
1
+ import { ChangeEvent, ChangeEventHandler } from 'react';
2
+ export declare function useCheckboxController({ name, defaultChecked, onChange, }: {
3
+ name: string;
4
+ defaultChecked?: boolean;
5
+ onChange?: ChangeEventHandler<HTMLInputElement>;
6
+ }): {
7
+ handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
8
+ checked: boolean;
9
+ };
@@ -0,0 +1,9 @@
1
+ import { CheckboxProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ /**
4
+ * Checkbox component factory
5
+ * Renders either a stateful or stateless component
6
+ * based on the `stateless` prop.
7
+ */
8
+ declare const Checkbox: FC<CheckboxProps>;
9
+ export default Checkbox;
@@ -0,0 +1,6 @@
1
+ import { FormValues } from '../../../types';
2
+ export declare function getCheckboxInitialValue({ defaultChecked, initialValues, name, }: {
3
+ defaultChecked?: boolean;
4
+ initialValues?: FormValues;
5
+ name: string;
6
+ }): boolean;
@@ -0,0 +1,4 @@
1
+ import { CheckboxProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const CheckboxStateful: FC<CheckboxProps>;
4
+ export default CheckboxStateful;
@@ -0,0 +1,4 @@
1
+ import { CheckboxProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const CheckboxStateless: FC<CheckboxProps>;
4
+ export default CheckboxStateless;
@@ -0,0 +1,10 @@
1
+ export { default as Accordion } from './accordion/Accordion';
2
+ export { default as Alert } from './alert/Alert';
3
+ export { default as Breadcrumbs } from './breadcrumbs/Breadcrumbs';
4
+ export { default as Checkbox } from './checkbox/Checkbox';
5
+ export { default as MultiSelect } from './multi-select/MultiSelect';
6
+ export { default as NumericInput } from './numeric-input/NumericInput';
7
+ export { default as Search } from './search/Search';
8
+ export { default as Select } from './select/Select';
9
+ export { default as Switch } from './switch/Switch';
10
+ export { default as TextInput } from './text-input/TextInput';
@@ -0,0 +1,15 @@
1
+ import { MultiSelectValue } 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
+ values?: MultiSelectValue[];
11
+ placeholder?: string;
12
+ name: string;
13
+ };
14
+ export declare const MultiSelectCombobox: FC<Props>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { MultiSelectValue } from '../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ options: MultiSelectValue[];
5
+ opened: boolean;
6
+ dropdownId: string;
7
+ onClose: () => void;
8
+ onSelect: (id: string) => void;
9
+ };
10
+ export declare const MultiSelectDropdown: FC<Props>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { MultiSelectValue, SelectValue } from '../../../types';
2
+ export declare function useMultiSelectController({ name, defaultValue, onChange, options, }: {
3
+ name: string;
4
+ defaultValue?: string | number | readonly string[];
5
+ onChange?: (values?: SelectValue[]) => void;
6
+ options: SelectValue[];
7
+ }): {
8
+ handleClose: () => void;
9
+ handleToggle: () => void;
10
+ handleSelect: (id: string) => void;
11
+ opened: boolean;
12
+ values: MultiSelectValue[];
13
+ };
@@ -0,0 +1,4 @@
1
+ import { MultiSelectProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const MultiSelect: FC<MultiSelectProps>;
4
+ export default MultiSelect;
@@ -0,0 +1,9 @@
1
+ import { FormValues, MultiSelectValue, SelectValue } from '../../../types';
2
+ export declare function getMultiSelectInitialValues({ name, options, initialValues, defaultValue, }: {
3
+ name: string;
4
+ options: SelectValue[];
5
+ initialValues?: FormValues;
6
+ defaultValue?: string | number | readonly string[];
7
+ }): MultiSelectValue[];
8
+ export declare const getMultiSelectFormValues: (options: MultiSelectValue[]) => string[];
9
+ export declare const getMultiSelectUpdatedValues: (options: MultiSelectValue[], id: string) => MultiSelectValue[];
@@ -0,0 +1,8 @@
1
+ import { MultiSelectValue } from '../../../types';
2
+ import { FC } from 'react';
3
+ type Props = {
4
+ values?: MultiSelectValue[];
5
+ placeholder?: string;
6
+ };
7
+ export declare const MultiSelectComboboxSelectedValues: FC<Props>;
8
+ export {};