@salutejs/plasma-new-hope 0.94.0-canary.1253.9693605980.0 → 0.94.0-canary.1272.9712079341.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/Combobox.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
- package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
- package/cjs/components/Drawer/Drawer.js +1 -1
- package/cjs/components/Drawer/hooks/useDrawer.js +3 -1
- package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.js +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/cjs/components/Modal/hooks/useModal.js +3 -1
- package/cjs/components/Modal/hooks/useModal.js.map +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/cjs/components/Popover/Popover.js +9 -3
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/components/Popup/Popup.js +9 -3
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Portal/Portal.js +37 -0
- package/cjs/components/Portal/Portal.js.map +1 -0
- package/cjs/components/Range/Range.css +6 -6
- package/cjs/components/Select/Select.js +1 -1
- package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
- package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
- package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
- package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/cjs/components/Slider/Slider.css +6 -6
- package/cjs/components/Slider/components/Double/Double.css +6 -6
- package/cjs/components/TextField/TextField.styles.js +1 -1
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/{TextField.styles_9fkr1l.css → TextField.styles_aqmut.css} +2 -2
- package/cjs/index.css +6 -6
- package/cjs/index.js +3 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Combobox/Combobox.js +1 -1
- package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +1 -1
- package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +1 -1
- package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +1 -1
- package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +1 -1
- package/es/components/Drawer/Drawer.js +1 -1
- package/es/components/Drawer/hooks/useDrawer.js +3 -1
- package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/es/components/Dropdown/Dropdown.js +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
- package/es/components/Modal/hooks/useModal.js +3 -1
- package/es/components/Modal/hooks/useModal.js.map +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
- package/es/components/Popover/Popover.js +9 -3
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/components/Popup/Popup.js +9 -3
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Portal/Portal.js +32 -0
- package/es/components/Portal/Portal.js.map +1 -0
- package/es/components/Range/Range.css +6 -6
- package/es/components/Select/Select.js +1 -1
- package/es/components/Select/ui/SelectDivider/SelectDivider.js +1 -1
- package/es/components/Select/ui/SelectFooter/SelectFooter.js +1 -1
- package/es/components/Select/ui/SelectGroup/SelectGroup.js +1 -1
- package/es/components/Select/ui/SelectHeader/SelectHeader.js +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.js +1 -1
- package/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
- package/es/components/Slider/Slider.css +6 -6
- package/es/components/Slider/components/Double/Double.css +6 -6
- package/es/components/TextField/TextField.styles.js +1 -1
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/{TextField.styles_9fkr1l.css → TextField.styles_aqmut.css} +2 -2
- package/es/index.css +6 -6
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Popover/Popover.js +8 -4
- package/styled-components/cjs/components/Popup/Popup.js +8 -4
- package/styled-components/cjs/components/Portal/Portal.js +38 -0
- package/styled-components/cjs/components/Portal/Portal.template-doc.mdx +66 -0
- package/styled-components/cjs/components/Portal/Portal.types.js +5 -0
- package/styled-components/cjs/components/Portal/index.js +18 -0
- package/styled-components/cjs/components/TextField/TextField.styles.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Portal/Portal.js +10 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Portal/Portal.stories.tsx +57 -0
- package/styled-components/cjs/examples/plasma_web/components/Portal/Portal.js +10 -0
- package/styled-components/cjs/examples/plasma_web/components/Portal/Portal.stories.tsx +57 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Popover/Popover.js +8 -3
- package/styled-components/es/components/Popup/Popup.js +8 -3
- package/styled-components/es/components/Portal/Portal.js +28 -0
- package/styled-components/es/components/Portal/Portal.template-doc.mdx +66 -0
- package/styled-components/es/components/Portal/Portal.types.js +1 -0
- package/styled-components/es/components/Portal/index.js +1 -0
- package/styled-components/es/components/TextField/TextField.styles.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Portal/Portal.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/Portal/Portal.stories.tsx +57 -0
- package/styled-components/es/examples/plasma_web/components/Portal/Portal.js +4 -0
- package/styled-components/es/examples/plasma_web/components/Portal/Portal.stories.tsx +57 -0
- package/styled-components/es/index.js +2 -1
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Portal/Portal.d.ts +13 -0
- package/types/components/Portal/Portal.d.ts.map +1 -0
- package/types/components/Portal/Portal.types.d.ts +18 -0
- package/types/components/Portal/Portal.types.d.ts.map +1 -0
- package/types/components/Portal/index.d.ts +3 -0
- package/types/components/Portal/index.d.ts.map +1 -0
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Portal/Portal.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Portal/Portal.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Portal/Portal.d.ts +3 -0
- package/types/examples/plasma_web/components/Portal/Portal.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Popup.js","sources":["../../../src/components/Popup/Popup.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport { useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines/types';\nimport { cx } from '../../utils';\n\nimport type { PopupPlacementBasic, PopupPlacement, PopupPositionType, PopupProps } from './Popup.types';\nimport { POPUP_PORTAL_ID } from './PopupContext';\nimport { PopupRoot } from './PopupRoot';\nimport { usePopup } from './hooks';\nimport { classes } from './Popup.tokens';\n\nexport const handlePosition = (\n placement: PopupPlacement,\n offset: [number, number] | [string, string],\n): PopupPositionType => {\n let x = '0rem';\n let y = '0rem';\n\n if (offset) {\n const [_x, _y] = offset;\n x = typeof _x === 'number' ? `${_x}rem` : _x;\n y = typeof _y === 'number' ? `${_y}rem` : _y;\n }\n\n if (!placement || placement === 'center') {\n return {\n left: `calc(50% + ${x})`,\n top: `calc(50% - ${y})`,\n transform: 'translate(-50%, -50%)',\n };\n }\n\n let left;\n let right;\n let top;\n let bottom;\n let transform;\n const placements = placement.split('-') as PopupPlacementBasic[];\n\n placements.forEach((placement: PopupPlacementBasic) => {\n switch (placement) {\n case 'left':\n left = x;\n break;\n case 'right':\n right = x;\n break;\n case 'top':\n top = y;\n break;\n case 'bottom':\n bottom = y;\n break;\n default:\n break;\n }\n });\n\n const isCenteredX = left === undefined && right === undefined;\n const isCenteredY = top === undefined && bottom === undefined;\n\n if (isCenteredX) {\n transform = 'translateX(-50%)';\n }\n\n if (isCenteredY) {\n transform = 'translateY(-50%)';\n }\n\n return {\n left: isCenteredX ? `calc(50% + ${x})` : left,\n right,\n top: isCenteredY ? `calc(50% - ${y})` : top,\n bottom,\n transform,\n };\n};\n\n/**\n * Базовый копмонент Popup.\n */\nexport const popupRoot = (Root: RootProps<HTMLDivElement, PopupProps>) =>\n forwardRef<HTMLDivElement, PopupProps>(\n (\n {\n id,\n isOpen = false,\n placement = 'center',\n offset = [0, 0],\n frame = 'document',\n children,\n overlay,\n role,\n zIndex,\n popupInfo,\n withAnimation = false,\n className,\n ...rest\n },\n outerRootRef,\n ) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const { isVisible, animationInfo, setVisible } = usePopup({\n isOpen,\n id: innerId,\n popupInfo,\n withAnimation,\n });\n\n const portalRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const innerRef = useForkRef<HTMLDivElement>(contentRef, outerRootRef);\n\n const [, forceRender] = useState(false);\n\n useEffect(() => {\n let portal = document.getElementById(POPUP_PORTAL_ID);\n\n if (typeof frame !== 'string' && frame && frame.current) {\n portal = frame.current;\n }\n\n if (!portal) {\n portal = document.createElement('div');\n portal.setAttribute('id', POPUP_PORTAL_ID);\n /**\n * Нужно для того, чтобы во фрейме не происходило скачков контента\n * при анимации через transform, если есть элемент с шириной/высотой в 100% (Overlay)\n */\n portal.style.width = '0';\n\n if (typeof frame === 'string' && frame !== 'document') {\n document.getElementById(frame)?.appendChild(portal);\n } else {\n document.body.appendChild(portal);\n }\n }\n\n portalRef.current = portal;\n\n /**\n * Изменение стейта нужно для того, чтобы Popup\n * отобразился после записи DOM элемента в portalRef.current\n */\n forceRender(true);\n }, []);\n\n if (!isVisible && !isOpen) {\n return null;\n }\n\n const cls = cx(\n className,\n animationInfo?.endAnimation ? classes.endAnimation : '',\n animationInfo?.endTransition ? classes.endTransition : '',\n );\n\n return (\n <>\n {portalRef.current &&\n ReactDOM.createPortal(\n <Root className={cls} {...rest}>\n {overlay}\n <PopupRoot\n id={innerId}\n ref={innerRef}\n position={handlePosition(placement, offset)}\n frame={frame}\n zIndex={zIndex}\n animationInfo={animationInfo}\n setVisible={setVisible}\n >\n {children}\n </PopupRoot>\n </Root>,\n portalRef.current,\n )}\n </>\n );\n },\n );\n\nexport const popupConfig = {\n name: 'Popup',\n tag: 'div',\n layout: popupRoot,\n base: '',\n variations: {},\n defaults: {},\n};\n"],"names":["handlePosition","placement","offset","x","y","_offset","_slicedToArray","_x","_y","concat","left","top","transform","right","bottom","placements","split","forEach","isCenteredX","undefined","isCenteredY","popupRoot","Root","forwardRef","_ref","outerRootRef","id","_ref$isOpen","isOpen","_ref$placement","_ref$offset","_ref$frame","frame","children","overlay","zIndex","popupInfo","_ref$withAnimation","withAnimation","className","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","_usePopup","usePopup","isVisible","animationInfo","setVisible","portalRef","useRef","contentRef","innerRef","useForkRef","_useState","useState","_useState2","forceRender","useEffect","portal","document","getElementById","POPUP_PORTAL_ID","current","createElement","setAttribute","style","width","_document$getElementB","appendChild","body","cls","cx","endAnimation","classes","endTransition","React","Fragment","ReactDOM","createPortal","_extends","PopupRoot","ref","position","popupConfig","name","tag","layout","base","variations","defaults"],"mappings":";;;;;;;;;;;AAaO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CACvBC,SAAyB,EACzBC,MAA2C,EACvB;EACpB,IAAIC,CAAC,GAAG,MAAM,CAAA;EACd,IAAIC,CAAC,GAAG,MAAM,CAAA;AAEd,EAAA,IAAIF,MAAM,EAAE;AACR,IAAA,IAAAG,OAAA,GAAAC,cAAA,CAAiBJ,MAAM,EAAA,CAAA,CAAA;AAAhBK,MAAAA,EAAE,GAAAF,OAAA,CAAA,CAAA,CAAA;AAAEG,MAAAA,EAAE,GA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;"}
|
1
|
+
{"version":3,"file":"Popup.js","sources":["../../../src/components/Popup/Popup.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines/types';\nimport { cx } from '../../utils';\nimport { portalConfig } from '../Portal';\nimport { component, mergeConfig } from '../../engines';\n\nimport type { PopupPlacementBasic, PopupPlacement, PopupPositionType, PopupProps } from './Popup.types';\nimport { POPUP_PORTAL_ID } from './PopupContext';\nimport { PopupRoot } from './PopupRoot';\nimport { usePopup } from './hooks';\nimport { classes } from './Popup.tokens';\n\nexport const handlePosition = (\n placement: PopupPlacement,\n offset: [number, number] | [string, string],\n): PopupPositionType => {\n let x = '0rem';\n let y = '0rem';\n\n if (offset) {\n const [_x, _y] = offset;\n x = typeof _x === 'number' ? `${_x}rem` : _x;\n y = typeof _y === 'number' ? `${_y}rem` : _y;\n }\n\n if (!placement || placement === 'center') {\n return {\n left: `calc(50% + ${x})`,\n top: `calc(50% - ${y})`,\n transform: 'translate(-50%, -50%)',\n };\n }\n\n let left;\n let right;\n let top;\n let bottom;\n let transform;\n const placements = placement.split('-') as PopupPlacementBasic[];\n\n placements.forEach((placement: PopupPlacementBasic) => {\n switch (placement) {\n case 'left':\n left = x;\n break;\n case 'right':\n right = x;\n break;\n case 'top':\n top = y;\n break;\n case 'bottom':\n bottom = y;\n break;\n default:\n break;\n }\n });\n\n const isCenteredX = left === undefined && right === undefined;\n const isCenteredY = top === undefined && bottom === undefined;\n\n if (isCenteredX) {\n transform = 'translateX(-50%)';\n }\n\n if (isCenteredY) {\n transform = 'translateY(-50%)';\n }\n\n return {\n left: isCenteredX ? `calc(50% + ${x})` : left,\n right,\n top: isCenteredY ? `calc(50% - ${y})` : top,\n bottom,\n transform,\n };\n};\n\nconst mergedPortalConfig = mergeConfig(portalConfig);\nconst Portal = component(mergedPortalConfig);\n\n/**\n * Базовый копмонент Popup.\n */\nexport const popupRoot = (Root: RootProps<HTMLDivElement, PopupProps>) =>\n forwardRef<HTMLDivElement, PopupProps>(\n (\n {\n id,\n isOpen = false,\n placement = 'center',\n offset = [0, 0],\n frame = 'document',\n children,\n overlay,\n role,\n zIndex,\n popupInfo,\n withAnimation = false,\n className,\n ...rest\n },\n outerRootRef,\n ) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const { isVisible, animationInfo, setVisible } = usePopup({\n isOpen,\n id: innerId,\n popupInfo,\n withAnimation,\n });\n\n const portalRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const innerRef = useForkRef<HTMLDivElement>(contentRef, outerRootRef);\n\n const [, forceRender] = useState(false);\n\n useEffect(() => {\n let portal = document.getElementById(POPUP_PORTAL_ID);\n\n if (typeof frame !== 'string' && frame && frame.current) {\n portal = frame.current;\n }\n\n if (!portal) {\n portal = document.createElement('div');\n portal.setAttribute('id', POPUP_PORTAL_ID);\n /**\n * Нужно для того, чтобы во фрейме не происходило скачков контента\n * при анимации через transform, если есть элемент с шириной/высотой в 100% (Overlay)\n */\n portal.style.width = '0';\n\n if (typeof frame === 'string' && frame !== 'document') {\n document.getElementById(frame)?.appendChild(portal);\n } else {\n document.body.appendChild(portal);\n }\n }\n\n portalRef.current = portal;\n\n /**\n * Изменение стейта нужно для того, чтобы Popup\n * отобразился после записи DOM элемента в portalRef.current\n */\n forceRender(true);\n }, []);\n\n if (!isVisible && !isOpen) {\n return null;\n }\n\n const cls = cx(\n className,\n animationInfo?.endAnimation ? classes.endAnimation : '',\n animationInfo?.endTransition ? classes.endTransition : '',\n );\n\n return (\n <>\n {portalRef.current && (\n <Portal container={portalRef.current}>\n <Root className={cls} {...rest}>\n {overlay}\n <PopupRoot\n id={innerId}\n ref={innerRef}\n position={handlePosition(placement, offset)}\n frame={frame}\n zIndex={zIndex}\n animationInfo={animationInfo}\n setVisible={setVisible}\n >\n {children}\n </PopupRoot>\n </Root>\n </Portal>\n )}\n </>\n );\n },\n );\n\nexport const popupConfig = {\n name: 'Popup',\n tag: 'div',\n layout: popupRoot,\n base: '',\n variations: {},\n defaults: {},\n};\n"],"names":["handlePosition","placement","offset","x","y","_offset","_slicedToArray","_x","_y","concat","left","top","transform","right","bottom","placements","split","forEach","isCenteredX","undefined","isCenteredY","mergedPortalConfig","mergeConfig","portalConfig","Portal","component","popupRoot","Root","forwardRef","_ref","outerRootRef","id","_ref$isOpen","isOpen","_ref$placement","_ref$offset","_ref$frame","frame","children","overlay","zIndex","popupInfo","_ref$withAnimation","withAnimation","className","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","_usePopup","usePopup","isVisible","animationInfo","setVisible","portalRef","useRef","contentRef","innerRef","useForkRef","_useState","useState","_useState2","forceRender","useEffect","portal","document","getElementById","POPUP_PORTAL_ID","current","createElement","setAttribute","style","width","_document$getElementB","appendChild","body","cls","cx","endAnimation","classes","endTransition","React","Fragment","container","_extends","PopupRoot","ref","position","popupConfig","name","tag","layout","base","variations","defaults"],"mappings":";;;;;;;;;;;;;AAcO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CACvBC,SAAyB,EACzBC,MAA2C,EACvB;EACpB,IAAIC,CAAC,GAAG,MAAM,CAAA;EACd,IAAIC,CAAC,GAAG,MAAM,CAAA;AAEd,EAAA,IAAIF,MAAM,EAAE;AACR,IAAA,IAAAG,OAAA,GAAAC,cAAA,CAAiBJ,MAAM,EAAA,CAAA,CAAA;AAAhBK,MAAAA,EAAE,GAAAF,OAAA,CAAA,CAAA,CAAA;AAAEG,MAAAA,EAAE,GAAAH,OAAA,CAAA,CAAA,CAAA,CAAA;IACbF,CAAC,GAAG,OAAOI,EAAE,KAAK,QAAQ,MAAAE,MAAA,CAAMF,EAAE,EAAA,KAAA,CAAA,GAAQA,EAAE,CAAA;IAC5CH,CAAC,GAAG,OAAOI,EAAE,KAAK,QAAQ,MAAAC,MAAA,CAAMD,EAAE,EAAA,KAAA,CAAA,GAAQA,EAAE,CAAA;AAChD,GA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M from 'react-dom';
|
3
|
+
|
4
|
+
/*
|
5
|
+
* Вспомогательный компонент. Используется в Popup, Popover.
|
6
|
+
* Представляет собой ReactDOM.createPortal() в форме компонента.
|
7
|
+
*/
|
8
|
+
var portalRoot = function portalRoot(Root) {
|
9
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
10
|
+
var children = _ref.children,
|
11
|
+
container = _ref.container,
|
12
|
+
_ref$disabled = _ref.disabled,
|
13
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
14
|
+
var portalContainer = typeof container === 'function' ? container() : container;
|
15
|
+
return /*#__PURE__*/React.createElement(Root, {
|
16
|
+
container: container,
|
17
|
+
disabled: disabled,
|
18
|
+
ref: outerRootRef
|
19
|
+
}, disabled && children, !disabled && /*#__PURE__*/ReactDOM.createPortal(children, portalContainer));
|
20
|
+
});
|
21
|
+
};
|
22
|
+
var portalConfig = {
|
23
|
+
name: 'Portal',
|
24
|
+
tag: 'div',
|
25
|
+
layout: portalRoot,
|
26
|
+
base: '',
|
27
|
+
variations: {},
|
28
|
+
defaults: {}
|
29
|
+
};
|
30
|
+
|
31
|
+
export { portalConfig, portalRoot };
|
32
|
+
//# sourceMappingURL=Portal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Portal.js","sources":["../../../src/components/Portal/Portal.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { RootProps } from '../../engines/types';\n\nimport { PortalProps } from './Portal.types';\n\n/*\n * Вспомогательный компонент. Используется в Popup, Popover.\n * Представляет собой ReactDOM.createPortal() в форме компонента.\n */\nexport const portalRoot = (Root: RootProps<HTMLDivElement, PortalProps>) =>\n forwardRef<HTMLDivElement, PortalProps>(({ children, container, disabled = false }, outerRootRef) => {\n const portalContainer = typeof container === 'function' ? container() : container;\n\n return (\n <Root container={container} disabled={disabled} ref={outerRootRef}>\n {disabled && children}\n {!disabled && ReactDOM.createPortal(children, portalContainer)}\n </Root>\n );\n });\n\nexport const portalConfig = {\n name: 'Portal',\n tag: 'div',\n layout: portalRoot,\n base: '',\n variations: {},\n defaults: {},\n};\n"],"names":["portalRoot","Root","forwardRef","_ref","outerRootRef","children","container","_ref$disabled","disabled","portalContainer","React","createElement","ref","ReactDOM","createPortal","portalConfig","name","tag","layout","base","variations","defaults"],"mappings":";;;AAOA;AACA;AACA;AACA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,UAAU,CAA8B,UAAAC,IAAA,EAA4CC,YAAY,EAAK;AAAA,IAAA,IAA1DC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;MAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;MAAAC,aAAA,GAAAJ,IAAA,CAAEK,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA,CAAA;IAC5E,IAAME,eAAe,GAAG,OAAOH,SAAS,KAAK,UAAU,GAAGA,SAAS,EAAE,GAAGA,SAAS,CAAA;AAEjF,IAAA,oBACII,KAAA,CAAAC,aAAA,CAACV,IAAI,EAAA;AAACK,MAAAA,SAAS,EAAEA,SAAU;AAACE,MAAAA,QAAQ,EAAEA,QAAS;AAACI,MAAAA,GAAG,EAAER,YAAAA;AAAa,KAAA,EAC7DI,QAAQ,IAAIH,QAAQ,EACpB,CAACG,QAAQ,iBAAIK,QAAQ,CAACC,YAAY,CAACT,QAAQ,EAAEI,eAAe,CAC3D,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMM,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAElB,UAAU;AAClBmB,EAAAA,IAAI,EAAE,EAAE;EACRC,UAAU,EAAE,EAAE;AACdC,EAAAA,QAAQ,EAAE,EAAC;AACf;;;;"}
|
@@ -18,13 +18,13 @@
|
|
18
18
|
|
19
19
|
.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304{color:var(--plasma-textfield-color-readonly);background-color:var(--plasma-textfield-bg-color-readonly);box-shadow:inset 0 0 0 var(--plasmas-textfield-border-width) var(--plasma-textfield-border-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304:hover{background-color:var(--plasma-textfield-bg-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-webkit-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-moz-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304:-ms-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304{color:var(--plasma-textfield-color-readonly);cursor:default;min-width:unset;}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_llv9av6__3851a304{color:var(--plasma-textfield__left-helper-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_l13qvwoy__3851a304{color:var(--plasma-textfield__label-color-readonly);}
|
20
20
|
|
21
|
-
.
|
22
|
-
.
|
23
|
-
.
|
24
|
-
.
|
21
|
+
.TextField_styles_aqmut_iq39zt5__4a8fddcd{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;}
|
22
|
+
.TextField_styles_aqmut_i1j28rg8__4a8fddcd{-webkit-flex:1;-ms-flex:1;flex:1;overflow:scroll;position:relative;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;overscroll-behavior:contain;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd::-webkit-scrollbar{display:none;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd.TextField_styles_aqmut_hasChips__4a8fddcd{height:var(--plasma-textfield__chip-height);border-radius:var(--plasma-textfield__chip-border-radius);}
|
23
|
+
.TextField_styles_aqmut_s13zudoe__4a8fddcd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
24
|
+
.TextField_styles_aqmut_io4bpie__4a8fddcd{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
25
25
|
|
26
|
-
.
|
27
|
-
.
|
26
|
+
.TextField_styles_aqmut_s19ry60d__4a8fddcd{margin:var(--plasma-textfield__left-content-margin);}
|
27
|
+
.TextField_styles_aqmut_sbt1ohz__4a8fddcd{margin:var(--plasma-textfield__right-content-margin);}
|
28
28
|
|
29
29
|
|
30
30
|
|
@@ -11,8 +11,8 @@ import { base as base$2 } from './variations/_size/base.js';
|
|
11
11
|
import '@linaria/react';
|
12
12
|
import '@linaria/core';
|
13
13
|
import 'focus-visible';
|
14
|
-
import 'react-dom';
|
15
14
|
import 'react-popper';
|
15
|
+
import 'react-dom';
|
16
16
|
import 'styled-components';
|
17
17
|
import { classes } from './Select.tokens.js';
|
18
18
|
import { SelectTarget } from './ui/SelectTarget/SelectTarget.js';
|
@@ -5,8 +5,8 @@ import '@salutejs/plasma-core';
|
|
5
5
|
import '@linaria/react';
|
6
6
|
import '@linaria/core';
|
7
7
|
import 'focus-visible';
|
8
|
-
import 'react-dom';
|
9
8
|
import 'react-popper';
|
9
|
+
import 'react-dom';
|
10
10
|
import 'styled-components';
|
11
11
|
import { base as base$1 } from './variations/_view/base.js';
|
12
12
|
import { base as base$2 } from './variations/_size/base.js';
|
@@ -5,8 +5,8 @@ import '@linaria/react';
|
|
5
5
|
import { dropdownFooterRoot } from '../../../Dropdown/ui/DropdownFooter/DropdownFooter.js';
|
6
6
|
import '@linaria/core';
|
7
7
|
import 'focus-visible';
|
8
|
-
import 'react-dom';
|
9
8
|
import 'react-popper';
|
9
|
+
import 'react-dom';
|
10
10
|
import 'styled-components';
|
11
11
|
import { base as base$1 } from './variations/_view/base.js';
|
12
12
|
import { base as base$2 } from './variations/_size/base.js';
|
@@ -5,8 +5,8 @@ import '@linaria/react';
|
|
5
5
|
import { dropdownGroupRoot } from '../../../Dropdown/ui/DropdownGroup/DropdownGroup.js';
|
6
6
|
import '@linaria/core';
|
7
7
|
import 'focus-visible';
|
8
|
-
import 'react-dom';
|
9
8
|
import 'react-popper';
|
9
|
+
import 'react-dom';
|
10
10
|
import 'styled-components';
|
11
11
|
import { base as base$1 } from './variations/_view/base.js';
|
12
12
|
import { base as base$2 } from './variations/_size/base.js';
|
@@ -5,8 +5,8 @@ import '@linaria/react';
|
|
5
5
|
import { dropdownHeaderRoot } from '../../../Dropdown/ui/DropdownHeader/DropdownHeader.js';
|
6
6
|
import '@linaria/core';
|
7
7
|
import 'focus-visible';
|
8
|
-
import 'react-dom';
|
9
8
|
import 'react-popper';
|
9
|
+
import 'react-dom';
|
10
10
|
import 'styled-components';
|
11
11
|
import { base as base$1 } from './variations/_view/base.js';
|
12
12
|
import { base as base$2 } from './variations/_size/base.js';
|
@@ -4,8 +4,8 @@ import '@salutejs/plasma-core';
|
|
4
4
|
import '@linaria/react';
|
5
5
|
import '@linaria/core';
|
6
6
|
import 'focus-visible';
|
7
|
-
import 'react-dom';
|
8
7
|
import 'react-popper';
|
8
|
+
import 'react-dom';
|
9
9
|
import { dropdownItemOldRoot } from '../../../Dropdown/ui/DropdownItemOld/DropdownItemOld.js';
|
10
10
|
import { base as base$1 } from './variations/_view/base.js';
|
11
11
|
import { base as base$2 } from './variations/_size/base.js';
|
@@ -27,13 +27,13 @@
|
|
27
27
|
|
28
28
|
.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304{color:var(--plasma-textfield-color-readonly);background-color:var(--plasma-textfield-bg-color-readonly);box-shadow:inset 0 0 0 var(--plasmas-textfield-border-width) var(--plasma-textfield-border-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304:hover{background-color:var(--plasma-textfield-bg-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-webkit-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-moz-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304:-ms-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304{color:var(--plasma-textfield-color-readonly);cursor:default;min-width:unset;}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_llv9av6__3851a304{color:var(--plasma-textfield__left-helper-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_l13qvwoy__3851a304{color:var(--plasma-textfield__label-color-readonly);}
|
29
29
|
|
30
|
-
.
|
31
|
-
.
|
32
|
-
.
|
33
|
-
.
|
30
|
+
.TextField_styles_aqmut_iq39zt5__4a8fddcd{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;}
|
31
|
+
.TextField_styles_aqmut_i1j28rg8__4a8fddcd{-webkit-flex:1;-ms-flex:1;flex:1;overflow:scroll;position:relative;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;overscroll-behavior:contain;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd::-webkit-scrollbar{display:none;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd.TextField_styles_aqmut_hasChips__4a8fddcd{height:var(--plasma-textfield__chip-height);border-radius:var(--plasma-textfield__chip-border-radius);}
|
32
|
+
.TextField_styles_aqmut_s13zudoe__4a8fddcd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
33
|
+
.TextField_styles_aqmut_io4bpie__4a8fddcd{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
34
34
|
|
35
|
-
.
|
36
|
-
.
|
35
|
+
.TextField_styles_aqmut_s19ry60d__4a8fddcd{margin:var(--plasma-textfield__left-content-margin);}
|
36
|
+
.TextField_styles_aqmut_sbt1ohz__4a8fddcd{margin:var(--plasma-textfield__right-content-margin);}
|
37
37
|
|
38
38
|
|
39
39
|
|
@@ -20,13 +20,13 @@
|
|
20
20
|
|
21
21
|
.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304{color:var(--plasma-textfield-color-readonly);background-color:var(--plasma-textfield-bg-color-readonly);box-shadow:inset 0 0 0 var(--plasmas-textfield-border-width) var(--plasma-textfield-border-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304:hover{background-color:var(--plasma-textfield-bg-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-webkit-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-moz-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304:-ms-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304{color:var(--plasma-textfield-color-readonly);cursor:default;min-width:unset;}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_llv9av6__3851a304{color:var(--plasma-textfield__left-helper-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_l13qvwoy__3851a304{color:var(--plasma-textfield__label-color-readonly);}
|
22
22
|
|
23
|
-
.
|
24
|
-
.
|
25
|
-
.
|
26
|
-
.
|
23
|
+
.TextField_styles_aqmut_iq39zt5__4a8fddcd{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;}
|
24
|
+
.TextField_styles_aqmut_i1j28rg8__4a8fddcd{-webkit-flex:1;-ms-flex:1;flex:1;overflow:scroll;position:relative;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;overscroll-behavior:contain;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd::-webkit-scrollbar{display:none;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd.TextField_styles_aqmut_hasChips__4a8fddcd{height:var(--plasma-textfield__chip-height);border-radius:var(--plasma-textfield__chip-border-radius);}
|
25
|
+
.TextField_styles_aqmut_s13zudoe__4a8fddcd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
26
|
+
.TextField_styles_aqmut_io4bpie__4a8fddcd{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
27
27
|
|
28
|
-
.
|
29
|
-
.
|
28
|
+
.TextField_styles_aqmut_s19ry60d__4a8fddcd{margin:var(--plasma-textfield__left-content-margin);}
|
29
|
+
.TextField_styles_aqmut_sbt1ohz__4a8fddcd{margin:var(--plasma-textfield__right-content-margin);}
|
30
30
|
|
31
31
|
|
32
32
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextField.styles.js","sources":["../../../src/components/TextField/TextField.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from './TextField.tokens';\n\nexport const InputWrapper = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n`;\n\nexport const InputLabelWrapper = styled.div`\n flex: 1;\n overflow: scroll;\n position: relative;\n width: 100%;\n display: inline-flex;\n align-items: center;\n\n ::-webkit-scrollbar {\n display: none;\n }\n\n scrollbar-width: none;\n\n overscroll-behavior: contain;\n\n &.${String(classes.hasChips)} {\n height: var(${tokens.chipHeight});\n border-radius: var(${tokens.chipBorderRadius});\n }\n`;\n\nexport const StyledChips = styled.div`\n display: flex;\n gap: var(${tokens.chipGap});\n margin-right: var(${tokens.chipGap});\n user-select: none;\n`;\n\nexport const Input = styled.input`\n box-sizing: border-box;\n appearance: none;\n border: 0;\n padding: 0;\n background-color: transparent;\n outline: none;\n flex: 1;\n min-width: 60%;\n`;\n\nexport const Label = styled.label``;\n\nexport const StyledContentLeft = styled.div`\n margin: var(${tokens.leftContentMargin});\n
|
1
|
+
{"version":3,"file":"TextField.styles.js","sources":["../../../src/components/TextField/TextField.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from './TextField.tokens';\n\nexport const InputWrapper = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n`;\n\nexport const InputLabelWrapper = styled.div`\n flex: 1;\n overflow: scroll;\n position: relative;\n width: 100%;\n display: inline-flex;\n align-items: center;\n\n ::-webkit-scrollbar {\n display: none;\n }\n\n scrollbar-width: none;\n\n overscroll-behavior: contain;\n\n &.${String(classes.hasChips)} {\n height: var(${tokens.chipHeight});\n border-radius: var(${tokens.chipBorderRadius});\n }\n`;\n\nexport const StyledChips = styled.div`\n display: flex;\n gap: var(${tokens.chipGap});\n margin-right: var(${tokens.chipGap});\n user-select: none;\n`;\n\nexport const Input = styled.input`\n box-sizing: border-box;\n appearance: none;\n border: 0;\n padding: 0;\n background-color: transparent;\n outline: none;\n flex: 1;\n min-width: 60%;\n`;\n\nexport const Label = styled.label``;\n\nexport const StyledContentLeft = styled.div`\n margin: var(${tokens.leftContentMargin});\n`;\n\nexport const StyledContentRight = styled.div`\n margin: var(${tokens.rightContentMargin});\n`;\n\nexport const LeftHelper = styled.div``;\n\nexport const StyledTextBefore = styled.div``;\n\nexport const StyledTextAfter = styled.div``;\n"],"names":["InputWrapper","styled","name","class","propsAsIs","InputLabelWrapper","StyledChips","Input","Label","StyledContentLeft","StyledContentRight","LeftHelper","StyledTextBefore","StyledTextAfter"],"mappings":";;AAIO,IAAMA,YAAY,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,cAAA;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AAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAM,EAAA;AAE/B,IAAMQ,gBAAgB,gBAAGX,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,kBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAM,EAAA;AAErC,IAAMS,eAAe,gBAAGZ,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,iBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAAM;;;;"}
|
@@ -3,8 +3,8 @@
|
|
3
3
|
.s13zudoe{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
4
4
|
.io4bpie{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
5
5
|
|
6
|
-
.s19ry60d{margin:var(--plasma-textfield__left-content-margin);
|
7
|
-
.sbt1ohz{margin:var(--plasma-textfield__right-content-margin);
|
6
|
+
.s19ry60d{margin:var(--plasma-textfield__left-content-margin);}
|
7
|
+
.sbt1ohz{margin:var(--plasma-textfield__right-content-margin);}
|
8
8
|
|
9
9
|
|
10
10
|
|
package/es/index.css
CHANGED
@@ -128,13 +128,13 @@
|
|
128
128
|
|
129
129
|
.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304{color:var(--plasma-textfield-color-readonly);background-color:var(--plasma-textfield-bg-color-readonly);box-shadow:inset 0 0 0 var(--plasmas-textfield-border-width) var(--plasma-textfield-border-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_iq39zt5__3851a304:hover{background-color:var(--plasma-textfield-bg-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-webkit-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::-moz-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304:-ms-input-placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304::placeholder{color:var(--plasma-textfield__placeholder-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_io4bpie__3851a304{color:var(--plasma-textfield-color-readonly);cursor:default;min-width:unset;}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_llv9av6__3851a304{color:var(--plasma-textfield__left-helper-color-readonly);}.base_134hshp_b1w985rt__3851a304[readonly] .base_134hshp_l13qvwoy__3851a304{color:var(--plasma-textfield__label-color-readonly);}
|
130
130
|
|
131
|
-
.
|
132
|
-
.
|
133
|
-
.
|
134
|
-
.
|
131
|
+
.TextField_styles_aqmut_iq39zt5__4a8fddcd{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;}
|
132
|
+
.TextField_styles_aqmut_i1j28rg8__4a8fddcd{-webkit-flex:1;-ms-flex:1;flex:1;overflow:scroll;position:relative;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;overscroll-behavior:contain;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd::-webkit-scrollbar{display:none;}.TextField_styles_aqmut_i1j28rg8__4a8fddcd.TextField_styles_aqmut_hasChips__4a8fddcd{height:var(--plasma-textfield__chip-height);border-radius:var(--plasma-textfield__chip-border-radius);}
|
133
|
+
.TextField_styles_aqmut_s13zudoe__4a8fddcd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
134
|
+
.TextField_styles_aqmut_io4bpie__4a8fddcd{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
135
135
|
|
136
|
-
.
|
137
|
-
.
|
136
|
+
.TextField_styles_aqmut_s19ry60d__4a8fddcd{margin:var(--plasma-textfield__left-content-margin);}
|
137
|
+
.TextField_styles_aqmut_sbt1ohz__4a8fddcd{margin:var(--plasma-textfield__right-content-margin);}
|
138
138
|
|
139
139
|
|
140
140
|
|
package/es/index.js
CHANGED
@@ -180,6 +180,7 @@ export { tokens as rangeTokens } from './components/Range/Range.tokens.js';
|
|
180
180
|
export { accordionConfig, accordionRoot } from './components/Accordion/Accordion.js';
|
181
181
|
export { AccordionItem } from './components/Accordion/ui/AccordionItem/AccordionItem.js';
|
182
182
|
export { classes as accordionClasses, tokens as accordionTokens } from './components/Accordion/Accordion.tokens.js';
|
183
|
+
export { portalConfig, portalRoot } from './components/Portal/Portal.js';
|
183
184
|
export { component, mergeConfig } from './engines/common.js';
|
184
185
|
export { canUseDOM } from './utils/canUseDOM.js';
|
185
186
|
export { extractTextFrom } from './utils/extractTextFrom.js';
|
package/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.94.0-canary.
|
3
|
+
"version": "0.94.0-canary.1272.9712079341.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -105,5 +105,5 @@
|
|
105
105
|
"react-popper": "2.3.0",
|
106
106
|
"storeon": "3.1.5"
|
107
107
|
},
|
108
|
-
"gitHead": "
|
108
|
+
"gitHead": "63012186c6d60b76d4124c79587e7f5872f1e60c"
|
109
109
|
}
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.popoverRoot = exports.popoverConfig = exports.POPOVER_PORTAL_ID = exports.ESCAPE_KEYCODE = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _reactDom = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react-dom"));
|
10
9
|
var _reactPopper = /*#__PURE__*/require("react-popper");
|
11
10
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
11
|
+
var _engines = /*#__PURE__*/require("../../engines");
|
12
12
|
var _utils = /*#__PURE__*/require("../../utils");
|
13
|
+
var _Portal = /*#__PURE__*/require("../Portal");
|
13
14
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
14
15
|
var _Popover = /*#__PURE__*/require("./Popover.styles");
|
15
16
|
var _Popover2 = /*#__PURE__*/require("./Popover.tokens");
|
16
17
|
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle", "closeOnOverlayClick"];
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -33,6 +33,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
33
33
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
34
34
|
var ESCAPE_KEYCODE = exports.ESCAPE_KEYCODE = 27;
|
35
35
|
var POPOVER_PORTAL_ID = exports.POPOVER_PORTAL_ID = 'plasma-popover-root';
|
36
|
+
var mergedPortalConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Portal.portalConfig);
|
37
|
+
var Portal = /*#__PURE__*/(0, _engines.component)(mergedPortalConfig);
|
36
38
|
|
37
39
|
/**
|
38
40
|
* Всплывающее окно с возможностью позиционирования
|
@@ -222,7 +224,9 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
222
224
|
onFocus: onFocus,
|
223
225
|
onBlur: onBlur,
|
224
226
|
className: (0, _utils.cx)(className, _Popover2.classes.target)
|
225
|
-
}, target), children && portalRef.current && /*#__PURE__*/
|
227
|
+
}, target), children && portalRef.current && /*#__PURE__*/_react["default"].createElement(Portal, {
|
228
|
+
container: portalRef.current
|
229
|
+
}, /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
226
230
|
view: view,
|
227
231
|
className: className
|
228
232
|
}, rest), /*#__PURE__*/_react["default"].createElement(_Popover.StyledPopover, _extends({}, attributes.popper, {
|
@@ -236,7 +240,7 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
236
240
|
className: _Popover2.classes.arrow,
|
237
241
|
ref: setArrowElement,
|
238
242
|
style: styles.arrow
|
239
|
-
}, attributes.arrow)), children))
|
243
|
+
}, attributes.arrow)), children))));
|
240
244
|
});
|
241
245
|
};
|
242
246
|
var popoverConfig = exports.popoverConfig = {
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.popupRoot = exports.popupConfig = exports.handlePosition = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _reactDom = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react-dom"));
|
10
9
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
11
10
|
var _utils = /*#__PURE__*/require("../../utils");
|
11
|
+
var _Portal = /*#__PURE__*/require("../Portal");
|
12
|
+
var _engines = /*#__PURE__*/require("../../engines");
|
12
13
|
var _PopupContext = /*#__PURE__*/require("./PopupContext");
|
13
14
|
var _PopupRoot = /*#__PURE__*/require("./PopupRoot");
|
14
15
|
var _hooks = /*#__PURE__*/require("./hooks");
|
15
16
|
var _Popup = /*#__PURE__*/require("./Popup.tokens");
|
16
17
|
var _excluded = ["id", "isOpen", "placement", "offset", "frame", "children", "overlay", "role", "zIndex", "popupInfo", "withAnimation", "className"];
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
@@ -83,6 +83,8 @@ var handlePosition = exports.handlePosition = function handlePosition(placement,
|
|
83
83
|
transform: transform
|
84
84
|
};
|
85
85
|
};
|
86
|
+
var mergedPortalConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Portal.portalConfig);
|
87
|
+
var Portal = /*#__PURE__*/(0, _engines.component)(mergedPortalConfig);
|
86
88
|
|
87
89
|
/**
|
88
90
|
* Базовый копмонент Popup.
|
@@ -156,7 +158,9 @@ var popupRoot = exports.popupRoot = function popupRoot(Root) {
|
|
156
158
|
return null;
|
157
159
|
}
|
158
160
|
var cls = (0, _utils.cx)(className, animationInfo !== null && animationInfo !== void 0 && animationInfo.endAnimation ? _Popup.classes.endAnimation : '', animationInfo !== null && animationInfo !== void 0 && animationInfo.endTransition ? _Popup.classes.endTransition : '');
|
159
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, portalRef.current && /*#__PURE__*/
|
161
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, portalRef.current && /*#__PURE__*/_react["default"].createElement(Portal, {
|
162
|
+
container: portalRef.current
|
163
|
+
}, /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
160
164
|
className: cls
|
161
165
|
}, rest), overlay, /*#__PURE__*/_react["default"].createElement(_PopupRoot.PopupRoot, {
|
162
166
|
id: innerId,
|
@@ -166,7 +170,7 @@ var popupRoot = exports.popupRoot = function popupRoot(Root) {
|
|
166
170
|
zIndex: zIndex,
|
167
171
|
animationInfo: animationInfo,
|
168
172
|
setVisible: setVisible
|
169
|
-
}, children))
|
173
|
+
}, children))));
|
170
174
|
});
|
171
175
|
};
|
172
176
|
var popupConfig = exports.popupConfig = {
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.portalRoot = exports.portalConfig = void 0;
|
8
|
+
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
+
var _reactDom = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react-dom"));
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
13
|
+
/*
|
14
|
+
* Вспомогательный компонент. Используется в Popup, Popover.
|
15
|
+
* Представляет собой ReactDOM.createPortal() в форме компонента.
|
16
|
+
*/
|
17
|
+
var portalRoot = exports.portalRoot = function portalRoot(Root) {
|
18
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRootRef) {
|
19
|
+
var children = _ref.children,
|
20
|
+
container = _ref.container,
|
21
|
+
_ref$disabled = _ref.disabled,
|
22
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
23
|
+
var portalContainer = typeof container === 'function' ? container() : container;
|
24
|
+
return /*#__PURE__*/_react["default"].createElement(Root, {
|
25
|
+
container: container,
|
26
|
+
disabled: disabled,
|
27
|
+
ref: outerRootRef
|
28
|
+
}, disabled && children, !disabled && /*#__PURE__*/_reactDom["default"].createPortal(children, portalContainer));
|
29
|
+
});
|
30
|
+
};
|
31
|
+
var portalConfig = exports.portalConfig = {
|
32
|
+
name: 'Portal',
|
33
|
+
tag: 'div',
|
34
|
+
layout: portalRoot,
|
35
|
+
base: '',
|
36
|
+
variations: {},
|
37
|
+
defaults: {}
|
38
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
id: portal
|
3
|
+
title: Portal
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# Portal
|
9
|
+
<Description name="Portal" />
|
10
|
+
<PropsTable name="Portal" />
|
11
|
+
|
12
|
+
## Использование
|
13
|
+
|
14
|
+
```tsx live
|
15
|
+
import React, { useState, useRef } from 'react';
|
16
|
+
import { Portal, Button, BodyM } from '@salutejs/{{ package }}';
|
17
|
+
|
18
|
+
export function App() {
|
19
|
+
const [show, setShow] = useState(false);
|
20
|
+
const containerRef = useRef(null);
|
21
|
+
|
22
|
+
return (
|
23
|
+
<>
|
24
|
+
<Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
|
25
|
+
<div style=\{{padding: '20px', marginBottom: '10px', marginTop: '10px', border: '1px solid'}}>
|
26
|
+
<BodyM style=\{{ marginBottom: '20px' }}>Содержимое портала появится в нижнем блоке.</BodyM>
|
27
|
+
{show && containerRef.current && (
|
28
|
+
<Portal container={containerRef.current}>
|
29
|
+
<BodyM bold>Содержимое портала</BodyM>
|
30
|
+
</Portal>
|
31
|
+
)}
|
32
|
+
</div>
|
33
|
+
<div style=\{{padding: '20px', marginBottom: '10px', marginTop: '10px', border: '1px solid'}} ref={containerRef} />
|
34
|
+
</>
|
35
|
+
);
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
39
|
+
### Disabled
|
40
|
+
Отключить портал можно с помощью свойства `disabled`.
|
41
|
+
В этом случае содержимое портала добавится внутрь родительского элемента.
|
42
|
+
|
43
|
+
```tsx live
|
44
|
+
import React, { useState, useRef } from 'react';
|
45
|
+
import { Portal, Button, BodyM } from '@salutejs/{{ package }}';
|
46
|
+
|
47
|
+
export function App() {
|
48
|
+
const [show, setShow] = useState(false);
|
49
|
+
const containerRef = useRef(null);
|
50
|
+
|
51
|
+
return (
|
52
|
+
<>
|
53
|
+
<Button onClick={() => setShow(!show)}>{show ? 'Скрыть' : 'Показать'}</Button>
|
54
|
+
<div style=\{{padding: '20px', marginBottom: '10px', marginTop: '10px', border: '1px solid'}}>
|
55
|
+
<BodyM style=\{{ marginBottom: '20px' }}>Содержимое портала появится в данном блоке.</BodyM>
|
56
|
+
{show && containerRef.current && (
|
57
|
+
<Portal disabled container={containerRef.current}>
|
58
|
+
<BodyM bold>Содержимое портала</BodyM>
|
59
|
+
</Portal>
|
60
|
+
)}
|
61
|
+
</div>
|
62
|
+
<div style=\{{padding: '20px', marginBottom: '10px', marginTop: '10px', border: '1px solid'}} ref={containerRef} />
|
63
|
+
</>
|
64
|
+
);
|
65
|
+
}
|
66
|
+
```
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "portalConfig", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _Portal.portalConfig;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "portalRoot", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _Portal.portalRoot;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
var _Portal = /*#__PURE__*/require("./Portal");
|