@veritone-ce/design-system 2.0.1 → 2.0.3
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/esm-next/Alert/index.js +1 -2
- package/dist/esm-next/Alert/styles.module.scss.js +1 -1
- package/dist/esm-next/Button/index.js +33 -26
- package/dist/esm-next/Button/styles.module.scss.js +1 -1
- package/dist/esm-next/Checkbox/styles.module.scss.js +1 -1
- package/dist/esm-next/Dialog/components.js +77 -24
- package/dist/esm-next/Dialog/styles.module.scss.js +1 -1
- package/dist/esm-next/Drawer/components.js +183 -0
- package/dist/esm-next/Drawer/factory.js +14 -0
- package/dist/esm-next/Drawer/state.js +40 -0
- package/dist/esm-next/Drawer/styles.module.scss.js +3 -0
- package/dist/esm-next/Input/styles.module.scss.js +1 -1
- package/dist/esm-next/Menu/controlled.js +1 -0
- package/dist/esm-next/Menu/styles.module.scss.js +1 -1
- package/dist/esm-next/RadioButton/styles.module.scss.js +1 -1
- package/dist/esm-next/Select/styles.module.scss.js +1 -1
- package/dist/esm-next/Textarea/index.js +1 -0
- package/dist/esm-next/Textarea/styles.module.scss.js +1 -1
- package/dist/esm-next/Tooltip/index.js +16 -4
- package/dist/esm-next/Tooltip/styles.module.scss.js +1 -1
- package/dist/esm-next/Typography/index.js +4 -0
- package/dist/esm-next/Typography/variants.module.scss.js +1 -1
- package/dist/esm-next/index.js +3 -1
- package/dist/esm-next/styles/css-vars.js +9 -1
- package/dist/esm-next/styles/scss/theme.generated.scss +142 -2
- package/dist/esm-next/styles/typography.js +39 -2
- package/dist/esm-next/styles.css +12 -11
- package/dist/types/src/components/icons/IconListItem/index.d.ts +1 -1
- package/dist/types/src-next/Alert/index.d.ts +1 -1
- package/dist/types/src-next/CircularProgress/index.d.ts +1 -1
- package/dist/types/src-next/Dialog/components.d.ts +8 -2
- package/dist/types/src-next/Dialog/factory.d.ts +1 -0
- package/dist/types/src-next/Drawer/components.d.ts +33 -0
- package/dist/types/src-next/Drawer/factory.d.ts +14 -0
- package/dist/types/src-next/Drawer/index.d.ts +3 -0
- package/dist/types/src-next/Drawer/state.d.ts +113 -0
- package/dist/types/src-next/Textarea/index.d.ts +1 -0
- package/dist/types/src-next/index.d.ts +2 -0
- package/dist/types/src-next/popover/types.d.ts +1 -0
- package/dist/types/src-next/styles/typography.d.ts +3 -1
- package/package.json +9 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type DrawerOptions } from './state.js';
|
|
3
|
+
import { type ButtonProps } from '../Button/index.js';
|
|
4
|
+
import { type TypographyProps } from '../Typography/index.js';
|
|
5
|
+
import { type IconButtonProps } from '../IconButton/index.js';
|
|
6
|
+
export type DrawerProps = DrawerOptions & {
|
|
7
|
+
portalEl?: HTMLElement | null | React.MutableRefObject<HTMLElement | null>;
|
|
8
|
+
lockScroll?: boolean;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
className?: string;
|
|
12
|
+
overlayStyle?: React.CSSProperties;
|
|
13
|
+
overlayClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const Drawer: React.ForwardRefExoticComponent<DrawerOptions & {
|
|
16
|
+
portalEl?: HTMLElement | React.MutableRefObject<HTMLElement | null> | null | undefined;
|
|
17
|
+
lockScroll?: boolean | undefined;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
style?: React.CSSProperties | undefined;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
overlayStyle?: React.CSSProperties | undefined;
|
|
22
|
+
overlayClassName?: string | undefined;
|
|
23
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export default Drawer;
|
|
25
|
+
export declare const DrawerStart: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export declare const DrawerContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export declare const DrawerEnd: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export declare const DrawerTitle: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
29
|
+
export declare const DrawerTypography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
30
|
+
export declare const DrawerDescription: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
31
|
+
export declare const DrawerActions: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export declare const DrawerCloseButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
export declare const DrawerCloseIconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverPortalElProp } from '../popover/types.js';
|
|
3
|
+
export type DrawerFactoryOptions = {
|
|
4
|
+
portalEl?: PopoverPortalElProp;
|
|
5
|
+
};
|
|
6
|
+
export declare function createDrawerComponent({ portalEl }: DrawerFactoryOptions): React.ForwardRefExoticComponent<import("./state.js").DrawerOptions & {
|
|
7
|
+
portalEl?: HTMLElement | React.MutableRefObject<HTMLElement | null> | null | undefined;
|
|
8
|
+
lockScroll?: boolean | undefined;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
style?: React.CSSProperties | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
overlayStyle?: React.CSSProperties | undefined;
|
|
13
|
+
overlayClassName?: string | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface DrawerOptions {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useDrawer({ open, onDismiss: dismissDrawer }: DrawerOptions): {
|
|
7
|
+
labelId: string | undefined;
|
|
8
|
+
descriptionId: string | undefined;
|
|
9
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
10
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
11
|
+
placement: import("@floating-ui/utils").Placement;
|
|
12
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
13
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
isPositioned: boolean;
|
|
17
|
+
update: () => void;
|
|
18
|
+
floatingStyles: React.CSSProperties;
|
|
19
|
+
refs: {
|
|
20
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
21
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
22
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
23
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
24
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
25
|
+
elements: {
|
|
26
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
27
|
+
floating: HTMLElement | null;
|
|
28
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
29
|
+
context: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
placement: import("@floating-ui/utils").Placement;
|
|
33
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
34
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
35
|
+
isPositioned: boolean;
|
|
36
|
+
update: () => void;
|
|
37
|
+
floatingStyles: React.CSSProperties;
|
|
38
|
+
open: boolean;
|
|
39
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
40
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
41
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
42
|
+
nodeId: string | undefined;
|
|
43
|
+
floatingId: string;
|
|
44
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
45
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
46
|
+
};
|
|
47
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
48
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
49
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
50
|
+
active?: boolean | undefined;
|
|
51
|
+
selected?: boolean | undefined;
|
|
52
|
+
}) | undefined) => Record<string, unknown>;
|
|
53
|
+
open: boolean;
|
|
54
|
+
dismiss: () => void;
|
|
55
|
+
};
|
|
56
|
+
export type DrawerContextType = (ReturnType<typeof useDrawer> & {
|
|
57
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
58
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
59
|
+
}) | null;
|
|
60
|
+
export declare const DrawerContext: React.Context<DrawerContextType>;
|
|
61
|
+
export declare const useDrawerContext: () => {
|
|
62
|
+
labelId: string | undefined;
|
|
63
|
+
descriptionId: string | undefined;
|
|
64
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
65
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
66
|
+
placement: import("@floating-ui/utils").Placement;
|
|
67
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
68
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
isPositioned: boolean;
|
|
72
|
+
update: () => void;
|
|
73
|
+
floatingStyles: React.CSSProperties;
|
|
74
|
+
refs: {
|
|
75
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
76
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
77
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
78
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
79
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
80
|
+
elements: {
|
|
81
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
82
|
+
floating: HTMLElement | null;
|
|
83
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
84
|
+
context: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
placement: import("@floating-ui/utils").Placement;
|
|
88
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
89
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
90
|
+
isPositioned: boolean;
|
|
91
|
+
update: () => void;
|
|
92
|
+
floatingStyles: React.CSSProperties;
|
|
93
|
+
open: boolean;
|
|
94
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
95
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
96
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
97
|
+
nodeId: string | undefined;
|
|
98
|
+
floatingId: string;
|
|
99
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
100
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
101
|
+
};
|
|
102
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
103
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
104
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
105
|
+
active?: boolean | undefined;
|
|
106
|
+
selected?: boolean | undefined;
|
|
107
|
+
}) | undefined) => Record<string, unknown>;
|
|
108
|
+
open: boolean;
|
|
109
|
+
dismiss: () => void;
|
|
110
|
+
} & {
|
|
111
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
112
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
113
|
+
};
|
|
@@ -12,6 +12,8 @@ export { default as CircularProgress } from './CircularProgress/index.js';
|
|
|
12
12
|
export * from './CircularProgress/index.js';
|
|
13
13
|
export { default as Dialog } from './Dialog/index.js';
|
|
14
14
|
export * from './Dialog/index.js';
|
|
15
|
+
export { default as Drawer } from './Drawer/index.js';
|
|
16
|
+
export * from './Drawer/index.js';
|
|
15
17
|
export { default as GlobalStyles } from './GlobalStyles/index.js';
|
|
16
18
|
export * from './GlobalStyles/index.js';
|
|
17
19
|
export * from './Icon/index.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VirtualElement as PopoverVirtualElement } from '@floating-ui/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type { PopoverVirtualElement };
|
|
4
|
+
export declare const PopoverPlacementValues: readonly PopoverPlacement[];
|
|
4
5
|
export type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
5
6
|
export type PopoverAnchor = PopoverVirtualElement | (() => PopoverVirtualElement | null) | HTMLElement | (() => HTMLElement | null) | null | undefined;
|
|
6
7
|
export type PopoverStrategy = 'absolute' | 'fixed';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const TypographyVariantKeys: readonly ["h4", "label", "paragraph1", "paragraph2", "paragraph3", "button", "buttonSmall"];
|
|
2
|
+
export declare const TypographyVariantKeys: readonly ["title", "h1", "h2", "h3", "h4", "label", "paragraph1", "paragraph2", "paragraph3", "button", "buttonSmall"];
|
|
3
3
|
export type TypographyVariant = (typeof TypographyVariantKeys)[number];
|
|
4
4
|
export type TypographyStyle = {
|
|
5
5
|
fontFamily: React.CSSProperties['fontFamily'];
|
|
@@ -7,6 +7,8 @@ export type TypographyStyle = {
|
|
|
7
7
|
fontWeight: React.CSSProperties['fontWeight'];
|
|
8
8
|
fontSize: React.CSSProperties['fontSize'];
|
|
9
9
|
lineHeight: React.CSSProperties['lineHeight'];
|
|
10
|
+
letterSpacing: React.CSSProperties['letterSpacing'];
|
|
11
|
+
textTransform: React.CSSProperties['textTransform'];
|
|
10
12
|
};
|
|
11
13
|
export interface TypographyStyleOptions extends Partial<TypographyStyle> {
|
|
12
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritone-ce/design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Design System for Veritone CE",
|
|
6
6
|
"keywords": [
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Veritone"
|
|
21
21
|
},
|
|
22
|
+
"type": "module",
|
|
22
23
|
"main": "dist/cjs/index.js",
|
|
23
24
|
"module": "dist/esm/index.js",
|
|
24
25
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -122,15 +123,16 @@
|
|
|
122
123
|
"@storybook/testing-library": "^0.2.0",
|
|
123
124
|
"@testing-library/jest-dom": "^5.14.1",
|
|
124
125
|
"@testing-library/react": "^13.4.0",
|
|
125
|
-
"@testing-library/user-event": "^
|
|
126
|
+
"@testing-library/user-event": "^14.5.2",
|
|
126
127
|
"@types/jest": "^27.0.1",
|
|
127
128
|
"@types/node": "^16.7.13",
|
|
128
129
|
"@types/react": "^18.0.0",
|
|
129
130
|
"@types/react-dom": "^18.0.0",
|
|
130
131
|
"@types/react-dropzone": "^5.1.0",
|
|
132
|
+
"@types/react-syntax-highlighter": "^15.5.11",
|
|
131
133
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
132
134
|
"@typescript-eslint/parser": "^6.7.0",
|
|
133
|
-
"auto": "^11.
|
|
135
|
+
"auto": "^11.1.1",
|
|
134
136
|
"autoprefixer": "^10.4.17",
|
|
135
137
|
"babel-jest": "^29.3.1",
|
|
136
138
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
@@ -138,6 +140,7 @@
|
|
|
138
140
|
"cssnano": "^6.0.3",
|
|
139
141
|
"cz-conventional-changelog": "^3.3.0",
|
|
140
142
|
"esbuild": "^0.19.11",
|
|
143
|
+
"esbuild-jest": "^0.5.0",
|
|
141
144
|
"esbuild-runner": "^2.2.2",
|
|
142
145
|
"eslint": "^8.49.0",
|
|
143
146
|
"eslint-config-prettier": "^9.0.0",
|
|
@@ -147,6 +150,7 @@
|
|
|
147
150
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
148
151
|
"eslint-plugin-storybook": "^0.6.13",
|
|
149
152
|
"husky": "8.0.2",
|
|
153
|
+
"identity-obj-proxy": "^3.0.0",
|
|
150
154
|
"jest": "^29.3.1",
|
|
151
155
|
"jest-environment-jsdom": "^29.3.1",
|
|
152
156
|
"lint-staged": "^14.0.1",
|
|
@@ -155,10 +159,12 @@
|
|
|
155
159
|
"prettier": "^3.0.3",
|
|
156
160
|
"react": "^18.2.0",
|
|
157
161
|
"react-dom": "^18.2.0",
|
|
162
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
158
163
|
"rollup": "^4.9.5",
|
|
159
164
|
"rollup-plugin-copy": "^3.5.0",
|
|
160
165
|
"rollup-plugin-delete": "^2.0.0",
|
|
161
166
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
167
|
+
"rollup-plugin-jsx-remove-attributes": "^1.0.1",
|
|
162
168
|
"rollup-plugin-preserve-directives": "^0.3.0",
|
|
163
169
|
"rollup-plugin-styles": "^4.0.0",
|
|
164
170
|
"sass": "^1.70.0",
|