@vygruppen/spor-react 3.0.1 → 3.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.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +14 -0
- package/dist/{CountryCodeSelect-ZP44HPNI.mjs → CountryCodeSelect-7ASYXAQD.mjs} +1 -1
- package/dist/{chunk-B6U7OYV3.mjs → chunk-B2RY6AU2.mjs} +27 -10
- package/dist/index.d.ts +4 -0
- package/dist/index.js +25 -8
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/datepicker/TimeField.tsx +1 -0
- package/src/input/Combobox.tsx +10 -1
- package/src/input/NumericStepper.tsx +4 -0
- package/src/input/Popover.tsx +16 -0
- package/src/theme/components/datepicker.ts +1 -0
- package/src/theme/components/input.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@3.0.
|
2
|
+
> @vygruppen/spor-react@3.0.3 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
|
-
"toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-B6U7OYV3.mjs".
|
13
12
|
"toTime" is imported from external module "@internationalized/date" but never used in "dist/index.js".
|
13
|
+
"toTime" is imported from external module "@internationalized/date" but never used in "dist/chunk-B2RY6AU2.mjs".
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m896.58 KB[39m
|
15
|
+
[32mCJS[39m ⚡️ Build success in 5703ms
|
14
16
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.01 KB[39m
|
15
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
16
|
-
[32mESM[39m [1mdist/chunk-
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
18
|
-
[
|
19
|
-
[
|
20
|
-
[32mDTS[39m ⚡️ Build success in 19473ms
|
21
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m259.11 KB[39m
|
17
|
+
[32mESM[39m [1mdist/CountryCodeSelect-7ASYXAQD.mjs [22m[32m351.65 KB[39m
|
18
|
+
[32mESM[39m [1mdist/chunk-B2RY6AU2.mjs [22m[32m416.81 KB[39m
|
19
|
+
[32mESM[39m ⚡️ Build success in 5716ms
|
20
|
+
[32mDTS[39m ⚡️ Build success in 22215ms
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m259.26 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# @vygruppen/spor-react
|
2
2
|
|
3
|
+
## 3.0.3
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 7e9b8990: DatePicker, TimePicker: Use cursor: text; everywhere inside of the date input field
|
8
|
+
- 7e9b8990: Combobox: Make padding-right apply to the loading indicator as well
|
9
|
+
|
10
|
+
## 3.0.2
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- ed4dc214: NumericStepper: Make label work as "add one" button if the value is zero
|
15
|
+
- 0e951ddf: Input: Display text cursor for form labels inside of inputs.
|
16
|
+
|
3
17
|
## 3.0.1
|
4
18
|
|
5
19
|
### Patch Changes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { forwardRef, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, Stack as Stack$1, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, useFormControlContext, useMultiStyleConfig, chakra, Flex, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, FormLabel, InputGroup, 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, useBreakpointValue, Popover, PopoverAnchor, Portal, PopoverContent, PopoverArrow, PopoverBody, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverTrigger, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
|
1
|
+
import { forwardRef, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, Stack as Stack$1, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, useFormControlContext, useMultiStyleConfig, chakra, Flex, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, FormLabel, InputGroup, 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, useBreakpointValue, Popover, PopoverAnchor, Portal, PopoverContent, PopoverArrow, PopoverBody, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, useOutsideClick, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverTrigger, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, 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';
|
@@ -3828,7 +3828,8 @@ var TimeField = ({ state: state2, ...props }) => {
|
|
3828
3828
|
...labelProps,
|
3829
3829
|
htmlFor: fieldProps.id,
|
3830
3830
|
marginBottom: 0,
|
3831
|
-
fontSize: "mobile.xs"
|
3831
|
+
fontSize: "mobile.xs",
|
3832
|
+
cursor: "text"
|
3832
3833
|
},
|
3833
3834
|
props.label
|
3834
3835
|
), /* @__PURE__ */ React49__default.createElement(Flex, { ...fieldProps, ref }, state2.segments.map((segment) => /* @__PURE__ */ React49__default.createElement(DateTimeSegment, { key: segment.type, segment, state: state2 }))), /* @__PURE__ */ React49__default.createElement(
|
@@ -4031,7 +4032,9 @@ var Popover3 = forwardRef$1(
|
|
4031
4032
|
triggerRef,
|
4032
4033
|
offset = 0,
|
4033
4034
|
crossOffset = 0,
|
4034
|
-
placement = "bottom"
|
4035
|
+
placement = "bottom",
|
4036
|
+
shouldFlip = false,
|
4037
|
+
isNonModal = false
|
4035
4038
|
}, ref) => {
|
4036
4039
|
var _a6;
|
4037
4040
|
const internalRef = useRef(null);
|
@@ -4042,7 +4045,9 @@ var Popover3 = forwardRef$1(
|
|
4042
4045
|
popoverRef,
|
4043
4046
|
offset,
|
4044
4047
|
crossOffset,
|
4045
|
-
placement
|
4048
|
+
placement,
|
4049
|
+
shouldFlip,
|
4050
|
+
isNonModal
|
4046
4051
|
},
|
4047
4052
|
state2
|
4048
4053
|
);
|
@@ -4224,7 +4229,13 @@ function Combobox({
|
|
4224
4229
|
...rest,
|
4225
4230
|
defaultFilter: contains2,
|
4226
4231
|
allowsEmptyCollection: Boolean(emptyContent),
|
4227
|
-
shouldCloseOnBlur: true
|
4232
|
+
shouldCloseOnBlur: true,
|
4233
|
+
label
|
4234
|
+
});
|
4235
|
+
useOutsideClick({
|
4236
|
+
ref: listBoxRef,
|
4237
|
+
handler: state2.close,
|
4238
|
+
enabled: true
|
4228
4239
|
});
|
4229
4240
|
const {
|
4230
4241
|
inputProps: { size: size2, ...inputProps },
|
@@ -4266,6 +4277,7 @@ function Combobox({
|
|
4266
4277
|
{
|
4267
4278
|
width: "1.5rem",
|
4268
4279
|
alignSelf: "center",
|
4280
|
+
paddingRight,
|
4269
4281
|
css: {
|
4270
4282
|
div: {
|
4271
4283
|
display: "flex",
|
@@ -4281,7 +4293,8 @@ function Combobox({
|
|
4281
4293
|
state: state2,
|
4282
4294
|
triggerRef: inputRef,
|
4283
4295
|
ref: popoverRef,
|
4284
|
-
placement: "bottom start"
|
4296
|
+
placement: "bottom start",
|
4297
|
+
shouldFlip: false
|
4285
4298
|
},
|
4286
4299
|
/* @__PURE__ */ React49__default.createElement(
|
4287
4300
|
ListBox,
|
@@ -4673,6 +4686,7 @@ function NumericStepper({
|
|
4673
4686
|
name: nameProp,
|
4674
4687
|
value,
|
4675
4688
|
...formControlProps,
|
4689
|
+
id: value !== 0 ? formControlProps.id : void 0,
|
4676
4690
|
fontSize: "sm",
|
4677
4691
|
fontWeight: "bold",
|
4678
4692
|
width: "3ch",
|
@@ -4720,7 +4734,8 @@ function NumericStepper({
|
|
4720
4734
|
"aria-label": t2(texts11.incrementButtonAriaLabel),
|
4721
4735
|
onClick: () => onChange(value + 1),
|
4722
4736
|
visibility: value >= maxValue ? "hidden" : "visible",
|
4723
|
-
isDisabled: formControlProps.disabled
|
4737
|
+
isDisabled: formControlProps.disabled,
|
4738
|
+
id: value === 0 ? formControlProps.id : void 0
|
4724
4739
|
}
|
4725
4740
|
));
|
4726
4741
|
}
|
@@ -4925,7 +4940,7 @@ var texts13 = createTexts({
|
|
4925
4940
|
sv: "Telefonnummer"
|
4926
4941
|
}
|
4927
4942
|
});
|
4928
|
-
var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-
|
4943
|
+
var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-7ASYXAQD.mjs'));
|
4929
4944
|
var Radio = forwardRef((props, ref) => {
|
4930
4945
|
return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
|
4931
4946
|
});
|
@@ -11904,7 +11919,8 @@ var config13 = helpers6.defineMultiStyleConfig({
|
|
11904
11919
|
inputLabel: {
|
11905
11920
|
fontSize: "mobile.xs",
|
11906
11921
|
color: mode("darkGrey", "white")(props),
|
11907
|
-
margin: 0
|
11922
|
+
margin: 0,
|
11923
|
+
cursor: "text"
|
11908
11924
|
},
|
11909
11925
|
dateTimeSegment: {
|
11910
11926
|
color: mode(
|
@@ -12743,7 +12759,8 @@ var config21 = helpers13.defineMultiStyleConfig({
|
|
12743
12759
|
position: "absolute",
|
12744
12760
|
my: 2,
|
12745
12761
|
transition: ".1s ease-out",
|
12746
|
-
transformOrigin: "top left"
|
12762
|
+
transformOrigin: "top left",
|
12763
|
+
cursor: "text"
|
12747
12764
|
},
|
12748
12765
|
"&:not(:placeholder-shown)": {
|
12749
12766
|
pt: "16px",
|
package/dist/index.d.ts
CHANGED
@@ -2706,6 +2706,7 @@ declare const theme: {
|
|
2706
2706
|
fontSize: string;
|
2707
2707
|
color: string;
|
2708
2708
|
margin: number;
|
2709
|
+
cursor: string;
|
2709
2710
|
};
|
2710
2711
|
dateTimeSegment: {
|
2711
2712
|
color: string;
|
@@ -3383,6 +3384,7 @@ declare const theme: {
|
|
3383
3384
|
my: number;
|
3384
3385
|
transition: string;
|
3385
3386
|
transformOrigin: string;
|
3387
|
+
cursor: string;
|
3386
3388
|
};
|
3387
3389
|
"&:not(:placeholder-shown)": {
|
3388
3390
|
pt: string;
|
@@ -4047,6 +4049,7 @@ declare const theme: {
|
|
4047
4049
|
my: number;
|
4048
4050
|
transition: string;
|
4049
4051
|
transformOrigin: string;
|
4052
|
+
cursor: string;
|
4050
4053
|
};
|
4051
4054
|
"&:not(:placeholder-shown)": {
|
4052
4055
|
pt: string;
|
@@ -4827,6 +4830,7 @@ declare const theme: {
|
|
4827
4830
|
my: number;
|
4828
4831
|
transition: string;
|
4829
4832
|
transformOrigin: string;
|
4833
|
+
cursor: string;
|
4830
4834
|
};
|
4831
4835
|
"&:not(:placeholder-shown)": {
|
4832
4836
|
pt: string;
|
package/dist/index.js
CHANGED
@@ -3533,7 +3533,8 @@ var init_TimeField = __esm({
|
|
3533
3533
|
...labelProps,
|
3534
3534
|
htmlFor: fieldProps.id,
|
3535
3535
|
marginBottom: 0,
|
3536
|
-
fontSize: "mobile.xs"
|
3536
|
+
fontSize: "mobile.xs",
|
3537
|
+
cursor: "text"
|
3537
3538
|
},
|
3538
3539
|
props.label
|
3539
3540
|
), /* @__PURE__ */ React49__namespace.default.createElement(react.Flex, { ...fieldProps, ref }, state2.segments.map((segment) => /* @__PURE__ */ React49__namespace.default.createElement(DateTimeSegment, { key: segment.type, segment, state: state2 }))), /* @__PURE__ */ React49__namespace.default.createElement(
|
@@ -3770,7 +3771,9 @@ var init_Popover = __esm({
|
|
3770
3771
|
triggerRef,
|
3771
3772
|
offset = 0,
|
3772
3773
|
crossOffset = 0,
|
3773
|
-
placement = "bottom"
|
3774
|
+
placement = "bottom",
|
3775
|
+
shouldFlip = false,
|
3776
|
+
isNonModal = false
|
3774
3777
|
}, ref) => {
|
3775
3778
|
var _a6;
|
3776
3779
|
const internalRef = React49.useRef(null);
|
@@ -3781,7 +3784,9 @@ var init_Popover = __esm({
|
|
3781
3784
|
popoverRef,
|
3782
3785
|
offset,
|
3783
3786
|
crossOffset,
|
3784
|
-
placement
|
3787
|
+
placement,
|
3788
|
+
shouldFlip,
|
3789
|
+
isNonModal
|
3785
3790
|
},
|
3786
3791
|
state2
|
3787
3792
|
);
|
@@ -4734,7 +4739,13 @@ function Combobox({
|
|
4734
4739
|
...rest,
|
4735
4740
|
defaultFilter: contains2,
|
4736
4741
|
allowsEmptyCollection: Boolean(emptyContent),
|
4737
|
-
shouldCloseOnBlur: true
|
4742
|
+
shouldCloseOnBlur: true,
|
4743
|
+
label
|
4744
|
+
});
|
4745
|
+
react.useOutsideClick({
|
4746
|
+
ref: listBoxRef,
|
4747
|
+
handler: state2.close,
|
4748
|
+
enabled: true
|
4738
4749
|
});
|
4739
4750
|
const {
|
4740
4751
|
inputProps: { size: size2, ...inputProps },
|
@@ -4776,6 +4787,7 @@ function Combobox({
|
|
4776
4787
|
{
|
4777
4788
|
width: "1.5rem",
|
4778
4789
|
alignSelf: "center",
|
4790
|
+
paddingRight,
|
4779
4791
|
css: {
|
4780
4792
|
div: {
|
4781
4793
|
display: "flex",
|
@@ -4791,7 +4803,8 @@ function Combobox({
|
|
4791
4803
|
state: state2,
|
4792
4804
|
triggerRef: inputRef,
|
4793
4805
|
ref: popoverRef,
|
4794
|
-
placement: "bottom start"
|
4806
|
+
placement: "bottom start",
|
4807
|
+
shouldFlip: false
|
4795
4808
|
},
|
4796
4809
|
/* @__PURE__ */ React49__namespace.default.createElement(
|
4797
4810
|
ListBox,
|
@@ -5252,6 +5265,7 @@ function NumericStepper({
|
|
5252
5265
|
name: nameProp,
|
5253
5266
|
value,
|
5254
5267
|
...formControlProps,
|
5268
|
+
id: value !== 0 ? formControlProps.id : void 0,
|
5255
5269
|
fontSize: "sm",
|
5256
5270
|
fontWeight: "bold",
|
5257
5271
|
width: "3ch",
|
@@ -5299,7 +5313,8 @@ function NumericStepper({
|
|
5299
5313
|
"aria-label": t2(texts11.incrementButtonAriaLabel),
|
5300
5314
|
onClick: () => onChange(value + 1),
|
5301
5315
|
visibility: value >= maxValue ? "hidden" : "visible",
|
5302
|
-
isDisabled: formControlProps.disabled
|
5316
|
+
isDisabled: formControlProps.disabled,
|
5317
|
+
id: value === 0 ? formControlProps.id : void 0
|
5303
5318
|
}
|
5304
5319
|
));
|
5305
5320
|
}
|
@@ -19976,7 +19991,8 @@ var init_datepicker2 = __esm({
|
|
19976
19991
|
inputLabel: {
|
19977
19992
|
fontSize: "mobile.xs",
|
19978
19993
|
color: themeTools.mode("darkGrey", "white")(props),
|
19979
|
-
margin: 0
|
19994
|
+
margin: 0,
|
19995
|
+
cursor: "text"
|
19980
19996
|
},
|
19981
19997
|
dateTimeSegment: {
|
19982
19998
|
color: themeTools.mode(
|
@@ -20870,7 +20886,8 @@ var init_input2 = __esm({
|
|
20870
20886
|
position: "absolute",
|
20871
20887
|
my: 2,
|
20872
20888
|
transition: ".1s ease-out",
|
20873
|
-
transformOrigin: "top left"
|
20889
|
+
transformOrigin: "top left",
|
20890
|
+
cursor: "text"
|
20874
20891
|
},
|
20875
20892
|
"&:not(:placeholder-shown)": {
|
20876
20893
|
pt: "16px",
|
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-B2RY6AU2.mjs';
|
package/package.json
CHANGED
package/src/input/Combobox.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
2
2
|
import { AriaComboBoxProps, useComboBox, useFilter } from "react-aria";
|
3
3
|
import { useComboBoxState } from "react-stately";
|
4
|
-
import { ColorSpinner, Input, InputProps, ListBox } from "..";
|
4
|
+
import { ColorSpinner, Input, InputProps, ListBox, useOutsideClick } from "..";
|
5
5
|
import { Popover } from "./Popover";
|
6
6
|
|
7
7
|
export type ComboboxProps<T> = AriaComboBoxProps<T> & {
|
@@ -93,6 +93,13 @@ export function Combobox<T extends object>({
|
|
93
93
|
defaultFilter: contains,
|
94
94
|
allowsEmptyCollection: Boolean(emptyContent),
|
95
95
|
shouldCloseOnBlur: true,
|
96
|
+
label,
|
97
|
+
});
|
98
|
+
|
99
|
+
useOutsideClick({
|
100
|
+
ref: listBoxRef,
|
101
|
+
handler: state.close,
|
102
|
+
enabled: true,
|
96
103
|
});
|
97
104
|
|
98
105
|
const {
|
@@ -140,6 +147,7 @@ export function Combobox<T extends object>({
|
|
140
147
|
<ColorSpinner
|
141
148
|
width="1.5rem"
|
142
149
|
alignSelf="center"
|
150
|
+
paddingRight={paddingRight}
|
143
151
|
css={{
|
144
152
|
div: {
|
145
153
|
display: "flex",
|
@@ -158,6 +166,7 @@ export function Combobox<T extends object>({
|
|
158
166
|
triggerRef={inputRef as any}
|
159
167
|
ref={popoverRef}
|
160
168
|
placement="bottom start"
|
169
|
+
shouldFlip={false}
|
161
170
|
>
|
162
171
|
<ListBox
|
163
172
|
{...listBoxProps}
|
@@ -94,6 +94,7 @@ export function NumericStepper({
|
|
94
94
|
name={nameProp}
|
95
95
|
value={value}
|
96
96
|
{...formControlProps}
|
97
|
+
id={value !== 0 ? formControlProps.id : undefined}
|
97
98
|
fontSize="sm"
|
98
99
|
fontWeight="bold"
|
99
100
|
width="3ch"
|
@@ -140,6 +141,7 @@ export function NumericStepper({
|
|
140
141
|
onClick={() => onChange(value + 1)}
|
141
142
|
visibility={value >= maxValue ? "hidden" : "visible"}
|
142
143
|
isDisabled={formControlProps.disabled}
|
144
|
+
id={value === 0 ? formControlProps.id : undefined}
|
143
145
|
/>
|
144
146
|
</Flex>
|
145
147
|
);
|
@@ -156,6 +158,8 @@ type VerySmallButtonProps = {
|
|
156
158
|
visibility?: "visible" | "hidden";
|
157
159
|
/** Whether or not the button is disabled */
|
158
160
|
isDisabled?: boolean;
|
161
|
+
/** The ID of the button */
|
162
|
+
id?: string;
|
159
163
|
};
|
160
164
|
/** Internal override for extra small icon buttons */
|
161
165
|
const VerySmallButton = (props: VerySmallButtonProps) => {
|
package/src/input/Popover.tsx
CHANGED
@@ -27,6 +27,18 @@ type PopoverProps = {
|
|
27
27
|
* Defaults to "bottom"
|
28
28
|
*/
|
29
29
|
placement?: AriaPopoverProps["placement"];
|
30
|
+
/**
|
31
|
+
* Whether or not the list should flip to the opposite side of the trigger if there is not enough space.
|
32
|
+
* Defaults to false.
|
33
|
+
*/
|
34
|
+
shouldFlip?: boolean;
|
35
|
+
/**
|
36
|
+
* Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
|
37
|
+
* Most popovers should not use this option as it may negatively impact the screen reader experience. Only use with components such as combobox, which are designed to handle this situation carefully.
|
38
|
+
*
|
39
|
+
* Defaults to false.
|
40
|
+
*/
|
41
|
+
isNonModal?: boolean;
|
30
42
|
};
|
31
43
|
/**
|
32
44
|
* Internal popover component.
|
@@ -42,6 +54,8 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
42
54
|
offset = 0,
|
43
55
|
crossOffset = 0,
|
44
56
|
placement = "bottom",
|
57
|
+
shouldFlip = false,
|
58
|
+
isNonModal = false,
|
45
59
|
},
|
46
60
|
ref
|
47
61
|
) => {
|
@@ -55,6 +69,8 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
55
69
|
offset,
|
56
70
|
crossOffset,
|
57
71
|
placement,
|
72
|
+
shouldFlip,
|
73
|
+
isNonModal,
|
58
74
|
},
|
59
75
|
state
|
60
76
|
);
|