chop-logic-components 4.1.0 → 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 (159) hide show
  1. package/README.md +11 -0
  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.d.ts +3 -0
  7. package/dist/components/atoms/editable-text/EditView.d.ts +14 -0
  8. package/dist/components/atoms/editable-text/EditableText.d.ts +4 -0
  9. package/dist/components/atoms/editable-text/ReadView.d.ts +10 -0
  10. package/dist/components/atoms/editable-text/useEditModeState.d.ts +6 -0
  11. package/dist/components/atoms/editable-text/useInputFocus.d.ts +2 -0
  12. package/dist/components/atoms/editable-text/useValueState.d.ts +6 -0
  13. package/dist/components/atoms/error-message/ErrorMessage.d.ts +10 -0
  14. package/dist/components/atoms/header/Header.d.ts +4 -0
  15. package/dist/components/atoms/icon/Icon.d.ts +11 -0
  16. package/dist/components/atoms/image/BasicImage.d.ts +13 -0
  17. package/dist/components/atoms/image/FallBackImage.d.ts +2 -0
  18. package/dist/components/atoms/image/Image.d.ts +6 -0
  19. package/dist/components/atoms/image/ResponsivePicture.d.ts +15 -0
  20. package/dist/components/atoms/index.d.ts +11 -0
  21. package/dist/components/atoms/input/Input.d.ts +5 -0
  22. package/dist/components/atoms/label/Label.d.ts +16 -0
  23. package/dist/components/atoms/link/Link.d.ts +4 -0
  24. package/dist/components/atoms/portal/Portal.d.ts +5 -0
  25. package/dist/components/atoms/tooltip/Tooltip.controller.d.ts +19 -0
  26. package/dist/components/atoms/tooltip/Tooltip.d.ts +4 -0
  27. package/dist/components/contexts/form/FormContext.d.ts +7 -0
  28. package/dist/components/contexts/index.d.ts +4 -0
  29. package/dist/components/contexts/theme/ThemeContext.d.ts +8 -0
  30. package/dist/components/contexts/theme/ThemeProvider.d.ts +8 -0
  31. package/dist/components/hocs/index.d.ts +3 -0
  32. package/dist/components/hocs/with-error-boundary/with-error-boundary.d.ts +6 -0
  33. package/dist/components/hocs/with-figure-caption/with-figure-caption.d.ts +6 -0
  34. package/dist/components/hocs/with-tooltip/with-tooltip.d.ts +7 -0
  35. package/dist/components/molecules/accordion/Accordion.d.ts +4 -0
  36. package/dist/components/molecules/accordion/AccordionItem.d.ts +3 -0
  37. package/dist/components/molecules/alert/Alert.d.ts +4 -0
  38. package/dist/components/molecules/alert/Alert.helpers.d.ts +3 -0
  39. package/dist/components/molecules/alert/AlertProgressBar.d.ts +4 -0
  40. package/dist/components/molecules/breadcrumbs/BreadcrumbItem.d.ts +7 -0
  41. package/dist/components/molecules/breadcrumbs/BreadcrumbList.d.ts +6 -0
  42. package/dist/components/molecules/breadcrumbs/Breadcrumbs.d.ts +4 -0
  43. package/dist/components/molecules/checkbox/Checkbox.controller.d.ts +9 -0
  44. package/dist/components/molecules/checkbox/Checkbox.d.ts +9 -0
  45. package/dist/components/molecules/checkbox/Checkbox.helpers.d.ts +6 -0
  46. package/dist/components/molecules/checkbox/CheckboxStateful.d.ts +4 -0
  47. package/dist/components/molecules/checkbox/CheckboxStateless.d.ts +4 -0
  48. package/dist/components/molecules/index.d.ts +10 -0
  49. package/dist/components/molecules/multi-select/MultiSelect.Combobox.d.ts +15 -0
  50. package/dist/components/molecules/multi-select/MultiSelect.Dropdown.d.ts +11 -0
  51. package/dist/components/molecules/multi-select/MultiSelect.controller.d.ts +13 -0
  52. package/dist/components/molecules/multi-select/MultiSelect.d.ts +4 -0
  53. package/dist/components/molecules/multi-select/MultiSelect.helpers.d.ts +9 -0
  54. package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.d.ts +8 -0
  55. package/dist/components/molecules/multi-select/Option.d.ts +8 -0
  56. package/dist/components/molecules/numeric-input/NumericInput.controller.d.ts +22 -0
  57. package/dist/components/molecules/numeric-input/NumericInput.d.ts +9 -0
  58. package/dist/components/molecules/numeric-input/NumericInput.helpers.d.ts +13 -0
  59. package/dist/components/molecules/numeric-input/NumericInputStateful.d.ts +4 -0
  60. package/dist/components/molecules/numeric-input/NumericInputStateless.d.ts +4 -0
  61. package/dist/components/molecules/search/Search.controller.d.ts +12 -0
  62. package/dist/components/molecules/search/Search.d.ts +4 -0
  63. package/dist/components/molecules/select/Select.controller.d.ts +14 -0
  64. package/dist/components/molecules/select/Select.d.ts +4 -0
  65. package/dist/components/molecules/select/Select.helpers.d.ts +7 -0
  66. package/dist/components/molecules/select/combobox/Combobox.d.ts +15 -0
  67. package/dist/components/molecules/select/dropdown/Dropdown.d.ts +14 -0
  68. package/dist/components/molecules/select/option/Option.d.ts +10 -0
  69. package/dist/components/molecules/switch/Switch.controller.d.ts +10 -0
  70. package/dist/components/molecules/switch/Switch.d.ts +4 -0
  71. package/dist/components/molecules/switch/Switch.helpers.d.ts +6 -0
  72. package/dist/components/molecules/text-input/TextInput.controller.d.ts +17 -0
  73. package/dist/components/molecules/text-input/TextInput.d.ts +9 -0
  74. package/dist/components/molecules/text-input/TextInput.helpers.d.ts +11 -0
  75. package/dist/components/molecules/text-input/TextInputButtons.d.ts +11 -0
  76. package/dist/components/molecules/text-input/TextInputStateful.d.ts +4 -0
  77. package/dist/components/molecules/text-input/TextInputStateless.d.ts +4 -0
  78. package/dist/components/organisms/dialog/Dialog.d.ts +4 -0
  79. package/dist/components/organisms/form/Form.controller.d.ts +14 -0
  80. package/dist/components/organisms/form/Form.d.ts +4 -0
  81. package/dist/components/organisms/form/Form.helpers.d.ts +4 -0
  82. package/dist/components/organisms/grid/Grid.controller.d.ts +15 -0
  83. package/dist/components/organisms/grid/Grid.d.ts +4 -0
  84. package/dist/components/organisms/grid/Grid.helpers.d.ts +6 -0
  85. package/dist/components/organisms/grid/body/GridBody.d.ts +13 -0
  86. package/dist/components/organisms/grid/checkbox/GridCheckbox.d.ts +6 -0
  87. package/dist/components/organisms/grid/column-group/GridColumnGroup.d.ts +6 -0
  88. package/dist/components/organisms/grid/data-cell/GridDataCell.d.ts +4 -0
  89. package/dist/components/organisms/grid/grid-row/GridRow.d.ts +13 -0
  90. package/dist/components/organisms/grid/head/GridHead.d.ts +13 -0
  91. package/dist/components/organisms/grid/header-cell/HeaderCell.d.ts +5 -0
  92. package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.d.ts +10 -0
  93. package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.d.ts +10 -0
  94. package/dist/components/organisms/index.d.ts +5 -0
  95. package/dist/components/organisms/menu/Menu.d.ts +4 -0
  96. package/dist/components/organisms/menu/leaf/MenuLeaf.d.ts +5 -0
  97. package/dist/components/organisms/menu/list-item/MenuListItem.d.ts +10 -0
  98. package/dist/components/organisms/menu/sub-menu/SubMenu.d.ts +14 -0
  99. package/dist/components/organisms/tabs/Tabs.d.ts +4 -0
  100. package/dist/components/organisms/tabs/button/TabButton.d.ts +18 -0
  101. package/dist/components/organisms/tabs/content/TabContent.d.ts +8 -0
  102. package/dist/components/organisms/tabs/edit-input/TabEditInput.d.ts +14 -0
  103. package/dist/components/organisms/tabs/list/TabList.d.ts +19 -0
  104. package/dist/enums/alert-mode.d.ts +7 -0
  105. package/dist/enums/button-view.d.ts +6 -0
  106. package/dist/enums/element-size.d.ts +8 -0
  107. package/dist/enums/icon-name.d.ts +284 -0
  108. package/dist/enums/index.d.ts +8 -0
  109. package/dist/enums/loader-view.d.ts +11 -0
  110. package/dist/enums/orientation-mode.d.ts +4 -0
  111. package/dist/enums/semantic-color.d.ts +7 -0
  112. package/dist/enums/tooltip-container.d.ts +7 -0
  113. package/dist/hooks/index.d.ts +15 -0
  114. package/dist/hooks/use-auto-close/use-auto-close.d.ts +6 -0
  115. package/dist/hooks/use-click-outside/use-click-outside.d.ts +8 -0
  116. package/dist/hooks/use-container-dimensions/use-container-dimensions.d.ts +8 -0
  117. package/dist/hooks/use-debounce/use-debounce.d.ts +1 -0
  118. package/dist/hooks/use-element-ids/use-element-ids.d.ts +5 -0
  119. package/dist/hooks/use-is-hovered/use-is-hovered.d.ts +2 -0
  120. package/dist/hooks/use-is-mounted/use-is-mounted.d.ts +1 -0
  121. package/dist/hooks/use-is-overflow/use-is-overflow.d.ts +6 -0
  122. package/dist/hooks/use-key-press/use-key-press.d.ts +8 -0
  123. package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.d.ts +7 -0
  124. package/dist/hooks/use-remaining-timer/use-remaining-timer.d.ts +9 -0
  125. package/dist/hooks/use-reset-form-input/use-reset-form-input.d.ts +1 -0
  126. package/dist/hooks/use-theme/use-theme.d.ts +4 -0
  127. package/dist/hooks/use-tooltip-position/use-tooltip-position.d.ts +12 -0
  128. package/dist/hooks/use-window-dimensions/use-window-dimensions.d.ts +2 -0
  129. package/dist/index.d.ts +2 -924
  130. package/dist/main.d.ts +8 -0
  131. package/dist/types/_common.d.ts +35 -0
  132. package/dist/types/accordion.d.ts +8 -0
  133. package/dist/types/alert.d.ts +11 -0
  134. package/dist/types/breadcrumbs.d.ts +10 -0
  135. package/dist/types/button.d.ts +11 -0
  136. package/dist/types/checkbox.d.ts +9 -0
  137. package/dist/types/dialog.d.ts +9 -0
  138. package/dist/types/editable-text.d.ts +12 -0
  139. package/dist/types/form.d.ts +18 -0
  140. package/dist/types/grid.d.ts +27 -0
  141. package/dist/types/header.d.ts +9 -0
  142. package/dist/types/image.d.ts +21 -0
  143. package/dist/types/index.d.ts +23 -0
  144. package/dist/types/link.d.ts +9 -0
  145. package/dist/types/loader.d.ts +6 -0
  146. package/dist/types/menu.d.ts +17 -0
  147. package/dist/types/multi-select.d.ts +7 -0
  148. package/dist/types/numeric.d.ts +19 -0
  149. package/dist/types/search.d.ts +16 -0
  150. package/dist/types/select.d.ts +7 -0
  151. package/dist/types/switch.d.ts +13 -0
  152. package/dist/types/tabs.d.ts +23 -0
  153. package/dist/types/text.d.ts +17 -0
  154. package/dist/types/tooltip.d.ts +11 -0
  155. package/dist/utils/get-class-name.d.ts +5 -0
  156. package/dist/utils/handle-dropdown-list-key-press.d.ts +7 -0
  157. package/dist/utils/index.d.ts +3 -0
  158. package/dist/utils/move-focus-on-element-by-id.d.ts +1 -0
  159. package/package.json +17 -13
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ![Chop Logic](public/logo.jpeg)
4
4
 
5
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)
6
7
  [![codecov](https://codecov.io/gh/ChopLogic/chop-logic-components/graph/badge.svg?token=0M1IKB16FN)](https://codecov.io/gh/ChopLogic/chop-logic-components)
7
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)
@@ -38,6 +39,15 @@ Components has the tools to make it easier.
38
39
  - [Playground](https://choplogic.github.io/chop-logic-components)
39
40
  - [Changelog](CHANGELOG.md)
40
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/).
50
+
41
51
  ## 📦 Installation
42
52
 
43
53
  To get started with Chop Logic, install it via npm or yarn:
@@ -68,6 +78,7 @@ yarn add chop-logic-components
68
78
  | `typecheck` | Performs a full type check without emitting output. |
69
79
  | `test` | Runs unit tests using Vitest in watch mode (interactive). |
70
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. |
71
82
  | `coverage` | Runs tests and generates a coverage report using Vitest. |
72
83
  | `test:mutation` | Runs mutation testing using Stryker to verify test quality. |
73
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>;
@@ -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;
@@ -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,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,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 {};
@@ -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 {};
@@ -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;