@vygruppen/spor-react 12.10.5 → 12.11.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
3
  "type": "module",
4
- "version": "12.10.5",
4
+ "version": "12.11.0",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -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 />}
@@ -145,7 +145,7 @@ export const DrawerFullScreenHeader = forwardRef<
145
145
  HTMLDivElement,
146
146
  DrawerFullScreenHeaderProps
147
147
  >((props, ref) => {
148
- const { backTrigger = true, closeTrigger = true, title } = props;
148
+ const { backTrigger = true, closeTrigger = true, children } = props;
149
149
  return (
150
150
  <ChakraDrawer.Header {...props} ref={ref} asChild>
151
151
  <Grid templateColumns="1fr auto 1fr" height="auto" paddingX="8">
@@ -153,7 +153,7 @@ export const DrawerFullScreenHeader = forwardRef<
153
153
  {backTrigger && <DrawerBackTrigger />}
154
154
  </GridItem>
155
155
  <GridItem width="full" alignSelf="end" asChild>
156
- {title && <DrawerTitle>{title}</DrawerTitle>}
156
+ {children && <DrawerTitle>{children}</DrawerTitle>}
157
157
  </GridItem>
158
158
  {closeTrigger && (
159
159
  <GridItem width="full" alignSelf="end">
@@ -21,8 +21,10 @@ export type DrawerProps = Omit<
21
21
  children: React.ReactNode;
22
22
  };
23
23
 
24
- export type DrawerFullScreenHeaderProps = ChakraDrawer.HeaderProps & {
24
+ export type DrawerFullScreenHeaderProps = Omit<
25
+ ChakraDrawer.HeaderProps,
26
+ "title"
27
+ > & {
25
28
  backTrigger?: boolean;
26
29
  closeTrigger?: boolean;
27
- title?: string;
28
30
  };
@@ -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}