@vygruppen/spor-react 12.7.1 → 12.8.1
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 +13 -0
- package/dist/index.cjs +174 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -13
- package/dist/index.d.ts +15 -13
- package/dist/index.mjs +61 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/input/CheckboxGroup.tsx +17 -28
- package/src/input/Combobox.tsx +5 -4
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/Field.tsx +5 -2
- package/src/input/Select.tsx +3 -2
- package/src/theme/slot-recipes/field.ts +1 -1
- package/src/theme/slot-recipes/select.ts +2 -0
package/package.json
CHANGED
@@ -1,21 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
CheckboxGroupProps as ChakraCheckboxGroupProps,
|
4
|
-
Stack,
|
5
|
-
} from "@chakra-ui/react";
|
6
|
-
import React, { forwardRef } from "react";
|
1
|
+
import { CheckboxGroup as ChakraCheckboxGroup, Stack } from "@chakra-ui/react";
|
2
|
+
import React from "react";
|
7
3
|
|
8
|
-
export type CheckboxGroupProps =
|
9
|
-
|
10
|
-
"colorPalette" | "size" | "variant"
|
4
|
+
export type CheckboxGroupProps = React.ComponentProps<
|
5
|
+
typeof ChakraCheckboxGroup
|
11
6
|
> & {
|
12
|
-
|
13
|
-
direction?: "row" | "column";
|
14
|
-
children: React.ReactNode;
|
15
|
-
/* Defaults to 1 */
|
16
|
-
gap?: number | string;
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
18
|
-
[key: string]: any; //Find a way to not use type any
|
7
|
+
direction: "row" | "column"; // Defaults to row
|
19
8
|
};
|
20
9
|
/**
|
21
10
|
* Used to group several checkboxes together. You can pass the default value, as well as whether or not they're all disabled
|
@@ -36,19 +25,19 @@ export type CheckboxGroupProps = Exclude<
|
|
36
25
|
* <Checkbox>Business</Checkbox>
|
37
26
|
* <Checkbox>First Class</Checkbox>
|
38
27
|
* </CheckboxGroup>
|
28
|
+
* ```
|
39
29
|
*/
|
40
30
|
|
41
|
-
export const CheckboxGroup =
|
42
|
-
|
43
|
-
|
31
|
+
export const CheckboxGroup = (props: CheckboxGroupProps) => {
|
32
|
+
// Forwardref caues issue with prop types not working. Forwardref is unessessary here, as ChakraCheckbox already has a ref prop and is deprecated in react 19.
|
33
|
+
const { direction = "row", children, gap = 1, ...rest } = props;
|
44
34
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
);
|
35
|
+
return (
|
36
|
+
<ChakraCheckboxGroup {...rest}>
|
37
|
+
<Stack direction={direction} gap={gap}>
|
38
|
+
{children}
|
39
|
+
</Stack>
|
40
|
+
</ChakraCheckboxGroup>
|
41
|
+
);
|
42
|
+
};
|
54
43
|
CheckboxGroup.displayName = "CheckboxGroup";
|
package/src/input/Combobox.tsx
CHANGED
@@ -56,10 +56,10 @@ export const Combobox = (props: ComboboxProps<object>) => {
|
|
56
56
|
loading,
|
57
57
|
leftIcon,
|
58
58
|
rightIcon,
|
59
|
-
borderBottomLeftRadius
|
60
|
-
borderBottomRightRadius
|
61
|
-
borderTopLeftRadius
|
62
|
-
borderTopRightRadius
|
59
|
+
borderBottomLeftRadius,
|
60
|
+
borderBottomRightRadius,
|
61
|
+
borderTopLeftRadius,
|
62
|
+
borderTopRightRadius,
|
63
63
|
marginBottom,
|
64
64
|
marginTop,
|
65
65
|
marginX,
|
@@ -171,6 +171,7 @@ export const Combobox = (props: ComboboxProps<object>) => {
|
|
171
171
|
)
|
172
172
|
}
|
173
173
|
placeholder=""
|
174
|
+
data-attachable
|
174
175
|
/>
|
175
176
|
<span aria-hidden="true" data-trigger="multiselect"></span>
|
176
177
|
{state.isOpen && !loading && (
|
@@ -55,7 +55,7 @@ export const CountryCodeSelect = forwardRef<
|
|
55
55
|
collection={callingCodes}
|
56
56
|
lazyMount
|
57
57
|
aria-label={t(texts.countryCode)}
|
58
|
-
|
58
|
+
sideRadiusVariant={"rightSideSquare"}
|
59
59
|
>
|
60
60
|
{callingCodes.items.map((code) => (
|
61
61
|
<SelectItem as={"option"} key={code.label} item={code}>
|
package/src/input/Field.tsx
CHANGED
@@ -28,7 +28,10 @@ export type FieldBaseProps = {
|
|
28
28
|
floatingLabel?: boolean;
|
29
29
|
};
|
30
30
|
|
31
|
-
export type FieldProps = Omit<
|
31
|
+
export type FieldProps = Omit<
|
32
|
+
ChakraField.RootProps,
|
33
|
+
"label" | "onChange" | "onBlur" | "onFocus" | "onClick" | "children"
|
34
|
+
> &
|
32
35
|
React.PropsWithChildren<FieldVariantProps> &
|
33
36
|
FieldBaseProps;
|
34
37
|
|
@@ -68,7 +71,7 @@ export const Field = React.forwardRef<HTMLDivElement, FieldProps>(
|
|
68
71
|
const styles = recipe();
|
69
72
|
|
70
73
|
return (
|
71
|
-
<Stack gap="2" ref={ref} {...rest}>
|
74
|
+
<Stack gap="2" ref={ref} width="100%" {...rest}>
|
72
75
|
<ChakraField.Root
|
73
76
|
disabled={disabled}
|
74
77
|
invalid={invalid}
|
package/src/input/Select.tsx
CHANGED
@@ -30,8 +30,9 @@ export type SelectProps = ChakraSelectRootProps &
|
|
30
30
|
/**
|
31
31
|
* A Select component.
|
32
32
|
*
|
33
|
-
* This component is useful to choose an item from a dropdown list of items. The list has
|
34
|
-
*
|
33
|
+
* This component is useful to choose an item from a dropdown list of items. The list has two different variants, core, floating and floating.
|
34
|
+
* It also has a sideRadiusVariant that can be used to make the sides square, rightSideSquare, leftSideSquare.
|
35
|
+
* The sideRadiusVariant is useful in attachecdInput for example in the PhoneNumberInput and CountryCodeSelect components.
|
35
36
|
*
|
36
37
|
* @example
|
37
38
|
* ```tsx
|