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.
- package/dist/components/{button → controls/button}/Button.d.ts +1 -1
- package/dist/components/controls/button/__docs__/Button.stories.d.ts +7 -0
- package/dist/components/index.d.ts +4 -1
- 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/{modal/Modal.d.ts → modals/dialog/Dialog.d.ts} +2 -2
- package/dist/components/modals/dialog/__docs__/Dialog.stories.d.ts +7 -0
- package/dist/components/{modal/__docs__/Example.d.ts → modals/dialog/__docs__/DialogExample.d.ts} +1 -1
- package/dist/components/{modal → modals/dialog}/elements/Header.d.ts +1 -1
- package/dist/components/{modal → modals/dialog}/elements/Layout.d.ts +1 -1
- package/dist/components/modals/tooltip/Tooltip.d.ts +10 -0
- package/dist/components/modals/tooltip/__docs__/Tooltip.stories.d.ts +10 -0
- package/dist/components/modals/tooltip/__docs__/TooltipExample.d.ts +5 -0
- package/dist/hooks/index.d.ts +3 -0
- 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-click-outside/index.d.ts +9 -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/index.d.ts +8 -0
- 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-key-press/__tests__/use-key-press.test.d.ts +1 -0
- package/dist/hooks/use-key-press/index.d.ts +9 -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-modal-focus-trap/__tests__/use-modal-focus-trap.test.d.ts +1 -0
- package/dist/hooks/use-modal-focus-trap/index.d.ts +6 -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-mount/index.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-tooltip-position/index.d.ts +11 -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/hooks/use-window-dimensions/index.d.ts +5 -0
- package/dist/index.cjs.js +183 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +20460 -657
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/dist/components/button/__docs__/Button.stories.d.ts +0 -7
- package/dist/components/modal/__docs__/Modal.stories.d.ts +0 -7
- package/dist/hooks/use-click-outside.d.ts +0 -17
- package/dist/hooks/use-key-press.d.ts +0 -18
- package/dist/hooks/use-modal-focus-trap.d.ts +0 -14
- package/dist/hooks/use-mount.d.ts +0 -8
- /package/dist/components/{button/__docs__/Example.d.ts → controls/button/__docs__/ButtonExample.d.ts} +0 -0
- /package/dist/components/{button → controls/button}/__tests__/Button.test.d.ts +0 -0
- /package/dist/components/{modal/__tests__/Modal.test.d.ts → elements/__tests__/error-message.test.d.ts} +0 -0
- /package/dist/{hooks/__tests__/use-click-outside.test.d.ts → components/elements/__tests__/label.test.d.ts} +0 -0
- /package/dist/components/{misc → elements}/error-message/ErrorMessage.d.ts +0 -0
- /package/dist/components/{misc → elements}/label/Label.d.ts +0 -0
- /package/dist/components/{misc → elements}/portal/Portal.d.ts +0 -0
- /package/dist/components/inputs/checkbox/__docs__/{Example.d.ts → CheckboxExample.d.ts} +0 -0
- /package/dist/components/inputs/multi-select/__docs__/{Example.d.ts → MultiSelectExample.d.ts} +0 -0
- /package/dist/components/inputs/select/__docs__/{Example.d.ts → SelectExample.d.ts} +0 -0
- /package/dist/components/inputs/text/__docs__/{Example.d.ts → TextInputExample.d.ts} +0 -0
- /package/dist/{hooks/__tests__/use-key-press.test.d.ts → components/modals/dialog/__tests__/Dialog.test.d.ts} +0 -0
- /package/dist/{hooks/__tests__/use-modal-focus.test.d.ts → components/modals/tooltip/__tests__/Tooltip.test.d.ts} +0 -0
- /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.
|
|
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.
|
|
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.
|
|
52
|
-
"@storybook/addon-interactions": "^8.1.
|
|
53
|
-
"@storybook/addon-links": "^8.1.
|
|
54
|
-
"@storybook/addon-onboarding": "^8.1.
|
|
55
|
-
"@storybook/blocks": "^8.1.
|
|
56
|
-
"@storybook/react": "^8.1.
|
|
57
|
-
"@storybook/react-vite": "^8.1.
|
|
58
|
-
"@storybook/test": "^8.1.
|
|
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.
|
|
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,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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/components/inputs/multi-select/__docs__/{Example.d.ts → MultiSelectExample.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|