@salutejs/plasma-new-hope 0.174.0-canary.1497.11463811587.0 → 0.174.0-canary.1497.11480463527.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
- package/cjs/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
- package/cjs/components/Attach/Attach.js +3 -4
- package/cjs/components/Attach/Attach.js.map +1 -1
- package/cjs/components/Attach/components/AttachButton/AttachButton.js +0 -1
- package/cjs/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
- package/cjs/components/Attach/ui/Button/Button.styles.js +0 -1
- package/cjs/components/Attach/ui/Button/Button.styles.js.map +1 -1
- package/cjs/components/Attach/ui/Cell/Cell.styles.js +0 -2
- package/cjs/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
- package/cjs/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
- package/cjs/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
- package/cjs/components/Attach/utils/getFileicon.js +3 -4
- package/cjs/components/Attach/utils/getFileicon.js.map +1 -1
- package/cjs/components/Attach/utils/index.js +0 -3
- package/cjs/components/Attach/utils/index.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.js +5 -6
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.styles.js +2 -3
- package/cjs/components/Autocomplete/Autocomplete.styles.js.map +1 -1
- package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
- package/cjs/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/Avatar/Avatar.js +2 -3
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
- package/cjs/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/cjs/components/Button/Button.styles.js +0 -3
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +5 -5
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
- package/cjs/components/Calendar/hooks/useDays.js +2 -2
- package/cjs/components/Calendar/hooks/useKeyNavigation.js +1 -1
- package/cjs/components/Calendar/hooks/useMonths.js +2 -2
- package/cjs/components/Calendar/hooks/useQuarters.js +2 -2
- package/cjs/components/Calendar/hooks/useYears.js +2 -2
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +4 -4
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +4 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +4 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +11 -12
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
- package/cjs/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +5 -6
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -3
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.js +4 -11
- package/cjs/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
- package/cjs/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
- package/cjs/components/DatePicker/DatePickerBase.styles.js +1 -7
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
- package/cjs/components/Drawer/Drawer.js +5 -10
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Drawer/Drawer.styles.js +0 -4
- package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
- package/cjs/components/Drawer/hooks/useDrawer.js +0 -4
- package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
- package/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
- package/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.css +1 -1
- package/cjs/components/Dropdown/Dropdown.js +3 -9
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.styles.js +1 -1
- package/cjs/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
- package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
- package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
- package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
- package/cjs/components/Editable/Editable.js +3 -4
- package/cjs/components/Editable/Editable.js.map +1 -1
- package/cjs/components/Editable/utils/clearSelection.js +0 -2
- package/cjs/components/Editable/utils/clearSelection.js.map +1 -1
- package/cjs/components/Editable/utils/selectText.js +0 -2
- package/cjs/components/Editable/utils/selectText.js.map +1 -1
- package/cjs/components/EmptyState/EmptyState.styles.js +1 -2
- package/cjs/components/EmptyState/EmptyState.styles.js.map +1 -1
- package/cjs/components/IconButton/IconButton.js +1 -1
- package/cjs/components/IconButton/IconButton.styles.js +0 -8
- package/cjs/components/IconButton/IconButton.styles.js.map +1 -1
- package/cjs/components/Modal/Modal.js +6 -8
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/hooks/useModal.js +0 -4
- package/cjs/components/Modal/hooks/useModal.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +2 -3
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +3 -4
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Pagination/Pagination.styles.js +1 -2
- package/cjs/components/Pagination/Pagination.styles.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/Popup/Popup.js +2 -2
- package/cjs/components/Popup/PopupContext.js +1 -1
- package/cjs/components/Range/Range.styles.js +0 -1
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
- package/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/cjs/components/Select/Select.js +11 -12
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/Select.styles.js +2 -5
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/hooks/usePathMaps.js +0 -2
- package/cjs/components/Select/hooks/usePathMaps.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.js +1 -2
- package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +4 -5
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Button/Button.js +1 -1
- package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
- package/cjs/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
- package/cjs/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
- package/cjs/components/Select/utils/getButtonLabel.js +0 -2
- package/cjs/components/Select/utils/getButtonLabel.js.map +1 -1
- package/cjs/components/Sheet/Sheet.js +3 -3
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
- package/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
- package/cjs/components/Slider/Slider.js +0 -8
- package/cjs/components/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.js +1 -2
- package/cjs/components/Slider/components/Double/Double.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.styles.js +0 -1
- package/cjs/components/Slider/components/Double/Double.styles.js.map +1 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.js +1 -2
- package/cjs/components/Slider/components/Single/Single.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +1 -1
- package/cjs/components/Steps/Steps.js +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/cjs/components/TextArea/TextArea.js +2 -2
- package/cjs/components/TextArea/TextArea.styles.js +2 -3
- package/cjs/components/TextArea/TextArea.styles.js.map +1 -1
- package/cjs/components/TextArea/ui/Hint/Hint.js +1 -2
- package/cjs/components/TextArea/ui/Hint/Hint.js.map +1 -1
- package/cjs/components/TextField/TextField.js +3 -3
- package/cjs/components/TextField/TextField.styles.js +1 -2
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/ui/Hint/Hint.js +1 -2
- package/cjs/components/TextField/ui/Hint/Hint.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/cjs/components/Toast/Toast.styles.js +1 -1
- package/cjs/components/Toast/ToastController.js +1 -1
- package/cjs/components/Toast/utils.js +1 -2
- package/cjs/components/Toast/utils.js.map +1 -1
- package/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
- package/cjs/components/Tooltip/Tooltip.js +2 -3
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/engines/index.js +0 -2
- package/cjs/engines/index.js.map +1 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/cjs/index.css +1 -1
- package/cjs/index.js +48 -51
- package/cjs/index.js.map +1 -1
- package/cjs/utils/index.js +0 -5
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
- package/emotion/package.json +2 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js +0 -1
- package/es/components/Accordion/ui/AccordionItem/AccordionItem.styles.js.map +1 -1
- package/es/components/Attach/Attach.js +3 -4
- package/es/components/Attach/Attach.js.map +1 -1
- package/es/components/Attach/components/AttachButton/AttachButton.js +0 -1
- package/es/components/Attach/components/AttachButton/AttachButton.js.map +1 -1
- package/es/components/Attach/ui/Button/Button.styles.js +0 -1
- package/es/components/Attach/ui/Button/Button.styles.js.map +1 -1
- package/es/components/Attach/ui/Cell/Cell.styles.js +0 -2
- package/es/components/Attach/ui/Cell/Cell.styles.js.map +1 -1
- package/es/components/Attach/ui/IconButton/IconButton.styles.js +0 -1
- package/es/components/Attach/ui/IconButton/IconButton.styles.js.map +1 -1
- package/es/components/Attach/utils/getFileicon.js +3 -4
- package/es/components/Attach/utils/getFileicon.js.map +1 -1
- package/es/components/Attach/utils/index.js +0 -3
- package/es/components/Attach/utils/index.js.map +1 -1
- package/es/components/Autocomplete/Autocomplete.js +5 -6
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Autocomplete/Autocomplete.styles.js +2 -3
- package/es/components/Autocomplete/Autocomplete.styles.js.map +1 -1
- package/es/components/Autocomplete/ui/TextField/TextField.styles.js +1 -2
- package/es/components/Autocomplete/ui/TextField/TextField.styles.js.map +1 -1
- package/es/components/Avatar/Avatar.js +2 -3
- package/es/components/Avatar/Avatar.js.map +1 -1
- package/es/components/Breadcrumbs/Breadcrumbs.styles.js +2 -4
- package/es/components/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/es/components/Button/Button.styles.js +0 -3
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js +5 -5
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +8 -8
- package/es/components/Calendar/hooks/useDays.js +2 -2
- package/es/components/Calendar/hooks/useKeyNavigation.js +1 -1
- package/es/components/Calendar/hooks/useMonths.js +2 -2
- package/es/components/Calendar/hooks/useQuarters.js +2 -2
- package/es/components/Calendar/hooks/useYears.js +2 -2
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +5 -6
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +0 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +4 -4
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +4 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +4 -4
- package/es/components/Combobox/ComboboxNew/Combobox.js +11 -12
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js +2 -4
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js +0 -2
- package/es/components/Combobox/ComboboxNew/hooks/getPathMaps.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +5 -6
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +1 -3
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js +1 -2
- package/es/components/Combobox/ComboboxNew/ui/Target/Target.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.js +4 -11
- package/es/components/Combobox/ComboboxOld/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.styles.js +0 -1
- package/es/components/Combobox/ComboboxOld/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js +0 -1
- package/es/components/Combobox/ComboboxOld/hooks/useFocusController.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js +1 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxChip/ComboboxChip.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js +1 -11
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js +0 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.js +1 -1
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js +1 -2
- package/es/components/Combobox/ComboboxOld/ui/ComboboxTarget/ComboboxTarget.styles.js.map +1 -1
- package/es/components/DatePicker/DatePickerBase.styles.js +1 -7
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.js +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js +0 -1
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +1 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -1
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +2 -5
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -1
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js +0 -1
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -1
- package/es/components/Drawer/Drawer.js +5 -10
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Drawer/Drawer.styles.js +0 -4
- package/es/components/Drawer/Drawer.styles.js.map +1 -1
- package/es/components/Drawer/hooks/useDrawer.js +0 -4
- package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.js +0 -7
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.js.map +1 -1
- package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +0 -7
- package/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js.map +1 -1
- package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +0 -3
- package/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js.map +1 -1
- package/es/components/Dropdown/Dropdown.css +1 -1
- package/es/components/Dropdown/Dropdown.js +3 -9
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/Dropdown.styles.js +1 -1
- package/es/components/Dropdown/{Dropdown.styles_18f0qpm.css → Dropdown.styles_1ix6io8.css} +1 -1
- package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -8
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -3
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -2
- package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +0 -1
- package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -1
- package/es/components/Editable/Editable.js +3 -4
- package/es/components/Editable/Editable.js.map +1 -1
- package/es/components/Editable/utils/clearSelection.js +0 -2
- package/es/components/Editable/utils/clearSelection.js.map +1 -1
- package/es/components/Editable/utils/selectText.js +0 -2
- package/es/components/Editable/utils/selectText.js.map +1 -1
- package/es/components/EmptyState/EmptyState.styles.js +1 -2
- package/es/components/EmptyState/EmptyState.styles.js.map +1 -1
- package/es/components/IconButton/IconButton.js +1 -1
- package/es/components/IconButton/IconButton.styles.js +0 -8
- package/es/components/IconButton/IconButton.styles.js.map +1 -1
- package/es/components/Modal/Modal.js +6 -8
- package/es/components/Modal/Modal.js.map +1 -1
- package/es/components/Modal/hooks/useModal.js +0 -4
- package/es/components/Modal/hooks/useModal.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +2 -3
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +3 -4
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Pagination/Pagination.styles.js +1 -2
- package/es/components/Pagination/Pagination.styles.js.map +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js.map +1 -1
- package/es/components/Panel/ui/PanelHeader/PanelHeader.js +1 -2
- package/es/components/Panel/ui/PanelHeader/PanelHeader.js.map +1 -1
- package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js +1 -2
- package/es/components/Panel/ui/PanelHeader/PanelHeader.styles.js.map +1 -1
- package/es/components/Popover/Popover.js +1 -1
- package/es/components/Popup/Popup.js +2 -2
- package/es/components/Popup/PopupContext.js +1 -1
- package/es/components/Range/Range.styles.js +0 -1
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js +4 -5
- package/es/components/Segment/ui/SegmentGroup/SegmentGroup.js.map +1 -1
- package/es/components/Select/Select.js +11 -12
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/Select.styles.js +2 -5
- package/es/components/Select/Select.styles.js.map +1 -1
- package/es/components/Select/hooks/usePathMaps.js +0 -2
- package/es/components/Select/hooks/usePathMaps.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.js +1 -2
- package/es/components/Select/ui/Inner/Inner.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +4 -5
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js +0 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Button/Button.js +1 -1
- package/es/components/Select/ui/Target/ui/Button/Button.styles.js +1 -3
- package/es/components/Select/ui/Target/ui/Button/Button.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +2 -2
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -4
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js +1 -2
- package/es/components/Select/ui/Target/ui/Textfield/ui/Chip/Chip.styles.js.map +1 -1
- package/es/components/Select/utils/getButtonLabel.js +0 -2
- package/es/components/Select/utils/getButtonLabel.js.map +1 -1
- package/es/components/Sheet/Sheet.js +3 -3
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js +2 -4
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/es/components/Skeleton/RectSkeleton/RectSkeleton.js +2 -4
- package/es/components/Skeleton/RectSkeleton/RectSkeleton.js.map +1 -1
- package/es/components/Slider/Slider.js +0 -8
- package/es/components/Slider/Slider.js.map +1 -1
- package/es/components/Slider/components/Double/Double.js +1 -2
- package/es/components/Slider/components/Double/Double.js.map +1 -1
- package/es/components/Slider/components/Double/Double.styles.js +0 -1
- package/es/components/Slider/components/Double/Double.styles.js.map +1 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +0 -3
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
- package/es/components/Slider/components/Single/Single.js +1 -2
- package/es/components/Slider/components/Single/Single.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.js +1 -1
- package/es/components/Steps/Steps.js +1 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles.js +0 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js +2 -3
- package/es/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js +2 -3
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.js.map +1 -1
- package/es/components/TextArea/TextArea.js +2 -2
- package/es/components/TextArea/TextArea.styles.js +2 -3
- package/es/components/TextArea/TextArea.styles.js.map +1 -1
- package/es/components/TextArea/ui/Hint/Hint.js +1 -2
- package/es/components/TextArea/ui/Hint/Hint.js.map +1 -1
- package/es/components/TextField/TextField.js +3 -3
- package/es/components/TextField/TextField.styles.js +1 -2
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/ui/Hint/Hint.js +1 -2
- package/es/components/TextField/ui/Hint/Hint.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -2
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/es/components/Toast/Toast.styles.js +1 -1
- package/es/components/Toast/ToastController.js +1 -1
- package/es/components/Toast/utils.js +1 -2
- package/es/components/Toast/utils.js.map +1 -1
- package/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -3
- package/es/components/Tooltip/Tooltip.js.map +1 -1
- package/es/engines/index.js +0 -2
- package/es/engines/index.js.map +1 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +0 -1
- package/es/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/es/index.css +1 -1
- package/es/index.js +21 -24
- package/es/index.js.map +1 -1
- package/es/utils/index.js +0 -3
- package/es/utils/index.js.map +1 -1
- package/package.json +5 -2
- package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +4 -4
- package/styled-components/package.json +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { createContext, forwardRef, useReducer, useRef } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport { pathReducer } from './reducers/pathReducer';\nimport { focusedPathReducer } from './reducers/focusedPathReducer';\nimport { DropdownInner } from './ui';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { Ul, base } from './Dropdown.styles';\nimport { childrenWithProps, getItemByFocused, getItemId, getPlacement } from './utils';\nimport type { DropdownProps, HandleGlobalToggleType, ItemContext } from './Dropdown.types';\nimport { classes } from './Dropdown.tokens';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { useHashMaps } from './hooks/useHashMaps';\nimport { FloatingPopover } from './FloatingPopover';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список.\n */\nexport const dropdownRoot = (Root: RootProps<HTMLDivElement, Omit<DropdownProps, 'items'>>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n items,\n children,\n placement,\n offset,\n closeOnOverlayClick = true,\n onToggle,\n size,\n view,\n itemRole = 'treeitem',\n className,\n listWidth,\n listHeight,\n listOverflow,\n closeOnSelect = true,\n onHover,\n onItemSelect,\n onItemClick,\n trigger = 'click',\n variant = 'normal',\n hasArrow = true,\n portal,\n ...rest\n },\n ref,\n ) => {\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n\n const [pathMap, focusedToValueMap] = useHashMaps(items);\n\n const activeDescendantItemValue = getItemByFocused(focusedPath, focusedToValueMap)?.value || '';\n\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const treeId = safeUseId();\n\n // Логика работы при клике за пределами выпадающего списка\n const targetRef = useOutsideClick<HTMLUListElement>((event) => {\n if (!isCurrentListOpen || !closeOnOverlayClick) {\n return;\n }\n\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n\n if (onToggle) {\n onToggle(false, event);\n }\n }, floatingPopoverRef);\n\n const handleGlobalToggle: HandleGlobalToggleType = (opened, event) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n }\n\n if (onToggle) {\n onToggle(opened, event);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleGlobalToggle,\n closeOnSelect,\n onItemSelect,\n onItemClick,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n return (\n <Context.Provider\n value={{\n focusedPath,\n size,\n variant,\n itemRole,\n handleGlobalToggle,\n closeOnSelect,\n onHover,\n onItemClick,\n onItemSelect,\n hasArrow,\n treeId,\n }}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isCurrentListOpen}\n onToggle={handleGlobalToggle}\n placement={getPlacement(placement)}\n offset={offset}\n portal={portal}\n trigger={trigger}\n target={childrenWithProps(children, {\n role: 'combobox',\n 'aria-controls': `${treeId}_tree_level_1`,\n 'aria-expanded': isCurrentListOpen,\n 'aria-activedescendant': activeDescendantItemValue\n ? getItemId(treeId, activeDescendantItemValue.toString())\n : '',\n onKeyDown,\n })}\n >\n <Root\n className={cx(className, classes.dropdownRoot)}\n ref={ref}\n view={view}\n size={size}\n style={{ display: 'inline-block' }}\n {...rest}\n >\n <Ul\n ref={targetRef}\n id={`${treeId}_tree_level_1`}\n role=\"tree\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n >\n {items.map((item, index) => (\n <DropdownInner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n trigger={trigger}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </Root>\n </FloatingPopover>\n </Context.Provider>\n );\n },\n );\n\nexport const dropdownConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownRoot,\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":["Context","createContext","dropdownRoot","Root","forwardRef","_ref","ref","_getItemByFocused","items","children","placement","offset","_ref$closeOnOverlayCl","closeOnOverlayClick","onToggle","size","view","_ref$itemRole","itemRole","className","listWidth","listHeight","listOverflow","_ref$closeOnSelect","closeOnSelect","onHover","onItemSelect","onItemClick","_ref$trigger","trigger","_ref$variant","variant","_ref$hasArrow","hasArrow","portal","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","pathReducer","_useReducer2","_slicedToArray","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useHashMaps","useHashMaps","_useHashMaps2","pathMap","focusedToValueMap","activeDescendantItemValue","getItemByFocused","value","floatingPopoverRef","useRef","treeId","safeUseId","targetRef","useOutsideClick","event","isCurrentListOpen","type","handleGlobalToggle","opened","_useKeyNavigation","useKeyNavigation","onKeyDown","Boolean","React","createElement","Provider","FloatingPopover","getPlacement","target","childrenWithProps","role","concat","getItemId","toString","_extends","cx","classes","style","display","Ul","id","map","item","index","DropdownInner","key","currentLevel","dropdownConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA6D,EAAA;AAAA,EAAA,oBACtFC,gBAAU,CACN,UAAAC,IAAA,EAyBIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAxBGC,KAAK,GAAAH,IAAA,CAALG,KAAK;MACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,SAAS,GAAAL,IAAA,CAATK,SAAS;MACTC,MAAM,GAAAN,IAAA,CAANM,MAAM;MAAAC,qBAAA,GAAAP,IAAA,CACNQ,mBAAmB;AAAnBA,MAAAA,mBAAmB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,qBAAA;MAC1BE,QAAQ,GAAAT,IAAA,CAARS,QAAQ;MACRC,IAAI,GAAAV,IAAA,CAAJU,IAAI;MACJC,IAAI,GAAAX,IAAA,CAAJW,IAAI;MAAAC,aAAA,GAAAZ,IAAA,CACJa,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,aAAA;MACrBE,SAAS,GAAAd,IAAA,CAATc,SAAS;MACTC,SAAS,GAAAf,IAAA,CAATe,SAAS;MACTC,UAAU,GAAAhB,IAAA,CAAVgB,UAAU;MACVC,YAAY,GAAAjB,IAAA,CAAZiB,YAAY;MAAAC,kBAAA,GAAAlB,IAAA,CACZmB,aAAa;AAAbA,MAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,kBAAA;MACpBE,OAAO,GAAApB,IAAA,CAAPoB,OAAO;MACPC,YAAY,GAAArB,IAAA,CAAZqB,YAAY;MACZC,WAAW,GA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,SAAAA;AAAU,KAAA,EAEpBZ,KAAK,CAACmF,GAAG,CAAC,UAACC,IAAI,EAAEC,KAAK,EAAA;AAAA,MAAA,oBACnBpB,KAAA,CAAAC,aAAA,CAACoB,2BAAa,EAAA;AACVC,QAAAA,GAAG,EAAAd,EAAAA,CAAAA,MAAA,CAAKY,KAAK,EAAK,IAAA,CAAA;AAClBD,QAAAA,IAAI,EAAEA,IAAK;AACXI,QAAAA,YAAY,EAAE,CAAE;AAChBnE,QAAAA,OAAO,EAAEA,OAAQ;AACjBc,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,YAAY,EAAEA,YAAa;AAC3BiD,QAAAA,KAAK,EAAEA,KAAM;AACbxE,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,YAAY,EAAEA,YAAa;AAC3BF,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;AAAA,KACL,CACD,CACF,CACO,CACH,CAAC,CAAA;AAE3B,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM6E,cAAc,GAAG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAElG,YAAY;AACpBmG,EAAAA,IAAI,EAAJA,oBAAI;AACJC,EAAAA,UAAU,EAAE;AACRtF,IAAAA,IAAI,EAAE;AACFuF,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDzF,IAAAA,IAAI,EAAE;AACFwF,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN1F,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React, { createContext, forwardRef, useReducer, useRef } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport { pathReducer } from './reducers/pathReducer';\nimport { focusedPathReducer } from './reducers/focusedPathReducer';\nimport { DropdownInner } from './ui';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { Ul, base } from './Dropdown.styles';\nimport { childrenWithProps, getItemByFocused, getItemId, getPlacement } from './utils';\nimport type { DropdownProps, HandleGlobalToggleType, ItemContext } from './Dropdown.types';\nimport { classes } from './Dropdown.tokens';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\nimport { useHashMaps } from './hooks/useHashMaps';\nimport { FloatingPopover } from './FloatingPopover';\n\nexport const Context = createContext<ItemContext>({} as ItemContext);\n\n/**\n * Выпадающий список.\n */\nexport const dropdownRoot = (Root: RootProps<HTMLDivElement, Omit<DropdownProps, 'items'>>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n items,\n children,\n placement,\n offset,\n closeOnOverlayClick = true,\n onToggle,\n size,\n view,\n itemRole = 'treeitem',\n className,\n listWidth,\n listHeight,\n listOverflow,\n closeOnSelect = true,\n onHover,\n onItemSelect,\n onItemClick,\n trigger = 'click',\n variant = 'normal',\n hasArrow = true,\n portal,\n ...rest\n },\n ref,\n ) => {\n const [path, dispatchPath] = useReducer(pathReducer, []);\n const [focusedPath, dispatchFocusedPath] = useReducer(focusedPathReducer, []);\n\n const [pathMap, focusedToValueMap] = useHashMaps(items);\n\n const activeDescendantItemValue = getItemByFocused(focusedPath, focusedToValueMap)?.value || '';\n\n const floatingPopoverRef = useRef<HTMLDivElement>(null);\n\n const treeId = safeUseId();\n\n // Логика работы при клике за пределами выпадающего списка\n const targetRef = useOutsideClick<HTMLUListElement>((event) => {\n if (!isCurrentListOpen || !closeOnOverlayClick) {\n return;\n }\n\n dispatchPath({ type: 'reset' });\n dispatchFocusedPath({ type: 'reset' });\n\n if (onToggle) {\n onToggle(false, event);\n }\n }, floatingPopoverRef);\n\n const handleGlobalToggle: HandleGlobalToggleType = (opened, event) => {\n if (opened) {\n dispatchPath({ type: 'opened_first_level' });\n } else {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n }\n\n if (onToggle) {\n onToggle(opened, event);\n }\n };\n\n const { onKeyDown } = useKeyNavigation({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleGlobalToggle,\n closeOnSelect,\n onItemSelect,\n onItemClick,\n });\n\n const isCurrentListOpen = Boolean(path[0]);\n\n return (\n <Context.Provider\n value={{\n focusedPath,\n size,\n variant,\n itemRole,\n handleGlobalToggle,\n closeOnSelect,\n onHover,\n onItemClick,\n onItemSelect,\n hasArrow,\n treeId,\n }}\n >\n <FloatingPopover\n ref={floatingPopoverRef}\n opened={isCurrentListOpen}\n onToggle={handleGlobalToggle}\n placement={getPlacement(placement)}\n offset={offset}\n portal={portal}\n trigger={trigger}\n target={childrenWithProps(children, {\n role: 'combobox',\n 'aria-controls': `${treeId}_tree_level_1`,\n 'aria-expanded': isCurrentListOpen,\n 'aria-activedescendant': activeDescendantItemValue\n ? getItemId(treeId, activeDescendantItemValue.toString())\n : '',\n onKeyDown,\n })}\n >\n <Root\n className={cx(className, classes.dropdownRoot)}\n ref={ref}\n view={view}\n size={size}\n style={{ display: 'inline-block' }}\n {...rest}\n >\n <Ul\n ref={targetRef}\n id={`${treeId}_tree_level_1`}\n role=\"tree\"\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n >\n {items.map((item, index) => (\n <DropdownInner\n key={`${index}/0`}\n item={item}\n currentLevel={0}\n trigger={trigger}\n path={path}\n dispatchPath={dispatchPath}\n index={index}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </Root>\n </FloatingPopover>\n </Context.Provider>\n );\n },\n );\n\nexport const dropdownConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownRoot,\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":["Context","createContext","dropdownRoot","Root","forwardRef","_ref","ref","_getItemByFocused","items","children","placement","offset","_ref$closeOnOverlayCl","closeOnOverlayClick","onToggle","size","view","_ref$itemRole","itemRole","className","listWidth","listHeight","listOverflow","_ref$closeOnSelect","closeOnSelect","onHover","onItemSelect","onItemClick","_ref$trigger","trigger","_ref$variant","variant","_ref$hasArrow","hasArrow","portal","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","pathReducer","_useReducer2","_slicedToArray","path","dispatchPath","_useReducer3","focusedPathReducer","_useReducer4","focusedPath","dispatchFocusedPath","_useHashMaps","useHashMaps","_useHashMaps2","pathMap","focusedToValueMap","activeDescendantItemValue","getItemByFocused","value","floatingPopoverRef","useRef","treeId","safeUseId","targetRef","useOutsideClick","event","isCurrentListOpen","type","handleGlobalToggle","opened","_useKeyNavigation","useKeyNavigation","onKeyDown","Boolean","React","createElement","Provider","FloatingPopover","getPlacement","target","childrenWithProps","role","concat","getItemId","toString","_extends","cx","classes","style","display","Ul","id","map","item","index","DropdownInner","key","currentLevel","dropdownConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;IAoBaA,OAAO,gBAAGC,mBAAa,CAAc,EAAiB,EAAC;;AAEpE;AACA;AACA;IACaC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAA6D,EAAA;AAAA,EAAA,oBACtFC,gBAAU,CACN,UAAAC,IAAA,EAyBIC,GAAG,EACF;AAAA,IAAA,IAAAC,iBAAA,CAAA;AAAA,IAAA,IAxBGC,KAAK,GAAAH,IAAA,CAALG,KAAK;MACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,SAAS,GAAAL,IAAA,CAATK,SAAS;MACTC,MAAM,GAAAN,IAAA,CAANM,MAAM;MAAAC,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BF,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;AAAA,KACL,CACD,CACF,CACO,CACH,CAAC,CAAA;AAE3B,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM6E,cAAc,GAAG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAElG,YAAY;AACpBmG,EAAAA,IAAI,EAAJA,oBAAI;AACJC,EAAAA,UAAU,EAAE;AACRtF,IAAAA,IAAI,EAAE;AACFuF,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDzF,IAAAA,IAAI,EAAE;AACFwF,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN1F,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
.un7uamp{box-sizing:border-box;width:var(--un7uamp-0);height:var(--un7uamp-1);margin:var(--un7uamp-2);padding:var(--plasma-dropdown-padding) 0;overflow:var(--un7uamp-3);background:var(--surface-solid-card);box-shadow:0px 4px 14px -4px rgba(8,8,8,0.08),0px 1px 4px -1px rgba(0,0,0,0.04);border-radius:var(--plasma-dropdown-border-radius);}
|
1
|
+
.un7uamp{box-sizing:border-box;width:var(--un7uamp-0);height:var(--un7uamp-1);margin:var(--un7uamp-2);padding:var(--plasma-dropdown-padding) 0;overflow:var(--un7uamp-3);background:var(--surface-solid-card-brightness);box-shadow:0px 4px 14px -4px rgba(8,8,8,0.08),0px 1px 4px -1px rgba(0,0,0,0.04);border-radius:var(--plasma-dropdown-border-radius);}
|
2
2
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownRoot: 'dropdown-root',\n dropdownItemIsFocused: 'dropdown-item-is-focused',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n dropdownItemIsActive: 'dropdown-item-is-active',\n dropdownItemIsSelected: 'dropdown-item-is-selected',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n borderRadius: '--plasma-dropdown-border-radius',\n padding: '--plasma-dropdown-padding',\n disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color', // Old\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginTopTight: '--plasma-dropdown-divider-margin-top-tight',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginBottomTight: '--plasma-dropdown-divider-margin-bottom-tight',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected', // Old\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover', // Old\n itemColor: '--plasma-dropdown-item-color', // Old\n itemColorSelected: '--plasma-dropdown-item-color-selected', // Old\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover', // Old\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemWidth: '--plasma-dropdown-item-width', // Old\n itemHeight: '--plasma-dropdown-item-height', // Old\n itemMarginTop: '--plasma-dropdown-item-margin-top', // Old\n itemMarginRight: '--plasma-dropdown-item-margin-right', // Old\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom', // Old\n itemMarginLeft: '--plasma-dropdown-item-margin-left', // Old\n itemPaddingTop: '--plasma-dropdown-item-padding-top', // Old\n itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight', // Old\n itemPaddingRight: '--plasma-dropdown-item-padding-right', // Old\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom', // Old\n itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight', // Old\n itemPaddingLeft: '--plasma-dropdown-item-padding-left', // Old\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width', // Old\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color', // Old\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width', // Old\n itemContentRightColor: '--plasma-dropdown-item-content-right-color', // Old\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n itemPadding: '--plasma-dropdown-item-padding',\n itemPaddingTight: '--plasma-dropdown-item-padding-tight',\n\n cellPadding: '--plasma-dropdown-cell-padding',\n cellPaddingLeftContent: '--plasma-dropdown-cell-padding-left-content',\n cellPaddingContent: '--plasma-dropdown-cell-padding-content',\n cellPaddingRightContent: '--plasma-dropdown-cell-padding-right-content',\n cellTextboxGap: '--plasma-dropdown-cell-textbox-gap',\n cellGap: '--plasma-dropdown-cell-gap',\n cellTitleFontFamily: '--plasma-dropdown-cell-title-font-family',\n cellTitleFontSize: '--plasma-dropdown-cell-title-font-size',\n cellTitleFontStyle: '--plasma-dropdown-cell-title-font-style',\n cellTitleFontWeight: '--plasma-dropdown-cell-title-font-weight',\n cellTitleLetterSpacing: '--plasma-dropdown-cell-title-letter-spacing',\n cellTitleLineHeight: '--plasma-dropdown-cell-title-line-height',\n\n // TODO: Remove below tokens as soon as they are no longer needed\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n};\n\nexport const constants = {\n focusColor: '--surface-accent',\n background: '--surface-solid-card',\n boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',\n disclosureIconColor: '--text-secondary',\n itemBackground: '--plasma-colors-transparent',\n itemBackgroundHover: '--surface-transparent-secondary',\n opacity: '0.4',\n cellTitleColor: '--text-primary',\n cellBackgroundColor: '--plasma-colors-transparent',\n};\n"],"names":["classes","dropdownRoot","dropdownItemIsFocused","dropdownItemIsDisabled","dropdownItemIsActive","dropdownItemIsSelected","tokens","background","boxShadow","width","borderRadius","padding","disclosureIconColor","disabledOpacity","focusColor","dividerColor","dividerMarginTop","dividerMarginTopTight","dividerMarginRight","dividerMarginBottom","dividerMarginBottomTight","dividerMarginLeft","itemBackground","itemBackgroundHover","itemBackgroundSelected","itemBackgroundSelectedHover","itemColor","itemColorSelected","itemColorSelectedHover","itemBorderRadius","itemWidth","itemHeight","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemPaddingTop","itemPaddingTopTight","itemPaddingRight","itemPaddingBottom","itemPaddingBottomTight","itemPaddingLeft","itemContentLeftWidth","itemContentLeftColor","itemContentRightWidth","itemContentRightColor","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","itemPadding","itemPaddingTight","cellPadding","cellPaddingLeftContent","cellPaddingContent","cellPaddingRightContent","cellTextboxGap","cellGap","cellTitleFontFamily","cellTitleFontSize","cellTitleFontStyle","cellTitleFontWeight","cellTitleLetterSpacing","cellTitleLineHeight","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerWidth","dividerHeight","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupL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1B;;;;;"}
|
1
|
+
{"version":3,"file":"Dropdown.tokens.js","sources":["../../../src/components/Dropdown/Dropdown.tokens.ts"],"sourcesContent":["export const classes = {\n dropdownRoot: 'dropdown-root',\n dropdownItemIsFocused: 'dropdown-item-is-focused',\n dropdownItemIsDisabled: 'dropdown-item-is-disabled',\n dropdownItemIsActive: 'dropdown-item-is-active',\n dropdownItemIsSelected: 'dropdown-item-is-selected',\n};\n\nexport const tokens = {\n background: '--plasma-dropdown-background',\n boxShadow: '--plasma-dropdown-box-shadow',\n width: '--plasma-dropdown-width',\n borderRadius: '--plasma-dropdown-border-radius',\n padding: '--plasma-dropdown-padding',\n disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',\n disabledOpacity: '--plasma-dropdown-disabled-opacity',\n focusColor: '--plasma-dropdown-focus-color', // Old\n\n dividerColor: '--plasma-dropdown-divider-color',\n dividerMarginTop: '--plasma-dropdown-divider-margin-top',\n dividerMarginTopTight: '--plasma-dropdown-divider-margin-top-tight',\n dividerMarginRight: '--plasma-dropdown-divider-margin-right',\n dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',\n dividerMarginBottomTight: '--plasma-dropdown-divider-margin-bottom-tight',\n dividerMarginLeft: '--plasma-dropdown-divider-margin-left',\n\n itemBackground: '--plasma-dropdown-item-background',\n itemBackgroundHover: '--plasma-dropdown-item-background-hover',\n itemBackgroundSelected: '--plasma-dropdown-item-background-selected', // Old\n itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover', // Old\n itemColor: '--plasma-dropdown-item-color', // Old\n itemColorSelected: '--plasma-dropdown-item-color-selected', // Old\n itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover', // Old\n itemBorderRadius: '--plasma-dropdown-item-border-radius',\n itemWidth: '--plasma-dropdown-item-width', // Old\n itemHeight: '--plasma-dropdown-item-height', // Old\n itemMarginTop: '--plasma-dropdown-item-margin-top', // Old\n itemMarginRight: '--plasma-dropdown-item-margin-right', // Old\n itemMarginBottom: '--plasma-dropdown-item-margin-bottom', // Old\n itemMarginLeft: '--plasma-dropdown-item-margin-left', // Old\n itemPaddingTop: '--plasma-dropdown-item-padding-top', // Old\n itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight', // Old\n itemPaddingRight: '--plasma-dropdown-item-padding-right', // Old\n itemPaddingBottom: '--plasma-dropdown-item-padding-bottom', // Old\n itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight', // Old\n itemPaddingLeft: '--plasma-dropdown-item-padding-left', // Old\n itemContentLeftWidth: '--plasma-dropdown-item-content-left-width', // Old\n itemContentLeftColor: '--plasma-dropdown-item-content-left-color', // Old\n itemContentRightWidth: '--plasma-dropdown-item-content-right-width', // Old\n itemContentRightColor: '--plasma-dropdown-item-content-right-color', // Old\n itemFontFamily: '--plasma-dropdown-item-font-family',\n itemFontSize: '--plasma-dropdown-item-font-size',\n itemFontStyle: '--plasma-dropdown-item-font-style',\n itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',\n itemFontLetterSpacing: '--plasma-dropdown-item-line-height',\n itemFontLineHeight: '--plasma-dropdown-item-font-weight',\n itemPadding: '--plasma-dropdown-item-padding',\n itemPaddingTight: '--plasma-dropdown-item-padding-tight',\n\n cellPadding: '--plasma-dropdown-cell-padding',\n cellPaddingLeftContent: '--plasma-dropdown-cell-padding-left-content',\n cellPaddingContent: '--plasma-dropdown-cell-padding-content',\n cellPaddingRightContent: '--plasma-dropdown-cell-padding-right-content',\n cellTextboxGap: '--plasma-dropdown-cell-textbox-gap',\n cellGap: '--plasma-dropdown-cell-gap',\n cellTitleFontFamily: '--plasma-dropdown-cell-title-font-family',\n cellTitleFontSize: '--plasma-dropdown-cell-title-font-size',\n cellTitleFontStyle: '--plasma-dropdown-cell-title-font-style',\n cellTitleFontWeight: '--plasma-dropdown-cell-title-font-weight',\n cellTitleLetterSpacing: '--plasma-dropdown-cell-title-letter-spacing',\n cellTitleLineHeight: '--plasma-dropdown-cell-title-line-height',\n\n // TODO: Remove below tokens as soon as they are no longer needed\n footerBackground: '--plasma-dropdown-footer-background',\n footerWidth: '--plasma-dropdown-footer-width',\n footerHeight: '--plasma-dropdown-footer-height',\n footerPaddingTop: '--plasma-dropdown-footer-padding-top',\n footerPaddingRight: '--plasma-dropdown-footer-padding-right',\n footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',\n footerPaddingLeft: '--plasma-dropdown-footer-padding-left',\n footerMarginTop: '--plasma-dropdown-footer-margin-top',\n footerMarginRight: '--plasma-dropdown-footer-margin-right',\n footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',\n footerMarginLeft: '--plasma-dropdown-footer-margin-left',\n footerFontFamily: '--plasma-dropdown-footer-font-family',\n footerFontSize: '--plasma-dropdown-footer-font-size',\n footerFontStyle: '--plasma-dropdown-footer-font-style',\n footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',\n footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',\n footerFontLineHeight: '--plasma-dropdown-footer-font-weight',\n\n headerBackground: '--plasma-dropdown-header-background',\n headerWidth: '--plasma-dropdown-header-width',\n headerHeight: '--plasma-dropdown-header-height',\n headerPaddingTop: '--plasma-dropdown-header-padding-top',\n headerPaddingRight: '--plasma-dropdown-header-padding-right',\n headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',\n headerPaddingLeft: '--plasma-dropdown-header-padding-left',\n headerMarginTop: '--plasma-dropdown-header-margin-top',\n headerMarginRight: '--plasma-dropdown-header-margin-right',\n headerMarginBottom: '--plasma-dropdown-header-margin-bottom',\n headerMarginLeft: '--plasma-dropdown-header-margin-left',\n headerFontFamily: '--plasma-dropdown-header-font-family',\n headerFontSize: '--plasma-dropdown-header-font-size',\n headerFontStyle: '--plasma-dropdown-header-font-style',\n headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',\n headerFontLetterSpacing: '--plasma-dropdown-header-line-height',\n headerFontLineHeight: '--plasma-dropdown-header-font-weight',\n\n dividerWidth: '--plasma-dropdown-divider-width',\n dividerHeight: '--plasma-dropdown-divider-height',\n\n groupBackground: '--plasma-dropdown-group-background',\n groupWidth: '--plasma-dropdown-group-width',\n groupHeight: '--plasma-dropdown-group-height',\n groupPaddingTop: '--plasma-dropdown-group-padding-top',\n groupPaddingRight: '--plasma-dropdown-group-padding-right',\n groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',\n groupPaddingLeft: '--plasma-dropdown-group-padding-left',\n groupMarginTop: '--plasma-dropdown-group-margin-top',\n groupMarginRight: '--plasma-dropdown-group-margin-right',\n groupMarginBottom: '--plasma-dropdown-group-margin-bottom',\n groupMarginLeft: '--plasma-dropdown-group-margin-left',\n groupLabelColor: '--plasma-dropdown-group-label-color',\n groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',\n groupLabelFontSize: '--plasma-dropdown-group-label-font-size',\n groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',\n groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',\n groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',\n groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',\n groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',\n groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',\n groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',\n groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',\n groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',\n groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',\n groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',\n groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',\n};\n\nexport const constants = {\n focusColor: '--surface-accent',\n background: '--surface-solid-card-brightness',\n boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',\n disclosureIconColor: '--text-secondary',\n itemBackground: '--plasma-colors-transparent',\n itemBackgroundHover: '--surface-transparent-secondary',\n opacity: '0.4',\n cellTitleColor: '--text-primary',\n cellBackgroundColor: '--plasma-colors-transparent',\n};\n"],"names":["classes","dropdownRoot","dropdownItemIsFocused","dropdownItemIsDisabled","dropdownItemIsActive","dropdownItemIsSelected","tokens","background","boxShadow","width","borderRadius","padding","disclosureIconColor","disabledOpacity","focusColor","dividerColor","dividerMarginTop","dividerMarginTopTight","dividerMarginRight","dividerMarginBottom","dividerMarginBottomTight","dividerMarginLeft","itemBackground","itemBackgroundHover","itemBackgroundSelected","itemBackgroundSelectedHover","itemColor","itemColorSelected","itemColorSelectedHover","itemBorderRadius","itemWidth","itemHeight","itemMarginTop","itemMarginRight","itemMarginBottom","itemMarginLeft","itemPaddingTop","itemPaddingTopTight","itemPaddingRight","itemPaddingBottom","itemPaddingBottomTight","itemPaddingLeft","itemContentLeftWidth","itemContentLeftColor","itemContentRightWidth","itemContentRightColor","itemFontFamily","itemFontSize","itemFontStyle","itemFontWeightBold","itemFontLetterSpacing","itemFontLineHeight","itemPadding","itemPaddingTight","cellPadding","cellPaddingLeftContent","cellPaddingContent","cellPaddingRightContent","cellTextboxGap","cellGap","cellTitleFontFamily","cellTitleFontSize","cellTitleFontStyle","cellTitleFontWeight","cellTitleLetterSpacing","cellTitleLineHeight","footerBackground","footerWidth","footerHeight","footerPaddingTop","footerPaddingRight","footerPaddingBottom","footerPaddingLeft","footerMarginTop","footerMarginRight","footerMarginBottom","footerMarginLeft","footerFontFamily","footerFontSize","footerFontStyle","footerFontWeightBold","footerFontLetterSpacing","footerFontLineHeight","headerBackground","headerWidth","headerHeight","headerPaddingTop","headerPaddingRight","headerPaddingBottom","headerPaddingLeft","headerMarginTop","headerMarginRight","headerMarginBottom","headerMarginLeft","headerFontFamily","headerFontSize","headerFontStyle","headerFontWeightBold","headerFontLetterSpacing","headerFontLineHeight","dividerWidth","dividerHeight","groupBackground","groupWidth","groupHeight","groupPaddingTop","groupPaddingRight","groupPaddingBottom","groupPaddingLeft","groupMarginTop","groupMarginRight","groupMarginBottom","groupMarginLeft","groupLabelColor","groupLabelFontFamily","groupLabelFontSize","groupLabelFontStyle","groupLabelFontWeight","groupLabelLetterSpacing","groupLabelLineHeight","groupLabelPaddingTop","groupLabelPaddingRight","groupLabelPaddingBottom","groupLabelPaddingLeft","groupLabelMarginTop","groupLabelMarginRight","groupLabelMarginBottom","groupLabelMarginLeft"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,YAAY,EAAE,eAAe;AAC7BC,EAAAA,qBAAqB,EAAE,0BAA0B;AACjDC,EAAAA,sBAAsB,EAAE,2BAA2B;AACnDC,EAAAA,oBAAoB,EAAE,yBAAyB;AAC/CC,EAAAA,sBAAsB,EAAE,2BAAA;AAC5B,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,SAAS,EAAE,8BAA8B;AACzCC,EAAAA,KAAK,EAAE,yBAAyB;AAChCC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,OAAO,EAAE,2BAA2B;AACpCC,EAAAA,mBAAmB,EAAE,yCAAyC;AAC9DC,EAAAA,eAAe,EAAE,oCAAoC;AACrDC,EAAAA,UAAU,EAAE,+BAA+B;AAAE;;AAE7CC,EAAAA,YAAY,EAAE,iCAAiC;AAC/CC,EAAAA,gBAAgB,EAAE,sCAAsC;AACxDC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,kBAAkB,EAAE,wCAAwC;AAC5DC,EAAAA,mBAAmB,EAAE,yCAAyC;AAC9DC,EAAAA,wBAAwB,EAAE,+CAA+C;AACzEC,EAAAA,iBAAiB,EAAE,uCAAuC;AAE1DC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,mBAAmB,EAAE,yCAAyC;AAC9DC,EAAAA,sBAAsB,EAAE,4CAA4C;AAAE;AACtEC,EAAAA,2BAA2B,EAAE,kDAAkD;AAAE;AACjFC,EAAAA,SAAS,EAAE,8BAA8B;AAAE;AAC3CC,EAAAA,iBAA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AAA,mBAAmB,EAAE,0CAA0C;AAC/DC,EAAAA,qBAAqB,EAAE,4CAA4C;AACnEC,EAAAA,sBAAsB,EAAE,6CAA6C;AACrEC,EAAAA,oBAAoB,EAAE,2CAAA;AAC1B;;;;;"}
|
@@ -4,16 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var React = require('react');
|
6
6
|
var plasmaCore = require('@salutejs/plasma-core');
|
7
|
-
require('@linaria/react');
|
8
|
-
var DropdownItem = require('../DropdownItem/DropdownItem.js');
|
9
7
|
var Dropdown_styles = require('../../Dropdown.styles.js');
|
10
8
|
var FloatingPopover = require('../../FloatingPopover.js');
|
11
|
-
require('
|
12
|
-
require('focus-visible');
|
13
|
-
require('styled-components');
|
14
|
-
require('@linaria/core');
|
15
|
-
require('react-popper');
|
16
|
-
require('react-dom');
|
9
|
+
var DropdownItem = require('../DropdownItem/DropdownItem.js');
|
17
10
|
|
18
11
|
var DropdownInner = function DropdownInner(_ref) {
|
19
12
|
var item = _ref.item,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownInner.js","sources":["../../../../../src/components/Dropdown/ui/DropdownInner/DropdownInner.tsx"],"sourcesContent":["import React from 'react';\nimport type { FC } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { DropdownItem } from '..';\nimport { Ul } from '../../Dropdown.styles';\nimport { FloatingPopover } from '../../FloatingPopover';\n\nimport { DropdownInnerProps } from './DropdownInner.type';\n\nconst DropdownInner: FC<DropdownInnerProps> = ({\n item,\n currentLevel,\n path,\n dispatchPath,\n index,\n trigger,\n listHeight,\n listOverflow,\n listWidth,\n}) => {\n const handleToggle = (opened: boolean): void => {\n if (opened) {\n dispatchPath({ type: 'changed_on_level', value: item.value.toString(), level: currentLevel + 1 });\n } else {\n dispatchPath({ type: 'cut_by_level', level: currentLevel + 1 });\n }\n };\n\n const isCurrentListOpen = path[currentLevel + 1] === item.value.toString();\n\n const treeId = safeUseId();\n const listId = `${treeId}_tree_level_${currentLevel + 2}`;\n const nextLevel = currentLevel + 1;\n\n if (item?.items) {\n return (\n <FloatingPopover\n placement=\"right-start\"\n opened={isCurrentListOpen}\n onToggle={handleToggle}\n trigger={trigger}\n target={\n <DropdownItem\n item={item}\n index={index}\n path={path}\n currentLevel={currentLevel}\n ariaControls={listId}\n ariaExpanded={isCurrentListOpen}\n ariaLevel={nextLevel}\n ariaLabel={item.label}\n />\n }\n isInner\n >\n <Ul\n id={listId}\n role=\"group\"\n isInnerUl\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n >\n {item.items.map((innerItem, innerIndex) => (\n <DropdownInner\n key={`${innerIndex}/${currentLevel}`}\n item={innerItem}\n currentLevel={nextLevel}\n path={path}\n dispatchPath={dispatchPath}\n index={innerIndex}\n trigger={trigger}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </FloatingPopover>\n );\n }\n\n return <DropdownItem item={item} path={path} index={index} currentLevel={currentLevel} ariaLevel={nextLevel} />;\n};\n\nexport { DropdownInner };\n"],"names":["DropdownInner","_ref","item","currentLevel","path","dispatchPath","index","trigger","listHeight","listOverflow","listWidth","handleToggle","opened","type","value","toString","level","isCurrentListOpen","treeId","safeUseId","listId","concat","nextLevel","items","React","createElement","FloatingPopover","placement","onToggle","target","DropdownItem","ariaControls","ariaExpanded","ariaLevel","ariaLabel","label","isInner","Ul","id","role","isInnerUl","map","innerItem","innerIndex","key"],"mappings":"
|
1
|
+
{"version":3,"file":"DropdownInner.js","sources":["../../../../../src/components/Dropdown/ui/DropdownInner/DropdownInner.tsx"],"sourcesContent":["import React from 'react';\nimport type { FC } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { DropdownItem } from '..';\nimport { Ul } from '../../Dropdown.styles';\nimport { FloatingPopover } from '../../FloatingPopover';\n\nimport { DropdownInnerProps } from './DropdownInner.type';\n\nconst DropdownInner: FC<DropdownInnerProps> = ({\n item,\n currentLevel,\n path,\n dispatchPath,\n index,\n trigger,\n listHeight,\n listOverflow,\n listWidth,\n}) => {\n const handleToggle = (opened: boolean): void => {\n if (opened) {\n dispatchPath({ type: 'changed_on_level', value: item.value.toString(), level: currentLevel + 1 });\n } else {\n dispatchPath({ type: 'cut_by_level', level: currentLevel + 1 });\n }\n };\n\n const isCurrentListOpen = path[currentLevel + 1] === item.value.toString();\n\n const treeId = safeUseId();\n const listId = `${treeId}_tree_level_${currentLevel + 2}`;\n const nextLevel = currentLevel + 1;\n\n if (item?.items) {\n return (\n <FloatingPopover\n placement=\"right-start\"\n opened={isCurrentListOpen}\n onToggle={handleToggle}\n trigger={trigger}\n target={\n <DropdownItem\n item={item}\n index={index}\n path={path}\n currentLevel={currentLevel}\n ariaControls={listId}\n ariaExpanded={isCurrentListOpen}\n ariaLevel={nextLevel}\n ariaLabel={item.label}\n />\n }\n isInner\n >\n <Ul\n id={listId}\n role=\"group\"\n isInnerUl\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n >\n {item.items.map((innerItem, innerIndex) => (\n <DropdownInner\n key={`${innerIndex}/${currentLevel}`}\n item={innerItem}\n currentLevel={nextLevel}\n path={path}\n dispatchPath={dispatchPath}\n index={innerIndex}\n trigger={trigger}\n listHeight={listHeight}\n listOverflow={listOverflow}\n listWidth={listWidth}\n />\n ))}\n </Ul>\n </FloatingPopover>\n );\n }\n\n return <DropdownItem item={item} path={path} index={index} currentLevel={currentLevel} ariaLevel={nextLevel} />;\n};\n\nexport { DropdownInner };\n"],"names":["DropdownInner","_ref","item","currentLevel","path","dispatchPath","index","trigger","listHeight","listOverflow","listWidth","handleToggle","opened","type","value","toString","level","isCurrentListOpen","treeId","safeUseId","listId","concat","nextLevel","items","React","createElement","FloatingPopover","placement","onToggle","target","DropdownItem","ariaControls","ariaExpanded","ariaLevel","ariaLabel","label","isInner","Ul","id","role","isInnerUl","map","innerItem","innerIndex","key"],"mappings":";;;;;;;;;;AAUA,I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xBlB,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,KAAK,EAAEqC,UAAW;AAClBpC,QAAAA,OAAO,EAAEA,OAAQ;AACjBC,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,SAAS,EAAEA,SAAAA;AAAU,OACxB,CAAC,CAAA;KACL,CACD,CACS,CAAC,CAAA;AAE1B,GAAA;AAEA,EAAA,oBAAOc,KAAA,CAAAC,aAAA,CAACK,yBAAY,EAAA;AAAC5B,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,IAAI,EAAEA,IAAK;AAACE,IAAAA,KAAK,EAAEA,KAAM;AAACH,IAAAA,YAAY,EAAEA,YAAa;AAAC8B,IAAAA,SAAS,EAAEX,SAAAA;AAAU,GAAE,CAAC,CAAA;AACnH;;;;"}
|
@@ -22,7 +22,7 @@
|
|
22
22
|
.Dropdown_styles_3w3l45_s1rwu6ky__59648b20 .Dropdown_styles_3w3l45_popoverTarget__59648b20{display:block;}
|
23
23
|
.Dropdown_styles_3w3l45_s10jhp3l__59648b20{box-sizing:border-box;background:var(--plasma-dropdown-background);box-shadow:var(--plasma-dropdown-box-shadow);border-radius:var(--plasma-dropdown-border-radius);width:var(--plasma-dropdown-width);height:var(--plasma-dropdown-height);padding:var(--plasma-dropdown-padding-top) var(--plasma-dropdown-padding-right) var(--plasma-dropdown-padding-bottom) var(--plasma-dropdown-padding-left);}
|
24
24
|
|
25
|
-
.
|
25
|
+
.Dropdown_styles_1ix6io8_un7uamp__de6f45f2{box-sizing:border-box;width:var(--un7uamp-0);height:var(--un7uamp-1);margin:var(--un7uamp-2);padding:var(--plasma-dropdown-padding) 0;overflow:var(--un7uamp-3);background:var(--surface-solid-card-brightness);box-shadow:0px 4px 14px -4px rgba(8,8,8,0.08),0px 1px 4px -1px rgba(0,0,0,0.04);border-radius:var(--plasma-dropdown-border-radius);}
|
26
26
|
|
27
27
|
|
28
28
|
.CellTextboxLabel_styles_1x97zqi_supiagz__b05150dd{color:var(--plasma-cell-label-color);font-size:var(--plasma-cell-label-font-size);font-weight:var(--plasma-cell-label-font-weight);font-family:var(--plasma-cell-label-font-family);font-style:var(--plasma-cell-label-font-style);line-height:var(--plasma-cell-label-line-height);-webkit-letter-spacing:var(--plasma-cell-label-letter-spacing);-moz-letter-spacing:var(--plasma-cell-label-letter-spacing);-ms-letter-spacing:var(--plasma-cell-label-letter-spacing);letter-spacing:var(--plasma-cell-label-letter-spacing);}
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var React = require('react');
|
6
6
|
var Dropdown_tokens = require('../../Dropdown.tokens.js');
|
7
7
|
var index = require('../../../../utils/index.js');
|
8
|
-
require('@linaria/react');
|
9
|
-
var IconDisclosureRight = require('../../../_Icon/Icons/IconDisclosureRight.js');
|
10
8
|
var Dropdown = require('../../Dropdown.js');
|
11
|
-
var getItemId = require('../../utils/getItemId.js');
|
12
9
|
var DropdownItem_styles = require('./DropdownItem.styles.js');
|
10
|
+
var getItemId = require('../../utils/getItemId.js');
|
11
|
+
var IconDisclosureRight = require('../../../_Icon/Icons/IconDisclosureRight.js');
|
13
12
|
|
14
13
|
var DropdownItem = function DropdownItem(_ref) {
|
15
14
|
var item = _ref.item,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { classes } from '../../Dropdown.tokens';\nimport { cx } from '../../../../utils';\nimport { IconDisclosureRight } from '../../../_Icon';\nimport { Context } from '../../Dropdown';\nimport { getItemId } from '../../utils';\n\nimport { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';\nimport type { DropdownItemProps } from './DropdownItem.type';\n\nexport const DropdownItem: FC<DropdownItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, isDisabled, contentLeft, contentRight, dividerBefore, dividerAfter } = item;\n\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n size,\n variant,\n itemRole,\n handleGlobalToggle,\n closeOnSelect,\n onHover,\n onItemSelect,\n onItemClick,\n hasArrow,\n treeId,\n } = useContext(Context);\n\n const hasDescendants = Boolean(item.items);\n const disclosureIconSize = size === 'xs' ? 'xs' : 's';\n const isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n if (disabled || isDisabled) {\n return;\n }\n\n if (onItemSelect) {\n onItemSelect(item, event);\n }\n\n if (onItemClick) {\n onItemClick(item, event);\n }\n\n // Закрываем весь дропдаун целиком при клике на айтем без потомков. Только при closeOnSelect === true.\n if (closeOnSelect && !hasDescendants) {\n handleGlobalToggle(false, event);\n }\n };\n\n const handleHover = () => {\n if (onHover) {\n onHover(index);\n }\n };\n\n return (\n <>\n {dividerBefore && <Divider variant={variant} />}\n\n <Wrapper\n ref={ref}\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={getItemId(treeId, value.toString())}\n role={itemRole}\n onClick={handleClick}\n onMouseEnter={handleHover}\n variant={variant}\n aria-disabled={disabled || isDisabled}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n >\n <CellWrapper>\n <StyledCell\n contentLeft={contentLeft}\n contentRight={contentRight}\n alignContentLeft=\"center\"\n alignContentRight=\"center\"\n title={label}\n />\n </CellWrapper>\n\n {item.items && hasArrow && (\n <DisclosureIconWrapper>\n <IconDisclosureRight size={disclosureIconSize} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n\n {dividerAfter && <Divider variant={variant} />}\n </>\n );\n};\n"],"names":["DropdownItem","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","value","label","disabled","isDisabled","contentLeft","contentRight","dividerBefore","dividerAfter","ref","useRef","_useContext","useContext","Context","focusedPath","size","variant","itemRole","handleGlobalToggle","closeOnSelect","onHover","onItemSelect","onItemClick","hasArrow","treeId","hasDescendants","Boolean","items","disclosureIconSize","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleClick","event","handleHover","React","createElement","Fragment","Divider","Wrapper","className","cx","id","getItemId","toString","role","onClick","onMouseEnter","CellWrapper","StyledCell","alignContentLeft","alignContentRight","title","DisclosureIconWrapper","IconDisclosureRight","color"],"mappings":"
|
1
|
+
{"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC, useContext } from 'react';\n\nimport { classes } from '../../Dropdown.tokens';\nimport { cx } from '../../../../utils';\nimport { IconDisclosureRight } from '../../../_Icon';\nimport { Context } from '../../Dropdown';\nimport { getItemId } from '../../utils';\n\nimport { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';\nimport type { DropdownItemProps } from './DropdownItem.type';\n\nexport const DropdownItem: FC<DropdownItemProps> = ({\n item,\n path,\n currentLevel,\n index,\n ariaControls,\n ariaExpanded,\n ariaLevel,\n ariaLabel,\n}) => {\n const { value, label, disabled, isDisabled, contentLeft, contentRight, dividerBefore, dividerAfter } = item;\n\n const ref = useRef<HTMLLIElement | null>(null);\n\n const {\n focusedPath,\n size,\n variant,\n itemRole,\n handleGlobalToggle,\n closeOnSelect,\n onHover,\n onItemSelect,\n onItemClick,\n hasArrow,\n treeId,\n } = useContext(Context);\n\n const hasDescendants = Boolean(item.items);\n const disclosureIconSize = size === 'xs' ? 'xs' : 's';\n const isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n if (disabled || isDisabled) {\n return;\n }\n\n if (onItemSelect) {\n onItemSelect(item, event);\n }\n\n if (onItemClick) {\n onItemClick(item, event);\n }\n\n // Закрываем весь дропдаун целиком при клике на айтем без потомков. Только при closeOnSelect === true.\n if (closeOnSelect && !hasDescendants) {\n handleGlobalToggle(false, event);\n }\n };\n\n const handleHover = () => {\n if (onHover) {\n onHover(index);\n }\n };\n\n return (\n <>\n {dividerBefore && <Divider variant={variant} />}\n\n <Wrapper\n ref={ref}\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={getItemId(treeId, value.toString())}\n role={itemRole}\n onClick={handleClick}\n onMouseEnter={handleHover}\n variant={variant}\n aria-disabled={disabled || isDisabled}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n >\n <CellWrapper>\n <StyledCell\n contentLeft={contentLeft}\n contentRight={contentRight}\n alignContentLeft=\"center\"\n alignContentRight=\"center\"\n title={label}\n />\n </CellWrapper>\n\n {item.items && hasArrow && (\n <DisclosureIconWrapper>\n <IconDisclosureRight size={disclosureIconSize} color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n\n {dividerAfter && <Divider variant={variant} />}\n </>\n );\n};\n"],"names":["DropdownItem","_ref","item","path","currentLevel","index","ariaControls","ariaExpanded","ariaLevel","ariaLabel","value","label","disabled","isDisabled","contentLeft","contentRight","dividerBefore","dividerAfter","ref","useRef","_useContext","useContext","Context","focusedPath","size","variant","itemRole","handleGlobalToggle","closeOnSelect","onHover","onItemSelect","onItemClick","hasArrow","treeId","hasDescendants","Boolean","items","disclosureIconSize","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleClick","event","handleHover","React","createElement","Fragment","Divider","Wrapper","className","cx","id","getItemId","toString","role","onClick","onMouseEnter","CellWrapper","StyledCell","alignContentLeft","alignContentRight","title","DisclosureIconWrapper","IconDisclosureRight","color"],"mappings":";;;;;;;;;;;;IAWaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAS1C;AAAA,EAAA,IARFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,OAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAQC,KAAK,GAA0FR,IAAI,CAAnGQ,KAAK;IAAEC,KAAK,GAAmFT,IAAI,CAA5FS,KAAK;IAAEC,QAAQ,GAAyEV,IAAI,CAArFU,QAAQ;IAAEC,UAAU,GAA6DX,IAAI,CAA3EW,UAAU;IAAEC,WAAW,GAAgDZ,IAAI,CAA/DY,WAAW;IAAEC,YAAY,GAAkCb,IA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7C,CAEtB,CAAC,EAET3D,YAAY,iBAAIuC,KAAA,CAAAC,aAAA,CAACE,2BAAO,EAAA;AAAClC,IAAAA,OAAO,EAAEA,OAAAA;AAAQ,GAAE,CAC/C,CAAC,CAAA;AAEX;;;;"}
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
6
6
|
var react = require('@linaria/react');
|
7
7
|
var Dropdown_tokens = require('../../Dropdown.tokens.js');
|
8
|
-
require('react');
|
9
|
-
var Cell$1 = require('../../../Cell/Cell.js');
|
10
|
-
require('@linaria/core');
|
11
8
|
var common = require('../../../../engines/common.js');
|
9
|
+
var Cell$1 = require('../../../Cell/Cell.js');
|
12
10
|
|
13
11
|
var mergedCellConfig = /*#__PURE__*/common.mergeConfig(Cell$1.cellConfig);
|
14
12
|
var Cell = /*#__PURE__*/common.component(mergedCellConfig);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../Dropdown.tokens';\nimport { addFocus } from '../../../../mixins';\nimport { DropdownProps } from '../../Dropdown.types';\nimport { cellConfig, cellTokens } from '../../../Cell';\nimport { component, mergeConfig } from '../../../../engines';\n\nconst mergedCellConfig = mergeConfig(cellConfig);\nconst Cell = component(mergedCellConfig);\n\nexport const CellWrapper = styled.div`\n ${cellTokens.cellTitleColor}: var(${constants.cellTitleColor});\n ${cellTokens.cellBackgroundColor}: var(${constants.cellBackgroundColor});\n ${cellTokens.cellPadding}: var(${tokens.cellPadding});\n ${cellTokens.cellPaddingLeftContent}: var(${tokens.cellPaddingLeftContent});\n ${cellTokens.cellPaddingContent}: var(${tokens.cellPaddingContent});\n ${cellTokens.cellPaddingRightContent}: var(${tokens.cellPaddingRightContent});\n ${cellTokens.cellTextboxGap}: var(${tokens.cellTextboxGap});\n ${cellTokens.cellGap}: var(${tokens.cellGap});\n ${cellTokens.cellTitleFontFamily}: var(${tokens.cellTitleFontFamily});\n ${cellTokens.cellTitleFontSize}: var(${tokens.cellTitleFontSize});\n ${cellTokens.cellTitleFontStyle}: var(${tokens.cellTitleFontStyle});\n ${cellTokens.cellTitleFontWeight}: var(${tokens.cellTitleFontWeight});\n ${cellTokens.cellTitleLetterSpacing}: var(${tokens.cellTitleLetterSpacing});\n ${cellTokens.cellTitleLineHeight}: var(${tokens.cellTitleLineHeight});\n width: 100%;\n`;\n\nexport const StyledCell = styled(Cell)``;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${constants.disclosureIconColor});\n`;\n\nexport const Divider = styled.div<{ variant: DropdownProps['variant'] }>`\n height: 1px;\n margin-top: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop})`};\n margin-right: var(${tokens.dividerMarginRight});\n margin-bottom: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom})`};\n margin-left: var(${tokens.dividerMarginLeft});\n background: var(${tokens.dividerColor});\n`;\n\nexport const Wrapper = styled.li<{ variant: DropdownProps['variant'] }>`\n display: flex;\n align-items: center;\n min-height: var(${tokens.itemHeight});\n margin: 0;\n box-sizing: content-box;\n padding: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`};\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n background-color: var(${constants.itemBackground});\n border-radius: var(${tokens.borderRadius});\n user-select: none;\n border-right: 0.125rem solid transparent;\n border-left: 0.125rem solid transparent;\n background-clip: padding-box;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background-color: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background-color: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: ${constants.opacity};\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${constants.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${constants.focusColor});\n }\n `,\n })};\n`;\n"],"names":["mergedCellConfig","mergeConfig","cellConfig","Cell","component","CellWrapper","styled","name","class","propsAsIs","_exp29","StyledCell","DisclosureIconWrapper","_exp31","_ref","variant","tokens","dividerMarginTopTight","dividerMarginTop","_exp33","_ref2","dividerMarginBottomTight","dividerMarginBottom","Divider","vars","_exp37","_ref3","itemPaddingTight","itemPadding","Wrapper"],"mappings":"
|
1
|
+
{"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens, constants } from '../../Dropdown.tokens';\nimport { addFocus } from '../../../../mixins';\nimport { DropdownProps } from '../../Dropdown.types';\nimport { cellConfig, cellTokens } from '../../../Cell';\nimport { component, mergeConfig } from '../../../../engines';\n\nconst mergedCellConfig = mergeConfig(cellConfig);\nconst Cell = component(mergedCellConfig);\n\nexport const CellWrapper = styled.div`\n ${cellTokens.cellTitleColor}: var(${constants.cellTitleColor});\n ${cellTokens.cellBackgroundColor}: var(${constants.cellBackgroundColor});\n ${cellTokens.cellPadding}: var(${tokens.cellPadding});\n ${cellTokens.cellPaddingLeftContent}: var(${tokens.cellPaddingLeftContent});\n ${cellTokens.cellPaddingContent}: var(${tokens.cellPaddingContent});\n ${cellTokens.cellPaddingRightContent}: var(${tokens.cellPaddingRightContent});\n ${cellTokens.cellTextboxGap}: var(${tokens.cellTextboxGap});\n ${cellTokens.cellGap}: var(${tokens.cellGap});\n ${cellTokens.cellTitleFontFamily}: var(${tokens.cellTitleFontFamily});\n ${cellTokens.cellTitleFontSize}: var(${tokens.cellTitleFontSize});\n ${cellTokens.cellTitleFontStyle}: var(${tokens.cellTitleFontStyle});\n ${cellTokens.cellTitleFontWeight}: var(${tokens.cellTitleFontWeight});\n ${cellTokens.cellTitleLetterSpacing}: var(${tokens.cellTitleLetterSpacing});\n ${cellTokens.cellTitleLineHeight}: var(${tokens.cellTitleLineHeight});\n width: 100%;\n`;\n\nexport const StyledCell = styled(Cell)``;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${constants.disclosureIconColor});\n`;\n\nexport const Divider = styled.div<{ variant: DropdownProps['variant'] }>`\n height: 1px;\n margin-top: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop})`};\n margin-right: var(${tokens.dividerMarginRight});\n margin-bottom: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom})`};\n margin-left: var(${tokens.dividerMarginLeft});\n background: var(${tokens.dividerColor});\n`;\n\nexport const Wrapper = styled.li<{ variant: DropdownProps['variant'] }>`\n display: flex;\n align-items: center;\n min-height: var(${tokens.itemHeight});\n margin: 0;\n box-sizing: content-box;\n padding: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding})`};\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n background-color: var(${constants.itemBackground});\n border-radius: var(${tokens.borderRadius});\n user-select: none;\n border-right: 0.125rem solid transparent;\n border-left: 0.125rem solid transparent;\n background-clip: padding-box;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background-color: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background-color: var(${constants.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: ${constants.opacity};\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${constants.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${constants.focusColor});\n }\n `,\n })};\n`;\n"],"names":["mergedCellConfig","mergeConfig","cellConfig","Cell","component","CellWrapper","styled","name","class","propsAsIs","_exp29","StyledCell","DisclosureIconWrapper","_exp31","_ref","variant","tokens","dividerMarginTopTight","dividerMarginTop","_exp33","_ref2","dividerMarginBottomTight","dividerMarginBottom","Divider","vars","_exp37","_ref3","itemPaddingTight","itemPadding","Wrapper"],"mappings":";;;;;;;;;AAQA,IAAMA,gBAAgB,gBAAGC,kBAAW,CAACC,iBAAU,CAAC,CAAA;AAChD,IAAMC,IAAI,gBAAGC,gBAAS,CAACJ,gBAAgB,CAAC,CAAA;AAEjC,IAAMK,WAAW,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAgBhC,EAAA;AAAC,IAAAC,MAAA,GA1BgBA,SA0BhBA,MAAAA,GAAA;AAAA,EAAA,OAE+BP,IAAI,CAAA;AAAA,CAAA,CAAA;AAA9B,IAAMQ,UAAU,gBAAGL,YAAM,CAAAI,MAAA,EAAA,CAAA,CAAA;AAAAH,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA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A,EAAA,OAQa,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGX,OAAAA,GAAAA,KAAAA,CAAAA,OAAAA,CAAAA;AAAAA,IAAAA,OAAAA,MAAAA,CAAAA,MAAAA,CAAqBA,OAAO,KAAK,OAAO,GAAGC,sBAAM,CAACW,gBAAgB,GAAGX,sBAAM,CAACY,WAAY,EAAA,GAAA,CAAA,CAAA;GAAE,CAAA;AAAA,CAAA,CAAA;AANrG,IAAMC,OAAO,gBAAGvB,YAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,SAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAe,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAMdC,MAA6F,EAAA,CAAA;AAAA,GAAA;AAAA,CA6C3G;;;;;;;;"}
|
@@ -4,8 +4,6 @@ import './DropdownItem.styles_1lyg81y.css';
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
5
5
|
|
6
6
|
var react = require('@linaria/react');
|
7
|
-
require('focus-visible');
|
8
|
-
require('styled-components');
|
9
7
|
|
10
8
|
var StyledContentLeft = /*#__PURE__*/react.styled('div')({
|
11
9
|
name: "StyledContentLeft",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Dropdown.tokens';\nimport { addFocus, applyEllipsis } from '../../../../mixins';\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n\n min-width: var(${tokens.itemContentLeftWidth});\n color: var(${tokens.itemContentLeftColor});\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n\n min-width: var(${tokens.itemContentRightWidth});\n color: var(${tokens.itemContentRightColor});\n`;\n\nexport const StyledText = styled.div`\n ${applyEllipsis()};\n`;\n\n// INFO: Для возможности переиспользования стилей в других компонентах\nexport const baseContent = `\n box-sizing: content-box;\n display: flex;\n align-items: center;\n user-select: none;\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${tokens.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n })};\n\n width: auto;\n\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n\n background: var(${tokens.itemBackground});\n color: var(${tokens.itemColor});\n border-radius: var(${tokens.itemBorderRadius});\n\n width: var(${tokens.itemWidth});\n height: var(${tokens.itemHeight});\n\n padding: var(${tokens.itemPaddingTop}) var(${tokens.itemPaddingRight}) var(${tokens.itemPaddingBottom})\n var(${tokens.itemPaddingLeft});\n\n margin: var(${tokens.itemMarginTop}) var(${tokens.itemMarginRight}) var(${tokens.itemMarginBottom})\n var(${tokens.itemMarginLeft});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${tokens.itemBackgroundHover});\n }\n\n &.${String(classes.dropdownItemIsSelected)} {\n color: var(${tokens.itemColorSelected});\n background: var(${tokens.itemBackgroundSelected});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n background: var(${tokens.itemBackgroundSelectedHover});\n }\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: var(${tokens.disabledOpacity});\n cursor: not-allowed;\n }\n`;\n\nexport const base = css`\n ${baseContent};\n`;\n"],"names":["StyledContentLeft","styled","name","class","propsAsIs","StyledContentRight","StyledText","base"],"mappings":"
|
1
|
+
{"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Dropdown.tokens';\nimport { addFocus, applyEllipsis } from '../../../../mixins';\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n\n min-width: var(${tokens.itemContentLeftWidth});\n color: var(${tokens.itemContentLeftColor});\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n\n min-width: var(${tokens.itemContentRightWidth});\n color: var(${tokens.itemContentRightColor});\n`;\n\nexport const StyledText = styled.div`\n ${applyEllipsis()};\n`;\n\n// INFO: Для возможности переиспользования стилей в других компонентах\nexport const baseContent = `\n box-sizing: content-box;\n display: flex;\n align-items: center;\n user-select: none;\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${tokens.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n })};\n\n width: auto;\n\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n\n background: var(${tokens.itemBackground});\n color: var(${tokens.itemColor});\n border-radius: var(${tokens.itemBorderRadius});\n\n width: var(${tokens.itemWidth});\n height: var(${tokens.itemHeight});\n\n padding: var(${tokens.itemPaddingTop}) var(${tokens.itemPaddingRight}) var(${tokens.itemPaddingBottom})\n var(${tokens.itemPaddingLeft});\n\n margin: var(${tokens.itemMarginTop}) var(${tokens.itemMarginRight}) var(${tokens.itemMarginBottom})\n var(${tokens.itemMarginLeft});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${tokens.itemBackgroundHover});\n }\n\n &.${String(classes.dropdownItemIsSelected)} {\n color: var(${tokens.itemColorSelected});\n background: var(${tokens.itemBackgroundSelected});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n background: var(${tokens.itemBackgroundSelectedHover});\n }\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: var(${tokens.disabledOpacity});\n cursor: not-allowed;\n }\n`;\n\nexport const base = css`\n ${baseContent};\n`;\n"],"names":["StyledContentLeft","styled","name","class","propsAsIs","StyledContentRight","StyledText","base"],"mappings":";;;;;;AAMO,IAAMA,iBAAiB,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAKtC,EAAA;AAEM,IAAMC,kBAAkB,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAMvC,EAAA;AAEM,IAAME,UAAU,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE/B,EAAA;AA+DM,IAAMG,IAAI,GAEhB;;;;;;;"}
|
@@ -4,7 +4,6 @@ import './Dropdown.styles_3w3l45.css';
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
5
5
|
|
6
6
|
var react = require('@linaria/react');
|
7
|
-
require('@linaria/core');
|
8
7
|
var common = require('../../../../engines/common.js');
|
9
8
|
var Popover$1 = require('../../../Popover/Popover.js');
|
10
9
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownOld/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { component } from '../../../../engines';\nimport { popoverConfig, popoverClasses } from '../../../Popover';\n\nimport { tokens } from './DropdownOld.tokens';\n\n// issue #823\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)`\n .${String(popoverClasses.target)} {\n display: block;\n }\n`;\n\nexport const StyledDropdown = styled.div`\n box-sizing: border-box;\n\n background: var(${tokens.background});\n box-shadow: var(${tokens.boxShadow});\n\n border-radius: var(${tokens.borderRadius});\n width: var(${tokens.width});\n height: var(${tokens.height});\n\n padding: var(${tokens.paddingTop}) var(${tokens.paddingRight}) var(${tokens.paddingBottom})\n var(${tokens.paddingLeft});\n`;\n"],"names":["Popover","component","popoverConfig","_exp","StyledPopover","styled","name","class","propsAsIs","StyledDropdown"],"mappings":"
|
1
|
+
{"version":3,"file":"Dropdown.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownOld/Dropdown.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { component } from '../../../../engines';\nimport { popoverConfig, popoverClasses } from '../../../Popover';\n\nimport { tokens } from './DropdownOld.tokens';\n\n// issue #823\nconst Popover = component(popoverConfig);\n\nexport const StyledPopover = styled(Popover)`\n .${String(popoverClasses.target)} {\n display: block;\n }\n`;\n\nexport const StyledDropdown = styled.div`\n box-sizing: border-box;\n\n background: var(${tokens.background});\n box-shadow: var(${tokens.boxShadow});\n\n border-radius: var(${tokens.borderRadius});\n width: var(${tokens.width});\n height: var(${tokens.height});\n\n padding: var(${tokens.paddingTop}) var(${tokens.paddingRight}) var(${tokens.paddingBottom})\n var(${tokens.paddingLeft});\n`;\n"],"names":["Popover","component","popoverConfig","_exp","StyledPopover","styled","name","class","propsAsIs","StyledDropdown"],"mappings":";;;;;;;;AAOA;AACA,IAAMA,OAAO,gBAAGC,gBAAS,CAACC,uBAAa,CAAC,CAAA;AAAC,IAAAC,IAAA,GAPvBA,SAOuBA,IAAAA,GAAA;AAAA,EAAA,OAELH,OAAO,CAAA;AAAA,CAAA,CAAA;AAApC,IAAMI,aAAa,gBAAGC,YAAM,CAAAF,IAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAIlC,EAAA;AAEM,IAAMC,cAAc,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,gBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAYnC;;;;;"}
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
7
|
var plasmaCore = require('@salutejs/plasma-core');
|
8
|
-
require('../../utils/react.js');
|
9
|
-
var constants = require('../../utils/constants.js');
|
10
|
-
var clearSelection = require('./utils/clearSelection.js');
|
11
|
-
var selectText = require('./utils/selectText.js');
|
12
8
|
var Editable_tokens = require('./Editable.tokens.js');
|
13
9
|
var Editable_styles = require('./Editable.styles.js');
|
14
10
|
var base = require('./variations/_view/base.js');
|
15
11
|
var base$1 = require('./variations/_size/base.js');
|
12
|
+
var clearSelection = require('./utils/clearSelection.js');
|
13
|
+
var selectText = require('./utils/selectText.js');
|
14
|
+
var constants = require('../../utils/constants.js');
|
16
15
|
|
17
16
|
var _excluded = ["textComponent", "value", "icon", "maxLength", "spellCheck", "placeholder", "name", "onChange", "onBlur", "onPaste"];
|
18
17
|
var editableRoot = function editableRoot(typograpyVariants) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Editable.js","sources":["../../../src/components/Editable/Editable.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type {\n ChangeEvent,\n ClipboardEvent,\n FocusEvent,\n ClipboardEventHandler,\n FocusEventHandler,\n FormEventHandler,\n KeyboardEventHandler,\n} from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines';\nimport { constants } from '../../utils';\n\nimport type { EditableProps, TypographyVariants } from './Editable.types';\nimport { clearSelection, selectText } from './utils';\nimport { classes } from './Editable.tokens';\nimport { base, EditButton, StyledInput, StyledPlacehpolder } from './Editable.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\n\nexport const editableRoot = (typograpyVariants: TypographyVariants) => (\n Root: RootProps<HTMLSpanElement, Omit<EditableProps<typeof typograpyVariants>, 'textComponent'>>,\n) =>\n forwardRef<HTMLInputElement, EditableProps<typeof typograpyVariants>>(\n (\n {\n textComponent,\n value,\n icon,\n maxLength,\n spellCheck = 'false',\n placeholder,\n name,\n onChange,\n onBlur,\n onPaste,\n ...props\n },\n outerRef,\n ) => {\n const Component = textComponent;\n\n const [isEditing, setIsEditing] = useState(false);\n\n const inputRef = useRef<HTMLDivElement>(null);\n const innerRef = useForkRef(inputRef, outerRef);\n\n const prevValueRef = useRef(value || '');\n\n const handlePaste: ClipboardEventHandler<HTMLDivElement> = (e) => {\n if (!inputRef.current) {\n return;\n }\n\n e.preventDefault();\n\n const text = e.clipboardData.getData('text/plain').replace(/[\\n\\r]/gi, '');\n\n if (document.queryCommandSupported('insertText')) {\n document.execCommand('insertText', false, text);\n } else {\n try {\n navigator.clipboard.writeText(text);\n } catch {\n inputRef.current.textContent = text;\n }\n }\n\n if (onPaste) {\n onPaste(e as ClipboardEvent<HTMLInputElement>);\n }\n };\n\n const handleBlur: FocusEventHandler<HTMLDivElement> = (e) => {\n setIsEditing(false);\n\n clearSelection();\n\n // NOTE: Remove <br> tag inserted by Safari\n const editableElement = inputRef.current;\n if (editableElement && editableElement.innerHTML === '<br>') {\n editableElement.innerHTML = '';\n }\n\n if (onBlur) {\n onBlur(e as FocusEvent<HTMLInputElement>);\n }\n };\n\n const handleFocus: FocusEventHandler = () => {\n setIsEditing(true);\n\n inputRef.current && selectText(inputRef.current);\n };\n\n const handleEditClick = () => {\n inputRef.current?.focus();\n };\n\n const handleKeyDown: KeyboardEventHandler = (e) => {\n if ([constants.keyCodes.Enter, constants.keyCodes.Escape].includes(e.keyCode)) {\n inputRef.current?.blur();\n }\n };\n\n const handleChange: FormEventHandler = (e) => {\n if (!inputRef.current) {\n return;\n }\n\n const contentLength = inputRef.current.textContent?.length || 0;\n\n if (!maxLength || contentLength <= maxLength) {\n prevValueRef.current = inputRef.current.textContent || '';\n\n onChange && onChange(e as ChangeEvent<HTMLInputElement>);\n } else {\n inputRef.current.textContent = prevValueRef.current;\n }\n };\n\n useEffect(() => {\n if (!inputRef.current || typeof value === 'undefined' || value === inputRef.current.textContent) {\n return;\n }\n\n inputRef.current.textContent = value;\n }, [value, textComponent]);\n\n return (\n <Root {...props}>\n <Component\n ref={innerRef}\n className={classes.editableTextBox}\n role=\"textbox\"\n spellCheck={spellCheck}\n contentEditable\n onPaste={handlePaste}\n onInput={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n aria-label={placeholder}\n />\n {prevValueRef.current?.length === 0 && !isEditing && (\n <Component>\n <StyledPlacehpolder onClick={handleEditClick}>{placeholder}</StyledPlacehpolder>\n </Component>\n )}\n <StyledInput type=\"hidden\" value={prevValueRef.current} name={name} />\n <EditButton onClick={handleEditClick} isHidden={isEditing}>\n {icon}\n </EditButton>\n </Root>\n );\n },\n );\n\nexport const editableConfig = (typographyVariants: TypographyVariants) => ({\n name: 'Editable',\n tag: 'span',\n layout: editableRoot(typographyVariants),\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":["editableRoot","typograpyVariants","Root","forwardRef","_ref","outerRef","_prevValueRef$current","textComponent","value","icon","maxLength","_ref$spellCheck","spellCheck","placeholder","name","onChange","onBlur","onPaste","props","_objectWithoutProperties","_excluded","Component","_useState","useState","_useState2","_slicedToArray","isEditing","setIsEditing","inputRef","useRef","innerRef","useForkRef","prevValueRef","handlePaste","e","current","preventDefault","text","clipboardData","getData","replace","document","queryCommandSupported","execCommand","navigator","clipboard","writeText","_unused","textContent","handleBlur","clearSelection","editableElement","innerHTML","handleFocus","selectText","handleEditClick","_inputRef$current","focus","handleKeyDown","constants","Enter","Escape","includes","keyCode","_inputRef$current2","blur","handleChange","_inputRef$current$tex","contentLength","length","useEffect","React","createElement","ref","className","classes","editableTextBox","role","contentEditable","onInput","onFocus","onKeyDown","StyledPlacehpolder","onClick","StyledInput","type","EditButton","isHidden","editableConfig","typographyVariants","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;IAsBaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,iBAAqC,EAAA;AAAA,EAAA,OAAK,UACnEC,IAAgG,EAAA;AAAA,IAAA,oBAEhGC,gBAAU,CACN,UAAAC,IAAA,EAcIC,QAAQ,EACP;AAAA,MAAA,IAAAC,qBAAA,CAAA;AAAA,MAAA,IAbGC,aAAa,GAAAH,IAAA,CAAbG,aAAa;QACbC,KAAK,GAAAJ,IAAA,CAALI,KAAK;QACLC,IAAI,GAAAL,IAAA,CAAJK,IAAI;QACJC,SAAS,GAAAN,IAAA,CAATM,SAAS;QAAAC,eAAA,GAAAP,IAAA,CACTQ,UAAU;AAAVA,QAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,eAAA;QACpBE,WAAW,GAAAT,IAAA,CAAXS,WAAW;QACXC,IAAI,GAAAV,IAAA,CAAJU,IAAI;QACJC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;QACRC,MAAM,GAAAZ,IAAA,CAANY,MAAM;QACNC,OAAO,GAAAb,IAAA,CAAPa,OAAO;AACJC,QAAAA,KAAK,GAAAC,iDAAA,CAAAf,IAAA,EAAAgB,SAAA,CAAA,CAAA;MAIZ,IAAMC,SAAS,GAAGd,aAAa,CAAA;AAE/B,MAAA,IAAAe,SAAA,GAAkCC,cAAQ,C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AAA,IAAI,EAAJA,oBAAI;AACJC,IAAAA,UAAU,EAAE;AACRC,MAAAA,IAAI,EAAE;AACFC,QAAAA,GAAG,EAAEC,SAAAA;OACR;AACDC,MAAAA,IAAI,EAAE;AACFF,QAAAA,GAAG,EAAEG,WAAAA;AACT,OAAA;KACH;AACDC,IAAAA,QAAQ,EAAE;AACNL,MAAAA,IAAI,EAAE,SAAS;AACfG,MAAAA,IAAI,EAAE,GAAA;AACV,KAAA;GACH,CAAA;AAAA;;;;;"}
|
1
|
+
{"version":3,"file":"Editable.js","sources":["../../../src/components/Editable/Editable.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type {\n ChangeEvent,\n ClipboardEvent,\n FocusEvent,\n ClipboardEventHandler,\n FocusEventHandler,\n FormEventHandler,\n KeyboardEventHandler,\n} from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines';\nimport { constants } from '../../utils';\n\nimport type { EditableProps, TypographyVariants } from './Editable.types';\nimport { clearSelection, selectText } from './utils';\nimport { classes } from './Editable.tokens';\nimport { base, EditButton, StyledInput, StyledPlacehpolder } from './Editable.styles';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\n\nexport const editableRoot = (typograpyVariants: TypographyVariants) => (\n Root: RootProps<HTMLSpanElement, Omit<EditableProps<typeof typograpyVariants>, 'textComponent'>>,\n) =>\n forwardRef<HTMLInputElement, EditableProps<typeof typograpyVariants>>(\n (\n {\n textComponent,\n value,\n icon,\n maxLength,\n spellCheck = 'false',\n placeholder,\n name,\n onChange,\n onBlur,\n onPaste,\n ...props\n },\n outerRef,\n ) => {\n const Component = textComponent;\n\n const [isEditing, setIsEditing] = useState(false);\n\n const inputRef = useRef<HTMLDivElement>(null);\n const innerRef = useForkRef(inputRef, outerRef);\n\n const prevValueRef = useRef(value || '');\n\n const handlePaste: ClipboardEventHandler<HTMLDivElement> = (e) => {\n if (!inputRef.current) {\n return;\n }\n\n e.preventDefault();\n\n const text = e.clipboardData.getData('text/plain').replace(/[\\n\\r]/gi, '');\n\n if (document.queryCommandSupported('insertText')) {\n document.execCommand('insertText', false, text);\n } else {\n try {\n navigator.clipboard.writeText(text);\n } catch {\n inputRef.current.textContent = text;\n }\n }\n\n if (onPaste) {\n onPaste(e as ClipboardEvent<HTMLInputElement>);\n }\n };\n\n const handleBlur: FocusEventHandler<HTMLDivElement> = (e) => {\n setIsEditing(false);\n\n clearSelection();\n\n // NOTE: Remove <br> tag inserted by Safari\n const editableElement = inputRef.current;\n if (editableElement && editableElement.innerHTML === '<br>') {\n editableElement.innerHTML = '';\n }\n\n if (onBlur) {\n onBlur(e as FocusEvent<HTMLInputElement>);\n }\n };\n\n const handleFocus: FocusEventHandler = () => {\n setIsEditing(true);\n\n inputRef.current && selectText(inputRef.current);\n };\n\n const handleEditClick = () => {\n inputRef.current?.focus();\n };\n\n const handleKeyDown: KeyboardEventHandler = (e) => {\n if ([constants.keyCodes.Enter, constants.keyCodes.Escape].includes(e.keyCode)) {\n inputRef.current?.blur();\n }\n };\n\n const handleChange: FormEventHandler = (e) => {\n if (!inputRef.current) {\n return;\n }\n\n const contentLength = inputRef.current.textContent?.length || 0;\n\n if (!maxLength || contentLength <= maxLength) {\n prevValueRef.current = inputRef.current.textContent || '';\n\n onChange && onChange(e as ChangeEvent<HTMLInputElement>);\n } else {\n inputRef.current.textContent = prevValueRef.current;\n }\n };\n\n useEffect(() => {\n if (!inputRef.current || typeof value === 'undefined' || value === inputRef.current.textContent) {\n return;\n }\n\n inputRef.current.textContent = value;\n }, [value, textComponent]);\n\n return (\n <Root {...props}>\n <Component\n ref={innerRef}\n className={classes.editableTextBox}\n role=\"textbox\"\n spellCheck={spellCheck}\n contentEditable\n onPaste={handlePaste}\n onInput={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n aria-label={placeholder}\n />\n {prevValueRef.current?.length === 0 && !isEditing && (\n <Component>\n <StyledPlacehpolder onClick={handleEditClick}>{placeholder}</StyledPlacehpolder>\n </Component>\n )}\n <StyledInput type=\"hidden\" value={prevValueRef.current} name={name} />\n <EditButton onClick={handleEditClick} isHidden={isEditing}>\n {icon}\n </EditButton>\n </Root>\n );\n },\n );\n\nexport const editableConfig = (typographyVariants: TypographyVariants) => ({\n name: 'Editable',\n tag: 'span',\n layout: editableRoot(typographyVariants),\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":["editableRoot","typograpyVariants","Root","forwardRef","_ref","outerRef","_prevValueRef$current","textComponent","value","icon","maxLength","_ref$spellCheck","spellCheck","placeholder","name","onChange","onBlur","onPaste","props","_objectWithoutProperties","_excluded","Component","_useState","useState","_useState2","_slicedToArray","isEditing","setIsEditing","inputRef","useRef","innerRef","useForkRef","prevValueRef","handlePaste","e","current","preventDefault","text","clipboardData","getData","replace","document","queryCommandSupported","execCommand","navigator","clipboard","writeText","_unused","textContent","handleBlur","clearSelection","editableElement","innerHTML","handleFocus","selectText","handleEditClick","_inputRef$current","focus","handleKeyDown","constants","Enter","Escape","includes","keyCode","_inputRef$current2","blur","handleChange","_inputRef$current$tex","contentLength","length","useEffect","React","createElement","ref","className","classes","editableTextBox","role","contentEditable","onInput","onFocus","onKeyDown","StyledPlacehpolder","onClick","StyledInput","type","EditButton","isHidden","editableConfig","typographyVariants","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;IAsBaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,iBAAqC,EAAA;AAAA,EAAA,OAAK,UACnEC,IAAgG,EAAA;AAAA,IAAA,oBAEhGC,gBAAU,CACN,UAAAC,IAAA,EAcIC,QAAQ,EACP;AAAA,MAAA,IAAAC,qBAAA,CAAA;AAAA,MAAA,IAbGC,aAAa,GAAAH,IAAA,CAAbG,aAAa;QACbC,KAAK,GAAAJ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AC,aAAA,CAACY,2BAAW,EAAA;AAACC,QAAAA,IAAI,EAAC,QAAQ;QAAC7E,KAAK,EAAEwB,YAAY,CAACG,OAAQ;AAACrB,QAAAA,IAAI,EAAEA,IAAAA;AAAK,OAAE,CAAC,eACtEyD,KAAA,CAAAC,aAAA,CAACc,0BAAU,EAAA;AAACH,QAAAA,OAAO,EAAE5B,eAAgB;AAACgC,QAAAA,QAAQ,EAAE7D,SAAAA;OAC3CjB,EAAAA,IACO,CACV,CAAC,CAAA;AAEf,KACJ,CAAC,CAAA;AAAA,GAAA,CAAA;AAAA,EAAA;IAEQ+E,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,kBAAsC,EAAA;EAAA,OAAM;AACvE3E,IAAAA,IAAI,EAAE,UAAU;AAChB4E,IAAAA,GAAG,EAAE,MAAM;AACXC,IAAAA,MAAM,EAAE3F,YAAY,CAAmB,CAAC;AACxC4F,IAAAA,IAAI,EAAJA,oBAAI;AACJC,IAAAA,UAAU,EAAE;AACRC,MAAAA,IAAI,EAAE;AACFC,QAAAA,GAAG,EAAEC,SAAAA;OACR;AACDC,MAAAA,IAAI,EAAE;AACFF,QAAAA,GAAG,EAAEG,WAAAA;AACT,OAAA;KACH;AACDC,IAAAA,QAAQ,EAAE;AACNL,MAAAA,IAAI,EAAE,SAAS;AACfG,MAAAA,IAAI,EAAE,GAAA;AACV,KAAA;GACH,CAAA;AAAA;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clearSelection.js","sources":["../../../../src/components/Editable/utils/clearSelection.ts"],"sourcesContent":["import { canUseDOM } from '../../../utils';\n\ninterface CustomDocument extends Document {\n selection?: {\n empty: () => void;\n };\n}\n\nexport const clearSelection = () => {\n if (!canUseDOM) {\n return;\n }\n\n const doc = document as CustomDocument;\n\n if (window.getSelection) {\n window.getSelection()?.removeAllRanges();\n } else if (doc.selection) {\n doc.selection.empty();\n }\n};\n"],"names":["clearSelection","canUseDOM","doc","document","window","getSelection","_window$getSelection","removeAllRanges","selection","empty"],"mappings":"
|
1
|
+
{"version":3,"file":"clearSelection.js","sources":["../../../../src/components/Editable/utils/clearSelection.ts"],"sourcesContent":["import { canUseDOM } from '../../../utils';\n\ninterface CustomDocument extends Document {\n selection?: {\n empty: () => void;\n };\n}\n\nexport const clearSelection = () => {\n if (!canUseDOM) {\n return;\n }\n\n const doc = document as CustomDocument;\n\n if (window.getSelection) {\n window.getSelection()?.removeAllRanges();\n } else if (doc.selection) {\n doc.selection.empty();\n }\n};\n"],"names":["clearSelection","canUseDOM","doc","document","window","getSelection","_window$getSelection","removeAllRanges","selection","empty"],"mappings":";;;;;;IAQaA,cAAc,GAAG,SAAjBA,cAAcA,GAAS;EAChC,IAAI,CAACC,mBAAS,EAAE;AACZ,IAAA,OAAA;AACJ,GAAA;EAEA,IAAMC,GAAG,GAAGC,QAA0B,CAAA;EAEtC,IAAIC,MAAM,CAACC,YAAY,EAAE;AAAA,IAAA,IAAAC,oBAAA,CAAA;AACrB,IAAA,CAAAA,oBAAA,GAAAF,MAAM,CAACC,YAAY,EAAE,MAAAC,IAAAA,IAAAA,oBAAA,KAArBA,KAAAA,CAAAA,IAAAA,oBAAA,CAAuBC,eAAe,EAAE,CAAA;AAC5C,GAAC,MAAM,IAAIL,GAAG,CAACM,SAAS,EAAE;AACtBN,IAAAA,GAAG,CAACM,SAAS,CAACC,KAAK,EAAE,CAAA;AACzB,GAAA;AACJ;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"selectText.js","sources":["../../../../src/components/Editable/utils/selectText.ts"],"sourcesContent":["import { canUseDOM } from '../../../utils';\n\ninterface Body extends HTMLElement {\n createTextRange: () => {\n moveToElementText: (node: Node) => {};\n select: () => {};\n };\n}\n\nexport const selectText = (node: Node) => {\n if (!canUseDOM) {\n return;\n }\n\n setTimeout(() => {\n const body = document.body as Body;\n\n if (window.getSelection && document.createRange) {\n const range = document.createRange();\n range.selectNodeContents(node);\n const selection = window.getSelection();\n selection?.removeAllRanges();\n selection?.addRange(range);\n } else if (body.createTextRange) {\n const range = body.createTextRange();\n range.moveToElementText(node);\n range.select();\n }\n });\n};\n"],"names":["selectText","node","canUseDOM","setTimeout","body","document","window","getSelection","createRange","range","selectNodeContents","selection","removeAllRanges","addRange","createTextRange","moveToElementText","select"],"mappings":"
|
1
|
+
{"version":3,"file":"selectText.js","sources":["../../../../src/components/Editable/utils/selectText.ts"],"sourcesContent":["import { canUseDOM } from '../../../utils';\n\ninterface Body extends HTMLElement {\n createTextRange: () => {\n moveToElementText: (node: Node) => {};\n select: () => {};\n };\n}\n\nexport const selectText = (node: Node) => {\n if (!canUseDOM) {\n return;\n }\n\n setTimeout(() => {\n const body = document.body as Body;\n\n if (window.getSelection && document.createRange) {\n const range = document.createRange();\n range.selectNodeContents(node);\n const selection = window.getSelection();\n selection?.removeAllRanges();\n selection?.addRange(range);\n } else if (body.createTextRange) {\n const range = body.createTextRange();\n range.moveToElementText(node);\n range.select();\n }\n });\n};\n"],"names":["selectText","node","canUseDOM","setTimeout","body","document","window","getSelection","createRange","range","selectNodeContents","selection","removeAllRanges","addRange","createTextRange","moveToElementText","select"],"mappings":";;;;;;IASaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAU,EAAK;EACtC,IAAI,CAACC,mBAAS,EAAE;AACZ,IAAA,OAAA;AACJ,GAAA;AAEAC,EAAAA,UAAU,CAAC,YAAM;AACb,IAAA,IAAMC,IAAI,GAAGC,QAAQ,CAACD,IAAY,CAAA;AAElC,IAAA,IAAIE,MAAM,CAACC,YAAY,IAAIF,QAAQ,CAACG,WAAW,EAAE;AAC7C,MAAA,IAAMC,KAAK,GAAGJ,QAAQ,CAACG,WAAW,EAAE,CAAA;AACpCC,MAAAA,KAAK,CAACC,kBAAkB,CAACT,IAAI,CAAC,CAAA;AAC9B,MAAA,IAAMU,SAAS,GAAGL,MAAM,CAACC,YAAY,EAAE,CAAA;AACvCI,MAAAA,SAAS,aAATA,SAAS,KAAA,KAAA,CAAA,IAATA,SAAS,CAAEC,eAAe,EAAE,CAAA;MAC5BD,SAAS,KAAA,IAAA,IAATA,SAAS,KAATA,KAAAA,CAAAA,IAAAA,SAAS,CAAEE,QAAQ,CAACJ,KAAK,CAAC,CAAA;AAC9B,KAAC,MAAM,IAAIL,IAAI,CAACU,eAAe,EAAE;AAC7B,MAAA,IAAML,MAAK,GAAGL,IAAI,CAACU,eAAe,EAAE,CAAA;AACpCL,MAAAA,MAAK,CAACM,iBAAiB,CAACd,IAAI,CAAC,CAAA;MAC7BQ,MAAK,CAACO,MAAM,EAAE,CAAA;AAClB,KAAA;AACJ,GAAC,CAAC,CAAA;AACN;;;;"}
|
@@ -4,9 +4,8 @@ import './EmptyState.styles_s585zf.css';
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
5
5
|
|
6
6
|
var react = require('@linaria/react');
|
7
|
-
var Button$1 = require('../Button/Button.js');
|
8
|
-
require('@linaria/core');
|
9
7
|
var common = require('../../engines/common.js');
|
8
|
+
var Button$1 = require('../Button/Button.js');
|
10
9
|
|
11
10
|
var mergedButtonConfig = /*#__PURE__*/common.mergeConfig(Button$1.buttonConfig);
|
12
11
|
var Button = /*#__PURE__*/common.component(mergedButtonConfig);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmptyState.styles.js","sources":["../../../src/components/EmptyState/EmptyState.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { buttonConfig, buttonTokens } from '../Button';\nimport { component, mergeConfig } from '../../engines';\n\nimport { tokens } from './EmptyState.tokens';\n\nconst mergedButtonConfig = mergeConfig(buttonConfig);\nconst Button = component(mergedButtonConfig);\n\nexport const base = css`\n display: flex;\n flex-direction: column;\n align-items: center;\n background: var(--surface-solid-card);\n box-shadow: 0 4px 14px -4px rgba(8, 8, 8, 0.08), 0 1px 4px -1px rgba(0, 0, 0, 0.04);\n border-radius: var(${tokens.borderRadius});\n padding: var(${tokens.padding});\n text-align: center;\n`;\n\nexport const StyledButton = styled(Button)`\n ${buttonTokens.buttonColor}: var(--text-primary);\n ${buttonTokens.buttonColorActive}: var(--text-primary-active);\n ${buttonTokens.buttonColorHover}: var(--text-primary-hover);\n ${buttonTokens.buttonBackgroundColor}: none;\n ${buttonTokens.buttonPadding}: 0;\n ${buttonTokens.buttonHeight}: var(${tokens.buttonHeight});\n ${buttonTokens.buttonRadius}: 0;\n ${buttonTokens.buttonFontFamily}: var(${tokens.fontFamily});\n ${buttonTokens.buttonFontSize}: var(${tokens.fontSize});\n ${buttonTokens.buttonFontStyle}: var(${tokens.fontStyle});\n ${buttonTokens.buttonFontWeight}: 600;\n ${buttonTokens.buttonLetterSpacing}: var(${tokens.fontLetterSpacing});\n ${buttonTokens.buttonLineHeight}: var(${tokens.fontLineHeight});\n margin: var(${tokens.buttonMargin});\n`;\n\nexport const IconWrapper = styled.div`\n margin: var(${tokens.iconMargin});\n line-height: 0;\n`;\n\nexport const Description = styled.div`\n margin: var(${tokens.descriptionMargin});\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n"],"names":["mergedButtonConfig","mergeConfig","buttonConfig","Button","component","base","_exp3","StyledButton","styled","name","class","propsAsIs","IconWrapper","Description"],"mappings":"
|
1
|
+
{"version":3,"file":"EmptyState.styles.js","sources":["../../../src/components/EmptyState/EmptyState.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { buttonConfig, buttonTokens } from '../Button';\nimport { component, mergeConfig } from '../../engines';\n\nimport { tokens } from './EmptyState.tokens';\n\nconst mergedButtonConfig = mergeConfig(buttonConfig);\nconst Button = component(mergedButtonConfig);\n\nexport const base = css`\n display: flex;\n flex-direction: column;\n align-items: center;\n background: var(--surface-solid-card);\n box-shadow: 0 4px 14px -4px rgba(8, 8, 8, 0.08), 0 1px 4px -1px rgba(0, 0, 0, 0.04);\n border-radius: var(${tokens.borderRadius});\n padding: var(${tokens.padding});\n text-align: center;\n`;\n\nexport const StyledButton = styled(Button)`\n ${buttonTokens.buttonColor}: var(--text-primary);\n ${buttonTokens.buttonColorActive}: var(--text-primary-active);\n ${buttonTokens.buttonColorHover}: var(--text-primary-hover);\n ${buttonTokens.buttonBackgroundColor}: none;\n ${buttonTokens.buttonPadding}: 0;\n ${buttonTokens.buttonHeight}: var(${tokens.buttonHeight});\n ${buttonTokens.buttonRadius}: 0;\n ${buttonTokens.buttonFontFamily}: var(${tokens.fontFamily});\n ${buttonTokens.buttonFontSize}: var(${tokens.fontSize});\n ${buttonTokens.buttonFontStyle}: var(${tokens.fontStyle});\n ${buttonTokens.buttonFontWeight}: 600;\n ${buttonTokens.buttonLetterSpacing}: var(${tokens.fontLetterSpacing});\n ${buttonTokens.buttonLineHeight}: var(${tokens.fontLineHeight});\n margin: var(${tokens.buttonMargin});\n`;\n\nexport const IconWrapper = styled.div`\n margin: var(${tokens.iconMargin});\n line-height: 0;\n`;\n\nexport const Description = styled.div`\n margin: var(${tokens.descriptionMargin});\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.fontLetterSpacing});\n line-height: var(${tokens.fontLineHeight});\n`;\n"],"names":["mergedButtonConfig","mergeConfig","buttonConfig","Button","component","base","_exp3","StyledButton","styled","name","class","propsAsIs","IconWrapper","Description"],"mappings":";;;;;;;;AAQA,IAAMA,kBAAkB,gBAAGC,kBAAW,CAACC,qBAAY,CAAC,CAAA;AACpD,IAAMC,MAAM,gBAAGC,gBAAS,CAACJ,kBAAkB,CAAC,CAAA;AAErC,IAAMK,IAAI,GAShB,UAAA;AAAC,IAAAC,KAAA,GAnBgBA,SAmBhBA,KAAAA,GAAA;AAAA,EAAA,OAEiCH,MAAM,CAAA;AAAA,CAAA,CAAA;AAAlC,IAAMI,YAAY,gBAAGC,YAAM,CAAAF,KAAA,EAAA,CAAA,CAAA;AAAAG,EAAAA,IAAA,EAAA,cAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,IAAA;AAAA,CAejC,EAAA;AAEM,IAAMC,WAAW,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAGhC,EAAA;AAEM,IAAME,WAAW,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAQhC;;;;;;;"}
|