draft-components 1.5.0 → 1.6.0
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/cjs/components/tooltip/tooltip.cjs +2 -2
- package/esm/components/tooltip/tooltip.js +2 -2
- package/package.json +23 -23
- package/types/components/alert/alert.d.ts +1 -1
- package/types/components/avatar-group/avatar-group.d.ts +1 -1
- package/types/components/breadcrumbs/breadcrumbs-item.d.ts +1 -1
- package/types/components/button/button.d.ts +1 -1
- package/types/components/button-group/button-group.d.ts +1 -1
- package/types/components/date-picker-popover/date-picker-popover.d.ts +1 -1
- package/types/components/date-range-picker-popover/date-range-picker-popover.d.ts +1 -1
- package/types/components/menu/menu.d.ts +1 -1
- package/types/components/nav-list/nav-list-item.d.ts +1 -1
- package/types/components/selection-control/selection-control.d.ts +1 -1
- package/types/components/tooltip/tooltip.d.ts +3 -2
|
@@ -6,7 +6,7 @@ const reactHelpers = require('../../lib/react-helpers.cjs');
|
|
|
6
6
|
const useMountTransition = require('../../hooks/use-mount-transition.cjs');
|
|
7
7
|
const positioner = require('../positioner/positioner.cjs');
|
|
8
8
|
|
|
9
|
-
function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style, className, content, children, ...props }) {
|
|
9
|
+
function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style, className, htmlContent, content, children, ...props }) {
|
|
10
10
|
const [defaultShow, setDefaultShow] = react.useState(props.defaultIsShown ?? false);
|
|
11
11
|
const defaultId = react.useId();
|
|
12
12
|
const tooltipId = props.id || defaultId;
|
|
@@ -66,7 +66,7 @@ function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style
|
|
|
66
66
|
'--dc-tooltip-transition-duration': `${durationMs}ms`,
|
|
67
67
|
...portalStyle,
|
|
68
68
|
...style,
|
|
69
|
-
}, className: reactHelpers.classNames('dc-tooltip', transitionClass, className), role: "tooltip", children: content }));
|
|
69
|
+
}, className: reactHelpers.classNames('dc-tooltip', transitionClass, className), content: htmlContent, role: "tooltip", children: content }));
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
return (jsxRuntime.jsx(positioner.Positioner, { placement: placement, alignment: alignment, anchorGap: anchorGap, renderAnchor: renderAnchor, renderContent: renderContent }));
|
|
@@ -4,7 +4,7 @@ import { isReactElementWithRef, mergeRefs, classNames } from '../../lib/react-he
|
|
|
4
4
|
import { useMountTransition } from '../../hooks/use-mount-transition.js';
|
|
5
5
|
import { Positioner } from '../positioner/positioner.js';
|
|
6
6
|
|
|
7
|
-
function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style, className, content, children, ...props }) {
|
|
7
|
+
function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style, className, htmlContent, content, children, ...props }) {
|
|
8
8
|
const [defaultShow, setDefaultShow] = useState(props.defaultIsShown ?? false);
|
|
9
9
|
const defaultId = useId();
|
|
10
10
|
const tooltipId = props.id || defaultId;
|
|
@@ -64,7 +64,7 @@ function Tooltip({ anchorGap = 8, placement = 'top', alignment = 'center', style
|
|
|
64
64
|
'--dc-tooltip-transition-duration': `${durationMs}ms`,
|
|
65
65
|
...portalStyle,
|
|
66
66
|
...style,
|
|
67
|
-
}, className: classNames('dc-tooltip', transitionClass, className), role: "tooltip", children: content }));
|
|
67
|
+
}, className: classNames('dc-tooltip', transitionClass, className), content: htmlContent, role: "tooltip", children: content }));
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
return (jsx(Positioner, { placement: placement, alignment: alignment, anchorGap: anchorGap, renderAnchor: renderAnchor, renderContent: renderContent }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "draft-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "The React based UI components library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -57,29 +57,29 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@alexzimakov/eslint-config": "1.5.0",
|
|
60
|
-
"@babel/core": "7.
|
|
61
|
-
"@babel/preset-env": "7.
|
|
62
|
-
"@babel/preset-react": "7.
|
|
63
|
-
"@babel/preset-typescript": "7.
|
|
60
|
+
"@babel/core": "7.22.5",
|
|
61
|
+
"@babel/preset-env": "7.22.5",
|
|
62
|
+
"@babel/preset-react": "7.22.5",
|
|
63
|
+
"@babel/preset-typescript": "7.22.5",
|
|
64
64
|
"@heroicons/react": "2.0.18",
|
|
65
65
|
"@rollup/plugin-typescript": "11.1.1",
|
|
66
|
-
"@storybook/addon-actions": "7.0.
|
|
67
|
-
"@storybook/addon-essentials": "7.0.
|
|
68
|
-
"@storybook/addon-links": "7.0.
|
|
69
|
-
"@storybook/react": "7.0.
|
|
70
|
-
"@storybook/react-vite": "7.0.
|
|
71
|
-
"@testing-library/dom": "9.3.
|
|
66
|
+
"@storybook/addon-actions": "7.0.23",
|
|
67
|
+
"@storybook/addon-essentials": "7.0.23",
|
|
68
|
+
"@storybook/addon-links": "7.0.23",
|
|
69
|
+
"@storybook/react": "7.0.23",
|
|
70
|
+
"@storybook/react-vite": "7.0.23",
|
|
71
|
+
"@testing-library/dom": "9.3.1",
|
|
72
72
|
"@testing-library/jest-dom": "5.16.5",
|
|
73
73
|
"@testing-library/react": "14.0.0",
|
|
74
74
|
"@testing-library/user-event": "14.4.3",
|
|
75
|
-
"@types/jest": "29.5.
|
|
76
|
-
"@types/node": "18.16.
|
|
77
|
-
"@types/react": "18.2.
|
|
78
|
-
"@types/react-dom": "18.2.
|
|
79
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
80
|
-
"@typescript-eslint/parser": "5.
|
|
75
|
+
"@types/jest": "29.5.2",
|
|
76
|
+
"@types/node": "18.16.18",
|
|
77
|
+
"@types/react": "18.2.13",
|
|
78
|
+
"@types/react-dom": "18.2.6",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
80
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
81
81
|
"autoprefixer": "10.4.14",
|
|
82
|
-
"eslint": "8.
|
|
82
|
+
"eslint": "8.43.0",
|
|
83
83
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
84
84
|
"eslint-plugin-react": "7.32.2",
|
|
85
85
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
@@ -89,16 +89,16 @@
|
|
|
89
89
|
"jest": "29.5.0",
|
|
90
90
|
"jest-environment-jsdom": "29.5.0",
|
|
91
91
|
"lint-staged": "13.2.2",
|
|
92
|
-
"postcss": "8.4.
|
|
92
|
+
"postcss": "8.4.24",
|
|
93
93
|
"postcss-import": "15.1.0",
|
|
94
94
|
"react": "18.2.0",
|
|
95
95
|
"react-dom": "18.2.0",
|
|
96
|
-
"rollup": "3.
|
|
97
|
-
"storybook": "7.0.
|
|
98
|
-
"stylelint": "15.
|
|
96
|
+
"rollup": "3.25.1",
|
|
97
|
+
"storybook": "7.0.23",
|
|
98
|
+
"stylelint": "15.8.0",
|
|
99
99
|
"stylelint-config-standard": "33.0.0",
|
|
100
100
|
"stylelint-order": "6.0.3",
|
|
101
|
-
"typescript": "
|
|
101
|
+
"typescript": "5.1.3",
|
|
102
102
|
"vite": "4.3.9"
|
|
103
103
|
},
|
|
104
104
|
"lint-staged": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentPropsWithRef, type JSX, type ReactNode } from 'react';
|
|
2
2
|
type AlertHTMLProps = ComponentPropsWithRef<'div'>;
|
|
3
3
|
export type AlertAppearance = 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
4
4
|
export type AlertVariant = 'default' | 'full-width' | 'accent-border';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX } from 'react';
|
|
2
2
|
type AvatarGroupBaseProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
3
3
|
export type AvatarGroupProps = AvatarGroupBaseProps & {
|
|
4
4
|
children: JSX.Element | JSX.Element[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from 'react';
|
|
2
2
|
type BreadcrumbsItemHTMLProps = ComponentPropsWithoutRef<'a'>;
|
|
3
3
|
export type BreadcrumbsItemRenderFn = (props: {
|
|
4
4
|
className: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentPropsWithRef, type JSX, type ReactNode } from 'react';
|
|
2
2
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
export type ButtonAppearance = 'default' | 'primary' | 'danger' | 'success';
|
|
4
4
|
export type ButtonVariant = 'filled' | 'tinted' | 'plain';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX } from 'react';
|
|
2
2
|
type ButtonGroupBaseProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
|
|
3
3
|
export type ButtonGroupProps = ButtonGroupBaseProps & {
|
|
4
4
|
children: JSX.Element | JSX.Element[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DateISO } from '../date-picker/date-helpers';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
2
|
+
import { type JSX, type ReactNode } from 'react';
|
|
3
3
|
import { type DatePickerProps } from '../date-picker';
|
|
4
4
|
export type DatePickerChangeValueFn = (value: DateISO) => void;
|
|
5
5
|
export type DatePickerPopoverProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DateRangePickerPopoverOption, type DateRangePickerPopoverSelection } from './types';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
2
|
+
import { type JSX, type ReactNode } from 'react';
|
|
3
3
|
import { type PopoverAlignment, type PopoverPlacement } from '../popover';
|
|
4
4
|
import { type DateRangePickerProps } from '../date-picker';
|
|
5
5
|
export type DateRangePickerPopoverPlacement = PopoverPlacement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type KeyboardEventHandler, type MouseEventHandler, type ReactNode, type RefCallback } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type KeyboardEventHandler, type MouseEventHandler, type ReactNode, type RefCallback } from 'react';
|
|
2
2
|
import { type ButtonAppearance, type ButtonVariant } from '../button';
|
|
3
3
|
import { type PopoverAlignment, type PopoverPlacement } from '../popover';
|
|
4
4
|
export type MenuButtonRenderFn = (props: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from 'react';
|
|
2
2
|
type NavListItemHTMLProps = ComponentPropsWithoutRef<'a'>;
|
|
3
3
|
export type NavListItemRenderFn = (props: {
|
|
4
4
|
className: string;
|
|
@@ -9,10 +9,11 @@ type TooltipChildrenRenderFn = (props: {
|
|
|
9
9
|
showTooltip: () => void;
|
|
10
10
|
}) => ReactNode;
|
|
11
11
|
type TooltipHTMLProps = ComponentPropsWithoutRef<'div'>;
|
|
12
|
-
type TooltipBaseProps = Omit<TooltipHTMLProps, 'children'>;
|
|
12
|
+
type TooltipBaseProps = Omit<TooltipHTMLProps, 'children' | 'content'>;
|
|
13
13
|
export type TooltipPlacement = PositionerProps['placement'];
|
|
14
14
|
export type TooltipAlignment = PositionerProps['alignment'];
|
|
15
15
|
export type TooltipProps = {
|
|
16
|
+
htmlContent?: TooltipHTMLProps['content'];
|
|
16
17
|
anchorGap?: number;
|
|
17
18
|
placement?: TooltipPlacement;
|
|
18
19
|
alignment?: TooltipAlignment;
|
|
@@ -21,5 +22,5 @@ export type TooltipProps = {
|
|
|
21
22
|
content: ReactNode;
|
|
22
23
|
children: ReactNode | TooltipChildrenRenderFn;
|
|
23
24
|
} & TooltipBaseProps;
|
|
24
|
-
export declare function Tooltip({ anchorGap, placement, alignment, style, className, content, children, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function Tooltip({ anchorGap, placement, alignment, style, className, htmlContent, content, children, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export {};
|