@nulogy/components 13.1.2 → 13.1.4
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/main.js +175 -267
- package/dist/main.module.js +175 -267
- package/dist/src/AsyncSelect/AsyncSelect.graphql.story.d.ts +6 -0
- package/dist/src/AsyncSelect/AsyncSelectComponents.d.ts +6 -2
- package/dist/src/Layout/Sidebar.d.ts +1 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/testing/useUrlProps.d.ts +6 -0
- package/dist/src/utils/useScrollLock.d.ts +55 -0
- package/package.json +4 -2
- package/dist/src/utils/PreventBodyElementScrolling.d.ts +0 -8
- /package/dist/src/utils/{testHelpers → testing}/createMatchMedia.d.ts +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ClearIndicatorProps, ContainerProps, ControlProps, DropdownIndicatorProps, InputProps, MenuProps, MultiValueProps } from "react-select";
|
|
2
|
+
import { ClearIndicatorProps, ContainerProps, ControlProps, DropdownIndicatorProps, InputProps, MenuProps, MultiValueProps, Props } from "react-select";
|
|
3
3
|
import { GroupBase } from "react-select";
|
|
4
4
|
import { OptionProps } from "react-select";
|
|
5
5
|
import { IconName } from "@nulogy/icons";
|
|
6
6
|
import type { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
7
|
-
|
|
7
|
+
interface CustomSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends Props<Option, IsMulti, Group> {
|
|
8
8
|
iconLeft?: IconName | "loading";
|
|
9
|
+
}
|
|
10
|
+
export declare const SelectControl: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isFocused, children, ...props }: ControlProps<Option, IsMulti, Group> & {
|
|
11
|
+
selectProps: CustomSelectProps<Option, IsMulti, Group>;
|
|
9
12
|
}) => React.JSX.Element;
|
|
10
13
|
export declare const SelectMultiValue: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MultiValueProps<Option, IsMulti, Group>) => React.JSX.Element;
|
|
11
14
|
export declare const SelectClearIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ClearIndicatorProps<Option, IsMulti, Group>) => React.JSX.Element;
|
|
@@ -16,3 +19,4 @@ export declare const SelectMenu: <Option, IsMulti extends boolean, Group extends
|
|
|
16
19
|
export declare function SelectOption<Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: OptionProps<Option, IsMulti, Group> & {
|
|
17
20
|
variant?: ComponentVariant;
|
|
18
21
|
}): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import React, { RefObject } from "react";
|
|
|
2
2
|
import { AnimatedBoxProps } from "../Box/Box";
|
|
3
3
|
type PredefinedSidebarWidth = "xs" | "s" | "m" | "l" | "xl";
|
|
4
4
|
type SidebarWidth = PredefinedSidebarWidth | (string & {});
|
|
5
|
-
type SidebarProps = Omit<AnimatedBoxProps, "width"> & {
|
|
5
|
+
export type SidebarProps = Omit<AnimatedBoxProps, "width"> & {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
title?: string;
|
|
@@ -8,5 +8,4 @@ export { default as PopperArrow } from "./PopperArrow";
|
|
|
8
8
|
export { default as ScrollIndicators } from "./ScrollIndicators";
|
|
9
9
|
export { default as withMenuState } from "./withMenuState";
|
|
10
10
|
export type { WithMenuStateProps, AcceptsMenuStateProps } from "./withMenuState";
|
|
11
|
-
export { default as PreventBodyElementScrolling } from "./PreventBodyElementScrolling";
|
|
12
11
|
export { default as useWindowDimensions } from "./useWindowDimensions";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useUrlProps is a hook that reads URL search parameters and returns them as an object.
|
|
3
|
+
* It is meant to be used in Storybook stories to allow for easy URL-based configuration from Cypress specs.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare function useUrlProps<T extends Record<string, unknown>>(defaultProps?: T): T;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
3
|
+
/** Hook options. */
|
|
4
|
+
type UseScrollLockOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to lock the scroll initially.
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
autoLock?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The target element to lock the scroll (default is the body element).
|
|
12
|
+
* @default document.body
|
|
13
|
+
*/
|
|
14
|
+
lockTarget?: HTMLElement | string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to prevent width reflow when locking the scroll.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
widthReflow?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Hook return type. */
|
|
22
|
+
type UseScrollLockReturn = {
|
|
23
|
+
/** Whether the scroll is locked. */
|
|
24
|
+
isLocked: boolean;
|
|
25
|
+
/** Lock the scroll. */
|
|
26
|
+
lock: () => void;
|
|
27
|
+
/** Unlock the scroll. */
|
|
28
|
+
unlock: () => void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A custom hook that locks and unlocks scroll.
|
|
32
|
+
* @param {UseScrollLockOptions} [options] - Options to configure the hook, by default it will lock the scroll automatically.
|
|
33
|
+
* @returns {UseScrollLockReturn} - An object containing the lock and unlock functions.
|
|
34
|
+
* @public
|
|
35
|
+
* @see [Documentation](https://usehooks-ts.com/react-hook/use-scroll-lock)
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Lock the scroll when the modal is mounted, and unlock it when it's unmounted
|
|
39
|
+
* useScrollLock()
|
|
40
|
+
* ```
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Manually lock and unlock the scroll
|
|
44
|
+
* const { lock, unlock } = useScrollLock({ autoLock: false })
|
|
45
|
+
*
|
|
46
|
+
* return (
|
|
47
|
+
* <div>
|
|
48
|
+
* <button onClick={lock}>Lock</button>
|
|
49
|
+
* <button onClick={unlock}>Unlock</button>
|
|
50
|
+
* </div>
|
|
51
|
+
* )
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function useScrollLock(options?: UseScrollLockOptions): UseScrollLockReturn;
|
|
55
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulogy/components",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.4",
|
|
4
4
|
"description": "Component library for the Nulogy Design System - http://nulogy.design",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"typescript": "4.9.5"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
+
"@apollo/client": "^3.11.8",
|
|
64
65
|
"@babel/core": "^7.0.0-0",
|
|
65
66
|
"@babel/plugin-proposal-private-methods": "^7.10.4",
|
|
66
67
|
"@babel/plugin-proposal-private-property-in-object": "^7.10.4",
|
|
@@ -117,6 +118,7 @@
|
|
|
117
118
|
"enzyme-to-json": "3.4.4",
|
|
118
119
|
"eslint": "6.8.0",
|
|
119
120
|
"eslint-plugin-prettier": "^3.1.4",
|
|
121
|
+
"graphql": "15.8.0",
|
|
120
122
|
"http-server": "^14.0.0",
|
|
121
123
|
"husky": "^4.3.0",
|
|
122
124
|
"jest": "29.7.0",
|
|
@@ -172,7 +174,7 @@
|
|
|
172
174
|
"react-popper": "1.3.11",
|
|
173
175
|
"react-popper-2": "npm:react-popper@2.2.4",
|
|
174
176
|
"react-resize-detector": "^9.1.0",
|
|
175
|
-
"react-select": "^5.
|
|
177
|
+
"react-select": "^5.9.0",
|
|
176
178
|
"react-window": "^1.8.11",
|
|
177
179
|
"smoothscroll-polyfill": "^0.4.4",
|
|
178
180
|
"styled-system": "^5.1.4",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export default class PreventBodyElementScrolling extends React.Component<any, any, any> {
|
|
2
|
-
constructor(props: any);
|
|
3
|
-
constructor(props: any, context: any);
|
|
4
|
-
componentDidMount(): void;
|
|
5
|
-
componentWillUnmount(): void;
|
|
6
|
-
render(): React.JSX.Element;
|
|
7
|
-
}
|
|
8
|
-
import React from "react";
|
|
File without changes
|