@semcore/feature-popover 16.1.6 → 16.2.0-prerelease.1
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/CHANGELOG.md +12 -0
- package/lib/cjs/FeaturePopover.js +61 -51
- package/lib/cjs/FeaturePopover.js.map +1 -1
- package/lib/cjs/FeaturePopover.type.js +2 -0
- package/lib/cjs/FeaturePopover.type.js.map +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/feature-popover.shadow.css +26 -4
- package/lib/es6/FeaturePopover.js +53 -43
- package/lib/es6/FeaturePopover.js.map +1 -1
- package/lib/es6/FeaturePopover.type.js +2 -0
- package/lib/es6/FeaturePopover.type.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/feature-popover.shadow.css +26 -4
- package/lib/esm/FeaturePopover.mjs +41 -32
- package/lib/esm/style/feature-popover.shadow.css +26 -4
- package/lib/types/FeaturePopover.d.ts +3 -0
- package/lib/types/FeaturePopover.type.d.ts +147 -0
- package/lib/types/index.d.ts +3 -138
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +44 -0
- package/package.json +13 -13
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeaturePopover.js","names":["Animation","Button","createComponent","Root","Component","sstyled","callAllEventHandlers","i18nEnhance","Box","CloseIcon","Popper","React","style","_sstyled","insert","localizedMessages","stylePopper","FeaturePopover","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","name","enabled","visible","handlers","e","_inherits","_createClass","key","value","uncontrolledProps","getPopperProps","_this$asProps","asProps","getI18nText","$onCloseClick","handleCloseClick","getSpotProps","render","_ref4","_this$asProps2","styles","forwardRef","onVisibleChange","_this$asProps2$modifi","modifiers","other","_objectWithoutProperties","_excluded","createElement","cn","_objectSpread","handleVisibleChange","_toConsumableArray","defaultModifiers","offset","placement","defaultVisible","onOutsideClick","interaction","i18n","locale","Trigger","_ref8","_ref","arguments[0]","_ref5","Children","STrigger","_assignProps","FeaturePopoverPopper","_Component2","_ref2","_ref6","SFeaturePopover","SClose","_this$asProps3","closeIcon","duration","animationsDisabled","zIndex","ariaLabel","ariaDescribedBy","ariaLabelledby","title","disableEnforceFocus","tabIndex","autoFocus","role","_assignProps2","Spot","props","_ref3","_ref7","SSpot","_assignProps3","parent"],"sources":["../../src/FeaturePopover.jsx"],"sourcesContent":["import { Animation } from '@semcore/animation';\nimport Button from '@semcore/button';\nimport { createComponent, Root, Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Box } from '@semcore/flex-box';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport Popper from '@semcore/popper';\nimport React from 'react';\n\nimport style from './style/feature-popover.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst stylePopper = sstyled.css`\n @keyframes enter {\n from {\n opacity: 0;\n transform: translateX(-10px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n }\n\n @keyframes exit {\n from {\n opacity: 1;\n transform: translateX(0);\n }\n to {\n opacity: 0;\n transform: translateX(-10px);\n }\n }\n`;\n\nclass FeaturePopover extends Component {\n static displayName = 'FeaturePopover';\n static style = style;\n static defaultProps = {\n offset: [0, 12],\n placement: 'bottom-start',\n defaultVisible: false,\n onOutsideClick: () => false,\n interaction: 'none',\n i18n: localizedMessages,\n locale: 'en',\n };\n\n static enhance = [i18nEnhance(localizedMessages)];\n\n defaultModifiers = [\n {\n name: 'flip',\n enabled: false,\n },\n ];\n\n uncontrolledProps() {\n return {\n visible: null,\n };\n }\n\n handleVisibleChange = (visible) => {\n this.handlers.visible(visible);\n };\n\n handleCloseClick = (e) => {\n this.handlers.visible(false, e);\n };\n\n getPopperProps() {\n const { visible, getI18nText } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n getI18nText,\n };\n }\n\n getSpotProps() {\n const { visible } = this.asProps;\n return { visible };\n }\n\n render() {\n const { styles, forwardRef, onVisibleChange, modifiers = [], ...other } = this.asProps;\n\n return sstyled(styles)(\n <Popper\n ref={forwardRef}\n onVisibleChange={callAllEventHandlers(onVisibleChange, this.handleVisibleChange)}\n modifiers={[...this.defaultModifiers, ...modifiers]}\n {...other}\n />,\n );\n }\n}\n\nfunction Trigger({ Children, styles }) {\n const STrigger = Root;\n return sstyled(styles)(\n <STrigger render={Popper.Trigger} tag={Box} aria-haspopup={false}>\n <Children />\n </STrigger>,\n );\n}\n\nclass FeaturePopoverPopper extends Component {\n static defaultProps = {\n closeIcon: false,\n duration: 200,\n };\n\n render() {\n const SFeaturePopover = Root;\n const SClose = Button;\n const {\n Children,\n styles,\n visible,\n closeIcon,\n duration,\n $onCloseClick,\n animationsDisabled,\n getI18nText,\n zIndex,\n 'aria-label': ariaLabel,\n 'aria-describedBy': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledby,\n title,\n } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper\n disableEnforceFocus\n zIndex={zIndex}\n tabIndex={0}\n autoFocus\n role='dialog'\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n title={title}\n >\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n initialAnimation\n animationsDisabled={animationsDisabled}\n >\n <SFeaturePopover\n render={Box}\n __excludeProps={['aria-label', 'aria-describedBy', 'title']}\n >\n {closeIcon && (\n <SClose\n aria-label={getI18nText('close')}\n onClick={$onCloseClick}\n use='tertiary'\n theme='muted'\n size='m'\n addonLeft={CloseIcon}\n type='button'\n />\n )}\n <Children />\n </SFeaturePopover>\n </Animation>\n </Popper.Popper>,\n );\n }\n}\n\nconst Spot = (props) => {\n const SSpot = Root;\n\n const { styles, visible } = props;\n\n if (!visible) return null;\n\n return sstyled(styles)(<SSpot render={Box} />);\n};\n\nexport default createComponent(\n FeaturePopover,\n {\n Trigger: Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n { parent: Popper },\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAG1B,SAASC,iBAAiB,QAAQ,gDAAgD;AAElF,IAAMC,WAAW,8BAAGX,OAAO,CAAAS,MAAI;AAAA;AAAA;EAAA;EAAA;AAAA,EAsB9B;AAAC,IAEIG,cAAc,0BAAAC,UAAA;EAAA,SAAAD,eAAA;IAAA,IAAAE,KAAA;IAAAC,eAAA,OAAAH,cAAA;IAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAQ,UAAA,OAAAV,cAAA,KAAAW,MAAA,CAAAJ,IAAA;IAAAK,eAAA,CAAAV,KAAA,sBAeC,CACjB;MACEW,IAAI,EAAE,MAAM;MAC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IA,CAAIC,KAAK,EAAK;EAAA,IAAAC,KAAA,GAAA3B,YAAA;IAAA4B,KAAA;EACtB,IAAMC,KAAK,GAM2B/F,GAAG;EAJzC,IAAQ0C,MAAM,GAAckD,KAAK,CAAzBlD,MAAM;IAAElB,OAAO,GAAKoE,KAAK,CAAjBpE,OAAO;EAEvB,IAAI,CAACA,OAAO,EAAE,OAAO,IAAI;EAEzB,OAAAsE,KAAA,GAAOjG,OAAO,CAAC6C,MAAM,CAAC,eAACvC,KAAA,CAAA+C,aAAA,CAAC6C,KAAK,EAAAD,KAAA,CAAA3C,EAAA,UAAAC,aAAA,KAAA4C,aAAA,KAAAH,KAAA,GAAe,CAAC;AAC/C,CAAC;AAED,eAAenG,eAAe,CAC5Be,cAAc,EACd;EACEsD,OAAO,EAAEA,OAAO;EAChB7D,MAAM,EAAEqE,oBAAoB;EAC5BoB,IAAI,EAAJA;AACF,CAAC,EACD;EAAEM,MAAM,EAAE/F;AAAO,CACnB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FeaturePopover.js","names":["Box","Popper","Animation","Button","createComponent","Root","Component","sstyled","callAllEventHandlers","i18nEnhance","CloseIcon","React","style","_sstyled","insert","localizedMessages","stylePopper","enhance","FeaturePopover","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","name","enabled","visible","handlers","e","_inherits","_createClass","key","value","uncontrolledProps","getPopperProps","_this$asProps","asProps","getI18nText","theme","$onCloseClick","handleCloseClick","getSpotProps","_this$asProps2","render","_ref4","_this$asProps3","styles","forwardRef","onVisibleChange","_this$asProps3$modifi","modifiers","other","_objectWithoutProperties","_excluded","createElement","cn","_objectSpread","handleVisibleChange","_toConsumableArray","defaultModifiers","offset","placement","defaultVisible","onOutsideClick","interaction","i18n","locale","Trigger","_ref8","_ref","arguments[0]","_ref5","Children","STrigger","_assignProps","FeaturePopoverPopper","_Component2","_ref2","_ref6","SFeaturePopover","SClose","_this$asProps4","closeIcon","duration","animationsDisabled","zIndex","ariaLabel","ariaDescribedBy","ariaLabelledby","title","disableEnforceFocus","tabIndex","autoFocus","role","_assignProps2","Spot","props","_ref3","_ref7","SSpot","_assignProps3","parent"],"sources":["../../src/FeaturePopover.tsx"],"sourcesContent":["import { Box, Popper, Animation } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport type { IRootComponentProps } from '@semcore/core';\nimport { createComponent, Root, Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n FeaturePopoverProps,\n FeaturePopoverComponent,\n FeaturePopoverSpotProps,\n FeaturePopoverPopperProps,\n FeaturePopoverPopperInnerProps,\n} from './FeaturePopover.type';\nimport style from './style/feature-popover.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst stylePopper = sstyled.css`\n @keyframes enter {\n from {\n opacity: 0;\n transform: translateX(-10px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n }\n\n @keyframes exit {\n from {\n opacity: 1;\n transform: translateX(0);\n }\n to {\n opacity: 0;\n transform: translateX(-10px);\n }\n }\n`;\n\nconst enhance = [\n i18nEnhance(localizedMessages),\n] as const;\n\nclass FeaturePopover extends Component<FeaturePopoverProps, {}, {}, typeof enhance> {\n static displayName = 'FeaturePopover';\n static style = style;\n static defaultProps = {\n offset: [0, 12],\n placement: 'bottom-start',\n defaultVisible: false,\n onOutsideClick: () => false,\n interaction: 'none',\n i18n: localizedMessages,\n locale: 'en',\n theme: 'accent',\n };\n\n static enhance = enhance;\n\n defaultModifiers = [\n {\n name: 'flip',\n enabled: false,\n },\n ];\n\n uncontrolledProps() {\n return {\n visible: null,\n };\n }\n\n handleVisibleChange = (visible: boolean) => {\n this.handlers.visible(visible);\n };\n\n handleCloseClick = (e: React.SyntheticEvent<HTMLButtonElement>) => {\n this.handlers.visible(false, e);\n };\n\n getPopperProps() {\n const { visible, getI18nText, theme } = this.asProps;\n return {\n visible,\n $onCloseClick: this.handleCloseClick,\n getI18nText,\n theme,\n };\n }\n\n getSpotProps() {\n const { visible, theme } = this.asProps;\n return { visible, theme };\n }\n\n render() {\n const { styles, forwardRef, onVisibleChange, modifiers = [], ...other } = this.asProps;\n\n return sstyled(styles)(\n <Popper\n ref={forwardRef}\n onVisibleChange={callAllEventHandlers(onVisibleChange, this.handleVisibleChange)}\n modifiers={[...this.defaultModifiers, ...modifiers]}\n {...other}\n />,\n );\n }\n}\n\nfunction Trigger({ Children, styles }: IRootComponentProps) {\n const STrigger = Root;\n return sstyled(styles)(\n <STrigger render={Popper.Trigger} tag={Box} aria-haspopup={false}>\n <Children />\n </STrigger>,\n );\n}\n\nclass FeaturePopoverPopper extends Component<FeaturePopoverPopperProps, {}, {}, [], FeaturePopoverPopperInnerProps> {\n static defaultProps = {\n closeIcon: false,\n duration: 200,\n };\n\n render() {\n const SFeaturePopover = Root;\n const SClose = Button;\n const {\n Children,\n styles,\n visible,\n closeIcon,\n duration,\n $onCloseClick,\n animationsDisabled,\n getI18nText,\n zIndex,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledby,\n title,\n theme,\n } = this.asProps;\n\n return sstyled(styles)(\n <Popper.Popper\n disableEnforceFocus\n zIndex={zIndex}\n tabIndex={0}\n autoFocus\n role='dialog'\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n title={title}\n >\n <Animation\n visible={visible}\n duration={duration}\n keyframes={[stylePopper['@enter'], stylePopper['@exit']]}\n initialAnimation\n animationsDisabled={animationsDisabled}\n >\n <SFeaturePopover\n render={Box}\n __excludeProps={['aria-label', 'aria-describedBy', 'title']}\n >\n {closeIcon && (\n <SClose\n aria-label={getI18nText('close')}\n onClick={$onCloseClick}\n use='tertiary'\n theme={theme === 'accent' ? 'muted' : 'invert'}\n size='m'\n addonLeft={CloseIcon}\n type='button'\n />\n )}\n <Children />\n </SFeaturePopover>\n </Animation>\n </Popper.Popper>,\n );\n }\n}\n\nconst Spot = (props: IRootComponentProps & FeaturePopoverSpotProps) => {\n const SSpot = Root;\n\n const { styles, visible } = props;\n\n if (!visible) return null;\n\n return sstyled(styles)(<SSpot render={Box} />);\n};\n\nexport default createComponent(\n FeaturePopover,\n {\n Trigger: Trigger,\n Popper: FeaturePopoverPopper,\n Spot,\n },\n // @ts-ignore\n { parent: Popper },\n) as FeaturePopoverComponent;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,MAAM,EAAEC,SAAS,QAAQ,0BAA0B;AACjE,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,eAAe,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAU1B,SAASC,iBAAiB,QAAQ,gDAAgD;AAElF,IAAMC,WAAW,8BAAGT,OAAO,CAAAO,MAAI;AAAA;AAAA;EAAA;EAAA;AAAA,EAsB9B;AAED,IAAMG,OAAO,GAAG,CACdR,WAAW,CAACM,iBAAiB,CAAC,CACtB;AAAC,IAELG,cAAc,0BAAAC,UAAA;EAAA,SAAAD,eAAA;IAAA,IAAAE,KAAA;IAAAC,eAAA,OAAAH,cAAA;IAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MA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C,OAAO,CAAC;QAAA,WACvBE,aAAa;QAAA,OAClB,UAAU;QAAA,SACPD,KAAK,KAAK,QAAQ,GAAG,OAAO,GAAG,QAAQ;QAAA,QACzC,GAAG;QAAA,aACGnC,SAAS;QAAA,QACf;MAAQ,EACd,CACF,eACDC,KAAA,CAAAkD,aAAA,CAACkB,QAAQ,EAAAM,KAAA,CAAAvB,EAAA,gBAAE,CACI,CACR,CACE,CAAC;IAEpB;EAAC;AAAA,EAjEgCxD,SAAS;AAAAwB,eAAA,CAAtCoD,oBAAoB,kBACF;EACpBO,SAAS,EAAE,KAAK;EAChBC,QAAQ,EAAE;AACZ,CAAC;AAgEH,IAAMY,IAAI,GAAG,SAAPA,IAAIA,CAAIC,KAAoD,EAAK;EAAA,IAAAC,KAAA,GAAA3B,YAAA;IAAA4B,KAAA;EACrE,IAAMC,KAAK,GAM2B1G,GAAG;EAJzC,IAAQqD,MAAM,GAAckD,KAAK,CAAzBlD,MAAM;IAAEpB,OAAO,GAAKsE,KAAK,CAAjBtE,OAAO;EAEvB,IAAI,CAACA,OAAO,EAAE,OAAO,IAAI;EAEzB,OAAAwE,KAAA,GAAOlG,OAAO,CAAC8C,MAAM,CAAC,eAAC1C,KAAA,CAAAkD,aAAA,CAAC6C,KAAK,EAAAD,KAAA,CAAA3C,EAAA,UAAAC,aAAA,KAAA4C,aAAA,KAAAH,KAAA,GAAe,CAAC;AAC/C,CAAC;AAED,eAAepG,eAAe,CAC5Bc,cAAc,EACd;EACEwD,OAAO,EAAEA,OAAO;EAChBzE,MAAM,EAAEiF,oBAAoB;EAC5BoB,IAAI,EAAJA;AACF,CAAC;AACD;AACA;EAAEM,MAAM,EAAE3G;AAAO,CACnB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeaturePopover.type.js","names":[],"sources":["../../src/FeaturePopover.type.ts"],"sourcesContent":["import type { Options as OptionsArrow } from '@popperjs/core/lib/modifiers/arrow';\nimport type { Options as OptionsComputeStyles } from '@popperjs/core/lib/modifiers/computeStyles';\nimport type { Options as OptionsEventListeners } from '@popperjs/core/lib/modifiers/eventListeners';\nimport type { Options as OptionsFlip } from '@popperjs/core/lib/modifiers/flip';\nimport type { Options as OptionsOffset } from '@popperjs/core/lib/modifiers/offset';\nimport type { Options as OptionsPreventOverflow } from '@popperjs/core/lib/modifiers/preventOverflow';\nimport type { Modifier, Options, PositioningStrategy } from '@popperjs/core/lib/types';\nimport type {\n AnimationProps,\n BoxProps,\n eventInteraction, Flex,\n OutsideClickProps,\n PortalProps,\n} from '@semcore/base-components';\nimport type { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';\nimport type { UniqueIDProps } from '@semcore/core/lib/utils/uniqueID';\nimport type { Box } from '@semcore/flex-box';\nimport type { PopperContext, PopperPopperProps, Placement } from '@semcore/popper';\nimport type Popper from '@semcore/popper';\nimport type React from 'react';\n\n/**\n * Popper must have an accessible names (aria-group-name).\n */\ntype AriaProps = Intergalactic.RequireAtLeastOne<{\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'title'?: string;\n}>;\n\n/** @deprecated */\nexport interface IFeaturePopoverPopperProps extends FeaturePopoverPopperProps, UnknownProperties {}\nexport type FeaturePopoverPopperProps = PopperPopperProps & {\n /**\n * The property responsible for the visibility of the closing icon\n * @default false\n */\n closeIcon?: boolean;\n /** Animation display duration in `ms`\n * @default 200\n */\n duration?: number;\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type FeaturePopoverPopperInnerProps = {\n theme: FeaturePopoverProps['theme'];\n\n visible: boolean;\n\n $onCloseClick: (e: React.SyntheticEvent<HTMLButtonElement>) => void;\n animationsDisabled: boolean;\n getI18nText: (message: string, opts?: Record<string, unknown>) => string;\n};\n\n/** @deprecated */\nexport interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {}\nexport type FeaturePopoverContext = PopperContext & {\n getSpotProps: PropGetterFn;\n};\n\nexport type FPPopperProps = OutsideClickProps &\n PortalProps &\n UniqueIDProps &\n AnimationProps & {\n /**\n * Popper can have different positioning options\n * @default absolute\n */\n strategy?: PositioningStrategy;\n /**\n * Modifiers for popper.js\n */\n modifiers?: Array<Partial<Modifier<any, any>>>;\n /** Timer to show and hide the popper */\n timeout?: number | [number, number];\n /** PopperJS modifier settings for popper indent */\n offset?: Partial<OptionsOffset> | number | [number, number];\n /** PopperJS modifier settings for finding borders */\n preventOverflow?: Partial<OptionsPreventOverflow>;\n /** PopperJS modifier settings responsible for the arrow */\n arrow?: Partial<OptionsArrow>;\n /** PopperJS modifier settings responsible for turning the popper when there is not enough space */\n flip?: Partial<OptionsFlip>;\n /** PopperJS modifier settings for applying styles */\n computeStyles?: Partial<OptionsComputeStyles>;\n /** PopperJS modifier settings responsible for subscribing to global events */\n eventListeners?: Partial<OptionsEventListeners>;\n /** @ignore */\n onFirstUpdate?: Options['onFirstUpdate'];\n /**\n * Flag for disable Popover (if true, it will close Popper and it will not respond to handlers)\n * @default false\n */\n disabled?: boolean;\n /**\n * If enabled, you will need to use setTrigger function from children rendering function to set popper trigger.\n */\n explicitTriggerSet?: boolean;\n /**\n * If set, popper will be placed near the place mouse cursor entered the trigger\n * @deprecated\n */\n cursorAnchoring?: boolean;\n\n popperMargin?: number;\n\n /**\n * You shouldn't change an interaction in FeaturePopover. Comes from a Popper component.\n * @deprecated\n * @default none\n */\n interaction?: 'click' | 'hover' | 'focus' | 'none' | eventInteraction;\n /**\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n * @default false */\n defaultVisible?: boolean;\n /**\n * Disabled focus trap, autofocus and focus return\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n */\n disableEnforceFocus?: boolean;\n /**\n * If enabled, after reaching the end of popper the browser focus goes to the start of popper and vice versa.\n * If disabled, after reading the end of popper the browser focus returns to trigger and popper is being closed.\n * You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.\n * @deprecated\n * @default `true` (`false` in Tooltip)\n */\n focusLoop?: boolean;\n };\n\nexport type FeaturePopoverProps = FPPopperProps & {\n /** Popper visibility value */\n visible?: boolean;\n /** Function called when visibility changes */\n onVisibleChange?: (visible: boolean, e?: Event) => boolean | void;\n /**\n * The position of the popper relative to the trigger that called it.\n * @default auto\n */\n placement?: Placement;\n /**\n * The theme of FeaturePopover\n * @default accent\n */\n theme?: 'accent' | 'neutral';\n};\n\nexport type FeaturePopoverTriggerProps = BoxProps & {\n theme?: FeaturePopoverProps['theme'];\n};\n\nexport type FeaturePopoverSpotProps = {\n visible?: boolean;\n theme?: FeaturePopoverProps['theme'];\n};\n\nexport type FeaturePopoverComponent = Intergalactic.Component<'div', FeaturePopoverProps, FeaturePopoverContext> & {\n Trigger: Intergalactic.Component<typeof Popper.Trigger, FeaturePopoverTriggerProps>;\n Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;\n Spot: Intergalactic.Component<typeof Box, FeaturePopoverSpotProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../src/index.ts"],"sourcesContent":["import type { FeaturePopoverProps, FeaturePopoverPopperProps } from './FeaturePopover.type';\n\nexport { default } from './FeaturePopover';\n\nexport type {\n FeaturePopoverProps,\n FeaturePopoverPopperProps,\n};\n"],"mappings":"AAEA,SAASA,OAAO,QAAQ,kBAAkB","ignoreList":[]}
|
|
@@ -5,10 +5,17 @@ SFeaturePopover {
|
|
|
5
5
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
6
6
|
border-radius: var(--intergalactic-popper-rounded, 6px);
|
|
7
7
|
box-sizing: border-box;
|
|
8
|
-
background-color: var(--intergalactic-bg-primary-highlight, #fce081);
|
|
9
|
-
color: var(--intergalactic-text-primary, #191b23);
|
|
10
8
|
box-shadow: var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));
|
|
11
9
|
position: relative;
|
|
10
|
+
|
|
11
|
+
&[theme='accent'] {
|
|
12
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
13
|
+
color: var(--intergalactic-text-primary, #191b23);
|
|
14
|
+
}
|
|
15
|
+
&[theme='neutral'] {
|
|
16
|
+
background-color: var(--intergalactic-feature-popover-bg-neutral, #1D113E);
|
|
17
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
STrigger {
|
|
@@ -70,7 +77,6 @@ SSpot {
|
|
|
70
77
|
animation-iteration-count: infinite;
|
|
71
78
|
animation-fill-mode: forwards;
|
|
72
79
|
animation-delay: 0.5s;
|
|
73
|
-
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
74
80
|
border-radius: 50%;
|
|
75
81
|
width: 12px;
|
|
76
82
|
height: 12px;
|
|
@@ -84,7 +90,23 @@ SSpot {
|
|
|
84
90
|
border-radius: 50%;
|
|
85
91
|
width: 12px;
|
|
86
92
|
height: 12px;
|
|
87
|
-
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[theme='accent'] {
|
|
96
|
+
&::before {
|
|
97
|
+
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
98
|
+
}
|
|
99
|
+
&::after {
|
|
100
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
&[theme='neutral'] {
|
|
104
|
+
&::before {
|
|
105
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192);
|
|
106
|
+
}
|
|
107
|
+
&::after {
|
|
108
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral, #00c192);
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
|
|
@@ -9,13 +9,11 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
9
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
11
|
import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
|
|
12
|
-
import { Animation } from "@semcore/
|
|
12
|
+
import { Popper, Box, Animation } from "@semcore/base-components";
|
|
13
13
|
import Button from "@semcore/button";
|
|
14
14
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
15
15
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
|
-
import { Box } from "@semcore/flex-box";
|
|
17
16
|
import CloseIcon from "@semcore/icon/Close/m";
|
|
18
|
-
import Popper from "@semcore/popper";
|
|
19
17
|
import React from "react";
|
|
20
18
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
21
19
|
var _excluded = ["styles", "forwardRef", "onVisibleChange", "modifiers"];
|
|
@@ -27,33 +25,36 @@ var style = (
|
|
|
27
25
|
/*__reshadow_css_start__*/
|
|
28
26
|
(sstyled.insert(
|
|
29
27
|
/*__inner_css_start__*/
|
|
30
|
-
'@keyframes
|
|
28
|
+
'@keyframes showTrigger_1a3ym{0%{opacity:0}to{opacity:1}}@keyframes scaleSizeAndHide_1a3ym{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.___SFeaturePopover_1a3ym_gg_{padding-top:var(--intergalactic-spacing-4x, 16px);padding-right:var(--intergalactic-spacing-10x, 40px);padding-bottom:var(--intergalactic-spacing-4x, 16px);padding-left:var(--intergalactic-spacing-4x, 16px);border-radius:var(--intergalactic-popper-rounded, 6px);box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));position:relative}.___SFeaturePopover_1a3ym_gg_._theme_accent_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg, #fce081);color:var(--intergalactic-text-primary, #191b23)}.___SFeaturePopover_1a3ym_gg_._theme_neutral_1a3ym_gg_{background-color:var(--intergalactic-feature-popover-bg-neutral, #1D113E);color:var(--intergalactic-text-primary-invert, #ffffff)}.___STrigger_1a3ym_gg_{position:relative}.___SClose_1a3ym_gg_{position:absolute;z-index:1;right:var(--intergalactic-spacing-2x, 8px);top:var(--intergalactic-spacing-2x, 8px)}.___SClose_1a3ym_gg_ .___SAddon_1a3ym_gg_:only-child{margin-left:calc(var(--intergalactic-spacing-2x, 8px) - 1px);margin-right:calc(var(--intergalactic-spacing-2x, 8px) - 1px)}.___SSpot_1a3ym_gg_{position:absolute;bottom:calc(-1*var(--intergalactic-spacing-1x, 4px));right:calc(-1*var(--intergalactic-spacing-1x, 4px));animation-name:showTrigger_1a3ym;animation-duration:.2s;animation-timing-function:ease-in;animation-delay:.4s;animation-fill-mode:forwards;width:12px;height:12px}.___SSpot_1a3ym_gg_::before{transform-origin:50%;animation-name:scaleSizeAndHide_1a3ym;animation-duration:1s;animation-iteration-count:infinite;animation-fill-mode:forwards;animation-delay:.5s}.___SSpot_1a3ym_gg_::after,.___SSpot_1a3ym_gg_::before{content:"";position:absolute;top:0;left:0;border-radius:50%;width:12px;height:12px}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-outer-border, #fce081)}.___SSpot_1a3ym_gg_._theme_accent_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-bg, #fce081)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::before{background-color:var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192)}.___SSpot_1a3ym_gg_._theme_neutral_1a3ym_gg_::after{background-color:var(--intergalactic-feature-popover-dot-neutral, #00c192)}@media (prefers-reduced-motion){.___SSpot_1a3ym_gg_,.___SSpot_1a3ym_gg_::before{animation-name:none}}',
|
|
31
29
|
/*__inner_css_end__*/
|
|
32
|
-
"
|
|
30
|
+
"1a3ym_gg_"
|
|
33
31
|
), /*__reshadow_css_end__*/
|
|
34
32
|
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
33
|
+
"__STrigger": "___STrigger_1a3ym_gg_",
|
|
34
|
+
"@showTrigger": "showTrigger_1a3ym",
|
|
35
|
+
"@scaleSizeAndHide": "scaleSizeAndHide_1a3ym",
|
|
36
|
+
"__SFeaturePopover": "___SFeaturePopover_1a3ym_gg_",
|
|
37
|
+
"_theme_accent": "_theme_accent_1a3ym_gg_",
|
|
38
|
+
"_theme_neutral": "_theme_neutral_1a3ym_gg_",
|
|
39
|
+
"__SClose": "___SClose_1a3ym_gg_",
|
|
40
|
+
"__SAddon": "___SAddon_1a3ym_gg_",
|
|
41
|
+
"__SSpot": "___SSpot_1a3ym_gg_"
|
|
42
42
|
})
|
|
43
43
|
);
|
|
44
44
|
var stylePopper = (
|
|
45
45
|
/*__reshadow_css_start__*/
|
|
46
46
|
(sstyled.insert(
|
|
47
47
|
/*__inner_css_start__*/
|
|
48
|
-
"@keyframes
|
|
48
|
+
"@keyframes enter_1ewp0{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}@keyframes exit_1ewp0{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-10px)}}",
|
|
49
49
|
/*__inner_css_end__*/
|
|
50
|
-
"
|
|
50
|
+
"1ewp0_gg_"
|
|
51
51
|
), /*__reshadow_css_end__*/
|
|
52
52
|
{
|
|
53
|
-
"@enter": "
|
|
54
|
-
"@exit": "
|
|
53
|
+
"@enter": "enter_1ewp0",
|
|
54
|
+
"@exit": "exit_1ewp0"
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
|
+
var enhance = [i18nEnhance(localizedMessages)];
|
|
57
58
|
var FeaturePopover = /* @__PURE__ */ function(_Component) {
|
|
58
59
|
function FeaturePopover2() {
|
|
59
60
|
var _this;
|
|
@@ -85,26 +86,28 @@ var FeaturePopover = /* @__PURE__ */ function(_Component) {
|
|
|
85
86
|
}, {
|
|
86
87
|
key: "getPopperProps",
|
|
87
88
|
value: function getPopperProps() {
|
|
88
|
-
var _this$asProps = this.asProps, visible = _this$asProps.visible, getI18nText = _this$asProps.getI18nText;
|
|
89
|
+
var _this$asProps = this.asProps, visible = _this$asProps.visible, getI18nText = _this$asProps.getI18nText, theme = _this$asProps.theme;
|
|
89
90
|
return {
|
|
90
91
|
visible,
|
|
91
92
|
$onCloseClick: this.handleCloseClick,
|
|
92
|
-
getI18nText
|
|
93
|
+
getI18nText,
|
|
94
|
+
theme
|
|
93
95
|
};
|
|
94
96
|
}
|
|
95
97
|
}, {
|
|
96
98
|
key: "getSpotProps",
|
|
97
99
|
value: function getSpotProps() {
|
|
98
|
-
var
|
|
100
|
+
var _this$asProps2 = this.asProps, visible = _this$asProps2.visible, theme = _this$asProps2.theme;
|
|
99
101
|
return {
|
|
100
|
-
visible
|
|
102
|
+
visible,
|
|
103
|
+
theme
|
|
101
104
|
};
|
|
102
105
|
}
|
|
103
106
|
}, {
|
|
104
107
|
key: "render",
|
|
105
108
|
value: function render() {
|
|
106
109
|
var _ref4;
|
|
107
|
-
var _this$
|
|
110
|
+
var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, forwardRef = _this$asProps3.forwardRef, onVisibleChange = _this$asProps3.onVisibleChange, _this$asProps3$modifi = _this$asProps3.modifiers, modifiers = _this$asProps3$modifi === void 0 ? [] : _this$asProps3$modifi, other = _objectWithoutProperties(_this$asProps3, _excluded);
|
|
108
111
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Popper, _ref4.cn("Popper", _objectSpread({
|
|
109
112
|
"ref": forwardRef,
|
|
110
113
|
"onVisibleChange": callAllEventHandlers(onVisibleChange, this.handleVisibleChange),
|
|
@@ -124,9 +127,10 @@ _defineProperty(FeaturePopover, "defaultProps", {
|
|
|
124
127
|
},
|
|
125
128
|
interaction: "none",
|
|
126
129
|
i18n: localizedMessages,
|
|
127
|
-
locale: "en"
|
|
130
|
+
locale: "en",
|
|
131
|
+
theme: "accent"
|
|
128
132
|
});
|
|
129
|
-
_defineProperty(FeaturePopover, "enhance",
|
|
133
|
+
_defineProperty(FeaturePopover, "enhance", enhance);
|
|
130
134
|
function Trigger(_ref8) {
|
|
131
135
|
var _ref = arguments[0], _ref5;
|
|
132
136
|
var Children = _ref8.Children, styles = _ref8.styles;
|
|
@@ -148,7 +152,7 @@ var FeaturePopoverPopper = /* @__PURE__ */ function(_Component2) {
|
|
|
148
152
|
var _ref2 = this.asProps, _ref6;
|
|
149
153
|
var SFeaturePopover = Box;
|
|
150
154
|
var SClose = Button;
|
|
151
|
-
var _this$
|
|
155
|
+
var _this$asProps4 = this.asProps, Children = _this$asProps4.Children, styles = _this$asProps4.styles, visible = _this$asProps4.visible, closeIcon = _this$asProps4.closeIcon, duration = _this$asProps4.duration, $onCloseClick = _this$asProps4.$onCloseClick, animationsDisabled = _this$asProps4.animationsDisabled, getI18nText = _this$asProps4.getI18nText, zIndex = _this$asProps4.zIndex, ariaLabel = _this$asProps4["aria-label"], ariaDescribedBy = _this$asProps4["aria-describedby"], ariaLabelledby = _this$asProps4["aria-labelledby"], title = _this$asProps4.title, theme = _this$asProps4.theme;
|
|
152
156
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(Popper.Popper, {
|
|
153
157
|
disableEnforceFocus: true,
|
|
154
158
|
zIndex,
|
|
@@ -171,7 +175,7 @@ var FeaturePopoverPopper = /* @__PURE__ */ function(_Component2) {
|
|
|
171
175
|
"aria-label": getI18nText("close"),
|
|
172
176
|
"onClick": $onCloseClick,
|
|
173
177
|
"use": "tertiary",
|
|
174
|
-
"theme": "muted",
|
|
178
|
+
"theme": theme === "accent" ? "muted" : "invert",
|
|
175
179
|
"size": "m",
|
|
176
180
|
"addonLeft": CloseIcon,
|
|
177
181
|
"type": "button"
|
|
@@ -190,13 +194,18 @@ var Spot = function Spot2(props) {
|
|
|
190
194
|
if (!visible) return null;
|
|
191
195
|
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SSpot, _ref7.cn("SSpot", _objectSpread({}, assignProps({}, _ref3))));
|
|
192
196
|
};
|
|
193
|
-
const FeaturePopover$1 = createComponent(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
197
|
+
const FeaturePopover$1 = createComponent(
|
|
198
|
+
FeaturePopover,
|
|
199
|
+
{
|
|
200
|
+
Trigger,
|
|
201
|
+
Popper: FeaturePopoverPopper,
|
|
202
|
+
Spot
|
|
203
|
+
},
|
|
204
|
+
// @ts-ignore
|
|
205
|
+
{
|
|
206
|
+
parent: Popper
|
|
207
|
+
}
|
|
208
|
+
);
|
|
200
209
|
export {
|
|
201
210
|
FeaturePopover$1 as default
|
|
202
211
|
};
|
|
@@ -5,10 +5,17 @@ SFeaturePopover {
|
|
|
5
5
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
6
6
|
border-radius: var(--intergalactic-popper-rounded, 6px);
|
|
7
7
|
box-sizing: border-box;
|
|
8
|
-
background-color: var(--intergalactic-bg-primary-highlight, #fce081);
|
|
9
|
-
color: var(--intergalactic-text-primary, #191b23);
|
|
10
8
|
box-shadow: var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));
|
|
11
9
|
position: relative;
|
|
10
|
+
|
|
11
|
+
&[theme='accent'] {
|
|
12
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
13
|
+
color: var(--intergalactic-text-primary, #191b23);
|
|
14
|
+
}
|
|
15
|
+
&[theme='neutral'] {
|
|
16
|
+
background-color: var(--intergalactic-feature-popover-bg-neutral, #1D113E);
|
|
17
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
STrigger {
|
|
@@ -70,7 +77,6 @@ SSpot {
|
|
|
70
77
|
animation-iteration-count: infinite;
|
|
71
78
|
animation-fill-mode: forwards;
|
|
72
79
|
animation-delay: 0.5s;
|
|
73
|
-
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
74
80
|
border-radius: 50%;
|
|
75
81
|
width: 12px;
|
|
76
82
|
height: 12px;
|
|
@@ -84,7 +90,23 @@ SSpot {
|
|
|
84
90
|
border-radius: 50%;
|
|
85
91
|
width: 12px;
|
|
86
92
|
height: 12px;
|
|
87
|
-
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[theme='accent'] {
|
|
96
|
+
&::before {
|
|
97
|
+
background-color: var(--intergalactic-feature-popover-dot-outer-border, #fce081);
|
|
98
|
+
}
|
|
99
|
+
&::after {
|
|
100
|
+
background-color: var(--intergalactic-feature-popover-bg, #fce081);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
&[theme='neutral'] {
|
|
104
|
+
&::before {
|
|
105
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral-outer-border, #00c192);
|
|
106
|
+
}
|
|
107
|
+
&::after {
|
|
108
|
+
background-color: var(--intergalactic-feature-popover-dot-neutral, #00c192);
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { Options as OptionsArrow } from '@popperjs/core/lib/modifiers/arrow';
|
|
2
|
+
import type { Options as OptionsComputeStyles } from '@popperjs/core/lib/modifiers/computeStyles';
|
|
3
|
+
import type { Options as OptionsEventListeners } from '@popperjs/core/lib/modifiers/eventListeners';
|
|
4
|
+
import type { Options as OptionsFlip } from '@popperjs/core/lib/modifiers/flip';
|
|
5
|
+
import type { Options as OptionsOffset } from '@popperjs/core/lib/modifiers/offset';
|
|
6
|
+
import type { Options as OptionsPreventOverflow } from '@popperjs/core/lib/modifiers/preventOverflow';
|
|
7
|
+
import type { Modifier, Options, PositioningStrategy } from '@popperjs/core/lib/types';
|
|
8
|
+
import type { AnimationProps, BoxProps, eventInteraction, OutsideClickProps, PortalProps } from '@semcore/base-components';
|
|
9
|
+
import type { Intergalactic, PropGetterFn, UnknownProperties } from '@semcore/core';
|
|
10
|
+
import type { UniqueIDProps } from '@semcore/core/lib/utils/uniqueID';
|
|
11
|
+
import type { Box } from '@semcore/flex-box';
|
|
12
|
+
import type { PopperContext, PopperPopperProps, Placement } from '@semcore/popper';
|
|
13
|
+
import type Popper from '@semcore/popper';
|
|
14
|
+
import type React from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* Popper must have an accessible names (aria-group-name).
|
|
17
|
+
*/
|
|
18
|
+
type AriaProps = Intergalactic.RequireAtLeastOne<{
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
'aria-labelledby'?: string;
|
|
21
|
+
'title'?: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
export interface IFeaturePopoverPopperProps extends FeaturePopoverPopperProps, UnknownProperties {
|
|
25
|
+
}
|
|
26
|
+
export type FeaturePopoverPopperProps = PopperPopperProps & {
|
|
27
|
+
/**
|
|
28
|
+
* The property responsible for the visibility of the closing icon
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
closeIcon?: boolean;
|
|
32
|
+
/** Animation display duration in `ms`
|
|
33
|
+
* @default 200
|
|
34
|
+
*/
|
|
35
|
+
duration?: number;
|
|
36
|
+
/** Specifies the locale for i18n support */
|
|
37
|
+
locale?: string;
|
|
38
|
+
};
|
|
39
|
+
export type FeaturePopoverPopperInnerProps = {
|
|
40
|
+
theme: FeaturePopoverProps['theme'];
|
|
41
|
+
visible: boolean;
|
|
42
|
+
$onCloseClick: (e: React.SyntheticEvent<HTMLButtonElement>) => void;
|
|
43
|
+
animationsDisabled: boolean;
|
|
44
|
+
getI18nText: (message: string, opts?: Record<string, unknown>) => string;
|
|
45
|
+
};
|
|
46
|
+
/** @deprecated */
|
|
47
|
+
export interface IFeaturePopoverContext extends FeaturePopoverContext, UnknownProperties {
|
|
48
|
+
}
|
|
49
|
+
export type FeaturePopoverContext = PopperContext & {
|
|
50
|
+
getSpotProps: PropGetterFn;
|
|
51
|
+
};
|
|
52
|
+
export type FPPopperProps = OutsideClickProps & PortalProps & UniqueIDProps & AnimationProps & {
|
|
53
|
+
/**
|
|
54
|
+
* Popper can have different positioning options
|
|
55
|
+
* @default absolute
|
|
56
|
+
*/
|
|
57
|
+
strategy?: PositioningStrategy;
|
|
58
|
+
/**
|
|
59
|
+
* Modifiers for popper.js
|
|
60
|
+
*/
|
|
61
|
+
modifiers?: Array<Partial<Modifier<any, any>>>;
|
|
62
|
+
/** Timer to show and hide the popper */
|
|
63
|
+
timeout?: number | [number, number];
|
|
64
|
+
/** PopperJS modifier settings for popper indent */
|
|
65
|
+
offset?: Partial<OptionsOffset> | number | [number, number];
|
|
66
|
+
/** PopperJS modifier settings for finding borders */
|
|
67
|
+
preventOverflow?: Partial<OptionsPreventOverflow>;
|
|
68
|
+
/** PopperJS modifier settings responsible for the arrow */
|
|
69
|
+
arrow?: Partial<OptionsArrow>;
|
|
70
|
+
/** PopperJS modifier settings responsible for turning the popper when there is not enough space */
|
|
71
|
+
flip?: Partial<OptionsFlip>;
|
|
72
|
+
/** PopperJS modifier settings for applying styles */
|
|
73
|
+
computeStyles?: Partial<OptionsComputeStyles>;
|
|
74
|
+
/** PopperJS modifier settings responsible for subscribing to global events */
|
|
75
|
+
eventListeners?: Partial<OptionsEventListeners>;
|
|
76
|
+
/** @ignore */
|
|
77
|
+
onFirstUpdate?: Options['onFirstUpdate'];
|
|
78
|
+
/**
|
|
79
|
+
* Flag for disable Popover (if true, it will close Popper and it will not respond to handlers)
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* If enabled, you will need to use setTrigger function from children rendering function to set popper trigger.
|
|
85
|
+
*/
|
|
86
|
+
explicitTriggerSet?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* If set, popper will be placed near the place mouse cursor entered the trigger
|
|
89
|
+
* @deprecated
|
|
90
|
+
*/
|
|
91
|
+
cursorAnchoring?: boolean;
|
|
92
|
+
popperMargin?: number;
|
|
93
|
+
/**
|
|
94
|
+
* You shouldn't change an interaction in FeaturePopover. Comes from a Popper component.
|
|
95
|
+
* @deprecated
|
|
96
|
+
* @default none
|
|
97
|
+
*/
|
|
98
|
+
interaction?: 'click' | 'hover' | 'focus' | 'none' | eventInteraction;
|
|
99
|
+
/**
|
|
100
|
+
* You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.
|
|
101
|
+
* @deprecated
|
|
102
|
+
* @default false */
|
|
103
|
+
defaultVisible?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Disabled focus trap, autofocus and focus return
|
|
106
|
+
* You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.
|
|
107
|
+
* @deprecated
|
|
108
|
+
*/
|
|
109
|
+
disableEnforceFocus?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* If enabled, after reaching the end of popper the browser focus goes to the start of popper and vice versa.
|
|
112
|
+
* If disabled, after reading the end of popper the browser focus returns to trigger and popper is being closed.
|
|
113
|
+
* You shouldn't change it in FeaturePopover as it should be controlled always. Comes from a Popper component.
|
|
114
|
+
* @deprecated
|
|
115
|
+
* @default `true` (`false` in Tooltip)
|
|
116
|
+
*/
|
|
117
|
+
focusLoop?: boolean;
|
|
118
|
+
};
|
|
119
|
+
export type FeaturePopoverProps = FPPopperProps & {
|
|
120
|
+
/** Popper visibility value */
|
|
121
|
+
visible?: boolean;
|
|
122
|
+
/** Function called when visibility changes */
|
|
123
|
+
onVisibleChange?: (visible: boolean, e?: Event) => boolean | void;
|
|
124
|
+
/**
|
|
125
|
+
* The position of the popper relative to the trigger that called it.
|
|
126
|
+
* @default auto
|
|
127
|
+
*/
|
|
128
|
+
placement?: Placement;
|
|
129
|
+
/**
|
|
130
|
+
* The theme of FeaturePopover
|
|
131
|
+
* @default accent
|
|
132
|
+
*/
|
|
133
|
+
theme?: 'accent' | 'neutral';
|
|
134
|
+
};
|
|
135
|
+
export type FeaturePopoverTriggerProps = BoxProps & {
|
|
136
|
+
theme?: FeaturePopoverProps['theme'];
|
|
137
|
+
};
|
|
138
|
+
export type FeaturePopoverSpotProps = {
|
|
139
|
+
visible?: boolean;
|
|
140
|
+
theme?: FeaturePopoverProps['theme'];
|
|
141
|
+
};
|
|
142
|
+
export type FeaturePopoverComponent = Intergalactic.Component<'div', FeaturePopoverProps, FeaturePopoverContext> & {
|
|
143
|
+
Trigger: Intergalactic.Component<typeof Popper.Trigger, FeaturePopoverTriggerProps>;
|
|
144
|
+
Popper: Intergalactic.Component<'div', FeaturePopoverPopperProps & AriaProps>;
|
|
145
|
+
Spot: Intergalactic.Component<typeof Box, FeaturePopoverSpotProps>;
|
|
146
|
+
};
|
|
147
|
+
export {};
|