@skbkontur/react-ui 6.0.2 → 6.0.4-46247.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +6 -8
- package/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/components/Autocomplete/Autocomplete.js +16 -16
- package/components/Autocomplete/Autocomplete.js.map +1 -1
- package/components/Autocomplete/getAutocompleteTheme.js.map +1 -1
- package/components/Autocomplete/locale/index.js.map +1 -1
- package/components/Button/Button.d.ts +3 -3
- package/components/Button/Button.js +9 -9
- package/components/Button/Button.js.map +1 -1
- package/components/Button/Button.styles.js +2 -2
- package/components/Button/Button.styles.js.map +1 -1
- package/components/Button/ButtonArrow.d.ts +1 -1
- package/components/Button/ButtonArrow.js +2 -2
- package/components/Button/ButtonArrow.js.map +1 -1
- package/components/Button/ButtonIcon.js +1 -1
- package/components/Button/ButtonIcon.js.map +1 -1
- package/components/Button/LoadingButtonIcon.js +1 -1
- package/components/Button/LoadingButtonIcon.js.map +1 -1
- package/components/Button/getInnerLinkTheme.js.map +1 -1
- package/components/Calendar/Calendar.d.ts +2 -2
- package/components/Calendar/Calendar.js +13 -13
- package/components/Calendar/Calendar.js.map +1 -1
- package/components/Calendar/CalendarContext.d.ts +1 -1
- package/components/Calendar/CalendarContext.js.map +1 -1
- package/components/Calendar/CalendarDay.d.ts +1 -2
- package/components/Calendar/CalendarDay.js +7 -7
- package/components/Calendar/CalendarDay.js.map +1 -1
- package/components/Calendar/CalendarUtils.d.ts +2 -2
- package/components/Calendar/CalendarUtils.js +1 -1
- package/components/Calendar/CalendarUtils.js.map +1 -1
- package/components/Calendar/DayCellView.js +2 -2
- package/components/Calendar/DayCellView.js.map +1 -1
- package/components/Calendar/DayCellView.styles.js +1 -1
- package/components/Calendar/DayCellView.styles.js.map +1 -1
- package/components/Calendar/Month.js +4 -4
- package/components/Calendar/Month.js.map +1 -1
- package/components/Calendar/MonthView.js +5 -5
- package/components/Calendar/MonthView.js.map +1 -1
- package/components/Calendar/MonthViewModel.js.map +1 -1
- package/components/Calendar/config.js.map +1 -1
- package/components/Center/Center.d.ts +1 -1
- package/components/Center/Center.js +1 -1
- package/components/Center/Center.js.map +1 -1
- package/components/Checkbox/Checkbox.d.ts +1 -1
- package/components/Checkbox/Checkbox.js +5 -5
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/Checkbox.styles.js.map +1 -1
- package/components/Checkbox/CheckedIcon.js +1 -1
- package/components/Checkbox/CheckedIcon.js.map +1 -1
- package/components/ComboBox/ComboBox.d.ts +3 -3
- package/components/ComboBox/ComboBox.js +1 -1
- package/components/ComboBox/ComboBox.js.map +1 -1
- package/components/CurrencyInput/CurrencyHelper.js +1 -1
- package/components/CurrencyInput/CurrencyHelper.js.map +1 -1
- package/components/CurrencyInput/CurrencyInput.d.ts +2 -2
- package/components/CurrencyInput/CurrencyInput.js +6 -6
- package/components/CurrencyInput/CurrencyInput.js.map +1 -1
- package/components/CurrencyInput/CurrencyInputHelper.js.map +1 -1
- package/components/CurrencyLabel/CurrencyLabel.js +2 -2
- package/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
- package/components/DateInput/DateFragmentsView.d.ts +1 -1
- package/components/DateInput/DateFragmentsView.js +1 -1
- package/components/DateInput/DateFragmentsView.js.map +1 -1
- package/components/DateInput/DateInput.d.ts +1 -1
- package/components/DateInput/DateInput.js +8 -8
- package/components/DateInput/DateInput.js.map +1 -1
- package/components/DateInput/helpers/InternalDateMediator.js.map +1 -1
- package/components/DatePicker/DatePicker.d.ts +2 -2
- package/components/DatePicker/DatePicker.js +16 -16
- package/components/DatePicker/DatePicker.js.map +1 -1
- package/components/DatePicker/DatePicker.styles.js.map +1 -1
- package/components/DatePicker/MobilePicker.js +6 -6
- package/components/DatePicker/MobilePicker.js.map +1 -1
- package/components/DatePicker/getMobilePickerTheme.js.map +1 -1
- package/components/DatePicker/locale/index.js.map +1 -1
- package/components/DatePicker/locale/locales/en.js +1 -1
- package/components/DatePicker/locale/locales/en.js.map +1 -1
- package/components/DatePicker/locale/locales/ru.js +1 -1
- package/components/DatePicker/locale/locales/ru.js.map +1 -1
- package/components/DateRangePicker/DateRangePicker.d.ts +19 -19
- package/components/DateRangePicker/DateRangePicker.js +17 -17
- package/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/components/DateRangePicker/DateRangePicker.styles.d.ts +1 -1
- package/components/DateRangePicker/DateRangePicker.styles.js.map +1 -1
- package/components/DateRangePicker/DateRangePickerContext.d.ts +1 -1
- package/components/DateRangePicker/DateRangePickerContext.js.map +1 -1
- package/components/DateRangePicker/DateRangePickerInput.d.ts +1 -1
- package/components/DateRangePicker/DateRangePickerInput.js +3 -3
- package/components/DateRangePicker/DateRangePickerInput.js.map +1 -1
- package/components/DateRangePicker/DateRangePickerTheme.js.map +1 -1
- package/components/DateRangePicker/helpers/getStateForValue.js +2 -2
- package/components/DateRangePicker/helpers/getStateForValue.js.map +1 -1
- package/components/DateRangePicker/helpers/validateDateRangePicker.js +3 -3
- package/components/DateRangePicker/helpers/validateDateRangePicker.js.map +1 -1
- package/components/DateRangePicker/locale/index.js.map +1 -1
- package/components/DateRangePicker/locale/locales/en.js.map +1 -1
- package/components/DateRangePicker/locale/locales/ru.js.map +1 -1
- package/components/Dropdown/Dropdown.d.ts +2 -2
- package/components/Dropdown/Dropdown.js +3 -3
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/getDropdownTheme.js.map +1 -1
- package/components/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/components/DropdownMenu/DropdownMenu.js +3 -3
- package/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/components/DropdownMenu/getDropdownMenuTheme.js.map +1 -1
- package/components/FileUploader/FileUploader.d.ts +5 -5
- package/components/FileUploader/FileUploader.js +22 -20
- package/components/FileUploader/FileUploader.js.map +1 -1
- package/components/FileUploader/FileUploader.styles.js.map +1 -1
- package/components/FileUploader/FileUploaderControlContext.d.ts +1 -1
- package/components/FileUploader/FileUploaderControlContext.js.map +1 -1
- package/components/FileUploader/FileUploaderControlProvider.d.ts +1 -1
- package/components/FileUploader/FileUploaderControlProvider.js +3 -3
- package/components/FileUploader/FileUploaderControlProvider.js.map +1 -1
- package/components/FileUploader/FileUploaderFile.js +11 -11
- package/components/FileUploader/FileUploaderFile.js.map +1 -1
- package/components/FileUploader/FileUploaderFileList/FileUploaderFileList.d.ts +1 -1
- package/components/FileUploader/FileUploaderFileList/FileUploaderFileList.js +5 -5
- package/components/FileUploader/FileUploaderFileList/FileUploaderFileList.js.map +1 -1
- package/components/FileUploader/FileUploaderFileStatusIcon.js +3 -3
- package/components/FileUploader/FileUploaderFileStatusIcon.js.map +1 -1
- package/components/FileUploader/FileUploaderFileTypeIcon.js +4 -4
- package/components/FileUploader/FileUploaderFileTypeIcon.js.map +1 -1
- package/components/FileUploader/fileUtils.js.map +1 -1
- package/components/FileUploader/hooks/useUpload.js +1 -1
- package/components/FileUploader/hooks/useUpload.js.map +1 -1
- package/components/FileUploader/icons/UploadIcon.js +1 -1
- package/components/FileUploader/icons/UploadIcon.js.map +1 -1
- package/components/FileUploader/icons/row/ArchiveIcon.js +1 -1
- package/components/FileUploader/icons/row/ArchiveIcon.js.map +1 -1
- package/components/FileUploader/icons/row/DocTextIcon.js +1 -1
- package/components/FileUploader/icons/row/DocTextIcon.js.map +1 -1
- package/components/FileUploader/icons/row/FolderIcon.js +1 -1
- package/components/FileUploader/icons/row/FolderIcon.js.map +1 -1
- package/components/FileUploader/icons/row/MarkupIcon.js +1 -1
- package/components/FileUploader/icons/row/MarkupIcon.js.map +1 -1
- package/components/FileUploader/icons/row/PdfIcon.js +1 -1
- package/components/FileUploader/icons/row/PdfIcon.js.map +1 -1
- package/components/FileUploader/icons/row/PictureIcon.js +1 -1
- package/components/FileUploader/icons/row/PictureIcon.js.map +1 -1
- package/components/FileUploader/icons/row/PresentationIcon.js +1 -1
- package/components/FileUploader/icons/row/PresentationIcon.js.map +1 -1
- package/components/FileUploader/icons/row/TableIcon.js +1 -1
- package/components/FileUploader/icons/row/TableIcon.js.map +1 -1
- package/components/FileUploader/icons/row/TextIcon.js +1 -1
- package/components/FileUploader/icons/row/TextIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/ArchiveIcon.js +1 -1
- package/components/FileUploader/icons/tile/ArchiveIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/DocTextIcon.js +1 -1
- package/components/FileUploader/icons/tile/DocTextIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/FolderIcon.js +1 -1
- package/components/FileUploader/icons/tile/FolderIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/MarkupIcon.js +1 -1
- package/components/FileUploader/icons/tile/MarkupIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/PdfIcon.js +1 -1
- package/components/FileUploader/icons/tile/PdfIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/PictureIcon.js +1 -1
- package/components/FileUploader/icons/tile/PictureIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/PresentationIcon.js +1 -1
- package/components/FileUploader/icons/tile/PresentationIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/TableIcon.js +1 -1
- package/components/FileUploader/icons/tile/TableIcon.js.map +1 -1
- package/components/FileUploader/icons/tile/TextIcon.js +1 -1
- package/components/FileUploader/icons/tile/TextIcon.js.map +1 -1
- package/components/FileUploader/locale/index.js.map +1 -1
- package/components/FileUploader/withFileUploaderControlProvider.js.map +1 -1
- package/components/FxInput/FxInput.d.ts +6 -6
- package/components/FxInput/FxInput.js +6 -6
- package/components/FxInput/FxInput.js.map +1 -1
- package/components/FxInput/FxInputRestoreBtn.d.ts +1 -1
- package/components/FxInput/FxInputRestoreBtn.js +1 -1
- package/components/FxInput/FxInputRestoreBtn.js.map +1 -1
- package/components/FxInput/UndoIcon.js +2 -2
- package/components/FxInput/UndoIcon.js.map +1 -1
- package/components/Gapped/Gapped.js +2 -2
- package/components/Gapped/Gapped.js.map +1 -1
- package/components/GlobalLoader/GlobalLoader.js +3 -3
- package/components/GlobalLoader/GlobalLoader.js.map +1 -1
- package/components/GlobalLoader/GlobalLoaderView.js +2 -2
- package/components/GlobalLoader/GlobalLoaderView.js.map +1 -1
- package/components/GlobalLoader/useParams.js.map +1 -1
- package/components/Group/Group.js +2 -2
- package/components/Group/Group.js.map +1 -1
- package/components/Hint/Hint.d.ts +4 -4
- package/components/Hint/Hint.js +5 -5
- package/components/Hint/Hint.js.map +1 -1
- package/components/Hint/Hint.styles.js.map +1 -1
- package/components/Input/Input.d.ts +1 -1
- package/components/Input/Input.js +7 -8
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.styles.js +1 -1
- package/components/Input/Input.styles.js.map +1 -1
- package/components/Input/InputLayout/InputLayout.d.ts +1 -1
- package/components/Input/InputLayout/InputLayout.js +4 -4
- package/components/Input/InputLayout/InputLayout.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutAside.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutAsideIcon.js +2 -2
- package/components/Input/InputLayout/InputLayoutAsideIcon.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutAsideText.js +1 -1
- package/components/Input/InputLayout/InputLayoutAsideText.js.map +1 -1
- package/components/Kebab/Kebab.d.ts +3 -3
- package/components/Kebab/Kebab.js +11 -11
- package/components/Kebab/Kebab.js.map +1 -1
- package/components/Link/Link.d.ts +3 -3
- package/components/Link/Link.js +6 -6
- package/components/Link/Link.js.map +1 -1
- package/components/Link/Link.styles.js +1 -1
- package/components/Link/Link.styles.js.map +1 -1
- package/components/Link/LinkIcon.js.map +1 -1
- package/components/Loader/Loader.d.ts +2 -2
- package/components/Loader/Loader.js +10 -10
- package/components/Loader/Loader.js.map +1 -1
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement.js +4 -4
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement.js.map +1 -1
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement.styles.js +1 -1
- package/components/MaskedInput/ColorableInputElement/ColorableInputElement.styles.js.map +1 -1
- package/components/MaskedInput/FixedIMaskInput.js +2 -2
- package/components/MaskedInput/FixedIMaskInput.js.map +1 -1
- package/components/MaskedInput/MaskedInput.js +5 -5
- package/components/MaskedInput/MaskedInput.js.map +1 -1
- package/components/MaskedInput/MaskedInput.styles.js +1 -1
- package/components/MaskedInput/MaskedInput.styles.js.map +1 -1
- package/components/MenuFooter/MenuFooter.js +2 -2
- package/components/MenuFooter/MenuFooter.js.map +1 -1
- package/components/MenuFooter/MenuFooter.styles.js.map +1 -1
- package/components/MenuHeader/MenuHeader.js +2 -2
- package/components/MenuHeader/MenuHeader.js.map +1 -1
- package/components/MenuHeader/MenuHeader.styles.js.map +1 -1
- package/components/MenuItem/MenuItem.d.ts +1 -1
- package/components/MenuItem/MenuItem.js +6 -6
- package/components/MenuItem/MenuItem.js.map +1 -1
- package/components/MenuItem/MenuItem.styles.js +1 -1
- package/components/MenuItem/MenuItem.styles.js.map +1 -1
- package/components/MenuSeparator/MenuSeparator.js +2 -2
- package/components/MenuSeparator/MenuSeparator.js.map +1 -1
- package/components/MiniModal/MiniModal.d.ts +2 -2
- package/components/MiniModal/MiniModal.js +3 -3
- package/components/MiniModal/MiniModal.js.map +1 -1
- package/components/MiniModal/MiniModalBody.js +2 -2
- package/components/MiniModal/MiniModalBody.js.map +1 -1
- package/components/MiniModal/MiniModalFooter.js +3 -3
- package/components/MiniModal/MiniModalFooter.js.map +1 -1
- package/components/MiniModal/MiniModalHeader.js +4 -4
- package/components/MiniModal/MiniModalHeader.js.map +1 -1
- package/components/MiniModal/MiniModalIndent.js +2 -2
- package/components/MiniModal/MiniModalIndent.js.map +1 -1
- package/components/MiniModal/getMiniModalTheme.js.map +1 -1
- package/components/Modal/Modal.d.ts +2 -2
- package/components/Modal/Modal.js +15 -15
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/Modal.styles.js +1 -1
- package/components/Modal/Modal.styles.js.map +1 -1
- package/components/Modal/ModalBody.js +7 -7
- package/components/Modal/ModalBody.js.map +1 -1
- package/components/Modal/ModalClose.js +6 -6
- package/components/Modal/ModalClose.js.map +1 -1
- package/components/Modal/ModalFooter.d.ts +1 -1
- package/components/Modal/ModalFooter.js +5 -5
- package/components/Modal/ModalFooter.js.map +1 -1
- package/components/Modal/ModalHeader.d.ts +1 -1
- package/components/Modal/ModalHeader.js +2 -2
- package/components/Modal/ModalHeader.js.map +1 -1
- package/components/Modal/ModalSeparator.js.map +1 -1
- package/components/Modal/getModalBodyTheme.js.map +1 -1
- package/components/Modal/getModalTheme.js.map +1 -1
- package/components/Modal/locale/index.js.map +1 -1
- package/components/Paging/DotsIcon.js +1 -1
- package/components/Paging/DotsIcon.js.map +1 -1
- package/components/Paging/Paging.d.ts +1 -1
- package/components/Paging/Paging.js +13 -13
- package/components/Paging/Paging.js.map +1 -1
- package/components/Paging/PagingDefaultComponent.js.map +1 -1
- package/components/Paging/locale/index.js.map +1 -1
- package/components/PasswordInput/ClosedIcon.js +1 -1
- package/components/PasswordInput/ClosedIcon.js.map +1 -1
- package/components/PasswordInput/OpenedIcon.js +1 -1
- package/components/PasswordInput/OpenedIcon.js.map +1 -1
- package/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/components/PasswordInput/PasswordInput.js +8 -8
- package/components/PasswordInput/PasswordInput.js.map +1 -1
- package/components/PasswordInput/PasswordInput.styles.js.map +1 -1
- package/components/PasswordInput/PasswordInputIcon.js.map +1 -1
- package/components/PasswordInput/locale/index.js.map +1 -1
- package/components/Radio/Radio.d.ts +2 -2
- package/components/Radio/Radio.js +6 -6
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/Radio.mixins.js +1 -1
- package/components/Radio/Radio.mixins.js.map +1 -1
- package/components/Radio/Radio.styles.js.map +1 -1
- package/components/RadioGroup/RadioGroup.js +7 -7
- package/components/RadioGroup/RadioGroup.js.map +1 -1
- package/components/ResponsiveLayout/ResponsiveLayout.js +2 -2
- package/components/ResponsiveLayout/ResponsiveLayout.js.map +1 -1
- package/components/ResponsiveLayout/useResponsiveLayout.js.map +1 -1
- package/components/ScrollContainer/ScrollBar.js +2 -2
- package/components/ScrollContainer/ScrollBar.js.map +1 -1
- package/components/ScrollContainer/ScrollContainer.d.ts +1 -1
- package/components/ScrollContainer/ScrollContainer.helpers.js.map +1 -1
- package/components/ScrollContainer/ScrollContainer.js +8 -8
- package/components/ScrollContainer/ScrollContainer.js.map +1 -1
- package/components/Select/Select.d.ts +4 -4
- package/components/Select/Select.js +17 -17
- package/components/Select/Select.js.map +1 -1
- package/components/Select/locale/index.js.map +1 -1
- package/components/Select/selectTheme.js.map +1 -1
- package/components/SidePage/SidePage.js +11 -11
- package/components/SidePage/SidePage.js.map +1 -1
- package/components/SidePage/SidePage.styles.js +1 -1
- package/components/SidePage/SidePage.styles.js.map +1 -1
- package/components/SidePage/SidePageBody.js +2 -2
- package/components/SidePage/SidePageBody.js.map +1 -1
- package/components/SidePage/SidePageCloseButton.js +5 -5
- package/components/SidePage/SidePageCloseButton.js.map +1 -1
- package/components/SidePage/SidePageContainer.js +3 -3
- package/components/SidePage/SidePageContainer.js.map +1 -1
- package/components/SidePage/SidePageFooter.js +6 -6
- package/components/SidePage/SidePageFooter.js.map +1 -1
- package/components/SidePage/SidePageHeader.js +7 -7
- package/components/SidePage/SidePageHeader.js.map +1 -1
- package/components/SidePage/locale/index.js.map +1 -1
- package/components/SingleToast/SingleToast.js +1 -1
- package/components/SingleToast/SingleToast.js.map +1 -1
- package/components/Spinner/Spinner.js +3 -3
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/Spinner/Spinner.styles.js +1 -1
- package/components/Spinner/Spinner.styles.js.map +1 -1
- package/components/Sticky/Sticky.d.ts +1 -1
- package/components/Sticky/Sticky.js +5 -5
- package/components/Sticky/Sticky.js.map +1 -1
- package/components/Switcher/Switcher.d.ts +2 -2
- package/components/Switcher/Switcher.js +6 -6
- package/components/Switcher/Switcher.js.map +1 -1
- package/components/Switcher/switcherTheme.js.map +1 -1
- package/components/Tabs/Indicator.js +5 -5
- package/components/Tabs/Indicator.js.map +1 -1
- package/components/Tabs/Tab.d.ts +1 -1
- package/components/Tabs/Tab.js +8 -8
- package/components/Tabs/Tab.js.map +1 -1
- package/components/Tabs/Tab.styles.js +1 -1
- package/components/Tabs/Tab.styles.js.map +1 -1
- package/components/Tabs/Tabs.js +4 -4
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/Tabs.styles.js.map +1 -1
- package/components/Tabs/TabsContext.js.map +1 -1
- package/components/Textarea/Textarea.d.ts +1 -1
- package/components/Textarea/Textarea.js +9 -9
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.styles.js.map +1 -1
- package/components/Textarea/TextareaCounter.js +3 -3
- package/components/Textarea/TextareaCounter.js.map +1 -1
- package/components/Toast/Toast.d.ts +2 -2
- package/components/Toast/Toast.js +4 -4
- package/components/Toast/Toast.js.map +1 -1
- package/components/Toast/ToastView.d.ts +1 -1
- package/components/Toast/ToastView.js +7 -7
- package/components/Toast/ToastView.js.map +1 -1
- package/components/Toast/locale/index.js.map +1 -1
- package/components/Toggle/Toggle.d.ts +1 -1
- package/components/Toggle/Toggle.js +5 -5
- package/components/Toggle/Toggle.js.map +1 -1
- package/components/Toggle/Toggle.mixins.js.map +1 -1
- package/components/Toggle/Toggle.styles.js.map +1 -1
- package/components/Token/Token.js +7 -7
- package/components/Token/Token.js.map +1 -1
- package/components/Token/Token.styles.js.map +1 -1
- package/components/Token/TokenView.d.ts +1 -1
- package/components/Token/TokenView.js +2 -2
- package/components/Token/TokenView.js.map +1 -1
- package/components/Token/locale/index.js.map +1 -1
- package/components/TokenInput/TextWidthHelper.js +2 -2
- package/components/TokenInput/TextWidthHelper.js.map +1 -1
- package/components/TokenInput/TokenInput.d.ts +2 -2
- package/components/TokenInput/TokenInput.js +13 -13
- package/components/TokenInput/TokenInput.js.map +1 -1
- package/components/TokenInput/TokenInput.styles.js +2 -2
- package/components/TokenInput/TokenInput.styles.js.map +1 -1
- package/components/TokenInput/TokenInputMenu.d.ts +2 -2
- package/components/TokenInput/TokenInputMenu.js +2 -2
- package/components/TokenInput/TokenInputMenu.js.map +1 -1
- package/components/TokenInput/TokenInputReducer.js.map +1 -1
- package/components/TokenInput/locale/index.js.map +1 -1
- package/components/Tooltip/Tooltip.d.ts +3 -3
- package/components/Tooltip/Tooltip.js +12 -13
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/TooltipMenu/TooltipMenu.d.ts +4 -4
- package/components/TooltipMenu/TooltipMenu.js +4 -4
- package/components/TooltipMenu/TooltipMenu.js.map +1 -1
- package/hooks/useDrop.js.map +1 -1
- package/hooks/useEffectWithoutInitCall.js.map +1 -1
- package/internal/ClearCrossIcon/ClearCrossIcon.d.ts +1 -1
- package/internal/ClearCrossIcon/ClearCrossIcon.js +1 -1
- package/internal/ClearCrossIcon/ClearCrossIcon.js.map +1 -1
- package/internal/ClearCrossIcon/ClearCrossIcon.styles.js +1 -1
- package/internal/ClearCrossIcon/ClearCrossIcon.styles.js.map +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon.js +2 -2
- package/internal/CloseButtonIcon/CloseButtonIcon.js.map +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon.styles.js +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon.styles.js.map +1 -1
- package/internal/CommonWrapper/CommonWrapper.js +2 -2
- package/internal/CommonWrapper/CommonWrapper.js.map +1 -1
- package/internal/CommonWrapper/utils/extractCommonProps.d.ts +1 -1
- package/internal/CommonWrapper/utils/extractCommonProps.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxMenu.d.ts +3 -3
- package/internal/CustomComboBox/ComboBoxMenu.js +7 -7
- package/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxView.d.ts +6 -6
- package/internal/CustomComboBox/ComboBoxView.js +15 -15
- package/internal/CustomComboBox/ComboBoxView.js.map +1 -1
- package/internal/CustomComboBox/CustomComboBox.d.ts +6 -6
- package/internal/CustomComboBox/CustomComboBox.js +6 -6
- package/internal/CustomComboBox/CustomComboBox.js.map +1 -1
- package/internal/CustomComboBox/CustomComboBoxReducer.d.ts +1 -1
- package/internal/CustomComboBox/CustomComboBoxReducer.js +1 -1
- package/internal/CustomComboBox/CustomComboBoxReducer.js.map +1 -1
- package/internal/CustomComboBox/getComboBoxTheme.js.map +1 -1
- package/internal/CustomComboBox/locale/index.js.map +1 -1
- package/internal/DateSelect/DateSelect.js +7 -7
- package/internal/DateSelect/DateSelect.js.map +1 -1
- package/internal/DateSelect/locale/index.js.map +1 -1
- package/internal/FocusControlWrapper/FocusControlWrapper.js.map +1 -1
- package/internal/FocusControlWrapper/useFocusControl.js.map +1 -1
- package/internal/FocusTrap/FocusTrap.d.ts +1 -0
- package/internal/FocusTrap/FocusTrap.js +7 -7
- package/internal/FocusTrap/FocusTrap.js.map +1 -1
- package/internal/HideBodyVerticalScroll/HideBodyVerticalScroll.js +2 -2
- package/internal/HideBodyVerticalScroll/HideBodyVerticalScroll.js.map +1 -1
- package/internal/InputLikeText/InputLikeText.d.ts +2 -2
- package/internal/InputLikeText/InputLikeText.js +14 -14
- package/internal/InputLikeText/InputLikeText.js.map +1 -1
- package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js +6 -6
- package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -1
- package/internal/MaskCharLowLine/MaskCharLowLine.js.map +1 -1
- package/internal/Menu/Menu.js +10 -10
- package/internal/Menu/Menu.js.map +1 -1
- package/internal/Menu/MenuContext.js.map +1 -1
- package/internal/Menu/MenuNavigation.d.ts +1 -1
- package/internal/Menu/MenuNavigation.js.map +1 -1
- package/internal/MenuMessage/MenuMessage.d.ts +1 -1
- package/internal/MenuMessage/MenuMessage.js +2 -2
- package/internal/MenuMessage/MenuMessage.js.map +1 -1
- package/internal/MenuMessage/MenuMessage.styles.js +1 -1
- package/internal/MenuMessage/MenuMessage.styles.js.map +1 -1
- package/internal/MobilePopup/MobilePopup.js +5 -5
- package/internal/MobilePopup/MobilePopup.js.map +1 -1
- package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js +1 -1
- package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js.map +1 -1
- package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js +2 -2
- package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js.map +1 -1
- package/internal/NativeDateInput/NativeDateInput.js +1 -1
- package/internal/NativeDateInput/NativeDateInput.js.map +1 -1
- package/internal/NativeDateInput/utils.d.ts +1 -1
- package/internal/NativeDateInput/utils.js.map +1 -1
- package/internal/Popup/Popup.d.ts +5 -3
- package/internal/Popup/Popup.js +69 -40
- package/internal/Popup/Popup.js.map +1 -1
- package/internal/Popup/PopupHelper.d.ts +5 -3
- package/internal/Popup/PopupHelper.js +14 -8
- package/internal/Popup/PopupHelper.js.map +1 -1
- package/internal/Popup/PopupPin.js +1 -1
- package/internal/Popup/PopupPin.js.map +1 -1
- package/internal/Popup/types.js.map +1 -1
- package/internal/PopupMenu/PopupMenu.d.ts +2 -2
- package/internal/PopupMenu/PopupMenu.js +8 -8
- package/internal/PopupMenu/PopupMenu.js.map +1 -1
- package/internal/PopupMenu/validatePositions.js.map +1 -1
- package/internal/RenderContainer/RenderContainer.d.ts +9 -1
- package/internal/RenderContainer/RenderContainer.js +85 -6
- package/internal/RenderContainer/RenderContainer.js.map +1 -1
- package/internal/RenderContainer/RenderInnerContainer.js.map +1 -1
- package/internal/RenderLayer/RenderLayer.d.ts +2 -1
- package/internal/RenderLayer/RenderLayer.js +7 -9
- package/internal/RenderLayer/RenderLayer.js.map +1 -1
- package/internal/ResizeDetector/ResizeDetector.js.map +1 -1
- package/internal/SpinnerIcon/SpinnerIcon.js.map +1 -1
- package/internal/TextWidthHelper/TextWidthHelper.js.map +1 -1
- package/internal/ZIndex/ZIndex.js +6 -6
- package/internal/ZIndex/ZIndex.js.map +1 -1
- package/internal/icons2022/ArrowALeftIcon/ArrowALeftIcon16Light.js.map +1 -1
- package/internal/icons2022/ArrowALeftIcon/ArrowALeftIcon20Light.js.map +1 -1
- package/internal/icons2022/ArrowALeftIcon/ArrowALeftIcon24Regular.js.map +1 -1
- package/internal/icons2022/ArrowARightIcon/ArrowARightIcon16Light.js.map +1 -1
- package/internal/icons2022/ArrowARightIcon/ArrowARightIcon20Light.js.map +1 -1
- package/internal/icons2022/ArrowARightIcon/ArrowARightIcon24Regular.js.map +1 -1
- package/internal/icons2022/ArrowAUpIcon/ArrowAUp16Light.js.map +1 -1
- package/internal/icons2022/ArrowCDownIcon/ArrowCDownIcon16Regular.js.map +1 -1
- package/internal/icons2022/ArrowCDownIcon/ArrowCDownIcon20Regular.js.map +1 -1
- package/internal/icons2022/ArrowCDownIcon/ArrowCDownIcon24Regular.js.map +1 -1
- package/internal/icons2022/ArrowCRightIcon/ArrowCRightIcon16Light.js.map +1 -1
- package/internal/icons2022/ArrowCRightIcon/ArrowCRightIcon20Light.js.map +1 -1
- package/internal/icons2022/ArrowCRightIcon/ArrowCRightIcon24Regular.js.map +1 -1
- package/internal/icons2022/ArrowCollapseCVOpenIcon/ArrowCollapseCVOpenIcon16Regular.js.map +1 -1
- package/internal/icons2022/ArrowShapeDRadiusUpLeftIcon/ArrowShapeDRadiusUpLeftIcon16Light.js.map +1 -1
- package/internal/icons2022/ArrowShapeDRadiusUpLeftIcon/ArrowShapeDRadiusUpLeftIcon20Light.js.map +1 -1
- package/internal/icons2022/ArrowShapeDRadiusUpLeftIcon/ArrowShapeDRadiusUpLeftIcon24Regular.js.map +1 -1
- package/internal/icons2022/BaseIcon.js +1 -1
- package/internal/icons2022/BaseIcon.js.map +1 -1
- package/internal/icons2022/CalendarIcon/CalendarIcon16Light.js.map +1 -1
- package/internal/icons2022/CalendarIcon/CalendarIcon20Light.js.map +1 -1
- package/internal/icons2022/CalendarIcon/CalendarIcon24Regular.js.map +1 -1
- package/internal/icons2022/CheckAIcon/CheckAIcon16Solid.js.map +1 -1
- package/internal/icons2022/CheckAIcon/CheckAIcon20Solid.js.map +1 -1
- package/internal/icons2022/EyeClosedIcon/EyeClosedIcon16Light.js.map +1 -1
- package/internal/icons2022/EyeClosedIcon/EyeClosedIcon20Light.js.map +1 -1
- package/internal/icons2022/EyeClosedIcon/EyeClosedIcon24Regular.js.map +1 -1
- package/internal/icons2022/EyeOpenIcon/EyeOpenIcon16Light.js.map +1 -1
- package/internal/icons2022/EyeOpenIcon/EyeOpenIcon20Light.js.map +1 -1
- package/internal/icons2022/EyeOpenIcon/EyeOpenIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeArchiveIcon/ArchiveIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeDocTextIcon/DocTextIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeFolderIcon/FolderIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeMarkupIcon/MarkupIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypePdfIcon/PdfIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypePictureIcon/PictureIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypePresentationIcon/PresentationIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTableIcon/TableIcon64Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon16Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon20Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon24Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon24Solid.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon32Regular.js.map +1 -1
- package/internal/icons2022/FileTypeTextIcon/TextIcon64Regular.js.map +1 -1
- package/internal/icons2022/InfoCircleIcon/InfoCircleIcon64Regular.js.map +1 -1
- package/internal/icons2022/LoadingIcon.js +1 -1
- package/internal/icons2022/LoadingIcon.js.map +1 -1
- package/internal/icons2022/MathFunctionIcon/MathFunctionIcon16Light.js.map +1 -1
- package/internal/icons2022/MathFunctionIcon/MathFunctionIcon20Light.js.map +1 -1
- package/internal/icons2022/MathFunctionIcon/MathFunctionIcon24Regular.js.map +1 -1
- package/internal/icons2022/NetUploadIcon/NetUploadIcon16Light.js.map +1 -1
- package/internal/icons2022/NetUploadIcon/NetUploadIcon20Regular.js.map +1 -1
- package/internal/icons2022/NetUploadIcon/NetUploadIcon24Regular.js.map +1 -1
- package/internal/icons2022/NetUploadIcon/NetUploadIcon32Regular.js.map +1 -1
- package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Solid.js.map +1 -1
- package/internal/icons2022/ShapeSquareIcon/ShapeSquareIcon16Solid.js.map +1 -1
- package/internal/icons2022/UiMenuDots3HIcon/UiMenuDots3HIcon16Regular.js.map +1 -1
- package/internal/icons2022/UiMenuDotsThreeVIcon/UiMenuDotsThreeVIcon16Light.js.map +1 -1
- package/internal/icons2022/UiMenuDotsThreeVIcon/UiMenuDotsThreeVIcon20Regular.js.map +1 -1
- package/internal/icons2022/UiMenuDotsThreeVIcon/UiMenuDotsThreeVIcon24Regular.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon16Solid.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon20Solid.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon24Regular.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon24Solid.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon32Regular.js.map +1 -1
- package/internal/icons2022/WarningTriangleIcon/WarningTriangleIcon64Regular.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon16Solid.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon20Solid.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon24Regular.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon24Solid.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon32Regular.js.map +1 -1
- package/internal/icons2022/XCircleIcon/XCircleIcon64Regular.js.map +1 -1
- package/internal/icons2022/XIcon/XIcon16Light.js.map +1 -1
- package/internal/icons2022/XIcon/XIcon20Light.js.map +1 -1
- package/internal/icons2022/XIcon/XIcon20Regular.js.map +1 -1
- package/internal/icons2022/XIcon/XIcon24Regular.js.map +1 -1
- package/internal/icons2022/iconSizer.js.map +1 -1
- package/internal/react-focus-lock/Lock.js +1 -1
- package/internal/react-focus-lock/Lock.js.map +1 -1
- package/internal/react-focus-lock/Trap.js +2 -2
- package/internal/react-focus-lock/Trap.js.map +1 -1
- package/internal/themes/DarkTheme6_0.js +1 -1
- package/internal/themes/DarkTheme6_0.js.map +1 -1
- package/internal/themes/LightTheme6_0.js.map +1 -1
- package/lib/ModalStack.d.ts +1 -1
- package/lib/ModalStack.js.map +1 -1
- package/lib/animation/index.js.map +1 -1
- package/lib/date/InternalDate.js.map +1 -1
- package/lib/date/InternalDateGetter.d.ts +1 -1
- package/lib/date/InternalDateGetter.js.map +1 -1
- package/lib/date/InternalDateSetter.d.ts +1 -1
- package/lib/date/InternalDateSetter.js.map +1 -1
- package/lib/date/InternalDateTransformer.js +1 -1
- package/lib/date/InternalDateTransformer.js.map +1 -1
- package/lib/date/InternalDateValidator.js +1 -1
- package/lib/date/InternalDateValidator.js.map +1 -1
- package/lib/date/comparison.js.map +1 -1
- package/lib/date/localeSets.js.map +1 -1
- package/lib/dom/scrollYCenterIntoNearestScrollable.js.map +1 -1
- package/lib/dom/selectionHelpers.js +3 -3
- package/lib/dom/selectionHelpers.js.map +1 -1
- package/lib/dom/tabbableHelpers.js +1 -1
- package/lib/dom/tabbableHelpers.js.map +1 -1
- package/lib/events/fixFirefoxModifiedClickOnLabel.js +1 -1
- package/lib/events/fixFirefoxModifiedClickOnLabel.js.map +1 -1
- package/lib/events/keyListener.js.map +1 -1
- package/lib/events/keyboard/extractCode.js.map +1 -1
- package/lib/events/keyboard/identifiers.js.map +1 -1
- package/lib/forwardRefAndName.js.map +1 -1
- package/lib/listenFocusOutside.d.ts +3 -1
- package/lib/listenFocusOutside.js +21 -4
- package/lib/listenFocusOutside.js.map +1 -1
- package/lib/locale/LocaleContext.js.map +1 -1
- package/lib/locale/types.d.ts +6 -6
- package/lib/locale/types.js.map +1 -1
- package/lib/locale/useLocaleForControl.d.ts +1 -1
- package/lib/locale/useLocaleForControl.js.map +1 -1
- package/lib/mergeRefs.js.map +1 -1
- package/lib/renderEnvironment/RenderEnvironmentContext.d.ts +17 -1
- package/lib/renderEnvironment/RenderEnvironmentContext.js +10 -10
- package/lib/renderEnvironment/RenderEnvironmentContext.js.map +1 -1
- package/lib/renderEnvironment/RenderEnvironmentDecorator.js.map +1 -1
- package/lib/rootNode/getRootNode.js.map +1 -1
- package/lib/rootNode/rootNodeDecorator.js.map +1 -1
- package/lib/shadowDom/isShadowRoot.d.ts +6 -0
- package/lib/shadowDom/isShadowRoot.js +17 -0
- package/lib/shadowDom/isShadowRoot.js.map +1 -0
- package/lib/size/SizeControlContext.js.map +1 -1
- package/lib/size/SizeDecorator.js +1 -1
- package/lib/size/SizeDecorator.js.map +1 -1
- package/lib/size/useSizeControl.js.map +1 -1
- package/lib/styles/ColorFunctions.js +2 -2
- package/lib/styles/ColorFunctions.js.map +1 -1
- package/lib/theming/AnimationKeyframes.js.map +1 -1
- package/lib/theming/Emotion.d.ts +17 -1
- package/lib/theming/Emotion.js +16 -5
- package/lib/theming/Emotion.js.map +1 -1
- package/lib/theming/ThemeFactory.js +1 -1
- package/lib/theming/ThemeFactory.js.map +1 -1
- package/lib/theming/ThemeHelpers.js.map +1 -1
- package/lib/theming/useTheme.js.map +1 -1
- package/lib/types/polymorphic-component.d.ts +1 -1
- package/lib/types/polymorphic-component.js.map +1 -1
- package/lib/utils.d.ts +8 -8
- package/lib/utils.js.map +1 -1
- package/package.json +14 -23
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import React, { createContext, useContext, useMemo } from 'react';
|
|
3
3
|
import { getOwnerGlobalObject, getSafeWindow } from '../globalObject.js';
|
|
4
|
-
import { getEmotion } from '../theming/Emotion.js';
|
|
4
|
+
import { getEmotion, PopupProvider } from '../theming/Emotion.js';
|
|
5
5
|
var globalObject = getSafeWindow();
|
|
6
6
|
export var RenderEnvironmentContext = createContext({
|
|
7
7
|
globalObject: globalObject,
|
|
8
8
|
emotion: getEmotion({ container: (_a = globalObject.document) === null || _a === void 0 ? void 0 : _a.head }),
|
|
9
9
|
});
|
|
10
10
|
export var RenderEnvironmentProvider = function (_a) {
|
|
11
|
-
var children = _a.children, rootNode = _a.rootNode;
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
11
|
+
var getOffsetParent = _a.getOffsetParent, popupStrategy = _a.popupStrategy, children = _a.children, rootNode = _a.rootNode, stylesContainer = _a.stylesContainer, _b = _a.emotionKey, emotionKey = _b === void 0 ? 'react-ui-render-environment' : _b;
|
|
12
|
+
var emotion = useMemo(function () { return getEmotion({ container: stylesContainer !== null && stylesContainer !== void 0 ? stylesContainer : rootNode, key: emotionKey }); }, [stylesContainer, rootNode, emotionKey]);
|
|
13
|
+
var value = useMemo(function () { return ({
|
|
14
|
+
globalObject: getOwnerGlobalObject(rootNode),
|
|
15
|
+
emotion: emotion,
|
|
16
|
+
}); }, [emotion, rootNode]);
|
|
17
|
+
var popupContext = useMemo(function () { return ({ getOffsetParent: getOffsetParent, popupStrategy: popupStrategy }); }, [getOffsetParent, popupStrategy]);
|
|
18
|
+
return (React.createElement(PopupProvider, { value: popupContext },
|
|
19
|
+
React.createElement(RenderEnvironmentContext.Provider, { value: value }, children)));
|
|
20
20
|
};
|
|
21
21
|
export var useGlobal = function () { return useContext(RenderEnvironmentContext).globalObject; };
|
|
22
22
|
export var useEmotion = function () { return useContext(RenderEnvironmentContext).emotion; };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderEnvironmentContext.js","sourceRoot":"","sources":["../../../lib/renderEnvironment/RenderEnvironmentContext.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RenderEnvironmentContext.js","sourceRoot":"","sources":["../../../lib/renderEnvironment/RenderEnvironmentContext.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,o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,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,cAAoB,OAAA,UAAU,CAAC,wBAAwB,CAAC,CAAC,YAAY,EAAjD,CAAiD,CAAC;AAC/F,MAAM,CAAC,IAAM,UAAU,GAAG,cAAe,OAAA,UAAU,CAAC,wBAAwB,CAAC,CAAC,OAAO,EAA5C,CAA4C,CAAC;AACtF,MAAM,CAAC,IAAM,SAAS,GAAG,UAAK,SAAkC;IAC9D,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React, { createContext, useContext, useMemo } from 'react';\n\nimport { getOwnerGlobalObject, getSafeWindow } from '../globalObject.js';\nimport type { GlobalObject } from '../globalObject.js';\nimport { getEmotion, PopupProvider } from '../theming/Emotion.js';\n\nexport interface RenderEnvironmentContextType {\n globalObject: GlobalObject;\n emotion: Emotion;\n}\n\nconst globalObject = getSafeWindow();\nexport const RenderEnvironmentContext = createContext<RenderEnvironmentContextType>({\n globalObject,\n emotion: getEmotion({ container: globalObject.document?.head as HTMLElement }),\n});\n\nexport type GetOffsetParent = (element?: Node) => HTMLElement | null;\n\n/**\n * Как монтировать портал с попапами относительно Shadow DOM:\n * - `auto` — абсолютное позиционирование внутри shadow root;\n * - `unstable_relative` — режим со смещением через `top` (не рекомендуется);\n * - `fixed` — фиксация к окну с подпиской на scroll/resize.\n */\nexport type PopupStrategy = 'auto' | 'unstable_relative' | 'fixed';\n\ninterface RenderEnvironmentProviderProps {\n children: React.ReactNode;\n rootNode: HTMLElement;\n /**\n * Контейнер, в который emotion должен инжектить style-теги.\n * Позволяет синхронно инициализировать emotion до первого render children.\n */\n stylesContainer?: HTMLElement;\n getOffsetParent?: GetOffsetParent;\n popupStrategy?: PopupStrategy;\n emotionKey?: string;\n}\n\nexport const RenderEnvironmentProvider: React.FC<RenderEnvironmentProviderProps> = ({\n getOffsetParent,\n popupStrategy,\n children,\n rootNode,\n stylesContainer,\n emotionKey = 'react-ui-render-environment',\n}) => {\n const emotion = useMemo(\n () => getEmotion({ container: stylesContainer ?? rootNode, key: emotionKey }),\n [stylesContainer, rootNode, emotionKey],\n );\n\n const value = useMemo(\n () => ({\n globalObject: getOwnerGlobalObject(rootNode),\n emotion,\n }),\n [emotion, rootNode],\n );\n\n const popupContext = useMemo(() => ({ getOffsetParent, popupStrategy }), [getOffsetParent, popupStrategy]);\n\n return (\n <PopupProvider value={popupContext}>\n <RenderEnvironmentContext.Provider value={value}>{children}</RenderEnvironmentContext.Provider>\n </PopupProvider>\n );\n};\n\nexport const useGlobal = (): GlobalObject => useContext(RenderEnvironmentContext).globalObject;\nexport const useEmotion = (): Emotion => useContext(RenderEnvironmentContext).emotion;\nexport const useStyles = <T,>(getStyles: (emotion: Emotion) => T): T => {\n const emotion = useEmotion();\n return getStyles(emotion);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderEnvironmentDecorator.js","sourceRoot":"","sources":["../../../lib/renderEnvironment/RenderEnvironmentDecorator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RenderEnvironmentDecorator.js","sourceRoot":"","sources":["../../../lib/renderEnvironment/RenderEnvironmentDecorator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AASzE,MAAM,UAAU,qBAAqB,CACnC,WAAc;;IAEd,IAAM,0BAA0B;YAAiB,2BAAW;YAAzB;;YA0BnC,CAAC;YAlBQ,wBAAM,GAAb;gBAAA,iBAiBC;gBAhBC,OAAO,CACL,oBAAC,wBAAwB,CAAC,QAAQ,QAC/B,UAAC,EAAyB;wBAAvB,YAAY,kBAAA,EAAE,OAAO,aAAA;oBACvB,KAAI,CAAC,YAAY,GAAG,YAAY,CAAC;oBACjC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;oBACvB,KAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;oBAErB,IAAM,cAAc,GAAG,gBAAK,CAAC,MAAM,CAAC;oBACpC,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE,CAAC;wBACzC,OAAO,cAAc,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;oBACnC,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC,CACiC,CACrC,CAAC;YACJ,CAAC;YACH,cAAC;QAAD,CAAC,AA1BkC,CAAc,WAAW;;QAC5C,sBAAmB,GAAG,WAAW,CAAC,mBAAoB;QACtD,cAAW,GAAG,WAAW,CAAC,WAAY;WAwBrD,CAAC;IAEF,IAAM,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;IAC3F,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,0BAA0B,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,0BAA0B,CAAC;AACpC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React from 'react';\n\nimport type { GlobalObject } from '../globalObject.js';\nimport { RenderEnvironmentContext } from './RenderEnvironmentContext.js';\n\ninterface ComponentWithKonturReactUI {\n __KONTUR_REACT_UI__?: string;\n displayName?: string;\n}\n\ntype Constructor<T = NonNullable<unknown>> = (new (...args: any[]) => T) & ComponentWithKonturReactUI;\n\nexport function withRenderEnvironment<T extends Constructor<React.Component>>(\n constructor: T,\n): ComponentWithKonturReactUI & T {\n const RenderEnvironmentDecorator = class extends constructor {\n public static __KONTUR_REACT_UI__ = constructor.__KONTUR_REACT_UI__;\n public static displayName = constructor.displayName;\n\n public globalObject!: GlobalObject;\n public cx!: Emotion['cx'];\n public emotion!: Emotion;\n\n public render(): React.ReactNode {\n return (\n <RenderEnvironmentContext.Consumer>\n {({ globalObject, emotion }) => {\n this.globalObject = globalObject;\n this.emotion = emotion;\n this.cx = emotion.cx;\n\n const originalRender = super.render;\n if (typeof originalRender === 'function') {\n return originalRender.call(this);\n }\n\n return null;\n }}\n </RenderEnvironmentContext.Consumer>\n );\n }\n };\n\n const nameDescriptor = Object.getOwnPropertyDescriptor(RenderEnvironmentDecorator, 'name');\n if (!nameDescriptor || nameDescriptor.configurable) {\n Object.defineProperty(RenderEnvironmentDecorator, 'name', { value: constructor.name });\n }\n\n return RenderEnvironmentDecorator;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRootNode.js","sourceRoot":"","sources":["../../../lib/rootNode/getRootNode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"getRootNode.js","sourceRoot":"","sources":["../../../lib/rootNode/getRootNode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;GAQG;AAEH,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,QAAuC;IACjE;;;;;;OAMG;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,oDAAoD;QACpD,+CAA+C;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,mDAAmD;QACnD,8DAA8D;QAC9D,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,QAAQ,CAAC;IAEb,IAAI,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,qFAAqF;QACrF,6FAA6F;QAC7F,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,kGAAkG;IAClG,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import type React from 'react';\n\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { isElement } from '../utils.js';\nimport { isInstanceWithRootNode } from './rootNodeDecorator.js';\n\n/**\n * Extracts component's root Element (HTMLElement/SVGElement) out of it's instance\n * following the \"StrictMode support convention\" (@see README.md#strictmode, #2518).\n *\n * Replaces findDOMNode but falls back to it if \"convention\" is not respected.\n *\n * @param instance Component's instance provided by React.Ref or `this` inside class-components.\n * @returns Component's root `Element` or null\n */\n\nexport const getRootNode = (instance: Nullable<React.ReactInstance>): Nullable<Element> => {\n /**\n * Options of what instance can be:\n * 1. null or undefined\n * 2. DOM Element\n * 3. class Component instance (object)\n * 4. literally anything, returned from useImperativeHandle\n */\n\n if (!instance) {\n // instance can be `null` if component was unmounted\n // also checking undefined for convenient usage\n return null;\n }\n\n if (isElement(instance)) {\n // instance can be an Element already if its coming\n // from Refs of intrinsic elements (<div />, <button />, etc.)\n return instance;\n }\n\n let rootNode;\n\n if (isInstanceWithRootNode(instance)) {\n rootNode = instance.getRootNode();\n }\n\n if (rootNode !== undefined) {\n // the getter exists and has returned something, it should be what we are looking for\n // probably its an Element or null (which is also OK, e.g. Popup/Tooltip/Hint before opening)\n return rootNode;\n }\n\n // the findDOMNode can also return Text, but we are only interested in Elements, so just filter it\n return isElement(rootNode) ? rootNode : null;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootNodeDecorator.js","sourceRoot":"","sources":["../../../lib/rootNode/rootNodeDecorator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"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SAAS,CAAC,mBAAoB;QACpD,cAAW,GAAG,SAAS,CAAC,WAAY;WA4BnD,CAAC;IAEF,IAAM,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzE,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,QAAiB;IACtD,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["import { EventEmitter } from 'eventemitter3';\nimport type React from 'react';\n\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { getRootNode } from './getRootNode.js';\n\nexport type TGetRootNode = () => Nullable<Element>;\nexport type TSetRootNode = (e: Nullable<React.ReactInstance>) => void;\n\nexport interface TRootNodeSubscription {\n remove: () => void;\n}\n\nexport interface InstanceWithRootNode {\n getRootNode: TGetRootNode;\n addRootNodeChangeListener?: (callback: (node: Nullable<Element>) => void) => TRootNodeSubscription;\n}\n\ninterface ComponentWithDefaultRootNode {\n defaultRootNode?: Element | null;\n}\ninterface ComponentWithKonturReactUI {\n __KONTUR_REACT_UI__?: string;\n displayName?: string;\n}\n\ninterface DecoratableClassComponent extends ComponentWithDefaultRootNode, ComponentWithKonturReactUI {\n new (...args: any[]): React.Component;\n}\n\nexport function rootNode<T extends DecoratableClassComponent>(Component: T): T {\n const rootNode = class extends Component implements InstanceWithRootNode {\n public static __KONTUR_REACT_UI__ = Component.__KONTUR_REACT_UI__;\n public static displayName = Component.displayName;\n\n public rootNode: Nullable<Element> = Component.defaultRootNode;\n public rootNodeEmitter = new EventEmitter();\n public constructor(...args: any[]) {\n super(args[0]);\n }\n\n public setRootNode = (instance: Nullable<React.ReactInstance>) => {\n const rootNode = getRootNode(instance);\n if (rootNode !== this.rootNode) {\n this.rootNode = rootNode;\n this.rootNodeEmitter.emit('change', rootNode);\n }\n };\n\n public getRootNode = (): Nullable<Element> => {\n return this.rootNode;\n };\n\n public addRootNodeChangeListener = (callback: (node: Nullable<Element>) => void): TRootNodeSubscription => {\n this.rootNodeEmitter.addListener('change', callback);\n return {\n remove: () => {\n this.rootNodeEmitter.removeListener('change', callback);\n },\n };\n };\n };\n\n const nameDescriptor = Object.getOwnPropertyDescriptor(rootNode, 'name');\n if (!nameDescriptor || nameDescriptor.configurable) {\n Object.defineProperty(rootNode, 'name', { value: Component.name });\n }\n\n return rootNode;\n}\n\nexport const isInstanceWithRootNode = (instance: unknown): instance is InstanceWithRootNode => {\n return Boolean(instance) && Object.prototype.hasOwnProperty.call(instance, 'getRootNode');\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Возвращает `true`, если узел является `ShadowRoot`.
|
|
3
|
+
* Работает и для `mode: 'closed'` (проверка фрагмента с `host` — `Element`),
|
|
4
|
+
* в отличие от `host.shadowRoot`, которое для closed-roots равно `null`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isShadowRoot: (root: unknown) => root is ShadowRoot;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var DOCUMENT_FRAGMENT_NODE = 11;
|
|
2
|
+
/**
|
|
3
|
+
* Возвращает `true`, если узел является `ShadowRoot`.
|
|
4
|
+
* Работает и для `mode: 'closed'` (проверка фрагмента с `host` — `Element`),
|
|
5
|
+
* в отличие от `host.shadowRoot`, которое для closed-roots равно `null`.
|
|
6
|
+
*/
|
|
7
|
+
export var isShadowRoot = function (root) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
var node = root;
|
|
10
|
+
if ((node === null || node === void 0 ? void 0 : node.nodeType) !== DOCUMENT_FRAGMENT_NODE) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
var host = node.host;
|
|
14
|
+
var ElementCtor = (_b = (_a = host === null || host === void 0 ? void 0 : host.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.Element;
|
|
15
|
+
return Boolean(ElementCtor && host instanceof ElementCtor);
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=isShadowRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isShadowRoot.js","sourceRoot":"","sources":["../../../lib/shadowDom/isShadowRoot.ts"],"names":[],"mappings":"AAAA,IAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;GAIG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,IAAa;;IACxC,IAAM,IAAI,GAAG,IAA+B,CAAC;IAC7C,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,MAAK,sBAAsB,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAM,IAAI,GAAI,IAA4C,CAAC,IAAI,CAAC;IAChE,IAAM,WAAW,GAAG,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,0CAAE,WAAW,0CAAE,OAAO,CAAC;IAC9D,OAAO,OAAO,CAAC,WAAW,IAAI,IAAI,YAAY,WAAW,CAAC,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["const DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Возвращает `true`, если узел является `ShadowRoot`.\n * Работает и для `mode: 'closed'` (проверка фрагмента с `host` — `Element`),\n * в отличие от `host.shadowRoot`, которое для closed-roots равно `null`.\n */\nexport const isShadowRoot = (root: unknown): root is ShadowRoot => {\n const node = root as Node | null | undefined;\n if (node?.nodeType !== DOCUMENT_FRAGMENT_NODE) {\n return false;\n }\n const host = (node as unknown as Pick<ShadowRoot, 'host'>).host;\n const ElementCtor = host?.ownerDocument?.defaultView?.Element;\n return Boolean(ElementCtor && host instanceof ElementCtor);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizeControlContext.js","sourceRoot":"","sources":["../../../lib/size/SizeControlContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SizeControlContext.js","sourceRoot":"","sources":["../../../lib/size/SizeControlContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMlD,MAAM,CAAC,IAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAA0B;IAC7E,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AAEH,kBAAkB,CAAC,WAAW,GAAG,aAAa,CAAC;AAC/C,kBAAkB,CAAC,mBAAmB,GAAG,aAAa,CAAC","sourcesContent":["import React from 'react';\n\nimport type { SizeProp } from '../types/props.js';\nimport { defaultSizeValue } from './constants.js';\n\nexport interface SizeControlContextProps {\n size: SizeProp;\n}\n\nexport const SizeControlContext = React.createContext<SizeControlContextProps>({\n size: defaultSizeValue,\n});\n\nSizeControlContext.displayName = 'SizeContext';\nSizeControlContext.__KONTUR_REACT_UI__ = 'SizeContext';\n"]}
|
|
@@ -14,8 +14,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import { SizeControlContext } from './SizeControlContext.js';
|
|
18
17
|
import { defaultSizeValue } from './constants.js';
|
|
18
|
+
import { SizeControlContext } from './SizeControlContext.js';
|
|
19
19
|
export function withSize(constructor) {
|
|
20
20
|
var SizeDecorator = /** @class */ (function (_super) {
|
|
21
21
|
__extends(class_1, _super);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SizeDecorator.js","sourceRoot":"","sources":["../../../lib/size/SizeDecorator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SizeDecorator.js","sourceRoot":"","sources":["../../../lib/size/SizeDecorator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,MAAM,UAAU,QAAQ,CAAwD,WAAc;IAC5F,IAAM,aAAa;QAAiB,2BAAW;QAAzB;;YACb,UAAI,GAAa,gBAAgB,CAAC;;QAiB3C,CAAC;QAfQ,wBAAM,GAAb;YAAA,iBAcC;YAbC,OAAO,CACL,oBAAC,kBAAkB,CAAC,QAAQ,QACzB,UAAC,OAAO;;gBACP,KAAI,CAAC,IAAI,GAAG,MAAA,KAAI,CAAC,KAAK,CAAC,IAAI,mCAAI,OAAO,CAAC,IAAI,CAAC;gBAC5C,IAAM,cAAc,GAAG,gBAAK,CAAC,MAAM,CAAC;gBACpC,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE,CAAC;oBACzC,OAAO,cAAc,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;gBACnC,CAAC;gBAED,OAAO,IAAI,CAAC;YACd,CAAC,CAC2B,CAC/B,CAAC;QACJ,CAAC;QACH,cAAC;IAAD,CAAC,AAlBqB,CAAc,WAAW,EAkB9C,CAAC;IAEF,IAAM,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC9E,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import React from 'react';\n\nimport type { SizeProp } from '../types/props.js';\nimport { defaultSizeValue } from './constants.js';\nimport { SizeControlContext } from './SizeControlContext.js';\n\ntype Constructor<T = NonNullable<unknown>> = new (...args: any[]) => T;\n\ninterface WithSizeProps {\n size?: SizeProp;\n}\n\nexport function withSize<T extends Constructor<React.Component<WithSizeProps>>>(constructor: T): WithSizeProps & T {\n const SizeDecorator = class extends constructor {\n public size: SizeProp = defaultSizeValue;\n\n public render(): React.ReactNode {\n return (\n <SizeControlContext.Consumer>\n {(context) => {\n this.size = this.props.size ?? context.size;\n const originalRender = super.render;\n if (typeof originalRender === 'function') {\n return originalRender.call(this);\n }\n\n return null;\n }}\n </SizeControlContext.Consumer>\n );\n }\n };\n\n const nameDescriptor = Object.getOwnPropertyDescriptor(SizeDecorator, 'name');\n if (!nameDescriptor || nameDescriptor.configurable) {\n Object.defineProperty(SizeDecorator, 'name', { value: constructor.name });\n }\n\n return SizeDecorator;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSizeControl.js","sourceRoot":"","sources":["../../../lib/size/useSizeControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSizeControl.js","sourceRoot":"","sources":["../../../lib/size/useSizeControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,aAAwB;IAC7C,IAAA,IAAI,GAAK,UAAU,CAAC,kBAAkB,CAAC,KAAnC,CAAoC;IAChD,OAAO,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,IAAI,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["import { useContext } from 'react';\n\nimport type { SizeProp } from '../types/props.js';\nimport { SizeControlContext } from './SizeControlContext.js';\n\nexport const useSizeControl = (propValueSize?: SizeProp): SizeProp => {\n const { size } = useContext(SizeControlContext);\n return propValueSize ?? size;\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clamp, floatFromPercent } from './ColorHelpers.js';
|
|
2
1
|
import { ColorFactory } from './ColorFactory.js';
|
|
2
|
+
import { clamp, floatFromPercent } from './ColorHelpers.js';
|
|
3
3
|
var DEFAULT_DARK = ColorFactory.create('#333333');
|
|
4
4
|
var DEFAULT_LIGHT = ColorFactory.create('#fff');
|
|
5
5
|
var ColorFunctionsCache = Object.create(null);
|
|
@@ -119,7 +119,7 @@ export var isValid = function (colorString) {
|
|
|
119
119
|
ColorFactory.create(colorString);
|
|
120
120
|
return true;
|
|
121
121
|
}
|
|
122
|
-
catch (
|
|
122
|
+
catch (_a) {
|
|
123
123
|
return false;
|
|
124
124
|
}
|
|
125
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorFunctions.js","sourceRoot":"","sources":["../../../lib/styles/ColorFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,IAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACpD,IAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClD,IAAM,mBAAmB,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAE3E,IAAM,aAAa,GAAG,UAAC,IAAY;IAAE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAAK,OAAA,UAAG,IAAI,cAAI,IAAI,CAAC,IAAI,EAAE,MAAG;AAAzB,CAAyB,CAA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,IAAI,GAAG,UAAC,WAAmB,EAAE,KAAa;IACrD,IAAM,GAAG,GAAG,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,IAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;QACvD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { clamp, floatFromPercent } from './ColorHelpers.js';\nimport { ColorFactory } from './ColorFactory.js';\nimport type { ColorObject } from './ColorObject.js';\n\ntype SignType = '+' | '-';\ntype MethodType = 'absolute' | 'relative';\n\nconst DEFAULT_DARK = ColorFactory.create('#333333');\nconst DEFAULT_LIGHT = ColorFactory.create('#fff');\nconst ColorFunctionsCache: { [key: string]: string } = Object.create(null);\n\nconst buildCacheKey = (name: string, ...args: any[]) => `${name}(${args.join()})`;\n\nconst shiftColor = (colorString: string, a: number | string, sign: SignType, method?: MethodType): string => {\n if (!colorString) {\n return '';\n }\n\n if (colorString.toLowerCase() === 'transparent') {\n return 'transparent';\n }\n\n let amount: number;\n if (typeof a === 'string') {\n amount = a.endsWith('%') ? floatFromPercent(a) : parseFloat(a);\n } else {\n amount = a;\n }\n amount = clamp(amount, 1);\n\n const color = ColorFactory.create(colorString);\n const hsl = color.toHSL();\n\n if (sign === '+') {\n hsl.l += method === 'relative' ? hsl.l * amount : amount;\n } else {\n hsl.l -= method === 'relative' ? hsl.l * amount : amount;\n }\n\n hsl.l = clamp(hsl.l);\n\n let newColor: ColorObject;\n if (color.alpha < 1) {\n newColor = ColorFactory.create(`hsla(${hsl.h}, ${hsl.s}, ${hsl.l}, ${hsl.a})`);\n } else {\n newColor = ColorFactory.create(`hsl(${hsl.h}, ${hsl.s}, ${hsl.l})`);\n }\n return newColor.toColorString(color.type);\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, white 20%);\n */\nexport function lighten(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('lighten', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '+', method);\n }\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, black 20%);\n */\nexport function darken(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('darken', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '-', method);\n return ColorFunctionsCache[key];\n }\n\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело. Рекомендуется использовать CSS Relative Color Syntax или CSS-переменные. Будет удалено в версии 7.0.\n */\nexport function contrast(colorString: string, darkString?: string, lightString?: string, threshold = 0.43): string {\n const key = buildCacheKey('contrast', colorString, darkString, lightString, threshold);\n if (!colorString) {\n ColorFunctionsCache[key] = '';\n }\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString);\n let dark = typeof darkString === 'undefined' ? DEFAULT_DARK : ColorFactory.create(darkString);\n let light = typeof lightString === 'undefined' ? DEFAULT_LIGHT : ColorFactory.create(lightString);\n\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n [dark, light] = [light, dark];\n }\n\n if (color.luma() < threshold) {\n ColorFunctionsCache[key] = light.alpha < 1 ? light.toRGBString() : light.toHEXString();\n } else {\n ColorFunctionsCache[key] = dark.alpha < 1 ? dark.toRGBString() : dark.toHEXString();\n }\n }\n return ColorFunctionsCache[key];\n}\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db r). Будет удалено в версии 7.0. */\nexport const red = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[0];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db g). Будет удалено в версии 7.0. */\nexport const green = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[1];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db b). Будет удалено в версии 7.0. */\nexport const blue = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[2];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax или color-mix. Будет удалено в версии 7.0. */\nexport const alpha = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.alpha;\n};\n\n/** @deprecated Устарело. Валидация на стороне JS не требуется при использовании нативного CSS. Будет удалено в версии 7.0. */\nexport const isValid = (colorString: string): boolean => {\n try {\n ColorFactory.create(colorString);\n return true;\n } catch (e) {\n return false;\n }\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, transparent 50%);\n */\nexport const fade = (colorString: string, alpha: number): string => {\n const key = buildCacheKey('fade', colorString, alpha);\n\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString).clone();\n color.alpha = alpha;\n ColorFunctionsCache[key] = color.toColorString(color.type === 'hex' ? 'rgba' : color.type);\n }\n return ColorFunctionsCache[key];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ColorFunctions.js","sourceRoot":"","sources":["../../../lib/styles/ColorFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,g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UAAC,WAAmB;IACvC,IAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC;AAEF,8HAA8H;AAC9H,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,WAAmB;IACzC,IAAI,CAAC;QACH,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,IAAM,IAAI,GAAG,UAAC,WAAmB,EAAE,KAAa;IACrD,IAAM,GAAG,GAAG,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,IAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;QACvD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { ColorFactory } from './ColorFactory.js';\nimport { clamp, floatFromPercent } from './ColorHelpers.js';\nimport type { ColorObject } from './ColorObject.js';\n\ntype SignType = '+' | '-';\ntype MethodType = 'absolute' | 'relative';\n\nconst DEFAULT_DARK = ColorFactory.create('#333333');\nconst DEFAULT_LIGHT = ColorFactory.create('#fff');\nconst ColorFunctionsCache: { [key: string]: string } = Object.create(null);\n\nconst buildCacheKey = (name: string, ...args: any[]) => `${name}(${args.join()})`;\n\nconst shiftColor = (colorString: string, a: number | string, sign: SignType, method?: MethodType): string => {\n if (!colorString) {\n return '';\n }\n\n if (colorString.toLowerCase() === 'transparent') {\n return 'transparent';\n }\n\n let amount: number;\n if (typeof a === 'string') {\n amount = a.endsWith('%') ? floatFromPercent(a) : parseFloat(a);\n } else {\n amount = a;\n }\n amount = clamp(amount, 1);\n\n const color = ColorFactory.create(colorString);\n const hsl = color.toHSL();\n\n if (sign === '+') {\n hsl.l += method === 'relative' ? hsl.l * amount : amount;\n } else {\n hsl.l -= method === 'relative' ? hsl.l * amount : amount;\n }\n\n hsl.l = clamp(hsl.l);\n\n let newColor: ColorObject;\n if (color.alpha < 1) {\n newColor = ColorFactory.create(`hsla(${hsl.h}, ${hsl.s}, ${hsl.l}, ${hsl.a})`);\n } else {\n newColor = ColorFactory.create(`hsl(${hsl.h}, ${hsl.s}, ${hsl.l})`);\n }\n return newColor.toColorString(color.type);\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, white 20%);\n */\nexport function lighten(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('lighten', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '+', method);\n }\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, black 20%);\n */\nexport function darken(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('darken', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '-', method);\n return ColorFunctionsCache[key];\n }\n\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело. Рекомендуется использовать CSS Relative Color Syntax или CSS-переменные. Будет удалено в версии 7.0.\n */\nexport function contrast(colorString: string, darkString?: string, lightString?: string, threshold = 0.43): string {\n const key = buildCacheKey('contrast', colorString, darkString, lightString, threshold);\n if (!colorString) {\n ColorFunctionsCache[key] = '';\n }\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString);\n let dark = typeof darkString === 'undefined' ? DEFAULT_DARK : ColorFactory.create(darkString);\n let light = typeof lightString === 'undefined' ? DEFAULT_LIGHT : ColorFactory.create(lightString);\n\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n [dark, light] = [light, dark];\n }\n\n if (color.luma() < threshold) {\n ColorFunctionsCache[key] = light.alpha < 1 ? light.toRGBString() : light.toHEXString();\n } else {\n ColorFunctionsCache[key] = dark.alpha < 1 ? dark.toRGBString() : dark.toHEXString();\n }\n }\n return ColorFunctionsCache[key];\n}\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db r). Будет удалено в версии 7.0. */\nexport const red = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[0];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db g). Будет удалено в версии 7.0. */\nexport const green = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[1];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db b). Будет удалено в версии 7.0. */\nexport const blue = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[2];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax или color-mix. Будет удалено в версии 7.0. */\nexport const alpha = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.alpha;\n};\n\n/** @deprecated Устарело. Валидация на стороне JS не требуется при использовании нативного CSS. Будет удалено в версии 7.0. */\nexport const isValid = (colorString: string): boolean => {\n try {\n ColorFactory.create(colorString);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, transparent 50%);\n */\nexport const fade = (colorString: string, alpha: number): string => {\n const key = buildCacheKey('fade', colorString, alpha);\n\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString).clone();\n color.alpha = alpha;\n ColorFunctionsCache[key] = color.toColorString(color.type === 'hex' ? 'rgba' : color.type);\n }\n return ColorFunctionsCache[key];\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationKeyframes.js","sourceRoot":"","sources":["../../../lib/theming/AnimationKeyframes.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"AnimationKeyframes.js","sourceRoot":"","sources":["../../../lib/theming/AnimationKeyframes.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,CAAC,IAAM,qBAAqB,GAAG,gBAAgB,CAAC,UAAC,EAAsB;QAApB,SAAS,eAAA;IAAgB,OAAA,CAAC;QACjF,mBAAmB;YACjB,OAAO,SAAS,kKAAA,+FAGb,KAAC;QACN,CAAC;QACD,mBAAmB;YACjB,OAAO,SAAS,uOAAA,oKAIb,KAAC;QACN,CAAC;QACD,mBAAmB;YACjB,OAAO,SAAS,0HAAA,uDAEb,KAAC;QACN,CAAC;QACD,YAAY,YAAC,CAAQ;YACnB,OAAO,SAAS,mNAAA,+BACS,EAAK,6BACV,EAAQ,6BACR,EAAO,kCACF,EAAO,aAC7B,KAJsB,CAAC,CAAC,GAAG,EACV,CAAC,CAAC,MAAM,EACR,CAAC,CAAC,KAAK,EACF,CAAC,CAAC,KAAK,EAC5B;QACN,CAAC;KACF,CAAC;AA3BgF,CA2BhF,CAAC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\n\nimport { memoizeGetStyles } from './Emotion.js';\nimport type { Theme } from './Theme.js';\n\nexport const getAnimationKeyframes = memoizeGetStyles(({ keyframes }: Emotion) => ({\n spinnerCircleOffset() {\n return keyframes`\n 0% { stroke-dashoffset: 231.25%; }\n 100% { stroke-dashoffset: 0%; }\n `;\n },\n spinnerCircleLength() {\n return keyframes`\n 0% { stroke-dasharray: 62.5%, 168.75%; }\n 50% { stroke-dasharray: 187.5%, 43.75%; }\n 100% { stroke-dasharray: 62.5%, 168.75%; }\n `;\n },\n spinnerCircleRotate() {\n return keyframes`\n 100% { transform: rotate(360deg); }\n `;\n },\n spinnerColor(t: Theme) {\n return keyframes`\n 100%, 0% { stroke: ${t.red}; }\n 40% { stroke: ${t.yellow}; }\n 66% { stroke: ${t.green}; }\n 80%, 90% { stroke: ${t.brand}; }\n `;\n },\n}));\n"]}
|
package/lib/theming/Emotion.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Emotion } from '@emotion/css/create-instance';
|
|
2
|
+
import type { GetOffsetParent, PopupStrategy } from '../renderEnvironment/RenderEnvironmentContext.js';
|
|
2
3
|
import type { Theme } from './Theme.js';
|
|
3
4
|
export declare const REACT_UI_PREFIX: string;
|
|
4
5
|
export declare const getEmotion: ({ key, container, nonce, }: {
|
|
5
|
-
container
|
|
6
|
+
container?: HTMLElement | null;
|
|
6
7
|
key?: string;
|
|
7
8
|
nonce?: string;
|
|
8
9
|
}) => Emotion;
|
|
@@ -13,3 +14,18 @@ export type StylesGetter<S> = (emotion: Emotion) => S;
|
|
|
13
14
|
export declare const memoizeStyle: <S extends StylesObject>(styles: S) => S;
|
|
14
15
|
export declare const memoizeGetStyles: <S extends StylesObject>(getStyles: StylesGetter<S>) => StylesGetter<S>;
|
|
15
16
|
export declare const prefix: (component: string, app?: string) => <T extends Record<string, string>>(classes: T) => T;
|
|
17
|
+
export declare const EmotionContext: import("react").Context<Emotion>;
|
|
18
|
+
export declare const EmotionConsumer: import("react").Consumer<Emotion>;
|
|
19
|
+
export declare const EmotionProvider: import("react").Provider<Emotion>;
|
|
20
|
+
export declare const PopupContext: import("react").Context<{
|
|
21
|
+
getOffsetParent?: GetOffsetParent;
|
|
22
|
+
popupStrategy?: PopupStrategy;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const PopupConsumer: import("react").Consumer<{
|
|
25
|
+
getOffsetParent?: GetOffsetParent;
|
|
26
|
+
popupStrategy?: PopupStrategy;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const PopupProvider: import("react").Provider<{
|
|
29
|
+
getOffsetParent?: GetOffsetParent;
|
|
30
|
+
popupStrategy?: PopupStrategy;
|
|
31
|
+
}>;
|
package/lib/theming/Emotion.js
CHANGED
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import createEmotion from '@emotion/css/create-instance';
|
|
13
|
+
import { createContext } from 'react';
|
|
13
14
|
import extraScopePlugin from 'stylis-plugin-extra-scope';
|
|
14
15
|
import { Upgrade } from '../Upgrades.js';
|
|
15
16
|
export var REACT_UI_PREFIX = Upgrade.getSpecificityClassName();
|
|
@@ -20,21 +21,21 @@ export var getEmotion = function (_a) {
|
|
|
20
21
|
key: key,
|
|
21
22
|
prepend: true,
|
|
22
23
|
stylisPlugins: scope ? [extraScopePlugin(scope)] : undefined,
|
|
23
|
-
container: container,
|
|
24
|
+
container: container !== null && container !== void 0 ? container : undefined,
|
|
24
25
|
nonce: nonce,
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
function isZeroArgs(fn) {
|
|
28
29
|
return fn.length === 0;
|
|
29
30
|
}
|
|
30
|
-
var memoize = function (fn) {
|
|
31
|
+
var memoize = function (fn, context) {
|
|
31
32
|
if (isZeroArgs(fn)) {
|
|
32
33
|
var isCalled_1 = false;
|
|
33
34
|
var result_1;
|
|
34
35
|
return function () {
|
|
35
36
|
if (!isCalled_1) {
|
|
36
37
|
isCalled_1 = true;
|
|
37
|
-
result_1 = fn();
|
|
38
|
+
result_1 = fn.call(context);
|
|
38
39
|
}
|
|
39
40
|
return result_1;
|
|
40
41
|
};
|
|
@@ -42,13 +43,13 @@ var memoize = function (fn) {
|
|
|
42
43
|
var cache = new WeakMap();
|
|
43
44
|
return function (arg) {
|
|
44
45
|
if (!cache.has(arg)) {
|
|
45
|
-
cache.set(arg, fn(arg));
|
|
46
|
+
cache.set(arg, fn.call(context, arg));
|
|
46
47
|
}
|
|
47
48
|
return cache.get(arg);
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
export var memoizeStyle = function (styles) {
|
|
51
|
-
Object.keys(styles).forEach(function (className) { return (styles[className] = memoize(styles[className])); });
|
|
52
|
+
Object.keys(styles).forEach(function (className) { return (styles[className] = memoize(styles[className], styles)); });
|
|
52
53
|
return styles;
|
|
53
54
|
};
|
|
54
55
|
export var memoizeGetStyles = function (getStyles) {
|
|
@@ -69,4 +70,14 @@ export var prefix = function (component, app) {
|
|
|
69
70
|
}, {});
|
|
70
71
|
};
|
|
71
72
|
};
|
|
73
|
+
export var EmotionContext = createContext(getEmotion({}));
|
|
74
|
+
export var EmotionConsumer = EmotionContext.Consumer;
|
|
75
|
+
export var EmotionProvider = EmotionContext.Provider;
|
|
76
|
+
export var PopupContext = createContext({
|
|
77
|
+
getOffsetParent: function () { return null; },
|
|
78
|
+
});
|
|
79
|
+
export var PopupConsumer = PopupContext.Consumer;
|
|
80
|
+
export var PopupProvider = PopupContext.Provider;
|
|
81
|
+
EmotionContext.displayName = 'EmotionContext';
|
|
82
|
+
EmotionContext.__KONTUR_REACT_UI__ = 'EmotionContext';
|
|
72
83
|
//# sourceMappingURL=Emotion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Emotion.js","sourceRoot":"","sources":["../../../lib/theming/Emotion.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Emotion.js","sourceRoot":"","sources":["../../../lib/theming/Emotion.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,aAAa,M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UAAC,GAAG,EAAE,GAAG;;YACnC,6BAAY,GAAG,gBAAG,GAAG,IAAG,UAAG,GAAG,cAAI,SAAS,cAAI,OAAO,CAAC,GAAG,CAAC,CAAE,OAAG;QAClE,CAAC,EAAE,EAAO,CAAC;IAFX,CAEW;AAHb,CAGa,CAAC;AAEhB,MAAM,CAAC,IAAM,cAAc,GAAG,aAAa,CAAU,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AACrE,MAAM,CAAC,IAAM,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC;AACvD,MAAM,CAAC,IAAM,eAAe,GAAG,cAAc,CAAC,QAAQ,CAAC;AAEvD,MAAM,CAAC,IAAM,YAAY,GAAG,aAAa,CAGtC;IACD,eAAe,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;CAC5B,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnD,MAAM,CAAC,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC;AAEnD,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC9C,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport createEmotion from '@emotion/css/create-instance';\nimport { createContext } from 'react';\nimport extraScopePlugin from 'stylis-plugin-extra-scope';\n\nimport type { GetOffsetParent, PopupStrategy } from '../renderEnvironment/RenderEnvironmentContext.js';\nimport { Upgrade } from '../Upgrades.js';\nimport type { AnyObject, FunctionWithParams } from '../utils.js';\nimport type { Theme } from './Theme.js';\n\nexport const REACT_UI_PREFIX = Upgrade.getSpecificityClassName();\n\nconst scope = new Array(Upgrade.getSpecificityLevel()).fill(`.${REACT_UI_PREFIX}`).join('');\n\nexport const getEmotion = ({\n key = REACT_UI_PREFIX,\n container,\n nonce,\n}: {\n container?: HTMLElement | null;\n key?: string;\n nonce?: string;\n}): Emotion =>\n createEmotion({\n key,\n prepend: true,\n stylisPlugins: scope ? [extraScopePlugin(scope)] : undefined,\n container: container ?? undefined,\n nonce,\n });\n\nfunction isZeroArgs<R, T extends FunctionWithParams<R>>(fn: T | FunctionWithParams<R>): fn is () => R {\n return fn.length === 0;\n}\n\nconst memoize = <A extends AnyObject, R>(\n fn: (() => R) | ((arg: A) => R),\n context: Record<string, unknown>,\n): (() => R) | ((arg: A) => R) => {\n if (isZeroArgs(fn)) {\n let isCalled = false;\n let result: R;\n return () => {\n if (!isCalled) {\n isCalled = true;\n result = fn.call(context);\n }\n return result;\n };\n }\n\n const cache = new WeakMap();\n return (arg: A) => {\n if (!cache.has(arg)) {\n cache.set(arg, fn.call(context, arg));\n }\n\n return cache.get(arg);\n };\n};\n\nexport interface StylesObject {\n [className: string]: (() => string) | ((t: Theme) => string);\n}\n\nexport type StylesGetter<S> = (emotion: Emotion) => S;\n\nexport const memoizeStyle = <S extends StylesObject>(styles: S): S => {\n Object.keys(styles).forEach(\n (className) => (styles[className as keyof S] = memoize(styles[className], styles) as S[keyof S]),\n );\n return styles;\n};\n\nexport const memoizeGetStyles = <S extends StylesObject>(getStyles: StylesGetter<S>): StylesGetter<S> => {\n const stylesCache = new WeakMap<Emotion, S>();\n return (emotion: Emotion): S => {\n if (!stylesCache.has(emotion)) {\n stylesCache.set(emotion, memoizeStyle(getStyles(emotion)));\n }\n\n return stylesCache.get(emotion) as S;\n };\n};\n\nexport const prefix =\n (component: string, app = REACT_UI_PREFIX) =>\n <T extends Record<string, string>>(classes: T): T =>\n Object.keys(classes).reduce((acc, key) => {\n return { ...acc, [key]: `${app}-${component}-${classes[key]}` };\n }, {} as T);\n\nexport const EmotionContext = createContext<Emotion>(getEmotion({}));\nexport const EmotionConsumer = EmotionContext.Consumer;\nexport const EmotionProvider = EmotionContext.Provider;\n\nexport const PopupContext = createContext<{\n getOffsetParent?: GetOffsetParent;\n popupStrategy?: PopupStrategy;\n}>({\n getOffsetParent: () => null,\n});\nexport const PopupConsumer = PopupContext.Consumer;\nexport const PopupProvider = PopupContext.Provider;\n\nEmotionContext.displayName = 'EmotionContext';\nEmotionContext.__KONTUR_REACT_UI__ = 'EmotionContext';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNonNullable } from '../utils.js';
|
|
2
|
-
import {
|
|
2
|
+
import { REACT_UI_THEME_MARKERS, findPropertyDescriptor } from './ThemeHelpers.js';
|
|
3
3
|
import { LIGHT_THEME } from './themes/LightTheme.js';
|
|
4
4
|
var ThemeFactory = /** @class */ (function () {
|
|
5
5
|
function ThemeFactory() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeFactory.js","sourceRoot":"","sources":["../../../lib/theming/ThemeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeFactory.js","sourceRoot":"","sources":["../../../lib/theming/ThemeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;IAAA;IA4DA,CAAC;IAlDC,sBAAkB,4BAAY;aAA9B;YACE,OAAO,IAAI,CAAC,uBAAuB,CAAC;QACtC,CAAC;;;OAAA;IAEa,mBAAM,GAApB,UAAwB,KAA2B,EAAE,SAAiB;QACpE,IAAM,IAAI,GAAG,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC;QAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEa,8BAAiB,GAA/B,UAAgC,KAAY;QAA5C,iBAYC;QAXC,0BAA0B;QAC1B,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAC,YAAY;YAC3D,IAAM,UAAU,GAAG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pE,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IA1DD;;;;;;OAMG;IACqB,oCAAuB,GAAU,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAoDtF,mBAAC;CAAA,AA5DD,IA4DC;SA5DY,YAAY","sourcesContent":["import type { NoInfer } from '../utils.js';\nimport { isNonNullable } from '../utils.js';\nimport type { Theme, ThemeIn } from './Theme.js';\nimport { REACT_UI_THEME_MARKERS, findPropertyDescriptor } from './ThemeHelpers.js';\nimport { LIGHT_THEME } from './themes/LightTheme.js';\n\nexport class ThemeFactory {\n /**\n * The default theme created with Object.create() is needed for the \"overrideBaseTheme\" to work.\n *\n * Themes should be frozen objects. But it is not possible to define properties on frozen objects.\n * So, an object created by Object.create({ *frozen_object* }) acts as frozen too,\n * but allows to apply Object.defineProperty to his own properties.\n */\n private static readonly overridableDefaultTheme: Theme = Object.create(LIGHT_THEME);\n\n public static get defaultTheme(): Theme {\n return this.overridableDefaultTheme;\n }\n\n public static create<T>(theme: ThemeIn & NoInfer<T>, baseTheme?: Theme): Readonly<Theme & NoInfer<T>> {\n const base = baseTheme || this.defaultTheme;\n return this.constructTheme(base, theme);\n }\n\n public static overrideBaseTheme(theme: Theme): void {\n // copying theme variables\n ThemeFactory.getKeys(this.defaultTheme).forEach((variableName) => {\n const descriptor = findPropertyDescriptor(theme, variableName);\n Object.defineProperty(this.defaultTheme, variableName, descriptor);\n });\n\n // copying theme markers\n Object.values(REACT_UI_THEME_MARKERS).forEach((marker) => {\n const descriptor = findPropertyDescriptor(theme, marker.key);\n Object.defineProperty(this.defaultTheme, marker.key, descriptor);\n });\n }\n\n public static getKeys<T extends Theme>(theme: T): Array<keyof T> {\n const keys: Array<keyof T> = [];\n while (isNonNullable(theme)) {\n (Object.keys(theme) as typeof keys).forEach((key) => {\n if (!keys.includes(key)) {\n keys.push(key);\n }\n });\n // TODO: Enable `no-param-reassign` rule.\n // eslint-disable-next-line no-param-reassign\n theme = Object.getPrototypeOf(theme);\n }\n\n return keys.sort();\n }\n\n private static constructTheme(base: Theme, theme: ThemeIn) {\n const newTheme = Object.create(base);\n Object.keys(theme).forEach((propName) => {\n const descriptor = Object.getOwnPropertyDescriptor(theme, propName);\n if (descriptor) {\n Object.defineProperty(newTheme, propName, descriptor);\n }\n });\n\n return Object.freeze(newTheme);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeHelpers.js","sourceRoot":"","sources":["../../../lib/theming/ThemeHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeHelpers.js","sourceRoot":"","sources":["../../../lib/theming/ThemeHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKvD;;;;GAIG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,KAAY;IACxC,IAAM,WAAW,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAC,GAAG;QACnC,IAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;YACpE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC;YAC7B,MAAM,CAAC,cAAc,CAAC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GAAwB,OAAO,eAA/B,EAAE,KAAsB,OAAO,aAAZ,EAAjB,YAAY,mBAAG,EAAE,KAAA,CAAa;IAElE,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,IAAM,KAAK,GAAG,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;IAEpE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import warning from 'warning';\n\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { isNonNullable } from '../utils.js';\nimport type { Theme, ThemeIn } from './Theme.js';\nimport type { ThemeVersions } from './ThemeVersions.js';\nimport { isThemeVersionGTE } from './ThemeVersions.js';\n\nexport type Marker = (theme: Theme) => Theme;\nexport type Markers = Marker[];\n\n/**\n * Makes all computable theme variables (getters) visible to the Object.keys(theme)\n * @param theme Theme object\n * @returns The given theme object with all getters made enumerable\n */\nexport const exposeGetters = (theme: Theme): Theme => {\n const descriptors = Object.getOwnPropertyDescriptors(theme);\n Object.keys(descriptors).forEach((key) => {\n const descriptor = descriptors[key];\n if (typeof descriptor.get === 'function' && descriptor.configurable) {\n descriptor.enumerable = true;\n Object.defineProperty(theme, key, descriptor);\n }\n });\n return theme;\n};\n\nexport const REACT_UI_THEME_MARKERS: {\n darkTheme: {\n key: string;\n value: true;\n };\n themeVersion: {\n key: string;\n value: ThemeVersions | null;\n };\n} = {\n darkTheme: {\n key: '__IS_REACT_UI_DARK_THEME__',\n value: true,\n },\n themeVersion: {\n key: '__REACT_UI_THEME_VERSION__',\n value: null,\n },\n};\n\n// backward compatible\nexport const REACT_UI_DARK_THEME_KEY = REACT_UI_THEME_MARKERS.darkTheme.key;\n\nexport const isDarkTheme = (theme: Theme | ThemeIn): boolean => {\n // @ts-expect-error: internal value.\n return theme[REACT_UI_THEME_MARKERS.darkTheme.key] === REACT_UI_THEME_MARKERS.darkTheme.value;\n};\n\n/**\n * Marks the given theme as \"dark\"\n * @param theme Theme object\n * @returns The given theme object with a \"dark theme\" mark\n */\nexport const markAsDarkTheme: Marker = (theme) => {\n return Object.create(theme, {\n [REACT_UI_THEME_MARKERS.darkTheme.key]: {\n value: REACT_UI_THEME_MARKERS.darkTheme.value,\n writable: false,\n enumerable: false,\n configurable: false,\n },\n });\n};\n\n/**\n * Creates a marker for the theme, that will mark it with a version\n * @param version Theme version\n * @returns A marker that marks the given theme with the given version once applied\n */\nexport const markThemeVersion: (version: ThemeVersions) => Marker = (version) => (theme) => {\n return Object.create(theme, {\n [REACT_UI_THEME_MARKERS.themeVersion.key]: {\n value: version || REACT_UI_THEME_MARKERS.themeVersion.value,\n writable: false,\n enumerable: false,\n configurable: false,\n },\n });\n};\n\n/**\n * Checks if the given theme's version is \"greater or equal\" then the given version\n * @param theme Theme object\n * @param version A string version\n * @returns Boolean result\n */\nexport const isThemeGTE = (theme: Theme | ThemeIn, version: ThemeVersions): boolean => {\n const themeVersion: Nullable<ThemeVersions> =\n // @ts-expect-error: internal value.\n theme[REACT_UI_THEME_MARKERS.themeVersion.key];\n\n if (!themeVersion) {\n warning(false, `[ThemeHelpers]: The theme doesn't have a version. Checking for ${version}.`);\n return false;\n }\n\n return isThemeVersionGTE(themeVersion, version);\n};\n\n/**\n * Finds the given theme's object property descriptor by its name\n * @param theme Theme object\n * @param propName The property name\n * @returns The found descriptor or an empty object\n */\nexport function findPropertyDescriptor(theme: Theme, propName: string): PropertyDescriptor {\n // TODO: Rewrite for loop.\n // TODO: Enable `no-param-reassign` rule.\n // eslint-disable-next-line no-param-reassign\n for (; isNonNullable(theme); theme = Object.getPrototypeOf(theme)) {\n if (Object.prototype.hasOwnProperty.call(theme, propName)) {\n return Object.getOwnPropertyDescriptor(theme, propName) || {};\n }\n }\n return {};\n}\n\n/**\n * Marks the given theme with the given markers\n * @param theme Theme object\n * @param markers Markers array\n * @returns The given theme marked with the given marks\n */\nexport function applyMarkers(theme: Theme, markers: Markers): Theme {\n return markers.reduce((markedTheme, marker) => {\n return marker(markedTheme);\n }, Object.create(theme));\n}\n\n/**\n * Creates a theme object out of the given class with variables\n * @param options Options object\n * @param options.themeClass A class with variables\n * @param [options.prototypeTheme] An optional prototype theme, that will be the base for the new theme\n * @param [options.themeMarkers] An optional array of markers, that new them will be marked of\n * @returns The new theme object\n */\nexport function createTheme(options: { themeClass: Theme; prototypeTheme?: Theme; themeMarkers?: Markers }): Theme {\n const { themeClass, prototypeTheme, themeMarkers = [] } = options;\n\n if (prototypeTheme) {\n Object.setPrototypeOf(themeClass, prototypeTheme);\n }\n\n const theme = applyMarkers(exposeGetters(themeClass), themeMarkers);\n\n return Object.freeze(theme);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../lib/theming/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../../lib/theming/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,IAAM,QAAQ,GAAG;IACtB,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { useContext } from 'react';\n\nimport type { BasicThemeClass } from '../../internal/themes/BasicTheme.js';\nimport { ThemeContext } from './ThemeContext.js';\n\nexport const useTheme = (): Readonly<typeof BasicThemeClass> => {\n return useContext(ThemeContext);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorphic-component.js","sourceRoot":"","sources":["../../../lib/types/polymorphic-component.ts"],"names":[],"mappings":"","sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"polymorphic-component.js","sourceRoot":"","sources":["../../../lib/types/polymorphic-component.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from 'react';\nimport type React from 'react';\n\nimport type { Merge } from '../../typings/utility-types.js';\n\ntype PropsWithComponent<P, T extends React.ElementType> = P & {\n /**\n * Компонент, используемый в качестве корневого узла.\n */\n component?: T;\n};\n\nexport type PolymorphicPropsWithoutRef<P, T extends React.ElementType> = Merge<\n T extends keyof JSX.IntrinsicElements\n ? React.PropsWithoutRef<JSX.IntrinsicElements[T]>\n : React.ComponentPropsWithoutRef<T>,\n PropsWithComponent<P, T>\n>;\n\nexport type PolymorphicPropsWithRef<P, T extends React.ElementType> = Merge<\n T extends keyof JSX.IntrinsicElements ? React.PropsWithRef<JSX.IntrinsicElements[T]> : React.ComponentPropsWithRef<T>,\n PropsWithComponent<P, T>\n>;\n\ntype PolymorphicExoticComponent<P = Record<string, unknown>, T extends React.ElementType = React.ElementType> = Merge<\n React.ExoticComponent<P & { [key: string]: unknown }>,\n {\n <InstanceT extends React.ElementType = T>(\n props: PolymorphicPropsWithRef<P, InstanceT>,\n ): React.ReactElement<any> | null;\n }\n>;\n\nexport type PolymorphicForwardRefExoticComponent<P, T extends React.ElementType> = Merge<\n React.ForwardRefExoticComponent<P & { [key: string]: unknown }>,\n PolymorphicExoticComponent<P, T>\n>;\n"]}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { GlobalObject } from '../lib/globalObject.js';
|
|
3
|
-
import type { CurrencyInputProps } from '../components/CurrencyInput/index.js';
|
|
4
|
-
import type { PasswordInputProps } from '../components/PasswordInput/index.js';
|
|
5
|
-
import type { InputProps } from '../components/Input/index.js';
|
|
6
2
|
import type { AutocompleteProps } from '../components/Autocomplete/index.js';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
3
|
+
import type { ButtonProps } from '../components/Button/index.js';
|
|
4
|
+
import type { CurrencyInputProps } from '../components/CurrencyInput/index.js';
|
|
9
5
|
import type { DropdownProps } from '../components/Dropdown/index.js';
|
|
10
6
|
import type { DropdownMenuProps } from '../components/DropdownMenu/index.js';
|
|
11
|
-
import type {
|
|
12
|
-
import type { TooltipProps } from '../components/Tooltip/index.js';
|
|
7
|
+
import type { FxInputProps } from '../components/FxInput/index.js';
|
|
13
8
|
import type { HintProps } from '../components/Hint/index.js';
|
|
9
|
+
import type { InputProps } from '../components/Input/index.js';
|
|
10
|
+
import type { PasswordInputProps } from '../components/PasswordInput/index.js';
|
|
11
|
+
import type { SelectProps } from '../components/Select/index.js';
|
|
12
|
+
import type { TooltipProps } from '../components/Tooltip/index.js';
|
|
13
|
+
import type { GlobalObject } from '../lib/globalObject.js';
|
|
14
14
|
export { delay } from './delay.js';
|
|
15
15
|
export type Defaultize<P, D> = P extends any ? string extends keyof P ? P : Pick<P, Exclude<keyof P, keyof D>> & Partial<Pick<P, Extract<keyof P, keyof D>>> & Partial<Pick<D, Exclude<keyof D, keyof P>>> : never;
|
|
16
16
|
export type DefaultizeProps<C, P> = C extends {
|