@consta/uikit 5.30.0 → 5.32.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/ColorPicker/index.d.ts +1 -0
- package/ColorPicker/index.js +1 -0
- package/FileCanary/index.d.ts +1 -0
- package/FileCanary/index.js +1 -0
- package/__internal__/src/components/Attachment/Attachment.css +1 -1
- package/__internal__/src/components/Attachment/types.d.ts +1 -1
- package/__internal__/src/components/Attachment/types.js.map +1 -1
- package/__internal__/src/components/AttachmentDeprecated/Attachment.css +1 -1
- package/__internal__/src/components/AttachmentDeprecated/AttachmentDeprecated.js.map +1 -1
- package/__internal__/src/components/AttachmentDeprecated/types.d.ts +1 -1
- package/__internal__/src/components/AttachmentDeprecated/types.js.map +1 -1
- package/__internal__/src/components/AutoComplete/AutoComplete.js +1 -1
- package/__internal__/src/components/AutoComplete/AutoComplete.js.map +1 -1
- package/__internal__/src/components/AutoComplete/helpers.d.ts +1 -0
- package/__internal__/src/components/AutoComplete/types.d.ts +1 -0
- package/__internal__/src/components/AutoComplete/types.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeText/AutoCompleteTypeText.js +1 -1
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeText/AutoCompleteTypeText.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeTextArray/AutoCompleteTypeTextArray.js +1 -1
- package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeTextArray/AutoCompleteTypeTextArray.js.map +1 -1
- package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -0
- package/__internal__/src/components/AutoCompleteCanary/types.d.ts +1 -0
- package/__internal__/src/components/AutoCompleteCanary/types.js.map +1 -1
- package/__internal__/src/components/Avatar/Avatar.d.ts +2 -2
- package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/types.d.ts +2 -2
- package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
- package/__internal__/src/components/Badge/Badge.css +2 -2
- package/__internal__/src/components/Badge/maps.js.map +1 -1
- package/__internal__/src/components/Badge/types.d.ts +4 -4
- package/__internal__/src/components/Badge/types.js.map +1 -1
- package/__internal__/src/components/Banner/Banner.d.ts +4 -4
- package/__internal__/src/components/Banner/Banner.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/BookmarkTabs.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/types.d.ts +3 -3
- package/__internal__/src/components/BookmarkTabs/types.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/types.d.ts +2 -2
- package/__internal__/src/components/Breadcrumbs/types.js.map +1 -1
- package/__internal__/src/components/Button/Button.d.ts +4 -4
- package/__internal__/src/components/Button/Button.js.map +1 -1
- package/__internal__/src/components/Card/Card.d.ts +3 -3
- package/__internal__/src/components/Card/Card.js.map +1 -1
- package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
- package/__internal__/src/components/Checkbox/Checkbox.d.ts +3 -3
- package/__internal__/src/components/Checkbox/Checkbox.js.map +1 -1
- package/__internal__/src/components/CheckboxDeprecated/Checkbox.css +2 -2
- package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.d.ts +3 -3
- package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/types.d.ts +4 -4
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/Chips/ChipsItem/ChipsItem.css +2 -2
- package/__internal__/src/components/Chips/types.d.ts +2 -2
- package/__internal__/src/components/Chips/types.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/types.d.ts +4 -4
- package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
- package/__internal__/src/components/Collapse/types.d.ts +7 -7
- package/__internal__/src/components/Collapse/types.js.map +1 -1
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.css +7 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.d.ts +4 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.d.ts +16 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.d.ts +13 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.d.ts +3 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.d.ts +25 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.css +3 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.d.ts +5 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.d.ts +25 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.d.ts +15 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.d.ts +8 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.d.ts +16 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.d.ts +13 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js.map +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js.map +1 -0
- package/__internal__/src/components/ColorPicker/index.d.ts +10 -0
- package/__internal__/src/components/ColorPicker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/index.d.ts +14 -0
- package/__internal__/src/components/ColorPicker/models/index.js +2 -0
- package/__internal__/src/components/ColorPicker/models/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/types.d.ts +33 -0
- package/__internal__/src/components/ColorPicker/types.js +2 -0
- package/__internal__/src/components/ColorPicker/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/compare.d.ts +4 -0
- package/__internal__/src/components/ColorPicker/utils/compare.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/compare.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/convert.d.ts +32 -0
- package/__internal__/src/components/ColorPicker/utils/convert.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/convert.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/format.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/format.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/format.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/round.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/round.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/round.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/validate.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/validate.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/validate.js.map +1 -0
- package/__internal__/src/components/Combobox/Combobox.js +1 -1
- package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
- package/__internal__/src/components/Combobox/helpers.d.ts +3 -1
- package/__internal__/src/components/Combobox/helpers.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js.map +1 -1
- package/__internal__/src/components/ContextMenu/helpers.d.ts +4 -2
- package/__internal__/src/components/ContextMenu/types.d.ts +6 -3
- package/__internal__/src/components/ContextMenu/types.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +2 -0
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/getChangeFnRange.js +1 -1
- package/__internal__/src/components/DatePicker/getChangeFnRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/types.d.ts +7 -6
- package/__internal__/src/components/DatePicker/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.d.ts +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeGrid/DateTimeGrid.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/index.js +1 -1
- package/__internal__/src/components/DateTime/helpers/index.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -3
- package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/types.d.ts +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/types.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.css +4 -2
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.d.ts +5 -2
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.d.ts +1 -0
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js.map +1 -1
- package/__internal__/src/components/FieldGroup/getForm.js +1 -1
- package/__internal__/src/components/FieldGroup/getForm.js.map +1 -1
- package/__internal__/src/components/FileCanary/FileCanary.d.ts +1 -0
- package/__internal__/src/components/FileCanary/FileCanary.js +2 -0
- package/__internal__/src/components/FileCanary/FileCanary.js.map +1 -0
- package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.css +1 -0
- package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.d.ts +4 -0
- package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.js +2 -0
- package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.js.map +1 -0
- package/__internal__/src/components/FileCanary/config.d.ts +2 -0
- package/__internal__/src/components/FileCanary/config.js +2 -0
- package/__internal__/src/components/FileCanary/config.js.map +1 -0
- package/__internal__/src/components/FileCanary/fileCanaryGenerator.d.ts +2 -0
- package/__internal__/src/components/FileCanary/fileCanaryGenerator.js +2 -0
- package/__internal__/src/components/FileCanary/fileCanaryGenerator.js.map +1 -0
- package/__internal__/src/components/FileCanary/index.d.ts +4 -0
- package/__internal__/src/components/FileCanary/index.js +2 -0
- package/__internal__/src/components/FileCanary/index.js.map +1 -0
- package/__internal__/src/components/FileCanary/types.d.ts +25 -0
- package/__internal__/src/components/FileCanary/types.js +2 -0
- package/__internal__/src/components/FileCanary/types.js.map +1 -0
- package/__internal__/src/components/FlatSelect/FlatSelect.css +8 -8
- package/__internal__/src/components/FlatSelect/FlatSelect.js +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelect.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.d.ts +1 -0
- package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js.map +1 -1
- package/__internal__/src/components/FlatSelect/types.d.ts +1 -0
- package/__internal__/src/components/FlatSelect/types.js.map +1 -1
- package/__internal__/src/components/Grid/types.d.ts +4 -4
- package/__internal__/src/components/Grid/types.js.map +1 -1
- package/__internal__/src/components/GridDeprecated/Grid.css +1 -1
- package/__internal__/src/components/GridDeprecated/GridDeprecated.d.ts +4 -4
- package/__internal__/src/components/GridDeprecated/GridDeprecated.js.map +1 -1
- package/__internal__/src/components/Informer/Informer.d.ts +3 -3
- package/__internal__/src/components/Informer/Informer.js.map +1 -1
- package/__internal__/src/components/Layout/Layout.d.ts +3 -3
- package/__internal__/src/components/Layout/Layout.js.map +1 -1
- package/__internal__/src/components/Layout/useFixed.d.ts +2 -2
- package/__internal__/src/components/Layout/useFixed.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListCanary.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListItemGrid/ListItemGrid.css +1 -1
- package/__internal__/src/components/ListCanary/types.d.ts +4 -4
- package/__internal__/src/components/ListCanary/types.js.map +1 -1
- package/__internal__/src/components/LoaderDeprecated/Loader.css +2 -2
- package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.d.ts +1 -1
- package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.js.map +1 -1
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +4 -4
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.d.ts +2 -2
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js.map +1 -1
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js +1 -1
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js.map +1 -1
- package/__internal__/src/components/Pagination/types.d.ts +3 -3
- package/__internal__/src/components/Pagination/types.js.map +1 -1
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.d.ts +4 -4
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.js.map +1 -1
- package/__internal__/src/components/Popover/Popover.d.ts +2 -2
- package/__internal__/src/components/Popover/Popover.js.map +1 -1
- package/__internal__/src/components/ProgressLine/ProgressLine.css +1 -1
- package/__internal__/src/components/ProgressLine/types.d.ts +1 -1
- package/__internal__/src/components/ProgressLine/types.js.map +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +8 -8
- package/__internal__/src/components/ProgressStepBar/helpers.d.ts +5 -5
- package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
- package/__internal__/src/components/Radio/Radio.css +1 -1
- package/__internal__/src/components/Radio/Radio.d.ts +3 -3
- package/__internal__/src/components/Radio/Radio.js.map +1 -1
- package/__internal__/src/components/RadioGroup/types.d.ts +4 -4
- package/__internal__/src/components/RadioGroup/types.js.map +1 -1
- package/__internal__/src/components/Responses/Responses.d.ts +1 -1
- package/__internal__/src/components/Responses/Responses.js.map +1 -1
- package/__internal__/src/components/Select/Select.js +1 -1
- package/__internal__/src/components/Select/Select.js.map +1 -1
- package/__internal__/src/components/Select/helpers.d.ts +3 -1
- package/__internal__/src/components/Select/helpers.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.d.ts +2 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.css +2 -2
- package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultiple/__test__/SelectMultiple.test.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultiple/__test__/SelectMultiple.test.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.d.ts +2 -1
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectSingle/SelectSingle.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectSingle/SelectSingle.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectSingle/__test__/SelectSingle.test.js +1 -1
- package/__internal__/src/components/SelectCanary/SelectSingle/__test__/SelectSingle.test.js.map +1 -1
- package/__internal__/src/components/SelectCanary/helpers.d.ts +2 -1
- package/__internal__/src/components/SelectCanary/types.d.ts +1 -0
- package/__internal__/src/components/SelectCanary/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +2 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.css +1 -1
- package/__internal__/src/components/SelectComponents/types.d.ts +4 -4
- package/__internal__/src/components/SelectComponents/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectValueTag/SelectValueTag.css +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/types.d.ts +4 -4
- package/__internal__/src/components/SelectComponentsDeprecated/types.js.map +1 -1
- package/__internal__/src/components/Sidebar/types.d.ts +2 -2
- package/__internal__/src/components/Sidebar/types.js.map +1 -1
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.d.ts +2 -2
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js.map +1 -1
- package/__internal__/src/components/Skeleton/Skeleton.css +1 -1
- package/__internal__/src/components/Slider/helper.d.ts +2 -2
- package/__internal__/src/components/Slider/helper.js.map +1 -1
- package/__internal__/src/components/SnackBar/types.d.ts +4 -4
- package/__internal__/src/components/SnackBar/types.js.map +1 -1
- package/__internal__/src/components/Spoiler/types.d.ts +2 -2
- package/__internal__/src/components/Spoiler/types.js.map +1 -1
- package/__internal__/src/components/Steps/StepsStep/StepsStep.css +1 -1
- package/__internal__/src/components/Steps/types.d.ts +1 -1
- package/__internal__/src/components/Steps/types.js.map +1 -1
- package/__internal__/src/components/Switch/Switch.css +1 -1
- package/__internal__/src/components/Switch/types.d.ts +3 -3
- package/__internal__/src/components/Switch/types.js.map +1 -1
- package/__internal__/src/components/SwitchGroup/types.d.ts +1 -1
- package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.css +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.d.ts +2 -2
- package/__internal__/src/components/Table/Cell/TableCell.js.map +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.d.ts +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
- package/__internal__/src/components/Table/Table.d.ts +3 -3
- package/__internal__/src/components/Table/Table.js.map +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.d.ts +10 -10
- package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
- package/__internal__/src/components/Table/helpers.d.ts +1 -1
- package/__internal__/src/components/Table/helpers.js.map +1 -1
- package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
- package/__internal__/src/components/Tabs/types.d.ts +4 -4
- package/__internal__/src/components/Tabs/types.js.map +1 -1
- package/__internal__/src/components/Tag/Tag.d.ts +1 -1
- package/__internal__/src/components/Tag/Tag.js.map +1 -1
- package/__internal__/src/components/TagBase/TagBase.d.ts +3 -3
- package/__internal__/src/components/TagBase/TagBase.js.map +1 -1
- package/__internal__/src/components/Text/Text.d.ts +13 -13
- package/__internal__/src/components/Text/Text.js.map +1 -1
- package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.css +1 -1
- package/__internal__/src/components/TextDeprecated/TextDeprecated.d.ts +13 -13
- package/__internal__/src/components/TextDeprecated/TextDeprecated.js.map +1 -1
- package/__internal__/src/components/TextField/types.d.ts +4 -4
- package/__internal__/src/components/TextField/types.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css +2 -2
- package/__internal__/src/components/TextFieldCanary/useTextField.js.map +1 -1
- package/__internal__/src/components/Theme/_font/Silkscreen-Regular.woff +0 -0
- package/__internal__/src/components/Theme/_font/Silkscreen-Regular.woff2 +0 -0
- package/__internal__/src/components/Theme/_font/Theme_font_gpnDefault.css +1 -1
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
- package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
- package/__internal__/src/components/Timer/Timer.d.ts +1 -1
- package/__internal__/src/components/Timer/Timer.js.map +1 -1
- package/__internal__/src/components/Tooltip/types.d.ts +2 -2
- package/__internal__/src/components/Tooltip/types.js.map +1 -1
- package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +2 -2
- package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
- package/__internal__/src/components/User/User.css +1 -1
- package/__internal__/src/components/User/User.d.ts +4 -4
- package/__internal__/src/components/User/User.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +3 -1
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIcon/FileIcon.js.map +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.d.ts +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js.map +1 -1
- package/__internal__/src/hooks/useRefs/useRefs.js.map +1 -1
- package/__internal__/src/hooks/useStyleProps/types.js.map +1 -1
- package/__internal__/src/mixs/MixCard/MixCard.d.ts +2 -2
- package/__internal__/src/mixs/MixCard/MixCard.js.map +1 -1
- package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +5 -5
- package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
- package/__internal__/src/mixs/MixScrollBar/MixScrollBar.d.ts +2 -2
- package/__internal__/src/mixs/MixScrollBar/MixScrollBar.js.map +1 -1
- package/__internal__/src/mixs/MixVisuallyHidden/MixVisuallyHidden.css +1 -1
- package/__internal__/src/utils/array.js.map +1 -1
- package/__internal__/src/utils/date/index.js +1 -1
- package/__internal__/src/utils/date/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Informer.js","names":["classnames","React","cnMixFlex","cnMixSpace","cn","Text","useTheme","informerPropView","informerPropViewDefault","informerPropStatus","informerPropStatusDefault","informerPropSize","informerPropSizeDefault","cnInformer","Informer","forwardRef","props","ref","view","status","size","Icon","icon","label","title","children","style","otherProps","themeClassNames","className","color","accent","p","flex","gap","mT","mB"],"sources":["../../../../../src/components/Informer/Informer.tsx"],"sourcesContent":["import './Informer.css';\n\nimport { classnames } from '@bem-react/classnames';\nimport { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Text } from '../Text/Text';\nimport { useTheme } from '../Theme/Theme';\n\nexport const informerPropView = ['filled', 'bordered', 'outline'] as const;\nexport type InformerPropView = typeof informerPropView[number];\nexport const informerPropViewDefault: InformerPropView = informerPropView[0];\n\nexport const informerPropStatus = [\n 'success',\n 'system',\n 'alert',\n 'warning',\n 'normal',\n] as const;\nexport type InformerPropStatus = typeof informerPropStatus[number];\nexport const informerPropStatusDefault: InformerPropStatus =\n informerPropStatus[0];\n\nexport const informerPropSize = ['m', 's'] as const;\nexport type InformerPropSize = typeof informerPropSize[number];\nexport const informerPropSizeDefault: InformerPropSize = informerPropSize[0];\n\ntype Props = {\n view?: InformerPropView;\n status?: InformerPropStatus;\n icon?: IconComponent;\n label?: React.ReactNode;\n title?: string;\n size?: InformerPropSize;\n};\n\nexport type InformerProps = PropsWithHTMLAttributes<Props, HTMLDivElement>;\n\nexport const cnInformer = cn('Informer');\n\nexport const Informer = React.forwardRef<HTMLDivElement, InformerProps>(\n (props, ref) => {\n const {\n view = informerPropViewDefault,\n status = informerPropStatusDefault,\n size = informerPropSizeDefault,\n icon: Icon,\n label,\n title,\n children,\n style,\n ...otherProps\n } = props;\n const { themeClassNames } = useTheme();\n\n const className =\n status !== 'system' && view === 'filled'\n ? classnames(props.className, themeClassNames.color.accent)\n : props.className;\n\n return (\n <div\n {...otherProps}\n className={cnInformer(\n {\n view,\n },\n [\n className,\n cnMixSpace({ p: size }),\n cnMixFlex({ flex: 'flex', gap: 's' }),\n ],\n )}\n style={{\n ...style,\n ['--informer-bg-color' as string]: `var(--color-bg-${status})`,\n ['--informer-border-color' as string]:\n status === 'system'\n ? `var(--color-bg-border)`\n : `var(--color-bg-${status})`,\n ['--informer-typo-color' as string]: `var(--color-typo-${status})`,\n ['--informer-bg-opacity' as string]:\n status === 'system' ? '30%' : '10%',\n }}\n ref={ref}\n >\n {Icon && (\n <Icon\n className={cnInformer('Icon', [cnMixSpace({ mT: '3xs' })])}\n size=\"s\"\n />\n )}\n <div className={cnInformer('Content')}>\n {title && (\n <Text\n lineHeight=\"xs\"\n className={cnInformer('Title', [cnMixSpace({ mB: '2xs' })])}\n weight=\"bold\"\n size={size}\n view=\"primary\"\n >\n {title}\n </Text>\n )}\n {label ? (\n <Text\n lineHeight=\"xs\"\n view=\"primary\"\n className={cnInformer('Label')}\n size={size}\n >\n {label}\n </Text>\n ) : (\n children\n )}\n </div>\n </div>\n );\n },\n);\n"],"mappings":"20BAAA,uBAEA,OAASA,UAAT,KAA2B,uBAA3B,CAEA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,SAAT,0BACA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBAEA,OAASC,IAAT,oBACA,OAASC,QAAT,sBAEA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,QAAD,CAAW,UAAX,CAAuB,SAAvB,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,mBAAkB,CAAG,CAChC,SADgC,CAEhC,QAFgC,CAGhC,OAHgC,CAIhC,SAJgC,CAKhC,QALgC,CAA3B,CAQP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAaP,MAAO,IAAME,WAAU,CAAGT,EAAE,CAAC,UAAD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,oBAAC,CAAD,EACE,SAAS,CAAER,UAAU,CAAC,MAAD,CAAS,CAACV,UAAU,CAAC,CAAEgC,EAAE,CAAE,KAAN,CAAD,CAAX,CAAT,CADvB,CAEE,IAAI,CAAC,GAFP,EA1BJ,CA+BE,2BAAK,SAAS,CAAEtB,UAAU,CAAC,SAAD,CAA1B,EACGW,CAAK,EACJ,oBAAC,IAAD,EACE,UAAU,CAAC,IADb,CAEE,SAAS,CAAEX,UAAU,CAAC,OAAD,CAAU,CAACV,UAAU,CAAC,CAAEiC,EAAE,CAAE,KAAN,CAAD,CAAX,CAAV,CAFvB,CAGE,MAAM,CAAC,MAHT,CAIE,IAAI,CAAEhB,CAJR,CAKE,IAAI,CAAC,SALP,EAOGI,CAPH,CAFJ,CAYGD,CAAK,CACJ,oBAAC,IAAD,EACE,UAAU,CAAC,IADb,CAEE,IAAI,CAAC,SAFP,CAGE,SAAS,CAAEV,UAAU,CAAC,OAAD,CAHvB,CAIE,IAAI,CAAEO,CAJR,EAMGG,CANH,CADI,CAUJE,CAtBJ,CA/BF,CA0DH,CA/EqB,CAAjB"}
|
|
1
|
+
{"version":3,"file":"Informer.js","names":["classnames","React","cnMixFlex","cnMixSpace","cn","Text","useTheme","informerPropView","informerPropViewDefault","informerPropStatus","informerPropStatusDefault","informerPropSize","informerPropSizeDefault","cnInformer","Informer","forwardRef","props","ref","view","status","size","Icon","icon","label","title","children","style","otherProps","themeClassNames","className","color","accent","p","flex","gap","mT","mB"],"sources":["../../../../../src/components/Informer/Informer.tsx"],"sourcesContent":["import './Informer.css';\n\nimport { classnames } from '@bem-react/classnames';\nimport { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { cn } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Text } from '../Text/Text';\nimport { useTheme } from '../Theme/Theme';\n\nexport const informerPropView = ['filled', 'bordered', 'outline'] as const;\nexport type InformerPropView = (typeof informerPropView)[number];\nexport const informerPropViewDefault: InformerPropView = informerPropView[0];\n\nexport const informerPropStatus = [\n 'success',\n 'system',\n 'alert',\n 'warning',\n 'normal',\n] as const;\nexport type InformerPropStatus = (typeof informerPropStatus)[number];\nexport const informerPropStatusDefault: InformerPropStatus =\n informerPropStatus[0];\n\nexport const informerPropSize = ['m', 's'] as const;\nexport type InformerPropSize = (typeof informerPropSize)[number];\nexport const informerPropSizeDefault: InformerPropSize = informerPropSize[0];\n\ntype Props = {\n view?: InformerPropView;\n status?: InformerPropStatus;\n icon?: IconComponent;\n label?: React.ReactNode;\n title?: string;\n size?: InformerPropSize;\n};\n\nexport type InformerProps = PropsWithHTMLAttributes<Props, HTMLDivElement>;\n\nexport const cnInformer = cn('Informer');\n\nexport const Informer = React.forwardRef<HTMLDivElement, InformerProps>(\n (props, ref) => {\n const {\n view = informerPropViewDefault,\n status = informerPropStatusDefault,\n size = informerPropSizeDefault,\n icon: Icon,\n label,\n title,\n children,\n style,\n ...otherProps\n } = props;\n const { themeClassNames } = useTheme();\n\n const className =\n status !== 'system' && view === 'filled'\n ? classnames(props.className, themeClassNames.color.accent)\n : props.className;\n\n return (\n <div\n {...otherProps}\n className={cnInformer(\n {\n view,\n },\n [\n className,\n cnMixSpace({ p: size }),\n cnMixFlex({ flex: 'flex', gap: 's' }),\n ],\n )}\n style={{\n ...style,\n ['--informer-bg-color' as string]: `var(--color-bg-${status})`,\n ['--informer-border-color' as string]:\n status === 'system'\n ? `var(--color-bg-border)`\n : `var(--color-bg-${status})`,\n ['--informer-typo-color' as string]: `var(--color-typo-${status})`,\n ['--informer-bg-opacity' as string]:\n status === 'system' ? '30%' : '10%',\n }}\n ref={ref}\n >\n {Icon && (\n <Icon\n className={cnInformer('Icon', [cnMixSpace({ mT: '3xs' })])}\n size=\"s\"\n />\n )}\n <div className={cnInformer('Content')}>\n {title && (\n <Text\n lineHeight=\"xs\"\n className={cnInformer('Title', [cnMixSpace({ mB: '2xs' })])}\n weight=\"bold\"\n size={size}\n view=\"primary\"\n >\n {title}\n </Text>\n )}\n {label ? (\n <Text\n lineHeight=\"xs\"\n view=\"primary\"\n className={cnInformer('Label')}\n size={size}\n >\n {label}\n </Text>\n ) : (\n children\n )}\n </div>\n </div>\n );\n },\n);\n"],"mappings":"20BAAA,uBAEA,OAASA,UAAT,KAA2B,uBAA3B,CAEA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,SAAT,0BACA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBAEA,OAASC,IAAT,oBACA,OAASC,QAAT,sBAEA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,QAAD,CAAW,UAAX,CAAuB,SAAvB,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAEP,MAAO,IAAME,mBAAkB,CAAG,CAChC,SADgC,CAEhC,QAFgC,CAGhC,OAHgC,CAIhC,SAJgC,CAKhC,QALgC,CAA3B,CAQP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAzB,CAEP,MAAO,IAAMC,wBAAyC,CAAGD,gBAAgB,CAAC,CAAD,CAAlE,CAaP,MAAO,IAAME,WAAU,CAAGT,EAAE,CAAC,UAAD,CAArB,CAEP,MAAO,IAAMU,SAAQ,CAAGb,KAAK,CAACc,UAAN,CACtB,SAACC,CAAD,CAAQC,CAAR,CAAgB,SAWVD,CAXU,CAEZE,IAFY,CAEZA,CAFY,YAELV,uBAFK,KAWVQ,CAXU,CAGZG,MAHY,CAGZA,CAHY,YAGHT,yBAHG,KAWVM,CAXU,CAIZI,IAJY,CAIZA,CAJY,YAILR,uBAJK,GAKNS,CALM,CAWVL,CAXU,CAKZM,IALY,CAMZC,CANY,CAWVP,CAXU,CAMZO,KANY,CAOZC,CAPY,CAWV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CAAD,CAAX,CAAV,CAFvB,CAGE,MAAM,CAAC,MAHT,CAIE,IAAI,CAAEhB,CAJR,CAKE,IAAI,CAAC,SALP,EAOGI,CAPH,CAFJ,CAYGD,CAAK,CACJ,oBAAC,IAAD,EACE,UAAU,CAAC,IADb,CAEE,IAAI,CAAC,SAFP,CAGE,SAAS,CAAEV,UAAU,CAAC,OAAD,CAHvB,CAIE,IAAI,CAAEO,CAJR,EAMGG,CANH,CADI,CAUJE,CAtBJ,CA/BF,CA0DH,CA/EqB,CAAjB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './Layout.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const layoutPropDirection: readonly ["row", "column"];
|
|
4
|
-
export type LayoutPropDirection = typeof layoutPropDirection[number];
|
|
4
|
+
export type LayoutPropDirection = (typeof layoutPropDirection)[number];
|
|
5
5
|
export declare const layoutPropDirectionDefault: LayoutPropDirection;
|
|
6
6
|
export declare const layoutPropVerticalAlign: readonly ["top", "bottom"];
|
|
7
|
-
export type LayoutPropVerticalAlign = typeof layoutPropVerticalAlign[number];
|
|
7
|
+
export type LayoutPropVerticalAlign = (typeof layoutPropVerticalAlign)[number];
|
|
8
8
|
export declare const layoutPropVerticalAlignDefault: LayoutPropVerticalAlign;
|
|
9
9
|
export declare const layoutPropHorizontalAlign: readonly ["left", "right"];
|
|
10
|
-
export type LayoutPropHorizontalAlign = typeof layoutPropHorizontalAlign[number];
|
|
10
|
+
export type LayoutPropHorizontalAlign = (typeof layoutPropHorizontalAlign)[number];
|
|
11
11
|
export declare const layoutPropHorizontalAlignDefault: LayoutPropHorizontalAlign;
|
|
12
12
|
export type LayoutProps = {
|
|
13
13
|
flex?: number | 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["React","useRef","useForkRef","cn","forwardRefWithAs","useFixed","layoutPropDirection","layoutPropDirectionDefault","layoutPropVerticalAlign","layoutPropVerticalAlignDefault","layoutPropHorizontalAlign","layoutPropHorizontalAlignDefault","cnLayout","Layout","props","ref","flex","fixed","anchorRef","scrollContainer","direction","children","className","tabIndex","verticalAlign","horizontalAlign","as","style","otherProps","containerRef","top","left","width","height","maxWidth","maxHeight","position","backgroundColor","current","window","getComputedStyle","getPropertyValue"],"sources":["../../../../../src/components/Layout/Layout.tsx"],"sourcesContent":["import './Layout.css';\n\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cn } from '../../utils/bem';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { useFixed } from './useFixed';\n\nexport const layoutPropDirection = ['row', 'column'] as const;\nexport type LayoutPropDirection = typeof layoutPropDirection[number];\nexport const layoutPropDirectionDefault: LayoutPropDirection =\n layoutPropDirection[0];\n\nexport const layoutPropVerticalAlign = ['top', 'bottom'] as const;\nexport type LayoutPropVerticalAlign = typeof layoutPropVerticalAlign[number];\nexport const layoutPropVerticalAlignDefault: LayoutPropVerticalAlign =\n layoutPropVerticalAlign[0];\n\nexport const layoutPropHorizontalAlign = ['left', 'right'] as const;\nexport type LayoutPropHorizontalAlign =\n typeof layoutPropHorizontalAlign[number];\nexport const layoutPropHorizontalAlignDefault: LayoutPropHorizontalAlign =\n layoutPropHorizontalAlign[0];\n\nexport type LayoutProps = {\n flex?: number | 'none';\n fixed?: boolean;\n verticalAlign?: LayoutPropVerticalAlign;\n horizontalAlign?: LayoutPropHorizontalAlign;\n anchorRef?: React.RefObject<HTMLElement>;\n scrollContainer?: React.RefObject<HTMLElement> | HTMLElement | null | Window;\n direction?: LayoutPropDirection;\n children?: React.ReactNode;\n};\n\nexport const cnLayout = cn('Layout');\n\nexport const Layout = forwardRefWithAs<LayoutProps>((props, ref) => {\n const {\n flex,\n fixed,\n anchorRef,\n scrollContainer,\n direction = layoutPropDirectionDefault,\n children,\n className,\n tabIndex,\n verticalAlign = layoutPropVerticalAlignDefault,\n horizontalAlign = layoutPropHorizontalAlignDefault,\n as = 'div',\n style,\n ...otherProps\n } = props;\n\n const containerRef = useRef<HTMLElement>(null);\n\n const { top, left, width, height, maxWidth, maxHeight, position } = useFixed(\n containerRef,\n scrollContainer,\n anchorRef,\n verticalAlign,\n horizontalAlign,\n );\n\n const Tag = as as string;\n\n const backgroundColor =\n containerRef && containerRef.current\n ? window\n .getComputedStyle(containerRef.current)\n .getPropertyValue('background-color')\n : 'none';\n\n return (\n <>\n <Tag\n tabIndex={tabIndex}\n ref={useForkRef([ref, containerRef])}\n style={\n fixed\n ? {\n ...style,\n ['--layout-flex' as string]: flex,\n ['--layout-top' as string]: `${top}px`,\n ['--layout-left' as string]: `${left}px`,\n ['--layout-max-height' as string]: `${maxHeight}px`,\n ['--layout-max-width' as string]: `${maxWidth}px`,\n ['--layout-position' as string]: position,\n ['--layout-min-width' as string]: `${width}px`,\n ['--layout-min-height' as string]: `${height}px`,\n }\n : {\n ...style,\n ['--layout-flex' as string]: flex,\n }\n }\n className={cnLayout(\n {\n direction,\n },\n [className],\n )}\n {...otherProps}\n >\n {children}\n </Tag>\n {position === 'fixed' && fixed && (\n <div\n className={cnLayout('Fake')}\n style={{\n ['--layout-flex' as string]: flex,\n ['--layout-min-width' as string]: `${width}px`,\n ['--layout-min-height' as string]: `${height}px`,\n ['--layout-bg-color' as string]: backgroundColor,\n }}\n />\n )}\n </>\n );\n});\n"],"mappings":"o5BAAA,qBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,UAAT,yCACA,OAASC,EAAT,uBACA,OAASC,gBAAT,+CACA,OAASC,QAAT,kBAEA,MAAO,IAAMC,oBAAmB,CAAG,CAAC,KAAD,CAAQ,QAAR,CAA5B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,mBAAmB,CAAC,CAAD,CADd,CAGP,MAAO,IAAME,wBAAuB,CAAG,CAAC,KAAD,CAAQ,QAAR,CAAhC,CAEP,MAAO,IAAMC,+BAAuD,CAClED,uBAAuB,CAAC,CAAD,CAD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mBhCA,QAnBgC,CAmBtBC,CAnBsB,GAmBtBA,SAnBsB,CAmBXC,CAnBW,GAmBXA,QAnBW,CA6B5DC,CAAe,CACnBR,CAAY,EAAIA,CAAY,CAACS,OAA7B,CACIC,MAAM,CACHC,gBADH,CACoBX,CAAY,CAACS,OADjC,EAEGG,gBAFH,CAEoB,kBAFpB,CADJ,CAII,MAlC4D,CAoClE,MACE,yCACE,oBAXQf,CAWR,gBACE,QAAQ,CAAEH,CADZ,CAEE,GAAG,CAAErB,UAAU,CAAC,CAACa,CAAD,CAAMc,CAAN,CAAD,CAFjB,CAGE,KAAK,CACHZ,CAAK,gCAEIU,CAFJ,6BAGE,eAHF,CAG8BX,CAH9B,oBAIE,cAJF,WAIgCc,CAJhC,0BAKE,eALF,WAKiCC,CALjC,0BAME,qBANF,WAMuCI,CANvC,0BAOE,oBAPF,WAOsCD,CAPtC,0BAQE,mBARF,CAQkCE,CARlC,oBASE,oBATF,WASsCJ,CATtC,0BAUE,qBAVF,WAUuCC,CAVvC,2CAaIN,CAbJ,wBAcE,eAdF,CAc8BX,CAd9B,EAJT,CAqBE,SAAS,CAAEJ,QAAQ,CACjB,CACEQ,SAAS,CAATA,CADF,CADiB,CAIjB,CAACE,CAAD,CAJiB,CArBrB,EA2BMM,CA3BN,EA6BGP,CA7BH,CADF,CAgCgB,OAAb,GAAAe,CAAQ,EAAgBnB,CAAxB,EACC,2BACE,SAAS,CAAEL,QAAQ,CAAC,MAAD,CADrB,CAEE,KAAK,yBACF,eADE,CAC0BI,CAD1B,oBAEF,oBAFE,WAEkCgB,CAFlC,0BAGF,qBAHE,WAGmCC,CAHnC,0BAIF,mBAJE,CAI8BI,CAJ9B,IAFP,EAjCJ,CA6CH,CAlFqC,CAA/B"}
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["React","useRef","useForkRef","cn","forwardRefWithAs","useFixed","layoutPropDirection","layoutPropDirectionDefault","layoutPropVerticalAlign","layoutPropVerticalAlignDefault","layoutPropHorizontalAlign","layoutPropHorizontalAlignDefault","cnLayout","Layout","props","ref","flex","fixed","anchorRef","scrollContainer","direction","children","className","tabIndex","verticalAlign","horizontalAlign","as","style","otherProps","containerRef","top","left","width","height","maxWidth","maxHeight","position","backgroundColor","current","window","getComputedStyle","getPropertyValue"],"sources":["../../../../../src/components/Layout/Layout.tsx"],"sourcesContent":["import './Layout.css';\n\nimport React, { useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cn } from '../../utils/bem';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { useFixed } from './useFixed';\n\nexport const layoutPropDirection = ['row', 'column'] as const;\nexport type LayoutPropDirection = (typeof layoutPropDirection)[number];\nexport const layoutPropDirectionDefault: LayoutPropDirection =\n layoutPropDirection[0];\n\nexport const layoutPropVerticalAlign = ['top', 'bottom'] as const;\nexport type LayoutPropVerticalAlign = (typeof layoutPropVerticalAlign)[number];\nexport const layoutPropVerticalAlignDefault: LayoutPropVerticalAlign =\n layoutPropVerticalAlign[0];\n\nexport const layoutPropHorizontalAlign = ['left', 'right'] as const;\nexport type LayoutPropHorizontalAlign =\n (typeof layoutPropHorizontalAlign)[number];\nexport const layoutPropHorizontalAlignDefault: LayoutPropHorizontalAlign =\n layoutPropHorizontalAlign[0];\n\nexport type LayoutProps = {\n flex?: number | 'none';\n fixed?: boolean;\n verticalAlign?: LayoutPropVerticalAlign;\n horizontalAlign?: LayoutPropHorizontalAlign;\n anchorRef?: React.RefObject<HTMLElement>;\n scrollContainer?: React.RefObject<HTMLElement> | HTMLElement | null | Window;\n direction?: LayoutPropDirection;\n children?: React.ReactNode;\n};\n\nexport const cnLayout = cn('Layout');\n\nexport const Layout = forwardRefWithAs<LayoutProps>((props, ref) => {\n const {\n flex,\n fixed,\n anchorRef,\n scrollContainer,\n direction = layoutPropDirectionDefault,\n children,\n className,\n tabIndex,\n verticalAlign = layoutPropVerticalAlignDefault,\n horizontalAlign = layoutPropHorizontalAlignDefault,\n as = 'div',\n style,\n ...otherProps\n } = props;\n\n const containerRef = useRef<HTMLElement>(null);\n\n const { top, left, width, height, maxWidth, maxHeight, position } = useFixed(\n containerRef,\n scrollContainer,\n anchorRef,\n verticalAlign,\n horizontalAlign,\n );\n\n const Tag = as as string;\n\n const backgroundColor =\n containerRef && containerRef.current\n ? window\n .getComputedStyle(containerRef.current)\n .getPropertyValue('background-color')\n : 'none';\n\n return (\n <>\n <Tag\n tabIndex={tabIndex}\n ref={useForkRef([ref, containerRef])}\n style={\n fixed\n ? {\n ...style,\n ['--layout-flex' as string]: flex,\n ['--layout-top' as string]: `${top}px`,\n ['--layout-left' as string]: `${left}px`,\n ['--layout-max-height' as string]: `${maxHeight}px`,\n ['--layout-max-width' as string]: `${maxWidth}px`,\n ['--layout-position' as string]: position,\n ['--layout-min-width' as string]: `${width}px`,\n ['--layout-min-height' as string]: `${height}px`,\n }\n : {\n ...style,\n ['--layout-flex' as string]: flex,\n }\n }\n className={cnLayout(\n {\n direction,\n },\n [className],\n )}\n {...otherProps}\n >\n {children}\n </Tag>\n {position === 'fixed' && fixed && (\n <div\n className={cnLayout('Fake')}\n style={{\n ['--layout-flex' as string]: flex,\n ['--layout-min-width' as string]: `${width}px`,\n ['--layout-min-height' as string]: `${height}px`,\n ['--layout-bg-color' as string]: backgroundColor,\n }}\n />\n )}\n </>\n );\n});\n"],"mappings":"o5BAAA,qBAEA,MAAOA,MAAP,EAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,UAAT,yCACA,OAASC,EAAT,uBACA,OAASC,gBAAT,+CACA,OAASC,QAAT,kBAEA,MAAO,IAAMC,oBAAmB,CAAG,CAAC,KAAD,CAAQ,QAAR,CAA5B,CAEP,MAAO,IAAMC,2BAA+C,CAC1DD,mBAAmB,CAAC,CAAD,CADd,CAGP,MAAO,IAAME,wBAAuB,CAAG,CAAC,KAAD,CAAQ,QAAR,CAAhC,CAEP,MAAO,IAAMC,+BAAuD,CAClED,uBAAuB,CAAC,CAAD,C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AmBhCA,QAnBgC,CAmBtBC,CAnBsB,GAmBtBA,SAnBsB,CAmBXC,CAnBW,GAmBXA,QAnBW,CA6B5DC,CAAe,CACnBR,CAAY,EAAIA,CAAY,CAACS,OAA7B,CACIC,MAAM,CACHC,gBADH,CACoBX,CAAY,CAACS,OADjC,EAEGG,gBAFH,CAEoB,kBAFpB,CADJ,CAII,MAlC4D,CAoClE,MACE,yCACE,oBAXQf,CAWR,gBACE,QAAQ,CAAEH,CADZ,CAEE,GAAG,CAAErB,UAAU,CAAC,CAACa,CAAD,CAAMc,CAAN,CAAD,CAFjB,CAGE,KAAK,CACHZ,CAAK,gCAEIU,CAFJ,6BAGE,eAHF,CAG8BX,CAH9B,oBAIE,cAJF,WAIgCc,CAJhC,0BAKE,eALF,WAKiCC,CALjC,0BAME,qBANF,WAMuCI,CANvC,0BAOE,oBAPF,WAOsCD,CAPtC,0BAQE,mBARF,CAQkCE,CARlC,oBASE,oBATF,WASsCJ,CATtC,0BAUE,qBAVF,WAUuCC,CAVvC,2CAaIN,CAbJ,wBAcE,eAdF,CAc8BX,CAd9B,EAJT,CAqBE,SAAS,CAAEJ,QAAQ,CACjB,CACEQ,SAAS,CAATA,CADF,CADiB,CAIjB,CAACE,CAAD,CAJiB,CArBrB,EA2BMM,CA3BN,EA6BGP,CA7BH,CADF,CAgCgB,OAAb,GAAAe,CAAQ,EAAgBnB,CAAxB,EACC,2BACE,SAAS,CAAEL,QAAQ,CAAC,MAAD,CADrB,CAEE,KAAK,yBACF,eADE,CAC0BI,CAD1B,oBAEF,oBAFE,WAEkCgB,CAFlC,0BAGF,qBAHE,WAGmCC,CAHnC,0BAIF,mBAJE,CAI8BI,CAJ9B,IAFP,EAjCJ,CA6CH,CAlFqC,CAA/B"}
|
|
@@ -9,9 +9,9 @@ export type UseFixedData = {
|
|
|
9
9
|
position?: 'unset' | 'fixed';
|
|
10
10
|
};
|
|
11
11
|
declare const verticalAlign: readonly ["top", "bottom"];
|
|
12
|
-
type VerticalAlign = typeof verticalAlign[number];
|
|
12
|
+
type VerticalAlign = (typeof verticalAlign)[number];
|
|
13
13
|
declare const horizontalAlign: readonly ["left", "right"];
|
|
14
|
-
type HorizontalAlign = typeof horizontalAlign[number];
|
|
14
|
+
type HorizontalAlign = (typeof horizontalAlign)[number];
|
|
15
15
|
type UseFixed = (layoutRef?: React.RefObject<HTMLElement> | null, scrollContainer?: React.RefObject<HTMLElement> | null | HTMLElement | Window, anchorRef?: React.RefObject<HTMLElement> | null, verticalAlign?: VerticalAlign, horizontalAlign?: HorizontalAlign) => UseFixedData;
|
|
16
16
|
export type ElementStationing = {
|
|
17
17
|
offsetTop: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFixed.js","names":["useCallback","useEffect","useState","verticalAlign","verticalAlignDefault","horizontalAlign","horizontalAlignDefault","getHTMLElement","element","HTMLElement","Window","current","getStationingElement","offsetTop","offsetHeight","offsetLeft","offsetWidth","clientHeight","clientWidth","scrollTop","scrollHeight","innerHeight","innerWidth","scrollY","Math","max","document","body","isElementScrollable","container","anchor","isVerticalFixation","startScroll","positioningElement","layoutStationing","scrollContainerStationing","anchorStationing","stationingData","top","left","width","height","maxWidth","maxHeight","position","scrollContainerPosition","bottom","right","window","scrollX","useFixed","layoutRef","scrollContainer","anchorRef","stationing","setStationing","result","setResult","setTimeout","parentElement","parentContainer","parentStationing","positioning","addEventListener","resizing","removeEventListener"],"sources":["../../../../../src/components/Layout/useFixed.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nexport type UseFixedData = {\n top?: number;\n left?: number;\n width?: number;\n height?: number;\n maxWidth?: number;\n maxHeight?: number;\n position?: 'unset' | 'fixed';\n};\n\nconst verticalAlign = ['top', 'bottom'] as const;\ntype VerticalAlign = typeof verticalAlign[number];\nconst verticalAlignDefault: VerticalAlign = verticalAlign[0];\n\nconst horizontalAlign = ['left', 'right'] as const;\ntype HorizontalAlign = typeof horizontalAlign[number];\nconst horizontalAlignDefault: HorizontalAlign = horizontalAlign[0];\n\ntype UseFixed = (\n layoutRef?: React.RefObject<HTMLElement> | null,\n scrollContainer?: React.RefObject<HTMLElement> | null | HTMLElement | Window,\n anchorRef?: React.RefObject<HTMLElement> | null,\n verticalAlign?: VerticalAlign,\n horizontalAlign?: HorizontalAlign,\n) => UseFixedData;\n\nexport type ElementStationing = {\n offsetTop: number;\n offsetHeight: number;\n offsetLeft: number;\n offsetWidth: number;\n clientHeight: number;\n clientWidth: number;\n scrollTop: number;\n scrollHeight: number;\n};\n\ntype GetHTMLFunction = (\n element: React.RefObject<HTMLElement> | HTMLElement | Window,\n) => HTMLElement | Window | null;\n\ntype PositioningElement = (\n startScroll?: number,\n layoutStationing?: ElementStationing,\n scrollContainerStationing?: ElementStationing,\n anchorStationing?: ElementStationing,\n verticalAlign?: VerticalAlign,\n horizontalAlign?: HorizontalAlign,\n) => UseFixedData;\n\nconst getHTMLElement: GetHTMLFunction = (element) => {\n if (element && !(element instanceof HTMLElement || element instanceof Window))\n return element?.current;\n return element;\n};\n\nconst getStationingElement = (\n element?: HTMLElement | null | Window,\n): ElementStationing | undefined => {\n if (element instanceof HTMLElement)\n return {\n offsetTop: element.offsetTop,\n offsetHeight: element.offsetHeight,\n offsetLeft: element.offsetLeft,\n offsetWidth: element.offsetWidth,\n clientHeight: element.clientHeight,\n clientWidth: element.clientWidth,\n scrollTop: element.scrollTop,\n scrollHeight: element.scrollHeight,\n };\n if (element instanceof Window) {\n return {\n offsetTop: 0,\n offsetHeight: element.innerHeight,\n offsetLeft: 0,\n offsetWidth: element.innerWidth,\n clientHeight: element.innerHeight,\n clientWidth: element.innerWidth,\n scrollTop: element.scrollY,\n scrollHeight: Math.max(\n document.body.scrollHeight,\n document.body.offsetHeight,\n ),\n };\n }\n return undefined;\n};\n\nconst isElementScrollable = (\n element: ElementStationing,\n container: ElementStationing,\n anchor: ElementStationing | undefined,\n isVerticalFixation: boolean,\n startScroll: number,\n): boolean | undefined => {\n if (isVerticalFixation)\n return (\n container.scrollTop >= startScroll &&\n container.scrollTop <=\n container.scrollHeight - container.offsetHeight + element.offsetHeight\n );\n return anchor\n ? container.scrollTop + anchor.offsetHeight >= startScroll &&\n container.scrollTop <=\n container.scrollHeight - container.offsetHeight + element.offsetHeight\n : container.scrollTop + container.offsetHeight <=\n startScroll + element.offsetHeight &&\n container.scrollTop <= container.scrollHeight - container.offsetHeight;\n};\n\nexport const positioningElement: PositioningElement = (\n startScroll,\n layoutStationing,\n scrollContainerStationing,\n anchorStationing,\n verticalAlign,\n horizontalAlign,\n) => {\n const stationingData: UseFixedData = {\n top: 0,\n left: 0,\n width: layoutStationing?.offsetWidth,\n height: layoutStationing?.offsetHeight,\n maxWidth: scrollContainerStationing?.clientWidth,\n maxHeight: scrollContainerStationing?.clientHeight,\n position: 'unset',\n };\n if (\n layoutStationing &&\n scrollContainerStationing &&\n typeof startScroll !== 'undefined'\n ) {\n const scrollContainerPosition = {\n top: scrollContainerStationing.offsetTop,\n bottom:\n scrollContainerStationing.offsetTop +\n scrollContainerStationing.clientHeight,\n left: scrollContainerStationing.offsetLeft,\n right:\n scrollContainerStationing.offsetLeft +\n scrollContainerStationing.clientWidth,\n width: scrollContainerStationing.clientWidth,\n height: scrollContainerStationing.clientHeight,\n };\n stationingData.width = layoutStationing.offsetWidth;\n stationingData.height = layoutStationing.offsetHeight;\n stationingData.maxWidth = scrollContainerPosition.width;\n stationingData.maxHeight = scrollContainerPosition.height;\n if (\n isElementScrollable(\n layoutStationing,\n scrollContainerStationing,\n anchorStationing,\n verticalAlign === 'top',\n startScroll,\n )\n ) {\n stationingData.position = 'fixed';\n if (verticalAlign === 'top')\n stationingData.top = anchorStationing\n ? anchorStationing.offsetTop\n : scrollContainerPosition.top;\n else\n stationingData.top = anchorStationing\n ? anchorStationing.offsetTop + anchorStationing.offsetHeight\n : scrollContainerPosition.bottom - layoutStationing.offsetHeight;\n if (horizontalAlign === 'left')\n stationingData.left = anchorStationing\n ? anchorStationing.offsetLeft\n : -window.scrollX + scrollContainerPosition.left;\n else\n stationingData.left = anchorStationing\n ? anchorStationing.offsetLeft +\n anchorStationing.offsetWidth -\n layoutStationing.offsetWidth\n : -window.scrollX +\n scrollContainerPosition.right -\n layoutStationing.offsetWidth;\n } else stationingData.position = 'unset';\n }\n return stationingData;\n};\n\nexport const useFixed: UseFixed = (\n layoutRef,\n scrollContainer,\n anchorRef,\n verticalAlign = verticalAlignDefault,\n horizontalAlign = horizontalAlignDefault,\n) => {\n const [stationing, setStationing] = useState<UseFixedData>({});\n const [result, setResult] = useState<UseFixedData>({});\n\n useEffect(() => {\n let startScroll = 0;\n setTimeout(\n () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n const parentStationing = getStationingElement(parentContainer);\n if (parentStationing) {\n startScroll =\n layoutRef.current.offsetTop - parentStationing.offsetTop >= 0\n ? layoutRef.current.offsetTop - parentStationing.offsetTop\n : 0;\n }\n positioning(startScroll);\n document.addEventListener('resize', resizing);\n if (typeof parentContainer?.addEventListener === 'function') {\n parentContainer?.addEventListener('resize', resizing);\n parentContainer?.addEventListener('scroll', () =>\n positioning(startScroll),\n );\n }\n }\n },\n typeof scrollContainer !== 'undefined' ? 0 : 500,\n );\n return () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n document.removeEventListener('resize', resizing);\n if (typeof parentContainer?.removeEventListener === 'function') {\n parentContainer?.removeEventListener('resize', resizing);\n parentContainer?.removeEventListener('scroll', () =>\n positioning(startScroll),\n );\n }\n }\n };\n }, [verticalAlign, horizontalAlign, layoutRef, scrollContainer, anchorRef]);\n\n useEffect(() => {\n setResult({ ...stationing });\n }, [\n stationing.top,\n stationing.left,\n stationing.position,\n stationing.width,\n stationing.height,\n stationing.maxHeight,\n stationing.maxWidth,\n ]);\n\n const resizing = () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n const parentStationing = getStationingElement(parentContainer);\n setStationing({\n ...stationing,\n width: layoutRef.current.offsetWidth,\n height: layoutRef.current.offsetHeight,\n maxWidth: parentStationing?.clientWidth,\n maxHeight: parentStationing?.clientHeight,\n });\n }\n };\n\n const positioning = useCallback(\n (startScroll: number) => {\n if (\n layoutRef &&\n layoutRef.current &&\n layoutRef.current.parentElement &&\n typeof startScroll === 'number'\n ) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n if (scrollContainer) {\n const stationingData = positioningElement(\n startScroll,\n getStationingElement(layoutRef.current),\n getStationingElement(parentContainer),\n getStationingElement(anchorRef?.current),\n verticalAlign,\n horizontalAlign,\n );\n setStationing({ ...stationingData });\n }\n }\n },\n [stationing],\n );\n\n return result;\n};\n"],"mappings":"suBAAA,OAAgBA,WAAhB,CAA6BC,SAA7B,CAAwCC,QAAxC,KAAwD,OAAxD,C,GAYMC,cAAa,CAAG,CAAC,KAAD,CAAQ,QAAR,C,CAEhBC,oBAAmC,CAAGD,aAAa,CAAC,CAAD,C,CAEnDE,eAAe,CAAG,CAAC,MAAD,CAAS,OAAT,C,CAElBC,sBAAuC,CAAGD,eAAe,CAAC,CAAD,C,CAkCzDE,cAA+B,CAAG,SAACC,CAAD,CAAa,OAC/CA,EAAO,EAAI,EAAEA,CAAO,WAAYC,YAAnB,EAAkCD,CAAO,WAAYE,OAAvD,CADoC,QAE1CF,CAF0C,WAE1CA,CAF0C,QAE1CA,CAAO,CAAEG,OAFiC,CAG5CH,CACR,C,CAEKI,oBAAoB,CAAG,SAC3BJ,CAD2B,CAEO,OAC9BA,EAAO,WAAYC,YADW,CAEzB,CACLI,SAAS,CAAEL,CAAO,CAACK,SADd,CAELC,YAAY,CAAEN,CAAO,CAACM,YAFjB,CAGLC,UAAU,CAAEP,CA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2EG6C,CAAW,CAAG9D,WAAW,CAC7B,SAACgC,CAAD,CAAyB,CACvB,GACEmB,CAAS,EACTA,CAAS,CAACxC,OADV,EAEAwC,CAAS,CAACxC,OAAV,CAAkBgD,aAFlB,EAGuB,QAAvB,QAAO3B,EAJT,CAKE,CACA,GAAM4B,EAAe,CAAGR,CAAe,CACnC7C,cAAc,CAAC6C,CAAD,CADqB,CAEnCD,CAAS,CAACxC,OAAV,CAAkBgD,aAFtB,CAGA,GAAIP,CAAJ,CAAqB,CACnB,GAAMf,EAAc,CAAGJ,kBAAkB,CACvCD,CADuC,CAEvCpB,oBAAoB,CAACuC,CAAS,CAACxC,OAAX,CAFmB,CAGvCC,oBAAoB,CAACgD,CAAD,CAHmB,CAIvChD,oBAAoB,QAACyC,CAAD,WAACA,CAAD,QAACA,CAAS,CAAE1C,OAAZ,CAJmB,CAKvCR,CALuC,CAMvCE,CANuC,CAAzC,CAQAkD,CAAa,kBAAMlB,CAAN,EACd,CACF,CACF,CAvB4B,CAwB7B,CAACiB,CAAD,CAxB6B,CA3E5B,CAsGH,MAAOE,EACR,CA7GM"}
|
|
1
|
+
{"version":3,"file":"useFixed.js","names":["useCallback","useEffect","useState","verticalAlign","verticalAlignDefault","horizontalAlign","horizontalAlignDefault","getHTMLElement","element","HTMLElement","Window","current","getStationingElement","offsetTop","offsetHeight","offsetLeft","offsetWidth","clientHeight","clientWidth","scrollTop","scrollHeight","innerHeight","innerWidth","scrollY","Math","max","document","body","isElementScrollable","container","anchor","isVerticalFixation","startScroll","positioningElement","layoutStationing","scrollContainerStationing","anchorStationing","stationingData","top","left","width","height","maxWidth","maxHeight","position","scrollContainerPosition","bottom","right","window","scrollX","useFixed","layoutRef","scrollContainer","anchorRef","stationing","setStationing","result","setResult","setTimeout","parentElement","parentContainer","parentStationing","positioning","addEventListener","resizing","removeEventListener"],"sources":["../../../../../src/components/Layout/useFixed.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nexport type UseFixedData = {\n top?: number;\n left?: number;\n width?: number;\n height?: number;\n maxWidth?: number;\n maxHeight?: number;\n position?: 'unset' | 'fixed';\n};\n\nconst verticalAlign = ['top', 'bottom'] as const;\ntype VerticalAlign = (typeof verticalAlign)[number];\nconst verticalAlignDefault: VerticalAlign = verticalAlign[0];\n\nconst horizontalAlign = ['left', 'right'] as const;\ntype HorizontalAlign = (typeof horizontalAlign)[number];\nconst horizontalAlignDefault: HorizontalAlign = horizontalAlign[0];\n\ntype UseFixed = (\n layoutRef?: React.RefObject<HTMLElement> | null,\n scrollContainer?: React.RefObject<HTMLElement> | null | HTMLElement | Window,\n anchorRef?: React.RefObject<HTMLElement> | null,\n verticalAlign?: VerticalAlign,\n horizontalAlign?: HorizontalAlign,\n) => UseFixedData;\n\nexport type ElementStationing = {\n offsetTop: number;\n offsetHeight: number;\n offsetLeft: number;\n offsetWidth: number;\n clientHeight: number;\n clientWidth: number;\n scrollTop: number;\n scrollHeight: number;\n};\n\ntype GetHTMLFunction = (\n element: React.RefObject<HTMLElement> | HTMLElement | Window,\n) => HTMLElement | Window | null;\n\ntype PositioningElement = (\n startScroll?: number,\n layoutStationing?: ElementStationing,\n scrollContainerStationing?: ElementStationing,\n anchorStationing?: ElementStationing,\n verticalAlign?: VerticalAlign,\n horizontalAlign?: HorizontalAlign,\n) => UseFixedData;\n\nconst getHTMLElement: GetHTMLFunction = (element) => {\n if (element && !(element instanceof HTMLElement || element instanceof Window))\n return element?.current;\n return element;\n};\n\nconst getStationingElement = (\n element?: HTMLElement | null | Window,\n): ElementStationing | undefined => {\n if (element instanceof HTMLElement)\n return {\n offsetTop: element.offsetTop,\n offsetHeight: element.offsetHeight,\n offsetLeft: element.offsetLeft,\n offsetWidth: element.offsetWidth,\n clientHeight: element.clientHeight,\n clientWidth: element.clientWidth,\n scrollTop: element.scrollTop,\n scrollHeight: element.scrollHeight,\n };\n if (element instanceof Window) {\n return {\n offsetTop: 0,\n offsetHeight: element.innerHeight,\n offsetLeft: 0,\n offsetWidth: element.innerWidth,\n clientHeight: element.innerHeight,\n clientWidth: element.innerWidth,\n scrollTop: element.scrollY,\n scrollHeight: Math.max(\n document.body.scrollHeight,\n document.body.offsetHeight,\n ),\n };\n }\n return undefined;\n};\n\nconst isElementScrollable = (\n element: ElementStationing,\n container: ElementStationing,\n anchor: ElementStationing | undefined,\n isVerticalFixation: boolean,\n startScroll: number,\n): boolean | undefined => {\n if (isVerticalFixation)\n return (\n container.scrollTop >= startScroll &&\n container.scrollTop <=\n container.scrollHeight - container.offsetHeight + element.offsetHeight\n );\n return anchor\n ? container.scrollTop + anchor.offsetHeight >= startScroll &&\n container.scrollTop <=\n container.scrollHeight - container.offsetHeight + element.offsetHeight\n : container.scrollTop + container.offsetHeight <=\n startScroll + element.offsetHeight &&\n container.scrollTop <= container.scrollHeight - container.offsetHeight;\n};\n\nexport const positioningElement: PositioningElement = (\n startScroll,\n layoutStationing,\n scrollContainerStationing,\n anchorStationing,\n verticalAlign,\n horizontalAlign,\n) => {\n const stationingData: UseFixedData = {\n top: 0,\n left: 0,\n width: layoutStationing?.offsetWidth,\n height: layoutStationing?.offsetHeight,\n maxWidth: scrollContainerStationing?.clientWidth,\n maxHeight: scrollContainerStationing?.clientHeight,\n position: 'unset',\n };\n if (\n layoutStationing &&\n scrollContainerStationing &&\n typeof startScroll !== 'undefined'\n ) {\n const scrollContainerPosition = {\n top: scrollContainerStationing.offsetTop,\n bottom:\n scrollContainerStationing.offsetTop +\n scrollContainerStationing.clientHeight,\n left: scrollContainerStationing.offsetLeft,\n right:\n scrollContainerStationing.offsetLeft +\n scrollContainerStationing.clientWidth,\n width: scrollContainerStationing.clientWidth,\n height: scrollContainerStationing.clientHeight,\n };\n stationingData.width = layoutStationing.offsetWidth;\n stationingData.height = layoutStationing.offsetHeight;\n stationingData.maxWidth = scrollContainerPosition.width;\n stationingData.maxHeight = scrollContainerPosition.height;\n if (\n isElementScrollable(\n layoutStationing,\n scrollContainerStationing,\n anchorStationing,\n verticalAlign === 'top',\n startScroll,\n )\n ) {\n stationingData.position = 'fixed';\n if (verticalAlign === 'top')\n stationingData.top = anchorStationing\n ? anchorStationing.offsetTop\n : scrollContainerPosition.top;\n else\n stationingData.top = anchorStationing\n ? anchorStationing.offsetTop + anchorStationing.offsetHeight\n : scrollContainerPosition.bottom - layoutStationing.offsetHeight;\n if (horizontalAlign === 'left')\n stationingData.left = anchorStationing\n ? anchorStationing.offsetLeft\n : -window.scrollX + scrollContainerPosition.left;\n else\n stationingData.left = anchorStationing\n ? anchorStationing.offsetLeft +\n anchorStationing.offsetWidth -\n layoutStationing.offsetWidth\n : -window.scrollX +\n scrollContainerPosition.right -\n layoutStationing.offsetWidth;\n } else stationingData.position = 'unset';\n }\n return stationingData;\n};\n\nexport const useFixed: UseFixed = (\n layoutRef,\n scrollContainer,\n anchorRef,\n verticalAlign = verticalAlignDefault,\n horizontalAlign = horizontalAlignDefault,\n) => {\n const [stationing, setStationing] = useState<UseFixedData>({});\n const [result, setResult] = useState<UseFixedData>({});\n\n useEffect(() => {\n let startScroll = 0;\n setTimeout(\n () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n const parentStationing = getStationingElement(parentContainer);\n if (parentStationing) {\n startScroll =\n layoutRef.current.offsetTop - parentStationing.offsetTop >= 0\n ? layoutRef.current.offsetTop - parentStationing.offsetTop\n : 0;\n }\n positioning(startScroll);\n document.addEventListener('resize', resizing);\n if (typeof parentContainer?.addEventListener === 'function') {\n parentContainer?.addEventListener('resize', resizing);\n parentContainer?.addEventListener('scroll', () =>\n positioning(startScroll),\n );\n }\n }\n },\n typeof scrollContainer !== 'undefined' ? 0 : 500,\n );\n return () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n document.removeEventListener('resize', resizing);\n if (typeof parentContainer?.removeEventListener === 'function') {\n parentContainer?.removeEventListener('resize', resizing);\n parentContainer?.removeEventListener('scroll', () =>\n positioning(startScroll),\n );\n }\n }\n };\n }, [verticalAlign, horizontalAlign, layoutRef, scrollContainer, anchorRef]);\n\n useEffect(() => {\n setResult({ ...stationing });\n }, [\n stationing.top,\n stationing.left,\n stationing.position,\n stationing.width,\n stationing.height,\n stationing.maxHeight,\n stationing.maxWidth,\n ]);\n\n const resizing = () => {\n if (layoutRef && layoutRef.current && layoutRef.current.parentElement) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n const parentStationing = getStationingElement(parentContainer);\n setStationing({\n ...stationing,\n width: layoutRef.current.offsetWidth,\n height: layoutRef.current.offsetHeight,\n maxWidth: parentStationing?.clientWidth,\n maxHeight: parentStationing?.clientHeight,\n });\n }\n };\n\n const positioning = useCallback(\n (startScroll: number) => {\n if (\n layoutRef &&\n layoutRef.current &&\n layoutRef.current.parentElement &&\n typeof startScroll === 'number'\n ) {\n const parentContainer = scrollContainer\n ? getHTMLElement(scrollContainer)\n : layoutRef.current.parentElement;\n if (scrollContainer) {\n const stationingData = positioningElement(\n startScroll,\n getStationingElement(layoutRef.current),\n getStationingElement(parentContainer),\n getStationingElement(anchorRef?.current),\n verticalAlign,\n horizontalAlign,\n );\n setStationing({ ...stationingData });\n }\n }\n },\n [stationing],\n );\n\n return result;\n};\n"],"mappings":"suBAAA,OAAgBA,WAAhB,CAA6BC,SAA7B,CAAwCC,QAAxC,KAAwD,OAAxD,C,GAYMC,cAAa,CAAG,CAAC,KAAD,CAAQ,QAAR,C,CAEhBC,oBAAmC,CAAGD,aAAa,CAAC,CAAD,C,CAEnDE,eAAe,CAAG,CAAC,MAAD,CAAS,OAAT,C,CAElBC,sBAAuC,CAAGD,eAAe,CAAC,CAAD,C,CAkCzDE,cAA+B,CAAG,SAACC,CAAD,CAAa,OAC/CA,EAAO,EAAI,EAAEA,CAAO,WAAYC,YAAnB,EAAkCD,CAAO,WA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d,KAAK,CAAEW,CAAS,CAACxC,OAAV,CAAkBK,WAFd,CAGXyB,MAAM,CAAEU,CAAS,CAACxC,OAAV,CAAkBG,YAHf,CAIX4B,QAAQ,QAAEmB,CAAF,WAAEA,CAAF,QAAEA,CAAgB,CAAE3C,WAJjB,CAKXyB,SAAS,QAAEkB,CAAF,WAAEA,CAAF,QAAEA,CAAgB,CAAE5C,YALlB,GAOd,CACF,CAzEE,CA2EG6C,CAAW,CAAG9D,WAAW,CAC7B,SAACgC,CAAD,CAAyB,CACvB,GACEmB,CAAS,EACTA,CAAS,CAACxC,OADV,EAEAwC,CAAS,CAACxC,OAAV,CAAkBgD,aAFlB,EAGuB,QAAvB,QAAO3B,EAJT,CAKE,CACA,GAAM4B,EAAe,CAAGR,CAAe,CACnC7C,cAAc,CAAC6C,CAAD,CADqB,CAEnCD,CAAS,CAACxC,OAAV,CAAkBgD,aAFtB,CAGA,GAAIP,CAAJ,CAAqB,CACnB,GAAMf,EAAc,CAAGJ,kBAAkB,CACvCD,CADuC,CAEvCpB,oBAAoB,CAACuC,CAAS,CAACxC,OAAX,CAFmB,CAGvCC,oBAAoB,CAACgD,CAAD,CAHmB,CAIvChD,oBAAoB,QAACyC,CAAD,WAACA,CAAD,QAACA,CAAS,CAAE1C,OAAZ,CAJmB,CAKvCR,CALuC,CAMvCE,CANuC,CAAzC,CAQAkD,CAAa,kBAAMlB,CAAN,EACd,CACF,CACF,CAvB4B,CAwB7B,CAACiB,CAAD,CAxB6B,CA3E5B,CAsGH,MAAOE,EACR,CA7GM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCanary.js","names":["React","useMemo","cn","getGroups","withDefaultGetters","ListItem","renderHeader","defaultListPropInnerOffset","defaultListPropSize","cnList","List","props","items","onItemClick","groupsProp","groups","disabledProp","disabled","itemSpace","groupLabelSpace","dividerSpace","getItemLabel","getItemLeftIcon","getItemLeftSide","getItemRightIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemDisabled","getItemActive","getItemChecked","getItemOnClick","getItemRef","getItemStatus","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","renderItem","innerOffset","size","sortGroup","renderItemDefault","item","onClick","handleClick","e","params","label","leftSide","leftIcon","rightSide","rightIcon","active","checked","status","as","ref","space","className","map","group","groupIndex","key","index"],"sources":["../../../../../src/components/ListCanary/ListCanary.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { cn } from '##/utils/bem';\nimport { getGroups } from '##/utils/getGroups';\n\nimport { withDefaultGetters } from './helper';\nimport { ListItem } from './ListItem';\nimport { renderHeader } from './renderHeader';\nimport {\n defaultListPropInnerOffset,\n defaultListPropSize,\n ListComponent,\n ListPropRenderItem,\n} from './types';\n\nexport const cnList = cn('List');\n\nexport const List: ListComponent = (props) => {\n const {\n items,\n onItemClick,\n groups: groupsProp,\n disabled: disabledProp,\n itemSpace,\n groupLabelSpace,\n dividerSpace,\n getItemLabel,\n getItemLeftIcon,\n getItemLeftSide,\n getItemRightIcon,\n getItemRightSide,\n getItemAs,\n getItemAttributes,\n getItemGroupKey,\n getItemDisabled,\n getItemActive,\n getItemChecked,\n getItemOnClick,\n getItemRef,\n getItemStatus,\n getItemAdditionalClassName,\n getGroupKey,\n getGroupLabel,\n getGroupRightSide,\n getGroupAdditionalClassName,\n renderItem,\n innerOffset = defaultListPropInnerOffset,\n size = defaultListPropSize,\n sortGroup,\n } = withDefaultGetters(props);\n\n const groups = useMemo(\n () => getGroups(items, getItemGroupKey, groupsProp, getGroupKey, sortGroup),\n [groupsProp, items],\n );\n\n type ITEM = typeof items[number];\n\n const renderItemDefault: ListPropRenderItem<ITEM> = (item) => {\n const onClick = getItemOnClick(item);\n const disabled = getItemDisabled(item) ?? disabledProp;\n\n const handleClick: React.MouseEventHandler<HTMLElement> | undefined =\n !disabled && (onClick || onItemClick)\n ? (e) => {\n onClick?.(e);\n onItemClick?.(item, { e, item });\n }\n : undefined;\n\n const params = {\n ...(getItemAttributes?.(item) ?? {}),\n label: getItemLabel(item),\n disabled,\n leftSide: getItemLeftSide(item),\n leftIcon: getItemLeftIcon(item),\n rightSide: getItemRightSide(item),\n rightIcon: getItemRightIcon(item),\n active: getItemActive(item),\n checked: getItemChecked(item),\n status: getItemStatus(item),\n as: getItemAs?.(item),\n size,\n onClick: handleClick,\n innerOffset,\n ref: (getItemRef?.(item) as React.RefObject<HTMLDivElement>) || undefined,\n space: itemSpace,\n className: getItemAdditionalClassName?.(item),\n };\n\n return <ListItem {...params} />;\n };\n\n return (\n <>\n {groups.map((group, groupIndex) => {\n return (\n <React.Fragment key={group.key}>\n {renderHeader(\n group.group && getGroupLabel(group.group),\n groupIndex === 0,\n size,\n group.group && getGroupRightSide(group.group),\n groupLabelSpace,\n dividerSpace,\n getGroupAdditionalClassName &&\n group.group &&\n getGroupAdditionalClassName(group.group),\n )}\n {group.items.map((item, index) => {\n return (\n <React.Fragment key={`${group.key}-${index}`}>\n {(renderItem ?? renderItemDefault)(item)}\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n"],"mappings":"qqBAAA,MAAOA,MAAP,EAAgBC,OAAhB,KAA+B,OAA/B,CAEA,OAASC,EAAT,uBACA,OAASC,SAAT,6BAEA,OAASC,kBAAT,gBACA,OAASC,QAAT,kBACA,OAASC,YAAT,sBACA,OACEC,0BADF,CAEEC,mBAFF,eAOA,MAAO,IAAMC,OAAM,CAAGP,EAAE,CAAC,MAAD,CAAjB,CAEP,MAAO,IAAMQ,KAAmB,CAAG,SAACC,CAAD,CAAW,OAgCxCP,kBAAkB,CAACO,CAAD,CAhCsB,CAE1CC,CAF0C,GAE1CA,KAF0C,CAG1CC,CAH0C,GAG1CA,WAH0C,CAIlCC,CAJkC,GAI1CC,MAJ0C,CAKhCC,CALgC,GAK1CC,QAL0C,CAM1CC,CAN0C,GAM1CA,SAN0C,CAO1CC,CAP0C,GAO1CA,eAP0C,CAQ1CC,CAR0C,GA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qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,CAAED,CAAK,CAACE,GAA3B,EACG3D,YAAY,CACXyD,CAAK,CAACA,KAAN,EAAe1B,CAAa,CAAC0B,CAAK,CAACA,KAAP,CADjB,CAEI,CAAf,GAAAC,CAFW,CAGXtB,CAHW,CAIXqB,CAAK,CAACA,KAAN,EAAezB,CAAiB,CAACyB,CAAK,CAACA,KAAP,CAJrB,CAKX5C,CALW,CAMXC,CANW,CAOXmB,CAA2B,EACzBwB,CAAK,CAACA,KADR,EAEExB,CAA2B,CAACwB,CAAK,CAACA,KAAP,CATlB,CADf,CAYGA,CAAK,CAACnD,KAAN,CAAYkD,GAAZ,CAAgB,SAACjB,CAAD,CAAOqB,CAAP,CAAiB,CAChC,MACE,qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,WAAKH,CAAK,CAACE,GAAX,aAAkBC,CAAlB,CAAnB,EACG,QAAC1B,CAAD,WAACA,CAAD,CAACA,CAAD,CAAeI,CAAf,EAAkCC,CAAlC,CADH,CAIH,CANA,CAZH,CAqBH,CAvBA,CADH,CA2BH,CAxGM"}
|
|
1
|
+
{"version":3,"file":"ListCanary.js","names":["React","useMemo","cn","getGroups","withDefaultGetters","ListItem","renderHeader","defaultListPropInnerOffset","defaultListPropSize","cnList","List","props","items","onItemClick","groupsProp","groups","disabledProp","disabled","itemSpace","groupLabelSpace","dividerSpace","getItemLabel","getItemLeftIcon","getItemLeftSide","getItemRightIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemDisabled","getItemActive","getItemChecked","getItemOnClick","getItemRef","getItemStatus","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","renderItem","innerOffset","size","sortGroup","renderItemDefault","item","onClick","handleClick","e","params","label","leftSide","leftIcon","rightSide","rightIcon","active","checked","status","as","ref","space","className","map","group","groupIndex","key","index"],"sources":["../../../../../src/components/ListCanary/ListCanary.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { cn } from '##/utils/bem';\nimport { getGroups } from '##/utils/getGroups';\n\nimport { withDefaultGetters } from './helper';\nimport { ListItem } from './ListItem';\nimport { renderHeader } from './renderHeader';\nimport {\n defaultListPropInnerOffset,\n defaultListPropSize,\n ListComponent,\n ListPropRenderItem,\n} from './types';\n\nexport const cnList = cn('List');\n\nexport const List: ListComponent = (props) => {\n const {\n items,\n onItemClick,\n groups: groupsProp,\n disabled: disabledProp,\n itemSpace,\n groupLabelSpace,\n dividerSpace,\n getItemLabel,\n getItemLeftIcon,\n getItemLeftSide,\n getItemRightIcon,\n getItemRightSide,\n getItemAs,\n getItemAttributes,\n getItemGroupKey,\n getItemDisabled,\n getItemActive,\n getItemChecked,\n getItemOnClick,\n getItemRef,\n getItemStatus,\n getItemAdditionalClassName,\n getGroupKey,\n getGroupLabel,\n getGroupRightSide,\n getGroupAdditionalClassName,\n renderItem,\n innerOffset = defaultListPropInnerOffset,\n size = defaultListPropSize,\n sortGroup,\n } = withDefaultGetters(props);\n\n const groups = useMemo(\n () => getGroups(items, getItemGroupKey, groupsProp, getGroupKey, sortGroup),\n [groupsProp, items],\n );\n\n type ITEM = (typeof items)[number];\n\n const renderItemDefault: ListPropRenderItem<ITEM> = (item) => {\n const onClick = getItemOnClick(item);\n const disabled = getItemDisabled(item) ?? disabledProp;\n\n const handleClick: React.MouseEventHandler<HTMLElement> | undefined =\n !disabled && (onClick || onItemClick)\n ? (e) => {\n onClick?.(e);\n onItemClick?.(item, { e, item });\n }\n : undefined;\n\n const params = {\n ...(getItemAttributes?.(item) ?? {}),\n label: getItemLabel(item),\n disabled,\n leftSide: getItemLeftSide(item),\n leftIcon: getItemLeftIcon(item),\n rightSide: getItemRightSide(item),\n rightIcon: getItemRightIcon(item),\n active: getItemActive(item),\n checked: getItemChecked(item),\n status: getItemStatus(item),\n as: getItemAs?.(item),\n size,\n onClick: handleClick,\n innerOffset,\n ref: (getItemRef?.(item) as React.RefObject<HTMLDivElement>) || undefined,\n space: itemSpace,\n className: getItemAdditionalClassName?.(item),\n };\n\n return <ListItem {...params} />;\n };\n\n return (\n <>\n {groups.map((group, groupIndex) => {\n return (\n <React.Fragment key={group.key}>\n {renderHeader(\n group.group && getGroupLabel(group.group),\n groupIndex === 0,\n size,\n group.group && getGroupRightSide(group.group),\n groupLabelSpace,\n dividerSpace,\n getGroupAdditionalClassName &&\n group.group &&\n getGroupAdditionalClassName(group.group),\n )}\n {group.items.map((item, index) => {\n return (\n <React.Fragment key={`${group.key}-${index}`}>\n {(renderItem ?? renderItemDefault)(item)}\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </>\n );\n};\n"],"mappings":"qqBAAA,MAAOA,MAAP,EAAgBC,OAAhB,KAA+B,OAA/B,CAEA,OAASC,EAAT,uBACA,OAASC,SAAT,6BAEA,OAASC,kBAAT,gBACA,OAASC,QAAT,kBACA,OAASC,YAAT,sBACA,OACEC,0BADF,CAEEC,mBAFF,eAOA,MAAO,IAAMC,OAAM,CAAGP,EAAE,CAAC,MAAD,CAAjB,CAEP,MAAO,IAAMQ,KAAmB,CAAG,SAACC,CAAD,CAAW,OAgCxCP,kBAAkB,CAACO,CAAD,CAhCsB,CAE1CC,CAF0C,GAE1CA,KAF0C,CAG1CC,CAH0C,GAG1CA,WAH0C,CAIlCC,CAJkC,GAI1CC,MAJ0C,CAKhCC,CALgC,GAK1CC,QAL0C,CAM1CC,CAN0C,GAM1CA,SAN0C,CAO1CC,CAP0C,GAO1CA,eAP0C,CAQ1CC,CAR0C,GAQ1CA,YAR0C,CAS1CC,CAT0C,GAS1CA,YAT0C,CAU1CC,CAV0C,GAU1CA,eAV0C,CAW1CC,CAX0C,GAW1CA,eAX0C,CAY1CC,CAZ0C,GAY1CA,gBAZ0C,CAa1CC,CAb0C,GAa1CA,gBAb0C,CAc1CC,CAd0C,GAc1CA,SAd0C,CAe1CC,CAf0C,GAe1CA,iBAf0C,CAgB1CC,CAhB0C,GAgB1CA,eAhB0C,CAiB1CC,CA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CAOXmB,CAA2B,EACzBwB,CAAK,CAACA,KADR,EAEExB,CAA2B,CAACwB,CAAK,CAACA,KAAP,CATlB,CADf,CAYGA,CAAK,CAACnD,KAAN,CAAYkD,GAAZ,CAAgB,SAACjB,CAAD,CAAOqB,CAAP,CAAiB,CAChC,MACE,qBAAC,KAAD,CAAO,QAAP,EAAgB,GAAG,WAAKH,CAAK,CAACE,GAAX,aAAkBC,CAAlB,CAAnB,EACG,QAAC1B,CAAD,WAACA,CAAD,CAACA,CAAD,CAAeI,CAAf,EAAkCC,CAAlC,CADH,CAIH,CANA,CAZH,CAqBH,CAvBA,CADH,CA2BH,CAxGM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ListItemGrid{
|
|
1
|
+
.ListItemGrid{box-sizing:border-box;gap:var(--space-xs);justify-content:space-between;overflow-wrap:break-word}.ListItemGrid,.ListItemGrid-Slot{align-items:center;display:flex}.ListItemGrid-Slot_position_left,.ListItemGrid-Slot_position_right{width:-moz-max-content;width:max-content}.ListItemGrid-Slot_position_center{flex:1}
|
|
@@ -6,15 +6,15 @@ import { AsAttributes, AsTags } from '../../utils/types/AsTags';
|
|
|
6
6
|
import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
|
|
7
7
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
8
8
|
export declare const listPropSize: readonly ["m", "xs", "s", "l"];
|
|
9
|
-
export type ListPropSize = typeof listPropSize[number];
|
|
9
|
+
export type ListPropSize = (typeof listPropSize)[number];
|
|
10
10
|
export declare const defaultListPropSize: "m";
|
|
11
11
|
export declare const listPropInnerOffset: readonly ["normal", "increased"];
|
|
12
|
-
export type ListPropInnerOffset = typeof listPropInnerOffset[number];
|
|
12
|
+
export type ListPropInnerOffset = (typeof listPropInnerOffset)[number];
|
|
13
13
|
export declare const defaultListPropInnerOffset: "normal";
|
|
14
14
|
export declare const listPropStatus: readonly ["alert", "success", "warning"];
|
|
15
|
-
export type ListPropStatus = typeof listPropStatus[number];
|
|
15
|
+
export type ListPropStatus = (typeof listPropStatus)[number];
|
|
16
16
|
export declare const listPropForm: readonly ["default", "brick", "round"];
|
|
17
|
-
export type ListPropForm = typeof listPropForm[number];
|
|
17
|
+
export type ListPropForm = (typeof listPropForm)[number];
|
|
18
18
|
export declare const defaultListPropForm: "default";
|
|
19
19
|
export type DefaultListGroup = {
|
|
20
20
|
id: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = typeof listPropSize[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = typeof listPropInnerOffset[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = typeof listPropStatus[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = typeof listPropForm[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (item: ITEM) => React.ReactNode | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpace?: MixSpaceProps;\n groupLabelSpace?: MixSpaceProps;\n dividerSpace?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nexport type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n>;\n\nexport type ListItemComponent = <AS extends AsTags = 'div'>(\n props: ListItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n disabled?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AASA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = (typeof listPropSize)[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = (typeof listPropInnerOffset)[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = (typeof listPropStatus)[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = (typeof listPropForm)[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (item: ITEM) => React.ReactNode | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpace?: MixSpaceProps;\n groupLabelSpace?: MixSpaceProps;\n dividerSpace?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nexport type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n>;\n\nexport type ListItemComponent = <AS extends AsTags = 'div'>(\n props: ListItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n disabled?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AASA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
.deprecated--Loader{--backgroundColor:var(
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
--loaderBackgroundColor,var(--color-control-bg-primary)
|
|
3
|
+
);height:calc(100% - var(--loader-size));left:50%;position:relative;top:50%;transform:translate(-50%,-50%);width:100%}.deprecated--Loader:before{animation:loader 1s ease infinite;background:var(--backgroundColor);border-radius:50%;content:"";height:var(--loader-size);left:calc(50% - var(--loader-size)*2 - var(--loader-gap));position:absolute;top:calc(50% - var(--loader-size)*.5);width:var(--loader-size)}.deprecated--Loader:after{animation:loader 1s ease -.36s infinite;background:var(--backgroundColor);border-radius:50%;content:"";height:var(--loader-size);left:calc(50% + var(--loader-size) + var(--loader-gap));position:absolute;top:calc(50% - var(--loader-size)*.5);width:var(--loader-size)}.deprecated--Loader-Dot{animation:loader 1s ease -.18s infinite;background:var(--backgroundColor);border-radius:50%;height:var(--loader-size);left:calc(50% - var(--loader-size)*.5);position:absolute;top:calc(50% - var(--loader-size)*.5);width:var(--loader-size)}.deprecated--Loader_size_xs{--loader-size:var(--space-2xs);--loader-gap:var(--space-3xs)}.deprecated--Loader_size_s{--loader-size:var(--space-2xs);--loader-gap:var(--space-2xs)}.deprecated--Loader_size_m{--loader-size:var(--space-xs);--loader-gap:calc(var(--space-xs) - var(--space-3xs))}@keyframes loader{50%{transform:scale(1.5)}}
|
|
@@ -2,7 +2,7 @@ import './Loader.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
export declare const loaderPropSize: readonly ["m", "s", "xs"];
|
|
5
|
-
export type LoaderPropSize = typeof loaderPropSize[number];
|
|
5
|
+
export type LoaderPropSize = (typeof loaderPropSize)[number];
|
|
6
6
|
export declare const loaderPropSizeDefault: LoaderPropSize;
|
|
7
7
|
type Props = {
|
|
8
8
|
size?: LoaderPropSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoaderDeprecated.js","names":["React","cnDeprecated","loaderPropSize","loaderPropSizeDefault","cnLoader","Loader","forwardRef","props","ref","className","size","otherProps"],"sources":["../../../../../src/components/LoaderDeprecated/LoaderDeprecated.tsx"],"sourcesContent":["import './Loader.css';\n\nimport React from 'react';\n\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const loaderPropSize = ['m', 's', 'xs'] as const;\nexport type LoaderPropSize = typeof loaderPropSize[number];\nexport const loaderPropSizeDefault: LoaderPropSize = loaderPropSize[0];\n\ntype Props = {\n size?: LoaderPropSize;\n children?: never;\n};\n\nexport type LoaderProps = PropsWithHTMLAttributes<Props, HTMLDivElement>;\n\nexport const cnLoader = cnDeprecated('Loader');\n\nexport const Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (props, ref) => {\n const { className, size = loaderPropSizeDefault, ...otherProps } = props;\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnLoader({ size }, [className])}\n >\n <div className={cnLoader('Dot')} />\n </div>\n );\n },\n);\n"],"mappings":"wHAAA,qBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,YAAT,uBAGA,MAAO,IAAMC,eAAc,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,IAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CASP,MAAO,IAAME,SAAQ,CAAGH,YAAY,CAAC,QAAD,CAA7B,CAEP,MAAO,IAAMI,OAAM,CAAGL,KAAK,CAACM,UAAN,CACpB,SAACC,CAAD,CAAQC,CAAR,CAAgB,CACd,GAAQC,EAAR,CAAmEF,CAAnE,CAAQE,SAAR,GAAmEF,CAAnE,CAAmBG,IAAnB,CAAmBA,CAAnB,YAA0BP,qBAA1B,GAAoDQ,CAApD,0BAAmEJ,CAAnE,YACA,MACE,4CACMI,CADN,EAEE,GAAG,CAAEH,CAFP,CAGE,SAAS,CAAEJ,QAAQ,CAAC,CAAEM,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACD,CAAD,CAAX,CAHrB,GAKE,2BAAK,SAAS,CAAEL,QAAQ,CAAC,KAAD,CAAxB,EALF,CAQH,CAZmB,CAAf"}
|
|
1
|
+
{"version":3,"file":"LoaderDeprecated.js","names":["React","cnDeprecated","loaderPropSize","loaderPropSizeDefault","cnLoader","Loader","forwardRef","props","ref","className","size","otherProps"],"sources":["../../../../../src/components/LoaderDeprecated/LoaderDeprecated.tsx"],"sourcesContent":["import './Loader.css';\n\nimport React from 'react';\n\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const loaderPropSize = ['m', 's', 'xs'] as const;\nexport type LoaderPropSize = (typeof loaderPropSize)[number];\nexport const loaderPropSizeDefault: LoaderPropSize = loaderPropSize[0];\n\ntype Props = {\n size?: LoaderPropSize;\n children?: never;\n};\n\nexport type LoaderProps = PropsWithHTMLAttributes<Props, HTMLDivElement>;\n\nexport const cnLoader = cnDeprecated('Loader');\n\nexport const Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (props, ref) => {\n const { className, size = loaderPropSizeDefault, ...otherProps } = props;\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnLoader({ size }, [className])}\n >\n <div className={cnLoader('Dot')} />\n </div>\n );\n },\n);\n"],"mappings":"wHAAA,qBAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,YAAT,uBAGA,MAAO,IAAMC,eAAc,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,IAAX,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CASP,MAAO,IAAME,SAAQ,CAAGH,YAAY,CAAC,QAAD,CAA7B,CAEP,MAAO,IAAMI,OAAM,CAAGL,KAAK,CAACM,UAAN,CACpB,SAACC,CAAD,CAAQC,CAAR,CAAgB,CACd,GAAQC,EAAR,CAAmEF,CAAnE,CAAQE,SAAR,GAAmEF,CAAnE,CAAmBG,IAAnB,CAAmBA,CAAnB,YAA0BP,qBAA1B,GAAoDQ,CAApD,0BAAmEJ,CAAnE,YACA,MACE,4CACMI,CADN,EAEE,GAAG,CAAEH,CAFP,CAGE,SAAS,CAAEJ,QAAQ,CAAC,CAAEM,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACD,CAAD,CAAX,CAHrB,GAKE,2BAAK,SAAS,CAAEL,QAAQ,CAAC,KAAD,CAAxB,EALF,CAQH,CAZmB,CAAf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.ModalLayout{display:flex;flex:1;flex-direction:column;justify-content:space-between}.ModalLayout-Slot{background-color:var(--color-bg-default);transition:box-shadow .3s}.ModalLayout-Slot_border_top{box-shadow:0 1px 0 0 var(--color-bg-border) inset,0 -2px 3px var(--modal-layout-slot-color-shadow,transparent);padding-top:1px}.ModalLayout-Slot_border_top[class*=MixSpace_pT]{padding-top:calc(var(--space-padding-top) + 1px)}.ModalLayout-Slot_border_bottom{box-shadow:0 -1px 0 0 var(--color-bg-border) inset,0 2px 3px var(--modal-layout-slot-color-shadow,transparent);padding-bottom:1px}.ModalLayout-Slot_border_bottom[class*=MixSpace_pB]{padding-bottom:calc(var(--space-padding-bottom) + 1px)}.ModalLayout-Slot_fixed_top{--modal-layout-slot-color-shadow:var(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
--modal-layout-header-color-shadow
|
|
3
|
+
);top:0}.ModalLayout-Slot_fixed_bottom,.ModalLayout-Slot_fixed_top{position:sticky;z-index:calc(var(--modal-layout-z-index-for-fixed-slot) + 1)}.ModalLayout-Slot_fixed_bottom{--modal-layout-slot-color-shadow:var(
|
|
4
|
+
--modal-layout-footer-color-shadow
|
|
5
|
+
);bottom:0}.ModalLayout-Slot_stretch{flex:1}
|
|
@@ -2,9 +2,9 @@ import './ModalDeprecated.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
declare const modalPropWidth: readonly ["auto"];
|
|
5
|
-
type ModalPropWidth = typeof modalPropWidth[number];
|
|
5
|
+
type ModalPropWidth = (typeof modalPropWidth)[number];
|
|
6
6
|
declare const modalPropPosition: readonly ["center", "top"];
|
|
7
|
-
type ModalPropPosition = typeof modalPropPosition[number];
|
|
7
|
+
type ModalPropPosition = (typeof modalPropPosition)[number];
|
|
8
8
|
type ModalProps = PropsWithHTMLAttributes<{
|
|
9
9
|
isOpen?: boolean;
|
|
10
10
|
onClose?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalDeprecated.js","names":["React","useEffect","useRef","Transition","PortalWithTheme","PortalWithThemeConsumer","useTheme","useGlobalKeys","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnDeprecated","cn","modalPropWidth","modalPropWidthDefault","modalPropPosition","modalPropPositionDefault","cnModal","Modal","props","isOpen","onClose","onOpen","hasOverlay","onOverlayClick","onClickOutside","onEsc","className","width","position","children","container","window","document","body","refsForExcludeClickOutside","rootClassName","afterClose","style","otherProps","ref","portalRef","theme","Escape","e","animate","zIndex"],"sources":["../../../../../src/components/ModalDeprecated/ModalDeprecated.tsx"],"sourcesContent":["import './ModalDeprecated.css';\n\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { useGlobalKeys } from '##/hooks/useGlobalKeys';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnDeprecated as cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nconst modalPropWidth = ['auto'] as const;\ntype ModalPropWidth = typeof modalPropWidth[number];\nconst modalPropWidthDefault: ModalPropWidth = modalPropWidth[0];\n\nconst modalPropPosition = ['center', 'top'] as const;\ntype ModalPropPosition = typeof modalPropPosition[number];\nconst modalPropPositionDefault: ModalPropPosition = modalPropPosition[0];\n\ntype ModalProps = PropsWithHTMLAttributes<\n {\n isOpen?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n hasOverlay?: boolean;\n /** @deprecated use onClickOutside */\n onOverlayClick?: (event: MouseEvent) => void;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n rootClassName?: string;\n width?: ModalPropWidth;\n position?: ModalPropPosition;\n children?: React.ReactNode;\n container?: HTMLDivElement | undefined;\n afterClose?: () => void;\n refsForExcludeClickOutside?: React.RefObject<HTMLElement>[];\n },\n HTMLDivElement\n>;\n\nexport const cnModal = cn('Modal');\n\nexport const Modal: React.FC<ModalProps> = (props) => {\n const {\n isOpen,\n onClose,\n onOpen,\n hasOverlay = true,\n onOverlayClick,\n onClickOutside,\n onEsc,\n className,\n width = modalPropWidthDefault,\n position = modalPropPositionDefault,\n children,\n container = window.document.body,\n refsForExcludeClickOutside,\n rootClassName,\n afterClose,\n style,\n ...otherProps\n } = props;\n\n const ref = useRef<HTMLDivElement | null>(null);\n const portalRef = useRef<HTMLDivElement | null>(null);\n const { theme } = useTheme();\n\n useEffect(() => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [isOpen]);\n\n useGlobalKeys({\n Escape: (e: KeyboardEvent) => isOpen && onEsc && onEsc(e),\n });\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={portalRef}\n timeout={animateTimeout}\n onExited={afterClose}\n >\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n container={container}\n className={cnModal({ hasOverlay }, [rootClassName])}\n ref={portalRef}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex }\n : undefined\n }\n >\n {hasOverlay && (\n <div\n className={cnModal('Overlay', { animate })}\n aria-label=\"Overlay\"\n />\n )}\n <div\n {...otherProps}\n style={{\n ...style,\n zIndex: undefined,\n }}\n className={cnModal('Window', { width, position }, [\n cnMixPopoverAnimate({ animate }),\n className,\n cnMixScrollBar(),\n ])}\n ref={ref}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside || onOverlayClick}\n ignoreClicksInsideRefs={[\n ...(refsForExcludeClickOutside || []),\n ref,\n ]}\n >\n {children}\n </PortalWithThemeConsumer>\n </div>\n </PortalWithTheme>\n )}\n </Transition>\n );\n};\n"],"mappings":"8hCAAA,8BAEA,MAAOA,MAAP,EAAgBC,SAAhB,CAA2BC,MAA3B,KAAyC,OAAzC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBACA,OAASC,aAAT,iCACA,OAASC,cAAT,CAAyBC,mBAAzB,oCACA,OAASC,cAAT,+BACA,OAASC,YAAY,GAAIC,GAAzB,uB,GAGMC,eAAc,CAAG,CAAC,MAAD,C,CAEjBC,qBAAqC,CAAGD,cAAc,CAAC,CAAD,C,CAEtDE,iBAAiB,CAAG,CAAC,QAAD,CAAW,KAAX,C,CAEpBC,wBAA2C,CAAGD,iBAAiB,CAAC,CAAD,C,CAuBrE,MAAO,IAAME,QAAO,CAAGL,EAAE,CAAC,OAAD,CAAlB,CAEP,MAAO,IAAMM,MAA2B,CAAG,SAACC,CAAD,CAAW,IAElDC,EAFkD,CAmBhDD,CAnBgD,CAElDC,MAFkD,CAGlDC,CAHkD,CAmBhDF,CAnBgD,CAGlDE,OAHkD,CAIlDC,CAJkD,CAmBhDH,CAnBgD,CAIlDG,MAJkD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b,CACE,oBAAC,UAAD,EACE,GAAIxB,CADN,CAEE,aAAa,GAFf,CAGE,OAAO,CAAEqB,CAHX,CAIE,OAAO,CAAEjC,cAJX,CAKE,QAAQ,CAAE6B,CALZ,EAOG,SAACQ,CAAD,QACC,qBAAC,eAAD,EACE,MAAM,CAAEH,CADV,CAEE,SAAS,CAAEX,CAFb,CAGE,SAAS,CAAEd,OAAO,CAAC,CAAEM,UAAU,CAAVA,CAAF,CAAD,CAAiB,CAACa,CAAD,CAAjB,CAHpB,CAIE,GAAG,CAAEK,CAJP,CAKE,KAAK,CACsB,QAAzB,gBAAOH,CAAP,WAAOA,CAAP,QAAOA,CAAK,CAAEQ,MAAd,EACI,CAAEA,MAAM,CAAER,CAAK,CAACQ,MAAhB,CADJ,OANJ,EAWGvB,CAAU,EACT,2BACE,SAAS,CAAEN,OAAO,CAAC,SAAD,CAAY,CAAE4B,OAAO,CAAPA,CAAF,CAAZ,CADpB,CAEE,aAAW,SAFb,EAZJ,CAiBE,2CACMN,CADN,EAEE,KAAK,gCACAD,CADA,MAEHQ,MAAM,OAFH,EAFP,CAME,SAAS,CAAE7B,OAAO,CAAC,QAAD,CAAW,CAAEW,KAAK,CAALA,CAAF,CAASC,QAAQ,CAARA,CAAT,CAAX,CAAgC,CAChDpB,mBAAmB,CAAC,CAAEoC,OAAO,CAAPA,CAAF,CAAD,CAD6B,CAEhDlB,CAFgD,CAGhDjB,cAAc,EAHkC,CAAhC,CANpB,CAWE,GAAG,CAAE8B,CAXP,GAaE,oBAAC,uBAAD,EACE,cAAc,CAAEf,CAAc,EAAID,CADpC,CAEE,sBAAsB,8BAChBW,CAA0B,EAAI,EADd,GAEpBK,CAFoB,EAFxB,EAOGV,CAPH,CAbF,CAjBF,CADD,CAPH,CAoDH,CA1FM"}
|
|
1
|
+
{"version":3,"file":"ModalDeprecated.js","names":["React","useEffect","useRef","Transition","PortalWithTheme","PortalWithThemeConsumer","useTheme","useGlobalKeys","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnDeprecated","cn","modalPropWidth","modalPropWidthDefault","modalPropPosition","modalPropPositionDefault","cnModal","Modal","props","isOpen","onClose","onOpen","hasOverlay","onOverlayClick","onClickOutside","onEsc","className","width","position","children","container","window","document","body","refsForExcludeClickOutside","rootClassName","afterClose","style","otherProps","ref","portalRef","theme","Escape","e","animate","zIndex"],"sources":["../../../../../src/components/ModalDeprecated/ModalDeprecated.tsx"],"sourcesContent":["import './ModalDeprecated.css';\n\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { useGlobalKeys } from '##/hooks/useGlobalKeys';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnDeprecated as cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nconst modalPropWidth = ['auto'] as const;\ntype ModalPropWidth = (typeof modalPropWidth)[number];\nconst modalPropWidthDefault: ModalPropWidth = modalPropWidth[0];\n\nconst modalPropPosition = ['center', 'top'] as const;\ntype ModalPropPosition = (typeof modalPropPosition)[number];\nconst modalPropPositionDefault: ModalPropPosition = modalPropPosition[0];\n\ntype ModalProps = PropsWithHTMLAttributes<\n {\n isOpen?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n hasOverlay?: boolean;\n /** @deprecated use onClickOutside */\n onOverlayClick?: (event: MouseEvent) => void;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n rootClassName?: string;\n width?: ModalPropWidth;\n position?: ModalPropPosition;\n children?: React.ReactNode;\n container?: HTMLDivElement | undefined;\n afterClose?: () => void;\n refsForExcludeClickOutside?: React.RefObject<HTMLElement>[];\n },\n HTMLDivElement\n>;\n\nexport const cnModal = cn('Modal');\n\nexport const Modal: React.FC<ModalProps> = (props) => {\n const {\n isOpen,\n onClose,\n onOpen,\n hasOverlay = true,\n onOverlayClick,\n onClickOutside,\n onEsc,\n className,\n width = modalPropWidthDefault,\n position = modalPropPositionDefault,\n children,\n container = window.document.body,\n refsForExcludeClickOutside,\n rootClassName,\n afterClose,\n style,\n ...otherProps\n } = props;\n\n const ref = useRef<HTMLDivElement | null>(null);\n const portalRef = useRef<HTMLDivElement | null>(null);\n const { theme } = useTheme();\n\n useEffect(() => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [isOpen]);\n\n useGlobalKeys({\n Escape: (e: KeyboardEvent) => isOpen && onEsc && onEsc(e),\n });\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={portalRef}\n timeout={animateTimeout}\n onExited={afterClose}\n >\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n container={container}\n className={cnModal({ hasOverlay }, [rootClassName])}\n ref={portalRef}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex }\n : undefined\n }\n >\n {hasOverlay && (\n <div\n className={cnModal('Overlay', { animate })}\n aria-label=\"Overlay\"\n />\n )}\n <div\n {...otherProps}\n style={{\n ...style,\n zIndex: undefined,\n }}\n className={cnModal('Window', { width, position }, [\n cnMixPopoverAnimate({ animate }),\n className,\n cnMixScrollBar(),\n ])}\n ref={ref}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside || onOverlayClick}\n ignoreClicksInsideRefs={[\n ...(refsForExcludeClickOutside || []),\n ref,\n ]}\n >\n {children}\n </PortalWithThemeConsumer>\n </div>\n </PortalWithTheme>\n )}\n </Transition>\n );\n};\n"],"mappings":"8hCAAA,8BAEA,MAAOA,MAAP,EAAgBC,SAAhB,CAA2BC,MAA3B,KAAyC,OAAzC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBACA,OAASC,aAAT,iCACA,OAASC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AAEW,KAAK,CAALA,CAAF,CAASC,QAAQ,CAARA,CAAT,CAAX,CAAgC,CAChDpB,mBAAmB,CAAC,CAAEoC,OAAO,CAAPA,CAAF,CAAD,CAD6B,CAEhDlB,CAFgD,CAGhDjB,cAAc,EAHkC,CAAhC,CANpB,CAWE,GAAG,CAAE8B,CAXP,GAaE,oBAAC,uBAAD,EACE,cAAc,CAAEf,CAAc,EAAID,CADpC,CAEE,sBAAsB,8BAChBW,CAA0B,EAAI,EADd,GAEpBK,CAFoB,EAFxB,EAOGV,CAPH,CAbF,CAjBF,CADD,CAPH,CAoDH,CA1FM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{format}from"date-fns";import
|
|
1
|
+
import{format,formatDistanceToNow}from"date-fns";import{ru}from"date-fns/locale";export var defaultDateFormat=function(a){var b=new Date;if(36e5>b.getTime()-a.getTime()){var c=formatDistanceToNow(a,{locale:ru,addSuffix:!0});return c.charAt(0).toUpperCase()+c.slice(1)}return format(b,"dd.MM.yyyy")===format(a,"dd.MM.yyyy")?format(a,"HH:mm"):format(a,"dd.MM.yyyy HH:mm")};
|
|
2
2
|
//# sourceMappingURL=defaultDateFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultDateFormat.js","names":["format","formatDistanceToNow","
|
|
1
|
+
{"version":3,"file":"defaultDateFormat.js","names":["format","formatDistanceToNow","ru","defaultDateFormat","date","currentDate","Date","getTime","str","locale","addSuffix","charAt","toUpperCase","slice"],"sources":["../../../../../../src/components/Notification/helpers/defaultDateFormat.ts"],"sourcesContent":["import { format, formatDistanceToNow } from 'date-fns';\nimport { ru } from 'date-fns/locale';\n\nexport const defaultDateFormat = (date: Date): string => {\n const currentDate = new Date();\n\n if (currentDate.getTime() - date.getTime() < 3600000) {\n const str = formatDistanceToNow(date, {\n locale: ru,\n addSuffix: true,\n });\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n if (format(currentDate, 'dd.MM.yyyy') === format(date, 'dd.MM.yyyy')) {\n return format(date, 'HH:mm');\n }\n\n return format(date, 'dd.MM.yyyy HH:mm');\n};\n"],"mappings":"AAAA,OAASA,MAAT,CAAiBC,mBAAjB,KAA4C,UAA5C,CACA,OAASC,EAAT,KAAmB,iBAAnB,CAEA,MAAO,IAAMC,kBAAiB,CAAG,SAACC,CAAD,CAAwB,CACvD,GAAMC,EAAW,CAAG,GAAIC,KAAxB,CAEA,GAA6C,IAAzC,CAAAD,CAAW,CAACE,OAAZ,GAAwBH,CAAI,CAACG,OAAL,EAA5B,CAAsD,CACpD,GAAMC,EAAG,CAAGP,mBAAmB,CAACG,CAAD,CAAO,CACpCK,MAAM,CAAEP,EAD4B,CAEpCQ,SAAS,GAF2B,CAAP,CAA/B,CAIA,MAAOF,EAAG,CAACG,MAAJ,CAAW,CAAX,EAAcC,WAAd,GAA8BJ,CAAG,CAACK,KAAJ,CAAU,CAAV,CACtC,CATsD,MAWnDb,OAAM,CAACK,CAAD,CAAc,YAAd,CAAN,GAAsCL,MAAM,CAACI,CAAD,CAAO,YAAP,CAXO,CAY9CJ,MAAM,CAACI,CAAD,CAAO,OAAP,CAZwC,CAehDJ,MAAM,CAACI,CAAD,CAAO,kBAAP,CACd,CAhBM"}
|
|
@@ -4,13 +4,13 @@ import { AsAttributes, AsTags } from '../../utils/types/AsTags';
|
|
|
4
4
|
import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
|
|
5
5
|
import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
6
6
|
export declare const paginationPropForm: readonly ["default", "brick", "round"];
|
|
7
|
-
export type PaginationPropForm = typeof paginationPropForm[number];
|
|
7
|
+
export type PaginationPropForm = (typeof paginationPropForm)[number];
|
|
8
8
|
export declare const paginationPropFormDefault: PaginationPropForm;
|
|
9
9
|
export declare const paginationPropSize: readonly ["m", "xs", "s", "l"];
|
|
10
|
-
export type PaginationPropSize = typeof paginationPropSize[number];
|
|
10
|
+
export type PaginationPropSize = (typeof paginationPropSize)[number];
|
|
11
11
|
export declare const paginationPropSizeDefault: PaginationPropSize;
|
|
12
12
|
export declare const paginationPropType: readonly ["default", "input"];
|
|
13
|
-
export type PaginationPropType = typeof paginationPropType[number];
|
|
13
|
+
export type PaginationPropType = (typeof paginationPropType)[number];
|
|
14
14
|
export declare const paginationPropTypeDefault: PaginationPropType;
|
|
15
15
|
export type PaginationArrowTypes = 'first' | 'previous' | 'next' | 'last';
|
|
16
16
|
export type PaginationPropHotKey = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["paginationPropForm","paginationPropFormDefault","paginationPropSize","paginationPropSizeDefault","paginationPropType","paginationPropTypeDefault"],"sources":["../../../../../src/components/Pagination/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const paginationPropForm = ['default', 'brick', 'round'] as const;\nexport type PaginationPropForm = typeof paginationPropForm[number];\nexport const paginationPropFormDefault: PaginationPropForm =\n paginationPropForm[0];\n\nexport const paginationPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type PaginationPropSize = typeof paginationPropSize[number];\nexport const paginationPropSizeDefault: PaginationPropSize =\n paginationPropSize[0];\n\nexport const paginationPropType = ['default', 'input'] as const;\nexport type PaginationPropType = typeof paginationPropType[number];\nexport const paginationPropTypeDefault: PaginationPropType =\n paginationPropType[0];\n\nexport type PaginationArrowTypes = 'first' | 'previous' | 'next' | 'last';\n\nexport type PaginationPropHotKey = { label: string; keys: string[] };\n\nexport type PaginationPropOnItemClick<ITEM> = (\n item: ITEM,\n params: { e: React.MouseEvent },\n) => void;\n\nexport type PaginationPropOnChange<ITEM> = (\n value: ITEM,\n params: { e: React.MouseEvent | KeyboardEvent },\n) => void;\n\n// ARROWS\n\nexport type PaginationPropArrow =\n | boolean\n | IconComponent\n | {\n label?: string;\n icon?: IconComponent;\n };\n\nexport type PaginationBasePropArrow =\n | false\n | {\n label?: string;\n disabled?: boolean;\n icon?: IconComponent;\n onClick?: React.MouseEventHandler;\n };\n\ntype PaginationArrowsProps = {\n outerMostArrows?: [PaginationPropArrow?, PaginationPropArrow?];\n} & (\n | {\n arrows: [PaginationPropArrow?, PaginationPropArrow?];\n hotKeys?: [PaginationPropHotKey?, PaginationPropHotKey?];\n }\n | {\n arrows?: never;\n hotKeys?: never;\n }\n);\n\nexport type PaginationItem = {\n key: string | number;\n label: string;\n clickable: boolean;\n};\n\nexport type PaginationProps<TYPE extends PaginationPropType> =\n PropsWithHTMLAttributes<\n {\n type?: TYPE;\n showFirstPage?: boolean;\n showLastPage?: boolean;\n visibleCount?: number;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n containerEventListener?: HTMLElement | Window;\n value?: number;\n items?: number;\n onChange?: PaginationPropOnChange<number>;\n getItemAs?: PaginationPropGetItemAs<PaginationItem>;\n getItemAttributes?: PaginationPropGetItemAttributes<PaginationItem>;\n getItemRef?: PaginationPropGetItemRef<PaginationItem>;\n },\n HTMLDivElement\n > &\n PaginationArrowsProps &\n (TYPE extends 'input'\n ? { getTotalLabel?: (pages: number) => string | number }\n : {\n getTotalLabel?: never;\n });\n\nexport type PaginationComponent = <TYPE extends PaginationPropType>(\n props: PaginationProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type PaginationBaseItemDefault = {\n key: string | number;\n label?: string;\n as?: AsTags;\n ref?: React.RefObject<HTMLElement>;\n clickable?: boolean;\n attributes?: AsAttributes;\n onClick?: React.MouseEventHandler;\n};\n\nexport type PaginationPropGetItemKey<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['key'];\nexport type PaginationPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['label'];\nexport type PaginationPropGetItemClickable<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['clickable'];\nexport type PaginationPropGetItemAs<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['as'];\nexport type PaginationPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['attributes'];\nexport type PaginationPropGetItemRef<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['ref'];\nexport type PaginationPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['onClick'];\n\ntype Mappers<ITEM = PaginationBaseItemDefault> = {\n getItemLabel?: PaginationPropGetItemLabel<ITEM>;\n getItemKey: PaginationPropGetItemKey<ITEM>;\n getItemAs?: PaginationPropGetItemAs<ITEM>;\n getItemAttributes?: PaginationPropGetItemAttributes<ITEM>;\n getItemRef?: PaginationPropGetItemRef<ITEM>;\n getItemClickable?: PaginationPropGetItemClickable<ITEM>;\n getItemOnClick?: PaginationPropGetItemOnClick<ITEM>;\n};\n\nexport type PaginationArrowProps = PropsWithHTMLAttributes<\n {\n icon?: IconComponent;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n disabled?: boolean;\n orientation?: 'start' | 'end';\n label?: string;\n caption?: string;\n },\n HTMLButtonElement\n>;\n\nexport type PaginationItemProps<AS extends AsTags = 'button'> =\n PropsWithAsAttributes<\n {\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n label?: string;\n active?: boolean;\n clickable?: boolean;\n },\n AS\n >;\n\nexport type PaginationItemComponent = <AS extends AsTags = 'button'>(\n props: PaginationItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type PaginationNumberInputProps = PropsWithHTMLAttributes<\n {\n value?: number;\n onChange?: PaginationPropOnChange<number>;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n total: number;\n getTotalLabel?: (pages: number) => string | number;\n },\n HTMLDivElement\n>;\n\nexport type PaginationListProps<ITEM> = PropsWithHTMLAttributesAndRef<\n {\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n items: ITEM[];\n value?: ITEM;\n onItemClick?: PaginationPropOnItemClick<ITEM>;\n },\n HTMLDivElement\n> &\n Mappers<ITEM>;\n\nexport type PaginationListComponent = <ITEM extends PaginationBaseItemDefault>(\n props: PaginationListProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAUA,MAAO,IAAMA,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["paginationPropForm","paginationPropFormDefault","paginationPropSize","paginationPropSizeDefault","paginationPropType","paginationPropTypeDefault"],"sources":["../../../../../src/components/Pagination/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const paginationPropForm = ['default', 'brick', 'round'] as const;\nexport type PaginationPropForm = (typeof paginationPropForm)[number];\nexport const paginationPropFormDefault: PaginationPropForm =\n paginationPropForm[0];\n\nexport const paginationPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type PaginationPropSize = (typeof paginationPropSize)[number];\nexport const paginationPropSizeDefault: PaginationPropSize =\n paginationPropSize[0];\n\nexport const paginationPropType = ['default', 'input'] as const;\nexport type PaginationPropType = (typeof paginationPropType)[number];\nexport const paginationPropTypeDefault: PaginationPropType =\n paginationPropType[0];\n\nexport type PaginationArrowTypes = 'first' | 'previous' | 'next' | 'last';\n\nexport type PaginationPropHotKey = { label: string; keys: string[] };\n\nexport type PaginationPropOnItemClick<ITEM> = (\n item: ITEM,\n params: { e: React.MouseEvent },\n) => void;\n\nexport type PaginationPropOnChange<ITEM> = (\n value: ITEM,\n params: { e: React.MouseEvent | KeyboardEvent },\n) => void;\n\n// ARROWS\n\nexport type PaginationPropArrow =\n | boolean\n | IconComponent\n | {\n label?: string;\n icon?: IconComponent;\n };\n\nexport type PaginationBasePropArrow =\n | false\n | {\n label?: string;\n disabled?: boolean;\n icon?: IconComponent;\n onClick?: React.MouseEventHandler;\n };\n\ntype PaginationArrowsProps = {\n outerMostArrows?: [PaginationPropArrow?, PaginationPropArrow?];\n} & (\n | {\n arrows: [PaginationPropArrow?, PaginationPropArrow?];\n hotKeys?: [PaginationPropHotKey?, PaginationPropHotKey?];\n }\n | {\n arrows?: never;\n hotKeys?: never;\n }\n);\n\nexport type PaginationItem = {\n key: string | number;\n label: string;\n clickable: boolean;\n};\n\nexport type PaginationProps<TYPE extends PaginationPropType> =\n PropsWithHTMLAttributes<\n {\n type?: TYPE;\n showFirstPage?: boolean;\n showLastPage?: boolean;\n visibleCount?: number;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n containerEventListener?: HTMLElement | Window;\n value?: number;\n items?: number;\n onChange?: PaginationPropOnChange<number>;\n getItemAs?: PaginationPropGetItemAs<PaginationItem>;\n getItemAttributes?: PaginationPropGetItemAttributes<PaginationItem>;\n getItemRef?: PaginationPropGetItemRef<PaginationItem>;\n },\n HTMLDivElement\n > &\n PaginationArrowsProps &\n (TYPE extends 'input'\n ? { getTotalLabel?: (pages: number) => string | number }\n : {\n getTotalLabel?: never;\n });\n\nexport type PaginationComponent = <TYPE extends PaginationPropType>(\n props: PaginationProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type PaginationBaseItemDefault = {\n key: string | number;\n label?: string;\n as?: AsTags;\n ref?: React.RefObject<HTMLElement>;\n clickable?: boolean;\n attributes?: AsAttributes;\n onClick?: React.MouseEventHandler;\n};\n\nexport type PaginationPropGetItemKey<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['key'];\nexport type PaginationPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['label'];\nexport type PaginationPropGetItemClickable<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['clickable'];\nexport type PaginationPropGetItemAs<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['as'];\nexport type PaginationPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['attributes'];\nexport type PaginationPropGetItemRef<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['ref'];\nexport type PaginationPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => PaginationBaseItemDefault['onClick'];\n\ntype Mappers<ITEM = PaginationBaseItemDefault> = {\n getItemLabel?: PaginationPropGetItemLabel<ITEM>;\n getItemKey: PaginationPropGetItemKey<ITEM>;\n getItemAs?: PaginationPropGetItemAs<ITEM>;\n getItemAttributes?: PaginationPropGetItemAttributes<ITEM>;\n getItemRef?: PaginationPropGetItemRef<ITEM>;\n getItemClickable?: PaginationPropGetItemClickable<ITEM>;\n getItemOnClick?: PaginationPropGetItemOnClick<ITEM>;\n};\n\nexport type PaginationArrowProps = PropsWithHTMLAttributes<\n {\n icon?: IconComponent;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n disabled?: boolean;\n orientation?: 'start' | 'end';\n label?: string;\n caption?: string;\n },\n HTMLButtonElement\n>;\n\nexport type PaginationItemProps<AS extends AsTags = 'button'> =\n PropsWithAsAttributes<\n {\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n label?: string;\n active?: boolean;\n clickable?: boolean;\n },\n AS\n >;\n\nexport type PaginationItemComponent = <AS extends AsTags = 'button'>(\n props: PaginationItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type PaginationNumberInputProps = PropsWithHTMLAttributes<\n {\n value?: number;\n onChange?: PaginationPropOnChange<number>;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n total: number;\n getTotalLabel?: (pages: number) => string | number;\n },\n HTMLDivElement\n>;\n\nexport type PaginationListProps<ITEM> = PropsWithHTMLAttributesAndRef<\n {\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n items: ITEM[];\n value?: ITEM;\n onItemClick?: PaginationPropOnItemClick<ITEM>;\n },\n HTMLDivElement\n> &\n Mappers<ITEM>;\n\nexport type PaginationListComponent = <ITEM extends PaginationBaseItemDefault>(\n props: PaginationListProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAUA,MAAO,IAAMA,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb,CAGP,MAAO,IAAME,mBAAkB,CAAG,CAAC,SAAD,CAAY,OAAZ,CAA3B,CAEP,MAAO,IAAMC,0BAA6C,CACxDD,kBAAkB,CAAC,CAAD,CADb"}
|
|
@@ -2,16 +2,16 @@ import './Pagination.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
export declare const paginationForms: readonly ["default", "round", "brick"];
|
|
5
|
-
export type PaginationPropForm = typeof paginationForms[number];
|
|
5
|
+
export type PaginationPropForm = (typeof paginationForms)[number];
|
|
6
6
|
export declare const paginationDefaultForm: PaginationPropForm;
|
|
7
7
|
export declare const paginationSizes: readonly ["xs", "s", "m", "l"];
|
|
8
|
-
export type PaginationPropSize = typeof paginationSizes[number];
|
|
8
|
+
export type PaginationPropSize = (typeof paginationSizes)[number];
|
|
9
9
|
export declare const paginationDefaultSize: PaginationPropSize;
|
|
10
10
|
export declare const paginationTypes: readonly ["default", "input"];
|
|
11
|
-
export type PaginationPropType = typeof paginationTypes[number];
|
|
11
|
+
export type PaginationPropType = (typeof paginationTypes)[number];
|
|
12
12
|
export declare const paginationDefaultType: PaginationPropType;
|
|
13
13
|
export declare const paginationPositions: readonly ["left", "center", "right"];
|
|
14
|
-
export type PaginationPropPosition = typeof paginationPositions[number];
|
|
14
|
+
export type PaginationPropPosition = (typeof paginationPositions)[number];
|
|
15
15
|
export declare const paginationDefaultPosition: PaginationPropPosition;
|
|
16
16
|
export declare const cnPagination: import("@bem-react/classname").ClassNameFormatter;
|
|
17
17
|
type HotKey = {
|