@consta/uikit 5.26.0 → 5.27.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/__internal__/src/components/Banner/Banner.d.ts +20 -8
- package/__internal__/src/components/Banner/Banner.js +1 -1
- package/__internal__/src/components/Banner/Banner.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldWrapper/types.d.ts +1 -0
- package/__internal__/src/components/FieldComponents/FieldWrapper/types.js.map +1 -1
- package/__internal__/src/components/Modal/Modal.css +1 -1
- package/__internal__/src/components/Modal/Modal.d.ts +8 -13
- package/__internal__/src/components/Modal/Modal.js +1 -1
- package/__internal__/src/components/Modal/Modal.js.map +1 -1
- package/__internal__/src/components/Modal/ModalHeader/ModalHeader.css +1 -0
- package/__internal__/src/components/Modal/ModalHeader/ModalHeader.d.ts +14 -0
- package/__internal__/src/components/Modal/ModalHeader/ModalHeader.js +2 -0
- package/__internal__/src/components/Modal/ModalHeader/ModalHeader.js.map +1 -0
- package/__internal__/src/components/Modal/ModalHeader/index.d.ts +1 -0
- package/__internal__/src/components/Modal/ModalHeader/index.js +2 -0
- package/__internal__/src/components/Modal/ModalHeader/index.js.map +1 -0
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +5 -0
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.d.ts +10 -0
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.js +2 -0
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.js.map +1 -0
- package/__internal__/src/components/Modal/ModalLayout/index.d.ts +1 -0
- package/__internal__/src/components/Modal/ModalLayout/index.js +2 -0
- package/__internal__/src/components/Modal/ModalLayout/index.js.map +1 -0
- package/__internal__/src/components/Modal/index.d.ts +3 -0
- package/__internal__/src/components/Modal/index.js +1 -1
- package/__internal__/src/components/Modal/index.js.map +1 -1
- package/__internal__/src/components/Modal/types.d.ts +23 -0
- package/__internal__/src/components/Modal/types.js +2 -0
- package/__internal__/src/components/Modal/types.js.map +1 -0
- package/__internal__/src/components/Modal/useModal.d.ts +20 -0
- package/__internal__/src/components/Modal/useModal.js +2 -0
- package/__internal__/src/components/Modal/useModal.js.map +1 -0
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js +1 -1
- package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js.map +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.css +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -36
- package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
- package/__internal__/src/components/Sidebar/index.d.ts +1 -0
- package/__internal__/src/components/Sidebar/index.js +1 -1
- package/__internal__/src/components/Sidebar/index.js.map +1 -1
- package/__internal__/src/components/Sidebar/types.d.ts +47 -0
- package/__internal__/src/components/Sidebar/types.js +2 -0
- package/__internal__/src/components/Sidebar/types.js.map +1 -0
- package/__internal__/src/components/Sidebar/useAnimateTimeout.d.ts +2 -0
- package/__internal__/src/components/Sidebar/useAnimateTimeout.js +2 -0
- package/__internal__/src/components/Sidebar/useAnimateTimeout.js.map +1 -0
- package/__internal__/src/hooks/useComponentSize/useComponentSize.d.ts +1 -1
- package/__internal__/src/hooks/useComponentSize/useComponentSize.js +1 -1
- package/__internal__/src/hooks/useComponentSize/useComponentSize.js.map +1 -1
- package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +2 -2
- package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
- package/__internal__/src/mixs/MixSpace/MixSpace.d.ts +1 -1
- package/__internal__/src/mixs/MixSpace/MixSpace.js +1 -1
- package/__internal__/src/mixs/MixSpace/MixSpace.js.map +1 -1
- package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.d.ts +4 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.js +2 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.js.map +1 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/index.d.ts +3 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/index.js +2 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/index.js.map +1 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/types.d.ts +4 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/types.js +2 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/types.js.map +1 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.d.ts +2 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.js +2 -0
- package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.js.map +1 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/index.d.ts +1 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/index.js +2 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/index.js.map +1 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.d.ts +2 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.js +2 -0
- package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.js.map +1 -0
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalWithTheme.js","names":["React","useEffect","useRef","useState","ReactDOM","useForkRef","Theme","PortalWithThemeProvider","usePortalContext","getZIndex","contextZIndex","propZIndex","isRef","ref","
|
|
1
|
+
{"version":3,"file":"PortalWithTheme.js","names":["React","useEffect","useRef","useState","ReactDOM","useForkRef","Theme","PortalWithThemeProvider","usePortalContext","getZIndex","contextZIndex","propZIndex","isRef","ref","getElement","current","PortalWithTheme","forwardRef","children","container","window","document","body","styleProp","style","rest","addRefs","zIndexContext","zIndex","portalContainer","setPortalContainer","themeRef","themeRefForked","createPortal"],"sources":["../../../../../src/components/PortalWithTheme/PortalWithTheme.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { Theme, ThemeProps } from '../Theme/Theme';\nimport {\n PortalWithThemeProvider,\n usePortalContext,\n} from './PortalWithThemeContext/PortalWithThemeContext';\n\nexport { usePortalContext };\n\ntype Props = {\n container?: Element | React.RefObject<HTMLElement>;\n} & ThemeProps;\n\nconst getZIndex = (contextZIndex?: number, propZIndex?: number | string) => {\n if (typeof propZIndex === 'number') {\n return propZIndex;\n }\n\n if (contextZIndex) {\n return contextZIndex + 1;\n }\n\n return undefined;\n};\n\nconst isRef = (\n ref: React.RefObject<HTMLElement> | Element | undefined,\n): ref is React.RefObject<HTMLElement> => !!ref && 'current' in ref;\n\nconst getElement = (ref: React.RefObject<HTMLElement> | Element) =>\n isRef(ref) ? ref.current : ref;\n\nexport const PortalWithTheme = React.forwardRef<HTMLDivElement, Props>(\n (\n { children, container = window.document.body, style: styleProp, ...rest },\n ref,\n ) => {\n const { addRefs, zIndex: zIndexContext } = usePortalContext();\n const [portalContainer, setPortalContainer] = useState<Element | null>(\n getElement(container),\n );\n\n const themeRef = useRef(null);\n\n const zIndex = getZIndex(zIndexContext, styleProp?.zIndex);\n\n const themeRefForked = useForkRef([themeRef, ref]);\n\n useEffect(() => {\n addRefs && addRefs([themeRef]);\n }, [themeRef]);\n\n useEffect(() => {\n setPortalContainer(getElement(container));\n }, [getElement(container)]);\n\n if (!portalContainer) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <PortalWithThemeProvider zIndex={zIndex}>\n <Theme\n {...rest}\n ref={themeRefForked}\n style={{\n ...styleProp,\n zIndex,\n }}\n >\n {children}\n </Theme>\n </PortalWithThemeProvider>,\n portalContainer,\n );\n },\n);\n"],"mappings":"02BAAA,MAAOA,MAAP,EAAgBC,SAAhB,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gBH9B,SAAS,CAAC,UAAM,CACd6B,CAAkB,CAAChB,UAAU,CAACK,CAAD,CAAX,CACnB,CAFQ,CAEN,CAACL,UAAU,CAACK,CAAD,CAAX,CAFM,CAhBN,CAoBEU,CApBF,CAwBIzB,QAAQ,CAAC6B,YAAT,CACL,oBAAC,uBAAD,EAAyB,MAAM,CAAEL,CAAjC,EACE,oBAAC,KAAD,kBACMH,CADN,EAEE,GAAG,CAAEO,CAFP,CAGE,KAAK,gCACAT,CADA,MAEHK,MAAM,CAANA,CAFG,EAHP,GAQGV,CARH,CADF,CADK,CAaLW,CAbK,CAxBJ,CAqBM,IAkBV,CA3C4B,CAAxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className"];import"./RadioGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Radio}from"../Radio/Radio";import{withDefaultGetters}from"./helper";import{radioGroupDefaultDirection,radioGroupDefaultSize,radioGroupDefaultView,radioGroupPropAlignDefault}from"./types";export var cnRadioGroup=cn("RadioGroup");var RadioGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemKey,i=c.getItemDisabled,j=c.onChange,k=c.name,l=c.direction,m=void 0===l?radioGroupDefaultDirection:l,n=c.size,o=void 0===n?radioGroupDefaultSize:n,p=c.view,q=void 0===p?radioGroupDefaultView:p,r=c.align,s=void 0===r?radioGroupPropAlignDefault:r,t=c.disabled,u=c.className,v=_objectWithoutProperties(c,_excluded),
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className","id"];import"./RadioGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Radio}from"../Radio/Radio";import{withDefaultGetters}from"./helper";import{radioGroupDefaultDirection,radioGroupDefaultSize,radioGroupDefaultView,radioGroupPropAlignDefault}from"./types";export var cnRadioGroup=cn("RadioGroup");var RadioGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemKey,i=c.getItemDisabled,j=c.onChange,k=c.name,l=c.direction,m=void 0===l?radioGroupDefaultDirection:l,n=c.size,o=void 0===n?radioGroupDefaultSize:n,p=c.view,q=void 0===p?radioGroupDefaultView:p,r=c.align,s=void 0===r?radioGroupPropAlignDefault:r,t=c.disabled,u=c.className,v=c.id,w=_objectWithoutProperties(c,_excluded),x=useChoiceGroup({value:e,getKey:function getKey(a){var b;return null!==(b=h(a))&&void 0!==b?b:g(a)},callBack:j,multiple:!1}),y=x.getOnChange,z=x.getChecked;return React.createElement("div",Object.assign({},w,{ref:b,className:cnRadioGroup({direction:m,size:o,view:q},[u])}),f.map(function(a){var b;return React.createElement(Radio,{align:s,key:null!==(b=h(a))&&void 0!==b?b:g(a),label:g(a),size:o,view:q,name:k,disabled:void 0!==t&&t||!!i&&i(a),checked:z(a),onChange:y(a),className:cnRadioGroup("Item")})}))};export var RadioGroup=forwardRef(RadioGroupRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Radio","withDefaultGetters","radioGroupDefaultDirection","radioGroupDefaultSize","radioGroupDefaultView","radioGroupPropAlignDefault","cnRadioGroup","RadioGroupRender","props","ref","value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className","otherProps","getKey","item","callBack","multiple","getOnChange","getChecked","map","RadioGroup"],"sources":["../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import './RadioGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Radio } from '../Radio/Radio';\nimport { withDefaultGetters } from './helper';\nimport {\n RadioGroupComponent,\n radioGroupDefaultDirection,\n radioGroupDefaultSize,\n radioGroupDefaultView,\n radioGroupPropAlignDefault,\n RadioGroupProps,\n} from './types';\n\nexport const cnRadioGroup = cn('RadioGroup');\n\nconst RadioGroupRender = (\n props: RadioGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemKey,\n getItemDisabled,\n onChange,\n name,\n direction = radioGroupDefaultDirection,\n size = radioGroupDefaultSize,\n view = radioGroupDefaultView,\n align = radioGroupPropAlignDefault,\n disabled = false,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: (item) => getItemKey(item) ?? getItemLabel(item),\n callBack: onChange,\n multiple: false,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnRadioGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Radio\n align={align}\n key={getItemKey(item) ?? getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || (!!getItemDisabled && getItemDisabled(item))}\n checked={getChecked(item)}\n onChange={getOnChange(item)}\n className={cnRadioGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const RadioGroup = forwardRef(RadioGroupRender) as RadioGroupComponent;\n\nexport * from './types';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Radio","withDefaultGetters","radioGroupDefaultDirection","radioGroupDefaultSize","radioGroupDefaultView","radioGroupPropAlignDefault","cnRadioGroup","RadioGroupRender","props","ref","value","items","getItemLabel","getItemKey","getItemDisabled","onChange","name","direction","size","view","align","disabled","className","id","otherProps","getKey","item","callBack","multiple","getOnChange","getChecked","map","RadioGroup"],"sources":["../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import './RadioGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport { Radio } from '../Radio/Radio';\nimport { withDefaultGetters } from './helper';\nimport {\n RadioGroupComponent,\n radioGroupDefaultDirection,\n radioGroupDefaultSize,\n radioGroupDefaultView,\n radioGroupPropAlignDefault,\n RadioGroupProps,\n} from './types';\n\nexport const cnRadioGroup = cn('RadioGroup');\n\nconst RadioGroupRender = (\n props: RadioGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemKey,\n getItemDisabled,\n onChange,\n name,\n direction = radioGroupDefaultDirection,\n size = radioGroupDefaultSize,\n view = radioGroupDefaultView,\n align = radioGroupPropAlignDefault,\n disabled = false,\n className,\n id,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: (item) => getItemKey(item) ?? getItemLabel(item),\n callBack: onChange,\n multiple: false,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnRadioGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Radio\n align={align}\n key={getItemKey(item) ?? getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || (!!getItemDisabled && getItemDisabled(item))}\n checked={getChecked(item)}\n onChange={getOnChange(item)}\n className={cnRadioGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const RadioGroup = forwardRef(RadioGroupRender) as RadioGroupComponent;\n\nexport * from './types';\n"],"mappings":"mPAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OAASC,K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D,EACE,KAAK,CAAEN,CADT,CAEE,GAAG,WAAEP,CAAU,CAACa,CAAD,CAAZ,gBAAsBd,CAAY,CAACc,CAAD,CAFvC,CAGE,KAAK,CAAEd,CAAY,CAACc,CAAD,CAHrB,CAIE,IAAI,CAAER,CAJR,CAKE,IAAI,CAAEC,CALR,CAME,IAAI,CAAEH,CANR,CAOE,QAAQ,CAAE,eAAa,CAAC,CAACF,CAAF,EAAqBA,CAAe,CAACY,CAAD,CAP7D,CAQE,OAAO,CAAEI,CAAU,CAACJ,CAAD,CARrB,CASE,QAAQ,CAAEG,CAAW,CAACH,CAAD,CATvB,CAUE,SAAS,CAAEpB,YAAY,CAAC,MAAD,CAVzB,EADS,CAAV,CALH,CAqBH,CAnDD,CAqDA,MAAO,IAAM0B,WAAU,CAAGnC,UAAU,CAACU,gBAAD,CAA7B,CAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Sidebar{
|
|
1
|
+
.Sidebar{bottom:0;box-sizing:border-box;display:flex;left:0;overflow:hidden;position:fixed;right:0;top:0}.Sidebar:not(.Sidebar_hasOverlay){pointer-events:none}.Sidebar_position_top{flex-direction:column}.Sidebar_position_bottom{flex-direction:column;justify-content:flex-end}.Sidebar_position_right{justify-content:flex-end}.Sidebar-Overlay{background:var(--color-bg-tone);border:none;bottom:0;left:0;padding:0;position:absolute;right:0;top:0}.Sidebar-Overlay_animate_exited,.Sidebar-Overlay_animate_exiting{opacity:0}.Sidebar-Overlay_animate_entered,.Sidebar-Overlay_animate_entering{opacity:1}.Sidebar-Overlay_animate_entered,.Sidebar-Overlay_animate_entering,.Sidebar-Overlay_animate_exited,.Sidebar-Overlay_animate_exiting{transition:opacity var(--sidebar-animate-timeout) ease}.Sidebar-Window{--sidebar-border:none;background-color:var(--color-bg-default);box-shadow:var(--sidebar-modal-shadow);display:flex;flex-direction:column;max-height:100%;max-width:100%;pointer-events:auto;position:absolute}.Sidebar-Window_border{--sidebar-border:1px solid var(--color-bg-border)}.Sidebar-Window_position_right{--sidebar-transform:translate3d(100%,0,0);border-left:var(--sidebar-border);height:100%;width:var(--sidebar-size)}.Sidebar-Window_position_bottom{--sidebar-transform:translate3d(0,100%,0);border-top:var(--sidebar-border);height:var(--sidebar-size);width:100%}.Sidebar-Window_position_left{--sidebar-transform:translate3d(-100%,0,0);border-right:var(--sidebar-border);height:100%;width:var(--sidebar-size)}.Sidebar-Window_position_top{--sidebar-transform:translate3d(0,-100%,0);border-bottom:var(--sidebar-border);height:var(--sidebar-size);width:100%}.Sidebar-Window_size_s{--sidebar-size:260px}.Sidebar-Window_size_m{--sidebar-size:320px}.Sidebar-Window_size_l{--sidebar-size:480px}.Sidebar-Window_size_full{--sidebar-size:100%}.Sidebar-Window_size_1\/4{--sidebar-size:25%}.Sidebar-Window_size_3\/4{--sidebar-size:75%}.Sidebar-Window_size_1\/2{--sidebar-size:50%}.Sidebar-Window_size_1\/3{--sidebar-size:33.33333%}.Sidebar-Window_size_2\/3{--sidebar-size:66.66667%}.Sidebar-Window_animate_exited,.Sidebar-Window_animate_exiting{--sidebar-modal-shadow:0 0 0 transparent,0 0 0 transparent;transform:var(--sidebar-transform)}.Sidebar-Window_animate_entered,.Sidebar-Window_animate_entering{--sidebar-modal-shadow:var(--shadow-modal);transform:translateZ(0)}.Sidebar-Window_animate_entered,.Sidebar-Window_animate_entering,.Sidebar-Window_animate_exited,.Sidebar-Window_animate_exiting{transition:transform var(--sidebar-animate-timeout),box-shadow var(--sidebar-animate-timeout) ease-in}.Sidebar-Content,.Sidebar-Scroll{display:flex;flex:1;flex-direction:column}.Sidebar-Scroll{height:100%;overflow:auto}.Sidebar-Actions{border-top:1px solid var(--color-bg-border);flex-shrink:0}
|
|
@@ -1,39 +1,4 @@
|
|
|
1
1
|
import './Sidebar.css';
|
|
2
|
-
import
|
|
3
|
-
import { AsTagAttribute } from '../../utils/types/AsTags';
|
|
4
|
-
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
5
|
-
declare const sidebarPropPosition: readonly ["right", "bottom", "left", "top"];
|
|
6
|
-
type SidebarPropPosition = typeof sidebarPropPosition[number];
|
|
7
|
-
export declare const sidebarPropSize: readonly ["s", "m", "l", "full", "1/2", "1/3", "1/4", "2/3", "3/4"];
|
|
8
|
-
export type SidebarPropSize = typeof sidebarPropSize[number];
|
|
9
|
-
export type SidebarProps = PropsWithHTMLAttributes<{
|
|
10
|
-
isOpen?: boolean;
|
|
11
|
-
onClose?: () => void;
|
|
12
|
-
onOpen?: () => void;
|
|
13
|
-
hasOverlay?: boolean;
|
|
14
|
-
onClickOutside?: (event: MouseEvent) => void;
|
|
15
|
-
onEsc?: (event: KeyboardEvent) => void;
|
|
16
|
-
position?: SidebarPropPosition;
|
|
17
|
-
size?: SidebarPropSize;
|
|
18
|
-
rootClassName?: string;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
container?: HTMLDivElement | undefined;
|
|
21
|
-
afterClose?: () => void;
|
|
22
|
-
}, HTMLDivElement>;
|
|
23
|
-
type SidebarContentProps = {
|
|
24
|
-
className?: string;
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
};
|
|
27
|
-
type SidebarActionsProps = {
|
|
28
|
-
className?: string;
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
};
|
|
2
|
+
import { SidebarComponent } from './types';
|
|
31
3
|
export declare const cnSidebar: import("@bem-react/classname").ClassNameFormatter;
|
|
32
|
-
declare const SidebarContent: React.FC<SidebarContentProps>;
|
|
33
|
-
declare const SidebarActions: React.FC<SidebarActionsProps>;
|
|
34
|
-
interface SidebarComponent extends React.FC<SidebarProps>, AsTagAttribute<'div'> {
|
|
35
|
-
Content: typeof SidebarContent;
|
|
36
|
-
Actions: typeof SidebarActions;
|
|
37
|
-
}
|
|
38
4
|
export declare const Sidebar: SidebarComponent;
|
|
39
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children"],_excluded2=["className","children"],_excluded3=["isOpen","onClose","onOpen","hasOverlay","onClickOutside","onEsc","position","size","className","children","container","style","rootClassName","afterClose"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Sidebar.css";import React,{
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children"],_excluded2=["className","children"],_excluded3=["isOpen","onClose","onOpen","hasOverlay","onClickOutside","onEsc","position","size","className","children","container","style","rootClassName","afterClose","ignoreOutsideClicksRefs","border"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./Sidebar.css";import React,{forwardRef}from"react";import{Transition}from"react-transition-group";import{useModal}from"../Modal/useModal";import{PortalWithTheme,PortalWithThemeConsumer}from"../PortalWithTheme";import{cnMixScrollBar}from"../../mixs/MixScrollBar";import{cn}from"../../utils/bem";import{withCtx}from"../../utils/state";import{useAnimateTimeout}from"./useAnimateTimeout";export var cnSidebar=cn("Sidebar");var SidebarContent=function(a){var b=a.className,c=a.children,d=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({className:cnSidebar("Content",[b,cnMixScrollBar()])},d),c)},SidebarActions=function(a){var b=a.className,c=a.children,d=_objectWithoutProperties(a,_excluded2);return React.createElement("div",Object.assign({className:cnSidebar("Actions",[b])},d),c)};export var Sidebar=withCtx(forwardRef(function(a,b){var c=a.isOpen,d=a.onClose,e=a.onOpen,f=a.hasOverlay,g=!(void 0!==f)||f,h=a.onClickOutside,i=a.onEsc,j=a.position,k=void 0===j?"right":j,l=a.size,m=void 0===l?"m":l,n=a.className,o=a.children,p=a.container,q=void 0===p?window.document.body:p,r=a.style,s=a.rootClassName,t=a.afterClose,u=a.ignoreOutsideClicksRefs,v=a.border,w=_objectWithoutProperties(a,_excluded3),x=useModal({ref:b,isOpen:c,onEsc:i,onOpen:e,onClose:d,ignoreOutsideClicksRefs:u}),y=x.shadowHeader,z=x.shadowFooter,A=x.scrollable,B=x.theme,C=x.portalRef,D=x.windowRef,E=x.contentRef,F=x.scrollRef,G=x.ignoreOutsideClicksRefs,H=x.windowElAtom,I=useAnimateTimeout(H,k);return React.createElement(Transition,{in:c,unmountOnExit:!0,timeout:I,nodeRef:C,onExiting:t},function(a){return React.createElement(PortalWithTheme,{preset:B,ref:C,container:q,className:cnSidebar({position:k,hasOverlay:g},[s]),style:_objectSpread(_objectSpread(_objectSpread(_objectSpread({},(null===r||void 0===r?void 0:r.zIndex)&&{zIndex:r.zIndex}),{},_defineProperty({},"--sidebar-animate-timeout","".concat(I,"ms")),y&&_defineProperty({},"--modal-layout-header-color-shadow","var(--color-shadow-group-2)")),z&&_defineProperty({},"--modal-layout-footer-color-shadow","var(--color-shadow-group-2)")),(null===r||void 0===r?void 0:r.zIndex)&&_defineProperty({},"--modal-layout-z-index-for-fixed-slot",r.zIndex))},g&&React.createElement("div",{className:cnSidebar("Overlay",{animate:a}),"aria-label":"Overlay"}),React.createElement("div",Object.assign({},w,{style:_objectSpread(_objectSpread({},r),{},{zIndex:void 0}),className:cnSidebar("Window",{size:m,position:k,animate:a,scrollable:A,border:v},[n]),ref:D}),React.createElement("div",{className:cnSidebar("Scroll",cnMixScrollBar({size:"s"})),ref:F},React.createElement("div",{className:cnSidebar("Content"),ref:E},React.createElement(PortalWithThemeConsumer,{onClickOutside:h,ignoreClicksInsideRefs:G},o)))))})}));Sidebar.Actions=SidebarActions,Sidebar.Content=SidebarContent;
|
|
2
2
|
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","names":["React","
|
|
1
|
+
{"version":3,"file":"Sidebar.js","names":["React","forwardRef","Transition","useModal","PortalWithTheme","PortalWithThemeConsumer","cnMixScrollBar","cn","withCtx","useAnimateTimeout","cnSidebar","SidebarContent","className","children","rest","SidebarActions","Sidebar","props","ref","isOpen","onClose","onOpen","hasOverlay","onClickOutside","onEsc","position","size","container","window","document","body","style","rootClassName","afterClose","ignoreOutsideClicksRefsProp","ignoreOutsideClicksRefs","border","otherProps","shadowHeader","shadowFooter","scrollable","theme","portalRef","windowRef","contentRef","scrollRef","windowElAtom","animateTimeout","animate","zIndex","Actions","Content"],"sources":["../../../../../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import './Sidebar.css';\n\nimport React, { forwardRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { useModal } from '##/components/Modal/useModal';\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cn } from '##/utils/bem';\nimport { withCtx } from '##/utils/state';\n\nimport {\n SidebarActionsProps,\n SidebarComponent,\n SidebarContentProps,\n SidebarProps,\n} from './types';\nimport { useAnimateTimeout } from './useAnimateTimeout';\n\nexport const cnSidebar = cn('Sidebar');\n\nconst SidebarContent: React.FC<SidebarContentProps> = ({\n className,\n children,\n ...rest\n}) => (\n <div\n className={cnSidebar('Content', [className, cnMixScrollBar()])}\n {...rest}\n >\n {children}\n </div>\n);\n\nconst SidebarActions: React.FC<SidebarActionsProps> = ({\n className,\n children,\n ...rest\n}) => (\n <div className={cnSidebar('Actions', [className])} {...rest}>\n {children}\n </div>\n);\n\nexport const Sidebar = withCtx(\n forwardRef<HTMLDivElement, SidebarProps>((props, ref) => {\n const {\n isOpen,\n onClose,\n onOpen,\n hasOverlay = true,\n onClickOutside,\n onEsc,\n position = 'right',\n size = 'm',\n className,\n children,\n container = window.document.body,\n style,\n rootClassName,\n afterClose,\n ignoreOutsideClicksRefs: ignoreOutsideClicksRefsProp,\n border,\n ...otherProps\n } = props;\n\n const {\n shadowHeader,\n shadowFooter,\n scrollable,\n theme,\n portalRef,\n windowRef,\n contentRef,\n scrollRef,\n ignoreOutsideClicksRefs,\n windowElAtom,\n } = useModal({\n ref,\n isOpen,\n onEsc,\n onOpen,\n onClose,\n ignoreOutsideClicksRefs: ignoreOutsideClicksRefsProp,\n });\n\n const animateTimeout = useAnimateTimeout(windowElAtom, position);\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n timeout={animateTimeout}\n nodeRef={portalRef}\n onExiting={afterClose}\n >\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n ref={portalRef}\n container={container}\n className={cnSidebar({ position, hasOverlay }, [rootClassName])}\n style={{\n ...(style?.zIndex && {\n zIndex: style.zIndex,\n }),\n ['--sidebar-animate-timeout' as string]: `${animateTimeout}ms`,\n ...(shadowHeader && {\n ['--modal-layout-header-color-shadow' as string]:\n 'var(--color-shadow-group-2)',\n }),\n ...(shadowFooter && {\n ['--modal-layout-footer-color-shadow' as string]:\n 'var(--color-shadow-group-2)',\n }),\n ...(style?.zIndex && {\n ['--modal-layout-z-index-for-fixed-slot' as string]:\n style.zIndex,\n }),\n }}\n >\n {hasOverlay && (\n <div\n className={cnSidebar('Overlay', { animate })}\n aria-label=\"Overlay\"\n />\n )}\n <div\n {...otherProps}\n style={{\n ...style,\n zIndex: undefined,\n }}\n className={cnSidebar(\n 'Window',\n {\n size,\n position,\n animate,\n scrollable,\n border,\n },\n [className],\n )}\n ref={windowRef}\n >\n <div\n className={cnSidebar('Scroll', cnMixScrollBar({ size: 's' }))}\n ref={scrollRef}\n >\n <div className={cnSidebar('Content')} ref={contentRef}>\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside}\n ignoreClicksInsideRefs={ignoreOutsideClicksRefs}\n >\n {children}\n </PortalWithThemeConsumer>\n </div>\n </div>\n </div>\n </PortalWithTheme>\n )}\n </Transition>\n );\n }),\n) as SidebarComponent;\n/**\n * @deprecated use actions\n */\nSidebar.Actions = SidebarActions;\n\n/**\n * @deprecated use actions\n */\nSidebar.Content = SidebarContent;\n"],"mappings":"ihCAAA,sBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,QAAT,yBACA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,cAAT,+BACA,OAASC,EAAT,uBACA,OAASC,OAAT,yBAQA,OAASC,iBAAT,2BAEA,MAAO,IAAMC,UAAS,CAAGH,EAAE,CAAC,SAAD,CAApB,C,GAEDI,eAA6C,CAAG,eACpDC,EADoD,GACpDA,SADoD,CAEpDC,CAFoD,GAEpDA,QAFoD,CAGjDC,CAHiD,6CAKpD,0CACE,SAAS,CAAEJ,SAAS,CAAC,SAAD,CAAY,CAACE,CAAD,CAAYN,cAAc,EAA1B,CAAZ,CADtB,EAEMQ,CAFN,EAIGD,CAJH,CALoD,C,CAahDE,cAA6C,CAAG,eACpDH,EADoD,GACpDA,SADoD,CAEpDC,CAFoD,GAEpDA,QAFoD,CAGjDC,CAHiD,8CAKpD,0CAAK,SAAS,CAAEJ,SAAS,CAAC,SAAD,CAAY,CA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AAEsC,OAAO,CAAPA,CAAF,CAAZ,CADtB,CAEE,aAAW,SAFb,EAzBJ,CA8BE,2CACMX,CADN,EAEE,KAAK,gCACAN,CADA,MAEHkB,MAAM,OAFH,EAFP,CAME,SAAS,CAAEvC,SAAS,CAClB,QADkB,CAElB,CACEgB,IAAI,CAAJA,CADF,CAEED,QAAQ,CAARA,CAFF,CAGEuB,OAAO,CAAPA,CAHF,CAIER,UAAU,CAAVA,CAJF,CAKEJ,MAAM,CAANA,CALF,CAFkB,CASlB,CAACxB,CAAD,CATkB,CANtB,CAiBE,GAAG,CAAE+B,CAjBP,GAmBE,2BACE,SAAS,CAAEjC,SAAS,CAAC,QAAD,CAAWJ,cAAc,CAAC,CAAEoB,IAAI,CAAE,GAAR,CAAD,CAAzB,CADtB,CAEE,GAAG,CAAEmB,CAFP,EAIE,2BAAK,SAAS,CAAEnC,SAAS,CAAC,SAAD,CAAzB,CAAsC,GAAG,CAAEkC,CAA3C,EACE,oBAAC,uBAAD,EACE,cAAc,CAAErB,CADlB,CAEE,sBAAsB,CAAEY,CAF1B,EAIGtB,CAJH,CADF,CAJF,CAnBF,CA9BF,CADD,CAPH,CA2EH,CAvHS,CADkB,CAAvB,CA6HPG,OAAO,CAACkC,OAAR,CAAkBnC,c,CAKlBC,OAAO,CAACmC,OAAR,CAAkBxC,c"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./Sidebar";
|
|
1
|
+
export*from"./Sidebar";export*from"./types";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Sidebar/index.ts"],"sourcesContent":["export * from './Sidebar';\n"],"mappings":"AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Sidebar/index.ts"],"sourcesContent":["export * from './Sidebar';\nexport * from './types';\n"],"mappings":"AAAA,uBACA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AsTagAttribute } from '../../utils/types/AsTags';
|
|
2
|
+
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
3
|
+
declare const sidebarPropPosition: readonly ["right", "bottom", "left", "top"];
|
|
4
|
+
export type SidebarPropPosition = typeof sidebarPropPosition[number];
|
|
5
|
+
export declare const sidebarPropSize: readonly ["s", "m", "l", "full", "none", "1/2", "1/3", "1/4", "2/3", "3/4"];
|
|
6
|
+
export type SidebarPropSize = typeof sidebarPropSize[number];
|
|
7
|
+
export type SidebarProps = PropsWithHTMLAttributes<{
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
onOpen?: () => void;
|
|
11
|
+
hasOverlay?: boolean;
|
|
12
|
+
onClickOutside?: (event: MouseEvent) => void;
|
|
13
|
+
onEsc?: (event: KeyboardEvent) => void;
|
|
14
|
+
position?: SidebarPropPosition;
|
|
15
|
+
size?: SidebarPropSize;
|
|
16
|
+
rootClassName?: string;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
container?: HTMLDivElement | React.RefObject<HTMLDivElement>;
|
|
19
|
+
afterClose?: () => void;
|
|
20
|
+
ignoreOutsideClicksRefs?: React.RefObject<HTMLElement>[];
|
|
21
|
+
border?: boolean;
|
|
22
|
+
}, HTMLDivElement>;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
export type SidebarContentProps = {
|
|
27
|
+
className?: string;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
33
|
+
export type SidebarActionsProps = {
|
|
34
|
+
className?: string;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
};
|
|
37
|
+
export interface SidebarComponent extends React.ForwardRefExoticComponent<SidebarProps>, AsTagAttribute<'div'> {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated
|
|
40
|
+
*/
|
|
41
|
+
Content: React.FC<SidebarContentProps>;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
Actions: React.FC<SidebarActionsProps>;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["sidebarPropPosition","sidebarPropSize"],"sources":["../../../../../src/components/Sidebar/types.ts"],"sourcesContent":["import { AsTagAttribute } from '##/utils/types/AsTags';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nconst sidebarPropPosition = ['right', 'bottom', 'left', 'top'] as const;\nexport type SidebarPropPosition = typeof sidebarPropPosition[number];\n\nexport const sidebarPropSize = [\n 's',\n 'm',\n 'l',\n 'full',\n 'none',\n '1/2',\n '1/3',\n '1/4',\n '2/3',\n '3/4',\n] as const;\n\nexport type SidebarPropSize = typeof sidebarPropSize[number];\n\nexport type SidebarProps = PropsWithHTMLAttributes<\n {\n isOpen?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n hasOverlay?: boolean;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n position?: SidebarPropPosition;\n size?: SidebarPropSize;\n rootClassName?: string;\n children?: React.ReactNode;\n container?: HTMLDivElement | React.RefObject<HTMLDivElement>;\n afterClose?: () => void;\n ignoreOutsideClicksRefs?: React.RefObject<HTMLElement>[];\n border?: boolean;\n },\n HTMLDivElement\n>;\n\n/**\n * @deprecated\n */\nexport type SidebarContentProps = {\n className?: string;\n children: React.ReactNode;\n};\n\n/**\n * @deprecated\n */\nexport type SidebarActionsProps = {\n className?: string;\n children: React.ReactNode;\n};\n\nexport interface SidebarComponent\n extends React.ForwardRefExoticComponent<SidebarProps>,\n AsTagAttribute<'div'> {\n /**\n * @deprecated\n */\n Content: React.FC<SidebarContentProps>;\n /**\n * @deprecated\n */\n Actions: React.FC<SidebarActionsProps>;\n}\n"],"mappings":"AAGA,GAAMA,oBAAmB,CAAG,CAAC,OAAD,CAAU,QAAV,CAAoB,MAApB,CAA4B,KAA5B,CAA5B,CAGA,MAAO,IAAMC,gBAAe,CAAG,CAC7B,GAD6B,CAE7B,GAF6B,CAG7B,GAH6B,CAI7B,MAJ6B,CAK7B,MAL6B,CAM7B,KAN6B,CAO7B,KAP6B,CAQ7B,KAR6B,CAS7B,KAT6B,CAU7B,KAV6B,CAAxB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useAtom}from"@reatom/npm-react";import{getElementSize}from"../../hooks/useResizeObserved";import{useCreateAtom}from"../../utils/state/useCreateAtom";import{useResizeObservedAtom}from"../../utils/state/useResizeObservedAtom";import{useSendToAtom}from"../../utils/state/useSendToAtom";var coefficient=60;export var useAnimateTimeout=function(a,b){var c=useResizeObservedAtom(useCreateAtom(function(b){return[b.spy(a)]}),getElementSize),d=useSendToAtom(b),e=useCreateAtom(function(a){var b=a.spy(c)[0]||{width:0,height:0},e=a.spy(d),f="right"===e||"left"===e?b.width:b.height,g=Math.ceil(f/100*coefficient);return 150>g?150:Math.min(g,400)});return useAtom(e)[0]};
|
|
2
|
+
//# sourceMappingURL=useAnimateTimeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnimateTimeout.js","names":["useAtom","getElementSize","useCreateAtom","useResizeObservedAtom","useSendToAtom","coefficient","useAnimateTimeout","windowElAtom","position","dimensionsAtom","ctx","spy","positionAtom","useAnimateTimeoutAtom","dimensions","width","height","size","timeout","Math","ceil","min"],"sources":["../../../../../src/components/Sidebar/useAnimateTimeout.ts"],"sourcesContent":["import { AtomMut } from '@reatom/core';\nimport { useAtom } from '@reatom/npm-react';\n\nimport { getElementSize } from '##/hooks/useResizeObserved';\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\nimport { useResizeObservedAtom } from '##/utils/state/useResizeObservedAtom';\nimport { useSendToAtom } from '##/utils/state/useSendToAtom';\n\nconst coefficient = 60;\n\nexport const useAnimateTimeout = (\n windowElAtom: AtomMut<HTMLDivElement | null>,\n position: 'right' | 'bottom' | 'left' | 'top',\n) => {\n const dimensionsAtom = useResizeObservedAtom(\n useCreateAtom((ctx) => [ctx.spy(windowElAtom)]),\n getElementSize,\n );\n\n const positionAtom = useSendToAtom(position);\n\n const useAnimateTimeoutAtom = useCreateAtom((ctx) => {\n const dimensions = ctx.spy(dimensionsAtom)[0] || { width: 0, height: 0 };\n const position = ctx.spy(positionAtom);\n\n const size =\n position === 'right' || position === 'left'\n ? dimensions.width\n : dimensions.height;\n\n const timeout = Math.ceil((size / 100) * coefficient);\n\n return timeout < 150 ? 150 : Math.min(timeout, 400);\n });\n\n return useAtom(useAnimateTimeoutAtom)[0];\n};\n"],"mappings":"AACA,OAASA,OAAT,KAAwB,mBAAxB,CAEA,OAASC,cAAT,qCACA,OAASC,aAAT,uCACA,OAASC,qBAAT,+CACA,OAASC,aAAT,uCAEA,GAAMC,YAAW,CAAG,EAApB,CAEA,MAAO,IAAMC,kBAAiB,CAAG,SAC/BC,CAD+B,CAE/BC,CAF+B,CAG5B,IACGC,EAAc,CAAGN,qBAAqB,CAC1CD,aAAa,CAAC,SAACQ,CAAD,QAAS,CAACA,CAAG,CAACC,GAAJ,CAAQJ,CAAR,CAAD,CAAT,CAAD,CAD6B,CAE1CN,cAF0C,CADzC,CAMGW,CAAY,CAAGR,aAAa,CAACI,CAAD,CAN/B,CAQGK,CAAqB,CAAGX,aAAa,CAAC,SAACQ,CAAD,CAAS,IAC7CI,EAAU,CAAGJ,CAAG,CAACC,GAAJ,CAAQF,CAAR,EAAwB,CAAxB,GAA8B,CAAEM,KAAK,CAAE,CAAT,CAAYC,MAAM,CAAE,CAApB,CADE,CAE7CR,CAAQ,CAAGE,CAAG,CAACC,GAAJ,CAAQC,CAAR,CAFkC,CAI7CK,CAAI,CACK,OAAb,GAAAT,CAAQ,EAA6B,MAAb,GAAAA,CAAxB,CACIM,CAAU,CAACC,KADf,CAEID,CAAU,CAACE,MAPkC,CAS7CE,CAAO,CAAGC,IAAI,CAACC,IAAL,CAAWH,CAAI,CAAG,GAAR,CAAeZ,WAAzB,CATmC,CAWnD,MAAiB,IAAV,CAAAa,CAAO,CAAS,GAAT,CAAeC,IAAI,CAACE,GAAL,CAASH,CAAT,CAAkB,GAAlB,CAC9B,CAZ0C,CARxC,CAsBH,MAAOlB,QAAO,CAACa,CAAD,CAAP,CAA+B,CAA/B,CACR,CA1BM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ComponentSize } from './types';
|
|
2
|
-
export declare const useComponentSize: (ref: React.RefObject<HTMLElement | SVGGraphicsElement
|
|
2
|
+
export declare const useComponentSize: (ref: React.RefObject<HTMLElement | SVGGraphicsElement>, deps?: unknown[]) => ComponentSize;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../useResizeObserved";export var useComponentSize=function(a){return useResizeObserved(useMemo(function(){return[a]},[a.current]),getElementSize)[0]};
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../useResizeObserved";export var useComponentSize=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return useResizeObserved(useMemo(function(){return[a]},[a.current].concat(_toConsumableArray(b))),getElementSize)[0]};
|
|
2
2
|
//# sourceMappingURL=useComponentSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","current"],"sources":["../../../../../src/hooks/useComponentSize/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current],\n ),\n getElementSize,\n )[0];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","deps","current"],"sources":["../../../../../src/hooks/useComponentSize/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n deps: unknown[] = [],\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current, ...deps],\n ),\n getElementSize,\n )[0];\n"],"mappings":"yEAAA,OAASA,OAAT,KAAwB,OAAxB,CAEA,OAASC,cAAT,CAAyBC,iBAAzB,4BAIA,MAAO,IAAMC,iBAAgB,CAAG,SAC9BC,CAD8B,KAE9BC,EAF8B,wDAEZ,EAFY,OAI9BH,kBAAiB,CACfF,OAAO,CACL,iBAAM,CAACI,CAAD,CAAN,CADK,EAGJA,CAAG,CAACE,OAHA,4BAGYD,CAHZ,GADQ,CAMfJ,cANe,CAAjB,CAOE,CAPF,CAJ8B,CAAzB"}
|
|
@@ -10,7 +10,7 @@ export declare const mixFlexPropWrap: readonly ["nowrap", "wrap", "wrap-reverse"
|
|
|
10
10
|
export type MixFlexPropWrap = typeof mixFlexPropWrap[number];
|
|
11
11
|
export declare const mixFlexPropDirection: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
12
12
|
export type MixFlexPropDirection = typeof mixFlexPropDirection[number];
|
|
13
|
-
type
|
|
13
|
+
export type CnMixFlexProps = {
|
|
14
14
|
align?: MixFlexPropAlign;
|
|
15
15
|
justify?: MixFlexPropJustify;
|
|
16
16
|
flex?: MixFlexPropFlex;
|
|
@@ -19,6 +19,6 @@ type Props = {
|
|
|
19
19
|
gap?: Space;
|
|
20
20
|
order?: -1 | 0 | 1;
|
|
21
21
|
};
|
|
22
|
-
type CnMixFlex = (props:
|
|
22
|
+
type CnMixFlex = (props: CnMixFlexProps, classNames?: Array<string | undefined>) => string;
|
|
23
23
|
export declare const cnMixFlex: CnMixFlex;
|
|
24
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MixFlex.js","names":["cn","mixFlexPropAlign","mixFlexPropJustify","mixFlexPropFlex","mixFlexPropWrap","mixFlexPropDirection","cnFlex","cnMixFlex","props","classNames"],"sources":["../../../../../src/mixs/MixFlex/MixFlex.ts"],"sourcesContent":["import './MixFlex.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { Space } from '../MixSpace';\n\nexport const mixFlexPropAlign = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\nexport type MixFlexPropAlign = typeof mixFlexPropAlign[number];\n\nexport const mixFlexPropJustify = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n] as const;\nexport type MixFlexPropJustify = typeof mixFlexPropJustify[number];\n\nexport const mixFlexPropFlex = ['flex', 'inline-flex'] as const;\nexport type MixFlexPropFlex = typeof mixFlexPropFlex[number];\n\nexport const mixFlexPropWrap = ['nowrap', 'wrap', 'wrap-reverse'] as const;\nexport type MixFlexPropWrap = typeof mixFlexPropWrap[number];\n\nexport const mixFlexPropDirection = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\nexport type MixFlexPropDirection = typeof mixFlexPropDirection[number];\n\
|
|
1
|
+
{"version":3,"file":"MixFlex.js","names":["cn","mixFlexPropAlign","mixFlexPropJustify","mixFlexPropFlex","mixFlexPropWrap","mixFlexPropDirection","cnFlex","cnMixFlex","props","classNames"],"sources":["../../../../../src/mixs/MixFlex/MixFlex.ts"],"sourcesContent":["import './MixFlex.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { Space } from '../MixSpace';\n\nexport const mixFlexPropAlign = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\nexport type MixFlexPropAlign = typeof mixFlexPropAlign[number];\n\nexport const mixFlexPropJustify = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n] as const;\nexport type MixFlexPropJustify = typeof mixFlexPropJustify[number];\n\nexport const mixFlexPropFlex = ['flex', 'inline-flex'] as const;\nexport type MixFlexPropFlex = typeof mixFlexPropFlex[number];\n\nexport const mixFlexPropWrap = ['nowrap', 'wrap', 'wrap-reverse'] as const;\nexport type MixFlexPropWrap = typeof mixFlexPropWrap[number];\n\nexport const mixFlexPropDirection = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\nexport type MixFlexPropDirection = typeof mixFlexPropDirection[number];\n\nexport type CnMixFlexProps = {\n align?: MixFlexPropAlign;\n justify?: MixFlexPropJustify;\n flex?: MixFlexPropFlex;\n wrap?: MixFlexPropWrap;\n direction?: MixFlexPropDirection;\n gap?: Space;\n order?: -1 | 0 | 1;\n};\n\ntype CnMixFlex = (\n props: CnMixFlexProps,\n classNames?: Array<string | undefined>,\n) => string;\n\nconst cnFlex = cn('MixFlex');\n\nexport const cnMixFlex: CnMixFlex = (props, classNames = []) =>\n cnFlex(props, classNames);\n"],"mappings":"AAAA,sBAEA,OAASA,EAAT,uBAIA,MAAO,IAAMC,iBAAgB,CAAG,CAC9B,YAD8B,CAE9B,UAF8B,CAG9B,QAH8B,CAI9B,UAJ8B,CAK9B,SAL8B,CAAzB,CASP,MAAO,IAAMC,mBAAkB,CAAG,CAChC,YADgC,CAEhC,UAFgC,CAGhC,QAHgC,CAIhC,eAJgC,CAKhC,cALgC,CAMhC,cANgC,CAA3B,CAUP,MAAO,IAAMC,gBAAe,CAAG,CAAC,MAAD,CAAS,aAAT,CAAxB,CAGP,MAAO,IAAMC,gBAAe,CAAG,CAAC,QAAD,CAAW,MAAX,CAAmB,cAAnB,CAAxB,CAGP,MAAO,IAAMC,qBAAoB,CAAG,CAClC,KADkC,CAElC,aAFkC,CAGlC,QAHkC,CAIlC,gBAJkC,CAA7B,CAuBP,GAAMC,OAAM,CAAGN,EAAE,CAAC,SAAD,CAAjB,CAEA,MAAO,IAAMO,UAAoB,CAAG,SAACC,CAAD,KAAQC,EAAR,wDAAqB,EAArB,OAClCH,OAAM,CAACE,CAAD,CAAQC,CAAR,CAD4B,CAA7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./MixSpace.css";import{cn}from"../../utils/bem";var cnSpace=cn("MixSpace");export var cnMixSpace=function(a){var b=a.p,c=a.m,d=a.pV,e=a.pH,f=a.mV,g=a.mH,h=a.mT,i=a.mL,j=a.mR,k=a.mB,l=a.pT,m=a.pL,n=a.pR,o=a.pB;return cnSpace({pT:l||d||b,pL:m||e||b,pR:n||e||b,pB:o||d||b,mT:h||f||c,mL:i||g||c,mR:j||g||c,mB:k||f||c})};
|
|
1
|
+
import"./MixSpace.css";import{cn}from"../../utils/bem";var cnSpace=cn("MixSpace");export var cnMixSpace=function(a){if(!a)return"";var b=a.p,c=a.m,d=a.pV,e=a.pH,f=a.mV,g=a.mH,h=a.mT,i=a.mL,j=a.mR,k=a.mB,l=a.pT,m=a.pL,n=a.pR,o=a.pB;return cnSpace({pT:l||d||b,pL:m||e||b,pR:n||e||b,pB:o||d||b,mT:h||f||c,mL:i||g||c,mR:j||g||c,mB:k||f||c})};
|
|
2
2
|
//# sourceMappingURL=MixSpace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MixSpace.js","names":["cn","cnSpace","cnMixSpace","p","m","pV","pH","mV","mH","mT","mL","mR","mB","pT","pL","pR","pB"],"sources":["../../../../../src/mixs/MixSpace/MixSpace.tsx"],"sourcesContent":["import './MixSpace.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { MixSpaceProps } from './types';\n\ntype CnMixSpace = (props
|
|
1
|
+
{"version":3,"file":"MixSpace.js","names":["cn","cnSpace","cnMixSpace","props","p","m","pV","pH","mV","mH","mT","mL","mR","mB","pT","pL","pR","pB"],"sources":["../../../../../src/mixs/MixSpace/MixSpace.tsx"],"sourcesContent":["import './MixSpace.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { MixSpaceProps } from './types';\n\ntype CnMixSpace = (props?: MixSpaceProps) => string;\n\nconst cnSpace = cn('MixSpace');\n\nexport const cnMixSpace: CnMixSpace = (props) => {\n if (!props) return '';\n const { p, m, pV, pH, mV, mH, mT, mL, mR, mB, pT, pL, pR, pB } = props;\n return cnSpace({\n pT: pT || pV || p,\n pL: pL || pH || p,\n pR: pR || pH || p,\n pB: pB || pV || p,\n mT: mT || mV || m,\n mL: mL || mH || m,\n mR: mR || mH || m,\n mB: mB || mV || m,\n });\n};\n"],"mappings":"AAAA,uBAEA,OAASA,EAAT,uBAMA,GAAMC,QAAO,CAAGD,EAAE,CAAC,UAAD,CAAlB,CAEA,MAAO,IAAME,WAAsB,CAAG,SAACC,CAAD,CAAW,CAC/C,GAAI,CAACA,CAAL,CAAY,MAAO,EAAP,CACZ,GAAQC,EAAR,CAAiED,CAAjE,CAAQC,CAAR,CAAWC,CAAX,CAAiEF,CAAjE,CAAWE,CAAX,CAAcC,CAAd,CAAiEH,CAAjE,CAAcG,EAAd,CAAkBC,CAAlB,CAAiEJ,CAAjE,CAAkBI,EAAlB,CAAsBC,CAAtB,CAAiEL,CAAjE,CAAsBK,EAAtB,CAA0BC,CAA1B,CAAiEN,CAAjE,CAA0BM,EAA1B,CAA8BC,CAA9B,CAAiEP,CAAjE,CAA8BO,EAA9B,CAAkCC,CAAlC,CAAiER,CAAjE,CAAkCQ,EAAlC,CAAsCC,CAAtC,CAAiET,CAAjE,CAAsCS,EAAtC,CAA0CC,CAA1C,CAAiEV,CAAjE,CAA0CU,EAA1C,CAA8CC,CAA9C,CAAiEX,CAAjE,CAA8CW,EAA9C,CAAkDC,CAAlD,CAAiEZ,CAAjE,CAAkDY,EAAlD,CAAsDC,CAAtD,CAAiEb,CAAjE,CAAsDa,EAAtD,CAA0DC,CAA1D,CAAiEd,CAAjE,CAA0Dc,EAA1D,CACA,MAAOhB,QAAO,CAAC,CACba,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYF,CADH,CAEbW,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYH,CAFH,CAGbY,EAAE,CAAEA,CAAE,EAAIT,CAAN,EAAYH,CAHH,CAIba,EAAE,CAAEA,CAAE,EAAIX,CAAN,EAAYF,CAJH,CAKbM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYH,CALH,CAMbM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYJ,CANH,CAObO,EAAE,CAAEA,CAAE,EAAIH,CAAN,EAAYJ,CAPH,CAQbQ,EAAE,CAAEA,CAAE,EAAIL,CAAN,EAAYH,CARH,CAAD,CAUf,CAbM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementSize.js","names":["getElementSize","fn"],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/getElementSize.ts"],"sourcesContent":["import { getElementSize as fn } from '##/hooks/useResizeObserved/getElementSize';\n\n/**\n * @deprecated use import { getElementSize } from '@consta/uikit/useResizeObserved'\n */\nexport const getElementSize = fn;\n"],"mappings":"AAAA,OAASA,cAAc,GAAIC,GAA3B,uDAKA,MAAO,IAAMD,eAAc,CAAGC,EAAvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/index.ts"],"sourcesContent":["export * from './useComponentSize';\nexport * from './getElementSize';\nexport * from './types';\n"],"mappings":"AAAA,gCACA,8BACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/types.ts"],"sourcesContent":["export type ComponentSize = {\n width: number;\n height: number;\n};\n"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../../../hooks/useResizeObserved";export var useComponentSize=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return useResizeObserved(useMemo(function(){return[a]},[a.current].concat(_toConsumableArray(b))),getElementSize)[0]};
|
|
2
|
+
//# sourceMappingURL=useComponentSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","deps","current"],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n deps: unknown[] = [],\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current, ...deps],\n ),\n getElementSize,\n )[0];\n"],"mappings":"yEAAA,OAASA,OAAT,KAAwB,OAAxB,CAEA,OAASC,cAAT,CAAyBC,iBAAzB,wCAIA,MAAO,IAAMC,iBAAgB,CAAG,SAC9BC,CAD8B,KAE9BC,EAF8B,wDAEZ,EAFY,OAI9BH,kBAAiB,CACfF,OAAO,CACL,iBAAM,CAACI,CAAD,CAAN,CADK,EAGJA,CAAG,CAACE,OAHA,4BAGYD,CAHZ,GADQ,CAMfJ,cANe,CAAjB,CAOE,CAPF,CAJ8B,CAAzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useResizeObservedAtom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useResizeObservedAtom/index.ts"],"sourcesContent":["export * from './useResizeObservedAtom';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}import{useAction,useUpdate}from"@reatom/npm-react";import{useEffect,useMemo}from"react";import{useCreateAtom}from"../useCreateAtom";import{useSendToAtom}from"../useSendToAtom";export var useResizeObservedAtom=function(a,b){var c=useSendToAtom([b]),d=useCreateAtom([]),e=useAction(function(b){return d(b,b.get(a).map(function(a){return b.get(c)[0](a)}))}),f=useMemo(function(){return new ResizeObserver(e)},[]);return useUpdate(function(a,b){e(),f.disconnect();var c,d=_createForOfIteratorHelper(b);try{for(d.s();!(c=d.n()).done;){var g=c.value;g&&f.observe(g)}}catch(a){d.e(a)}finally{d.f()}},[a]),useEffect(function(){return function(){f.disconnect()}},[]),d};
|
|
2
|
+
//# sourceMappingURL=useResizeObservedAtom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeObservedAtom.js","names":["useAction","useUpdate","useEffect","useMemo","useCreateAtom","useSendToAtom","useResizeObservedAtom","elementsAtom","mapper","mapperAtom","stateAtom","update","ctx","get","map","el","resizeObserver","ResizeObserver","elements","disconnect","observe"],"sources":["../../../../../../src/utils/state/useResizeObservedAtom/useResizeObservedAtom.ts"],"sourcesContent":["import { AtomMut } from '@reatom/framework';\nimport { useAction, useUpdate } from '@reatom/npm-react';\nimport { useEffect, useMemo } from 'react';\n\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\nimport { useSendToAtom } from '##/utils/state/useSendToAtom';\n\nexport const useResizeObservedAtom = <\n ELEMENT extends HTMLElement | null,\n RETURN_TYPE,\n>(\n elementsAtom: AtomMut<ELEMENT[]>,\n mapper: (el: ELEMENT | null) => RETURN_TYPE,\n) => {\n const mapperAtom = useSendToAtom([mapper]);\n const stateAtom = useCreateAtom<(RETURN_TYPE | undefined)[]>([]);\n\n const update = useAction((ctx) =>\n stateAtom(\n ctx,\n ctx.get(elementsAtom).map((el) => ctx.get(mapperAtom)[0](el)),\n ),\n );\n\n const resizeObserver = useMemo(() => new ResizeObserver(update), []);\n\n useUpdate(\n (ctx, elements) => {\n update();\n resizeObserver.disconnect();\n for (const el of elements) {\n el && resizeObserver.observe(el);\n }\n },\n [elementsAtom],\n );\n\n useEffect(() => {\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n return stateAtom;\n};\n"],"mappings":"qpCACA,OAASA,SAAT,CAAoBC,SAApB,KAAqC,mBAArC,CACA,OAASC,SAAT,CAAoBC,OAApB,KAAmC,OAAnC,CAEA,OAASC,aAAT,wBACA,OAASC,aAAT,wBAEA,MAAO,IAAMC,sBAAqB,CAAG,SAInCC,CAJmC,CAKnCC,CALmC,CAMhC,IACGC,EAAU,CAAGJ,aAAa,CAAC,CAACG,CAAD,CAAD,CAD7B,CAEGE,CAAS,CAAGN,aAAa,CAA8B,EAA9B,CAF5B,CAIGO,CAAM,CAAGX,SAAS,CAAC,SAACY,CAAD,QACvBF,EAAS,CACPE,CADO,CAEPA,CAAG,CAACC,GAAJ,CAAQN,CAAR,EAAsBO,GAAtB,CAA0B,SAACC,CAAD,QAAQH,EAAG,CAACC,GAAJ,CAAQJ,CAAR,EAAoB,CAApB,EAAuBM,CAAvB,CAAR,CAA1B,CAFO,CADc,CAAD,CAJrB,CAWGC,CAAc,CAAGb,OAAO,CAAC,iBAAM,IAAIc,eAAJ,CAAmBN,CAAnB,CAAN,CAAD,CAAmC,EAAnC,CAX3B,CA8BH,MAjBAV,UAAS,CACP,SAACW,CAAD,CAAMM,CAAN,CAAmB,CACjBP,CAAM,EADW,CAEjBK,CAAc,CAACG,UAAf,EAFiB,oCAGAD,CAHA,MAGjB,2BAA2B,IAAhBH,EAAgB,SACzBA,CAAE,EAAIC,CAAc,CAACI,OAAf,CAAuBL,CAAvB,CACP,CALgB,+BAMlB,CAPM,CAQP,CAACR,CAAD,CARO,CAiBT,CANAL,SAAS,CAAC,UAAM,CACd,MAAO,WAAM,CACXc,CAAc,CAACG,UAAf,EACD,CACF,CAJQ,CAIN,EAJM,CAMT,CAAOT,CACR,CArCM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consta/uikit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.27.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ui-kit",
|
|
6
6
|
"design-system",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@bem-react/classname": "^1.6.0",
|
|
18
18
|
"@bem-react/classnames": "^1.3.10",
|
|
19
|
-
"@consta/icons": "^1.
|
|
19
|
+
"@consta/icons": "^1.3.0",
|
|
20
|
+
"@consta/table": "^0.7.0",
|
|
20
21
|
"@reatom/core": "^3.10.1",
|
|
21
22
|
"@reatom/npm-react": "^3.10.6",
|
|
22
23
|
"compute-scroll-into-view": "^3.1.1",
|