@vygruppen/spor-react 8.1.0 → 8.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@8.1.0 build
2
+ > @vygruppen/spor-react@8.2.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -10,13 +10,13 @@
10
10
  ESM Build start
11
11
  "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
12
12
  DTS Build start
13
- "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-JUNOSADJ.mjs".
14
- CJS dist/index.js 502.62 KB
15
- CJS ⚡️ Build success in 2210ms
13
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-D4IHIS3H.mjs".
14
+ CJS dist/index.js 503.28 KB
15
+ CJS ⚡️ Build success in 2095ms
16
16
  ESM dist/index.mjs 2.01 KB
17
- ESM dist/CountryCodeSelect-X4ONXTIF.mjs 1.19 KB
18
- ESM dist/chunk-JUNOSADJ.mjs 394.94 KB
19
- ESM ⚡️ Build success in 2211ms
20
- DTS ⚡️ Build success in 11198ms
21
- DTS dist/index.d.ts 271.10 KB
22
- DTS dist/index.d.mts 271.10 KB
17
+ ESM dist/CountryCodeSelect-POM47KR5.mjs 1.19 KB
18
+ ESM dist/chunk-D4IHIS3H.mjs 395.57 KB
19
+ ESM ⚡️ Build success in 2097ms
20
+ DTS ⚡️ Build success in 10536ms
21
+ DTS dist/index.d.ts 271.35 KB
22
+ DTS dist/index.d.mts 271.35 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f96483c: ListBox: Fix a focus bug
8
+
9
+ ### Patch Changes
10
+
11
+ - 5c87f0c: ListBox: Fix focus styles for listbox
12
+ - 7011328: TextLink: Updated colors for primary and secondary variants to align with Figma
13
+
3
14
  ## 8.1.0
4
15
 
5
16
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-JUNOSADJ.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-D4IHIS3H.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -2669,6 +2669,7 @@ function Combobox({
2669
2669
  paddingY,
2670
2670
  emptyContent,
2671
2671
  inputRef: externalInputRef,
2672
+ allowsEmptyCollection,
2672
2673
  ...rest
2673
2674
  }) {
2674
2675
  const { contains: contains2 } = useFilter({ sensitivity: "base" });
@@ -2678,11 +2679,11 @@ function Combobox({
2678
2679
  const popoverRef = useRef(null);
2679
2680
  const inputWidth = useInputWidth(inputRef);
2680
2681
  const state2 = useComboBoxState({
2681
- ...rest,
2682
- defaultFilter: contains2,
2683
2682
  allowsEmptyCollection: Boolean(emptyContent),
2683
+ defaultFilter: contains2,
2684
2684
  shouldCloseOnBlur: true,
2685
- label
2685
+ label,
2686
+ ...rest
2686
2687
  });
2687
2688
  const {
2688
2689
  inputProps: { size: size2, ...inputProps },
@@ -3432,7 +3433,7 @@ var texts14 = createTexts({
3432
3433
  sv: "Telefonnummer"
3433
3434
  }
3434
3435
  });
3435
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-X4ONXTIF.mjs'));
3436
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-POM47KR5.mjs'));
3436
3437
  var Radio = forwardRef((props, ref) => {
3437
3438
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
3438
3439
  });
@@ -10103,6 +10104,23 @@ function accentText(state2, props) {
10103
10104
  };
10104
10105
  }
10105
10106
  }
10107
+ function brandText(state2, props) {
10108
+ switch (state2) {
10109
+ case "hover":
10110
+ return {
10111
+ color: mode("white", "darkTeal")(props)
10112
+ };
10113
+ case "active":
10114
+ return {
10115
+ color: mode("white", "darkTeal")(props)
10116
+ };
10117
+ case "default":
10118
+ default:
10119
+ return {
10120
+ color: mode("pine", "coralGreen")(props)
10121
+ };
10122
+ }
10123
+ }
10106
10124
 
10107
10125
  // src/theme/components/accordion.ts
10108
10126
  var helpers = createMultiStyleConfigHelpers(accordionAnatomy.keys);
@@ -12338,25 +12356,34 @@ var config23 = defineStyleConfig$1({
12338
12356
  }),
12339
12357
  variants: {
12340
12358
  primary: (props) => ({
12341
- color: mode("pine", "coralGreen")(props),
12359
+ ...brandText("default", props),
12342
12360
  _hover: {
12343
- color: mode("darkTeal", "white")(props),
12344
- backgroundColor: mode("coralGreen", "whiteAlpha.200")(props)
12361
+ ...brandText("hover", props),
12362
+ ...brandBackground("hover", props)
12345
12363
  },
12346
12364
  _active: {
12347
- color: mode("pine", "white")(props),
12348
- backgroundColor: mode("mint", "whiteAlpha.100")(props)
12365
+ ...brandText("active", props),
12366
+ ...brandBackground("active", props)
12349
12367
  }
12350
12368
  }),
12351
12369
  secondary: (props) => ({
12352
- color: mode("darkGrey", "white")(props),
12370
+ backgroundImage: `linear-gradient(${mode(
12371
+ "blackAlpha.400",
12372
+ "whiteAlpha.400"
12373
+ )(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
12374
+ ...baseText("default", props),
12375
+ "&:focus, &:focus-visible, &:active, &:hover": {
12376
+ outline: "solid",
12377
+ outlineWidth: "1px"
12378
+ },
12379
+ ...baseBackground("default", props),
12353
12380
  _hover: {
12354
- backgroundColor: mode("blackAlpha.100", "whiteAlpha.200")(props),
12355
- color: mode("darkGrey", "white")(props)
12381
+ outlineColor: mode("darkGrey", "white")(props),
12382
+ ...baseBackground("hover", props)
12356
12383
  },
12357
12384
  _active: {
12358
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
12359
- color: mode("darkGrey", "white")(props)
12385
+ outlineColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
12386
+ ...baseBackground("active", props)
12360
12387
  }
12361
12388
  })
12362
12389
  },
@@ -12421,7 +12448,9 @@ var config24 = helpers15.defineMultiStyleConfig({
12421
12448
  _hover: {
12422
12449
  ...ghostBackground("hover", props)
12423
12450
  },
12424
- ...focusVisibleStyles(props),
12451
+ _focus: {
12452
+ ...ghostBackground("selected", props)
12453
+ },
12425
12454
  _selected: {
12426
12455
  ...ghostBackground("selected", props)
12427
12456
  }
package/dist/index.d.mts CHANGED
@@ -776,6 +776,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
776
776
  emptyContent?: React.ReactNode;
777
777
  /** A ref to the input field */
778
778
  inputRef?: React.RefObject<HTMLInputElement>;
779
+ /** If you want to allow an empty collection */
780
+ allowsEmptyCollection?: boolean;
779
781
  } & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
780
782
  /**
781
783
  * A combobox is a combination of an input and a list of suggestions.
@@ -800,7 +802,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
800
802
  * </Combobox>
801
803
  * ```
802
804
  */
803
- declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
805
+ declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, allowsEmptyCollection, ...rest }: ComboboxProps<T>): React.JSX.Element;
804
806
 
805
807
  type FormControlProps = FormControlProps$1;
806
808
  declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
@@ -4252,26 +4254,32 @@ declare const theme: {
4252
4254
  } | undefined;
4253
4255
  variants?: {
4254
4256
  primary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
4255
- color: string;
4256
4257
  _hover: {
4257
- color: string;
4258
4258
  backgroundColor: string;
4259
+ color: string;
4259
4260
  };
4260
4261
  _active: {
4261
- color: string;
4262
4262
  backgroundColor: string;
4263
+ color: string;
4263
4264
  };
4265
+ color: string;
4264
4266
  };
4265
4267
  secondary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
4266
- color: string;
4267
4268
  _hover: {
4268
4269
  backgroundColor: string;
4269
- color: string;
4270
+ outlineColor: string;
4270
4271
  };
4271
4272
  _active: {
4272
4273
  backgroundColor: string;
4273
- color: string;
4274
+ outlineColor: string;
4275
+ };
4276
+ backgroundColor: string;
4277
+ "&:focus, &:focus-visible, &:active, &:hover": {
4278
+ outline: string;
4279
+ outlineWidth: string;
4274
4280
  };
4281
+ color: string;
4282
+ backgroundImage: string;
4275
4283
  };
4276
4284
  } | undefined;
4277
4285
  defaultProps?: {
@@ -4323,15 +4331,6 @@ declare const theme: {
4323
4331
  borderBottomRadius: string;
4324
4332
  };
4325
4333
  item: {
4326
- _selected: {
4327
- backgroundColor: string;
4328
- };
4329
- _focusVisible: {
4330
- outlineWidth: string;
4331
- outlineColor: string;
4332
- outlineStyle: string;
4333
- outlineOffset: string;
4334
- };
4335
4334
  paddingX: number;
4336
4335
  paddingY: number;
4337
4336
  marginY: number;
@@ -4346,6 +4345,12 @@ declare const theme: {
4346
4345
  _hover: {
4347
4346
  backgroundColor: string;
4348
4347
  };
4348
+ _focus: {
4349
+ backgroundColor: string;
4350
+ };
4351
+ _selected: {
4352
+ backgroundColor: string;
4353
+ };
4349
4354
  };
4350
4355
  label: {};
4351
4356
  description: {
package/dist/index.d.ts CHANGED
@@ -776,6 +776,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
776
776
  emptyContent?: React.ReactNode;
777
777
  /** A ref to the input field */
778
778
  inputRef?: React.RefObject<HTMLInputElement>;
779
+ /** If you want to allow an empty collection */
780
+ allowsEmptyCollection?: boolean;
779
781
  } & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
780
782
  /**
781
783
  * A combobox is a combination of an input and a list of suggestions.
@@ -800,7 +802,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
800
802
  * </Combobox>
801
803
  * ```
802
804
  */
803
- declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
805
+ declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, allowsEmptyCollection, ...rest }: ComboboxProps<T>): React.JSX.Element;
804
806
 
805
807
  type FormControlProps = FormControlProps$1;
806
808
  declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
@@ -4252,26 +4254,32 @@ declare const theme: {
4252
4254
  } | undefined;
4253
4255
  variants?: {
4254
4256
  primary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
4255
- color: string;
4256
4257
  _hover: {
4257
- color: string;
4258
4258
  backgroundColor: string;
4259
+ color: string;
4259
4260
  };
4260
4261
  _active: {
4261
- color: string;
4262
4262
  backgroundColor: string;
4263
+ color: string;
4263
4264
  };
4265
+ color: string;
4264
4266
  };
4265
4267
  secondary: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
4266
- color: string;
4267
4268
  _hover: {
4268
4269
  backgroundColor: string;
4269
- color: string;
4270
+ outlineColor: string;
4270
4271
  };
4271
4272
  _active: {
4272
4273
  backgroundColor: string;
4273
- color: string;
4274
+ outlineColor: string;
4275
+ };
4276
+ backgroundColor: string;
4277
+ "&:focus, &:focus-visible, &:active, &:hover": {
4278
+ outline: string;
4279
+ outlineWidth: string;
4274
4280
  };
4281
+ color: string;
4282
+ backgroundImage: string;
4275
4283
  };
4276
4284
  } | undefined;
4277
4285
  defaultProps?: {
@@ -4323,15 +4331,6 @@ declare const theme: {
4323
4331
  borderBottomRadius: string;
4324
4332
  };
4325
4333
  item: {
4326
- _selected: {
4327
- backgroundColor: string;
4328
- };
4329
- _focusVisible: {
4330
- outlineWidth: string;
4331
- outlineColor: string;
4332
- outlineStyle: string;
4333
- outlineOffset: string;
4334
- };
4335
4334
  paddingX: number;
4336
4335
  paddingY: number;
4337
4336
  marginY: number;
@@ -4346,6 +4345,12 @@ declare const theme: {
4346
4345
  _hover: {
4347
4346
  backgroundColor: string;
4348
4347
  };
4348
+ _focus: {
4349
+ backgroundColor: string;
4350
+ };
4351
+ _selected: {
4352
+ backgroundColor: string;
4353
+ };
4349
4354
  };
4350
4355
  label: {};
4351
4356
  description: {
package/dist/index.js CHANGED
@@ -3173,6 +3173,7 @@ function Combobox({
3173
3173
  paddingY,
3174
3174
  emptyContent,
3175
3175
  inputRef: externalInputRef,
3176
+ allowsEmptyCollection,
3176
3177
  ...rest
3177
3178
  }) {
3178
3179
  const { contains: contains2 } = reactAria.useFilter({ sensitivity: "base" });
@@ -3182,11 +3183,11 @@ function Combobox({
3182
3183
  const popoverRef = React69.useRef(null);
3183
3184
  const inputWidth = useInputWidth(inputRef);
3184
3185
  const state2 = reactStately.useComboBoxState({
3185
- ...rest,
3186
- defaultFilter: contains2,
3187
3186
  allowsEmptyCollection: Boolean(emptyContent),
3187
+ defaultFilter: contains2,
3188
3188
  shouldCloseOnBlur: true,
3189
- label
3189
+ label,
3190
+ ...rest
3190
3191
  });
3191
3192
  const {
3192
3193
  inputProps: { size: size2, ...inputProps },
@@ -11514,6 +11515,23 @@ function accentText(state2, props) {
11514
11515
  };
11515
11516
  }
11516
11517
  }
11518
+ function brandText(state2, props) {
11519
+ switch (state2) {
11520
+ case "hover":
11521
+ return {
11522
+ color: themeTools.mode("white", "darkTeal")(props)
11523
+ };
11524
+ case "active":
11525
+ return {
11526
+ color: themeTools.mode("white", "darkTeal")(props)
11527
+ };
11528
+ case "default":
11529
+ default:
11530
+ return {
11531
+ color: themeTools.mode("pine", "coralGreen")(props)
11532
+ };
11533
+ }
11534
+ }
11517
11535
  var init_text_utils = __esm({
11518
11536
  "src/theme/utils/text-utils.ts"() {
11519
11537
  init_foundations();
@@ -13884,6 +13902,8 @@ var config23, link_default;
13884
13902
  var init_link2 = __esm({
13885
13903
  "src/theme/components/link.ts"() {
13886
13904
  init_focus_util();
13905
+ init_background_utils();
13906
+ init_text_utils();
13887
13907
  config23 = react.defineStyleConfig({
13888
13908
  baseStyle: (props) => ({
13889
13909
  transitionProperty: "common",
@@ -13917,25 +13937,34 @@ var init_link2 = __esm({
13917
13937
  }),
13918
13938
  variants: {
13919
13939
  primary: (props) => ({
13920
- color: themeTools.mode("pine", "coralGreen")(props),
13940
+ ...brandText("default", props),
13921
13941
  _hover: {
13922
- color: themeTools.mode("darkTeal", "white")(props),
13923
- backgroundColor: themeTools.mode("coralGreen", "whiteAlpha.200")(props)
13942
+ ...brandText("hover", props),
13943
+ ...brandBackground("hover", props)
13924
13944
  },
13925
13945
  _active: {
13926
- color: themeTools.mode("pine", "white")(props),
13927
- backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props)
13946
+ ...brandText("active", props),
13947
+ ...brandBackground("active", props)
13928
13948
  }
13929
13949
  }),
13930
13950
  secondary: (props) => ({
13931
- color: themeTools.mode("darkGrey", "white")(props),
13951
+ backgroundImage: `linear-gradient(${themeTools.mode(
13952
+ "blackAlpha.400",
13953
+ "whiteAlpha.400"
13954
+ )(props)}, ${themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
13955
+ ...baseText("default", props),
13956
+ "&:focus, &:focus-visible, &:active, &:hover": {
13957
+ outline: "solid",
13958
+ outlineWidth: "1px"
13959
+ },
13960
+ ...baseBackground("default", props),
13932
13961
  _hover: {
13933
- backgroundColor: themeTools.mode("blackAlpha.100", "whiteAlpha.200")(props),
13934
- color: themeTools.mode("darkGrey", "white")(props)
13962
+ outlineColor: themeTools.mode("darkGrey", "white")(props),
13963
+ ...baseBackground("hover", props)
13935
13964
  },
13936
13965
  _active: {
13937
- backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props),
13938
- color: themeTools.mode("darkGrey", "white")(props)
13966
+ outlineColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props),
13967
+ ...baseBackground("active", props)
13939
13968
  }
13940
13969
  })
13941
13970
  },
@@ -13978,7 +14007,6 @@ var init_listbox = __esm({
13978
14007
  init_dist4();
13979
14008
  init_foundations();
13980
14009
  init_background_utils();
13981
- init_focus_util();
13982
14010
  parts10 = anatomy("ListBox").parts(
13983
14011
  "container",
13984
14012
  "item",
@@ -14016,7 +14044,9 @@ var init_listbox = __esm({
14016
14044
  _hover: {
14017
14045
  ...ghostBackground("hover", props)
14018
14046
  },
14019
- ...focusVisibleStyles(props),
14047
+ _focus: {
14048
+ ...ghostBackground("selected", props)
14049
+ },
14020
14050
  _selected: {
14021
14051
  ...ghostBackground("selected", props)
14022
14052
  }
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, 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, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, 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, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-JUNOSADJ.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, 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, Nudge, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, 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, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-D4IHIS3H.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -13,6 +13,8 @@ export type ComboboxProps<T> = AriaComboBoxProps<T> & {
13
13
  emptyContent?: React.ReactNode;
14
14
  /** A ref to the input field */
15
15
  inputRef?: React.RefObject<HTMLInputElement>;
16
+ /** If you want to allow an empty collection */
17
+ allowsEmptyCollection?: boolean;
16
18
  } & Pick<
17
19
  InputProps,
18
20
  | "marginTop"
@@ -81,6 +83,7 @@ export function Combobox<T extends object>({
81
83
  paddingY,
82
84
  emptyContent,
83
85
  inputRef: externalInputRef,
86
+ allowsEmptyCollection,
84
87
  ...rest
85
88
  }: ComboboxProps<T>) {
86
89
  const { contains } = useFilter({ sensitivity: "base" });
@@ -93,11 +96,11 @@ export function Combobox<T extends object>({
93
96
  const inputWidth = useInputWidth(inputRef);
94
97
 
95
98
  const state = useComboBoxState({
96
- ...rest,
97
- defaultFilter: contains,
98
99
  allowsEmptyCollection: Boolean(emptyContent),
100
+ defaultFilter: contains,
99
101
  shouldCloseOnBlur: true,
100
102
  label,
103
+ ...rest,
101
104
  });
102
105
 
103
106
  const {
@@ -1,6 +1,8 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { mode } from "@chakra-ui/theme-tools";
3
3
  import { focusVisibleStyles } from "../utils/focus-util";
4
+ import { baseBackground, brandBackground } from "../utils/background-utils";
5
+ import { baseText, brandText } from "../utils/text-utils";
4
6
 
5
7
  const config = defineStyleConfig({
6
8
  baseStyle: (props) => ({
@@ -38,25 +40,34 @@ const config = defineStyleConfig({
38
40
  }),
39
41
  variants: {
40
42
  primary: (props) => ({
41
- color: mode("pine", "coralGreen")(props),
43
+ ...brandText("default", props),
42
44
  _hover: {
43
- color: mode("darkTeal", "white")(props),
44
- backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
45
+ ...brandText("hover", props),
46
+ ...brandBackground("hover", props),
45
47
  },
46
48
  _active: {
47
- color: mode("pine", "white")(props),
48
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
49
+ ...brandText("active", props),
50
+ ...brandBackground("active", props),
49
51
  },
50
52
  }),
51
53
  secondary: (props) => ({
52
- color: mode("darkGrey", "white")(props),
54
+ backgroundImage: `linear-gradient(${mode(
55
+ "blackAlpha.400",
56
+ "whiteAlpha.400",
57
+ )(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
58
+ ...baseText("default", props),
59
+ "&:focus, &:focus-visible, &:active, &:hover": {
60
+ outline: "solid",
61
+ outlineWidth: "1px",
62
+ },
63
+ ...baseBackground("default", props),
53
64
  _hover: {
54
- backgroundColor: mode("blackAlpha.100", "whiteAlpha.200")(props),
55
- color: mode("darkGrey", "white")(props),
65
+ outlineColor: mode("darkGrey", "white")(props),
66
+ ...baseBackground("hover", props),
56
67
  },
57
68
  _active: {
58
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
59
- color: mode("darkGrey", "white")(props),
69
+ outlineColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
70
+ ...baseBackground("active", props),
60
71
  },
61
72
  }),
62
73
  },
@@ -3,7 +3,6 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
3
  import { mode } from "@chakra-ui/theme-tools";
4
4
  import { colors } from "../foundations";
5
5
  import { ghostBackground } from "../utils/background-utils";
6
- import { focusVisibleStyles } from "../utils/focus-util";
7
6
 
8
7
  const parts = anatomy("ListBox").parts(
9
8
  "container",
@@ -44,7 +43,9 @@ const config = helpers.defineMultiStyleConfig({
44
43
  _hover: {
45
44
  ...ghostBackground("hover", props),
46
45
  },
47
- ...focusVisibleStyles(props),
46
+ _focus: {
47
+ ...ghostBackground("selected", props),
48
+ },
48
49
  _selected: {
49
50
  ...ghostBackground("selected", props),
50
51
  },
@@ -38,3 +38,23 @@ export function accentText(state: AccentTextState, props: StyleFunctionProps) {
38
38
  };
39
39
  }
40
40
  }
41
+
42
+ type BrandTextState = Subset<State, "hover" | "active" | "default">;
43
+
44
+ export function brandText(state: BrandTextState, props: StyleFunctionProps) {
45
+ switch (state) {
46
+ case "hover":
47
+ return {
48
+ color: mode("white", "darkTeal")(props),
49
+ };
50
+ case "active":
51
+ return {
52
+ color: mode("white", "darkTeal")(props),
53
+ };
54
+ case "default":
55
+ default:
56
+ return {
57
+ color: mode("pine", "coralGreen")(props),
58
+ };
59
+ }
60
+ }