chop-logic-components 0.6.0 → 0.6.3
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/components/controls/button/Button.d.ts +2 -10
- package/dist/components/controls/button/__docs__/Button.stories.d.ts +8 -4
- package/dist/components/controls/button/__docs__/ButtonExample.d.ts +1 -1
- package/dist/components/controls/button/types.d.ts +12 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/checkbox/Checkbox.d.ts +2 -2
- package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +3 -3
- package/dist/components/inputs/multi-select/__docs__/MultiSelect.stories.d.ts +3 -3
- package/dist/components/inputs/select/__docs__/Select.stories.d.ts +3 -3
- package/dist/components/inputs/text/__docs__/TextInput.stories.d.ts +3 -3
- package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +3 -3
- package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +4 -4
- package/dist/enums/icon.d.ts +45 -45
- package/dist/hooks/use-click-outside/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-click-outside/__docs__/useClickOutside.stories.d.ts +8 -0
- package/dist/hooks/use-container-dimensions/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.stories.d.ts +8 -0
- package/dist/hooks/{use-container-dimensions.d.ts → use-container-dimensions/index.d.ts} +2 -2
- package/dist/hooks/use-key-press/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-key-press/__docs__/useKeyPress.stories.d.ts +8 -0
- package/dist/hooks/use-modal-focus-trap/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.stories.d.ts +8 -0
- package/dist/hooks/use-mount/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-mount/__docs__/useMount.stories.d.ts +8 -0
- package/dist/hooks/use-mount/__tests__/use-mount.test.d.ts +1 -0
- package/dist/hooks/use-tooltip-position/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.stories.d.ts +8 -0
- package/dist/hooks/use-window-dimensions/__docs__/Example.d.ts +2 -0
- package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.stories.d.ts +8 -0
- package/dist/hooks/use-window-dimensions/__tests__/use-window-dimensions.test.d.ts +1 -0
- package/dist/index.cjs.js +52 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +7083 -7012
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/index.d.ts +1 -0
- package/package.json +11 -11
- /package/dist/{hooks/__tests__/use-click-outside.test.d.ts → components/elements/__tests__/error-message.test.d.ts} +0 -0
- /package/dist/{hooks/__tests__/use-key-press.test.d.ts → components/elements/__tests__/label.test.d.ts} +0 -0
- /package/dist/hooks/{__tests__/use-modal-focus.test.d.ts → use-click-outside/__tests__/use-click-outside.test.d.ts} +0 -0
- /package/dist/hooks/{use-click-outside.d.ts → use-click-outside/index.d.ts} +0 -0
- /package/dist/hooks/{__tests__/use-mount.test.d.ts → use-key-press/__tests__/use-key-press.test.d.ts} +0 -0
- /package/dist/hooks/{use-key-press.d.ts → use-key-press/index.d.ts} +0 -0
- /package/dist/hooks/{__tests__/use-window-dimensions.test.d.ts → use-modal-focus-trap/__tests__/use-modal-focus-trap.test.d.ts} +0 -0
- /package/dist/hooks/{use-modal-focus-trap.d.ts → use-modal-focus-trap/index.d.ts} +0 -0
- /package/dist/hooks/{use-mount.d.ts → use-mount/index.d.ts} +0 -0
- /package/dist/hooks/{use-tooltip-position.d.ts → use-tooltip-position/index.d.ts} +0 -0
- /package/dist/hooks/{use-window-dimensions.d.ts → use-window-dimensions/index.d.ts} +0 -0
|
@@ -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
|
-
export type ChopLogicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
-
text?: string;
|
|
6
|
-
onClick?: MouseEventHandler<HTMLButtonElement> | (() => void);
|
|
7
|
-
view?: 'primary' | 'secondary' | 'danger' | 'icon';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
icon?: Icon;
|
|
10
|
-
label?: string;
|
|
11
|
-
};
|
|
12
4
|
declare const Button: React.FC<ChopLogicButtonProps>;
|
|
13
5
|
export default Button;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as ButtonExample } from './ButtonExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof ButtonExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
7
|
-
export declare const
|
|
6
|
+
type Story = StoryObj<typeof ButtonExample>;
|
|
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,6 +1,7 @@
|
|
|
1
1
|
export { default as ChopLogicButton } from './controls/button/Button';
|
|
2
2
|
export { default as ChopLogicTextInput } from './inputs/text/TextInput';
|
|
3
3
|
export { default as ChopLogicSelect } from './inputs/select/Select';
|
|
4
|
+
export { default as ChopLogicMultiSelect } from './inputs/multi-select/MultiSelect';
|
|
4
5
|
export { default as ChopLogicCheckbox } from './inputs/checkbox/Checkbox';
|
|
5
6
|
export { default as ChopLogicDialog } from './modals/dialog/Dialog';
|
|
6
7
|
export { default as ChopLogicTooltip } from './modals/tooltip/Tooltip';
|
|
@@ -6,5 +6,5 @@ export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement>
|
|
|
6
6
|
label: string;
|
|
7
7
|
isLabelHidden?: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const ChopLogicCheckbox: React.FC<ChopLogicCheckboxProps>;
|
|
10
|
+
export default ChopLogicCheckbox;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as CheckboxExample } from './CheckboxExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof CheckboxExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
6
|
+
type Story = StoryObj<typeof CheckboxExample>;
|
|
7
7
|
export declare const Default: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as MultiSelectExample } from './MultiSelectExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof MultiSelectExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
6
|
+
type Story = StoryObj<typeof MultiSelectExample>;
|
|
7
7
|
export declare const Default: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as SelectExample } from './SelectExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof SelectExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
6
|
+
type Story = StoryObj<typeof SelectExample>;
|
|
7
7
|
export declare const Default: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as TextInputExample } from './TextInputExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof TextInputExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
6
|
+
type Story = StoryObj<typeof TextInputExample>;
|
|
7
7
|
export declare const Default: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as DialogExample } from './DialogExample';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
declare const meta: Meta<typeof
|
|
4
|
+
declare const meta: Meta<typeof DialogExample>;
|
|
5
5
|
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof
|
|
6
|
+
type Story = StoryObj<typeof DialogExample>;
|
|
7
7
|
export declare const Default: Story;
|
|
@@ -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;
|
package/dist/enums/icon.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
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
47
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dimensions } from '
|
|
1
|
+
import { Dimensions } from '../use-window-dimensions';
|
|
2
2
|
|
|
3
3
|
type useContainerDimensionsParams = {
|
|
4
|
-
ref: React.RefObject<
|
|
4
|
+
ref: React.RefObject<HTMLElement>;
|
|
5
5
|
isVisible?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const useContainerDimensions: ({ ref, isVisible }: useContainerDimensionsParams) => Dimensions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleModal: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleModal>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleModal>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const ExampleComponent: React.FC;
|
|
5
|
+
declare const meta: Meta<typeof ExampleComponent>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof ExampleComponent>;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|