@foxford/ui 2.82.0-beta-2c266bb-20251002 → 2.83.0-beta-4ae8299-20251007
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/components/AccordionItem/AccordionItem.js +1 -1
- package/components/AccordionItem/AccordionItem.js.map +1 -1
- package/components/AccordionItem/AccordionItem.mjs +1 -1
- package/components/AccordionItem/AccordionItem.mjs.map +1 -1
- package/components/AccordionItem/useAccordionPanel.js +2 -0
- package/components/AccordionItem/useAccordionPanel.js.map +1 -0
- package/components/AccordionItem/useAccordionPanel.mjs +2 -0
- package/components/AccordionItem/useAccordionPanel.mjs.map +1 -0
- package/components/AccordionItem/useAccordionPanelProps.js +2 -0
- package/components/AccordionItem/useAccordionPanelProps.js.map +1 -0
- package/components/AccordionItem/useAccordionPanelProps.mjs +2 -0
- package/components/AccordionItem/useAccordionPanelProps.mjs.map +1 -0
- package/components/ProgressCircle/ProgressCircle.js +1 -1
- package/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
- package/components/ProgressLine/style.js +1 -1
- package/components/ProgressLine/style.js.map +1 -1
- package/components/ProgressLine/style.mjs +1 -1
- package/components/ProgressLine/style.mjs.map +1 -1
- package/hooks/useClickOutside.js +1 -1
- package/hooks/useClickOutside.js.map +1 -1
- package/hooks/useClickOutside.mjs +1 -1
- package/hooks/useClickOutside.mjs.map +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useResizeObserver.mjs +1 -1
- package/hooks/useResizeObserver.mjs.map +1 -1
- package/package.json +2 -2
- package/shared/utils/dom.js +1 -1
- package/shared/utils/dom.js.map +1 -1
- package/shared/utils/dom.mjs +1 -1
- package/shared/utils/dom.mjs.map +1 -1
- package/shared/utils/getDomTargets.js +2 -0
- package/shared/utils/getDomTargets.js.map +1 -0
- package/shared/utils/getDomTargets.mjs +2 -0
- package/shared/utils/getDomTargets.mjs.map +1 -0
- package/shared/utils/getProgressPercent.js +2 -0
- package/shared/utils/getProgressPercent.js.map +1 -0
- package/shared/utils/getProgressPercent.mjs +2 -0
- package/shared/utils/getProgressPercent.mjs.map +1 -0
- package/shared/utils/misc.js +1 -1
- package/shared/utils/misc.js.map +1 -1
- package/shared/utils/misc.mjs +1 -1
- package/shared/utils/misc.mjs.map +1 -1
- package/components/AccordionItem/hooks.js +0 -2
- package/components/AccordionItem/hooks.js.map +0 -1
- package/components/AccordionItem/hooks.mjs +0 -2
- package/components/AccordionItem/hooks.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var nanoid=require('nanoid');var withMergedProps=require('../../hocs/withMergedProps.js');var
|
|
1
|
+
'use strict';var React=require('react');var nanoid=require('nanoid');var withMergedProps=require('../../hocs/withMergedProps.js');var useAccordionPanel=require('./useAccordionPanel.js');var useAccordionPanelProps=require('./useAccordionPanelProps.js');var sizes=require('./sizes.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');var Icon=require('../Icon/Icon.js');const AccordionItem=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:n="m",defaultExpanded:i=!1,headingAs:t="h3",borderRadius:o=0,sizeXXS:r,sizeXS:a,sizeS:d,sizeM:c,sizeL:l,sizeXL:u,id:x,header:p,addon:j,content:E,title:m,subtitle:R,icon:S,panel:h,children:z,loading:y,disabled:I,expanded:P,embedded:b,onExpandedChange:D,...A}=useAccordionPanelProps.useAccordionPanelProps(e);const T={size:n,sizeXXS:r,sizeXS:a,sizeS:d,sizeM:c,sizeL:l,sizeXL:u};const f={...T,preset:'brand',name:'chevronDown',sizes:sizes.SIZES_ICON};const g={...T,as:'span',appearance:'subheading-compact',wordBreak:'break-word',color:'inherit',sizes:sizes.SIZES_TITLE};const k={...T,as:'span',appearance:'body',wordBreak:'break-word',color:'inherit',sizes:sizes.SIZES_SUBTITLE};const{panelExpanded:_,setPanelExpanded:v}=useAccordionPanel.useAccordionPanel({id:x,expanded:P,defaultExpanded:i,onExpandedChange:D});const[w,M]=React.useState(_);const Z=React.useMemo((()=>nanoid.nanoid()),[]);const q=React.useMemo((()=>nanoid.nanoid()),[]);return React.useLayoutEffect((()=>{_&&M(!0)}),[_]),jsxRuntime.jsxs(style.Root,{...A,...T,id:x,disabled:I,loading:y,expanded:_,borderRadius:o,"data-accordion-item":!0,ref:s,children:[jsxRuntime.jsx(style.Heading,{as:t,onClick:()=>{I||v(!_)},children:jsxRuntime.jsx(style.Button,{id:Z,type:"button","data-accordion-control":!0,"aria-controls":q,"aria-expanded":w,"aria-disabled":Boolean(w&&(I||P!==void 0&&!D)),disabled:I,onClick:e=>{e.stopPropagation(),v(!_)},children:y?jsxRuntime.jsx(style.Header,{...T,sizes:b?sizes.SIZES_HEADER_EMBEDDED:sizes.SIZES_HEADER,children:jsxRuntime.jsx(style.Content,{children:jsxRuntime.jsx(Skeleton.Skeleton,{as:"span",borderRadius:4,width:"90%","data-accordion-skeleton":!0,children:jsxRuntime.jsx(Text.Text,{...g})})})}):React.isValidElement(p)?p:typeof p=='function'?p({titleProps:g,subtitleProps:k,iconProps:f}):jsxRuntime.jsxs(style.Header,{...T,sizes:b?sizes.SIZES_HEADER_EMBEDDED:sizes.SIZES_HEADER,children:[j,jsxRuntime.jsx(style.Content,{children:React.isValidElement(E)?E:typeof E=='function'?E({titleProps:g,subtitleProps:k}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[React.isValidElement(m)?m:typeof m=='function'?m(g):typeof m=='string'||typeof m=='number'?jsxRuntime.jsx(Text.Text,{...g,children:m}):null,React.isValidElement(R)?R:typeof R=='function'?R(k):typeof R=='string'||typeof R=='number'?jsxRuntime.jsx(Text.Text,{...k,children:R}):null]})}),jsxRuntime.jsx(style.IconAnimation,{up:_,children:React.isValidElement(S)?S:typeof S=='function'?S(f):jsxRuntime.jsx(Icon.Icon,{...f})})]})})}),jsxRuntime.jsx(style.Panel,{id:q,role:"region","aria-labelledby":Z,hidden:!w,onTransitionEnd:e=>{e.propertyName!=='opacity'||_||M(!1)},children:y?jsxRuntime.jsxs(style.Details,{...T,sizes:b?sizes.SIZES_DETAILS_EMBEDDED:sizes.SIZES_DETAILS,children:[jsxRuntime.jsx(Skeleton.Skeleton,{as:"span",borderRadius:4,width:"100%",marginBottom:"0.4em",children:jsxRuntime.jsx(Text.Text,{...k})}),jsxRuntime.jsx(Skeleton.Skeleton,{as:"span",borderRadius:4,width:"70%",children:jsxRuntime.jsx(Text.Text,{...k})})]}):React.isValidElement(h)?h:jsxRuntime.jsx(style.Details,{...T,sizes:b?sizes.SIZES_DETAILS_EMBEDDED:sizes.SIZES_DETAILS,children:z})})]})})),{displayName:'AccordionItem',sizes:sizes.SIZES});exports.AccordionItem=AccordionItem;
|
|
2
2
|
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.js","sources":["../../../../src/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement, useLayoutEffect, useMemo } from 'react'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useAccordionPanel, useAccordionPanelProps } from './hooks'\nimport {\n SIZES,\n SIZES_HEADER,\n SIZES_HEADER_EMBEDDED,\n SIZES_DETAILS,\n SIZES_DETAILS_EMBEDDED,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_ICON,\n} from './sizes'\nimport type { AccordionItemProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'AccordionItem'\n\n/**\n *\n * Компонент для создания сворачиваемой секции контента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<section\\> элемента.\n *\n * Дизайн соответствует [рекомендациям WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * @visibleName Accordion.Item\n */\nconst AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps> = withMergedProps<\n AccordionItemProps,\n HTMLElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n defaultExpanded = false,\n headingAs = 'h3',\n borderRadius = 0,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n id,\n header,\n addon,\n content,\n title,\n subtitle,\n icon,\n panel,\n children,\n loading,\n disabled,\n expanded,\n embedded,\n onExpandedChange,\n ...restProps\n } = useAccordionPanelProps(props)\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'chevronDown',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'subheading-compact',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_SUBTITLE,\n }\n\n const { panelExpanded, setPanelExpanded } = useAccordionPanel({\n id,\n expanded,\n defaultExpanded,\n onExpandedChange,\n })\n\n const [panelVisible, setPanelVisible] = useState<boolean>(panelExpanded)\n\n const controlId = useMemo(() => nanoid(), [])\n const panelId = useMemo(() => nanoid(), [])\n\n useLayoutEffect(() => {\n if (panelExpanded) setPanelVisible(true)\n }, [panelExpanded])\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n id={id}\n disabled={disabled}\n loading={loading}\n expanded={panelExpanded}\n borderRadius={borderRadius}\n data-accordion-item\n ref={ref}\n >\n <Styled.Heading\n as={headingAs}\n onClick={() => {\n if (!disabled) {\n setPanelExpanded(!panelExpanded)\n }\n }}\n >\n <Styled.Button\n id={controlId}\n type='button'\n data-accordion-control\n aria-controls={panelId}\n aria-expanded={panelVisible}\n aria-disabled={Boolean(panelVisible && (disabled || (expanded !== undefined && !onExpandedChange)))}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n setPanelExpanded(!panelExpanded)\n }}\n >\n {loading ? (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n <Styled.Content>\n <Skeleton as='span' borderRadius={4} width='90%' data-accordion-skeleton>\n <Text {...titleProps} />\n </Skeleton>\n </Styled.Content>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n titleProps,\n subtitleProps,\n iconProps,\n })\n ) : (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n {addon}\n <Styled.Content>\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n titleProps,\n subtitleProps,\n })\n ) : (\n <>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n </>\n )}\n </Styled.Content>\n <Styled.IconAnimation up={panelExpanded}>\n {isValidElement(icon) ? icon : typeof icon === 'function' ? icon(iconProps) : <Icon {...iconProps} />}\n </Styled.IconAnimation>\n </Styled.Header>\n )}\n </Styled.Button>\n </Styled.Heading>\n <Styled.Panel\n id={panelId}\n role='region'\n aria-labelledby={controlId}\n hidden={!panelVisible}\n onTransitionEnd={(evt) => {\n if (evt.propertyName === 'opacity' && !panelExpanded) {\n setPanelVisible(false)\n }\n }}\n >\n {loading ? (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n <Skeleton as='span' borderRadius={4} width='100%' marginBottom='0.4em'>\n <Text {...subtitleProps} />\n </Skeleton>\n <Skeleton as='span' borderRadius={4} width='70%'>\n <Text {...subtitleProps} />\n </Skeleton>\n </Styled.Details>\n ) : isValidElement(panel) ? (\n panel\n ) : (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n {children}\n </Styled.Details>\n )}\n </Styled.Panel>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { AccordionItem }\n"],"names":["AccordionItem","withMergedProps","forwardRef","props","ref","size","defaultExpanded","headingAs","borderRadius","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","id","header","addon","content","title","subtitle","icon","panel","children","loading","disabled","expanded","embedded","onExpandedChange","restProps","useAccordionPanelProps","sizeProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","wordBreak","color","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","panelExpanded","setPanelExpanded","useAccordionPanel","panelVisible","setPanelVisible","useState","controlId","useMemo","nanoid","panelId","useLayoutEffect","_jsxs","Styled","_jsx","jsx","onClick","type","Boolean","undefined","evt","stopPropagation","SIZES_HEADER_EMBEDDED","SIZES_HEADER","Skeleton","width","Text","isValidElement","jsxs","_Fragment","up","Icon","role","hidden","onTransitionEnd","propertyName","SIZES_DETAILS_EMBEDDED","SIZES_DETAILS","marginBottom","displayName","SIZES"],"mappings":"sYAkCMA,MAAAA,cAAqEC,gBAAAA,gBAIzEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,gBACVA,GAAkB,EAAKC,UACvBA,EAAY,KAAIC,aAChBA,EAAe,EAACC,QAChBA,EAAOC,OACPA,E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,SACL,kBAAiBzB,EACjB0B,QAAS7B,EACT8B,gBAAkBd,IACZA,EAAIe,eAAiB,WAAclC,GACrCI,GAAgB,EAClB,EACA1B,SAEDC,EACCgC,WAAAgB,KAACf,cAAc,IAAK1B,EAAWI,MAAOR,EAAWqD,MAAAA,uBAAyBC,MAAcA,cAAA1D,SAAA,CACtFmC,WAAAC,IAACS,kBAAQ,CAAC9B,GAAG,OAAO9B,aAAc,EAAG6D,MAAM,OAAOa,aAAa,QAAO3D,SACpEmC,WAAAC,IAACW,UAAI,IAAK3B,MAEZe,WAAAC,IAACS,kBAAQ,CAAC9B,GAAG,OAAO9B,aAAc,EAAG6D,MAAM,MAAK9C,SAC9CmC,WAAAC,IAACW,UAAI,IAAK3B,SAGZ4B,MAAcA,eAACjD,GACjBA,EAEAoC,WAAAA,IAACD,MAAAA,QAAc,IAAK1B,EAAWI,MAAOR,EAAWqD,MAAAA,uBAAyBC,MAAcA,cAAA1D,SACrFA,QAIK,IAGlB,CACE4D,YAtNmB,gBAuNnBhD,MAAOiD,MAAAA"}
|
|
1
|
+
{"version":3,"file":"AccordionItem.js","sources":["../../../../src/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement, useLayoutEffect, useMemo } from 'react'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useAccordionPanel } from './useAccordionPanel'\nimport { useAccordionPanelProps } from './useAccordionPanelProps'\nimport {\n SIZES,\n SIZES_HEADER,\n SIZES_HEADER_EMBEDDED,\n SIZES_DETAILS,\n SIZES_DETAILS_EMBEDDED,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_ICON,\n} from './sizes'\nimport type { AccordionItemProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'AccordionItem'\n\n/**\n *\n * Компонент для создания сворачиваемой секции контента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<section\\> элемента.\n *\n * Дизайн соответствует [рекомендациям WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * @visibleName Accordion.Item\n */\nconst AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps> = withMergedProps<\n AccordionItemProps,\n HTMLElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n defaultExpanded = false,\n headingAs = 'h3',\n borderRadius = 0,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n id,\n header,\n addon,\n content,\n title,\n subtitle,\n icon,\n panel,\n children,\n loading,\n disabled,\n expanded,\n embedded,\n onExpandedChange,\n ...restProps\n } = useAccordionPanelProps(props)\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'chevronDown',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'subheading-compact',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_SUBTITLE,\n }\n\n const { panelExpanded, setPanelExpanded } = useAccordionPanel({\n id,\n expanded,\n defaultExpanded,\n onExpandedChange,\n })\n\n const [panelVisible, setPanelVisible] = useState<boolean>(panelExpanded)\n\n const controlId = useMemo(() => nanoid(), [])\n const panelId = useMemo(() => nanoid(), [])\n\n useLayoutEffect(() => {\n if (panelExpanded) setPanelVisible(true)\n }, [panelExpanded])\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n id={id}\n disabled={disabled}\n loading={loading}\n expanded={panelExpanded}\n borderRadius={borderRadius}\n data-accordion-item\n ref={ref}\n >\n <Styled.Heading\n as={headingAs}\n onClick={() => {\n if (!disabled) {\n setPanelExpanded(!panelExpanded)\n }\n }}\n >\n <Styled.Button\n id={controlId}\n type='button'\n data-accordion-control\n aria-controls={panelId}\n aria-expanded={panelVisible}\n aria-disabled={Boolean(panelVisible && (disabled || (expanded !== undefined && !onExpandedChange)))}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n setPanelExpanded(!panelExpanded)\n }}\n >\n {loading ? (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n <Styled.Content>\n <Skeleton as='span' borderRadius={4} width='90%' data-accordion-skeleton>\n <Text {...titleProps} />\n </Skeleton>\n </Styled.Content>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n titleProps,\n subtitleProps,\n iconProps,\n })\n ) : (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n {addon}\n <Styled.Content>\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n titleProps,\n subtitleProps,\n })\n ) : (\n <>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n </>\n )}\n </Styled.Content>\n <Styled.IconAnimation up={panelExpanded}>\n {isValidElement(icon) ? icon : typeof icon === 'function' ? icon(iconProps) : <Icon {...iconProps} />}\n </Styled.IconAnimation>\n </Styled.Header>\n )}\n </Styled.Button>\n </Styled.Heading>\n <Styled.Panel\n id={panelId}\n role='region'\n aria-labelledby={controlId}\n hidden={!panelVisible}\n onTransitionEnd={(evt) => {\n if (evt.propertyName === 'opacity' && !panelExpanded) {\n setPanelVisible(false)\n }\n }}\n >\n {loading ? (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n <Skeleton as='span' borderRadius={4} width='100%' marginBottom='0.4em'>\n <Text {...subtitleProps} />\n </Skeleton>\n <Skeleton as='span' borderRadius={4} width='70%'>\n <Text {...subtitleProps} />\n </Skeleton>\n </Styled.Details>\n ) : isValidElement(panel) ? (\n panel\n ) : (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n {children}\n </Styled.Details>\n )}\n </Styled.Panel>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { AccordionItem }\n"],"names":["AccordionItem","withMergedProps","forwardRef","props","ref","size","defaultExpanded","headingAs","borderRadius","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","id","header","addon","content","title","subtitle","icon","panel","children","loading","disabled","expanded","embedded","onExpandedChange","restProps","useAccordionPanelProps","sizeProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","wordBreak","color","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","panelExpanded","setPanelExpanded","useAccordionPanel","panelVisible","setPanelVisible","useState","controlId","useMemo","nanoid","panelId","useLayoutEffect","_jsxs","Styled","_jsx","jsx","onClick","type","Boolean","undefined","evt","stopPropagation","SIZES_HEADER_EMBEDDED","SIZES_HEADER","Skeleton","width","Text","isValidElement","jsxs","_Fragment","up","Icon","role","hidden","onTransitionEnd","propertyName","SIZES_DETAILS_EMBEDDED","SIZES_DETAILS","marginBottom","displayName","SIZES"],"mappings":"geAmCMA,MAAAA,cAAqEC,gBAAAA,gBAIzEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,gBACVA,GAAkB,EAAKC,UACvBA,EAAY,KAA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AAAC,IAACF,YAAY,CACX1C,GAAIuC,EACJsB,KAAK,SACL,kBAAiBzB,EACjB0B,QAAS7B,EACT8B,gBAAkBd,IACZA,EAAIe,eAAiB,WAAclC,GACrCI,GAAgB,EAClB,EACA1B,SAEDC,EACCgC,WAAAgB,KAACf,cAAc,IAAK1B,EAAWI,MAAOR,EAAWqD,MAAAA,uBAAyBC,MAAcA,cAAA1D,SAAA,CACtFmC,WAAAC,IAACS,kBAAQ,CAAC9B,GAAG,OAAO9B,aAAc,EAAG6D,MAAM,OAAOa,aAAa,QAAO3D,SACpEmC,WAAAC,IAACW,UAAI,IAAK3B,MAEZe,WAAAC,IAACS,kBAAQ,CAAC9B,GAAG,OAAO9B,aAAc,EAAG6D,MAAM,MAAK9C,SAC9CmC,WAAAC,IAACW,UAAI,IAAK3B,SAGZ4B,MAAcA,eAACjD,GACjBA,EAEAoC,WAAAA,IAACD,MAAAA,QAAc,IAAK1B,EAAWI,MAAOR,EAAWqD,MAAAA,uBAAyBC,MAAcA,cAAA1D,SACrFA,QAIK,IAGlB,CACE4D,YAtNmB,gBAuNnBhD,MAAOiD,MAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef,useState,useMemo,useLayoutEffect,isValidElement}from'react';import{nanoid}from'nanoid';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{
|
|
1
|
+
import{forwardRef,useState,useMemo,useLayoutEffect,isValidElement}from'react';import{nanoid}from'nanoid';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useAccordionPanel}from'./useAccordionPanel.mjs';import{useAccordionPanelProps}from'./useAccordionPanelProps.mjs';import{SIZES,SIZES_HEADER_EMBEDDED,SIZES_HEADER,SIZES_DETAILS_EMBEDDED,SIZES_DETAILS,SIZES_ICON,SIZES_TITLE,SIZES_SUBTITLE}from'./sizes.mjs';import{Root,Heading,Button,Header,Content,IconAnimation,Panel,Details}from'./style.mjs';import{jsxs,jsx,Fragment}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';import{Icon}from'../Icon/Icon.mjs';const AccordionItem=withMergedProps(forwardRef(((e,o)=>{const{size:n="m",defaultExpanded:i=!1,headingAs:s="h3",borderRadius:t=0,sizeXXS:r,sizeXS:d,sizeS:a,sizeM:l,sizeL:c,sizeXL:E,id:p,header:S,addon:m,content:x,title:u,subtitle:I,icon:f,panel:h,children:D,loading:j,disabled:A,expanded:_,embedded:b,onExpandedChange:z,...T}=useAccordionPanelProps(e);const P={size:n,sizeXXS:r,sizeXS:d,sizeS:a,sizeM:l,sizeL:c,sizeXL:E};const Z={...P,preset:'brand',name:'chevronDown',sizes:SIZES_ICON};const g={...P,as:'span',appearance:'subheading-compact',wordBreak:'break-word',color:'inherit',sizes:SIZES_TITLE};const y={...P,as:'span',appearance:'body',wordBreak:'break-word',color:'inherit',sizes:SIZES_SUBTITLE};const{panelExpanded:L,setPanelExpanded:R}=useAccordionPanel({id:p,expanded:_,defaultExpanded:i,onExpandedChange:z});const[B,M]=useState(L);const k=useMemo((()=>nanoid()),[]);const w=useMemo((()=>nanoid()),[]);return useLayoutEffect((()=>{L&&M(!0)}),[L]),jsxs(Root,{...T,...P,id:p,disabled:A,loading:j,expanded:L,borderRadius:t,"data-accordion-item":!0,ref:o,children:[jsx(Heading,{as:s,onClick:()=>{A||R(!L)},children:jsx(Button,{id:k,type:"button","data-accordion-control":!0,"aria-controls":w,"aria-expanded":B,"aria-disabled":Boolean(B&&(A||_!==void 0&&!z)),disabled:A,onClick:e=>{e.stopPropagation(),R(!L)},children:j?jsx(Header,{...P,sizes:b?SIZES_HEADER_EMBEDDED:SIZES_HEADER,children:jsx(Content,{children:jsx(Skeleton,{as:"span",borderRadius:4,width:"90%","data-accordion-skeleton":!0,children:jsx(Text,{...g})})})}):isValidElement(S)?S:typeof S=='function'?S({titleProps:g,subtitleProps:y,iconProps:Z}):jsxs(Header,{...P,sizes:b?SIZES_HEADER_EMBEDDED:SIZES_HEADER,children:[m,jsx(Content,{children:isValidElement(x)?x:typeof x=='function'?x({titleProps:g,subtitleProps:y}):jsxs(Fragment,{children:[isValidElement(u)?u:typeof u=='function'?u(g):typeof u=='string'||typeof u=='number'?jsx(Text,{...g,children:u}):null,isValidElement(I)?I:typeof I=='function'?I(y):typeof I=='string'||typeof I=='number'?jsx(Text,{...y,children:I}):null]})}),jsx(IconAnimation,{up:L,children:isValidElement(f)?f:typeof f=='function'?f(Z):jsx(Icon,{...Z})})]})})}),jsx(Panel,{id:w,role:"region","aria-labelledby":k,hidden:!B,onTransitionEnd:e=>{e.propertyName!=='opacity'||L||M(!1)},children:j?jsxs(Details,{...P,sizes:b?SIZES_DETAILS_EMBEDDED:SIZES_DETAILS,children:[jsx(Skeleton,{as:"span",borderRadius:4,width:"100%",marginBottom:"0.4em",children:jsx(Text,{...y})}),jsx(Skeleton,{as:"span",borderRadius:4,width:"70%",children:jsx(Text,{...y})})]}):isValidElement(h)?h:jsx(Details,{...P,sizes:b?SIZES_DETAILS_EMBEDDED:SIZES_DETAILS,children:D})})]})})),{displayName:'AccordionItem',sizes:SIZES});export{AccordionItem};
|
|
2
2
|
//# sourceMappingURL=AccordionItem.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.mjs","sources":["../../../../src/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement, useLayoutEffect, useMemo } from 'react'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useAccordionPanel, useAccordionPanelProps } from './hooks'\nimport {\n SIZES,\n SIZES_HEADER,\n SIZES_HEADER_EMBEDDED,\n SIZES_DETAILS,\n SIZES_DETAILS_EMBEDDED,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_ICON,\n} from './sizes'\nimport type { AccordionItemProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'AccordionItem'\n\n/**\n *\n * Компонент для создания сворачиваемой секции контента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<section\\> элемента.\n *\n * Дизайн соответствует [рекомендациям WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * @visibleName Accordion.Item\n */\nconst AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps> = withMergedProps<\n AccordionItemProps,\n HTMLElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n defaultExpanded = false,\n headingAs = 'h3',\n borderRadius = 0,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n id,\n header,\n addon,\n content,\n title,\n subtitle,\n icon,\n panel,\n children,\n loading,\n disabled,\n expanded,\n embedded,\n onExpandedChange,\n ...restProps\n } = useAccordionPanelProps(props)\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'chevronDown',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'subheading-compact',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_SUBTITLE,\n }\n\n const { panelExpanded, setPanelExpanded } = useAccordionPanel({\n id,\n expanded,\n defaultExpanded,\n onExpandedChange,\n })\n\n const [panelVisible, setPanelVisible] = useState<boolean>(panelExpanded)\n\n const controlId = useMemo(() => nanoid(), [])\n const panelId = useMemo(() => nanoid(), [])\n\n useLayoutEffect(() => {\n if (panelExpanded) setPanelVisible(true)\n }, [panelExpanded])\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n id={id}\n disabled={disabled}\n loading={loading}\n expanded={panelExpanded}\n borderRadius={borderRadius}\n data-accordion-item\n ref={ref}\n >\n <Styled.Heading\n as={headingAs}\n onClick={() => {\n if (!disabled) {\n setPanelExpanded(!panelExpanded)\n }\n }}\n >\n <Styled.Button\n id={controlId}\n type='button'\n data-accordion-control\n aria-controls={panelId}\n aria-expanded={panelVisible}\n aria-disabled={Boolean(panelVisible && (disabled || (expanded !== undefined && !onExpandedChange)))}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n setPanelExpanded(!panelExpanded)\n }}\n >\n {loading ? (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n <Styled.Content>\n <Skeleton as='span' borderRadius={4} width='90%' data-accordion-skeleton>\n <Text {...titleProps} />\n </Skeleton>\n </Styled.Content>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n titleProps,\n subtitleProps,\n iconProps,\n })\n ) : (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n {addon}\n <Styled.Content>\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n titleProps,\n subtitleProps,\n })\n ) : (\n <>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n </>\n )}\n </Styled.Content>\n <Styled.IconAnimation up={panelExpanded}>\n {isValidElement(icon) ? icon : typeof icon === 'function' ? icon(iconProps) : <Icon {...iconProps} />}\n </Styled.IconAnimation>\n </Styled.Header>\n )}\n </Styled.Button>\n </Styled.Heading>\n <Styled.Panel\n id={panelId}\n role='region'\n aria-labelledby={controlId}\n hidden={!panelVisible}\n onTransitionEnd={(evt) => {\n if (evt.propertyName === 'opacity' && !panelExpanded) {\n setPanelVisible(false)\n }\n }}\n >\n {loading ? (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n <Skeleton as='span' borderRadius={4} width='100%' marginBottom='0.4em'>\n <Text {...subtitleProps} />\n </Skeleton>\n <Skeleton as='span' borderRadius={4} width='70%'>\n <Text {...subtitleProps} />\n </Skeleton>\n </Styled.Details>\n ) : isValidElement(panel) ? (\n panel\n ) : (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n {children}\n </Styled.Details>\n )}\n </Styled.Panel>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { AccordionItem }\n"],"names":["AccordionItem","withMergedProps","forwardRef","props","ref","size","defaultExpanded","headingAs","borderRadius","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","id","header","addon","content","title","subtitle","icon","panel","children","loading","disabled","expanded","embedded","onExpandedChange","restProps","useAccordionPanelProps","sizeProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","wordBreak","color","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","panelExpanded","setPanelExpanded","useAccordionPanel","panelVisible","setPanelVisible","useState","controlId","useMemo","nanoid","panelId","useLayoutEffect","_jsxs","Styled","_jsx","onClick","type","Boolean","undefined","evt","stopPropagation","SIZES_HEADER_EMBEDDED","SIZES_HEADER","Skeleton","width","Text","isValidElement","_Fragment","up","Icon","role","hidden","onTransitionEnd","propertyName","SIZES_DETAILS_EMBEDDED","SIZES_DETAILS","marginBottom","displayName","SIZES"],"mappings":"knBAkCMA,MAAAA,cAAqEC,gBAIzEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAC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WmD,uBAAyBC,cAAcxD,SAAA,CACtFmC,IAACS,SAAQ,CAAC7B,GAAG,OAAO9B,aAAc,EAAG4D,MAAM,OAAOY,aAAa,QAAOzD,SACpEmC,IAACW,KAAI,IAAK1B,MAEZe,IAACS,SAAQ,CAAC7B,GAAG,OAAO9B,aAAc,EAAG4D,MAAM,MAAK7C,SAC9CmC,IAACW,KAAI,IAAK1B,SAGZ2B,eAAehD,GACjBA,EAEAoC,IAACD,QAAc,IAAK1B,EAAWI,MAAOR,EAAWmD,uBAAyBC,cAAcxD,SACrFA,QAIK,IAGlB,CACE0D,YAtNmB,gBAuNnB9C,MAAO+C"}
|
|
1
|
+
{"version":3,"file":"AccordionItem.mjs","sources":["../../../../src/components/AccordionItem/AccordionItem.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement, useLayoutEffect, useMemo } from 'react'\nimport { nanoid } from 'nanoid'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport { useAccordionPanel } from './useAccordionPanel'\nimport { useAccordionPanelProps } from './useAccordionPanelProps'\nimport {\n SIZES,\n SIZES_HEADER,\n SIZES_HEADER_EMBEDDED,\n SIZES_DETAILS,\n SIZES_DETAILS_EMBEDDED,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n SIZES_ICON,\n} from './sizes'\nimport type { AccordionItemProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'AccordionItem'\n\n/**\n *\n * Компонент для создания сворачиваемой секции контента.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<section\\> элемента.\n *\n * Дизайн соответствует [рекомендациям WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * @visibleName Accordion.Item\n */\nconst AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps> = withMergedProps<\n AccordionItemProps,\n HTMLElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n defaultExpanded = false,\n headingAs = 'h3',\n borderRadius = 0,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n id,\n header,\n addon,\n content,\n title,\n subtitle,\n icon,\n panel,\n children,\n loading,\n disabled,\n expanded,\n embedded,\n onExpandedChange,\n ...restProps\n } = useAccordionPanelProps(props)\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const iconProps: IconProps = {\n ...sizeProps,\n preset: 'brand',\n name: 'chevronDown',\n sizes: SIZES_ICON,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'subheading-compact',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'body',\n wordBreak: 'break-word',\n color: 'inherit',\n sizes: SIZES_SUBTITLE,\n }\n\n const { panelExpanded, setPanelExpanded } = useAccordionPanel({\n id,\n expanded,\n defaultExpanded,\n onExpandedChange,\n })\n\n const [panelVisible, setPanelVisible] = useState<boolean>(panelExpanded)\n\n const controlId = useMemo(() => nanoid(), [])\n const panelId = useMemo(() => nanoid(), [])\n\n useLayoutEffect(() => {\n if (panelExpanded) setPanelVisible(true)\n }, [panelExpanded])\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n id={id}\n disabled={disabled}\n loading={loading}\n expanded={panelExpanded}\n borderRadius={borderRadius}\n data-accordion-item\n ref={ref}\n >\n <Styled.Heading\n as={headingAs}\n onClick={() => {\n if (!disabled) {\n setPanelExpanded(!panelExpanded)\n }\n }}\n >\n <Styled.Button\n id={controlId}\n type='button'\n data-accordion-control\n aria-controls={panelId}\n aria-expanded={panelVisible}\n aria-disabled={Boolean(panelVisible && (disabled || (expanded !== undefined && !onExpandedChange)))}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n setPanelExpanded(!panelExpanded)\n }}\n >\n {loading ? (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n <Styled.Content>\n <Skeleton as='span' borderRadius={4} width='90%' data-accordion-skeleton>\n <Text {...titleProps} />\n </Skeleton>\n </Styled.Content>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n titleProps,\n subtitleProps,\n iconProps,\n })\n ) : (\n <Styled.Header {...sizeProps} sizes={embedded ? SIZES_HEADER_EMBEDDED : SIZES_HEADER}>\n {addon}\n <Styled.Content>\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content({\n titleProps,\n subtitleProps,\n })\n ) : (\n <>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n </>\n )}\n </Styled.Content>\n <Styled.IconAnimation up={panelExpanded}>\n {isValidElement(icon) ? icon : typeof icon === 'function' ? icon(iconProps) : <Icon {...iconProps} />}\n </Styled.IconAnimation>\n </Styled.Header>\n )}\n </Styled.Button>\n </Styled.Heading>\n <Styled.Panel\n id={panelId}\n role='region'\n aria-labelledby={controlId}\n hidden={!panelVisible}\n onTransitionEnd={(evt) => {\n if (evt.propertyName === 'opacity' && !panelExpanded) {\n setPanelVisible(false)\n }\n }}\n >\n {loading ? (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n <Skeleton as='span' borderRadius={4} width='100%' marginBottom='0.4em'>\n <Text {...subtitleProps} />\n </Skeleton>\n <Skeleton as='span' borderRadius={4} width='70%'>\n <Text {...subtitleProps} />\n </Skeleton>\n </Styled.Details>\n ) : isValidElement(panel) ? (\n panel\n ) : (\n <Styled.Details {...sizeProps} sizes={embedded ? SIZES_DETAILS_EMBEDDED : SIZES_DETAILS}>\n {children}\n </Styled.Details>\n )}\n </Styled.Panel>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { AccordionItem }\n"],"names":["AccordionItem","withMergedProps","forwardRef","props","ref","size","defaultExpanded","headingAs","borderRadius","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","id","header","addon","content","title","subtitle","icon","panel","children","loading","disabled","expanded","embedded","onExpandedChange","restProps","useAccordionPanelProps","sizeProps","iconProps","preset","name","sizes","SIZES_ICON","titleProps","as","appearance","wordBreak","color","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","panelExpanded","setPanelExpanded","useAccordionPanel","panelVisible","setPanelVisible","useState","controlId","useMemo","nanoid","panelId","useLayoutEffect","_jsxs","Styled","_jsx","onClick","type","Boolean","undefined","evt","stopPropagation","SIZES_HEADER_EMBEDDED","SIZES_HEADER","Skeleton","width","Text","isValidElement","_Fragment","up","Icon","role","hidden","onTransitionEnd","propertyName","SIZES_DETAILS_EMBEDDED","SIZES_DETAILS","marginBottom","displayName","SIZES"],"mappings":"wqBAmCMA,MAAAA,cAAqEC,gBAIzEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,gBACVA,GAAkB,EAAKC,UACvBA,EAAY,KAAIC,aAChBA,EAAe,EAACC,QAChBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,GACNA,EAAEC,OACFA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,KACRA,EAAIC,MACJA,EAAKC,SACLA,EAAQC,QACRA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,SACRA,EAAQC,iB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AAcxD,SACrFA,QAIK,IAGlB,CACE0D,YAtNmB,gBAuNnB9C,MAAO+C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var React=require('react');var accordion=require('../../shared/context/accordion.js');exports.useAccordionPanel=({defaultExpanded:e=!1,id:n,expanded:a,onExpandedChange:t})=>{const d=React.useContext(accordion.AccordionPanelsContext);const[c,o]=React.useState(a??e);const r=d!==null&&typeof n=='string';return React.useLayoutEffect((()=>{r||a===void 0||o(a)}),[r,a]),{panelExpanded:r?d.expandedPanels.includes(n):c,setPanelExpanded:e=>{r?d.updatePanels(n,e):(a===void 0&&o(e),t&&t(e))}}};
|
|
2
|
+
//# sourceMappingURL=useAccordionPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordionPanel.js","sources":["../../../../src/components/AccordionItem/useAccordionPanel.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext } from 'shared/context/accordion'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels"],"mappings":"6HAIiCA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,iBAAWC,UAAAA,wBAE3B,MAAOC,EAAoBC,GAAyBC,MAAAA,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,MAAAA,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useContext,useState,useLayoutEffect}from'react';import{AccordionPanelsContext}from'../../shared/context/accordion.mjs';const useAccordionPanel=({defaultExpanded:e=!1,id:n,expanded:t,onExpandedChange:o})=>{const a=useContext(AccordionPanelsContext);const[d,s]=useState(t??e);const c=a!==null&&typeof n=='string';return useLayoutEffect((()=>{c||t===void 0||s(t)}),[c,t]),{panelExpanded:c?a.expandedPanels.includes(n):d,setPanelExpanded:e=>{c?a.updatePanels(n,e):(t===void 0&&s(e),o&&o(e))}}};export{useAccordionPanel};
|
|
2
|
+
//# sourceMappingURL=useAccordionPanel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordionPanel.mjs","sources":["../../../../src/components/AccordionItem/useAccordionPanel.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext } from 'shared/context/accordion'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels"],"mappings":"8HAIO,MAAMA,kBAAoBA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,WAAWC,wBAE3B,MAAOC,EAAoBC,GAAyBC,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var React=require('react');var accordion=require('../../shared/context/accordion.js');var misc=require('../../shared/utils/misc.js');exports.useAccordionPanelProps=e=>{const r=React.useContext(accordion.AccordionPropsContext);return r?misc.deepmerge(r,e):e};
|
|
2
|
+
//# sourceMappingURL=useAccordionPanelProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordionPanelProps.js","sources":["../../../../src/components/AccordionItem/useAccordionPanelProps.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["props","contextProps","useContext","AccordionPropsContext","deepmerge"],"mappings":"iLAI0CA,IACxC,MAAMC,EAAeC,iBAAWC,UAAAA,uBAEhC,OAAQF,EAAeG,KAASA,UAACH,EAAcD,GAASA,CAAK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useContext}from'react';import{AccordionPropsContext}from'../../shared/context/accordion.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';const useAccordionPanelProps=o=>{const e=useContext(AccordionPropsContext);return e?deepmerge(e,o):o};export{useAccordionPanelProps};
|
|
2
|
+
//# sourceMappingURL=useAccordionPanelProps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccordionPanelProps.mjs","sources":["../../../../src/components/AccordionItem/useAccordionPanelProps.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["useAccordionPanelProps","props","contextProps","useContext","AccordionPropsContext","deepmerge"],"mappings":"uJAIaA,MAAAA,uBAA6BC,IACxC,MAAMC,EAAeC,WAAWC,uBAEhC,OAAQF,EAAeG,UAAUH,EAAcD,GAASA,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var getProgressPercent=require('../../shared/utils/getProgressPercent.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');const ProgressCircle=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:r="s",max:t=1,sizeXXS:i,sizeXS:n,sizeS:o,sizeM:a,sizeL:c,sizeXL:l,value:u,children:g,...j}=e;const x={size:r,sizeXXS:i,sizeXS:n,sizeS:o,sizeM:a,sizeL:c,sizeXL:l};const P=getProgressPercent.getProgressPercent(u??-1,t);return jsxRuntime.jsxs(style.Root,{...j,...x,role:"progressbar","aria-valuemax":t,"aria-valuenow":u,value:u,ref:s,children:[jsxRuntime.jsxs(style.Svg,{children:[jsxRuntime.jsx(style.Circle,{}),typeof u=='number'?P>0?jsxRuntime.jsx(style.Circle,{strokeLinecap:"round",strokeDasharray:`${P}, 100`}):null:jsxRuntime.jsx(style.Circle,{strokeLinecap:"round"})]}),g!==void 0&&jsxRuntime.jsx(style.Content,{children:typeof g=='function'?g({value:u,max:t,percent:P,sizeProps:x}):g})]})})),{displayName:'ProgressCircle',sizes:constants.SIZES});exports.ProgressCircle=ProgressCircle;
|
|
2
2
|
//# sourceMappingURL=ProgressCircle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.js","sources":["../../../../src/components/ProgressCircle/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { getProgressPercent } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"ProgressCircle.js","sources":["../../../../src/components/ProgressCircle/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { getProgressPercent } from 'shared/utils/getProgressPercent'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { ProgressCircleProps } from './types'\n\nconst COMPONENT_NAME = 'ProgressCircle'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Переданный \"ref\" будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/ProgressCircle/types.ts).\n */\nconst ProgressCircle: React.ForwardRefExoticComponent<ProgressCircleProps> = withMergedProps<\n ProgressCircleProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<ProgressCircleProps>>((props, ref) => {\n const { size = 's', max = 1, sizeXXS, sizeXS, sizeS, sizeM, sizeL, sizeXL, value, children, ...restProps } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const percent = getProgressPercent(value ?? -1, max)\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n role='progressbar'\n aria-valuemax={max}\n aria-valuenow={value}\n value={value}\n ref={ref}\n >\n <Styled.Svg>\n <Styled.Circle />\n {typeof value === 'number' ? (\n percent > 0 ? (\n <Styled.Circle strokeLinecap='round' strokeDasharray={`${percent}, 100`} />\n ) : null\n ) : (\n <Styled.Circle strokeLinecap='round' />\n )}\n </Styled.Svg>\n {children !== undefined && (\n <Styled.Content>\n {typeof children === 'function' ? children({ value, max, percent, sizeProps }) : children}\n </Styled.Content>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ProgressCircle }\n"],"names":["ProgressCircle","withMergedProps","forwardRef","props","ref","size","max","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","value","children","restProps","sizeProps","percent","getProgressPercent","_jsxs","Styled","role","jsxs","_jsx","Circle","strokeLinecap","strokeDasharray","jsx","undefined","displayName","sizes","SIZES"],"mappings":"oSAoBMA,MAAAA,eAAuEC,gBAAAA,gBAI3EC,MAAAA,YAA6D,CAACC,EAAOC,KACnE,MAAMC,KAAEA,EAAO,IAAGC,IAAEA,EAAM,EAACC,QAAEA,EAAOC,OAAEA,EAAMC,MAAEA,EAAKC,MAAEA,EAAKC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAKC,SAAEA,KAAaC,GAAcZ,EAE7G,MAAMa,EAAY,CAChBX,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMK,EAAUC,mBAAAA,mBAAmBL,IAAU,EAAGP,GAEhD,OACEa,WAAAA,KAACC,MAAAA,KAAW,IACNL,KACAC,EACJK,KAAK,cACL,gBAAef,EACf,gBAAeO,EACfA,MAAOA,EACPT,IAAKA,EAAIU,SAETK,CAAAA,WAAAG,KAACF,UAAU,CAAAN,SAAA,CACTS,WAAAA,IAACH,MAAaI,OAAA,CAAE,UACRX,GAAU,SAChBI,EAAU,EACRM,WAAAA,IAACH,MAAAA,OAAa,CAACK,cAAc,QAAQC,gBAAiB,GAAGT,WACvD,KAEJM,WAAAI,IAACP,aAAa,CAACK,cAAc,aAGhCX,SAAac,GACZL,WAAAA,IAACH,MAAAA,QAAc,CAAAN,gBACLA,GAAa,WAAaA,EAAS,CAAED,QAAOP,MAAKW,UAASD,cAAeF,MAGzE,IAGlB,CACEe,YA5DmB,iBA6DnBC,MAAOC,UAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{getProgressPercent}from'../../shared/utils/
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{getProgressPercent}from'../../shared/utils/getProgressPercent.mjs';import{SIZES}from'./constants.mjs';import{Root,Svg,Circle,Content}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const ProgressCircle=withMergedProps(forwardRef(((e,r)=>{const{size:s="s",max:o=1,sizeXXS:i,sizeXS:t,sizeS:n,sizeM:a,sizeL:c,sizeXL:l,value:m,children:p,...z}=e;const g={size:s,sizeXXS:i,sizeXS:t,sizeS:n,sizeM:a,sizeL:c,sizeXL:l};const d=getProgressPercent(m??-1,o);return jsxs(Root,{...z,...g,role:"progressbar","aria-valuemax":o,"aria-valuenow":m,value:m,ref:r,children:[jsxs(Svg,{children:[jsx(Circle,{}),typeof m=='number'?d>0?jsx(Circle,{strokeLinecap:"round",strokeDasharray:`${d}, 100`}):null:jsx(Circle,{strokeLinecap:"round"})]}),p!==void 0&&jsx(Content,{children:typeof p=='function'?p({value:m,max:o,percent:d,sizeProps:g}):p})]})})),{displayName:'ProgressCircle',sizes:SIZES});export{ProgressCircle};
|
|
2
2
|
//# sourceMappingURL=ProgressCircle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.mjs","sources":["../../../../src/components/ProgressCircle/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { getProgressPercent } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"ProgressCircle.mjs","sources":["../../../../src/components/ProgressCircle/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { getProgressPercent } from 'shared/utils/getProgressPercent'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { ProgressCircleProps } from './types'\n\nconst COMPONENT_NAME = 'ProgressCircle'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Переданный \"ref\" будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/ProgressCircle/types.ts).\n */\nconst ProgressCircle: React.ForwardRefExoticComponent<ProgressCircleProps> = withMergedProps<\n ProgressCircleProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<ProgressCircleProps>>((props, ref) => {\n const { size = 's', max = 1, sizeXXS, sizeXS, sizeS, sizeM, sizeL, sizeXL, value, children, ...restProps } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const percent = getProgressPercent(value ?? -1, max)\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n role='progressbar'\n aria-valuemax={max}\n aria-valuenow={value}\n value={value}\n ref={ref}\n >\n <Styled.Svg>\n <Styled.Circle />\n {typeof value === 'number' ? (\n percent > 0 ? (\n <Styled.Circle strokeLinecap='round' strokeDasharray={`${percent}, 100`} />\n ) : null\n ) : (\n <Styled.Circle strokeLinecap='round' />\n )}\n </Styled.Svg>\n {children !== undefined && (\n <Styled.Content>\n {typeof children === 'function' ? children({ value, max, percent, sizeProps }) : children}\n </Styled.Content>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ProgressCircle }\n"],"names":["ProgressCircle","withMergedProps","forwardRef","props","ref","size","max","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","value","children","restProps","sizeProps","percent","getProgressPercent","_jsxs","Styled","role","_jsx","strokeLinecap","strokeDasharray","undefined","displayName","sizes","SIZES"],"mappings":"gSAoBMA,MAAAA,eAAuEC,gBAI3EC,YAA6D,CAACC,EAAOC,KACnE,MAAMC,KAAEA,EAAO,IAAGC,IAAEA,EAAM,EAACC,QAAEA,EAAOC,OAAEA,EAAMC,MAAEA,EAAKC,MAAEA,EAAKC,MAAEA,EAAKC,OAAEA,EAAMC,MAAEA,EAAKC,SAAEA,KAAaC,GAAcZ,EAE7G,MAAMa,EAAY,CAChBX,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMK,EAAUC,mBAAmBL,IAAU,EAAGP,GAEhD,OACEa,KAACC,KAAW,IACNL,KACAC,EACJK,KAAK,cACL,gBAAef,EACf,gBAAeO,EACfA,MAAOA,EACPT,IAAKA,EAAIU,SAETK,CAAAA,KAACC,IAAU,CAAAN,SAAA,CACTQ,IAACF,OAAa,CAAE,UACRP,GAAU,SAChBI,EAAU,EACRK,IAACF,OAAa,CAACG,cAAc,QAAQC,gBAAiB,GAAGP,WACvD,KAEJK,IAACF,OAAa,CAACG,cAAc,aAGhCT,SAAaW,GACZH,IAACF,QAAc,CAAAN,gBACLA,GAAa,WAAaA,EAAS,CAAED,QAAOP,MAAKW,UAASD,cAAeF,MAGzE,IAGlB,CACEY,YA5DmB,iBA6DnBC,MAAOC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var iconPack=require('@foxford/icon-pack');var
|
|
1
|
+
'use strict';var styled=require('styled-components');var iconPack=require('@foxford/icon-pack');var getProgressPercent=require('../../shared/utils/getProgressPercent.js');var style=require('../../shared/utils/style.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');function _interopDefault(r){return r&&r.__esModule?r:{default:r}}var styled__default=_interopDefault(styled);const shouldForwardProgressLineProp=style.createShouldForwardProp((r=>!['value','max','fancy','hasIcon'].includes(r)));const shiftAnimation=styled.keyframes(["0%{transform:translateX(-100%);}100%{transform:translateX(200%);}"]);const Track=styled__default.default.div.withConfig({displayName:"ProgressLine__Track",componentId:"ui__sc-3juwyd-0"})(["box-sizing:border-box;width:100%;height:100%;overflow:hidden;border-radius:inherit;"]);const Bar=styled__default.default.div.withConfig({displayName:"ProgressLine__Bar",componentId:"ui__sc-3juwyd-1"})(["box-sizing:border-box;width:100%;height:100%;border-radius:inherit;"]);const IconBar=styled__default.default.div.withConfig({displayName:"ProgressLine__IconBar",componentId:"ui__sc-3juwyd-2"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;height:100%;"]);const IconPosition=styled__default.default.div.withConfig({displayName:"ProgressLine__IconPosition",componentId:"ui__sc-3juwyd-3"})(["box-sizing:border-box;display:flex;position:absolute;right:0;top:50%;transform:translate(50%,-50%);"]);const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardProgressLineProp}).withConfig({displayName:"ProgressLine__Root",componentId:"ui__sc-3juwyd-4"})(["box-sizing:border-box;position:relative;"," "," "," "," ",""],(r=>typeof r.value=='number'?`\n & ${Bar}, \n & ${IconBar} {\n transition: transform 150ms linear;\n transform: translateX(-${100-getProgressPercent.getProgressPercent(r.value,r.max)}%);\n }\n `:styled.css(["& ","{width:50%;animation:"," 2000ms infinite;}"],Bar,shiftAnimation)),(r=>r.hasIcon&&`\n & ${Bar} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n `),(r=>{return o={barColor:r.theme.colors['bg-brand-primary-basic'],iconColor:r.theme.colors['bg-brand-primary-basic'],trackColor:r.theme.colors['bg-onmain-tertiary'],...r.palette},`\n & ${Bar} {\n background-color: ${o.barColor};\n }\n & ${IconBar} {\n color: ${o.iconColor};\n }\n & ${Track} {\n background-color: ${o.trackColor};\n }\n`;var o}),responsiveSize.responsiveSize,responsiveMargin.responsiveMargin);const StarFillRotated=styled__default.default(iconPack.StarFill).withConfig({displayName:"ProgressLine__StarFillRotated",componentId:"ui__sc-3juwyd-5"})(["transform:rotate(-21deg);"]);exports.Bar=Bar,exports.IconBar=IconBar,exports.IconPosition=IconPosition,exports.Root=Root,exports.StarFillRotated=StarFillRotated,exports.Track=Track;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/ProgressLine/style.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components'\nimport { StarFill } from '@foxford/icon-pack'\nimport { getProgressPercent } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/ProgressLine/style.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components'\nimport { StarFill } from '@foxford/icon-pack'\nimport { getProgressPercent } from 'shared/utils/getProgressPercent'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { StyledProgressLineProps, ProgressLinePalette } from './types'\n\nconst shouldForwardProgressLineProp = createShouldForwardProp(\n (propKey) => !['value', 'max', 'fancy', 'hasIcon'].includes(propKey)\n)\n\nconst shiftAnimation = keyframes`\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(200%);\n }\n`\n\nexport const Track = styled.div`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n overflow: hidden;\n border-radius: inherit;\n`\n\nexport const Bar = styled.div`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n`\n\nexport const IconBar = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n`\n\nexport const IconPosition = styled.div`\n box-sizing: border-box;\n display: flex;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translate(50%, -50%);\n`\n\nconst template = (palette: ProgressLinePalette) => `\n & ${Bar} {\n background-color: ${palette.barColor};\n }\n & ${IconBar} {\n color: ${palette.iconColor};\n }\n & ${Track} {\n background-color: ${palette.trackColor};\n }\n`\n\nexport const Root = styled.div.withConfig<StyledProgressLineProps>({\n shouldForwardProp: shouldForwardProgressLineProp,\n})`\n box-sizing: border-box;\n position: relative;\n\n ${(props) =>\n typeof props.value === 'number'\n ? `\n & ${Bar}, \n & ${IconBar} {\n transition: transform 150ms linear;\n transform: translateX(-${100 - getProgressPercent(props.value, props.max)}%);\n }\n `\n : css`\n & ${Bar} {\n width: 50%;\n animation: ${shiftAnimation} 2000ms infinite;\n }\n `}\n\n ${(props) =>\n props.hasIcon &&\n `\n & ${Bar} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n `}\n\n ${(props) =>\n template({\n barColor: props.theme.colors['bg-brand-primary-basic'],\n iconColor: props.theme.colors['bg-brand-primary-basic'],\n trackColor: props.theme.colors['bg-onmain-tertiary'],\n ...props.palette,\n })}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const StarFillRotated = styled(StarFill)`\n transform: rotate(-21deg);\n`\n"],"names":["shouldForwardProgressLineProp","createShouldForwardProp","propKey","includes","shiftAnimation","keyframes","Track","styled","div","withConfig","displayName","componentId","Bar","IconBar","IconPosition","Root","shouldForwardProp","props","value","getProgressPercent","max","css","hasIcon","template","palette","barColor","theme","colors","iconColor","trackColor","responsiveSize","responsiveMargin","StarFillRotated","default","StarFill"],"mappings":"ycAQA,MAAMA,8BAAgCC,MAAuBA,yBAC1DC,IAAa,CAAC,QAAS,MAAO,QAAS,WAAWC,SAASD,KAG9D,MAAME,eAAiBC,OAASA,UAO/B,CAAA,4EAEYC,MAAQC,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAAVJ,CAMpB,CAAA,8FAEYK,IAAML,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,oBAAAC,YAAA,mBAAVJ,CAKlB,CAAA,8EAEYM,QAAUN,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,wBAAAC,YAAA,mBAAVJ,CAOtB,CAAA,uFAEYO,aAAeP,gBAAAA,QAAOC,IAAGC,WAAA,CAAAC,YAAA,6BAAAC,YAAA,mBAAVJ,CAO3B,CAAA,wGAcM,MAAMQ,KAAOR,gBAAAA,QAAOC,IAAIC,WAAoC,CACjEO,kBAAmBhB,gCACnBS,WAAA,CAAAC,YAAA,qBAAAC,YAAA,mBAFkBJ,CAMfU,CAAAA,2CAAAA,IAAAA,IAAAA,IAAAA,IAAAA,KAAAA,UACMA,EAAMC,OAAU,SACnB,eACIN,oBACAC,8FAEuB,IAAMM,mBAAAA,mBAAmBF,EAAMC,MAAOD,EAAMG,6BAGvEC,OAAGA,IACGT,CAAAA,KAAAA,wBAAAA,sBAAAA,IAEWR,kBAIpBa,GACDA,EAAMK,SACN,aACMV,sGAMLK,IACDM,OA5CcC,EA4CL,CACPC,SAAUR,EAAMS,MAAMC,OAAO,0BAC7BC,UAAWX,EAAMS,MAAMC,OAAO,0BAC9BE,WAAYZ,EAAMS,MAAMC,OAAO,yBAC5BV,EAAMO,SAhDoC,SAC7CZ,gCACkBY,EAAQC,uBAE1BZ,yBACOW,EAAQI,wBAEftB,kCACkBkB,EAAQK,qBARdL,KAiDZ,GAEFM,eAAcA,eACdC,mCAGG,MAAMC,gBAAkBzB,gBAAM0B,QAACC,mBAASzB,WAAA,CAAAC,YAAA,gCAAAC,YAAA,mBAAhBJ,CAE9B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled,{keyframes,css}from'styled-components';import{StarFill}from'@foxford/icon-pack';import{getProgressPercent}from'../../shared/utils/
|
|
1
|
+
import styled,{keyframes,css}from'styled-components';import{StarFill}from'@foxford/icon-pack';import{getProgressPercent}from'../../shared/utils/getProgressPercent.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';const shouldForwardProgressLineProp=createShouldForwardProp((o=>!['value','max','fancy','hasIcon'].includes(o)));const shiftAnimation=keyframes(["0%{transform:translateX(-100%);}100%{transform:translateX(200%);}"]);const Track=styled.div.withConfig({displayName:"ProgressLine__Track",componentId:"ui__sc-3juwyd-0"})(["box-sizing:border-box;width:100%;height:100%;overflow:hidden;border-radius:inherit;"]);const Bar=styled.div.withConfig({displayName:"ProgressLine__Bar",componentId:"ui__sc-3juwyd-1"})(["box-sizing:border-box;width:100%;height:100%;border-radius:inherit;"]);const IconBar=styled.div.withConfig({displayName:"ProgressLine__IconBar",componentId:"ui__sc-3juwyd-2"})(["box-sizing:border-box;position:absolute;top:0;left:0;width:100%;height:100%;"]);const IconPosition=styled.div.withConfig({displayName:"ProgressLine__IconPosition",componentId:"ui__sc-3juwyd-3"})(["box-sizing:border-box;display:flex;position:absolute;right:0;top:50%;transform:translate(50%,-50%);"]);const Root=styled.div.withConfig({shouldForwardProp:shouldForwardProgressLineProp}).withConfig({displayName:"ProgressLine__Root",componentId:"ui__sc-3juwyd-4"})(["box-sizing:border-box;position:relative;"," "," "," "," ",""],(o=>typeof o.value=='number'?`\n & ${Bar}, \n & ${IconBar} {\n transition: transform 150ms linear;\n transform: translateX(-${100-getProgressPercent(o.value,o.max)}%);\n }\n `:css(["& ","{width:50%;animation:"," 2000ms infinite;}"],Bar,shiftAnimation)),(o=>o.hasIcon&&`\n & ${Bar} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n `),(o=>{return r={barColor:o.theme.colors['bg-brand-primary-basic'],iconColor:o.theme.colors['bg-brand-primary-basic'],trackColor:o.theme.colors['bg-onmain-tertiary'],...o.palette},`\n & ${Bar} {\n background-color: ${r.barColor};\n }\n & ${IconBar} {\n color: ${r.iconColor};\n }\n & ${Track} {\n background-color: ${r.trackColor};\n }\n`;var r}),responsiveSize,responsiveMargin);const StarFillRotated=styled(StarFill).withConfig({displayName:"ProgressLine__StarFillRotated",componentId:"ui__sc-3juwyd-5"})(["transform:rotate(-21deg);"]);export{Bar,IconBar,IconPosition,Root,StarFillRotated,Track};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/ProgressLine/style.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components'\nimport { StarFill } from '@foxford/icon-pack'\nimport { getProgressPercent } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/ProgressLine/style.ts"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components'\nimport { StarFill } from '@foxford/icon-pack'\nimport { getProgressPercent } from 'shared/utils/getProgressPercent'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport type { StyledProgressLineProps, ProgressLinePalette } from './types'\n\nconst shouldForwardProgressLineProp = createShouldForwardProp(\n (propKey) => !['value', 'max', 'fancy', 'hasIcon'].includes(propKey)\n)\n\nconst shiftAnimation = keyframes`\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(200%);\n }\n`\n\nexport const Track = styled.div`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n overflow: hidden;\n border-radius: inherit;\n`\n\nexport const Bar = styled.div`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n`\n\nexport const IconBar = styled.div`\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n`\n\nexport const IconPosition = styled.div`\n box-sizing: border-box;\n display: flex;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translate(50%, -50%);\n`\n\nconst template = (palette: ProgressLinePalette) => `\n & ${Bar} {\n background-color: ${palette.barColor};\n }\n & ${IconBar} {\n color: ${palette.iconColor};\n }\n & ${Track} {\n background-color: ${palette.trackColor};\n }\n`\n\nexport const Root = styled.div.withConfig<StyledProgressLineProps>({\n shouldForwardProp: shouldForwardProgressLineProp,\n})`\n box-sizing: border-box;\n position: relative;\n\n ${(props) =>\n typeof props.value === 'number'\n ? `\n & ${Bar}, \n & ${IconBar} {\n transition: transform 150ms linear;\n transform: translateX(-${100 - getProgressPercent(props.value, props.max)}%);\n }\n `\n : css`\n & ${Bar} {\n width: 50%;\n animation: ${shiftAnimation} 2000ms infinite;\n }\n `}\n\n ${(props) =>\n props.hasIcon &&\n `\n & ${Bar} {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n `}\n\n ${(props) =>\n template({\n barColor: props.theme.colors['bg-brand-primary-basic'],\n iconColor: props.theme.colors['bg-brand-primary-basic'],\n trackColor: props.theme.colors['bg-onmain-tertiary'],\n ...props.palette,\n })}\n\n ${responsiveSize}\n ${responsiveMargin}\n`\n\nexport const StarFillRotated = styled(StarFill)`\n transform: rotate(-21deg);\n`\n"],"names":["shouldForwardProgressLineProp","createShouldForwardProp","propKey","includes","shiftAnimation","keyframes","Track","styled","div","withConfig","displayName","componentId","Bar","IconBar","IconPosition","Root","shouldForwardProp","props","value","getProgressPercent","max","css","hasIcon","template","palette","barColor","theme","colors","iconColor","trackColor","responsiveSize","responsiveMargin","StarFillRotated","StarFill"],"mappings":"wWAQA,MAAMA,8BAAgCC,yBACnCC,IAAa,CAAC,QAAS,MAAO,QAAS,WAAWC,SAASD,KAG9D,MAAME,eAAiBC,UAOtB,CAAA,4EAEYC,MAAQC,OAAOC,IAAGC,WAAA,CAAAC,YAAA,sBAAAC,YAAA,mBAAVJ,CAMpB,CAAA,8FAEYK,IAAML,OAAOC,IAAGC,WAAA,CAAAC,YAAA,oBAAAC,YAAA,mBAAVJ,CAKlB,CAAA,8EAEYM,QAAUN,OAAOC,IAAGC,WAAA,CAAAC,YAAA,wBAAAC,YAAA,mBAAVJ,CAOtB,CAAA,uFAEYO,aAAeP,OAAOC,IAAGC,WAAA,CAAAC,YAAA,6BAAAC,YAAA,mBAAVJ,CAO3B,CAAA,wGAcM,MAAMQ,KAAOR,OAAOC,IAAIC,WAAoC,CACjEO,kBAAmBhB,gCACnBS,WAAA,CAAAC,YAAA,qBAAAC,YAAA,mBAFkBJ,CAMfU,CAAAA,2CAAAA,IAAAA,IAAAA,IAAAA,IAAAA,KAAAA,UACMA,EAAMC,OAAU,SACnB,eACIN,oBACAC,8FAEuB,IAAMM,mBAAmBF,EAAMC,MAAOD,EAAMG,6BAGvEC,IACMT,CAAAA,KAAAA,wBAAAA,sBAAAA,IAEWR,kBAIpBa,GACDA,EAAMK,SACN,aACMV,sGAMLK,IACDM,OA5CcC,EA4CL,CACPC,SAAUR,EAAMS,MAAMC,OAAO,0BAC7BC,UAAWX,EAAMS,MAAMC,OAAO,0BAC9BE,WAAYZ,EAAMS,MAAMC,OAAO,yBAC5BV,EAAMO,SAhDoC,SAC7CZ,gCACkBY,EAAQC,uBAE1BZ,yBACOW,EAAQI,wBAEftB,kCACkBkB,EAAQK,qBARdL,KAiDZ,GAEFM,eACAC,kBAGG,MAAMC,gBAAkBzB,OAAO0B,UAASxB,WAAA,CAAAC,YAAA,gCAAAC,YAAA,mBAAhBJ,CAE9B,CAAA"}
|
package/hooks/useClickOutside.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var
|
|
1
|
+
'use strict';var React=require('react');var getDomTargets=require('../shared/utils/getDomTargets.js');exports.useClickOutside=(e,t,s)=>{const{enabled:n=!0,event:r="click",once:c,passive:a,signal:o,capture:i}=s??{};React.useEffect((()=>{const s={once:c,passive:a,signal:o,capture:i};const listener=s=>{const n=getDomTargets.getDomTargets(e);const r=s.target;r&&r.isConnected&&n.length>0&&n.every((e=>!e.contains(r)))&&t(s)};return n&&document.addEventListener(r,listener,s),()=>{document.removeEventListener(r,listener,s)}}),[e,t,n,r,c,a,o,i])};
|
|
2
2
|
//# sourceMappingURL=useClickOutside.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useClickOutside.js","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useClickOutside = (\n target: DomTarget | DomTarget[],\n callback: (evt: MouseEvent) => void,\n options?: {\n enabled?: boolean\n event?: 'click' | 'mousedown'\n once?: boolean\n passive?: boolean\n signal?: AbortSignal\n capture?: boolean\n }\n) => {\n const { enabled = true, event = 'click', once, passive, signal, capture } = options ?? {}\n\n useEffect(() => {\n const listenerOptions = { once, passive, signal, capture }\n\n const listener = (evt: MouseEvent) => {\n const domTargets = getDomTargets(target)\n\n const evtTarget = evt.target as Node\n\n if (\n evtTarget &&\n evtTarget.isConnected &&\n domTargets.length > 0 &&\n domTargets.every((item) => !item.contains(evtTarget))\n ) {\n callback(evt)\n }\n }\n\n if (enabled) {\n document.addEventListener(event, listener, listenerOptions)\n }\n\n return () => {\n document.removeEventListener(event, listener, listenerOptions)\n }\n }, [target, callback, enabled, event, once, passive, signal, capture])\n}\n"],"names":["useClickOutside","target","callback","options","enabled","event","once","passive","signal","capture","useEffect","listenerOptions","listener","evt","domTargets","getDomTargets","evtTarget","isConnected","length","every","item","contains","document","addEventListener","removeEventListener"],"mappings":"8HAI+BA,CAC7BC,EACAC,EACAC,KASA,MAAMC,QAAEA,GAAU,EAAIC,MAAEA,EAAQ,QAAOC,KAAEA,EAAIC,QAAEA,EAAOC,OAAEA,EAAMC,QAAEA,GAAYN,GAAW,CAAA,EAEvFO,MAAAA,WAAU,KACR,MAAMC,EAAkB,CAAEL,OAAMC,UAASC,SAAQC,WAEjD,MAAMG,SAAYC,IAChB,MAAMC,EAAaC,4BAAcd,GAEjC,MAAMe,EAAYH,EAAIZ,OAGpBe,GACAA,EAAUC,aACVH,EAAWI,OAAS,GACpBJ,EAAWK,OAAOC,IAAUA,EAAKC,SAASL,MAE1Cd,EAASW,EACX,EAOF,OAJIT,GACFkB,SAASC,iBAAiBlB,EAAOO,SAAUD,GAGtC,KACLW,SAASE,oBAAoBnB,EAAOO,SAAUD,EAAgB,CAC/D,GACA,CAACV,EAAQC,EAAUE,EAASC,EAAOC,EAAMC,EAASC,EAAQC,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect}from'react';import{getDomTargets}from'../shared/utils/
|
|
1
|
+
import{useEffect}from'react';import{getDomTargets}from'../shared/utils/getDomTargets.mjs';const useClickOutside=(e,t,s)=>{const{enabled:n=!0,event:c="click",once:o,passive:r,signal:i,capture:a}=s??{};useEffect((()=>{const s={once:o,passive:r,signal:i,capture:a};const listener=s=>{const n=getDomTargets(e);const c=s.target;c&&c.isConnected&&n.length>0&&n.every((e=>!e.contains(c)))&&t(s)};return n&&document.addEventListener(c,listener,s),()=>{document.removeEventListener(c,listener,s)}}),[e,t,n,c,o,r,i,a])};export{useClickOutside};
|
|
2
2
|
//# sourceMappingURL=useClickOutside.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.mjs","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useClickOutside.mjs","sources":["../../../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useClickOutside = (\n target: DomTarget | DomTarget[],\n callback: (evt: MouseEvent) => void,\n options?: {\n enabled?: boolean\n event?: 'click' | 'mousedown'\n once?: boolean\n passive?: boolean\n signal?: AbortSignal\n capture?: boolean\n }\n) => {\n const { enabled = true, event = 'click', once, passive, signal, capture } = options ?? {}\n\n useEffect(() => {\n const listenerOptions = { once, passive, signal, capture }\n\n const listener = (evt: MouseEvent) => {\n const domTargets = getDomTargets(target)\n\n const evtTarget = evt.target as Node\n\n if (\n evtTarget &&\n evtTarget.isConnected &&\n domTargets.length > 0 &&\n domTargets.every((item) => !item.contains(evtTarget))\n ) {\n callback(evt)\n }\n }\n\n if (enabled) {\n document.addEventListener(event, listener, listenerOptions)\n }\n\n return () => {\n document.removeEventListener(event, listener, listenerOptions)\n }\n }, [target, callback, enabled, event, once, passive, signal, capture])\n}\n"],"names":["useClickOutside","target","callback","options","enabled","event","once","passive","signal","capture","useEffect","listenerOptions","listener","evt","domTargets","getDomTargets","evtTarget","isConnected","length","every","item","contains","document","addEventListener","removeEventListener"],"mappings":"0FAIO,MAAMA,gBAAkBA,CAC7BC,EACAC,EACAC,KASA,MAAMC,QAAEA,GAAU,EAAIC,MAAEA,EAAQ,QAAOC,KAAEA,EAAIC,QAAEA,EAAOC,OAAEA,EAAMC,QAAEA,GAAYN,GAAW,CAAA,EAEvFO,WAAU,KACR,MAAMC,EAAkB,CAAEL,OAAMC,UAASC,SAAQC,WAEjD,MAAMG,SAAYC,IAChB,MAAMC,EAAaC,cAAcd,GAEjC,MAAMe,EAAYH,EAAIZ,OAGpBe,GACAA,EAAUC,aACVH,EAAWI,OAAS,GACpBJ,EAAWK,OAAOC,IAAUA,EAAKC,SAASL,MAE1Cd,EAASW,EACX,EAOF,OAJIT,GACFkB,SAASC,iBAAiBlB,EAAOO,SAAUD,GAGtC,KACLW,SAASE,oBAAoBnB,EAAOO,SAAUD,EAAgB,CAC/D,GACA,CAACV,EAAQC,EAAUE,EAASC,EAAOC,EAAMC,EAASC,EAAQC,GAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var resizeObserver=require('../shared/resize-observer.js');var
|
|
1
|
+
'use strict';var React=require('react');var resizeObserver=require('../shared/resize-observer.js');var getDomTargets=require('../shared/utils/getDomTargets.js');exports.useResizeObserver=({enabled:e=!0,target:r,onResize:s})=>{const[t]=React.useState((()=>new WeakMap));React.useLayoutEffect((()=>{const a=getDomTargets.getDomTargets(r);return e&&a.forEach((e=>{e[resizeObserver.resizeObserver.symbol]=r=>{const a=t.get(e);a&&cancelAnimationFrame(a),t.set(e,requestAnimationFrame((()=>{s(r)})))},resizeObserver.resizeObserver.observe(e)})),()=>{a.forEach((e=>{resizeObserver.resizeObserver.unobserve(e)}))}}),[e,t,r,s])};
|
|
2
2
|
//# sourceMappingURL=useResizeObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.js","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useResizeObserver = <T extends HTMLElement = HTMLElement>({\n enabled = true,\n target,\n onResize,\n}: {\n onResize: (target: T) => void\n target?: DomTarget<T> | DomTarget<T>[]\n enabled?: boolean\n}) => {\n const [animationRequests] = useState<WeakMap<T, number>>(() => new WeakMap())\n\n useLayoutEffect(() => {\n const targets = getDomTargets<T>(target)\n\n if (enabled) {\n targets.forEach((observerTarget) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n observerTarget[resizeObserver.symbol] = (e: T) => {\n const reqId = animationRequests.get(observerTarget)\n\n if (reqId) {\n cancelAnimationFrame(reqId)\n }\n\n animationRequests.set(\n observerTarget,\n requestAnimationFrame(() => {\n onResize(e)\n })\n )\n }\n\n resizeObserver.observe(observerTarget)\n })\n }\n\n return () => {\n targets.forEach((observerTarget) => {\n resizeObserver.unobserve(observerTarget)\n })\n }\n }, [enabled, animationRequests, target, onResize])\n}\n"],"names":["useResizeObserver","enabled","target","onResize","animationRequests","useState","WeakMap","useLayoutEffect","targets","getDomTargets","forEach","observerTarget","resizeObserver","symbol","e","reqId","get","cancelAnimationFrame","set","requestAnimationFrame","observe","unobserve"],"mappings":"2LAKiCA,EAC/BC,WAAU,EACVC,SACAC,eAMA,MAAOC,GAAqBC,MAAAA,UAA6B,IAAM,IAAIC,UAEnEC,MAAAA,iBAAgB,KACd,MAAMC,EAAUC,4BAAiBP,GAyBjC,OAvBID,GACFO,EAAQE,SAASC,IAGfA,EAAeC,eAAcA,eAACC,QAAWC,IACvC,MAAMC,EAAQX,EAAkBY,IAAIL,GAEhCI,GACFE,qBAAqBF,GAGvBX,EAAkBc,IAChBP,EACAQ,uBAAsB,KACpBhB,EAASW,EAAE,IAEd,EAGHF,8BAAeQ,QAAQT,EAAe,IAInC,KACLH,EAAQE,SAASC,IACfC,8BAAeS,UAAUV,EAAe,GACxC,CACH,GACA,CAACV,EAASG,EAAmBF,EAAQC,GAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState,useLayoutEffect}from'react';import{resizeObserver}from'../shared/resize-observer.mjs';import{getDomTargets}from'../shared/utils/
|
|
1
|
+
import{useState,useLayoutEffect}from'react';import{resizeObserver}from'../shared/resize-observer.mjs';import{getDomTargets}from'../shared/utils/getDomTargets.mjs';const useResizeObserver=({enabled:e=!0,target:r,onResize:s})=>{const[t]=useState((()=>new WeakMap));useLayoutEffect((()=>{const o=getDomTargets(r);return e&&o.forEach((e=>{e[resizeObserver.symbol]=r=>{const o=t.get(e);o&&cancelAnimationFrame(o),t.set(e,requestAnimationFrame((()=>{s(r)})))},resizeObserver.observe(e)})),()=>{o.forEach((e=>{resizeObserver.unobserve(e)}))}}),[e,t,r,s])};export{useResizeObserver};
|
|
2
2
|
//# sourceMappingURL=useResizeObserver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/
|
|
1
|
+
{"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\nimport { resizeObserver } from 'shared/resize-observer'\nimport { getDomTargets } from 'shared/utils/getDomTargets'\nimport type { DomTarget } from 'shared/types'\n\nexport const useResizeObserver = <T extends HTMLElement = HTMLElement>({\n enabled = true,\n target,\n onResize,\n}: {\n onResize: (target: T) => void\n target?: DomTarget<T> | DomTarget<T>[]\n enabled?: boolean\n}) => {\n const [animationRequests] = useState<WeakMap<T, number>>(() => new WeakMap())\n\n useLayoutEffect(() => {\n const targets = getDomTargets<T>(target)\n\n if (enabled) {\n targets.forEach((observerTarget) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n observerTarget[resizeObserver.symbol] = (e: T) => {\n const reqId = animationRequests.get(observerTarget)\n\n if (reqId) {\n cancelAnimationFrame(reqId)\n }\n\n animationRequests.set(\n observerTarget,\n requestAnimationFrame(() => {\n onResize(e)\n })\n )\n }\n\n resizeObserver.observe(observerTarget)\n })\n }\n\n return () => {\n targets.forEach((observerTarget) => {\n resizeObserver.unobserve(observerTarget)\n })\n }\n }, [enabled, animationRequests, target, onResize])\n}\n"],"names":["useResizeObserver","enabled","target","onResize","animationRequests","useState","WeakMap","useLayoutEffect","targets","getDomTargets","forEach","observerTarget","resizeObserver","symbol","e","reqId","get","cancelAnimationFrame","set","requestAnimationFrame","observe","unobserve"],"mappings":"mKAKO,MAAMA,kBAAoBA,EAC/BC,WAAU,EACVC,SACAC,eAMA,MAAOC,GAAqBC,UAA6B,IAAM,IAAIC,UAEnEC,iBAAgB,KACd,MAAMC,EAAUC,cAAiBP,GAyBjC,OAvBID,GACFO,EAAQE,SAASC,IAGfA,EAAeC,eAAeC,QAAWC,IACvC,MAAMC,EAAQX,EAAkBY,IAAIL,GAEhCI,GACFE,qBAAqBF,GAGvBX,EAAkBc,IAChBP,EACAQ,uBAAsB,KACpBhB,EAASW,EAAE,IAEd,EAGHF,eAAeQ,QAAQT,EAAe,IAInC,KACLH,EAAQE,SAASC,IACfC,eAAeS,UAAUV,EAAe,GACxC,CACH,GACA,CAACV,EAASG,EAAmBF,EAAQC,GAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxford/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.83.0-beta-4ae8299-20251007",
|
|
4
4
|
"description": "UI components and utilities",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/foxford/ui/issues"
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"shared",
|
|
69
69
|
"theme"
|
|
70
70
|
],
|
|
71
|
-
"sha": "
|
|
71
|
+
"sha": "4ae8299",
|
|
72
72
|
"scripts": {}
|
|
73
73
|
}
|
package/shared/utils/dom.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var constants=require('../constants.js');const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const
|
|
1
|
+
'use strict';var constants=require('../constants.js');const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const a=e.querySelector(t);return a instanceof HTMLElement&&typeof a.focus=='function'&&(a.focus(),!0)};const createKeyboardNavigation=({prevKey:e,nextKey:t})=>(a,n,o,i=SELECTORS_KEYBOARD_FOCUSABLE)=>{let s=o.indexOf(n);if(s!==-1&&o.length!==0)do{constants.keyboardKeys[e].validate(a)?s--:constants.keyboardKeys[t].validate(a)&&s++,s<0?s=o.length-1:s>o.length-1&&(s=0)}while(!focusFirstFocusable(o[s],i))};const navigateVerticalList=createKeyboardNavigation({prevKey:'ArrowUp',nextKey:'ArrowDown'});const navigateHorizontalList=createKeyboardNavigation({prevKey:'ArrowLeft',nextKey:'ArrowRight'});exports.SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])',exports.SELECTORS_KEYBOARD_FOCUSABLE=SELECTORS_KEYBOARD_FOCUSABLE,exports.concatClassNames=(...e)=>e.reduce(((e,t)=>(typeof t=='string'&&(e=e?e+' '+t:t),e)),''),exports.createKeyboardNavigation=createKeyboardNavigation,exports.focusFirstFocusable=focusFirstFocusable,exports.focusLastFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{const a=e.querySelectorAll(t);const n=a[a.length-1];return n instanceof HTMLElement&&typeof n.focus=='function'&&(n.focus(),!0)},exports.navigateHorizontalList=navigateHorizontalList,exports.navigateVerticalList=navigateVerticalList;
|
|
2
2
|
//# sourceMappingURL=dom.js.map
|
package/shared/utils/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable
|
|
1
|
+
{"version":3,"file":"dom.js","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable } from 'shared/types'\n\nexport const SELECTORS_KEYBOARD_FOCUSABLE =\n 'a[href]:not([tabindex^=\"-\"]), button:not(:disabled, [tabindex^=\"-\"]), input:not(:disabled, [type=\"hidden\"], [tabindex^=\"-\"]), select:not(:disabled, [tabindex^=\"-\"]), textarea:not(:disabled, [tabindex^=\"-\"]), area[href]:not([tabindex^=\"-\"]), iframe:not([tabindex^=\"-\"]), object:not([tabindex^=\"-\"]), summary:not([tabindex^=\"-\"]), [tabindex]:not([tabindex^=\"-\"], :disabled), [contenteditable]:not([contenteditable=\"false\"], [tabindex^=\"-\"])'\n\nexport const SELECTORS_FOCUSABLE =\n 'a[href], button:not(:disabled), input:not(:disabled, [type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable=\"false\"])'\n\nexport const focusFirstFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n if (element.matches(selectors) && typeof element.focus === 'function') {\n element.focus()\n\n return true\n }\n\n const descendent = element.querySelector(selectors)\n\n if (descendent instanceof HTMLElement && typeof descendent.focus === 'function') {\n descendent.focus()\n\n return true\n }\n\n return false\n}\n\nexport const focusLastFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n const descendants = element.querySelectorAll(selectors)\n const lastDescendant = descendants[descendants.length - 1]\n\n if (lastDescendant instanceof HTMLElement && typeof lastDescendant.focus === 'function') {\n lastDescendant.focus()\n\n return true\n }\n\n return false\n}\n\nexport const concatClassNames = (...classNames: Nullable<unknown>[]): string =>\n classNames.reduce<string>((acc, className) => {\n if (typeof className === 'string') {\n // eslint-disable-next-line no-param-reassign\n acc = acc ? acc + ' ' + className : className\n }\n\n return acc\n }, '')\n\nexport const createKeyboardNavigation = ({\n prevKey,\n nextKey,\n}: {\n prevKey: keyof typeof keyboardKeys\n nextKey: keyof typeof keyboardKeys\n}) => {\n return (\n key: React.KeyboardEvent['key'],\n active: HTMLElement,\n list: HTMLElement[],\n selectorsFocusable = SELECTORS_KEYBOARD_FOCUSABLE\n ) => {\n let idx = list.indexOf(active)\n\n if (idx === -1 || list.length === 0) {\n return\n }\n\n do {\n if (keyboardKeys[prevKey].validate(key)) {\n idx--\n } else if (keyboardKeys[nextKey].validate(key)) {\n idx++\n }\n\n if (idx < 0) {\n idx = list.length - 1\n } else if (idx > list.length - 1) {\n idx = 0\n }\n } while (!focusFirstFocusable(list[idx], selectorsFocusable))\n }\n}\n\nexport const navigateVerticalList = createKeyboardNavigation({\n prevKey: 'ArrowUp',\n nextKey: 'ArrowDown',\n})\n\nexport const navigateHorizontalList = createKeyboardNavigation({\n prevKey: 'ArrowLeft',\n nextKey: 'ArrowRight',\n})\n"],"names":["SELECTORS_KEYBOARD_FOCUSABLE","focusFirstFocusable","element","selectors","matches","focus","descendent","querySelector","HTMLElement","createKeyboardNavigation","prevKey","nextKey","key","active","list","selectorsFocusable","idx","indexOf","length","keyboardKeys","validate","navigateVerticalList","navigateHorizontalList","concatClassNames","classNames","reduce","acc","className","focusLastFocusable","descendants","querySelectorAll","lastDescendant"],"mappings":"sDAGO,MAAMA,6BACX,ybAKK,MAAMC,oBAAsBA,CAACC,EAAsBC,EAAYH,gCACpE,GAAIE,EAAQE,QAAQD,WAAqBD,EAAQG,OAAU,WAGzD,OAFAH,EAAQG,SAED,EAGT,MAAMC,EAAaJ,EAAQK,cAAcJ,GAEzC,OAAIG,aAAsBE,oBAAsBF,EAAWD,OAAU,aACnEC,EAAWD,SAEJ,EAGG,EA0BP,MAAMI,yBAA2BA,EACtCC,UACAC,aAKO,CACLC,EACAC,EACAC,EACAC,EAAqBf,gCAErB,IAAIgB,EAAMF,EAAKG,QAAQJ,GAEvB,GAAIG,KAAS,GAAKF,EAAKI,SAAW,EAIlC,GACMC,UAAYA,aAACT,GAASU,SAASR,GACjCI,IACSG,UAAAA,aAAaR,GAASS,SAASR,IACxCI,IAGEA,EAAM,EACRA,EAAMF,EAAKI,OAAS,EACXF,EAAMF,EAAKI,OAAS,IAC7BF,EAAM,UAEAf,oBAAoBa,EAAKE,GAAMD,GAAmB,EAInDM,MAAAA,qBAAuBZ,yBAAyB,CAC3DC,QAAS,UACTC,QAAS,cAGEW,MAAAA,uBAAyBb,yBAAyB,CAC7DC,QAAS,YACTC,QAAS,2CArFT,qUAiC8BY,IAAIC,IAClCA,EAAWC,QAAe,CAACC,EAAKC,YACnBA,GAAc,WAEvBD,EAAMA,EAAMA,EAAM,IAAMC,EAAYA,GAG/BD,IACN,yIArB6BE,CAAC1B,EAAsBC,EAAYH,gCACnE,MAAM6B,EAAc3B,EAAQ4B,iBAAiB3B,GAC7C,MAAM4B,EAAiBF,EAAYA,EAAYX,OAAS,GAExD,OAAIa,aAA0BvB,oBAAsBuB,EAAe1B,OAAU,aAC3E0B,EAAe1B,SAER,EAGG"}
|
package/shared/utils/dom.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{keyboardKeys}from'../constants.mjs';const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const
|
|
1
|
+
import{keyboardKeys}from'../constants.mjs';const SELECTORS_KEYBOARD_FOCUSABLE='a[href]:not([tabindex^="-"]), button:not(:disabled, [tabindex^="-"]), input:not(:disabled, [type="hidden"], [tabindex^="-"]), select:not(:disabled, [tabindex^="-"]), textarea:not(:disabled, [tabindex^="-"]), area[href]:not([tabindex^="-"]), iframe:not([tabindex^="-"]), object:not([tabindex^="-"]), summary:not([tabindex^="-"]), [tabindex]:not([tabindex^="-"], :disabled), [contenteditable]:not([contenteditable="false"], [tabindex^="-"])';const SELECTORS_FOCUSABLE='a[href], button:not(:disabled), input:not(:disabled, [type="hidden"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable="false"])';const focusFirstFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{if(e.matches(t)&&typeof e.focus=='function')return e.focus(),!0;const a=e.querySelector(t);return a instanceof HTMLElement&&typeof a.focus=='function'&&(a.focus(),!0)};const focusLastFocusable=(e,t=SELECTORS_KEYBOARD_FOCUSABLE)=>{const a=e.querySelectorAll(t);const n=a[a.length-1];return n instanceof HTMLElement&&typeof n.focus=='function'&&(n.focus(),!0)};const concatClassNames=(...e)=>e.reduce(((e,t)=>(typeof t=='string'&&(e=e?e+' '+t:t),e)),'');const createKeyboardNavigation=({prevKey:e,nextKey:t})=>(a,n,o,i=SELECTORS_KEYBOARD_FOCUSABLE)=>{let s=o.indexOf(n);if(s!==-1&&o.length!==0)do{keyboardKeys[e].validate(a)?s--:keyboardKeys[t].validate(a)&&s++,s<0?s=o.length-1:s>o.length-1&&(s=0)}while(!focusFirstFocusable(o[s],i))};const navigateVerticalList=createKeyboardNavigation({prevKey:'ArrowUp',nextKey:'ArrowDown'});const navigateHorizontalList=createKeyboardNavigation({prevKey:'ArrowLeft',nextKey:'ArrowRight'});export{SELECTORS_FOCUSABLE,SELECTORS_KEYBOARD_FOCUSABLE,concatClassNames,createKeyboardNavigation,focusFirstFocusable,focusLastFocusable,navigateHorizontalList,navigateVerticalList};
|
|
2
2
|
//# sourceMappingURL=dom.mjs.map
|
package/shared/utils/dom.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.mjs","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable
|
|
1
|
+
{"version":3,"file":"dom.mjs","sources":["../../../../src/shared/utils/dom.ts"],"sourcesContent":["import { keyboardKeys } from 'shared/constants'\nimport type { Nullable } from 'shared/types'\n\nexport const SELECTORS_KEYBOARD_FOCUSABLE =\n 'a[href]:not([tabindex^=\"-\"]), button:not(:disabled, [tabindex^=\"-\"]), input:not(:disabled, [type=\"hidden\"], [tabindex^=\"-\"]), select:not(:disabled, [tabindex^=\"-\"]), textarea:not(:disabled, [tabindex^=\"-\"]), area[href]:not([tabindex^=\"-\"]), iframe:not([tabindex^=\"-\"]), object:not([tabindex^=\"-\"]), summary:not([tabindex^=\"-\"]), [tabindex]:not([tabindex^=\"-\"], :disabled), [contenteditable]:not([contenteditable=\"false\"], [tabindex^=\"-\"])'\n\nexport const SELECTORS_FOCUSABLE =\n 'a[href], button:not(:disabled), input:not(:disabled, [type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), area[href], iframe, object, summary, [tabindex]:not(:disabled), [contenteditable]:not([contenteditable=\"false\"])'\n\nexport const focusFirstFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n if (element.matches(selectors) && typeof element.focus === 'function') {\n element.focus()\n\n return true\n }\n\n const descendent = element.querySelector(selectors)\n\n if (descendent instanceof HTMLElement && typeof descendent.focus === 'function') {\n descendent.focus()\n\n return true\n }\n\n return false\n}\n\nexport const focusLastFocusable = (element: HTMLElement, selectors = SELECTORS_KEYBOARD_FOCUSABLE): boolean => {\n const descendants = element.querySelectorAll(selectors)\n const lastDescendant = descendants[descendants.length - 1]\n\n if (lastDescendant instanceof HTMLElement && typeof lastDescendant.focus === 'function') {\n lastDescendant.focus()\n\n return true\n }\n\n return false\n}\n\nexport const concatClassNames = (...classNames: Nullable<unknown>[]): string =>\n classNames.reduce<string>((acc, className) => {\n if (typeof className === 'string') {\n // eslint-disable-next-line no-param-reassign\n acc = acc ? acc + ' ' + className : className\n }\n\n return acc\n }, '')\n\nexport const createKeyboardNavigation = ({\n prevKey,\n nextKey,\n}: {\n prevKey: keyof typeof keyboardKeys\n nextKey: keyof typeof keyboardKeys\n}) => {\n return (\n key: React.KeyboardEvent['key'],\n active: HTMLElement,\n list: HTMLElement[],\n selectorsFocusable = SELECTORS_KEYBOARD_FOCUSABLE\n ) => {\n let idx = list.indexOf(active)\n\n if (idx === -1 || list.length === 0) {\n return\n }\n\n do {\n if (keyboardKeys[prevKey].validate(key)) {\n idx--\n } else if (keyboardKeys[nextKey].validate(key)) {\n idx++\n }\n\n if (idx < 0) {\n idx = list.length - 1\n } else if (idx > list.length - 1) {\n idx = 0\n }\n } while (!focusFirstFocusable(list[idx], selectorsFocusable))\n }\n}\n\nexport const navigateVerticalList = createKeyboardNavigation({\n prevKey: 'ArrowUp',\n nextKey: 'ArrowDown',\n})\n\nexport const navigateHorizontalList = createKeyboardNavigation({\n prevKey: 'ArrowLeft',\n nextKey: 'ArrowRight',\n})\n"],"names":["SELECTORS_KEYBOARD_FOCUSABLE","SELECTORS_FOCUSABLE","focusFirstFocusable","element","selectors","matches","focus","descendent","querySelector","HTMLElement","focusLastFocusable","descendants","querySelectorAll","lastDescendant","length","concatClassNames","classNames","reduce","acc","className","createKeyboardNavigation","prevKey","nextKey","key","active","list","selectorsFocusable","idx","indexOf","keyboardKeys","validate","navigateVerticalList","navigateHorizontalList"],"mappings":"2CAGO,MAAMA,6BACX,ybAEK,MAAMC,oBACX,0OAEK,MAAMC,oBAAsBA,CAACC,EAAsBC,EAAYJ,gCACpE,GAAIG,EAAQE,QAAQD,WAAqBD,EAAQG,OAAU,WAGzD,OAFAH,EAAQG,SAED,EAGT,MAAMC,EAAaJ,EAAQK,cAAcJ,GAEzC,OAAIG,aAAsBE,oBAAsBF,EAAWD,OAAU,aACnEC,EAAWD,SAEJ,EAGG,EAGP,MAAMI,mBAAqBA,CAACP,EAAsBC,EAAYJ,gCACnE,MAAMW,EAAcR,EAAQS,iBAAiBR,GAC7C,MAAMS,EAAiBF,EAAYA,EAAYG,OAAS,GAExD,OAAID,aAA0BJ,oBAAsBI,EAAeP,OAAU,aAC3EO,EAAeP,SAER,EAGG,EAGDS,MAAAA,iBAAmBA,IAAIC,IAClCA,EAAWC,QAAe,CAACC,EAAKC,YACnBA,GAAc,WAEvBD,EAAMA,EAAMA,EAAM,IAAMC,EAAYA,GAG/BD,IACN,IAEE,MAAME,yBAA2BA,EACtCC,UACAC,aAKO,CACLC,EACAC,EACAC,EACAC,EAAqB1B,gCAErB,IAAI2B,EAAMF,EAAKG,QAAQJ,GAEvB,GAAIG,KAAS,GAAKF,EAAKX,SAAW,EAIlC,GACMe,aAAaR,GAASS,SAASP,GACjCI,IACSE,aAAaP,GAASQ,SAASP,IACxCI,IAGEA,EAAM,EACRA,EAAMF,EAAKX,OAAS,EACXa,EAAMF,EAAKX,OAAS,IAC7Ba,EAAM,UAEAzB,oBAAoBuB,EAAKE,GAAMD,GAAmB,EAInDK,MAAAA,qBAAuBX,yBAAyB,CAC3DC,QAAS,UACTC,QAAS,cAGEU,MAAAA,uBAAyBZ,yBAAyB,CAC7DC,QAAS,YACTC,QAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDomTargets.js","sources":["../../../../src/shared/utils/getDomTargets.ts"],"sourcesContent":["import type { DomTarget } from 'shared/types'\n\nexport const getDomTargets = <T extends HTMLElement = HTMLElement>(target: DomTarget<T> | DomTarget<T>[]): T[] =>\n (Array.isArray(target) ? target : [target]).reduce<T[]>((acc, item) => {\n if (item instanceof HTMLElement) {\n if (item.isConnected) acc.push(item)\n } else if (item && item.current instanceof HTMLElement) {\n if (item.current.isConnected) acc.push(item.current)\n }\n\n return acc\n }, [])\n"],"names":["target","Array","isArray","reduce","acc","item","HTMLElement","isConnected","push","current"],"mappings":"mCAEmEA,IAChEC,MAAMC,QAAQF,GAAUA,EAAS,CAACA,IAASG,QAAY,CAACC,EAAKC,KACxDA,aAAgBC,YACdD,EAAKE,aAAaH,EAAII,KAAKH,GACtBA,GAAQA,EAAKI,mBAAmBH,aACrCD,EAAKI,QAAQF,aAAaH,EAAII,KAAKH,EAAKI,SAGvCL,IACN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDomTargets.mjs","sources":["../../../../src/shared/utils/getDomTargets.ts"],"sourcesContent":["import type { DomTarget } from 'shared/types'\n\nexport const getDomTargets = <T extends HTMLElement = HTMLElement>(target: DomTarget<T> | DomTarget<T>[]): T[] =>\n (Array.isArray(target) ? target : [target]).reduce<T[]>((acc, item) => {\n if (item instanceof HTMLElement) {\n if (item.isConnected) acc.push(item)\n } else if (item && item.current instanceof HTMLElement) {\n if (item.current.isConnected) acc.push(item.current)\n }\n\n return acc\n }, [])\n"],"names":["getDomTargets","target","Array","isArray","reduce","acc","item","HTMLElement","isConnected","push","current"],"mappings":"AAEO,MAAMA,cAAsDC,IAChEC,MAAMC,QAAQF,GAAUA,EAAS,CAACA,IAASG,QAAY,CAACC,EAAKC,KACxDA,aAAgBC,YACdD,EAAKE,aAAaH,EAAII,KAAKH,GACtBA,GAAQA,EAAKI,mBAAmBH,aACrCD,EAAKI,QAAQF,aAAaH,EAAII,KAAKH,EAAKI,SAGvCL,IACN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProgressPercent.js","sources":["../../../../src/shared/utils/getProgressPercent.ts"],"sourcesContent":["export const getProgressPercent = (value: number, max: number): number => {\n if (value < 0 || max <= 0) return 0\n\n const percent = (value / max) * 100\n\n return Number.isNaN(percent) ? 0 : Math.round(Math.min(percent, 100))\n}\n"],"names":["getProgressPercent","value","max","percent","Number","isNaN","Math","round","min"],"mappings":"wCAAkCA,CAACC,EAAeC,KAChD,GAAID,EAAQ,GAAKC,GAAO,EAAG,OAAO,EAElC,MAAMC,EAAWF,EAAQC,EAAO,IAEhC,OAAOE,OAAOC,MAAMF,GAAW,EAAIG,KAAKC,MAAMD,KAAKE,IAAIL,EAAS,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProgressPercent.mjs","sources":["../../../../src/shared/utils/getProgressPercent.ts"],"sourcesContent":["export const getProgressPercent = (value: number, max: number): number => {\n if (value < 0 || max <= 0) return 0\n\n const percent = (value / max) * 100\n\n return Number.isNaN(percent) ? 0 : Math.round(Math.min(percent, 100))\n}\n"],"names":["getProgressPercent","value","max","percent","Number","isNaN","Math","round","min"],"mappings":"MAAaA,mBAAqBA,CAACC,EAAeC,KAChD,GAAID,EAAQ,GAAKC,GAAO,EAAG,OAAO,EAElC,MAAMC,EAAWF,EAAQC,EAAO,IAEhC,OAAOE,OAAOC,MAAMF,GAAW,EAAIG,KAAKC,MAAMD,KAAKE,IAAIL,EAAS,KAAK"}
|
package/shared/utils/misc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';const deepmerge=require('deepmerge-ts').deepmergeCustom({mergeArrays:!1});exports.createDebouncedCallback=(e,r=100)=>{let t=null;return
|
|
1
|
+
'use strict';const deepmerge=require('deepmerge-ts').deepmergeCustom({mergeArrays:!1});exports.createDebouncedCallback=(e,r=100)=>{let t=null;return l=>{t&&clearTimeout(t),t=setTimeout((()=>{e(l),t=null}),r)}},exports.createThrottledCallback=(e,r=100)=>{let t=null;return l=>{t||(t=setTimeout((()=>{t=null}),r),e(l))}},exports.deepmerge=deepmerge;
|
|
2
2
|
//# sourceMappingURL=misc.js.map
|
package/shared/utils/misc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n
|
|
1
|
+
{"version":3,"file":"misc.js","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n"],"names":["deepmerge","deepmergeCustom","mergeArrays","createDebouncedCallback","cb","debounceMS","timerId","params","clearTimeout","setTimeout","createThrottledCallback","throttleMS"],"mappings":"aAGaA,MAAAA,kCAAYC,gBAAgB,CACvCC,aAAa,oCAiBwBC,CAAIC,EAAyBC,EAAa,OAC/E,IAAIC,EAAgD,KAEpD,OAAQC,IACFD,GAASE,aAAaF,GAC1BA,EAAUG,YAAW,KACnBL,EAAGG,GACHD,EAAU,IAAI,GACbD,EAAW,CACf,kCAvBoCK,CAAIN,EAAyBO,EAAa,OAC/E,IAAIL,EAAmD,KAEvD,OAAQC,IACFD,IAEJA,EAAUG,YAAW,KACnBH,EAAU,IAAI,GACbK,GAEHP,EAAGG,GAAO,CACX"}
|
package/shared/utils/misc.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{deepmergeCustom}from'deepmerge-ts';const deepmerge=deepmergeCustom({mergeArrays:!1});const createThrottledCallback=(e,t=100)=>{let r=null;return l=>{r||(r=setTimeout((()=>{r=null}),t),e(l))}};const createDebouncedCallback=(e,t=100)=>{let r=null;return l=>{r&&clearTimeout(r),r=setTimeout((()=>{e(l),r=null}),t)}};
|
|
1
|
+
import{deepmergeCustom}from'deepmerge-ts';const deepmerge=deepmergeCustom({mergeArrays:!1});const createThrottledCallback=(e,t=100)=>{let r=null;return l=>{r||(r=setTimeout((()=>{r=null}),t),e(l))}};const createDebouncedCallback=(e,t=100)=>{let r=null;return l=>{r&&clearTimeout(r),r=setTimeout((()=>{e(l),r=null}),t)}};export{createDebouncedCallback,createThrottledCallback,deepmerge};
|
|
2
2
|
//# sourceMappingURL=misc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.mjs","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n
|
|
1
|
+
{"version":3,"file":"misc.mjs","sources":["../../../../src/shared/utils/misc.ts"],"sourcesContent":["import { deepmergeCustom } from 'deepmerge-ts'\nimport type { Nullable } from 'shared/types'\n\nexport const deepmerge = deepmergeCustom({\n mergeArrays: false,\n})\n\nexport const createThrottledCallback = <T>(cb: (params: T) => void, throttleMS = 100): typeof cb => {\n let timerId: Nullable<ReturnType<typeof setTimeout>> = null\n\n return (params: T) => {\n if (timerId) return\n\n timerId = setTimeout(() => {\n timerId = null\n }, throttleMS)\n\n cb(params)\n }\n}\n\nexport const createDebouncedCallback = <T>(cb: (params: T) => void, debounceMS = 100): typeof cb => {\n let timerId: ReturnType<typeof setTimeout> | null = null\n\n return (params: T) => {\n if (timerId) clearTimeout(timerId)\n timerId = setTimeout(() => {\n cb(params)\n timerId = null\n }, debounceMS)\n }\n}\n"],"names":["deepmerge","deepmergeCustom","mergeArrays","createThrottledCallback","cb","throttleMS","timerId","params","setTimeout","createDebouncedCallback","debounceMS","clearTimeout"],"mappings":"0CAGaA,MAAAA,UAAYC,gBAAgB,CACvCC,aAAa,IAGR,MAAMC,wBAA0BA,CAAIC,EAAyBC,EAAa,OAC/E,IAAIC,EAAmD,KAEvD,OAAQC,IACFD,IAEJA,EAAUE,YAAW,KACnBF,EAAU,IAAI,GACbD,GAEHD,EAAGG,GAAO,CACX,EAGI,MAAME,wBAA0BA,CAAIL,EAAyBM,EAAa,OAC/E,IAAIJ,EAAgD,KAEpD,OAAQC,IACFD,GAASK,aAAaL,GAC1BA,EAAUE,YAAW,KACnBJ,EAAGG,GACHD,EAAU,IAAI,GACbI,EAAW,CACf"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var React=require('react');var accordion=require('../../shared/context/accordion.js');var misc=require('../../shared/utils/misc.js');exports.useAccordionPanel=({defaultExpanded:e=!1,id:n,expanded:t,onExpandedChange:o})=>{const a=React.useContext(accordion.AccordionPanelsContext);const[c,r]=React.useState(t??e);const s=a!==null&&typeof n=='string';return React.useLayoutEffect((()=>{s||t===void 0||r(t)}),[s,t]),{panelExpanded:s?a.expandedPanels.includes(n):c,setPanelExpanded:e=>{s?a.updatePanels(n,e):(t===void 0&&r(e),o&&o(e))}}},exports.useAccordionPanelProps=e=>{const n=React.useContext(accordion.AccordionPropsContext);return n?misc.deepmerge(n,e):e};
|
|
2
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../../../../src/components/AccordionItem/hooks.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext, AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels","props","contextProps","AccordionPropsContext","deepmerge"],"mappings":"4KAKiCA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,iBAAWC,UAAAA,wBAE3B,MAAOC,EAAoBC,GAAyBC,MAAAA,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,MAAAA,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH,iCAGuCE,IACxC,MAAMC,EAAef,iBAAWgB,UAAAA,uBAEhC,OAAQD,EAAeE,KAASA,UAACF,EAAcD,GAASA,CAAK"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useContext,useState,useLayoutEffect}from'react';import{AccordionPanelsContext,AccordionPropsContext}from'../../shared/context/accordion.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';const useAccordionPanel=({defaultExpanded:e=!1,id:o,expanded:n,onExpandedChange:t})=>{const s=useContext(AccordionPanelsContext);const[d,c]=useState(n??e);const r=s!==null&&typeof o=='string';return useLayoutEffect((()=>{r||n===void 0||c(n)}),[r,n]),{panelExpanded:r?s.expandedPanels.includes(o):d,setPanelExpanded:e=>{r?s.updatePanels(o,e):(n===void 0&&c(e),t&&t(e))}}};const useAccordionPanelProps=e=>{const o=useContext(AccordionPropsContext);return o?deepmerge(o,e):e};export{useAccordionPanel,useAccordionPanelProps};
|
|
2
|
-
//# sourceMappingURL=hooks.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.mjs","sources":["../../../../src/components/AccordionItem/hooks.ts"],"sourcesContent":["import { useContext, useState, useLayoutEffect } from 'react'\nimport { AccordionPanelsContext, AccordionPropsContext } from 'shared/context/accordion'\nimport { deepmerge } from 'shared/utils/misc'\nimport type { AccordionItemProps } from './types'\n\nexport const useAccordionPanel = ({\n defaultExpanded = false,\n id,\n expanded,\n onExpandedChange,\n}: Pick<AccordionItemProps, 'id' | 'expanded' | 'defaultExpanded' | 'onExpandedChange'>): {\n panelExpanded: boolean\n setPanelExpanded: (update: boolean) => void\n} => {\n const context = useContext(AccordionPanelsContext)\n\n const [panelExpandedLocal, setPanelExpandedLocal] = useState<boolean>(expanded ?? defaultExpanded)\n\n const contextEnabled = context !== null && typeof id === 'string'\n\n useLayoutEffect(() => {\n if (!contextEnabled && expanded !== undefined) {\n setPanelExpandedLocal(expanded)\n }\n }, [contextEnabled, expanded])\n\n return {\n panelExpanded: contextEnabled ? context.expandedPanels.includes(id) : panelExpandedLocal,\n setPanelExpanded: (update) => {\n if (contextEnabled) {\n context.updatePanels(id, update)\n } else {\n if (expanded === undefined) setPanelExpandedLocal(update)\n if (onExpandedChange) onExpandedChange(update)\n }\n },\n }\n}\n\nexport const useAccordionPanelProps = <T>(props: T): T => {\n const contextProps = useContext(AccordionPropsContext)\n\n return (contextProps ? deepmerge(contextProps, props) : props) as T\n}\n"],"names":["useAccordionPanel","defaultExpanded","id","expanded","onExpandedChange","context","useContext","AccordionPanelsContext","panelExpandedLocal","setPanelExpandedLocal","useState","contextEnabled","useLayoutEffect","undefined","panelExpanded","expandedPanels","includes","setPanelExpanded","update","updatePanels","useAccordionPanelProps","props","contextProps","AccordionPropsContext","deepmerge"],"mappings":"uMAKO,MAAMA,kBAAoBA,EAC/BC,mBAAkB,EAClBC,KACAC,WACAC,uBAKA,MAAMC,EAAUC,WAAWC,wBAE3B,MAAOC,EAAoBC,GAAyBC,SAAkBP,GAAYF,GAElF,MAAMU,EAAiBN,IAAY,aAAeH,GAAO,SAQzD,OANAU,iBAAgB,KACTD,GAAkBR,SAAaU,GAClCJ,EAAsBN,EACxB,GACC,CAACQ,EAAgBR,IAEb,CACLW,cAAeH,EAAiBN,EAAQU,eAAeC,SAASd,GAAMM,EACtES,iBAAmBC,IACbP,EACFN,EAAQc,aAAajB,EAAIgB,IAErBf,SAAaU,GAAWJ,EAAsBS,GAC9Cd,GAAkBA,EAAiBc,GACzC,EAEH,EAGUE,MAAAA,uBAA6BC,IACxC,MAAMC,EAAehB,WAAWiB,uBAEhC,OAAQD,EAAeE,UAAUF,EAAcD,GAASA,CAAK"}
|