@vygruppen/spor-react 8.2.1 → 8.3.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 +10 -10
- package/CHANGELOG.md +8 -0
- package/dist/{CountryCodeSelect-NEASN3EC.mjs → CountryCodeSelect-DYAFPSID.mjs} +1 -1
- package/dist/{chunk-AKOJGLTQ.mjs → chunk-42ZK3WXN.mjs} +23 -8
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +22 -7
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/accordion/Expandable.tsx +22 -2
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@8.
|
2
|
+
> @vygruppen/spor-react@8.3.0 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -10,13 +10,13 @@
|
|
10
10
|
[34mESM[39m Build start
|
11
11
|
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
|
12
12
|
[34mDTS[39m Build start
|
13
|
-
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-
|
14
|
-
[32mCJS[39m [1mdist/index.js [22m[32m504.
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
13
|
+
"Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-42ZK3WXN.mjs".
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m504.82 KB[39m
|
15
|
+
[32mCJS[39m ⚡️ Build success in 2190ms
|
16
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.01 KB[39m
|
17
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
18
|
-
[32mESM[39m [1mdist/chunk-
|
19
|
-
[32mESM[39m ⚡️ Build success in
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
21
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m271.
|
22
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m271.
|
17
|
+
[32mESM[39m [1mdist/CountryCodeSelect-DYAFPSID.mjs [22m[32m1.19 KB[39m
|
18
|
+
[32mESM[39m [1mdist/chunk-42ZK3WXN.mjs [22m[32m396.72 KB[39m
|
19
|
+
[32mESM[39m ⚡️ Build success in 2192ms
|
20
|
+
[32mDTS[39m ⚡️ Build success in 10757ms
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m271.82 KB[39m
|
22
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m271.82 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# @vygruppen/spor-react
|
2
2
|
|
3
|
+
## 8.3.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- f984752: Expandable: Add defaultOpen, isOpen and onChange props, and remove undocumented defaultIndex and index props.
|
8
|
+
|
9
|
+
This might be breaking if you were using these props, so make sure to double check while updating.
|
10
|
+
|
3
11
|
## 8.2.1
|
4
12
|
|
5
13
|
### Patch Changes
|
@@ -814,17 +814,32 @@ var Expandable = ({
|
|
814
814
|
title,
|
815
815
|
leftIcon,
|
816
816
|
size: size2 = "md",
|
817
|
+
defaultOpen,
|
818
|
+
isOpen,
|
819
|
+
onChange = () => {
|
820
|
+
},
|
817
821
|
...rest
|
818
822
|
}) => {
|
819
|
-
return /* @__PURE__ */ React69__default.createElement(
|
820
|
-
|
823
|
+
return /* @__PURE__ */ React69__default.createElement(
|
824
|
+
Accordion,
|
821
825
|
{
|
822
|
-
|
823
|
-
|
824
|
-
|
826
|
+
...rest,
|
827
|
+
index: isOpen ? 0 : void 0,
|
828
|
+
defaultIndex: defaultOpen ? 0 : void 0,
|
829
|
+
allowMultiple: true,
|
830
|
+
size: size2,
|
831
|
+
onChange: (expandedIndex) => onChange(expandedIndex === 0)
|
825
832
|
},
|
826
|
-
|
827
|
-
|
833
|
+
/* @__PURE__ */ React69__default.createElement(
|
834
|
+
ExpandableItem,
|
835
|
+
{
|
836
|
+
headingLevel,
|
837
|
+
title,
|
838
|
+
leftIcon
|
839
|
+
},
|
840
|
+
children
|
841
|
+
)
|
842
|
+
);
|
828
843
|
};
|
829
844
|
var ExpandableItem = ({
|
830
845
|
children,
|
@@ -3435,7 +3450,7 @@ var texts14 = createTexts({
|
|
3435
3450
|
sv: "Telefonnummer"
|
3436
3451
|
}
|
3437
3452
|
});
|
3438
|
-
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-
|
3453
|
+
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-DYAFPSID.mjs'));
|
3439
3454
|
var Radio = forwardRef((props, ref) => {
|
3440
3455
|
return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
|
3441
3456
|
});
|
package/dist/index.d.mts
CHANGED
@@ -81,7 +81,7 @@ type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
|
|
81
81
|
declare const Accordion: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", AccordionProps>;
|
82
82
|
|
83
83
|
type HeadingLevel = "h2" | "h3" | "h4" | "h5" | "h6";
|
84
|
-
type ExpandableProps = Omit<AccordionProps, "title"> & {
|
84
|
+
type ExpandableProps = Omit<AccordionProps, "title" | "index" | "defaultIndex" | "onChange"> & {
|
85
85
|
/** The hidden content */
|
86
86
|
children: React.ReactNode;
|
87
87
|
/** The title that's shown inside the toggle button */
|
@@ -97,6 +97,12 @@ type ExpandableProps = Omit<AccordionProps, "title"> & {
|
|
97
97
|
* If the size is set to `lg`, the icon should be 30px.
|
98
98
|
*/
|
99
99
|
leftIcon?: React.ReactNode;
|
100
|
+
/** Controlled value of whether the accordion is open or not */
|
101
|
+
isOpen?: boolean;
|
102
|
+
/** Default value of when the accordion is open or not */
|
103
|
+
defaultOpen?: boolean;
|
104
|
+
/** Callback for when the expandable opens or closes */
|
105
|
+
onChange?: (isOpen: boolean) => void;
|
100
106
|
};
|
101
107
|
/**
|
102
108
|
* A standalone expandable component.
|
@@ -110,7 +116,7 @@ type ExpandableProps = Omit<AccordionProps, "title"> & {
|
|
110
116
|
* </Expandable>
|
111
117
|
* ```
|
112
118
|
*/
|
113
|
-
declare const Expandable: ({ children, headingLevel, title, leftIcon, size, ...rest }: ExpandableProps) => React.JSX.Element;
|
119
|
+
declare const Expandable: ({ children, headingLevel, title, leftIcon, size, defaultOpen, isOpen, onChange, ...rest }: ExpandableProps) => React.JSX.Element;
|
114
120
|
type ExpandableItemProps = Omit<AccordionItemProps, "title"> & {
|
115
121
|
/** The hidden content */
|
116
122
|
children: React.ReactNode;
|
package/dist/index.d.ts
CHANGED
@@ -81,7 +81,7 @@ type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
|
|
81
81
|
declare const Accordion: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", AccordionProps>;
|
82
82
|
|
83
83
|
type HeadingLevel = "h2" | "h3" | "h4" | "h5" | "h6";
|
84
|
-
type ExpandableProps = Omit<AccordionProps, "title"> & {
|
84
|
+
type ExpandableProps = Omit<AccordionProps, "title" | "index" | "defaultIndex" | "onChange"> & {
|
85
85
|
/** The hidden content */
|
86
86
|
children: React.ReactNode;
|
87
87
|
/** The title that's shown inside the toggle button */
|
@@ -97,6 +97,12 @@ type ExpandableProps = Omit<AccordionProps, "title"> & {
|
|
97
97
|
* If the size is set to `lg`, the icon should be 30px.
|
98
98
|
*/
|
99
99
|
leftIcon?: React.ReactNode;
|
100
|
+
/** Controlled value of whether the accordion is open or not */
|
101
|
+
isOpen?: boolean;
|
102
|
+
/** Default value of when the accordion is open or not */
|
103
|
+
defaultOpen?: boolean;
|
104
|
+
/** Callback for when the expandable opens or closes */
|
105
|
+
onChange?: (isOpen: boolean) => void;
|
100
106
|
};
|
101
107
|
/**
|
102
108
|
* A standalone expandable component.
|
@@ -110,7 +116,7 @@ type ExpandableProps = Omit<AccordionProps, "title"> & {
|
|
110
116
|
* </Expandable>
|
111
117
|
* ```
|
112
118
|
*/
|
113
|
-
declare const Expandable: ({ children, headingLevel, title, leftIcon, size, ...rest }: ExpandableProps) => React.JSX.Element;
|
119
|
+
declare const Expandable: ({ children, headingLevel, title, leftIcon, size, defaultOpen, isOpen, onChange, ...rest }: ExpandableProps) => React.JSX.Element;
|
114
120
|
type ExpandableItemProps = Omit<AccordionItemProps, "title"> & {
|
115
121
|
/** The hidden content */
|
116
122
|
children: React.ReactNode;
|
package/dist/index.js
CHANGED
@@ -149,17 +149,32 @@ var init_Expandable = __esm({
|
|
149
149
|
title,
|
150
150
|
leftIcon,
|
151
151
|
size: size2 = "md",
|
152
|
+
defaultOpen,
|
153
|
+
isOpen,
|
154
|
+
onChange = () => {
|
155
|
+
},
|
152
156
|
...rest
|
153
157
|
}) => {
|
154
|
-
return /* @__PURE__ */ React69__namespace.default.createElement(
|
155
|
-
exports.
|
158
|
+
return /* @__PURE__ */ React69__namespace.default.createElement(
|
159
|
+
exports.Accordion,
|
156
160
|
{
|
157
|
-
|
158
|
-
|
159
|
-
|
161
|
+
...rest,
|
162
|
+
index: isOpen ? 0 : void 0,
|
163
|
+
defaultIndex: defaultOpen ? 0 : void 0,
|
164
|
+
allowMultiple: true,
|
165
|
+
size: size2,
|
166
|
+
onChange: (expandedIndex) => onChange(expandedIndex === 0)
|
160
167
|
},
|
161
|
-
|
162
|
-
|
168
|
+
/* @__PURE__ */ React69__namespace.default.createElement(
|
169
|
+
exports.ExpandableItem,
|
170
|
+
{
|
171
|
+
headingLevel,
|
172
|
+
title,
|
173
|
+
leftIcon
|
174
|
+
},
|
175
|
+
children
|
176
|
+
)
|
177
|
+
);
|
163
178
|
};
|
164
179
|
exports.ExpandableItem = ({
|
165
180
|
children,
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-42ZK3WXN.mjs';
|
package/package.json
CHANGED
@@ -12,7 +12,10 @@ import { Accordion, AccordionProps } from "./Accordion";
|
|
12
12
|
import { useAccordionContext } from "./AccordionContext";
|
13
13
|
|
14
14
|
type HeadingLevel = "h2" | "h3" | "h4" | "h5" | "h6";
|
15
|
-
type ExpandableProps = Omit<
|
15
|
+
type ExpandableProps = Omit<
|
16
|
+
AccordionProps,
|
17
|
+
"title" | "index" | "defaultIndex" | "onChange"
|
18
|
+
> & {
|
16
19
|
/** The hidden content */
|
17
20
|
children: React.ReactNode;
|
18
21
|
/** The title that's shown inside the toggle button */
|
@@ -28,6 +31,13 @@ type ExpandableProps = Omit<AccordionProps, "title"> & {
|
|
28
31
|
* If the size is set to `lg`, the icon should be 30px.
|
29
32
|
*/
|
30
33
|
leftIcon?: React.ReactNode;
|
34
|
+
|
35
|
+
/** Controlled value of whether the accordion is open or not */
|
36
|
+
isOpen?: boolean;
|
37
|
+
/** Default value of when the accordion is open or not */
|
38
|
+
defaultOpen?: boolean;
|
39
|
+
/** Callback for when the expandable opens or closes */
|
40
|
+
onChange?: (isOpen: boolean) => void;
|
31
41
|
};
|
32
42
|
/**
|
33
43
|
* A standalone expandable component.
|
@@ -47,10 +57,20 @@ export const Expandable = ({
|
|
47
57
|
title,
|
48
58
|
leftIcon,
|
49
59
|
size = "md",
|
60
|
+
defaultOpen,
|
61
|
+
isOpen,
|
62
|
+
onChange = () => {},
|
50
63
|
...rest
|
51
64
|
}: ExpandableProps) => {
|
52
65
|
return (
|
53
|
-
<Accordion
|
66
|
+
<Accordion
|
67
|
+
{...rest}
|
68
|
+
index={isOpen ? 0 : undefined}
|
69
|
+
defaultIndex={defaultOpen ? 0 : undefined}
|
70
|
+
allowMultiple={true}
|
71
|
+
size={size}
|
72
|
+
onChange={(expandedIndex) => onChange(expandedIndex === 0)}
|
73
|
+
>
|
54
74
|
<ExpandableItem
|
55
75
|
headingLevel={headingLevel}
|
56
76
|
title={title}
|