@coveord/plasma-mantine 57.1.0 → 58.0.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 +106 -102
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/ActionIcon/ActionIcon.d.ts +3 -3
- package/dist/cjs/components/Alert/Alert.d.ts +3 -3
- package/dist/cjs/components/Alert/Alert.js +4 -12
- package/dist/cjs/components/Alert/Alert.js.map +1 -1
- package/dist/cjs/components/AppShell/AppShell.d.ts +8 -1
- package/dist/cjs/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/cjs/components/AppShell/AppShell.js +27 -1
- package/dist/cjs/components/AppShell/AppShell.js.map +1 -1
- package/dist/cjs/components/AppShell/AppShell.module.css +4 -0
- package/dist/cjs/components/Badge/Badge.d.ts +3 -3
- package/dist/cjs/components/BrowserPreview/BrowserPreview.d.ts +1 -1
- package/dist/cjs/components/BrowserPreview/BrowserPreview.d.ts.map +1 -1
- package/dist/cjs/components/BrowserPreview/BrowserPreview.js +1 -2
- package/dist/cjs/components/BrowserPreview/BrowserPreview.js.map +1 -1
- package/dist/cjs/components/Button/Button.d.ts +3 -3
- package/dist/cjs/components/ChildForm/ChildForm.d.ts +5 -4
- package/dist/cjs/components/ChildForm/ChildForm.d.ts.map +1 -1
- package/dist/cjs/components/ChildForm/ChildForm.js +4 -2
- package/dist/cjs/components/ChildForm/ChildForm.js.map +1 -1
- package/dist/cjs/components/Collection/Collection.d.ts +6 -6
- package/dist/cjs/components/Collection/CollectionAddButton.d.ts +1 -1
- package/dist/cjs/components/Collection/CollectionAddButton.d.ts.map +1 -1
- package/dist/cjs/components/Collection/CollectionContext.d.ts +1 -1
- package/dist/cjs/components/Collection/CollectionContext.d.ts.map +1 -1
- package/dist/cjs/components/Collection/layouts/CollectionLayouts.d.ts +5 -5
- package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayout.d.ts +3 -3
- package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts +1 -1
- package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutBody.d.ts.map +1 -1
- package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts +1 -1
- package/dist/cjs/components/Collection/layouts/horizontal-layout/HorizontalLayoutHeader.d.ts.map +1 -1
- package/dist/cjs/components/Collection/layouts/shared/itemRenderer.d.ts +3 -3
- package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayout.d.ts +2 -2
- package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts +1 -1
- package/dist/cjs/components/Collection/layouts/vertical-layout/VerticalLayoutBody.d.ts.map +1 -1
- package/dist/cjs/components/DateRangePicker/DateRangePickerInlineCalendar.d.ts +1 -1
- package/dist/cjs/components/DateRangePicker/DateRangePickerInlineCalendar.d.ts.map +1 -1
- package/dist/cjs/components/DateRangePicker/DateRangePickerPopoverCalendar.d.ts +1 -1
- package/dist/cjs/components/DateRangePicker/DateRangePickerPopoverCalendar.d.ts.map +1 -1
- package/dist/cjs/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -1
- package/dist/cjs/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/cjs/components/EllipsisText/EllipsisText.d.ts +3 -3
- package/dist/cjs/components/Header/Header.context.d.ts +1 -1
- package/dist/cjs/components/Header/Header.context.d.ts.map +1 -1
- package/dist/cjs/components/Header/Header.module.css +0 -5
- package/dist/cjs/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbAnchor.d.ts +3 -3
- package/dist/cjs/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbText.d.ts +3 -3
- package/dist/cjs/components/Header/HeaderDocAnchor/HeaderDocAnchor.js +2 -4
- package/dist/cjs/components/Header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
- package/dist/cjs/components/InfoToken/InfoToken.d.ts +26 -82
- package/dist/cjs/components/InfoToken/InfoToken.d.ts.map +1 -1
- package/dist/cjs/components/InfoToken/InfoToken.js +62 -55
- package/dist/cjs/components/InfoToken/InfoToken.js.map +1 -1
- package/dist/cjs/components/InfoToken/InfoToken.module.css +11 -3
- package/dist/cjs/components/InlineConfirm/InlineConfirmTarget.d.ts +3 -3
- package/dist/cjs/components/Input/Input.d.ts +14 -1
- package/dist/cjs/components/Input/Input.d.ts.map +1 -1
- package/dist/cjs/components/Input/Input.js +17 -5
- package/dist/cjs/components/Input/Input.js.map +1 -1
- package/dist/cjs/components/Input/InputLabelInfo.d.ts +17 -0
- package/dist/cjs/components/Input/InputLabelInfo.d.ts.map +1 -0
- package/dist/cjs/components/Input/InputLabelInfo.js +58 -0
- package/dist/cjs/components/Input/InputLabelInfo.js.map +1 -0
- package/dist/cjs/components/Input/InputLabelInfo.module.css +5 -0
- package/dist/cjs/components/Menu/Menu.d.ts +1 -1
- package/dist/cjs/components/Modal/Modal.js +1 -1
- package/dist/cjs/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/Modal/ModalFooter.js +2 -0
- package/dist/cjs/components/Modal/ModalFooter.js.map +1 -1
- package/dist/cjs/components/Modal/ModalFooter.module.css +2 -2
- package/dist/cjs/components/Prompt/Prompt.context.d.ts +1 -1
- package/dist/cjs/components/Prompt/Prompt.context.d.ts.map +1 -1
- package/dist/cjs/components/Prompt/Prompt.d.ts +33 -33
- package/dist/cjs/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/cjs/components/Prompt/Prompt.js +38 -18
- package/dist/cjs/components/Prompt/Prompt.js.map +1 -1
- package/dist/cjs/components/Prompt/Prompt.module.css +0 -17
- package/dist/cjs/components/Prompt/PromptCancelButton.d.ts.map +1 -1
- package/dist/cjs/components/Prompt/PromptCancelButton.js +1 -0
- package/dist/cjs/components/Prompt/PromptCancelButton.js.map +1 -1
- package/dist/cjs/components/Prompt/PromptConfirmButton.d.ts.map +1 -1
- package/dist/cjs/components/Prompt/PromptConfirmButton.js +2 -1
- package/dist/cjs/components/Prompt/PromptConfirmButton.js.map +1 -1
- package/dist/cjs/components/StickyFooter/StickyFooter.js +1 -1
- package/dist/cjs/components/StickyFooter/StickyFooter.js.map +1 -1
- package/dist/cjs/components/Table/Table.d.ts +4 -4
- package/dist/cjs/components/Table/layouts/TableLayoutControl.d.ts +1 -1
- package/dist/cjs/components/Table/layouts/TableLayoutControl.d.ts.map +1 -1
- package/dist/cjs/components/Table/layouts/row-layout/RowLayoutBody.d.ts +1 -1
- package/dist/cjs/components/Table/layouts/row-layout/RowLayoutContext.d.ts +1 -1
- package/dist/cjs/components/Table/layouts/row-layout/RowLayoutContext.d.ts.map +1 -1
- package/dist/cjs/components/Table/layouts/row-layout/RowLayoutHeader.d.ts +1 -1
- package/dist/cjs/components/Table/table-actions/TableActionItem.d.ts +3 -3
- package/dist/cjs/components/Table/table-actions/TableActionsList.d.ts +2 -2
- package/dist/cjs/components/Table/table-header/Th.d.ts +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles/AppShell.module.css +4 -0
- package/dist/cjs/styles/Breadcrumbs.module.css +0 -4
- package/dist/cjs/styles/Checkbox.module.css +0 -1
- package/dist/cjs/styles/InputWrapper.module.css +0 -4
- package/dist/cjs/styles/NavLink.module.css +0 -2
- package/dist/cjs/styles/Radio.module.css +0 -1
- package/dist/cjs/styles/RadioCard.module.css +0 -1
- package/dist/cjs/styles/Select.module.css +0 -2
- package/dist/cjs/styles/Tabs.module.css +2 -2
- package/dist/cjs/theme/Theme.d.ts.map +1 -1
- package/dist/cjs/theme/Theme.js +15 -4
- package/dist/cjs/theme/Theme.js.map +1 -1
- package/dist/cjs/theme/plasmaCSSVariablesResolver.d.ts.map +1 -1
- package/dist/cjs/theme/plasmaCSSVariablesResolver.js +3 -6
- package/dist/cjs/theme/plasmaCSSVariablesResolver.js.map +1 -1
- package/dist/esm/components/ActionIcon/ActionIcon.d.ts +3 -3
- package/dist/esm/components/Alert/Alert.d.ts +3 -3
- package/dist/esm/components/Alert/Alert.js +4 -12
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/AppShell/AppShell.d.ts +8 -1
- package/dist/esm/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/esm/components/AppShell/AppShell.js +15 -3
- package/dist/esm/components/AppShell/AppShell.js.map +1 -1
- package/dist/esm/components/AppShell/AppShell.module.css +4 -0
- package/dist/esm/components/Badge/Badge.d.ts +3 -3
- package/dist/esm/components/BrowserPreview/BrowserPreview.js +1 -2
- package/dist/esm/components/BrowserPreview/BrowserPreview.js.map +1 -1
- package/dist/esm/components/Button/Button.d.ts +3 -3
- package/dist/esm/components/ChildForm/ChildForm.d.ts +5 -4
- package/dist/esm/components/ChildForm/ChildForm.d.ts.map +1 -1
- package/dist/esm/components/ChildForm/ChildForm.js +4 -2
- package/dist/esm/components/ChildForm/ChildForm.js.map +1 -1
- package/dist/esm/components/EllipsisText/EllipsisText.d.ts +3 -3
- package/dist/esm/components/Header/Header.module.css +0 -5
- package/dist/esm/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbAnchor.d.ts +3 -3
- package/dist/esm/components/Header/HeaderBreadcrumbs/HeaderBreadcrumbText.d.ts +3 -3
- package/dist/esm/components/Header/HeaderDocAnchor/HeaderDocAnchor.js +2 -4
- package/dist/esm/components/Header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
- package/dist/esm/components/InfoToken/InfoToken.d.ts +26 -82
- package/dist/esm/components/InfoToken/InfoToken.d.ts.map +1 -1
- package/dist/esm/components/InfoToken/InfoToken.js +61 -57
- package/dist/esm/components/InfoToken/InfoToken.js.map +1 -1
- package/dist/esm/components/InfoToken/InfoToken.module.css +11 -3
- package/dist/esm/components/InlineConfirm/InlineConfirmTarget.d.ts +3 -3
- package/dist/esm/components/Input/Input.d.ts +14 -1
- package/dist/esm/components/Input/Input.d.ts.map +1 -1
- package/dist/esm/components/Input/Input.js +7 -2
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/InputLabelInfo.d.ts +17 -0
- package/dist/esm/components/Input/InputLabelInfo.d.ts.map +1 -0
- package/dist/esm/components/Input/InputLabelInfo.js +35 -0
- package/dist/esm/components/Input/InputLabelInfo.js.map +1 -0
- package/dist/esm/components/Input/InputLabelInfo.module.css +5 -0
- package/dist/esm/components/Modal/Modal.js +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalFooter.js +2 -0
- package/dist/esm/components/Modal/ModalFooter.js.map +1 -1
- package/dist/esm/components/Modal/ModalFooter.module.css +2 -2
- package/dist/esm/components/Prompt/Prompt.d.ts +33 -33
- package/dist/esm/components/Prompt/Prompt.d.ts.map +1 -1
- package/dist/esm/components/Prompt/Prompt.js +38 -19
- package/dist/esm/components/Prompt/Prompt.js.map +1 -1
- package/dist/esm/components/Prompt/Prompt.module.css +0 -17
- package/dist/esm/components/Prompt/PromptCancelButton.d.ts.map +1 -1
- package/dist/esm/components/Prompt/PromptCancelButton.js +1 -0
- package/dist/esm/components/Prompt/PromptCancelButton.js.map +1 -1
- package/dist/esm/components/Prompt/PromptConfirmButton.d.ts.map +1 -1
- package/dist/esm/components/Prompt/PromptConfirmButton.js +2 -1
- package/dist/esm/components/Prompt/PromptConfirmButton.js.map +1 -1
- package/dist/esm/components/StickyFooter/StickyFooter.js +1 -1
- package/dist/esm/components/StickyFooter/StickyFooter.js.map +1 -1
- package/dist/esm/components/Table/Table.d.ts +3 -3
- package/dist/esm/components/Table/table-actions/TableActionItem.d.ts +3 -3
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles/AppShell.module.css +4 -0
- package/dist/esm/styles/Breadcrumbs.module.css +0 -4
- package/dist/esm/styles/Checkbox.module.css +0 -1
- package/dist/esm/styles/InputWrapper.module.css +0 -4
- package/dist/esm/styles/NavLink.module.css +0 -2
- package/dist/esm/styles/Radio.module.css +0 -1
- package/dist/esm/styles/RadioCard.module.css +0 -1
- package/dist/esm/styles/Select.module.css +0 -2
- package/dist/esm/styles/Tabs.module.css +2 -2
- package/dist/esm/theme/Theme.d.ts.map +1 -1
- package/dist/esm/theme/Theme.js +15 -4
- package/dist/esm/theme/Theme.js.map +1 -1
- package/dist/esm/theme/plasmaCSSVariablesResolver.d.ts.map +1 -1
- package/dist/esm/theme/plasmaCSSVariablesResolver.js +3 -6
- package/dist/esm/theme/plasmaCSSVariablesResolver.js.map +1 -1
- package/package.json +23 -23
- package/src/components/Alert/Alert.tsx +4 -4
- package/src/components/AppShell/AppShell.module.css +4 -0
- package/src/components/AppShell/AppShell.tsx +27 -0
- package/src/components/BrowserPreview/BrowserPreview.tsx +1 -1
- package/src/components/ChildForm/ChildForm.tsx +10 -3
- package/src/components/ChildForm/__tests__/ChildForm.spec.tsx +29 -4
- package/src/components/Header/Header.module.css +0 -5
- package/src/components/Header/HeaderDocAnchor/HeaderDocAnchor.tsx +2 -2
- package/src/components/InfoToken/InfoToken.module.css +11 -3
- package/src/components/InfoToken/InfoToken.tsx +83 -67
- package/src/components/Input/Input.ts +24 -2
- package/src/components/Input/InputLabelInfo.module.css +5 -0
- package/src/components/Input/InputLabelInfo.tsx +43 -0
- package/src/components/Input/__tests__/Input.spec.tsx +33 -0
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Modal/ModalFooter.module.css +2 -2
- package/src/components/Modal/ModalFooter.tsx +3 -1
- package/src/components/Prompt/Prompt.module.css +0 -17
- package/src/components/Prompt/Prompt.tsx +48 -34
- package/src/components/Prompt/PromptCancelButton.tsx +3 -1
- package/src/components/Prompt/PromptConfirmButton.tsx +4 -2
- package/src/components/Prompt/__tests__/Prompt.spec.tsx +18 -16
- package/src/components/StickyFooter/StickyFooter.tsx +1 -1
- package/src/components/Switch/__tests__/Switch.spec.tsx +27 -0
- package/src/index.ts +12 -4
- package/src/styles/AppShell.module.css +4 -0
- package/src/styles/Breadcrumbs.module.css +0 -4
- package/src/styles/Checkbox.module.css +0 -1
- package/src/styles/InputWrapper.module.css +0 -4
- package/src/styles/NavLink.module.css +0 -2
- package/src/styles/Radio.module.css +0 -1
- package/src/styles/RadioCard.module.css +0 -1
- package/src/styles/Select.module.css +0 -2
- package/src/styles/Tabs.module.css +2 -2
- package/src/theme/Theme.tsx +10 -2
- package/src/theme/__tests__/plasmaCSSVariablesResolver.spec.ts +3 -6
- package/src/theme/plasmaCSSVariablesResolver.ts +3 -6
- package/dist/cjs/components/Prompt/icons/CriticalIcon.d.ts +0 -3
- package/dist/cjs/components/Prompt/icons/CriticalIcon.d.ts.map +0 -1
- package/dist/cjs/components/Prompt/icons/CriticalIcon.js +0 -29
- package/dist/cjs/components/Prompt/icons/CriticalIcon.js.map +0 -1
- package/dist/cjs/components/Prompt/icons/InfoIcon.d.ts +0 -3
- package/dist/cjs/components/Prompt/icons/InfoIcon.d.ts.map +0 -1
- package/dist/cjs/components/Prompt/icons/InfoIcon.js +0 -29
- package/dist/cjs/components/Prompt/icons/InfoIcon.js.map +0 -1
- package/dist/cjs/components/Prompt/icons/SuccessIcon.d.ts +0 -3
- package/dist/cjs/components/Prompt/icons/SuccessIcon.d.ts.map +0 -1
- package/dist/cjs/components/Prompt/icons/SuccessIcon.js +0 -29
- package/dist/cjs/components/Prompt/icons/SuccessIcon.js.map +0 -1
- package/dist/cjs/components/Prompt/icons/WarningIcon.d.ts +0 -3
- package/dist/cjs/components/Prompt/icons/WarningIcon.d.ts.map +0 -1
- package/dist/cjs/components/Prompt/icons/WarningIcon.js +0 -29
- package/dist/cjs/components/Prompt/icons/WarningIcon.js.map +0 -1
- package/dist/esm/components/Prompt/icons/CriticalIcon.d.ts +0 -3
- package/dist/esm/components/Prompt/icons/CriticalIcon.d.ts.map +0 -1
- package/dist/esm/components/Prompt/icons/CriticalIcon.js +0 -17
- package/dist/esm/components/Prompt/icons/CriticalIcon.js.map +0 -1
- package/dist/esm/components/Prompt/icons/InfoIcon.d.ts +0 -3
- package/dist/esm/components/Prompt/icons/InfoIcon.d.ts.map +0 -1
- package/dist/esm/components/Prompt/icons/InfoIcon.js +0 -17
- package/dist/esm/components/Prompt/icons/InfoIcon.js.map +0 -1
- package/dist/esm/components/Prompt/icons/SuccessIcon.d.ts +0 -3
- package/dist/esm/components/Prompt/icons/SuccessIcon.d.ts.map +0 -1
- package/dist/esm/components/Prompt/icons/SuccessIcon.js +0 -17
- package/dist/esm/components/Prompt/icons/SuccessIcon.js.map +0 -1
- package/dist/esm/components/Prompt/icons/WarningIcon.d.ts +0 -3
- package/dist/esm/components/Prompt/icons/WarningIcon.d.ts.map +0 -1
- package/dist/esm/components/Prompt/icons/WarningIcon.js +0 -17
- package/dist/esm/components/Prompt/icons/WarningIcon.js.map +0 -1
- package/src/components/AppShell/AppShell.ts +0 -11
- package/src/components/Prompt/icons/CriticalIcon.tsx +0 -18
- package/src/components/Prompt/icons/InfoIcon.tsx +0 -18
- package/src/components/Prompt/icons/SuccessIcon.tsx +0 -17
- package/src/components/Prompt/icons/WarningIcon.tsx +0 -18
|
@@ -1,105 +1,49 @@
|
|
|
1
|
-
import { BoxProps, Factory,
|
|
1
|
+
import { BoxProps, Factory, PolymorphicComponentProps, StylesApiProps } from '@mantine/core';
|
|
2
|
+
import { FunctionComponent, ReactElement } from 'react';
|
|
2
3
|
export type InfoTokenFactory = Factory<{
|
|
3
|
-
props:
|
|
4
|
+
props: InfoTokenInternalProps;
|
|
4
5
|
defaultRef: HTMLDivElement;
|
|
5
6
|
defaultComponent: 'div';
|
|
6
7
|
stylesNames: InfoTokenComponentStylesNames;
|
|
7
8
|
vars: InfoTokenCssVariables;
|
|
8
9
|
variant: InfoTokenVariant;
|
|
9
|
-
staticComponents: {
|
|
10
|
-
Information: typeof TokenInformation;
|
|
11
|
-
InformationOutline: typeof TokenInformationOutline;
|
|
12
|
-
Advice: typeof TokenAdvice;
|
|
13
|
-
Warning: typeof TokenWarning;
|
|
14
|
-
Error: typeof TokenError;
|
|
15
|
-
Question: typeof TokenQuestion;
|
|
16
|
-
};
|
|
17
10
|
}>;
|
|
18
11
|
export type InfoTokenComponentStylesNames = 'root';
|
|
19
|
-
export type
|
|
12
|
+
export type InfoTokenType = 'information' | 'advice' | 'warning' | 'error' | 'question' | 'success';
|
|
13
|
+
export type InfoTokenVariant = 'outline' | 'light';
|
|
14
|
+
export type InfoTokenSizes = 'xs' | 'sm' | 'md' | 'lg';
|
|
20
15
|
export type InfoTokenCssVariables = {
|
|
21
|
-
root: '--
|
|
16
|
+
root: '--it-color' | '--it-bg';
|
|
22
17
|
};
|
|
23
|
-
|
|
18
|
+
interface InfoTokenInternalProps extends BoxProps, StylesApiProps<InfoTokenFactory> {
|
|
24
19
|
/**
|
|
25
20
|
* The variant of the token.
|
|
26
21
|
*
|
|
27
|
-
* @default '
|
|
22
|
+
* @default 'outline'
|
|
28
23
|
*/
|
|
29
24
|
variant?: InfoTokenVariant;
|
|
25
|
+
/**
|
|
26
|
+
* The semantic type of the token
|
|
27
|
+
*
|
|
28
|
+
* @default 'information'
|
|
29
|
+
*/
|
|
30
|
+
type?: InfoTokenType;
|
|
30
31
|
/**
|
|
31
32
|
* The size of the info token.
|
|
32
33
|
*
|
|
33
|
-
* @default '
|
|
34
|
+
* @default 'xs'
|
|
34
35
|
*/
|
|
35
|
-
size?:
|
|
36
|
+
size?: InfoTokenSizes;
|
|
36
37
|
}
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
props: InfoTokenProps;
|
|
47
|
-
defaultRef: HTMLDivElement;
|
|
48
|
-
defaultComponent: "div";
|
|
49
|
-
stylesNames: InfoTokenComponentStylesNames;
|
|
50
|
-
vars: InfoTokenCssVariables;
|
|
51
|
-
variant: InfoTokenVariant;
|
|
52
|
-
staticComponents: {
|
|
53
|
-
Information: typeof TokenInformation;
|
|
54
|
-
InformationOutline: typeof TokenInformationOutline;
|
|
55
|
-
Advice: typeof TokenAdvice;
|
|
56
|
-
Warning: typeof TokenWarning;
|
|
57
|
-
Error: typeof TokenError;
|
|
58
|
-
Question: typeof TokenQuestion;
|
|
59
|
-
};
|
|
60
|
-
}> & import("node_modules/@mantine/core/lib/core/factory/factory").ComponentClasses<{
|
|
61
|
-
props: InfoTokenProps;
|
|
62
|
-
defaultRef: HTMLDivElement;
|
|
63
|
-
defaultComponent: "div";
|
|
64
|
-
stylesNames: InfoTokenComponentStylesNames;
|
|
65
|
-
vars: InfoTokenCssVariables;
|
|
66
|
-
variant: InfoTokenVariant;
|
|
67
|
-
staticComponents: {
|
|
68
|
-
Information: typeof TokenInformation;
|
|
69
|
-
InformationOutline: typeof TokenInformationOutline;
|
|
70
|
-
Advice: typeof TokenAdvice;
|
|
71
|
-
Warning: typeof TokenWarning;
|
|
72
|
-
Error: typeof TokenError;
|
|
73
|
-
Question: typeof TokenQuestion;
|
|
74
|
-
};
|
|
75
|
-
}> & import("node_modules/@mantine/core/lib/core/factory/polymorphic-factory").PolymorphicComponentWithProps<{
|
|
76
|
-
props: InfoTokenProps;
|
|
77
|
-
defaultRef: HTMLDivElement;
|
|
78
|
-
defaultComponent: "div";
|
|
79
|
-
stylesNames: InfoTokenComponentStylesNames;
|
|
80
|
-
vars: InfoTokenCssVariables;
|
|
81
|
-
variant: InfoTokenVariant;
|
|
82
|
-
staticComponents: {
|
|
83
|
-
Information: typeof TokenInformation;
|
|
84
|
-
InformationOutline: typeof TokenInformationOutline;
|
|
85
|
-
Advice: typeof TokenAdvice;
|
|
86
|
-
Warning: typeof TokenWarning;
|
|
87
|
-
Error: typeof TokenError;
|
|
88
|
-
Question: typeof TokenQuestion;
|
|
89
|
-
};
|
|
90
|
-
}> & {
|
|
91
|
-
Information: typeof TokenInformation;
|
|
92
|
-
InformationOutline: typeof TokenInformationOutline;
|
|
93
|
-
Advice: typeof TokenAdvice;
|
|
94
|
-
Warning: typeof TokenWarning;
|
|
95
|
-
Error: typeof TokenError;
|
|
96
|
-
Question: typeof TokenQuestion;
|
|
38
|
+
export type InfoTokenProps = Omit<InfoTokenInternalProps, 'type'>;
|
|
39
|
+
type InfoTokenCompoundComponent = (<C = 'div'>(props: PolymorphicComponentProps<C, InfoTokenProps>) => ReactElement) & Omit<FunctionComponent<PolymorphicComponentProps<any, InfoTokenProps>>, never>;
|
|
40
|
+
export declare const InfoToken: {
|
|
41
|
+
readonly Information: InfoTokenCompoundComponent;
|
|
42
|
+
readonly Advice: InfoTokenCompoundComponent;
|
|
43
|
+
readonly Warning: InfoTokenCompoundComponent;
|
|
44
|
+
readonly Error: InfoTokenCompoundComponent;
|
|
45
|
+
readonly Question: InfoTokenCompoundComponent;
|
|
46
|
+
readonly Success: InfoTokenCompoundComponent;
|
|
97
47
|
};
|
|
98
|
-
declare const TokenInformation: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
99
|
-
declare const TokenInformationOutline: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
100
|
-
declare const TokenAdvice: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
101
|
-
declare const TokenWarning: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
102
|
-
declare const TokenError: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
103
|
-
declare const TokenQuestion: <L = "div">(props: import("@mantine/core").PolymorphicComponentProps<L, InfoTokenProps>) => React.ReactElement;
|
|
104
48
|
export {};
|
|
105
49
|
//# sourceMappingURL=InfoToken.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoToken.d.ts","sourceRoot":"","sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"names":[],"mappings":"AASA,OAAO,EAEH,QAAQ,
|
|
1
|
+
{"version":3,"file":"InfoToken.d.ts","sourceRoot":"","sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"names":[],"mappings":"AASA,OAAO,EAEH,QAAQ,EAGR,OAAO,EACP,yBAAyB,EAEzB,cAAc,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAa,iBAAiB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;IACnC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,UAAU,EAAE,cAAc,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC;IACxB,WAAW,EAAE,6BAA6B,CAAC;IAC3C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,gBAAgB,CAAC;CAC7B,CAAC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AACpG,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvD,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,UAAU,sBAAuB,SAAQ,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC;IAC/E;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAElE,KAAK,0BAA0B,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,EAAE,cAAc,CAAC,KAAK,YAAY,CAAC,GAChH,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AA2HnF,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC"}
|
|
@@ -1,29 +1,46 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Box, createVarsResolver, polymorphicFactory, useProps, useStyles } from '@mantine/core';
|
|
2
|
+
import { IconAlertSquare, IconAlertTriangle, IconBulb, IconCheck, IconHelpCircle, IconInfoCircle } from '@coveord/plasma-react-icons';
|
|
3
|
+
import { Box, createPolymorphicComponent, createVarsResolver, polymorphicFactory, useProps, useStyles } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
4
5
|
import classes from './InfoToken.module.css';
|
|
5
6
|
const defaultProps = {
|
|
6
|
-
variant: '
|
|
7
|
+
variant: 'outline',
|
|
8
|
+
type: 'information',
|
|
7
9
|
size: 'xs'
|
|
8
10
|
};
|
|
9
|
-
const colorResolver = (
|
|
10
|
-
switch(
|
|
11
|
+
const colorResolver = (type)=>{
|
|
12
|
+
switch(type){
|
|
11
13
|
case 'error':
|
|
12
14
|
return 'var(--mantine-color-error)';
|
|
13
15
|
case 'advice':
|
|
14
16
|
case 'question':
|
|
15
17
|
return 'var(--coveo-color-text-primary)';
|
|
16
18
|
case 'warning':
|
|
17
|
-
return 'var(--mantine-color-
|
|
19
|
+
return 'var(--mantine-color-yellow-text)';
|
|
20
|
+
case 'success':
|
|
21
|
+
return 'var(--mantine-color-green-text)';
|
|
18
22
|
case 'information':
|
|
19
23
|
default:
|
|
20
|
-
return 'var(--mantine-color-gray-
|
|
24
|
+
return 'var(--mantine-color-gray-text)';
|
|
21
25
|
}
|
|
22
26
|
};
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const bgColorResolver = (type)=>{
|
|
28
|
+
switch(type){
|
|
29
|
+
case 'error':
|
|
30
|
+
return 'var(--mantine-color-red-light)';
|
|
31
|
+
case 'advice':
|
|
32
|
+
case 'question':
|
|
33
|
+
return 'var(--mantine-primary-color-light)';
|
|
34
|
+
case 'warning':
|
|
35
|
+
return 'var(--mantine-color-yellow-light)';
|
|
36
|
+
case 'success':
|
|
37
|
+
return 'var(--mantine-color-green-light)';
|
|
38
|
+
case 'information':
|
|
39
|
+
default:
|
|
40
|
+
return 'var(--mantine-color-gray-light)';
|
|
26
41
|
}
|
|
42
|
+
};
|
|
43
|
+
const sizeResolver = (size)=>{
|
|
27
44
|
switch(size){
|
|
28
45
|
case 'sm':
|
|
29
46
|
return 20;
|
|
@@ -31,41 +48,40 @@ const sizeResolver = (size)=>{
|
|
|
31
48
|
return 24;
|
|
32
49
|
case 'lg':
|
|
33
50
|
return 32;
|
|
34
|
-
case 'xl':
|
|
35
|
-
return 40;
|
|
36
51
|
case 'xs':
|
|
37
52
|
default:
|
|
38
53
|
return 16;
|
|
39
54
|
}
|
|
40
55
|
};
|
|
41
|
-
const iconResolver = (
|
|
42
|
-
switch(
|
|
56
|
+
const iconResolver = (type)=>{
|
|
57
|
+
switch(type){
|
|
43
58
|
case 'error':
|
|
44
|
-
return
|
|
45
|
-
case 'information':
|
|
46
|
-
return IconInfoCircleFilled;
|
|
47
|
-
case 'information-outline':
|
|
48
|
-
return IconInfoCircle;
|
|
59
|
+
return IconAlertSquare;
|
|
49
60
|
case 'question':
|
|
50
61
|
return IconHelpCircle;
|
|
51
62
|
case 'warning':
|
|
52
|
-
return
|
|
63
|
+
return IconAlertTriangle;
|
|
53
64
|
case 'advice':
|
|
65
|
+
return IconBulb;
|
|
66
|
+
case 'success':
|
|
67
|
+
return IconCheck;
|
|
54
68
|
default:
|
|
55
|
-
return
|
|
69
|
+
return IconInfoCircle;
|
|
56
70
|
}
|
|
57
71
|
};
|
|
58
|
-
const varsResolver = createVarsResolver((_theme, {
|
|
59
|
-
const color = colorResolver(
|
|
72
|
+
const varsResolver = createVarsResolver((_theme, { type })=>{
|
|
73
|
+
const color = colorResolver(type);
|
|
74
|
+
const bgColor = bgColorResolver(type);
|
|
60
75
|
return {
|
|
61
76
|
root: {
|
|
62
|
-
'--
|
|
77
|
+
'--it-color': color,
|
|
78
|
+
'--it-bg': bgColor
|
|
63
79
|
}
|
|
64
80
|
};
|
|
65
81
|
});
|
|
66
|
-
|
|
82
|
+
const _InfoToken = polymorphicFactory((_props, ref)=>{
|
|
67
83
|
const props = useProps('InfoToken', defaultProps, _props);
|
|
68
|
-
const { variant, vars, className, style, unstyled, styles, classNames, size, ...others } = props;
|
|
84
|
+
const { variant, type, vars, className, style, unstyled, styles, classNames, size, ...others } = props;
|
|
69
85
|
const getStyles = useStyles({
|
|
70
86
|
name: 'InfoToken',
|
|
71
87
|
classes,
|
|
@@ -77,12 +93,12 @@ export const InfoToken = polymorphicFactory((_props, ref)=>{
|
|
|
77
93
|
vars,
|
|
78
94
|
varsResolver
|
|
79
95
|
});
|
|
80
|
-
const IconComponent = iconResolver(
|
|
96
|
+
const IconComponent = iconResolver(type);
|
|
81
97
|
return /*#__PURE__*/ _jsx(Box, {
|
|
82
98
|
ref: ref,
|
|
83
99
|
variant: variant,
|
|
84
100
|
role: "img",
|
|
85
|
-
"aria-label":
|
|
101
|
+
"aria-label": type,
|
|
86
102
|
size: size,
|
|
87
103
|
...getStyles('root', {
|
|
88
104
|
className,
|
|
@@ -96,34 +112,22 @@ export const InfoToken = polymorphicFactory((_props, ref)=>{
|
|
|
96
112
|
})
|
|
97
113
|
});
|
|
98
114
|
});
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
117
|
-
TokenError.displayName = 'InfoToken.Error';
|
|
118
|
-
const TokenQuestion = InfoToken.withProps({
|
|
119
|
-
variant: 'question'
|
|
120
|
-
});
|
|
121
|
-
TokenQuestion.displayName = 'InfoToken.Question';
|
|
122
|
-
InfoToken.Information = TokenInformation;
|
|
123
|
-
InfoToken.InformationOutline = TokenInformationOutline;
|
|
124
|
-
InfoToken.Advice = TokenAdvice;
|
|
125
|
-
InfoToken.Warning = TokenWarning;
|
|
126
|
-
InfoToken.Error = TokenError;
|
|
127
|
-
InfoToken.Question = TokenQuestion;
|
|
115
|
+
const createInfoTokenCompound = (type, displayName)=>{
|
|
116
|
+
const Component = createPolymorphicComponent(/*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ _jsx(_InfoToken, {
|
|
117
|
+
ref: ref,
|
|
118
|
+
...props,
|
|
119
|
+
type: type
|
|
120
|
+
})));
|
|
121
|
+
Component.displayName = displayName;
|
|
122
|
+
return Component;
|
|
123
|
+
};
|
|
124
|
+
export const InfoToken = {
|
|
125
|
+
Information: createInfoTokenCompound('information', 'InfoToken.Information'),
|
|
126
|
+
Advice: createInfoTokenCompound('advice', 'InfoToken.Advice'),
|
|
127
|
+
Warning: createInfoTokenCompound('warning', 'InfoToken.Warning'),
|
|
128
|
+
Error: createInfoTokenCompound('error', 'InfoToken.Error'),
|
|
129
|
+
Question: createInfoTokenCompound('question', 'InfoToken.Question'),
|
|
130
|
+
Success: createInfoTokenCompound('success', 'InfoToken.Success')
|
|
131
|
+
};
|
|
128
132
|
|
|
129
133
|
//# sourceMappingURL=InfoToken.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/InfoToken/InfoToken.tsx"],"sourcesContent":["import {\n IconAlertSquare,\n IconAlertTriangle,\n IconBulb,\n IconCheck,\n IconHelpCircle,\n IconInfoCircle,\n TablerIcon,\n} from '@coveord/plasma-react-icons';\nimport {\n Box,\n BoxProps,\n createPolymorphicComponent,\n createVarsResolver,\n Factory,\n PolymorphicComponentProps,\n polymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport {forwardRef, FunctionComponent, ReactElement} from 'react';\nimport classes from './InfoToken.module.css';\n\nexport type InfoTokenFactory = Factory<{\n props: InfoTokenInternalProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: InfoTokenComponentStylesNames;\n vars: InfoTokenCssVariables;\n variant: InfoTokenVariant;\n}>;\nexport type InfoTokenComponentStylesNames = 'root';\nexport type InfoTokenType = 'information' | 'advice' | 'warning' | 'error' | 'question' | 'success';\nexport type InfoTokenVariant = 'outline' | 'light';\nexport type InfoTokenSizes = 'xs' | 'sm' | 'md' | 'lg';\nexport type InfoTokenCssVariables = {\n root: '--it-color' | '--it-bg';\n};\n\ninterface InfoTokenInternalProps extends BoxProps, StylesApiProps<InfoTokenFactory> {\n /**\n * The variant of the token.\n *\n * @default 'outline'\n */\n variant?: InfoTokenVariant;\n /**\n * The semantic type of the token\n *\n * @default 'information'\n */\n type?: InfoTokenType;\n /**\n * The size of the info token.\n *\n * @default 'xs'\n */\n size?: InfoTokenSizes;\n}\n\nexport type InfoTokenProps = Omit<InfoTokenInternalProps, 'type'>;\n\ntype InfoTokenCompoundComponent = (<C = 'div'>(props: PolymorphicComponentProps<C, InfoTokenProps>) => ReactElement) &\n Omit<FunctionComponent<PolymorphicComponentProps<any, InfoTokenProps>>, never>;\n\nconst defaultProps: Partial<InfoTokenInternalProps> = {variant: 'outline', type: 'information', size: 'xs'};\n\nconst colorResolver = (type: InfoTokenType): string => {\n switch (type) {\n case 'error':\n return 'var(--mantine-color-error)';\n case 'advice':\n case 'question':\n return 'var(--coveo-color-text-primary)';\n case 'warning':\n return 'var(--mantine-color-yellow-text)';\n case 'success':\n return 'var(--mantine-color-green-text)';\n case 'information':\n default:\n return 'var(--mantine-color-gray-text)';\n }\n};\n\nconst bgColorResolver = (type: InfoTokenType): string => {\n switch (type) {\n case 'error':\n return 'var(--mantine-color-red-light)';\n case 'advice':\n case 'question':\n return 'var(--mantine-primary-color-light)';\n case 'warning':\n return 'var(--mantine-color-yellow-light)';\n case 'success':\n return 'var(--mantine-color-green-light)';\n case 'information':\n default:\n return 'var(--mantine-color-gray-light)';\n }\n};\n\nconst sizeResolver = (size: InfoTokenSizes): number => {\n switch (size) {\n case 'sm':\n return 20;\n case 'md':\n return 24;\n case 'lg':\n return 32;\n case 'xs':\n default:\n return 16;\n }\n};\n\nconst iconResolver = (type: InfoTokenType): TablerIcon => {\n switch (type) {\n case 'error':\n return IconAlertSquare;\n case 'question':\n return IconHelpCircle;\n case 'warning':\n return IconAlertTriangle;\n case 'advice':\n return IconBulb;\n case 'success':\n return IconCheck;\n default:\n return IconInfoCircle;\n }\n};\n\nconst varsResolver = createVarsResolver<InfoTokenFactory>((_theme, {type}) => {\n const color = colorResolver(type);\n const bgColor = bgColorResolver(type);\n return {\n root: {\n '--it-color': color,\n '--it-bg': bgColor,\n },\n };\n});\n\nconst _InfoToken = polymorphicFactory<InfoTokenFactory>((_props, ref) => {\n const props = useProps('InfoToken', defaultProps, _props);\n const {variant, type, vars, className, style, unstyled, styles, classNames, size, ...others} = props;\n const getStyles = useStyles<InfoTokenFactory>({\n name: 'InfoToken',\n classes,\n className,\n props,\n style,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n const IconComponent = iconResolver(type);\n return (\n <Box\n ref={ref}\n variant={variant}\n role=\"img\"\n aria-label={type}\n size={size}\n {...getStyles('root', {\n className,\n style,\n styles,\n classNames,\n })}\n {...others}\n >\n <IconComponent size={sizeResolver(size)} />\n </Box>\n );\n});\n\nconst createInfoTokenCompound = (type: InfoTokenType, displayName: string): InfoTokenCompoundComponent => {\n const Component: InfoTokenCompoundComponent = createPolymorphicComponent<'div', InfoTokenProps>(\n forwardRef<any, InfoTokenProps>((props, ref) => <_InfoToken ref={ref} {...props} type={type} />),\n );\n Component.displayName = displayName;\n return Component;\n};\n\nexport const InfoToken = {\n Information: createInfoTokenCompound('information', 'InfoToken.Information'),\n Advice: createInfoTokenCompound('advice', 'InfoToken.Advice'),\n Warning: createInfoTokenCompound('warning', 'InfoToken.Warning'),\n Error: createInfoTokenCompound('error', 'InfoToken.Error'),\n Question: createInfoTokenCompound('question', 'InfoToken.Question'),\n Success: createInfoTokenCompound('success', 'InfoToken.Success'),\n} as const;\n"],"names":["IconAlertSquare","IconAlertTriangle","IconBulb","IconCheck","IconHelpCircle","IconInfoCircle","Box","createPolymorphicComponent","createVarsResolver","polymorphicFactory","useProps","useStyles","forwardRef","classes","defaultProps","variant","type","size","colorResolver","bgColorResolver","sizeResolver","iconResolver","varsResolver","_theme","color","bgColor","root","_InfoToken","_props","ref","props","vars","className","style","unstyled","styles","classNames","others","getStyles","name","IconComponent","role","aria-label","createInfoTokenCompound","displayName","Component","InfoToken","Information","Advice","Warning","Error","Question","Success"],"mappings":";AAAA,SACIA,eAAe,EACfC,iBAAiB,EACjBC,QAAQ,EACRC,SAAS,EACTC,cAAc,EACdC,cAAc,QAEX,8BAA8B;AACrC,SACIC,GAAG,EAEHC,0BAA0B,EAC1BC,kBAAkB,EAGlBC,kBAAkB,EAElBC,QAAQ,EACRC,SAAS,QACN,gBAAgB;AACvB,SAAQC,UAAU,QAAwC,QAAQ;AAClE,OAAOC,aAAa,yBAAyB;AA4C7C,MAAMC,eAAgD;IAACC,SAAS;IAAWC,MAAM;IAAeC,MAAM;AAAI;AAE1G,MAAMC,gBAAgB,CAACF;IACnB,OAAQA;QACJ,KAAK;YACD,OAAO;QACX,KAAK;QACL,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;QACL;YACI,OAAO;IACf;AACJ;AAEA,MAAMG,kBAAkB,CAACH;IACrB,OAAQA;QACJ,KAAK;YACD,OAAO;QACX,KAAK;QACL,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;QACL;YACI,OAAO;IACf;AACJ;AAEA,MAAMI,eAAe,CAACH;IAClB,OAAQA;QACJ,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAO;QACX,KAAK;QACL;YACI,OAAO;IACf;AACJ;AAEA,MAAMI,eAAe,CAACL;IAClB,OAAQA;QACJ,KAAK;YACD,OAAOhB;QACX,KAAK;YACD,OAAOI;QACX,KAAK;YACD,OAAOH;QACX,KAAK;YACD,OAAOC;QACX,KAAK;YACD,OAAOC;QACX;YACI,OAAOE;IACf;AACJ;AAEA,MAAMiB,eAAed,mBAAqC,CAACe,QAAQ,EAACP,IAAI,EAAC;IACrE,MAAMQ,QAAQN,cAAcF;IAC5B,MAAMS,UAAUN,gBAAgBH;IAChC,OAAO;QACHU,MAAM;YACF,cAAcF;YACd,WAAWC;QACf;IACJ;AACJ;AAEA,MAAME,aAAalB,mBAAqC,CAACmB,QAAQC;IAC7D,MAAMC,QAAQpB,SAAS,aAAaI,cAAcc;IAClD,MAAM,EAACb,OAAO,EAAEC,IAAI,EAAEe,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,UAAU,EAAEnB,IAAI,EAAE,GAAGoB,QAAO,GAAGP;IAC/F,MAAMQ,YAAY3B,UAA4B;QAC1C4B,MAAM;QACN1B;QACAmB;QACAF;QACAG;QACAE;QACAD;QACAH;QACAT;IACJ;IACA,MAAMkB,gBAAgBnB,aAAaL;IACnC,qBACI,KAACV;QACGuB,KAAKA;QACLd,SAASA;QACT0B,MAAK;QACLC,cAAY1B;QACZC,MAAMA;QACL,GAAGqB,UAAU,QAAQ;YAClBN;YACAC;YACAE;YACAC;QACJ,EAAE;QACD,GAAGC,MAAM;kBAEV,cAAA,KAACG;YAAcvB,MAAMG,aAAaH;;;AAG9C;AAEA,MAAM0B,0BAA0B,CAAC3B,MAAqB4B;IAClD,MAAMC,YAAwCtC,yCAC1CK,WAAgC,CAACkB,OAAOD,oBAAQ,KAACF;YAAWE,KAAKA;YAAM,GAAGC,KAAK;YAAEd,MAAMA;;IAE3F6B,UAAUD,WAAW,GAAGA;IACxB,OAAOC;AACX;AAEA,OAAO,MAAMC,YAAY;IACrBC,aAAaJ,wBAAwB,eAAe;IACpDK,QAAQL,wBAAwB,UAAU;IAC1CM,SAASN,wBAAwB,WAAW;IAC5CO,OAAOP,wBAAwB,SAAS;IACxCQ,UAAUR,wBAAwB,YAAY;IAC9CS,SAAST,wBAAwB,WAAW;AAChD,EAAW"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
--info-token-color: var(--mantine-color-primary);
|
|
3
|
-
|
|
4
2
|
display: inline-flex;
|
|
5
3
|
flex-shrink: 0;
|
|
6
4
|
align-items: center;
|
|
7
|
-
color: var(--
|
|
5
|
+
color: var(--it-color);
|
|
6
|
+
|
|
7
|
+
&[data-variant='light'] {
|
|
8
|
+
background-color: var(--it-bg);
|
|
9
|
+
border-radius: var(--mantine-spacing-xxs);
|
|
10
|
+
padding: var(--mantine-spacing-xs);
|
|
11
|
+
|
|
12
|
+
&[data-size='xs'] {
|
|
13
|
+
padding: var(--mantine-spacing-xxs);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
8
16
|
}
|
|
@@ -12,7 +12,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
|
|
|
12
12
|
}) | (ButtonProps & {
|
|
13
13
|
component: React.ElementType;
|
|
14
14
|
renderRoot?: (props: Record<string, any>) => any;
|
|
15
|
-
})>, never> & import("
|
|
15
|
+
})>, never> & import("@mantine/core").ThemeExtend<{
|
|
16
16
|
props: ButtonProps;
|
|
17
17
|
defaultRef: HTMLButtonElement;
|
|
18
18
|
defaultComponent: "button";
|
|
@@ -30,7 +30,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
|
|
|
30
30
|
DestructiveTertiary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
|
|
31
31
|
DestructiveQuaternary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
|
|
32
32
|
};
|
|
33
|
-
}> & import("
|
|
33
|
+
}> & import("@mantine/core").ComponentClasses<{
|
|
34
34
|
props: ButtonProps;
|
|
35
35
|
defaultRef: HTMLButtonElement;
|
|
36
36
|
defaultComponent: "button";
|
|
@@ -48,7 +48,7 @@ export declare const InlineConfirmTarget: (<C = (<C_1 = "button">(props: import(
|
|
|
48
48
|
DestructiveTertiary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
|
|
49
49
|
DestructiveQuaternary: <L = "button">(props: import("@mantine/core").PolymorphicComponentProps<L, ButtonProps>) => React.ReactElement;
|
|
50
50
|
};
|
|
51
|
-
}> & import("
|
|
51
|
+
}> & import("@mantine/core").PolymorphicComponentWithProps<{
|
|
52
52
|
props: ButtonProps;
|
|
53
53
|
defaultRef: HTMLButtonElement;
|
|
54
54
|
defaultComponent: "button";
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { Input as MantineInput, type InputFactory as MantineInputFactory, type InputProps } from '@mantine/core';
|
|
2
|
+
import { InputLabelInfo, type InputLabelInfoFactory, type InputLabelInfoProps, type InputLabelInfoStylesNames } from './InputLabelInfo.js';
|
|
3
|
+
type PlasmaInputFactory = Omit<MantineInputFactory, 'staticComponents'> & {
|
|
4
|
+
staticComponents: MantineInputFactory['staticComponents'] & {
|
|
5
|
+
LabelInfo: typeof InputLabelInfo;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare const Input: typeof MantineInput & {
|
|
9
|
+
LabelInfo: typeof InputLabelInfo;
|
|
10
|
+
};
|
|
11
|
+
export { Input };
|
|
12
|
+
export type InputFactory = PlasmaInputFactory;
|
|
13
|
+
export type { InputProps, InputLabelInfoFactory, InputLabelInfoProps, InputLabelInfoStylesNames };
|
|
14
|
+
export { InputLabelInfo };
|
|
2
15
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,YAAY,EAAE,KAAK,YAAY,IAAI,mBAAmB,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AAC/G,OAAO,EACH,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EACjC,MAAM,qBAAqB,CAAC;AAE7B,KAAK,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,GAAG;IACtE,gBAAgB,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,GAAG;QACxD,SAAS,EAAE,OAAO,cAAc,CAAC;KACpC,CAAC;CACL,CAAC;AAEF,QAAA,MAAM,KAAK,EAAmB,OAAO,YAAY,GAAG;IAChD,SAAS,EAAE,OAAO,cAAc,CAAC;CACpC,CAAC;AAOF,OAAO,EAAC,KAAK,EAAC,CAAC;AACf,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC9C,YAAY,EAAC,UAAU,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,yBAAyB,EAAC,CAAC;AAChG,OAAO,EAAC,cAAc,EAAC,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { Input } from '@mantine/core';
|
|
1
|
+
import { Input as MantineInput } from '@mantine/core';
|
|
2
|
+
import { InputLabelInfo } from './InputLabelInfo.js';
|
|
3
|
+
const Input = MantineInput;
|
|
2
4
|
Input.displayName = 'Input';
|
|
3
|
-
|
|
5
|
+
Input.LabelInfo = InputLabelInfo;
|
|
6
|
+
InputLabelInfo.displayName = 'Input.LabelInfo';
|
|
7
|
+
export { Input };
|
|
8
|
+
export { InputLabelInfo };
|
|
4
9
|
|
|
5
10
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Input/Input.ts"],"sourcesContent":["import {Input} from '@mantine/core';\n\nInput.displayName = 'Input';\n\nexport {Input
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Input/Input.ts"],"sourcesContent":["import {Input as MantineInput, type InputFactory as MantineInputFactory, type InputProps} from '@mantine/core';\nimport {\n InputLabelInfo,\n type InputLabelInfoFactory,\n type InputLabelInfoProps,\n type InputLabelInfoStylesNames,\n} from './InputLabelInfo.js';\n\ntype PlasmaInputFactory = Omit<MantineInputFactory, 'staticComponents'> & {\n staticComponents: MantineInputFactory['staticComponents'] & {\n LabelInfo: typeof InputLabelInfo;\n };\n};\n\nconst Input = MantineInput as typeof MantineInput & {\n LabelInfo: typeof InputLabelInfo;\n};\n\nInput.displayName = 'Input';\nInput.LabelInfo = InputLabelInfo;\n\nInputLabelInfo.displayName = 'Input.LabelInfo';\n\nexport {Input};\nexport type InputFactory = PlasmaInputFactory;\nexport type {InputProps, InputLabelInfoFactory, InputLabelInfoProps, InputLabelInfoStylesNames};\nexport {InputLabelInfo};\n"],"names":["Input","MantineInput","InputLabelInfo","displayName","LabelInfo"],"mappings":"AAAA,SAAQA,SAASC,YAAY,QAAkE,gBAAgB;AAC/G,SACIC,cAAc,QAIX,sBAAsB;AAQ7B,MAAMF,QAAQC;AAIdD,MAAMG,WAAW,GAAG;AACpBH,MAAMI,SAAS,GAAGF;AAElBA,eAAeC,WAAW,GAAG;AAE7B,SAAQH,KAAK,GAAE;AAGf,SAAQE,cAAc,GAAE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StylesApiProps, type Factory, type TooltipProps } from '@mantine/core';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export type InputLabelInfoStylesNames = 'labelInfo';
|
|
4
|
+
export interface InputLabelInfoProps extends Omit<TooltipProps, 'label' | 'classNames' | 'attributes' | 'styles' | 'vars'>, StylesApiProps<InputLabelInfoFactory> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export type InputLabelInfoFactory = Factory<{
|
|
8
|
+
props: InputLabelInfoProps;
|
|
9
|
+
ref: HTMLSpanElement;
|
|
10
|
+
stylesNames: InputLabelInfoStylesNames;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const InputLabelInfo: import("@mantine/core").MantineComponent<{
|
|
13
|
+
props: InputLabelInfoProps;
|
|
14
|
+
ref: HTMLSpanElement;
|
|
15
|
+
stylesNames: InputLabelInfoStylesNames;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=InputLabelInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLabelInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/InputLabelInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAgC,KAAK,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AACrH,OAAO,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAIrC,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC;AAEpD,MAAM,WAAW,mBACb,SACI,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC,EAC7E,cAAc,CAAC,qBAAqB,CAAC;IACzC,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,EAAE,yBAAyB,CAAC;CAC1C,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc;WAPhB,mBAAmB;SACrB,eAAe;iBACP,yBAAyB;EAyBxC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { factory, Tooltip, useProps, useStyles } from '@mantine/core';
|
|
3
|
+
import { InfoToken } from '../InfoToken/InfoToken.js';
|
|
4
|
+
import classes from './InputLabelInfo.module.css';
|
|
5
|
+
const defaultProps = {};
|
|
6
|
+
export const InputLabelInfo = factory((_props, ref)=>{
|
|
7
|
+
const props = useProps('InputLabelInfo', defaultProps, _props);
|
|
8
|
+
const { classNames, className, style, styles, unstyled, vars, children, attributes, ...others } = props;
|
|
9
|
+
const getStyles = useStyles({
|
|
10
|
+
name: 'InputLabelInfo',
|
|
11
|
+
props,
|
|
12
|
+
style,
|
|
13
|
+
styles,
|
|
14
|
+
unstyled,
|
|
15
|
+
attributes,
|
|
16
|
+
className,
|
|
17
|
+
classes,
|
|
18
|
+
classNames,
|
|
19
|
+
vars
|
|
20
|
+
});
|
|
21
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
22
|
+
label: children,
|
|
23
|
+
...others,
|
|
24
|
+
children: /*#__PURE__*/ _jsx(InfoToken.Information, {
|
|
25
|
+
component: "span",
|
|
26
|
+
...getStyles('labelInfo', {
|
|
27
|
+
className,
|
|
28
|
+
style
|
|
29
|
+
}),
|
|
30
|
+
ref: ref
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=InputLabelInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Input/InputLabelInfo.tsx"],"sourcesContent":["import {factory, StylesApiProps, Tooltip, useProps, useStyles, type Factory, type TooltipProps} from '@mantine/core';\nimport {type ReactNode} from 'react';\nimport {InfoToken} from '../InfoToken/InfoToken.js';\nimport classes from './InputLabelInfo.module.css';\n\nexport type InputLabelInfoStylesNames = 'labelInfo';\n\nexport interface InputLabelInfoProps\n extends\n Omit<TooltipProps, 'label' | 'classNames' | 'attributes' | 'styles' | 'vars'>,\n StylesApiProps<InputLabelInfoFactory> {\n children: ReactNode;\n}\n\nexport type InputLabelInfoFactory = Factory<{\n props: InputLabelInfoProps;\n ref: HTMLSpanElement;\n stylesNames: InputLabelInfoStylesNames;\n}>;\n\nconst defaultProps = {} satisfies Partial<InputLabelInfoProps>;\n\nexport const InputLabelInfo = factory<InputLabelInfoFactory>((_props, ref) => {\n const props = useProps('InputLabelInfo', defaultProps, _props);\n const {classNames, className, style, styles, unstyled, vars, children, attributes, ...others} = props;\n const getStyles = useStyles<InputLabelInfoFactory>({\n name: 'InputLabelInfo',\n props,\n style,\n styles,\n unstyled,\n attributes,\n className,\n classes,\n classNames,\n vars,\n });\n return (\n <Tooltip label={children} {...others}>\n <InfoToken.Information component=\"span\" {...getStyles('labelInfo', {className, style})} ref={ref} />\n </Tooltip>\n );\n});\n"],"names":["factory","Tooltip","useProps","useStyles","InfoToken","classes","defaultProps","InputLabelInfo","_props","ref","props","classNames","className","style","styles","unstyled","vars","children","attributes","others","getStyles","name","label","Information","component"],"mappings":";AAAA,SAAQA,OAAO,EAAkBC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAwC,gBAAgB;AAErH,SAAQC,SAAS,QAAO,4BAA4B;AACpD,OAAOC,aAAa,8BAA8B;AAiBlD,MAAMC,eAAe,CAAC;AAEtB,OAAO,MAAMC,iBAAiBP,QAA+B,CAACQ,QAAQC;IAClE,MAAMC,QAAQR,SAAS,kBAAkBI,cAAcE;IACvD,MAAM,EAACG,UAAU,EAAEC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGC,QAAO,GAAGT;IAChG,MAAMU,YAAYjB,UAAiC;QAC/CkB,MAAM;QACNX;QACAG;QACAC;QACAC;QACAG;QACAN;QACAP;QACAM;QACAK;IACJ;IACA,qBACI,KAACf;QAAQqB,OAAOL;QAAW,GAAGE,MAAM;kBAChC,cAAA,KAACf,UAAUmB,WAAW;YAACC,WAAU;YAAQ,GAAGJ,UAAU,aAAa;gBAACR;gBAAWC;YAAK,EAAE;YAAEJ,KAAKA;;;AAGzG,GAAG"}
|
|
@@ -20,7 +20,7 @@ const PlasmaModal = factory(({ title, description, help, ...otherProps }, ref)=>
|
|
|
20
20
|
...otherProps
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
|
-
PlasmaModal.displayName = '
|
|
23
|
+
PlasmaModal.displayName = 'Modal';
|
|
24
24
|
PlasmaModal.Root = MantineModal.Root;
|
|
25
25
|
PlasmaModal.Body = MantineModal.Body;
|
|
26
26
|
PlasmaModal.Overlay = MantineModal.Overlay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n factory,\n Modal as MantineModal,\n ModalFactory as MantineModalFactory,\n ModalProps as MantineModalProps,\n} from '@mantine/core';\nimport {Header, type HeaderDocAnchorProps, type HeaderProps} from '../Header/Header.js';\nimport {ModalFooter as PlasmaModalFooter} from './ModalFooter.js';\n\ninterface PlasmaModalProps extends MantineModalProps {\n /**\n * Description of the modal, displayed below the title.\n */\n description?: HeaderProps['description'];\n /**\n * Help link for the modal, displayed in the header.\n * Usually provides a link to external documentation or help resources.\n */\n help?: HeaderDocAnchorProps;\n}\n\n// Need to redeclare the factory to override and add footer to the props type\ntype PlasmaModalFactory = Omit<MantineModalFactory, 'staticComponents'> & {\n props: PlasmaModalProps;\n staticComponents: MantineModalFactory['staticComponents'] & {\n Footer: typeof PlasmaModalFooter;\n };\n};\n\nconst PlasmaModal = factory<PlasmaModalFactory>(({title, description, help, ...otherProps}, ref) => {\n const header =\n typeof title === 'string' ? (\n <Header titleComponent=\"div\" variant=\"secondary\" description={description}>\n {title}\n {help && <Header.DocAnchor {...help} />}\n </Header>\n ) : (\n title\n );\n return <MantineModal ref={ref} title={header} {...otherProps} />;\n});\n\nPlasmaModal.displayName = '
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n factory,\n Modal as MantineModal,\n ModalFactory as MantineModalFactory,\n ModalProps as MantineModalProps,\n} from '@mantine/core';\nimport {Header, type HeaderDocAnchorProps, type HeaderProps} from '../Header/Header.js';\nimport {ModalFooter as PlasmaModalFooter} from './ModalFooter.js';\n\ninterface PlasmaModalProps extends MantineModalProps {\n /**\n * Description of the modal, displayed below the title.\n */\n description?: HeaderProps['description'];\n /**\n * Help link for the modal, displayed in the header.\n * Usually provides a link to external documentation or help resources.\n */\n help?: HeaderDocAnchorProps;\n}\n\n// Need to redeclare the factory to override and add footer to the props type\ntype PlasmaModalFactory = Omit<MantineModalFactory, 'staticComponents'> & {\n props: PlasmaModalProps;\n staticComponents: MantineModalFactory['staticComponents'] & {\n Footer: typeof PlasmaModalFooter;\n };\n};\n\nconst PlasmaModal = factory<PlasmaModalFactory>(({title, description, help, ...otherProps}, ref) => {\n const header =\n typeof title === 'string' ? (\n <Header titleComponent=\"div\" variant=\"secondary\" description={description}>\n {title}\n {help && <Header.DocAnchor {...help} />}\n </Header>\n ) : (\n title\n );\n return <MantineModal ref={ref} title={header} {...otherProps} />;\n});\n\nPlasmaModal.displayName = 'Modal';\nPlasmaModal.Root = MantineModal.Root;\nPlasmaModal.Body = MantineModal.Body;\nPlasmaModal.Overlay = MantineModal.Overlay;\nPlasmaModal.Content = MantineModal.Content;\nPlasmaModal.Header = MantineModal.Header;\nPlasmaModal.Title = MantineModal.Title;\nPlasmaModal.CloseButton = MantineModal.CloseButton;\nPlasmaModal.Stack = MantineModal.Stack;\nPlasmaModal.Footer = PlasmaModalFooter;\n\nexport const Modal = PlasmaModal;\nexport type ModalProps = PlasmaModalProps;\n\nexport type ModalFactory = PlasmaModalFactory;\nexport type {ModalRootProps, ModalCssVariables, ModalStylesNames} from '@mantine/core';\n"],"names":["factory","Modal","MantineModal","Header","ModalFooter","PlasmaModalFooter","PlasmaModal","title","description","help","otherProps","ref","header","titleComponent","variant","DocAnchor","displayName","Root","Body","Overlay","Content","Title","CloseButton","Stack","Footer"],"mappings":";AAAA,SACIA,OAAO,EACPC,SAASC,YAAY,QAGlB,gBAAgB;AACvB,SAAQC,MAAM,QAAoD,sBAAsB;AACxF,SAAQC,eAAeC,iBAAiB,QAAO,mBAAmB;AAsBlE,MAAMC,cAAcN,QAA4B,CAAC,EAACO,KAAK,EAAEC,WAAW,EAAEC,IAAI,EAAE,GAAGC,YAAW,EAAEC;IACxF,MAAMC,SACF,OAAOL,UAAU,yBACb,MAACJ;QAAOU,gBAAe;QAAMC,SAAQ;QAAYN,aAAaA;;YACzDD;YACAE,sBAAQ,KAACN,OAAOY,SAAS;gBAAE,GAAGN,IAAI;;;SAGvCF;IAER,qBAAO,KAACL;QAAaS,KAAKA;QAAKJ,OAAOK;QAAS,GAAGF,UAAU;;AAChE;AAEAJ,YAAYU,WAAW,GAAG;AAC1BV,YAAYW,IAAI,GAAGf,aAAae,IAAI;AACpCX,YAAYY,IAAI,GAAGhB,aAAagB,IAAI;AACpCZ,YAAYa,OAAO,GAAGjB,aAAaiB,OAAO;AAC1Cb,YAAYc,OAAO,GAAGlB,aAAakB,OAAO;AAC1Cd,YAAYH,MAAM,GAAGD,aAAaC,MAAM;AACxCG,YAAYe,KAAK,GAAGnB,aAAamB,KAAK;AACtCf,YAAYgB,WAAW,GAAGpB,aAAaoB,WAAW;AAClDhB,YAAYiB,KAAK,GAAGrB,aAAaqB,KAAK;AACtCjB,YAAYkB,MAAM,GAAGnB;AAErB,OAAO,MAAMJ,QAAQK,YAAY"}
|
|
@@ -20,10 +20,12 @@ export const ModalFooter = factory((props, ref)=>{
|
|
|
20
20
|
props.h
|
|
21
21
|
]);
|
|
22
22
|
return /*#__PURE__*/ _jsx(StickyFooter, {
|
|
23
|
+
borderTop: true,
|
|
23
24
|
className: classes.root,
|
|
24
25
|
ref: footerRef,
|
|
25
26
|
...props
|
|
26
27
|
});
|
|
27
28
|
});
|
|
29
|
+
ModalFooter.displayName = 'Modal.Footer';
|
|
28
30
|
|
|
29
31
|
//# sourceMappingURL=ModalFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import {useRef, useEffect} from 'react';\nimport {Factory, factory} from '@mantine/core';\nimport {StickyFooter, type StickyFooterProps, type StickyFooterStylesNames} from '../StickyFooter/StickyFooter.js';\nimport classes from './ModalFooter.module.css';\n\nexport interface ModalFooterProps extends Omit<StickyFooterProps, 'variant'> {}\n\nexport type ModalFooterStylesNames = StickyFooterStylesNames;\n\nexport type ModalFooterFactory = Factory<{\n props: ModalFooterProps;\n ref: HTMLDivElement;\n stylesNames: ModalFooterStylesNames;\n}>;\n\nconst ensuresFooterHasEvenHeight = (footer: HTMLElement) => {\n const remainder = footer.offsetHeight % 2;\n footer.style.height = `${footer.offsetHeight - remainder + 2}px`;\n};\n\nexport const ModalFooter = factory<ModalFooterFactory>((props, ref) => {\n const _ref = useRef<HTMLDivElement>(null);\n\n const footerRef = ref || _ref;\n\n useEffect(() => {\n if (typeof footerRef !== 'function' && footerRef.current) {\n ensuresFooterHasEvenHeight(footerRef.current);\n }\n\n // if ref === 'function', this is a callback ref. Haven't found any solution for adjusting the height in this case\n }, [ref, props.h]);\n\n return <StickyFooter className={classes.root} ref={footerRef} {...props} />;\n});\n"],"names":["useRef","useEffect","factory","StickyFooter","classes","ensuresFooterHasEvenHeight","footer","remainder","offsetHeight","style","height","ModalFooter","props","ref","_ref","footerRef","current","h","className","root"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,SAAS,QAAO,QAAQ;AACxC,SAAiBC,OAAO,QAAO,gBAAgB;AAC/C,SAAQC,YAAY,QAA6D,kCAAkC;AACnH,OAAOC,aAAa,2BAA2B;AAY/C,MAAMC,6BAA6B,CAACC;IAChC,MAAMC,YAAYD,OAAOE,YAAY,GAAG;IACxCF,OAAOG,KAAK,CAACC,MAAM,GAAG,GAAGJ,OAAOE,YAAY,GAAGD,YAAY,EAAE,EAAE,CAAC;AACpE;AAEA,OAAO,MAAMI,cAAcT,QAA4B,CAACU,OAAOC;IAC3D,MAAMC,OAAOd,OAAuB;IAEpC,MAAMe,YAAYF,OAAOC;IAEzBb,UAAU;QACN,IAAI,OAAOc,cAAc,cAAcA,UAAUC,OAAO,EAAE;YACtDX,2BAA2BU,UAAUC,OAAO;QAChD;IAEA,kHAAkH;IACtH,GAAG;QAACH;QAAKD,MAAMK,CAAC;KAAC;IAEjB,qBAAO,KAACd;QAAae,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Modal/ModalFooter.tsx"],"sourcesContent":["import {useRef, useEffect} from 'react';\nimport {Factory, factory} from '@mantine/core';\nimport {StickyFooter, type StickyFooterProps, type StickyFooterStylesNames} from '../StickyFooter/StickyFooter.js';\nimport classes from './ModalFooter.module.css';\n\nexport interface ModalFooterProps extends Omit<StickyFooterProps, 'variant'> {}\n\nexport type ModalFooterStylesNames = StickyFooterStylesNames;\n\nexport type ModalFooterFactory = Factory<{\n props: ModalFooterProps;\n ref: HTMLDivElement;\n stylesNames: ModalFooterStylesNames;\n}>;\n\nconst ensuresFooterHasEvenHeight = (footer: HTMLElement) => {\n const remainder = footer.offsetHeight % 2;\n footer.style.height = `${footer.offsetHeight - remainder + 2}px`;\n};\n\nexport const ModalFooter = factory<ModalFooterFactory>((props, ref) => {\n const _ref = useRef<HTMLDivElement>(null);\n\n const footerRef = ref || _ref;\n\n useEffect(() => {\n if (typeof footerRef !== 'function' && footerRef.current) {\n ensuresFooterHasEvenHeight(footerRef.current);\n }\n\n // if ref === 'function', this is a callback ref. Haven't found any solution for adjusting the height in this case\n }, [ref, props.h]);\n\n return <StickyFooter borderTop className={classes.root} ref={footerRef} {...props} />;\n});\n\nModalFooter.displayName = 'Modal.Footer';\n"],"names":["useRef","useEffect","factory","StickyFooter","classes","ensuresFooterHasEvenHeight","footer","remainder","offsetHeight","style","height","ModalFooter","props","ref","_ref","footerRef","current","h","borderTop","className","root","displayName"],"mappings":";AAAA,SAAQA,MAAM,EAAEC,SAAS,QAAO,QAAQ;AACxC,SAAiBC,OAAO,QAAO,gBAAgB;AAC/C,SAAQC,YAAY,QAA6D,kCAAkC;AACnH,OAAOC,aAAa,2BAA2B;AAY/C,MAAMC,6BAA6B,CAACC;IAChC,MAAMC,YAAYD,OAAOE,YAAY,GAAG;IACxCF,OAAOG,KAAK,CAACC,MAAM,GAAG,GAAGJ,OAAOE,YAAY,GAAGD,YAAY,EAAE,EAAE,CAAC;AACpE;AAEA,OAAO,MAAMI,cAAcT,QAA4B,CAACU,OAAOC;IAC3D,MAAMC,OAAOd,OAAuB;IAEpC,MAAMe,YAAYF,OAAOC;IAEzBb,UAAU;QACN,IAAI,OAAOc,cAAc,cAAcA,UAAUC,OAAO,EAAE;YACtDX,2BAA2BU,UAAUC,OAAO;QAChD;IAEA,kHAAkH;IACtH,GAAG;QAACH;QAAKD,MAAMK,CAAC;KAAC;IAEjB,qBAAO,KAACd;QAAae,SAAS;QAACC,WAAWf,QAAQgB,IAAI;QAAEP,KAAKE;QAAY,GAAGH,KAAK;;AACrF,GAAG;AAEHD,YAAYU,WAAW,GAAG"}
|