chop-logic-components 0.6.3 → 0.7.0

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 (45) hide show
  1. package/dist/__mocks__/select-values.d.ts +2 -2
  2. package/dist/components/controls/button/Button.d.ts +2 -2
  3. package/dist/components/inputs/checkbox/Checkbox.d.ts +1 -6
  4. package/dist/components/inputs/checkbox/__docs__/CheckboxExample.d.ts +1 -1
  5. package/dist/components/inputs/checkbox/types.d.ts +6 -0
  6. package/dist/components/inputs/multi-select/MultiSelect.d.ts +1 -13
  7. package/dist/components/inputs/multi-select/__docs__/MultiSelectExample.d.ts +1 -1
  8. package/dist/components/inputs/multi-select/elements/Combobox.d.ts +1 -1
  9. package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +2 -9
  10. package/dist/components/inputs/multi-select/elements/Option.d.ts +1 -1
  11. package/dist/components/inputs/multi-select/types.d.ts +20 -0
  12. package/dist/components/inputs/select/Select.d.ts +1 -12
  13. package/dist/components/inputs/select/__docs__/SelectExample.d.ts +1 -1
  14. package/dist/components/inputs/select/elements/Combobox.d.ts +1 -1
  15. package/dist/components/inputs/select/elements/Dropdown.d.ts +1 -1
  16. package/dist/components/inputs/select/elements/Option.d.ts +1 -1
  17. package/dist/components/inputs/select/types.d.ts +12 -0
  18. package/dist/components/inputs/text/TextInput.d.ts +1 -7
  19. package/dist/components/inputs/text/__docs__/TextInputExample.d.ts +1 -1
  20. package/dist/components/inputs/text/types.d.ts +7 -0
  21. package/dist/components/modals/alert/Alert.d.ts +4 -0
  22. package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +9 -0
  23. package/dist/components/modals/alert/__docs__/AlertExample.d.ts +2 -0
  24. package/dist/components/modals/alert/__tests__/Alert.test.d.ts +1 -0
  25. package/dist/components/modals/alert/elements/Header.d.ts +10 -0
  26. package/dist/components/modals/alert/helpers/get-alert-icon.d.ts +4 -0
  27. package/dist/components/modals/alert/helpers/get-alert-title.d.ts +3 -0
  28. package/dist/components/modals/alert/types.d.ts +8 -0
  29. package/dist/components/modals/dialog/Dialog.d.ts +1 -6
  30. package/dist/components/modals/dialog/__docs__/DialogExample.d.ts +1 -1
  31. package/dist/components/modals/dialog/types.d.ts +7 -0
  32. package/dist/components/modals/tooltip/Tooltip.d.ts +1 -7
  33. package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +1 -1
  34. package/dist/components/modals/tooltip/types.d.ts +8 -0
  35. package/dist/enums/icon.d.ts +6 -1
  36. package/dist/index.cjs.js +23 -23
  37. package/dist/index.cjs.js.map +1 -1
  38. package/dist/index.d.ts +0 -1
  39. package/dist/index.es.js +359 -350
  40. package/dist/index.es.js.map +1 -1
  41. package/dist/style.css +1 -1
  42. package/package.json +11 -11
  43. package/dist/styles/index.d.ts +0 -1
  44. /package/dist/components/elements/__tests__/{error-message.test.d.ts → ErrorMessage.test.d.ts} +0 -0
  45. /package/dist/components/elements/__tests__/{label.test.d.ts → Label.test.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import { SelectValue } from '../../../../../../../src/components/inputs/select/Select';
2
- import { MultiSelectValue } from '../../../../../../../src/components/inputs/multi-select/MultiSelect';
1
+ import { SelectValue } from '../../../../../../../src/components/inputs/select/types';
2
+ import { MultiSelectValue } from '../../../../../../../src/components/inputs/multi-select/types';
3
3
 
4
4
  export declare const SELECT_LANGUAGES: SelectValue[];
5
5
  export declare const MULTI_SELECT_VALUES: MultiSelectValue[];
@@ -1,5 +1,5 @@
1
1
  import { ChopLogicButtonProps } from './types';
2
2
  import { default as React } from 'react';
3
3
 
4
- declare const Button: React.FC<ChopLogicButtonProps>;
5
- export default Button;
4
+ declare const ChopLogicButton: React.FC<ChopLogicButtonProps>;
5
+ export default ChopLogicButton;
@@ -1,10 +1,5 @@
1
+ import { ChopLogicCheckboxProps } from './types';
1
2
  import { default as React } from 'react';
2
3
 
3
- export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
- id: string;
5
- name: string;
6
- label: string;
7
- isLabelHidden?: boolean;
8
- };
9
4
  declare const ChopLogicCheckbox: React.FC<ChopLogicCheckboxProps>;
10
5
  export default ChopLogicCheckbox;
@@ -1,4 +1,4 @@
1
- import { ChopLogicCheckboxProps } from '../Checkbox';
1
+ import { ChopLogicCheckboxProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicCheckboxProps>;
@@ -0,0 +1,6 @@
1
+ export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
2
+ id: string;
3
+ name: string;
4
+ label: string;
5
+ isLabelHidden?: boolean;
6
+ };
@@ -1,16 +1,4 @@
1
+ import { ChopLogicMultiSelectProps } from './types';
1
2
 
2
- export type ChopLogicMultiSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
3
- id: string;
4
- name: string;
5
- label: string;
6
- values: MultiSelectValue[];
7
- onSelectChange?: (values?: MultiSelectValue[]) => void;
8
- placeholder?: string;
9
- };
10
- export type MultiSelectValue = {
11
- id: string;
12
- label: string;
13
- selected: boolean;
14
- };
15
3
  declare const ChopLogicMultiSelect: React.FC<ChopLogicMultiSelectProps>;
16
4
  export default ChopLogicMultiSelect;
@@ -1,4 +1,4 @@
1
- import { ChopLogicMultiSelectProps } from '../MultiSelect';
1
+ import { ChopLogicMultiSelectProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicMultiSelectProps>;
@@ -1,4 +1,4 @@
1
- import { MultiSelectValue } from '../MultiSelect';
1
+ import { MultiSelectValue } from '../types';
2
2
 
3
3
  type SelectComboboxProps = {
4
4
  isOpened: boolean;
@@ -1,11 +1,4 @@
1
- import { MultiSelectValue } from '../MultiSelect';
1
+ import { MultiSelectDropdownProps } from '../types';
2
2
 
3
- type SelectDropdownProps = {
4
- values: MultiSelectValue[];
5
- isOpened: boolean;
6
- dropdownId: string;
7
- onClose: () => void;
8
- onSelect: (id: string) => void;
9
- };
10
- declare const SelectDropdown: React.FC<SelectDropdownProps>;
3
+ declare const SelectDropdown: React.FC<MultiSelectDropdownProps>;
11
4
  export default SelectDropdown;
@@ -1,4 +1,4 @@
1
- import { MultiSelectValue } from '../MultiSelect';
1
+ import { MultiSelectValue } from '../types';
2
2
 
3
3
  type SelectOptionProps = {
4
4
  value: MultiSelectValue;
@@ -0,0 +1,20 @@
1
+ export type MultiSelectValue = {
2
+ id: string;
3
+ label: string;
4
+ selected: boolean;
5
+ };
6
+ export type ChopLogicMultiSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
7
+ id: string;
8
+ name: string;
9
+ label: string;
10
+ values: MultiSelectValue[];
11
+ onSelectChange?: (values?: MultiSelectValue[]) => void;
12
+ placeholder?: string;
13
+ };
14
+ export type MultiSelectDropdownProps = {
15
+ values: MultiSelectValue[];
16
+ isOpened: boolean;
17
+ dropdownId: string;
18
+ onClose: () => void;
19
+ onSelect: (id: string) => void;
20
+ };
@@ -1,15 +1,4 @@
1
+ import { ChopLogicSelectProps } from './types';
1
2
 
2
- export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
3
- id: string;
4
- name: string;
5
- label: string;
6
- values: SelectValue[];
7
- onSelectChange?: (value?: SelectValue) => void;
8
- placeholder?: string;
9
- };
10
- export type SelectValue = {
11
- id: string;
12
- label: string;
13
- };
14
3
  declare const ChopLogicSelect: React.FC<ChopLogicSelectProps>;
15
4
  export default ChopLogicSelect;
@@ -1,4 +1,4 @@
1
- import { ChopLogicSelectProps } from '../Select';
1
+ import { ChopLogicSelectProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicSelectProps>;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../Select';
1
+ import { SelectValue } from '../types';
2
2
 
3
3
  type SelectComboboxProps = {
4
4
  isOpened: boolean;
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../Select';
1
+ import { SelectValue } from '../types';
2
2
 
3
3
  type SelectDropdownProps = {
4
4
  values: SelectValue[];
@@ -1,4 +1,4 @@
1
- import { SelectValue } from '../Select';
1
+ import { SelectValue } from '../types';
2
2
 
3
3
  type SelectOptionProps = {
4
4
  value: SelectValue;
@@ -0,0 +1,12 @@
1
+ export type ChopLogicSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
2
+ id: string;
3
+ name: string;
4
+ label: string;
5
+ values: SelectValue[];
6
+ onSelectChange?: (value?: SelectValue) => void;
7
+ placeholder?: string;
8
+ };
9
+ export type SelectValue = {
10
+ id: string;
11
+ label: string;
12
+ };
@@ -1,11 +1,5 @@
1
+ import { ChopLogicTextInputProps } from './types';
1
2
  import { default as React } from 'react';
2
3
 
3
- export type ChopLogicTextInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
- id: string;
5
- name: string;
6
- label: string;
7
- valid?: boolean;
8
- errorMessage?: string;
9
- };
10
4
  declare const TextInput: React.FC<ChopLogicTextInputProps>;
11
5
  export default TextInput;
@@ -1,4 +1,4 @@
1
- import { ChopLogicTextInputProps } from '../TextInput';
1
+ import { ChopLogicTextInputProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicTextInputProps>;
@@ -0,0 +1,7 @@
1
+ export type ChopLogicTextInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
2
+ id: string;
3
+ name: string;
4
+ label: string;
5
+ valid?: boolean;
6
+ errorMessage?: string;
7
+ };
@@ -0,0 +1,4 @@
1
+ import { ChopLogicAlertProps } from './types';
2
+
3
+ declare const ChopLogicAlert: React.FC<ChopLogicAlertProps>;
4
+ export default ChopLogicAlert;
@@ -0,0 +1,9 @@
1
+ import { ChopLogicAlertProps } from '../types';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import { default as React } from 'react';
4
+
5
+ declare const ExampleComponent: React.FC<ChopLogicAlertProps>;
6
+ declare const meta: Meta<typeof ExampleComponent>;
7
+ export default meta;
8
+ type Story = StoryObj<typeof ExampleComponent>;
9
+ export declare const Default: Story;
@@ -0,0 +1,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -0,0 +1,10 @@
1
+ import { ChopLogicAlertMode } from '../types';
2
+ import { default as React } from 'react';
3
+
4
+ type ChopLogicAlertHeaderProps = {
5
+ onClose: () => void;
6
+ title?: string;
7
+ mode: ChopLogicAlertMode;
8
+ };
9
+ declare const ChopLogicAlertHeader: React.FC<ChopLogicAlertHeaderProps>;
10
+ export default ChopLogicAlertHeader;
@@ -0,0 +1,4 @@
1
+ import { ChopLogicAlertMode } from '../types';
2
+ import { Icon } from '../../../../../../../../../../src/enums/icon';
3
+
4
+ export declare function getAlertIcon(mode: ChopLogicAlertMode): Icon;
@@ -0,0 +1,3 @@
1
+ import { ChopLogicAlertMode } from '../types';
2
+
3
+ export declare function getAlertTitle(mode: ChopLogicAlertMode, title?: string): string;
@@ -0,0 +1,8 @@
1
+ export type ChopLogicAlertMode = 'success' | 'error' | 'warning' | 'info' | 'help';
2
+ export type ChopLogicAlertProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ isOpened: boolean;
4
+ onClose: () => void;
5
+ message: string;
6
+ title?: string;
7
+ mode?: ChopLogicAlertMode;
8
+ };
@@ -1,9 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ChopLogicModalProps } from './types';
2
2
 
3
- export type ChopLogicModalProps = PropsWithChildren & React.HTMLAttributes<HTMLDivElement> & {
4
- isOpened: boolean;
5
- onClose: () => void;
6
- title: string;
7
- };
8
3
  declare const ChopLogicDialog: React.FC<ChopLogicModalProps>;
9
4
  export default ChopLogicDialog;
@@ -1,4 +1,4 @@
1
- import { ChopLogicModalProps } from '../Dialog';
1
+ import { ChopLogicModalProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const Example: React.FC<ChopLogicModalProps>;
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ export type ChopLogicModalProps = PropsWithChildren & React.HTMLAttributes<HTMLDivElement> & {
4
+ isOpened: boolean;
5
+ onClose: () => void;
6
+ title: string;
7
+ };
@@ -1,10 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ChopLogicTooltipProps } from './types';
2
2
 
3
- export type ChopLogicTooltipProps = PropsWithChildren & React.HTMLAttributes<HTMLElement> & {
4
- tooltipContent: string | React.ReactElement;
5
- id: string;
6
- containerTag?: 'span' | 'div' | 'p' | 'strong' | 'em';
7
- visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
8
- };
9
3
  declare const ChopLogicTooltip: React.FC<ChopLogicTooltipProps>;
10
4
  export default ChopLogicTooltip;
@@ -1,4 +1,4 @@
1
- import { ChopLogicTooltipProps } from '../Tooltip';
1
+ import { ChopLogicTooltipProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const TooltipExample: React.FC<ChopLogicTooltipProps>;
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ export type ChopLogicTooltipProps = PropsWithChildren & React.HTMLAttributes<HTMLElement> & {
4
+ tooltipContent: string | React.ReactElement;
5
+ id: string;
6
+ containerTag?: 'span' | 'div' | 'p' | 'strong' | 'em';
7
+ visibleOn?: 'hover' | 'click' | 'focus' | 'contextmenu';
8
+ };
@@ -43,5 +43,10 @@ export declare enum Icon {
43
43
  Paste = "cl-icon__paste",
44
44
  Cut = "cl-icon__scissors",
45
45
  Reset = "cl-icon__trash",
46
- Clear = "cl-icon__cross"
46
+ Clear = "cl-icon__cross",
47
+ Support = "cl-icon__support",
48
+ Bomb = "cl-icon__bomb",
49
+ Quill = "cl-icon__quill",
50
+ Warning = "cl-icon__warning",
51
+ Notification = "cl-icon__notification"
47
52
  }