@vygruppen/spor-react 7.0.0 → 7.1.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@7.0.0 build
2
+ > @vygruppen/spor-react@7.1.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -8,15 +8,15 @@
8
8
  CLI Target: node16
9
9
  CJS Build start
10
10
  ESM Build start
11
- "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-CYU6YFQK.mjs".
12
11
  "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
12
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-UQDHT6S5.mjs".
13
13
  DTS Build start
14
+ CJS dist/index.js 494.15 KB
15
+ CJS ⚡️ Build success in 2222ms
14
16
  ESM dist/index.mjs 2.16 KB
15
- ESM dist/CountryCodeSelect-OK6RZ6AY.mjs 1.19 KB
16
- ESM dist/chunk-CYU6YFQK.mjs 385.72 KB
17
- ESM ⚡️ Build success in 2175ms
18
- CJS dist/index.js 492.77 KB
19
- CJS ⚡️ Build success in 2175ms
20
- DTS ⚡️ Build success in 10809ms
21
- DTS dist/index.d.ts 262.80 KB
22
- DTS dist/index.d.mts 262.80 KB
17
+ ESM dist/CountryCodeSelect-NMBC7YLP.mjs 1.19 KB
18
+ ESM dist/chunk-UQDHT6S5.mjs 386.88 KB
19
+ ESM ⚡️ Build success in 2223ms
20
+ DTS ⚡️ Build success in 11100ms
21
+ DTS dist/index.d.ts 264.83 KB
22
+ DTS dist/index.d.mts 264.83 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 7.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cd07ee5: Stepper: Redesign and re-implement the Stepper component.
8
+
9
+ This change also introduces a new prop – onBackButtonClick – which is called whenever the back button is clicked on smaller screen. It receives a boolean argument outlining whether or not the current step is the first one or not. If you don't pass this prop, the back button will be hidden on the first step.
10
+
11
+ ## 7.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 1e960e1: Button, FAB: Tweak disabled state
16
+ - a7590c8: ProgressIndicator: Change colors of inactive dots
17
+ - 0ccf0c5: Stepper: Change the breakpoint for when the stepper changes from one design to another
18
+
3
19
  ## 7.0.0
4
20
 
5
21
  ### Major Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-CYU6YFQK.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-UQDHT6S5.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1,11 +1,11 @@
1
1
  import tokens10__default from '@vygruppen/spor-design-tokens';
2
2
  import * as tokens10 from '@vygruppen/spor-design-tokens';
3
3
  export { tokens10 as tokens };
4
- import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, useStyleConfig, Box, Center, Flex, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, Button as Button$1, 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, useColorMode, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, useColorModeValue, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
4
+ import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, useStyleConfig, Box, Center, Flex, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, Button as Button$1, 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, useColorMode, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, useColorModeValue, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, useToast as useToast$1, useInterval } from '@chakra-ui/react';
5
5
  export { AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, Box, Center, Container, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, Fade, Flex, FormHelperText, Grid, GridItem, HStack, Image, Img, InputGroup, LightMode, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, VStack, Wrap, WrapItem, defineStyleConfig, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
6
6
  import * as React69 from 'react';
7
7
  import React69__default, { createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, useId, Suspense, useContext, useCallback, useMemo, useLayoutEffect } from 'react';
8
- import { CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, CalendarOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill24Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, LinkOutOutline24Icon, DropdownRightFill18Icon, DropdownLeftFill18Icon, DropdownDownFill18Icon, DropdownDownFill24Icon, DropdownUpFill24Icon, ArrowRightFill18Icon, DropdownLeftFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, ErrorOutline24Icon, AltTransportOutline24Icon, WarningOutline24Icon, SuccessOutline24Icon, InformationOutline24Icon, TrainFill18Icon, TrainFill24Icon, TrainFill30Icon, ExpressBusFill18Icon, ExpressBusFill24Icon, ExpressBusFill30Icon, BusFill18Icon, BusFill24Icon, BusFill30Icon, FerryFill18Icon, FerryFill24Icon, FerryFill30Icon, SubwayFill18Icon, SubwayFill24Icon, SubwayFill30Icon, TramFill18Icon, TramFill24Icon, TramFill30Icon, AltTransportFill18Icon, AltTransportFill24Icon, AltTransportFill30Icon, WalkFill18Icon, WalkFill24Icon, WalkFill30Icon } from '@vygruppen/spor-icon-react';
8
+ import { CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, CalendarOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill24Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, LinkOutOutline24Icon, DropdownRightFill18Icon, DropdownLeftFill18Icon, DropdownDownFill18Icon, DropdownDownFill24Icon, DropdownUpFill24Icon, ArrowRightFill18Icon, ArrowLeftFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, ErrorOutline24Icon, AltTransportOutline24Icon, WarningOutline24Icon, SuccessOutline24Icon, InformationOutline24Icon, TrainFill18Icon, TrainFill24Icon, TrainFill30Icon, ExpressBusFill18Icon, ExpressBusFill24Icon, ExpressBusFill30Icon, BusFill18Icon, BusFill24Icon, BusFill30Icon, FerryFill18Icon, FerryFill24Icon, FerryFill30Icon, SubwayFill18Icon, SubwayFill24Icon, SubwayFill30Icon, TramFill18Icon, TramFill24Icon, TramFill30Icon, AltTransportFill18Icon, AltTransportFill24Icon, AltTransportFill30Icon, WalkFill18Icon, WalkFill24Icon, WalkFill30Icon } from '@vygruppen/spor-icon-react';
9
9
  import { inlineLoaderColorData, spinnerColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, fullScreenLoaderBlackData, inlineLoaderLightData, spinnerLightData, spinnerDarkData } from '@vygruppen/spor-loader';
10
10
  import { useLottie } from 'lottie-react';
11
11
  import { useDateSegment, useDateField, useDatePicker, I18nProvider, usePopover, DismissButton, Overlay, useOverlayTrigger, useButton, useProgressBar, useCalendar, useDateRangePicker, useDialog, useFilter, useComboBox, useListBox, useOption, useListBoxSection, useSelect, HiddenSelect, useCalendarGrid, useRangeCalendar, useTimeField, useCalendarCell } from 'react-aria';
@@ -3417,7 +3417,7 @@ var texts14 = createTexts({
3417
3417
  sv: "Telefonnummer"
3418
3418
  }
3419
3419
  });
3420
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-OK6RZ6AY.mjs'));
3420
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-NMBC7YLP.mjs'));
3421
3421
  var Radio = forwardRef((props, ref) => {
3422
3422
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
3423
3423
  });
@@ -4268,16 +4268,22 @@ var useStepper = () => {
4268
4268
  var Stepper = ({
4269
4269
  onClick = () => {
4270
4270
  },
4271
+ onBackButtonClick,
4271
4272
  steps,
4272
4273
  activeStep: activeStepAsStringOrNumber,
4273
4274
  title,
4274
- variant
4275
+ heading,
4276
+ headingLevel,
4277
+ variant,
4278
+ isDisabled
4275
4279
  }) => {
4276
4280
  const style = useMultiStyleConfig("Stepper", { variant });
4277
4281
  const numberOfSteps = steps.length;
4278
4282
  const activeStep = Number(activeStepAsStringOrNumber);
4279
4283
  const { t: t2 } = useTranslation();
4280
- return /* @__PURE__ */ React69__default.createElement(Box, { __css: style.root }, /* @__PURE__ */ React69__default.createElement(
4284
+ const hideBackButtonOnFirstStep = activeStep === 1 && !onBackButtonClick;
4285
+ const shownHeading = heading || title;
4286
+ return /* @__PURE__ */ React69__default.createElement(Box, { sx: style.root }, /* @__PURE__ */ React69__default.createElement(
4281
4287
  StepperProvider,
4282
4288
  {
4283
4289
  onClick,
@@ -4285,40 +4291,51 @@ var Stepper = ({
4285
4291
  variant,
4286
4292
  numberOfSteps
4287
4293
  },
4288
- /* @__PURE__ */ React69__default.createElement(Box, { __css: style.container }, /* @__PURE__ */ React69__default.createElement(Box, { __css: style.innerContainer }, /* @__PURE__ */ React69__default.createElement(HStack, null, activeStep > 1 && /* @__PURE__ */ React69__default.createElement(
4289
- IconButton,
4290
- {
4291
- "aria-label": t2(texts22.back),
4292
- icon: /* @__PURE__ */ React69__default.createElement(DropdownLeftFill24Icon, null),
4293
- variant: "ghost",
4294
- size: "sm",
4295
- onClick: () => onClick(activeStep - 1),
4296
- __css: style.backButton
4297
- }
4298
- ), /* @__PURE__ */ React69__default.createElement(
4299
- SimplePopover,
4294
+ /* @__PURE__ */ React69__default.createElement(Box, { sx: style.container }, /* @__PURE__ */ React69__default.createElement(Box, { sx: style.innerContainer }, /* @__PURE__ */ React69__default.createElement(
4295
+ Flex,
4300
4296
  {
4301
- triggerElement: /* @__PURE__ */ React69__default.createElement(Box, { as: "button", __css: style.stepCounter }, t2(texts22.stepsOf(activeStep, numberOfSteps))),
4302
- borderRadius: "xs"
4297
+ justifyContent: "space-between",
4298
+ alignItems: "center",
4299
+ gap: 2,
4300
+ flex: 1
4303
4301
  },
4304
- steps.map((step, index) => /* @__PURE__ */ React69__default.createElement(
4305
- StepperStep,
4302
+ /* @__PURE__ */ React69__default.createElement(
4303
+ IconButton,
4306
4304
  {
4307
- key: step,
4308
- stepNumber: index + 1,
4309
- variant
4310
- },
4311
- step
4312
- ))
4313
- )), title && /* @__PURE__ */ React69__default.createElement(Box, { as: "h3", __css: style.title }, title)), /* @__PURE__ */ React69__default.createElement(Flex, { justifyContent: "center", display: ["none", "flex"] }, steps.map((step, index) => /* @__PURE__ */ React69__default.createElement(StepperStep, { key: index, stepNumber: index + 1, variant }, step))))
4305
+ "aria-label": t2(texts22.back),
4306
+ icon: /* @__PURE__ */ React69__default.createElement(ArrowLeftFill24Icon, null),
4307
+ variant: "ghost",
4308
+ size: "sm",
4309
+ visibility: hideBackButtonOnFirstStep ? "hidden" : "visible",
4310
+ onClick: () => {
4311
+ if (onBackButtonClick) {
4312
+ onBackButtonClick(activeStep === 1);
4313
+ }
4314
+ onClick(activeStep - 1);
4315
+ }
4316
+ }
4317
+ ),
4318
+ shownHeading && /* @__PURE__ */ React69__default.createElement(Text4, { flex: 1, variant: "sm", as: headingLevel, sx: style.title }, shownHeading),
4319
+ /* @__PURE__ */ React69__default.createElement(Box, { sx: style.stepCounter }, t2(texts22.stepsOf(activeStep, numberOfSteps)))
4320
+ )), /* @__PURE__ */ React69__default.createElement(Flex, { justifyContent: "center", display: ["none", null, "flex"] }, steps.map((step, index) => /* @__PURE__ */ React69__default.createElement(
4321
+ StepperStep,
4322
+ {
4323
+ key: index,
4324
+ stepNumber: index + 1,
4325
+ variant,
4326
+ "aria-current": index + 1 === activeStep ? "step" : void 0,
4327
+ isDisabled
4328
+ },
4329
+ step
4330
+ ))))
4314
4331
  ));
4315
4332
  };
4316
4333
  var texts22 = createTexts({
4317
4334
  stepsOf: (activeStep, numberOfSteps) => ({
4318
- nb: `Steg ${activeStep} av ${numberOfSteps}`,
4319
- nn: `Steg ${activeStep} av ${numberOfSteps}`,
4320
- sv: `Steg ${activeStep} av ${numberOfSteps}`,
4321
- en: `Step ${activeStep} of ${numberOfSteps}`
4335
+ nb: `Steg ${activeStep}/${numberOfSteps}`,
4336
+ nn: `Steg ${activeStep}/${numberOfSteps}`,
4337
+ sv: `Steg ${activeStep}/${numberOfSteps}`,
4338
+ en: `Step ${activeStep}/${numberOfSteps}`
4322
4339
  }),
4323
4340
  back: {
4324
4341
  nb: "Tilbake",
@@ -4330,7 +4347,8 @@ var texts22 = createTexts({
4330
4347
  var StepperStep = ({
4331
4348
  children,
4332
4349
  stepNumber,
4333
- variant
4350
+ variant,
4351
+ isDisabled: isDisabledOverride
4334
4352
  }) => {
4335
4353
  const { activeStep, onClick } = useStepper();
4336
4354
  const state2 = getState(stepNumber, activeStep);
@@ -4338,45 +4356,42 @@ var StepperStep = ({
4338
4356
  state: state2,
4339
4357
  variant
4340
4358
  });
4341
- const adjustedProps = getButtonStylesForState(state2);
4342
- return /* @__PURE__ */ React69__default.createElement(Box, { __css: style.stepContainer }, stepNumber > 1 && /* @__PURE__ */ React69__default.createElement(DropdownRightFill18Icon, { marginX: 5, display: ["none", "block"] }), /* @__PURE__ */ React69__default.createElement(
4359
+ const disabledTextColor = useColorModeValue(
4360
+ "blackAlpha.400",
4361
+ "whiteAlpha.400"
4362
+ );
4363
+ const iconColor = useColorModeValue("blackAlpha.200", "whiteAlpha.200");
4364
+ const isDisabled = state2 !== "active" && isDisabledOverride || state2 === "disabled";
4365
+ return /* @__PURE__ */ React69__default.createElement(Box, { sx: style.stepContainer }, stepNumber > 1 && /* @__PURE__ */ React69__default.createElement(
4366
+ DropdownRightFill18Icon,
4367
+ {
4368
+ marginX: 5,
4369
+ display: ["none", null, "block"],
4370
+ color: iconColor
4371
+ }
4372
+ ), isDisabled ? /* @__PURE__ */ React69__default.createElement(
4373
+ Text4,
4374
+ {
4375
+ variant: "xs",
4376
+ fontSize: "16px",
4377
+ color: disabledTextColor,
4378
+ cursor: "default",
4379
+ paddingX: 2
4380
+ },
4381
+ children
4382
+ ) : /* @__PURE__ */ React69__default.createElement(
4343
4383
  Button,
4344
4384
  {
4345
4385
  size: "xs",
4346
- variant: state2 === "active" ? "primary" : state2 === "completed" ? "tertiary" : "ghost",
4347
- ...adjustedProps,
4348
- onClick: () => onClick(stepNumber)
4386
+ variant: state2 === "active" ? "primary" : "ghost",
4387
+ onClick: state2 === "completed" ? () => onClick(stepNumber) : void 0,
4388
+ pointerEvents: state2 === "active" ? "none" : "auto",
4389
+ tabIndex: state2 === "active" ? -1 : void 0,
4390
+ sx: style.stepButton
4349
4391
  },
4350
4392
  children
4351
4393
  ));
4352
4394
  };
4353
- var getButtonStylesForState = (state2) => {
4354
- switch (state2) {
4355
- case "active":
4356
- return {
4357
- _hover: {},
4358
- boxShadow: "none",
4359
- _focus: {},
4360
- _active: {},
4361
- cursor: "auto"
4362
- };
4363
- case "completed":
4364
- return {
4365
- boxShadow: "none"
4366
- };
4367
- case "disabled":
4368
- return {
4369
- _disabled: {},
4370
- _hover: {},
4371
- _focus: {},
4372
- _active: {},
4373
- color: "dimGrey",
4374
- cursor: "auto"
4375
- };
4376
- default:
4377
- return {};
4378
- }
4379
- };
4380
4395
  var getState = (stepNumber, activeStep) => {
4381
4396
  if (stepNumber < activeStep) {
4382
4397
  return "completed";
@@ -10095,12 +10110,12 @@ var config6 = defineStyleConfig$1({
10095
10110
  _disabled: {
10096
10111
  cursor: "not-allowed",
10097
10112
  boxShadow: "none",
10098
- backgroundColor: "silver",
10099
- color: "dimGrey"
10113
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
10114
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props)
10100
10115
  },
10101
10116
  _hover: {
10102
10117
  _disabled: {
10103
- background: "silver"
10118
+ background: mode("blackAlpha.100", "whiteAlpha.100")(props)
10104
10119
  }
10105
10120
  }
10106
10121
  }),
@@ -11240,12 +11255,16 @@ var config15 = helpers8.defineMultiStyleConfig({
11240
11255
  position: "fixed",
11241
11256
  ...getPositionProps(props),
11242
11257
  _disabled: {
11243
- backgroundColor: "whiteAlpha.400",
11244
- color: "white"
11258
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
11259
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props)
11245
11260
  },
11246
11261
  ...focusVisibleStyles(props),
11247
11262
  _hover: {
11248
- backgroundColor: "seaMist"
11263
+ backgroundColor: "seaMist",
11264
+ _disabled: {
11265
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
11266
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props)
11267
+ }
11249
11268
  },
11250
11269
  zIndex: "sticky"
11251
11270
  },
@@ -12435,7 +12454,7 @@ var config28 = helpers19.defineMultiStyleConfig({
12435
12454
  }
12436
12455
  },
12437
12456
  circle: {
12438
- fill: mode("blackAlpha.400", "whiteAlpha.400")(props)
12457
+ fill: mode("blackAlpha.200", "whiteAlpha.200")(props)
12439
12458
  }
12440
12459
  }
12441
12460
  }),
@@ -12574,7 +12593,6 @@ var parts14 = anatomy$1("stepper").parts(
12574
12593
  "root",
12575
12594
  "container",
12576
12595
  "innerContainer",
12577
- "backButton",
12578
12596
  "title",
12579
12597
  "stepCounter",
12580
12598
  "stepContainer",
@@ -12585,32 +12603,27 @@ var parts14 = anatomy$1("stepper").parts(
12585
12603
  );
12586
12604
  var helpers22 = createMultiStyleConfigHelpers$1(parts14.keys);
12587
12605
  var config32 = helpers22.defineMultiStyleConfig({
12588
- baseStyle: (props) => ({
12606
+ baseStyle: {
12589
12607
  root: {
12590
12608
  display: "flex",
12591
12609
  alignItems: "center",
12592
- justifyContent: ["space-between", "center"],
12593
- minHeight: ["48px", "60px"],
12610
+ justifyContent: ["space-between", null, "center"],
12611
+ minHeight: ["48px", null, "60px"],
12594
12612
  overflowX: "auto",
12595
12613
  width: "100%"
12596
12614
  },
12597
12615
  container: {
12598
- paddingX: [2, 2, 0],
12616
+ paddingX: [2, null, null, 0],
12599
12617
  maxWidth: "container.lg",
12600
12618
  marginX: "auto",
12601
12619
  width: "100%"
12602
12620
  },
12603
12621
  innerContainer: {
12604
12622
  overflow: "hidden",
12605
- display: ["flex", "none"],
12623
+ display: ["flex", null, "none"],
12606
12624
  alignItems: "center",
12607
- justifyContent: "space-between"
12608
- },
12609
- backButton: {
12610
- borderRadius: "xs",
12611
- paddingX: 0,
12612
- width: "auto",
12613
- minWidth: "auto"
12625
+ justifyContent: "space-between",
12626
+ gap: 3
12614
12627
  },
12615
12628
  title: {
12616
12629
  overflow: "hidden",
@@ -12618,8 +12631,8 @@ var config32 = helpers22.defineMultiStyleConfig({
12618
12631
  WebkitLineClamp: 2,
12619
12632
  display: "-webkit-box",
12620
12633
  WebkitBoxOrient: "vertical",
12621
- marginLeft: 2,
12622
- textAlign: "right"
12634
+ textAlign: "center",
12635
+ maxWidth: "80%"
12623
12636
  },
12624
12637
  stepContainer: {
12625
12638
  display: "flex",
@@ -12629,7 +12642,7 @@ var config32 = helpers22.defineMultiStyleConfig({
12629
12642
  textStyle: "sm",
12630
12643
  whiteSpace: "nowrap"
12631
12644
  }
12632
- }),
12645
+ },
12633
12646
  variants: {
12634
12647
  base: () => ({
12635
12648
  root: {
@@ -12638,7 +12651,19 @@ var config32 = helpers22.defineMultiStyleConfig({
12638
12651
  }),
12639
12652
  accent: (props) => ({
12640
12653
  root: {
12641
- backgroundColor: mode("seaMist", "pine")(props)
12654
+ backgroundColor: mode("seaMist", "pine")(props),
12655
+ color: mode("darkTeal", "seaMist")(props)
12656
+ },
12657
+ stepButton: {
12658
+ color: props.state === "disabled" ? mode("blackAlpha.400", "whiteAlpha.400")(props) : props.state === "completed" ? mode("darkTeal", "white")(props) : mode("white", "darkTeal")(props),
12659
+ _hover: {
12660
+ backgroundColor: props.state === "disabled" ? "transparent" : mode("coralGreen", "greenHaze")(props)
12661
+ }
12662
+ },
12663
+ backButton: {
12664
+ _hover: {
12665
+ backgroundColor: mode("coralGreen", "greenHaze")(props)
12666
+ }
12642
12667
  }
12643
12668
  })
12644
12669
  },
package/dist/index.d.mts CHANGED
@@ -1953,11 +1953,37 @@ type SporProviderProps = ChakraProviderProps & {
1953
1953
  declare const SporProvider: ({ theme, language, brand, children, ...props }: SporProviderProps) => React__default.JSX.Element;
1954
1954
 
1955
1955
  type StepperProps = {
1956
+ /** Callback for when a step is clicked */
1956
1957
  onClick: (clickedStep: number) => void;
1958
+ /** Callback for when the back button is clicked (on smaller screens).
1959
+ * A boolean indicating whether or not the user is on the first step is passed as an argument.
1960
+ *
1961
+ * If this is not provided, the back button will not be shown on smaller screens on the first step.
1962
+ */
1963
+ onBackButtonClick?: (isFirstStep: boolean) => void;
1964
+ /**
1965
+ * Heading shown on smaller devices
1966
+ * @deprecated Use `heading` instead
1967
+ */
1957
1968
  title?: string;
1969
+ /** Heading shown on smaller devices */
1970
+ heading?: string;
1971
+ /**
1972
+ * The heading level rendered for the heading shown on smaller devices.
1973
+ *
1974
+ * Defaults to h2
1975
+ * */
1976
+ headingLevel?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
1977
+ /** The currently active step */
1958
1978
  activeStep: number;
1979
+ /** The labels of each step */
1959
1980
  steps: string[];
1981
+ /** The variant.
1982
+ * "base" has a transparent background,
1983
+ * while "accent" has a slight accent color */
1960
1984
  variant: "base" | "accent";
1985
+ /** Disables all clicks */
1986
+ isDisabled?: boolean;
1961
1987
  };
1962
1988
  /**
1963
1989
  * A stepper is used to show which step of a process a user is currently in.
@@ -1966,21 +1992,22 @@ type StepperProps = {
1966
1992
  *
1967
1993
  * ```tsx
1968
1994
  * <Stepper
1969
- * title="Eksempel"
1995
+ * title="Example"
1970
1996
  * onClick={handleStepClick}
1971
1997
  * activeStep={2}
1972
- * steps={['Velg hvor', 'Velg når', 'Velg hvordan']}
1998
+ * steps={['Where', 'When', 'How']}
1973
1999
  * />
1974
2000
  * ```
1975
2001
  **/
1976
- declare const Stepper: ({ onClick, steps, activeStep: activeStepAsStringOrNumber, title, variant, }: StepperProps) => React__default.JSX.Element;
2002
+ declare const Stepper: ({ onClick, onBackButtonClick, steps, activeStep: activeStepAsStringOrNumber, title, heading, headingLevel, variant, isDisabled, }: StepperProps) => React__default.JSX.Element;
1977
2003
 
1978
2004
  type StepperStepProps = {
1979
2005
  children: React__default.ReactNode;
1980
2006
  stepNumber: number;
1981
2007
  variant: "base" | "accent";
2008
+ isDisabled?: boolean;
1982
2009
  };
1983
- declare const StepperStep: ({ children, stepNumber, variant, }: StepperStepProps) => React__default.JSX.Element;
2010
+ declare const StepperStep: ({ children, stepNumber, variant, isDisabled: isDisabledOverride, }: StepperStepProps) => React__default.JSX.Element;
1984
2011
 
1985
2012
  type TabsProps = Exclude<TabsProps$1, "colorScheme" | "variant" | "orientation" | "size"> & {
1986
2013
  colorScheme: "base" | "accent";
@@ -3312,6 +3339,10 @@ declare const theme: {
3312
3339
  container: {
3313
3340
  _hover: {
3314
3341
  backgroundColor: string;
3342
+ _disabled: {
3343
+ backgroundColor: string;
3344
+ color: string;
3345
+ };
3315
3346
  };
3316
3347
  zIndex: string;
3317
3348
  _focusVisible: {
@@ -3340,6 +3371,10 @@ declare const theme: {
3340
3371
  } | {
3341
3372
  _hover: {
3342
3373
  backgroundColor: string;
3374
+ _disabled: {
3375
+ backgroundColor: string;
3376
+ color: string;
3377
+ };
3343
3378
  };
3344
3379
  zIndex: string;
3345
3380
  _focusVisible: {
@@ -3372,6 +3407,10 @@ declare const theme: {
3372
3407
  } | {
3373
3408
  _hover: {
3374
3409
  backgroundColor: string;
3410
+ _disabled: {
3411
+ backgroundColor: string;
3412
+ color: string;
3413
+ };
3375
3414
  };
3376
3415
  zIndex: string;
3377
3416
  _focusVisible: {
@@ -3404,6 +3443,10 @@ declare const theme: {
3404
3443
  } | {
3405
3444
  _hover: {
3406
3445
  backgroundColor: string;
3446
+ _disabled: {
3447
+ backgroundColor: string;
3448
+ color: string;
3449
+ };
3407
3450
  };
3408
3451
  zIndex: string;
3409
3452
  _focusVisible: {
@@ -3436,6 +3479,10 @@ declare const theme: {
3436
3479
  } | {
3437
3480
  _hover: {
3438
3481
  backgroundColor: string;
3482
+ _disabled: {
3483
+ backgroundColor: string;
3484
+ color: string;
3485
+ };
3439
3486
  };
3440
3487
  zIndex: string;
3441
3488
  _focusVisible: {
@@ -4693,32 +4740,27 @@ declare const theme: {
4693
4740
  } | undefined;
4694
4741
  };
4695
4742
  Stepper: {
4696
- baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
4743
+ baseStyle?: {
4697
4744
  root: {
4698
4745
  display: string;
4699
4746
  alignItems: string;
4700
- justifyContent: ("center" | "space-between")[];
4701
- minHeight: ("48px" | "60px")[];
4747
+ justifyContent: ("center" | "space-between" | null)[];
4748
+ minHeight: ("48px" | "60px" | null)[];
4702
4749
  overflowX: string;
4703
4750
  width: string;
4704
4751
  };
4705
4752
  container: {
4706
- paddingX: number[];
4753
+ paddingX: (number | null)[];
4707
4754
  maxWidth: string;
4708
4755
  marginX: string;
4709
4756
  width: string;
4710
4757
  };
4711
4758
  innerContainer: {
4712
4759
  overflow: string;
4713
- display: ("flex" | "none")[];
4760
+ display: ("flex" | "none" | null)[];
4714
4761
  alignItems: string;
4715
4762
  justifyContent: string;
4716
- };
4717
- backButton: {
4718
- borderRadius: string;
4719
- paddingX: number;
4720
- width: string;
4721
- minWidth: string;
4763
+ gap: number;
4722
4764
  };
4723
4765
  title: {
4724
4766
  overflow: string;
@@ -4726,8 +4768,8 @@ declare const theme: {
4726
4768
  WebkitLineClamp: number;
4727
4769
  display: string;
4728
4770
  WebkitBoxOrient: string;
4729
- marginLeft: number;
4730
4771
  textAlign: string;
4772
+ maxWidth: string;
4731
4773
  };
4732
4774
  stepContainer: {
4733
4775
  display: string;
@@ -4737,10 +4779,10 @@ declare const theme: {
4737
4779
  textStyle: string;
4738
4780
  whiteSpace: string;
4739
4781
  };
4740
- }) | undefined;
4782
+ } | undefined;
4741
4783
  sizes?: {
4742
4784
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
4743
- keys: ("title" | "container" | "closeButton" | "root" | "innerContainer" | "backButton" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle")[];
4785
+ keys: ("title" | "container" | "closeButton" | "root" | "innerContainer" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle")[];
4744
4786
  }>;
4745
4787
  } | undefined;
4746
4788
  variants?: {
@@ -4752,6 +4794,18 @@ declare const theme: {
4752
4794
  accent: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
4753
4795
  root: {
4754
4796
  backgroundColor: string;
4797
+ color: string;
4798
+ };
4799
+ stepButton: {
4800
+ color: string;
4801
+ _hover: {
4802
+ backgroundColor: string;
4803
+ };
4804
+ };
4805
+ backButton: {
4806
+ _hover: {
4807
+ backgroundColor: string;
4808
+ };
4755
4809
  };
4756
4810
  };
4757
4811
  } | undefined;
@@ -4760,7 +4814,7 @@ declare const theme: {
4760
4814
  variant?: "base" | "accent" | undefined;
4761
4815
  colorScheme?: string | undefined;
4762
4816
  } | undefined;
4763
- parts: ("title" | "container" | "closeButton" | "root" | "innerContainer" | "backButton" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle")[];
4817
+ parts: ("title" | "container" | "closeButton" | "root" | "innerContainer" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle")[];
4764
4818
  };
4765
4819
  Switch: {
4766
4820
  baseStyle?: {