@vygruppen/spor-react 3.4.4 → 3.5.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 +13 -12
- package/CHANGELOG.md +16 -0
- package/dist/CountryCodeSelect-IS3VUSPZ.mjs +40 -0
- package/dist/{chunk-QBIZVUPL.mjs → chunk-HZ6V7HFA.mjs} +427 -287
- package/dist/index.d.mts +7092 -0
- package/dist/index.d.ts +72 -49
- package/dist/index.js +552 -6918
- package/dist/index.mjs +1 -1
- package/package.json +7 -6
- package/src/breadcrumb/Breadcrumb.tsx +37 -0
- package/src/breadcrumb/index.tsx +1 -0
- package/src/button/Button.tsx +1 -1
- package/src/button/FloatingActionButton.tsx +1 -1
- package/src/button/IconButton.tsx +1 -1
- package/src/datepicker/DateRangePicker.tsx +2 -2
- package/src/index.tsx +1 -0
- package/src/input/ChoiceChip.tsx +1 -1
- package/src/input/PasswordInput.tsx +1 -1
- package/src/input/SearchInput.tsx +3 -3
- package/src/layout/Divider.tsx +1 -1
- package/src/loader/ColorSpinner.tsx +1 -1
- package/src/loader/ContentLoader.tsx +1 -1
- package/src/loader/LightSpinner.tsx +4 -2
- package/src/stepper/StepperStep.tsx +1 -1
- package/src/theme/components/breadcrumb.ts +47 -0
- package/src/theme/components/index.ts +1 -0
- package/dist/CountryCodeSelect-7GGNROZW.mjs +0 -6522
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, Breadcrumb, BreadcrumbItem, BreadcrumbLink, 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-HZ6V7HFA.mjs';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.5.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -25,18 +25,19 @@
|
|
25
25
|
"@vygruppen/spor-design-tokens": "*",
|
26
26
|
"@vygruppen/spor-icon-react": "*",
|
27
27
|
"@vygruppen/spor-loader": "*",
|
28
|
-
"
|
28
|
+
"awesome-phonenumber": "^5.10.0",
|
29
|
+
"framer-motion": "^10.16.4",
|
29
30
|
"lottie-react": "^2.3.1",
|
30
31
|
"react-aria": "^3.27.0",
|
31
|
-
"react-stately": "^3.
|
32
|
+
"react-stately": "^3.25.0",
|
32
33
|
"react-swipeable": "^7.0.0"
|
33
34
|
},
|
34
35
|
"devDependencies": {
|
35
|
-
"@testing-library/jest-dom": "^
|
36
|
-
"@testing-library/react": "^
|
36
|
+
"@testing-library/jest-dom": "^6.1.3",
|
37
|
+
"@testing-library/react": "^14.0.0",
|
37
38
|
"react": "^18.2.0",
|
38
39
|
"react-dom": "^18.2.0",
|
39
|
-
"tsup": "^
|
40
|
+
"tsup": "^7.2.0",
|
40
41
|
"vitest": "^0.26.3",
|
41
42
|
"vitest-axe": "^0.1.0",
|
42
43
|
"vitest-canvas-mock": "^0.2.0"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
Breadcrumb as ChakraBreadcrumb,
|
3
|
+
BreadcrumbItem as ChakraBreadcrumbItem,
|
4
|
+
BreadcrumbLink as ChakraBreadcrumbLink,
|
5
|
+
BreadcrumbProps as ChakraBreadcrumbProps,
|
6
|
+
} from "@chakra-ui/react";
|
7
|
+
import { DropdownRightFill18Icon } from "@vygruppen/spor-icon-react";
|
8
|
+
import React from "react";
|
9
|
+
|
10
|
+
type BreadcrumbProps = ChakraBreadcrumbProps;
|
11
|
+
/**
|
12
|
+
* A breadcrumb component.
|
13
|
+
*
|
14
|
+
* Used to create customizable breadcrumbs.
|
15
|
+
*
|
16
|
+
* ```tsx
|
17
|
+
* <Breadcrumb>
|
18
|
+
* <BreadcrumbItem>
|
19
|
+
* <BreadcrumbLink href="/">Home</BreadcrumbLink>
|
20
|
+
* </BreadcrumbItem>
|
21
|
+
* <BreadcrumbItem isCurrentPage={true}>
|
22
|
+
* <BreadcrumbLink href="/about">About</BreadcrumbLink>
|
23
|
+
* </BreadcrumbItem>
|
24
|
+
* </Breadcrumb>
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
export const Breadcrumb = (props: BreadcrumbProps) => {
|
28
|
+
return (
|
29
|
+
<ChakraBreadcrumb
|
30
|
+
separator={<DropdownRightFill18Icon color="blackAlpha.400" />}
|
31
|
+
{...props}
|
32
|
+
/>
|
33
|
+
);
|
34
|
+
};
|
35
|
+
|
36
|
+
export const BreadcrumbItem = ChakraBreadcrumbItem;
|
37
|
+
export const BreadcrumbLink = ChakraBreadcrumbLink;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Breadcrumb";
|
package/src/button/Button.tsx
CHANGED
@@ -93,7 +93,7 @@ type ScrollDirection = "up" | "down" | null;
|
|
93
93
|
const useScrollDirection = () => {
|
94
94
|
const [scrollDirection, setScrollDirection] =
|
95
95
|
React.useState<ScrollDirection>(null);
|
96
|
-
const lastScrollPosition = React.useRef(window.scrollY);
|
96
|
+
const lastScrollPosition = React.useRef(typeof window !== "undefined" ? window.scrollY : 0);
|
97
97
|
React.useEffect(() => {
|
98
98
|
const onScroll = () => {
|
99
99
|
const delta = window.scrollY - lastScrollPosition.current;
|
@@ -136,7 +136,7 @@ export function DateRangePicker({
|
|
136
136
|
minHeight={minHeight}
|
137
137
|
>
|
138
138
|
{!hasTrigger && (
|
139
|
-
<CalendarOutline24Icon
|
139
|
+
<CalendarOutline24Icon marginRight={2} alignSelf="center" />
|
140
140
|
)}
|
141
141
|
<DateField
|
142
142
|
{...startFieldProps}
|
@@ -145,7 +145,7 @@ export function DateRangePicker({
|
|
145
145
|
ref={hasTrigger ? undefined : ref}
|
146
146
|
labelProps={labelProps}
|
147
147
|
/>
|
148
|
-
<Box as="span" aria-hidden="true"
|
148
|
+
<Box as="span" aria-hidden="true" paddingX="2">
|
149
149
|
–
|
150
150
|
</Box>
|
151
151
|
<DateField
|
package/src/index.tsx
CHANGED
@@ -2,6 +2,7 @@ export { extendTheme } from "@chakra-ui/react";
|
|
2
2
|
export * as tokens from "@vygruppen/spor-design-tokens";
|
3
3
|
export * from "./accordion";
|
4
4
|
export * from "./alert";
|
5
|
+
export * from "./breadcrumb";
|
5
6
|
export * from "./button";
|
6
7
|
export * from "./card";
|
7
8
|
export * from "./datepicker";
|
package/src/input/ChoiceChip.tsx
CHANGED
@@ -94,7 +94,7 @@ export const ChoiceChip = forwardRef((props: ChoiceChipProps, ref) => {
|
|
94
94
|
{variant !== "icon" && children}
|
95
95
|
</chakra.span>
|
96
96
|
{variant === "filter" && state.isChecked && (
|
97
|
-
<CloseOutline24Icon
|
97
|
+
<CloseOutline24Icon marginLeft={1.5} />
|
98
98
|
)}
|
99
99
|
</chakra.div>
|
100
100
|
</chakra.label>
|
@@ -39,8 +39,8 @@ export const SearchInput = forwardRef<SearchInputProps, "input">(
|
|
39
39
|
<SearchOutline24Icon />
|
40
40
|
</InputLeftElement>
|
41
41
|
<ChakraInput
|
42
|
-
|
43
|
-
|
42
|
+
paddingLeft={7}
|
43
|
+
paddingRight={7}
|
44
44
|
{...props}
|
45
45
|
id={inputId}
|
46
46
|
type="search"
|
@@ -62,7 +62,7 @@ export const SearchInput = forwardRef<SearchInputProps, "input">(
|
|
62
62
|
variant="ghost"
|
63
63
|
type="button"
|
64
64
|
size="sm"
|
65
|
-
|
65
|
+
marginRight={1}
|
66
66
|
aria-label={t(texts.reset)}
|
67
67
|
icon={<CloseOutline24Icon />}
|
68
68
|
onClick={onReset}
|
package/src/layout/Divider.tsx
CHANGED
@@ -7,7 +7,7 @@ export type DividerProps = BoxProps;
|
|
7
7
|
* You can specify margins if you need to give the content some space, or use a `Stack` component to do it for you
|
8
8
|
*
|
9
9
|
* ```tsx
|
10
|
-
* <Divider
|
10
|
+
* <Divider marginTop={4} marginBottom={6} />
|
11
11
|
* ```
|
12
12
|
*/
|
13
13
|
export const Divider = forwardRef<BoxProps, As>((props, ref) => {
|
@@ -12,7 +12,7 @@ export type ContentLoaderProps = BoxProps;
|
|
12
12
|
export const ContentLoader = ({ children, ...props }: ContentLoaderProps) => {
|
13
13
|
return (
|
14
14
|
<Box {...props}>
|
15
|
-
<Box maxWidth="140px"
|
15
|
+
<Box maxWidth="140px" marginX="auto">
|
16
16
|
<ClientOnly>
|
17
17
|
{() => <Lottie animationData={contentLoaderData} />}
|
18
18
|
</ClientOnly>
|
@@ -29,10 +29,12 @@ export const LightSpinner = ({
|
|
29
29
|
return (
|
30
30
|
<Center flexDirection="column" {...props}>
|
31
31
|
<Box width={width} maxWidth={maxWidth}>
|
32
|
-
<ClientOnly>
|
32
|
+
<ClientOnly>
|
33
|
+
{() => <Lottie animationData={spinnerLightData} />}
|
34
|
+
</ClientOnly>
|
33
35
|
</Box>
|
34
36
|
{children && (
|
35
|
-
<Box
|
37
|
+
<Box marginTop={3} fontWeight="bold">
|
36
38
|
{children}
|
37
39
|
</Box>
|
38
40
|
)}
|
@@ -19,7 +19,7 @@ export const StepperStep = ({ children, stepNumber }: StepperStepProps) => {
|
|
19
19
|
return (
|
20
20
|
<Box __css={style.stepContainer}>
|
21
21
|
{stepNumber > 1 && (
|
22
|
-
<DropdownRightFill18Icon
|
22
|
+
<DropdownRightFill18Icon marginX={5} display={["none", "block"]} />
|
23
23
|
)}
|
24
24
|
|
25
25
|
<Flex
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { breadcrumbAnatomy as parts } from "@chakra-ui/anatomy";
|
2
|
+
import {
|
3
|
+
createMultiStyleConfigHelpers,
|
4
|
+
defineStyle,
|
5
|
+
} from "@chakra-ui/styled-system";
|
6
|
+
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
7
|
+
|
8
|
+
const { defineMultiStyleConfig, definePartsStyle } =
|
9
|
+
createMultiStyleConfigHelpers(parts.keys);
|
10
|
+
|
11
|
+
const baseStyleLink = defineStyle({
|
12
|
+
transitionProperty: "common",
|
13
|
+
transitionDuration: "fast",
|
14
|
+
transitionTimingFunction: "ease-out",
|
15
|
+
outline: "none",
|
16
|
+
color: "inherit",
|
17
|
+
textDecoration: "none",
|
18
|
+
"&:not([aria-current=page])": {
|
19
|
+
cursor: "pointer",
|
20
|
+
paddingX: 0.5,
|
21
|
+
borderRadius: "xs",
|
22
|
+
_hover: {
|
23
|
+
backgroundColor: "coralGreen",
|
24
|
+
},
|
25
|
+
_focusVisible: {
|
26
|
+
boxShadow: getBoxShadowString({
|
27
|
+
borderColor: "greenHaze",
|
28
|
+
borderWidth: 2,
|
29
|
+
}),
|
30
|
+
},
|
31
|
+
_active: {
|
32
|
+
backgroundColor: "mint",
|
33
|
+
},
|
34
|
+
},
|
35
|
+
});
|
36
|
+
|
37
|
+
const baseStyle = definePartsStyle({
|
38
|
+
link: baseStyleLink,
|
39
|
+
list: {
|
40
|
+
flexWrap: "wrap",
|
41
|
+
alignItems: "flex-start",
|
42
|
+
},
|
43
|
+
});
|
44
|
+
|
45
|
+
export default defineMultiStyleConfig({
|
46
|
+
baseStyle,
|
47
|
+
});
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { default as Accordion } from "./accordion";
|
2
2
|
export { default as Alert } from "./alert";
|
3
3
|
export { default as Badge } from "./badge";
|
4
|
+
export { default as Breadcrumb } from "./breadcrumb";
|
4
5
|
export { default as Button } from "./button";
|
5
6
|
export { default as Card } from "./card";
|
6
7
|
export { default as CardSelect } from "./card-select";
|