@vygruppen/spor-react 4.0.2 → 4.0.3

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@4.0.2 build
2
+ > @vygruppen/spor-react@4.0.3 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -8,15 +8,15 @@
8
8
  CLI Target: node16
9
9
  CJS Build start
10
10
  ESM Build start
11
+ "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-XT6QVKN5.mjs".
11
12
  "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/index.js".
12
13
  DTS Build start
13
- "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-MGJQOEU2.mjs".
14
- CJS dist/index.js 552.34 KB
15
- CJS ⚡️ Build success in 2656ms
16
14
  ESM dist/index.mjs 2.10 KB
17
- ESM dist/CountryCodeSelect-WSPQNU6B.mjs 1.19 KB
18
- ESM dist/chunk-MGJQOEU2.mjs 441.05 KB
19
- ESM ⚡️ Build success in 2657ms
20
- DTS ⚡️ Build success in 13491ms
21
- DTS dist/index.d.ts 265.34 KB
22
- DTS dist/index.d.mts 265.34 KB
15
+ ESM dist/CountryCodeSelect-RUH47EQH.mjs 1.19 KB
16
+ ESM dist/chunk-XT6QVKN5.mjs 441.18 KB
17
+ ESM ⚡️ Build success in 3115ms
18
+ CJS dist/index.js 552.47 KB
19
+ CJS ⚡️ Build success in 3116ms
20
+ DTS ⚡️ Build success in 14728ms
21
+ DTS dist/index.d.ts 265.43 KB
22
+ DTS dist/index.d.mts 265.43 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 4.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 1cd9939e: TimePicker: Make defaultValue=null a valid value
8
+ - 8b4ab3ac: spinner: added darkmode for Darkspinner
9
+
3
10
  ## 4.0.2
4
11
 
5
12
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-MGJQOEU2.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-XT6QVKN5.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1,4 +1,4 @@
1
- import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, Flex, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, useControllableState, Radio as Radio$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Textarea as Textarea$1, Link, ModalHeader as ModalHeader$1, useModalContext, DrawerContent as DrawerContent$1, Tabs as Tabs$1, Table as Table$1, defineStyleConfig as defineStyleConfig$1, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
1
+ import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, Flex, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, useControllableState, Radio as Radio$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Textarea as Textarea$1, Link, ModalHeader as ModalHeader$1, useModalContext, DrawerContent as DrawerContent$1, Tabs as Tabs$1, Table as Table$1, defineStyleConfig as defineStyleConfig$1, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, useColorMode, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
2
2
  export { AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, Box, Center, Collapse, Container, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, Fade, Flex, FormHelperText, Grid, GridItem, HStack, Image, Img, InputGroup, LightMode, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, VStack, Wrap, WrapItem, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
3
  import tokens10__default from '@vygruppen/spor-design-tokens';
4
4
  import * as tokens10 from '@vygruppen/spor-design-tokens';
@@ -6,7 +6,7 @@ export { tokens10 as tokens };
6
6
  import * as React69 from 'react';
7
7
  import React69__default, { createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, useId, Suspense, useMemo, useContext, useCallback } from 'react';
8
8
  import { CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, CalendarOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill24Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, LinkOutOutline24Icon, DropdownRightFill18Icon, DropdownLeftFill18Icon, DropdownDownFill18Icon, DropdownDownFill24Icon, DropdownUpFill24Icon, ArrowRightFill18Icon, DropdownLeftFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, ErrorOutline24Icon, AltTransportOutline24Icon, WarningOutline24Icon, SuccessOutline24Icon, InformationOutline24Icon, TrainFill18Icon, TrainFill24Icon, TrainFill30Icon, ExpressBusFill18Icon, ExpressBusFill24Icon, ExpressBusFill30Icon, BusFill18Icon, BusFill24Icon, BusFill30Icon, FerryFill18Icon, FerryFill24Icon, FerryFill30Icon, SubwayFill18Icon, SubwayFill24Icon, SubwayFill30Icon, TramFill18Icon, TramFill24Icon, TramFill30Icon, AltTransportFill18Icon, AltTransportFill24Icon, AltTransportFill30Icon, WalkFill18Icon, WalkFill24Icon, WalkFill30Icon } from '@vygruppen/spor-icon-react';
9
- import { inlineLoaderColorData, spinnerColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, spinnerDarkData, fullScreenLoaderBlackData, inlineLoaderLightData, spinnerLightData } from '@vygruppen/spor-loader';
9
+ import { inlineLoaderColorData, spinnerColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, fullScreenLoaderBlackData, inlineLoaderLightData, spinnerLightData, spinnerDarkData } from '@vygruppen/spor-loader';
10
10
  import { useLottie } from 'lottie-react';
11
11
  import { useDateSegment, useDateField, useDatePicker, I18nProvider, usePopover, DismissButton, Overlay, useOverlayTrigger, useButton, useProgressBar, useCalendar, useDateRangePicker, useDialog, useFilter, useComboBox, useListBox, useOption, useListBoxSection, useSelect, HiddenSelect, useCalendarGrid, useRangeCalendar, useTimeField, useCalendarCell } from 'react-aria';
12
12
  import { motion } from 'framer-motion';
@@ -961,7 +961,9 @@ var DarkSpinner = ({
961
961
  maxWidth,
962
962
  ...props
963
963
  }) => {
964
- return /* @__PURE__ */ React69__default.createElement(Center, { flexDirection: "column", ...props }, /* @__PURE__ */ React69__default.createElement(Box, { width, maxWidth }, /* @__PURE__ */ React69__default.createElement(ClientOnly, null, () => /* @__PURE__ */ React69__default.createElement(Lottie, { animationData: spinnerDarkData }))), children && /* @__PURE__ */ React69__default.createElement(Box, { marginTop: 3, fontWeight: "bold" }, children));
964
+ const { colorMode } = useColorMode();
965
+ const spinnerData = colorMode === "dark" ? spinnerLightData : spinnerDarkData;
966
+ return /* @__PURE__ */ React69__default.createElement(Center, { flexDirection: "column", ...props }, /* @__PURE__ */ React69__default.createElement(Box, { width, maxWidth }, /* @__PURE__ */ React69__default.createElement(ClientOnly, null, () => /* @__PURE__ */ React69__default.createElement(Lottie, { animationData: spinnerData }))), children && /* @__PURE__ */ React69__default.createElement(Box, { marginTop: 3, fontWeight: "bold" }, children));
965
967
  };
966
968
  var LightFullScreenLoader = ({
967
969
  width,
@@ -5111,7 +5113,7 @@ var texts14 = createTexts({
5111
5113
  sv: "Telefonnummer"
5112
5114
  }
5113
5115
  });
5114
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-WSPQNU6B.mjs'));
5116
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-RUH47EQH.mjs'));
5115
5117
  var Radio = forwardRef((props, ref) => {
5116
5118
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
5117
5119
  });
package/dist/index.d.mts CHANGED
@@ -493,9 +493,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
493
493
  value?: TimeValue;
494
494
  /** A default value, if any.
495
495
  *
496
- * A `new Time(hours, minutes)` should be passed. Defaults to the current time if not provided.
496
+ * A `new Time(hours, minutes)` should be passed.
497
+ * Defaults to the current time if not provided.
498
+ * Can be set to null if you don't want a time to be selected by default.
497
499
  **/
498
- defaultValue?: TimeValue;
500
+ defaultValue?: TimeValue | null;
499
501
  /** Callback for when the time changes */
500
502
  onChange?: (value: TimeValue) => void;
501
503
  /** The maxiumum number of minutes to move when the step buttons are used.
@@ -3445,7 +3447,7 @@ declare const theme: {
3445
3447
  } | undefined;
3446
3448
  defaultProps?: {
3447
3449
  size?: string | number | undefined;
3448
- variant?: "base" | "green" | "light" | "accent" | "brand" | "dark" | undefined;
3450
+ variant?: "base" | "green" | "light" | "dark" | "accent" | "brand" | undefined;
3449
3451
  colorScheme?: string | undefined;
3450
3452
  } | undefined;
3451
3453
  parts: ("text" | "container" | "icon")[];
package/dist/index.d.ts CHANGED
@@ -493,9 +493,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
493
493
  value?: TimeValue;
494
494
  /** A default value, if any.
495
495
  *
496
- * A `new Time(hours, minutes)` should be passed. Defaults to the current time if not provided.
496
+ * A `new Time(hours, minutes)` should be passed.
497
+ * Defaults to the current time if not provided.
498
+ * Can be set to null if you don't want a time to be selected by default.
497
499
  **/
498
- defaultValue?: TimeValue;
500
+ defaultValue?: TimeValue | null;
499
501
  /** Callback for when the time changes */
500
502
  onChange?: (value: TimeValue) => void;
501
503
  /** The maxiumum number of minutes to move when the step buttons are used.
@@ -3445,7 +3447,7 @@ declare const theme: {
3445
3447
  } | undefined;
3446
3448
  defaultProps?: {
3447
3449
  size?: string | number | undefined;
3448
- variant?: "base" | "green" | "light" | "accent" | "brand" | "dark" | undefined;
3450
+ variant?: "base" | "green" | "light" | "dark" | "accent" | "brand" | undefined;
3449
3451
  colorScheme?: string | undefined;
3450
3452
  } | undefined;
3451
3453
  parts: ("text" | "container" | "icon")[];
package/dist/index.js CHANGED
@@ -360,7 +360,9 @@ var init_DarkSpinner = __esm({
360
360
  maxWidth,
361
361
  ...props
362
362
  }) => {
363
- return /* @__PURE__ */ React69__namespace.default.createElement(react.Center, { flexDirection: "column", ...props }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { width, maxWidth }, /* @__PURE__ */ React69__namespace.default.createElement(ClientOnly, null, () => /* @__PURE__ */ React69__namespace.default.createElement(Lottie, { animationData: sporLoader.spinnerDarkData }))), children && /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { marginTop: 3, fontWeight: "bold" }, children));
363
+ const { colorMode } = react.useColorMode();
364
+ const spinnerData = colorMode === "dark" ? sporLoader.spinnerLightData : sporLoader.spinnerDarkData;
365
+ return /* @__PURE__ */ React69__namespace.default.createElement(react.Center, { flexDirection: "column", ...props }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { width, maxWidth }, /* @__PURE__ */ React69__namespace.default.createElement(ClientOnly, null, () => /* @__PURE__ */ React69__namespace.default.createElement(Lottie, { animationData: spinnerData }))), children && /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { marginTop: 3, fontWeight: "bold" }, children));
364
366
  };
365
367
  }
366
368
  });
package/dist/index.mjs CHANGED
@@ -1 +1 @@
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, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, 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, UnorderedList, 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-MGJQOEU2.mjs';
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, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, 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, UnorderedList, 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-XT6QVKN5.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -24,9 +24,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
24
24
  value?: TimeValue;
25
25
  /** A default value, if any.
26
26
  *
27
- * A `new Time(hours, minutes)` should be passed. Defaults to the current time if not provided.
27
+ * A `new Time(hours, minutes)` should be passed.
28
+ * Defaults to the current time if not provided.
29
+ * Can be set to null if you don't want a time to be selected by default.
28
30
  **/
29
- defaultValue?: TimeValue;
31
+ defaultValue?: TimeValue | null;
30
32
  /** Callback for when the time changes */
31
33
  onChange?: (value: TimeValue) => void;
32
34
  /** The maxiumum number of minutes to move when the step buttons are used.
@@ -1,6 +1,6 @@
1
- import { spinnerDarkData } from "@vygruppen/spor-loader";
1
+ import { spinnerDarkData, spinnerLightData } from "@vygruppen/spor-loader";
2
2
  import React from "react";
3
- import { Box, BoxProps, Center } from "..";
3
+ import { Box, BoxProps, Center, useColorMode } from "..";
4
4
  import { ClientOnly } from "./ClientOnly";
5
5
  import Lottie from "./Lottie";
6
6
 
@@ -26,11 +26,13 @@ export const DarkSpinner = ({
26
26
  maxWidth,
27
27
  ...props
28
28
  }: DarkSpinnerProps) => {
29
+ const { colorMode } = useColorMode();
30
+ const spinnerData = colorMode === "dark" ? spinnerLightData : spinnerDarkData
29
31
  return (
30
32
  <Center flexDirection="column" {...props}>
31
33
  <Box width={width} maxWidth={maxWidth}>
32
34
  <ClientOnly>
33
- {() => <Lottie animationData={spinnerDarkData} />}
35
+ {() => <Lottie animationData={spinnerData} />}
34
36
  </ClientOnly>
35
37
  </Box>
36
38
  {children && (