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.
- package/README.md +23 -8
- package/dist/components/atoms/button/Button.d.ts +7 -0
- package/dist/components/atoms/button/icon-button/IconButton.d.ts +3 -0
- package/dist/components/atoms/button/inner-button/InnerButton.d.ts +3 -0
- package/dist/components/atoms/button/primary-button/PrimaryButton.d.ts +3 -0
- package/dist/components/atoms/button/secondary-button/SecondaryButton.css +1 -1
- package/dist/components/atoms/button/secondary-button/SecondaryButton.d.ts +3 -0
- package/dist/components/atoms/editable-text/EditView.d.ts +14 -0
- package/dist/components/atoms/editable-text/EditableText.d.ts +4 -0
- package/dist/components/atoms/editable-text/ReadView.d.ts +10 -0
- package/dist/components/atoms/editable-text/useEditModeState.d.ts +6 -0
- package/dist/components/atoms/editable-text/useInputFocus.d.ts +2 -0
- package/dist/components/atoms/editable-text/useValueState.d.ts +6 -0
- package/dist/components/atoms/error-message/ErrorMessage.d.ts +10 -0
- package/dist/components/atoms/header/Header.d.ts +4 -0
- package/dist/components/atoms/icon/Icon.d.ts +11 -0
- package/dist/components/atoms/icon/Icon2.js +7 -11
- package/dist/components/atoms/image/BasicImage.d.ts +13 -0
- package/dist/components/atoms/image/FallBackImage.d.ts +2 -0
- package/dist/components/atoms/image/Image.d.ts +6 -0
- package/dist/components/atoms/image/ResponsivePicture.d.ts +15 -0
- package/dist/components/atoms/index.d.ts +11 -0
- package/dist/components/atoms/input/Input.d.ts +5 -0
- package/dist/components/atoms/label/Label.d.ts +16 -0
- package/dist/components/atoms/link/Link.d.ts +4 -0
- package/dist/components/atoms/portal/Portal.d.ts +5 -0
- package/dist/components/atoms/tooltip/Tooltip.controller.d.ts +19 -0
- package/dist/components/atoms/tooltip/Tooltip.d.ts +4 -0
- package/dist/components/contexts/form/FormContext.d.ts +7 -0
- package/dist/components/contexts/index.d.ts +4 -0
- package/dist/components/contexts/theme/ThemeContext.d.ts +8 -0
- package/dist/components/contexts/theme/ThemeProvider.d.ts +8 -0
- package/dist/components/hocs/index.d.ts +3 -0
- package/dist/components/hocs/with-error-boundary/index.js +2 -0
- package/dist/components/hocs/with-error-boundary/with-error-boundary.d.ts +6 -0
- package/dist/components/hocs/with-error-boundary/with-error-boundary.js +32 -0
- package/dist/components/hocs/with-figure-caption/with-figure-caption.d.ts +6 -0
- package/dist/components/hocs/with-tooltip/with-tooltip.d.ts +7 -0
- package/dist/components/molecules/accordion/Accordion.d.ts +4 -0
- package/dist/components/molecules/accordion/AccordionItem.d.ts +3 -0
- package/dist/components/molecules/alert/Alert.d.ts +4 -0
- package/dist/components/molecules/alert/Alert.helpers.d.ts +3 -0
- package/dist/components/molecules/alert/AlertProgressBar.d.ts +4 -0
- package/dist/components/molecules/breadcrumbs/BreadcrumbItem.d.ts +7 -0
- package/dist/components/molecules/breadcrumbs/BreadcrumbList.d.ts +6 -0
- package/dist/components/molecules/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/components/molecules/checkbox/Checkbox.controller.d.ts +9 -0
- package/dist/components/molecules/checkbox/Checkbox.d.ts +9 -0
- package/dist/components/molecules/checkbox/Checkbox.helpers.d.ts +6 -0
- package/dist/components/molecules/checkbox/CheckboxStateful.d.ts +4 -0
- package/dist/components/molecules/checkbox/CheckboxStateless.d.ts +4 -0
- package/dist/components/molecules/index.d.ts +10 -0
- package/dist/components/molecules/multi-select/MultiSelect.Combobox.d.ts +15 -0
- package/dist/components/molecules/multi-select/MultiSelect.Dropdown.d.ts +11 -0
- package/dist/components/molecules/multi-select/MultiSelect.controller.d.ts +13 -0
- package/dist/components/molecules/multi-select/MultiSelect.d.ts +4 -0
- package/dist/components/molecules/multi-select/MultiSelect.helpers.d.ts +9 -0
- package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.d.ts +8 -0
- package/dist/components/molecules/multi-select/Option.d.ts +8 -0
- package/dist/components/molecules/multi-select/Option.js +11 -11
- package/dist/components/molecules/numeric-input/NumericInput.controller.d.ts +22 -0
- package/dist/components/molecules/numeric-input/NumericInput.d.ts +9 -0
- package/dist/components/molecules/numeric-input/NumericInput.helpers.d.ts +13 -0
- package/dist/components/molecules/numeric-input/NumericInputStateful.d.ts +4 -0
- package/dist/components/molecules/numeric-input/NumericInputStateless.d.ts +4 -0
- package/dist/components/molecules/search/Search.controller.d.ts +12 -0
- package/dist/components/molecules/search/Search.d.ts +4 -0
- package/dist/components/molecules/select/Select.controller.d.ts +14 -0
- package/dist/components/molecules/select/Select.d.ts +4 -0
- package/dist/components/molecules/select/Select.helpers.d.ts +7 -0
- package/dist/components/molecules/select/combobox/Combobox.d.ts +15 -0
- package/dist/components/molecules/select/dropdown/Dropdown.d.ts +14 -0
- package/dist/components/molecules/select/option/Option.d.ts +10 -0
- package/dist/components/molecules/select/option/Option2.js +10 -10
- package/dist/components/molecules/switch/Switch.controller.d.ts +10 -0
- package/dist/components/molecules/switch/Switch.d.ts +4 -0
- package/dist/components/molecules/switch/Switch.helpers.d.ts +6 -0
- package/dist/components/molecules/switch/Switch2.js +4 -4
- package/dist/components/molecules/text-input/TextInput.controller.d.ts +17 -0
- package/dist/components/molecules/text-input/TextInput.d.ts +9 -0
- package/dist/components/molecules/text-input/TextInput.helpers.d.ts +11 -0
- package/dist/components/molecules/text-input/TextInputButtons.d.ts +11 -0
- package/dist/components/molecules/text-input/TextInputStateful.d.ts +4 -0
- package/dist/components/molecules/text-input/TextInputStateless.d.ts +4 -0
- package/dist/components/molecules/text-input/TextInputStateless.js +8 -8
- package/dist/components/organisms/dialog/Dialog.css +1 -1
- package/dist/components/organisms/dialog/Dialog.d.ts +4 -0
- package/dist/components/organisms/form/Form.controller.d.ts +14 -0
- package/dist/components/organisms/form/Form.d.ts +4 -0
- package/dist/components/organisms/form/Form.helpers.d.ts +4 -0
- package/dist/components/organisms/grid/Grid.controller.d.ts +15 -0
- package/dist/components/organisms/grid/Grid.d.ts +4 -0
- package/dist/components/organisms/grid/Grid.helpers.d.ts +6 -0
- package/dist/components/organisms/grid/body/GridBody.d.ts +13 -0
- package/dist/components/organisms/grid/checkbox/GridCheckbox.d.ts +6 -0
- package/dist/components/organisms/grid/column-group/GridColumnGroup.d.ts +6 -0
- package/dist/components/organisms/grid/data-cell/GridDataCell.d.ts +4 -0
- package/dist/components/organisms/grid/grid-row/GridRow.d.ts +13 -0
- package/dist/components/organisms/grid/head/GridHead.d.ts +13 -0
- package/dist/components/organisms/grid/header-cell/HeaderCell.d.ts +5 -0
- package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.d.ts +10 -0
- package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.d.ts +10 -0
- package/dist/components/organisms/index.d.ts +5 -0
- package/dist/components/organisms/menu/Menu.d.ts +4 -0
- package/dist/components/organisms/menu/leaf/MenuLeaf.d.ts +5 -0
- package/dist/components/organisms/menu/list-item/MenuListItem.d.ts +10 -0
- package/dist/components/organisms/menu/sub-menu/SubMenu.d.ts +14 -0
- package/dist/components/organisms/tabs/Tabs.d.ts +4 -0
- package/dist/components/organisms/tabs/button/TabButton.d.ts +18 -0
- package/dist/components/organisms/tabs/content/TabContent.d.ts +8 -0
- package/dist/components/organisms/tabs/content/TabContent2.js +3 -3
- package/dist/components/organisms/tabs/edit-input/TabEditInput.d.ts +14 -0
- package/dist/components/organisms/tabs/list/TabList.d.ts +19 -0
- package/dist/enums/alert-mode.d.ts +7 -0
- package/dist/enums/button-view.d.ts +6 -0
- package/dist/enums/element-size.d.ts +8 -0
- package/dist/enums/icon-name.d.ts +284 -0
- package/dist/enums/index.d.ts +8 -0
- package/dist/enums/loader-view.d.ts +11 -0
- package/dist/enums/orientation-mode.d.ts +4 -0
- package/dist/enums/semantic-color.d.ts +7 -0
- package/dist/enums/tooltip-container.d.ts +7 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/use-auto-close/use-auto-close.d.ts +6 -0
- package/dist/hooks/use-click-outside/use-click-outside.d.ts +8 -0
- package/dist/hooks/use-container-dimensions/use-container-dimensions.d.ts +8 -0
- package/dist/hooks/use-debounce/use-debounce.d.ts +1 -0
- package/dist/hooks/use-element-ids/use-element-ids.d.ts +5 -0
- package/dist/hooks/use-is-hovered/use-is-hovered.d.ts +2 -0
- package/dist/hooks/use-is-mounted/use-is-mounted.d.ts +1 -0
- package/dist/hooks/use-is-overflow/use-is-overflow.d.ts +6 -0
- package/dist/hooks/use-key-press/use-key-press.d.ts +8 -0
- package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.d.ts +7 -0
- package/dist/hooks/use-remaining-timer/use-remaining-timer.d.ts +9 -0
- package/dist/hooks/use-reset-form-input/use-reset-form-input.d.ts +1 -0
- package/dist/hooks/use-theme/use-theme.d.ts +4 -0
- package/dist/hooks/use-tooltip-position/use-tooltip-position.d.ts +12 -0
- package/dist/hooks/use-window-dimensions/use-window-dimensions.d.ts +2 -0
- package/dist/index.d.ts +2 -917
- package/dist/index.es.js +42 -41
- package/dist/main.d.ts +8 -0
- package/dist/styles/main.css +1 -1
- package/dist/types/_common.d.ts +35 -0
- package/dist/types/accordion.d.ts +8 -0
- package/dist/types/alert.d.ts +11 -0
- package/dist/types/breadcrumbs.d.ts +10 -0
- package/dist/types/button.d.ts +11 -0
- package/dist/types/checkbox.d.ts +9 -0
- package/dist/types/dialog.d.ts +9 -0
- package/dist/types/editable-text.d.ts +12 -0
- package/dist/types/form.d.ts +18 -0
- package/dist/types/grid.d.ts +27 -0
- package/dist/types/header.d.ts +9 -0
- package/dist/types/image.d.ts +21 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/link.d.ts +9 -0
- package/dist/types/loader.d.ts +6 -0
- package/dist/types/menu.d.ts +17 -0
- package/dist/types/multi-select.d.ts +7 -0
- package/dist/types/numeric.d.ts +19 -0
- package/dist/types/search.d.ts +16 -0
- package/dist/types/select.d.ts +7 -0
- package/dist/types/switch.d.ts +13 -0
- package/dist/types/tabs.d.ts +23 -0
- package/dist/types/text.d.ts +17 -0
- package/dist/types/tooltip.d.ts +11 -0
- package/dist/utils/get-class-name.d.ts +5 -0
- package/dist/utils/handle-dropdown-list-key-press.d.ts +7 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/move-focus-on-element-by-id.d.ts +1 -0
- package/package.json +22 -18
package/README.md
CHANGED
|
@@ -2,25 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](https://github.com/ChopLogic/chop-logic-components/actions/workflows/ci.yml)
|
|
7
7
|
[](https://codecov.io/gh/ChopLogic/chop-logic-components)
|
|
8
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/ChopLogic/chop-logic-components/main)
|
|
8
9
|
[](https://sonarcloud.io/summary/new_code?id=ChopLogic_chop-logic-components)
|
|
10
|
+
[](https://biomejs.dev)
|
|
11
|
+
|
|
12
|
+
#### Deployments
|
|
13
|
+
[](https://github.com/ChopLogic/chop-logic-components/actions/workflows/github-pages.yml)
|
|
9
14
|
[](https://github.com/ChopLogic/chop-logic-components/actions/workflows/npm.yml)
|
|
15
|
+
|
|
16
|
+
#### Standards
|
|
10
17
|
[](CODE_OF_CONDUCT.md)
|
|
11
18
|
[](https://conventionalcommits.org)
|
|
12
|
-
[](https://biomejs.dev)
|
|
13
|
-
[](https://prettier.io)
|
|
14
19
|
[](https://keepachangelog.com/en/1.1.0/)
|
|
15
20
|
[](https://semver.org/spec/v2.0.0)
|
|
16
|
-
[](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` |
|
|
@@ -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);
|
|
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,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,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,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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,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,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,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,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,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,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,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,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,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[];
|