@vygruppen/spor-react 3.3.1 → 3.3.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@3.3.1 build
2
+ > @vygruppen/spor-react@3.3.3 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,13 +9,13 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
- "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-5JEY3QEF.mjs".
13
12
  "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/index.js".
13
+ "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-HUBPEIHF.mjs".
14
14
  ESM dist/index.mjs 2.01 KB
15
- ESM dist/CountryCodeSelect-A2JYYB5S.mjs 350.82 KB
16
- ESM dist/chunk-5JEY3QEF.mjs 419.69 KB
17
- ESM ⚡️ Build success in 4776ms
18
- CJS dist/index.js 902.43 KB
19
- CJS ⚡️ Build success in 4777ms
20
- DTS ⚡️ Build success in 16972ms
21
- DTS dist/index.d.ts 252.16 KB
15
+ ESM dist/CountryCodeSelect-X3MPRW2E.mjs 350.82 KB
16
+ ESM dist/chunk-HUBPEIHF.mjs 420.27 KB
17
+ ESM ⚡️ Build success in 5772ms
18
+ CJS dist/index.js 903.03 KB
19
+ CJS ⚡️ Build success in 5772ms
20
+ DTS ⚡️ Build success in 21778ms
21
+ DTS dist/index.d.ts 252.30 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 3.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 3a95bedd: Accordion: Make the text size responsive
8
+
9
+ ## 3.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 1209e991: Add workaround for click throughs on mobile devices in CalendarCell and ListBox
14
+
3
15
  ## 3.3.1
4
16
 
5
17
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-5JEY3QEF.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-HUBPEIHF.mjs';
2
2
  import React from 'react';
3
3
 
4
4
  // ../../node_modules/awesome-phonenumber/index-esm.mjs
@@ -3314,6 +3314,16 @@ function CalendarCell({ state: state2, date, currentMonth }) {
3314
3314
  if (isOutsideMonth) {
3315
3315
  stateProps["data-unavailable"] = true;
3316
3316
  }
3317
+ useEffect(() => {
3318
+ var _a6;
3319
+ (_a6 = ref == null ? void 0 : ref.current) == null ? void 0 : _a6.addEventListener(
3320
+ "touchend",
3321
+ (event) => {
3322
+ event.preventDefault();
3323
+ },
3324
+ { passive: false, once: true }
3325
+ );
3326
+ }, []);
3317
3327
  return /* @__PURE__ */ React49__default.createElement(
3318
3328
  Box,
3319
3329
  {
@@ -4540,6 +4550,16 @@ function Option({ item, state: state2 }) {
4540
4550
  if (isFocused) {
4541
4551
  dataFields["data-focus"] = true;
4542
4552
  }
4553
+ useEffect(() => {
4554
+ var _a6;
4555
+ (_a6 = ref == null ? void 0 : ref.current) == null ? void 0 : _a6.addEventListener(
4556
+ "touchend",
4557
+ (event) => {
4558
+ event.preventDefault();
4559
+ },
4560
+ { passive: false, once: true }
4561
+ );
4562
+ }, []);
4543
4563
  return /* @__PURE__ */ React49__default.createElement(OptionContext.Provider, { value: { labelProps, descriptionProps } }, /* @__PURE__ */ React49__default.createElement(ListItem, { ...optionProps, ...dataFields, ref, sx: styles2.item }, item.rendered));
4544
4564
  }
4545
4565
  var OptionContext = React49__default.createContext({
@@ -4822,7 +4842,7 @@ function NumericStepper({
4822
4842
  {
4823
4843
  fontSize: "sm",
4824
4844
  fontWeight: "bold",
4825
- width: "3ch",
4845
+ width: "4ch",
4826
4846
  marginX: 1,
4827
4847
  paddingX: 1,
4828
4848
  textAlign: "center",
@@ -5045,7 +5065,7 @@ var texts14 = createTexts({
5045
5065
  sv: "Telefonnummer"
5046
5066
  }
5047
5067
  });
5048
- var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-A2JYYB5S.mjs'));
5068
+ var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-X3MPRW2E.mjs'));
5049
5069
  var Radio = forwardRef((props, ref) => {
5050
5070
  return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
5051
5071
  });
@@ -11010,34 +11030,34 @@ var config3 = helpers.defineMultiStyleConfig({
11010
11030
  sizes: {
11011
11031
  sm: {
11012
11032
  button: {
11013
- fontSize: "desktop.xs",
11033
+ fontSize: ["mobile.xs", "desktop.xs"],
11014
11034
  paddingX: 2,
11015
11035
  paddingY: 1
11016
11036
  },
11017
11037
  panel: {
11018
- fontSize: "desktop.xs",
11038
+ fontSize: ["mobile.xs", "desktop.xs"],
11019
11039
  paddingX: 2
11020
11040
  }
11021
11041
  },
11022
11042
  md: {
11023
11043
  button: {
11024
- fontSize: "desktop.sm",
11044
+ fontSize: ["mobile.sm", "desktop.sm"],
11025
11045
  paddingX: 3,
11026
11046
  paddingY: 1
11027
11047
  },
11028
11048
  panel: {
11029
- fontSize: "desktop.sm",
11049
+ fontSize: ["mobile.sm", "desktop.sm"],
11030
11050
  paddingX: 3
11031
11051
  }
11032
11052
  },
11033
11053
  lg: {
11034
11054
  button: {
11035
- fontSize: "desktop.sm",
11055
+ fontSize: ["mobile.sm", "desktop.sm"],
11036
11056
  paddingX: 3,
11037
11057
  paddingY: 2
11038
11058
  },
11039
11059
  panel: {
11040
- fontSize: "desktop.sm",
11060
+ fontSize: ["mobile.sm", "desktop.sm"],
11041
11061
  paddingX: 3
11042
11062
  }
11043
11063
  }
package/dist/index.d.ts CHANGED
@@ -1966,34 +1966,34 @@ declare const theme: {
1966
1966
  sizes?: {
1967
1967
  sm: {
1968
1968
  button: {
1969
- fontSize: string;
1969
+ fontSize: ("mobile.xs" | "desktop.xs")[];
1970
1970
  paddingX: number;
1971
1971
  paddingY: number;
1972
1972
  };
1973
1973
  panel: {
1974
- fontSize: string;
1974
+ fontSize: ("mobile.xs" | "desktop.xs")[];
1975
1975
  paddingX: number;
1976
1976
  };
1977
1977
  };
1978
1978
  md: {
1979
1979
  button: {
1980
- fontSize: string;
1980
+ fontSize: ("mobile.sm" | "desktop.sm")[];
1981
1981
  paddingX: number;
1982
1982
  paddingY: number;
1983
1983
  };
1984
1984
  panel: {
1985
- fontSize: string;
1985
+ fontSize: ("mobile.sm" | "desktop.sm")[];
1986
1986
  paddingX: number;
1987
1987
  };
1988
1988
  };
1989
1989
  lg: {
1990
1990
  button: {
1991
- fontSize: string;
1991
+ fontSize: ("mobile.sm" | "desktop.sm")[];
1992
1992
  paddingX: number;
1993
1993
  paddingY: number;
1994
1994
  };
1995
1995
  panel: {
1996
- fontSize: string;
1996
+ fontSize: ("mobile.sm" | "desktop.sm")[];
1997
1997
  paddingX: number;
1998
1998
  };
1999
1999
  };
package/dist/index.js CHANGED
@@ -2931,6 +2931,16 @@ function CalendarCell({ state: state2, date: date$1, currentMonth }) {
2931
2931
  if (isOutsideMonth) {
2932
2932
  stateProps["data-unavailable"] = true;
2933
2933
  }
2934
+ React49.useEffect(() => {
2935
+ var _a6;
2936
+ (_a6 = ref == null ? void 0 : ref.current) == null ? void 0 : _a6.addEventListener(
2937
+ "touchend",
2938
+ (event) => {
2939
+ event.preventDefault();
2940
+ },
2941
+ { passive: false, once: true }
2942
+ );
2943
+ }, []);
2934
2944
  return /* @__PURE__ */ React49__namespace.default.createElement(
2935
2945
  react.Box,
2936
2946
  {
@@ -5077,6 +5087,16 @@ function Option({ item, state: state2 }) {
5077
5087
  if (isFocused) {
5078
5088
  dataFields["data-focus"] = true;
5079
5089
  }
5090
+ React49.useEffect(() => {
5091
+ var _a6;
5092
+ (_a6 = ref == null ? void 0 : ref.current) == null ? void 0 : _a6.addEventListener(
5093
+ "touchend",
5094
+ (event) => {
5095
+ event.preventDefault();
5096
+ },
5097
+ { passive: false, once: true }
5098
+ );
5099
+ }, []);
5080
5100
  return /* @__PURE__ */ React49__namespace.default.createElement(OptionContext.Provider, { value: { labelProps, descriptionProps } }, /* @__PURE__ */ React49__namespace.default.createElement(react.ListItem, { ...optionProps, ...dataFields, ref, sx: styles2.item }, item.rendered));
5081
5101
  }
5082
5102
  function ListBoxSection({ section, state: state2 }) {
@@ -5406,7 +5426,7 @@ function NumericStepper({
5406
5426
  {
5407
5427
  fontSize: "sm",
5408
5428
  fontWeight: "bold",
5409
- width: "3ch",
5429
+ width: "4ch",
5410
5430
  marginX: 1,
5411
5431
  paddingX: 1,
5412
5432
  textAlign: "center",
@@ -19006,34 +19026,34 @@ var init_accordion2 = __esm({
19006
19026
  sizes: {
19007
19027
  sm: {
19008
19028
  button: {
19009
- fontSize: "desktop.xs",
19029
+ fontSize: ["mobile.xs", "desktop.xs"],
19010
19030
  paddingX: 2,
19011
19031
  paddingY: 1
19012
19032
  },
19013
19033
  panel: {
19014
- fontSize: "desktop.xs",
19034
+ fontSize: ["mobile.xs", "desktop.xs"],
19015
19035
  paddingX: 2
19016
19036
  }
19017
19037
  },
19018
19038
  md: {
19019
19039
  button: {
19020
- fontSize: "desktop.sm",
19040
+ fontSize: ["mobile.sm", "desktop.sm"],
19021
19041
  paddingX: 3,
19022
19042
  paddingY: 1
19023
19043
  },
19024
19044
  panel: {
19025
- fontSize: "desktop.sm",
19045
+ fontSize: ["mobile.sm", "desktop.sm"],
19026
19046
  paddingX: 3
19027
19047
  }
19028
19048
  },
19029
19049
  lg: {
19030
19050
  button: {
19031
- fontSize: "desktop.sm",
19051
+ fontSize: ["mobile.sm", "desktop.sm"],
19032
19052
  paddingX: 3,
19033
19053
  paddingY: 2
19034
19054
  },
19035
19055
  panel: {
19036
- fontSize: "desktop.sm",
19056
+ fontSize: ["mobile.sm", "desktop.sm"],
19037
19057
  paddingX: 3
19038
19058
  }
19039
19059
  }
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-5JEY3QEF.mjs';
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-HUBPEIHF.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -5,7 +5,7 @@ import {
5
5
  isSameMonth,
6
6
  isToday,
7
7
  } from "@internationalized/date";
8
- import React, { useRef } from "react";
8
+ import React, { useEffect, useRef } from "react";
9
9
  import { useCalendarCell } from "react-aria";
10
10
  import { CalendarState, RangeCalendarState } from "react-stately";
11
11
 
@@ -41,7 +41,22 @@ export function CalendarCell({ state, date, currentMonth }: CalendarCellProps) {
41
41
  if (isOutsideMonth) {
42
42
  stateProps["data-unavailable"] = true;
43
43
  }
44
-
44
+
45
+ /*
46
+ Workaround to fix click througs on mobile devices
47
+ Related to https://github.com/adobe/react-spectrum/issues/4970
48
+ TODO: Follow up with react-spectrum to see if they can solve it on their end
49
+ */
50
+ useEffect(() => {
51
+ (ref as any)?.current?.addEventListener(
52
+ "touchend",
53
+ (event: TouchEvent) => {
54
+ event.preventDefault();
55
+ },
56
+ { passive: false, once: true }
57
+ );
58
+ }, []);
59
+
45
60
  return (
46
61
  <Box
47
62
  as="td"
@@ -7,7 +7,7 @@ import {
7
7
  type BoxProps,
8
8
  } from "@chakra-ui/react";
9
9
  import type { Node } from "@react-types/shared";
10
- import React, { useContext, useRef } from "react";
10
+ import React, { useContext, useEffect, useRef } from "react";
11
11
  import {
12
12
  AriaListBoxProps,
13
13
  useListBox,
@@ -152,6 +152,21 @@ function Option({ item, state }: OptionProps) {
152
152
  dataFields["data-focus"] = true;
153
153
  }
154
154
 
155
+ /*
156
+ Workaround to fix click througs on mobile devices
157
+ Related to https://github.com/adobe/react-spectrum/issues/4970
158
+ TODO: Follow up with react-spectrum to see if they can solve it on their end
159
+ */
160
+ useEffect(() => {
161
+ (ref as any)?.current?.addEventListener(
162
+ "touchend",
163
+ (event: TouchEvent) => {
164
+ event.preventDefault();
165
+ },
166
+ { passive: false, once: true }
167
+ );
168
+ }, []);
169
+
155
170
  return (
156
171
  <OptionContext.Provider value={{ labelProps, descriptionProps }}>
157
172
  <ListItem {...optionProps} {...dataFields} ref={ref} sx={styles.item}>
@@ -143,7 +143,7 @@ export function NumericStepper({
143
143
  <chakra.text
144
144
  fontSize="sm"
145
145
  fontWeight="bold"
146
- width="3ch"
146
+ width="4ch"
147
147
  marginX={1}
148
148
  paddingX={1}
149
149
  textAlign="center"
@@ -262,4 +262,4 @@ const texts = createTexts({
262
262
  nn: "Legg til 1",
263
263
  sv: "Lägg till 1",
264
264
  },
265
- });
265
+ });
@@ -107,34 +107,34 @@ const config = helpers.defineMultiStyleConfig({
107
107
  sizes: {
108
108
  sm: {
109
109
  button: {
110
- fontSize: "desktop.xs",
110
+ fontSize: ["mobile.xs", "desktop.xs"],
111
111
  paddingX: 2,
112
112
  paddingY: 1,
113
113
  },
114
114
  panel: {
115
- fontSize: "desktop.xs",
115
+ fontSize: ["mobile.xs", "desktop.xs"],
116
116
  paddingX: 2,
117
117
  },
118
118
  },
119
119
  md: {
120
120
  button: {
121
- fontSize: "desktop.sm",
121
+ fontSize: ["mobile.sm", "desktop.sm"],
122
122
  paddingX: 3,
123
123
  paddingY: 1,
124
124
  },
125
125
  panel: {
126
- fontSize: "desktop.sm",
126
+ fontSize: ["mobile.sm", "desktop.sm"],
127
127
  paddingX: 3,
128
128
  },
129
129
  },
130
130
  lg: {
131
131
  button: {
132
- fontSize: "desktop.sm",
132
+ fontSize: ["mobile.sm", "desktop.sm"],
133
133
  paddingX: 3,
134
134
  paddingY: 2,
135
135
  },
136
136
  panel: {
137
- fontSize: "desktop.sm",
137
+ fontSize: ["mobile.sm", "desktop.sm"],
138
138
  paddingX: 3,
139
139
  },
140
140
  },