@consta/uikit 5.31.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/__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/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/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
- package/__internal__/src/components/ContextMenu/types.d.ts +3 -3
- package/__internal__/src/components/ContextMenu/types.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +1 -0
- 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/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 +6 -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/types.d.ts +1 -1
- package/__internal__/src/components/FileCanary/types.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelect.css +8 -8
- 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/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/SelectCanary/SelectDropdown/SelectDropdown.d.ts +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/SelectPopover/SelectPopover.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js.map +1 -1
- package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +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/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/UserSelectItem/UserSelectItem.css +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 +2 -2
|
@@ -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,GAmBhDH,CAnBgD,CAKlDI,UALkD,CAKlDA,CALkD,eAMlDC,CANkD,CAmBhDL,CAnBgD,CAMlDK,cANkD,CAOlDC,CAPkD,CAmBhDN,CAnBgD,CAOlDM,cAPkD,CAQlDC,CARkD,CAmBhDP,CAnBgD,CAQlDO,KARkD,CASlDC,CATkD,CAmBhDR,CAnBgD,CASlDQ,SATkD,GAmBhDR,CAnBgD,CAUlDS,KAVkD,CAUlDA,CAVkD,YAU1Cd,qBAV0C,KAmBhDK,CAnBgD,CAWlDU,QAXkD,CAWlDA,CAXkD,YAWvCb,wBAXuC,GAYlDc,CAZkD,CA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OA,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,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,CA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-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 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationDeprecated.js","names":["IconBackward","IconForward","React","cnDeprecated","Button","Text","TextField","getPaginationInfo","paginationForms","paginationDefaultForm","paginationSizes","paginationDefaultSize","paginationTypes","paginationDefaultType","paginationPositions","paginationDefaultPosition","getDefaultLabel","totalPages","cnPagination","Pagination","forwardRef","props","ref","currentPage","onChange","getLabel","form","size","type","position","minified","hotkeys","nextPage","label","values","prevPage","containerEventListener","window","className","otherProps","currPage","isStartDots","isEndDots","pages","isEmpty","useState","keys","setKeys","changePage","page","handleClick","e","preventDefault","keyUpListener","event","key","prevState","filter","hotKey","keyDownListener","includes","newKeys","every","useEffect","addEventListener","removeEventListener","itemWidth","show","isActive","width","map","toString","handleChange","value","pageNumber","Number","isNaN"],"sources":["../../../../../src/components/PaginationDeprecated/PaginationDeprecated.tsx"],"sourcesContent":["import './Pagination.css';\n\nimport { IconBackward } from '@consta/icons/IconBackward';\nimport { IconForward } from '@consta/icons/IconForward';\nimport React from 'react';\n\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Button } from '../Button/Button';\nimport { Text } from '../Text/Text';\nimport { TextField, TextFieldPropOnChange } from '../TextField/TextField';\nimport { getPaginationInfo } from './helpers';\n\nexport const paginationForms = ['default', 'round', 'brick'] as const;\nexport type PaginationPropForm = typeof paginationForms[number];\nexport const paginationDefaultForm: PaginationPropForm = 'default';\n\nexport const paginationSizes = ['xs', 's', 'm', 'l'] as const;\nexport type PaginationPropSize = typeof paginationSizes[number];\nexport const paginationDefaultSize: PaginationPropSize = 'm';\n\nexport const paginationTypes = ['default', 'input'] as const;\nexport type PaginationPropType = typeof paginationTypes[number];\nexport const paginationDefaultType: PaginationPropType = 'default';\n\nexport const paginationPositions = ['left', 'center', 'right'] as const;\nexport type PaginationPropPosition = typeof paginationPositions[number];\nexport const paginationDefaultPosition: PaginationPropPosition = 'center';\n\nconst getDefaultLabel = (totalPages: number): string => `из ${totalPages}`;\n\nexport const cnPagination = cnDeprecated('Pagination');\n\ntype HotKey = {\n label: string;\n values: string[];\n};\n\nexport type HotKeys = {\n nextPage: HotKey;\n prevPage: HotKey;\n};\n\ntype Props = {\n currentPage: number;\n totalPages: number;\n onChange: (pageNumber: number) => void;\n getLabel?: (totalPages: number) => string;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n type?: PaginationPropType;\n hotkeys?: HotKeys;\n containerEventListener?: HTMLElement | Window;\n className?: string;\n} & (\n | {\n minified?: true;\n position?: never;\n }\n | {\n minified?: false;\n position?: PaginationPropPosition;\n }\n);\n\ntype Pagination = (\n props: PropsWithHTMLAttributesAndRef<Props, HTMLDivElement>,\n) => React.ReactNode | null;\n\nexport const Pagination: Pagination = React.forwardRef((props, ref) => {\n const {\n currentPage = 0,\n totalPages = 0,\n onChange,\n getLabel = getDefaultLabel,\n form = paginationDefaultForm,\n size = paginationDefaultSize,\n type = paginationDefaultType,\n position = paginationDefaultPosition,\n minified = false,\n hotkeys = {\n nextPage: {\n label: 'Alt →',\n values: ['Alt', 'ArrowRight'],\n },\n prevPage: {\n label: '← Alt',\n values: ['Alt', 'ArrowLeft'],\n },\n },\n containerEventListener = window,\n className,\n ...otherProps\n } = props;\n\n const currPage = currentPage + 1;\n const { prevPage, nextPage, isStartDots, isEndDots, pages, isEmpty } =\n getPaginationInfo(currPage, totalPages);\n const [keys, setKeys] = React.useState<string[]>([]);\n\n const changePage = (page: number | null) => {\n if (page && page !== currPage && onChange) {\n onChange(page - 1);\n }\n };\n\n const handleClick = (page: number | null) => (e: React.MouseEvent) => {\n e.preventDefault();\n changePage(page);\n };\n\n const handleChange: TextFieldPropOnChange = (value) => {\n const pageNumber = Number(value);\n\n if (pageNumber > totalPages || Number.isNaN(pageNumber)) return;\n\n if (onChange) {\n onChange(pageNumber - 1);\n }\n };\n\n const keyUpListener: EventListener = (event) => {\n const { key } = event as KeyboardEvent;\n\n setKeys((prevState) => prevState.filter((hotKey) => hotKey !== key));\n };\n\n const keyDownListener: EventListener = (event) => {\n const { key } = event as KeyboardEvent;\n\n if (\n hotkeys.nextPage.values.includes(key) ||\n hotkeys.prevPage.values.includes(key)\n ) {\n const newKeys = [...keys, key];\n if (hotkeys.nextPage.values.every((hotKey) => newKeys.includes(hotKey))) {\n changePage(nextPage);\n } else if (\n hotkeys.prevPage.values.every((hotKey) => newKeys.includes(hotKey))\n ) {\n changePage(prevPage);\n }\n setKeys(newKeys);\n }\n };\n\n React.useEffect(() => {\n containerEventListener.addEventListener('keydown', keyDownListener);\n containerEventListener.addEventListener('keyup', keyUpListener);\n return () => {\n containerEventListener.removeEventListener('keydown', keyDownListener);\n containerEventListener.removeEventListener('keyup', keyUpListener);\n };\n });\n\n const itemWidth = `var(--control-height-${size})`;\n\n if (!totalPages) return null;\n\n return (\n (!isEmpty && (\n <nav\n className={cnPagination(\n {\n form,\n size,\n position: minified ? paginationDefaultPosition : position,\n },\n [className],\n )}\n ref={ref}\n {...otherProps}\n >\n {(currPage > 1 || minified) && (\n <div className={cnPagination('PrevPage')}>\n <Button\n type=\"button\"\n className={cnPagination('ItemLeft', {\n minified,\n show: currPage > 1,\n })}\n label=\"Назад\"\n iconLeft={IconBackward}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(prevPage)}\n />\n {!minified && (\n <Text\n className={cnPagination('TipLeft')}\n size=\"xs\"\n view=\"ghost\"\n lineHeight=\"m\"\n >\n {hotkeys.prevPage.label}\n </Text>\n )}\n </div>\n )}\n {type === paginationDefaultType ? (\n <div className={cnPagination('Pages')}>\n {isStartDots && (\n <Button\n type=\"button\"\n className={cnPagination('Item', { isActive: currPage === 1 })}\n style={{ width: itemWidth }}\n label=\"1\"\n title=\"1\"\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(1)}\n />\n )}\n {isStartDots && (\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('More')}\n style={{ width: itemWidth }}\n lineHeight=\"m\"\n >\n ...\n </Text>\n )}\n {pages.map((page) => (\n <Button\n type=\"button\"\n key={page}\n className={cnPagination('Item', {\n isActive: currPage === page,\n })}\n style={{ width: itemWidth }}\n label={page}\n title={`${page}`}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(page)}\n />\n ))}\n {isEndDots && (\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('More')}\n style={{ width: itemWidth }}\n lineHeight=\"m\"\n >\n ...\n </Text>\n )}\n {isEndDots && (\n <Button\n type=\"button\"\n className={cnPagination('Item', {\n isActive: currPage === totalPages,\n })}\n style={{ width: itemWidth }}\n label={totalPages}\n title={`${totalPages}`}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(totalPages)}\n />\n )}\n </div>\n ) : (\n <div className={cnPagination('Pages')}>\n <TextField\n className={cnPagination('Input')}\n form={form}\n size={size}\n value={currPage.toString()}\n onChange={handleChange}\n />\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('Total')}\n lineHeight=\"m\"\n >\n {getLabel(totalPages)}\n </Text>\n </div>\n )}\n {(currPage < totalPages || minified) && (\n <div className={cnPagination('NextPage')}>\n <Button\n type=\"button\"\n className={cnPagination('ItemRight', {\n minified,\n show: currPage < totalPages,\n })}\n label=\"Вперёд\"\n iconRight={IconForward}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(nextPage)}\n />\n {!minified && (\n <Text\n className={cnPagination('TipRight')}\n size=\"xs\"\n view=\"ghost\"\n lineHeight=\"m\"\n >\n {hotkeys.nextPage.label}\n </Text>\n )}\n </div>\n )}\n </nav>\n )) ||\n null\n );\n});\n"],"mappings":"0XAAA,yBAEA,OAASA,YAAT,KAA6B,4BAA7B,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,CAAEhB,WAPb,CAQE,IAAI,CAAC,OARP,CASE,IAAI,CAAEyB,CATR,CAUE,IAAI,CAAEC,CAVR,CAWE,OAAO,CAAEuB,CAAW,CAAClB,CAAD,CAXtB,EADF,CAcG,CAACF,CAAD,EACC,oBAAC,IAAD,EACE,SAAS,CAAEZ,YAAY,CAAC,UAAD,CADzB,CAEE,IAAI,CAAC,IAFP,CAGE,IAAI,CAAC,OAHP,CAIE,UAAU,CAAC,GAJb,EAMGa,CAAO,CAACC,QAAR,CAAiBC,KANpB,CAfJ,CAhIJ,CADF,EA6JA,IAxPmE,CAwF7C,IAkKzB,CA1PqC,CAA/B"}
|
|
1
|
+
{"version":3,"file":"PaginationDeprecated.js","names":["IconBackward","IconForward","React","cnDeprecated","Button","Text","TextField","getPaginationInfo","paginationForms","paginationDefaultForm","paginationSizes","paginationDefaultSize","paginationTypes","paginationDefaultType","paginationPositions","paginationDefaultPosition","getDefaultLabel","totalPages","cnPagination","Pagination","forwardRef","props","ref","currentPage","onChange","getLabel","form","size","type","position","minified","hotkeys","nextPage","label","values","prevPage","containerEventListener","window","className","otherProps","currPage","isStartDots","isEndDots","pages","isEmpty","useState","keys","setKeys","changePage","page","handleClick","e","preventDefault","keyUpListener","event","key","prevState","filter","hotKey","keyDownListener","includes","newKeys","every","useEffect","addEventListener","removeEventListener","itemWidth","show","isActive","width","map","toString","handleChange","value","pageNumber","Number","isNaN"],"sources":["../../../../../src/components/PaginationDeprecated/PaginationDeprecated.tsx"],"sourcesContent":["import './Pagination.css';\n\nimport { IconBackward } from '@consta/icons/IconBackward';\nimport { IconForward } from '@consta/icons/IconForward';\nimport React from 'react';\n\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Button } from '../Button/Button';\nimport { Text } from '../Text/Text';\nimport { TextField, TextFieldPropOnChange } from '../TextField/TextField';\nimport { getPaginationInfo } from './helpers';\n\nexport const paginationForms = ['default', 'round', 'brick'] as const;\nexport type PaginationPropForm = (typeof paginationForms)[number];\nexport const paginationDefaultForm: PaginationPropForm = 'default';\n\nexport const paginationSizes = ['xs', 's', 'm', 'l'] as const;\nexport type PaginationPropSize = (typeof paginationSizes)[number];\nexport const paginationDefaultSize: PaginationPropSize = 'm';\n\nexport const paginationTypes = ['default', 'input'] as const;\nexport type PaginationPropType = (typeof paginationTypes)[number];\nexport const paginationDefaultType: PaginationPropType = 'default';\n\nexport const paginationPositions = ['left', 'center', 'right'] as const;\nexport type PaginationPropPosition = (typeof paginationPositions)[number];\nexport const paginationDefaultPosition: PaginationPropPosition = 'center';\n\nconst getDefaultLabel = (totalPages: number): string => `из ${totalPages}`;\n\nexport const cnPagination = cnDeprecated('Pagination');\n\ntype HotKey = {\n label: string;\n values: string[];\n};\n\nexport type HotKeys = {\n nextPage: HotKey;\n prevPage: HotKey;\n};\n\ntype Props = {\n currentPage: number;\n totalPages: number;\n onChange: (pageNumber: number) => void;\n getLabel?: (totalPages: number) => string;\n form?: PaginationPropForm;\n size?: PaginationPropSize;\n type?: PaginationPropType;\n hotkeys?: HotKeys;\n containerEventListener?: HTMLElement | Window;\n className?: string;\n} & (\n | {\n minified?: true;\n position?: never;\n }\n | {\n minified?: false;\n position?: PaginationPropPosition;\n }\n);\n\ntype Pagination = (\n props: PropsWithHTMLAttributesAndRef<Props, HTMLDivElement>,\n) => React.ReactNode | null;\n\nexport const Pagination: Pagination = React.forwardRef((props, ref) => {\n const {\n currentPage = 0,\n totalPages = 0,\n onChange,\n getLabel = getDefaultLabel,\n form = paginationDefaultForm,\n size = paginationDefaultSize,\n type = paginationDefaultType,\n position = paginationDefaultPosition,\n minified = false,\n hotkeys = {\n nextPage: {\n label: 'Alt →',\n values: ['Alt', 'ArrowRight'],\n },\n prevPage: {\n label: '← Alt',\n values: ['Alt', 'ArrowLeft'],\n },\n },\n containerEventListener = window,\n className,\n ...otherProps\n } = props;\n\n const currPage = currentPage + 1;\n const { prevPage, nextPage, isStartDots, isEndDots, pages, isEmpty } =\n getPaginationInfo(currPage, totalPages);\n const [keys, setKeys] = React.useState<string[]>([]);\n\n const changePage = (page: number | null) => {\n if (page && page !== currPage && onChange) {\n onChange(page - 1);\n }\n };\n\n const handleClick = (page: number | null) => (e: React.MouseEvent) => {\n e.preventDefault();\n changePage(page);\n };\n\n const handleChange: TextFieldPropOnChange = (value) => {\n const pageNumber = Number(value);\n\n if (pageNumber > totalPages || Number.isNaN(pageNumber)) return;\n\n if (onChange) {\n onChange(pageNumber - 1);\n }\n };\n\n const keyUpListener: EventListener = (event) => {\n const { key } = event as KeyboardEvent;\n\n setKeys((prevState) => prevState.filter((hotKey) => hotKey !== key));\n };\n\n const keyDownListener: EventListener = (event) => {\n const { key } = event as KeyboardEvent;\n\n if (\n hotkeys.nextPage.values.includes(key) ||\n hotkeys.prevPage.values.includes(key)\n ) {\n const newKeys = [...keys, key];\n if (hotkeys.nextPage.values.every((hotKey) => newKeys.includes(hotKey))) {\n changePage(nextPage);\n } else if (\n hotkeys.prevPage.values.every((hotKey) => newKeys.includes(hotKey))\n ) {\n changePage(prevPage);\n }\n setKeys(newKeys);\n }\n };\n\n React.useEffect(() => {\n containerEventListener.addEventListener('keydown', keyDownListener);\n containerEventListener.addEventListener('keyup', keyUpListener);\n return () => {\n containerEventListener.removeEventListener('keydown', keyDownListener);\n containerEventListener.removeEventListener('keyup', keyUpListener);\n };\n });\n\n const itemWidth = `var(--control-height-${size})`;\n\n if (!totalPages) return null;\n\n return (\n (!isEmpty && (\n <nav\n className={cnPagination(\n {\n form,\n size,\n position: minified ? paginationDefaultPosition : position,\n },\n [className],\n )}\n ref={ref}\n {...otherProps}\n >\n {(currPage > 1 || minified) && (\n <div className={cnPagination('PrevPage')}>\n <Button\n type=\"button\"\n className={cnPagination('ItemLeft', {\n minified,\n show: currPage > 1,\n })}\n label=\"Назад\"\n iconLeft={IconBackward}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(prevPage)}\n />\n {!minified && (\n <Text\n className={cnPagination('TipLeft')}\n size=\"xs\"\n view=\"ghost\"\n lineHeight=\"m\"\n >\n {hotkeys.prevPage.label}\n </Text>\n )}\n </div>\n )}\n {type === paginationDefaultType ? (\n <div className={cnPagination('Pages')}>\n {isStartDots && (\n <Button\n type=\"button\"\n className={cnPagination('Item', { isActive: currPage === 1 })}\n style={{ width: itemWidth }}\n label=\"1\"\n title=\"1\"\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(1)}\n />\n )}\n {isStartDots && (\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('More')}\n style={{ width: itemWidth }}\n lineHeight=\"m\"\n >\n ...\n </Text>\n )}\n {pages.map((page) => (\n <Button\n type=\"button\"\n key={page}\n className={cnPagination('Item', {\n isActive: currPage === page,\n })}\n style={{ width: itemWidth }}\n label={page}\n title={`${page}`}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(page)}\n />\n ))}\n {isEndDots && (\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('More')}\n style={{ width: itemWidth }}\n lineHeight=\"m\"\n >\n ...\n </Text>\n )}\n {isEndDots && (\n <Button\n type=\"button\"\n className={cnPagination('Item', {\n isActive: currPage === totalPages,\n })}\n style={{ width: itemWidth }}\n label={totalPages}\n title={`${totalPages}`}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(totalPages)}\n />\n )}\n </div>\n ) : (\n <div className={cnPagination('Pages')}>\n <TextField\n className={cnPagination('Input')}\n form={form}\n size={size}\n value={currPage.toString()}\n onChange={handleChange}\n />\n <Text\n size={size}\n view=\"linkMinor\"\n className={cnPagination('Total')}\n lineHeight=\"m\"\n >\n {getLabel(totalPages)}\n </Text>\n </div>\n )}\n {(currPage < totalPages || minified) && (\n <div className={cnPagination('NextPage')}>\n <Button\n type=\"button\"\n className={cnPagination('ItemRight', {\n minified,\n show: currPage < totalPages,\n })}\n label=\"Вперёд\"\n iconRight={IconForward}\n view=\"ghost\"\n form={form}\n size={size}\n onClick={handleClick(nextPage)}\n />\n {!minified && (\n <Text\n className={cnPagination('TipRight')}\n size=\"xs\"\n view=\"ghost\"\n lineHeight=\"m\"\n >\n {hotkeys.nextPage.label}\n </Text>\n )}\n </div>\n )}\n </nav>\n )) ||\n null\n );\n});\n"],"mappings":"0XAAA,yBAEA,OAASA,YAAT,KAA6B,4BAA7B,CACA,OAASC,WAAT,KAA4B,2BAA5B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,YAAT,uBAEA,OAASC,MAAT,wBACA,OAASC,IAAT,oBACA,OAASC,SAAT,8BACA,OAASC,iBAAT,iBAEA,MAAO,IAAMC,gBAAe,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAG,SAAlD,CAEP,MAAO,IAAMC,gBAAe,CAAG,CAAC,IAAD,CAAO,GAAP,CAAY,GAAZ,CAAiB,GAAjB,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAG,GAAlD,CAEP,MAAO,IAAMC,gBAAe,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAxB,CAEP,MAAO,IAAMC,sBAAyC,CAAG,SAAlD,CAEP,MAAO,IAAMC,oBAAmB,CAAG,CAAC,MAAD,CAAS,QAAT,CAAmB,OAAnB,CAA5B,CAEP,MAAO,IAAMC,0BAAiD,CAAG,QAA1D,CAEP,GAAMC,gBAAe,CAAG,SAACC,CAAD,+BAAsCA,CAAtC,EAAxB,CAEA,MAAO,IAAMC,aAAY,CAAGf,YAAY,CAAC,YAAD,CAAjC,CAsCP,MAAO,IAAMgB,WAAsB,CAAGjB,KAAK,CAACkB,UAAN,CAAiB,SAACC,CAAD,CAAQC,CAAR,CAAgB,OAwBjED,CAxBiE,CAEnEE,WAFmE,CAEnEA,CAFmE,YAErD,CAFqD,KAwBjEF,CAxBiE,CAGnEJ,UAHmE,CAGnEA,CAHmE,YAGtD,CAHsD,GAInEO,CAJmE,CAwBjEH,C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AAY,CAAC,UAAD,CAA5B,EACE,oBAAC,MAAD,EACE,IAAI,CAAC,QADP,CAEE,SAAS,CAAEA,YAAY,CAAC,WAAD,CAAc,CACnCY,QAAQ,CAARA,CADmC,CAEnCqC,IAAI,CAAE3B,CAAQ,CAAGvB,CAFkB,CAAd,CAFzB,CAME,KAAK,CAAC,sCANR,CAOE,SAAS,CAAEhB,WAPb,CAQE,IAAI,CAAC,OARP,CASE,IAAI,CAAEyB,CATR,CAUE,IAAI,CAAEC,CAVR,CAWE,OAAO,CAAEuB,CAAW,CAAClB,CAAD,CAXtB,EADF,CAcG,CAACF,CAAD,EACC,oBAAC,IAAD,EACE,SAAS,CAAEZ,YAAY,CAAC,UAAD,CADzB,CAEE,IAAI,CAAC,IAFP,CAGE,IAAI,CAAC,OAHP,CAIE,UAAU,CAAC,GAJb,EAMGa,CAAO,CAACC,QAAR,CAAiBC,KANpB,CAfJ,CAhIJ,CADF,EA6JA,IAxPmE,CAwF7C,IAkKzB,CA1PqC,CAA/B"}
|
|
@@ -9,9 +9,9 @@ import { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes
|
|
|
9
9
|
export declare const directionsStartCenter: readonly ["downCenter", "upCenter", "downRight", "downLeft", "upRight", "upLeft", "leftUp", "leftCenter", "leftDown", "rightUp", "rightCenter", "rightDown"];
|
|
10
10
|
export declare const directionsStartEdge: readonly ["downStartLeft", "upStartLeft", "downStartRight", "upStartRight", "leftStartUp", "leftStartDown", "rightStartUp", "rightStartDown"];
|
|
11
11
|
export declare const popoverPropOffset: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"];
|
|
12
|
-
export type PopoverPropOffset = typeof popoverPropOffset[number] | number;
|
|
12
|
+
export type PopoverPropOffset = (typeof popoverPropOffset)[number] | number;
|
|
13
13
|
export declare const directions: ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[];
|
|
14
|
-
export type Direction = typeof directions[number];
|
|
14
|
+
export type Direction = (typeof directions)[number];
|
|
15
15
|
export type Position = {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["React","forwardRef","useEffect","useLayoutEffect","useMemo","PortalWithTheme","PortalWithThemeConsumer","useTheme","useComponentSize","useForkRef","cn","isRenderProp","isNumber","isString","getComputedPositionAndDirection","getPointPosition","getRenderPosition","usePopoverReposition","directionsStartCenter","directionsStartEdge","popoverPropOffset","directions","getOffset","ref","propOffset","current","cssVar","getComputedStyle","getPropertyValue","test","slice","length","fontSize","parseFloat","document","documentElement","rem","em","cnPopover","Popover","props","componentRef","children","direction","passedDirection","offset","arrowOffset","possibleDirections","isInteractive","onClickOutside","spareDirection","style","className","passedPosition","position","anchorRef","equalAnchorWidth","onSetDirection","viewportRef","container","window","body","otherProps","viewportElement","useRef","theme","useState","anchorClientRect","setAnchorClientRect","width","height","anchorSize","previousDirectionRef","bannedDirections","setBannedDirections","resetBannedDirections","state","updateAnchorClientRect","getBoundingClientRect","contentSize","viewportSize","clientWidth","clientHeight","x","left","y","top","isActive","scrollAnchorRef","onRequestReposition","includes","renderPosition","notVisible"],"sources":["../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import './Popover.css';\n\nimport React, { forwardRef, useEffect, useLayoutEffect, useMemo } from 'react';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { ClickOutsideHandler } from '##/hooks/useClickOutside';\nimport { useComponentSize } from '##/hooks/useComponentSize';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cn } from '##/utils/bem';\nimport { isRenderProp } from '##/utils/isRenderProp';\nimport { isNumber, isString } from '##/utils/type-guards';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport {\n getComputedPositionAndDirection,\n getPointPosition,\n getRenderPosition,\n} from './helpers';\nimport { usePopoverReposition } from './usePopoverReposition';\n\n/**\n * Стороны упорядочены по приоритету:\n * Используется первая сторона, в которую смог вписаться поповер.\n */\nexport const directionsStartCenter = [\n 'downCenter',\n 'upCenter',\n\n 'downRight',\n 'downLeft',\n 'upRight',\n 'upLeft',\n\n 'leftUp',\n 'leftCenter',\n 'leftDown',\n\n 'rightUp',\n 'rightCenter',\n 'rightDown',\n] as const;\n\nexport const directionsStartEdge = [\n 'downStartLeft',\n 'upStartLeft',\n\n 'downStartRight',\n 'upStartRight',\n\n 'leftStartUp',\n 'leftStartDown',\n\n 'rightStartUp',\n 'rightStartDown',\n] as const;\n\nexport const popoverPropOffset = [\n '3xs',\n '2xs',\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n '6xl',\n] as const;\nexport type PopoverPropOffset = typeof popoverPropOffset[number] | number;\n\nexport const directions = [...directionsStartCenter, ...directionsStartEdge];\n\nexport type Direction = typeof directions[number];\n\nexport type Position = { x: number; y: number } | undefined;\n\nexport type PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n equalAnchorWidth?: boolean;\n position?: never;\n }\n | {\n anchorRef?: never;\n equalAnchorWidth?: never;\n position: Position;\n };\n\ntype ChildrenRenderProp = (direction: Direction) => React.ReactNode;\n\nexport type PopoverProps = PropsWithJsxAttributes<\n {\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n offset?: PopoverPropOffset;\n arrowOffset?: number;\n isInteractive?: boolean;\n children?: React.ReactNode | ChildrenRenderProp;\n onClickOutside?: ClickOutsideHandler;\n onSetDirection?: (direction: Direction) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n } & PositioningProps\n>;\n\nexport type Props = PopoverProps; // удалить при мажоре\n\nconst getOffset = (\n ref: React.RefObject<HTMLDivElement>,\n propOffset: PopoverPropOffset,\n) => {\n if (isNumber(propOffset)) {\n return propOffset;\n }\n\n if (isString(propOffset) && ref.current) {\n const cssVar = getComputedStyle(ref.current).getPropertyValue(\n `--space-${propOffset}`,\n );\n\n if (cssVar && /px$/.test(cssVar)) {\n return Number(cssVar.slice(0, cssVar.length - 2));\n }\n\n if (cssVar && /rem$/.test(cssVar)) {\n const fontSize = parseFloat(\n getComputedStyle(document.documentElement).fontSize,\n );\n const rem = Number(cssVar.slice(0, cssVar.length - 3));\n\n return fontSize * rem;\n }\n\n if (cssVar && /em$/.test(cssVar)) {\n const fontSize = parseFloat(getComputedStyle(ref.current).fontSize);\n const em = Number(cssVar.slice(0, cssVar.length - 2));\n\n return fontSize * em;\n }\n\n return 0;\n }\n\n return 0;\n};\n\nconst cnPopover = cn('Popover');\n\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, componentRef) => {\n const {\n children,\n direction: passedDirection = 'upCenter',\n offset: propOffset = 0,\n arrowOffset,\n possibleDirections = directions,\n isInteractive = true,\n onClickOutside,\n spareDirection = 'downStartLeft',\n style,\n className,\n position: passedPosition,\n anchorRef,\n equalAnchorWidth,\n onSetDirection,\n viewportRef,\n container = window.document.body,\n ...otherProps\n } = props;\n\n const viewportElement = viewportRef?.current || document.documentElement;\n\n const ref = React.useRef<HTMLDivElement>(null);\n const { theme } = useTheme();\n\n const [anchorClientRect, setAnchorClientRect] = React.useState<\n DOMRect | undefined\n >();\n const { width, height } = useComponentSize(ref);\n const anchorSize = useComponentSize(anchorRef || { current: null });\n const previousDirectionRef = React.useRef<Direction | null>(null);\n const [bannedDirections, setBannedDirections] = React.useState<\n readonly Direction[]\n >([]);\n\n const resetBannedDirections = () => {\n setBannedDirections((state) => (state.length ? [] : state));\n previousDirectionRef.current = null;\n };\n\n const updateAnchorClientRect = () =>\n setAnchorClientRect(anchorRef?.current?.getBoundingClientRect());\n\n const offset = useMemo(\n () => getOffset(ref, propOffset),\n [propOffset, Boolean(ref.current)],\n );\n\n const { position, direction } = getComputedPositionAndDirection({\n contentSize: { width, height },\n viewportSize: {\n // Размер вьюпорта без скроллбаров\n width: viewportElement.clientWidth,\n height: viewportElement.clientHeight,\n },\n arrowOffset,\n offset,\n direction: passedDirection,\n possibleDirections,\n bannedDirections,\n position: getPointPosition(\n viewportElement,\n anchorClientRect\n ? { x: anchorClientRect.left, y: anchorClientRect.top }\n : passedPosition,\n !!viewportRef?.current,\n ),\n anchorSize,\n spareDirection,\n });\n\n useEffect(() => onSetDirection?.(direction), [direction]);\n\n useEffect(updateAnchorClientRect, [anchorSize]);\n\n usePopoverReposition({\n isActive: true,\n scrollAnchorRef: anchorRef || { current: null },\n onRequestReposition: () => {\n resetBannedDirections();\n updateAnchorClientRect();\n },\n });\n\n /**\n * Может возникнуть ситуация, когда перерасчет поповера всегда будет выдавать 2 направления\n * и бесконечно зацикливать себя. Для избежания таких кейсов мы запоминаем стороны,\n * которые не подошли, чтобы не возвращаться к ним и предотвратить бесконечный ререндер.\n * См. PopoverBannedPositionsStory\n */\n\n useLayoutEffect(() => {\n if (previousDirectionRef.current !== direction) {\n if (\n previousDirectionRef.current &&\n !bannedDirections.includes(previousDirectionRef.current) &&\n !bannedDirections.includes(direction) &&\n direction !== spareDirection\n ) {\n setBannedDirections((state) =>\n previousDirectionRef.current\n ? [...state, previousDirectionRef.current]\n : state,\n );\n }\n previousDirectionRef.current = direction;\n }\n }, [direction]);\n\n // Сбрасываем при любом изменении пропсов, чтобы заново начать перебор направлений\n // Главное не сбрасывать при изменении размеров поповера, т.к. именно оно может вызвать бесконечный перебор\n\n useLayoutEffect(resetBannedDirections, [props]);\n\n const renderPosition = getRenderPosition(\n viewportElement,\n position,\n !!viewportRef?.current,\n width,\n height,\n );\n\n const notVisible = !renderPosition || !height || !width;\n\n return (\n <PortalWithTheme\n {...otherProps}\n preset={theme}\n className={cnPopover({ direction, notVisible }, [className])}\n container={container}\n ref={useForkRef([ref, componentRef])}\n style={{\n ...style,\n ...(notVisible\n ? {}\n : {\n ['--popover-left' as string]: `${renderPosition.x}px`,\n ['--popover-top' as string]: `${renderPosition.y}px`,\n [`--popover-width` as string]: equalAnchorWidth\n ? `${anchorSize.width}px`\n : undefined,\n [`--popover-pointer-events` as string]: isInteractive\n ? undefined\n : 'none',\n [`--popover-visibility` as string]: position\n ? undefined\n : 'hidden',\n }),\n }}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside}\n ignoreClicksInsideRefs={[ref, anchorRef || { current: null }]}\n >\n {isRenderProp(children) ? children(direction) : children}\n </PortalWithThemeConsumer>\n </PortalWithTheme>\n );\n },\n);\n"],"mappings":"knCAAA,sBAEA,MAAOA,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,CAAuCC,eAAvC,CAAwDC,OAAxD,KAAuE,OAAvE,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBAEA,OAASC,gBAAT,oCACA,OAASC,UAAT,8BACA,OAASC,EAAT,uBACA,OAASC,YAAT,gCACA,OAASC,QAAT,CAAmBC,QAAnB,+BAGA,OACEC,+BADF,CAEEC,gBAFF,CAGEC,iBAHF,iBAKA,OAASC,oBAAT,8BAMA,MAAO,IAAMC,sBAAqB,CAAG,CACnC,YADmC,CAEnC,UAFmC,CAInC,WAJmC,CAKnC,UALmC,CAMnC,SANmC,CAOnC,QAPmC,CASnC,QATmC,CAUnC,YAVmC,CAWnC,UAXmC,CAanC,SAbmC,CAcnC,aAdmC,CAenC,WAfmC,CAA9B,CAkBP,MAAO,IAAMC,oBAAmB,CAAG,CACjC,eADiC,CAEjC,aAFiC,CAIjC,gBAJiC,CAKjC,cALiC,CAOjC,aAPiC,CAQjC,eARiC,CAUjC,cAViC,CAWjC,gBAXiC,CAA5B,CAcP,MAAO,IAAMC,kBAAiB,CAAG,CAC/B,KAD+B,CAE/B,KAF+B,CAG/B,IAH+B,CAI/B,GAJ+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
|
1
|
+
{"version":3,"file":"Popover.js","names":["React","forwardRef","useEffect","useLayoutEffect","useMemo","PortalWithTheme","PortalWithThemeConsumer","useTheme","useComponentSize","useForkRef","cn","isRenderProp","isNumber","isString","getComputedPositionAndDirection","getPointPosition","getRenderPosition","usePopoverReposition","directionsStartCenter","directionsStartEdge","popoverPropOffset","directions","getOffset","ref","propOffset","current","cssVar","getComputedStyle","getPropertyValue","test","slice","length","fontSize","parseFloat","document","documentElement","rem","em","cnPopover","Popover","props","componentRef","children","direction","passedDirection","offset","arrowOffset","possibleDirections","isInteractive","onClickOutside","spareDirection","style","className","passedPosition","position","anchorRef","equalAnchorWidth","onSetDirection","viewportRef","container","window","body","otherProps","viewportElement","useRef","theme","useState","anchorClientRect","setAnchorClientRect","width","height","anchorSize","previousDirectionRef","bannedDirections","setBannedDirections","resetBannedDirections","state","updateAnchorClientRect","getBoundingClientRect","contentSize","viewportSize","clientWidth","clientHeight","x","left","y","top","isActive","scrollAnchorRef","onRequestReposition","includes","renderPosition","notVisible"],"sources":["../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import './Popover.css';\n\nimport React, { forwardRef, useEffect, useLayoutEffect, useMemo } from 'react';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { ClickOutsideHandler } from '##/hooks/useClickOutside';\nimport { useComponentSize } from '##/hooks/useComponentSize';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cn } from '##/utils/bem';\nimport { isRenderProp } from '##/utils/isRenderProp';\nimport { isNumber, isString } from '##/utils/type-guards';\nimport { PropsWithJsxAttributes } from '##/utils/types/PropsWithJsxAttributes';\n\nimport {\n getComputedPositionAndDirection,\n getPointPosition,\n getRenderPosition,\n} from './helpers';\nimport { usePopoverReposition } from './usePopoverReposition';\n\n/**\n * Стороны упорядочены по приоритету:\n * Используется первая сторона, в которую смог вписаться поповер.\n */\nexport const directionsStartCenter = [\n 'downCenter',\n 'upCenter',\n\n 'downRight',\n 'downLeft',\n 'upRight',\n 'upLeft',\n\n 'leftUp',\n 'leftCenter',\n 'leftDown',\n\n 'rightUp',\n 'rightCenter',\n 'rightDown',\n] as const;\n\nexport const directionsStartEdge = [\n 'downStartLeft',\n 'upStartLeft',\n\n 'downStartRight',\n 'upStartRight',\n\n 'leftStartUp',\n 'leftStartDown',\n\n 'rightStartUp',\n 'rightStartDown',\n] as const;\n\nexport const popoverPropOffset = [\n '3xs',\n '2xs',\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n '6xl',\n] as const;\nexport type PopoverPropOffset = (typeof popoverPropOffset)[number] | number;\n\nexport const directions = [...directionsStartCenter, ...directionsStartEdge];\n\nexport type Direction = (typeof directions)[number];\n\nexport type Position = { x: number; y: number } | undefined;\n\nexport type PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n equalAnchorWidth?: boolean;\n position?: never;\n }\n | {\n anchorRef?: never;\n equalAnchorWidth?: never;\n position: Position;\n };\n\ntype ChildrenRenderProp = (direction: Direction) => React.ReactNode;\n\nexport type PopoverProps = PropsWithJsxAttributes<\n {\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n offset?: PopoverPropOffset;\n arrowOffset?: number;\n isInteractive?: boolean;\n children?: React.ReactNode | ChildrenRenderProp;\n onClickOutside?: ClickOutsideHandler;\n onSetDirection?: (direction: Direction) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n } & PositioningProps\n>;\n\nexport type Props = PopoverProps; // удалить при мажоре\n\nconst getOffset = (\n ref: React.RefObject<HTMLDivElement>,\n propOffset: PopoverPropOffset,\n) => {\n if (isNumber(propOffset)) {\n return propOffset;\n }\n\n if (isString(propOffset) && ref.current) {\n const cssVar = getComputedStyle(ref.current).getPropertyValue(\n `--space-${propOffset}`,\n );\n\n if (cssVar && /px$/.test(cssVar)) {\n return Number(cssVar.slice(0, cssVar.length - 2));\n }\n\n if (cssVar && /rem$/.test(cssVar)) {\n const fontSize = parseFloat(\n getComputedStyle(document.documentElement).fontSize,\n );\n const rem = Number(cssVar.slice(0, cssVar.length - 3));\n\n return fontSize * rem;\n }\n\n if (cssVar && /em$/.test(cssVar)) {\n const fontSize = parseFloat(getComputedStyle(ref.current).fontSize);\n const em = Number(cssVar.slice(0, cssVar.length - 2));\n\n return fontSize * em;\n }\n\n return 0;\n }\n\n return 0;\n};\n\nconst cnPopover = cn('Popover');\n\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, componentRef) => {\n const {\n children,\n direction: passedDirection = 'upCenter',\n offset: propOffset = 0,\n arrowOffset,\n possibleDirections = directions,\n isInteractive = true,\n onClickOutside,\n spareDirection = 'downStartLeft',\n style,\n className,\n position: passedPosition,\n anchorRef,\n equalAnchorWidth,\n onSetDirection,\n viewportRef,\n container = window.document.body,\n ...otherProps\n } = props;\n\n const viewportElement = viewportRef?.current || document.documentElement;\n\n const ref = React.useRef<HTMLDivElement>(null);\n const { theme } = useTheme();\n\n const [anchorClientRect, setAnchorClientRect] = React.useState<\n DOMRect | undefined\n >();\n const { width, height } = useComponentSize(ref);\n const anchorSize = useComponentSize(anchorRef || { current: null });\n const previousDirectionRef = React.useRef<Direction | null>(null);\n const [bannedDirections, setBannedDirections] = React.useState<\n readonly Direction[]\n >([]);\n\n const resetBannedDirections = () => {\n setBannedDirections((state) => (state.length ? [] : state));\n previousDirectionRef.current = null;\n };\n\n const updateAnchorClientRect = () =>\n setAnchorClientRect(anchorRef?.current?.getBoundingClientRect());\n\n const offset = useMemo(\n () => getOffset(ref, propOffset),\n [propOffset, Boolean(ref.current)],\n );\n\n const { position, direction } = getComputedPositionAndDirection({\n contentSize: { width, height },\n viewportSize: {\n // Размер вьюпорта без скроллбаров\n width: viewportElement.clientWidth,\n height: viewportElement.clientHeight,\n },\n arrowOffset,\n offset,\n direction: passedDirection,\n possibleDirections,\n bannedDirections,\n position: getPointPosition(\n viewportElement,\n anchorClientRect\n ? { x: anchorClientRect.left, y: anchorClientRect.top }\n : passedPosition,\n !!viewportRef?.current,\n ),\n anchorSize,\n spareDirection,\n });\n\n useEffect(() => onSetDirection?.(direction), [direction]);\n\n useEffect(updateAnchorClientRect, [anchorSize]);\n\n usePopoverReposition({\n isActive: true,\n scrollAnchorRef: anchorRef || { current: null },\n onRequestReposition: () => {\n resetBannedDirections();\n updateAnchorClientRect();\n },\n });\n\n /**\n * Может возникнуть ситуация, когда перерасчет поповера всегда будет выдавать 2 направления\n * и бесконечно зацикливать себя. Для избежания таких кейсов мы запоминаем стороны,\n * которые не подошли, чтобы не возвращаться к ним и предотвратить бесконечный ререндер.\n * См. PopoverBannedPositionsStory\n */\n\n useLayoutEffect(() => {\n if (previousDirectionRef.current !== direction) {\n if (\n previousDirectionRef.current &&\n !bannedDirections.includes(previousDirectionRef.current) &&\n !bannedDirections.includes(direction) &&\n direction !== spareDirection\n ) {\n setBannedDirections((state) =>\n previousDirectionRef.current\n ? [...state, previousDirectionRef.current]\n : state,\n );\n }\n previousDirectionRef.current = direction;\n }\n }, [direction]);\n\n // Сбрасываем при любом изменении пропсов, чтобы заново начать перебор направлений\n // Главное не сбрасывать при изменении размеров поповера, т.к. именно оно может вызвать бесконечный перебор\n\n useLayoutEffect(resetBannedDirections, [props]);\n\n const renderPosition = getRenderPosition(\n viewportElement,\n position,\n !!viewportRef?.current,\n width,\n height,\n );\n\n const notVisible = !renderPosition || !height || !width;\n\n return (\n <PortalWithTheme\n {...otherProps}\n preset={theme}\n className={cnPopover({ direction, notVisible }, [className])}\n container={container}\n ref={useForkRef([ref, componentRef])}\n style={{\n ...style,\n ...(notVisible\n ? {}\n : {\n ['--popover-left' as string]: `${renderPosition.x}px`,\n ['--popover-top' as string]: `${renderPosition.y}px`,\n [`--popover-width` as string]: equalAnchorWidth\n ? `${anchorSize.width}px`\n : undefined,\n [`--popover-pointer-events` as string]: isInteractive\n ? undefined\n : 'none',\n [`--popover-visibility` as string]: position\n ? undefined\n : 'hidden',\n }),\n }}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside}\n ignoreClicksInsideRefs={[ref, anchorRef || { current: null }]}\n >\n {isRenderProp(children) ? children(direction) : children}\n </PortalWithThemeConsumer>\n </PortalWithTheme>\n );\n },\n);\n"],"mappings":"knCAAA,sBAEA,MAAOA,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,CAAuCC,eAAvC,CAAwDC,OAAxD,KAAuE,OAAvE,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBAEA,OAASC,gBAAT,oCACA,OAASC,UAAT,8BACA,OAASC,EAAT,uBACA,OAASC,YAAT,gCACA,OAASC,QAAT,CAAmBC,QAAnB,+BAGA,OACEC,+BADF,CAEEC,gBAFF,CAGEC,iBAHF,iBAKA,OAASC,oBAAT,8BAMA,MAAO,IAAMC,sBAAqB,CAAG,CACnC,YADmC,CAEnC,UAFmC,CAInC,WAJmC,CAKnC,UALmC,CAMnC,SANmC,CAOnC,QAPmC,CASnC,QATmC,CAUnC,YAVmC,CAWnC,UAXmC,CAanC,SAbmC,CAcnC,aAdmC,CAenC,WAfmC,CAA9B,CAkBP,MAAO,IAAMC,oBAAmB,CAAG,CACjC,eADiC,CAEjC,aAFiC,CAIjC,gBAJiC,CAKjC,cALiC,CAOjC,aAPiC,CAQjC,eARiC,CAUjC,cAViC,CAWjC,gBAXiC,CAA5B,CAcP,MAAO,IAAMC,kBAAiB,CAAG,CAC/B,KAD+B,CAE/B,KAF+B,CAG/B,IAH+B,CAI/B,GAJ+B,CAK/B,GAL+B,CAM/B,GAN+B,CAO/B,IAP+B,CAQ/B,KAR+B,CAS/B,KAT+B,CAU/B,KAV+B,CAW/B,KAX+B,CAY/B,KAZ+B,CAA1B,CAgBP,MAAO,IAAMC,WAAU,WAAOH,qBAAP,CAAiCC,mBAAjC,CAAhB,C,GAsCDG,UAAS,CAAG,SAChBC,CADgB,CAEhBC,CAFg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EtCT,CAFsC,CAGtC,CAAC,SAACI,CAAD,WAACA,CAAD,EAACA,CAAW,CAAEjC,OAAd,CAHqC,CAItC4C,CAJsC,CAKtCC,CALsC,CAnHjB,CA2HjBsB,CAAU,CAAG,CAACD,CAAD,EAAmB,CAACrB,CAApB,EAA8B,CAACD,CA3H3B,CA6HvB,MACE,qBAAC,eAAD,kBACMP,CADN,EAEE,MAAM,CAAEG,CAFV,CAGE,SAAS,CAAE3B,SAAS,CAAC,CAAEK,SAAS,CAATA,CAAF,CAAaiD,UAAU,CAAVA,CAAb,CAAD,CAA4B,CAACxC,CAAD,CAA5B,CAHtB,CAIE,SAAS,CAAEO,CAJb,CAKE,GAAG,CAAElD,UAAU,CAAC,CAACc,CAAD,CAAMkB,CAAN,CAAD,CALjB,CAME,KAAK,gCACAU,CADA,EAECyC,CAAU,CACV,EADU,yBAGP,gBAHO,WAGyBD,CAAc,CAACR,CAHxC,0BAIP,eAJO,WAIwBQ,CAAc,CAACN,CAJvC,4CAKuB7B,CAAgB,WACxCe,CAAU,CAACF,KAD6B,aALvC,+CAQgC,wBAEpC,MAVI,2CAW4Bf,CAAQ,QAExC,QAbI,IAFX,CANP,GAyBE,oBAAC,uBAAD,EACE,cAAc,CAAEL,CADlB,CAEE,sBAAsB,CAAE,CAAC1B,CAAD,CAAMgC,CAAS,EAAI,CAAE9B,OAAO,CAAE,IAAX,CAAnB,CAF1B,EAIGd,YAAY,CAAC+B,CAAD,CAAZ,CAAyBA,CAAQ,CAACC,CAAD,CAAjC,CAA+CD,CAJlD,CAzBF,CAiCH,CAhK8B,CAA1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ProgressLine{position:relative;width:100%}.ProgressLine_size_s{--progress-line-height:var(--space-3xs)}.ProgressLine_size_m{--progress-line-height:var(--space-2xs)}.ProgressLine:after{content:"";position:absolute;top:0}.ProgressLine_mode_step{min-height:var(--progress-line-height)}.ProgressLine_mode_step:before{background:var(--color-bg-system);content:"";height:var(--progress-line-height);-webkit-mask-image:var(--progress-line-mask);mask-image:var(--progress-line-mask);position:absolute;top:0;width:100%}.ProgressLine_mode_step:after{background:var(--color-control-bg-primary);height:var(--progress-line-height);-webkit-mask-image:var(--progress-line-mask);mask-image:var(--progress-line-mask);transition:width .3s;width:var(--progress-line-background-active-width)}.ProgressLine_mode_determinate{background:var(--color-bg-system);height:var(--progress-line-height)}.ProgressLine_mode_determinate:after{background-color:var(--color-bg-brand);height:100%;transform:scaleX(var(--progress-line-value));transform-origin:left;transition:transform .3s;width:100%}.ProgressLine_mode_indeterminate{background:var(--color-bg-system);height:var(--progress-line-height);overflow-x:hidden}.ProgressLine_mode_indeterminate:after{animation:ProgressLineAnimation 2s linear infinite;background-color:var(--color-bg-brand);height:100%;transform-origin:left;transition:transform .3s;width:80%}.ProgressLine-Step{display:inline-flex;flex-direction:column;justify-content:flex-start}.ProgressLine-Steps{--progress-line-width-no-gap:calc(100% - (var(--progress-line-steps) - 1)*var(--space-3xs));grid
|
|
1
|
+
.ProgressLine{position:relative;width:100%}.ProgressLine_size_s{--progress-line-height:var(--space-3xs)}.ProgressLine_size_m{--progress-line-height:var(--space-2xs)}.ProgressLine:after{content:"";position:absolute;top:0}.ProgressLine_mode_step{min-height:var(--progress-line-height)}.ProgressLine_mode_step:before{background:var(--color-bg-system);content:"";height:var(--progress-line-height);-webkit-mask-image:var(--progress-line-mask);mask-image:var(--progress-line-mask);position:absolute;top:0;width:100%}.ProgressLine_mode_step:after{background:var(--color-control-bg-primary);height:var(--progress-line-height);-webkit-mask-image:var(--progress-line-mask);mask-image:var(--progress-line-mask);transition:width .3s;width:var(--progress-line-background-active-width)}.ProgressLine_mode_determinate{background:var(--color-bg-system);height:var(--progress-line-height)}.ProgressLine_mode_determinate:after{background-color:var(--color-bg-brand);height:100%;transform:scaleX(var(--progress-line-value));transform-origin:left;transition:transform .3s;width:100%}.ProgressLine_mode_indeterminate{background:var(--color-bg-system);height:var(--progress-line-height);overflow-x:hidden}.ProgressLine_mode_indeterminate:after{animation:ProgressLineAnimation 2s linear infinite;background-color:var(--color-bg-brand);height:100%;transform-origin:left;transition:transform .3s;width:80%}.ProgressLine-Step{display:inline-flex;flex-direction:column;justify-content:flex-start}.ProgressLine-Steps{--progress-line-width-no-gap:calc(100% - (var(--progress-line-steps) - 1)*var(--space-3xs));background:transparent;display:grid;gap:var(--space-3xs);grid-template-columns:repeat(var(--progress-line-steps),calc(var(--progress-line-width-no-gap)/var(--progress-line-steps)));height:auto;margin-top:var(--progress-line-height)}.ProgressLine-Label{margin-top:var(--space-3xs)}@keyframes ProgressLineAnimation{0%{transform:translateX(-100%)}to{transform:translateX(130%)}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
3
3
|
export declare const progressLinePropSize: readonly ["m", "s"];
|
|
4
|
-
export type ProgressLinePropSize = typeof progressLinePropSize[number];
|
|
4
|
+
export type ProgressLinePropSize = (typeof progressLinePropSize)[number];
|
|
5
5
|
export declare const defaultProgressLinePropSize: "m";
|
|
6
6
|
export type ProgressLineItemDefault = {
|
|
7
7
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["progressLinePropSize","defaultProgressLinePropSize"],"sources":["../../../../../src/components/ProgressLine/types.ts"],"sourcesContent":["import React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressLinePropSize = ['m', 's'] as const;\nexport type ProgressLinePropSize = typeof progressLinePropSize[number];\nexport const defaultProgressLinePropSize = progressLinePropSize[0];\n\nexport type ProgressLineItemDefault = {\n label?: string;\n};\n\nexport type ProgressLinePropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type ProgressLineProps<ITEM = ProgressLineItemDefault> =\n PropsWithHTMLAttributesAndRef<\n {\n size?: ProgressLinePropSize;\n value?: number;\n steps?: ITEM[];\n getItemLabel?: ProgressLinePropGetItemLabel<ITEM>;\n },\n HTMLDivElement\n >;\n\nexport type ProgressLineComponent = <ITEM>(\n props: ProgressLineProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAIA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,GAAD,CAAM,GAAN,CAA7B,CAEP,MAAO,IAAMC,4BAA2B,CAAGD,oBAAoB,CAAC,CAAD,CAAxD"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["progressLinePropSize","defaultProgressLinePropSize"],"sources":["../../../../../src/components/ProgressLine/types.ts"],"sourcesContent":["import React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressLinePropSize = ['m', 's'] as const;\nexport type ProgressLinePropSize = (typeof progressLinePropSize)[number];\nexport const defaultProgressLinePropSize = progressLinePropSize[0];\n\nexport type ProgressLineItemDefault = {\n label?: string;\n};\n\nexport type ProgressLinePropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type ProgressLineProps<ITEM = ProgressLineItemDefault> =\n PropsWithHTMLAttributesAndRef<\n {\n size?: ProgressLinePropSize;\n value?: number;\n steps?: ITEM[];\n getItemLabel?: ProgressLinePropGetItemLabel<ITEM>;\n },\n HTMLDivElement\n >;\n\nexport type ProgressLineComponent = <ITEM>(\n props: ProgressLineProps<ITEM>,\n) => React.ReactNode | null;\n"],"mappings":"AAIA,MAAO,IAAMA,qBAAoB,CAAG,CAAC,GAAD,CAAM,GAAN,CAA7B,CAEP,MAAO,IAAMC,4BAA2B,CAAGD,oBAAoB,CAAC,CAAD,CAAxD"}
|
|
@@ -2,7 +2,7 @@ import './ProgressSpin.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
export declare const progressSpinPropSize: readonly ["m", "s", "l", "xl", "2xl"];
|
|
5
|
-
export type ProgressSpinPropSize = typeof progressSpinPropSize[number];
|
|
5
|
+
export type ProgressSpinPropSize = (typeof progressSpinPropSize)[number];
|
|
6
6
|
export declare const progressSpinPropSizeDefault: ProgressSpinPropSize;
|
|
7
7
|
type Props = {
|
|
8
8
|
size?: ProgressSpinPropSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressSpin.js","names":["React","useMemo","cn","getByMap","isNumber","progressSpinPropSize","progressSpinPropSizeDefault","cnProgressSpin","sizeMap","strokeWidthMap","getSvgParamsBySize","size","sizeOfPixels","strokeWidth","radius","strokeDasharray","Math","PI","ProgressSpin","forwardRef","props","ref","progressProp","progress","value","animation","className","otherProps","animatedProgress","spin"],"sources":["../../../../../src/components/ProgressSpin/ProgressSpin.tsx"],"sourcesContent":["import './ProgressSpin.css';\n\nimport React, { useMemo } from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { isNumber } from '../../utils/type-guards';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressSpinPropSize = ['m', 's', 'l', 'xl', '2xl'] as const;\nexport type ProgressSpinPropSize = typeof progressSpinPropSize[number];\nexport const progressSpinPropSizeDefault: ProgressSpinPropSize =\n progressSpinPropSize[0];\n\ntype Props = {\n size?: ProgressSpinPropSize;\n className?: string;\n progress?: number;\n value?: number;\n animation?: boolean;\n children?: never;\n};\nexport type ProgressSpinProps = PropsWithHTMLAttributes<Props, SVGElement>;\n\nexport const cnProgressSpin = cn('ProgressSpin');\n\nconst sizeMap: Record<ProgressSpinPropSize, number> = {\n 's': 12,\n 'm': 20,\n 'l': 28,\n 'xl': 36,\n '2xl': 44,\n};\n\nconst strokeWidthMap: Record<ProgressSpinPropSize, number> = {\n 's': 2,\n 'm': 2,\n 'l': 2.2,\n 'xl': 2.7,\n '2xl': 3.5,\n};\n\nfunction getSvgParamsBySize(\n size: ProgressSpinPropSize,\n): [number, number, number, number] {\n const sizeOfPixels = getByMap(sizeMap, size);\n const strokeWidth = getByMap(strokeWidthMap, size);\n const radius = (sizeOfPixels - strokeWidth) / 2;\n const strokeDasharray = radius * 2 * Math.PI;\n\n return [sizeOfPixels, strokeWidth, radius, strokeDasharray];\n}\n\nexport const ProgressSpin = React.forwardRef<SVGSVGElement, ProgressSpinProps>(\n (props, ref) => {\n const {\n size = progressSpinPropSizeDefault,\n progress: progressProp,\n value,\n animation,\n className,\n ...otherProps\n } = props;\n const [sizeOfPixels, strokeWidth, radius, strokeDasharray] = useMemo(\n () => getSvgParamsBySize(size),\n [size],\n );\n\n const progress = value ?? progressProp;\n\n const animatedProgress = isNumber(progress) ? progress : 50;\n const strokeDashoffset =\n strokeDasharray - (strokeDasharray * animatedProgress) / 100;\n\n return (\n <svg\n {...otherProps}\n className={cnProgressSpin({ spin: !isNumber(progress) }, [className])}\n width={sizeOfPixels}\n height={sizeOfPixels}\n viewBox={`0 0 ${sizeOfPixels} ${sizeOfPixels}`}\n ref={ref}\n >\n <circle\n className={cnProgressSpin('Circle', { animation })}\n cx={sizeOfPixels / 2}\n cy={sizeOfPixels / 2}\n r={radius}\n strokeWidth={strokeWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n />\n </svg>\n );\n },\n);\n"],"mappings":"wNAAA,2BAEA,MAAOA,MAAP,EAAgBC,OAAhB,KAA+B,OAA/B,CAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,QAAT,+BAGA,MAAO,IAAMC,qBAAoB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAgB,IAAhB,CAAsB,KAAtB,CAA7B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,oBAAoB,CAAC,CAAD,CADf,CAaP,MAAO,IAAME,eAAc,CAAGL,EAAE,CAAC,cAAD,CAAzB,C,GAEDM,QAA6C,CAAG,CACpD,EAAK,EAD+C,CAEpD,EAAK,EAF+C,CAGpD,EAAK,EAH+C,CAIpD,GAAM,EAJ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AD,CAAjB,CAAD,CAAgC,CAACG,CAAD,CAAhC,CAF3B,CAGE,KAAK,CAAEd,CAHT,CAIE,MAAM,CAAEA,CAJV,CAKE,OAAO,eAASA,CAAT,aAAyBA,CAAzB,CALT,CAME,GAAG,CAAES,CANP,GAQE,8BACE,SAAS,CAAEd,cAAc,CAAC,QAAD,CAAW,CAAEkB,SAAS,CAATA,CAAF,CAAX,CAD3B,CAEE,EAAE,CAAEb,CAAY,CAAG,CAFrB,CAGE,EAAE,CAAEA,CAAY,CAAG,CAHrB,CAIE,CAAC,CAAEE,CAJL,CAKE,WAAW,CAAED,CALf,CAME,eAAe,CAAEE,CANnB,CAOE,gBAAgB,CAlBpBA,CAAe,CAAIA,CAAe,CAAGa,CAAnB,CAAuC,GAWvD,EARF,CAmBH,CAzCyB,CAArB"}
|
|
1
|
+
{"version":3,"file":"ProgressSpin.js","names":["React","useMemo","cn","getByMap","isNumber","progressSpinPropSize","progressSpinPropSizeDefault","cnProgressSpin","sizeMap","strokeWidthMap","getSvgParamsBySize","size","sizeOfPixels","strokeWidth","radius","strokeDasharray","Math","PI","ProgressSpin","forwardRef","props","ref","progressProp","progress","value","animation","className","otherProps","animatedProgress","spin"],"sources":["../../../../../src/components/ProgressSpin/ProgressSpin.tsx"],"sourcesContent":["import './ProgressSpin.css';\n\nimport React, { useMemo } from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { isNumber } from '../../utils/type-guards';\nimport { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';\n\nexport const progressSpinPropSize = ['m', 's', 'l', 'xl', '2xl'] as const;\nexport type ProgressSpinPropSize = (typeof progressSpinPropSize)[number];\nexport const progressSpinPropSizeDefault: ProgressSpinPropSize =\n progressSpinPropSize[0];\n\ntype Props = {\n size?: ProgressSpinPropSize;\n className?: string;\n progress?: number;\n value?: number;\n animation?: boolean;\n children?: never;\n};\nexport type ProgressSpinProps = PropsWithHTMLAttributes<Props, SVGElement>;\n\nexport const cnProgressSpin = cn('ProgressSpin');\n\nconst sizeMap: Record<ProgressSpinPropSize, number> = {\n 's': 12,\n 'm': 20,\n 'l': 28,\n 'xl': 36,\n '2xl': 44,\n};\n\nconst strokeWidthMap: Record<ProgressSpinPropSize, number> = {\n 's': 2,\n 'm': 2,\n 'l': 2.2,\n 'xl': 2.7,\n '2xl': 3.5,\n};\n\nfunction getSvgParamsBySize(\n size: ProgressSpinPropSize,\n): [number, number, number, number] {\n const sizeOfPixels = getByMap(sizeMap, size);\n const strokeWidth = getByMap(strokeWidthMap, size);\n const radius = (sizeOfPixels - strokeWidth) / 2;\n const strokeDasharray = radius * 2 * Math.PI;\n\n return [sizeOfPixels, strokeWidth, radius, strokeDasharray];\n}\n\nexport const ProgressSpin = React.forwardRef<SVGSVGElement, ProgressSpinProps>(\n (props, ref) => {\n const {\n size = progressSpinPropSizeDefault,\n progress: progressProp,\n value,\n animation,\n className,\n ...otherProps\n } = props;\n const [sizeOfPixels, strokeWidth, radius, strokeDasharray] = useMemo(\n () => getSvgParamsBySize(size),\n [size],\n );\n\n const progress = value ?? progressProp;\n\n const animatedProgress = isNumber(progress) ? progress : 50;\n const strokeDashoffset =\n strokeDasharray - (strokeDasharray * animatedProgress) / 100;\n\n return (\n <svg\n {...otherProps}\n className={cnProgressSpin({ spin: !isNumber(progress) }, [className])}\n width={sizeOfPixels}\n height={sizeOfPixels}\n viewBox={`0 0 ${sizeOfPixels} ${sizeOfPixels}`}\n ref={ref}\n >\n <circle\n className={cnProgressSpin('Circle', { animation })}\n cx={sizeOfPixels / 2}\n cy={sizeOfPixels / 2}\n r={radius}\n strokeWidth={strokeWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n />\n </svg>\n );\n },\n);\n"],"mappings":"wNAAA,2BAEA,MAAOA,MAAP,EAAgBC,OAAhB,KAA+B,OAA/B,CAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,QAAT,+BAGA,MAAO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kE,CATtD,uBASPC,CATO,MASOC,CATP,MASoBC,CATpB,MAS4BC,CAT5B,MAcRQ,CAAQ,QAAGC,CAAH,WAAGA,CAAH,CAAGA,CAAH,CAAYF,CAdZ,CAgBRM,CAAgB,CAAGxB,QAAQ,CAACmB,CAAD,CAAR,CAAqBA,CAArB,CAAgC,EAhB3C,CAoBd,MACE,4CACMI,CADN,EAEE,SAAS,CAAEpB,cAAc,CAAC,CAAEsB,IAAI,CAAE,CAACzB,QAAQ,CAACmB,CAAD,CAAjB,CAAD,CAAgC,CAACG,CAAD,CAAhC,CAF3B,CAGE,KAAK,CAAEd,CAHT,CAIE,MAAM,CAAEA,CAJV,CAKE,OAAO,eAASA,CAAT,aAAyBA,CAAzB,CALT,CAME,GAAG,CAAES,CANP,GAQE,8BACE,SAAS,CAAEd,cAAc,CAAC,QAAD,CAAW,CAAEkB,SAAS,CAATA,CAAF,CAAX,CAD3B,CAEE,EAAE,CAAEb,CAAY,CAAG,CAFrB,CAGE,EAAE,CAAEA,CAAY,CAAG,CAHrB,CAIE,CAAC,CAAEE,CAJL,CAKE,WAAW,CAAED,CALf,CAME,eAAe,CAAEE,CANnB,CAOE,gBAAgB,CAlBpBA,CAAe,CAAIA,CAAe,CAAGa,CAAnB,CAAuC,GAWvD,EARF,CAmBH,CAzCyB,CAArB"}
|
package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.ProgressStepBarItem{align-items:flex-start;display:inline-flex;flex:1;height:100%;position:relative;width:100%}.ProgressStepBarItem_direction_horizontal{flex-direction:column}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_xs{margin-bottom:var(--space-2xs)}.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_m,.ProgressStepBarItem_direction_horizontal .ProgressStepBarItem-Point_size_s{margin-bottom:var(--space-xs)}.ProgressStepBarItem_direction_vertical{flex-direction:row}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Point{margin-right:var(--space-xs)}.ProgressStepBarItem_direction_vertical .ProgressStepBarItem-Content_size_xs{margin-top:-4px}.ProgressStepBarItem::-webkit-scrollbar{display:none}.ProgressStepBarItem_size_xs{--progress-step-bar-item-point-size:var(--space-xs);--progress-step-bar-item-label-margin:var(--space-2xs)}.ProgressStepBarItem_size_s{--progress-step-bar-item-point-size:var(--space-m);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_size_m{--progress-step-bar-item-point-size:var(--space-xl);--progress-step-bar-item-label-margin:var(--space-xs)}.ProgressStepBarItem_position_start.ProgressStepBarItem_direction_horizontal{align-items:flex-start;text-align:left}.ProgressStepBarItem_position_center.ProgressStepBarItem_direction_horizontal{align-items:center;text-align:center}.ProgressStepBarItem_position_end.ProgressStepBarItem_direction_horizontal{align-items:flex-end;text-align:right}.ProgressStepBarItem_status_system{--progress-step-bar-item-point-background:var(--color-bg-system);--progress-step-bar-item-point-content-color:var(--color-typo-secondary)}.ProgressStepBarItem_status_normal{--progress-step-bar-item-point-background:var(--color-bg-normal);--progress-step-bar-item-point-content-color:var(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
--color-control-typo-primary
|
|
3
|
+
)}.ProgressStepBarItem_status_success{--progress-step-bar-item-point-background:var(--color-bg-success);--progress-step-bar-item-point-content-color:var(
|
|
4
|
+
--color-control-typo-primary
|
|
5
|
+
)}.ProgressStepBarItem_status_warning{--progress-step-bar-item-point-background:var(--color-bg-warning);--progress-step-bar-item-point-content-color:var(
|
|
6
|
+
--color-control-typo-primary
|
|
7
|
+
)}.ProgressStepBarItem_status_alert{--progress-step-bar-item-point-background:var(--color-bg-alert);--progress-step-bar-item-point-content-color:var(
|
|
8
|
+
--color-control-typo-primary
|
|
9
|
+
)}.ProgressStepBarItem .ProgressStepBarItem-PointIcon,.ProgressStepBarItem .ProgressStepBarItem-PointText{color:var(--progress-step-bar-item-point-content-color)}.ProgressStepBarItem .ProgressSpin{stroke:var(--progress-step-bar-item-point-content-color)}.ProgressStepBarItem-Point{align-items:center;background-color:var(--progress-step-bar-item-point-background);border:none;border-radius:calc(var(--progress-step-bar-item-point-size)*.5);color:var(--color-bg-default);display:flex;justify-content:center;margin:0;min-height:var(--progress-step-bar-item-point-size);min-width:var(--progress-step-bar-item-point-size);padding:0;transition:background-color .3s}.ProgressStepBarItem-Point_pointer{cursor:pointer}.ProgressStepBarItem-PointText.Text{line-height:var(--size-text-xs);transition:color .3s}.ProgressStepBarItem-Content_bottomOffset,.ProgressStepBarItem-Label{margin-bottom:var(--progress-step-bar-item-label-margin)}
|
|
@@ -2,18 +2,18 @@ import { IconComponent } from '@consta/icons/Icon';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
4
|
export declare const progressStepBarPropSize: readonly ["s", "xs", "m"];
|
|
5
|
-
export type ProgressStepBarPropSize = typeof progressStepBarPropSize[number];
|
|
5
|
+
export type ProgressStepBarPropSize = (typeof progressStepBarPropSize)[number];
|
|
6
6
|
export declare const progressStepBarPropSizeDefault: "s";
|
|
7
7
|
export declare const progressStepBarPropDirection: readonly ["horizontal", "vertical"];
|
|
8
|
-
export type ProgressStepBarPropDirection = typeof progressStepBarPropDirection[number];
|
|
8
|
+
export type ProgressStepBarPropDirection = (typeof progressStepBarPropDirection)[number];
|
|
9
9
|
export declare const progressStepBarPropDirectionDefault: "horizontal";
|
|
10
10
|
export declare const progressStepBarPropStatus: readonly ["normal", "success", "warning", "alert"];
|
|
11
|
-
export type ProgressStepBarPropStatus = typeof progressStepBarPropStatus[number];
|
|
11
|
+
export type ProgressStepBarPropStatus = (typeof progressStepBarPropStatus)[number];
|
|
12
12
|
export declare const progressStepBarPropStatusDefault: "normal";
|
|
13
13
|
export declare const progressStepBarPointNumbersMap: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
14
|
-
export type ProgressStepBarPointNumbersMap = typeof progressStepBarPointNumbersMap[number];
|
|
14
|
+
export type ProgressStepBarPointNumbersMap = (typeof progressStepBarPointNumbersMap)[number];
|
|
15
15
|
export declare const progressStepBarPropPosition: readonly ["center", "start", "end"];
|
|
16
|
-
export type ProgressStepBarPropPosition = typeof progressStepBarPropPosition[number];
|
|
16
|
+
export type ProgressStepBarPropPosition = (typeof progressStepBarPropPosition)[number];
|
|
17
17
|
export declare const progressStepBarPropPositionDefault: ProgressStepBarPropPosition;
|
|
18
18
|
export type ProgressStepBarPropGetItemLabel<ITEM> = (item: ITEM) => string | undefined;
|
|
19
19
|
export type ProgressStepBarPropGetItemKey<ITEM> = (item: ITEM) => string | number;
|