@pushwoosh/dumb-components 2.9.3 → 2.9.5
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/Badge/types.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/Link/types.d.ts +1 -1
- package/Pagination/types.d.ts +1 -1
- package/Popover/types.d.ts +3 -3
- package/SortButton/types.d.ts +1 -1
- package/Tabs/components/Tab/types.d.ts +1 -1
- package/Tabs/components/TabBar/types.d.ts +1 -1
- package/Tabs/components/TabBarScrollableFrame/types.d.ts +1 -0
- package/Tabs/components/TabBase/types.d.ts +1 -1
- package/Tooltip/types.d.ts +1 -1
- package/hooks/useElementWidth.d.ts +1 -1
- package/hooks/useThemeName.d.ts +1 -1
- package/package.json +2 -2
- package/shared/dropdownField/shared.d.ts +2 -2
- package/shared/dropdownField/useFieldOpenEffects.d.ts +1 -1
package/Badge/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref, ReactNode } from 'react';
|
|
1
|
+
import type { JSX, Ref, ReactNode } from 'react';
|
|
2
2
|
/** Color of a {@link Badge}. */
|
|
3
3
|
export type BadgeColor = 'gray' | 'green' | 'orange' | 'red' | 'purple' | 'sky' | 'locked' | 'black';
|
|
4
4
|
/** Props of {@link Badge} — all `<div>` attributes plus the badge-specific ones. */
|
package/Link/Link.d.ts
CHANGED
package/Link/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref, ReactNode, ComponentType } from 'react';
|
|
1
|
+
import type { JSX, Ref, ReactNode, ComponentType } from 'react';
|
|
2
2
|
/** Default {@link Link} props — renders a styled `<a>` (requires `title` and `href`). */
|
|
3
3
|
export type LinkPropsWithoutAs = Omit<JSX.IntrinsicElements['a'], 'ref'> & {
|
|
4
4
|
/** Ref to the `<a>` element. */
|
package/Pagination/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
1
|
+
import type { JSX, Ref } from 'react';
|
|
2
2
|
/** Props of {@link Pagination} — all `<div>` attributes plus the pagination-specific ones. */
|
|
3
3
|
export type PaginationProps = Omit<JSX.IntrinsicElements['div'], 'ref'> & {
|
|
4
4
|
/** Ref to the container `<div>`. */
|
package/Popover/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { RefObject, ReactNode } from 'react';
|
|
1
|
+
import type { Ref, RefObject, ReactNode } from 'react';
|
|
2
2
|
import type { Placement } from 'tippy.js';
|
|
3
3
|
/** Props of {@link Popover}. */
|
|
4
4
|
export interface PopoverProps {
|
|
5
5
|
/** Ref to the element the popover anchors to. */
|
|
6
|
-
readonly anchorEl: RefObject<HTMLElement>;
|
|
6
|
+
readonly anchorEl: RefObject<HTMLElement | null>;
|
|
7
7
|
/** Ref to the popover window, e.g. for click-outside detection. */
|
|
8
|
-
readonly internalWindowRef?:
|
|
8
|
+
readonly internalWindowRef?: Ref<HTMLDivElement>;
|
|
9
9
|
/** Placement relative to the anchor (default `right-start`). */
|
|
10
10
|
readonly position?: Placement;
|
|
11
11
|
/** Whether the popover is open. */
|
package/SortButton/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
1
|
+
import type { JSX, Ref } from 'react';
|
|
2
2
|
/** Current sort order of a column: ascending, descending, or unsorted (`null`). */
|
|
3
3
|
export type SortButtonOrder = 'asc' | 'desc' | null;
|
|
4
4
|
/** Arrow icon state shown by a {@link SortButton}. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
2
|
import type { TabCode } from '../../types';
|
|
3
3
|
/** Props of {@link Tab} — all `<div>` attributes plus the tab-specific ones. */
|
|
4
4
|
export type TabProps = Omit<JSX.IntrinsicElements['div'], 'ref' | 'onClick'> & Readonly<{
|
package/Tooltip/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type TooltipProps = {
|
|
|
24
24
|
/** Controlled visibility; omit for hover/focus behavior. */
|
|
25
25
|
readonly isVisible?: boolean;
|
|
26
26
|
/** External anchor ref to attach to instead of wrapping `children`. */
|
|
27
|
-
readonly reference?: RefObject<Element>;
|
|
27
|
+
readonly reference?: RefObject<Element | null>;
|
|
28
28
|
/** The anchor element the tooltip wraps. */
|
|
29
29
|
readonly children?: ReactElement<unknown>;
|
|
30
30
|
};
|
|
@@ -8,5 +8,5 @@ type ElementWidth = number | null;
|
|
|
8
8
|
* @returns a tuple of the current width (`null` before first measure) and a
|
|
9
9
|
* `forceUpdate` callback to re-measure on demand
|
|
10
10
|
*/
|
|
11
|
-
export declare function useElementWidth(ref: RefObject<HTMLElement>): [ElementWidth, ForceUpdate];
|
|
11
|
+
export declare function useElementWidth(ref: RefObject<HTMLElement | null>): [ElementWidth, ForceUpdate];
|
|
12
12
|
export {};
|
package/hooks/useThemeName.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import { type ThemeName } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
/** Current theme as a value, for widgets that cannot read `var(--pw-color-*)` — canvas, shadow DOM.
|
|
4
4
|
* @param ref - element inside the theme scope, so a light island wins over the document theme
|
|
5
5
|
* @param isEnabled - pass `false` when the caller already knows the theme and needs no observer */
|
|
6
|
-
export declare function useThemeName(ref?: RefObject<Element>, isEnabled?: boolean): ThemeName;
|
|
6
|
+
export declare function useThemeName(ref?: RefObject<Element | null>, isEnabled?: boolean): ThemeName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/dumb-components",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.5",
|
|
4
4
|
"description": "React components to build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@pushwoosh/kit-constants": "^2.1.0",
|
|
44
44
|
"@pushwoosh/kit-helpers": "^4.12.7",
|
|
45
45
|
"@pushwoosh/kit-icons": "^2.3.3",
|
|
46
|
-
"@pushwoosh/kit-typography": "^1.8.
|
|
46
|
+
"@pushwoosh/kit-typography": "^1.8.7",
|
|
47
47
|
"@tippyjs/react": "^4.2.6",
|
|
48
48
|
"@uiw/codemirror-themes": "^4.23.8",
|
|
49
49
|
"@uiw/react-codemirror": "^4.23.8",
|
|
@@ -10,5 +10,5 @@ export declare function defaultLabelFilter<T>(item: T, query: string, getLabel:
|
|
|
10
10
|
* Mousedown handler for the field shell: refocuses the input and opens the dropdown,
|
|
11
11
|
* while letting clicks on the input itself or on inner buttons through.
|
|
12
12
|
*/
|
|
13
|
-
export declare function useShellMouseDown(inputRef: RefObject<HTMLInputElement>, isOpen: boolean, open: () => void): (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
|
-
export declare function useToggleOpen(inputRef: RefObject<HTMLInputElement>, isOpen: boolean, open: () => void, close: () => void): () => void;
|
|
13
|
+
export declare function useShellMouseDown(inputRef: RefObject<HTMLInputElement | null>, isOpen: boolean, open: () => void): (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
|
+
export declare function useToggleOpen(inputRef: RefObject<HTMLInputElement | null>, isOpen: boolean, open: () => void, close: () => void): () => void;
|
|
@@ -5,7 +5,7 @@ type Args = {
|
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
inputRef: RefObject<HTMLInputElement>;
|
|
8
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Side effects tied to a Combobox field's open state: optional autofocus on mount
|