chop-logic-components 0.6.1 → 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.
- package/dist/__mocks__/select-values.d.ts +2 -2
- package/dist/components/controls/button/Button.d.ts +4 -12
- package/dist/components/controls/button/__docs__/Button.stories.d.ts +5 -1
- package/dist/components/controls/button/__docs__/ButtonExample.d.ts +1 -1
- package/dist/components/controls/button/types.d.ts +12 -0
- package/dist/components/inputs/checkbox/Checkbox.d.ts +3 -8
- package/dist/components/inputs/checkbox/__docs__/CheckboxExample.d.ts +1 -1
- package/dist/components/inputs/checkbox/types.d.ts +6 -0
- package/dist/components/inputs/multi-select/MultiSelect.d.ts +1 -13
- package/dist/components/inputs/multi-select/__docs__/MultiSelectExample.d.ts +1 -1
- package/dist/components/inputs/multi-select/elements/Combobox.d.ts +1 -1
- package/dist/components/inputs/multi-select/elements/Dropdown.d.ts +2 -9
- package/dist/components/inputs/multi-select/elements/Option.d.ts +1 -1
- package/dist/components/inputs/multi-select/types.d.ts +20 -0
- package/dist/components/inputs/select/Select.d.ts +1 -12
- package/dist/components/inputs/select/__docs__/SelectExample.d.ts +1 -1
- package/dist/components/inputs/select/elements/Combobox.d.ts +1 -1
- package/dist/components/inputs/select/elements/Dropdown.d.ts +1 -1
- package/dist/components/inputs/select/elements/Option.d.ts +1 -1
- package/dist/components/inputs/select/types.d.ts +12 -0
- package/dist/components/inputs/text/TextInput.d.ts +1 -7
- package/dist/components/inputs/text/__docs__/TextInputExample.d.ts +1 -1
- package/dist/components/inputs/text/types.d.ts +7 -0
- package/dist/components/modals/alert/Alert.d.ts +4 -0
- package/dist/components/modals/alert/__docs__/Alert.stories.d.ts +9 -0
- package/dist/components/modals/alert/__docs__/AlertExample.d.ts +2 -0
- package/dist/components/modals/alert/__tests__/Alert.test.d.ts +1 -0
- package/dist/components/modals/alert/elements/Header.d.ts +10 -0
- package/dist/components/modals/alert/helpers/get-alert-icon.d.ts +4 -0
- package/dist/components/modals/alert/helpers/get-alert-title.d.ts +3 -0
- package/dist/components/modals/alert/types.d.ts +8 -0
- package/dist/components/modals/dialog/Dialog.d.ts +1 -6
- package/dist/components/modals/dialog/__docs__/DialogExample.d.ts +1 -1
- package/dist/components/modals/dialog/types.d.ts +7 -0
- package/dist/components/modals/tooltip/Tooltip.d.ts +1 -7
- package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +4 -4
- package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +1 -1
- package/dist/components/modals/tooltip/types.d.ts +8 -0
- package/dist/enums/icon.d.ts +50 -45
- package/dist/index.cjs.js +44 -44
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4893 -4945
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +11 -11
- /package/dist/components/elements/__tests__/{error-message.test.d.ts → ErrorMessage.test.d.ts} +0 -0
- /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/
|
|
2
|
-
import { MultiSelectValue } from '../../../../../../../src/components/inputs/multi-select/
|
|
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,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { default as React
|
|
1
|
+
import { ChopLogicButtonProps } from './types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
|
|
7
|
-
view?: 'primary' | 'secondary' | 'danger' | 'icon';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
icon?: Icon;
|
|
10
|
-
label?: string;
|
|
11
|
-
};
|
|
12
|
-
declare const Button: React.FC<ChopLogicButtonProps>;
|
|
13
|
-
export default Button;
|
|
4
|
+
declare const ChopLogicButton: React.FC<ChopLogicButtonProps>;
|
|
5
|
+
export default ChopLogicButton;
|
|
@@ -4,4 +4,8 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
4
4
|
declare const meta: Meta<typeof ButtonExample>;
|
|
5
5
|
export default meta;
|
|
6
6
|
type Story = StoryObj<typeof ButtonExample>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const PrimaryButton: Story;
|
|
8
|
+
export declare const SecondaryButton: Story;
|
|
9
|
+
export declare const DangerButton: Story;
|
|
10
|
+
export declare const IconButton: Story;
|
|
11
|
+
export declare const DisabledButton: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
import { Icon } from '../../../../../../../../../src/enums/icon';
|
|
3
|
+
|
|
4
|
+
export type ChopLogicButtonView = 'primary' | 'secondary' | 'danger' | 'icon';
|
|
5
|
+
export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
text?: string;
|
|
7
|
+
onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
|
|
8
|
+
view?: ChopLogicButtonView;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon?: Icon;
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
+
import { ChopLogicCheckboxProps } from './types';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name: string;
|
|
6
|
-
label: string;
|
|
7
|
-
isLabelHidden?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const Checkbox: React.FC<ChopLogicCheckboxProps>;
|
|
10
|
-
export default Checkbox;
|
|
4
|
+
declare const ChopLogicCheckbox: React.FC<ChopLogicCheckboxProps>;
|
|
5
|
+
export default ChopLogicCheckbox;
|
|
@@ -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,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MultiSelectDropdownProps } from '../types';
|
|
2
2
|
|
|
3
|
-
|
|
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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,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 {
|
|
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,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
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;
|
|
@@ -4,7 +4,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
|
|
4
4
|
declare const meta: Meta<typeof TooltipExample>;
|
|
5
5
|
export default meta;
|
|
6
6
|
type Story = StoryObj<typeof TooltipExample>;
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
7
|
+
export declare const VisibleOnHover: Story;
|
|
8
|
+
export declare const VisibleOnClick: Story;
|
|
9
|
+
export declare const VisibleOnFocus: Story;
|
|
10
|
+
export declare const VisibleOnContextMenu: Story;
|
|
@@ -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
|
+
};
|
package/dist/enums/icon.d.ts
CHANGED
|
@@ -1,47 +1,52 @@
|
|
|
1
1
|
export declare enum Icon {
|
|
2
|
-
CheckMark = "
|
|
3
|
-
Home = "
|
|
4
|
-
Menu = "
|
|
5
|
-
Enlarge = "
|
|
6
|
-
Shrink = "
|
|
7
|
-
Settings = "
|
|
8
|
-
Delete = "
|
|
9
|
-
Up = "
|
|
10
|
-
Down = "
|
|
11
|
-
Right = "
|
|
12
|
-
Left = "
|
|
13
|
-
Sound = "
|
|
14
|
-
NoSound = "
|
|
15
|
-
LightMode = "
|
|
16
|
-
DarkMode = "
|
|
17
|
-
Cancel = "
|
|
18
|
-
Sidebar = "
|
|
19
|
-
Telegram = "
|
|
20
|
-
Github = "
|
|
21
|
-
Mail = "
|
|
22
|
-
Propositions = "
|
|
23
|
-
Resolution = "
|
|
24
|
-
Predicates = "
|
|
25
|
-
TruthTables = "
|
|
26
|
-
Syllogisms = "
|
|
27
|
-
English = "
|
|
28
|
-
Russian = "
|
|
29
|
-
Required = "
|
|
30
|
-
Checked = "
|
|
31
|
-
Unchecked = "
|
|
32
|
-
Info = "
|
|
33
|
-
LinkedIn = "
|
|
34
|
-
File = "
|
|
35
|
-
Files = "
|
|
36
|
-
Facebook = "
|
|
37
|
-
CaretUp = "
|
|
38
|
-
CaretDown = "
|
|
39
|
-
SavePDF = "
|
|
40
|
-
ExportXML = "
|
|
41
|
-
ImportXML = "
|
|
42
|
-
Copy = "
|
|
43
|
-
Paste = "
|
|
44
|
-
Cut = "
|
|
45
|
-
Reset = "
|
|
46
|
-
Clear = "
|
|
2
|
+
CheckMark = "cl-icon__check",
|
|
3
|
+
Home = "cl-icon__home",
|
|
4
|
+
Menu = "cl-icon__menu",
|
|
5
|
+
Enlarge = "cl-icon__enlarge2",
|
|
6
|
+
Shrink = "cl-icon__shrink2",
|
|
7
|
+
Settings = "cl-icon__cog",
|
|
8
|
+
Delete = "cl-icon__bin2",
|
|
9
|
+
Up = "cl-icon__circle-up",
|
|
10
|
+
Down = "cl-icon__circle-down",
|
|
11
|
+
Right = "cl-icon__circle-right",
|
|
12
|
+
Left = "cl-icon__circle-left",
|
|
13
|
+
Sound = "cl-icon__volume-medium",
|
|
14
|
+
NoSound = "cl-icon__volume-mute2",
|
|
15
|
+
LightMode = "cl-icon__sun",
|
|
16
|
+
DarkMode = "cl-icon__contrast",
|
|
17
|
+
Cancel = "cl-icon__close",
|
|
18
|
+
Sidebar = "cl-icon__magic-wand",
|
|
19
|
+
Telegram = "cl-icon__telegram",
|
|
20
|
+
Github = "cl-icon__github",
|
|
21
|
+
Mail = "cl-icon__mail4",
|
|
22
|
+
Propositions = "cl-icon__cube",
|
|
23
|
+
Resolution = "cl-icon__libreoffice",
|
|
24
|
+
Predicates = "cl-icon__cubes",
|
|
25
|
+
TruthTables = "cl-icon__delicious",
|
|
26
|
+
Syllogisms = "cl-icon__dice",
|
|
27
|
+
English = "cl-icon__english-lang",
|
|
28
|
+
Russian = "cl-icon__russian-lang",
|
|
29
|
+
Required = "cl-icon__fire",
|
|
30
|
+
Checked = "cl-icon__checkbox-checked",
|
|
31
|
+
Unchecked = "cl-icon__checkbox-unchecked",
|
|
32
|
+
Info = "cl-icon__exclamation-triangle",
|
|
33
|
+
LinkedIn = "cl-icon__linkedin-square",
|
|
34
|
+
File = "cl-icon__file-empty",
|
|
35
|
+
Files = "cl-icon__files-empty",
|
|
36
|
+
Facebook = "cl-icon__facebook2",
|
|
37
|
+
CaretUp = "cl-icon__caret-up",
|
|
38
|
+
CaretDown = "cl-icon__caret-down",
|
|
39
|
+
SavePDF = "cl-icon__file-pdf",
|
|
40
|
+
ExportXML = "cl-icon__download",
|
|
41
|
+
ImportXML = "cl-icon__upload",
|
|
42
|
+
Copy = "cl-icon__copy",
|
|
43
|
+
Paste = "cl-icon__paste",
|
|
44
|
+
Cut = "cl-icon__scissors",
|
|
45
|
+
Reset = "cl-icon__trash",
|
|
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
|
}
|