@juspay/blend-design-system 0.0.21-beta → 0.0.22-beta
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/assets/main.css +1 -1
- package/dist/components/Accordion/types.d.ts +0 -1
- package/dist/components/Card/CardComponents.d.ts +3 -0
- package/dist/components/Card/types.d.ts +11 -0
- package/dist/components/DataTable/DataTablePagination.d.ts +2 -1
- package/dist/components/DataTable/TableBody/types.d.ts +1 -0
- package/dist/components/DataTable/TableCell/index.d.ts +2 -1
- package/dist/components/DataTable/TableCell/types.d.ts +2 -0
- package/dist/components/DataTable/TableFooter/types.d.ts +1 -0
- package/dist/components/DateRangePicker/CalendarGrid.d.ts +1 -0
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +6 -0
- package/dist/components/KeyValuePair/types.d.ts +23 -0
- package/dist/components/KeyValuePair/utils.d.ts +23 -0
- package/dist/components/Stepper/HorizonatlLine.d.ts +6 -0
- package/dist/components/Stepper/HorizontalStepper.d.ts +4 -0
- package/dist/components/Stepper/Stepper.d.ts +3 -0
- package/dist/components/Stepper/StepperLine.d.ts +6 -0
- package/dist/components/Stepper/VerticalLine.d.ts +5 -0
- package/dist/components/Stepper/VerticalStepper.d.ts +3 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/stepper.tokens.d.ts +67 -0
- package/dist/components/Stepper/types.d.ts +48 -0
- package/dist/components/Upload/Upload.d.ts +4 -0
- package/dist/components/Upload/components/DefaultState.d.ts +10 -0
- package/dist/components/Upload/components/ErrorState.d.ts +14 -0
- package/dist/components/Upload/components/FileListDisplay.d.ts +11 -0
- package/dist/components/Upload/components/MixedState.d.ts +13 -0
- package/dist/components/Upload/components/SuccessState.d.ts +14 -0
- package/dist/components/Upload/components/UploadingState.d.ts +13 -0
- package/dist/components/Upload/components/index.d.ts +6 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/Upload/types.d.ts +56 -0
- package/dist/components/Upload/upload.tokens.d.ts +101 -0
- package/dist/components/Upload/utils.d.ts +114 -0
- package/dist/components/WorkflowCanvas/WorkflowCanvas.d.ts +19 -0
- package/dist/components/WorkflowCanvas/WorkflowControls.d.ts +3 -0
- package/dist/components/WorkflowCanvas/components/NodeContent.d.ts +15 -0
- package/dist/components/WorkflowCanvas/constants.d.ts +42 -0
- package/dist/components/WorkflowCanvas/edges/DefaultEdge.d.ts +3 -0
- package/dist/components/WorkflowCanvas/index.d.ts +11 -0
- package/dist/components/WorkflowCanvas/nodes/DefaultNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/nodes/InputNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/nodes/OutputNode.d.ts +3 -0
- package/dist/components/WorkflowCanvas/types.d.ts +76 -0
- package/dist/components/WorkflowCanvas/utils.d.ts +13 -0
- package/dist/components/WorkflowCanvas/workflow.tokens.d.ts +100 -0
- package/dist/context/ThemeContext.d.ts +7 -1
- package/dist/context/useComponentToken.d.ts +4 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +30944 -22610
- package/package.json +2 -1
package/dist/assets/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{display:none}
|
|
1
|
+
[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{display:none}.react-flow{direction:ltr}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;cursor:-webkit-grab;cursor:grab}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{pointer-events:none;overflow:visible}.react-flow__edge-path,.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{pointer-events:visibleStroke;cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:-webkit-grab;cursor:grab}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background:#1a192b;border:1px solid white;border-radius:100%}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translate(-50%)}.react-flow__attribution{font-size:10px;background:#ffffff80;padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-input,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:3px;width:150px;font-size:12px;color:#222;text-align:center;border-width:1px;border-style:solid;border-color:#1a192b;background-color:#fff}.react-flow__node-default.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:0 1px 4px 1px #00000014}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:#f0f0f040}.react-flow__nodesselection-rect,.react-flow__selection{background:#0059dc14;border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px #00000014}.react-flow__controls-button{border:none;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;display:flex;justify-content:center;align-items:center;width:16px;height:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:5px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:4px;height:4px;border:1px solid #fff;border-radius:1px;background-color:#3367d9;transform:translate(-50%,-50%)}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:#3367d9;border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.blend-workflow-canvas .react-flow__node{cursor:pointer;padding:0;border:none;background:transparent;border-radius:0;box-shadow:none}.blend-workflow-canvas .react-flow__node:hover,.blend-workflow-canvas .react-flow__node.selected,.blend-workflow-canvas .react-flow__node.selectable:hover{padding:0;border:none;background:transparent;box-shadow:none}.blend-workflow-canvas .react-flow__edge{cursor:pointer}.blend-workflow-canvas .react-flow__attribution{display:none}
|
|
@@ -6,18 +6,21 @@ type CardComponentProps = {
|
|
|
6
6
|
variant?: CardVariant.DEFAULT;
|
|
7
7
|
}>;
|
|
8
8
|
cardToken: CardTokenType;
|
|
9
|
+
maxHeight?: string;
|
|
9
10
|
};
|
|
10
11
|
type AlignedCardComponentProps = {
|
|
11
12
|
props: Extract<CardProps, {
|
|
12
13
|
variant: CardVariant.ALIGNED;
|
|
13
14
|
}>;
|
|
14
15
|
cardToken: CardTokenType;
|
|
16
|
+
maxHeight?: string;
|
|
15
17
|
};
|
|
16
18
|
type CustomCardComponentProps = {
|
|
17
19
|
props: Extract<CardProps, {
|
|
18
20
|
variant: CardVariant.CUSTOM;
|
|
19
21
|
}>;
|
|
20
22
|
cardToken: CardTokenType;
|
|
23
|
+
maxHeight?: string;
|
|
21
24
|
};
|
|
22
25
|
export declare const DefaultCard: React.FC<CardComponentProps>;
|
|
23
26
|
export declare const AlignedCard: React.FC<AlignedCardComponentProps>;
|
|
@@ -43,4 +43,15 @@ export type CustomCardProps = {
|
|
|
43
43
|
export type CardProps = {
|
|
44
44
|
className?: string;
|
|
45
45
|
maxWidth?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Height of the card. Accepts any valid CSS height value.
|
|
48
|
+
* Examples: "200px", "100%", "50vh", "auto"
|
|
49
|
+
* Note: For percentage heights to work, parent container must have a defined height.
|
|
50
|
+
*/
|
|
51
|
+
maxHeight?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Minimum height of the card. Accepts any valid CSS height value.
|
|
54
|
+
* Useful when you want the card to grow with content but maintain a minimum height.
|
|
55
|
+
*/
|
|
56
|
+
minHeight?: string;
|
|
46
57
|
} & (DefaultCardProps | AlignedCardProps | CustomCardProps);
|
|
@@ -4,8 +4,9 @@ type DataTablePaginationProps = {
|
|
|
4
4
|
totalRows: number;
|
|
5
5
|
pageSizeOptions: number[];
|
|
6
6
|
isLoading?: boolean;
|
|
7
|
+
hasData?: boolean;
|
|
7
8
|
onPageChange: (page: number) => void;
|
|
8
9
|
onPageSizeChange: (pageSize: number) => void;
|
|
9
10
|
};
|
|
10
|
-
export declare function DataTablePagination({ currentPage, pageSize, totalRows, pageSizeOptions, isLoading, onPageChange, onPageSizeChange, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function DataTablePagination({ currentPage, pageSize, totalRows, pageSizeOptions, isLoading, hasData, onPageChange, onPageSizeChange, }: DataTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -4,6 +4,7 @@ export type TableBodyProps<T extends Record<string, unknown>> = {
|
|
|
4
4
|
currentData: T[];
|
|
5
5
|
visibleColumns: ColumnDefinition<T>[];
|
|
6
6
|
idField: string;
|
|
7
|
+
tableTitle?: string;
|
|
7
8
|
selectedRows: Record<string, boolean>;
|
|
8
9
|
editingRows: Record<string, boolean>;
|
|
9
10
|
editValues: Record<string, T>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { TableCellProps } from './types';
|
|
2
|
-
declare const TableCell:
|
|
3
|
+
declare const TableCell: React.ForwardRefExoticComponent<TableCellProps<Record<string, unknown>> & React.RefAttributes<HTMLTableCellElement>>;
|
|
3
4
|
export default TableCell;
|
|
@@ -11,6 +11,7 @@ type CalendarGridProps = {
|
|
|
11
11
|
customDisableDates?: (date: Date) => boolean;
|
|
12
12
|
customRangeConfig?: CustomRangeConfig;
|
|
13
13
|
showDateTimePicker?: boolean;
|
|
14
|
+
resetScrollPosition?: number;
|
|
14
15
|
};
|
|
15
16
|
declare const CalendarGrid: import('react').ForwardRefExoticComponent<CalendarGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
17
|
export default CalendarGrid;
|
|
@@ -192,7 +192,13 @@ export type CalendarTokenType = {
|
|
|
192
192
|
};
|
|
193
193
|
todayIndicator: {
|
|
194
194
|
width: CSSObject['width'];
|
|
195
|
+
height: CSSObject['height'];
|
|
195
196
|
backgroundColor: CSSObject['backgroundColor'];
|
|
197
|
+
borderRadius: CSSObject['borderRadius'];
|
|
198
|
+
position: CSSObject['position'];
|
|
199
|
+
bottom: CSSObject['bottom'];
|
|
200
|
+
left: CSSObject['left'];
|
|
201
|
+
transform: CSSObject['transform'];
|
|
196
202
|
};
|
|
197
203
|
};
|
|
198
204
|
};
|
|
@@ -7,6 +7,7 @@ export declare enum KeyValuePairSize {
|
|
|
7
7
|
MEDIUM = "md",
|
|
8
8
|
LARGE = "lg"
|
|
9
9
|
}
|
|
10
|
+
export type TextOverflowMode = 'truncate' | 'wrap' | 'wrap-clamp';
|
|
10
11
|
export type KeyValuePairPropTypes = {
|
|
11
12
|
keyString: string;
|
|
12
13
|
size?: KeyValuePairSize;
|
|
@@ -16,4 +17,26 @@ export type KeyValuePairPropTypes = {
|
|
|
16
17
|
valueRightSlot?: React.ReactNode;
|
|
17
18
|
keyValuePairState?: KeyValuePairStateType;
|
|
18
19
|
maxWidth?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Controls how text overflow is handled for both key and value
|
|
22
|
+
* - 'truncate': Single line with ellipsis (default, all browsers)
|
|
23
|
+
* - 'wrap': Allow natural text wrapping (all browsers)
|
|
24
|
+
* - 'wrap-clamp': Wrap with line limit and ellipsis (Chrome/Edge/Safari/Firefox 68+, graceful fallback for older browsers)
|
|
25
|
+
*
|
|
26
|
+
* Note: 'wrap-clamp' uses -webkit-line-clamp which is widely supported but non-standard.
|
|
27
|
+
* In unsupported browsers, text will wrap naturally without the line limit.
|
|
28
|
+
*
|
|
29
|
+
* @default 'truncate'
|
|
30
|
+
*/
|
|
31
|
+
textOverflow?: TextOverflowMode;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum number of lines to display when textOverflow is 'wrap-clamp'
|
|
34
|
+
* @default 2
|
|
35
|
+
*/
|
|
36
|
+
maxLines?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Show tooltip on hover when text is truncated
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
showTooltipOnTruncate?: boolean;
|
|
19
42
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { TextOverflowMode, KeyValuePairStateType } from './types';
|
|
3
|
+
import { KeyValuePairTokensType } from './KeyValuePair.tokens';
|
|
4
|
+
/**
|
|
5
|
+
* Get text styles based on overflow mode
|
|
6
|
+
*/
|
|
7
|
+
export declare const getTextStyles: (textOverflow: TextOverflowMode, maxLines: number) => CSSObject;
|
|
8
|
+
/**
|
|
9
|
+
* Get PrimitiveText styles based on overflow mode
|
|
10
|
+
*/
|
|
11
|
+
export declare const getPrimitiveTextStyles: (textOverflow: TextOverflowMode) => CSSObject;
|
|
12
|
+
/**
|
|
13
|
+
* Get container styles based on text overflow mode and max width
|
|
14
|
+
*/
|
|
15
|
+
export declare const getContainerStyles: (textOverflow: TextOverflowMode, maxWidth: string) => CSSObject;
|
|
16
|
+
/**
|
|
17
|
+
* Get flex direction and gap based on layout state
|
|
18
|
+
*/
|
|
19
|
+
export declare const getLayoutStyles: (keyValuePairState: KeyValuePairStateType, keyValuePairTokens: KeyValuePairTokensType) => CSSObject;
|
|
20
|
+
/**
|
|
21
|
+
* Get slot container styles
|
|
22
|
+
*/
|
|
23
|
+
export declare const getSlotStyles: () => CSSObject;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
import { StepState } from './types';
|
|
5
|
+
export type StepperState = 'default' | 'hover' | 'focus' | 'disabled';
|
|
6
|
+
export type StepperTokensType = {
|
|
7
|
+
container: {
|
|
8
|
+
default: {
|
|
9
|
+
gap: CSSObject['gap'];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
step: {
|
|
13
|
+
circle: {
|
|
14
|
+
[key in StepState]: {
|
|
15
|
+
[key in StepperState]: {
|
|
16
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
17
|
+
borderColor: CSSObject['borderColor'];
|
|
18
|
+
borderWidth: CSSObject['borderWidth'];
|
|
19
|
+
borderRadius: CSSObject['borderRadius'];
|
|
20
|
+
size: CSSObject['width'];
|
|
21
|
+
transition: CSSObject['transition'];
|
|
22
|
+
outline: CSSObject['outline'];
|
|
23
|
+
outlineOffset: CSSObject['outlineOffset'];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
icon: {
|
|
28
|
+
[key in StepState]: {
|
|
29
|
+
[key in StepperState]: {
|
|
30
|
+
color: CSSObject['color'];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
connector: {
|
|
36
|
+
line: {
|
|
37
|
+
active: {
|
|
38
|
+
default: {
|
|
39
|
+
color: CSSObject['color'];
|
|
40
|
+
height: CSSObject['height'];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
inactive: {
|
|
44
|
+
default: {
|
|
45
|
+
color: CSSObject['color'];
|
|
46
|
+
height: CSSObject['height'];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
title: {
|
|
52
|
+
text: {
|
|
53
|
+
[key in StepState]: {
|
|
54
|
+
[key in StepperState]: {
|
|
55
|
+
color: CSSObject['color'];
|
|
56
|
+
fontSize: CSSObject['fontSize'];
|
|
57
|
+
fontWeight: CSSObject['fontWeight'];
|
|
58
|
+
gap: CSSObject['gap'];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type ResponsiveStepperTokens = {
|
|
65
|
+
[key in keyof BreakpointType]: StepperTokensType;
|
|
66
|
+
};
|
|
67
|
+
export declare const getStepperTokens: (foundationToken: FoundationTokenType) => ResponsiveStepperTokens;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare enum StepState {
|
|
3
|
+
COMPLETED = "completed",
|
|
4
|
+
CURRENT = "current",
|
|
5
|
+
PENDING = "pending",
|
|
6
|
+
DISABLED = "disabled",
|
|
7
|
+
SKIPPED = "skipped"
|
|
8
|
+
}
|
|
9
|
+
export declare enum StepperType {
|
|
10
|
+
HORIZONTAL = "horizontal",
|
|
11
|
+
VERTICAL = "vertical"
|
|
12
|
+
}
|
|
13
|
+
export type StepperProps = {
|
|
14
|
+
steps: Step[];
|
|
15
|
+
onStepClick?: (stepIndex: number) => void;
|
|
16
|
+
onSubstepClick?: (stepId: number, substepIndex: number) => void;
|
|
17
|
+
clickable?: boolean;
|
|
18
|
+
stepperType?: StepperType;
|
|
19
|
+
};
|
|
20
|
+
export type SubStep = {
|
|
21
|
+
id: number;
|
|
22
|
+
title: string;
|
|
23
|
+
status?: StepState;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type Step = {
|
|
27
|
+
id: number;
|
|
28
|
+
title: string;
|
|
29
|
+
status?: StepState;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
description?: string;
|
|
32
|
+
icon?: ReactNode;
|
|
33
|
+
substeps?: SubStep[];
|
|
34
|
+
isExpandable?: boolean;
|
|
35
|
+
isExpanded?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type StepProps = {
|
|
38
|
+
step: Step;
|
|
39
|
+
stepIndex: number;
|
|
40
|
+
isCompleted: boolean;
|
|
41
|
+
isCurrent: boolean;
|
|
42
|
+
isLast: boolean;
|
|
43
|
+
isFirst: boolean;
|
|
44
|
+
onClick?: (stepIndex: number) => void;
|
|
45
|
+
onSubstepClick?: (stepIndex: number, substepIndex: number) => void;
|
|
46
|
+
clickable?: boolean;
|
|
47
|
+
currentSubsteps?: Record<string, number>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
3
|
+
type DefaultStateProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
description?: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
uploadTokens: UploadTokenType;
|
|
8
|
+
};
|
|
9
|
+
declare const DefaultState: React.FC<DefaultStateProps>;
|
|
10
|
+
export default DefaultState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadedFileWithStatus } from '../types';
|
|
3
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
4
|
+
type ErrorStateProps = {
|
|
5
|
+
errorFiles: UploadedFileWithStatus[];
|
|
6
|
+
multiple: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
errorText?: string;
|
|
9
|
+
onFileRemove?: (fileId: string) => void;
|
|
10
|
+
uploadTokens: UploadTokenType;
|
|
11
|
+
maxFiles?: number;
|
|
12
|
+
};
|
|
13
|
+
declare const ErrorState: React.FC<ErrorStateProps>;
|
|
14
|
+
export default ErrorState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadedFileWithStatus } from '../types';
|
|
3
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
4
|
+
type FileListDisplayProps = {
|
|
5
|
+
files: UploadedFileWithStatus[];
|
|
6
|
+
onFileRemove?: (fileId: string) => void;
|
|
7
|
+
uploadTokens: UploadTokenType;
|
|
8
|
+
maxFiles?: number;
|
|
9
|
+
};
|
|
10
|
+
declare const FileListDisplay: React.FC<FileListDisplayProps>;
|
|
11
|
+
export default FileListDisplay;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadedFileWithStatus } from '../types';
|
|
3
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
4
|
+
type MixedStateProps = {
|
|
5
|
+
successfulFiles: UploadedFileWithStatus[];
|
|
6
|
+
errorFiles: UploadedFileWithStatus[];
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
onFileRemove?: (fileId: string) => void;
|
|
9
|
+
uploadTokens: UploadTokenType;
|
|
10
|
+
maxFiles?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const MixedState: React.FC<MixedStateProps>;
|
|
13
|
+
export default MixedState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadedFileWithStatus } from '../types';
|
|
3
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
4
|
+
type SuccessStateProps = {
|
|
5
|
+
successfulFiles: UploadedFileWithStatus[];
|
|
6
|
+
multiple: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
onReplaceFile?: () => void;
|
|
9
|
+
onFileRemove?: (fileId: string) => void;
|
|
10
|
+
uploadTokens: UploadTokenType;
|
|
11
|
+
maxFiles?: number;
|
|
12
|
+
};
|
|
13
|
+
declare const SuccessState: React.FC<SuccessStateProps>;
|
|
14
|
+
export default SuccessState;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UploadTokenType } from '../upload.tokens';
|
|
3
|
+
type UploadingStateProps = {
|
|
4
|
+
uploadingFile: {
|
|
5
|
+
file: File;
|
|
6
|
+
progress: number;
|
|
7
|
+
};
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
description?: string;
|
|
10
|
+
uploadTokens: UploadTokenType;
|
|
11
|
+
};
|
|
12
|
+
declare const UploadingState: React.FC<UploadingStateProps>;
|
|
13
|
+
export default UploadingState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as FileListDisplay } from './FileListDisplay';
|
|
2
|
+
export { default as UploadingState } from './UploadingState';
|
|
3
|
+
export { default as SuccessState } from './SuccessState';
|
|
4
|
+
export { default as MixedState } from './MixedState';
|
|
5
|
+
export { default as ErrorState } from './ErrorState';
|
|
6
|
+
export { default as DefaultState } from './DefaultState';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare enum UploadState {
|
|
3
|
+
IDLE = "idle",
|
|
4
|
+
UPLOADING = "uploading",
|
|
5
|
+
SUCCESS = "success",
|
|
6
|
+
ERROR = "error"
|
|
7
|
+
}
|
|
8
|
+
export type FileRejection = {
|
|
9
|
+
file: File;
|
|
10
|
+
errors: Array<{
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export type UploadFile = {
|
|
16
|
+
file: File;
|
|
17
|
+
progress: number;
|
|
18
|
+
status: UploadState;
|
|
19
|
+
id: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
};
|
|
22
|
+
export type UploadedFileWithStatus = {
|
|
23
|
+
file: File;
|
|
24
|
+
id: string;
|
|
25
|
+
status: 'success' | 'error';
|
|
26
|
+
error?: string;
|
|
27
|
+
};
|
|
28
|
+
export type UploadProps = {
|
|
29
|
+
multiple?: boolean;
|
|
30
|
+
accept?: string[];
|
|
31
|
+
maxSize?: number;
|
|
32
|
+
maxFiles?: number;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
label?: string;
|
|
36
|
+
subLabel?: string;
|
|
37
|
+
helpIconHintText?: string;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
description?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
errorText?: string;
|
|
42
|
+
state?: UploadState;
|
|
43
|
+
uploadingFiles?: UploadFile[];
|
|
44
|
+
uploadedFiles?: UploadedFileWithStatus[];
|
|
45
|
+
failedFiles?: UploadedFileWithStatus[];
|
|
46
|
+
enforceFileTypeConsistency?: boolean;
|
|
47
|
+
onDrop?: (acceptedFiles: File[], fileRejections: FileRejection[]) => void;
|
|
48
|
+
onDropAccepted?: (files: File[]) => void;
|
|
49
|
+
onDropRejected?: (fileRejections: FileRejection[]) => void;
|
|
50
|
+
onFileRemove?: (fileId: string) => void;
|
|
51
|
+
onReplaceFile?: () => void;
|
|
52
|
+
isDragActive?: boolean;
|
|
53
|
+
isDragAccept?: boolean;
|
|
54
|
+
isDragReject?: boolean;
|
|
55
|
+
validator?: (file: File) => FileRejection['errors'][0] | null;
|
|
56
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop' | 'onDragOver' | 'onDragLeave'>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
export type UploadState = 'idle' | 'uploading' | 'success' | 'error' | 'dragActive';
|
|
5
|
+
/**
|
|
6
|
+
* Upload Tokens following the pattern: [target].CSSProp.[state]
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: wrapper | label | container | slot | text | progressContainer | fileList
|
|
10
|
+
* - CSSProp: padding | border | backgroundColor | fontSize | fontWeight | color | gap | margin
|
|
11
|
+
* - state: idle | uploading | success | error | dragActive (upload states)
|
|
12
|
+
*
|
|
13
|
+
* Hierarchy:
|
|
14
|
+
* - Wrapper: Outermost container with base padding
|
|
15
|
+
* - Label: Label section with text styling and spacing
|
|
16
|
+
* - Container: Upload box with state-dependent styling (border, background)
|
|
17
|
+
* - Slot: Content area with icon/content spacing
|
|
18
|
+
* - Text: Text styling for titles, descriptions, filenames, errors
|
|
19
|
+
* - ProgressContainer: Progress bar section with spacing
|
|
20
|
+
* - FileList: File list display with spacing and layout
|
|
21
|
+
*/
|
|
22
|
+
export type UploadTokenType = {
|
|
23
|
+
header: {
|
|
24
|
+
label: {
|
|
25
|
+
text: {
|
|
26
|
+
fontSize: CSSObject['fontSize'];
|
|
27
|
+
fontWeight: CSSObject['fontWeight'];
|
|
28
|
+
color: CSSObject['color'];
|
|
29
|
+
};
|
|
30
|
+
marginBottom: CSSObject['marginBottom'];
|
|
31
|
+
gap: CSSObject['gap'];
|
|
32
|
+
};
|
|
33
|
+
required: {
|
|
34
|
+
text: {
|
|
35
|
+
color: CSSObject['color'];
|
|
36
|
+
};
|
|
37
|
+
gap: CSSObject['gap'];
|
|
38
|
+
};
|
|
39
|
+
subLabel: {
|
|
40
|
+
text: {
|
|
41
|
+
fontSize: CSSObject['fontSize'];
|
|
42
|
+
fontWeight: CSSObject['fontWeight'];
|
|
43
|
+
color: CSSObject['color'];
|
|
44
|
+
};
|
|
45
|
+
gap: CSSObject['gap'];
|
|
46
|
+
};
|
|
47
|
+
helpIcon: {
|
|
48
|
+
width: CSSObject['width'];
|
|
49
|
+
color: CSSObject['color'];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
container: {
|
|
53
|
+
border: {
|
|
54
|
+
idle: CSSObject['border'];
|
|
55
|
+
uploading: CSSObject['border'];
|
|
56
|
+
success: CSSObject['border'];
|
|
57
|
+
error: CSSObject['border'];
|
|
58
|
+
dragActive: CSSObject['border'];
|
|
59
|
+
};
|
|
60
|
+
backgroundColor: {
|
|
61
|
+
idle: CSSObject['backgroundColor'];
|
|
62
|
+
uploading: CSSObject['backgroundColor'];
|
|
63
|
+
success: CSSObject['backgroundColor'];
|
|
64
|
+
error: CSSObject['backgroundColor'];
|
|
65
|
+
dragActive: CSSObject['backgroundColor'];
|
|
66
|
+
};
|
|
67
|
+
borderRadius: CSSObject['borderRadius'];
|
|
68
|
+
padding: CSSObject['padding'];
|
|
69
|
+
content: {
|
|
70
|
+
slot: {
|
|
71
|
+
width: CSSObject['width'];
|
|
72
|
+
gap: CSSObject['gap'];
|
|
73
|
+
};
|
|
74
|
+
text: {
|
|
75
|
+
title: {
|
|
76
|
+
color: CSSObject['color'];
|
|
77
|
+
fontSize: CSSObject['fontSize'];
|
|
78
|
+
fontWeight: CSSObject['fontWeight'];
|
|
79
|
+
};
|
|
80
|
+
subtitle: {
|
|
81
|
+
color: CSSObject['color'];
|
|
82
|
+
fontSize: CSSObject['fontSize'];
|
|
83
|
+
fontWeight: CSSObject['fontWeight'];
|
|
84
|
+
};
|
|
85
|
+
gap: CSSObject['gap'];
|
|
86
|
+
};
|
|
87
|
+
actionable: {
|
|
88
|
+
gap: CSSObject['gap'];
|
|
89
|
+
errorText: {
|
|
90
|
+
color: CSSObject['color'];
|
|
91
|
+
fontSize: CSSObject['fontSize'];
|
|
92
|
+
fontWeight: CSSObject['fontWeight'];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export type ResponsiveUploadTokens = {
|
|
99
|
+
[key in keyof BreakpointType]: UploadTokenType;
|
|
100
|
+
};
|
|
101
|
+
export declare const getUploadTokens: (foundationToken: FoundationTokenType) => ResponsiveUploadTokens;
|