@northlight/ui 2.28.5 → 2.28.6

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.
@@ -939,10 +939,10 @@ type FormBody = Record<string, DateRange>;
939
939
  * @example (Example)
940
940
  * ## Another example
941
941
  * (?
942
- * <DatePicker
943
- * variant="filled"
944
- * dateFormat="mm|dd-yyyy"
945
- * />
942
+ * <DatePicker
943
+ * variant="filled"
944
+ * dateFormat="mm|dd-yyyy"
945
+ * />
946
946
  * ?)
947
947
  *
948
948
  */
@@ -1,4 +1,4 @@
1
- import { Accordion as Accordion$1, AccordionButton as AccordionButton$1, AccordionPanel as AccordionPanel$1, AccordionItem as AccordionItem$1, useInterval, useMediaQuery, useToken as useToken$1, Box, useMultiStyleConfig, chakra, Alert as Alert$2, AspectRatio as AspectRatio$1, forwardRef, useStyleConfig, Icon as Icon$2, Heading, Text, FormLabel as FormLabel$1, VisuallyHidden, HStack, Badge as Badge$2, Spinner as Spinner$2, Button as Button$2, Checkbox as Checkbox$2, FormControl, Stack, FormErrorMessage, Flex, IconButton as IconButton$1, Popover as Popover$2, useDisclosure, useBoolean, PopoverTrigger, PopoverContent, PopoverHeader, PopoverBody, SimpleGrid, SlideFade as SlideFade$1, keyframes, extendTheme, Table as Table$2, Thead, Tbody, Tr, Select as Select$2, PopoverAnchor, InputGroup, InputRightElement, Link as Link$1, Portal, Tooltip as Tooltip$2, VStack, Circle, Center, Fade as Fade$1, ScaleFade as ScaleFade$1, Slide as Slide$1, Collapse as Collapse$1, CloseButton as CloseButton$1, Radio as Radio$2, RadioGroup as RadioGroup$1, Tag as Tag$2, TagLabel, TagRightIcon, useEditableControls, useEditableState, Editable, InputLeftElement, Input as Input$1, EditablePreview, EditableInput, Modal as Modal$2, ModalOverlay, ModalContent, ModalCloseButton, ModalBody as ModalBody$1, ModalHeader, Slider, SliderTrack, SliderFilledTrack, SliderThumb, ModalFooter, Progress, Image as Image$1, ChakraProvider, Menu as Menu$2, NumberInputStepper as NumberInputStepper$1, Divider, NumberIncrementStepper, NumberDecrementStepper, NumberInput as NumberInput$2, NumberInputField as NumberInputField$1, PinInput as PinInput$2, Switch as Switch$2, TabPanel as TabPanel$1, Tabs as Tabs$2, Textarea as Textarea$2, useToast as useToast$1, TagLeftIcon, AlertTitle, AlertDescription, Tab, TabList, useClipboard, Grid, GridItem, theme as theme$1 } from '@chakra-ui/react';
1
+ import { Accordion as Accordion$1, AccordionButton as AccordionButton$1, AccordionPanel as AccordionPanel$1, AccordionItem as AccordionItem$1, useInterval, useMediaQuery, useToken as useToken$1, Box, useMultiStyleConfig, chakra, Alert as Alert$2, AspectRatio as AspectRatio$1, forwardRef, useStyleConfig, Icon as Icon$2, Heading, Text, FormLabel as FormLabel$1, VisuallyHidden, HStack, Badge as Badge$2, Spinner as Spinner$2, Button as Button$2, Checkbox as Checkbox$2, FormControl, Stack, FormErrorMessage, Flex, IconButton as IconButton$1, Popover as Popover$2, useDisclosure, useBoolean, PopoverTrigger, PopoverContent, PopoverHeader, PopoverBody, SimpleGrid, SlideFade as SlideFade$1, keyframes, extendTheme, Table as Table$2, Thead, Tr, Tbody, Select as Select$2, PopoverAnchor, InputGroup, InputRightElement, Link as Link$1, Spacer, useOutsideClick, Portal, Tooltip as Tooltip$2, VStack, Circle, Center, Fade as Fade$1, ScaleFade as ScaleFade$1, Slide as Slide$1, Collapse as Collapse$1, CloseButton as CloseButton$1, Radio as Radio$2, RadioGroup as RadioGroup$1, Tag as Tag$2, TagLabel, TagRightIcon, useEditableControls, useEditableState, Editable, InputLeftElement, Input as Input$1, EditablePreview, EditableInput, Modal as Modal$2, ModalOverlay, ModalContent, ModalCloseButton, ModalBody as ModalBody$1, ModalHeader, Slider, SliderTrack, SliderFilledTrack, SliderThumb, ModalFooter, Progress, Image as Image$1, ChakraProvider, Menu as Menu$2, NumberInputStepper as NumberInputStepper$1, Divider, NumberIncrementStepper, NumberDecrementStepper, NumberInput as NumberInput$2, NumberInputField as NumberInputField$1, PinInput as PinInput$2, Switch as Switch$2, TabPanel as TabPanel$1, Tabs as Tabs$2, Textarea as Textarea$2, useToast as useToast$1, TagLeftIcon, AlertTitle, AlertDescription, Tab, TabList, useClipboard, Grid, GridItem, theme as theme$1 } from '@chakra-ui/react';
2
2
  export { AbsoluteCenter, AccordionIcon, AlertDescription, AlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, AlertTitle, Box, BreadcrumbItem as Breadcrumb, BreadcrumbLink, BreadcrumbSeparator, Breadcrumb as Breadcrumbs, ButtonGroup, Card, CardBody, CardFooter, CardHeader, Center, Modal as ChakraModal, CheckboxGroup, Circle, CircularProgress, CircularProgressLabel, CloseButton, Code, Container, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Editable, EditableInput, EditablePreview, Flex, FormControl, FormErrorMessage, FormHelperText, Grid, GridItem, HStack, Heading, Hide, Highlight, Image, Input, InputAddon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkBox, LinkOverlay, List, ListIcon, ListItem, Mark, MenuButton, MenuCommand, MenuDivider, MenuGroup, MenuIcon, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, NumberDecrementStepper, NumberIncrementStepper, OrderedList, PinInputField, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RangeSlider, RangeSliderFilledTrack, RangeSliderMark, RangeSliderThumb, RangeSliderTrack, Show, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack, Spacer, Stack, StackDivider, Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber, TabIndicator as StepIndicator, TabPanels as StepPanels, Tab, TabIndicator, TabList, TabPanels, TableCaption, TableContainer, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon, Tbody, Td, Text, Tfoot, Th, Thead, Tr, UnorderedList, VStack, VisuallyHidden, VisuallyHiddenInput, Wrap, WrapItem, keyframes, useBoolean, useBreakpoint, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useEditable, useEditableControls, useEditableState, useInterval, useMediaQuery, useMergeRefs, useNumberInput, useOutsideClick, usePrefersReducedMotion, useRadio, useRadioGroup, useTab, useTabs, useTheme, useToken } from '@chakra-ui/react';
3
3
  import React, { useState, useEffect, useRef, isValidElement, cloneElement, Children, createContext, useContext, forwardRef as forwardRef$1, useImperativeHandle, memo, useMemo, useCallback } from 'react';
4
4
  import { CreatableSelect, chakraComponents, AsyncSelect, Select as Select$3 } from 'chakra-react-select';
@@ -16,7 +16,7 @@ import { useRadioGroup, useRadio } from '@react-aria/radio';
16
16
  import { mergeProps } from '@react-aria/utils';
17
17
  import { useRadioGroupState } from '@react-stately/radio';
18
18
  import { useCheckboxGroupState } from '@react-stately/checkbox';
19
- import { randomColor, cssVar } from '@chakra-ui/theme-tools';
19
+ import { randomColor, cssVar, mode } from '@chakra-ui/theme-tools';
20
20
  import { useDateSegment, useDateField, useDatePicker, useDateRangePicker } from '@react-aria/datepicker';
21
21
  import { useDateFieldState, useDatePickerState, useDateRangePickerState } from '@react-stately/datepicker';
22
22
  import { createCalendar, today, isSameMonth, getWeeksInMonth, getDayOfWeek, GregorianCalendar, parseDate, startOfWeek, endOfWeek, startOfMonth, endOfMonth, startOfYear, endOfYear } from '@internationalized/date';
@@ -5682,7 +5682,16 @@ const FilePicker$1 = {
5682
5682
  };
5683
5683
 
5684
5684
  const Table$1 = {
5685
- parts: ["table", "th", "td"],
5685
+ parts: [
5686
+ "table",
5687
+ "th",
5688
+ "td",
5689
+ "columnHeader",
5690
+ "cell",
5691
+ "caption",
5692
+ "footer",
5693
+ "tr"
5694
+ ],
5686
5695
  variants: {
5687
5696
  rounded: () => ({
5688
5697
  table: {
@@ -5703,7 +5712,48 @@ const Table$1 = {
5703
5712
  borderColor: "border.default",
5704
5713
  borderTopWidth: "xs"
5705
5714
  }
5706
- })
5715
+ }),
5716
+ striped: (props) => {
5717
+ const { colorScheme: c = "gray" } = props;
5718
+ return {
5719
+ table: {
5720
+ borderSpacing: "0",
5721
+ borderCollapse: "separate",
5722
+ borderRadius: "md",
5723
+ borderColor: "border.default",
5724
+ borderWidth: "xs",
5725
+ p: "2"
5726
+ },
5727
+ columnHeader: {
5728
+ color: "text.subdued",
5729
+ bgColor: mode(`${c}.100`, `${c}.700`)(props),
5730
+ fontWeight: "bold",
5731
+ textTransform: "none",
5732
+ fontSize: "sm"
5733
+ },
5734
+ cell: {
5735
+ bgColor: mode(`${c}.100`, `${c}.700`)(props)
5736
+ },
5737
+ caption: {
5738
+ color: mode("gray.600", "gray.100")(props)
5739
+ },
5740
+ th: {
5741
+ borderBottomWidth: "0"
5742
+ },
5743
+ tr: {
5744
+ "&:nth-of-type(odd)": {
5745
+ td: {
5746
+ background: mode(`${c}.100`, `${c}.700`)(props)
5747
+ }
5748
+ }
5749
+ },
5750
+ footer: {
5751
+ tr: {
5752
+ th: { borderBottomWidth: 0 }
5753
+ }
5754
+ }
5755
+ };
5756
+ }
5707
5757
  }
5708
5758
  };
5709
5759
 
@@ -6284,14 +6334,16 @@ const CalendarCell = ({
6284
6334
  ));
6285
6335
  };
6286
6336
 
6287
- const DayLabels = memo(({
6288
- weekDays
6289
- }) => {
6337
+ const DayLabels = memo(({ weekDays }) => {
6290
6338
  const { dayLabel } = useMultiStyleConfig$1("Calendar");
6291
6339
  const weekDaysWithIds = weekDays.map((day, i) => ({ label: day, _id: i }));
6292
- return /* @__PURE__ */ React.createElement(chakra$1.tr, null, /* @__PURE__ */ React.createElement(chakra$1.th, null), weekDaysWithIds.map(({ label, _id }) => /* @__PURE__ */ React.createElement(chakra$1.th, { key: _id, __css: dayLabel }, label)));
6340
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, weekDaysWithIds.map(({ label, _id }) => /* @__PURE__ */ React.createElement(chakra$1.th, { key: _id, __css: dayLabel }, label)));
6293
6341
  });
6294
6342
 
6343
+ const mondayFirstWeekDays = ["M", "T", "W", "T", "F", "S", "S"];
6344
+ const sundayFirstWeekDays = ["S", "M", "T", "W", "T", "F", "S"];
6345
+ const getWeekdays = (firstDayOfWeek) => firstDayOfWeek === "monday" ? mondayFirstWeekDays : sundayFirstWeekDays;
6346
+
6295
6347
  var __defProp$1w = Object.defineProperty;
6296
6348
  var __getOwnPropSymbols$1w = Object.getOwnPropertySymbols;
6297
6349
  var __hasOwnProp$1w = Object.prototype.hasOwnProperty;
@@ -6322,21 +6374,25 @@ var __objRest$1e = (source, exclude) => {
6322
6374
  };
6323
6375
  const CalendarGrid = memo(
6324
6376
  (_a) => {
6325
- var _b = _a, { state, locale } = _b, rest = __objRest$1e(_b, ["state", "locale"]);
6377
+ var _b = _a, { state, locale, firstDayOfWeek } = _b, rest = __objRest$1e(_b, ["state", "locale", "firstDayOfWeek"]);
6326
6378
  const startDate = state.visibleRange.start;
6327
- const { gridProps, headerProps, weekDays } = useCalendarGrid(rest, state);
6379
+ const { gridProps, headerProps } = useCalendarGrid(rest, state);
6328
6380
  const weeksInMonth = getWeeksInMonth(startDate, locale);
6329
- return /* @__PURE__ */ React.createElement(Table, __spreadValues$1w({ variant: "unstyled" }, gridProps), /* @__PURE__ */ React.createElement(Thead, __spreadValues$1w({}, headerProps), /* @__PURE__ */ React.createElement(DayLabels, { weekDays })), /* @__PURE__ */ React.createElement(Tbody, null, times((weekIndex) => /* @__PURE__ */ React.createElement(Tr, { key: weekIndex }, state.getDatesInWeek(weekIndex, startDate).map(
6330
- (date) => date ? /* @__PURE__ */ React.createElement(
6331
- CalendarCell,
6332
- {
6333
- key: date.day,
6334
- state,
6335
- date,
6336
- currentMonth: startDate
6337
- }
6338
- ) : /* @__PURE__ */ React.createElement(chakra.td, null)
6339
- )), weeksInMonth)));
6381
+ const weekDays = getWeekdays(firstDayOfWeek);
6382
+ return /* @__PURE__ */ React.createElement(Table, __spreadValues$1w({ variant: "unstyled" }, gridProps), /* @__PURE__ */ React.createElement(Thead, __spreadValues$1w({}, headerProps), /* @__PURE__ */ React.createElement(Tr, null, /* @__PURE__ */ React.createElement(DayLabels, { weekDays }))), /* @__PURE__ */ React.createElement(Tbody, null, times(
6383
+ (weekIndex) => /* @__PURE__ */ React.createElement(Tr, { key: weekIndex }, state.getDatesInWeek(weekIndex, startDate).map(
6384
+ (date) => date ? /* @__PURE__ */ React.createElement(
6385
+ CalendarCell,
6386
+ {
6387
+ key: date.day,
6388
+ state,
6389
+ date,
6390
+ currentMonth: startDate
6391
+ }
6392
+ ) : /* @__PURE__ */ React.createElement(chakra.td, null)
6393
+ )),
6394
+ weeksInMonth
6395
+ )));
6340
6396
  }
6341
6397
  );
6342
6398
 
@@ -6425,7 +6481,7 @@ const MonthSelect = ({ state }) => {
6425
6481
  w: "max-content",
6426
6482
  textAlign: "center"
6427
6483
  },
6428
- months.map((month, i) => /* @__PURE__ */ React.createElement("option", { value: i }, month))
6484
+ months.map((month, i) => /* @__PURE__ */ React.createElement("option", { value: i, key: `month-${i}` }, month))
6429
6485
  );
6430
6486
  };
6431
6487
 
@@ -6576,6 +6632,7 @@ const RangeCell = ({
6576
6632
  ring: isToday && !isSelected ? "1px" : "0px",
6577
6633
  ringColor: "blue.500",
6578
6634
  mx: "-1px",
6635
+ ml: isToday ? "-2px " : void 0,
6579
6636
  my: "0a",
6580
6637
  w: "8",
6581
6638
  h: "8",
@@ -6635,10 +6692,12 @@ var __objRest$1c = (source, exclude) => {
6635
6692
  const StandaloneCalendarGrid = (_a) => {
6636
6693
  var _b = _a, {
6637
6694
  state,
6638
- range
6695
+ range,
6696
+ firstDayOfWeek
6639
6697
  } = _b, rest = __objRest$1c(_b, [
6640
6698
  "state",
6641
- "range"
6699
+ "range",
6700
+ "firstDayOfWeek"
6642
6701
  ]);
6643
6702
  const { locale } = useLocale();
6644
6703
  const { calendarProps, prevButtonProps, nextButtonProps } = useCalendar(
@@ -6646,7 +6705,8 @@ const StandaloneCalendarGrid = (_a) => {
6646
6705
  state
6647
6706
  );
6648
6707
  const startDate = state.visibleRange.start;
6649
- const { gridProps, headerProps, weekDays } = useCalendarGrid(rest, state);
6708
+ const { gridProps, headerProps } = useCalendarGrid(rest, state);
6709
+ const weekDays = getWeekdays(firstDayOfWeek);
6650
6710
  const weeksInMonth = getWeeksInMonth(startDate, locale);
6651
6711
  const weekNumberStart = useMemo(
6652
6712
  () => getWeekNumberAtStartOfMonth(
@@ -6656,24 +6716,21 @@ const StandaloneCalendarGrid = (_a) => {
6656
6716
  ),
6657
6717
  [startDate.year, startDate.month]
6658
6718
  );
6659
- return /* @__PURE__ */ React.createElement(Box, __spreadProps$g(__spreadValues$1t({}, calendarProps), { h: "265px", p: "0" }), /* @__PURE__ */ React.createElement(Stack, null, /* @__PURE__ */ React.createElement(Flex, { justify: "space-between", w: "full", p: "1", alignItems: "center" }, /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1t({}, prevButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronLeftSolid, boxSize: 4 })), /* @__PURE__ */ React.createElement(HStack, { spacing: "0" }, /* @__PURE__ */ React.createElement(MonthSelect, { state }), /* @__PURE__ */ React.createElement(YearSelectRangeCalendar, { state })), /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1t({}, nextButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronRightSolid, boxSize: 4 }))), /* @__PURE__ */ React.createElement(chakra.table, __spreadProps$g(__spreadValues$1t({}, gridProps), { sx: { borderSpacing: "0" } }), /* @__PURE__ */ React.createElement(chakra.thead, __spreadValues$1t({}, headerProps), /* @__PURE__ */ React.createElement(DayLabels, { weekDays })), /* @__PURE__ */ React.createElement(chakra.tbody, null, times(
6660
- (weekIndex) => {
6661
- const weekNumber = weekNumberStart + weekIndex;
6662
- return /* @__PURE__ */ React.createElement(chakra.tr, { key: weekIndex }, /* @__PURE__ */ React.createElement(chakra.td, null, /* @__PURE__ */ React.createElement(Small$1, { sx: { color: "text.subdued" }, pr: "2" }, "w.", weekNumber > 52 ? weekNumber - 52 : weekNumber)), state.getDatesInWeek(weekIndex, startDate).map(
6663
- (date) => date ? /* @__PURE__ */ React.createElement(
6664
- RangeCell,
6665
- {
6666
- key: date.day,
6667
- state,
6668
- range,
6669
- date,
6670
- currentMonth: startDate
6671
- }
6672
- ) : /* @__PURE__ */ React.createElement(chakra.td, null)
6673
- ));
6674
- },
6675
- weeksInMonth
6676
- )))));
6719
+ return /* @__PURE__ */ React.createElement(Box, __spreadProps$g(__spreadValues$1t({}, calendarProps), { h: "265px", p: "0" }), /* @__PURE__ */ React.createElement(Stack, null, /* @__PURE__ */ React.createElement(Flex, { justify: "space-between", w: "full", p: "1", alignItems: "center" }, /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1t({}, prevButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronLeftSolid, boxSize: 4 })), /* @__PURE__ */ React.createElement(HStack, { spacing: "0" }, /* @__PURE__ */ React.createElement(MonthSelect, { state }), /* @__PURE__ */ React.createElement(YearSelectRangeCalendar, { state })), /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1t({}, nextButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronRightSolid, boxSize: 4 }))), /* @__PURE__ */ React.createElement(chakra.table, __spreadProps$g(__spreadValues$1t({}, gridProps), { sx: { borderSpacing: "0" } }), /* @__PURE__ */ React.createElement(chakra.thead, __spreadValues$1t({}, headerProps), /* @__PURE__ */ React.createElement(chakra.tr, null, /* @__PURE__ */ React.createElement(chakra.th, null), /* @__PURE__ */ React.createElement(DayLabels, { weekDays }))), /* @__PURE__ */ React.createElement(chakra.tbody, null, times((weekIndex) => {
6720
+ const weekNumber = weekNumberStart + weekIndex;
6721
+ return /* @__PURE__ */ React.createElement(chakra.tr, { key: weekIndex }, /* @__PURE__ */ React.createElement(chakra.td, null, /* @__PURE__ */ React.createElement(Small$1, { sx: { color: "text.subdued" }, pr: "2" }, "w.", weekNumber > 52 ? weekNumber - 52 : weekNumber)), state.getDatesInWeek(weekIndex, startDate).map(
6722
+ (date) => date ? /* @__PURE__ */ React.createElement(
6723
+ RangeCell,
6724
+ {
6725
+ key: date.day,
6726
+ state,
6727
+ range,
6728
+ date,
6729
+ currentMonth: startDate
6730
+ }
6731
+ ) : /* @__PURE__ */ React.createElement(chakra.td, null)
6732
+ ));
6733
+ }, weeksInMonth)))));
6677
6734
  };
6678
6735
 
6679
6736
  var __defProp$1s = Object.defineProperty;
@@ -6696,6 +6753,7 @@ var __spreadValues$1s = (a, b) => {
6696
6753
  };
6697
6754
  var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
6698
6755
  const Calendar = (props) => {
6756
+ const { firstDayOfWeek } = props;
6699
6757
  const { locale } = useLocale();
6700
6758
  const { container } = useMultiStyleConfig("Calendar");
6701
6759
  const state = useCalendarState(__spreadProps$f(__spreadValues$1s({}, props), {
@@ -6706,7 +6764,14 @@ const Calendar = (props) => {
6706
6764
  props,
6707
6765
  state
6708
6766
  );
6709
- return /* @__PURE__ */ React.createElement(Box, __spreadProps$f(__spreadValues$1s({}, calendarProps), { __css: container }), /* @__PURE__ */ React.createElement(Stack, null, /* @__PURE__ */ React.createElement(Flex, { justifyContent: "space-between" }, /* @__PURE__ */ React.createElement(Box, { paddingInlineStart: "2" }, /* @__PURE__ */ React.createElement(YearSelectCalendar, { state })), /* @__PURE__ */ React.createElement(HStack, { spacing: 2 }, /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1s({}, prevButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronLeftSolid, boxSize: 4 })), /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1s({}, nextButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronRightSolid, boxSize: 4 })))), /* @__PURE__ */ React.createElement(CalendarGrid, { state, locale })));
6767
+ return /* @__PURE__ */ React.createElement(Box, __spreadProps$f(__spreadValues$1s({}, calendarProps), { __css: container }), /* @__PURE__ */ React.createElement(Stack, null, /* @__PURE__ */ React.createElement(Flex, { justifyContent: "space-between" }, /* @__PURE__ */ React.createElement(Box, { paddingInlineStart: "2" }, /* @__PURE__ */ React.createElement(YearSelectCalendar, { state })), /* @__PURE__ */ React.createElement(HStack, { spacing: 2 }, /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1s({}, prevButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronLeftSolid, boxSize: 4 })), /* @__PURE__ */ React.createElement(MonthButton, __spreadValues$1s({}, nextButtonProps), /* @__PURE__ */ React.createElement(Icon$1, { as: ChevronRightSolid, boxSize: 4 })))), /* @__PURE__ */ React.createElement(
6768
+ CalendarGrid,
6769
+ {
6770
+ state,
6771
+ locale,
6772
+ firstDayOfWeek
6773
+ }
6774
+ )));
6710
6775
  };
6711
6776
 
6712
6777
  var __defProp$1r = Object.defineProperty;
@@ -6736,7 +6801,8 @@ const DatePicker = (props) => {
6736
6801
  isInvalid = false,
6737
6802
  dateFormat,
6738
6803
  minValue,
6739
- variant = "outline"
6804
+ variant = "outline",
6805
+ firstDayOfWeek = "monday"
6740
6806
  } = props;
6741
6807
  const ref = useRef();
6742
6808
  const { group } = useMultiStyleConfig("DatePicker");
@@ -6757,19 +6823,15 @@ const DatePicker = (props) => {
6757
6823
  onClose: () => state.setOpen(false),
6758
6824
  placement: "bottom-end"
6759
6825
  },
6760
- /* @__PURE__ */ React.createElement(PopoverAnchor, null, /* @__PURE__ */ React.createElement(HStack, { minW: 56 }, /* @__PURE__ */ React.createElement(InputGroup, __spreadProps$e(__spreadValues$1r({}, groupProps), { ref, __css: group }), /* @__PURE__ */ React.createElement(StyledField, { isDisabled, isInvalid, variant }, /* @__PURE__ */ React.createElement(
6761
- Box,
6826
+ /* @__PURE__ */ React.createElement(PopoverAnchor, null, /* @__PURE__ */ React.createElement(HStack, { minW: 56 }, /* @__PURE__ */ React.createElement(InputGroup, __spreadProps$e(__spreadValues$1r({}, groupProps), { ref, __css: group }), /* @__PURE__ */ React.createElement(
6827
+ StyledField,
6762
6828
  {
6763
- paddingInlineStart: "1a",
6764
- paddingInlineEnd: 10
6829
+ isDisabled,
6830
+ isInvalid,
6831
+ variant
6765
6832
  },
6766
- /* @__PURE__ */ React.createElement(
6767
- DateField,
6768
- __spreadProps$e(__spreadValues$1r({}, fieldProps), {
6769
- dateFormat
6770
- })
6771
- )
6772
- )), /* @__PURE__ */ React.createElement(
6833
+ /* @__PURE__ */ React.createElement(Box, { paddingInlineStart: "1a", paddingInlineEnd: 10 }, /* @__PURE__ */ React.createElement(DateField, __spreadProps$e(__spreadValues$1r({}, fieldProps), { dateFormat })))
6834
+ ), /* @__PURE__ */ React.createElement(
6773
6835
  InputRightElement,
6774
6836
  {
6775
6837
  sx: { height: "100%", paddingRight: "1" },
@@ -6795,7 +6857,7 @@ const DatePicker = (props) => {
6795
6857
  icon: /* @__PURE__ */ React.createElement(Icon$1, { as: XCloseSolid })
6796
6858
  }
6797
6859
  ))),
6798
- state.isOpen && /* @__PURE__ */ React.createElement(PopoverContent, __spreadProps$e(__spreadValues$1r({}, dialogProps), { ref, w: 64, border: "none" }), /* @__PURE__ */ React.createElement(FocusScope, { contain: true, restoreFocus: true }, /* @__PURE__ */ React.createElement(Calendar, __spreadValues$1r({}, calendarProps))))
6860
+ state.isOpen && /* @__PURE__ */ React.createElement(PopoverContent, __spreadProps$e(__spreadValues$1r({}, dialogProps), { ref, w: 64, border: "none" }), /* @__PURE__ */ React.createElement(FocusScope, { contain: true, restoreFocus: true }, /* @__PURE__ */ React.createElement(Calendar, __spreadProps$e(__spreadValues$1r({}, calendarProps), { firstDayOfWeek }))))
6799
6861
  );
6800
6862
  };
6801
6863
 
@@ -7090,7 +7152,7 @@ const QuickSelect = ({
7090
7152
  fiscalStartMonth = 0,
7091
7153
  fiscalStartDay = 0,
7092
7154
  locale = "",
7093
- height = "2xs"
7155
+ height = "17.5rem"
7094
7156
  }) => {
7095
7157
  const { quickDates, fiscalQuarters } = useMemo(
7096
7158
  () => getQuickSelectOptions(state, locale, fiscalStartMonth, fiscalStartDay),
@@ -7112,8 +7174,7 @@ const QuickSelect = ({
7112
7174
  pr: "4",
7113
7175
  _hover: { overflowY: "scroll" },
7114
7176
  w: "36",
7115
- display: shouldShow(quickDates) ? "initial" : "none",
7116
- mb: "4"
7177
+ display: shouldShow(quickDates) ? "initial" : "none"
7117
7178
  },
7118
7179
  map(
7119
7180
  (quickDate) => validRange(quickDate.value, state) && /* @__PURE__ */ React.createElement(Box, { minH: "20px", key: `quick-select-${quickDate.label}` }, /* @__PURE__ */ React.createElement(
@@ -7133,7 +7194,7 @@ const QuickSelect = ({
7133
7194
  borderTop: seperator,
7134
7195
  display: shouldShow(fiscalQuarters) ? "initial" : "none"
7135
7196
  }
7136
- ), /* @__PURE__ */ React.createElement(
7197
+ ), /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement(
7137
7198
  Flex,
7138
7199
  {
7139
7200
  justifyContent: "space-between",
@@ -7189,7 +7250,8 @@ const RangeCalendar = (props) => {
7189
7250
  fiscalStartMonth,
7190
7251
  fiscalStartDay,
7191
7252
  minValue,
7192
- maxValue
7253
+ maxValue,
7254
+ firstDayOfWeek
7193
7255
  } = props;
7194
7256
  const { locale } = useLocale();
7195
7257
  const ref = useRef(null);
@@ -7247,13 +7309,15 @@ const RangeCalendar = (props) => {
7247
7309
  StandaloneCalendarGrid,
7248
7310
  {
7249
7311
  state: calendarOneState,
7250
- range: value
7312
+ range: value,
7313
+ firstDayOfWeek
7251
7314
  }
7252
7315
  ))), /* @__PURE__ */ React.createElement(Stack, { h: "full", justify: "space-between" }, /* @__PURE__ */ React.createElement(Stack, { opacity: value && value.start ? "1" : "0.4" }, /* @__PURE__ */ React.createElement(Box, { p: "2" }, /* @__PURE__ */ React.createElement(Label$1, { size: "xs" }, "End date:"), /* @__PURE__ */ React.createElement(
7253
7316
  StandaloneCalendarGrid,
7254
7317
  {
7255
7318
  state: calendarTwoState,
7256
- range: value
7319
+ range: value,
7320
+ firstDayOfWeek
7257
7321
  }
7258
7322
  ))), /* @__PURE__ */ React.createElement(HStack, { pt: "2", alignSelf: "end" }, isClearable && /* @__PURE__ */ React.createElement(Button$1, { onClick: resetDate, variant: "ghost", size: "sm" }, "Clear"), /* @__PURE__ */ React.createElement(Button$1, { variant: "brand", onClick: handleClose, size: "sm" }, "Save"))))))));
7259
7323
  };
@@ -7307,7 +7371,8 @@ const DateRangePicker = (props) => {
7307
7371
  value,
7308
7372
  minValue = "1994-03-08",
7309
7373
  maxValue,
7310
- renderInPortal = false
7374
+ renderInPortal = false,
7375
+ firstDayOfWeek
7311
7376
  } = props;
7312
7377
  const ref = useRef();
7313
7378
  const { group } = useMultiStyleConfig("DatePicker");
@@ -7344,6 +7409,10 @@ const DateRangePicker = (props) => {
7344
7409
  const handleClose = () => {
7345
7410
  state.setOpen(false);
7346
7411
  };
7412
+ useOutsideClick({
7413
+ ref,
7414
+ handler: () => state.setOpen(false)
7415
+ });
7347
7416
  return /* @__PURE__ */ React.createElement(
7348
7417
  Popover$1,
7349
7418
  {
@@ -7385,7 +7454,8 @@ const DateRangePicker = (props) => {
7385
7454
  handleClose,
7386
7455
  fiscalStartMonth: fiscalStartMonth || 0,
7387
7456
  fiscalStartDay: fiscalStartDay || 0,
7388
- isClearable
7457
+ isClearable,
7458
+ firstDayOfWeek
7389
7459
  })
7390
7460
  ))))
7391
7461
  );