@vygruppen/spor-react 3.1.2 → 3.2.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 +9 -9
- package/CHANGELOG.md +6 -0
- package/dist/{CountryCodeSelect-PU2FEIUH.mjs → CountryCodeSelect-YGXVIC6H.mjs} +1 -1
- package/dist/{chunk-GIRK7GTN.mjs → chunk-QOZMDFH3.mjs} +18 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +17 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/input/NumericStepper.tsx +69 -49
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@3.
|
2
|
+
> @vygruppen/spor-react@3.2.0 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -9,13 +9,13 @@
|
|
9
9
|
[34mCJS[39m Build start
|
10
10
|
[34mESM[39m Build start
|
11
11
|
[34mDTS[39m Build start
|
12
|
+
"toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-QOZMDFH3.mjs".
|
12
13
|
"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-GIRK7GTN.mjs".
|
14
|
-
[32mCJS[39m [1mdist/index.js [22m[32m901.12 KB[39m
|
15
|
-
[32mCJS[39m ⚡️ Build success in 4689ms
|
16
14
|
[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
|
-
[
|
21
|
-
[
|
15
|
+
[32mESM[39m [1mdist/CountryCodeSelect-YGXVIC6H.mjs [22m[32m350.82 KB[39m
|
16
|
+
[32mESM[39m [1mdist/chunk-QOZMDFH3.mjs [22m[32m418.96 KB[39m
|
17
|
+
[32mESM[39m ⚡️ Build success in 4811ms
|
18
|
+
[32mCJS[39m [1mdist/index.js [22m[32m901.54 KB[39m
|
19
|
+
[32mCJS[39m ⚡️ Build success in 4811ms
|
20
|
+
[32mDTS[39m ⚡️ Build success in 17792ms
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m251.71 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -4969,6 +4969,7 @@ function NumericStepper({
|
|
4969
4969
|
minValue = 0,
|
4970
4970
|
maxValue = 99,
|
4971
4971
|
isDisabled,
|
4972
|
+
withInput = true,
|
4972
4973
|
...boxProps
|
4973
4974
|
}) {
|
4974
4975
|
const { t: t2 } = useTranslation();
|
@@ -4990,7 +4991,7 @@ function NumericStepper({
|
|
4990
4991
|
visibility: value <= minValue ? "hidden" : "visible",
|
4991
4992
|
isDisabled: formControlProps.disabled
|
4992
4993
|
}
|
4993
|
-
), /* @__PURE__ */ React49__default.createElement(
|
4994
|
+
), withInput ? /* @__PURE__ */ React49__default.createElement(
|
4994
4995
|
chakra.input,
|
4995
4996
|
{
|
4996
4997
|
type: "number",
|
@@ -5040,6 +5041,21 @@ function NumericStepper({
|
|
5040
5041
|
onChange(numericInput);
|
5041
5042
|
}
|
5042
5043
|
}
|
5044
|
+
) : /* @__PURE__ */ React49__default.createElement(
|
5045
|
+
chakra.text,
|
5046
|
+
{
|
5047
|
+
fontSize: "sm",
|
5048
|
+
fontWeight: "bold",
|
5049
|
+
width: "3ch",
|
5050
|
+
marginX: 1,
|
5051
|
+
paddingX: 1,
|
5052
|
+
textAlign: "center",
|
5053
|
+
color: textColor,
|
5054
|
+
transition: "box-shadow .1s ease-out",
|
5055
|
+
visibility: value === 0 ? "hidden" : "visible",
|
5056
|
+
"aria-label": value.toString()
|
5057
|
+
},
|
5058
|
+
value
|
5043
5059
|
), /* @__PURE__ */ React49__default.createElement(
|
5044
5060
|
VerySmallButton,
|
5045
5061
|
{
|
@@ -5253,7 +5269,7 @@ var texts13 = createTexts({
|
|
5253
5269
|
sv: "Telefonnummer"
|
5254
5270
|
}
|
5255
5271
|
});
|
5256
|
-
var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-
|
5272
|
+
var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-YGXVIC6H.mjs'));
|
5257
5273
|
var Radio = forwardRef((props, ref) => {
|
5258
5274
|
return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
|
5259
5275
|
});
|
package/dist/index.d.ts
CHANGED
@@ -1096,6 +1096,8 @@ type NumericStepperProps = {
|
|
1096
1096
|
maxValue?: number;
|
1097
1097
|
/** Whether the stepper is disabled or not */
|
1098
1098
|
isDisabled?: boolean;
|
1099
|
+
/** Whether to show input field or not */
|
1100
|
+
withInput?: boolean;
|
1099
1101
|
} & Omit<BoxProps, "onChange">;
|
1100
1102
|
/** A simple stepper component for integer values
|
1101
1103
|
*
|
@@ -1121,7 +1123,7 @@ type NumericStepperProps = {
|
|
1121
1123
|
* </FormControl>
|
1122
1124
|
* ```
|
1123
1125
|
*/
|
1124
|
-
declare function NumericStepper({ name: nameProp, id: idProp, value: valueProp, defaultValue, onChange: onChangeProp, minValue, maxValue, isDisabled, ...boxProps }: NumericStepperProps): React__default.JSX.Element;
|
1126
|
+
declare function NumericStepper({ name: nameProp, id: idProp, value: valueProp, defaultValue, onChange: onChangeProp, minValue, maxValue, isDisabled, withInput, ...boxProps }: NumericStepperProps): React__default.JSX.Element;
|
1125
1127
|
|
1126
1128
|
type PasswordInputProps = InputProps;
|
1127
1129
|
declare const PasswordInput: _chakra_ui_system_dist_system_types.ComponentWithAs<"input", InputProps>;
|
package/dist/index.js
CHANGED
@@ -5626,6 +5626,7 @@ function NumericStepper({
|
|
5626
5626
|
minValue = 0,
|
5627
5627
|
maxValue = 99,
|
5628
5628
|
isDisabled,
|
5629
|
+
withInput = true,
|
5629
5630
|
...boxProps
|
5630
5631
|
}) {
|
5631
5632
|
const { t: t2 } = useTranslation();
|
@@ -5647,7 +5648,7 @@ function NumericStepper({
|
|
5647
5648
|
visibility: value <= minValue ? "hidden" : "visible",
|
5648
5649
|
isDisabled: formControlProps.disabled
|
5649
5650
|
}
|
5650
|
-
), /* @__PURE__ */ React49__namespace.default.createElement(
|
5651
|
+
), withInput ? /* @__PURE__ */ React49__namespace.default.createElement(
|
5651
5652
|
react.chakra.input,
|
5652
5653
|
{
|
5653
5654
|
type: "number",
|
@@ -5697,6 +5698,21 @@ function NumericStepper({
|
|
5697
5698
|
onChange(numericInput);
|
5698
5699
|
}
|
5699
5700
|
}
|
5701
|
+
) : /* @__PURE__ */ React49__namespace.default.createElement(
|
5702
|
+
react.chakra.text,
|
5703
|
+
{
|
5704
|
+
fontSize: "sm",
|
5705
|
+
fontWeight: "bold",
|
5706
|
+
width: "3ch",
|
5707
|
+
marginX: 1,
|
5708
|
+
paddingX: 1,
|
5709
|
+
textAlign: "center",
|
5710
|
+
color: textColor,
|
5711
|
+
transition: "box-shadow .1s ease-out",
|
5712
|
+
visibility: value === 0 ? "hidden" : "visible",
|
5713
|
+
"aria-label": value.toString()
|
5714
|
+
},
|
5715
|
+
value
|
5700
5716
|
), /* @__PURE__ */ React49__namespace.default.createElement(
|
5701
5717
|
VerySmallButton,
|
5702
5718
|
{
|
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-QOZMDFH3.mjs';
|
package/package.json
CHANGED
@@ -31,6 +31,8 @@ type NumericStepperProps = {
|
|
31
31
|
maxValue?: number;
|
32
32
|
/** Whether the stepper is disabled or not */
|
33
33
|
isDisabled?: boolean;
|
34
|
+
/** Whether to show input field or not */
|
35
|
+
withInput?: boolean;
|
34
36
|
} & Omit<BoxProps, "onChange">;
|
35
37
|
/** A simple stepper component for integer values
|
36
38
|
*
|
@@ -65,6 +67,7 @@ export function NumericStepper({
|
|
65
67
|
minValue = 0,
|
66
68
|
maxValue = 99,
|
67
69
|
isDisabled,
|
70
|
+
withInput = true,
|
68
71
|
...boxProps
|
69
72
|
}: NumericStepperProps) {
|
70
73
|
const { t } = useTranslation();
|
@@ -87,54 +90,71 @@ export function NumericStepper({
|
|
87
90
|
visibility={value <= minValue ? "hidden" : "visible"}
|
88
91
|
isDisabled={formControlProps.disabled}
|
89
92
|
/>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
93
|
+
{withInput ? (
|
94
|
+
<chakra.input
|
95
|
+
type="number"
|
96
|
+
min={minValue}
|
97
|
+
max={maxValue}
|
98
|
+
name={nameProp}
|
99
|
+
value={value}
|
100
|
+
{...formControlProps}
|
101
|
+
id={value !== 0 ? formControlProps.id : undefined}
|
102
|
+
fontSize="sm"
|
103
|
+
fontWeight="bold"
|
104
|
+
width="3ch"
|
105
|
+
marginX={1}
|
106
|
+
paddingX={1}
|
107
|
+
borderRadius="xs"
|
108
|
+
textAlign="center"
|
109
|
+
backgroundColor={backgroundColor}
|
110
|
+
color={textColor}
|
111
|
+
transition="box-shadow .1s ease-out"
|
112
|
+
visibility={value === 0 ? "hidden" : "visible"}
|
113
|
+
aria-live="assertive"
|
114
|
+
aria-label={value.toString()}
|
115
|
+
_hover={{
|
116
|
+
boxShadow: getBoxShadowString({
|
117
|
+
borderColor: "currentColor",
|
118
|
+
borderWidth: 1,
|
119
|
+
}),
|
120
|
+
_disabled: {
|
121
|
+
boxShadow: "none",
|
122
|
+
},
|
123
|
+
}}
|
124
|
+
_disabled={{
|
125
|
+
opacity: 0.5,
|
126
|
+
}}
|
127
|
+
_focus={{
|
128
|
+
outline: "none",
|
129
|
+
boxShadow: getBoxShadowString({
|
130
|
+
borderColor: focusColor,
|
131
|
+
borderWidth: 1,
|
132
|
+
}),
|
133
|
+
}}
|
134
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
135
|
+
const numericInput = Number(e.target.value);
|
136
|
+
if (Number.isNaN(numericInput)) {
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
onChange(numericInput);
|
140
|
+
}}
|
141
|
+
/>
|
142
|
+
) : (
|
143
|
+
<chakra.text
|
144
|
+
fontSize="sm"
|
145
|
+
fontWeight="bold"
|
146
|
+
width="3ch"
|
147
|
+
marginX={1}
|
148
|
+
paddingX={1}
|
149
|
+
textAlign="center"
|
150
|
+
color={textColor}
|
151
|
+
transition="box-shadow .1s ease-out"
|
152
|
+
visibility={value === 0 ? "hidden" : "visible"}
|
153
|
+
aria-label={value.toString()}
|
154
|
+
>
|
155
|
+
{value}
|
156
|
+
</chakra.text>
|
157
|
+
)}
|
138
158
|
<VerySmallButton
|
139
159
|
icon={<AddIcon color="white" />}
|
140
160
|
aria-label={t(texts.incrementButtonAriaLabel)}
|
@@ -242,4 +262,4 @@ const texts = createTexts({
|
|
242
262
|
nn: "Legg til 1",
|
243
263
|
sv: "Lägg till 1",
|
244
264
|
},
|
245
|
-
});
|
265
|
+
});
|