@semcore/notice 17.2.1 → 17.2.2-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 +7 -0
- package/lib/cjs/Notice.js +47 -38
- package/lib/cjs/Notice.js.map +1 -1
- package/lib/cjs/Notice.type.js +2 -0
- package/lib/cjs/Notice.type.js.map +1 -0
- package/lib/cjs/NoticeSmart.js.map +1 -1
- package/lib/cjs/NoticeSmart.type.js +2 -0
- package/lib/cjs/NoticeSmart.type.js.map +1 -0
- package/lib/cjs/index.js +27 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/Notice.js +47 -38
- package/lib/es6/Notice.js.map +1 -1
- package/lib/es6/Notice.type.js +2 -0
- package/lib/es6/Notice.type.js.map +1 -0
- package/lib/es6/NoticeSmart.js.map +1 -1
- package/lib/es6/NoticeSmart.type.js +2 -0
- package/lib/es6/NoticeSmart.type.js.map +1 -0
- package/lib/es6/index.js +2 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/Notice.mjs +48 -39
- package/lib/esm/Notice.type.mjs +1 -0
- package/lib/esm/NoticeSmart.type.mjs +1 -0
- package/lib/esm/index.mjs +2 -0
- package/lib/types/Notice.d.ts +8 -0
- package/lib/types/Notice.type.d.ts +69 -0
- package/lib/types/NoticeSmart.d.ts +8 -0
- package/lib/types/NoticeSmart.type.d.ts +35 -0
- package/lib/types/index.d.ts +4 -77
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +73 -0
- package/package.json +4 -4
- package/vite.config.ts +1 -1
- package/vitest.config.mts +0 -1
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notice.type.js","names":[],"sources":["../../src/Notice.type.ts"],"sourcesContent":["import type { FadeInOutProps, Box, BoxProps } from '@semcore/base-components';\nimport type Button from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Text } from '@semcore/typography';\n\nimport type { LocalizedMessaged } from './translations/__intergalactic-dynamic-locales';\n\ndeclare namespace NSNotice {\n type Theme = 'danger' | 'warning' | 'success' | 'info' | 'muted';\n type Props = BoxProps &\n FadeInOutProps & {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /**\n * Notice theme\n * @default info\n */\n theme?: NSNotice.Theme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n type DefaultProps = {\n theme: 'info';\n i18n: LocalizedMessaged;\n locale: 'en';\n };\n type Ctx = {\n getLabelProps?: PropGetterFn;\n };\n\n namespace Label {\n type Props = BoxProps & {\n theme?: NSNotice.Theme;\n };\n\n type Component = Intergalactic.Component<'div', Props>;\n }\n\n namespace Actions {\n type Component = typeof Box;\n }\n\n namespace Content {\n type Component = typeof Box;\n }\n\n namespace Title {\n type Component = typeof Text;\n }\n\n namespace Text {\n type Component = typeof Text;\n }\n\n namespace Close {\n type Component = typeof Button;\n }\n\n type Component = Intergalactic.Component<'div', Props, Ctx> & {\n Label: Label.Component;\n Actions: Actions.Component;\n Content: Content.Component;\n Title: Title.Component;\n Text: Text.Component;\n Close: Close.Component;\n };\n}\n\n/** @deprecated It will be removed in v18. */\nexport type NoticeTheme = NSNotice.Theme;\n/** @deprecated It will be removed in v18. */\nexport type NoticeProps = NSNotice.Props;\n/** @deprecated It will be removed in v18. */\nexport type NoticeLabelProps = NSNotice.Label.Props;\n/** @deprecated It will be removed in v18. */\nexport type NoticeContext = NSNotice.Ctx;\n\nexport type { NSNotice };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeSmart.js","names":["createComponent","Component","Root","isNode","React","Notice","NoticeSmart","render","_ref","asProps","SNoticeSmart","label","title","actions","closable","onClose","text","createElement","_assignProps","Label","Content","Title","Text","Actions","Close","onClick","_defineProperty","theme"],"sources":["../../src/NoticeSmart.
|
|
1
|
+
{"version":3,"file":"NoticeSmart.js","names":["createComponent","Component","Root","isNode","React","Notice","NoticeSmart","render","_ref","asProps","SNoticeSmart","label","title","actions","closable","onClose","text","createElement","_assignProps","Label","Content","Title","Text","Actions","Close","onClick","_defineProperty","theme"],"sources":["../../src/NoticeSmart.tsx"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, Root } from '@semcore/core';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport React from 'react';\n\nimport Notice from './Notice';\nimport type { NSNoticeSmart } from './NoticeSmart.type';\n\nclass NoticeSmart extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSNoticeSmart.Component>,\n [],\n {},\n {},\n {},\n NSNoticeSmart.DefaultProps\n> {\n static displayName = 'NoticeSmart';\n\n static defaultProps = {\n theme: 'info',\n } as const;\n\n render() {\n const SNoticeSmart = Root;\n const { label, title, actions, closable, onClose, text } = this.asProps;\n\n return (\n <SNoticeSmart render={Notice} __excludeProps={['title']}>\n {isNode(label) && <Notice.Label>{label}</Notice.Label>}\n <Notice.Content>\n {isNode(title) && <Notice.Title>{title}</Notice.Title>}\n {isNode(text) && <Notice.Text>{text}</Notice.Text>}\n {isNode(actions) && <Notice.Actions>{actions}</Notice.Actions>}\n </Notice.Content>\n {closable && <Notice.Close onClick={onClose} />}\n </SNoticeSmart>\n );\n }\n}\n\n/**\n * NoticeSmart\n *\n * {@link https://developer.semrush.com/intergalactic/components/notice/notice-api#noticesmart|API} | {@link https://developer.semrush.com/intergalactic/components/notice/notice-code/|Examples}\n */\nexport default createComponent<\n NSNoticeSmart.Component,\n typeof NoticeSmart\n>(NoticeSmart);\n"],"mappings":";;AACA,SAASA,eAAe,EAAEC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,MAAM,MAAM,gCAAgC;AACnD,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,UAAU;AAG7B,MAAMC,WAAW,SAASL,SAAS,CAOjC;EAOAM,MAAMA,CAAA,EAAG;IAAA,IAAAC,IAAA,QAAAC,OAAA;IACP,MAAMC,YAAY,GAIML,MAAM;IAH9B,MAAM;MAAEM,KAAK;MAAEC,KAAK;MAAEC,OAAO;MAAEC,QAAQ;MAAEC,OAAO;MAAEC;IAAK,CAAC,GAAG,IAAI,CAACP,OAAO;IAEvE,oBACEL,KAAA,CAAAa,aAAA,CAACP,YAAY,EAAAQ,YAAA;MAAA,kBAAiC,CAAC,OAAO;IAAC,GAAAV,IAAA,GACpDL,MAAM,CAACQ,KAAK,CAAC,iBAAIP,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACc,KAAK,QAAER,KAAoB,CAAC,eACtDP,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACe,OAAO,QACZjB,MAAM,CAACS,KAAK,CAAC,iBAAIR,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACgB,KAAK,QAAET,KAAoB,CAAC,EACrDT,MAAM,CAACa,IAAI,CAAC,iBAAIZ,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACiB,IAAI,QAAEN,IAAkB,CAAC,EACjDb,MAAM,CAACU,OAAO,CAAC,iBAAIT,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACkB,OAAO,QAAEV,OAAwB,CAC/C,CAAC,EAChBC,QAAQ,iBAAIV,KAAA,CAAAa,aAAA,CAACZ,MAAM,CAACmB,KAAK;MAACC,OAAO,EAAEV;IAAQ,CAAE,CAClC,CAAC;EAEnB;AACF;;AAEA;AACA;AACA;AACA;AACA;AAJAW,eAAA,CAhCMpB,WAAW,iBAQM,aAAa;AAAAoB,eAAA,CAR9BpB,WAAW,kBAUO;EACpBqB,KAAK,EAAE;AACT,CAAC;AAyBH,eAAe3B,eAAe,CAG5BM,WAAW,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeSmart.type.js","names":[],"sources":["../../src/NoticeSmart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\n\nimport type { NSNotice } from './Notice.type';\n\ndeclare namespace NSNoticeSmart {\n type Props = NSNotice.Props & {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n\n /**\n * A custom element for title\n */\n title?: React.ReactNode;\n\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n\n /** A custom element for text */\n text?: React.ReactNode;\n /**\n * Adds a Close button\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n };\n type DefaultProps = {\n theme: 'info';\n };\n\n type Component = (\n props: Intergalactic.InternalTypings.EfficientOmit<\n Intergalactic.InternalTypings.ComponentProps<'div', 'div', Props>,\n 'children'\n >,\n ) => Intergalactic.InternalTypings.ComponentRenderingResults &\n Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', Props>;\n}\n\n/** @deprecated It will be removed in v18. */\nexport type NoticeSmartProps = NSNoticeSmart.Props;\n\nexport type { NSNoticeSmart };\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/index.js
CHANGED
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Notice","NoticeSmart"],"sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Notice","NoticeSmart"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as Notice } from './Notice';\n\nexport default Notice;\nexport * from './Notice.type';\nexport { default as NoticeSmart } from './NoticeSmart';\nexport * from './NoticeSmart.type';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,MAAM,QAAQ,UAAU;AAE5C,eAAeA,MAAM;AACrB,cAAc,eAAe;AAC7B,SAASD,OAAO,IAAIE,WAAW,QAAQ,eAAe;AACtD,cAAc,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","vi","zh","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAE1B,OAAO,MAAMC,iBAAiB,GAAG;EAC/Bd,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFE,EAAE;EACFE,EAAE;EACFC,EAAE;EACFC,EAAE;EACFL,EAAE;EACFE;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","vi","zh","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n\nexport type LocalizedMessaged = typeof localizedMessages;\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAE1B,OAAO,MAAMC,iBAAiB,GAAG;EAC/Bd,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFE,EAAE;EACFE,EAAE;EACFC,EAAE;EACFC,EAAE;EACFL,EAAE;EACFE;AACF,CAAC","ignoreList":[]}
|
package/lib/esm/Notice.mjs
CHANGED
|
@@ -15,26 +15,26 @@ const style = (
|
|
|
15
15
|
/*__reshadow_css_start__*/
|
|
16
16
|
(sstyled.insert(
|
|
17
17
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
18
|
+
".___SNotice_17j3l_gg_{display:flex;padding:var(--intergalactic-spacing-4x,16px);font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%);box-sizing:border-box;border-style:solid;border-width:1px;border-radius:var(--intergalactic-surface-rounded,8px);color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899))}.___SNotice_17j3l_gg_._theme_info_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-info,#ecf1ff);border-color:var(--intergalactic-border-info,oklch(.51 .274 263.6/.222))}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_info_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-info,oklch(.959 .021 267.8))}}.___SNotice_17j3l_gg_._theme_info_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-neutral,oklch(.092 .024 152.2/.526))}@media (hover:hover){.___SNotice_17j3l_gg_._theme_info_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,#00030095)}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_info_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,oklch(.088 .026 147.7/.583))}}}.___SNotice_17j3l_gg_._theme_danger_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-critical,#ffebef);border-color:var(--intergalactic-border-critical,#ff00133e)}@media (color-gamut:rec2020){.___SNotice_17j3l_gg_._theme_danger_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-critical,oklch(.958 .029 5.7))}}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_danger_17j3l_gg_{border-color:var(--intergalactic-border-critical,oklch(.628 .257 28.1/.243))}}.___SNotice_17j3l_gg_._theme_danger_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-critical,oklch(.552 .226 28.7/.848))}@media (hover:hover){.___SNotice_17j3l_gg_._theme_danger_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-critical-hover-active,oklch(.511 .209 28.7/.91))}}.___SNotice_17j3l_gg_._theme_warning_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-warning,#fff8e6);border-color:var(--intergalactic-border-warning,oklch(.77 .174 64.1/.543))}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_warning_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-warning,oklch(.979 .03 88.1))}}.___SNotice_17j3l_gg_._theme_warning_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-warning,#ff7d02)}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_warning_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-warning,oklch(.728 .188 51.8))}}@media (hover:hover){.___SNotice_17j3l_gg_._theme_warning_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-warning-hover-active,oklch(.531 .169 39.3))}}.___SNotice_17j3l_gg_._theme_success_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-success,#c9fff3);border-color:var(--intergalactic-border-success,oklch(.818 .171 165.4/.531))}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_success_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-success,oklch(.96 .057 179.7))}}.___SNotice_17j3l_gg_._theme_success_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-success,oklch(.595 .124 165.4))}@media (hover:hover){.___SNotice_17j3l_gg_._theme_success_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active,#00855f)}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_success_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-success-hover-active,oklch(.545 .115 164.9))}}}.___SNotice_17j3l_gg_._theme_muted_17j3l_gg_{background-color:var(--intergalactic-bg-secondary-neutral,oklch(.98 .001 180));border-color:var(--intergalactic-border-secondary,#00151012)}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_muted_17j3l_gg_{border-color:var(--intergalactic-border-secondary,oklch(.176 .033 175.7/.07))}}.___SNotice_17j3l_gg_._theme_muted_17j3l_gg_ .___SCloseIcon_17j3l_gg_{color:var(--intergalactic-icon-primary-neutral,oklch(.092 .024 152.2/.526))}@media (hover:hover){.___SNotice_17j3l_gg_._theme_muted_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,#00030095)}@media (color-gamut:p3){.___SNotice_17j3l_gg_._theme_muted_17j3l_gg_ .___SCloseIcon_17j3l_gg_:hover{color:var(--intergalactic-icon-primary-neutral-hover-active,oklch(.088 .026 147.7/.583))}}}.___SContent_17j3l_gg_{flex:1 1 auto;width:100%}.___SActions_17j3l_gg_{flex-shrink:0;margin-top:var(--intergalactic-spacing-3x,12px)}.___SLabel_17j3l_gg_{min-height:var(--intergalactic-form-control-m,28px);height:-moz-fit-content;height:fit-content;margin-right:var(--intergalactic-spacing-2x,8px);display:inline-flex;align-items:center}.___SLabel_17j3l_gg_._theme_info_17j3l_gg_{color:var(--intergalactic-icon-primary-neutral,oklch(.092 .024 152.2/.526))}.___SLabel_17j3l_gg_._theme_danger_17j3l_gg_{color:var(--intergalactic-icon-primary-critical,oklch(.552 .226 28.7/.848))}.___SLabel_17j3l_gg_._theme_warning_17j3l_gg_{color:var(--intergalactic-icon-primary-warning,#ff7d02)}@media (color-gamut:p3){.___SLabel_17j3l_gg_._theme_warning_17j3l_gg_{color:var(--intergalactic-icon-primary-warning,oklch(.728 .188 51.8))}}.___SLabel_17j3l_gg_._theme_success_17j3l_gg_{color:var(--intergalactic-icon-primary-success,oklch(.595 .124 165.4))}.___SLabel_17j3l_gg_._theme_muted_17j3l_gg_{color:var(--intergalactic-icon-primary-neutral,oklch(.092 .024 152.2/.526))}.___SLabel_17j3l_gg_._theme_custom_17j3l_gg_{color:var(--color_17j3l)}.___SCloseIcon_17j3l_gg_{flex-shrink:0;margin-left:var(--intergalactic-spacing-4x,16px)}.___SNotice_17j3l_gg_._theme_custom_17j3l_gg_{background-color:var(--backgroundColor_17j3l);border-color:var(--backgroundColor_17j3l)}.___STitle_17j3l_gg_{margin-top:var(--intergalactic-spacing-05x,2px);margin-bottom:var(--intergalactic-spacing-05x,2px)}.___SText_17j3l_gg_{margin-top:var(--intergalactic-spacing-1x,4px);margin-bottom:var(--intergalactic-spacing-1x,4px)}",
|
|
19
19
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
20
|
+
"17j3l_gg_"
|
|
21
21
|
), /*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SNotice": "
|
|
24
|
-
"__SContent": "
|
|
25
|
-
"__SActions": "
|
|
26
|
-
"__SLabel": "
|
|
27
|
-
"_theme_info": "
|
|
28
|
-
"_theme_danger": "
|
|
29
|
-
"_theme_warning": "
|
|
30
|
-
"_theme_success": "
|
|
31
|
-
"_theme_muted": "
|
|
32
|
-
"_theme_custom": "
|
|
33
|
-
"--color": "--
|
|
34
|
-
"__SCloseIcon": "
|
|
35
|
-
"--backgroundColor": "--
|
|
36
|
-
"__STitle": "
|
|
37
|
-
"__SText": "
|
|
23
|
+
"__SNotice": "___SNotice_17j3l_gg_",
|
|
24
|
+
"__SContent": "___SContent_17j3l_gg_",
|
|
25
|
+
"__SActions": "___SActions_17j3l_gg_",
|
|
26
|
+
"__SLabel": "___SLabel_17j3l_gg_",
|
|
27
|
+
"_theme_info": "_theme_info_17j3l_gg_",
|
|
28
|
+
"_theme_danger": "_theme_danger_17j3l_gg_",
|
|
29
|
+
"_theme_warning": "_theme_warning_17j3l_gg_",
|
|
30
|
+
"_theme_success": "_theme_success_17j3l_gg_",
|
|
31
|
+
"_theme_muted": "_theme_muted_17j3l_gg_",
|
|
32
|
+
"_theme_custom": "_theme_custom_17j3l_gg_",
|
|
33
|
+
"--color": "--color_17j3l",
|
|
34
|
+
"__SCloseIcon": "___SCloseIcon_17j3l_gg_",
|
|
35
|
+
"--backgroundColor": "--backgroundColor_17j3l",
|
|
36
|
+
"__STitle": "___STitle_17j3l_gg_",
|
|
37
|
+
"__SText": "___SText_17j3l_gg_"
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
function isCustomTheme(theme) {
|
|
@@ -46,7 +46,7 @@ class RootNotice extends Component {
|
|
|
46
46
|
_defineProperty(this, "ref", /* @__PURE__ */ React.createRef());
|
|
47
47
|
}
|
|
48
48
|
componentDidMount() {
|
|
49
|
-
if (this.ref.current && process.env.NODE_ENV !== "production" && !["muted", "danger"].includes(this.props.theme)) {
|
|
49
|
+
if (this.ref.current && process.env.NODE_ENV !== "production" && !["muted", "danger"].includes(this.props.theme ?? "")) {
|
|
50
50
|
const hasTitle = (node) => {
|
|
51
51
|
if (node.hasAttribute("aria-label")) return true;
|
|
52
52
|
if (node.hasAttribute("aria-labelledby")) return true;
|
|
@@ -117,6 +117,9 @@ _defineProperty(RootNotice, "style", style);
|
|
|
117
117
|
_defineProperty(RootNotice, "enhance", [i18nEnhance(localizedMessages), cssVariableEnhance({
|
|
118
118
|
variable: "--intergalactic-duration-popper",
|
|
119
119
|
fallback: "200",
|
|
120
|
+
// TODO: Types are incompatible. For some reason string type isn't recognized as a valid value.
|
|
121
|
+
// Leave it with ts-ignore annotation.
|
|
122
|
+
// @ts-ignore
|
|
120
123
|
map: Number.parseInt,
|
|
121
124
|
prop: "duration"
|
|
122
125
|
}), resolveColorEnhance()]);
|
|
@@ -125,12 +128,13 @@ _defineProperty(RootNotice, "defaultProps", {
|
|
|
125
128
|
i18n: localizedMessages,
|
|
126
129
|
locale: "en"
|
|
127
130
|
});
|
|
128
|
-
function Label({
|
|
129
|
-
styles,
|
|
130
|
-
theme,
|
|
131
|
-
resolveColor
|
|
132
|
-
}) {
|
|
131
|
+
function Label(props) {
|
|
133
132
|
var _ref2 = arguments[0], _ref9;
|
|
133
|
+
const {
|
|
134
|
+
styles,
|
|
135
|
+
theme,
|
|
136
|
+
resolveColor
|
|
137
|
+
} = props;
|
|
134
138
|
const SLabel = Box;
|
|
135
139
|
const useTheme = isCustomTheme(theme) ? "custom" : theme;
|
|
136
140
|
const color = resolveColor(theme);
|
|
@@ -141,10 +145,11 @@ function Label({
|
|
|
141
145
|
}, _ref2)
|
|
142
146
|
}));
|
|
143
147
|
}
|
|
144
|
-
function Title({
|
|
145
|
-
styles
|
|
146
|
-
}) {
|
|
148
|
+
function Title(props) {
|
|
147
149
|
var _ref3 = arguments[0], _ref0;
|
|
150
|
+
const {
|
|
151
|
+
styles
|
|
152
|
+
} = props;
|
|
148
153
|
const STitle = Text;
|
|
149
154
|
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(STitle, _ref0.cn("STitle", {
|
|
150
155
|
...assignProps({
|
|
@@ -154,10 +159,11 @@ function Title({
|
|
|
154
159
|
}, _ref3)
|
|
155
160
|
}));
|
|
156
161
|
}
|
|
157
|
-
function NoticeText({
|
|
158
|
-
styles
|
|
159
|
-
}) {
|
|
162
|
+
function NoticeText(props) {
|
|
160
163
|
var _ref4 = arguments[0], _ref1;
|
|
164
|
+
const {
|
|
165
|
+
styles
|
|
166
|
+
} = props;
|
|
161
167
|
const SText = Text;
|
|
162
168
|
return _ref1 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref1.cn("SText", {
|
|
163
169
|
...assignProps({
|
|
@@ -165,29 +171,32 @@ function NoticeText({
|
|
|
165
171
|
}, _ref4)
|
|
166
172
|
}));
|
|
167
173
|
}
|
|
168
|
-
function Actions({
|
|
169
|
-
styles
|
|
170
|
-
}) {
|
|
174
|
+
function Actions(props) {
|
|
171
175
|
var _ref5 = arguments[0], _ref10;
|
|
176
|
+
const {
|
|
177
|
+
styles
|
|
178
|
+
} = props;
|
|
172
179
|
const SActions = Box;
|
|
173
180
|
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SActions, _ref10.cn("SActions", {
|
|
174
181
|
...assignProps({}, _ref5)
|
|
175
182
|
}));
|
|
176
183
|
}
|
|
177
|
-
function Content({
|
|
178
|
-
styles
|
|
179
|
-
}) {
|
|
184
|
+
function Content(props) {
|
|
180
185
|
var _ref6 = arguments[0], _ref11;
|
|
186
|
+
const {
|
|
187
|
+
styles
|
|
188
|
+
} = props;
|
|
181
189
|
const SContent = Box;
|
|
182
190
|
return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SContent, _ref11.cn("SContent", {
|
|
183
191
|
...assignProps({}, _ref6)
|
|
184
192
|
}));
|
|
185
193
|
}
|
|
186
|
-
function Close({
|
|
187
|
-
styles,
|
|
188
|
-
getI18nText
|
|
189
|
-
}) {
|
|
194
|
+
function Close(props) {
|
|
190
195
|
var _ref7 = arguments[0], _ref12;
|
|
196
|
+
const {
|
|
197
|
+
styles,
|
|
198
|
+
getI18nText
|
|
199
|
+
} = props;
|
|
191
200
|
const SCloseIcon = Button;
|
|
192
201
|
return _ref12 = sstyled(styles), /* @__PURE__ */ React.createElement(SCloseIcon, _ref12.cn("SCloseIcon", {
|
|
193
202
|
...assignProps({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/esm/index.mjs
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NSNotice } from './Notice.type';
|
|
2
|
+
/**
|
|
3
|
+
* Notice
|
|
4
|
+
*
|
|
5
|
+
* {@link https://developer.semrush.com/intergalactic/components/notice/notice-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice/notice-code/|Examples}
|
|
6
|
+
*/
|
|
7
|
+
declare const Notice: NSNotice.Component;
|
|
8
|
+
export default Notice;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { FadeInOutProps, Box, BoxProps } from '@semcore/base-components';
|
|
2
|
+
import type Button from '@semcore/button';
|
|
3
|
+
import type { PropGetterFn, Intergalactic } from '@semcore/core';
|
|
4
|
+
import type { Text } from '@semcore/typography';
|
|
5
|
+
import type { LocalizedMessaged } from './translations/__intergalactic-dynamic-locales';
|
|
6
|
+
declare namespace NSNotice {
|
|
7
|
+
type Theme = 'danger' | 'warning' | 'success' | 'info' | 'muted';
|
|
8
|
+
type Props = BoxProps & FadeInOutProps & {
|
|
9
|
+
/** Property for managing visibility of Notice */
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Notice theme
|
|
13
|
+
* @default info
|
|
14
|
+
*/
|
|
15
|
+
theme?: NSNotice.Theme;
|
|
16
|
+
/** Duration of animation, ms
|
|
17
|
+
* @default 250
|
|
18
|
+
*/
|
|
19
|
+
duration?: number;
|
|
20
|
+
/** Specifies the locale for i18n support */
|
|
21
|
+
locale?: string;
|
|
22
|
+
};
|
|
23
|
+
type DefaultProps = {
|
|
24
|
+
theme: 'info';
|
|
25
|
+
i18n: LocalizedMessaged;
|
|
26
|
+
locale: 'en';
|
|
27
|
+
};
|
|
28
|
+
type Ctx = {
|
|
29
|
+
getLabelProps?: PropGetterFn;
|
|
30
|
+
};
|
|
31
|
+
namespace Label {
|
|
32
|
+
type Props = BoxProps & {
|
|
33
|
+
theme?: NSNotice.Theme;
|
|
34
|
+
};
|
|
35
|
+
type Component = Intergalactic.Component<'div', Props>;
|
|
36
|
+
}
|
|
37
|
+
namespace Actions {
|
|
38
|
+
type Component = typeof Box;
|
|
39
|
+
}
|
|
40
|
+
namespace Content {
|
|
41
|
+
type Component = typeof Box;
|
|
42
|
+
}
|
|
43
|
+
namespace Title {
|
|
44
|
+
type Component = typeof Text;
|
|
45
|
+
}
|
|
46
|
+
namespace Text {
|
|
47
|
+
type Component = typeof Text;
|
|
48
|
+
}
|
|
49
|
+
namespace Close {
|
|
50
|
+
type Component = typeof Button;
|
|
51
|
+
}
|
|
52
|
+
type Component = Intergalactic.Component<'div', Props, Ctx> & {
|
|
53
|
+
Label: Label.Component;
|
|
54
|
+
Actions: Actions.Component;
|
|
55
|
+
Content: Content.Component;
|
|
56
|
+
Title: Title.Component;
|
|
57
|
+
Text: Text.Component;
|
|
58
|
+
Close: Close.Component;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** @deprecated It will be removed in v18. */
|
|
62
|
+
export type NoticeTheme = NSNotice.Theme;
|
|
63
|
+
/** @deprecated It will be removed in v18. */
|
|
64
|
+
export type NoticeProps = NSNotice.Props;
|
|
65
|
+
/** @deprecated It will be removed in v18. */
|
|
66
|
+
export type NoticeLabelProps = NSNotice.Label.Props;
|
|
67
|
+
/** @deprecated It will be removed in v18. */
|
|
68
|
+
export type NoticeContext = NSNotice.Ctx;
|
|
69
|
+
export type { NSNotice };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NSNoticeSmart } from './NoticeSmart.type';
|
|
2
|
+
/**
|
|
3
|
+
* NoticeSmart
|
|
4
|
+
*
|
|
5
|
+
* {@link https://developer.semrush.com/intergalactic/components/notice/notice-api#noticesmart|API} | {@link https://developer.semrush.com/intergalactic/components/notice/notice-code/|Examples}
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: NSNoticeSmart.Component;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Intergalactic } from '@semcore/core';
|
|
2
|
+
import type { NSNotice } from './Notice.type';
|
|
3
|
+
declare namespace NSNoticeSmart {
|
|
4
|
+
type Props = NSNotice.Props & {
|
|
5
|
+
/**
|
|
6
|
+
* A custom element for additional information
|
|
7
|
+
*/
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* A custom element for title
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Custom action element
|
|
15
|
+
*/
|
|
16
|
+
actions?: React.ReactNode;
|
|
17
|
+
/** A custom element for text */
|
|
18
|
+
text?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Adds a Close button
|
|
21
|
+
*/
|
|
22
|
+
closable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Callback on a click on the close button
|
|
25
|
+
*/
|
|
26
|
+
onClose?: (event: React.SyntheticEvent) => void;
|
|
27
|
+
};
|
|
28
|
+
type DefaultProps = {
|
|
29
|
+
theme: 'info';
|
|
30
|
+
};
|
|
31
|
+
type Component = (props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentProps<'div', 'div', Props>, 'children'>) => Intergalactic.InternalTypings.ComponentRenderingResults & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', Props>;
|
|
32
|
+
}
|
|
33
|
+
/** @deprecated It will be removed in v18. */
|
|
34
|
+
export type NoticeSmartProps = NSNoticeSmart.Props;
|
|
35
|
+
export type { NSNoticeSmart };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,78 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type Button from '@semcore/button';
|
|
3
|
-
import type { PropGetterFn, Intergalactic } from '@semcore/core';
|
|
4
|
-
import type { Text } from '@semcore/typography';
|
|
5
|
-
|
|
6
|
-
export type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';
|
|
7
|
-
|
|
8
|
-
export type NoticeProps = BoxProps &
|
|
9
|
-
FadeInOutProps & {
|
|
10
|
-
/** Property for managing visibility of Notice */
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Notice theme
|
|
14
|
-
* @default info
|
|
15
|
-
*/
|
|
16
|
-
theme?: NoticeTheme;
|
|
17
|
-
/** Duration of animation, ms
|
|
18
|
-
* @default 250
|
|
19
|
-
*/
|
|
20
|
-
duration?: number;
|
|
21
|
-
/** Specifies the locale for i18n support */
|
|
22
|
-
locale?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type NoticeLabelProps = BoxProps & {
|
|
26
|
-
theme?: NoticeTheme;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type NoticeContext = {
|
|
30
|
-
getLabelProps?: PropGetterFn;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type NoticeSmartProps = NoticeProps & {
|
|
34
|
-
/**
|
|
35
|
-
* A custom element for additional information
|
|
36
|
-
*/
|
|
37
|
-
label?: React.ReactNode;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A custom element for title
|
|
41
|
-
*/
|
|
42
|
-
title?: React.ReactNode;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Custom action element
|
|
46
|
-
*/
|
|
47
|
-
actions?: React.ReactNode;
|
|
48
|
-
|
|
49
|
-
/** A custom element for text */
|
|
50
|
-
text?: React.ReactNode;
|
|
51
|
-
/**
|
|
52
|
-
* Adds a Close button
|
|
53
|
-
*/
|
|
54
|
-
closable?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Callback on a click on the close button
|
|
57
|
-
*/
|
|
58
|
-
onClose?: (event: React.SyntheticEvent) => void;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
declare const Notice: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {
|
|
62
|
-
Label: Intergalactic.Component<'div', NoticeLabelProps>;
|
|
63
|
-
Actions: typeof Box;
|
|
64
|
-
Content: typeof Box;
|
|
65
|
-
Title: typeof Text;
|
|
66
|
-
Text: typeof Text;
|
|
67
|
-
Close: typeof Button;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
declare const NoticeSmart: (
|
|
71
|
-
props: Intergalactic.InternalTypings.EfficientOmit<
|
|
72
|
-
Intergalactic.InternalTypings.ComponentProps<'div', 'div', NoticeSmartProps>,
|
|
73
|
-
'children'
|
|
74
|
-
>
|
|
75
|
-
) => Intergalactic.InternalTypings.ComponentRenderingResults & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', NoticeSmartProps>;
|
|
76
|
-
|
|
77
|
-
export { NoticeSmart };
|
|
1
|
+
import { default as Notice } from './Notice';
|
|
78
2
|
export default Notice;
|
|
3
|
+
export * from './Notice.type';
|
|
4
|
+
export { default as NoticeSmart } from './NoticeSmart';
|
|
5
|
+
export * from './NoticeSmart.type';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const localizedMessages: {
|
|
2
|
+
de: {
|
|
3
|
+
notification: string;
|
|
4
|
+
criticalNotification: string;
|
|
5
|
+
close: string;
|
|
6
|
+
};
|
|
7
|
+
en: {
|
|
8
|
+
notification: string;
|
|
9
|
+
criticalNotification: string;
|
|
10
|
+
close: string;
|
|
11
|
+
};
|
|
12
|
+
es: {
|
|
13
|
+
notification: string;
|
|
14
|
+
criticalNotification: string;
|
|
15
|
+
close: string;
|
|
16
|
+
};
|
|
17
|
+
fr: {
|
|
18
|
+
notification: string;
|
|
19
|
+
criticalNotification: string;
|
|
20
|
+
close: string;
|
|
21
|
+
};
|
|
22
|
+
it: {
|
|
23
|
+
notification: string;
|
|
24
|
+
criticalNotification: string;
|
|
25
|
+
close: string;
|
|
26
|
+
};
|
|
27
|
+
ja: {
|
|
28
|
+
notification: string;
|
|
29
|
+
criticalNotification: string;
|
|
30
|
+
close: string;
|
|
31
|
+
};
|
|
32
|
+
ko: {
|
|
33
|
+
notification: string;
|
|
34
|
+
criticalNotification: string;
|
|
35
|
+
close: string;
|
|
36
|
+
};
|
|
37
|
+
nl: {
|
|
38
|
+
notification: string;
|
|
39
|
+
criticalNotification: string;
|
|
40
|
+
close: string;
|
|
41
|
+
};
|
|
42
|
+
pt: {
|
|
43
|
+
notification: string;
|
|
44
|
+
criticalNotification: string;
|
|
45
|
+
close: string;
|
|
46
|
+
};
|
|
47
|
+
tr: {
|
|
48
|
+
notification: string;
|
|
49
|
+
criticalNotification: string;
|
|
50
|
+
close: string;
|
|
51
|
+
};
|
|
52
|
+
vi: {
|
|
53
|
+
notification: string;
|
|
54
|
+
criticalNotification: string;
|
|
55
|
+
close: string;
|
|
56
|
+
};
|
|
57
|
+
zh: {
|
|
58
|
+
notification: string;
|
|
59
|
+
criticalNotification: string;
|
|
60
|
+
close: string;
|
|
61
|
+
};
|
|
62
|
+
pl: {
|
|
63
|
+
notification: string;
|
|
64
|
+
criticalNotification: string;
|
|
65
|
+
close: string;
|
|
66
|
+
};
|
|
67
|
+
sv: {
|
|
68
|
+
notification: string;
|
|
69
|
+
criticalNotification: string;
|
|
70
|
+
close: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type LocalizedMessaged = typeof localizedMessages;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/notice",
|
|
3
3
|
"description": "Semrush Notice Component",
|
|
4
|
-
"version": "17.2.1",
|
|
4
|
+
"version": "17.2.2-prerelease.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"directory": "semcore/notice"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@semcore/testing-utils": "1.0.0",
|
|
31
|
-
"@semcore/core": "17.2.1",
|
|
32
30
|
"@semcore/base-components": "17.2.1",
|
|
31
|
+
"@semcore/core": "17.2.1",
|
|
32
|
+
"@semcore/testing-utils": "1.0.0",
|
|
33
33
|
"@semcore/icon": "17.2.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "pnpm semcore-builder
|
|
36
|
+
"build": "pnpm semcore-builder && pnpm vite build"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/vite.config.ts
CHANGED
package/vitest.config.mts
CHANGED
package/lib/cjs/index.d.js
DELETED
package/lib/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { FadeInOutProps, Box, BoxProps } from '@semcore/base-components';\nimport type Button from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Text } from '@semcore/typography';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';\n\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\nexport type NoticeContext = {\n getLabelProps?: PropGetterFn;\n};\n\nexport type NoticeSmartProps = NoticeProps & {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n\n /**\n * A custom element for title\n */\n title?: React.ReactNode;\n\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n\n /** A custom element for text */\n text?: React.ReactNode;\n /**\n * Adds a Close button\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n};\n\ndeclare const Notice: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n Title: typeof Text;\n Text: typeof Text;\n Close: typeof Button;\n};\n\ndeclare const NoticeSmart: (\n props: Intergalactic.InternalTypings.EfficientOmit<\n Intergalactic.InternalTypings.ComponentProps<'div', 'div', NoticeSmartProps>,\n 'children'\n >\n) => Intergalactic.InternalTypings.ComponentRenderingResults & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/index.d.js
DELETED
package/lib/es6/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { FadeInOutProps, Box, BoxProps } from '@semcore/base-components';\nimport type Button from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { Text } from '@semcore/typography';\n\nexport type NoticeTheme = 'danger' | 'warning' | 'success' | 'info' | 'muted';\n\nexport type NoticeProps = BoxProps &\n FadeInOutProps & {\n /** Property for managing visibility of Notice */\n hidden?: boolean;\n /**\n * Notice theme\n * @default info\n */\n theme?: NoticeTheme;\n /** Duration of animation, ms\n * @default 250\n */\n duration?: number;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeLabelProps = BoxProps & {\n theme?: NoticeTheme;\n};\n\nexport type NoticeContext = {\n getLabelProps?: PropGetterFn;\n};\n\nexport type NoticeSmartProps = NoticeProps & {\n /**\n * A custom element for additional information\n */\n label?: React.ReactNode;\n\n /**\n * A custom element for title\n */\n title?: React.ReactNode;\n\n /**\n * Custom action element\n */\n actions?: React.ReactNode;\n\n /** A custom element for text */\n text?: React.ReactNode;\n /**\n * Adds a Close button\n */\n closable?: boolean;\n /**\n * Callback on a click on the close button\n */\n onClose?: (event: React.SyntheticEvent) => void;\n};\n\ndeclare const Notice: Intergalactic.Component<'div', NoticeProps, NoticeContext> & {\n Label: Intergalactic.Component<'div', NoticeLabelProps>;\n Actions: typeof Box;\n Content: typeof Box;\n Title: typeof Text;\n Text: typeof Text;\n Close: typeof Button;\n};\n\ndeclare const NoticeSmart: (\n props: Intergalactic.InternalTypings.EfficientOmit<\n Intergalactic.InternalTypings.ComponentProps<'div', 'div', NoticeSmartProps>,\n 'children'\n >\n) => Intergalactic.InternalTypings.ComponentRenderingResults & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', NoticeSmartProps>;\n\nexport { NoticeSmart };\nexport default Notice;\n"],"mappings":"","ignoreList":[]}
|