@salutejs/plasma-new-hope 0.336.0-canary.2235.17792261875.0 → 0.336.0-canary.2238.17818313113.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/cjs/components/Attach/Attach.css +18 -16
- package/cjs/components/Attach/Attach.js +13 -59
- package/cjs/components/Attach/Attach.js.map +1 -1
- package/cjs/components/Attach/Attach.styles.js +21 -9
- package/cjs/components/Attach/Attach.styles.js.map +1 -1
- package/cjs/components/Attach/Attach.styles_pso18d.css +7 -0
- package/cjs/components/Attach/Attach.tokens.js +1 -0
- package/cjs/components/Attach/Attach.tokens.js.map +1 -1
- package/cjs/components/Attach/components/AttachButton/AttachButton.css +9 -9
- package/cjs/components/Attach/utils/getFileicon.js +2 -2
- package/cjs/components/Attach/utils/getFileicon.js.map +1 -1
- package/cjs/components/Attach/variations/_helperTextView/base.js +1 -1
- package/cjs/components/Attach/variations/_helperTextView/base_1tgnvl9.css +1 -0
- package/cjs/components/Attach/variations/_size/base.js +1 -1
- package/cjs/components/Attach/variations/_size/base.js.map +1 -1
- package/cjs/components/Attach/variations/_size/{base_a4eelx.css → base_kpo9at.css} +1 -1
- package/cjs/components/Button/Button.css +9 -9
- package/cjs/components/Button/Button.styles.js +11 -11
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Button/{Button.styles_yce5o0.css → Button.styles_wo15lb.css} +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.css +9 -9
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.css +9 -9
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.css +9 -9
- package/cjs/components/Carousel/CarouselNew/Carousel.css +9 -9
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +9 -9
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +9 -9
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +9 -9
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +9 -9
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +9 -9
- package/cjs/components/Drawer/Drawer.css +11 -11
- package/cjs/components/Drawer/Drawer.js +10 -7
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Drawer/Drawer.styles.js +17 -2
- package/cjs/components/Drawer/Drawer.styles.js.map +1 -1
- package/cjs/components/Drawer/{Drawer.styles_h5od79.css → Drawer.styles_1gcp61n.css} +1 -1
- package/cjs/components/Drawer/Drawer.tokens.js +10 -0
- package/cjs/components/Drawer/Drawer.tokens.js.map +1 -1
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -9
- package/cjs/components/EmbedIconButton/EmbedIconButton.css +9 -9
- package/cjs/components/EmptyState/EmptyState.css +9 -9
- package/cjs/components/IconButton/IconButton.css +9 -9
- package/cjs/components/Note/Note.css +9 -9
- package/cjs/components/Notification/Notification.css +9 -9
- package/cjs/components/Notification/NotificationsProvider.css +9 -9
- package/cjs/components/NumberInput/NumberInput.css +9 -9
- package/cjs/components/Pagination/Pagination.css +9 -9
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -9
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.css +9 -9
- package/cjs/components/Select/Select.css +9 -9
- package/cjs/components/Select/ui/Target/Target.css +9 -9
- package/cjs/components/Select/ui/Target/ui/Button/Button.css +9 -9
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.css +1 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +10 -4
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +2 -1
- package/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js.map +1 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +9 -0
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js.map +1 -0
- package/cjs/components/Skeleton/LineSkeleton/variations/_view/base_1it9pjr.css +1 -0
- package/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -1
- package/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js.map +1 -1
- package/cjs/components/Skeleton/tokens.js +2 -1
- package/cjs/components/Skeleton/tokens.js.map +1 -1
- package/cjs/components/Table/Table.css +9 -9
- package/cjs/components/Table/ui/Cell/Cell.css +9 -9
- package/cjs/components/Table/ui/EditableCell/EditableCell.css +9 -9
- package/cjs/components/Table/ui/HeadCell/HeadCell.css +9 -9
- package/cjs/components/Table/ui/HeadCell/ui/Filter/Filter.css +9 -9
- package/cjs/components/Toast/Toast.css +9 -9
- package/cjs/components/Toast/ToastController.css +9 -9
- package/cjs/components/Toast/ToastNew/ToastNew.css +9 -9
- package/cjs/index.css +21 -19
- package/emotion/cjs/components/Attach/Attach.js +12 -51
- package/emotion/cjs/components/Attach/Attach.styles.js +28 -13
- package/emotion/cjs/components/Attach/Attach.tokens.js +1 -0
- package/emotion/cjs/components/Attach/utils/getFileicon.js +3 -3
- package/emotion/cjs/components/Attach/utils/index.js +2 -10
- package/emotion/cjs/components/Attach/variations/_size/base.js +1 -1
- package/emotion/cjs/components/Button/Button.styles.js +17 -17
- package/emotion/cjs/components/Drawer/Drawer.js +13 -4
- package/emotion/cjs/components/Drawer/Drawer.styles.js +10 -4
- package/emotion/cjs/components/Drawer/Drawer.tokens.js +12 -0
- package/emotion/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +11 -5
- package/emotion/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +5 -4
- package/emotion/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -3
- package/emotion/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +14 -0
- package/emotion/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -2
- package/emotion/cjs/components/Skeleton/tokens.js +2 -1
- package/emotion/cjs/examples/components/Attach/Attach.config.js +18 -18
- package/emotion/cjs/examples/components/Button/Button.config.js +21 -21
- package/emotion/cjs/examples/components/Skeleton/LineSkeleton.config.js +23 -18
- package/emotion/es/components/Attach/Attach.js +16 -55
- package/emotion/es/components/Attach/Attach.styles.js +20 -11
- package/emotion/es/components/Attach/Attach.tokens.js +1 -0
- package/emotion/es/components/Attach/utils/getFileicon.js +1 -1
- package/emotion/es/components/Attach/utils/index.js +1 -3
- package/emotion/es/components/Attach/variations/_size/base.js +2 -2
- package/emotion/es/components/Button/Button.styles.js +17 -17
- package/emotion/es/components/Drawer/Drawer.js +9 -5
- package/emotion/es/components/Drawer/Drawer.styles.js +11 -5
- package/emotion/es/components/Drawer/Drawer.tokens.js +9 -0
- package/emotion/es/components/Skeleton/LineSkeleton/LineSkeleton.js +11 -5
- package/emotion/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +5 -4
- package/emotion/es/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -3
- package/emotion/es/components/Skeleton/LineSkeleton/variations/_view/base.js +4 -0
- package/emotion/es/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -2
- package/emotion/es/components/Skeleton/tokens.js +2 -1
- package/emotion/es/examples/components/Attach/Attach.config.js +18 -18
- package/emotion/es/examples/components/Button/Button.config.js +21 -21
- package/emotion/es/examples/components/Combobox/Combobox.js +7 -0
- package/emotion/es/examples/components/Skeleton/LineSkeleton.config.js +23 -18
- package/es/components/Attach/Attach.css +18 -16
- package/es/components/Attach/Attach.js +17 -63
- package/es/components/Attach/Attach.js.map +1 -1
- package/es/components/Attach/Attach.styles.js +19 -9
- package/es/components/Attach/Attach.styles.js.map +1 -1
- package/es/components/Attach/Attach.styles_pso18d.css +7 -0
- package/es/components/Attach/Attach.tokens.js +1 -0
- package/es/components/Attach/Attach.tokens.js.map +1 -1
- package/es/components/Attach/components/AttachButton/AttachButton.css +9 -9
- package/es/components/Attach/utils/getFileicon.js +2 -2
- package/es/components/Attach/utils/getFileicon.js.map +1 -1
- package/es/components/Attach/variations/_helperTextView/base.js +1 -1
- package/es/components/Attach/variations/_helperTextView/base_1tgnvl9.css +1 -0
- package/es/components/Attach/variations/_size/base.js +1 -1
- package/es/components/Attach/variations/_size/base.js.map +1 -1
- package/es/components/Attach/variations/_size/{base_a4eelx.css → base_kpo9at.css} +1 -1
- package/es/components/Button/Button.css +9 -9
- package/es/components/Button/Button.styles.js +11 -11
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Button/{Button.styles_yce5o0.css → Button.styles_wo15lb.css} +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.css +9 -9
- package/es/components/Calendar/CalendarDouble/CalendarDouble.css +9 -9
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.css +9 -9
- package/es/components/Carousel/CarouselNew/Carousel.css +9 -9
- package/es/components/Combobox/ComboboxNew/Combobox.css +9 -9
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +9 -9
- package/es/components/DatePicker/RangeDate/RangeDate.css +9 -9
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +9 -9
- package/es/components/DatePicker/SingleDate/SingleDate.css +9 -9
- package/es/components/Drawer/Drawer.css +11 -11
- package/es/components/Drawer/Drawer.js +8 -6
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Drawer/Drawer.styles.js +17 -2
- package/es/components/Drawer/Drawer.styles.js.map +1 -1
- package/es/components/Drawer/{Drawer.styles_h5od79.css → Drawer.styles_1gcp61n.css} +1 -1
- package/es/components/Drawer/Drawer.tokens.js +10 -1
- package/es/components/Drawer/Drawer.tokens.js.map +1 -1
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -9
- package/es/components/EmbedIconButton/EmbedIconButton.css +9 -9
- package/es/components/EmptyState/EmptyState.css +9 -9
- package/es/components/IconButton/IconButton.css +9 -9
- package/es/components/Note/Note.css +9 -9
- package/es/components/Notification/Notification.css +9 -9
- package/es/components/Notification/NotificationsProvider.css +9 -9
- package/es/components/NumberInput/NumberInput.css +9 -9
- package/es/components/Pagination/Pagination.css +9 -9
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -9
- package/es/components/Panel/ui/PanelHeader/PanelHeader.css +9 -9
- package/es/components/Select/Select.css +9 -9
- package/es/components/Select/ui/Target/Target.css +9 -9
- package/es/components/Select/ui/Target/ui/Button/Button.css +9 -9
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.css +1 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js +10 -4
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +2 -1
- package/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base.js +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base.js.map +1 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base_x642ct.css +1 -0
- package/es/components/Skeleton/LineSkeleton/variations/_view/base.js +5 -0
- package/es/components/Skeleton/LineSkeleton/variations/_view/base.js.map +1 -0
- package/es/components/Skeleton/LineSkeleton/variations/_view/base_1it9pjr.css +1 -0
- package/es/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -1
- package/es/components/Skeleton/TextSkeleton/TextSkeleton.js.map +1 -1
- package/es/components/Skeleton/tokens.js +2 -1
- package/es/components/Skeleton/tokens.js.map +1 -1
- package/es/components/Table/Table.css +9 -9
- package/es/components/Table/ui/Cell/Cell.css +9 -9
- package/es/components/Table/ui/EditableCell/EditableCell.css +9 -9
- package/es/components/Table/ui/HeadCell/HeadCell.css +9 -9
- package/es/components/Table/ui/HeadCell/ui/Filter/Filter.css +9 -9
- package/es/components/Toast/Toast.css +9 -9
- package/es/components/Toast/ToastController.css +9 -9
- package/es/components/Toast/ToastNew/ToastNew.css +9 -9
- package/es/index.css +21 -19
- package/package.json +5 -5
- package/styled-components/cjs/components/Attach/Attach.js +12 -51
- package/styled-components/cjs/components/Attach/Attach.styles.js +31 -11
- package/styled-components/cjs/components/Attach/Attach.tokens.js +1 -0
- package/styled-components/cjs/components/Attach/utils/getFileicon.js +3 -3
- package/styled-components/cjs/components/Attach/utils/index.js +2 -10
- package/styled-components/cjs/components/Attach/variations/_size/base.js +2 -1
- package/styled-components/cjs/components/Button/Button.styles.js +11 -10
- package/styled-components/cjs/components/Drawer/Drawer.js +13 -4
- package/styled-components/cjs/components/Drawer/Drawer.styles.js +17 -4
- package/styled-components/cjs/components/Drawer/Drawer.tokens.js +12 -0
- package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +11 -5
- package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +3 -2
- package/styled-components/cjs/components/Skeleton/LineSkeleton/variations/_size/base.js +2 -7
- package/styled-components/cjs/components/Skeleton/LineSkeleton/variations/_view/base.js +19 -0
- package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -2
- package/styled-components/cjs/components/Skeleton/tokens.js +2 -1
- package/styled-components/cjs/examples/components/Attach/Attach.config.js +8 -4
- package/styled-components/cjs/examples/components/Button/Button.config.js +2 -4
- package/styled-components/cjs/examples/components/Combobox/Combobox.js +15 -0
- package/styled-components/cjs/examples/components/Skeleton/LineSkeleton.config.js +12 -1
- package/styled-components/es/components/Attach/Attach.js +16 -55
- package/styled-components/es/components/Attach/Attach.styles.js +23 -9
- package/styled-components/es/components/Attach/Attach.tokens.js +1 -0
- package/styled-components/es/components/Attach/utils/getFileicon.js +1 -1
- package/styled-components/es/components/Attach/utils/index.js +1 -3
- package/styled-components/es/components/Attach/variations/_size/base.js +3 -2
- package/styled-components/es/components/Button/Button.styles.js +11 -10
- package/styled-components/es/components/Drawer/Drawer.js +9 -5
- package/styled-components/es/components/Drawer/Drawer.styles.js +18 -5
- package/styled-components/es/components/Drawer/Drawer.tokens.js +9 -0
- package/styled-components/es/components/Skeleton/LineSkeleton/LineSkeleton.js +11 -5
- package/styled-components/es/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +3 -2
- package/styled-components/es/components/Skeleton/LineSkeleton/variations/_size/base.js +2 -7
- package/styled-components/es/components/Skeleton/LineSkeleton/variations/_view/base.js +9 -0
- package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +4 -2
- package/styled-components/es/components/Skeleton/tokens.js +2 -1
- package/styled-components/es/examples/components/Attach/Attach.config.js +8 -4
- package/styled-components/es/examples/components/Button/Button.config.js +2 -4
- package/styled-components/es/examples/components/Combobox/Combobox.js +7 -0
- package/styled-components/es/examples/components/Skeleton/LineSkeleton.config.js +12 -1
- package/types/components/Attach/Attach.d.ts.map +1 -1
- package/types/components/Attach/Attach.styles.d.ts +3 -1
- package/types/components/Attach/Attach.styles.d.ts.map +1 -1
- package/types/components/Attach/Attach.tokens.d.ts +1 -0
- package/types/components/Attach/Attach.tokens.d.ts.map +1 -1
- package/types/components/Attach/Attach.types.d.ts +7 -0
- package/types/components/Attach/Attach.types.d.ts.map +1 -1
- package/types/components/Attach/utils/getFileicon.d.ts +1 -1
- package/types/components/Attach/utils/index.d.ts +1 -3
- package/types/components/Attach/utils/index.d.ts.map +1 -1
- package/types/components/Attach/variations/_size/base.d.ts.map +1 -1
- package/types/components/Button/Button.styles.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.d.ts +2 -0
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.styles.d.ts +2 -1
- package/types/components/Drawer/Drawer.styles.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.tokens.d.ts +9 -0
- package/types/components/Drawer/Drawer.tokens.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.types.d.ts +16 -0
- package/types/components/Drawer/Drawer.types.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.d.ts +3 -0
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.styles.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.types.d.ts +1 -1
- package/types/components/Skeleton/LineSkeleton/LineSkeleton.types.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/variations/_size/base.d.ts.map +1 -1
- package/types/components/Skeleton/LineSkeleton/variations/_view/base.d.ts +2 -0
- package/types/components/Skeleton/LineSkeleton/variations/_view/base.d.ts.map +1 -0
- package/types/components/Skeleton/Skeleton.types.d.ts +1 -0
- package/types/components/Skeleton/Skeleton.types.d.ts.map +1 -1
- package/types/components/Skeleton/TextSkeleton/TextSkeleton.d.ts.map +1 -1
- package/types/components/Skeleton/tokens.d.ts +1 -0
- package/types/components/Skeleton/tokens.d.ts.map +1 -1
- package/types/examples/components/Attach/Attach.config.d.ts.map +1 -1
- package/types/examples/components/Attach/Attach.d.ts.map +1 -1
- package/types/examples/components/Button/Button.config.d.ts.map +1 -1
- package/types/examples/components/Drawer/Drawer.d.ts +1 -0
- package/types/examples/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/examples/components/Skeleton/LineSkeleton.config.d.ts +5 -0
- package/types/examples/components/Skeleton/LineSkeleton.config.d.ts.map +1 -1
- package/types/examples/components/Skeleton/Skeleton.d.ts +8 -0
- package/types/examples/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/cjs/components/Attach/Attach.styles_1w3ga58.css +0 -5
- package/cjs/components/Attach/utils/addSeparator.js +0 -18
- package/cjs/components/Attach/utils/addSeparator.js.map +0 -1
- package/cjs/components/Attach/utils/index.js +0 -8
- package/cjs/components/Attach/utils/index.js.map +0 -1
- package/cjs/components/Attach/variations/_helperTextView/base_1vgke1p.css +0 -1
- package/cjs/components/Skeleton/LineSkeleton/variations/_size/base_1wf7n5i.css +0 -1
- package/emotion/cjs/components/Attach/utils/addSeparator.js +0 -20
- package/emotion/es/components/Attach/utils/addSeparator.js +0 -10
- package/es/components/Attach/Attach.styles_1w3ga58.css +0 -5
- package/es/components/Attach/utils/addSeparator.js +0 -14
- package/es/components/Attach/utils/addSeparator.js.map +0 -1
- package/es/components/Attach/utils/index.js +0 -4
- package/es/components/Attach/utils/index.js.map +0 -1
- package/es/components/Attach/variations/_helperTextView/base_1vgke1p.css +0 -1
- package/es/components/Skeleton/LineSkeleton/variations/_size/base_1wf7n5i.css +0 -1
- package/styled-components/cjs/components/Attach/utils/addSeparator.js +0 -20
- package/styled-components/es/components/Attach/utils/addSeparator.js +0 -10
- package/types/components/Attach/utils/addSeparator.d.ts +0 -2
- package/types/components/Attach/utils/addSeparator.d.ts.map +0 -1
|
@@ -173,9 +173,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
173
173
|
}
|
|
174
174
|
var attachRoot = function(Root) {
|
|
175
175
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(props, outerRef) {
|
|
176
|
-
var _props_flow = props.flow, flow = _props_flow === void 0 ? 'auto' : _props_flow, _props_buttonType = props.buttonType, buttonType = _props_buttonType === void 0 ? 'button' : _props_buttonType, _props_hasAttachment = props.hasAttachment, hasAttachment = _props_hasAttachment === void 0 ? true : _props_hasAttachment, acceptedFileFormats = props.acceptedFileFormats, helperText = props.helperText, size = props.size, view = props.view, helperTextView = props.helperTextView, className = props.className, style = props.style, isLoading = props.isLoading, disabled = props.disabled, id = props.id, name = props.name, customIcon = props.customIcon, onChange = props.onChange, onClear = props.onClear, rest = _object_without_properties(props, [
|
|
176
|
+
var _props_flow = props.flow, flow = _props_flow === void 0 ? 'auto' : _props_flow, _props_buttonType = props.buttonType, buttonType = _props_buttonType === void 0 ? 'button' : _props_buttonType, _props_hideButtonOnAttach = props.hideButtonOnAttach, hideButtonOnAttach = _props_hideButtonOnAttach === void 0 ? false : _props_hideButtonOnAttach, _props_hasAttachment = props.hasAttachment, hasAttachment = _props_hasAttachment === void 0 ? true : _props_hasAttachment, acceptedFileFormats = props.acceptedFileFormats, helperText = props.helperText, size = props.size, view = props.view, helperTextView = props.helperTextView, className = props.className, style = props.style, isLoading = props.isLoading, disabled = props.disabled, id = props.id, name = props.name, customIcon = props.customIcon, onClick = props.onClick, onChange = props.onChange, onClear = props.onClear, rest = _object_without_properties(props, [
|
|
177
177
|
"flow",
|
|
178
178
|
"buttonType",
|
|
179
|
+
"hideButtonOnAttach",
|
|
179
180
|
"hasAttachment",
|
|
180
181
|
"acceptedFileFormats",
|
|
181
182
|
"helperText",
|
|
@@ -189,66 +190,31 @@ var attachRoot = function(Root) {
|
|
|
189
190
|
"id",
|
|
190
191
|
"name",
|
|
191
192
|
"customIcon",
|
|
193
|
+
"onClick",
|
|
192
194
|
"onChange",
|
|
193
195
|
"onClear"
|
|
194
196
|
]);
|
|
195
197
|
var innerRef = (0, _react.useRef)(null);
|
|
196
198
|
var ref = (0, _plasmacore.useForkRef)(outerRef, innerRef);
|
|
197
199
|
var inputRef = (0, _react.useRef)(null);
|
|
198
|
-
var inputHelperRef = (0, _react.useRef)(null);
|
|
199
200
|
var cellRef = (0, _react.useRef)(null);
|
|
200
201
|
var buttonRef = (0, _react.useRef)(null);
|
|
201
|
-
var emptyTextCellWidth = (0, _react.useRef)(null);
|
|
202
202
|
var _useState = _sliced_to_array((0, _react.useState)(''), 2), filename = _useState[0], setFilename = _useState[1];
|
|
203
|
-
var _useState1 = _sliced_to_array((0, _react.useState)(''), 2), truncatedFilename = _useState1[0], setTruncatedFilename = _useState1[1];
|
|
204
203
|
var horizontalClass = flow === 'horizontal' ? _Attachtokens.classes.horizontal : undefined;
|
|
205
204
|
var verticalClass = flow === 'vertical' ? _Attachtokens.classes.vertical : undefined;
|
|
206
205
|
var withHelperTextClass = helperText ? _Attachtokens.classes.withHelperText : undefined;
|
|
207
206
|
var autoClass = flow === 'auto' ? _Attachtokens.classes.auto : undefined;
|
|
208
|
-
var cellHiddenClass = truncatedFilename.length === 0 ? _Attachtokens.classes.cellHidden : undefined;
|
|
209
207
|
var accept = acceptedFileFormats === null || acceptedFileFormats === void 0 ? void 0 : acceptedFileFormats.join(',');
|
|
210
208
|
var extension = (0, _utils1.extractExtension)(filename);
|
|
211
|
-
var
|
|
212
|
-
(0,
|
|
213
|
-
|
|
214
|
-
emptyTextCellWidth.current = ((_cellRef_current = cellRef.current) === null || _cellRef_current === void 0 ? void 0 : _cellRef_current.offsetWidth) || 0;
|
|
215
|
-
}, []);
|
|
216
|
-
(0, _plasmacore.useIsomorphicLayoutEffect)(function() {
|
|
217
|
-
if (!cellRef.current || !cellRef.current.parentElement || !inputHelperRef.current || !inputHelperRef.current.textContent || !emptyTextCellWidth.current || !buttonRef.current) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
var _inputHelperRef_current = inputHelperRef.current, textWidth = _inputHelperRef_current.offsetWidth;
|
|
221
|
-
var _buttonRef_current = buttonRef.current, buttonWidth = _buttonRef_current.offsetWidth;
|
|
222
|
-
var _cellRef_current_parentElement_getBoundingClientRect = cellRef.current.parentElement.getBoundingClientRect(), parentWidth = _cellRef_current_parentElement_getBoundingClientRect.width, parentLeft = _cellRef_current_parentElement_getBoundingClientRect.left;
|
|
223
|
-
var _cellRef_current_getBoundingClientRect = cellRef.current.getBoundingClientRect(), cellLeft = _cellRef_current_getBoundingClientRect.left;
|
|
224
|
-
var leftDiff = cellLeft - parentLeft;
|
|
225
|
-
var currentTextWidth = textWidth;
|
|
226
|
-
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth || currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
|
227
|
-
setTruncatedFilename(filename);
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
var currFilename = (0, _utils1.addSeparator)(filename, _utils1.separator);
|
|
231
|
-
for(var i = currFilename.indexOf(_utils1.separator) - 1; i > 0; i -= 1){
|
|
232
|
-
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
var left = currFilename.slice(0, i);
|
|
236
|
-
var right = currFilename.slice(i + 1);
|
|
237
|
-
var newFilename = "".concat(left).concat(right);
|
|
238
|
-
inputHelperRef.current.textContent = newFilename;
|
|
239
|
-
currentTextWidth = inputHelperRef.current.offsetWidth;
|
|
240
|
-
if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
currFilename = newFilename;
|
|
244
|
-
}
|
|
245
|
-
inputHelperRef.current.textContent = filename;
|
|
246
|
-
setTruncatedFilename(currFilename);
|
|
247
|
-
});
|
|
248
|
-
var handleClick = function() {
|
|
209
|
+
var filenameWithoutExtension = filename.slice(0, -1 - ((extension === null || extension === void 0 ? void 0 : extension.length) || 0));
|
|
210
|
+
var cellContentLeft = customIcon || (0, _utils1.getFileIcon)(extension, size);
|
|
211
|
+
var handleClick = function(e) {
|
|
249
212
|
if (!inputRef.current) {
|
|
250
213
|
return;
|
|
251
214
|
}
|
|
215
|
+
if (onClick) {
|
|
216
|
+
onClick(e);
|
|
217
|
+
}
|
|
252
218
|
inputRef.current.click();
|
|
253
219
|
};
|
|
254
220
|
var handleChange = function(e) {
|
|
@@ -269,7 +235,6 @@ var attachRoot = function(Root) {
|
|
|
269
235
|
}
|
|
270
236
|
inputRef.current.value = '';
|
|
271
237
|
setFilename('');
|
|
272
|
-
setTruncatedFilename('');
|
|
273
238
|
};
|
|
274
239
|
return /*#__PURE__*/ _react.default.createElement(Root, {
|
|
275
240
|
className: (0, _utils.cx)(horizontalClass, verticalClass, autoClass, withHelperTextClass, className),
|
|
@@ -285,20 +250,16 @@ var attachRoot = function(Root) {
|
|
|
285
250
|
id: id,
|
|
286
251
|
name: name,
|
|
287
252
|
onChange: handleChange
|
|
288
|
-
}), /*#__PURE__*/ _react.default.createElement(_Attachstyles.
|
|
289
|
-
ref: inputHelperRef
|
|
290
|
-
}, filename), /*#__PURE__*/ _react.default.createElement(_Attachstyles.StyledAttachButtonWrapper, null, /*#__PURE__*/ _react.default.createElement(_AttachButton.AttachButton, _object_spread({
|
|
253
|
+
}), (!hideButtonOnAttach || !filename) && /*#__PURE__*/ _react.default.createElement(_Attachstyles.StyledAttachButtonWrapper, null, /*#__PURE__*/ _react.default.createElement(_AttachButton.AttachButton, _object_spread({
|
|
291
254
|
ref: buttonRef,
|
|
292
255
|
buttonType: buttonType,
|
|
293
256
|
isLoading: isLoading,
|
|
294
257
|
disabled: disabled,
|
|
295
258
|
onClick: handleClick
|
|
296
|
-
}, rest)), helperText && /*#__PURE__*/ _react.default.createElement(_Attachstyles.StyledHelperText, null, helperText)), hasAttachment && /*#__PURE__*/ _react.default.createElement(_Cell.StyledCell, {
|
|
259
|
+
}, rest)), helperText && /*#__PURE__*/ _react.default.createElement(_Attachstyles.StyledHelperText, null, helperText)), (hasAttachment || hideButtonOnAttach) && filename && /*#__PURE__*/ _react.default.createElement(_Cell.StyledCell, {
|
|
297
260
|
stretching: "fixed",
|
|
298
|
-
className: cellHiddenClass,
|
|
299
261
|
ref: cellRef,
|
|
300
262
|
size: size,
|
|
301
|
-
title: truncatedFilename,
|
|
302
263
|
contentLeft: cellContentLeft,
|
|
303
264
|
contentRight: /*#__PURE__*/ _react.default.createElement(_IconButtonstyles.StyledIconButtonCancel, {
|
|
304
265
|
onClick: handleClear
|
|
@@ -306,7 +267,7 @@ var attachRoot = function(Root) {
|
|
|
306
267
|
size: "xs",
|
|
307
268
|
color: "inherit"
|
|
308
269
|
}))
|
|
309
|
-
}));
|
|
270
|
+
}, /*#__PURE__*/ _react.default.createElement(_Attachstyles.FilenameWrapper, null, /*#__PURE__*/ _react.default.createElement(_Attachstyles.TruncatedFilenamePart, null, filenameWithoutExtension.slice(0, -1)), /*#__PURE__*/ _react.default.createElement(_Attachstyles.FilenameExtensionPart, null, filenameWithoutExtension.at(-1), ".", extension))));
|
|
310
271
|
});
|
|
311
272
|
};
|
|
312
273
|
var attachConfig = {
|
|
@@ -9,6 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
get FilenameExtensionPart () {
|
|
13
|
+
return FilenameExtensionPart;
|
|
14
|
+
},
|
|
15
|
+
get FilenameWrapper () {
|
|
16
|
+
return FilenameWrapper;
|
|
17
|
+
},
|
|
12
18
|
get StyledAttachButtonWrapper () {
|
|
13
19
|
return StyledAttachButtonWrapper;
|
|
14
20
|
},
|
|
@@ -18,14 +24,15 @@ _export(exports, {
|
|
|
18
24
|
get StyledHiddenInput () {
|
|
19
25
|
return StyledHiddenInput;
|
|
20
26
|
},
|
|
21
|
-
get
|
|
22
|
-
return
|
|
27
|
+
get TruncatedFilenamePart () {
|
|
28
|
+
return TruncatedFilenamePart;
|
|
23
29
|
},
|
|
24
30
|
get base () {
|
|
25
31
|
return base;
|
|
26
32
|
}
|
|
27
33
|
});
|
|
28
34
|
var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
35
|
+
var _mixins = require("../../mixins");
|
|
29
36
|
function _getRequireWildcardCache(nodeInterop) {
|
|
30
37
|
if (typeof WeakMap !== "function") return null;
|
|
31
38
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -72,25 +79,38 @@ var base = (0, _styledcomponents.css)([
|
|
|
72
79
|
]);
|
|
73
80
|
var StyledHiddenInput = _styledcomponents.default.input.withConfig({
|
|
74
81
|
displayName: "Attach.styles__StyledHiddenInput",
|
|
75
|
-
componentId: "sc-
|
|
82
|
+
componentId: "sc-ebfa8a10-0"
|
|
76
83
|
})([
|
|
77
84
|
"display:none;"
|
|
78
85
|
]);
|
|
79
|
-
var StyledHiddenInputHelper = _styledcomponents.default.div.withConfig({
|
|
80
|
-
displayName: "Attach.styles__StyledHiddenInputHelper",
|
|
81
|
-
componentId: "sc-7ce14282-1"
|
|
82
|
-
})([
|
|
83
|
-
"position:absolute;visibility:hidden;white-space:nowrap;"
|
|
84
|
-
]);
|
|
85
86
|
var StyledAttachButtonWrapper = _styledcomponents.default.div.withConfig({
|
|
86
87
|
displayName: "Attach.styles__StyledAttachButtonWrapper",
|
|
87
|
-
componentId: "sc-
|
|
88
|
+
componentId: "sc-ebfa8a10-1"
|
|
88
89
|
})([
|
|
89
90
|
"position:relative;"
|
|
90
91
|
]);
|
|
91
92
|
var StyledHelperText = _styledcomponents.default.div.withConfig({
|
|
92
93
|
displayName: "Attach.styles__StyledHelperText",
|
|
93
|
-
componentId: "sc-
|
|
94
|
+
componentId: "sc-ebfa8a10-2"
|
|
94
95
|
})([
|
|
95
96
|
"position:absolute;margin-top:0.25rem;"
|
|
96
97
|
]);
|
|
98
|
+
var FilenameWrapper = _styledcomponents.default.div.withConfig({
|
|
99
|
+
displayName: "Attach.styles__FilenameWrapper",
|
|
100
|
+
componentId: "sc-ebfa8a10-3"
|
|
101
|
+
})([
|
|
102
|
+
"display:inline-grid;align-items:center;grid-template-columns:auto 1fr;min-width:8ch;"
|
|
103
|
+
]);
|
|
104
|
+
var TruncatedFilenamePart = _styledcomponents.default.span.withConfig({
|
|
105
|
+
displayName: "Attach.styles__TruncatedFilenamePart",
|
|
106
|
+
componentId: "sc-ebfa8a10-4"
|
|
107
|
+
})([
|
|
108
|
+
"",
|
|
109
|
+
""
|
|
110
|
+
], (0, _mixins.applyEllipsis)());
|
|
111
|
+
var FilenameExtensionPart = _styledcomponents.default.span.withConfig({
|
|
112
|
+
displayName: "Attach.styles__FilenameExtensionPart",
|
|
113
|
+
componentId: "sc-ebfa8a10-5"
|
|
114
|
+
})([
|
|
115
|
+
""
|
|
116
|
+
]);
|
|
@@ -27,6 +27,7 @@ var tokens = {
|
|
|
27
27
|
horizontalGap: '--plasma-attach-horizontal-gap',
|
|
28
28
|
verticalGap: '--plasma-attach-vertical-gap',
|
|
29
29
|
verticalGapWithHelperText: '--plasma-attach-vertical-gap-with-helper-text',
|
|
30
|
+
filenameWrapperHeight: '--plasma-attach-filename-wrapper-height',
|
|
30
31
|
helperTextColor: '--plasma-attach-helper-text-color',
|
|
31
32
|
// Токены для Button
|
|
32
33
|
buttonColor: '--plasma-attach-button-color',
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "getFileIcon", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return getFileIcon;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var getFileIcon = function(extension, size) {
|
|
19
19
|
var iconSize = size === 'xs' ? 'xs' : 's';
|
|
20
20
|
switch(extension){
|
|
21
21
|
case 'pdf':
|
|
@@ -9,20 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
get addSeparator () {
|
|
13
|
-
return _addSeparator.addSeparator;
|
|
14
|
-
},
|
|
15
12
|
get extractExtension () {
|
|
16
13
|
return _extractExtension.extractExtension;
|
|
17
14
|
},
|
|
18
|
-
get
|
|
19
|
-
return _getFileicon.
|
|
20
|
-
},
|
|
21
|
-
get separator () {
|
|
22
|
-
return separator;
|
|
15
|
+
get getFileIcon () {
|
|
16
|
+
return _getFileicon.getFileIcon;
|
|
23
17
|
}
|
|
24
18
|
});
|
|
25
19
|
var _extractExtension = require("./extractExtension");
|
|
26
20
|
var _getFileicon = require("./getFileicon");
|
|
27
|
-
var _addSeparator = require("./addSeparator");
|
|
28
|
-
var separator = '...';
|
|
@@ -28,6 +28,7 @@ var base = (0, _styledcomponents.css)([
|
|
|
28
28
|
");font-weight:var(",
|
|
29
29
|
");letter-spacing:var(",
|
|
30
30
|
");line-height:var(",
|
|
31
|
+
");height:var(",
|
|
31
32
|
");}",
|
|
32
33
|
"{font-family:var(--plasma-typo-body-xs-font-family);font-size:var(--plasma-typo-body-xs-font-size);font-style:var(--plasma-typo-body-xs-font-style);font-weight:var(--plasma-typo-body-xs-font-weight);letter-spacing:var(--plasma-typo-body-xs-letter-spacing);line-height:var(--plasma-typo-body-xs-line-height);}}"
|
|
33
|
-
], _Attachtokens.classes.horizontal, _Attachtokens.tokens.horizontalGap, _Attachtokens.classes.vertical, _Attachtokens.tokens.verticalGap, _Attachtokens.classes.auto, _Attachtokens.tokens.verticalGap, _Attachtokens.tokens.horizontalGap, _Attachtokens.classes.withHelperText, _Attachtokens.tokens.verticalGapWithHelperText, _Attachstyles.
|
|
34
|
+
], _Attachtokens.classes.horizontal, _Attachtokens.tokens.horizontalGap, _Attachtokens.classes.vertical, _Attachtokens.tokens.verticalGap, _Attachtokens.classes.auto, _Attachtokens.tokens.verticalGap, _Attachtokens.tokens.horizontalGap, _Attachtokens.classes.withHelperText, _Attachtokens.tokens.verticalGapWithHelperText, _Attachstyles.FilenameWrapper, _Attachtokens.tokens.cellTitleFontFamily, _Attachtokens.tokens.cellTitleFontSize, _Attachtokens.tokens.cellTitleFontStyle, _Attachtokens.tokens.cellTitleFontWeight, _Attachtokens.tokens.cellTitleLetterSpacing, _Attachtokens.tokens.cellTitleLineHeight, _Attachtokens.tokens.filenameWrapperHeight, _Attachstyles.StyledHelperText);
|
|
@@ -91,15 +91,16 @@ var mergedConfig = (0, _engines.mergeConfig)(_Spinner.spinnerConfig);
|
|
|
91
91
|
var Spinner = (0, _engines.component)(mergedConfig);
|
|
92
92
|
var ButtonText = _styledcomponents.default.span.withConfig({
|
|
93
93
|
displayName: "Button.styles__ButtonText",
|
|
94
|
-
componentId: "sc-
|
|
94
|
+
componentId: "sc-b7c1e7a-0"
|
|
95
95
|
})([
|
|
96
96
|
"min-width:4ch;&.",
|
|
97
|
-
"{flex-grow:2;text-align:start;}",
|
|
97
|
+
"{flex-grow:2;text-align:start;}color:var(",
|
|
98
|
+
");",
|
|
98
99
|
""
|
|
99
|
-
], String(_Buttontokens.classes.contentRelaxed), (0, _mixins.applyEllipsis)());
|
|
100
|
+
], String(_Buttontokens.classes.contentRelaxed), _Buttontokens.tokens.buttonTextColor, (0, _mixins.applyEllipsis)());
|
|
100
101
|
var StyledAdditionalContent = _styledcomponents.default.div.withConfig({
|
|
101
102
|
displayName: "Button.styles__StyledAdditionalContent",
|
|
102
|
-
componentId: "sc-
|
|
103
|
+
componentId: "sc-b7c1e7a-1"
|
|
103
104
|
})([
|
|
104
105
|
"display:flex;align-items:center;margin:var(",
|
|
105
106
|
");&.",
|
|
@@ -109,7 +110,7 @@ var StyledAdditionalContent = _styledcomponents.default.div.withConfig({
|
|
|
109
110
|
], _Buttontokens.tokens.buttonAdditionalContentMargin, String(_Buttontokens.classes.contentRelaxed), _Buttontokens.classes.buttonHasValue, _Buttontokens.tokens.buttonAdditionalContentMarginRightWidthValue);
|
|
110
111
|
var ButtonValue = _styledcomponents.default.span.withConfig({
|
|
111
112
|
displayName: "Button.styles__ButtonValue",
|
|
112
|
-
componentId: "sc-
|
|
113
|
+
componentId: "sc-b7c1e7a-2"
|
|
113
114
|
})([
|
|
114
115
|
"color:var(",
|
|
115
116
|
");margin:var(",
|
|
@@ -118,7 +119,7 @@ var ButtonValue = _styledcomponents.default.span.withConfig({
|
|
|
118
119
|
], _Buttontokens.tokens.buttonValueColor, _Buttontokens.tokens.buttonValueMargin, (0, _mixins.applyEllipsis)());
|
|
119
120
|
var LoadWrap = _styledcomponents.default.div.withConfig({
|
|
120
121
|
displayName: "Button.styles__LoadWrap",
|
|
121
|
-
componentId: "sc-
|
|
122
|
+
componentId: "sc-b7c1e7a-3"
|
|
122
123
|
})([
|
|
123
124
|
"opacity:",
|
|
124
125
|
";display:flex;align-items:inherit;justify-content:",
|
|
@@ -132,13 +133,13 @@ var LoadWrap = _styledcomponents.default.div.withConfig({
|
|
|
132
133
|
});
|
|
133
134
|
var Loader = _styledcomponents.default.div.withConfig({
|
|
134
135
|
displayName: "Button.styles__Loader",
|
|
135
|
-
componentId: "sc-
|
|
136
|
+
componentId: "sc-b7c1e7a-4"
|
|
136
137
|
})([
|
|
137
138
|
"position:absolute;"
|
|
138
139
|
]);
|
|
139
140
|
var StyledSpinner = (0, _styledcomponents.default)(Spinner).withConfig({
|
|
140
141
|
displayName: "Button.styles__StyledSpinner",
|
|
141
|
-
componentId: "sc-
|
|
142
|
+
componentId: "sc-b7c1e7a-5"
|
|
142
143
|
})([
|
|
143
144
|
"",
|
|
144
145
|
":var(",
|
|
@@ -148,7 +149,7 @@ var StyledSpinner = (0, _styledcomponents.default)(Spinner).withConfig({
|
|
|
148
149
|
], _Spinner.spinnerTokens.size, _Buttontokens.tokens.buttonSpinnerSize, _Spinner.spinnerTokens.color, _Buttontokens.tokens.buttonSpinnerColor);
|
|
149
150
|
var StyledContentLeft = _styledcomponents.default.div.withConfig({
|
|
150
151
|
displayName: "Button.styles__StyledContentLeft",
|
|
151
|
-
componentId: "sc-
|
|
152
|
+
componentId: "sc-b7c1e7a-6"
|
|
152
153
|
})([
|
|
153
154
|
"display:flex;align-self:var(",
|
|
154
155
|
");color:var(",
|
|
@@ -160,7 +161,7 @@ var StyledContentLeft = _styledcomponents.default.div.withConfig({
|
|
|
160
161
|
});
|
|
161
162
|
var StyledContentRight = _styledcomponents.default.div.withConfig({
|
|
162
163
|
displayName: "Button.styles__StyledContentRight",
|
|
163
|
-
componentId: "sc-
|
|
164
|
+
componentId: "sc-b7c1e7a-7"
|
|
164
165
|
})([
|
|
165
166
|
"display:flex;align-self:var(",
|
|
166
167
|
");color:var(",
|
|
@@ -17,6 +17,7 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
|
+
var _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
20
21
|
var _plasmacore = require("@salutejs/plasma-core");
|
|
21
22
|
var _utils = require("../../utils");
|
|
22
23
|
var _Popup = require("../Popup");
|
|
@@ -43,6 +44,11 @@ function _define_property(obj, key, value) {
|
|
|
43
44
|
}
|
|
44
45
|
return obj;
|
|
45
46
|
}
|
|
47
|
+
function _interop_require_default(obj) {
|
|
48
|
+
return obj && obj.__esModule ? obj : {
|
|
49
|
+
default: obj
|
|
50
|
+
};
|
|
51
|
+
}
|
|
46
52
|
function _getRequireWildcardCache(nodeInterop) {
|
|
47
53
|
if (typeof WeakMap !== "function") return null;
|
|
48
54
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -128,7 +134,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
128
134
|
}
|
|
129
135
|
var drawerRoot = function(Root) {
|
|
130
136
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(_param, outerRef) {
|
|
131
|
-
var id = _param.id, zIndex = _param.zIndex, popupInfo = _param.popupInfo, withBlur = _param.withBlur, children = _param.children, view = _param.view, size = _param.size, width = _param.width, height = _param.height, isOpen = _param.isOpen, opened = _param.opened, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef, className = _param.className, customBackgroundColor = _param.customBackgroundColor, customContentBackgroundColor = _param.customContentBackgroundColor, onClose = _param.onClose, onOverlayClick = _param.onOverlayClick, onEscKeyDown = _param.onEscKeyDown, offset = _param.offset, frame = _param.frame, _param_borderRadius = _param.borderRadius, borderRadius = _param_borderRadius === void 0 ? 'none' : _param_borderRadius, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'right' : _param_placement, _param_closeOnEsc = _param.closeOnEsc, closeOnEsc = _param_closeOnEsc === void 0 ? true : _param_closeOnEsc, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, _param_asModal = _param.asModal, asModal = _param_asModal === void 0 ? true : _param_asModal, draggable = _param.draggable, rest = _object_without_properties(_param, [
|
|
137
|
+
var id = _param.id, zIndex = _param.zIndex, popupInfo = _param.popupInfo, withBlur = _param.withBlur, children = _param.children, view = _param.view, size = _param.size, width = _param.width, height = _param.height, isOpen = _param.isOpen, opened = _param.opened, initialFocusRef = _param.initialFocusRef, focusAfterRef = _param.focusAfterRef, animationInfo = _param.animationInfo, className = _param.className, customBackgroundColor = _param.customBackgroundColor, customContentBackgroundColor = _param.customContentBackgroundColor, onClose = _param.onClose, onOverlayClick = _param.onOverlayClick, onEscKeyDown = _param.onEscKeyDown, offset = _param.offset, frame = _param.frame, _param_borderRadius = _param.borderRadius, borderRadius = _param_borderRadius === void 0 ? 'none' : _param_borderRadius, _param_placement = _param.placement, placement = _param_placement === void 0 ? 'right' : _param_placement, _param_closeOnEsc = _param.closeOnEsc, closeOnEsc = _param_closeOnEsc === void 0 ? true : _param_closeOnEsc, _param_closeOnOverlayClick = _param.closeOnOverlayClick, closeOnOverlayClick = _param_closeOnOverlayClick === void 0 ? true : _param_closeOnOverlayClick, _param_asModal = _param.asModal, asModal = _param_asModal === void 0 ? true : _param_asModal, draggable = _param.draggable, rest = _object_without_properties(_param, [
|
|
132
138
|
"id",
|
|
133
139
|
"zIndex",
|
|
134
140
|
"popupInfo",
|
|
@@ -142,6 +148,7 @@ var drawerRoot = function(Root) {
|
|
|
142
148
|
"opened",
|
|
143
149
|
"initialFocusRef",
|
|
144
150
|
"focusAfterRef",
|
|
151
|
+
"animationInfo",
|
|
145
152
|
"className",
|
|
146
153
|
"customBackgroundColor",
|
|
147
154
|
"customContentBackgroundColor",
|
|
@@ -191,10 +198,11 @@ var drawerRoot = function(Root) {
|
|
|
191
198
|
onClose();
|
|
192
199
|
}
|
|
193
200
|
};
|
|
201
|
+
var _obj;
|
|
194
202
|
return /*#__PURE__*/ _react.default.createElement(_Drawerstyles.StyledPopup, _object_spread({
|
|
195
203
|
id: innerId,
|
|
196
204
|
ref: asModal ? innerRef : outerRef,
|
|
197
|
-
className: (0,
|
|
205
|
+
className: (0, _classnames.default)(placementClass, className, (_obj = {}, _define_property(_obj, _Drawertokens.classes.enterCustomAnimation, animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.enter), _define_property(_obj, _Drawertokens.classes.exitCustomAnimation, animationInfo === null || animationInfo === void 0 ? void 0 : animationInfo.exit), _obj)),
|
|
198
206
|
opened: innerIsOpen,
|
|
199
207
|
zIndex: zIndex,
|
|
200
208
|
placement: placement,
|
|
@@ -204,6 +212,7 @@ var drawerRoot = function(Root) {
|
|
|
204
212
|
height: innerHeight,
|
|
205
213
|
offset: offset,
|
|
206
214
|
withAnimation: true,
|
|
215
|
+
drawerAnimationInfo: animationInfo,
|
|
207
216
|
overlay: asModal && /*#__PURE__*/ _react.default.createElement(Root, {
|
|
208
217
|
view: view
|
|
209
218
|
}, /*#__PURE__*/ _react.default.createElement(_Overlay.Overlay, {
|
|
@@ -216,6 +225,7 @@ var drawerRoot = function(Root) {
|
|
|
216
225
|
onOverlayClick: onDrawerOverlayKeyDown
|
|
217
226
|
}))
|
|
218
227
|
}, rest), /*#__PURE__*/ _react.default.createElement(Root, {
|
|
228
|
+
className: _Drawertokens.classes.panel,
|
|
219
229
|
view: view,
|
|
220
230
|
size: size,
|
|
221
231
|
style: {
|
|
@@ -227,8 +237,7 @@ var drawerRoot = function(Root) {
|
|
|
227
237
|
width: innerWidth,
|
|
228
238
|
height: innerHeight,
|
|
229
239
|
customBackgroundColor: customBackgroundColor,
|
|
230
|
-
customContentBackgroundColor: customContentBackgroundColor
|
|
231
|
-
className: className
|
|
240
|
+
customContentBackgroundColor: customContentBackgroundColor
|
|
232
241
|
}, children)));
|
|
233
242
|
});
|
|
234
243
|
};
|
|
@@ -82,7 +82,7 @@ var getAnimationStyles = function() {
|
|
|
82
82
|
};
|
|
83
83
|
var StyledPanel = (0, _styledcomponents.default)(Panel).withConfig({
|
|
84
84
|
displayName: "Drawer.styles__StyledPanel",
|
|
85
|
-
componentId: "sc-
|
|
85
|
+
componentId: "sc-758b0d76-0"
|
|
86
86
|
})([
|
|
87
87
|
"",
|
|
88
88
|
":var(",
|
|
@@ -90,7 +90,7 @@ var StyledPanel = (0, _styledcomponents.default)(Panel).withConfig({
|
|
|
90
90
|
], _Panel.panelTokens.closeColor, _Drawertokens.tokens.closeIconColor);
|
|
91
91
|
var StyledPopup = (0, _styledcomponents.default)(Popup).withConfig({
|
|
92
92
|
displayName: "Drawer.styles__StyledPopup",
|
|
93
|
-
componentId: "sc-
|
|
93
|
+
componentId: "sc-758b0d76-1"
|
|
94
94
|
})([
|
|
95
95
|
"&&.",
|
|
96
96
|
"{animation:fadeIn 0.2s forwards;scrollbar-gutter:stable;}&&.",
|
|
@@ -100,11 +100,24 @@ var StyledPopup = (0, _styledcomponents.default)(Popup).withConfig({
|
|
|
100
100
|
" > div{width:",
|
|
101
101
|
";height:",
|
|
102
102
|
";}",
|
|
103
|
-
""
|
|
103
|
+
" &.",
|
|
104
|
+
"{&& .",
|
|
105
|
+
"{animation:",
|
|
106
|
+
";}}&.",
|
|
107
|
+
"{&&.",
|
|
108
|
+
" .",
|
|
109
|
+
"{animation:",
|
|
110
|
+
";}}"
|
|
104
111
|
], _Drawertokens.classes.overlay, _Popup.popupClasses.endAnimation, _Drawertokens.classes.overlay, _Popup.popupClasses.root, _Popup.popupClasses.root, function(param) {
|
|
105
112
|
var width = param.width;
|
|
106
113
|
return width || 'auto';
|
|
107
114
|
}, function(param) {
|
|
108
115
|
var height = param.height;
|
|
109
116
|
return height || 'auto';
|
|
110
|
-
}, getAnimationStyles())
|
|
117
|
+
}, getAnimationStyles(), _Drawertokens.classes.enterCustomAnimation, _Popup.popupClasses.root, function(param) {
|
|
118
|
+
var drawerAnimationInfo = param.drawerAnimationInfo;
|
|
119
|
+
return (drawerAnimationInfo === null || drawerAnimationInfo === void 0 ? void 0 : drawerAnimationInfo.enter) || "var(".concat(_Drawertokens.privateTokens.enterAnimation, ")");
|
|
120
|
+
}, _Drawertokens.classes.exitCustomAnimation, _Popup.popupClasses.endAnimation, _Popup.popupClasses.root, function(param) {
|
|
121
|
+
var drawerAnimationInfo = param.drawerAnimationInfo;
|
|
122
|
+
return (drawerAnimationInfo === null || drawerAnimationInfo === void 0 ? void 0 : drawerAnimationInfo.exit) || "var(".concat(_Drawertokens.privateTokens.exitAnimation, ")");
|
|
123
|
+
});
|
|
@@ -12,6 +12,9 @@ _export(exports, {
|
|
|
12
12
|
get classes () {
|
|
13
13
|
return classes;
|
|
14
14
|
},
|
|
15
|
+
get privateTokens () {
|
|
16
|
+
return privateTokens;
|
|
17
|
+
},
|
|
15
18
|
get tokens () {
|
|
16
19
|
return tokens;
|
|
17
20
|
}
|
|
@@ -21,6 +24,9 @@ var classes = {
|
|
|
21
24
|
header: 'drawer-header',
|
|
22
25
|
footer: 'drawer-footer',
|
|
23
26
|
overlay: 'drawer-overlay',
|
|
27
|
+
panel: 'drawer-panel',
|
|
28
|
+
enterCustomAnimation: 'drawer-enter-custom-animation',
|
|
29
|
+
exitCustomAnimation: 'drawer-exit-custom-animation',
|
|
24
30
|
horizontal: 'drawer-horizontal',
|
|
25
31
|
hasHeader: 'drawer-has-header',
|
|
26
32
|
isRightClose: 'drawer-right-close-button',
|
|
@@ -29,6 +35,12 @@ var classes = {
|
|
|
29
35
|
rightPlacement: 'drawer-right-placement',
|
|
30
36
|
leftPlacement: 'drawer-left-placement'
|
|
31
37
|
};
|
|
38
|
+
var privateTokens = {
|
|
39
|
+
enterAnimation: '--plasma__private-drawer-enter-animation',
|
|
40
|
+
exitAnimation: '--plasma__private-drawer-exit-animation',
|
|
41
|
+
customEnterAnimation: '--plasma__private-drawer-custom-enter-animation',
|
|
42
|
+
customExitAnimation: '--plasma__private-drawer-custom-exit-animation'
|
|
43
|
+
};
|
|
32
44
|
var tokens = {
|
|
33
45
|
drawerOverlayWithBlurColor: '--plasma-drawer-overlay-with-blur-color',
|
|
34
46
|
drawerOverlayColor: '--plasma-drawer-overlay-color',
|
|
@@ -19,6 +19,7 @@ _export(exports, {
|
|
|
19
19
|
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
var _mixins = require("../../../mixins");
|
|
21
21
|
var _base = require("./variations/_size/base");
|
|
22
|
+
var _base1 = require("./variations/_view/base");
|
|
22
23
|
var _LineSkeletonstyles = require("./LineSkeleton.styles");
|
|
23
24
|
function _define_property(obj, key, value) {
|
|
24
25
|
if (key in obj) {
|
|
@@ -118,22 +119,24 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
118
119
|
}
|
|
119
120
|
var lineSkeletonRoot = function(Root) {
|
|
120
121
|
return /*#__PURE__*/ (0, _react.forwardRef)(function(_param, outerRootRef) {
|
|
121
|
-
var size = _param.size, lighter = _param.lighter, customGradientColor = _param.customGradientColor, _param_roundness = _param.roundness, roundness = _param_roundness === void 0 ? '16' : _param_roundness, rest = _object_without_properties(_param, [
|
|
122
|
+
var size = _param.size, lighter = _param.lighter, customGradientColor = _param.customGradientColor, _param_roundness = _param.roundness, roundness = _param_roundness === void 0 ? '16' : _param_roundness, view = _param.view, rest = _object_without_properties(_param, [
|
|
122
123
|
"size",
|
|
123
124
|
"lighter",
|
|
124
125
|
"customGradientColor",
|
|
125
|
-
"roundness"
|
|
126
|
+
"roundness",
|
|
127
|
+
"view"
|
|
126
128
|
]);
|
|
127
129
|
var roundnessValue = (0, _mixins.getRoundness)({
|
|
128
130
|
roundness: roundness
|
|
129
131
|
});
|
|
130
|
-
var skeletonGradientColor = (0, _mixins.getSkeletonColor)({
|
|
132
|
+
var skeletonGradientColor = lighter ? (0, _mixins.getSkeletonColor)({
|
|
131
133
|
lighter: lighter,
|
|
132
134
|
customGradientColor: customGradientColor
|
|
133
|
-
});
|
|
135
|
+
}) : undefined;
|
|
134
136
|
return /*#__PURE__*/ _react.default.createElement(Root, _object_spread({
|
|
135
137
|
ref: outerRootRef,
|
|
136
|
-
size: size
|
|
138
|
+
size: size,
|
|
139
|
+
view: view
|
|
137
140
|
}, rest), /*#__PURE__*/ _react.default.createElement(_LineSkeletonstyles.StyledVisibleLine, {
|
|
138
141
|
roundness: roundnessValue,
|
|
139
142
|
gradientColor: skeletonGradientColor
|
|
@@ -148,6 +151,9 @@ var lineSkeletonConfig = {
|
|
|
148
151
|
variations: {
|
|
149
152
|
size: {
|
|
150
153
|
css: _base.base
|
|
154
|
+
},
|
|
155
|
+
view: {
|
|
156
|
+
css: _base1.base
|
|
151
157
|
}
|
|
152
158
|
},
|
|
153
159
|
defaults: {}
|
|
@@ -18,6 +18,7 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
|
|
20
20
|
var _mixins = require("../../../mixins");
|
|
21
|
+
var _tokens = require("../tokens");
|
|
21
22
|
function _getRequireWildcardCache(nodeInterop) {
|
|
22
23
|
if (typeof WeakMap !== "function") return null;
|
|
23
24
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -64,7 +65,7 @@ var base = (0, _styledcomponents.css)([
|
|
|
64
65
|
]);
|
|
65
66
|
var StyledVisibleLine = _styledcomponents.default.div.withConfig({
|
|
66
67
|
displayName: "LineSkeleton.styles__StyledVisibleLine",
|
|
67
|
-
componentId: "sc-
|
|
68
|
+
componentId: "sc-e66a9562-0"
|
|
68
69
|
})([
|
|
69
70
|
"position:relative;overflow:hidden;width:100%;--plasma_private-line-skeleton-roundness:",
|
|
70
71
|
";",
|
|
@@ -76,5 +77,5 @@ var StyledVisibleLine = _styledcomponents.default.div.withConfig({
|
|
|
76
77
|
return roundness;
|
|
77
78
|
}, (0, _mixins.applyRoundness)('var(--plasma_private-line-skeleton-roundness)'), function(param) {
|
|
78
79
|
var gradientColor = param.gradientColor;
|
|
79
|
-
return gradientColor;
|
|
80
|
+
return gradientColor || "var(".concat(_tokens.tokens.gradientColor, ")");
|
|
80
81
|
}, (0, _mixins.applySkeletonGradient)('var(--plasma_private-line-skeleton-gradient)'));
|
|
@@ -9,11 +9,6 @@ Object.defineProperty(exports, "base", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _styledcomponents = require("styled-components");
|
|
12
|
-
var _LineSkeletonstyles = require("../../LineSkeleton.styles");
|
|
13
|
-
var _tokens = require("../../../tokens");
|
|
14
12
|
var base = (0, _styledcomponents.css)([
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"{height:var(",
|
|
18
|
-
");}"
|
|
19
|
-
], _tokens.tokens.lineHeight, _LineSkeletonstyles.StyledVisibleLine, _tokens.tokens.visibleLineHeight);
|
|
13
|
+
""
|
|
14
|
+
]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "base", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return base;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _styledcomponents = require("styled-components");
|
|
12
|
+
var _LineSkeletonstyles = require("../../LineSkeleton.styles");
|
|
13
|
+
var _tokens = require("../../../tokens");
|
|
14
|
+
var base = (0, _styledcomponents.css)([
|
|
15
|
+
"height:var(",
|
|
16
|
+
");& ",
|
|
17
|
+
"{height:var(",
|
|
18
|
+
");}"
|
|
19
|
+
], _tokens.tokens.lineHeight, _LineSkeletonstyles.StyledVisibleLine, _tokens.tokens.visibleLineHeight);
|
|
@@ -195,13 +195,14 @@ var variousWidth = [
|
|
|
195
195
|
];
|
|
196
196
|
var textSkeleton = function(Component) {
|
|
197
197
|
return function(_param) {
|
|
198
|
-
var lines = _param.lines, width = _param.width, roundness = _param.roundness, customGradientColor = _param.customGradientColor, lighter = _param.lighter, _param_size = _param.size, size = _param_size === void 0 ? 'bodyM' : _param_size, props = _object_without_properties(_param, [
|
|
198
|
+
var lines = _param.lines, width = _param.width, roundness = _param.roundness, customGradientColor = _param.customGradientColor, lighter = _param.lighter, _param_size = _param.size, size = _param_size === void 0 ? 'bodyM' : _param_size, _param_view = _param.view, view = _param_view === void 0 ? 'default' : _param_view, props = _object_without_properties(_param, [
|
|
199
199
|
"lines",
|
|
200
200
|
"width",
|
|
201
201
|
"roundness",
|
|
202
202
|
"customGradientColor",
|
|
203
203
|
"lighter",
|
|
204
|
-
"size"
|
|
204
|
+
"size",
|
|
205
|
+
"view"
|
|
205
206
|
]);
|
|
206
207
|
var _useState = _sliced_to_array((0, _react.useState)(null), 2), fixedWidth = _useState[0], setFixedWidth = _useState[1];
|
|
207
208
|
var _useState1 = _sliced_to_array((0, _react.useState)([]), 2), linesWidth = _useState1[0], setLinesWidth = _useState1[1];
|
|
@@ -239,6 +240,7 @@ var textSkeleton = function(Component) {
|
|
|
239
240
|
return /*#__PURE__*/ _react.default.createElement(ComponentSkeleton, {
|
|
240
241
|
key: "line:".concat(i),
|
|
241
242
|
size: size,
|
|
243
|
+
view: view,
|
|
242
244
|
roundness: roundness,
|
|
243
245
|
customGradientColor: customGradientColor,
|
|
244
246
|
lighter: lighter,
|
|
@@ -10,5 +10,6 @@ Object.defineProperty(exports, "tokens", {
|
|
|
10
10
|
});
|
|
11
11
|
var tokens = {
|
|
12
12
|
lineHeight: '--plasma-skeleton-line-height',
|
|
13
|
-
visibleLineHeight: '--plasma-skeleton-visible-line-height'
|
|
13
|
+
visibleLineHeight: '--plasma-skeleton-visible-line-height',
|
|
14
|
+
gradientColor: '--plasma-skeleton-gradient-color'
|
|
14
15
|
};
|