@foxford/ui 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Chip/constants.js +1 -1
- package/components/Chip/constants.js.map +1 -1
- package/components/Chip/constants.mjs +1 -1
- package/components/Chip/constants.mjs.map +1 -1
- package/components/Dropdown/Dropdown.js +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.mjs +1 -1
- package/components/Dropdown/Dropdown.mjs.map +1 -1
- package/components/Dropdown/DropdownMenu.js +2 -0
- package/components/Dropdown/DropdownMenu.js.map +1 -0
- package/components/Dropdown/DropdownMenu.mjs +2 -0
- package/components/Dropdown/DropdownMenu.mjs.map +1 -0
- package/components/Dropdown/constants.js +1 -1
- package/components/Dropdown/constants.js.map +1 -1
- package/components/Dropdown/constants.mjs +1 -1
- package/components/Dropdown/constants.mjs.map +1 -1
- package/components/Dropdown/style.js +1 -1
- package/components/Dropdown/style.js.map +1 -1
- package/components/Dropdown/style.mjs +1 -1
- package/components/Dropdown/style.mjs.map +1 -1
- package/components/Dropdown/utils.js.map +1 -1
- package/components/Dropdown/utils.mjs.map +1 -1
- package/components/Menu/Menu.js +1 -1
- package/components/Menu/Menu.js.map +1 -1
- package/components/Menu/Menu.mjs +1 -1
- package/components/Menu/Menu.mjs.map +1 -1
- package/components/MenuComponent/MenuComponent.js +1 -1
- package/components/MenuComponent/MenuComponent.js.map +1 -1
- package/components/MenuComponent/MenuComponent.mjs +1 -1
- package/components/MenuComponent/MenuComponent.mjs.map +1 -1
- package/components/MenuComponent/constants.js +1 -1
- package/components/MenuComponent/constants.js.map +1 -1
- package/components/MenuComponent/constants.mjs +1 -1
- package/components/MenuComponent/constants.mjs.map +1 -1
- package/components/MenuComponent/style.js +1 -1
- package/components/MenuComponent/style.js.map +1 -1
- package/components/MenuComponent/style.mjs +1 -1
- package/components/MenuComponent/style.mjs.map +1 -1
- package/components/MenuContainer/MenuContainer.js +1 -1
- package/components/MenuContainer/MenuContainer.js.map +1 -1
- package/components/MenuContainer/MenuContainer.mjs +1 -1
- package/components/MenuContainer/MenuContainer.mjs.map +1 -1
- package/dts/index.d.ts +16 -10
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var constants=require('../FormInputLabel/constants.js');var constants$1=require('../InputCheckbox/constants.js');const SIZES={
|
|
1
|
+
'use strict';var constants=require('../FormInputLabel/constants.js');var constants$1=require('../InputCheckbox/constants.js');const SIZES={l:constants.SIZES.l,m:constants.SIZES.m,s:constants.SIZES.s};const SIZES_CHECKBOX={l:constants$1.SIZES.m,m:constants$1.SIZES.s,s:constants$1.SIZES.xs};exports.FuseSearchKeys={text:'text',tags:'tags'},exports.SIZES=SIZES,exports.SIZES_CHECKBOX=SIZES_CHECKBOX,exports.SIZES_MENU={l:{width:560,minWidth:'auto',maxWidth:'none'},m:{width:480,minWidth:'auto',maxWidth:'none'},s:{width:280,minWidth:'auto',maxWidth:'none'},fluid:{width:'100%',minWidth:'auto',maxWidth:'none'}};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/Dropdown/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_FORM_INPUT_LABEL } from 'components/FormInputLabel'\nimport { SIZES as SIZES_INPUT_CHECKBOX } from 'components/InputCheckbox'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/Dropdown/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_FORM_INPUT_LABEL } from 'components/FormInputLabel'\nimport { SIZES as SIZES_INPUT_CHECKBOX } from 'components/InputCheckbox'\nimport type { MenuComponentSize } from 'components/MenuComponent'\nimport type { DropdownSize } from './types'\n\nexport const FuseSearchKeys = {\n text: 'text',\n tags: 'tags',\n} as const\n\nexport const SIZES: Record<DropdownSize, CSSProperties> = {\n l: SIZES_FORM_INPUT_LABEL.l,\n m: SIZES_FORM_INPUT_LABEL.m,\n s: SIZES_FORM_INPUT_LABEL.s,\n}\n\nexport const SIZES_CHECKBOX: Record<DropdownSize, CSSProperties> = {\n l: SIZES_INPUT_CHECKBOX.m,\n m: SIZES_INPUT_CHECKBOX.s,\n s: SIZES_INPUT_CHECKBOX.xs,\n}\n\nexport const SIZES_MENU: Record<MenuComponentSize, CSSProperties> = {\n l: {\n width: 560,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n m: {\n width: 480,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n s: {\n width: 280,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n fluid: {\n width: '100%',\n minWidth: 'auto',\n maxWidth: 'none',\n },\n}\n"],"names":["SIZES","l","SIZES_FORM_INPUT_LABEL","m","s","SIZES_CHECKBOX","SIZES_INPUT_CHECKBOX","xs","text","tags","width","minWidth","maxWidth","fluid"],"mappings":"8HAWO,MAAMA,MAA6C,CACxDC,EAAGC,UAAsBF,MAACC,EAC1BE,EAAGD,UAAsBF,MAACG,EAC1BC,EAAGF,UAAsBF,MAACI,GAGrB,MAAMC,eAAsD,CACjEJ,EAAGK,YAAoBN,MAACG,EACxBA,EAAGG,YAAoBN,MAACI,EACxBA,EAAGE,YAAoBN,MAACO,2BAdI,CAC5BC,KAAM,OACNC,KAAM,qFAe4D,CAClER,EAAG,CACDS,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZT,EAAG,CACDO,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZR,EAAG,CACDM,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZC,MAAO,CACLH,MAAO,OACPC,SAAU,OACVC,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{SIZES as SIZES$1}from'../FormInputLabel/constants.mjs';import{SIZES as SIZES$2}from'../InputCheckbox/constants.mjs';const FuseSearchKeys={text:'text',tags:'tags'};const SIZES={
|
|
1
|
+
import{SIZES as SIZES$1}from'../FormInputLabel/constants.mjs';import{SIZES as SIZES$2}from'../InputCheckbox/constants.mjs';const FuseSearchKeys={text:'text',tags:'tags'};const SIZES={l:SIZES$1.l,m:SIZES$1.m,s:SIZES$1.s};const SIZES_CHECKBOX={l:SIZES$2.m,m:SIZES$2.s,s:SIZES$2.xs};const SIZES_MENU={l:{width:560,minWidth:'auto',maxWidth:'none'},m:{width:480,minWidth:'auto',maxWidth:'none'},s:{width:280,minWidth:'auto',maxWidth:'none'},fluid:{width:'100%',minWidth:'auto',maxWidth:'none'}};export{FuseSearchKeys,SIZES,SIZES_CHECKBOX,SIZES_MENU};
|
|
2
2
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Dropdown/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_FORM_INPUT_LABEL } from 'components/FormInputLabel'\nimport { SIZES as SIZES_INPUT_CHECKBOX } from 'components/InputCheckbox'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/Dropdown/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES as SIZES_FORM_INPUT_LABEL } from 'components/FormInputLabel'\nimport { SIZES as SIZES_INPUT_CHECKBOX } from 'components/InputCheckbox'\nimport type { MenuComponentSize } from 'components/MenuComponent'\nimport type { DropdownSize } from './types'\n\nexport const FuseSearchKeys = {\n text: 'text',\n tags: 'tags',\n} as const\n\nexport const SIZES: Record<DropdownSize, CSSProperties> = {\n l: SIZES_FORM_INPUT_LABEL.l,\n m: SIZES_FORM_INPUT_LABEL.m,\n s: SIZES_FORM_INPUT_LABEL.s,\n}\n\nexport const SIZES_CHECKBOX: Record<DropdownSize, CSSProperties> = {\n l: SIZES_INPUT_CHECKBOX.m,\n m: SIZES_INPUT_CHECKBOX.s,\n s: SIZES_INPUT_CHECKBOX.xs,\n}\n\nexport const SIZES_MENU: Record<MenuComponentSize, CSSProperties> = {\n l: {\n width: 560,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n m: {\n width: 480,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n s: {\n width: 280,\n minWidth: 'auto',\n maxWidth: 'none',\n },\n fluid: {\n width: '100%',\n minWidth: 'auto',\n maxWidth: 'none',\n },\n}\n"],"names":["FuseSearchKeys","text","tags","SIZES","l","SIZES_FORM_INPUT_LABEL","m","s","SIZES_CHECKBOX","SIZES_INPUT_CHECKBOX","xs","SIZES_MENU","width","minWidth","maxWidth","fluid"],"mappings":"2HAMO,MAAMA,eAAiB,CAC5BC,KAAM,OACNC,KAAM,QAGD,MAAMC,MAA6C,CACxDC,EAAGC,QAAuBD,EAC1BE,EAAGD,QAAuBC,EAC1BC,EAAGF,QAAuBE,GAGrB,MAAMC,eAAsD,CACjEJ,EAAGK,QAAqBH,EACxBA,EAAGG,QAAqBF,EACxBA,EAAGE,QAAqBC,IAGnB,MAAMC,WAAuD,CAClEP,EAAG,CACDQ,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZR,EAAG,CACDM,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZP,EAAG,CACDK,MAAO,IACPC,SAAU,OACVC,SAAU,QAEZC,MAAO,CACLH,MAAO,OACPC,SAAU,OACVC,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var index=require('../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js');var index$1=require('../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.js');function _interopDefault(n){return n&&n.__esModule?n:{default:n}}var styled__default=_interopDefault(styled);const Input=styled__default.default.input.withConfig({shouldForwardProp:n=>!['palette','preset','label','labelPosition','active'].includes(n)}).withConfig({displayName:"Dropdown__Input",componentId:"ui__sc-519mcg-0"})([""," ",""],(n=>{let o='1';let e='0px';return n.label&&n.labelPosition==='dynamic'&&(o=""+(n.active?1:0),e='0.8em'),n.label&&n.labelPosition==='top'&&(e='0.8em'),n.label&&n.labelPosition==='center'&&(o=""+(n.active?1:0)),`\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${o};\n padding-top: ${e};\n cursor: ${n.disabled?'not-allowed':'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `}),(n=>{return`\n color: ${(o={color:n.palette.color??n.theme.colors['content-onmain-primary'],placeholderColor:n.palette.placeholderColor??n.theme.colors['content-onmain-secondary'],colorDisabled:n.palette.colorDisabled??n.theme.colors['content-disabled'],placeholderColorDisabled:n.palette.placeholderColorDisabled??n.theme.colors['content-disabled']}).color};\n &::placeholder {\n color: ${o.placeholderColor};\n }\n &:disabled {\n color: ${o.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${o.placeholderColorDisabled};\n }\n`;var o}));const spinAnimation=styled.keyframes(["100%{transform:rotate(360deg);}"]);const IconContainer=styled__default.default.div.withConfig({displayName:"Dropdown__IconContainer",componentId:"ui__sc-519mcg-
|
|
1
|
+
'use strict';var styled=require('styled-components');var MenuComponent=require('../MenuComponent/MenuComponent.js');var index=require('../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.js');var index$1=require('../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.js');function _interopDefault(n){return n&&n.__esModule?n:{default:n}}var styled__default=_interopDefault(styled);const Input=styled__default.default.input.withConfig({shouldForwardProp:n=>!['palette','preset','label','labelPosition','active'].includes(n)}).withConfig({displayName:"Dropdown__Input",componentId:"ui__sc-519mcg-0"})([""," ",""],(n=>{let o='1';let e='0px';return n.label&&n.labelPosition==='dynamic'&&(o=""+(n.active?1:0),e='0.8em'),n.label&&n.labelPosition==='top'&&(e='0.8em'),n.label&&n.labelPosition==='center'&&(o=""+(n.active?1:0)),`\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${o};\n padding-top: ${e};\n cursor: ${n.disabled?'not-allowed':'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `}),(n=>{return`\n color: ${(o={color:n.palette.color??n.theme.colors['content-onmain-primary'],placeholderColor:n.palette.placeholderColor??n.theme.colors['content-onmain-secondary'],colorDisabled:n.palette.colorDisabled??n.theme.colors['content-disabled'],placeholderColorDisabled:n.palette.placeholderColorDisabled??n.theme.colors['content-disabled']}).color};\n &::placeholder {\n color: ${o.placeholderColor};\n }\n &:disabled {\n color: ${o.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${o.placeholderColorDisabled};\n }\n`;var o}));const PositionedMenuComponent=styled__default.default(MenuComponent.MenuComponent).withConfig({shouldForwardProp:n=>!['expanseDirectionLeft'].includes(n)}).withConfig({displayName:"Dropdown__PositionedMenuComponent",componentId:"ui__sc-519mcg-1"})(["position:absolute;",""],(n=>`\n top: 0;\n left: ${n.expanseDirectionLeft?'auto':0};\n right: ${n.expanseDirectionLeft?0:'auto'}; \n `));const spinAnimation=styled.keyframes(["100%{transform:rotate(360deg);}"]);const IconContainer=styled__default.default.div.withConfig({displayName:"Dropdown__IconContainer",componentId:"ui__sc-519mcg-2"})(["box-sizing:border-box;display:flex;align-items:center;justify-content:center;margin:12px 0;"]);const ChevronIcon=styled__default.default(index.ChevronDown).withConfig({shouldForwardProp:n=>n!=='up'}).withConfig({displayName:"Dropdown__ChevronIcon",componentId:"ui__sc-519mcg-3"})(["",""],(n=>`\n transition-property: transform;\n transition-duration: 250ms;\n transform-origin: center;\n transform: rotate(${n.up?180:0}deg);\n `));const LoadingIconAnimated=styled__default.default(index$1.LoaderFill).withConfig({displayName:"Dropdown__LoadingIconAnimated",componentId:"ui__sc-519mcg-4"})(["transform-origin:center;animation:"," 1600ms infinite linear;"],spinAnimation);exports.ChevronIcon=ChevronIcon,exports.IconContainer=IconContainer,exports.Input=Input,exports.LoadingIconAnimated=LoadingIconAnimated,exports.PositionedMenuComponent=PositionedMenuComponent;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/Dropdown/style.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components'\nimport { LoaderFill, ChevronDown } from '@foxford/icon-pack'\nimport type { DropdownInputPalette,
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/Dropdown/style.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components'\nimport { LoaderFill, ChevronDown } from '@foxford/icon-pack'\nimport { MenuComponent } from 'components/MenuComponent'\nimport type { DropdownInputPalette, DropdownMenuProps, StyledDropdownInputProps, StyledChevronIconProps } from './types'\n\nconst template = (palette: DropdownInputPalette) => `\n color: ${palette.color};\n &::placeholder {\n color: ${palette.placeholderColor};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${palette.placeholderColorDisabled};\n }\n`\n\nexport const Input = styled.input.withConfig<StyledDropdownInputProps>({\n shouldForwardProp: (propKey) => !['palette', 'preset', 'label', 'labelPosition', 'active'].includes(propKey),\n})`\n ${(props) => {\n let opacity = '1'\n let paddingTop = '0px'\n\n if (props.label && props.labelPosition === 'dynamic') {\n opacity = `${props.active ? 1 : 0}`\n paddingTop = '0.8em'\n }\n\n if (props.label && props.labelPosition === 'top') {\n paddingTop = '0.8em'\n }\n\n if (props.label && props.labelPosition === 'center') {\n opacity = `${props.active ? 1 : 0}`\n }\n\n return `\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${opacity};\n padding-top: ${paddingTop};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `\n }}\n ${(props) =>\n template({\n color: props.palette.color ?? props.theme.colors['content-onmain-primary'],\n placeholderColor: props.palette.placeholderColor ?? props.theme.colors['content-onmain-secondary'],\n colorDisabled: props.palette.colorDisabled ?? props.theme.colors['content-disabled'],\n placeholderColorDisabled: props.palette.placeholderColorDisabled ?? props.theme.colors['content-disabled'],\n })}\n`\n\nexport const PositionedMenuComponent = styled(MenuComponent).withConfig<DropdownMenuProps>({\n shouldForwardProp: (propKey) => !['expanseDirectionLeft'].includes(propKey),\n})`\n position: absolute;\n\n ${(props) => `\n top: 0;\n left: ${props.expanseDirectionLeft ? 'auto' : 0};\n right: ${props.expanseDirectionLeft ? 0 : 'auto'}; \n `}\n`\n\nconst spinAnimation = keyframes`\n 100% {\n transform: rotate(360deg);\n }\n`\n\nexport const IconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 12px 0;\n`\n\nexport const ChevronIcon = styled(ChevronDown).withConfig<StyledChevronIconProps>({\n shouldForwardProp: (propKey) => propKey !== 'up',\n})`\n ${(props) => `\n transition-property: transform;\n transition-duration: 250ms;\n transform-origin: center;\n transform: rotate(${props.up ? 180 : 0}deg);\n `}\n`\n\nexport const LoadingIconAnimated = styled(LoaderFill)`\n transform-origin: center;\n animation: ${spinAnimation} 1600ms infinite linear;\n`\n"],"names":["Input","styled","input","withConfig","shouldForwardProp","propKey","includes","displayName","componentId","props","opacity","paddingTop","label","labelPosition","active","disabled","template","palette","color","theme","colors","placeholderColor","colorDisabled","placeholderColorDisabled","PositionedMenuComponent","default","MenuComponent","expanseDirectionLeft","spinAnimation","keyframes","IconContainer","div","ChevronIcon","ChevronDown","up","LoadingIconAnimated","LoaderFill"],"mappings":"sjBAkBO,MAAMA,MAAQC,gBAAAA,QAAOC,MAAMC,WAAqC,CACrEC,kBAAoBC,IAAa,CAAC,UAAW,SAAU,QAAS,gBAAiB,UAAUC,SAASD,KACpGF,WAAA,CAAAI,YAAA,kBAAAC,YAAA,mBAFmBP,CAEnB,CAAA,GAAA,IAAA,KACGQ,IACD,IAAIC,EAAU,IACd,IAAIC,EAAa,MAejB,OAbIF,EAAMG,OAASH,EAAMI,gBAAkB,YACzCH,EAAU,IAAGD,EAAMK,OAAS,EAAI,GAChCH,EAAa,SAGXF,EAAMG,OAASH,EAAMI,gBAAkB,QACzCF,EAAa,SAGXF,EAAMG,OAASH,EAAMI,gBAAkB,WACzCH,EAAU,IAAGD,EAAMK,OAAS,EAAI,IAG3B,yRAWMJ,0BACIC,qBACLF,EAAMM,SAAW,cAAgB,6FAM5C,IAEAN,IACDO,MAvDgD,eAAlCC,EAuDL,CACPC,MAAOT,EAAMQ,QAAQC,OAAST,EAAMU,MAAMC,OAAO,0BACjDC,iBAAkBZ,EAAMQ,QAAQI,kBAAoBZ,EAAMU,MAAMC,OAAO,4BACvEE,cAAeb,EAAMQ,QAAQK,eAAiBb,EAAMU,MAAMC,OAAO,oBACjEG,yBAA0Bd,EAAMQ,QAAQM,0BAA4Bd,EAAMU,MAAMC,OAAO,sBA1D1EF,0CAEND,EAAQI,sDAGRJ,EAAQK,gEAGRL,EAAQM,mCATHN,KA4DZ,IAGC,MAAMO,wBAA0BvB,gBAAMwB,QAACC,6BAAevB,WAA8B,CACzFC,kBAAoBC,IAAa,CAAC,wBAAwBC,SAASD,KACnEF,WAAA,CAAAI,YAAA,oCAAAC,YAAA,mBAFqCP,CAErC,CAAA,qBAAA,KAGGQ,GAAU,4BAEHA,EAAMkB,qBAAuB,OAAS,kBACrClB,EAAMkB,qBAAuB,EAAI,kBAI9C,MAAMC,cAAgBC,OAASA,UAI9B,CAAA,0CAEYC,cAAgB7B,gBAAAA,QAAO8B,IAAG5B,WAAA,CAAAI,YAAA,0BAAAC,YAAA,mBAAVP,CAM5B,CAAA,gGAEM,MAAM+B,YAAc/B,gBAAMwB,QAACQ,mBAAa9B,WAAmC,CAChFC,kBAAoBC,GAAYA,IAAY,OAC5CF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFyBP,CAEzB,CAAA,GAAA,KACGQ,GAAU,gIAISA,EAAMyB,GAAK,IAAM,eAIlC,MAAMC,oBAAsBlC,gBAAMwB,QAACW,oBAAWjC,WAAA,CAAAI,YAAA,gCAAAC,YAAA,mBAAlBP,CAAkB,CAAA,qCAAA,4BAEtC2B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled,{keyframes}from'styled-components';import{ChevronDown as ChevronDown_2}from'../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.mjs';import{LoaderFill as LoaderFill_2}from'../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.mjs';const Input=styled.input.withConfig({shouldForwardProp:o=>!['palette','preset','label','labelPosition','active'].includes(o)}).withConfig({displayName:"Dropdown__Input",componentId:"ui__sc-519mcg-0"})([""," ",""],(o=>{let n='1';let e='0px';return o.label&&o.labelPosition==='dynamic'&&(n=""+(o.active?1:0),e='0.8em'),o.label&&o.labelPosition==='top'&&(e='0.8em'),o.label&&o.labelPosition==='center'&&(n=""+(o.active?1:0)),`\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${n};\n padding-top: ${e};\n cursor: ${o.disabled?'not-allowed':'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `}),(o=>{return`\n color: ${(n={color:o.palette.color??o.theme.colors['content-onmain-primary'],placeholderColor:o.palette.placeholderColor??o.theme.colors['content-onmain-secondary'],colorDisabled:o.palette.colorDisabled??o.theme.colors['content-disabled'],placeholderColorDisabled:o.palette.placeholderColorDisabled??o.theme.colors['content-disabled']}).color};\n &::placeholder {\n color: ${n.placeholderColor};\n }\n &:disabled {\n color: ${n.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${n.placeholderColorDisabled};\n }\n`;var n}));const spinAnimation=keyframes(["100%{transform:rotate(360deg);}"]);const IconContainer=styled.div.withConfig({displayName:"Dropdown__IconContainer",componentId:"ui__sc-519mcg-
|
|
1
|
+
import styled,{keyframes}from'styled-components';import{MenuComponent}from'../MenuComponent/MenuComponent.mjs';import{ChevronDown as ChevronDown_2}from'../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/ChevronDown/index.mjs';import{LoaderFill as LoaderFill_2}from'../../external/.pnpm/@foxford_icon-pack@0.6.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@foxford/icon-pack/icons/LoaderFill/index.mjs';const Input=styled.input.withConfig({shouldForwardProp:o=>!['palette','preset','label','labelPosition','active'].includes(o)}).withConfig({displayName:"Dropdown__Input",componentId:"ui__sc-519mcg-0"})([""," ",""],(o=>{let n='1';let e='0px';return o.label&&o.labelPosition==='dynamic'&&(n=""+(o.active?1:0),e='0.8em'),o.label&&o.labelPosition==='top'&&(e='0.8em'),o.label&&o.labelPosition==='center'&&(n=""+(o.active?1:0)),`\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${n};\n padding-top: ${e};\n cursor: ${o.disabled?'not-allowed':'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `}),(o=>{return`\n color: ${(n={color:o.palette.color??o.theme.colors['content-onmain-primary'],placeholderColor:o.palette.placeholderColor??o.theme.colors['content-onmain-secondary'],colorDisabled:o.palette.colorDisabled??o.theme.colors['content-disabled'],placeholderColorDisabled:o.palette.placeholderColorDisabled??o.theme.colors['content-disabled']}).color};\n &::placeholder {\n color: ${n.placeholderColor};\n }\n &:disabled {\n color: ${n.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${n.placeholderColorDisabled};\n }\n`;var n}));const PositionedMenuComponent=styled(MenuComponent).withConfig({shouldForwardProp:o=>!['expanseDirectionLeft'].includes(o)}).withConfig({displayName:"Dropdown__PositionedMenuComponent",componentId:"ui__sc-519mcg-1"})(["position:absolute;",""],(o=>`\n top: 0;\n left: ${o.expanseDirectionLeft?'auto':0};\n right: ${o.expanseDirectionLeft?0:'auto'}; \n `));const spinAnimation=keyframes(["100%{transform:rotate(360deg);}"]);const IconContainer=styled.div.withConfig({displayName:"Dropdown__IconContainer",componentId:"ui__sc-519mcg-2"})(["box-sizing:border-box;display:flex;align-items:center;justify-content:center;margin:12px 0;"]);const ChevronIcon=styled(ChevronDown_2).withConfig({shouldForwardProp:o=>o!=='up'}).withConfig({displayName:"Dropdown__ChevronIcon",componentId:"ui__sc-519mcg-3"})(["",""],(o=>`\n transition-property: transform;\n transition-duration: 250ms;\n transform-origin: center;\n transform: rotate(${o.up?180:0}deg);\n `));const LoadingIconAnimated=styled(LoaderFill_2).withConfig({displayName:"Dropdown__LoadingIconAnimated",componentId:"ui__sc-519mcg-4"})(["transform-origin:center;animation:"," 1600ms infinite linear;"],spinAnimation);export{ChevronIcon,IconContainer,Input,LoadingIconAnimated,PositionedMenuComponent};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Dropdown/style.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components'\nimport { LoaderFill, ChevronDown } from '@foxford/icon-pack'\nimport type { DropdownInputPalette,
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Dropdown/style.ts"],"sourcesContent":["import styled, { keyframes } from 'styled-components'\nimport { LoaderFill, ChevronDown } from '@foxford/icon-pack'\nimport { MenuComponent } from 'components/MenuComponent'\nimport type { DropdownInputPalette, DropdownMenuProps, StyledDropdownInputProps, StyledChevronIconProps } from './types'\n\nconst template = (palette: DropdownInputPalette) => `\n color: ${palette.color};\n &::placeholder {\n color: ${palette.placeholderColor};\n }\n &:disabled {\n color: ${palette.colorDisabled};\n }\n &:disabled::placeholder {\n color: ${palette.placeholderColorDisabled};\n }\n`\n\nexport const Input = styled.input.withConfig<StyledDropdownInputProps>({\n shouldForwardProp: (propKey) => !['palette', 'preset', 'label', 'labelPosition', 'active'].includes(propKey),\n})`\n ${(props) => {\n let opacity = '1'\n let paddingTop = '0px'\n\n if (props.label && props.labelPosition === 'dynamic') {\n opacity = `${props.active ? 1 : 0}`\n paddingTop = '0.8em'\n }\n\n if (props.label && props.labelPosition === 'top') {\n paddingTop = '0.8em'\n }\n\n if (props.label && props.labelPosition === 'center') {\n opacity = `${props.active ? 1 : 0}`\n }\n\n return `\n box-sizing: border-box;\n appearance: textfield;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n background-color: transparent;\n width: 100%;\n align-self: stretch;\n opacity: ${opacity};\n padding-top: ${paddingTop};\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n\n &:focus {\n cursor: text;\n outline: none;\n }\n `\n }}\n ${(props) =>\n template({\n color: props.palette.color ?? props.theme.colors['content-onmain-primary'],\n placeholderColor: props.palette.placeholderColor ?? props.theme.colors['content-onmain-secondary'],\n colorDisabled: props.palette.colorDisabled ?? props.theme.colors['content-disabled'],\n placeholderColorDisabled: props.palette.placeholderColorDisabled ?? props.theme.colors['content-disabled'],\n })}\n`\n\nexport const PositionedMenuComponent = styled(MenuComponent).withConfig<DropdownMenuProps>({\n shouldForwardProp: (propKey) => !['expanseDirectionLeft'].includes(propKey),\n})`\n position: absolute;\n\n ${(props) => `\n top: 0;\n left: ${props.expanseDirectionLeft ? 'auto' : 0};\n right: ${props.expanseDirectionLeft ? 0 : 'auto'}; \n `}\n`\n\nconst spinAnimation = keyframes`\n 100% {\n transform: rotate(360deg);\n }\n`\n\nexport const IconContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 12px 0;\n`\n\nexport const ChevronIcon = styled(ChevronDown).withConfig<StyledChevronIconProps>({\n shouldForwardProp: (propKey) => propKey !== 'up',\n})`\n ${(props) => `\n transition-property: transform;\n transition-duration: 250ms;\n transform-origin: center;\n transform: rotate(${props.up ? 180 : 0}deg);\n `}\n`\n\nexport const LoadingIconAnimated = styled(LoaderFill)`\n transform-origin: center;\n animation: ${spinAnimation} 1600ms infinite linear;\n`\n"],"names":["Input","styled","input","withConfig","shouldForwardProp","propKey","includes","displayName","componentId","props","opacity","paddingTop","label","labelPosition","active","disabled","template","palette","color","theme","colors","placeholderColor","colorDisabled","placeholderColorDisabled","PositionedMenuComponent","MenuComponent","expanseDirectionLeft","spinAnimation","keyframes","IconContainer","div","ChevronIcon","ChevronDown","up","LoadingIconAnimated","LoaderFill"],"mappings":"4eAkBO,MAAMA,MAAQC,OAAOC,MAAMC,WAAqC,CACrEC,kBAAoBC,IAAa,CAAC,UAAW,SAAU,QAAS,gBAAiB,UAAUC,SAASD,KACpGF,WAAA,CAAAI,YAAA,kBAAAC,YAAA,mBAFmBP,CAEnB,CAAA,GAAA,IAAA,KACGQ,IACD,IAAIC,EAAU,IACd,IAAIC,EAAa,MAejB,OAbIF,EAAMG,OAASH,EAAMI,gBAAkB,YACzCH,EAAU,IAAGD,EAAMK,OAAS,EAAI,GAChCH,EAAa,SAGXF,EAAMG,OAASH,EAAMI,gBAAkB,QACzCF,EAAa,SAGXF,EAAMG,OAASH,EAAMI,gBAAkB,WACzCH,EAAU,IAAGD,EAAMK,OAAS,EAAI,IAG3B,yRAWMJ,0BACIC,qBACLF,EAAMM,SAAW,cAAgB,6FAM5C,IAEAN,IACDO,MAvDgD,eAAlCC,EAuDL,CACPC,MAAOT,EAAMQ,QAAQC,OAAST,EAAMU,MAAMC,OAAO,0BACjDC,iBAAkBZ,EAAMQ,QAAQI,kBAAoBZ,EAAMU,MAAMC,OAAO,4BACvEE,cAAeb,EAAMQ,QAAQK,eAAiBb,EAAMU,MAAMC,OAAO,oBACjEG,yBAA0Bd,EAAMQ,QAAQM,0BAA4Bd,EAAMU,MAAMC,OAAO,sBA1D1EF,0CAEND,EAAQI,sDAGRJ,EAAQK,gEAGRL,EAAQM,mCATHN,KA4DZ,IAGC,MAAMO,wBAA0BvB,OAAOwB,eAAetB,WAA8B,CACzFC,kBAAoBC,IAAa,CAAC,wBAAwBC,SAASD,KACnEF,WAAA,CAAAI,YAAA,oCAAAC,YAAA,mBAFqCP,CAErC,CAAA,qBAAA,KAGGQ,GAAU,4BAEHA,EAAMiB,qBAAuB,OAAS,kBACrCjB,EAAMiB,qBAAuB,EAAI,kBAI9C,MAAMC,cAAgBC,UAIrB,CAAA,0CAEYC,cAAgB5B,OAAO6B,IAAG3B,WAAA,CAAAI,YAAA,0BAAAC,YAAA,mBAAVP,CAM5B,CAAA,gGAEM,MAAM8B,YAAc9B,OAAO+B,eAAa7B,WAAmC,CAChFC,kBAAoBC,GAAYA,IAAY,OAC5CF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFyBP,CAEzB,CAAA,GAAA,KACGQ,GAAU,gIAISA,EAAMwB,GAAK,IAAM,eAIlC,MAAMC,oBAAsBjC,OAAOkC,cAAWhC,WAAA,CAAAI,YAAA,gCAAAC,YAAA,mBAAlBP,CAAkB,CAAA,qCAAA,4BAEtC0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/Dropdown/utils.ts"],"sourcesContent":["import type { DropdownOption } from './types'\n\nexport const getDropdownInputText = (option
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/Dropdown/utils.ts"],"sourcesContent":["import type { Nullable } from 'shared/types'\nimport type { DropdownOption } from './types'\n\nexport const getDropdownInputText = (option: Nullable<DropdownOption | DropdownOption[]>): string => {\n if (!option) return ''\n\n if (Array.isArray(option)) return option[0] ? option[0].text : ''\n\n return option.text\n}\n\nexport const getDropdownInputValue = (option: Nullable<DropdownOption | DropdownOption[]>): string => {\n if (!option) return ''\n\n if (Array.isArray(option)) return option[0] ? option[0].value : ''\n\n return option.value\n}\n\nexport const getDropdownInputMultipleValue = (option: Nullable<DropdownOption | DropdownOption[]>): string[] => {\n if (!option) return []\n\n return Array.isArray(option) ? option.map((item) => item.value) : [option.value]\n}\n\nexport const groupDropdownOptions = (\n options: DropdownOption[],\n selectedOptionsValues: string[]\n): [DropdownOption[], DropdownOption[]] => {\n return options.reduce<[DropdownOption[], DropdownOption[]]>(\n (groups, option) => {\n groups[selectedOptionsValues.includes(option.value) ? 0 : 1].push(option)\n return groups\n },\n [[], []]\n )\n}\n"],"names":["option","Array","isArray","map","item","value","text","groupDropdownOptions","options","selectedOptionsValues","reduce","groups","includes","push"],"mappings":"mDAmB8CA,GACvCA,EAEEC,MAAMC,QAAQF,GAAUA,EAAOG,KAAKC,GAASA,EAAKC,QAAS,CAACL,EAAOK,OAFtD,gCAjBeL,GAC9BA,EAEDC,MAAMC,QAAQF,GAAgBA,EAAO,GAAKA,EAAO,GAAGM,KAAO,GAExDN,EAAOM,KAJM,iCAOgBN,GAC/BA,EAEDC,MAAMC,QAAQF,GAAgBA,EAAO,GAAKA,EAAO,GAAGK,MAAQ,GAEzDL,EAAOK,MAJM,gCAacE,CAClCC,EACAC,IAEOD,EAAQE,QACb,CAACC,EAAQX,KACPW,EAAOF,EAAsBG,SAASZ,EAAOK,OAAS,EAAI,GAAGQ,KAAKb,GAC3DW,IAET,CAAC,GAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../../src/components/Dropdown/utils.ts"],"sourcesContent":["import type { DropdownOption } from './types'\n\nexport const getDropdownInputText = (option
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../src/components/Dropdown/utils.ts"],"sourcesContent":["import type { Nullable } from 'shared/types'\nimport type { DropdownOption } from './types'\n\nexport const getDropdownInputText = (option: Nullable<DropdownOption | DropdownOption[]>): string => {\n if (!option) return ''\n\n if (Array.isArray(option)) return option[0] ? option[0].text : ''\n\n return option.text\n}\n\nexport const getDropdownInputValue = (option: Nullable<DropdownOption | DropdownOption[]>): string => {\n if (!option) return ''\n\n if (Array.isArray(option)) return option[0] ? option[0].value : ''\n\n return option.value\n}\n\nexport const getDropdownInputMultipleValue = (option: Nullable<DropdownOption | DropdownOption[]>): string[] => {\n if (!option) return []\n\n return Array.isArray(option) ? option.map((item) => item.value) : [option.value]\n}\n\nexport const groupDropdownOptions = (\n options: DropdownOption[],\n selectedOptionsValues: string[]\n): [DropdownOption[], DropdownOption[]] => {\n return options.reduce<[DropdownOption[], DropdownOption[]]>(\n (groups, option) => {\n groups[selectedOptionsValues.includes(option.value) ? 0 : 1].push(option)\n return groups\n },\n [[], []]\n )\n}\n"],"names":["getDropdownInputText","option","Array","isArray","text","getDropdownInputValue","value","getDropdownInputMultipleValue","map","item","groupDropdownOptions","options","selectedOptionsValues","reduce","groups","includes","push"],"mappings":"AAGaA,MAAAA,qBAAwBC,GAC9BA,EAEDC,MAAMC,QAAQF,GAAgBA,EAAO,GAAKA,EAAO,GAAGG,KAAO,GAExDH,EAAOG,KAJM,GAOTC,MAAAA,sBAAyBJ,GAC/BA,EAEDC,MAAMC,QAAQF,GAAgBA,EAAO,GAAKA,EAAO,GAAGK,MAAQ,GAEzDL,EAAOK,MAJM,GAOTC,MAAAA,8BAAiCN,GACvCA,EAEEC,MAAMC,QAAQF,GAAUA,EAAOO,KAAKC,GAASA,EAAKH,QAAS,CAACL,EAAOK,OAFtD,SAKTI,qBAAuBA,CAClCC,EACAC,IAEOD,EAAQE,QACb,CAACC,EAAQb,KACPa,EAAOF,EAAsBG,SAASd,EAAOK,OAAS,EAAI,GAAGU,KAAKf,GAC3Da,IAET,CAAC,GAAI"}
|
package/components/Menu/Menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var require$$0=require('react/jsx-runtime');var MenuComponent=require('../MenuComponent/MenuComponent.js');var MenuList=require('../MenuList/MenuList.js');var MenuContainer=require('../MenuContainer/MenuContainer.js');var MenuDivider=require('../MenuDivider/MenuDivider.js');var constants=require('../MenuComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Menu=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:n="m",disableFlip:t=!0,offset:s=8,placement:
|
|
1
|
+
'use strict';var React=require('react');var ramda=require('ramda');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var require$$0=require('react/jsx-runtime');var MenuComponent=require('../MenuComponent/MenuComponent.js');var MenuList=require('../MenuList/MenuList.js');var MenuContainer=require('../MenuContainer/MenuContainer.js');var MenuDivider=require('../MenuDivider/MenuDivider.js');var constants=require('../MenuComponent/constants.js');var Tooltip=require('../Tooltip/Tooltip.js');const Menu=Object.assign(withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:n="m",disableFlip:t=!0,offset:s=8,placement:i="bottom-start",styles:o={},sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:d,sizeUnits:m,render:z,primary:v,secondary:f,palette:C,autoFocus:q,disableAutoFocus:L,...j}=e;const b={size:n,sizeXXS:a,sizeXS:u,sizeS:c,sizeM:p,sizeL:l,sizeXL:M,sizes:d,sizeUnits:m};const g=React.useRef(null);return require$$0.jsx(Tooltip.Tooltip,{...j,ref:r,preset:"brand",hideArrow:!0,getPopper:(e,r)=>{e.state.elements.reference instanceof HTMLElement&&(g.current=e.state.elements.reference),j.getPopper&&j.getPopper(e,r)},callback:(e,r)=>{e==='close'&&g.current instanceof HTMLElement&&dom.focusFirstFocusable(g.current),j.callback&&j.callback(e,r)},disableFlip:t,offset:s,placement:i,styles:ramda.mergeDeepLeft(o,f?{floater:{filter:'none'},wrapper:{cursor:'pointer'}}:{wrapper:{cursor:'pointer'}}),component:require$$0.jsx(MenuComponent.MenuComponent,{...b,autoFocus:q,disableAutoFocus:L,primary:v,secondary:f,palette:C,children:z})})})),{displayName:'Menu',sizes:constants.SIZES}),{Component:MenuComponent.MenuComponent,List:MenuList.MenuList,Container:MenuContainer.MenuContainer,Divider:MenuDivider.MenuDivider});exports.Menu=Menu;
|
|
2
2
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","jsx","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"oiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBAAAA,gBACEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,aAA2B,MAE3C,OACEC,WAAAA,IAACC,QAAAA,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,wBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,MAAAA,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,WAAAsB,IAACC,4BAAa,IACR1B,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ+B,SAEhBlC,KAGL,IAGN,CACEmC,YA1GiB,OA2GjBrC,MAAOsC,UAAAA,QAGX,CACEC,UAAWJ,cAAaA,cACxBK,KAAMC,SAAQA,SACdC,UAAWC,cAAaA,cACxBC,QAASC,YAAAA"}
|
package/components/Menu/Menu.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef,useRef}from'react';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{focusFirstFocusable}from'../../shared/utils/dom.mjs';import{jsx}from'react/jsx-runtime';import{MenuComponent}from'../MenuComponent/MenuComponent.mjs';import{MenuList}from'../MenuList/MenuList.mjs';import{MenuContainer}from'../MenuContainer/MenuContainer.mjs';import{MenuDivider}from'../MenuDivider/MenuDivider.mjs';import{SIZES}from'../MenuComponent/constants.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';const Menu=Object.assign(withMergedProps(forwardRef(((e,
|
|
1
|
+
import{forwardRef,useRef}from'react';import{mergeDeepLeft}from'ramda';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{focusFirstFocusable}from'../../shared/utils/dom.mjs';import{jsx}from'react/jsx-runtime';import{MenuComponent}from'../MenuComponent/MenuComponent.mjs';import{MenuList}from'../MenuList/MenuList.mjs';import{MenuContainer}from'../MenuContainer/MenuContainer.mjs';import{MenuDivider}from'../MenuDivider/MenuDivider.mjs';import{SIZES}from'../MenuComponent/constants.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';const Menu=Object.assign(withMergedProps(forwardRef(((e,o)=>{const{size:r="m",disableFlip:t=!0,offset:s=8,placement:n="bottom-start",styles:i={},sizeXXS:m,sizeXS:p,sizeS:a,sizeM:u,sizeL:c,sizeXL:l,sizes:f,sizeUnits:M,render:d,primary:z,secondary:j,palette:L,autoFocus:b,disableAutoFocus:C,...F}=e;const S={size:r,sizeXXS:m,sizeXS:p,sizeS:a,sizeM:u,sizeL:c,sizeXL:l,sizes:f,sizeUnits:M};const g=useRef(null);return jsx(Tooltip,{...F,ref:o,preset:"brand",hideArrow:!0,getPopper:(e,o)=>{e.state.elements.reference instanceof HTMLElement&&(g.current=e.state.elements.reference),F.getPopper&&F.getPopper(e,o)},callback:(e,o)=>{e==='close'&&g.current instanceof HTMLElement&&focusFirstFocusable(g.current),F.callback&&F.callback(e,o)},disableFlip:t,offset:s,placement:n,styles:mergeDeepLeft(i,j?{floater:{filter:'none'},wrapper:{cursor:'pointer'}}:{wrapper:{cursor:'pointer'}}),component:jsx(MenuComponent,{...S,autoFocus:b,disableAutoFocus:C,primary:z,secondary:j,palette:L,children:d})})})),{displayName:'Menu',sizes:SIZES}),{Component:MenuComponent,List:MenuList,Container:MenuContainer,Divider:MenuDivider});export{Menu};
|
|
2
2
|
//# sourceMappingURL=Menu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n
|
|
1
|
+
{"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef } from 'react'\nimport { mergeDeepLeft } from 'ramda'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const trigger = useRef<HTMLElement | null>(null)\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={mergeDeepLeft(\n styles,\n secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","restProps","sizeProps","trigger","useRef","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","mergeDeepLeft","floater","filter","wrapper","cursor","component","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"kiBAuBA,MAAMA,KAKFC,OAAOC,OACTC,gBACEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,KACGC,GACDrB,EAEJ,MAAMsB,EAAY,CAChBpB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAMS,EAAUC,OAA2B,MAE3C,OACEC,IAACC,QAAO,IACFL,EACJpB,IAAKA,EACL0B,OAAO,QACPC,WAAS,EACTC,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CZ,EAAQa,QAAUN,EAAOE,MAAMC,SAASC,WAGtCb,EAAUQ,WACZR,EAAUQ,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAWf,EAAQa,mBAAmBD,aACnDK,oBAAoBjB,EAAQa,SAG1Bf,EAAUgB,UACZhB,EAAUgB,SAASC,EAAQC,EAC7B,EAEFpC,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQmC,cACNnC,EACAW,EACI,CAAEyB,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,aAE3BC,UACErB,IAACsB,cAAa,IACRzB,EACJH,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ8B,SAEhBjC,KAGL,IAGN,CACEkC,YA1GiB,OA2GjBpC,MAAOqC,QAGX,CACEC,UAAWJ,cACXK,KAAMC,SACNC,UAAWC,cACXC,QAASC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');const noop=()=>{};const MenuComponent=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:t="m",
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var dom=require('../../shared/utils/dom.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');const noop=()=>{};const MenuComponent=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{const{size:t="m",closeFn:o=noop,sizeXXS:r,sizeXS:n,sizeS:c,sizeM:i,sizeL:u,sizeXL:a,children:l,autoFocus:p,disableAutoFocus:d,showCloseButton:m,closeButtonProps:z,onUnmount:f,...R}=e;const S=React.useRef(null);React.useImperativeHandle(s,(()=>S.current)),React.useEffect((()=>()=>{f&&f()}),[]),React.useEffect((()=>{const e=setTimeout((()=>{!d&&S.current&&dom.focusFirstFocusable(S.current)}),0);return()=>{clearTimeout(e)}}),[p,d]);const h={size:t,sizeXXS:r,sizeXS:n,sizeS:c,sizeM:i,sizeL:u,sizeXL:a};const M={showCloseButton:m,closeButtonProps:z,closeFn:o};const q=React.isValidElement(l)&&typeof l.props=='object'&&l.props!==null?l.props:{};return require$$0.jsx(style.Root,{...R,...h,ref:S,children:React.isValidElement(l)?React.cloneElement(l,{...h,...M,...q}):typeof l=='function'?l({...h,...M}):void 0})})),{displayName:'MenuComponent',sizes:constants.SIZES});exports.SIZES=constants.SIZES,exports.MenuComponent=MenuComponent;
|
|
2
2
|
//# sourceMappingURL=MenuComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuComponent.js","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, forwardedRef) => {\n const {\n size = 'm',\n
|
|
1
|
+
{"version":3,"file":"MenuComponent.js","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n onUnmount,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n useEffect(() => {\n return () => {\n if (onUnmount) onUnmount()\n }\n }, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","onUnmount","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"sQASA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAAAA,gBAIzEC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,EAAgBC,UAChBA,KACGC,GACDhB,EAEJ,MAAMiB,EAAMC,aAAuB,MAEnCC,MAAAA,oBAAkElB,GAAc,IAAMgB,EAAIG,UAE1FC,MAAAA,WAAU,IACD,KACDN,GAAWA,GAAW,GAE3B,IAEHM,MAAAA,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBX,GAAoBK,EAAIG,SAASI,IAAAA,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACX,EAAWC,IAEf,MAAMc,EAAY,CAChBxB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMkB,EAAe,CACnBd,kBACAC,mBACAX,WAGF,MAAMyB,EACJC,MAAcA,eAACnB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE8B,WAAAA,IAACC,MAAAA,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIP,SACjDmB,MAAAA,eAAenB,GACZsB,MAAAA,aAAatB,EAAU,IAAKgB,KAAcC,KAAiBC,WACpDlB,GAAa,WACpBA,EAAS,IAAKgB,KAAcC,SAC5BM,GACQ,IAGlB,CACEC,YAvFmB,gBAwFnBC,MAAOC,UAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef,useRef,useImperativeHandle,useEffect,isValidElement,cloneElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{focusFirstFocusable}from'../../shared/utils/dom.mjs';import{SIZES}from'./constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';const noop=()=>{};const MenuComponent=withMergedProps(forwardRef(((e,o)=>{const{size:s="m",
|
|
1
|
+
import{forwardRef,useRef,useImperativeHandle,useEffect,isValidElement,cloneElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{focusFirstFocusable}from'../../shared/utils/dom.mjs';import{SIZES}from'./constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';const noop=()=>{};const MenuComponent=withMergedProps(forwardRef(((e,o)=>{const{size:s="m",closeFn:t=noop,sizeXXS:n,sizeXS:r,sizeS:i,sizeM:c,sizeL:u,sizeXL:m,children:l,autoFocus:p,disableAutoFocus:f,showCloseButton:a,closeButtonProps:d,onUnmount:z,...S}=e;const E=useRef(null);useImperativeHandle(o,(()=>E.current)),useEffect((()=>()=>{z&&z()}),[]),useEffect((()=>{const e=setTimeout((()=>{!f&&E.current&&focusFirstFocusable(E.current)}),0);return()=>{clearTimeout(e)}}),[p,f]);const h={size:s,sizeXXS:n,sizeXS:r,sizeS:i,sizeM:c,sizeL:u,sizeXL:m};const j={showCloseButton:a,closeButtonProps:d,closeFn:t};const F=isValidElement(l)&&typeof l.props=='object'&&l.props!==null?l.props:{};return jsx(Root,{...S,...h,ref:E,children:isValidElement(l)?cloneElement(l,{...h,...j,...F}):typeof l=='function'?l({...h,...j}):void 0})})),{displayName:'MenuComponent',sizes:SIZES});export{MenuComponent,SIZES};
|
|
2
2
|
//# sourceMappingURL=MenuComponent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuComponent.mjs","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, forwardedRef) => {\n const {\n size = 'm',\n
|
|
1
|
+
{"version":3,"file":"MenuComponent.mjs","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n onUnmount,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n useEffect(() => {\n return () => {\n if (onUnmount) onUnmount()\n }\n }, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","onUnmount","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"2TASA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAIzEC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,EAAgBC,UAChBA,KACGC,GACDhB,EAEJ,MAAMiB,EAAMC,OAAuB,MAEnCC,oBAAkElB,GAAc,IAAMgB,EAAIG,UAE1FC,WAAU,IACD,KACDN,GAAWA,GAAW,GAE3B,IAEHM,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBX,GAAoBK,EAAIG,SAASI,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACX,EAAWC,IAEf,MAAMc,EAAY,CAChBxB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMkB,EAAe,CACnBd,kBACAC,mBACAX,WAGF,MAAMyB,EACJC,eAAenB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE8B,IAACC,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIP,SACjDmB,eAAenB,GACZsB,aAAatB,EAAU,IAAKgB,KAAcC,KAAiBC,WACpDlB,GAAa,WACpBA,EAAS,IAAKgB,KAAcC,SAC5BM,GACQ,IAGlB,CACEC,YAvFmB,gBAwFnBC,MAAOC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';exports.SIZES={
|
|
1
|
+
'use strict';exports.SIZES={l:{maxWidth:560,minWidth:'min-content',maxHeight:240},m:{maxWidth:480,minWidth:'min-content',maxHeight:240},s:{maxWidth:280,minWidth:'min-content',maxHeight:240},fluid:{maxWidth:'100%',minWidth:'min-content',maxHeight:240}};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/MenuComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/MenuComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { MenuComponentSize } from './types'\n\nexport const SIZES: Record<MenuComponentSize, CSSProperties> = {\n l: {\n maxWidth: 560,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n m: {\n maxWidth: 480,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n s: {\n maxWidth: 280,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n fluid: {\n maxWidth: '100%',\n minWidth: 'min-content',\n maxHeight: 240,\n },\n}\n"],"names":["l","maxWidth","minWidth","maxHeight","m","s","fluid"],"mappings":"2BAG+D,CAC7DA,EAAG,CACDC,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbC,EAAG,CACDH,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbE,EAAG,CACDJ,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbG,MAAO,CACLL,SAAU,OACVC,SAAU,cACVC,UAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const SIZES={
|
|
1
|
+
const SIZES={l:{maxWidth:560,minWidth:'min-content',maxHeight:240},m:{maxWidth:480,minWidth:'min-content',maxHeight:240},s:{maxWidth:280,minWidth:'min-content',maxHeight:240},fluid:{maxWidth:'100%',minWidth:'min-content',maxHeight:240}};export{SIZES};
|
|
2
2
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/MenuComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type {
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../src/components/MenuComponent/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { MenuComponentSize } from './types'\n\nexport const SIZES: Record<MenuComponentSize, CSSProperties> = {\n l: {\n maxWidth: 560,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n m: {\n maxWidth: 480,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n s: {\n maxWidth: 280,\n minWidth: 'min-content',\n maxHeight: 240,\n },\n fluid: {\n maxWidth: '100%',\n minWidth: 'min-content',\n maxHeight: 240,\n },\n}\n"],"names":["SIZES","l","maxWidth","minWidth","maxHeight","m","s","fluid"],"mappings":"AAGO,MAAMA,MAAkD,CAC7DC,EAAG,CACDC,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbC,EAAG,CACDH,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbE,EAAG,CACDJ,SAAU,IACVC,SAAU,cACVC,UAAW,KAEbG,MAAO,CACLL,SAAU,OACVC,SAAU,cACVC,UAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var style=require('../../shared/utils/style.js');var responsiveSize=require('../../mixins/responsive-size.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const shouldForwardMenuComponentProp=style.createShouldForwardProp((o=>!['black','elevated'
|
|
1
|
+
'use strict';var styled=require('styled-components');var style=require('../../shared/utils/style.js');var responsiveSize=require('../../mixins/responsive-size.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const shouldForwardMenuComponentProp=style.createShouldForwardProp((o=>!['black','elevated'].includes(o)));const template=o=>`\n background-color: ${o.backgroundColor};\n border-color: ${o.borderColor};\n box-shadow: 0 6px 20px ${o.shadowColor};\n`;const COLOR_SCHEMA={primary:styled.css(["",""],(o=>template({backgroundColor:o.theme.colors['bg-onmain-primary'],borderColor:o.theme.colors.transparent,shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,...o.palette}))),secondary:styled.css(["",""],(o=>template({backgroundColor:o.theme.colors['bg-onmain-secondary'],borderColor:o.theme.colors['border-onmain-default-large'],shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,...o.palette})))};const Root=styled__default.default.div.withConfig({shouldForwardProp:shouldForwardMenuComponentProp}).withConfig({displayName:"MenuComponent__Root",componentId:"ui__sc-10iu45v-0"})(["box-sizing:border-box;isolation:isolate;border-radius:12px;border:1px solid transparent;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;"," ",""],(o=>o.secondary?COLOR_SCHEMA.secondary:COLOR_SCHEMA.primary),responsiveSize.responsiveSize);exports.COLOR_SCHEMA=COLOR_SCHEMA,exports.Root=Root;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/MenuComponent/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport type { StyledMenuComponentProps, MenuComponentPalette } from './types'\n\nconst shouldForwardMenuComponentProp = createShouldForwardProp(
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/MenuComponent/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport type { StyledMenuComponentProps, MenuComponentPalette } from './types'\n\nconst shouldForwardMenuComponentProp = createShouldForwardProp((propKey) => !['black', 'elevated'].includes(propKey))\n\nconst template = (palette: MenuComponentPalette) => `\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n box-shadow: 0 6px 20px ${palette.shadowColor};\n`\n\nexport const COLOR_SCHEMA = {\n primary: css<StyledMenuComponentProps>`\n ${(props) =>\n template({\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n borderColor: props.theme.colors.transparent,\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledMenuComponentProps>`\n ${(props) =>\n template({\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n borderColor: props.theme.colors['border-onmain-default-large'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledMenuComponentProps>({\n shouldForwardProp: shouldForwardMenuComponentProp,\n})`\n box-sizing: border-box;\n isolation: isolate;\n border-radius: 12px;\n border: 1px solid transparent;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-width: thin;\n\n ${(props) => {\n return props.secondary ? COLOR_SCHEMA.secondary : COLOR_SCHEMA.primary\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardMenuComponentProp","createShouldForwardProp","propKey","includes","template","palette","backgroundColor","borderColor","shadowColor","COLOR_SCHEMA","primary","css","props","theme","colors","transparent","elevated","secondary","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","responsiveSize"],"mappings":"iRAKA,MAAMA,+BAAiCC,MAAAA,yBAAyBC,IAAa,CAAC,QAAS,YAAYC,SAASD,KAE5G,MAAME,SAAYC,GAAkC,yBAC9BA,EAAQC,qCACZD,EAAQE,0CACCF,EAAQG,iBAG5B,MAAMC,aAAe,CAC1BC,QAASC,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDR,SAAS,CACPE,gBAAiBM,EAAMC,MAAMC,OAAO,qBACpCP,YAAaK,EAAMC,MAAMC,OAAOC,YAChCP,YAAaI,EAAMI,SAAWJ,EAAMC,MAAMC,OAAO,oBAAsBF,EAAMC,MAAMC,OAAOC,eACvFH,EAAMP,YAGfY,UAAWN,OAAGA,IAAA,CAAA,GAAA,KACTC,GACDR,SAAS,CACPE,gBAAiBM,EAAMC,MAAMC,OAAO,uBACpCP,YAAaK,EAAMC,MAAMC,OAAO,+BAChCN,YAAaI,EAAMI,SAAWJ,EAAMC,MAAMC,OAAO,oBAAsBF,EAAMC,MAAMC,OAAOC,eACvFH,EAAMP,aAKV,MAAMa,KAAOC,gBAAAA,QAAOC,IAAIC,WAAqC,CAClEC,kBAAmBtB,iCACnBqB,WAAA,CAAAE,YAAA,sBAAAC,YAAA,oBAFkBL,CAElB,CAAA,kJAAA,IAAA,KASGP,GACMA,EAAMK,UAAYR,aAAaQ,UAAYR,aAAaC,SAG/De,eAAcA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';const shouldForwardMenuComponentProp=createShouldForwardProp((o=>!['black','elevated'
|
|
1
|
+
import styled,{css}from'styled-components';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';const shouldForwardMenuComponentProp=createShouldForwardProp((o=>!['black','elevated'].includes(o)));const template=o=>`\n background-color: ${o.backgroundColor};\n border-color: ${o.borderColor};\n box-shadow: 0 6px 20px ${o.shadowColor};\n`;const COLOR_SCHEMA={primary:css(["",""],(o=>template({backgroundColor:o.theme.colors['bg-onmain-primary'],borderColor:o.theme.colors.transparent,shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,...o.palette}))),secondary:css(["",""],(o=>template({backgroundColor:o.theme.colors['bg-onmain-secondary'],borderColor:o.theme.colors['border-onmain-default-large'],shadowColor:o.elevated?o.theme.colors['bg-oncolor-hover']:o.theme.colors.transparent,...o.palette})))};const Root=styled.div.withConfig({shouldForwardProp:shouldForwardMenuComponentProp}).withConfig({displayName:"MenuComponent__Root",componentId:"ui__sc-10iu45v-0"})(["box-sizing:border-box;isolation:isolate;border-radius:12px;border:1px solid transparent;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;"," ",""],(o=>o.secondary?COLOR_SCHEMA.secondary:COLOR_SCHEMA.primary),responsiveSize);export{COLOR_SCHEMA,Root};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/MenuComponent/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport type { StyledMenuComponentProps, MenuComponentPalette } from './types'\n\nconst shouldForwardMenuComponentProp = createShouldForwardProp(
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/MenuComponent/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport type { StyledMenuComponentProps, MenuComponentPalette } from './types'\n\nconst shouldForwardMenuComponentProp = createShouldForwardProp((propKey) => !['black', 'elevated'].includes(propKey))\n\nconst template = (palette: MenuComponentPalette) => `\n background-color: ${palette.backgroundColor};\n border-color: ${palette.borderColor};\n box-shadow: 0 6px 20px ${palette.shadowColor};\n`\n\nexport const COLOR_SCHEMA = {\n primary: css<StyledMenuComponentProps>`\n ${(props) =>\n template({\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n borderColor: props.theme.colors.transparent,\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n secondary: css<StyledMenuComponentProps>`\n ${(props) =>\n template({\n backgroundColor: props.theme.colors['bg-onmain-secondary'],\n borderColor: props.theme.colors['border-onmain-default-large'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div.withConfig<StyledMenuComponentProps>({\n shouldForwardProp: shouldForwardMenuComponentProp,\n})`\n box-sizing: border-box;\n isolation: isolate;\n border-radius: 12px;\n border: 1px solid transparent;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-width: thin;\n\n ${(props) => {\n return props.secondary ? COLOR_SCHEMA.secondary : COLOR_SCHEMA.primary\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardMenuComponentProp","createShouldForwardProp","propKey","includes","template","palette","backgroundColor","borderColor","shadowColor","COLOR_SCHEMA","primary","css","props","theme","colors","transparent","elevated","secondary","Root","styled","div","withConfig","shouldForwardProp","displayName","componentId","responsiveSize"],"mappings":"0KAKA,MAAMA,+BAAiCC,yBAAyBC,IAAa,CAAC,QAAS,YAAYC,SAASD,KAE5G,MAAME,SAAYC,GAAkC,yBAC9BA,EAAQC,qCACZD,EAAQE,0CACCF,EAAQG,iBAG5B,MAAMC,aAAe,CAC1BC,QAASC,IAAG,CAAA,GAAA,KACPC,GACDR,SAAS,CACPE,gBAAiBM,EAAMC,MAAMC,OAAO,qBACpCP,YAAaK,EAAMC,MAAMC,OAAOC,YAChCP,YAAaI,EAAMI,SAAWJ,EAAMC,MAAMC,OAAO,oBAAsBF,EAAMC,MAAMC,OAAOC,eACvFH,EAAMP,YAGfY,UAAWN,IAAG,CAAA,GAAA,KACTC,GACDR,SAAS,CACPE,gBAAiBM,EAAMC,MAAMC,OAAO,uBACpCP,YAAaK,EAAMC,MAAMC,OAAO,+BAChCN,YAAaI,EAAMI,SAAWJ,EAAMC,MAAMC,OAAO,oBAAsBF,EAAMC,MAAMC,OAAOC,eACvFH,EAAMP,aAKV,MAAMa,KAAOC,OAAOC,IAAIC,WAAqC,CAClEC,kBAAmBtB,iCACnBqB,WAAA,CAAAE,YAAA,sBAAAC,YAAA,oBAFkBL,CAElB,CAAA,kJAAA,IAAA,KASGP,GACMA,EAAMK,UAAYR,aAAaQ,UAAYR,aAAaC,SAG/De"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var style=require('./style.js');var require$$0=require('react/jsx-runtime');exports.MenuContainer=React.forwardRef(((e,r)=>{const{closeButtonProps:s={},children:t,showCloseButton:o,closeFn:i}=e;return require$$0.jsxs(style.Root,{ref:r,children:[o&&require$$0.jsx(style.CloseButton,{square:!0,size:"m",icon:"close",...s,onClick:e=>{i&&i(),s.onClick&&s.onClick(e)}}),t]})}));
|
|
1
|
+
'use strict';var React=require('react');var style=require('./style.js');var require$$0=require('react/jsx-runtime');exports.MenuContainer=React.forwardRef(((e,r)=>{const{closeButtonProps:s={},children:t,showCloseButton:o,closeFn:i,...n}=e;return require$$0.jsxs(style.Root,{...n,ref:r,children:[o&&require$$0.jsx(style.CloseButton,{square:!0,size:"m",icon:"close",...s,onClick:e=>{i&&i(),s.onClick&&s.onClick(e)}}),t]})}));
|
|
2
2
|
//# sourceMappingURL=MenuContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContainer.js","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn } = props\n\n return (\n <Styled.Root ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n )}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","_jsxs","Styled","_jsx","jsx","square","size","icon","onClick","evt"],"mappings":"0IAY2EA,MAAUA,YAGnF,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,
|
|
1
|
+
{"version":3,"file":"MenuContainer.js","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n )}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","jsx","square","size","icon","onClick","evt"],"mappings":"0IAY2EA,MAAUA,YAGnF,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,WAAAA,KAACC,MAAAA,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,GACCK,WAAAC,IAACF,kBAAkB,CACjBG,QAAM,EACNC,KAAK,IACLC,KAAK,WACDX,EACJY,QAAUC,IACJV,GAASA,IACTH,EAAiBY,SAASZ,EAAiBY,QAAQC,EAAI,IAIhEZ,IACW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{Root,CloseButton}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const MenuContainer=forwardRef(((o,e)=>{const{closeButtonProps:r={},children:t,showCloseButton:n,closeFn:s}=o;return jsxs(Root,{ref:e,children:[n&&jsx(CloseButton,{square:!0,size:"m",icon:"close",...r,onClick:o=>{s&&s(),r.onClick&&r.onClick(o)}}),t]})}));export{MenuContainer};
|
|
1
|
+
import{forwardRef}from'react';import{Root,CloseButton}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';const MenuContainer=forwardRef(((o,e)=>{const{closeButtonProps:r={},children:t,showCloseButton:n,closeFn:s,...c}=o;return jsxs(Root,{...c,ref:e,children:[n&&jsx(CloseButton,{square:!0,size:"m",icon:"close",...r,onClick:o=>{s&&s(),r.onClick&&r.onClick(o)}}),t]})}));export{MenuContainer};
|
|
2
2
|
//# sourceMappingURL=MenuContainer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContainer.mjs","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn } = props\n\n return (\n <Styled.Root ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n )}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["MenuContainer","forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","_jsxs","Styled","_jsx","square","size","icon","onClick","evt"],"mappings":"gHAYMA,MAAAA,cAAqEC,YAGzE,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,
|
|
1
|
+
{"version":3,"file":"MenuContainer.mjs","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n )}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["MenuContainer","forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","square","size","icon","onClick","evt"],"mappings":"gHAYMA,MAAAA,cAAqEC,YAGzE,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,KAACC,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,GACCK,IAACD,YAAkB,CACjBE,QAAM,EACNC,KAAK,IACLC,KAAK,WACDV,EACJW,QAAUC,IACJT,GAASA,IACTH,EAAiBW,SAASX,EAAiBW,QAAQC,EAAI,IAIhEX,IACW"}
|