@pushwoosh/dumb-components 2.9.4 → 2.9.6
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/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +1 -1
- package/Drawer/components/Drawer/Drawer.js +1 -1
- package/Link/Link.d.ts +1 -1
- package/Link/types.d.ts +1 -1
- package/Modal/components/Modal/Modal.js +1 -1
- package/NotificationInbox/NotificationInbox.js +3 -1
- package/Pagination/types.d.ts +1 -1
- 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/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. */
|
|
@@ -18,7 +18,7 @@ export const CalendarRangePicker = ({
|
|
|
18
18
|
firstDayOfWeek,
|
|
19
19
|
initialVisibleMonth
|
|
20
20
|
}) => {
|
|
21
|
-
const startMonthRef = useRef();
|
|
21
|
+
const startMonthRef = useRef(undefined);
|
|
22
22
|
if (!startMonthRef.current) {
|
|
23
23
|
const d = new Date();
|
|
24
24
|
startMonthRef.current = initialVisibleMonth ?? value[0] ?? {
|
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. */
|
|
@@ -155,7 +155,9 @@ export function NotificationInbox({
|
|
|
155
155
|
children: notification.title
|
|
156
156
|
}), notification.description && _jsx(NotificationDescription, {
|
|
157
157
|
as: "div",
|
|
158
|
-
ref: element =>
|
|
158
|
+
ref: element => {
|
|
159
|
+
descriptionRefs.current[notification.id] = element || null;
|
|
160
|
+
},
|
|
159
161
|
"$variant": "standard",
|
|
160
162
|
"$color": Color.MAIN,
|
|
161
163
|
"$visibleLines": VISIBLE_LINES,
|
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/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<{
|
|
@@ -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.6",
|
|
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
|