@veritone-ce/design-system 2.8.6 → 2.8.7
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.
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ResolvablePaletteValue, type PaletteColor } from '../styles/index.js';
|
|
3
|
+
export type AccordionProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Title displayed in the accordion header
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* Background color for the accordion header
|
|
10
|
+
*/
|
|
11
|
+
palette?: ResolvablePaletteValue<PaletteColor>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the accordion is expanded by default
|
|
14
|
+
* This is ignored when used inside an AccordionGroup
|
|
15
|
+
*/
|
|
16
|
+
defaultExpanded?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Unique ID for the accordion when used in an AccordionGroup
|
|
19
|
+
* If not provided, a generated ID will be used
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Content to be displayed when the accordion is expanded
|
|
24
|
+
*/
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Optional test id for testing
|
|
28
|
+
*/
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
};
|
|
31
|
+
declare const Accordion: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
32
|
+
/**
|
|
33
|
+
* Title displayed in the accordion header
|
|
34
|
+
*/
|
|
35
|
+
title: string;
|
|
36
|
+
/**
|
|
37
|
+
* Background color for the accordion header
|
|
38
|
+
*/
|
|
39
|
+
palette?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the accordion is expanded by default
|
|
42
|
+
* This is ignored when used inside an AccordionGroup
|
|
43
|
+
*/
|
|
44
|
+
defaultExpanded?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Unique ID for the accordion when used in an AccordionGroup
|
|
47
|
+
* If not provided, a generated ID will be used
|
|
48
|
+
*/
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Content to be displayed when the accordion is expanded
|
|
52
|
+
*/
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Optional test id for testing
|
|
56
|
+
*/
|
|
57
|
+
'data-testid'?: string | undefined;
|
|
58
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export default Accordion;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionGroupProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
3
|
+
/**
|
|
4
|
+
* The initially expanded accordion ID (optional)
|
|
5
|
+
*/
|
|
6
|
+
defaultActiveId?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Allow all accordions to be closed
|
|
9
|
+
* If false, at least one accordion will always be open
|
|
10
|
+
*/
|
|
11
|
+
allowAllClosed?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Children accordions to be controlled
|
|
14
|
+
*/
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Optional test id for testing
|
|
18
|
+
*/
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const AccordionGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
22
|
+
/**
|
|
23
|
+
* The initially expanded accordion ID (optional)
|
|
24
|
+
*/
|
|
25
|
+
defaultActiveId?: string | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Allow all accordions to be closed
|
|
28
|
+
* If false, at least one accordion will always be open
|
|
29
|
+
*/
|
|
30
|
+
allowAllClosed?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Children accordions to be controlled
|
|
33
|
+
*/
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Optional test id for testing
|
|
37
|
+
*/
|
|
38
|
+
'data-testid'?: string | undefined;
|
|
39
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export default AccordionGroup;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
export type AccordionGroupContextType = {
|
|
3
|
+
activeAccordionId: string | null;
|
|
4
|
+
setActiveAccordionId: (id: string | null) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const defaultContextValue: AccordionGroupContextType;
|
|
7
|
+
export declare const AccordionGroupContext: import("react").Context<AccordionGroupContextType>;
|
|
8
|
+
export declare const useAccordionGroup: () => AccordionGroupContextType;
|
|
9
|
+
export declare const useIsInsideAccordionGroup: () => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Hook to manage accordion state logic, handling both group and individual accordion states
|
|
12
|
+
* @param id - The ID of the accordion
|
|
13
|
+
* @param defaultExpanded - Whether the accordion is expanded by default (when not in a group)
|
|
14
|
+
* @returns Object containing isExpanded state and toggle function
|
|
15
|
+
*/
|
|
16
|
+
export declare const useAccordionState: (id: string, defaultExpanded?: boolean) => {
|
|
17
|
+
isExpanded: boolean;
|
|
18
|
+
toggleAccordion: () => void;
|
|
19
|
+
};
|
|
@@ -37,11 +37,11 @@ export declare function useDialog({ open, onDismiss: dismissDialog, preventOutsi
|
|
|
37
37
|
context: {
|
|
38
38
|
x: number;
|
|
39
39
|
y: number;
|
|
40
|
+
update: () => void;
|
|
40
41
|
placement: import("@floating-ui/utils").Placement;
|
|
41
42
|
strategy: import("@floating-ui/utils").Strategy;
|
|
42
43
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
43
44
|
isPositioned: boolean;
|
|
44
|
-
update: () => void;
|
|
45
45
|
floatingStyles: React.CSSProperties;
|
|
46
46
|
open: boolean;
|
|
47
47
|
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
@@ -92,11 +92,11 @@ export declare const useDialogContext: () => {
|
|
|
92
92
|
context: {
|
|
93
93
|
x: number;
|
|
94
94
|
y: number;
|
|
95
|
+
update: () => void;
|
|
95
96
|
placement: import("@floating-ui/utils").Placement;
|
|
96
97
|
strategy: import("@floating-ui/utils").Strategy;
|
|
97
98
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
98
99
|
isPositioned: boolean;
|
|
99
|
-
update: () => void;
|
|
100
100
|
floatingStyles: React.CSSProperties;
|
|
101
101
|
open: boolean;
|
|
102
102
|
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
@@ -30,11 +30,11 @@ export declare function useDrawer({ open, dismissEnabled, onDismiss: dismissDraw
|
|
|
30
30
|
context: {
|
|
31
31
|
x: number;
|
|
32
32
|
y: number;
|
|
33
|
+
update: () => void;
|
|
33
34
|
placement: import("@floating-ui/utils").Placement;
|
|
34
35
|
strategy: import("@floating-ui/utils").Strategy;
|
|
35
36
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
36
37
|
isPositioned: boolean;
|
|
37
|
-
update: () => void;
|
|
38
38
|
floatingStyles: React.CSSProperties;
|
|
39
39
|
open: boolean;
|
|
40
40
|
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
@@ -85,11 +85,11 @@ export declare const useDrawerContext: () => {
|
|
|
85
85
|
context: {
|
|
86
86
|
x: number;
|
|
87
87
|
y: number;
|
|
88
|
+
update: () => void;
|
|
88
89
|
placement: import("@floating-ui/utils").Placement;
|
|
89
90
|
strategy: import("@floating-ui/utils").Strategy;
|
|
90
91
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
91
92
|
isPositioned: boolean;
|
|
92
|
-
update: () => void;
|
|
93
93
|
floatingStyles: React.CSSProperties;
|
|
94
94
|
open: boolean;
|
|
95
95
|
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritone-ce/design-system",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Design System for Veritone CE",
|
|
6
6
|
"keywords": [
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"@floating-ui/react": "^0.26.6",
|
|
117
117
|
"@fontsource/nunito-sans": "5.1.1",
|
|
118
118
|
"@mui/utils": "^7.2.0",
|
|
119
|
+
"@react-spring/web": "^10.0.3",
|
|
119
120
|
"@tanstack/react-table": "^8.10.7",
|
|
120
121
|
"@tanstack/react-virtual": "^v3.0.0-beta.68",
|
|
121
122
|
"color2k": "^2.0.3",
|