@vygruppen/spor-react 12.4.6 → 12.4.8
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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/index.d.mts +35 -23
- package/dist/index.d.ts +35 -23
- package/dist/index.js +36 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/datepicker/TimePicker.tsx +5 -0
- package/src/loader/ProgressBar.tsx +3 -3
- package/src/table/Table.tsx +10 -22
- package/src/table/index.tsx +1 -0
- package/src/theme/slot-recipes/table.ts +31 -22
- package/src/util/externals.tsx +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "12.4.
|
3
|
+
"version": "12.4.8",
|
4
4
|
"exports": {
|
5
5
|
".": {
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"vitest": "^0.26.3",
|
67
67
|
"vitest-axe": "^0.1.0",
|
68
68
|
"vitest-canvas-mock": "^0.2.2",
|
69
|
-
"@vygruppen/eslint-config": "1.1.
|
69
|
+
"@vygruppen/eslint-config": "1.1.1",
|
70
70
|
"@vygruppen/tsconfig": "0.1.0"
|
71
71
|
},
|
72
72
|
"peerDependencies": {
|
@@ -45,6 +45,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> &
|
|
45
45
|
minuteInterval?: number;
|
46
46
|
/** Whether or not the field is disabled */
|
47
47
|
disabled?: boolean;
|
48
|
+
/**
|
49
|
+
* The variant of the time picker.
|
50
|
+
* Defaults to "core".
|
51
|
+
*/
|
52
|
+
variant?: "core" | "floating" | "ghost";
|
48
53
|
};
|
49
54
|
/** A time picker component.
|
50
55
|
*
|
@@ -16,7 +16,7 @@ type ProgressBarVariants = RecipeVariantProps<typeof progressBarRecipe>;
|
|
16
16
|
export type ProgressBarProps = BoxProps &
|
17
17
|
UseProgressProps &
|
18
18
|
PropsWithChildren<ProgressBarVariants> & {
|
19
|
-
children
|
19
|
+
children?: React.ReactNode;
|
20
20
|
/** The height of the progress bar.
|
21
21
|
* Defaults to .5rem
|
22
22
|
**/
|
@@ -28,12 +28,12 @@ export type ProgressBarProps = BoxProps &
|
|
28
28
|
width?: BoxProps["width"];
|
29
29
|
|
30
30
|
/** Pass if no label is passed to the label */
|
31
|
-
"aria-label"
|
31
|
+
"aria-label"?: string;
|
32
32
|
/** Optional text shown below the loader.
|
33
33
|
*
|
34
34
|
* If you pass an array of strings, the text will rotate every 5 seconds. If you want to change the delay, pass the delay in milliseconds to the `labelRotationDelay` prop.
|
35
35
|
*/
|
36
|
-
label
|
36
|
+
label?: string | string[];
|
37
37
|
/** The number of milliseconds a label is shown, if an array of strings is passed to the `label` prop.
|
38
38
|
*
|
39
39
|
* Defaults to 5000 (5 seconds).
|
package/src/table/Table.tsx
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
|
-
Box,
|
4
3
|
RecipeVariantProps,
|
5
4
|
Table as ChakraTable,
|
6
5
|
TableRootProps as ChakraTableProps,
|
@@ -39,27 +38,16 @@ export const Table = forwardRef<HTMLTableElement, TableProps>((props, ref) => {
|
|
39
38
|
const recipe = useSlotRecipe({ recipe: tableSlotRecipe });
|
40
39
|
const styles = recipe({ variant, size });
|
41
40
|
return (
|
42
|
-
<
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
</Box>
|
41
|
+
<ChakraTable.Root
|
42
|
+
variant={variant}
|
43
|
+
size={size}
|
44
|
+
colorPalette={colorPalette}
|
45
|
+
css={styles}
|
46
|
+
ref={ref}
|
47
|
+
{...props}
|
48
|
+
>
|
49
|
+
{children}
|
50
|
+
</ChakraTable.Root>
|
53
51
|
);
|
54
52
|
});
|
55
53
|
Table.displayName = "Table";
|
56
|
-
|
57
|
-
function getStyleProps(props: TableProps) {
|
58
|
-
return props.variant === "core"
|
59
|
-
? {
|
60
|
-
borderRadius: "sm",
|
61
|
-
border: "sm",
|
62
|
-
borderColor: "outline.disabled",
|
63
|
-
}
|
64
|
-
: {};
|
65
|
-
}
|
package/src/table/index.tsx
CHANGED
@@ -22,15 +22,12 @@ export const tableSlotRecipe = defineSlotRecipe({
|
|
22
22
|
columnHeader: {
|
23
23
|
fontWeight: "bold",
|
24
24
|
textAlign: "start",
|
25
|
-
|
26
|
-
borderColor: "outline.disabled",
|
25
|
+
|
27
26
|
...numericStyles,
|
28
27
|
paddingX: 1.5,
|
29
28
|
paddingY: 1,
|
30
29
|
},
|
31
30
|
row: {
|
32
|
-
borderBottom: "sm",
|
33
|
-
borderColor: "outline.disabled",
|
34
31
|
...numericStyles,
|
35
32
|
},
|
36
33
|
cell: {
|
@@ -85,7 +82,6 @@ export const tableSlotRecipe = defineSlotRecipe({
|
|
85
82
|
backgroundColor: "none",
|
86
83
|
},
|
87
84
|
columnHeader: {
|
88
|
-
borderLeft: "none",
|
89
85
|
borderBottom: "sm",
|
90
86
|
borderColor: "outline.disabled",
|
91
87
|
backgroundColor: "none",
|
@@ -93,46 +89,59 @@ export const tableSlotRecipe = defineSlotRecipe({
|
|
93
89
|
},
|
94
90
|
|
95
91
|
cell: {
|
92
|
+
...numericStyles,
|
93
|
+
},
|
94
|
+
row: {
|
96
95
|
borderBottom: "sm",
|
97
96
|
borderColor: "outline.disabled",
|
98
97
|
...numericStyles,
|
99
|
-
_first: {
|
100
|
-
borderLeft: "none",
|
101
|
-
},
|
102
98
|
},
|
103
99
|
},
|
104
100
|
|
105
101
|
core: {
|
102
|
+
root: {
|
103
|
+
boxShadow: "0 0 0 1px var(--shadow-color)",
|
104
|
+
shadowColor: "outline.disabled",
|
105
|
+
borderRadius: "sm",
|
106
|
+
},
|
107
|
+
|
106
108
|
table: {
|
107
|
-
borderRadius: "md",
|
108
109
|
overflow: "hidden",
|
109
|
-
border: "sm",
|
110
|
-
borderColor: "outline.disabled",
|
111
110
|
},
|
112
111
|
cell: {
|
113
|
-
borderLeft: "sm",
|
114
|
-
borderColor: "outline.disabled",
|
115
112
|
...numericStyles,
|
116
|
-
|
117
|
-
|
113
|
+
|
114
|
+
borderRight: "sm",
|
115
|
+
borderColor: "outline.disabled",
|
116
|
+
|
117
|
+
_last: {
|
118
|
+
borderRight: "none",
|
118
119
|
},
|
119
120
|
},
|
120
|
-
|
121
|
-
border: "none",
|
122
|
-
},
|
121
|
+
|
123
122
|
columnHeader: {
|
124
|
-
borderBottom: "sm",
|
125
|
-
borderLeft: "sm",
|
126
|
-
borderLeftColor: "outline.disabled",
|
127
123
|
...numericStyles,
|
124
|
+
|
125
|
+
borderRight: "sm",
|
126
|
+
borderColor: "outline.disabled",
|
127
|
+
|
128
128
|
_first: {
|
129
|
-
|
129
|
+
borderTopLeftRadius: "sm",
|
130
|
+
},
|
131
|
+
_last: {
|
132
|
+
borderTopRightRadius: "sm",
|
133
|
+
borderRight: "none",
|
130
134
|
},
|
131
135
|
},
|
136
|
+
header: {
|
137
|
+
borderBottom: "sm",
|
138
|
+
borderColor: "outline.disabled",
|
139
|
+
},
|
132
140
|
row: {
|
133
141
|
...numericStyles,
|
134
142
|
borderBottom: "sm",
|
135
143
|
borderColor: "outline.disabled",
|
144
|
+
|
136
145
|
_last: {
|
137
146
|
borderBottom: "none",
|
138
147
|
},
|