chop-logic-components 0.5.1 → 0.6.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.
Files changed (67) hide show
  1. package/dist/components/{button → controls/button}/Button.d.ts +1 -1
  2. package/dist/components/controls/button/__docs__/Button.stories.d.ts +7 -0
  3. package/dist/components/index.d.ts +4 -1
  4. package/dist/components/inputs/checkbox/__docs__/Checkbox.stories.d.ts +3 -3
  5. package/dist/components/inputs/multi-select/__docs__/MultiSelect.stories.d.ts +3 -3
  6. package/dist/components/inputs/select/__docs__/Select.stories.d.ts +3 -3
  7. package/dist/components/inputs/text/__docs__/TextInput.stories.d.ts +3 -3
  8. package/dist/components/{modal/Modal.d.ts → modals/dialog/Dialog.d.ts} +2 -2
  9. package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +7 -0
  10. package/dist/components/{modal/__docs__/Example.d.ts → modals/dialog/__docs__/DialogExample.d.ts} +1 -1
  11. package/dist/components/{modal → modals/dialog}/elements/Header.d.ts +1 -1
  12. package/dist/components/{modal → modals/dialog}/elements/Layout.d.ts +1 -1
  13. package/dist/components/modals/tooltip/Tooltip.d.ts +10 -0
  14. package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +10 -0
  15. package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +5 -0
  16. package/dist/hooks/index.d.ts +3 -0
  17. package/dist/hooks/use-click-outside/__docs__/Example.d.ts +2 -0
  18. package/dist/hooks/use-click-outside/__docs__/useClickOutside.stories.d.ts +8 -0
  19. package/dist/hooks/use-click-outside/index.d.ts +9 -0
  20. package/dist/hooks/use-container-dimensions/__docs__/Example.d.ts +2 -0
  21. package/dist/hooks/use-container-dimensions/__docs__/useContainerDimensions.stories.d.ts +8 -0
  22. package/dist/hooks/use-container-dimensions/index.d.ts +8 -0
  23. package/dist/hooks/use-key-press/__docs__/Example.d.ts +2 -0
  24. package/dist/hooks/use-key-press/__docs__/useKeyPress.stories.d.ts +8 -0
  25. package/dist/hooks/use-key-press/__tests__/use-key-press.test.d.ts +1 -0
  26. package/dist/hooks/use-key-press/index.d.ts +9 -0
  27. package/dist/hooks/use-modal-focus-trap/__docs__/Example.d.ts +2 -0
  28. package/dist/hooks/use-modal-focus-trap/__docs__/useModalFocusTrap.stories.d.ts +8 -0
  29. package/dist/hooks/use-modal-focus-trap/__tests__/use-modal-focus-trap.test.d.ts +1 -0
  30. package/dist/hooks/use-modal-focus-trap/index.d.ts +6 -0
  31. package/dist/hooks/use-mount/__docs__/Example.d.ts +2 -0
  32. package/dist/hooks/use-mount/__docs__/useMount.stories.d.ts +8 -0
  33. package/dist/hooks/use-mount/__tests__/use-mount.test.d.ts +1 -0
  34. package/dist/hooks/use-mount/index.d.ts +1 -0
  35. package/dist/hooks/use-tooltip-position/__docs__/Example.d.ts +2 -0
  36. package/dist/hooks/use-tooltip-position/__docs__/useTooltipPosition.stories.d.ts +8 -0
  37. package/dist/hooks/use-tooltip-position/index.d.ts +11 -0
  38. package/dist/hooks/use-window-dimensions/__docs__/Example.d.ts +2 -0
  39. package/dist/hooks/use-window-dimensions/__docs__/useWindowDimensions.stories.d.ts +8 -0
  40. package/dist/hooks/use-window-dimensions/__tests__/use-window-dimensions.test.d.ts +1 -0
  41. package/dist/hooks/use-window-dimensions/index.d.ts +5 -0
  42. package/dist/index.cjs.js +183 -10
  43. package/dist/index.cjs.js.map +1 -1
  44. package/dist/index.es.js +20460 -657
  45. package/dist/index.es.js.map +1 -1
  46. package/dist/style.css +1 -1
  47. package/package.json +11 -11
  48. package/dist/components/button/__docs__/Button.stories.d.ts +0 -7
  49. package/dist/components/modal/__docs__/Modal.stories.d.ts +0 -7
  50. package/dist/hooks/use-click-outside.d.ts +0 -17
  51. package/dist/hooks/use-key-press.d.ts +0 -18
  52. package/dist/hooks/use-modal-focus-trap.d.ts +0 -14
  53. package/dist/hooks/use-mount.d.ts +0 -8
  54. /package/dist/components/{button/__docs__/Example.d.ts → controls/button/__docs__/ButtonExample.d.ts} +0 -0
  55. /package/dist/components/{button → controls/button}/__tests__/Button.test.d.ts +0 -0
  56. /package/dist/components/{modal/__tests__/Modal.test.d.ts → elements/__tests__/error-message.test.d.ts} +0 -0
  57. /package/dist/{hooks/__tests__/use-click-outside.test.d.ts → components/elements/__tests__/label.test.d.ts} +0 -0
  58. /package/dist/components/{misc → elements}/error-message/ErrorMessage.d.ts +0 -0
  59. /package/dist/components/{misc → elements}/label/Label.d.ts +0 -0
  60. /package/dist/components/{misc → elements}/portal/Portal.d.ts +0 -0
  61. /package/dist/components/inputs/checkbox/__docs__/{Example.d.ts → CheckboxExample.d.ts} +0 -0
  62. /package/dist/components/inputs/multi-select/__docs__/{Example.d.ts → MultiSelectExample.d.ts} +0 -0
  63. /package/dist/components/inputs/select/__docs__/{Example.d.ts → SelectExample.d.ts} +0 -0
  64. /package/dist/components/inputs/text/__docs__/{Example.d.ts → TextInputExample.d.ts} +0 -0
  65. /package/dist/{hooks/__tests__/use-key-press.test.d.ts → components/modals/dialog/__tests__/Dialog.test.d.ts} +0 -0
  66. /package/dist/{hooks/__tests__/use-modal-focus.test.d.ts → components/modals/tooltip/__tests__/Tooltip.test.d.ts} +0 -0
  67. /package/dist/hooks/{__tests__/use-mount.test.d.ts → use-click-outside/__tests__/use-click-outside.test.d.ts} +0 -0
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/SavouryGin/chop-logic-components.git"
6
6
  },
7
- "version": "0.5.1",
7
+ "version": "0.6.1",
8
8
  "description": "React UI components library for Chop Logic project",
9
9
  "type": "module",
10
10
  "main": "dist/index.cjs.js",
@@ -45,17 +45,17 @@
45
45
  },
46
46
  "homepage": "https://github.com/SavouryGin/chop-logic-components#readme",
47
47
  "devDependencies": {
48
- "@chromatic-com/storybook": "^1.5.0",
48
+ "@chromatic-com/storybook": "^1.6.1",
49
49
  "@commitlint/cli": "^19.3.0",
50
50
  "@commitlint/config-conventional": "^19.2.2",
51
- "@storybook/addon-essentials": "^8.1.10",
52
- "@storybook/addon-interactions": "^8.1.10",
53
- "@storybook/addon-links": "^8.1.10",
54
- "@storybook/addon-onboarding": "^8.1.10",
55
- "@storybook/blocks": "^8.1.10",
56
- "@storybook/react": "^8.1.10",
57
- "@storybook/react-vite": "^8.1.10",
58
- "@storybook/test": "^8.1.10",
51
+ "@storybook/addon-essentials": "^8.1.11",
52
+ "@storybook/addon-interactions": "^8.1.11",
53
+ "@storybook/addon-links": "^8.1.11",
54
+ "@storybook/addon-onboarding": "^8.1.11",
55
+ "@storybook/blocks": "^8.1.11",
56
+ "@storybook/react": "^8.1.11",
57
+ "@storybook/react-vite": "^8.1.11",
58
+ "@storybook/test": "^8.1.11",
59
59
  "@testing-library/jest-dom": "^6.4.2",
60
60
  "@testing-library/react": "^15.0.6",
61
61
  "@testing-library/user-event": "^14.5.2",
@@ -73,7 +73,7 @@
73
73
  "jsdom": "^24.0.0",
74
74
  "lint-staged": "^15.2.2",
75
75
  "prettier": "^3.2.5",
76
- "storybook": "^8.1.10",
76
+ "storybook": "^8.1.11",
77
77
  "typescript": "^5.4.5",
78
78
  "vite": "^5.2.10",
79
79
  "vite-plugin-dts": "^3.9.0",
@@ -1,7 +0,0 @@
1
- import { default as ExampleButton } from './Example';
2
- import { Meta, StoryObj } from '@storybook/react';
3
-
4
- declare const meta: Meta<typeof ExampleButton>;
5
- export default meta;
6
- type Story = StoryObj<typeof ExampleButton>;
7
- export declare const Primary: Story;
@@ -1,7 +0,0 @@
1
- import { default as Example } from './Example';
2
- import { Meta, StoryObj } from '@storybook/react';
3
-
4
- declare const meta: Meta<typeof Example>;
5
- export default meta;
6
- type Story = StoryObj<typeof Example>;
7
- export declare const Default: Story;
@@ -1,17 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- type UseClickOutsideParams = {
4
- ref: React.RefObject<HTMLDivElement>;
5
- onClickOutsideHandler: () => void;
6
- dependentRef?: React.RefObject<HTMLDivElement>;
7
- };
8
- /**
9
- * Custom hook that triggers a callback when a click event occurs outside specified elements.
10
- *
11
- * @param {UseClickOutsideParams} ref - Reference to the main element to check if the click is outside
12
- * @param {UseClickOutsideParams} onClickOutsideHandler - Callback function to execute when a click event occurs outside
13
- * @param {UseClickOutsideParams} dependentRef - Reference to a dependent element to check if the click is outside
14
- * @return {void} Function does not return anything
15
- */
16
- export declare const useClickOutside: ({ ref, onClickOutsideHandler, dependentRef }: UseClickOutsideParams) => void;
17
- export {};
@@ -1,18 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- type useKeyPressParams = {
4
- keyCode: string;
5
- ref: React.RefObject<HTMLDivElement>;
6
- onKeyPress: () => void;
7
- };
8
- /**
9
- * Hook that listens for a specific key press event and triggers an action when the key is pressed.
10
- *
11
- * @param {Object} params - An object containing the following properties:
12
- * - ref: A ref object that refers to the HTML element to attach the event listener to.
13
- * - keyCode: The key code of the key to listen for.
14
- * - onKeyPress: A function to be called when the key is pressed.
15
- * @return {void} This hook does not return anything.
16
- */
17
- export declare const useKeyPress: ({ ref, keyCode, onKeyPress }: useKeyPressParams) => void;
18
- export {};
@@ -1,14 +0,0 @@
1
- type ModalFocusTrapParams = {
2
- modalRef: React.RefObject<HTMLDivElement>;
3
- isOpened: boolean;
4
- };
5
- /**
6
- * Traps the focus within a modal element when it is opened.
7
- *
8
- * @param {ModalFocusTrapParams} params - An object containing the modal reference and a boolean indicating whether the modal is opened.
9
- * @param {React.RefObject<HTMLDivElement>} params.modalRef - A reference to the modal element.
10
- * @param {boolean} params.isOpened - A boolean indicating whether the modal is opened.
11
- * @return {void} This function does not return anything.
12
- */
13
- export declare const useModalFocusTrap: ({ modalRef, isOpened }: ModalFocusTrapParams) => void;
14
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Custom hook that manages the mounting state based on the isOpened prop and a delay.
3
- *
4
- * @param {boolean} isOpened - Indicates if the component is opened.
5
- * @param {number} [delay=300] - The delay in milliseconds before unmounting.
6
- * @return {boolean} The current state of mounting.
7
- */
8
- export declare const useMount: (isOpened: boolean, delay?: number) => boolean;