@vygruppen/spor-react 9.6.5 → 9.8.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.
@@ -22,6 +22,7 @@ export function baseBackground(
22
22
  };
23
23
  case "selected":
24
24
  return brandBackground("default", props);
25
+
25
26
  case "disabled":
26
27
  return surface("disabled", props);
27
28
  case "hover":
@@ -32,7 +33,7 @@ export function baseBackground(
32
33
 
33
34
  type BorderState = Subset<
34
35
  State,
35
- "hover" | "focus" | "disabled" | "selected" | "invalid" | "default"
36
+ "hover" | "focus" | "active" | "disabled" | "selected" | "invalid" | "default"
36
37
  >;
37
38
 
38
39
  export function baseBorder(state: BorderState, props: StyleFunctionProps) {
@@ -57,6 +58,12 @@ export function baseBorder(state: BorderState, props: StyleFunctionProps) {
57
58
  )(props),
58
59
  };
59
60
  }
61
+ case "active": {
62
+ return {
63
+ outline: "2px solid",
64
+ outlineColor: mode("base.outline.light", "base.outline.dark")(props),
65
+ };
66
+ }
60
67
  case "invalid": {
61
68
  return {
62
69
  outline: "2px solid",
@@ -38,7 +38,10 @@ export function floatingBackground(
38
38
  }
39
39
  }
40
40
 
41
- type FloatingBorderState = Subset<State, "default" | "hover" | "active">;
41
+ type FloatingBorderState = Subset<
42
+ State,
43
+ "default" | "hover" | "active" | "selected"
44
+ >;
42
45
  export function floatingBorder(
43
46
  state: FloatingBorderState,
44
47
  props: StyleFunctionProps,
@@ -52,6 +55,19 @@ export function floatingBorder(
52
55
  "floating.outline.hover.dark",
53
56
  )(props),
54
57
  };
58
+ case "selected":
59
+ return {
60
+ outline: "1px solid",
61
+ outlineColor: mode("outline.focus.light", "outline.focus.dark")(props),
62
+ };
63
+ case "active":
64
+ return {
65
+ outline: "1px solid",
66
+ outlineColor: mode(
67
+ "floating.outline.active.light",
68
+ "floating.outline.active.dark",
69
+ )(props),
70
+ };
55
71
  default:
56
72
  return {
57
73
  outline: "1px solid",
@@ -1,52 +0,0 @@
1
- import React from "react";
2
- import { Box, BoxProps, useStyleConfig } from "@chakra-ui/react";
3
-
4
- type PressableCardProps = Omit<BoxProps, "as"> & {
5
- variant: "floating" | "accent" | "base";
6
- size?: "sm" | "lg";
7
- as: "button" | "a" | "label";
8
- };
9
-
10
- /**
11
- * Renders a Pressable card.
12
- *
13
- * The most basic version looks like this:
14
- *
15
- * ```tsx
16
- * <PressableCard>
17
- * Content
18
- * </PressableCard>
19
- * ```
20
- *
21
- * There are lots of color schemes available. You can also set the size as either `sm` or `lg`. The default is `sm`.
22
- *
23
- * ```tsx
24
- * <PressableCard colorScheme="orange" size="lg">
25
- * A smaller card
26
- * </PressableCard>
27
- * ```
28
- *
29
- * Pressable cards can also be rendered as button, link or label – like a li (list item) or an article.
30
- * You do this by specifying the `as` prop. If no `as` is specified, button is chosen as default:
31
- *
32
- *
33
- * ```tsx
34
- * <PressableCard colorScheme="green" as="section">
35
- * This is now a <section /> element
36
- * </PressableCard>
37
- * ```
38
- */
39
- export const PressableCard = ({
40
- children,
41
- as = "button",
42
- size = "sm",
43
- variant = "base",
44
- ...props
45
- }: PressableCardProps) => {
46
- const styles = useStyleConfig("PressableCard", { variant, size });
47
- return (
48
- <Box as={as} __css={styles} {...props}>
49
- {children}
50
- </Box>
51
- );
52
- };
@@ -1,25 +0,0 @@
1
- import React from "react";
2
- import { Box, useStyleConfig } from "@chakra-ui/react";
3
- /**
4
- * Renders a static card.
5
- *
6
- * The most basic version looks like this:
7
- *
8
- * ```tsx
9
- * <StaticCard colorScheme="white">
10
- * Content
11
- * </StaticCard>
12
- * ```
13
- *
14
- * Static cards can also be rendered as whatever DOM element you want – like a li (list item) or an article. You do this by specifying the `as` prop:
15
- *
16
- * ```tsx
17
- * <StaticCard colorScheme="green" as="section">
18
- * This is now a <section /> element
19
- * </StaticCard>
20
- * ```
21
- */
22
- export const StaticCard = ({ colorScheme, ...props }: any) => {
23
- const styles = useStyleConfig("StaticCard", { colorScheme });
24
- return <Box __css={styles} {...props} />;
25
- };