@vygruppen/spor-react 9.8.3 → 9.9.0
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 +9 -9
- package/CHANGELOG.md +11 -0
- package/dist/{CountryCodeSelect-C2XKHNTP.mjs → CountryCodeSelect-U25NF65N.mjs} +1 -1
- package/dist/{chunk-ZDOSE4VD.mjs → chunk-TEDOVPXZ.mjs} +87 -27
- package/dist/index.d.mts +55 -24
- package/dist/index.d.ts +55 -24
- package/dist/index.js +85 -25
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/alert/BaseAlert.tsx +2 -0
- package/src/alert/ClosableAlert.tsx +11 -2
- package/src/alert/ExpandableAlert.tsx +3 -1
- package/src/alert/StaticAlert.tsx +10 -2
- package/src/input/InfoSelect.tsx +33 -14
- package/src/input/ListBox.tsx +1 -0
- package/src/layout/PressableCard.tsx +2 -2
- package/src/layout/StaticCard.tsx +0 -1
- package/src/theme/components/alert.ts +1 -0
- package/src/theme/components/info-select.ts +12 -1
- package/src/theme/components/listbox.ts +5 -5
- package/src/theme/components/pressable-card.ts +6 -1
- package/src/theme/utils/floating-utils.ts +3 -3
- package/src/theme/utils/ghost-utils.ts +19 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
type PressableCardProps = BoxProps & {
|
|
11
11
|
/** Defaults to "base" */
|
|
12
|
-
variant
|
|
12
|
+
variant?: "floating" | "accent" | "base";
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -43,7 +43,7 @@ type PressableCardProps = BoxProps & {
|
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
export const PressableCard = forwardRef<PressableCardProps, As>(
|
|
46
|
-
({ children, variant = "
|
|
46
|
+
({ children, variant = "floating", ...props }, ref) => {
|
|
47
47
|
const styles = useStyleConfig("PressableCard", {
|
|
48
48
|
variant,
|
|
49
49
|
});
|
|
@@ -19,18 +19,28 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
19
19
|
container: {},
|
|
20
20
|
label: {
|
|
21
21
|
position: "relative",
|
|
22
|
+
fontSize: ["mobile.xs", "desktop.sm"],
|
|
22
23
|
...(props.isLabelSrOnly ? srOnly : {}),
|
|
23
24
|
},
|
|
25
|
+
innerButton: {
|
|
26
|
+
display: "flex",
|
|
27
|
+
flexDir: "column",
|
|
28
|
+
alignItems: "start",
|
|
29
|
+
justifyContent: "start",
|
|
30
|
+
},
|
|
24
31
|
button: {
|
|
32
|
+
display: "flex",
|
|
25
33
|
appearance: "none",
|
|
34
|
+
width: "100%",
|
|
35
|
+
height: "54px",
|
|
26
36
|
borderTopRadius: "sm",
|
|
27
37
|
borderBottomRadius: props.isOpen ? 0 : "sm",
|
|
28
38
|
paddingY: 1.5,
|
|
29
39
|
paddingX: 3,
|
|
30
|
-
display: "flex",
|
|
31
40
|
justifyContent: "space-between",
|
|
32
41
|
alignItems: "center",
|
|
33
42
|
fontSize: "mobile.md",
|
|
43
|
+
h: 8,
|
|
34
44
|
...baseBorder("default", props),
|
|
35
45
|
_hover: {
|
|
36
46
|
...baseBorder("hover", props),
|
|
@@ -48,6 +58,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
48
58
|
...baseBorder("invalid", props),
|
|
49
59
|
},
|
|
50
60
|
},
|
|
61
|
+
placeholder: {},
|
|
51
62
|
arrowIcon: {},
|
|
52
63
|
}),
|
|
53
64
|
variants: {
|
|
@@ -2,7 +2,7 @@ import { anatomy } from "@chakra-ui/anatomy";
|
|
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
3
3
|
import { mode } from "@chakra-ui/theme-tools";
|
|
4
4
|
import { baseBorder } from "../utils/base-utils";
|
|
5
|
-
import { ghostBackground } from "../utils/ghost-utils";
|
|
5
|
+
import { ghostBackground, ghostText } from "../utils/ghost-utils";
|
|
6
6
|
import { surface } from "../utils/surface-utils";
|
|
7
7
|
|
|
8
8
|
const parts = anatomy("ListBox").parts(
|
|
@@ -32,7 +32,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
32
32
|
marginY: 1,
|
|
33
33
|
marginX: 1,
|
|
34
34
|
borderRadius: "sm",
|
|
35
|
-
|
|
35
|
+
...ghostText("default", props),
|
|
36
36
|
cursor: "pointer",
|
|
37
37
|
outline: "none",
|
|
38
38
|
_active: {
|
|
@@ -45,15 +45,15 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
45
45
|
...ghostBackground("selected", props),
|
|
46
46
|
},
|
|
47
47
|
_selected: {
|
|
48
|
-
...ghostBackground("
|
|
48
|
+
...ghostBackground("active", props),
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
label: {},
|
|
52
52
|
description: {
|
|
53
53
|
fontSize: ["mobile.xs", "desktop.xs"],
|
|
54
|
-
|
|
54
|
+
...ghostText("default", props),
|
|
55
55
|
"[aria-selected='true'] &": {
|
|
56
|
-
|
|
56
|
+
...ghostText("selected", props),
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
}),
|
|
@@ -13,9 +13,14 @@ const config = defineStyleConfig({
|
|
|
13
13
|
display: "block",
|
|
14
14
|
borderRadius: "md",
|
|
15
15
|
cursor: "pointer",
|
|
16
|
-
|
|
16
|
+
transitionProperty: "common",
|
|
17
|
+
transitionDuration: "fast",
|
|
18
|
+
"button&, a&, label&, &.is-clickable": {
|
|
19
|
+
...focusVisibleStyles(props),
|
|
20
|
+
},
|
|
17
21
|
_disabled: {
|
|
18
22
|
...baseBackground("disabled", props),
|
|
23
|
+
...baseBorder("disabled", props),
|
|
19
24
|
...baseText("disabled", props),
|
|
20
25
|
outline: "none",
|
|
21
26
|
pointerEvents: "none",
|
|
@@ -25,14 +25,14 @@ export function floatingBackground(
|
|
|
25
25
|
return {
|
|
26
26
|
backgroundColor: mode(
|
|
27
27
|
"floating.surface.hover.light",
|
|
28
|
-
|
|
28
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
|
|
29
29
|
)(props),
|
|
30
30
|
};
|
|
31
31
|
case "default":
|
|
32
32
|
return {
|
|
33
33
|
backgroundColor: mode(
|
|
34
|
-
"
|
|
35
|
-
|
|
34
|
+
"white",
|
|
35
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
|
|
36
36
|
)(props),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -29,7 +29,10 @@ export function ghostBackground(
|
|
|
29
29
|
};
|
|
30
30
|
case "selected": {
|
|
31
31
|
return {
|
|
32
|
-
backgroundColor: mode(
|
|
32
|
+
backgroundColor: mode(
|
|
33
|
+
"ghost.surface.selected.light",
|
|
34
|
+
"ghost.surface.selected.dark",
|
|
35
|
+
)(props),
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
case "default":
|
|
@@ -38,3 +41,18 @@ export function ghostBackground(
|
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
43
|
}
|
|
44
|
+
|
|
45
|
+
type GhostTextState = Subset<State, "default" | "selected">;
|
|
46
|
+
|
|
47
|
+
export function ghostText(state: GhostTextState, props: StyleFunctionProps) {
|
|
48
|
+
switch (state) {
|
|
49
|
+
case "selected":
|
|
50
|
+
return {
|
|
51
|
+
color: mode("ghost.text.light", "ghost.text.dark")(props),
|
|
52
|
+
};
|
|
53
|
+
default:
|
|
54
|
+
return {
|
|
55
|
+
color: mode("ghost.text.light", "ghost.text.dark")(props),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|