@vygruppen/spor-react 3.1.0 → 3.1.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 +10 -10
- package/CHANGELOG.md +10 -0
- package/dist/{CountryCodeSelect-WPMTKT2L.mjs → CountryCodeSelect-PU2FEIUH.mjs} +1 -1
- package/dist/{chunk-V6MFUVYF.mjs → chunk-GIRK7GTN.mjs} +350 -325
- package/dist/index.d.ts +19 -19
- package/dist/index.js +540 -516
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/src/accordion/Expandable.tsx +2 -2
- package/src/alert/ExpandableAlert.tsx +2 -1
- package/src/datepicker/DateField.tsx +3 -1
- package/src/datepicker/DateTimeSegment.tsx +2 -1
- package/src/datepicker/TimeField.tsx +3 -1
- package/src/datepicker/TimePicker.tsx +4 -4
- package/src/input/Combobox.tsx +1 -0
- package/src/input/Popover.tsx +17 -9
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, 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, Tr, TravelTag, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, 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, Tr, TravelTag, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-GIRK7GTN.mjs';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"@vygruppen/spor-loader": "*",
|
28
28
|
"framer-motion": ">6.0.0",
|
29
29
|
"lottie-react": "^2.3.1",
|
30
|
-
"react-aria": "^3.
|
30
|
+
"react-aria": "^3.27.0",
|
31
31
|
"react-stately": "^3.20.0",
|
32
32
|
"react-swipeable": "^7.0.0"
|
33
33
|
},
|
@@ -12,7 +12,7 @@ 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 = AccordionProps & {
|
15
|
+
type ExpandableProps = Omit<AccordionProps, "title"> & {
|
16
16
|
/** The hidden content */
|
17
17
|
children: React.ReactNode;
|
18
18
|
/** The title that's shown inside the toggle button */
|
@@ -62,7 +62,7 @@ export const Expandable = ({
|
|
62
62
|
);
|
63
63
|
};
|
64
64
|
|
65
|
-
export type ExpandableItemProps = AccordionItemProps & {
|
65
|
+
export type ExpandableItemProps = Omit<AccordionItemProps, "title"> & {
|
66
66
|
/** The hidden content */
|
67
67
|
children: React.ReactNode;
|
68
68
|
/** The title that's shown inside the toggle button */
|
@@ -42,9 +42,10 @@ export const ExpandableAlert = ({
|
|
42
42
|
headingLevel = "h3",
|
43
43
|
defaultOpen = false,
|
44
44
|
onToggle = () => {},
|
45
|
+
...boxProps
|
45
46
|
}: ExpandableAlertProps) => {
|
46
47
|
return (
|
47
|
-
<BaseAlert variant={variant} paddingX={0} paddingY={0} padding={0}>
|
48
|
+
<BaseAlert variant={variant} paddingX={0} paddingY={0} padding={0} {...boxProps}>
|
48
49
|
<Accordion
|
49
50
|
onChange={(expandedIndex) => onToggle(expandedIndex === 0)}
|
50
51
|
defaultIndex={defaultOpen ? 0 : -1}
|
@@ -46,11 +46,13 @@ export const DateField = forwardRef<HTMLDivElement, DateFieldProps>(
|
|
46
46
|
{...props.labelProps}
|
47
47
|
{...labelProps}
|
48
48
|
sx={styles.inputLabel}
|
49
|
+
position="absolute"
|
50
|
+
paddingTop="2px"
|
49
51
|
>
|
50
52
|
{props.label}
|
51
53
|
</FormLabel>
|
52
54
|
)}
|
53
|
-
<Flex {...fieldProps}>
|
55
|
+
<Flex {...fieldProps} paddingTop="3" paddingBottom="0.5">
|
54
56
|
{state.segments.map((segment, i) => (
|
55
57
|
<DateTimeSegment
|
56
58
|
ref={i === 0 ? ref : undefined}
|
@@ -2,6 +2,7 @@ import { Box, useMultiStyleConfig } from "@chakra-ui/react";
|
|
2
2
|
import React, { RefObject, forwardRef, useRef } from "react";
|
3
3
|
import { useDateSegment } from "react-aria";
|
4
4
|
import { DateFieldState, DateSegment } from "react-stately";
|
5
|
+
import { colors } from "../theme/foundations";
|
5
6
|
|
6
7
|
type DateTimeSegmentProps = {
|
7
8
|
segment: DateSegment;
|
@@ -29,7 +30,6 @@ export const DateTimeSegment = forwardRef<HTMLDivElement, DateTimeSegmentProps>(
|
|
29
30
|
isPlaceholder: segment.isPlaceholder,
|
30
31
|
isEditable: segment.isEditable,
|
31
32
|
});
|
32
|
-
|
33
33
|
return (
|
34
34
|
<Box
|
35
35
|
{...segmentProps}
|
@@ -38,6 +38,7 @@ export const DateTimeSegment = forwardRef<HTMLDivElement, DateTimeSegmentProps>(
|
|
38
38
|
...segmentProps.style,
|
39
39
|
fontVariantNumeric: "tabular-nums",
|
40
40
|
boxSizing: "content-box",
|
41
|
+
color: colors.darkGrey,
|
41
42
|
}}
|
42
43
|
paddingX="1px"
|
43
44
|
textAlign="end"
|
@@ -29,10 +29,12 @@ export const TimeField = ({ state, ...props }: TimeFieldProps) => {
|
|
29
29
|
marginBottom={0}
|
30
30
|
fontSize="mobile.xs"
|
31
31
|
cursor="text"
|
32
|
+
position="absolute"
|
33
|
+
paddingTop="2px"
|
32
34
|
>
|
33
35
|
{props.label}
|
34
36
|
</FormLabel>
|
35
|
-
<Flex {...fieldProps} ref={ref}>
|
37
|
+
<Flex {...fieldProps} ref={ref} paddingTop="3" paddingBottom="0.5">
|
36
38
|
{state.segments.map((segment) => (
|
37
39
|
<DateTimeSegment key={segment.type} segment={segment} state={state} />
|
38
40
|
))}
|
@@ -2,8 +2,8 @@ import { BoxProps, useFormControlContext } from "@chakra-ui/react";
|
|
2
2
|
import { CalendarDateTime } from "@internationalized/date";
|
3
3
|
import { TimeValue } from "@react-types/datepicker";
|
4
4
|
import {
|
5
|
-
|
6
|
-
|
5
|
+
DropdownLeftFill18Icon,
|
6
|
+
DropdownRightFill18Icon,
|
7
7
|
} from "@vygruppen/spor-icon-react";
|
8
8
|
import React from "react";
|
9
9
|
import { useTimeFieldState } from "react-stately";
|
@@ -140,7 +140,7 @@ export const TimePicker = ({
|
|
140
140
|
borderRadius="xs"
|
141
141
|
aria-label={backwardsLabel}
|
142
142
|
title={backwardsLabel}
|
143
|
-
icon={<
|
143
|
+
icon={<DropdownLeftFill18Icon />}
|
144
144
|
onClick={handleBackwardsClick}
|
145
145
|
isDisabled={isDisabled}
|
146
146
|
style={isDisabled ? { backgroundColor: "transparent" } : {}}
|
@@ -152,7 +152,7 @@ export const TimePicker = ({
|
|
152
152
|
borderRadius="xs"
|
153
153
|
aria-label={forwardsLabel}
|
154
154
|
title={forwardsLabel}
|
155
|
-
icon={<
|
155
|
+
icon={<DropdownRightFill18Icon />}
|
156
156
|
onClick={handleForwardClick}
|
157
157
|
isDisabled={isDisabled}
|
158
158
|
style={isDisabled ? { backgroundColor: "transparent" } : {}}
|
package/src/input/Combobox.tsx
CHANGED
package/src/input/Popover.tsx
CHANGED
@@ -81,18 +81,26 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
81
81
|
state
|
82
82
|
);
|
83
83
|
|
84
|
+
const popoverBox = (
|
85
|
+
<Box
|
86
|
+
{...popoverProps}
|
87
|
+
ref={popoverRef}
|
88
|
+
minWidth={triggerRef.current?.clientWidth ?? "auto"}
|
89
|
+
marginLeft={-2}
|
90
|
+
>
|
91
|
+
<DismissButton onDismiss={state.close} />
|
92
|
+
{children}
|
93
|
+
<DismissButton onDismiss={state.close} />
|
94
|
+
</Box>
|
95
|
+
);
|
96
|
+
|
97
|
+
if (isNonModal) {
|
98
|
+
return popoverBox;
|
99
|
+
}
|
84
100
|
return (
|
85
101
|
<Overlay>
|
86
102
|
{hasBackdrop && <Box {...underlayProps} position="fixed" inset="0" />}
|
87
|
-
|
88
|
-
{...popoverProps}
|
89
|
-
ref={popoverRef}
|
90
|
-
minWidth={triggerRef.current?.clientWidth ?? "auto"}
|
91
|
-
>
|
92
|
-
<DismissButton onDismiss={state.close} />
|
93
|
-
{children}
|
94
|
-
<DismissButton onDismiss={state.close} />
|
95
|
-
</Box>
|
103
|
+
{popoverBox}
|
96
104
|
</Overlay>
|
97
105
|
);
|
98
106
|
}
|