@salutejs/plasma-new-hope 0.93.1-canary.1273.9712922183.0 → 0.93.1-canary.1273.9714986596.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Calendar/Calendar.tokens.js +67 -28
- package/cjs/components/Calendar/Calendar.tokens.js.map +1 -1
- package/cjs/components/Calendar/Calendar.types.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.css +57 -29
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +6 -0
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/{CalendarBase.styles_rv9ax9.css → CalendarBase.styles_1m6uih1.css} +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.css +58 -30
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +6 -0
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js.map +1 -1
- package/{es/components/Calendar/CalendarDouble/CalendarDouble.styles_1rc2ejs.css → cjs/components/Calendar/CalendarDouble/CalendarDouble.styles_e9ada0.css} +2 -2
- package/cjs/components/Calendar/hoc/withRange.js.map +1 -1
- package/cjs/components/Calendar/hooks/useDays.js +1 -1
- package/cjs/components/Calendar/hooks/useDays.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.css +4 -4
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +9 -9
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_107vqka.css +4 -0
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.css +7 -7
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/{CalendarDays.styles_bnrjbd.css → CalendarDays.styles_1oq8sud.css} +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.css +36 -8
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +31 -17
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +27 -12
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_gnorek.css +8 -0
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.css +4 -4
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_7jeg2n.css +4 -0
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.css +4 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles_4z2ki7.css +4 -0
- package/cjs/components/Calendar/utils/index.js.map +1 -1
- package/cjs/components/Combobox/Combobox.js +2 -2
- package/cjs/components/Combobox/Combobox.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.tokens.js +189 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js.map +1 -0
- package/cjs/components/DatePicker/DatePickerBase.styles.js +30 -0
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -0
- package/cjs/components/DatePicker/DatePickerBase.styles_1thp2xv.css +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +152 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +285 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +51 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles_ww61h9.css +5 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +144 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +83 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +42 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_wp3vfj.css +2 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base_tl4jc7.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base_f58pkk.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base_11yn9y8.css +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +134 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.js +183 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +51 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles_18b5qkz.css +5 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base_1rfgfsz.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base_1jucwp.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base_lf7y25.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base_15vaheb.css +1 -0
- package/cjs/components/DatePicker/hooks/useDatePicker.js +79 -0
- package/cjs/components/DatePicker/hooks/useDatePicker.js.map +1 -0
- package/cjs/components/DatePicker/utils/dateHelper.js +84 -0
- package/cjs/components/DatePicker/utils/dateHelper.js.map +1 -0
- package/cjs/components/Dropdown/Dropdown.js +4 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/utils/index.js +0 -17
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Range/Range.css +6 -6
- package/cjs/components/Range/Range.js +17 -2
- package/cjs/components/Range/Range.js.map +1 -1
- package/cjs/components/Range/Range.styles.js +1 -1
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Range/Range.styles_9rort8.css +8 -0
- package/cjs/components/Select/Select.js +2 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Sheet/Sheet.js.map +1 -1
- package/cjs/components/Slider/Slider.css +3 -3
- package/cjs/components/Slider/components/Double/Double.css +3 -3
- package/cjs/components/TextField/TextField.tokens.js +1 -1
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base_1vu13zn.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base.js.map +1 -1
- package/cjs/components/TextField/variations/_size/base_orwx1f.css +1 -0
- package/cjs/components/TextField/variations/_view/base.js +1 -1
- package/cjs/components/TextField/variations/_view/base_18ea6z7.css +1 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js +23 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js.map +1 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureLeft.js.map +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/cjs/components/_Icon/Icons/IconDisclosureDownFill.js +23 -0
- package/cjs/components/_Icon/Icons/IconDisclosureDownFill.js.map +1 -0
- package/cjs/index.css +71 -38
- package/cjs/index.js +12 -0
- package/cjs/index.js.map +1 -1
- package/cjs/utils/datejs.js +12 -0
- package/cjs/utils/datejs.js.map +1 -0
- package/cjs/utils/getPopoverPlacement.js +23 -0
- package/cjs/utils/getPopoverPlacement.js.map +1 -0
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Calendar/Calendar.tokens.js +67 -28
- package/es/components/Calendar/Calendar.tokens.js.map +1 -1
- package/es/components/Calendar/Calendar.types.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.css +57 -29
- package/es/components/Calendar/CalendarBase/CalendarBase.js +7 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.styles.js.map +1 -1
- package/es/components/Calendar/CalendarBase/{CalendarBase.styles_rv9ax9.css → CalendarBase.styles_1m6uih1.css} +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.css +58 -30
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +7 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js.map +1 -1
- package/{cjs/components/Calendar/CalendarDouble/CalendarDouble.styles_1rc2ejs.css → es/components/Calendar/CalendarDouble/CalendarDouble.styles_e9ada0.css} +2 -2
- package/es/components/Calendar/hoc/withRange.js.map +1 -1
- package/es/components/Calendar/hooks/useDays.js +1 -1
- package/es/components/Calendar/hooks/useDays.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.css +4 -4
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +9 -9
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_107vqka.css +4 -0
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.css +7 -7
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDays/{CalendarDays.styles_bnrjbd.css → CalendarDays.styles_1oq8sud.css} +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.css +36 -8
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +32 -18
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +26 -13
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_gnorek.css +8 -0
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.css +4 -4
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_7jeg2n.css +4 -0
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.css +4 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles_4z2ki7.css +4 -0
- package/es/components/Calendar/utils/index.js.map +1 -1
- package/es/components/Combobox/Combobox.js +1 -1
- package/es/components/Combobox/Combobox.js.map +1 -1
- package/es/components/DatePicker/DatePicker.tokens.js +184 -0
- package/es/components/DatePicker/DatePicker.tokens.js.map +1 -0
- package/es/components/DatePicker/DatePickerBase.styles.js +26 -0
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -0
- package/es/components/DatePicker/DatePickerBase.styles_1thp2xv.css +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.css +152 -0
- package/es/components/DatePicker/RangeDate/RangeDate.js +280 -0
- package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js +43 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles_ww61h9.css +5 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +144 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +79 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +37 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_wp3vfj.css +2 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base_tl4jc7.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base_f58pkk.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base_11yn9y8.css +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.css +134 -0
- package/es/components/DatePicker/SingleDate/SingleDate.js +178 -0
- package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js +43 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles_18b5qkz.css +5 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base_1rfgfsz.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base_1jucwp.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base_lf7y25.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base_15vaheb.css +1 -0
- package/es/components/DatePicker/hooks/useDatePicker.js +75 -0
- package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -0
- package/es/components/DatePicker/utils/dateHelper.js +76 -0
- package/es/components/DatePicker/utils/dateHelper.js.map +1 -0
- package/es/components/Dropdown/Dropdown.js +4 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/utils/index.js +1 -16
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Range/Range.css +6 -6
- package/es/components/Range/Range.js +18 -3
- package/es/components/Range/Range.js.map +1 -1
- package/es/components/Range/Range.styles.js +1 -1
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Range/Range.styles_9rort8.css +8 -0
- package/es/components/Select/Select.js +1 -1
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Sheet/Sheet.js +4 -4
- package/es/components/Sheet/Sheet.js.map +1 -1
- package/es/components/Slider/Slider.css +3 -3
- package/es/components/Slider/components/Double/Double.css +3 -3
- package/es/components/TextField/TextField.tokens.js +1 -1
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base_1vu13zn.css +1 -0
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base.js.map +1 -1
- package/es/components/TextField/variations/_size/base_orwx1f.css +1 -0
- package/es/components/TextField/variations/_view/base.js +1 -1
- package/es/components/TextField/variations/_view/base_18ea6z7.css +1 -0
- package/es/components/_Icon/Icon.assets/DisclosureDownFill.js +19 -0
- package/es/components/_Icon/Icon.assets/DisclosureDownFill.js.map +1 -0
- package/es/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureLeft.js.map +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/es/components/_Icon/Icons/IconDisclosureDownFill.js +19 -0
- package/es/components/_Icon/Icons/IconDisclosureDownFill.js.map +1 -0
- package/es/index.css +71 -38
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/utils/datejs.js +8 -0
- package/es/utils/datejs.js.map +1 -0
- package/es/utils/getPopoverPlacement.js +18 -0
- package/es/utils/getPopoverPlacement.js.map +1 -0
- package/es/utils/index.js.map +1 -1
- package/package.json +3 -2
- package/styled-components/cjs/components/Calendar/Calendar.tokens.js +67 -28
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +6 -0
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +2 -1
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +6 -0
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +2 -2
- package/styled-components/cjs/components/Calendar/hooks/useDays.js +1 -1
- package/styled-components/cjs/components/Calendar/mixins/active.js +12 -0
- package/styled-components/cjs/components/Calendar/mixins/flex.js +8 -0
- package/styled-components/cjs/components/Calendar/mixins/index.js +30 -29
- package/styled-components/cjs/components/Calendar/mixins/selected.js +24 -0
- package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +27 -20
- package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +2 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +30 -16
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +29 -11
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +26 -12
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +26 -14
- package/styled-components/cjs/components/Combobox/Combobox.js +6 -7
- package/styled-components/cjs/components/DatePicker/DatePicker.template-doc.mdx +150 -0
- package/styled-components/cjs/components/DatePicker/DatePicker.tokens.js +187 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.styles.js +19 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +293 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +33 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +81 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +26 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js +9 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_disabled/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +190 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +33 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js +9 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_disabled/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_size/tokens.json +16 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +77 -0
- package/styled-components/cjs/components/DatePicker/index.js +44 -0
- package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +78 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +3 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/styled-components/cjs/components/Dropdown/utils/index.js +1 -16
- package/styled-components/cjs/components/Range/Range.js +17 -2
- package/styled-components/cjs/components/Range/Range.styles.js +3 -2
- package/styled-components/cjs/components/Select/Select.js +7 -8
- package/styled-components/cjs/components/Sheet/Sheet.js +3 -3
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js +22 -0
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/styled-components/cjs/components/_Icon/Icons/IconDisclosureDownFill.js +22 -0
- package/styled-components/cjs/components/_Icon/index.js +7 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.js +13 -0
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +4 -4
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/cjs/utils/datejs.js +11 -0
- package/styled-components/cjs/utils/getPopoverPlacement.js +21 -0
- package/styled-components/cjs/utils/index.js +22 -0
- package/styled-components/es/components/Calendar/Calendar.tokens.js +67 -28
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +7 -1
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.styles.js +2 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +7 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js +2 -2
- package/styled-components/es/components/Calendar/hooks/useDays.js +1 -1
- package/styled-components/es/components/Calendar/mixins/active.js +6 -0
- package/styled-components/es/components/Calendar/mixins/flex.js +2 -0
- package/styled-components/es/components/Calendar/mixins/index.js +3 -27
- package/styled-components/es/components/Calendar/mixins/selected.js +18 -0
- package/styled-components/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +26 -19
- package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +2 -1
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +32 -18
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +29 -11
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +25 -11
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +25 -13
- package/styled-components/es/components/Combobox/Combobox.js +1 -2
- package/styled-components/es/components/DatePicker/DatePicker.template-doc.mdx +150 -0
- package/styled-components/es/components/DatePicker/DatePicker.tokens.js +181 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.styles.js +12 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +284 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.styles.js +25 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +74 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +19 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_disabled/base.js +3 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_disabled/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_readonly/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_size/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_view/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_view/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +181 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.styles.js +25 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.types.js +1 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_disabled/base.js +3 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_disabled/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_readonly/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_size/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_size/tokens.json +16 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_view/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +71 -0
- package/styled-components/es/components/DatePicker/index.js +3 -0
- package/styled-components/es/components/DatePicker/utils/dateHelper.js +72 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +4 -3
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/styled-components/es/components/Dropdown/utils/index.js +0 -15
- package/styled-components/es/components/Range/Range.js +18 -3
- package/styled-components/es/components/Range/Range.styles.js +3 -2
- package/styled-components/es/components/Select/Select.js +1 -2
- package/styled-components/es/components/Sheet/Sheet.js +4 -4
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -1
- package/styled-components/es/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureDownFill.js +15 -0
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/styled-components/es/components/_Icon/Icons/IconDisclosureDownFill.js +15 -0
- package/styled-components/es/components/_Icon/index.js +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.js +7 -0
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.js +7 -0
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +4 -4
- package/styled-components/es/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/index.js +2 -1
- package/styled-components/es/utils/datejs.js +4 -0
- package/styled-components/es/utils/getPopoverPlacement.js +15 -0
- package/styled-components/es/utils/index.js +1 -0
- package/types/components/Accordion/utils/index.d.ts +1 -1
- package/types/components/Calendar/Calendar.tokens.d.ts +60 -26
- package/types/components/Calendar/Calendar.tokens.d.ts.map +1 -1
- package/types/components/Calendar/Calendar.types.d.ts +1 -1
- package/types/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts +27 -3
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
- package/types/components/Calendar/CalendarBase/CalendarBase.styles.d.ts.map +1 -1
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts +30 -3
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useDays.d.ts.map +1 -1
- package/types/components/Calendar/mixins/active.d.ts +17 -0
- package/types/components/Calendar/mixins/active.d.ts.map +1 -0
- package/types/components/Calendar/mixins/flex.d.ts +3 -0
- package/types/components/Calendar/mixins/flex.d.ts.map +1 -0
- package/types/components/Calendar/mixins/index.d.ts +3 -8
- package/types/components/Calendar/mixins/index.d.ts.map +1 -1
- package/types/components/Calendar/mixins/selected.d.ts +40 -0
- package/types/components/Calendar/mixins/selected.d.ts.map +1 -0
- package/types/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.d.ts +47 -7
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.types.d.ts +1 -0
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.types.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarYears/CalendarYears.styles.d.ts.map +1 -1
- package/types/components/Calendar/utils/index.d.ts +1 -1
- package/types/components/Calendar/utils/index.d.ts.map +1 -1
- package/types/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/components/DatePicker/DatePicker.tokens.d.ts +182 -0
- package/types/components/DatePicker/DatePicker.tokens.d.ts.map +1 -0
- package/types/components/DatePicker/DatePickerBase.styles.d.ts +8 -0
- package/types/components/DatePicker/DatePickerBase.styles.d.ts.map +1 -0
- package/types/components/DatePicker/DatePickerBase.types.d.ts +37 -0
- package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts +110 -0
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.styles.d.ts +115 -0
- package/types/components/DatePicker/RangeDate/RangeDate.styles.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +76 -0
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts +4 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.d.ts +5 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts +29 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_disabled/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_readonly/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_readonly/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_size/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_size/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_view/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_view/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +31 -0
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +45 -0
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +120 -0
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_disabled/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_readonly/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_readonly/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_size/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_size/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_view/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_view/base.d.ts.map +1 -0
- package/types/components/DatePicker/hooks/useDatePicker.d.ts +10 -0
- package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -0
- package/types/components/DatePicker/index.d.ts +6 -0
- package/types/components/DatePicker/index.d.ts.map +1 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts +10 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -0
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +1 -3
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/components/Range/Range.d.ts +3 -3
- package/types/components/Range/Range.d.ts.map +1 -1
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Range/Range.types.d.ts +8 -3
- package/types/components/Range/Range.types.d.ts.map +1 -1
- package/types/components/Range/index.d.ts +1 -1
- package/types/components/Range/index.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Sheet/Sheet.d.ts.map +1 -1
- package/types/components/Sheet/Sheet.types.d.ts +1 -1
- package/types/components/Sheet/Sheet.types.d.ts.map +1 -1
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -1
- package/types/components/_Icon/Icon.assets/DisclosureDownFill.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/DisclosureDownFill.d.ts.map +1 -0
- package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
- package/types/components/_Icon/Icons/IconDisclosureDownFill.d.ts +4 -0
- package/types/components/_Icon/Icons/IconDisclosureDownFill.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +1 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/plasma_b2c/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.config.d.ts +24 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts +75 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Range/Range.d.ts +3 -3
- package/types/examples/plasma_b2c/components/Range/Range.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/plasma_web/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/DatePicker/DatePicker.config.d.ts +24 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts +75 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Range/Range.d.ts +3 -3
- package/types/examples/plasma_web/components/Range/Range.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/sds_engineer/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/sds_engineer/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/sds_engineer/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/utils/datejs.d.ts +3 -0
- package/types/utils/datejs.d.ts.map +1 -0
- package/types/utils/getPopoverPlacement.d.ts +5 -0
- package/types/utils/getPopoverPlacement.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Calendar/mixins/index.js +0 -18
- package/cjs/components/Calendar/mixins/index.js.map +0 -1
- package/cjs/components/Calendar/mixins/index_o3bz9l.css +0 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_xf9c5e.css +0 -4
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_1c4p417.css +0 -6
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_1jnzviu.css +0 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles_1lubnwe.css +0 -4
- package/cjs/components/Range/Range.styles_mc4w65.css +0 -8
- package/cjs/components/TextField/variations/_read-only/base_134hshp.css +0 -1
- package/cjs/components/TextField/variations/_size/base_ntoddv.css +0 -1
- package/cjs/components/TextField/variations/_view/base_19gxyva.css +0 -1
- package/es/components/Calendar/mixins/index.js +0 -14
- package/es/components/Calendar/mixins/index.js.map +0 -1
- package/es/components/Calendar/mixins/index_o3bz9l.css +0 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_xf9c5e.css +0 -4
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_1c4p417.css +0 -6
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_1jnzviu.css +0 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles_1lubnwe.css +0 -4
- package/es/components/Range/Range.styles_mc4w65.css +0 -8
- package/es/components/TextField/variations/_read-only/base_134hshp.css +0 -1
- package/es/components/TextField/variations/_size/base_ntoddv.css +0 -1
- package/es/components/TextField/variations/_view/base_19gxyva.css +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport {
|
1
|
+
{"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Calendar.tokens';\nimport { component, mergeConfig } from '../../../../engines';\nimport { iconButtonConfig, iconButtonTokens } from '../../../IconButton';\nimport { flexCenter } from '../../mixins';\nimport { addFocus } from '../../../../mixins';\n\nconst mergedIconButtonConfig = mergeConfig(iconButtonConfig);\nconst IconButton = component(mergedIconButtonConfig);\n\nexport const StyledCalendarHeader = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: var(${tokens.calendarHeaderWrapperPadding});\n`;\n\nexport const StyledHeader = styled.button`\n border: none;\n background-color: transparent;\n padding: 0;\n outline: none;\n font-family: var(${tokens.calendarHeaderFontFamily});\n font-size: var(${tokens.calendarHeaderFontSize});\n font-style: var(${tokens.calendarHeaderFontStyle});\n font-weight: var(${tokens.calendarHeaderFontWeightBold});\n letter-spacing: var(${tokens.calendarHeaderFontLetterSpacing});\n line-height: var(${tokens.calendarHeaderFontLineHeight});\n padding: var(${tokens.calendarHeaderPadding});\n\n color: var(${tokens.calendarContentPrimaryColor});\n\n cursor: pointer;\n display: flex;\n gap: var(${tokens.calendarHeaderDateGap});\n justify-content: space-between;\n align-items: center;\n\n &:hover,\n &:active {\n color: var(${tokens.calendarContentSecondaryColor});\n }\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.calendarOutlineFocusColor})`,\n outlineRadius: '0.563rem',\n })};\n`;\n\nexport const StyledHeaderDate = styled.span`\n ${flexCenter};\n pointer-events: none;\n`;\n\nexport const StyledArrows = styled.div`\n display: flex;\n gap: var(${tokens.calendarHeaderArrowGap});\n padding: var(${tokens.calendarHeaderArrowPadding});\n`;\n\n// NOTE: переопределение токенов IconButton\nexport const StyledArrow = styled(IconButton)`\n ${iconButtonTokens.iconButtonColor}: var(${tokens.iconButtonColor});\n ${iconButtonTokens.iconButtonBackgroundColor}: var(${tokens.iconButtonBackgroundColor});\n ${iconButtonTokens.iconButtonColorHover}: var(${tokens.iconButtonColorHover});\n ${iconButtonTokens.iconButtonBackgroundColorHover}: var(${tokens.iconButtonBackgroundColorHover});\n ${iconButtonTokens.iconButtonColorActive}: var(${tokens.iconButtonColorActive});\n ${iconButtonTokens.iconButtonBackgroundColorActive}: var(${tokens.iconButtonBackgroundColorActive});\n ${iconButtonTokens.iconButtonHeight}: var(${tokens.iconButtonHeight});\n ${iconButtonTokens.iconButtonWidth}: var(${tokens.iconButtonWidth});\n ${iconButtonTokens.iconButtonPadding}: var(${tokens.iconButtonPadding});\n ${iconButtonTokens.iconButtonRadius}: var(${tokens.iconButtonRadius});\n ${iconButtonTokens.iconButtonFocusColor}: var(${tokens.iconButtonFocusColor});\n`;\n\nexport const StyledNavigation = styled.div`\n width: 100%;\n ${flexCenter};\n`;\n\nexport const StyledDoubleHeaderWrapper = styled.div`\n width: 100%;\n display: grid;\n grid-template-columns: var(${tokens.iconButtonWidth}) 1fr var(${tokens.iconButtonWidth});\n grid-template-areas: 'a b c';\n\n ${StyledArrow} {\n grid-area: a;\n }\n\n &.${classes.doubleHeaderLastDateWrapper} ${StyledArrow} {\n grid-area: c;\n }\n`;\n\nexport const StyledHeaderDouble = styled.h4`\n font-family: var(${tokens.calendarHeaderFontFamily});\n font-size: var(${tokens.calendarHeaderFontSize});\n font-style: var(${tokens.calendarHeaderFontStyle});\n font-weight: var(${tokens.calendarHeaderFontWeightBold});\n letter-spacing: var(${tokens.calendarHeaderFontLetterSpacing});\n line-height: var(${tokens.calendarHeaderFontLineHeight});\n\n grid-area: b;\n justify-self: center;\n cursor: pointer;\n display: flex;\n gap: var(${tokens.calendarHeaderDateGap});\n justify-content: space-between;\n align-items: center;\n margin: 0;\n\n ${String(flexCenter)};\n`;\n"],"names":["mergedIconButtonConfig","mergeConfig","iconButtonConfig","IconButton","component","StyledCalendarHeader","styled","name","class","propsAsIs","StyledHeader","StyledHeaderDate","StyledArrows","_exp16","StyledArrow","StyledNavigation","StyledDoubleHeaderWrapper","StyledHeaderDouble"],"mappings":";;;;;AAQA,IAAMA,sBAAsB,gBAAGC,WAAW,CAACC,gBAAgB,CAAC,CAAA;AAC5D,IAAMC,UAAU,gBAAGC,SAAS,CAACJ,sBAAsB,CAAC,CAAA;AAE7C,IAAMK,oBAAoB,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,sBA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SAAA,EAAA,KAAA;AAAA,CAa9C,EAAA;AAEM,IAAMQ,kBAAkB,gBAAGX,MAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkBvC;;;;"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
.sjaqipy{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:var(--plasma-calendar-header-wrapper-padding);}
|
2
|
+
.s1k7jebr{border:none;background-color:transparent;padding:0;outline:none;font-family:var(--plasma-calendar-header-font-family);font-size:var(--plasma-calendar-header-font-size);font-style:var(--plasma-calendar-header-font-style);font-weight:var(--plasma-calendar-header-font-weight-bold);-webkit-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);letter-spacing:var(--plasma-calendar-header-font-letter-spacing);line-height:var(--plasma-calendar-header-line-height);padding:var(--plasma-calendar-header-padding);color:var(--plasma-calendar-content-primary-color);cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-calendar-header-date-gap);-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;}.s1k7jebr:hover,.s1k7jebr:active{color:var(--plasma-calendar-content-secondary-color);}.s1k7jebr::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:0.563rem;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s1k7jebr.focus-visible:focus::before,.s1k7jebr[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}
|
3
|
+
.s1b07tlr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;}
|
4
|
+
.s13yvda3{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-calendar-arrow-container-gap);padding:var(--plasma-calendar-arrow-container-padding);}
|
5
|
+
.s1i8jkj2{--plasma-icon-button-color:var(--plasma-calendar-icon-button-color);--plasma-icon-button-background-color:var(--plasma-calendar-icon-button-background);--plasma-icon-button-color-hover:var(--plasma-calendar-icon-button-color-hover);--plasma-icon-button-background-color-hover:var(--plasma-calendar-icon-button-background-hover);--plasma-icon-button-color-active:var(--plasma-calendar-icon-button-color-active);--plasma-icon-button-background-color-active:var(--plasma-calendar-icon-button-background-active);--plasma-icon-button-height:var(--plasma-calendar-icon-button-height);--plasma-icon-button-width:var(--plasma-calendar-icon-button-width);--plasma-icon-button-padding:var(--plasma-calendar-icon-button-padding);--plasma-icon-button-radius:var(--plasma-calendar-icon-button-radius);--plasma-icon-button-focus-color:var(--plasma-calendar-icon-button-focus-color);}
|
6
|
+
.sw3by8z{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
7
|
+
.sdke0q6{width:100%;display:grid;grid-template-columns:var(--plasma-calendar-icon-button-width) 1fr var(--plasma-calendar-icon-button-width);grid-template-areas:'a b c';}.sdke0q6 .s1i8jkj2{grid-area:a;}.sdke0q6.double-header--last-date-wrapper .s1i8jkj2{grid-area:c;}
|
8
|
+
.sdtpxcv{font-family:var(--plasma-calendar-header-font-family);font-size:var(--plasma-calendar-header-font-size);font-style:var(--plasma-calendar-header-font-style);font-weight:var(--plasma-calendar-header-font-weight-bold);-webkit-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-header-font-letter-spacing);letter-spacing:var(--plasma-calendar-header-font-letter-spacing);line-height:var(--plasma-calendar-header-line-height);grid-area:b;justify-self:center;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-calendar-header-date-gap);-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.
|
2
|
-
.
|
3
|
-
.
|
4
|
-
.
|
1
|
+
.CalendarMonths_styles_7jeg2n_s2fb05v__2634db4d{padding:var(--plasma-calendar-months-padding);box-sizing:border-box;}
|
2
|
+
.CalendarMonths_styles_7jeg2n_s1nlg4aa__2634db4d{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
3
|
+
.CalendarMonths_styles_7jeg2n_s1cvx4bk__2634db4d{border-radius:calc(var(--plasma-calendar-month-item-border-radius) - 0.125rem);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
4
|
+
.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d{font-family:var(--plasma-calendar-month-font-family);font-size:var(--plasma-calendar-month-font-size);font-style:var(--plasma-calendar-month-font-style);font-weight:var(--plasma-calendar-month-font-weight);-webkit-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);letter-spacing:var(--plasma-calendar-month-font-letter-spacing);line-height:var(--plasma-calendar-month-line-height);position:relative;box-sizing:border-box;min-height:var(--plasma-calendar-month-item-height);min-width:var(--plasma-calendar-month-item-width);border-radius:var(--plasma-calendar-month-item-border-radius);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;outline:none;cursor:pointer;position:relative;}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d:hover{background-color:var(--plasma-calendar-selectable-item-bg-hover);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemHovered__2634db4d,.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemHovered__2634db4d:hover{background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:pointer;font-weight:var(--plasma-calendar-month-selected-font-weight);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemSelected__2634db4d:not(.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d){border:0;background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:default;font-weight:var(--plasma-calendar-month-selected-font-weight);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d:active{background-color:var(--plasma-calendar-active-item-bg);color:var(--plasma-calendar-active-item-color);font-weight:var(--plasma-calendar-month-selected-font-weight);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d{border:0.063rem solid var(--plasma-calendar-current-item-border-color);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d.CalendarMonths_styles_7jeg2n_itemSelected__2634db4d{background-color:initial;color:var(--plasma-calendar-selected-item-color);font-weight:var(--plasma-calendar-month-selected-font-weight);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d.CalendarMonths_styles_7jeg2n_itemSelected__2634db4d > div:first-of-type{background-color:var(--plasma-calendar-selected-item-background);min-width:calc(var(--plasma-calendar-month-item-width) - 0.25rem);min-height:calc(var(--plasma-calendar-month-item-height) - 0.25rem);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-month-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_focusVisible__2634db4d:focus::before,.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d{position:relative;}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d::before{content:'';position:absolute;top:-0.1875rem;left:-0.1875rem;right:-0.1875rem;bottom:-0.1875rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-month-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d.CalendarMonths_styles_7jeg2n_focusVisible__2634db4d:focus::before,.CalendarMonths_styles_7jeg2n_s14caaqm__2634db4d.CalendarMonths_styles_7jeg2n_itemCurrent__2634db4d[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}
|
@@ -55,7 +55,7 @@ var CalendarMonths = function CalendarMonths(_ref) {
|
|
55
55
|
isCurrent = _ref2.isCurrent,
|
56
56
|
monthFullName = _ref2.monthFullName;
|
57
57
|
var selectedClass = isSelected ? classes.selectedItem : undefined;
|
58
|
-
var currentClass =
|
58
|
+
var currentClass = isCurrent ? classes.currentItem : undefined;
|
59
59
|
return /*#__PURE__*/React.createElement(StyledMonthRoot, {
|
60
60
|
id: "month-test-".concat(i, "-").concat(j),
|
61
61
|
className: cx(selectedClass, currentClass, classes.selectableItem),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useMonths } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex, StyledMonth, StyledMonthRoot } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n selectIndexes,\n outerRefs,\n onChangeMonth,\n onSetSelected,\n onKeyDown,\n}) => {\n const [months, selected] = useMonths(currentDate);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { monthIndex } = event.currentTarget.dataset;\n onChangeMonth(Number(monthIndex));\n },\n [onChangeMonth],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(({ monthName, monthIndex, isSelected, isCurrent, monthFullName }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass =
|
1
|
+
{"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useMonths } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex, StyledMonth, StyledMonthRoot } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n selectIndexes,\n outerRefs,\n onChangeMonth,\n onSetSelected,\n onKeyDown,\n}) => {\n const [months, selected] = useMonths(currentDate);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { monthIndex } = event.currentTarget.dataset;\n onChangeMonth(Number(monthIndex));\n },\n [onChangeMonth],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(({ monthName, monthIndex, isSelected, isCurrent, monthFullName }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledMonthRoot\n id={`month-test-${i}-${j}`}\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeMonth}\n data-month-index={monthIndex}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledMonth-${i}-${j}`}\n aria-label={monthFullName}\n >\n <StyledMonth>{monthName}</StyledMonth>\n </StyledMonthRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarMonths>\n );\n};\n"],"names":["CalendarMonths","_ref","currentDate","date","selectIndexes","outerRefs","onChangeMonth","onSetSelected","onKeyDown","_useMonths","useMonths","_useMonths2","_slicedToArray","months","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeMonth","useCallback","event","nativeEvent","stopImmediatePropagation","monthIndex","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarMonths","role","map","month","StyledFlex","key","_ref2","monthName","isSelected","isCurrent","monthFullName","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledMonthRoot","id","concat","className","cx","selectableItem","ref","tabIndex","onClick","StyledMonth"],"mappings":";;;;;;;AASA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAOpD;AAAA,EAAA,IANIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,SAAS,GAAAP,IAAA,CAATO,SAAS,CAAA;AAET,EAAA,IAAAC,UAAA,GAA2BC,SAAS,CAACR,WAAW,CAAC;IAAAS,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAA1CI,IAAAA,MAAM,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,WAAA,CAAA,CAAA,CAAA,CAAA;AACvB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,mBAAmB,GAAGC,WAAW,CACnC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,CAACC,wBAAwB,EAAE,CAAA;IAE5C,IAAQC,UAAU,GAAKH,KAAK,CAACI,aAAa,CAACC,OAAO,CAA1CF,UAAU,CAAA;AAClBjB,IAAAA,aAAa,CAACoB,MAAM,CAACH,UAAU,CAAC,CAAC,CAAA;AACrC,GAAC,EACD,CAACjB,aAAa,CAClB,CAAC,CAAA;EAED,IAAMqB,OAAO,GAAGR,WAAW,CACvB,UAACS,OAAuB,EAAEC,CAAS,EAAEC,CAAS,EAAK;IAC/CzB,SAAS,CAAC0B,OAAO,CAACF,CAAC,CAAC,CAACC,CA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AAA,CAACkB,eAAe,EAAA;QACZC,EAAE,EAAA,aAAA,CAAAC,MAAA,CAAgB3B,CAAC,OAAA2B,MAAA,CAAI1B,CAAC,CAAG;QAC3B2B,SAAS,EAAEC,EAAE,CAACV,aAAa,EAAEI,YAAY,EAAEH,OAAO,CAACU,cAAc,CAAE;QACnEC,GAAG,EAAE,SAAAA,GAAAA,CAAChC,OAAuB,EAAA;AAAA,UAAA,OAAKD,OAAO,CAACC,OAAO,EAAEC,CAAC,EAAEC,CAAC,CAAC,CAAA;SAAC;QACzD+B,QAAQ,EAAEhC,CAAC,MAAKzB,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAI0B,IAAAA,CAAC,MAAK1B,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAG,GAAA,CAAC,GAAG,CAAC,CAAE;AACxE0D,QAAAA,OAAO,EAAE5C,mBAAoB;AAC7B,QAAA,kBAAA,EAAkBK,UAAW;AAC7B,QAAA,eAAA,EAAesB,UAAW;AAC1BP,QAAAA,IAAI,EAAC,UAAU;QACfI,GAAG,EAAA,cAAA,CAAAc,MAAA,CAAiB3B,CAAC,OAAA2B,MAAA,CAAI1B,CAAC,CAAG;QAC7B,YAAYiB,EAAAA,aAAAA;OAEZZ,eAAAA,KAAA,CAAAC,aAAA,CAAC2B,WAAW,EAAEnB,IAAAA,EAAAA,SAAuB,CACxB,CAAC,CAAA;AAE1B,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarMonths.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport {
|
1
|
+
{"version":3,"file":"CalendarMonths.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Calendar.tokens';\nimport { addFocus } from '../../../../mixins';\nimport { addSelected, flexCenter } from '../../mixins';\n\nexport const StyledCalendarMonths = styled.div`\n padding: var(${tokens.calendarMonthsPadding});\n box-sizing: border-box;\n`;\n\nexport const StyledFlex = styled.div`\n ${String(flexCenter)};\n`;\n\nexport const StyledMonth = styled.div`\n border-radius: calc(var(${tokens.calendarMonthItemBorderRadius}) - 0.125rem);\n\n ${String(flexCenter)};\n`;\n\nexport const StyledMonthRoot = styled.div`\n font-family: var(${tokens.calendarMonthFontFamily});\n font-size: var(${tokens.calendarMonthFontSize});\n font-style: var(${tokens.calendarMonthFontStyle});\n font-weight: var(${tokens.calendarMonthFontWeight});\n letter-spacing: var(${tokens.calendarMonthFontLetterSpacing});\n line-height: var(${tokens.calendarMonthFontLineHeight});\n position: relative;\n box-sizing: border-box;\n\n min-height: var(${tokens.calendarMonthItemHeight});\n min-width: var(${tokens.calendarMonthItemWidth});\n\n border-radius: var(${tokens.calendarMonthItemBorderRadius});\n\n ${String(flexCenter)};\n\n ${addSelected({\n minWidth: `calc(var(${tokens.calendarMonthItemWidth}) - 0.25rem)`,\n minHeight: `calc(var(${tokens.calendarMonthItemHeight}) - 0.25rem)`,\n selectedFontWeight: `var(${tokens.calendarMonthSelectedFontWeight})`,\n selectedBackground: `var(${tokens.calendarSelectedItemBackground})`,\n selectedColor: `var(${tokens.calendarSelectedItemColor})`,\n selectableBackgroundHover: `var(${tokens.calendarSelectableItemBackgroundHover})`,\n currentBorderColor: `var(${tokens.calendarCurrentItemBorderColor})`,\n activeBackground: `var(${tokens.calendarActiveItemBackground})`,\n activeColor: `var(${tokens.calendarActiveItemColor})`,\n })};\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.calendarOutlineFocusColor})`,\n outlineRadius: `calc(var(${tokens.calendarMonthItemBorderRadius}) + 0.125rem)`,\n })};\n\n &.${classes.currentItem} {\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.1875rem',\n outlineColor: `var(${tokens.calendarOutlineFocusColor})`,\n outlineRadius: `calc(var(${tokens.calendarMonthItemBorderRadius}) + 0.125rem)`,\n })};\n }\n`;\n"],"names":["StyledCalendarMonths","styled","name","class","propsAsIs","StyledFlex","StyledMonth","StyledMonthRoot"],"mappings":";;AAMO,IAAMA,oBAAoB,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,sBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAGzC,EAAA;AAEM,IAAMC,UAAU,gBAAGJ,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE/B,EAAA;AAEM,IAAME,WAAW,gBAAGL,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAIhC,EAAA;AAEM,IAAMG,eAAe,gBAAGN,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,iBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA4CpC;;;;"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.s2fb05v{padding:var(--plasma-calendar-months-padding);box-sizing:border-box;}
|
2
|
+
.s1nlg4aa{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
3
|
+
.s1cvx4bk{border-radius:calc(var(--plasma-calendar-month-item-border-radius) - 0.125rem);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
4
|
+
.s14caaqm{font-family:var(--plasma-calendar-month-font-family);font-size:var(--plasma-calendar-month-font-size);font-style:var(--plasma-calendar-month-font-style);font-weight:var(--plasma-calendar-month-font-weight);-webkit-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-month-font-letter-spacing);letter-spacing:var(--plasma-calendar-month-font-letter-spacing);line-height:var(--plasma-calendar-month-line-height);position:relative;box-sizing:border-box;min-height:var(--plasma-calendar-month-item-height);min-width:var(--plasma-calendar-month-item-width);border-radius:var(--plasma-calendar-month-item-border-radius);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;outline:none;cursor:pointer;position:relative;}.s14caaqm:hover{background-color:var(--plasma-calendar-selectable-item-bg-hover);}.s14caaqm.item-hovered,.s14caaqm.item-hovered:hover{background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:pointer;font-weight:var(--plasma-calendar-month-selected-font-weight);}.s14caaqm.item-selected:not(.item-current){border:0;background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:default;font-weight:var(--plasma-calendar-month-selected-font-weight);}.s14caaqm:active{background-color:var(--plasma-calendar-active-item-bg);color:var(--plasma-calendar-active-item-color);font-weight:var(--plasma-calendar-month-selected-font-weight);}.s14caaqm.item-current{border:0.063rem solid var(--plasma-calendar-current-item-border-color);}.s14caaqm.item-current.item-selected{background-color:initial;color:var(--plasma-calendar-selected-item-color);font-weight:var(--plasma-calendar-month-selected-font-weight);}.s14caaqm.item-current.item-selected > div:first-of-type{background-color:var(--plasma-calendar-selected-item-background);min-width:calc(var(--plasma-calendar-month-item-width) - 0.25rem);min-height:calc(var(--plasma-calendar-month-item-height) - 0.25rem);}.s14caaqm::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-month-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s14caaqm.focus-visible:focus::before,.s14caaqm[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}.s14caaqm.item-current{position:relative;}.s14caaqm.item-current::before{content:'';position:absolute;top:-0.1875rem;left:-0.1875rem;right:-0.1875rem;bottom:-0.1875rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-month-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s14caaqm.item-current.focus-visible:focus::before,.s14caaqm.item-current[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.
|
2
|
-
.
|
3
|
-
.
|
4
|
-
.
|
1
|
+
.CalendarYears_styles_4z2ki7_sq90exc__3419e23e{padding:var(--plasma-calendar-years-padding);box-sizing:border-box;}
|
2
|
+
.CalendarYears_styles_4z2ki7_sp45mzt__3419e23e{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
3
|
+
.CalendarYears_styles_4z2ki7_s1rv7a6a__3419e23e{border-radius:calc(var(--plasma-calendar-year-item-border-radius) - 0.125rem);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
4
|
+
.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e{font-family:var(--plasma-calendar-year-font-family);font-size:var(--plasma-calendar-year-font-size);font-style:var(--plasma-calendar-year-font-style);font-weight:var(--plasma-calendar-year-font-weight);-webkit-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);letter-spacing:var(--plasma-calendar-year-font-letter-spacing);line-height:var(--plasma-calendar-year-line-height);position:relative;box-sizing:border-box;min-height:var(--plasma-calendar-year-item-height);min-width:var(--plasma-calendar-year-item-width);border-radius:var(--plasma-calendar-year-item-border-radius);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;outline:none;cursor:pointer;position:relative;}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e:hover{background-color:var(--plasma-calendar-selectable-item-bg-hover);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemHovered__3419e23e,.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemHovered__3419e23e:hover{background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:pointer;font-weight:var(--plasma-calendar-year-selected-font-weight);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemSelected__3419e23e:not(.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e){border:0;background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:default;font-weight:var(--plasma-calendar-year-selected-font-weight);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e:active{background-color:var(--plasma-calendar-active-item-bg);color:var(--plasma-calendar-active-item-color);font-weight:var(--plasma-calendar-year-selected-font-weight);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e{border:0.063rem solid var(--plasma-calendar-current-item-border-color);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e.CalendarYears_styles_4z2ki7_itemSelected__3419e23e{background-color:initial;color:var(--plasma-calendar-selected-item-color);font-weight:var(--plasma-calendar-year-selected-font-weight);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e.CalendarYears_styles_4z2ki7_itemSelected__3419e23e > div:first-of-type{background-color:var(--plasma-calendar-selected-item-background);min-width:calc(var(--plasma-calendar-year-item-width) - 0.25rem);min-height:calc(var(--plasma-calendar-year-item-height) - 0.25rem);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-year-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_focusVisible__3419e23e:focus::before,.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e{position:relative;}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e::before{content:'';position:absolute;top:-0.1875rem;left:-0.1875rem;right:-0.1875rem;bottom:-0.1875rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-year-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e.CalendarYears_styles_4z2ki7_focusVisible__3419e23e:focus::before,.CalendarYears_styles_4z2ki7_s1fgpu0g__3419e23e.CalendarYears_styles_4z2ki7_itemCurrent__3419e23e[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}
|
@@ -54,7 +54,7 @@ var CalendarYears = function CalendarYears(_ref) {
|
|
54
54
|
isSelected = _ref2.isSelected,
|
55
55
|
isCurrent = _ref2.isCurrent;
|
56
56
|
var selectedClass = isSelected ? classes.selectedItem : undefined;
|
57
|
-
var currentClass =
|
57
|
+
var currentClass = isCurrent ? classes.currentItem : undefined;
|
58
58
|
return /*#__PURE__*/React.createElement(StyledYearRoot, {
|
59
59
|
className: cx(selectedClass, currentClass, classes.selectableItem),
|
60
60
|
ref: function ref(element) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass =
|
1
|
+
{"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledYearRoot\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeYear}\n data-year={yearValue}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledYear-${i}-${j}`}\n aria-label={String(yearValue)}\n >\n <StyledYear>{yearValue}</StyledYear>\n </StyledYearRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","startYear","selectIndexes","outerRefs","onChangeYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeYear","useCallback","event","nativeEvent","stopImmediatePropagation","year","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledYearRoot","className","cx","selectableItem","ref","tabIndex","onClick","concat","String","StyledYear"],"mappings":";;;;;;;AASA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAQlD;AAAA,EAAA,IAPIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAAC,SAAA,GAA0BC,QAAQ,CAACT,WAAW,EAAEE,SAAS,CAAC;IAAAQ,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAnDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AACtB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,kBAAkB,GAAGC,WAAW,CAClC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,CAACC,wBAAwB,EAAE,CAAA;IAE5C,IAAQC,IAAI,GAAKH,KAAK,CAACI,aAAa,CAACC,OAAO,CAApCF,IAAI,CAAA;AACZjB,IAAAA,YAAY,CAACoB,MAAM,CAACH,IAAI,CAAC,CAAC,CAAA;AAC9B,GAAC,EACD,CAAC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GL,SAAS,GAAGE,OAAO,CAACI,WAAW,GAAGF,SAAS,CAAA;AAEhE,MAAA,oBACId,KAAA,CAAAC,aAAA,CAACgB,cAAc,EAAA;QACXC,SAAS,EAAEC,EAAE,CAACR,aAAa,EAAEI,YAAY,EAAEH,OAAO,CAACQ,cAAc,CAAE;QACnEC,GAAG,EAAE,SAAAA,GAAAA,CAAC5B,OAAuB,EAAA;AAAA,UAAA,OAAKD,OAAO,CAACC,OAAO,EAAEC,CAAC,EAAEC,CAAC,CAAC,CAAA;SAAC;QACzD2B,QAAQ,EAAE5B,CAAC,MAAKzB,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAI0B,IAAAA,CAAC,MAAK1B,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAG,GAAA,CAAC,GAAG,CAAC,CAAE;AACxEsD,QAAAA,OAAO,EAAExC,kBAAmB;AAC5B,QAAA,WAAA,EAAWyB,SAAU;AACrB,QAAA,eAAA,EAAeC,UAAW;AAC1BN,QAAAA,IAAI,EAAC,UAAU;QACfG,GAAG,EAAA,aAAA,CAAAkB,MAAA,CAAgB9B,CAAC,OAAA8B,MAAA,CAAI7B,CAAC,CAAG;QAC5B,YAAY8B,EAAAA,MAAM,CAACjB,SAAS,CAAA;OAE5BR,eAAAA,KAAA,CAAAC,aAAA,CAACyB,UAAU,EAAElB,IAAAA,EAAAA,SAAsB,CACvB,CAAC,CAAA;AAEzB,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CalendarYears.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport {
|
1
|
+
{"version":3,"file":"CalendarYears.styles.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Calendar.tokens';\nimport { addFocus } from '../../../../mixins';\nimport { addSelected, flexCenter } from '../../mixins';\n\nexport const StyledCalendarYears = styled.div`\n padding: var(${tokens.calendarYearsPadding});\n box-sizing: border-box;\n`;\n\nexport const StyledFlex = styled.div`\n ${String(flexCenter)};\n`;\n\nexport const StyledYear = styled.div`\n border-radius: calc(var(${tokens.calendarYearItemBorderRadius}) - 0.125rem);\n\n ${String(flexCenter)};\n`;\n\nexport const StyledYearRoot = styled.div`\n font-family: var(${tokens.calendarYearFontFamily});\n font-size: var(${tokens.calendarYearFontSize});\n font-style: var(${tokens.calendarYearFontStyle});\n font-weight: var(${tokens.calendarYearFontWeight});\n letter-spacing: var(${tokens.calendarYearFontLetterSpacing});\n line-height: var(${tokens.calendarYearFontLineHeight});\n position: relative;\n box-sizing: border-box;\n\n min-height: var(${tokens.calendarYearItemHeight});\n min-width: var(${tokens.calendarYearItemWidth});\n\n border-radius: var(${tokens.calendarYearItemBorderRadius});\n\n ${String(flexCenter)};\n\n ${addSelected({\n minWidth: `calc(var(${tokens.calendarYearItemWidth}) - 0.25rem)`,\n minHeight: `calc(var(${tokens.calendarYearItemHeight}) - 0.25rem)`,\n selectedFontWeight: `var(${tokens.calendarYearSelectedFontWeight})`,\n selectedBackground: `var(${tokens.calendarSelectedItemBackground})`,\n selectedColor: `var(${tokens.calendarSelectedItemColor})`,\n selectableBackgroundHover: `var(${tokens.calendarSelectableItemBackgroundHover})`,\n currentBorderColor: `var(${tokens.calendarCurrentItemBorderColor})`,\n activeBackground: `var(${tokens.calendarActiveItemBackground})`,\n activeColor: `var(${tokens.calendarActiveItemColor})`,\n })};\n\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.125rem',\n outlineColor: `var(${tokens.calendarOutlineFocusColor})`,\n outlineRadius: `calc(var(${tokens.calendarYearItemBorderRadius}) + 0.125rem)`,\n })};\n\n &.${classes.currentItem} {\n ${addFocus({\n outlineSize: '0.063rem',\n outlineOffset: '-0.1875rem',\n outlineColor: `var(${tokens.calendarOutlineFocusColor})`,\n outlineRadius: `calc(var(${tokens.calendarYearItemBorderRadius}) + 0.125rem)`,\n })};\n }\n`;\n"],"names":["StyledCalendarYears","styled","name","class","propsAsIs","StyledFlex","StyledYear","StyledYearRoot"],"mappings":";;AAMO,IAAMA,mBAAmB,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,qBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAGxC,EAAA;AAEM,IAAMC,UAAU,gBAAGJ,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE/B,EAAA;AAEM,IAAME,UAAU,gBAAGL,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAI/B,EAAA;AAEM,IAAMG,cAAc,gBAAGN,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,gBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CA4CnC;;;;"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.sq90exc{padding:var(--plasma-calendar-years-padding);box-sizing:border-box;}
|
2
|
+
.sp45mzt{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
3
|
+
.s1rv7a6a{border-radius:calc(var(--plasma-calendar-year-item-border-radius) - 0.125rem);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
4
|
+
.s1fgpu0g{font-family:var(--plasma-calendar-year-font-family);font-size:var(--plasma-calendar-year-font-size);font-style:var(--plasma-calendar-year-font-style);font-weight:var(--plasma-calendar-year-font-weight);-webkit-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);-moz-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);-ms-letter-spacing:var(--plasma-calendar-year-font-letter-spacing);letter-spacing:var(--plasma-calendar-year-font-letter-spacing);line-height:var(--plasma-calendar-year-line-height);position:relative;box-sizing:border-box;min-height:var(--plasma-calendar-year-item-height);min-width:var(--plasma-calendar-year-item-width);border-radius:var(--plasma-calendar-year-item-border-radius);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;outline:none;cursor:pointer;position:relative;}.s1fgpu0g:hover{background-color:var(--plasma-calendar-selectable-item-bg-hover);}.s1fgpu0g.item-hovered,.s1fgpu0g.item-hovered:hover{background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:pointer;font-weight:var(--plasma-calendar-year-selected-font-weight);}.s1fgpu0g.item-selected:not(.item-current){border:0;background-color:var(--plasma-calendar-selected-item-background);color:var(--plasma-calendar-selected-item-color);cursor:default;font-weight:var(--plasma-calendar-year-selected-font-weight);}.s1fgpu0g:active{background-color:var(--plasma-calendar-active-item-bg);color:var(--plasma-calendar-active-item-color);font-weight:var(--plasma-calendar-year-selected-font-weight);}.s1fgpu0g.item-current{border:0.063rem solid var(--plasma-calendar-current-item-border-color);}.s1fgpu0g.item-current.item-selected{background-color:initial;color:var(--plasma-calendar-selected-item-color);font-weight:var(--plasma-calendar-year-selected-font-weight);}.s1fgpu0g.item-current.item-selected > div:first-of-type{background-color:var(--plasma-calendar-selected-item-background);min-width:calc(var(--plasma-calendar-year-item-width) - 0.25rem);min-height:calc(var(--plasma-calendar-year-item-height) - 0.25rem);}.s1fgpu0g::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-year-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s1fgpu0g.focus-visible:focus::before,.s1fgpu0g[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}.s1fgpu0g.item-current{position:relative;}.s1fgpu0g.item-current::before{content:'';position:absolute;top:-0.1875rem;left:-0.1875rem;right:-0.1875rem;bottom:-0.1875rem;z-index:1;display:block;box-sizing:content-box;border:0.063rem solid transparent;border-radius:calc(var(--plasma-calendar-year-item-border-radius) + 0.125rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.s1fgpu0g.item-current.focus-visible:focus::before,.s1fgpu0g.item-current[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.063rem var(--plasma-calendar-outline-focus-color);}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Calendar/utils/index.ts"],"sourcesContent":["import type { CalendarStateType } from '../store/types';\nimport type { CalendarValueType, DateObject, DisabledDay, ItemProps } from '../Calendar.types';\n\nexport const ROW_STEP = 6;\n\nexport const YEAR_RENDER_COUNT = 12;\n\nexport const SHORT_DAY_NAMES = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'] as const;\n\nexport const FULL_DAY_NAMES: Record<typeof SHORT_DAY_NAMES[number], string> = {\n Пн: 'Понедельник',\n Вт: 'Вторник',\n Ср: 'Среда',\n Чт: 'Четверг',\n Пт: 'Пятница',\n Сб: 'Суббота',\n Вс: 'Воскресенье',\n};\n\nexport const SHORT_MONTH_NAME = ['Янв', 'Фев', 'Март', 'Апр', 'Май', 'Июнь', 'Июль', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'];\n\nexport const MONTH_NAMES = [\n 'Январь',\n 'Февраль',\n 'Март',\n 'Апрель',\n 'Май',\n 'Июнь',\n 'Июль',\n 'Август',\n 'Сентябрь',\n 'Октябрь',\n 'Ноябрь',\n 'Декабрь',\n];\n\nexport const getDaysInMonth = (monthIndex: number, year: number) => new Date(year, monthIndex + 1, 0).getDate();\n\nexport const getOffsetDayInWeek = (monthIndex: number, year: number) => (new Date(year, monthIndex).getDay() || 7) - 1;\n\nexport const getStartYear = (year: number) => Math.trunc((year - 1) * 0.1) * 10 - 1;\n\nexport const getNextDate = (currentYear: number, currentMonth: number) =>\n currentMonth + 1 === MONTH_NAMES.length ? [currentYear + 1, 0] : [currentYear, currentMonth + 1];\n\nexport const getPrevDate = (currentYear: number, currentMonth: number) =>\n currentMonth - 1 < 0 ? [currentYear - 1, 11] : [currentYear, currentMonth - 1];\n\nexport const getDateFromValue = (date: Date | undefined): DateObject => {\n const state = date || new Date();\n\n return {\n day: date !== undefined ? state.getDate() : 0,\n monthIndex: state.getMonth(),\n year: state.getFullYear(),\n };\n};\n\nexport const getDateFromNow = (): DateObject => {\n const nowDate = new Date();\n\n return {\n day: nowDate.getDate(),\n monthIndex: nowDate.getMonth(),\n year: nowDate.getFullYear(),\n };\n};\n\nexport const IsCurrentDay = (date: DateObject, currentDay: number) => {\n const { day, monthIndex: currentMonthIndex, year: currentYear } = getDateFromNow();\n return day === currentDay && date.monthIndex === currentMonthIndex && date.year === currentYear;\n};\n\nexport const isSelectedDay = (date: DateObject, currentDay: number, value?: Date) => {\n if (!value) {\n return false;\n }\n\n const { day, monthIndex, year } = getDateFromValue(value);\n return day === currentDay && date.monthIndex === monthIndex && date.year === year;\n};\n\nexport const isCurrentMonth = (date: DateObject, monthIndex: number) => {\n const { monthIndex: currentMonthIndex, year: currentYear } = getDateFromNow();\n return monthIndex === currentMonthIndex && date.year === currentYear;\n};\n\nexport const isSelectedMonth = (date: DateObject, monthIndex: number) => date.monthIndex === monthIndex;\n\nexport const isCurrentYear = (year: number) => {\n const { year: currentYear } = getDateFromNow();\n return year === currentYear;\n};\n\nexport const isSelectedYear = (date: DateObject, year: number) => date.year === year;\n\nexport const getSortedValues = (values: [Date | undefined, (Date | undefined)?]) =>\n values.sort((start, end) => {\n if (!start || !end) {\n return -1;\n }\n\n return start.getTime() - end.getTime();\n });\n\nexport const isDayInRange = (\n year: number,\n monthIndex: number,\n currentDay: number,\n values: [Date | undefined, Date?],\n) => {\n const [startValue, endValue] = getSortedValues(values);\n\n if (!endValue || !startValue) {\n return false;\n }\n\n const day = new Date(year, monthIndex, currentDay);\n return startValue < day && day <= endValue;\n};\n\nexport const isSameDay = (firstDate: DateObject, secondDate?: DateObject) =>\n secondDate &&\n firstDate.day === secondDate.day &&\n firstDate.monthIndex === secondDate.monthIndex &&\n firstDate.year === secondDate.year;\n\nexport const isValueUpdate = (value: Date | [Date, Date?], prevValue: Date | [Date, Date?]) => {\n if (!Array.isArray(value) && !Array.isArray(prevValue)) {\n return prevValue?.getTime() !== value?.getTime();\n }\n\n if (Array.isArray(value) && Array.isArray(prevValue)) {\n return prevValue[0]?.getTime() !== value[0]?.getTime() || prevValue[1]?.getTime() !== value[1]?.getTime();\n }\n\n return false;\n};\n\n/**\n * Метод проверяет, находится ли календарь в режиме выбора второго значения.\n */\nexport const isSelectProcess = (array: unknown | unknown[]): array is [Date, Date?] =>\n Array.isArray(array) && !array[1];\n\n/**\n * Метод возвращает сторону, когда выбор второго значения диапазона завершён.\n */\nexport const getSideForSelected = (date: DateObject, startValue: Date, endValue: Date) => {\n const currentDateTime = new Date(date.year, date.monthIndex, date.day).getTime();\n const startValueTime = startValue.getTime();\n const endValueTime = endValue.getTime();\n\n if (currentDateTime === startValueTime) {\n return 'right';\n }\n\n if (currentDateTime === endValueTime) {\n return 'left';\n }\n\n return undefined;\n};\n\n/**\n * Метод возвращает сторону, во время выбора второго значения диапазона.\n */\nexport const getSideForHovered = (date: DateObject, hoveredDay: DateObject, startValue: Date, isSelected?: boolean) => {\n const dateHover = new Date(hoveredDay.year, hoveredDay.monthIndex, hoveredDay.day);\n const isHovered = isSameDay(date, hoveredDay);\n\n if ((isSelected && startValue > dateHover) || (isHovered && startValue < dateHover)) {\n return 'left';\n }\n\n if ((isSelected && startValue < dateHover) || (isHovered && startValue > dateHover)) {\n return 'right';\n }\n\n return undefined;\n};\n\n/**\n * Метод возвращает сторону, с которой нужно отрисовать направление полоски диапазона.\n */\nexport const getSideInRange = (\n value: CalendarValueType,\n date: DateObject,\n hoveredDay?: DateObject,\n isSelected?: boolean,\n) => {\n if (!Array.isArray(value)) {\n return undefined;\n }\n\n const [startValue, endValue] = value;\n\n if (startValue && isSelected && endValue) {\n return getSideForSelected(date, startValue, endValue);\n }\n\n if (startValue && hoveredDay) {\n return getSideForHovered(date, hoveredDay, startValue, isSelected);\n }\n\n return undefined;\n};\n\n/**\n * Метод проверяет, находится ли выбранный день в диапазоне.\n */\nexport const getInRange = (value: CalendarValueType, date: DateObject, hoveredDay?: DateObject, inRange?: boolean) => {\n if (!isSelectProcess(value) || !hoveredDay) {\n return inRange;\n }\n\n const dateSelected = value[0];\n const dateHover = new Date(hoveredDay.year, hoveredDay.monthIndex, hoveredDay.day);\n const dateCurrent = new Date(date.year, date.monthIndex, date.day);\n\n if (\n (dateSelected < dateCurrent && dateCurrent < dateHover) ||\n (dateSelected > dateCurrent && dateCurrent > dateHover)\n ) {\n return true;\n }\n\n return inRange;\n};\n\n/**\n * Метод проверяет, можно ли выбрать день.\n */\nexport const canSelectDate = (\n { year, monthIndex, day }: DateObject,\n value: CalendarValueType,\n disabledList?: DisabledDay[],\n) => {\n if (!isSelectProcess(value)) {\n return true;\n }\n\n const hoverDate = new Date(year, monthIndex, day);\n const [startDate] = value;\n\n if (!disabledList?.length) {\n return true;\n }\n\n const offDisabledRange = disabledList.some(\n ({ date }) => (startDate < date && date < hoverDate) || (startDate > date && date > hoverDate),\n );\n\n return !offDisabledRange;\n};\n\n/**\n * Метод для получения двумерного массива и возвращения выбранного элемента.\n */\nexport const getMatrix = <T extends ItemProps>(items: T[], rowSize = 7): readonly [T[][], number[] | undefined] => {\n const newItems = [...items];\n\n let selected: [number, number] | undefined;\n\n const result = newItems.reduce((acc: T[][], item, index) => {\n if (index % rowSize === 0) {\n acc.push([]);\n }\n\n acc[acc.length - 1].push(item);\n\n if (item.isSelected) {\n selected = [acc.length - 1, index % rowSize];\n }\n\n return acc;\n }, []);\n\n return [result, selected] as const;\n};\n\nexport const getCalendarType = (type: CalendarStateType) => {\n switch (type) {\n case 'Months':\n return 'год';\n case 'Years':\n return 'период';\n default:\n return 'месяц';\n }\n};\n"],"names":["ROW_STEP","YEAR_RENDER_COUNT","SHORT_DAY_NAMES","FULL_DAY_NAMES","Пн","Вт","Ср","Чт","Пт","Сб","Вс","SHORT_MONTH_NAME","MONTH_NAMES","getDaysInMonth","monthIndex","year","Date","getDate","getOffsetDayInWeek","getDay","getStartYear","Math","trunc","getNextDate","currentYear","currentMonth","length","getPrevDate","getDateFromValue","date","state","day","undefined","getMonth","getFullYear","getDateFromNow","nowDate","IsCurrentDay","currentDay","_getDateFromNow","currentMonthIndex","isSelectedDay","value","_getDateFromValue","isCurrentMonth","_getDateFromNow2","isSelectedMonth","isCurrentYear","_getDateFromNow3","isSelectedYear","getSortedValues","values","sort","start","end","getTime","isDayInRange","_getSortedValues","_getSortedValues2","_slicedToArray","startValue","endValue","isSameDay","firstDate","secondDate","isValueUpdate","prevValue","Array","isArray","_prevValue$","_value$","_prevValue$2","_value$2","isSelectProcess","array","getSideForSelected","currentDateTime","startValueTime","endValueTime","getSideForHovered","hoveredDay","isSelected","dateHover","isHovered","getSideInRange","_value","getInRange","inRange","dateSelected","dateCurrent","canSelectDate","_ref","disabledList","hoverDate","_value2","startDate","offDisabledRange","some","_ref2","getMatrix","items","rowSize","arguments","newItems","_toConsumableArray","selected","result","reduce","acc","item","index","push","getCalendarType","type"],"mappings":";;AAGO,IAAMA,QAAQ,GAAG,EAAC;AAElB,IAAMC,iBAAiB,GAAG,GAAE;IAEtBC,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAU;AAE3E,IAAMC,cAA8D,GAAG;AAC1EC,EAAAA,EAAE,EAAE,aAAa;AACjBC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,OAAO;AACXC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,aAAA;AACR,EAAC;AAEM,IAAMC,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;AAEhH,IAAMC,WAAW,GAAG,CACvB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACZ;AAEM,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,UAAkB,EAAEC,IAAY,EAAA;AAAA,EAAA,OAAK,IAAIC,IAAI,CAACD,IAAI,EAAED,UAAU,GAAG,CAAC,EAAE,CAAC,CAAC,CAACG,OAAO,EAAE,CAAA;AAAA,EAAA;AAExG,IAAMC,kBAAkB,GA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ent":["import type { CalendarStateType } from '../store/types';\nimport type { CalendarValueType, DateObject, DisabledDay, ItemProps } from '../Calendar.types';\n\nexport const ROW_STEP = 6;\n\nexport const YEAR_RENDER_COUNT = 12;\n\nexport const SHORT_DAY_NAMES = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'] as const;\n\nexport const FULL_DAY_NAMES: Record<typeof SHORT_DAY_NAMES[number], string> = {\n Пн: 'Понедельник',\n Вт: 'Вторник',\n Ср: 'Среда',\n Чт: 'Четверг',\n Пт: 'Пятница',\n Сб: 'Суббота',\n Вс: 'Воскресенье',\n};\n\nexport const SHORT_MONTH_NAME = ['Янв', 'Фев', 'Март', 'Апр', 'Май', 'Июнь', 'Июль', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'];\n\nexport const MONTH_NAMES = [\n 'Январь',\n 'Февраль',\n 'Март',\n 'Апрель',\n 'Май',\n 'Июнь',\n 'Июль',\n 'Август',\n 'Сентябрь',\n 'Октябрь',\n 'Ноябрь',\n 'Декабрь',\n];\n\nexport const getDaysInMonth = (monthIndex: number, year: number) => new Date(year, monthIndex + 1, 0).getDate();\n\nexport const getOffsetDayInWeek = (monthIndex: number, year: number) => (new Date(year, monthIndex).getDay() || 7) - 1;\n\nexport const getStartYear = (year: number) => Math.trunc((year - 1) * 0.1) * 10 - 1;\n\nexport const getNextDate = (currentYear: number, currentMonth: number) =>\n currentMonth + 1 === MONTH_NAMES.length ? [currentYear + 1, 0] : [currentYear, currentMonth + 1];\n\nexport const getPrevDate = (currentYear: number, currentMonth: number) =>\n currentMonth - 1 < 0 ? [currentYear - 1, 11] : [currentYear, currentMonth - 1];\n\nexport const getDateFromValue = (date: Date | undefined): DateObject => {\n const state = date || new Date();\n\n return {\n day: date !== undefined ? state.getDate() : 0,\n monthIndex: state.getMonth(),\n year: state.getFullYear(),\n };\n};\n\nexport const getDateFromNow = (): DateObject => {\n const nowDate = new Date();\n\n return {\n day: nowDate.getDate(),\n monthIndex: nowDate.getMonth(),\n year: nowDate.getFullYear(),\n };\n};\n\nexport const IsCurrentDay = (date: DateObject, currentDay: number) => {\n const { day, monthIndex: currentMonthIndex, year: currentYear } = getDateFromNow();\n return day === currentDay && date.monthIndex === currentMonthIndex && date.year === currentYear;\n};\n\nexport const isSelectedDay = (date: DateObject, currentDay: number, value?: Date) => {\n if (!value) {\n return false;\n }\n\n const { day, monthIndex, year } = getDateFromValue(value);\n return day === currentDay && date.monthIndex === monthIndex && date.year === year;\n};\n\nexport const isCurrentMonth = (date: DateObject, monthIndex: number) => {\n const { monthIndex: currentMonthIndex, year: currentYear } = getDateFromNow();\n return monthIndex === currentMonthIndex && date.year === currentYear;\n};\n\nexport const isSelectedMonth = (date: DateObject, monthIndex: number) => date.monthIndex === monthIndex;\n\nexport const isCurrentYear = (year: number) => {\n const { year: currentYear } = getDateFromNow();\n return year === currentYear;\n};\n\nexport const isSelectedYear = (date: DateObject, year: number) => date.year === year;\n\nexport const getSortedValues = (values: [Date | undefined, (Date | undefined)?]) =>\n values.sort((start, end) => {\n if (!start || !end) {\n return -1;\n }\n\n return start.getTime() - end.getTime();\n });\n\nexport const isDayInRange = (\n year: number,\n monthIndex: number,\n currentDay: number,\n values: [Date | undefined, Date?],\n) => {\n const [startValue, endValue] = getSortedValues(values);\n\n if (!endValue || !startValue) {\n return false;\n }\n\n const day = new Date(year, monthIndex, currentDay);\n return startValue < day && day <= endValue;\n};\n\nexport const isSameDay = (firstDate: DateObject, secondDate?: DateObject) =>\n secondDate &&\n firstDate.day === secondDate.day &&\n firstDate.monthIndex === secondDate.monthIndex &&\n firstDate.year === secondDate.year;\n\nexport const isValueUpdate = (value: Date | [Date?, Date?], prevValue: Date | [Date?, Date?]) => {\n if (!Array.isArray(value) && !Array.isArray(prevValue)) {\n return prevValue?.getTime() !== value?.getTime();\n }\n\n if (Array.isArray(value) && Array.isArray(prevValue)) {\n return prevValue[0]?.getTime() !== value[0]?.getTime() || prevValue[1]?.getTime() !== value[1]?.getTime();\n }\n\n return false;\n};\n\n/**\n * Метод проверяет, находится ли календарь в режиме выбора второго значения.\n */\nexport const isSelectProcess = (array: unknown | unknown[]): array is [Date, Date?] =>\n Array.isArray(array) && !array[1];\n\n/**\n * Метод возвращает сторону, когда выбор второго значения диапазона завершён.\n */\nexport const getSideForSelected = (date: DateObject, startValue: Date, endValue: Date) => {\n const currentDateTime = new Date(date.year, date.monthIndex, date.day).getTime();\n const startValueTime = startValue.getTime();\n const endValueTime = endValue.getTime();\n\n if (currentDateTime === startValueTime) {\n return 'right';\n }\n\n if (currentDateTime === endValueTime) {\n return 'left';\n }\n\n return undefined;\n};\n\n/**\n * Метод возвращает сторону, во время выбора второго значения диапазона.\n */\nexport const getSideForHovered = (date: DateObject, hoveredDay: DateObject, startValue: Date, isSelected?: boolean) => {\n const dateHover = new Date(hoveredDay.year, hoveredDay.monthIndex, hoveredDay.day);\n const isHovered = isSameDay(date, hoveredDay);\n\n if ((isSelected && startValue > dateHover) || (isHovered && startValue < dateHover)) {\n return 'left';\n }\n\n if ((isSelected && startValue < dateHover) || (isHovered && startValue > dateHover)) {\n return 'right';\n }\n\n return undefined;\n};\n\n/**\n * Метод возвращает сторону, с которой нужно отрисовать направление полоски диапазона.\n */\nexport const getSideInRange = (\n value: CalendarValueType,\n date: DateObject,\n hoveredDay?: DateObject,\n isSelected?: boolean,\n) => {\n if (!Array.isArray(value)) {\n return undefined;\n }\n\n const [startValue, endValue] = value;\n\n if (startValue && isSelected && endValue) {\n return getSideForSelected(date, startValue, endValue);\n }\n\n if (startValue && hoveredDay) {\n return getSideForHovered(date, hoveredDay, startValue, isSelected);\n }\n\n return undefined;\n};\n\n/**\n * Метод проверяет, находится ли выбранный день в диапазоне.\n */\nexport const getInRange = (value: CalendarValueType, date: DateObject, hoveredDay?: DateObject, inRange?: boolean) => {\n if (!isSelectProcess(value) || !hoveredDay) {\n return inRange;\n }\n\n const dateSelected = value[0];\n const dateHover = new Date(hoveredDay.year, hoveredDay.monthIndex, hoveredDay.day);\n const dateCurrent = new Date(date.year, date.monthIndex, date.day);\n\n if (\n (dateSelected < dateCurrent && dateCurrent < dateHover) ||\n (dateSelected > dateCurrent && dateCurrent > dateHover)\n ) {\n return true;\n }\n\n return inRange;\n};\n\n/**\n * Метод проверяет, можно ли выбрать день.\n */\nexport const canSelectDate = (\n { year, monthIndex, day }: DateObject,\n value: CalendarValueType,\n disabledList?: DisabledDay[],\n) => {\n if (!isSelectProcess(value)) {\n return true;\n }\n\n const hoverDate = new Date(year, monthIndex, day);\n const [startDate] = value;\n\n if (!disabledList?.length) {\n return true;\n }\n\n const offDisabledRange = disabledList.some(\n ({ date }) => (startDate < date && date < hoverDate) || (startDate > date && date > hoverDate),\n );\n\n return !offDisabledRange;\n};\n\n/**\n * Метод для получения двумерного массива и возвращения выбранного элемента.\n */\nexport const getMatrix = <T extends ItemProps>(items: T[], rowSize = 7): readonly [T[][], number[] | undefined] => {\n const newItems = [...items];\n\n let selected: [number, number] | undefined;\n\n const result = newItems.reduce((acc: T[][], item, index) => {\n if (index % rowSize === 0) {\n acc.push([]);\n }\n\n acc[acc.length - 1].push(item);\n\n if (item.isSelected) {\n selected = [acc.length - 1, index % rowSize];\n }\n\n return acc;\n }, []);\n\n return [result, selected] as const;\n};\n\nexport const getCalendarType = (type: CalendarStateType) => {\n switch (type) {\n case 'Months':\n return 'год';\n case 'Years':\n return 'период';\n default:\n return 'месяц';\n }\n};\n"],"names":["ROW_STEP","YEAR_RENDER_COUNT","SHORT_DAY_NAMES","FULL_DAY_NAMES","Пн","Вт","Ср","Чт","Пт","Сб","Вс","SHORT_MONTH_NAME","MONTH_NAMES","getDaysInMonth","monthIndex","year","Date","getDate","getOffsetDayInWeek","getDay","getStartYear","Math","trunc","getNextDate","currentYear","currentMonth","length","getPrevDate","getDateFromValue","date","state","day","undefined","getMonth","getFullYear","getDateFromNow","nowDate","IsCurrentDay","currentDay","_getDateFromNow","currentMonthIndex","isSelectedDay","value","_getDateFromValue","isCurrentMonth","_getDateFromNow2","isSelectedMonth","isCurrentYear","_getDateFromNow3","isSelectedYear","getSortedValues","values","sort","start","end","getTime","isDayInRange","_getSortedValues","_getSortedValues2","_slicedToArray","startValue","endValue","isSameDay","firstDate","secondDate","isValueUpdate","prevValue","Array","isArray","_prevValue$","_value$","_prevValue$2","_value$2","isSelectProcess","array","getSideForSelected","currentDateTime","startValueTime","endValueTime","getSideForHovered","hoveredDay","isSelected","dateHover","isHovered","getSideInRange","_value","getInRange","inRange","dateSelected","dateCurrent","canSelectDate","_ref","disabledList","hoverDate","_value2","startDate","offDisabledRange","some","_ref2","getMatrix","items","rowSize","arguments","newItems","_toConsumableArray","selected","result","reduce","acc","item","index","push","getCalendarType","type"],"mappings":";;AAGO,IAAMA,QAAQ,GAAG,EAAC;AAElB,IAAMC,iBAAiB,GAAG,GAAE;IAEtBC,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAU;AAE3E,IAAMC,cAA8D,GAAG;AAC1EC,EAAAA,EAAE,EAAE,aAAa;AACjBC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,OAAO;AACXC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,SAAS;AACbC,EAAAA,EAAE,EAAE,aAAA;AACR,EAAC;AAEM,IAAMC,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC;AAEhH,IAAMC,WAAW,GAAG,CACvB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACZ;AAE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;AACT,MAAA,OAAO,KAAK,CAAA;AAChB,IAAA,KAAK,OAAO;AACR,MAAA,OAAO,QAAQ,CAAA;AACnB,IAAA;AACI,MAAA,OAAO,OAAO,CAAA;AACtB,GAAA;AACJ;;;;"}
|
@@ -2,7 +2,6 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
|
|
2
2
|
import React, { forwardRef, useState, useRef, useEffect, Children } from 'react';
|
3
3
|
import { safeUseId, useForkRef } from '@salutejs/plasma-core';
|
4
4
|
import { cx } from '../../utils/index.js';
|
5
|
-
import { getPlacements } from '../Dropdown/utils/index.js';
|
6
5
|
import { getChildren, getValues, getNewSelected } from '../Select/utils/index.js';
|
7
6
|
import { useKeyNavigation } from '../Select/hooks/useKeyNavigation.js';
|
8
7
|
import { useForceUpdate } from '../../hooks/useForceUpdate.js';
|
@@ -17,6 +16,7 @@ import 'react-popper';
|
|
17
16
|
import 'styled-components';
|
18
17
|
import { ComboboxTarget } from './ui/ComboboxTarget/ComboboxTarget.js';
|
19
18
|
import { StyledRoot, StyledNativeSelect, StyledPopover, StyledCombobox, ComboboxItemNotFound } from './Combobox.styles.js';
|
19
|
+
import { getPlacements } from '../../utils/getPopoverPlacement.js';
|
20
20
|
|
21
21
|
var _excluded = ["name", "form", "readOnly", "disabled", "label", "placeholder", "id", "children", "role", "view", "size", "frame", "usePortal", "negativeResultContent", "enumerationType", "opened", "placement", "onToggle", "onKeyDown", "filterFunction"];
|
22
22
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import React, { Children, forwardRef, useEffect, useRef, useState } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { getPlacements } from '../Dropdown/utils';\nimport { getChildren, getNewSelected, getValues } from '../Select/utils';\nimport { useKeyNavigation } from '../Select/hooks';\nimport { useDidMountEffect, useForceUpdate } from '../../hooks';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { ComboboxTarget } from './ui';\nimport { ComboboxItemNotFound, StyledPopover, StyledRoot, StyledCombobox, StyledNativeSelect } from './Combobox.styles';\nimport type { ComboboxPrimitiveValue, ComboboxProps } from './Combobox.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, ComboboxProps>) =>\n forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n name,\n form,\n readOnly,\n disabled,\n label,\n placeholder,\n id,\n children,\n role,\n view,\n size,\n frame,\n usePortal,\n negativeResultContent = 'Элементы не найдены',\n enumerationType = 'comma',\n opened = false,\n placement = 'bottom',\n onToggle,\n onKeyDown,\n filterFunction,\n ...rest\n },\n outerRootRef,\n ) => {\n const forceUpdate = useForceUpdate();\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const { valueType = 'single', value } = rest;\n const offset = [0, 4] as [number, number];\n\n const [ref, setRef] = useState<HTMLInputElement | null>(null);\n\n const targetRef = useRef<HTMLInputElement>(null);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n const comboboxRef = useRef<HTMLDivElement>(null);\n const itemsRefs = useRef<Array<HTMLDivElement>>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef<HTMLInputElement>(targetRef, outerRootRef);\n const controlledRefs = { targetRef, chipsRefs, selectRef: comboboxRef, itemsRefs, inputRef };\n\n const [innerOpened, setInnerOpened] = useState(opened);\n const [search, setSearch] = useState<string | undefined>('');\n const [filterValue, setFilterValue] = useState(search);\n\n // INFO: нужно высчитывать для корректной работы портала\n const dynamicTargetWidth = targetRef.current?.offsetWidth;\n\n // INFO: Из-за того, что классы передаются через ref,\n // состояние пропсов после изменения view, size\n // всегда предыдущее, поэтому нужно делать форс-ререндер\n useDidMountEffect(() => {\n forceUpdate();\n }, [view, size]);\n\n useEffect(() => {\n if (disabled || readOnly) {\n return;\n }\n\n setInnerOpened(opened);\n }, [opened, disabled, readOnly]);\n\n useEffect(() => {\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (opened) {\n setFilterValue('');\n }\n }, []);\n\n const onInnerToggle = (openValue: boolean, event: React.SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (!innerOpened) {\n setFilterValue('');\n }\n\n if (onToggle) {\n onToggle(openValue, event);\n\n return;\n }\n\n setInnerOpened(openValue);\n };\n\n const closedWithoutChanges = useRef(true);\n\n const updateValue = (item: HTMLElement, event: React.SyntheticEvent | Event) => {\n const {\n dataset: { value: newValue },\n } = item;\n\n if (rest.valueType === 'multiple') {\n const newSelected = getNewSelected(rest.value, newValue, rest.valueType);\n rest.onChangeValue?.(newSelected);\n\n return;\n }\n\n const newSelected = getNewSelected(rest.value, newValue, 'single');\n\n rest.onChangeValue?.(newSelected);\n\n onInnerToggle?.(false, event);\n\n closedWithoutChanges.current = false;\n };\n\n const onClickChildrenItem = (event: React.MouseEvent<HTMLDivElement>) => {\n // INFO: Для корректной работы компонента Popper\n event.stopPropagation();\n\n const item = event.currentTarget as HTMLElement;\n\n updateValue(item, event);\n };\n\n const onChangeChipValue = (newValue?: Array<ComboboxPrimitiveValue>) => {\n if (rest.valueType !== 'multiple') {\n return;\n }\n\n rest.onChangeValue?.(newValue);\n };\n\n const { onKeyDownTarget, onKeyDownSelect } = useKeyNavigation({\n controlledRefs,\n opened: innerOpened,\n enumerationType,\n valueType,\n componentType: 'combobox',\n value,\n search: filterValue,\n updateOpened: onInnerToggle,\n updateValue,\n });\n\n const childrenArray = Children.toArray(children) as React.ReactElement[];\n\n const childrenMemo = getChildren(\n childrenArray,\n { onClick: onClickChildrenItem, childrenRefs: itemsRefs },\n value,\n filterValue,\n filterFunction,\n ).filter(Boolean);\n\n const values = getValues(childrenArray, value);\n\n const onSearch = (newSearch?: string, newOpened?: boolean) => {\n setSearch(newSearch);\n setFilterValue(newSearch);\n setInnerOpened(newOpened ?? true);\n };\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n onKeyDownTarget(event);\n };\n\n return (\n <StyledRoot ref={comboboxRef}>\n <StyledNativeSelect\n aria-invalid=\"false\"\n aria-hidden=\"true\"\n aria-readonly={readOnly}\n tabIndex={-1}\n form={form}\n name={name}\n value={`${value}`}\n disabled={disabled || readOnly}\n />\n <StyledPopover\n role={role}\n isOpen={innerOpened}\n onToggle={onInnerToggle}\n target={\n <ComboboxTarget\n opened={innerOpened}\n values={values}\n label={label}\n placeholder={placeholder}\n search={search}\n enumerationType={enumerationType}\n valueType={valueType}\n readOnly={readOnly}\n disabled={disabled}\n size={size}\n closedWithoutChanges={closedWithoutChanges}\n ref={handleRef}\n chipsRefs={chipsRefs}\n inputRef={inputRef}\n id={innerId}\n onChange={onChangeChipValue}\n onSearch={onSearch}\n onKeyDown={onKeyDownHandle}\n {...rest}\n />\n }\n className={cx(ref?.classList.toString())} // INFO: Прокидываем стили для Popover\n id={innerId}\n offset={offset}\n placement={getPlacements(placement)}\n usePortal={usePortal}\n selectWidth={dynamicTargetWidth}\n frame={frame}\n trigger=\"click\"\n isFocusTrapped={false}\n preventOverflow={false}\n closeOnEsc={false}\n closeOnOverlayClick\n >\n <Root ref={setRef} view={view} size={size}>\n <StyledCombobox onKeyDown={onKeyDownSelect}>\n {childrenMemo.length ? (\n childrenMemo\n ) : (\n <ComboboxItemNotFound>{negativeResultContent}</ComboboxItemNotFound>\n )}\n </StyledCombobox>\n </Root>\n </StyledPopover>\n </StyledRoot>\n );\n },\n );\n\nexport const comboboxConfig = {\n name: 'Combobox',\n tag: 'div',\n layout: comboboxRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["comboboxRoot","Root","forwardRef","_ref","outerRootRef","_targetRef$current","name","form","readOnly","disabled","label","placeholder","id","children","role","view","size","frame","usePortal","_ref$negativeResultCo","negativeResultContent","_ref$enumerationType","enumerationType","_ref$opened","opened","_ref$placement","placement","onToggle","onKeyDown","filterFunction","rest","_objectWithoutProperties","_excluded","forceUpdate","useForceUpdate","uniqId","safeUseId","innerId","_rest$valueType","valueType","value","offset","_useState","useState","_useState2","_slicedToArray","ref","setRef","targetRef","useRef","chipsRefs","comboboxRef","itemsRefs","inputRef","handleRef","useForkRef","controlledRefs","selectRef","_useState3","_useState4","innerOpened","setInnerOpened","_useState5","_useState6","search","setSearch","_useState7","_useState8","filterValue","setFilterValue","dynamicTargetWidth","current","offsetWidth","useDidMountEffect","useEffect","onInnerToggle","openValue","event","closedWithoutChanges","updateValue","item","_rest$onChangeValue2","newValue","dataset","_rest$onChangeValue","newSelected","getNewSelected","onChangeValue","call","onClickChildrenItem","stopPropagation","currentTarget","onChangeChipValue","_rest$onChangeValue3","_useKeyNavigation","useKeyNavigation","componentType","updateOpened","onKeyDownTarget","onKeyDownSelect","childrenArray","Children","toArray","childrenMemo","getChildren","onClick","childrenRefs","filter","Boolean","values","getValues","onSearch","newSearch","newOpened","onKeyDownHandle","React","createElement","StyledRoot","StyledNativeSelect","tabIndex","concat","StyledPopover","isOpen","target","ComboboxTarget","_extends","onChange","className","cx","classList","toString","getPlacements","selectWidth","trigger","isFocusTrapped","preventOverflow","closeOnEsc","closeOnOverlayClick","StyledCombobox","length","ComboboxItemNotFound","comboboxConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;IACaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAAgD,EAAA;AAAA,EAAA,oBACzEC,UAAU,CACN,UAAAC,IAAA,EAwBIC,YAAY,EACX;AAAA,IAAA,IAAAC,kBAAA,CAAA;AAAA,IAAA,IAvBGC,IAAI,GAAAH,IAAA,CAAJG,IAAI;MACJC,IA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AAEC,IAAAA;KACR;AACDnI,IAAAA,IAAI,EAAE;AACFkI,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtI,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Combobox.js","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import React, { Children, forwardRef, useEffect, useRef, useState } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx, getPlacements } from '../../utils';\nimport { getChildren, getNewSelected, getValues } from '../Select/utils';\nimport { useKeyNavigation } from '../Select/hooks';\nimport { useDidMountEffect, useForceUpdate } from '../../hooks';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { ComboboxTarget } from './ui';\nimport { ComboboxItemNotFound, StyledPopover, StyledRoot, StyledCombobox, StyledNativeSelect } from './Combobox.styles';\nimport type { ComboboxPrimitiveValue, ComboboxProps } from './Combobox.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const comboboxRoot = (Root: RootProps<HTMLInputElement, ComboboxProps>) =>\n forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n name,\n form,\n readOnly,\n disabled,\n label,\n placeholder,\n id,\n children,\n role,\n view,\n size,\n frame,\n usePortal,\n negativeResultContent = 'Элементы не найдены',\n enumerationType = 'comma',\n opened = false,\n placement = 'bottom',\n onToggle,\n onKeyDown,\n filterFunction,\n ...rest\n },\n outerRootRef,\n ) => {\n const forceUpdate = useForceUpdate();\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const { valueType = 'single', value } = rest;\n const offset = [0, 4] as [number, number];\n\n const [ref, setRef] = useState<HTMLInputElement | null>(null);\n\n const targetRef = useRef<HTMLInputElement>(null);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n const comboboxRef = useRef<HTMLDivElement>(null);\n const itemsRefs = useRef<Array<HTMLDivElement>>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n const handleRef = useForkRef<HTMLInputElement>(targetRef, outerRootRef);\n const controlledRefs = { targetRef, chipsRefs, selectRef: comboboxRef, itemsRefs, inputRef };\n\n const [innerOpened, setInnerOpened] = useState(opened);\n const [search, setSearch] = useState<string | undefined>('');\n const [filterValue, setFilterValue] = useState(search);\n\n // INFO: нужно высчитывать для корректной работы портала\n const dynamicTargetWidth = targetRef.current?.offsetWidth;\n\n // INFO: Из-за того, что классы передаются через ref,\n // состояние пропсов после изменения view, size\n // всегда предыдущее, поэтому нужно делать форс-ререндер\n useDidMountEffect(() => {\n forceUpdate();\n }, [view, size]);\n\n useEffect(() => {\n if (disabled || readOnly) {\n return;\n }\n\n setInnerOpened(opened);\n }, [opened, disabled, readOnly]);\n\n useEffect(() => {\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (opened) {\n setFilterValue('');\n }\n }, []);\n\n const onInnerToggle = (openValue: boolean, event: React.SyntheticEvent | Event) => {\n if (disabled || readOnly) {\n return;\n }\n\n // INFO: Для кейсов, когда значение выбрано и нужно вывести весь список\n if (!innerOpened) {\n setFilterValue('');\n }\n\n if (onToggle) {\n onToggle(openValue, event);\n\n return;\n }\n\n setInnerOpened(openValue);\n };\n\n const closedWithoutChanges = useRef(true);\n\n const updateValue = (item: HTMLElement, event: React.SyntheticEvent | Event) => {\n const {\n dataset: { value: newValue },\n } = item;\n\n if (rest.valueType === 'multiple') {\n const newSelected = getNewSelected(rest.value, newValue, rest.valueType);\n rest.onChangeValue?.(newSelected);\n\n return;\n }\n\n const newSelected = getNewSelected(rest.value, newValue, 'single');\n\n rest.onChangeValue?.(newSelected);\n\n onInnerToggle?.(false, event);\n\n closedWithoutChanges.current = false;\n };\n\n const onClickChildrenItem = (event: React.MouseEvent<HTMLDivElement>) => {\n // INFO: Для корректной работы компонента Popper\n event.stopPropagation();\n\n const item = event.currentTarget as HTMLElement;\n\n updateValue(item, event);\n };\n\n const onChangeChipValue = (newValue?: Array<ComboboxPrimitiveValue>) => {\n if (rest.valueType !== 'multiple') {\n return;\n }\n\n rest.onChangeValue?.(newValue);\n };\n\n const { onKeyDownTarget, onKeyDownSelect } = useKeyNavigation({\n controlledRefs,\n opened: innerOpened,\n enumerationType,\n valueType,\n componentType: 'combobox',\n value,\n search: filterValue,\n updateOpened: onInnerToggle,\n updateValue,\n });\n\n const childrenArray = Children.toArray(children) as React.ReactElement[];\n\n const childrenMemo = getChildren(\n childrenArray,\n { onClick: onClickChildrenItem, childrenRefs: itemsRefs },\n value,\n filterValue,\n filterFunction,\n ).filter(Boolean);\n\n const values = getValues(childrenArray, value);\n\n const onSearch = (newSearch?: string, newOpened?: boolean) => {\n setSearch(newSearch);\n setFilterValue(newSearch);\n setInnerOpened(newOpened ?? true);\n };\n\n const onKeyDownHandle = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n onKeyDownTarget(event);\n };\n\n return (\n <StyledRoot ref={comboboxRef}>\n <StyledNativeSelect\n aria-invalid=\"false\"\n aria-hidden=\"true\"\n aria-readonly={readOnly}\n tabIndex={-1}\n form={form}\n name={name}\n value={`${value}`}\n disabled={disabled || readOnly}\n />\n <StyledPopover\n role={role}\n isOpen={innerOpened}\n onToggle={onInnerToggle}\n target={\n <ComboboxTarget\n opened={innerOpened}\n values={values}\n label={label}\n placeholder={placeholder}\n search={search}\n enumerationType={enumerationType}\n valueType={valueType}\n readOnly={readOnly}\n disabled={disabled}\n size={size}\n closedWithoutChanges={closedWithoutChanges}\n ref={handleRef}\n chipsRefs={chipsRefs}\n inputRef={inputRef}\n id={innerId}\n onChange={onChangeChipValue}\n onSearch={onSearch}\n onKeyDown={onKeyDownHandle}\n {...rest}\n />\n }\n className={cx(ref?.classList.toString())} // INFO: Прокидываем стили для Popover\n id={innerId}\n offset={offset}\n placement={getPlacements(placement)}\n usePortal={usePortal}\n selectWidth={dynamicTargetWidth}\n frame={frame}\n trigger=\"click\"\n isFocusTrapped={false}\n preventOverflow={false}\n closeOnEsc={false}\n closeOnOverlayClick\n >\n <Root ref={setRef} view={view} size={size}>\n <StyledCombobox onKeyDown={onKeyDownSelect}>\n {childrenMemo.length ? (\n childrenMemo\n ) : (\n <ComboboxItemNotFound>{negativeResultContent}</ComboboxItemNotFound>\n )}\n </StyledCombobox>\n </Root>\n </StyledPopover>\n </StyledRoot>\n );\n },\n );\n\nexport const comboboxConfig = {\n name: 'Combobox',\n tag: 'div',\n layout: comboboxRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["comboboxRoot","Root","forwardRef","_ref","outerRootRef","_targetRef$current","name","form","readOnly","disabled","label","placeholder","id","children","role","view","size","frame","usePortal","_ref$negativeResultCo","negativeResultContent","_ref$enumerationType","enumerationType","_ref$opened","opened","_ref$placement","placement","onToggle","onKeyDown","filterFunction","rest","_objectWithoutProperties","_excluded","forceUpdate","useForceUpdate","uniqId","safeUseId","innerId","_rest$valueType","valueType","value","offset","_useState","useState","_useState2","_slicedToArray","ref","setRef","targetRef","useRef","chipsRefs","comboboxRef","itemsRefs","inputRef","handleRef","useForkRef","controlledRefs","selectRef","_useState3","_useState4","innerOpened","setInnerOpened","_useState5","_useState6","search","setSearch","_useState7","_useState8","filterValue","setFilterValue","dynamicTargetWidth","current","offsetWidth","useDidMountEffect","useEffect","onInnerToggle","openValue","event","closedWithoutChanges","updateValue","item","_rest$onChangeValue2","newValue","dataset","_rest$onChangeValue","newSelected","getNewSelected","onChangeValue","call","onClickChildrenItem","stopPropagation","currentTarget","onChangeChipValue","_rest$onChangeValue3","_useKeyNavigation","useKeyNavigation","componentType","updateOpened","onKeyDownTarget","onKeyDownSelect","childrenArray","Children","toArray","childrenMemo","getChildren","onClick","childrenRefs","filter","Boolean","values","getValues","onSearch","newSearch","newOpened","onKeyDownHandle","React","createElement","StyledRoot","StyledNativeSelect","tabIndex","concat","StyledPopover","isOpen","target","ComboboxTarget","_extends","onChange","className","cx","classList","toString","getPlacements","selectWidth","trigger","isFocusTrapped","preventOverflow","closeOnEsc","closeOnOverlayClick","StyledCombobox","length","ComboboxItemNotFound","comboboxConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;AACA;AACA;IACaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAAgD,EAAA;AAAA,EAAA,oBACzEC,UAAU,CACN,UAAAC,IAAA,EAwBIC,YAAY,EACX;AAAA,IAAA,IAAAC,kBAAA,CAAA;AAAA,IAAA,IAvBGC,IAAI,GAAAH,IAAA,CAAJG,IAAI;MACJC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MACJC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MACRC,KAAK,GAAAP,IAAA,CAALO,KAAK;MACLC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;MACXC,EAAE,GAAAT,IAAA,CAAFS,EAAE;MACFC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;MACRC,IAAI,GAAAX,IAAA,CAAJW,IAAI;MACJC,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MACJC,IAAI,GAAAb,IAAA,CAAJa,IAAI;MACJC,KAAK,GAAAd,IAAA,CAALc,KAAK;MACLC,SAAS,GAAAf,IAAA,CAATe,SAAS;MAAAC,qBAAA,GAAAhB,IAAA,CACTiB,qBAAqB;AAArBA,MAAAA,qBAAqB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,qBAAqB,GAAAA,qBAAA;MAAAE,oBAAA,GAAAlB,IAAA,CAC7CmB,eAAe;AAAfA,MAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,oBAAA;MAAAE,WAAA,GAAApB,IAAA,CACzB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