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.
Files changed (49) hide show
  1. package/dist/components/controls/button/Button.d.ts +2 -10
  2. package/dist/components/controls/button/__docs__/Button.stories.d.ts +8 -4
  3. package/dist/components/controls/button/__docs__/ButtonExample.d.ts +1 -1
  4. package/dist/components/controls/button/types.d.ts +12 -0
  5. package/dist/components/index.d.ts +1 -0
  6. package/dist/components/inputs/checkbox/Checkbox.d.ts +2 -2
  7. package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +3 -3
  8. package/dist/components/inputs/multi-select/__docs__/MultiSelect.stories.d.ts +3 -3
  9. package/dist/components/inputs/select/__docs__/Select.stories.d.ts +3 -3
  10. package/dist/components/inputs/text/__docs__/TextInput.stories.d.ts +3 -3
  11. package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +3 -3
  12. package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +4 -4
  13. package/dist/enums/icon.d.ts +45 -45
  14. package/dist/hooks/use-click-outside/__docs__/Example.d.ts +2 -0
  15. package/dist/hooks/use-click-outside/__docs__/useClickOutside.stories.d.ts +8 -0
  16. package/dist/hooks/use-container-dimensions/__docs__/Example.d.ts +2 -0
  17. package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.stories.d.ts +8 -0
  18. package/dist/hooks/{use-container-dimensions.d.ts → use-container-dimensions/index.d.ts} +2 -2
  19. package/dist/hooks/use-key-press/__docs__/Example.d.ts +2 -0
  20. package/dist/hooks/use-key-press/__docs__/useKeyPress.stories.d.ts +8 -0
  21. package/dist/hooks/use-modal-focus-trap/__docs__/Example.d.ts +2 -0
  22. package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.stories.d.ts +8 -0
  23. package/dist/hooks/use-mount/__docs__/Example.d.ts +2 -0
  24. package/dist/hooks/use-mount/__docs__/useMount.stories.d.ts +8 -0
  25. package/dist/hooks/use-mount/__tests__/use-mount.test.d.ts +1 -0
  26. package/dist/hooks/use-tooltip-position/__docs__/Example.d.ts +2 -0
  27. package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.stories.d.ts +8 -0
  28. package/dist/hooks/use-window-dimensions/__docs__/Example.d.ts +2 -0
  29. package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.stories.d.ts +8 -0
  30. package/dist/hooks/use-window-dimensions/__tests__/use-window-dimensions.test.d.ts +1 -0
  31. package/dist/index.cjs.js +52 -52
  32. package/dist/index.cjs.js.map +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.es.js +7083 -7012
  35. package/dist/index.es.js.map +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/styles/index.d.ts +1 -0
  38. package/package.json +11 -11
  39. /package/dist/{hooks/__tests__/use-click-outside.test.d.ts → components/elements/__tests__/error-message.test.d.ts} +0 -0
  40. /package/dist/{hooks/__tests__/use-key-press.test.d.ts → components/elements/__tests__/label.test.d.ts} +0 -0
  41. /package/dist/hooks/{__tests__/use-modal-focus.test.d.ts → use-click-outside/__tests__/use-click-outside.test.d.ts} +0 -0
  42. /package/dist/hooks/{use-click-outside.d.ts → use-click-outside/index.d.ts} +0 -0
  43. /package/dist/hooks/{__tests__/use-mount.test.d.ts → use-key-press/__tests__/use-key-press.test.d.ts} +0 -0
  44. /package/dist/hooks/{use-key-press.d.ts → use-key-press/index.d.ts} +0 -0
  45. /package/dist/hooks/{__tests__/use-window-dimensions.test.d.ts → use-modal-focus-trap/__tests__/use-modal-focus-trap.test.d.ts} +0 -0
  46. /package/dist/hooks/{use-modal-focus-trap.d.ts → use-modal-focus-trap/index.d.ts} +0 -0
  47. /package/dist/hooks/{use-mount.d.ts → use-mount/index.d.ts} +0 -0
  48. /package/dist/hooks/{use-tooltip-position.d.ts → use-tooltip-position/index.d.ts} +0 -0
  49. /package/dist/hooks/{use-window-dimensions.d.ts → use-window-dimensions/index.d.ts} +0 -0
@@ -1,13 +1,5 @@
1
- import { Icon } from '../../../../../../../../../src/enums/icon';
2
- import { default as React, MouseEventHandler } from '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 ExampleButton } from './ButtonExample';
1
+ import { default as ButtonExample } from './ButtonExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof ExampleButton>;
4
+ declare const meta: Meta<typeof ButtonExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof ExampleButton>;
7
- export declare const Primary: Story;
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;
@@ -1,4 +1,4 @@
1
- import { ChopLogicButtonProps } from '../Button';
1
+ import { ChopLogicButtonProps } from '../types';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  declare const ExampleButton: React.FC<ChopLogicButtonProps>;
@@ -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 Checkbox: React.FC<ChopLogicCheckboxProps>;
10
- export default Checkbox;
9
+ declare const ChopLogicCheckbox: React.FC<ChopLogicCheckboxProps>;
10
+ export default ChopLogicCheckbox;
@@ -1,7 +1,7 @@
1
- import { default as Example } from './CheckboxExample';
1
+ import { default as CheckboxExample } from './CheckboxExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof Example>;
4
+ declare const meta: Meta<typeof CheckboxExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof Example>;
6
+ type Story = StoryObj<typeof CheckboxExample>;
7
7
  export declare const Default: Story;
@@ -1,7 +1,7 @@
1
- import { default as Example } from './MultiSelectExample';
1
+ import { default as MultiSelectExample } from './MultiSelectExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof Example>;
4
+ declare const meta: Meta<typeof MultiSelectExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof Example>;
6
+ type Story = StoryObj<typeof MultiSelectExample>;
7
7
  export declare const Default: Story;
@@ -1,7 +1,7 @@
1
- import { default as Example } from './SelectExample';
1
+ import { default as SelectExample } from './SelectExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof Example>;
4
+ declare const meta: Meta<typeof SelectExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof Example>;
6
+ type Story = StoryObj<typeof SelectExample>;
7
7
  export declare const Default: Story;
@@ -1,7 +1,7 @@
1
- import { default as Example } from './TextInputExample';
1
+ import { default as TextInputExample } from './TextInputExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof Example>;
4
+ declare const meta: Meta<typeof TextInputExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof Example>;
6
+ type Story = StoryObj<typeof TextInputExample>;
7
7
  export declare const Default: Story;
@@ -1,7 +1,7 @@
1
- import { default as Example } from './DialogExample';
1
+ import { default as DialogExample } from './DialogExample';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
 
4
- declare const meta: Meta<typeof Example>;
4
+ declare const meta: Meta<typeof DialogExample>;
5
5
  export default meta;
6
- type Story = StoryObj<typeof Example>;
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 Default: Story;
8
- export declare const ClickToShow: Story;
9
- export declare const FocusToShow: Story;
10
- export declare const ContextMenuToShow: Story;
7
+ export declare const VisibleOnHover: Story;
8
+ export declare const VisibleOnClick: Story;
9
+ export declare const VisibleOnFocus: Story;
10
+ export declare const VisibleOnContextMenu: Story;
@@ -1,47 +1,47 @@
1
1
  export declare enum Icon {
2
- CheckMark = "chop-icon__check",
3
- Home = "chop-icon__home",
4
- Menu = "chop-icon__menu",
5
- Enlarge = "chop-icon__enlarge2",
6
- Shrink = "chop-icon__shrink2",
7
- Settings = "chop-icon__cog",
8
- Delete = "chop-icon__bin2",
9
- Up = "chop-icon__circle-up",
10
- Down = "chop-icon__circle-down",
11
- Right = "chop-icon__circle-right",
12
- Left = "chop-icon__circle-left",
13
- Sound = "chop-icon__volume-medium",
14
- NoSound = "chop-icon__volume-mute2",
15
- LightMode = "chop-icon__sun",
16
- DarkMode = "chop-icon__contrast",
17
- Cancel = "chop-icon__close",
18
- Sidebar = "chop-icon__magic-wand",
19
- Telegram = "chop-icon__telegram",
20
- Github = "chop-icon__github",
21
- Mail = "chop-icon__mail4",
22
- Propositions = "chop-icon__cube",
23
- Resolution = "chop-icon__libreoffice",
24
- Predicates = "chop-icon__cubes",
25
- TruthTables = "chop-icon__delicious",
26
- Syllogisms = "chop-icon__dice",
27
- English = "chop-icon__english-lang",
28
- Russian = "chop-icon__russian-lang",
29
- Required = "chop-icon__fire",
30
- Checked = "chop-icon__checkbox-checked",
31
- Unchecked = "chop-icon__checkbox-unchecked",
32
- Info = "chop-icon__exclamation-triangle",
33
- LinkedIn = "chop-icon__linkedin-square",
34
- File = "chop-icon__file-empty",
35
- Files = "chop-icon__files-empty",
36
- Facebook = "chop-icon__facebook2",
37
- CaretUp = "chop-icon__caret-up",
38
- CaretDown = "chop-icon__caret-down",
39
- SavePDF = "chop-icon__file-pdf",
40
- ExportXML = "chop-icon__download",
41
- ImportXML = "chop-icon__upload",
42
- Copy = "chop-icon__copy",
43
- Paste = "chop-icon__paste",
44
- Cut = "chop-icon__scissors",
45
- Reset = "chop-icon__trash",
46
- Clear = "chop-icon__cross"
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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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 './use-window-dimensions';
1
+ import { Dimensions } from '../use-window-dimensions';
2
2
 
3
3
  type useContainerDimensionsParams = {
4
- ref: React.RefObject<HTMLDivElement | HTMLSpanElement>;
4
+ ref: React.RefObject<HTMLElement>;
5
5
  isVisible?: boolean;
6
6
  };
7
7
  export declare const useContainerDimensions: ({ ref, isVisible }: useContainerDimensionsParams) => Dimensions;
@@ -0,0 +1,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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,2 @@
1
+ declare const Example: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Example;
@@ -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;