@coveord/plasma-mantine 56.17.0 → 56.18.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/.turbo/turbo-build.log +4 -4
- package/.turbo/turbo-test.log +114 -113
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/ActionIcon/ActionIcon.d.ts +1 -1
- package/dist/cjs/components/ActionIcon/ActionIcon.d.ts.map +1 -1
- package/dist/cjs/components/ActionIcon/ActionIcon.js +10 -0
- package/dist/cjs/components/ActionIcon/ActionIcon.js.map +1 -1
- package/dist/cjs/components/Alert/Alert.d.ts.map +1 -1
- package/dist/cjs/components/Alert/Alert.js +5 -0
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/Button/Button.d.ts.map +1 -1
- package/dist/cjs/components/Button/Button.js +10 -0
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/cjs/components/CodeEditor/CodeEditor.js +1 -0
- package/dist/cjs/components/CodeEditor/CodeEditor.js.map +1 -1
- package/dist/cjs/components/LastUpdated/LastUpdated.js +1 -0
- package/dist/cjs/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/cjs/components/StickyFooter/StickyFooter.d.ts.map +1 -1
- package/dist/cjs/components/StickyFooter/StickyFooter.js +1 -0
- package/dist/cjs/components/StickyFooter/StickyFooter.js.map +1 -1
- package/dist/esm/components/ActionIcon/ActionIcon.d.ts +1 -1
- package/dist/esm/components/ActionIcon/ActionIcon.d.ts.map +1 -1
- package/dist/esm/components/ActionIcon/ActionIcon.js +10 -0
- package/dist/esm/components/ActionIcon/ActionIcon.js.map +1 -1
- package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/esm/components/Alert/Alert.js +5 -0
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +10 -0
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/esm/components/CodeEditor/CodeEditor.js +1 -0
- package/dist/esm/components/CodeEditor/CodeEditor.js.map +1 -1
- package/dist/esm/components/LastUpdated/LastUpdated.js +1 -0
- package/dist/esm/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/esm/components/StickyFooter/StickyFooter.d.ts.map +1 -1
- package/dist/esm/components/StickyFooter/StickyFooter.js +1 -0
- package/dist/esm/components/StickyFooter/StickyFooter.js.map +1 -1
- package/package.json +3 -3
- package/src/components/ActionIcon/ActionIcon.tsx +15 -4
- package/src/components/Alert/Alert.tsx +7 -0
- package/src/components/Button/Button.tsx +12 -1
- package/src/components/CodeEditor/CodeEditor.tsx +4 -4
- package/src/components/LastUpdated/LastUpdated.tsx +2 -0
- package/src/components/StickyFooter/StickyFooter.tsx +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n ButtonCssVariables,\n type ButtonGroup,\n ButtonStylesNames,\n ButtonVariant,\n Factory,\n Button as MantineButton,\n ButtonProps as MantineButtonProps,\n polymorphicFactory,\n} from '@mantine/core';\nimport {MouseEventHandler} from 'react';\nimport {useClickWithLoading} from '../../hooks/useClickWithLoading.js';\nimport {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip.js';\n\nexport interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {\n /* Handler executed on click */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\ntype ButtonOverloadFactory = Factory<{\n props: ButtonProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: ButtonStylesNames;\n vars: ButtonCssVariables;\n variant: ButtonVariant;\n staticComponents: {\n Group: typeof ButtonGroup;\n Primary: typeof ButtonPrimary;\n Secondary: typeof ButtonSecondary;\n Tertiary: typeof ButtonTertiary;\n Quaternary: typeof ButtonQuaternary;\n DestructivePrimary: typeof ButtonDestructive;\n DestructiveSecondary: typeof ButtonDestructiveSecondary;\n DestructiveTertiary: typeof ButtonDestructiveTertiary;\n DestructiveQuaternary: typeof ButtonDestructiveQuaternary;\n };\n}>;\n\nexport const Button = polymorphicFactory<ButtonOverloadFactory>(\n (\n {disabledTooltip, disabled, disabledTooltipProps, loading, onClick, 'data-disabled': dataDisabled, ...others},\n ref,\n ) => {\n const {isLoading, handleClick} = useClickWithLoading(onClick);\n return (\n <ButtonWithDisabledTooltip\n disabled={disabled || dataDisabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n fullWidth={others.fullWidth}\n >\n <MantineButton\n loaderProps={{variant: 'oval'}}\n ref={ref}\n loading={isLoading || loading}\n onClick={dataDisabled ? (e) => e.preventDefault() : handleClick}\n disabled={disabled || dataDisabled}\n data-loading={isLoading || loading || undefined}\n {...others}\n />\n </ButtonWithDisabledTooltip>\n );\n },\n);\nconst ButtonPrimary = Button.withProps({variant: 'filled'});\nconst ButtonSecondary = Button.withProps({\n variant: 'light',\n color: 'var(--coveo-color-text-primary)',\n});\nconst ButtonTertiary = Button.withProps({\n variant: 'default',\n vars: (theme) => ({\n root: {\n '--button-color': 'var(--coveo-color-text-primary)',\n '--button-padding-x': theme.spacing.sm,\n },\n }),\n});\nconst ButtonQuaternary = Button.withProps({\n variant: 'subtle',\n color: 'var(--coveo-color-text-primary)',\n});\n\nconst ButtonDestructive = Button.withProps({variant: 'filled', color: 'var(--mantine-color-error)'});\nconst ButtonDestructiveSecondary = Button.withProps({\n variant: 'light',\n color: 'var(--mantine-color-error)',\n});\nconst ButtonDestructiveTertiary = Button.withProps({\n variant: 'default',\n vars: (theme) => ({\n root: {\n '--button-color': 'var(--mantine-color-error)',\n '--button-padding-x': theme.spacing.sm,\n },\n }),\n});\nconst ButtonDestructiveQuaternary = Button.withProps({variant: 'subtle', color: 'var(--mantine-color-error)'});\n\nButton.Group = MantineButton.Group;\nButton.Primary = ButtonPrimary;\nButton.Secondary = ButtonSecondary;\nButton.Tertiary = ButtonTertiary;\nButton.Quaternary = ButtonQuaternary;\nButton.DestructivePrimary = ButtonDestructive;\nButton.DestructiveSecondary = ButtonDestructiveSecondary;\nButton.DestructiveTertiary = ButtonDestructiveTertiary;\nButton.DestructiveQuaternary = ButtonDestructiveQuaternary;\n"],"names":["Button","MantineButton","polymorphicFactory","useClickWithLoading","ButtonWithDisabledTooltip","disabledTooltip","disabled","disabledTooltipProps","loading","onClick","dataDisabled","others","ref","isLoading","handleClick","fullWidth","loaderProps","variant","e","preventDefault","data-loading","undefined","ButtonPrimary","withProps","ButtonSecondary","color","ButtonTertiary","vars","theme","root","spacing","sm","ButtonQuaternary","ButtonDestructive","ButtonDestructiveSecondary","ButtonDestructiveTertiary","ButtonDestructiveQuaternary","Group","Primary","Secondary","Tertiary","Quaternary","DestructivePrimary","DestructiveSecondary","DestructiveTertiary","DestructiveQuaternary"],"mappings":";AAAA,SAMIA,UAAUC,aAAa,EAEvBC,kBAAkB,QACf,gBAAgB;AAEvB,SAAQC,mBAAmB,QAAO,qCAAqC;AACvE,SAAQC,yBAAyB,QAAuC,iCAAiC;AA2BzG,OAAO,MAAMJ,SAASE,mBAClB,CACI,EAACG,eAAe,EAAEC,QAAQ,EAAEC,oBAAoB,EAAEC,OAAO,EAAEC,OAAO,EAAE,iBAAiBC,YAAY,EAAE,GAAGC,QAAO,EAC7GC;IAEA,MAAM,EAACC,SAAS,EAAEC,WAAW,EAAC,GAAGX,oBAAoBM;IACrD,qBACI,KAACL;QACGE,UAAUA,YAAYI;QACtBL,iBAAiBA;QACjBE,sBAAsBA;QACtBQ,WAAWJ,OAAOI,SAAS;kBAE3B,cAAA,KAACd;YACGe,aAAa;gBAACC,SAAS;YAAM;YAC7BL,KAAKA;YACLJ,SAASK,aAAaL;YACtBC,SAASC,eAAe,CAACQ,IAAMA,EAAEC,cAAc,KAAKL;YACpDR,UAAUA,YAAYI;YACtBU,gBAAcP,aAAaL,WAAWa;YACrC,GAAGV,MAAM;;;AAI1B,GACF;AACF,MAAMW,gBAAgBtB,OAAOuB,SAAS,CAAC;IAACN,SAAS;AAAQ;AACzD,MAAMO,kBAAkBxB,OAAOuB,SAAS,CAAC;IACrCN,SAAS;IACTQ,OAAO;AACX;AACA,MAAMC,iBAAiB1B,OAAOuB,SAAS,CAAC;IACpCN,SAAS;IACTU,MAAM,CAACC,QAAW,CAAA;YACdC,MAAM;gBACF,kBAAkB;gBAClB,sBAAsBD,MAAME,OAAO,CAACC,EAAE;YAC1C;QACJ,CAAA;AACJ;AACA,MAAMC,mBAAmBhC,OAAOuB,SAAS,CAAC;IACtCN,SAAS;IACTQ,OAAO;AACX;AAEA,MAAMQ,oBAAoBjC,OAAOuB,SAAS,CAAC;IAACN,SAAS;IAAUQ,OAAO;AAA4B;AAClG,MAAMS,6BAA6BlC,OAAOuB,SAAS,CAAC;IAChDN,SAAS;IACTQ,OAAO;AACX;AACA,MAAMU,4BAA4BnC,OAAOuB,SAAS,CAAC;IAC/CN,SAAS;IACTU,MAAM,CAACC,QAAW,CAAA;YACdC,MAAM;gBACF,kBAAkB;gBAClB,sBAAsBD,MAAME,OAAO,CAACC,EAAE;YAC1C;QACJ,CAAA;AACJ;AACA,MAAMK,8BAA8BpC,OAAOuB,SAAS,CAAC;IAACN,SAAS;IAAUQ,OAAO;AAA4B;AAE5GzB,OAAOqC,KAAK,GAAGpC,cAAcoC,KAAK;AAClCrC,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n ButtonCssVariables,\n type ButtonGroup,\n ButtonStylesNames,\n ButtonVariant,\n Factory,\n Button as MantineButton,\n ButtonProps as MantineButtonProps,\n polymorphicFactory,\n} from '@mantine/core';\nimport {ComponentType, MouseEventHandler} from 'react';\nimport {useClickWithLoading} from '../../hooks/useClickWithLoading.js';\nimport {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip.js';\n\nexport interface ButtonProps extends MantineButtonProps, ButtonWithDisabledTooltipProps {\n /* Handler executed on click */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\ntype ButtonOverloadFactory = Factory<{\n props: ButtonProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: ButtonStylesNames;\n vars: ButtonCssVariables;\n variant: ButtonVariant;\n staticComponents: {\n Group: typeof ButtonGroup;\n Primary: typeof ButtonPrimary;\n Secondary: typeof ButtonSecondary;\n Tertiary: typeof ButtonTertiary;\n Quaternary: typeof ButtonQuaternary;\n DestructivePrimary: typeof ButtonDestructive;\n DestructiveSecondary: typeof ButtonDestructiveSecondary;\n DestructiveTertiary: typeof ButtonDestructiveTertiary;\n DestructiveQuaternary: typeof ButtonDestructiveQuaternary;\n };\n}>;\n\nexport const Button = polymorphicFactory<ButtonOverloadFactory>(\n (\n {disabledTooltip, disabled, disabledTooltipProps, loading, onClick, 'data-disabled': dataDisabled, ...others},\n ref,\n ) => {\n const {isLoading, handleClick} = useClickWithLoading(onClick);\n return (\n <ButtonWithDisabledTooltip\n disabled={disabled || dataDisabled}\n disabledTooltip={disabledTooltip}\n disabledTooltipProps={disabledTooltipProps}\n fullWidth={others.fullWidth}\n >\n <MantineButton\n loaderProps={{variant: 'oval'}}\n ref={ref}\n loading={isLoading || loading}\n onClick={dataDisabled ? (e) => e.preventDefault() : handleClick}\n disabled={disabled || dataDisabled}\n data-loading={isLoading || loading || undefined}\n {...others}\n />\n </ButtonWithDisabledTooltip>\n );\n },\n);\nconst ButtonPrimary = Button.withProps({variant: 'filled'});\nconst ButtonSecondary = Button.withProps({\n variant: 'light',\n color: 'var(--coveo-color-text-primary)',\n});\nconst ButtonTertiary = Button.withProps({\n variant: 'default',\n vars: (theme) => ({\n root: {\n '--button-color': 'var(--coveo-color-text-primary)',\n '--button-padding-x': theme.spacing.sm,\n },\n }),\n});\nconst ButtonQuaternary = Button.withProps({\n variant: 'subtle',\n color: 'var(--coveo-color-text-primary)',\n});\n\nconst ButtonDestructive = Button.withProps({variant: 'filled', color: 'var(--mantine-color-error)'});\nconst ButtonDestructiveSecondary = Button.withProps({\n variant: 'light',\n color: 'var(--mantine-color-error)',\n});\nconst ButtonDestructiveTertiary = Button.withProps({\n variant: 'default',\n vars: (theme) => ({\n root: {\n '--button-color': 'var(--mantine-color-error)',\n '--button-padding-x': theme.spacing.sm,\n },\n }),\n});\nconst ButtonDestructiveQuaternary = Button.withProps({variant: 'subtle', color: 'var(--mantine-color-error)'});\n\nButton.Group = MantineButton.Group;\nButton.Group.displayName = 'Button.Group';\nButton.Primary = ButtonPrimary;\nButton.Secondary = ButtonSecondary;\nButton.Tertiary = ButtonTertiary;\nButton.Quaternary = ButtonQuaternary;\nButton.DestructivePrimary = ButtonDestructive;\nButton.DestructiveSecondary = ButtonDestructiveSecondary;\nButton.DestructiveTertiary = ButtonDestructiveTertiary;\nButton.DestructiveQuaternary = ButtonDestructiveQuaternary;\n(ButtonPrimary as ComponentType).displayName = 'Button.Primary';\n(ButtonSecondary as ComponentType).displayName = 'Button.Secondary';\n(ButtonTertiary as ComponentType).displayName = 'Button.Tertiary';\n(ButtonQuaternary as ComponentType).displayName = 'Button.Quaternary';\n(ButtonDestructive as ComponentType).displayName = 'Button.DestructivePrimary';\n(ButtonDestructiveSecondary as ComponentType).displayName = 'Button.DestructiveSecondary';\n(ButtonDestructiveTertiary as ComponentType).displayName = 'Button.DestructiveTertiary';\n(ButtonDestructiveQuaternary as ComponentType).displayName = 'Button.DestructiveQuaternary';\n\nButton.displayName = 'Button';\n"],"names":["Button","MantineButton","polymorphicFactory","useClickWithLoading","ButtonWithDisabledTooltip","disabledTooltip","disabled","disabledTooltipProps","loading","onClick","dataDisabled","others","ref","isLoading","handleClick","fullWidth","loaderProps","variant","e","preventDefault","data-loading","undefined","ButtonPrimary","withProps","ButtonSecondary","color","ButtonTertiary","vars","theme","root","spacing","sm","ButtonQuaternary","ButtonDestructive","ButtonDestructiveSecondary","ButtonDestructiveTertiary","ButtonDestructiveQuaternary","Group","displayName","Primary","Secondary","Tertiary","Quaternary","DestructivePrimary","DestructiveSecondary","DestructiveTertiary","DestructiveQuaternary"],"mappings":";AAAA,SAMIA,UAAUC,aAAa,EAEvBC,kBAAkB,QACf,gBAAgB;AAEvB,SAAQC,mBAAmB,QAAO,qCAAqC;AACvE,SAAQC,yBAAyB,QAAuC,iCAAiC;AA2BzG,OAAO,MAAMJ,SAASE,mBAClB,CACI,EAACG,eAAe,EAAEC,QAAQ,EAAEC,oBAAoB,EAAEC,OAAO,EAAEC,OAAO,EAAE,iBAAiBC,YAAY,EAAE,GAAGC,QAAO,EAC7GC;IAEA,MAAM,EAACC,SAAS,EAAEC,WAAW,EAAC,GAAGX,oBAAoBM;IACrD,qBACI,KAACL;QACGE,UAAUA,YAAYI;QACtBL,iBAAiBA;QACjBE,sBAAsBA;QACtBQ,WAAWJ,OAAOI,SAAS;kBAE3B,cAAA,KAACd;YACGe,aAAa;gBAACC,SAAS;YAAM;YAC7BL,KAAKA;YACLJ,SAASK,aAAaL;YACtBC,SAASC,eAAe,CAACQ,IAAMA,EAAEC,cAAc,KAAKL;YACpDR,UAAUA,YAAYI;YACtBU,gBAAcP,aAAaL,WAAWa;YACrC,GAAGV,MAAM;;;AAI1B,GACF;AACF,MAAMW,gBAAgBtB,OAAOuB,SAAS,CAAC;IAACN,SAAS;AAAQ;AACzD,MAAMO,kBAAkBxB,OAAOuB,SAAS,CAAC;IACrCN,SAAS;IACTQ,OAAO;AACX;AACA,MAAMC,iBAAiB1B,OAAOuB,SAAS,CAAC;IACpCN,SAAS;IACTU,MAAM,CAACC,QAAW,CAAA;YACdC,MAAM;gBACF,kBAAkB;gBAClB,sBAAsBD,MAAME,OAAO,CAACC,EAAE;YAC1C;QACJ,CAAA;AACJ;AACA,MAAMC,mBAAmBhC,OAAOuB,SAAS,CAAC;IACtCN,SAAS;IACTQ,OAAO;AACX;AAEA,MAAMQ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AC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,oCAAoC,EAAE,SAAS,CAAC,CAAC;CAChF;AASD,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA4LzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import {\n Box,\n Center,\n Group,\n Input,\n InputWrapperProps,\n Loader,\n Space,\n Stack,\n StackProps,\n px,\n useMantineColorScheme,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {Monaco, loader} from '@monaco-editor/react';\nimport {MarkerSeverity, editor as monacoEditor} from 'monaco-editor';\nimport {FunctionComponent, useEffect, useRef, useState} from 'react';\n\nimport cx from 'clsx';\nimport {useParentHeight} from '../../hooks/useParentHeight.js';\nimport {CopyToClipboard} from '../CopyToClipboard/CopyToClipboard.js';\nimport CodeEditorClasses from './CodeEditor.module.css';\nimport {XML} from './languages/xml.js';\nimport {Search} from './search/Search.js';\ninterface CodeEditorProps\n extends Omit<\n InputWrapperProps,\n 'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'\n >,\n Omit<StackProps, 'onChange' | 'attributes'> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml' | (string & unknown);\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the search icon is clicked */\n onSearch?(): void;\n /** Called whenever the copy icon is clicked */\n onCopy?(): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /** Ref object that provides access to the editor's functionality */\n editorHandle?: React.MutableRefObject<monacoEditor.IStandaloneCodeEditor | null>;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n /**\n * Options to pass to the monaco editor.\n * Currently only supporting [`tabSize`](https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor.IStandaloneEditorConstructionOptions.html#tabSize).\n *\n */\n options?: Pick<monacoEditor.IStandaloneEditorConstructionOptions, 'tabSize'>;\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onCopy,\n onSearch,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n options: {tabSize} = {tabSize: 2},\n editorHandle,\n ...others\n } = useProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n const editorRef = useRef(null);\n\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n const registerThemes = (monaco: Monaco) => {\n monaco.editor.defineTheme('light', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': theme.colors.gray[0],\n },\n });\n };\n\n const handleSearch = () => {\n if (editorRef.current) {\n editorRef.current.focus();\n editorRef.current.trigger('editor', 'actions.find', '');\n onSearch?.();\n }\n };\n\n const [hasMonacoError, setHasMonacoError] = useState(false);\n const hasMonacoErrorRef = useRef(false);\n\n hasMonacoErrorRef.current = hasMonacoError;\n\n const hasError = !!error || hasMonacoError;\n const theme = useMantineTheme();\n const {colorScheme} = useMantineColorScheme();\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const handleValidate = (markers: monacoEditor.IMarker[]) => {\n setHasMonacoError(markers.some((marker) => marker.severity === MarkerSeverity.Error));\n };\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : <Space h=\"sm\" />;\n\n const _header =\n _label || _description ? (\n <Stack gap=\"xxs\">\n {_label}\n {_description}\n </Stack>\n ) : null;\n\n const _buttons = (\n <Group justify=\"right\" gap=\"xs\">\n <Search handleSearch={handleSearch} />\n <CopyToClipboard value={_value} onCopy={() => onCopy?.()} />\n </Group>\n );\n let editorTheme = colorScheme === 'light' ? 'light' : 'vs-dark';\n if (disabled) {\n editorTheme += '-disabled';\n }\n\n const _editor = loaded ? (\n <Box\n p=\"md\"\n pl=\"xs\"\n className={cx(\n CodeEditorClasses.root,\n {[CodeEditorClasses.error]: hasError},\n {[CodeEditorClasses.disabled]: disabled},\n )}\n data-testid=\"editor-wrapper\"\n >\n <Editor\n onValidate={handleValidate}\n defaultLanguage={language}\n theme={editorTheme}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: px(theme.fontSizes.xs) as number,\n readOnly: disabled,\n stickyScroll: {enabled: false},\n tabSize,\n }}\n value={_value}\n onChange={handleChange}\n beforeMount={(monaco) => {\n registerLanguages(monaco);\n registerThemes(monaco);\n }}\n onMount={(editor) => {\n editorRef.current = editor;\n if (editorHandle) {\n editorHandle.current = editor;\n }\n editor.onDidFocusEditorText(() => onFocus?.());\n editor.onDidBlurEditorText(async () => {\n // monaco editor has a timeout of 500ms populating errors, we want to ensure that checking errors happen after that\n setTimeout(async () => {\n if (!hasMonacoErrorRef.current) {\n await editor?.getAction('editor.action.formatDocument')?.run();\n }\n }, 550);\n });\n }}\n />\n </Box>\n ) : (\n <Center className={CodeEditorClasses.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack\n justify=\"flex-start\"\n gap=\"sm\"\n h={Math.max(parentHeight, minHeight)}\n mah={maxHeight}\n ref={ref}\n {...others}\n >\n <Group justify=\"space-between\">\n {_header}\n {_buttons}\n </Group>\n {_editor}\n {_error}\n </Stack>\n );\n};\n"],"names":["Box","Center","Group","Input","Loader","Space","Stack","px","useMantineColorScheme","useMantineTheme","useProps","useUncontrolled","Editor","loader","MarkerSeverity","useEffect","useRef","useState","cx","useParentHeight","CopyToClipboard","CodeEditorClasses","XML","Search","defaultProps","language","monacoLoader","defaultValue","minHeight","CodeEditor","props","onChange","onCopy","onSearch","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","options","tabSize","editorHandle","others","loaded","setLoaded","_value","handleChange","finalValue","parentHeight","ref","editorRef","loadLocalMonaco","monacoInstance","config","monaco","registerLanguages","register","registerThemes","editor","defineTheme","base","inherit","rules","colors","theme","gray","handleSearch","current","focus","trigger","hasMonacoError","setHasMonacoError","hasMonacoErrorRef","hasError","colorScheme","handleValidate","markers","some","marker","severity","Error","_label","Label","_description","Description","_error","h","_header","gap","_buttons","justify","editorTheme","_editor","p","pl","className","root","data-testid","onValidate","defaultLanguage","minimap","enabled","wordWrap","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","stickyScroll","beforeMount","onMount","onDidFocusEditorText","onDidBlurEditorText","setTimeout","getAction","run","Math","max","mah"],"mappings":";AAAA,SACIA,GAAG,EACHC,MAAM,EACNC,KAAK,EACLC,KAAK,EAELC,MAAM,EACNC,KAAK,EACLC,KAAK,EAELC,EAAE,EACFC,qBAAqB,EACrBC,eAAe,EACfC,QAAQ,QACL,gBAAgB;AACvB,SAAQC,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,UAAiBC,MAAM,QAAO,uBAAuB;AAC5D,SAAQC,cAAc,QAA+B,gBAAgB;AACrE,SAA2BC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAErE,OAAOC,QAAQ,OAAO;AACtB,SAAQC,eAAe,QAAO,iCAAiC;AAC/D,SAAQC,eAAe,QAAO,wCAAwC;AACtE,OAAOC,uBAAuB,0BAA0B;AACxD,SAAQC,GAAG,QAAO,qBAAqB;AACvC,SAAQC,MAAM,QAAO,qBAAqB;AA2D1C,MAAMC,eAAyC;IAC3CC,UAAU;IACVC,cAAc;IACdC,cAAc;IACdC,WAAW;AACf;AAEA,OAAO,MAAMC,aAAiD,CAACC;IAC3D,MAAM,EACFL,QAAQ,EACRE,YAAY,EACZI,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,QAAQ,EACRC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,gBAAgB,EAChBd,SAAS,EACTe,SAAS,EACTC,QAAQ,EACRlB,YAAY,EACZmB,SAAS,EAACC,OAAO,EAAC,GAAG;QAACA,SAAS;IAAC,CAAC,EACjCC,YAAY,EACZ,GAAGC,QACN,GAAGtC,SAAS,cAAcc,cAAcM;IACzC,MAAM,CAACmB,QAAQC,UAAU,GAAGjC,SAAS;IACr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,IAAIjB,cAAc;oBACdA,aAAa0B,OAAO,GAAGT;gBAC3B;gBACAA,OAAOsD,oBAAoB,CAAC,IAAMpF;gBAClC8B,OAAOuD,mBAAmB,CAAC;oBACvB,mHAAmH;oBACnHC,WAAW;wBACP,IAAI,CAAC1C,kBAAkBL,OAAO,EAAE;4BAC5B,MAAMT,QAAQyD,UAAU,iCAAiCC;wBAC7D;oBACJ,GAAG;gBACP;YACJ;;uBAIR,KAACzH;QAAOoG,WAAWhF,kBAAkB2C,MAAM;kBACvC,cAAA,KAAC5D;;IAIT,qBACI,MAACE;QACG0F,SAAQ;QACRF,KAAI;QACJF,GAAG+B,KAAKC,GAAG,CAACtE,cAAc1B;QAC1BiG,KAAKlF;QACLY,KAAKA;QACJ,GAAGP,MAAM;;0BAEV,MAAC9C;gBAAM8F,SAAQ;;oBACVH;oBACAE;;;YAEJG;YACAP;;;AAGb,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import {\n Box,\n Center,\n Group,\n Input,\n InputWrapperProps,\n Loader,\n Space,\n Stack,\n StackProps,\n px,\n useMantineColorScheme,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {Monaco, loader} from '@monaco-editor/react';\nimport {MarkerSeverity, editor as monacoEditor} from 'monaco-editor';\nimport {FunctionComponent, useEffect, useRef, useState} from 'react';\n\nimport cx from 'clsx';\nimport {useParentHeight} from '../../hooks/useParentHeight.js';\nimport {CopyToClipboard} from '../CopyToClipboard/CopyToClipboard.js';\nimport CodeEditorClasses from './CodeEditor.module.css';\nimport {XML} from './languages/xml.js';\nimport {Search} from './search/Search.js';\ninterface CodeEditorProps\n extends\n Omit<InputWrapperProps, 'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'>,\n Omit<StackProps, 'onChange' | 'attributes'> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml' | (string & unknown);\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the search icon is clicked */\n onSearch?(): void;\n /** Called whenever the copy icon is clicked */\n onCopy?(): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /** Ref object that provides access to the editor's functionality */\n editorHandle?: React.MutableRefObject<monacoEditor.IStandaloneCodeEditor | null>;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n /**\n * Options to pass to the monaco editor.\n * Currently only supporting [`tabSize`](https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor.IStandaloneEditorConstructionOptions.html#tabSize).\n *\n */\n options?: Pick<monacoEditor.IStandaloneEditorConstructionOptions, 'tabSize'>;\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onCopy,\n onSearch,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n options: {tabSize} = {tabSize: 2},\n editorHandle,\n ...others\n } = useProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n const editorRef = useRef(null);\n\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n const registerThemes = (monaco: Monaco) => {\n monaco.editor.defineTheme('light', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': theme.colors.gray[0],\n },\n });\n };\n\n const handleSearch = () => {\n if (editorRef.current) {\n editorRef.current.focus();\n editorRef.current.trigger('editor', 'actions.find', '');\n onSearch?.();\n }\n };\n\n const [hasMonacoError, setHasMonacoError] = useState(false);\n const hasMonacoErrorRef = useRef(false);\n\n hasMonacoErrorRef.current = hasMonacoError;\n\n const hasError = !!error || hasMonacoError;\n const theme = useMantineTheme();\n const {colorScheme} = useMantineColorScheme();\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const handleValidate = (markers: monacoEditor.IMarker[]) => {\n setHasMonacoError(markers.some((marker) => marker.severity === MarkerSeverity.Error));\n };\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? <Input.Error {...errorProps}>{error}</Input.Error> : <Space h=\"sm\" />;\n\n const _header =\n _label || _description ? (\n <Stack gap=\"xxs\">\n {_label}\n {_description}\n </Stack>\n ) : null;\n\n const _buttons = (\n <Group justify=\"right\" gap=\"xs\">\n <Search handleSearch={handleSearch} />\n <CopyToClipboard value={_value} onCopy={() => onCopy?.()} />\n </Group>\n );\n let editorTheme = colorScheme === 'light' ? 'light' : 'vs-dark';\n if (disabled) {\n editorTheme += '-disabled';\n }\n\n const _editor = loaded ? (\n <Box\n p=\"md\"\n pl=\"xs\"\n className={cx(\n CodeEditorClasses.root,\n {[CodeEditorClasses.error]: hasError},\n {[CodeEditorClasses.disabled]: disabled},\n )}\n data-testid=\"editor-wrapper\"\n >\n <Editor\n onValidate={handleValidate}\n defaultLanguage={language}\n theme={editorTheme}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: px(theme.fontSizes.xs) as number,\n readOnly: disabled,\n stickyScroll: {enabled: false},\n tabSize,\n }}\n value={_value}\n onChange={handleChange}\n beforeMount={(monaco) => {\n registerLanguages(monaco);\n registerThemes(monaco);\n }}\n onMount={(editor) => {\n editorRef.current = editor;\n if (editorHandle) {\n editorHandle.current = editor;\n }\n editor.onDidFocusEditorText(() => onFocus?.());\n editor.onDidBlurEditorText(async () => {\n // monaco editor has a timeout of 500ms populating errors, we want to ensure that checking errors happen after that\n setTimeout(async () => {\n if (!hasMonacoErrorRef.current) {\n await editor?.getAction('editor.action.formatDocument')?.run();\n }\n }, 550);\n });\n }}\n />\n </Box>\n ) : (\n <Center className={CodeEditorClasses.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack\n justify=\"flex-start\"\n gap=\"sm\"\n h={Math.max(parentHeight, minHeight)}\n mah={maxHeight}\n ref={ref}\n {...others}\n >\n <Group justify=\"space-between\">\n {_header}\n {_buttons}\n </Group>\n {_editor}\n {_error}\n </Stack>\n );\n};\n\nCodeEditor.displayName = 'CodeEditor';\n"],"names":["Box","Center","Group","Input","Loader","Space","Stack","px","useMantineColorScheme","useMantineTheme","useProps","useUncontrolled","Editor","loader","MarkerSeverity","useEffect","useRef","useState","cx","useParentHeight","CopyToClipboard","CodeEditorClasses","XML","Search","defaultProps","language","monacoLoader","defaultValue","minHeight","CodeEditor","props","onChange","onCopy","onSearch","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","options","tabSize","editorHandle","others","loaded","setLoaded","_value","handleChange","finalValue","parentHeight","ref","editorRef","loadLocalMonaco","monacoInstance","config","monaco","registerLanguages","register","registerThemes","editor","defineTheme","base","inherit","rules","colors","theme","gray","handleSearch","current","focus","trigger","hasMonacoError","setHasMonacoError","hasMonacoErrorRef","hasError","colorScheme","handleValidate","markers","some","marker","severity","Error","_label","Label","_description","Description","_error","h","_header","gap","_buttons","justify","editorTheme","_editor","p","pl","className","root","data-testid","onValidate","defaultLanguage","minimap","enabled","wordWrap","scrollBeyondLastLine","formatOnPaste","fontSize","fontSizes","xs","readOnly","stickyScroll","beforeMount","onMount","onDidFocusEditorText","onDidBlurEditorText","setTimeout","getAction","run","Math","max","mah","displayName"],"mappings":";AAAA,SACIA,GAAG,EACHC,MAAM,EACNC,KAAK,EACLC,KAAK,EAELC,MAAM,EACNC,KAAK,EACLC,KAAK,EAELC,EAAE,EACFC,qBAAqB,EACrBC,eAAe,EACfC,QAAQ,QACL,gBAAgB;AACvB,SAAQC,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,UAAiBC,MAAM,QAAO,uBAAuB;AAC5D,SAAQC,cAAc,QAA+B,gBAAgB;AACrE,SAA2BC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAErE,OAAOC,QAAQ,OAAO;AACtB,SAAQC,eAAe,QAAO,iCAAiC;AAC/D,SAAQC,eAAe,QAAO,wCAAwC;AACtE,OAAOC,uBAAuB,0BAA0B;AACxD,SAAQC,GAAG,QAAO,qBAAqB;AACvC,SAAQC,MAAM,QAAO,qBAAqB;AAyD1C,MAAMC,eAAyC;IAC3CC,UAAU;IACVC,cAAc;IACdC,cAAc;IACdC,WAAW;AACf;AAEA,OAAO,MAAMC,aAAiD,CAACC;IAC3D,MAAM,EACFL,QAAQ,EACRE,YAAY,EACZI,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,QAAQ,EACRC,UA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BACtBC,eAAe;gBACfC,UAAUxG,GAAG+D,MAAM0C,SAAS,CAACC,EAAE;gBAC/BC,UAAUtE;gBACVuE,cAAc;oBAACR,SAAS;gBAAK;gBAC7B7D;YACJ;YACAX,OAAOgB;YACPpB,UAAUqB;YACVgE,aAAa,CAACxD;gBACVC,kBAAkBD;gBAClBG,eAAeH;YACnB;YACAyD,SAAS,CAACrD;gBACNR,UAAUiB,OAAO,GAAGT;gBACpB,IAAIjB,cAAc;oBACdA,aAAa0B,OAAO,GAAGT;gBAC3B;gBACAA,OAAOsD,oBAAoB,CAAC,IAAMpF;gBAClC8B,OAAOuD,mBAAmB,CAAC;oBACvB,mHAAmH;oBACnHC,WAAW;wBACP,IAAI,CAAC1C,kBAAkBL,OAAO,EAAE;4BAC5B,MAAMT,QAAQyD,UAAU,iCAAiCC;wBAC7D;oBACJ,GAAG;gBACP;YACJ;;uBAIR,KAACzH;QAAOoG,WAAWhF,kBAAkB2C,MAAM;kBACvC,cAAA,KAAC5D;;IAIT,qBACI,MAACE;QACG0F,SAAQ;QACRF,KAAI;QACJF,GAAG+B,KAAKC,GAAG,CAACtE,cAAc1B;QAC1BiG,KAAKlF;QACLY,KAAKA;QACJ,GAAGP,MAAM;;0BAEV,MAAC9C;gBAAM8F,SAAQ;;oBACVH;oBACAE;;;YAEJG;YACAP;;;AAGb,EAAE;AAEF9D,WAAWiG,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"sourcesContent":["import {BoxProps, factory, Factory, Group, GroupProps, StylesApiProps, Text, useProps, useStyles} from '@mantine/core';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nexport type LastUpdatedStylesNames = 'root' | 'label';\n\nexport interface LastUpdatedProps extends BoxProps, Pick<GroupProps, 'justify'>, StylesApiProps<LastUpdatedFactory> {\n /**\n * Optional formatter function to format the time value.\n * Receives the time prop and should return a string.\n * @default (time) => dayjs(time).format('h:mm:ss A')\n */\n formatter?: (time: dayjs.ConfigType) => string;\n /**\n * The unformatted time to display that can be parsed by dayjs.\n * @default The current time via dayjs().valueOf()\n */\n time?: dayjs.ConfigType;\n /**\n * Label to contextualize the time.\n *\n * @default \"Last update:\"\n */\n label?: string;\n}\n\nexport type LastUpdatedFactory = Factory<{\n props: LastUpdatedProps;\n ref: HTMLDivElement;\n stylesNames: LastUpdatedStylesNames;\n}>;\n\nconst defaultProps: Partial<LastUpdatedProps> = {\n label: 'Last update:',\n formatter: (time) => dayjs(time).format('h:mm:ss A'),\n};\n\nexport const LastUpdated = factory<LastUpdatedFactory>(\n (props: LastUpdatedProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const {formatter, label, time, classNames, className, styles, style, vars, unstyled, ...others} = useProps(\n 'PlasmaLastUpdated',\n defaultProps as Partial<LastUpdatedProps>,\n props,\n );\n\n const resolvedTime = time ?? dayjs().valueOf();\n\n const getStyles = useStyles<LastUpdatedFactory>({\n name: 'LastUpdated',\n classes: {},\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n return (\n <Group\n justify={props.justify}\n ref={ref}\n {...getStyles('root', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Text size=\"xs\" {...getStyles('label', {className, style, ...stylesApiProps})}>\n {label}\n <span role=\"timer\">{formatter(resolvedTime)}</span>\n </Text>\n </Group>\n );\n },\n);\n"],"names":["factory","Group","Text","useProps","useStyles","dayjs","React","defaultProps","label","formatter","time","format","LastUpdated","props","ref","classNames","className","styles","style","vars","unstyled","others","resolvedTime","valueOf","getStyles","name","classes","stylesApiProps","justify","size","span","role"],"mappings":";AAAA,SAAkBA,OAAO,EAAWC,KAAK,EAA8BC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,QAAO,gBAAgB;AACvH,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,WAAW,QAAQ;AA8B1B,MAAMC,eAA0C;IAC5CC,OAAO;IACPC,WAAW,CAACC,OAASL,MAAMK,MAAMC,MAAM,CAAC;AAC5C;AAEA,OAAO,MAAMC,cAAcZ,QACvB,CAACa,OAAyBC;IACtB,MAAM,EAACL,SAAS,EAAED,KAAK,EAAEE,IAAI,EAAEK,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,QAAO,GAAGlB,SAC9F,qBACAI,cACAM;IAGJ,MAAMS,eAAeZ,QAAQL,QAAQkB,OAAO;IAE5C,MAAMC,YAAYpB,UAA8B;QAC5CqB,MAAM;QACNC,SAAS,CAAC;QACVb;QACAG;QACAE;QACAH;QACAE;QACAG;QACAD;IACJ;IACA,MAAMQ,iBAAiB;QAACZ;QAAYE;IAAM;IAE1C,qBACI,KAAChB;QACG2B,SAASf,MAAMe,OAAO;QACtBd,KAAKA;QACJ,GAAGU,UAAU,QAAQ;YAACR;YAAWE;YAAO,GAAGS,cAAc;QAAA,EAAE;QAC3D,GAAGN,MAAM;kBAEV,cAAA,MAACnB;YAAK2B,MAAK;YAAM,GAAGL,UAAU,SAAS;gBAACR;gBAAWE;gBAAO,GAAGS,cAAc;YAAA,EAAE;;gBACxEnB;8BACD,KAACsB;oBAAKC,MAAK;8BAAStB,UAAUa;;;;;AAI9C,GACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"sourcesContent":["import {BoxProps, factory, Factory, Group, GroupProps, StylesApiProps, Text, useProps, useStyles} from '@mantine/core';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nexport type LastUpdatedStylesNames = 'root' | 'label';\n\nexport interface LastUpdatedProps extends BoxProps, Pick<GroupProps, 'justify'>, StylesApiProps<LastUpdatedFactory> {\n /**\n * Optional formatter function to format the time value.\n * Receives the time prop and should return a string.\n * @default (time) => dayjs(time).format('h:mm:ss A')\n */\n formatter?: (time: dayjs.ConfigType) => string;\n /**\n * The unformatted time to display that can be parsed by dayjs.\n * @default The current time via dayjs().valueOf()\n */\n time?: dayjs.ConfigType;\n /**\n * Label to contextualize the time.\n *\n * @default \"Last update:\"\n */\n label?: string;\n}\n\nexport type LastUpdatedFactory = Factory<{\n props: LastUpdatedProps;\n ref: HTMLDivElement;\n stylesNames: LastUpdatedStylesNames;\n}>;\n\nconst defaultProps: Partial<LastUpdatedProps> = {\n label: 'Last update:',\n formatter: (time) => dayjs(time).format('h:mm:ss A'),\n};\n\nexport const LastUpdated = factory<LastUpdatedFactory>(\n (props: LastUpdatedProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const {formatter, label, time, classNames, className, styles, style, vars, unstyled, ...others} = useProps(\n 'PlasmaLastUpdated',\n defaultProps as Partial<LastUpdatedProps>,\n props,\n );\n\n const resolvedTime = time ?? dayjs().valueOf();\n\n const getStyles = useStyles<LastUpdatedFactory>({\n name: 'LastUpdated',\n classes: {},\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n return (\n <Group\n justify={props.justify}\n ref={ref}\n {...getStyles('root', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Text size=\"xs\" {...getStyles('label', {className, style, ...stylesApiProps})}>\n {label}\n <span role=\"timer\">{formatter(resolvedTime)}</span>\n </Text>\n </Group>\n );\n },\n);\n\nLastUpdated.displayName = 'LastUpdated';\n"],"names":["factory","Group","Text","useProps","useStyles","dayjs","React","defaultProps","label","formatter","time","format","LastUpdated","props","ref","classNames","className","styles","style","vars","unstyled","others","resolvedTime","valueOf","getStyles","name","classes","stylesApiProps","justify","size","span","role","displayName"],"mappings":";AAAA,SAAkBA,OAAO,EAAWC,KAAK,EAA8BC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,QAAO,gBAAgB;AACvH,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,WAAW,QAAQ;AA8B1B,MAAMC,eAA0C;IAC5CC,OAAO;IACPC,WAAW,CAACC,OAASL,MAAMK,MAAMC,MAAM,CAAC;AAC5C;AAEA,OAAO,MAAMC,cAAcZ,QACvB,CAACa,OAAyBC;IACtB,MAAM,EAACL,SAAS,EAAED,KAAK,EAAEE,IAAI,EAAEK,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,QAAO,GAAGlB,SAC9F,qBACAI,cACAM;IAGJ,MAAMS,eAAeZ,QAAQL,QAAQkB,OAAO;IAE5C,MAAMC,YAAYpB,UAA8B;QAC5CqB,MAAM;QACNC,SAAS,CAAC;QACVb;QACAG;QACAE;QACAH;QACAE;QACAG;QACAD;IACJ;IACA,MAAMQ,iBAAiB;QAACZ;QAAYE;IAAM;IAE1C,qBACI,KAAChB;QACG2B,SAASf,MAAMe,OAAO;QACtBd,KAAKA;QACJ,GAAGU,UAAU,QAAQ;YAACR;YAAWE;YAAO,GAAGS,cAAc;QAAA,EAAE;QAC3D,GAAGN,MAAM;kBAEV,cAAA,MAACnB;YAAK2B,MAAK;YAAM,GAAGL,UAAU,SAAS;gBAACR;gBAAWE;gBAAO,GAAGS,cAAc;YAAA,EAAE;;gBACxEnB;8BACD,KAACsB;oBAAKC,MAAK;8BAAStB,UAAUa;;;;;AAI9C,GACF;AAEFV,YAAYoB,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/StickyFooter/StickyFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAS,UAAU,EAAE,cAAc,EAA+B,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,MAAM,WAAW,iBACb,SAAQ,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"StickyFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/StickyFooter/StickyFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAS,UAAU,EAAE,cAAc,EAA+B,MAAM,eAAe,CAAC;AAEvG,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,MAAM,WAAW,iBACb,SAAQ,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC;IAC3G;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;CACxC;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;IACtC,KAAK,EAAE,iBAAiB,CAAC;IACzB,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,uBAAuB,CAAC;CACxC,CAAC,CAAC;AAOH,eAAO,MAAM,YAAY;WAVd,iBAAiB;SACnB,cAAc;iBACN,uBAAuB;EAoCtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/StickyFooter/StickyFooter.tsx"],"sourcesContent":["import {Factory, Group, GroupProps, StylesApiProps, factory, useProps, useStyles} from '@mantine/core';\nimport clsx from 'clsx';\nimport {ReactNode} from 'react';\nimport classes from './StickyFooter.module.css';\n\nexport interface StickyFooterProps\n extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'variant'
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/StickyFooter/StickyFooter.tsx"],"sourcesContent":["import {Factory, Group, GroupProps, StylesApiProps, factory, useProps, useStyles} from '@mantine/core';\nimport clsx from 'clsx';\nimport {ReactNode} from 'react';\nimport classes from './StickyFooter.module.css';\n\nexport interface StickyFooterProps\n extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'variant'>, StylesApiProps<StickyFooterFactory> {\n /**\n * Whether a border is render on top of the footer\n */\n borderTop?: boolean;\n /**\n * Footer's children, usually buttons\n */\n children?: ReactNode;\n /**\n * Use variant 'modal-footer' when rendering the `StickyFooter` inside `Modal`.\n *\n * The 'modal-footer' removes the modal's default padding so that the footer properly hugs the bottom of the modal.\n * It also adds a border on top of the footer.\n *\n * @deprecated Use Modal.Footer from @coveord/plasma-mantine/Modal for modal footers. For other cases, the 'default' variant should suffice.\n */\n variant?: 'default' | 'modal-footer';\n}\n\nexport type StickyFooterStylesNames = 'root';\n\nexport type StickyFooterFactory = Factory<{\n props: StickyFooterProps;\n ref: HTMLDivElement;\n stylesNames: StickyFooterStylesNames;\n}>;\n\nconst defaultProps: Partial<StickyFooterProps> = {\n gap: 'sm',\n justify: 'flex-end',\n};\n\nexport const StickyFooter = factory<StickyFooterFactory>((props, ref) => {\n const {borderTop, justify, gap, children, className, classNames, style, styles, unstyled, vars, ...others} =\n useProps('StickyFooter', defaultProps, props);\n const getStyles = useStyles<StickyFooterFactory>({\n name: 'StickyFooter',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n });\n\n const css = getStyles('root');\n\n return (\n <Group\n justify={justify}\n gap={gap}\n className={clsx(css.className, {[classes.border]: !!borderTop})}\n style={css.style}\n ref={ref}\n {...others}\n >\n {children}\n </Group>\n );\n});\n\nStickyFooter.displayName = 'StickyFooter';\n"],"names":["Group","factory","useProps","useStyles","clsx","classes","defaultProps","gap","justify","StickyFooter","props","ref","borderTop","children","className","classNames","style","styles","unstyled","vars","others","getStyles","name","css","border","displayName"],"mappings":";AAAA,SAAiBA,KAAK,EAA8BC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAO,gBAAgB;AACvG,OAAOC,UAAU,OAAO;AAExB,OAAOC,aAAa,4BAA4B;AA+BhD,MAAMC,eAA2C;IAC7CC,KAAK;IACLC,SAAS;AACb;AAEA,OAAO,MAAMC,eAAeR,QAA6B,CAACS,OAAOC;IAC7D,MAAM,EAACC,SAAS,EAAEJ,OAAO,EAAED,GAAG,EAAEM,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,QAAO,GACtGlB,SAAS,gBAAgBI,cAAcI;IAC3C,MAAMW,YAAYlB,UAA+B;QAC7CmB,MAAM;QACNjB;QACAK;QACAI;QACAE;QACAD;QACAE;QACAC;IACJ;IAEA,MAAMK,MAAMF,UAAU;IAEtB,qBACI,KAACrB;QACGQ,SAASA;QACTD,KAAKA;QACLO,WAAWV,KAAKmB,IAAIT,SAAS,EAAE;YAAC,CAACT,QAAQmB,MAAM,CAAC,EAAE,CAAC,CAACZ;QAAS;QAC7DI,OAAOO,IAAIP,KAAK;QAChBL,KAAKA;QACJ,GAAGS,MAAM;kBAETP;;AAGb,GAAG;AAEHJ,aAAagB,WAAW,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveord/plasma-mantine",
|
|
3
|
-
"version": "56.
|
|
3
|
+
"version": "56.18.0",
|
|
4
4
|
"description": "A Plasma flavoured Mantine theme",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plasma",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"fast-deep-equal": "3.1.3",
|
|
82
82
|
"lodash.defaultsdeep": "4.6.1",
|
|
83
83
|
"monaco-editor": "0.55.1",
|
|
84
|
-
"@coveord/plasma-
|
|
85
|
-
"@coveord/plasma-
|
|
84
|
+
"@coveord/plasma-tokens": "56.8.1",
|
|
85
|
+
"@coveord/plasma-react-icons": "56.18.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@mantine/carousel": "8.3.10",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ActionIcon as MantineActionIcon,
|
|
3
2
|
ActionIconCssVariables,
|
|
4
|
-
type ActionIconGroup,
|
|
5
|
-
type ActionIconProps as MantineActionIconProps,
|
|
6
3
|
ActionIconStylesNames,
|
|
7
4
|
ActionIconVariant,
|
|
8
5
|
Factory,
|
|
6
|
+
ActionIcon as MantineActionIcon,
|
|
9
7
|
polymorphicFactory,
|
|
8
|
+
type ActionIconGroup,
|
|
9
|
+
type ActionIconProps as MantineActionIconProps,
|
|
10
10
|
} from '@mantine/core';
|
|
11
|
-
import {MouseEventHandler} from 'react';
|
|
11
|
+
import {ComponentType, MouseEventHandler} from 'react';
|
|
12
12
|
import {useClickWithLoading} from '../../hooks/useClickWithLoading.js';
|
|
13
13
|
import {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from '../Button/ButtonWithDisabledTooltip.js';
|
|
14
14
|
|
|
@@ -93,3 +93,14 @@ ActionIcon.DestructivePrimary = ActionIconDestructive;
|
|
|
93
93
|
ActionIcon.DestructiveSecondary = ActionIconDestructiveSecondary;
|
|
94
94
|
ActionIcon.DestructiveTertiary = ActionIconDestructiveTertiary;
|
|
95
95
|
ActionIcon.DestructiveQuaternary = ActionIconDestructiveQuaternary;
|
|
96
|
+
|
|
97
|
+
ActionIcon.displayName = 'ActionIcon';
|
|
98
|
+
ActionIcon.Group.displayName = 'ActionIcon.Group';
|
|
99
|
+
(ActionIconPrimary as ComponentType).displayName = 'ActionIcon.Primary';
|
|
100
|
+
(ActionIconSecondary as ComponentType).displayName = 'ActionIcon.Secondary';
|
|
101
|
+
(ActionIconTertiary as ComponentType).displayName = 'ActionIcon.Tertiary';
|
|
102
|
+
(ActionIconQuaternary as ComponentType).displayName = 'ActionIcon.Quaternary';
|
|
103
|
+
(ActionIconDestructive as ComponentType).displayName = 'ActionIcon.DestructivePrimary';
|
|
104
|
+
(ActionIconDestructiveSecondary as ComponentType).displayName = 'ActionIcon.DestructiveSecondary';
|
|
105
|
+
(ActionIconDestructiveTertiary as ComponentType).displayName = 'ActionIcon.DestructiveTertiary';
|
|
106
|
+
(ActionIconDestructiveQuaternary as ComponentType).displayName = 'ActionIcon.DestructiveQuaternary';
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Alert as MantineAlert,
|
|
8
8
|
polymorphicFactory,
|
|
9
9
|
} from '@mantine/core';
|
|
10
|
+
import {type ComponentType} from 'react';
|
|
10
11
|
import {InfoToken} from '../InfoToken/InfoToken.js';
|
|
11
12
|
|
|
12
13
|
type AlertOverloadFactory = Factory<{
|
|
@@ -25,6 +26,7 @@ type AlertOverloadFactory = Factory<{
|
|
|
25
26
|
}>;
|
|
26
27
|
|
|
27
28
|
export const Alert = polymorphicFactory<AlertOverloadFactory>((props, ref) => <MantineAlert {...props} ref={ref} />);
|
|
29
|
+
Alert.displayName = 'Alert';
|
|
28
30
|
|
|
29
31
|
const AlertInformation = Alert.withProps({
|
|
30
32
|
color: 'gray',
|
|
@@ -36,6 +38,7 @@ const AlertInformation = Alert.withProps({
|
|
|
36
38
|
},
|
|
37
39
|
}),
|
|
38
40
|
});
|
|
41
|
+
(AlertInformation as ComponentType).displayName = 'Alert.Information';
|
|
39
42
|
|
|
40
43
|
const AlertAdvice = Alert.withProps({
|
|
41
44
|
icon: <InfoToken variant="advice" />,
|
|
@@ -46,6 +49,7 @@ const AlertAdvice = Alert.withProps({
|
|
|
46
49
|
},
|
|
47
50
|
}),
|
|
48
51
|
});
|
|
52
|
+
(AlertAdvice as ComponentType).displayName = 'Alert.Advice';
|
|
49
53
|
|
|
50
54
|
const AlertWarning = Alert.withProps({
|
|
51
55
|
color: 'warning',
|
|
@@ -57,6 +61,8 @@ const AlertWarning = Alert.withProps({
|
|
|
57
61
|
},
|
|
58
62
|
}),
|
|
59
63
|
});
|
|
64
|
+
(AlertWarning as ComponentType).displayName = 'Alert.Warning';
|
|
65
|
+
|
|
60
66
|
const AlertCritical = Alert.withProps({
|
|
61
67
|
icon: <InfoToken variant="error" />,
|
|
62
68
|
vars: () => ({
|
|
@@ -66,6 +72,7 @@ const AlertCritical = Alert.withProps({
|
|
|
66
72
|
},
|
|
67
73
|
}),
|
|
68
74
|
});
|
|
75
|
+
(AlertCritical as ComponentType).displayName = 'Alert.Critical';
|
|
69
76
|
|
|
70
77
|
Alert.Information = AlertInformation;
|
|
71
78
|
Alert.Advice = AlertAdvice;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ButtonProps as MantineButtonProps,
|
|
9
9
|
polymorphicFactory,
|
|
10
10
|
} from '@mantine/core';
|
|
11
|
-
import {MouseEventHandler} from 'react';
|
|
11
|
+
import {ComponentType, MouseEventHandler} from 'react';
|
|
12
12
|
import {useClickWithLoading} from '../../hooks/useClickWithLoading.js';
|
|
13
13
|
import {ButtonWithDisabledTooltip, ButtonWithDisabledTooltipProps} from './ButtonWithDisabledTooltip.js';
|
|
14
14
|
|
|
@@ -99,6 +99,7 @@ const ButtonDestructiveTertiary = Button.withProps({
|
|
|
99
99
|
const ButtonDestructiveQuaternary = Button.withProps({variant: 'subtle', color: 'var(--mantine-color-error)'});
|
|
100
100
|
|
|
101
101
|
Button.Group = MantineButton.Group;
|
|
102
|
+
Button.Group.displayName = 'Button.Group';
|
|
102
103
|
Button.Primary = ButtonPrimary;
|
|
103
104
|
Button.Secondary = ButtonSecondary;
|
|
104
105
|
Button.Tertiary = ButtonTertiary;
|
|
@@ -107,3 +108,13 @@ Button.DestructivePrimary = ButtonDestructive;
|
|
|
107
108
|
Button.DestructiveSecondary = ButtonDestructiveSecondary;
|
|
108
109
|
Button.DestructiveTertiary = ButtonDestructiveTertiary;
|
|
109
110
|
Button.DestructiveQuaternary = ButtonDestructiveQuaternary;
|
|
111
|
+
(ButtonPrimary as ComponentType).displayName = 'Button.Primary';
|
|
112
|
+
(ButtonSecondary as ComponentType).displayName = 'Button.Secondary';
|
|
113
|
+
(ButtonTertiary as ComponentType).displayName = 'Button.Tertiary';
|
|
114
|
+
(ButtonQuaternary as ComponentType).displayName = 'Button.Quaternary';
|
|
115
|
+
(ButtonDestructive as ComponentType).displayName = 'Button.DestructivePrimary';
|
|
116
|
+
(ButtonDestructiveSecondary as ComponentType).displayName = 'Button.DestructiveSecondary';
|
|
117
|
+
(ButtonDestructiveTertiary as ComponentType).displayName = 'Button.DestructiveTertiary';
|
|
118
|
+
(ButtonDestructiveQuaternary as ComponentType).displayName = 'Button.DestructiveQuaternary';
|
|
119
|
+
|
|
120
|
+
Button.displayName = 'Button';
|
|
@@ -25,10 +25,8 @@ import CodeEditorClasses from './CodeEditor.module.css';
|
|
|
25
25
|
import {XML} from './languages/xml.js';
|
|
26
26
|
import {Search} from './search/Search.js';
|
|
27
27
|
interface CodeEditorProps
|
|
28
|
-
extends
|
|
29
|
-
|
|
30
|
-
'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'
|
|
31
|
-
>,
|
|
28
|
+
extends
|
|
29
|
+
Omit<InputWrapperProps, 'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'>,
|
|
32
30
|
Omit<StackProps, 'onChange' | 'attributes'> {
|
|
33
31
|
/**
|
|
34
32
|
* The language syntax of the editor
|
|
@@ -278,3 +276,5 @@ export const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {
|
|
|
278
276
|
</Stack>
|
|
279
277
|
);
|
|
280
278
|
};
|
|
279
|
+
|
|
280
|
+
CodeEditor.displayName = 'CodeEditor';
|
|
@@ -4,8 +4,7 @@ import {ReactNode} from 'react';
|
|
|
4
4
|
import classes from './StickyFooter.module.css';
|
|
5
5
|
|
|
6
6
|
export interface StickyFooterProps
|
|
7
|
-
extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'variant'>,
|
|
8
|
-
StylesApiProps<StickyFooterFactory> {
|
|
7
|
+
extends Omit<GroupProps, 'classNames' | 'styles' | 'vars' | 'variant'>, StylesApiProps<StickyFooterFactory> {
|
|
9
8
|
/**
|
|
10
9
|
* Whether a border is render on top of the footer
|
|
11
10
|
*/
|
|
@@ -67,3 +66,5 @@ export const StickyFooter = factory<StickyFooterFactory>((props, ref) => {
|
|
|
67
66
|
</Group>
|
|
68
67
|
);
|
|
69
68
|
});
|
|
69
|
+
|
|
70
|
+
StickyFooter.displayName = 'StickyFooter';
|