@vygruppen/spor-react 12.10.4 → 12.10.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
3
  "type": "module",
4
- "version": "12.10.4",
4
+ "version": "12.10.6",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -47,8 +47,8 @@
47
47
  "react-swipeable": "^7.0.1",
48
48
  "usehooks-ts": "^3.1.0",
49
49
  "@vygruppen/spor-design-tokens": "4.0.8",
50
- "@vygruppen/spor-loader": "0.7.0",
51
- "@vygruppen/spor-icon-react": "4.2.1"
50
+ "@vygruppen/spor-icon-react": "4.2.1",
51
+ "@vygruppen/spor-loader": "0.7.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@react-types/datepicker": "^3.10.0",
@@ -75,7 +75,7 @@ export const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(
75
75
  const sizeNotFull = size !== "full";
76
76
  return (
77
77
  <Portal disabled={!portalled} container={portalRef}>
78
- <ChakraDrawer.Positioner>
78
+ <ChakraDrawer.Positioner asChild>
79
79
  <Box {...handlers} width="100%">
80
80
  <ChakraDrawer.Content ref={ref} {...rest}>
81
81
  {sizeNotFull && placement === "bottom" && <CloseDrawerLine />}
@@ -1,5 +1,5 @@
1
1
  import { Drawer as ChakraDrawer, RecipeVariantProps } from "@chakra-ui/react";
2
- import { PropsWithChildren } from "react";
2
+ import { PropsWithChildren, ReactNode } from "react";
3
3
 
4
4
  import { drawerSlotRecipe } from "@/theme/slot-recipes/drawer";
5
5
 
@@ -24,5 +24,5 @@ export type DrawerProps = Omit<
24
24
  export type DrawerFullScreenHeaderProps = ChakraDrawer.HeaderProps & {
25
25
  backTrigger?: boolean;
26
26
  closeTrigger?: boolean;
27
- title?: string;
27
+ title?: ReactNode;
28
28
  };
@@ -34,7 +34,9 @@ export const AttachedInputs = forwardRef<HTMLDivElement, AttachedInputsProps>(
34
34
  const [recipeProps, restProps] = recipe.splitVariantProps(props);
35
35
  const styles = recipe(recipeProps);
36
36
 
37
- return <Group ref={ref} css={styles} attached {...restProps} />;
37
+ return (
38
+ <Group ref={ref} css={styles} attached isolation="auto" {...restProps} />
39
+ );
38
40
  },
39
41
  );
40
42
  AttachedInputs.displayName = "AttachedInputs";
@@ -129,10 +129,4 @@ const texts = createTexts({
129
129
  en: "Phone number (optional)",
130
130
  sv: "Telefonnummer (valfritt)",
131
131
  },
132
- countryCodeLabel: {
133
- nb: "Landskode",
134
- nn: "Landskode",
135
- en: "Country code",
136
- sv: "Landskod",
137
- },
138
132
  });
@@ -76,16 +76,35 @@ const useLabelHeight = (label: ReactNode | undefined) => {
76
76
 
77
77
  export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
78
78
  (props, ref) => {
79
- const { label, variant = "core", ...fieldProps } = props;
79
+ const {
80
+ label,
81
+ variant = "core",
82
+ invalid,
83
+ required,
84
+ errorText,
85
+ readOnly,
86
+ helperText,
87
+ floatingLabel,
88
+ ...restProps
89
+ } = props;
80
90
  const recipe = useRecipe({ key: "textarea" });
81
91
  const styles = recipe({ variant });
82
92
 
83
93
  const { labelRef, labelHeight } = useLabelHeight(label);
84
94
 
85
95
  return (
86
- <Field {...fieldProps} position="relative">
96
+ <Field
97
+ label={label}
98
+ errorText={errorText}
99
+ helperText={helperText}
100
+ invalid={invalid}
101
+ required={required}
102
+ readOnly={readOnly}
103
+ floatingLabel={floatingLabel}
104
+ position="relative"
105
+ >
87
106
  <ChakraTextarea
88
- {...props}
107
+ {...restProps}
89
108
  css={styles}
90
109
  className="peer"
91
110
  ref={ref}
@@ -124,6 +124,7 @@ export const TravelTag = forwardRef<HTMLDivElement, TravelTagProps>(
124
124
  aria-disabled={disabled}
125
125
  ref={ref}
126
126
  className={clsx("light", rest.className)}
127
+ backgroundColor={backgroundColor}
127
128
  {...rest}
128
129
  >
129
130
  <LineIcon
@@ -34,7 +34,7 @@ export const createToast = ({
34
34
  text,
35
35
  variant,
36
36
  id,
37
- duration = 600_000,
37
+ duration = 6000,
38
38
  }: ToastProps) =>
39
39
  toaster.create({
40
40
  description: text,