@coveord/plasma-mantine 58.0.1 → 58.0.2
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 +106 -101
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/LastUpdated/LastUpdated.d.ts.map +1 -1
- package/dist/cjs/components/LastUpdated/LastUpdated.js +0 -1
- package/dist/cjs/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/cjs/components/Modal/ModalFooter.module.css +1 -0
- package/dist/cjs/components/Prompt/Prompt.d.ts +3 -3
- package/dist/cjs/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/cjs/components/Prompt/Prompt.js +6 -6
- package/dist/cjs/components/Prompt/Prompt.js.map +1 -1
- package/dist/cjs/styles/Modal.module.css +13 -0
- package/dist/esm/components/LastUpdated/LastUpdated.d.ts.map +1 -1
- package/dist/esm/components/LastUpdated/LastUpdated.js +0 -1
- package/dist/esm/components/LastUpdated/LastUpdated.js.map +1 -1
- package/dist/esm/components/Modal/ModalFooter.module.css +1 -0
- package/dist/esm/components/Prompt/Prompt.d.ts +3 -3
- package/dist/esm/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/esm/components/Prompt/Prompt.js +7 -8
- package/dist/esm/components/Prompt/Prompt.js.map +1 -1
- package/dist/esm/styles/Modal.module.css +13 -0
- package/package.json +5 -5
- package/src/components/LastUpdated/LastUpdated.tsx +34 -36
- package/src/components/Modal/ModalFooter.module.css +1 -0
- package/src/components/Prompt/Prompt.tsx +14 -6
- package/src/styles/Modal.module.css +13 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastUpdated.d.ts","sourceRoot":"","sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAW,OAAO,EAAS,UAAU,EAAE,cAAc,EAA4B,MAAM,eAAe,CAAC;AACvH,OA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AM,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACrC,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,sBAAsB,CAAC;CACvC,CAAC,CAAC;AAOH,eAAO,MAAM,WAAW;WAVb,gBAAgB;SAClB,cAAc;iBACN,sBAAsB;EA2CrC,CAAC"}
|
|
@@ -15,7 +15,6 @@ var _object_without_properties = require("@swc/helpers/_/_object_without_propert
|
|
|
15
15
|
var _jsxruntime = require("react/jsx-runtime");
|
|
16
16
|
var _core = require("@mantine/core");
|
|
17
17
|
var _dayjs = /*#__PURE__*/ _interop_require_default._(require("dayjs"));
|
|
18
|
-
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
19
18
|
var defaultProps = {
|
|
20
19
|
label: 'Last update:',
|
|
21
20
|
formatter: function formatter(time) {
|
|
@@ -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
|
|
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 {ForwardedRef} 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>((props: LastUpdatedProps, ref: 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\nLastUpdated.displayName = 'LastUpdated';\n"],"names":["LastUpdated","defaultProps","label","formatter","time","dayjs","format","factory","props","ref","useProps","classNames","className","styles","style","vars","unstyled","others","resolvedTime","valueOf","getStyles","useStyles","name","classes","stylesApiProps","Group","justify","Text","size","span","role","displayName"],"mappings":";;;;+BAqCaA;;;eAAAA;;;;;;;;oBArC0F;8DACrF;AA+BlB,IAAMC,eAA0C;IAC5CC,OAAO;IACPC,WAAW,SAAXA,UAAYC;eAASC,IAAAA,cAAK,EAACD,MAAME,MAAM,CAAC;;AAC5C;AAEO,IAAMN,cAAcO,IAAAA,aAAO,EAAqB,SAACC,OAAyBC;IAC7E,IAAkGC,YAAAA,IAAAA,cAAQ,EACtG,qBACAT,cACAO,QAHGL,YAA2FO,UAA3FP,WAAWD,QAAgFQ,UAAhFR,OAAOE,OAAyEM,UAAzEN,MAAMO,aAAmED,UAAnEC,YAAYC,YAAuDF,UAAvDE,WAAWC,SAA4CH,UAA5CG,QAAQC,QAAoCJ,UAApCI,OAAOC,OAA6BL,UAA7BK,MAAMC,WAAuBN,UAAvBM,UAAaC,sCAAUP;;;;;;;;;;;IAMlG,IAAMQ,eAAed,iBAAAA,kBAAAA,OAAQC,IAAAA,cAAK,IAAGc,OAAO;IAE5C,IAAMC,YAAYC,IAAAA,eAAS,EAAqB;QAC5CC,MAAM;QACNC,SAAS,CAAC;QACVf,OAAAA;QACAI,WAAAA;QACAE,OAAAA;QACAH,YAAAA;QACAE,QAAAA;QACAG,UAAAA;QACAD,MAAAA;IACJ;IACA,IAAMS,iBAAiB;QAACb,YAAAA;QAAYE,QAAAA;IAAM;IAE1C,qBACI,qBAACY,WAAK;QACFC,SAASlB,MAAMkB,OAAO;QACtBjB,KAAKA;OACDW,UAAU,QAAQ;QAACR,WAAAA;QAAWE,OAAAA;OAAUU,kBACxCP;kBAEJ,cAAA,sBAACU,UAAI;YAACC,MAAK;WAASR,UAAU,SAAS;YAACR,WAAAA;YAAWE,OAAAA;WAAUU;;gBACxDtB;8BACD,qBAAC2B;oBAAKC,MAAK;8BAAS3B,UAAUe;;;;;AAI9C;AAEAlB,YAAY+B,WAAW,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Factory, ModalRootProps, ModalStylesNames, StylesApiProps } from '@mantine/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
3
3
|
import { PromptCancelButtonStylesNamesVariant } from './PromptCancelButton.js';
|
|
4
4
|
import { PromptConfirmButtonStylesNamesVariant } from './PromptConfirmButton.js';
|
|
5
5
|
export type PromptVariant = 'success' | 'warning' | 'critical' | 'information';
|
|
@@ -22,7 +22,7 @@ export type PromptFactory = Factory<{
|
|
|
22
22
|
variant: PromptVariant;
|
|
23
23
|
stylesNames: PromptStylesNames;
|
|
24
24
|
}>;
|
|
25
|
-
type PromptCompoundComponent =
|
|
25
|
+
type PromptCompoundComponent = ForwardRefExoticComponent<PromptProps & RefAttributes<HTMLDivElement>>;
|
|
26
26
|
export declare const Prompt: {
|
|
27
27
|
readonly Information: PromptCompoundComponent;
|
|
28
28
|
readonly Success: PromptCompoundComponent;
|
|
@@ -40,7 +40,7 @@ export declare const Prompt: {
|
|
|
40
40
|
stylesNames: PromptConfirmButtonStylesNamesVariant;
|
|
41
41
|
compound: true;
|
|
42
42
|
}>;
|
|
43
|
-
readonly Footer: FunctionComponent<import("../Modal/ModalFooter.js").ModalFooterProps &
|
|
43
|
+
readonly Footer: import("react").FunctionComponent<import("../Modal/ModalFooter.js").ModalFooterProps & RefAttributes<HTMLDivElement> & {
|
|
44
44
|
component?: any;
|
|
45
45
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
46
46
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/Prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/Prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,cAAc,EAIjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKH,yBAAyB,EAEzB,SAAS,EACT,aAAa,EAChB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAqB,oCAAoC,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAsB,qCAAqC,EAAC,MAAM,0BAA0B,CAAC;AAEpG,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAC/E,MAAM,MAAM,UAAU,GAAG;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAC,CAAC;AACtD,MAAM,MAAM,iBAAiB,GACvB,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAClC,MAAM,GACN,oCAAoC,GACpC,qCAAqC,CAAC;AAE5C,KAAK,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,CAAC;AAE3E,MAAM,WAAW,WACb,SAAQ,oBAAoB,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAC/G,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,mBAAoB,SAAQ,WAAW;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;IAChC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC;CAClC,CAAC,CAAC;AAiFH,KAAK,uBAAuB,GAAG,yBAAyB,CAAC,WAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;AAatG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAQT,CAAC"}
|
|
@@ -97,12 +97,12 @@ var _Prompt = (0, _core.factory)(function(_props, ref) {
|
|
|
97
97
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Modal.Modal.CloseButton, _object_spread._({}, getStyles('close', stylesApiProps)))
|
|
98
98
|
]
|
|
99
99
|
})),
|
|
100
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
|
101
|
-
children:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Modal.Modal.Body, _object_spread_props._(_object_spread._({}, getStyles('body', stylesApiProps)), {
|
|
101
|
+
children: [
|
|
102
|
+
otherChildren,
|
|
103
|
+
footers
|
|
104
|
+
]
|
|
105
|
+
}))
|
|
106
106
|
]
|
|
107
107
|
}))
|
|
108
108
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Prompt/Prompt.tsx"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Prompt/Prompt.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n ModalRootProps,\n ModalStylesNames,\n StylesApiProps,\n Title,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {\n Children,\n ComponentProps,\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n RefAttributes,\n} from 'react';\nimport {InfoToken} from '../InfoToken/InfoToken.js';\nimport {Modal} from '../Modal/Modal.js';\nimport {PromptContextProvider} from './Prompt.context.js';\nimport classes from './Prompt.module.css';\nimport {PromptCancelButton, PromptCancelButtonStylesNamesVariant} from './PromptCancelButton.js';\nimport {PromptConfirmButton, PromptConfirmButtonStylesNamesVariant} from './PromptConfirmButton.js';\n\nexport type PromptVariant = 'success' | 'warning' | 'critical' | 'information';\nexport type PromptVars = {root: '--prompt-icon-size'};\nexport type PromptStylesNames =\n | Exclude<ModalStylesNames, 'title'>\n | 'icon'\n | PromptCancelButtonStylesNamesVariant\n | PromptConfirmButtonStylesNamesVariant;\n\ntype PromptStylesApiProps = Omit<StylesApiProps<PromptFactory>, 'variant'>;\n\nexport interface PromptProps\n extends PromptStylesApiProps, Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes' | 'variant'> {\n children: ReactNode;\n title: ReactNode;\n}\n\ninterface PromptInternalProps extends PromptProps {\n variant?: PromptVariant;\n}\n\nexport type PromptFactory = Factory<{\n props: PromptInternalProps;\n ref: HTMLDivElement;\n vars: PromptVars;\n variant: PromptVariant;\n stylesNames: PromptStylesNames;\n}>;\n\nconst PromptVariantIconsMapping: Record<PromptVariant, typeof InfoToken.Information> = {\n success: InfoToken.Success,\n warning: InfoToken.Warning,\n critical: InfoToken.Error,\n information: InfoToken.Information,\n};\n\nconst defaultProps: Partial<PromptInternalProps> = {\n variant: 'information',\n centered: true,\n};\n\nconst _Prompt = factory<PromptFactory>((_props, ref) => {\n const props = useProps('Prompt', defaultProps, _props);\n const {\n variant,\n title,\n children,\n className,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n attributes: _attributes,\n ...others\n } = props;\n const getStyles = useStyles<PromptFactory>({\n name: 'Prompt',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n const footers: ReactElement[] = [];\n const otherChildren: ReactElement[] = [];\n\n Children.forEach(children, (child: ReactElement) => {\n (child.type === PromptFooter ? footers : otherChildren).push(child);\n });\n\n const IconComponent = PromptVariantIconsMapping[variant];\n\n return (\n <PromptContextProvider value={{variant, getStyles}}>\n <Modal.Root ref={ref} variant=\"prompt\" size=\"sm\" {...others} {...getStyles('root')}>\n <Modal.Overlay {...getStyles('overlay', stylesApiProps)} />\n <Modal.Content {...getStyles('content', stylesApiProps)}>\n <Modal.Header {...getStyles('header', stylesApiProps)}>\n <IconComponent\n {...getStyles('icon', stylesApiProps)}\n variant=\"light\"\n size=\"sm\"\n aria-label={variant}\n />\n <Modal.Title>\n <Title order={3} component=\"div\">\n {title}\n </Title>\n </Modal.Title>\n <Modal.CloseButton {...getStyles('close', stylesApiProps)} />\n </Modal.Header>\n <Modal.Body {...getStyles('body', stylesApiProps)}>\n {otherChildren}\n {footers}\n </Modal.Body>\n </Modal.Content>\n </Modal.Root>\n </PromptContextProvider>\n );\n});\n_Prompt.displayName = 'Prompt';\n\ntype PromptCompoundComponent = ForwardRefExoticComponent<PromptProps & RefAttributes<HTMLDivElement>>;\n\nconst PromptFooter: ComponentType<ComponentProps<typeof Modal.Footer>> = (props) => <Modal.Footer {...props} />;\nPromptFooter.displayName = 'Prompt.Footer';\n\nconst createPromptCompound = (variant: PromptVariant, displayName: string) => {\n const Component = forwardRef<HTMLDivElement, PromptProps>((props, ref) => (\n <_Prompt ref={ref} {...props} variant={variant} />\n ));\n Component.displayName = displayName;\n return Component as PromptCompoundComponent;\n};\n\nexport const Prompt = {\n Information: createPromptCompound('information', 'Prompt.Information'),\n Success: createPromptCompound('success', 'Prompt.Success'),\n Warning: createPromptCompound('warning', 'Prompt.Warning'),\n Critical: createPromptCompound('critical', 'Prompt.Critical'),\n CancelButton: PromptCancelButton,\n ConfirmButton: PromptConfirmButton,\n Footer: PromptFooter,\n} as const;\n"],"names":["Prompt","PromptVariantIconsMapping","success","InfoToken","Success","warning","Warning","critical","Error","information","Information","defaultProps","variant","centered","_Prompt","factory","_props","ref","props","useProps","title","children","className","classNames","style","styles","unstyled","vars","attributes","_attributes","others","getStyles","useStyles","name","classes","stylesApiProps","footers","otherChildren","Children","forEach","child","type","PromptFooter","push","IconComponent","PromptContextProvider","value","Modal","Root","size","Overlay","Content","Header","aria-label","Title","order","component","CloseButton","Body","displayName","Footer","createPromptCompound","Component","forwardRef","Critical","CancelButton","PromptCancelButton","ConfirmButton","PromptConfirmButton"],"mappings":";;;;+BAmJaA;;;eAAAA;;;;;;;;oBA1IN;qBAUA;yBACiB;qBACJ;6BACgB;wEAChB;kCACmD;mCACE;AA8BzE,IAAMC,4BAAiF;IACnFC,SAASC,oBAAS,CAACC,OAAO;IAC1BC,SAASF,oBAAS,CAACG,OAAO;IAC1BC,UAAUJ,oBAAS,CAACK,KAAK;IACzBC,aAAaN,oBAAS,CAACO,WAAW;AACtC;AAEA,IAAMC,eAA6C;IAC/CC,SAAS;IACTC,UAAU;AACd;AAEA,IAAMC,UAAUC,IAAAA,aAAO,EAAgB,SAACC,QAAQC;IAC5C,IAAMC,QAAQC,IAAAA,cAAQ,EAAC,UAAUR,cAAcK;IAC/C,IACIJ,UAWAM,MAXAN,SACAQ,QAUAF,MAVAE,OACAC,WASAH,MATAG,UACAC,YAQAJ,MARAI,W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AACW,IAAI,8CAAK3B,UAAU,QAAQI;;gCAC7BE;gCACAD;;;;;;;;AAMzB;AACAtB,QAAQ6C,WAAW,GAAG;AAItB,IAAMjB,eAAmE,sBAACxB;yBAAU,qBAAC6B,YAAK,CAACa,MAAM,uBAAK1C;;AACtGwB,aAAaiB,WAAW,GAAG;AAE3B,IAAME,uBAAuB,8BAACjD,SAAwB+C;IAClD,IAAMG,0BAAYC,IAAAA,iBAAU,EAA8B,SAAC7C,OAAOD;6BAC9D,qBAACH;YAAQG,KAAKA;WAASC;YAAON,SAASA;;;IAE3CkD,UAAUH,WAAW,GAAGA;IACxB,OAAOG;AACX;AAEO,IAAM9D,SAAS;IAClBU,aAAamD,qBAAqB,eAAe;IACjDzD,SAASyD,qBAAqB,WAAW;IACzCvD,SAASuD,qBAAqB,WAAW;IACzCG,UAAUH,qBAAqB,YAAY;IAC3CI,cAAcC,sCAAkB;IAChCC,eAAeC,wCAAmB;IAClCR,QAAQlB;AACZ"}
|
|
@@ -4,8 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
.header {
|
|
6
6
|
gap: var(--mantine-spacing-sm);
|
|
7
|
+
min-height: unset;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.close {
|
|
10
11
|
align-self: flex-start;
|
|
11
12
|
}
|
|
13
|
+
|
|
14
|
+
.content {
|
|
15
|
+
overflow-y: initial;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.body {
|
|
21
|
+
overflow-y: scroll;
|
|
22
|
+
border-end-start-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
23
|
+
border-end-end-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastUpdated.d.ts","sourceRoot":"","sources":["../../../../src/components/LastUpdated/LastUpdated.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAW,OA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K,CAAC,UAAU,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACrC,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,sBAAsB,CAAC;CACvC,CAAC,CAAC;AAOH,eAAO,MAAM,WAAW;WAVb,gBAAgB;SAClB,cAAc;iBACN,sBAAsB;EA2CrC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { factory, Group, Text, useProps, useStyles } from '@mantine/core';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
-
import React from 'react';
|
|
5
4
|
const defaultProps = {
|
|
6
5
|
label: 'Last update:',
|
|
7
6
|
formatter: (time)=>dayjs(time).format('h:mm:ss A')
|
|
@@ -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
|
|
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 {ForwardedRef} 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>((props: LastUpdatedProps, ref: 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\nLastUpdated.displayName = 'LastUpdated';\n"],"names":["factory","Group","Text","useProps","useStyles","dayjs","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;AA+B1B,MAAMC,eAA0C;IAC5CC,OAAO;IACPC,WAAW,CAACC,OAASJ,MAAMI,MAAMC,MAAM,CAAC;AAC5C;AAEA,OAAO,MAAMC,cAAcX,QAA4B,CAACY,OAAyBC;IAC7E,MAAM,EAACL,SAAS,EAAED,KAAK,EAAEE,IAAI,EAAEK,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,QAAO,GAAGjB,SAC9F,qBACAG,cACAM;IAGJ,MAAMS,eAAeZ,QAAQJ,QAAQiB,OAAO;IAE5C,MAAMC,YAAYnB,UAA8B;QAC5CoB,MAAM;QACNC,SAAS,CAAC;QACVb;QACAG;QACAE;QACAH;QACAE;QACAG;QACAD;IACJ;IACA,MAAMQ,iBAAiB;QAACZ;QAAYE;IAAM;IAE1C,qBACI,KAACf;QACG0B,SAASf,MAAMe,OAAO;QACtBd,KAAKA;QACJ,GAAGU,UAAU,QAAQ;YAACR;YAAWE;YAAO,GAAGS,cAAc;QAAA,EAAE;QAC3D,GAAGN,MAAM;kBAEV,cAAA,MAAClB;YAAK0B,MAAK;YAAM,GAAGL,UAAU,SAAS;gBAACR;gBAAWE;gBAAO,GAAGS,cAAc;YAAA,EAAE;;gBACxEnB;8BACD,KAACsB;oBAAKC,MAAK;8BAAStB,UAAUa;;;;;AAI9C,GAAG;AAEHV,YAAYoB,WAAW,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Factory, ModalRootProps, ModalStylesNames, StylesApiProps } from '@mantine/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
3
3
|
import { PromptCancelButtonStylesNamesVariant } from './PromptCancelButton.js';
|
|
4
4
|
import { PromptConfirmButtonStylesNamesVariant } from './PromptConfirmButton.js';
|
|
5
5
|
export type PromptVariant = 'success' | 'warning' | 'critical' | 'information';
|
|
@@ -22,7 +22,7 @@ export type PromptFactory = Factory<{
|
|
|
22
22
|
variant: PromptVariant;
|
|
23
23
|
stylesNames: PromptStylesNames;
|
|
24
24
|
}>;
|
|
25
|
-
type PromptCompoundComponent =
|
|
25
|
+
type PromptCompoundComponent = ForwardRefExoticComponent<PromptProps & RefAttributes<HTMLDivElement>>;
|
|
26
26
|
export declare const Prompt: {
|
|
27
27
|
readonly Information: PromptCompoundComponent;
|
|
28
28
|
readonly Success: PromptCompoundComponent;
|
|
@@ -40,7 +40,7 @@ export declare const Prompt: {
|
|
|
40
40
|
stylesNames: PromptConfirmButtonStylesNamesVariant;
|
|
41
41
|
compound: true;
|
|
42
42
|
}>;
|
|
43
|
-
readonly Footer: FunctionComponent<import("../Modal/ModalFooter.js").ModalFooterProps &
|
|
43
|
+
readonly Footer: import("react").FunctionComponent<import("../Modal/ModalFooter.js").ModalFooterProps & RefAttributes<HTMLDivElement> & {
|
|
44
44
|
component?: any;
|
|
45
45
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
46
46
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/Prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/Prompt/Prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,cAAc,EAIjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKH,yBAAyB,EAEzB,SAAS,EACT,aAAa,EAChB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAqB,oCAAoC,EAAC,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAsB,qCAAqC,EAAC,MAAM,0BAA0B,CAAC;AAEpG,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAC/E,MAAM,MAAM,UAAU,GAAG;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAC,CAAC;AACtD,MAAM,MAAM,iBAAiB,GACvB,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAClC,MAAM,GACN,oCAAoC,GACpC,qCAAqC,CAAC;AAE5C,KAAK,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,CAAC;AAE3E,MAAM,WAAW,WACb,SAAQ,oBAAoB,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAC/G,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,mBAAoB,SAAQ,WAAW;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;IAChC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,iBAAiB,CAAC;CAClC,CAAC,CAAC;AAiFH,KAAK,uBAAuB,GAAG,yBAAyB,CAAC,WAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;AAatG,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAQT,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { factory, Title, useProps, useStyles } from '@mantine/core';
|
|
3
3
|
import { Children, forwardRef } from 'react';
|
|
4
4
|
import { InfoToken } from '../InfoToken/InfoToken.js';
|
|
5
5
|
import { Modal } from '../Modal/Modal.js';
|
|
@@ -80,14 +80,13 @@ const _Prompt = factory((_props, ref)=>{
|
|
|
80
80
|
})
|
|
81
81
|
]
|
|
82
82
|
}),
|
|
83
|
-
/*#__PURE__*/
|
|
83
|
+
/*#__PURE__*/ _jsxs(Modal.Body, {
|
|
84
84
|
...getStyles('body', stylesApiProps),
|
|
85
|
-
children:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
footers
|
|
85
|
+
children: [
|
|
86
|
+
otherChildren,
|
|
87
|
+
footers
|
|
88
|
+
]
|
|
89
|
+
})
|
|
91
90
|
]
|
|
92
91
|
})
|
|
93
92
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Prompt/Prompt.tsx"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Prompt/Prompt.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n ModalRootProps,\n ModalStylesNames,\n StylesApiProps,\n Title,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {\n Children,\n ComponentProps,\n ComponentType,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n RefAttributes,\n} from 'react';\nimport {InfoToken} from '../InfoToken/InfoToken.js';\nimport {Modal} from '../Modal/Modal.js';\nimport {PromptContextProvider} from './Prompt.context.js';\nimport classes from './Prompt.module.css';\nimport {PromptCancelButton, PromptCancelButtonStylesNamesVariant} from './PromptCancelButton.js';\nimport {PromptConfirmButton, PromptConfirmButtonStylesNamesVariant} from './PromptConfirmButton.js';\n\nexport type PromptVariant = 'success' | 'warning' | 'critical' | 'information';\nexport type PromptVars = {root: '--prompt-icon-size'};\nexport type PromptStylesNames =\n | Exclude<ModalStylesNames, 'title'>\n | 'icon'\n | PromptCancelButtonStylesNamesVariant\n | PromptConfirmButtonStylesNamesVariant;\n\ntype PromptStylesApiProps = Omit<StylesApiProps<PromptFactory>, 'variant'>;\n\nexport interface PromptProps\n extends PromptStylesApiProps, Omit<ModalRootProps, 'classNames' | 'styles' | 'vars' | 'attributes' | 'variant'> {\n children: ReactNode;\n title: ReactNode;\n}\n\ninterface PromptInternalProps extends PromptProps {\n variant?: PromptVariant;\n}\n\nexport type PromptFactory = Factory<{\n props: PromptInternalProps;\n ref: HTMLDivElement;\n vars: PromptVars;\n variant: PromptVariant;\n stylesNames: PromptStylesNames;\n}>;\n\nconst PromptVariantIconsMapping: Record<PromptVariant, typeof InfoToken.Information> = {\n success: InfoToken.Success,\n warning: InfoToken.Warning,\n critical: InfoToken.Error,\n information: InfoToken.Information,\n};\n\nconst defaultProps: Partial<PromptInternalProps> = {\n variant: 'information',\n centered: true,\n};\n\nconst _Prompt = factory<PromptFactory>((_props, ref) => {\n const props = useProps('Prompt', defaultProps, _props);\n const {\n variant,\n title,\n children,\n className,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n attributes: _attributes,\n ...others\n } = props;\n const getStyles = useStyles<PromptFactory>({\n name: 'Prompt',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n const stylesApiProps = {classNames, styles};\n\n const footers: ReactElement[] = [];\n const otherChildren: ReactElement[] = [];\n\n Children.forEach(children, (child: ReactElement) => {\n (child.type === PromptFooter ? footers : otherChildren).push(child);\n });\n\n const IconComponent = PromptVariantIconsMapping[variant];\n\n return (\n <PromptContextProvider value={{variant, getStyles}}>\n <Modal.Root ref={ref} variant=\"prompt\" size=\"sm\" {...others} {...getStyles('root')}>\n <Modal.Overlay {...getStyles('overlay', stylesApiProps)} />\n <Modal.Content {...getStyles('content', stylesApiProps)}>\n <Modal.Header {...getStyles('header', stylesApiProps)}>\n <IconComponent\n {...getStyles('icon', stylesApiProps)}\n variant=\"light\"\n size=\"sm\"\n aria-label={variant}\n />\n <Modal.Title>\n <Title order={3} component=\"div\">\n {title}\n </Title>\n </Modal.Title>\n <Modal.CloseButton {...getStyles('close', stylesApiProps)} />\n </Modal.Header>\n <Modal.Body {...getStyles('body', stylesApiProps)}>\n {otherChildren}\n {footers}\n </Modal.Body>\n </Modal.Content>\n </Modal.Root>\n </PromptContextProvider>\n );\n});\n_Prompt.displayName = 'Prompt';\n\ntype PromptCompoundComponent = ForwardRefExoticComponent<PromptProps & RefAttributes<HTMLDivElement>>;\n\nconst PromptFooter: ComponentType<ComponentProps<typeof Modal.Footer>> = (props) => <Modal.Footer {...props} />;\nPromptFooter.displayName = 'Prompt.Footer';\n\nconst createPromptCompound = (variant: PromptVariant, displayName: string) => {\n const Component = forwardRef<HTMLDivElement, PromptProps>((props, ref) => (\n <_Prompt ref={ref} {...props} variant={variant} />\n ));\n Component.displayName = displayName;\n return Component as PromptCompoundComponent;\n};\n\nexport const Prompt = {\n Information: createPromptCompound('information', 'Prompt.Information'),\n Success: createPromptCompound('success', 'Prompt.Success'),\n Warning: createPromptCompound('warning', 'Prompt.Warning'),\n Critical: createPromptCompound('critical', 'Prompt.Critical'),\n CancelButton: PromptCancelButton,\n ConfirmButton: PromptConfirmButton,\n Footer: PromptFooter,\n} as const;\n"],"names":["factory","Title","useProps","useStyles","Children","forwardRef","InfoToken","Modal","PromptContextProvider","classes","PromptCancelButton","PromptConfirmButton","PromptVariantIconsMapping","success","Success","warning","Warning","critical","Error","information","Information","defaultProps","variant","centered","_Prompt","_props","ref","props","title","children","className","classNames","style","styles","unstyled","vars","attributes","_attributes","others","getStyles","name","stylesApiProps","footers","otherChildren","forEach","child","type","PromptFooter","push","IconComponent","value","Root","size","Overlay","Content","Header","aria-label","order","component","CloseButton","Body","displayName","Footer","createPromptCompound","Component","Prompt","Critical","CancelButton","ConfirmButton"],"mappings":";AAAA,SACIA,OAAO,EAKPC,KAAK,EACLC,QAAQ,EACRC,SAAS,QACN,gBAAgB;AACvB,SACIC,QAAQ,EAGRC,UAAU,QAKP,QAAQ;AACf,SAAQC,SAAS,QAAO,4BAA4B;AACpD,SAAQC,KAAK,QAAO,oBAAoB;AACxC,SAAQC,qBAAqB,QAAO,sBAAsB;AAC1D,OAAOC,aAAa,sBAAsB;AAC1C,SAAQC,kBAAkB,QAA6C,0BAA0B;AACjG,SAAQC,mBAAmB,QAA8C,2BAA2B;AA8BpG,MAAMC,4BAAiF;IACnFC,SAASP,UAAUQ,OAAO;IAC1BC,SAAST,UAAUU,OAAO;IAC1BC,UAAUX,UAAUY,KAAK;IACzBC,aAAab,UAAUc,WAAW;AACtC;AAEA,MAAMC,eAA6C;I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AW;oCAAE,GAAGpB,UAAU,SAASE,eAAe;;;;sCAE7D,MAAClC,MAAMqD,IAAI;4BAAE,GAAGrB,UAAU,QAAQE,eAAe;;gCAC5CE;gCACAD;;;;;;;;AAMzB;AACAlB,QAAQqC,WAAW,GAAG;AAItB,MAAMd,eAAmE,CAACpB,sBAAU,KAACpB,MAAMuD,MAAM;QAAE,GAAGnC,KAAK;;AAC3GoB,aAAac,WAAW,GAAG;AAE3B,MAAME,uBAAuB,CAACzC,SAAwBuC;IAClD,MAAMG,0BAAY3D,WAAwC,CAACsB,OAAOD,oBAC9D,KAACF;YAAQE,KAAKA;YAAM,GAAGC,KAAK;YAAEL,SAASA;;IAE3C0C,UAAUH,WAAW,GAAGA;IACxB,OAAOG;AACX;AAEA,OAAO,MAAMC,SAAS;IAClB7C,aAAa2C,qBAAqB,eAAe;IACjDjD,SAASiD,qBAAqB,WAAW;IACzC/C,SAAS+C,qBAAqB,WAAW;IACzCG,UAAUH,qBAAqB,YAAY;IAC3CI,cAAczD;IACd0D,eAAezD;IACfmD,QAAQf;AACZ,EAAW"}
|
|
@@ -4,8 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
.header {
|
|
6
6
|
gap: var(--mantine-spacing-sm);
|
|
7
|
+
min-height: unset;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.close {
|
|
10
11
|
align-self: flex-start;
|
|
11
12
|
}
|
|
13
|
+
|
|
14
|
+
.content {
|
|
15
|
+
overflow-y: initial;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.body {
|
|
21
|
+
overflow-y: scroll;
|
|
22
|
+
border-end-start-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
23
|
+
border-end-end-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveord/plasma-mantine",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.2",
|
|
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-react-icons": "58.0.2",
|
|
85
|
+
"@coveord/plasma-tokens": "58.0.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@mantine/carousel": "8.3.18",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@mantine/hooks": "8.3.18",
|
|
94
94
|
"@mantine/modals": "8.3.18",
|
|
95
95
|
"@mantine/notifications": "8.3.18",
|
|
96
|
-
"@swc/cli": "0.8.
|
|
96
|
+
"@swc/cli": "0.8.1",
|
|
97
97
|
"@swc/core": "1.15.21",
|
|
98
98
|
"@testing-library/dom": "10.4.1",
|
|
99
99
|
"@testing-library/jest-dom": "6.9.1",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@types/lodash.defaultsdeep": "4.6.9",
|
|
103
103
|
"@types/react": "19.2.14",
|
|
104
104
|
"@types/react-dom": "19.2.3",
|
|
105
|
-
"@vitest/eslint-plugin": "1.6.
|
|
105
|
+
"@vitest/eslint-plugin": "1.6.14",
|
|
106
106
|
"cross-env": "10.1.0",
|
|
107
107
|
"embla-carousel": "8.6.0",
|
|
108
108
|
"embla-carousel-react": "8.6.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {BoxProps, factory, Factory, Group, GroupProps, StylesApiProps, Text, useProps, useStyles} from '@mantine/core';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import
|
|
3
|
+
import {ForwardedRef} from 'react';
|
|
4
4
|
|
|
5
5
|
export type LastUpdatedStylesNames = 'root' | 'label';
|
|
6
6
|
|
|
@@ -35,43 +35,41 @@ const defaultProps: Partial<LastUpdatedProps> = {
|
|
|
35
35
|
formatter: (time) => dayjs(time).format('h:mm:ss A'),
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export const LastUpdated = factory<LastUpdatedFactory>(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
38
|
+
export const LastUpdated = factory<LastUpdatedFactory>((props: LastUpdatedProps, ref: ForwardedRef<HTMLDivElement>) => {
|
|
39
|
+
const {formatter, label, time, classNames, className, styles, style, vars, unstyled, ...others} = useProps(
|
|
40
|
+
'PlasmaLastUpdated',
|
|
41
|
+
defaultProps as Partial<LastUpdatedProps>,
|
|
42
|
+
props,
|
|
43
|
+
);
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
const resolvedTime = time ?? dayjs().valueOf();
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
const getStyles = useStyles<LastUpdatedFactory>({
|
|
48
|
+
name: 'LastUpdated',
|
|
49
|
+
classes: {},
|
|
50
|
+
props,
|
|
51
|
+
className,
|
|
52
|
+
style,
|
|
53
|
+
classNames,
|
|
54
|
+
styles,
|
|
55
|
+
unstyled,
|
|
56
|
+
vars,
|
|
57
|
+
});
|
|
58
|
+
const stylesApiProps = {classNames, styles};
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
);
|
|
60
|
+
return (
|
|
61
|
+
<Group
|
|
62
|
+
justify={props.justify}
|
|
63
|
+
ref={ref}
|
|
64
|
+
{...getStyles('root', {className, style, ...stylesApiProps})}
|
|
65
|
+
{...others}
|
|
66
|
+
>
|
|
67
|
+
<Text size="xs" {...getStyles('label', {className, style, ...stylesApiProps})}>
|
|
68
|
+
{label}
|
|
69
|
+
<span role="timer">{formatter(resolvedTime)}</span>
|
|
70
|
+
</Text>
|
|
71
|
+
</Group>
|
|
72
|
+
);
|
|
73
|
+
});
|
|
76
74
|
|
|
77
75
|
LastUpdated.displayName = 'LastUpdated';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Box,
|
|
3
2
|
factory,
|
|
4
3
|
Factory,
|
|
5
4
|
ModalRootProps,
|
|
@@ -9,7 +8,16 @@ import {
|
|
|
9
8
|
useProps,
|
|
10
9
|
useStyles,
|
|
11
10
|
} from '@mantine/core';
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Children,
|
|
13
|
+
ComponentProps,
|
|
14
|
+
ComponentType,
|
|
15
|
+
forwardRef,
|
|
16
|
+
ForwardRefExoticComponent,
|
|
17
|
+
ReactElement,
|
|
18
|
+
ReactNode,
|
|
19
|
+
RefAttributes,
|
|
20
|
+
} from 'react';
|
|
13
21
|
import {InfoToken} from '../InfoToken/InfoToken.js';
|
|
14
22
|
import {Modal} from '../Modal/Modal.js';
|
|
15
23
|
import {PromptContextProvider} from './Prompt.context.js';
|
|
@@ -114,9 +122,9 @@ const _Prompt = factory<PromptFactory>((_props, ref) => {
|
|
|
114
122
|
<Modal.CloseButton {...getStyles('close', stylesApiProps)} />
|
|
115
123
|
</Modal.Header>
|
|
116
124
|
<Modal.Body {...getStyles('body', stylesApiProps)}>
|
|
117
|
-
|
|
125
|
+
{otherChildren}
|
|
126
|
+
{footers}
|
|
118
127
|
</Modal.Body>
|
|
119
|
-
{footers}
|
|
120
128
|
</Modal.Content>
|
|
121
129
|
</Modal.Root>
|
|
122
130
|
</PromptContextProvider>
|
|
@@ -124,12 +132,12 @@ const _Prompt = factory<PromptFactory>((_props, ref) => {
|
|
|
124
132
|
});
|
|
125
133
|
_Prompt.displayName = 'Prompt';
|
|
126
134
|
|
|
127
|
-
type PromptCompoundComponent =
|
|
135
|
+
type PromptCompoundComponent = ForwardRefExoticComponent<PromptProps & RefAttributes<HTMLDivElement>>;
|
|
128
136
|
|
|
129
137
|
const PromptFooter: ComponentType<ComponentProps<typeof Modal.Footer>> = (props) => <Modal.Footer {...props} />;
|
|
130
138
|
PromptFooter.displayName = 'Prompt.Footer';
|
|
131
139
|
|
|
132
|
-
const createPromptCompound = (variant: PromptVariant, displayName: string)
|
|
140
|
+
const createPromptCompound = (variant: PromptVariant, displayName: string) => {
|
|
133
141
|
const Component = forwardRef<HTMLDivElement, PromptProps>((props, ref) => (
|
|
134
142
|
<_Prompt ref={ref} {...props} variant={variant} />
|
|
135
143
|
));
|
|
@@ -4,8 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
.header {
|
|
6
6
|
gap: var(--mantine-spacing-sm);
|
|
7
|
+
min-height: unset;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.close {
|
|
10
11
|
align-self: flex-start;
|
|
11
12
|
}
|
|
13
|
+
|
|
14
|
+
.content {
|
|
15
|
+
overflow-y: initial;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.body {
|
|
21
|
+
overflow-y: scroll;
|
|
22
|
+
border-end-start-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
23
|
+
border-end-end-radius: var(--modal-radius, var(--mantine-radius-default));
|
|
24
|
+
}
|