@vygruppen/spor-react 12.4.4 → 12.4.6
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 +12 -12
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +33 -29
- package/dist/index.d.ts +33 -29
- package/dist/index.js +197 -458
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -458
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/linjetag/InfoTag.tsx +0 -1
- package/src/linjetag/LineIcon.tsx +1 -1
- package/src/linjetag/types.ts +1 -1
- package/src/theme/recipes/close-button.ts +2 -4
- package/src/theme/recipes/link.ts +3 -5
- package/src/theme/slot-recipes/accordion.ts +23 -19
- package/src/theme/slot-recipes/checkbox.ts +9 -15
- package/src/theme/slot-recipes/info-tag.ts +11 -7
- package/src/theme/slot-recipes/native-select.ts +1 -2
- package/src/theme/slot-recipes/pagination.ts +3 -6
- package/src/theme/slot-recipes/stepper.ts +4 -7
- package/src/theme/utils/accent-utils.ts +0 -47
- package/src/theme/utils/bg-utils.ts +0 -20
- package/src/theme/utils/brand-utils.ts +0 -29
- package/src/theme/utils/core-utils.ts +0 -101
- package/src/theme/utils/floating-utils.ts +0 -69
- package/src/theme/utils/ghost-utils.ts +0 -49
- package/src/theme/utils/input-utils.ts +0 -117
- package/src/theme/utils/outline-utils.ts +0 -22
- package/src/theme/utils/sr-utils.ts +0 -13
- package/src/theme/utils/surface-utils.ts +0 -25
@@ -1,117 +0,0 @@
|
|
1
|
-
import { coreBackground, coreBorder, coreText } from "./core-utils";
|
2
|
-
import { floatingBackground, floatingBorder } from "./floating-utils";
|
3
|
-
import { surface } from "./surface-utils";
|
4
|
-
import { InputState } from "./types";
|
5
|
-
|
6
|
-
export function inputVariant(state: InputState) {
|
7
|
-
switch (state) {
|
8
|
-
case "base": {
|
9
|
-
return {
|
10
|
-
...coreBackground("default"),
|
11
|
-
...coreBorder("default"),
|
12
|
-
_hover: {
|
13
|
-
...coreBorder("hover"),
|
14
|
-
},
|
15
|
-
_active: {
|
16
|
-
backgroundColor: "core.surface.active",
|
17
|
-
...coreBorder("default"),
|
18
|
-
},
|
19
|
-
_selected: {
|
20
|
-
...coreBackground("selected"),
|
21
|
-
...coreBorder("selected"),
|
22
|
-
},
|
23
|
-
};
|
24
|
-
}
|
25
|
-
case "floating": {
|
26
|
-
return {
|
27
|
-
boxShadow: "sm",
|
28
|
-
...floatingBackground("default"),
|
29
|
-
...floatingBorder("default"),
|
30
|
-
|
31
|
-
_hover: {
|
32
|
-
...floatingBorder("hover"),
|
33
|
-
...floatingBackground("hover"),
|
34
|
-
},
|
35
|
-
_active: {
|
36
|
-
...floatingBorder("active"),
|
37
|
-
backgroundColor: "core.surface.active",
|
38
|
-
},
|
39
|
-
_selected: {
|
40
|
-
backgroundColor: "floating.surface.selected",
|
41
|
-
borderColor: "floating.border.selected",
|
42
|
-
},
|
43
|
-
};
|
44
|
-
}
|
45
|
-
|
46
|
-
default: {
|
47
|
-
return {
|
48
|
-
...coreBackground("default"),
|
49
|
-
...coreBorder("default"),
|
50
|
-
_hover: {
|
51
|
-
...coreBorder("hover"),
|
52
|
-
},
|
53
|
-
_active: {
|
54
|
-
backgroundColor: "core.surface.active",
|
55
|
-
...coreBorder("default"),
|
56
|
-
},
|
57
|
-
_selected: {
|
58
|
-
...coreBackground("selected"),
|
59
|
-
...coreBorder("selected"),
|
60
|
-
},
|
61
|
-
};
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
export const inputBaseStyle = () => ({
|
67
|
-
field: {
|
68
|
-
appearance: "none",
|
69
|
-
width: "100%",
|
70
|
-
outline: "none",
|
71
|
-
border: 0,
|
72
|
-
borderRadius: "sm",
|
73
|
-
transitionProperty: "common",
|
74
|
-
transitionDuration: "fast",
|
75
|
-
position: "relative",
|
76
|
-
paddingX: 3,
|
77
|
-
height: 8,
|
78
|
-
fontSize: "mobile.md",
|
79
|
-
|
80
|
-
_disabled: {
|
81
|
-
...surface("disabled"),
|
82
|
-
...coreBorder("disabled"),
|
83
|
-
pointerEvents: "none",
|
84
|
-
},
|
85
|
-
_invalid: {
|
86
|
-
...coreBorder("invalid"),
|
87
|
-
_hover: {
|
88
|
-
...coreBorder("hover"),
|
89
|
-
},
|
90
|
-
},
|
91
|
-
" + label, + div[data-lastpass-icon-root] + label": {
|
92
|
-
fontSize: ["mobile.sm", "desktop.sm"],
|
93
|
-
top: "2px",
|
94
|
-
left: 3,
|
95
|
-
zIndex: 2,
|
96
|
-
position: "absolute",
|
97
|
-
marginY: 2,
|
98
|
-
transition: ".1s ease-out",
|
99
|
-
transformOrigin: "top left",
|
100
|
-
cursor: "text",
|
101
|
-
},
|
102
|
-
"&:not(:placeholder-shown)": {
|
103
|
-
paddingTop: "1rem",
|
104
|
-
"& + label, & + div[data-lastpass-icon-root] + label": {
|
105
|
-
transform: "scale(0.825) translateY(-10px)",
|
106
|
-
},
|
107
|
-
},
|
108
|
-
},
|
109
|
-
element: {
|
110
|
-
height: "100%",
|
111
|
-
},
|
112
|
-
group: {
|
113
|
-
":has(:disabled)": {
|
114
|
-
...coreText("disabled"),
|
115
|
-
},
|
116
|
-
},
|
117
|
-
});
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { State, Subset } from "./types";
|
2
|
-
|
3
|
-
type OutlineBorderState = Subset<State, "default" | "error" | "focus">;
|
4
|
-
export function outlineBorder(state: OutlineBorderState) {
|
5
|
-
switch (state) {
|
6
|
-
case "error": {
|
7
|
-
return {
|
8
|
-
outlineColor: "outline.error",
|
9
|
-
};
|
10
|
-
}
|
11
|
-
case "focus": {
|
12
|
-
return {
|
13
|
-
outlineColor: "outline.focus",
|
14
|
-
};
|
15
|
-
}
|
16
|
-
default: {
|
17
|
-
return {
|
18
|
-
outlineColor: "outline",
|
19
|
-
};
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/** All the styles you need to hide something visually, while still making it available for screen readers */
|
2
|
-
export const srOnly = {
|
3
|
-
border: "0 !important",
|
4
|
-
clip: "rect(1px, 1px, 1px, 1px) !important",
|
5
|
-
clipPath: "inset(50%) !important",
|
6
|
-
height: "1px !important",
|
7
|
-
margin: "-1px !important",
|
8
|
-
overflow: "hidden !important",
|
9
|
-
padding: "0 !important",
|
10
|
-
position: "absolute !important",
|
11
|
-
width: "1px !important",
|
12
|
-
whiteSpace: "nowrap !important",
|
13
|
-
};
|
@@ -1,25 +0,0 @@
|
|
1
|
-
type Surface = "default" | "secondary" | "tertiary" | "disabled";
|
2
|
-
export const surface = (surface: Surface) => {
|
3
|
-
switch (surface) {
|
4
|
-
case "default": {
|
5
|
-
return {
|
6
|
-
backgroundColor: "surface",
|
7
|
-
};
|
8
|
-
}
|
9
|
-
case "secondary": {
|
10
|
-
return {
|
11
|
-
backgroundColor: "surface.secondary",
|
12
|
-
};
|
13
|
-
}
|
14
|
-
case "tertiary": {
|
15
|
-
return {
|
16
|
-
backgroundColor: "surface.tertiary",
|
17
|
-
};
|
18
|
-
}
|
19
|
-
case "disabled": {
|
20
|
-
return {
|
21
|
-
backgroundColor: "surface.disabled",
|
22
|
-
};
|
23
|
-
}
|
24
|
-
}
|
25
|
-
};
|