@vygruppen/spor-react 12.3.5 → 12.4.1

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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { useSlotRecipe, Accordion as Accordion$1, Stack, Box, HStack, Progress, defineRecipe, chakra, Text, useRecipe, Circle, Skeleton as Skeleton$1, Button as Button$1, Group as Group$1, Badge as Badge$1, Code as Code$1, Clipboard as Clipboard$1, IconButton as IconButton$1, useDisclosure, Alert as Alert$1, Span, Flex, Breadcrumb as Breadcrumb$1, ClientOnly as ClientOnly$1, Field, defineStyle, defineSlotRecipe, PopoverAnchor, useFieldContext, Popover as Popover$1, Portal, Dialog, createContext as createContext$1, Drawer as Drawer$1, Grid, GridItem, usePopoverContext, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, InputElement, NativeSelect as NativeSelect$1, useControllableState, createListCollection, RadioGroup as RadioGroup$1, Select as Select$1, Switch as Switch$1, Textarea as Textarea$1, RadioCard as RadioCard$1, Separator as Separator$1, Link, List as List$1, Center, Pagination as Pagination$1, usePaginationContext, createToaster, Tabs as Tabs$1, Table as Table$1, defineSemanticTokens, defineTokens, defineAnimationStyles, defineGlobalStyles, defineTextStyles, createSystem, defaultBaseConfig, VisuallyHidden, defineConfig, ListItem, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
1
+ import { useSlotRecipe, Accordion as Accordion$1, Stack, Box, HStack, Progress, defineRecipe, chakra, Text, useRecipe, Circle, Skeleton as Skeleton$1, Button as Button$1, Group as Group$1, Badge as Badge$1, Code as Code$1, Clipboard as Clipboard$1, IconButton as IconButton$1, useDisclosure, Alert as Alert$1, Span, Flex, Breadcrumb as Breadcrumb$1, ClientOnly as ClientOnly$1, Field, defineStyle, defineSlotRecipe, PopoverAnchor, useFieldContext, Popover as Popover$1, Portal, Dialog, createContext as createContext$1, Drawer as Drawer$1, Grid, GridItem, usePopoverContext, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, InputElement, NativeSelect as NativeSelect$1, useControllableState, createListCollection, RadioGroup as RadioGroup$1, Select as Select$1, useSelectContext, Switch as Switch$1, Textarea as Textarea$1, RadioCard as RadioCard$1, Separator as Separator$1, Link, List as List$1, Center, Pagination as Pagination$1, usePaginationContext, createToaster, Tabs as Tabs$1, Table as Table$1, defineSemanticTokens, defineTokens, defineAnimationStyles, defineGlobalStyles, defineTextStyles, createSystem, defaultBaseConfig, VisuallyHidden, defineConfig, ListItem, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
2
2
  export { Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack, TableBody, TableCaption, TableCell, TableColumn, TableColumnHeader, TableFooter, TableHeader, TableRoot, TableRow, VStack, VisuallyHidden, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useToken } from '@chakra-ui/react';
3
3
  import { DropdownDownFill24Icon, CopyOutline18Icon, CheckmarkFill18Icon, CloseFill18Icon, CloseFill30Icon, CloseFill24Icon, ServiceFill24Icon, QuestionFill24Icon, ErrorOutline24Icon, ErrorFill24Icon, AltTransportFill24Icon, WarningFill24Icon, SuccessFill24Icon, InformationFill24Icon, DropdownDownFill18Icon, DropdownRightFill18Icon, CalendarOutline24Icon, ArrowLeftFill24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill18Icon, WarningFill18Icon, ErrorFill18Icon, Forward15MediaControllerFill30Icon, Backward15MediaControllerFill30Icon, PauseMediaControllerFill24Icon, PlayMediaControllerFill24Icon, NextMediaControllerFill30Icon, PreviousMediaControllerFill30Icon, ArrowRightFill18Icon, DropdownLeftOutline18Icon, DropdownRightOutline18Icon, WalkFill30Icon, WalkFill24Icon, WalkFill18Icon, AltTransportFill30Icon, AltTransportFill18Icon, TramFill30Icon, TramFill24Icon, TramFill18Icon, SubwayFill30Icon, SubwayFill24Icon, SubwayFill18Icon, FerryFill30Icon, FerryFill24Icon, FerryFill18Icon, BusFill30Icon, BusFill24Icon, BusFill18Icon, ExpressBusFill30Icon, ExpressBusFill24Icon, ExpressBusFill18Icon, TrainFill30Icon, TrainFill24Icon, TrainFill18Icon, LinkOutOutline24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, DropdownLeftFill18Icon, SuccessFill18Icon } from '@vygruppen/spor-icon-react';
4
4
  import * as React28 from 'react';
@@ -4156,7 +4156,7 @@ var CountryCodeSelect = forwardRef((props, ref) => {
4156
4156
  lazyMount: true,
4157
4157
  "aria-label": t(texts15.countryCode),
4158
4158
  variant: "rightSideSquare",
4159
- children: callingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { item: code, children: code.label }, code.label))
4159
+ children: callingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { as: "option", item: code, children: code.label }, code.label))
4160
4160
  }
4161
4161
  );
4162
4162
  });
@@ -4225,6 +4225,7 @@ var PhoneNumberInput = forwardRef((props, ref) => {
4225
4225
  {
4226
4226
  ref,
4227
4227
  type: "tel",
4228
+ ...props,
4228
4229
  value: value.nationalNumber,
4229
4230
  invalid,
4230
4231
  errorText,
@@ -4238,7 +4239,6 @@ var PhoneNumberInput = forwardRef((props, ref) => {
4238
4239
  },
4239
4240
  variant,
4240
4241
  "data-state": "on",
4241
- ...props,
4242
4242
  label
4243
4243
  }
4244
4244
  )
@@ -4358,6 +4358,16 @@ var Select = React28.forwardRef(
4358
4358
  ) });
4359
4359
  }
4360
4360
  );
4361
+ var SelectLabel = (props) => {
4362
+ const { value } = useSelectContext();
4363
+ return /* @__PURE__ */ jsx(
4364
+ Select$1.Label,
4365
+ {
4366
+ ...props,
4367
+ "data-selected": value.length > 0 ? true : void 0
4368
+ }
4369
+ );
4370
+ };
4361
4371
  Select.displayName = "Select";
4362
4372
  var SelectItem = React28.forwardRef(
4363
4373
  (props, ref) => {
@@ -4365,7 +4375,7 @@ var SelectItem = React28.forwardRef(
4365
4375
  const recipe = useSlotRecipe({ key: "select" });
4366
4376
  const styles = recipe();
4367
4377
  return /* @__PURE__ */ jsxs(Select$1.Item, { item, ...rest, ref, css: styles.item, children: [
4368
- /* @__PURE__ */ jsxs(Box, { children: [
4378
+ /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
4369
4379
  /* @__PURE__ */ jsx(Select$1.ItemText, { display: "flex", children }),
4370
4380
  description && /* @__PURE__ */ jsx(Box, { css: styles.itemDescription, children: description })
4371
4381
  ] }),
@@ -4430,7 +4440,6 @@ var SelectValueText = React28.forwardRef(function SelectValueText2(props, ref) {
4430
4440
  }
4431
4441
  );
4432
4442
  });
4433
- var SelectLabel = Select$1.Label;
4434
4443
  var SelectItemText = Select$1.ItemText;
4435
4444
  var SelectRoot = Select$1.Root;
4436
4445
  var Switch = forwardRef(
@@ -7116,9 +7125,6 @@ var alertSlotRecipe = defineSlotRecipe({
7116
7125
  border: "sm"
7117
7126
  },
7118
7127
  description: {
7119
- display: "flex",
7120
- alignItems: "flex-start",
7121
- gap: 1.5,
7122
7128
  color: "text"
7123
7129
  },
7124
7130
  content: {
@@ -7129,7 +7135,8 @@ var alertSlotRecipe = defineSlotRecipe({
7129
7135
  },
7130
7136
  title: {
7131
7137
  fontWeight: "bold"
7132
- }
7138
+ },
7139
+ closeButton: {}
7133
7140
  },
7134
7141
  variants: {
7135
7142
  variant: {
@@ -9201,17 +9208,7 @@ var selectSlotRecipe = defineSlotRecipe({
9201
9208
  flexDirection: "column",
9202
9209
  position: "relative",
9203
9210
  cursor: "pointer",
9204
- zIndex: "dropdown",
9205
- "& [data-state='open']": {
9206
- "& + label": {
9207
- transform: ["scale(0.825) translateY(-10px)"]
9208
- }
9209
- },
9210
- "&:has(button span:not(:empty))": {
9211
- "& label": {
9212
- transform: ["scale(0.825) translateY(-10px)"]
9213
- }
9214
- }
9211
+ zIndex: "dropdown"
9215
9212
  },
9216
9213
  label: {
9217
9214
  fontSize: ["mobile.sm", "desktop.sm"],
@@ -9219,7 +9216,11 @@ var selectSlotRecipe = defineSlotRecipe({
9219
9216
  left: 3,
9220
9217
  zIndex: 0,
9221
9218
  position: "absolute",
9219
+ color: "text",
9222
9220
  marginY: 2,
9221
+ _selected: {
9222
+ transform: ["scale(0.825) translateY(-10px)"]
9223
+ },
9223
9224
  transitionProperty: "transform",
9224
9225
  transitionDuration: "fast",
9225
9226
  transformOrigin: "top left",
@@ -9231,6 +9232,7 @@ var selectSlotRecipe = defineSlotRecipe({
9231
9232
  appearance: "none",
9232
9233
  width: "100%",
9233
9234
  height: 8,
9235
+ color: "text",
9234
9236
  paddingY: 1.5,
9235
9237
  paddingX: 3,
9236
9238
  justifyContent: "space-between",
@@ -9281,7 +9283,8 @@ var selectSlotRecipe = defineSlotRecipe({
9281
9283
  _open: {
9282
9284
  animationStyle: "slide-fade-in",
9283
9285
  animationDuration: "fast",
9284
- zIndex: "popover"
9286
+ zIndex: "popover",
9287
+ outline: "none"
9285
9288
  },
9286
9289
  _closed: {
9287
9290
  animationStyle: "slide-fade-out",
@@ -9301,6 +9304,17 @@ var selectSlotRecipe = defineSlotRecipe({
9301
9304
  color: "ghost.text",
9302
9305
  cursor: "pointer",
9303
9306
  outline: "none",
9307
+ "&[data-highlighted]:hover": {
9308
+ outlineOffset: "2px",
9309
+ outline: "2px solid",
9310
+ outlineColor: "outline.focus",
9311
+ backgroundColor: "ghost.surface.hover"
9312
+ },
9313
+ "&[data-highlighted]": {
9314
+ outlineOffset: "2px",
9315
+ outline: "2px solid",
9316
+ outlineColor: "outline.focus"
9317
+ },
9304
9318
  _active: {
9305
9319
  backgroundColor: "ghost.surface.active",
9306
9320
  color: "green"