@wallarm-org/design-system 0.45.0 → 0.46.0-rc-feature-progress.1
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/components/Progress/Progress.js +2 -1
- package/dist/components/Progress/classes.d.ts +2 -2
- package/dist/components/Progress/classes.js +8 -4
- package/dist/components/Progress/constants.d.ts +1 -0
- package/dist/components/Progress/constants.js +1 -0
- package/dist/components/Progress/types.d.ts +1 -1
- package/dist/components/SplashScreen/SplashScreen.js +13 -3
- package/dist/components/SplashScreen/classes.d.ts +9 -0
- package/dist/components/SplashScreen/classes.js +29 -0
- package/dist/components/Table/TableContext/TableProvider.js +3 -2
- package/dist/components/Table/types.d.ts +9 -0
- package/dist/metadata/components.json +33 -14
- package/dist/theme/components/progress.css +4 -30
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Progress } from "@ark-ui/react/progress";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { progressRangeVariants, progressTrackVariants } from "./classes.js";
|
|
5
|
-
const Progress_Progress = ({ value
|
|
5
|
+
const Progress_Progress = ({ value, min = 0, max = 100, size = 'xs', color = 'brand', showLabel = false, className, 'data-testid': testId, ref })=>/*#__PURE__*/ jsxs(Progress.Root, {
|
|
6
6
|
ref: ref,
|
|
7
7
|
value: value,
|
|
8
|
+
defaultValue: value,
|
|
8
9
|
min: min,
|
|
9
10
|
max: max,
|
|
10
11
|
"data-slot": "progress",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ProgressColor } from './types';
|
|
2
2
|
export declare const progressTrackVariants: (props?: ({
|
|
3
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
3
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
4
4
|
color?: ProgressColor | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const progressRangeVariants: (props?: ({
|
|
7
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
8
8
|
color?: ProgressColor | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
const progressColorMap = {
|
|
3
|
+
brand: 'bg-bg-fill-brand',
|
|
3
4
|
slate: 'bg-badge-slate-strong',
|
|
4
5
|
red: 'bg-badge-red-strong',
|
|
5
6
|
'w-orange': 'bg-badge-w-orange-strong',
|
|
@@ -23,6 +24,7 @@ const progressColorMap = {
|
|
|
23
24
|
stone: 'bg-badge-stone-strong'
|
|
24
25
|
};
|
|
25
26
|
const trackColorMap = {
|
|
27
|
+
brand: 'bg-bg-brand',
|
|
26
28
|
slate: 'bg-badge-slate-light',
|
|
27
29
|
red: 'bg-badge-red-light',
|
|
28
30
|
'w-orange': 'bg-badge-w-orange-light',
|
|
@@ -48,6 +50,7 @@ const trackColorMap = {
|
|
|
48
50
|
const progressTrackVariants = cva('relative w-full overflow-hidden', {
|
|
49
51
|
variants: {
|
|
50
52
|
size: {
|
|
53
|
+
xs: 'h-2 rounded-full',
|
|
51
54
|
sm: 'h-4 rounded-2',
|
|
52
55
|
md: 'h-8 rounded-4',
|
|
53
56
|
lg: 'h-12 rounded-6'
|
|
@@ -55,13 +58,14 @@ const progressTrackVariants = cva('relative w-full overflow-hidden', {
|
|
|
55
58
|
color: trackColorMap
|
|
56
59
|
},
|
|
57
60
|
defaultVariants: {
|
|
58
|
-
size: '
|
|
59
|
-
color: '
|
|
61
|
+
size: 'xs',
|
|
62
|
+
color: 'brand'
|
|
60
63
|
}
|
|
61
64
|
});
|
|
62
65
|
const progressRangeVariants = cva('h-full transition-all duration-300 ease-out', {
|
|
63
66
|
variants: {
|
|
64
67
|
size: {
|
|
68
|
+
xs: 'rounded-full',
|
|
65
69
|
sm: 'rounded-2',
|
|
66
70
|
md: 'rounded-4',
|
|
67
71
|
lg: 'rounded-6'
|
|
@@ -69,8 +73,8 @@ const progressRangeVariants = cva('h-full transition-all duration-300 ease-out',
|
|
|
69
73
|
color: progressColorMap
|
|
70
74
|
},
|
|
71
75
|
defaultVariants: {
|
|
72
|
-
size: '
|
|
73
|
-
color: '
|
|
76
|
+
size: 'xs',
|
|
77
|
+
color: 'brand'
|
|
74
78
|
}
|
|
75
79
|
});
|
|
76
80
|
export { progressRangeVariants, progressTrackVariants };
|
|
@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { Logo } from "../Logo/index.js";
|
|
5
5
|
import { Progress } from "../Progress/index.js";
|
|
6
|
+
import { splashContentVariants, splashLogoVariants, splashProgressVariants } from "./classes.js";
|
|
6
7
|
const SplashScreen = ({ ref, visible = true, className, ...props })=>{
|
|
7
8
|
const [phase, setPhase] = useState(visible ? 'enter-start' : 'exited');
|
|
8
9
|
useEffect(()=>{
|
|
@@ -24,21 +25,30 @@ const SplashScreen = ({ ref, visible = true, className, ...props })=>{
|
|
|
24
25
|
visible
|
|
25
26
|
]);
|
|
26
27
|
if ('exited' === phase) return null;
|
|
28
|
+
const animPhase = phase;
|
|
27
29
|
return /*#__PURE__*/ jsx("div", {
|
|
28
30
|
...props,
|
|
29
31
|
"data-slot": "splash-screen",
|
|
30
32
|
ref: ref,
|
|
31
33
|
className: "h-full w-full flex items-center justify-center",
|
|
32
34
|
children: /*#__PURE__*/ jsxs("div", {
|
|
33
|
-
className: cn(
|
|
35
|
+
className: cn(splashContentVariants({
|
|
36
|
+
phase: animPhase
|
|
37
|
+
}), className),
|
|
34
38
|
onTransitionEnd: ()=>{
|
|
35
39
|
if ('exiting' === phase) setPhase('exited');
|
|
36
40
|
},
|
|
37
41
|
children: [
|
|
38
|
-
/*#__PURE__*/ jsx(Logo, {
|
|
42
|
+
/*#__PURE__*/ jsx(Logo, {
|
|
43
|
+
className: splashLogoVariants({
|
|
44
|
+
phase: animPhase
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
39
47
|
/*#__PURE__*/ jsx(Progress, {
|
|
40
48
|
value: null,
|
|
41
|
-
|
|
49
|
+
className: splashProgressVariants({
|
|
50
|
+
phase: animPhase
|
|
51
|
+
})
|
|
42
52
|
})
|
|
43
53
|
]
|
|
44
54
|
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const splashContentVariants: (props?: ({
|
|
2
|
+
phase?: "enter-start" | "entered" | "exiting" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const splashLogoVariants: (props?: ({
|
|
5
|
+
phase?: "enter-start" | "entered" | "exiting" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const splashProgressVariants: (props?: ({
|
|
8
|
+
phase?: "enter-start" | "entered" | "exiting" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const splashContentVariants = cva('flex h-max w-max flex-col items-center justify-center gap-12', {
|
|
3
|
+
variants: {
|
|
4
|
+
phase: {
|
|
5
|
+
'enter-start': 'opacity-0',
|
|
6
|
+
entered: 'opacity-100 transition-opacity duration-500 ease-out',
|
|
7
|
+
exiting: 'opacity-0 transition-opacity duration-300 ease-out'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const splashLogoVariants = cva('', {
|
|
12
|
+
variants: {
|
|
13
|
+
phase: {
|
|
14
|
+
'enter-start': 'translate-y-8',
|
|
15
|
+
entered: 'translate-y-0 transition-transform duration-500 ease-out',
|
|
16
|
+
exiting: 'translate-y-0 transition-transform duration-500 ease-out'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const splashProgressVariants = cva('', {
|
|
21
|
+
variants: {
|
|
22
|
+
phase: {
|
|
23
|
+
'enter-start': 'translate-y-16',
|
|
24
|
+
entered: 'translate-y-0 transition-transform duration-500 ease-out',
|
|
25
|
+
exiting: 'translate-y-0 transition-transform duration-500 ease-out'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export { splashContentVariants, splashLogoVariants, splashProgressVariants };
|
|
@@ -8,7 +8,7 @@ import { useTableState } from "../hooks/index.js";
|
|
|
8
8
|
import { TABLE_EXPAND_COLUMN_ID, TABLE_MIN_COLUMN_WIDTH, TABLE_SELECT_COLUMN_ID, TABLE_SKELETON_ROWS, TABLE_VIRTUALIZATION_OVERSCAN, createExpandColumn, createSelectionColumn } from "../lib/index.js";
|
|
9
9
|
import { TableContext } from "./TableContext.js";
|
|
10
10
|
const TableProvider = (props)=>{
|
|
11
|
-
const { data, columns, isLoading = false, skeletonCount = TABLE_SKELETON_ROWS, children, getRowId, sorting: sortingProp, onSortingChange, rowSelection: rowSelectionProp, onRowSelectionChange, columnSizing: columnSizingProp, onColumnSizingChange, columnPinning: columnPinningProp, onColumnPinningChange, columnOrder: columnOrderProp, onColumnOrderChange, grouping: groupingProp, onGroupingChange, expanded: expandedProp, onExpandedChange, renderGroupRow, getSubRows, renderExpandedRow, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, defaultColumnVisibility, defaultColumnOrder, virtualized, estimateRowHeight, overscan = TABLE_VIRTUALIZATION_OVERSCAN, onEndReached, onEndReachedThreshold, onMasterCellClick, activeRowId: activeRowIdProp } = props;
|
|
11
|
+
const { data, columns, isLoading = false, skeletonCount = TABLE_SKELETON_ROWS, children, getRowId, sorting: sortingProp, onSortingChange, manualSorting = false, rowSelection: rowSelectionProp, onRowSelectionChange, columnSizing: columnSizingProp, onColumnSizingChange, columnPinning: columnPinningProp, onColumnPinningChange, columnOrder: columnOrderProp, onColumnOrderChange, grouping: groupingProp, onGroupingChange, expanded: expandedProp, onExpandedChange, renderGroupRow, getSubRows, renderExpandedRow, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, defaultColumnVisibility, defaultColumnOrder, virtualized, estimateRowHeight, overscan = TABLE_VIRTUALIZATION_OVERSCAN, onEndReached, onEndReachedThreshold, onMasterCellClick, activeRowId: activeRowIdProp } = props;
|
|
12
12
|
const masterCellActiveRowId = activeRowIdProp ?? null;
|
|
13
13
|
const sortingEnabled = !!onSortingChange;
|
|
14
14
|
const selectionEnabled = !!onRowSelectionChange;
|
|
@@ -131,9 +131,10 @@ const TableProvider = (props)=>{
|
|
|
131
131
|
getRowId,
|
|
132
132
|
getSubRows,
|
|
133
133
|
getCoreRowModel: getCoreRowModel(),
|
|
134
|
-
...sortingEnabled && {
|
|
134
|
+
...sortingEnabled && !manualSorting && {
|
|
135
135
|
getSortedRowModel: getSortedRowModel()
|
|
136
136
|
},
|
|
137
|
+
manualSorting,
|
|
137
138
|
...groupingEnabled && {
|
|
138
139
|
getGroupedRowModel: getGroupedRowModel()
|
|
139
140
|
},
|
|
@@ -155,6 +155,15 @@ export interface TableProps<T> extends TestableProps {
|
|
|
155
155
|
className?: string;
|
|
156
156
|
sorting?: TableSortingState;
|
|
157
157
|
onSortingChange?: TableOnChangeFn<TableSortingState>;
|
|
158
|
+
/**
|
|
159
|
+
* When `true`, disables TanStack's client-side sort. The table renders rows
|
|
160
|
+
* in the order they appear in `data` and only fires `onSortingChange` on
|
|
161
|
+
* header clicks. Use this when sorting is performed server-side and the
|
|
162
|
+
* server returns pre-sorted rows.
|
|
163
|
+
*
|
|
164
|
+
* Default: `false` (client-side sort via TanStack's `getSortedRowModel`).
|
|
165
|
+
*/
|
|
166
|
+
manualSorting?: boolean;
|
|
158
167
|
rowSelection?: TableRowSelectionState;
|
|
159
168
|
onRowSelectionChange?: TableOnChangeFn<TableRowSelectionState>;
|
|
160
169
|
columnSizing?: TableColumnSizingState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"generatedAt": "2026-05-
|
|
2
|
+
"version": "0.45.1",
|
|
3
|
+
"generatedAt": "2026-05-25T17:50:50.832Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -30545,8 +30545,7 @@
|
|
|
30545
30545
|
"name": "value",
|
|
30546
30546
|
"type": "number | null | undefined",
|
|
30547
30547
|
"required": false,
|
|
30548
|
-
"description": "Progress value (0–max). Pass `null` for indeterminate state."
|
|
30549
|
-
"defaultValue": "0"
|
|
30548
|
+
"description": "Progress value (0–max). Pass `null` for indeterminate state."
|
|
30550
30549
|
},
|
|
30551
30550
|
{
|
|
30552
30551
|
"name": "min",
|
|
@@ -30564,13 +30563,13 @@
|
|
|
30564
30563
|
"name": "size",
|
|
30565
30564
|
"type": "ProgressSize | undefined",
|
|
30566
30565
|
"required": false,
|
|
30567
|
-
"defaultValue": "
|
|
30566
|
+
"defaultValue": "xs"
|
|
30568
30567
|
},
|
|
30569
30568
|
{
|
|
30570
30569
|
"name": "color",
|
|
30571
30570
|
"type": "ProgressColor | undefined",
|
|
30572
30571
|
"required": false,
|
|
30573
|
-
"defaultValue": "
|
|
30572
|
+
"defaultValue": "brand"
|
|
30574
30573
|
},
|
|
30575
30574
|
{
|
|
30576
30575
|
"name": "showLabel",
|
|
@@ -30583,16 +30582,17 @@
|
|
|
30583
30582
|
{
|
|
30584
30583
|
"name": "size",
|
|
30585
30584
|
"options": [
|
|
30585
|
+
"xs",
|
|
30586
30586
|
"sm",
|
|
30587
30587
|
"md",
|
|
30588
30588
|
"lg"
|
|
30589
30589
|
],
|
|
30590
|
-
"defaultValue": "
|
|
30590
|
+
"defaultValue": "xs"
|
|
30591
30591
|
},
|
|
30592
30592
|
{
|
|
30593
30593
|
"name": "color",
|
|
30594
30594
|
"options": [],
|
|
30595
|
-
"defaultValue": "
|
|
30595
|
+
"defaultValue": "brand"
|
|
30596
30596
|
}
|
|
30597
30597
|
],
|
|
30598
30598
|
"subComponents": [],
|
|
@@ -30603,15 +30603,15 @@
|
|
|
30603
30603
|
},
|
|
30604
30604
|
{
|
|
30605
30605
|
"name": "Sizes",
|
|
30606
|
-
"code": "() => (\n <div className='w-300'>\n <HStack gap={12}>\n <VStack align='end'>\n <Text truncate>Small</Text>\n <Text truncate>Medium
|
|
30606
|
+
"code": "() => (\n <div className='w-300'>\n <HStack gap={12}>\n <VStack align='end'>\n <Text truncate>XSmall (default)</Text>\n <Text truncate>Small</Text>\n <Text truncate>Medium</Text>\n <Text truncate>Large</Text>\n </VStack>\n\n <VStack fullWidth justify='between' style={{ height: 'stretch' }}>\n <Progress value={20} size='xs' />\n <Progress value={40} size='sm' />\n <Progress value={60} size='md' />\n <Progress value={80} size='lg' />\n </VStack>\n </HStack>\n </div>\n)"
|
|
30607
30607
|
},
|
|
30608
30608
|
{
|
|
30609
|
-
"name": "
|
|
30610
|
-
"code": "() => (\n <div className='w-
|
|
30609
|
+
"name": "WithLabel",
|
|
30610
|
+
"code": "() => (\n <div className='w-280'>\n <VStack>\n <Progress value={20} showLabel />\n <Progress value={40} showLabel size='sm' />\n <Progress value={60} showLabel size='md' />\n <Progress value={80} showLabel size='lg' />\n </VStack>\n </div>\n)"
|
|
30611
30611
|
},
|
|
30612
30612
|
{
|
|
30613
|
-
"name": "
|
|
30614
|
-
"code": "() => (\n <div className='w-
|
|
30613
|
+
"name": "Colors",
|
|
30614
|
+
"code": "() => (\n <div className='w-300'>\n <HStack gap={12}>\n <VStack align='end'>\n {Object.entries(ProgressColorEnum).map(([key]) => (\n <Text key={key}>{key}</Text>\n ))}\n </VStack>\n\n <VStack fullWidth justify='between' style={{ height: 'stretch' }}>\n {Object.entries(ProgressColorEnum).map(([_, color], index) => (\n <Progress\n key={color}\n value={index + 1}\n max={Object.entries(ProgressColorEnum).length}\n color={color}\n size='sm'\n className='flex-1'\n />\n ))}\n </VStack>\n </HStack>\n </div>\n)"
|
|
30615
30615
|
},
|
|
30616
30616
|
{
|
|
30617
30617
|
"name": "Indeterminate",
|
|
@@ -46801,7 +46801,16 @@
|
|
|
46801
46801
|
"description": "@see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part}"
|
|
46802
46802
|
}
|
|
46803
46803
|
],
|
|
46804
|
-
"variants": [
|
|
46804
|
+
"variants": [
|
|
46805
|
+
{
|
|
46806
|
+
"name": "phase",
|
|
46807
|
+
"options": [
|
|
46808
|
+
"enter-start",
|
|
46809
|
+
"entered",
|
|
46810
|
+
"exiting"
|
|
46811
|
+
]
|
|
46812
|
+
}
|
|
46813
|
+
],
|
|
46805
46814
|
"subComponents": [],
|
|
46806
46815
|
"examples": [
|
|
46807
46816
|
{
|
|
@@ -49188,6 +49197,12 @@
|
|
|
49188
49197
|
"type": "TableSortingState | undefined",
|
|
49189
49198
|
"required": false
|
|
49190
49199
|
},
|
|
49200
|
+
{
|
|
49201
|
+
"name": "manualSorting",
|
|
49202
|
+
"type": "boolean | undefined",
|
|
49203
|
+
"required": false,
|
|
49204
|
+
"description": "When `true`, disables TanStack's client-side sort. The table renders rows\nin the order they appear in `data` and only fires `onSortingChange` on\nheader clicks. Use this when sorting is performed server-side and the\nserver returns pre-sorted rows.\n\nDefault: `false` (client-side sort via TanStack's `getSortedRowModel`)."
|
|
49205
|
+
},
|
|
49191
49206
|
{
|
|
49192
49207
|
"name": "rowSelection",
|
|
49193
49208
|
"type": "TableRowSelectionState | undefined",
|
|
@@ -49339,6 +49354,10 @@
|
|
|
49339
49354
|
"name": "Sorting",
|
|
49340
49355
|
"code": "() => {\n const [sorting, setSorting] = useState<TableSortingState>([]);\n\n return (\n <Table\n data={securityEvents}\n columns={securityColumns}\n getRowId={row => row.id}\n sorting={sorting}\n onSortingChange={setSorting}\n />\n );\n}"
|
|
49341
49356
|
},
|
|
49357
|
+
{
|
|
49358
|
+
"name": "ManualSorting",
|
|
49359
|
+
"code": "() => {\n const [sorting, setSorting] = useState<TableSortingState>([]);\n const data = useMemo(() => sortSecurityEvents(sorting), [sorting]);\n\n return (\n <Table\n data={data}\n columns={securityColumns}\n getRowId={row => row.id}\n sorting={sorting}\n onSortingChange={setSorting}\n manualSorting\n data-testid='manual-sort-table'\n />\n );\n}"
|
|
49360
|
+
},
|
|
49342
49361
|
{
|
|
49343
49362
|
"name": "LoadingState",
|
|
49344
49363
|
"code": "() => (\n <Table data={[]} columns={securityColumns} isLoading />\n)"
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
@keyframes progress-indeterminate {
|
|
2
2
|
0% {
|
|
3
|
-
|
|
4
|
-
width: 10%;
|
|
5
|
-
}
|
|
6
|
-
20% {
|
|
7
|
-
left: 100%;
|
|
8
|
-
width: 0%;
|
|
9
|
-
}
|
|
10
|
-
25% {
|
|
11
|
-
left: 100%;
|
|
12
|
-
width: 5%;
|
|
13
|
-
}
|
|
14
|
-
40% {
|
|
15
|
-
left: 0%;
|
|
16
|
-
width: 5%;
|
|
17
|
-
}
|
|
18
|
-
50% {
|
|
19
|
-
left: 0%;
|
|
20
|
-
width: 0%;
|
|
21
|
-
}
|
|
22
|
-
65% {
|
|
23
|
-
left: 0%;
|
|
24
|
-
width: 50%;
|
|
25
|
-
}
|
|
26
|
-
85% {
|
|
27
|
-
left: 20%;
|
|
28
|
-
width: 70%;
|
|
3
|
+
transform: translateX(-100%);
|
|
29
4
|
}
|
|
30
5
|
100% {
|
|
31
|
-
|
|
32
|
-
width: 30%;
|
|
6
|
+
transform: translateX(200%);
|
|
33
7
|
}
|
|
34
8
|
}
|
|
35
9
|
|
|
36
10
|
[data-scope='progress'][data-part='range'][data-state='indeterminate'] {
|
|
37
|
-
|
|
11
|
+
width: 50%;
|
|
38
12
|
transition: none;
|
|
39
|
-
animation: progress-indeterminate
|
|
13
|
+
animation: progress-indeterminate 1s ease-in-out infinite;
|
|
40
14
|
}
|
package/package.json
CHANGED