@coveord/plasma-mantine 52.26.3 → 52.26.4
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 +3 -3
- package/.turbo/turbo-test.log +34 -128
- package/dist/.tsbuildinfo +1 -1
- package/dist/esm/components/action-icon/ActionIcon.js +29 -80
- package/dist/esm/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/esm/components/action-icon/index.js +1 -1
- package/dist/esm/components/blank-slate/BlankSlate.js +3 -6
- package/dist/esm/components/blank-slate/BlankSlate.js.map +1 -1
- package/dist/esm/components/blank-slate/index.js +1 -1
- package/dist/esm/components/browser-preview/BrowserPreview.js +16 -28
- package/dist/esm/components/browser-preview/BrowserPreview.js.map +1 -1
- package/dist/esm/components/browser-preview/BrowserPreview.styles.js +6 -8
- package/dist/esm/components/browser-preview/BrowserPreview.styles.js.map +1 -1
- package/dist/esm/components/browser-preview/index.js +1 -1
- package/dist/esm/components/button/Button.js +29 -80
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/ButtonWithDisabledTooltip.js +16 -28
- package/dist/esm/components/button/ButtonWithDisabledTooltip.js.map +1 -1
- package/dist/esm/components/button/index.js +1 -1
- package/dist/esm/components/code-editor/CodeEditor.js +76 -144
- package/dist/esm/components/code-editor/CodeEditor.js.map +1 -1
- package/dist/esm/components/code-editor/index.js +1 -1
- package/dist/esm/components/code-editor/languages/xml.js +18 -32
- package/dist/esm/components/code-editor/languages/xml.js.map +1 -1
- package/dist/esm/components/code-editor/search/Search.js +6 -13
- package/dist/esm/components/code-editor/search/Search.js.map +1 -1
- package/dist/esm/components/code-editor/search/index.js +1 -1
- package/dist/esm/components/collection/Collection.js +57 -110
- package/dist/esm/components/collection/Collection.js.map +1 -1
- package/dist/esm/components/collection/Collection.styles.js +7 -9
- package/dist/esm/components/collection/Collection.styles.js.map +1 -1
- package/dist/esm/components/collection/CollectionItem.js +47 -54
- package/dist/esm/components/collection/CollectionItem.js.map +1 -1
- package/dist/esm/components/collection/index.js +1 -1
- package/dist/esm/components/copyToClipboard/CopyToClipboard.js +19 -29
- package/dist/esm/components/copyToClipboard/CopyToClipboard.js.map +1 -1
- package/dist/esm/components/copyToClipboard/index.js +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js +29 -32
- package/dist/esm/components/date-range-picker/DateRangePickerInlineCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js +22 -29
- package/dist/esm/components/date-range-picker/DateRangePickerPopoverCalendar.js.map +1 -1
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js +19 -30
- package/dist/esm/components/date-range-picker/DateRangePickerPresetSelect.js.map +1 -1
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.js +21 -22
- package/dist/esm/components/date-range-picker/EditableDateRangePicker.js.map +1 -1
- package/dist/esm/components/date-range-picker/index.js +3 -3
- package/dist/esm/components/header/Header.js +28 -48
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/components/header/Header.styles.js +7 -10
- package/dist/esm/components/header/Header.styles.js.map +1 -1
- package/dist/esm/components/header/HeaderActions/HeaderActions.js +16 -25
- package/dist/esm/components/header/HeaderActions/HeaderActions.js.map +1 -1
- package/dist/esm/components/header/HeaderActions/HeaderActions.styles.js +3 -7
- package/dist/esm/components/header/HeaderActions/HeaderActions.styles.js.map +1 -1
- package/dist/esm/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.js +13 -22
- package/dist/esm/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.js.map +1 -1
- package/dist/esm/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.styles.js +3 -7
- package/dist/esm/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.styles.js.map +1 -1
- package/dist/esm/components/header/HeaderDocAnchor/HeaderDocAnchor.js +17 -28
- package/dist/esm/components/header/HeaderDocAnchor/HeaderDocAnchor.js.map +1 -1
- package/dist/esm/components/header/HeaderDocAnchor/HeaderDocAnchor.styles.js +4 -8
- package/dist/esm/components/header/HeaderDocAnchor/HeaderDocAnchor.styles.js.map +1 -1
- package/dist/esm/components/header/index.js +1 -1
- package/dist/esm/components/index.js +15 -15
- package/dist/esm/components/inline-confirm/InlineConfirm.js +14 -20
- package/dist/esm/components/inline-confirm/InlineConfirm.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js +11 -17
- package/dist/esm/components/inline-confirm/InlineConfirmButton.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmContext.js +2 -2
- package/dist/esm/components/inline-confirm/InlineConfirmContext.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js +11 -17
- package/dist/esm/components/inline-confirm/InlineConfirmMenuItem.js.map +1 -1
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js +8 -9
- package/dist/esm/components/inline-confirm/InlineConfirmPrompt.js.map +1 -1
- package/dist/esm/components/inline-confirm/index.js +3 -3
- package/dist/esm/components/inline-confirm/useInlineConfirm.js +5 -5
- package/dist/esm/components/inline-confirm/useInlineConfirm.js.map +1 -1
- package/dist/esm/components/menu/Menu.js +13 -21
- package/dist/esm/components/menu/Menu.js.map +1 -1
- package/dist/esm/components/menu/index.js +1 -1
- package/dist/esm/components/modal-wizard/ModalWizard.js +57 -108
- package/dist/esm/components/modal-wizard/ModalWizard.js.map +1 -1
- package/dist/esm/components/modal-wizard/ModalWizardStep.js +1 -4
- package/dist/esm/components/modal-wizard/ModalWizardStep.js.map +1 -1
- package/dist/esm/components/modal-wizard/index.js +1 -1
- package/dist/esm/components/prompt/Prompt.js +29 -41
- package/dist/esm/components/prompt/Prompt.js.map +1 -1
- package/dist/esm/components/prompt/PromptFooter.js +4 -11
- package/dist/esm/components/prompt/PromptFooter.js.map +1 -1
- package/dist/esm/components/prompt/index.js +1 -1
- package/dist/esm/components/sticky-footer/StickyFooter.js +21 -35
- package/dist/esm/components/sticky-footer/StickyFooter.js.map +1 -1
- package/dist/esm/components/sticky-footer/index.js +1 -1
- package/dist/esm/components/table/Table.js +94 -123
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.styles.js +11 -13
- package/dist/esm/components/table/Table.styles.js.map +1 -1
- package/dist/esm/components/table/TableContext.js +5 -5
- package/dist/esm/components/table/TableContext.js.map +1 -1
- package/dist/esm/components/table/index.js +3 -3
- package/dist/esm/components/table/layouts/RowLayout.js +59 -79
- package/dist/esm/components/table/layouts/RowLayout.js.map +1 -1
- package/dist/esm/components/table/layouts/RowLayout.styles.js +27 -28
- package/dist/esm/components/table/layouts/RowLayout.styles.js.map +1 -1
- package/dist/esm/components/table/layouts/TableLayoutControl.js +10 -13
- package/dist/esm/components/table/layouts/TableLayoutControl.js.map +1 -1
- package/dist/esm/components/table/layouts/TableLayouts.js +2 -2
- package/dist/esm/components/table/layouts/TableLayouts.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableActions.js +17 -26
- package/dist/esm/components/table/table-actions/TableActions.js.map +1 -1
- package/dist/esm/components/table/table-actions/TableActions.styles.js +5 -7
- package/dist/esm/components/table/table-actions/TableActions.styles.js.map +1 -1
- package/dist/esm/components/table/table-column/TableCollapsibleColumn.js +19 -23
- package/dist/esm/components/table/table-column/TableCollapsibleColumn.js.map +1 -1
- package/dist/esm/components/table/table-column/TableSelectableColumn.js +9 -13
- package/dist/esm/components/table/table-column/TableSelectableColumn.js.map +1 -1
- package/dist/esm/components/table/table-consumer/TableConsumer.js +1 -4
- package/dist/esm/components/table/table-consumer/TableConsumer.js.map +1 -1
- package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.js +28 -43
- package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.js.map +1 -1
- package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.styles.js +3 -5
- package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.styles.js.map +1 -1
- package/dist/esm/components/table/table-filter/TableFilter.js +30 -40
- package/dist/esm/components/table/table-filter/TableFilter.js.map +1 -1
- package/dist/esm/components/table/table-filter/TableFilter.styles.js +4 -6
- package/dist/esm/components/table/table-filter/TableFilter.styles.js.map +1 -1
- package/dist/esm/components/table/table-footer/TableFooter.js +5 -13
- package/dist/esm/components/table/table-footer/TableFooter.js.map +1 -1
- package/dist/esm/components/table/table-header/TableHeader.js +20 -29
- package/dist/esm/components/table/table-header/TableHeader.js.map +1 -1
- package/dist/esm/components/table/table-header/TableHeader.styles.js +8 -10
- package/dist/esm/components/table/table-header/TableHeader.styles.js.map +1 -1
- package/dist/esm/components/table/table-header/Th.js +27 -35
- package/dist/esm/components/table/table-header/Th.js.map +1 -1
- package/dist/esm/components/table/table-header/Th.styles.js +13 -16
- package/dist/esm/components/table/table-header/Th.styles.js.map +1 -1
- package/dist/esm/components/table/table-last-updated/TableLastUpdated.js +24 -35
- package/dist/esm/components/table/table-last-updated/TableLastUpdated.js.map +1 -1
- package/dist/esm/components/table/table-last-updated/TableLastUpdated.styles.js +4 -6
- package/dist/esm/components/table/table-last-updated/TableLastUpdated.styles.js.map +1 -1
- package/dist/esm/components/table/table-loading/TableLoading.js +4 -7
- package/dist/esm/components/table/table-loading/TableLoading.js.map +1 -1
- package/dist/esm/components/table/table-pagination/TablePagination.js +21 -25
- package/dist/esm/components/table/table-pagination/TablePagination.js.map +1 -1
- package/dist/esm/components/table/table-per-page/TablePerPage.js +15 -24
- package/dist/esm/components/table/table-per-page/TablePerPage.js.map +1 -1
- package/dist/esm/components/table/table-predicate/TablePredicate.js +25 -35
- package/dist/esm/components/table/table-predicate/TablePredicate.js.map +1 -1
- package/dist/esm/components/table/table-predicate/TablePredicate.styles.js +3 -5
- package/dist/esm/components/table/table-predicate/TablePredicate.styles.js.map +1 -1
- package/dist/esm/form/FormProvider.js +9 -10
- package/dist/esm/form/FormProvider.js.map +1 -1
- package/dist/esm/form/index.js +2 -2
- package/dist/esm/form/useForm.js +18 -25
- package/dist/esm/form/useForm.js.map +1 -1
- package/dist/esm/hooks/index.js +2 -2
- package/dist/esm/hooks/useControlledList.js +24 -30
- package/dist/esm/hooks/useControlledList.js.map +1 -1
- package/dist/esm/hooks/useParentHeight.js +10 -11
- package/dist/esm/hooks/useParentHeight.js.map +1 -1
- package/dist/esm/hooks/useRowSelection.js +33 -44
- package/dist/esm/hooks/useRowSelection.js.map +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/esm/theme/PlasmaColors.js +13 -15
- package/dist/esm/theme/PlasmaColors.js.map +1 -1
- package/dist/esm/theme/Plasmantine.js +3 -6
- package/dist/esm/theme/Plasmantine.js.map +1 -1
- package/dist/esm/theme/Theme.js +142 -171
- package/dist/esm/theme/Theme.js.map +1 -1
- package/dist/esm/theme/index.js +1 -1
- package/dist/esm/utils/createPolymorphicComponent.js +2 -2
- package/dist/esm/utils/createPolymorphicComponent.js.map +1 -1
- package/dist/esm/utils/index.js +2 -2
- package/dist/esm/utils/overrideComponent.js +2 -8
- package/dist/esm/utils/overrideComponent.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {\n DefaultProps,\n Divider,\n Group,\n GroupProps,\n Selectors,\n Stack,\n Text,\n Title,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\n\nimport {HeaderStylesParams, useStyles} from './Header.styles';\nimport {HeaderActions} from './HeaderActions/HeaderActions';\nimport {HeaderBreadcrumbs} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {HeaderDocAnchor} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type {HeaderDocAnchorProps, HeaderDocAnchorStylesNames} from './HeaderDocAnchor/HeaderDocAnchor';\nexport type {HeaderBreadcrumbsProps, HeaderBreadcrumbsStylesNames} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nexport type {HeaderActionsProps, HeaderActionsStylesNames} from './HeaderActions/HeaderActions';\nexport type HeaderStylesNames = Selectors<typeof useStyles>;\n\nexport interface HeaderProps extends Omit<GroupProps, 'styles'>, DefaultProps<HeaderStylesNames, HeaderStylesParams> {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * Use the modal variant when displaying the header inside a modal\n *\n * @default 'page'\n */\n variant?: 'page' | 'modal';\n /**\n * The title of the header.\n */\n children: ReactNode;\n}\n\ninterface HeaderType {\n (props: HeaderProps): ReactElement;\n Breadcrumbs: typeof HeaderBreadcrumbs;\n Actions: typeof HeaderActions;\n DocAnchor: typeof HeaderDocAnchor;\n}\n\nconst defaultProps: Partial<HeaderProps> = {\n variant: 'page',\n position: 'apart',\n noWrap: true,\n};\n\nexport const Header: HeaderType = (props: HeaderProps) => {\n const {classNames, styles, unstyled, className, description, borderBottom, variant, children, ...others} =\n useComponentDefaultProps('PlasmaHeader', defaultProps, props);\n const {classes, cx} = useStyles({variant}, {name: 'PlasmaHeader', classNames, styles, unstyled});\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);\n const actions = convertedChildren.find((child) => child.type === HeaderActions);\n const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);\n const otherChildren = convertedChildren.filter(\n (child) => child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor,\n );\n return (\n <>\n <Group className={cx(className, classes.root)} {...others}>\n <Stack spacing={0}>\n {breadcrumbs}\n <Title order={variant === 'page' ? 1 : 3} className={classes.title}>\n {otherChildren}\n {docAnchor}\n </Title>\n <Text className={classes.description} size={variant === 'page' ? 'md' : 'sm'}>\n {description}\n </Text>\n </Stack>\n {actions}\n </Group>\n {borderBottom ? <Divider className={classes.divider} size=\"xs\" /> : null}\n </>\n );\n};\n\nHeader.Breadcrumbs = HeaderBreadcrumbs;\nHeader.Actions = HeaderActions;\nHeader.DocAnchor = HeaderDocAnchor;\n"],"names":["Divider","Group","Stack","Text","Title","useComponentDefaultProps","Children","useStyles","HeaderActions","HeaderBreadcrumbs","HeaderDocAnchor","defaultProps","variant","position","noWrap","Header","props","classNames","styles","unstyled","className","description","borderBottom","children","others","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/Header.tsx"],"sourcesContent":["import {\n DefaultProps,\n Divider,\n Group,\n GroupProps,\n Selectors,\n Stack,\n Text,\n Title,\n useComponentDefaultProps,\n} from '@mantine/core';\nimport {Children, ReactElement, ReactNode} from 'react';\n\nimport {HeaderStylesParams, useStyles} from './Header.styles';\nimport {HeaderActions} from './HeaderActions/HeaderActions';\nimport {HeaderBreadcrumbs} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {HeaderDocAnchor} from './HeaderDocAnchor/HeaderDocAnchor';\n\nexport type {HeaderDocAnchorProps, HeaderDocAnchorStylesNames} from './HeaderDocAnchor/HeaderDocAnchor';\nexport type {HeaderBreadcrumbsProps, HeaderBreadcrumbsStylesNames} from './HeaderBreadcrumbs/HeaderBreadcrumbs';\nexport type {HeaderActionsProps, HeaderActionsStylesNames} from './HeaderActions/HeaderActions';\nexport type HeaderStylesNames = Selectors<typeof useStyles>;\n\nexport interface HeaderProps extends Omit<GroupProps, 'styles'>, DefaultProps<HeaderStylesNames, HeaderStylesParams> {\n /**\n * The description text displayed inside the header underneath the title\n */\n description?: ReactNode;\n /**\n * Whether the header should have a border on the bottom\n */\n borderBottom?: boolean;\n /**\n * Use the modal variant when displaying the header inside a modal\n *\n * @default 'page'\n */\n variant?: 'page' | 'modal';\n /**\n * The title of the header.\n */\n children: ReactNode;\n}\n\ninterface HeaderType {\n (props: HeaderProps): ReactElement;\n Breadcrumbs: typeof HeaderBreadcrumbs;\n Actions: typeof HeaderActions;\n DocAnchor: typeof HeaderDocAnchor;\n}\n\nconst defaultProps: Partial<HeaderProps> = {\n variant: 'page',\n position: 'apart',\n noWrap: true,\n};\n\nexport const Header: HeaderType = (props: HeaderProps) => {\n const {classNames, styles, unstyled, className, description, borderBottom, variant, children, ...others} =\n useComponentDefaultProps('PlasmaHeader', defaultProps, props);\n const {classes, cx} = useStyles({variant}, {name: 'PlasmaHeader', classNames, styles, unstyled});\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);\n const actions = convertedChildren.find((child) => child.type === HeaderActions);\n const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);\n const otherChildren = convertedChildren.filter(\n (child) => child.type !== HeaderBreadcrumbs && child.type !== HeaderActions && child.type !== HeaderDocAnchor,\n );\n return (\n <>\n <Group className={cx(className, classes.root)} {...others}>\n <Stack spacing={0}>\n {breadcrumbs}\n <Title order={variant === 'page' ? 1 : 3} className={classes.title}>\n {otherChildren}\n {docAnchor}\n </Title>\n <Text className={classes.description} size={variant === 'page' ? 'md' : 'sm'}>\n {description}\n </Text>\n </Stack>\n {actions}\n </Group>\n {borderBottom ? <Divider className={classes.divider} size=\"xs\" /> : null}\n </>\n );\n};\n\nHeader.Breadcrumbs = HeaderBreadcrumbs;\nHeader.Actions = HeaderActions;\nHeader.DocAnchor = HeaderDocAnchor;\n"],"names":["Divider","Group","Stack","Text","Title","useComponentDefaultProps","Children","useStyles","HeaderActions","HeaderBreadcrumbs","HeaderDocAnchor","defaultProps","variant","position","noWrap","Header","props","classNames","styles","unstyled","className","description","borderBottom","children","others","classes","cx","name","convertedChildren","toArray","breadcrumbs","find","child","type","actions","docAnchor","otherChildren","filter","root","spacing","order","title","size","divider","Breadcrumbs","Actions","DocAnchor"],"mappings":";AAAA,SAEIA,OAAO,EACPC,KAAK,EAGLC,KAAK,EACLC,IAAI,EACJC,KAAK,EACLC,wBAAwB,QACrB,gBAAgB;AACvB,SAAQC,QAAQ,QAAgC,QAAQ;AAExD,SAA4BC,SAAS,QAAO,kBAAkB;AAC9D,SAAQC,aAAa,QAAO,gCAAgC;AAC5D,SAAQC,iBAAiB,QAAO,wCAAwC;AACxE,SAAQC,eAAe,QAAO,oCAAoC;AAmClE,MAAMC,eAAqC;IACvCC,SAAS;IACTC,UAAU;IACVC,QAAQ;AACZ;AAEA,OAAO,MAAMC,SAAqB,CAACC;IAC/B,MAAM,EAACC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,YAAY,EAAEV,OAAO,EAAEW,QAAQ,EAAE,GAAGC,QAAO,GACpGnB,yBAAyB,gBAAgBM,cAAcK;IAC3D,MAAM,EAACS,OAAO,EAAEC,EAAE,EAAC,GAAGnB,UAAU;QAACK;IAAO,GAAG;QAACe,MAAM;QAAgBV;QAAYC;QAAQC;IAAQ;IAE9F,MAAMS,oBAAoBtB,SAASuB,OAAO,CAACN;IAC3C,MAAMO,cAAcF,kBAAkBG,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAKxB;IACrE,MAAMyB,UAAUN,kBAAkBG,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAKzB;IACjE,MAAM2B,YAAYP,kBAAkBG,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAKvB;IACnE,MAAM0B,gBAAgBR,kBAAkBS,MAAM,CAC1C,CAACL,QAAUA,MAAMC,IAAI,KAAKxB,qBAAqBuB,MAAMC,IAAI,KAAKzB,iBAAiBwB,MAAMC,IAAI,KAAKvB;IAElG,qBACI;;0BACI,MAACT;gBAAMmB,WAAWM,GAAGN,WAAWK,QAAQa,IAAI;gBAAI,GAAGd,MAAM;;kCACrD,MAACtB;wBAAMqC,SAAS;;4BACXT;0CACD,MAAC1B;gCAAMoC,OAAO5B,YAAY,SAAS,IAAI;gCAAGQ,WAAWK,QAAQgB,KAAK;;oCAC7DL;oCACAD;;;0CAEL,KAAChC;gCAAKiB,WAAWK,QAAQJ,WAAW;gCAAEqB,MAAM9B,YAAY,SAAS,OAAO;0CACnES;;;;oBAGRa;;;YAEJZ,6BAAe,KAACtB;gBAAQoB,WAAWK,QAAQkB,OAAO;gBAAED,MAAK;iBAAU;;;AAGhF,EAAE;AAEF3B,OAAO6B,WAAW,GAAGnC;AACrBM,OAAO8B,OAAO,GAAGrC;AACjBO,OAAO+B,SAAS,GAAGpC"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { createStyles } from
|
|
2
|
-
export
|
|
3
|
-
var variant = param.variant;
|
|
4
|
-
return {
|
|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
|
+
export const useStyles = createStyles((theme, { variant })=>({
|
|
5
3
|
root: {
|
|
6
|
-
padding: variant ===
|
|
7
|
-
paddingBottom: variant ===
|
|
4
|
+
padding: variant === 'page' ? theme.spacing.xl : undefined,
|
|
5
|
+
paddingBottom: variant === 'page' ? theme.spacing.lg : undefined
|
|
8
6
|
},
|
|
9
7
|
title: {
|
|
10
|
-
wordBreak:
|
|
11
|
-
color: variant ===
|
|
8
|
+
wordBreak: 'break-word',
|
|
9
|
+
color: variant === 'page' ? theme.colors.gray[5] : undefined
|
|
12
10
|
},
|
|
13
11
|
description: {
|
|
14
12
|
color: theme.colors.gray[6]
|
|
15
13
|
},
|
|
16
14
|
divider: {}
|
|
17
|
-
};
|
|
18
|
-
});
|
|
15
|
+
}));
|
|
19
16
|
|
|
20
17
|
//# sourceMappingURL=Header.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/header/Header.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderStylesParams {\n variant?: 'page' | 'modal';\n}\n\nexport const useStyles = createStyles((theme, {variant}: HeaderStylesParams) => ({\n root: {\n padding: variant === 'page' ? theme.spacing.xl : undefined,\n paddingBottom: variant === 'page' ? theme.spacing.lg : undefined,\n },\n title: {\n wordBreak: 'break-word',\n color: variant === 'page' ? theme.colors.gray[5] : undefined,\n },\n description: {\n color: theme.colors.gray[6],\n },\n divider: {},\n}));\n"],"names":["createStyles","useStyles","theme","variant","root","padding","spacing","xl","undefined","paddingBottom","lg","title","wordBreak","color","colors","gray","description","divider"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAM3C,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/header/Header.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderStylesParams {\n variant?: 'page' | 'modal';\n}\n\nexport const useStyles = createStyles((theme, {variant}: HeaderStylesParams) => ({\n root: {\n padding: variant === 'page' ? theme.spacing.xl : undefined,\n paddingBottom: variant === 'page' ? theme.spacing.lg : undefined,\n },\n title: {\n wordBreak: 'break-word',\n color: variant === 'page' ? theme.colors.gray[5] : undefined,\n },\n description: {\n color: theme.colors.gray[6],\n },\n divider: {},\n}));\n"],"names":["createStyles","useStyles","theme","variant","root","padding","spacing","xl","undefined","paddingBottom","lg","title","wordBreak","color","colors","gray","description","divider"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAM3C,OAAO,MAAMC,YAAYD,aAAa,CAACE,OAAO,EAACC,OAAO,EAAqB,GAAM,CAAA;QAC7EC,MAAM;YACFC,SAASF,YAAY,SAASD,MAAMI,OAAO,CAACC,EAAE,GAAGC;YACjDC,eAAeN,YAAY,SAASD,MAAMI,OAAO,CAACI,EAAE,GAAGF;QAC3D;QACAG,OAAO;YACHC,WAAW;YACXC,OAAOV,YAAY,SAASD,MAAMY,MAAM,CAACC,IAAI,CAAC,EAAE,GAAGP;QACvD;QACAQ,aAAa;YACTH,OAAOX,MAAMY,MAAM,CAACC,IAAI,CAAC,EAAE;QAC/B;QACAE,SAAS,CAAC;IACd,CAAA,GAAI"}
|
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
4
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { Group, useComponentDefaultProps } from
|
|
6
|
-
import { useStyles } from
|
|
7
|
-
|
|
8
|
-
spacing:
|
|
2
|
+
import { Group, useComponentDefaultProps } from '@mantine/core';
|
|
3
|
+
import { useStyles } from './HeaderActions.styles';
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
spacing: 'sm'
|
|
9
6
|
};
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
styles: styles,
|
|
22
|
-
unstyled: unstyled
|
|
23
|
-
}), classes = _useStyles.classes, cx = _useStyles.cx;
|
|
24
|
-
return /*#__PURE__*/ _jsx(Group, _object_spread_props(_object_spread({
|
|
25
|
-
className: cx(className, classes.root)
|
|
26
|
-
}, others), {
|
|
7
|
+
export const HeaderActions = (props)=>{
|
|
8
|
+
const { classNames, styles, unstyled, className, children, ...others } = useComponentDefaultProps('PlasmaHeaderActions', defaultProps, props);
|
|
9
|
+
const { classes, cx } = useStyles({}, {
|
|
10
|
+
name: 'PlasmaHeaderActions',
|
|
11
|
+
classNames,
|
|
12
|
+
styles,
|
|
13
|
+
unstyled
|
|
14
|
+
});
|
|
15
|
+
return /*#__PURE__*/ _jsx(Group, {
|
|
16
|
+
className: cx(className, classes.root),
|
|
17
|
+
...others,
|
|
27
18
|
children: children
|
|
28
|
-
})
|
|
19
|
+
});
|
|
29
20
|
};
|
|
30
21
|
|
|
31
22
|
//# sourceMappingURL=HeaderActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import {DefaultProps, Group, GroupProps, Selectors, useComponentDefaultProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {HeaderActionsStylesParams, useStyles} from './HeaderActions.styles';\n\nexport type HeaderActionsStylesNames = Selectors<typeof useStyles>;\n\nexport type HeaderActionsProps = GroupProps & DefaultProps<HeaderActionsStylesNames, HeaderActionsStylesParams>;\n\nconst defaultProps: Partial<HeaderActionsProps> = {\n spacing: 'sm',\n};\n\nexport const HeaderActions: FunctionComponent<HeaderActionsProps> = (props: HeaderActionsProps) => {\n const {classNames, styles, unstyled, className, children, ...others} = useComponentDefaultProps(\n 'PlasmaHeaderActions',\n defaultProps,\n props,\n );\n const {classes, cx} = useStyles({}, {name: 'PlasmaHeaderActions', classNames, styles, unstyled});\n\n return (\n <Group className={cx(className, classes.root)} {...others}>\n {children}\n </Group>\n );\n};\n"],"names":["Group","useComponentDefaultProps","useStyles","defaultProps","spacing","HeaderActions","props","classNames","styles","unstyled","className","children","others","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import {DefaultProps, Group, GroupProps, Selectors, useComponentDefaultProps} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {HeaderActionsStylesParams, useStyles} from './HeaderActions.styles';\n\nexport type HeaderActionsStylesNames = Selectors<typeof useStyles>;\n\nexport type HeaderActionsProps = GroupProps & DefaultProps<HeaderActionsStylesNames, HeaderActionsStylesParams>;\n\nconst defaultProps: Partial<HeaderActionsProps> = {\n spacing: 'sm',\n};\n\nexport const HeaderActions: FunctionComponent<HeaderActionsProps> = (props: HeaderActionsProps) => {\n const {classNames, styles, unstyled, className, children, ...others} = useComponentDefaultProps(\n 'PlasmaHeaderActions',\n defaultProps,\n props,\n );\n const {classes, cx} = useStyles({}, {name: 'PlasmaHeaderActions', classNames, styles, unstyled});\n\n return (\n <Group className={cx(className, classes.root)} {...others}>\n {children}\n </Group>\n );\n};\n"],"names":["Group","useComponentDefaultProps","useStyles","defaultProps","spacing","HeaderActions","props","classNames","styles","unstyled","className","children","others","classes","cx","name","root"],"mappings":";AAAA,SAAsBA,KAAK,EAAyBC,wBAAwB,QAAO,gBAAgB;AAEnG,SAAmCC,SAAS,QAAO,yBAAyB;AAM5E,MAAMC,eAA4C;IAC9CC,SAAS;AACb;AAEA,OAAO,MAAMC,gBAAuD,CAACC;IACjE,MAAM,EAACC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,QAAO,GAAGX,yBACnE,uBACAE,cACAG;IAEJ,MAAM,EAACO,OAAO,EAAEC,EAAE,EAAC,GAAGZ,UAAU,CAAC,GAAG;QAACa,MAAM;QAAuBR;QAAYC;QAAQC;IAAQ;IAE9F,qBACI,KAACT;QAAMU,WAAWI,GAAGJ,WAAWG,QAAQG,IAAI;QAAI,GAAGJ,MAAM;kBACpDD;;AAGb,EAAE"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export var useStyles = createStyles(function(theme, param) {
|
|
4
|
-
var ref = _object_destructuring_empty(param);
|
|
5
|
-
return {
|
|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
|
+
export const useStyles = createStyles((theme, {})=>({
|
|
6
3
|
root: {}
|
|
7
|
-
};
|
|
8
|
-
});
|
|
4
|
+
}));
|
|
9
5
|
|
|
10
6
|
//# sourceMappingURL=HeaderActions.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderActionsStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderActionsStylesParams) => ({\n root: {},\n}));\n"],"names":["createStyles","useStyles","theme","root"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderActions/HeaderActions.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderActionsStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderActionsStylesParams) => ({\n root: {},\n}));\n"],"names":["createStyles","useStyles","theme","root"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,OAAO,MAAMC,YAAYD,aAAa,CAACE,OAAO,EAA6B,GAAM,CAAA;QAC7EC,MAAM,CAAC;IACX,CAAA,GAAI"}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
4
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { Breadcrumbs } from
|
|
6
|
-
import { useStyles } from
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
name: "PlasmaHeaderBreadcrumbs",
|
|
16
|
-
classNames: classNames,
|
|
17
|
-
styles: styles,
|
|
18
|
-
unstyled: unstyled
|
|
19
|
-
}).classes;
|
|
20
|
-
return /*#__PURE__*/ _jsx(Breadcrumbs, _object_spread_props(_object_spread({
|
|
2
|
+
import { Breadcrumbs } from '@mantine/core';
|
|
3
|
+
import { useStyles } from './HeaderBreadcrumbs.styles';
|
|
4
|
+
export const HeaderBreadcrumbs = ({ classNames, styles, unstyled, children, ...others })=>{
|
|
5
|
+
const { classes } = useStyles({}, {
|
|
6
|
+
name: 'PlasmaHeaderBreadcrumbs',
|
|
7
|
+
classNames,
|
|
8
|
+
styles,
|
|
9
|
+
unstyled
|
|
10
|
+
});
|
|
11
|
+
return /*#__PURE__*/ _jsx(Breadcrumbs, {
|
|
21
12
|
classNames: {
|
|
22
13
|
breadcrumb: classes.breadcrumb,
|
|
23
14
|
separator: classes.separator
|
|
24
|
-
}
|
|
25
|
-
|
|
15
|
+
},
|
|
16
|
+
...others,
|
|
26
17
|
children: children
|
|
27
|
-
})
|
|
18
|
+
});
|
|
28
19
|
};
|
|
29
20
|
|
|
30
21
|
//# sourceMappingURL=HeaderBreadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.tsx"],"sourcesContent":["import {Breadcrumbs, BreadcrumbsProps, DefaultProps, Selectors} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {HeaderBreadcrumbsStylesParams, useStyles} from './HeaderBreadcrumbs.styles';\n\nexport type HeaderBreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport type HeaderBreadcrumbsProps = BreadcrumbsProps &\n DefaultProps<HeaderBreadcrumbsStylesNames, HeaderBreadcrumbsStylesParams>;\n\nexport const HeaderBreadcrumbs: FunctionComponent<HeaderBreadcrumbsProps> = ({\n classNames,\n styles,\n unstyled,\n children,\n ...others\n}) => {\n const {classes} = useStyles(\n {},\n {\n name: 'PlasmaHeaderBreadcrumbs',\n classNames,\n styles,\n unstyled,\n },\n );\n return (\n <Breadcrumbs classNames={{breadcrumb: classes.breadcrumb, separator: classes.separator}} {...others}>\n {children}\n </Breadcrumbs>\n );\n};\n"],"names":["Breadcrumbs","useStyles","HeaderBreadcrumbs","classNames","styles","unstyled","children","others","classes","name","breadcrumb","separator"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.tsx"],"sourcesContent":["import {Breadcrumbs, BreadcrumbsProps, DefaultProps, Selectors} from '@mantine/core';\nimport {FunctionComponent} from 'react';\nimport {HeaderBreadcrumbsStylesParams, useStyles} from './HeaderBreadcrumbs.styles';\n\nexport type HeaderBreadcrumbsStylesNames = Selectors<typeof useStyles>;\n\nexport type HeaderBreadcrumbsProps = BreadcrumbsProps &\n DefaultProps<HeaderBreadcrumbsStylesNames, HeaderBreadcrumbsStylesParams>;\n\nexport const HeaderBreadcrumbs: FunctionComponent<HeaderBreadcrumbsProps> = ({\n classNames,\n styles,\n unstyled,\n children,\n ...others\n}) => {\n const {classes} = useStyles(\n {},\n {\n name: 'PlasmaHeaderBreadcrumbs',\n classNames,\n styles,\n unstyled,\n },\n );\n return (\n <Breadcrumbs classNames={{breadcrumb: classes.breadcrumb, separator: classes.separator}} {...others}>\n {children}\n </Breadcrumbs>\n );\n};\n"],"names":["Breadcrumbs","useStyles","HeaderBreadcrumbs","classNames","styles","unstyled","children","others","classes","name","breadcrumb","separator"],"mappings":";AAAA,SAAQA,WAAW,QAAkD,gBAAgB;AAErF,SAAuCC,SAAS,QAAO,6BAA6B;AAOpF,OAAO,MAAMC,oBAA+D,CAAC,EACzEC,UAAU,EACVC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACR,GAAGC,QACN;IACG,MAAM,EAACC,OAAO,EAAC,GAAGP,UACd,CAAC,GACD;QACIQ,MAAM;QACNN;QACAC;QACAC;IACJ;IAEJ,qBACI,KAACL;QAAYG,YAAY;YAACO,YAAYF,QAAQE,UAAU;YAAEC,WAAWH,QAAQG,SAAS;QAAA;QAAI,GAAGJ,MAAM;kBAC9FD;;AAGb,EAAE"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export var useStyles = createStyles(function(theme, param) {
|
|
4
|
-
var ref = _object_destructuring_empty(param);
|
|
5
|
-
return {
|
|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
|
+
export const useStyles = createStyles((theme, {})=>({
|
|
6
3
|
breadcrumb: {
|
|
7
4
|
fontSize: theme.fontSizes.sm,
|
|
8
5
|
fontWeight: 300
|
|
@@ -10,7 +7,6 @@ export var useStyles = createStyles(function(theme, param) {
|
|
|
10
7
|
separator: {
|
|
11
8
|
color: theme.colors.gray[5]
|
|
12
9
|
}
|
|
13
|
-
};
|
|
14
|
-
});
|
|
10
|
+
}));
|
|
15
11
|
|
|
16
12
|
//# sourceMappingURL=HeaderBreadcrumbs.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderBreadcrumbsStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderBreadcrumbsStylesParams) => ({\n breadcrumb: {fontSize: theme.fontSizes.sm, fontWeight: 300},\n separator: {color: theme.colors.gray[5]},\n}));\n"],"names":["createStyles","useStyles","theme","breadcrumb","fontSize","fontSizes","sm","fontWeight","separator","color","colors","gray"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderBreadcrumbs/HeaderBreadcrumbs.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderBreadcrumbsStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderBreadcrumbsStylesParams) => ({\n breadcrumb: {fontSize: theme.fontSizes.sm, fontWeight: 300},\n separator: {color: theme.colors.gray[5]},\n}));\n"],"names":["createStyles","useStyles","theme","breadcrumb","fontSize","fontSizes","sm","fontWeight","separator","color","colors","gray"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,OAAO,MAAMC,YAAYD,aAAa,CAACE,OAAO,EAAiC,GAAM,CAAA;QACjFC,YAAY;YAACC,UAAUF,MAAMG,SAAS,CAACC,EAAE;YAAEC,YAAY;QAAG;QAC1DC,WAAW;YAACC,OAAOP,MAAMQ,MAAM,CAACC,IAAI,CAAC,EAAE;QAAA;IAC3C,CAAA,GAAI"}
|
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
4
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { QuestionSize16Px } from
|
|
6
|
-
import { Anchor, Tooltip, useComponentDefaultProps } from
|
|
7
|
-
import { useStyles } from
|
|
8
|
-
|
|
9
|
-
position:
|
|
2
|
+
import { QuestionSize16Px } from '@coveord/plasma-react-icons';
|
|
3
|
+
import { Anchor, Tooltip, useComponentDefaultProps } from '@mantine/core';
|
|
4
|
+
import { useStyles } from './HeaderDocAnchor.styles';
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
position: 'right',
|
|
10
7
|
children: /*#__PURE__*/ _jsx(QuestionSize16Px, {
|
|
11
8
|
height: 16
|
|
12
9
|
})
|
|
13
10
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
]);
|
|
24
|
-
var _useStyles = useStyles({}, {
|
|
25
|
-
name: "PlasmaHeaderActions",
|
|
26
|
-
classNames: classNames,
|
|
27
|
-
styles: styles,
|
|
28
|
-
unstyled: unstyled
|
|
29
|
-
}), classes = _useStyles.classes, cx = _useStyles.cx;
|
|
30
|
-
return /*#__PURE__*/ _jsx(Tooltip, _object_spread_props(_object_spread({
|
|
11
|
+
export const HeaderDocAnchor = (props)=>{
|
|
12
|
+
const { classNames, styles, unstyled, className, children, href: docLink, label: docLinkTooltipLabel, ...others } = useComponentDefaultProps('PlasmaHeaderActions', defaultProps, props);
|
|
13
|
+
const { classes, cx } = useStyles({}, {
|
|
14
|
+
name: 'PlasmaHeaderActions',
|
|
15
|
+
classNames,
|
|
16
|
+
styles,
|
|
17
|
+
unstyled
|
|
18
|
+
});
|
|
19
|
+
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
31
20
|
className: cx(className, classes.tooltip),
|
|
32
21
|
label: docLinkTooltipLabel,
|
|
33
|
-
disabled: !docLinkTooltipLabel
|
|
34
|
-
|
|
22
|
+
disabled: !docLinkTooltipLabel,
|
|
23
|
+
...others,
|
|
35
24
|
children: /*#__PURE__*/ _jsx(Anchor, {
|
|
36
25
|
className: classes.anchor,
|
|
37
26
|
inline: true,
|
|
@@ -39,7 +28,7 @@ export var HeaderDocAnchor = function(props) {
|
|
|
39
28
|
target: "_blank",
|
|
40
29
|
children: children
|
|
41
30
|
})
|
|
42
|
-
})
|
|
31
|
+
});
|
|
43
32
|
};
|
|
44
33
|
|
|
45
34
|
//# sourceMappingURL=HeaderDocAnchor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.tsx"],"sourcesContent":["import {QuestionSize16Px} from '@coveord/plasma-react-icons';\nimport {Anchor, DefaultProps, Selectors, Tooltip, TooltipProps, useComponentDefaultProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {HeaderDocAnchorStylesParams, useStyles} from './HeaderDocAnchor.styles';\n\nexport type HeaderDocAnchorStylesNames = Selectors<typeof useStyles>;\n\nconst defaultProps: Partial<HeaderDocAnchorProps> = {\n position: 'right',\n children: <QuestionSize16Px height={16} />,\n};\n\nexport interface HeaderDocAnchorProps\n extends Pick<TooltipProps, 'position'>,\n DefaultProps<HeaderDocAnchorStylesNames, HeaderDocAnchorStylesParams> {\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n href: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n label?: string;\n /**\n * React component to add the tooltip and anchor on\n */\n children?: ReactNode;\n}\n\nexport const HeaderDocAnchor: FunctionComponent<HeaderDocAnchorProps> = (props: HeaderDocAnchorProps) => {\n const {\n classNames,\n styles,\n unstyled,\n className,\n children,\n href: docLink,\n label: docLinkTooltipLabel,\n ...others\n } = useComponentDefaultProps('PlasmaHeaderActions', defaultProps, props);\n const {classes, cx} = useStyles({}, {name: 'PlasmaHeaderActions', classNames, styles, unstyled});\n return (\n <Tooltip\n className={cx(className, classes.tooltip)}\n label={docLinkTooltipLabel}\n disabled={!docLinkTooltipLabel}\n {...others}\n >\n <Anchor className={classes.anchor} inline href={docLink} target=\"_blank\">\n {children}\n </Anchor>\n </Tooltip>\n );\n};\n"],"names":["QuestionSize16Px","Anchor","Tooltip","useComponentDefaultProps","useStyles","defaultProps","position","children","height","HeaderDocAnchor","props","classNames","styles","unstyled","className","href","docLink","label","docLinkTooltipLabel","others","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.tsx"],"sourcesContent":["import {QuestionSize16Px} from '@coveord/plasma-react-icons';\nimport {Anchor, DefaultProps, Selectors, Tooltip, TooltipProps, useComponentDefaultProps} from '@mantine/core';\nimport {FunctionComponent, ReactNode} from 'react';\nimport {HeaderDocAnchorStylesParams, useStyles} from './HeaderDocAnchor.styles';\n\nexport type HeaderDocAnchorStylesNames = Selectors<typeof useStyles>;\n\nconst defaultProps: Partial<HeaderDocAnchorProps> = {\n position: 'right',\n children: <QuestionSize16Px height={16} />,\n};\n\nexport interface HeaderDocAnchorProps\n extends Pick<TooltipProps, 'position'>,\n DefaultProps<HeaderDocAnchorStylesNames, HeaderDocAnchorStylesParams> {\n /**\n * A href pointing to documentation related to the current panel.\n * When provided, an info icon is rendered next to the title as link to this documentation\n */\n href: string;\n /**\n * The tooltip text shown when hovering over the doc link icon\n */\n label?: string;\n /**\n * React component to add the tooltip and anchor on\n */\n children?: ReactNode;\n}\n\nexport const HeaderDocAnchor: FunctionComponent<HeaderDocAnchorProps> = (props: HeaderDocAnchorProps) => {\n const {\n classNames,\n styles,\n unstyled,\n className,\n children,\n href: docLink,\n label: docLinkTooltipLabel,\n ...others\n } = useComponentDefaultProps('PlasmaHeaderActions', defaultProps, props);\n const {classes, cx} = useStyles({}, {name: 'PlasmaHeaderActions', classNames, styles, unstyled});\n return (\n <Tooltip\n className={cx(className, classes.tooltip)}\n label={docLinkTooltipLabel}\n disabled={!docLinkTooltipLabel}\n {...others}\n >\n <Anchor className={classes.anchor} inline href={docLink} target=\"_blank\">\n {children}\n </Anchor>\n </Tooltip>\n );\n};\n"],"names":["QuestionSize16Px","Anchor","Tooltip","useComponentDefaultProps","useStyles","defaultProps","position","children","height","HeaderDocAnchor","props","classNames","styles","unstyled","className","href","docLink","label","docLinkTooltipLabel","others","classes","cx","name","tooltip","disabled","anchor","inline","target"],"mappings":";AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SAAQC,MAAM,EAA2BC,OAAO,EAAgBC,wBAAwB,QAAO,gBAAgB;AAE/G,SAAqCC,SAAS,QAAO,2BAA2B;AAIhF,MAAMC,eAA8C;IAChDC,UAAU;IACVC,wBAAU,KAACP;QAAiBQ,QAAQ;;AACxC;AAoBA,OAAO,MAAMC,kBAA2D,CAACC;IACrE,MAAM,EACFC,UAAU,EACVC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTP,QAAQ,EACRQ,MAAMC,OAAO,EACbC,OAAOC,mBAAmB,EAC1B,GAAGC,QACN,GAAGhB,yBAAyB,uBAAuBE,cAAcK;IAClE,MAAM,EAACU,OAAO,EAAEC,EAAE,EAAC,GAAGjB,UAAU,CAAC,GAAG;QAACkB,MAAM;QAAuBX;QAAYC;QAAQC;IAAQ;IAC9F,qBACI,KAACX;QACGY,WAAWO,GAAGP,WAAWM,QAAQG,OAAO;QACxCN,OAAOC;QACPM,UAAU,CAACN;QACV,GAAGC,MAAM;kBAEV,cAAA,KAAClB;YAAOa,WAAWM,QAAQK,MAAM;YAAEC,MAAM;YAACX,MAAMC;YAASW,QAAO;sBAC3DpB;;;AAIjB,EAAE"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export var useStyles = createStyles(function(theme, param) {
|
|
4
|
-
var ref = _object_destructuring_empty(param);
|
|
5
|
-
return {
|
|
1
|
+
import { createStyles } from '@mantine/core';
|
|
2
|
+
export const useStyles = createStyles((theme, {})=>({
|
|
6
3
|
tooltip: {},
|
|
7
4
|
anchor: {
|
|
8
5
|
marginLeft: theme.spacing.xs,
|
|
9
|
-
verticalAlign:
|
|
6
|
+
verticalAlign: 'middle'
|
|
10
7
|
}
|
|
11
|
-
};
|
|
12
|
-
});
|
|
8
|
+
}));
|
|
13
9
|
|
|
14
10
|
//# sourceMappingURL=HeaderDocAnchor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderDocAnchorStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderDocAnchorStylesParams) => ({\n tooltip: {},\n anchor: {\n marginLeft: theme.spacing.xs,\n verticalAlign: 'middle',\n },\n}));\n"],"names":["createStyles","useStyles","theme","tooltip","anchor","marginLeft","spacing","xs","verticalAlign"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/header/HeaderDocAnchor/HeaderDocAnchor.styles.ts"],"sourcesContent":["import {createStyles} from '@mantine/core';\n\nexport interface HeaderDocAnchorStylesParams {}\n\nexport const useStyles = createStyles((theme, {}: HeaderDocAnchorStylesParams) => ({\n tooltip: {},\n anchor: {\n marginLeft: theme.spacing.xs,\n verticalAlign: 'middle',\n },\n}));\n"],"names":["createStyles","useStyles","theme","tooltip","anchor","marginLeft","spacing","xs","verticalAlign"],"mappings":"AAAA,SAAQA,YAAY,QAAO,gBAAgB;AAI3C,OAAO,MAAMC,YAAYD,aAAa,CAACE,OAAO,EAA+B,GAAM,CAAA;QAC/EC,SAAS,CAAC;QACVC,QAAQ;YACJC,YAAYH,MAAMI,OAAO,CAACC,EAAE;YAC5BC,eAAe;QACnB;IACJ,CAAA,GAAI"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
1
|
+
export * from './blank-slate';
|
|
2
|
+
export * from './browser-preview';
|
|
3
|
+
export * from './code-editor';
|
|
4
|
+
export * from './collection';
|
|
5
|
+
export * from './date-range-picker';
|
|
6
|
+
export * from './sticky-footer';
|
|
7
|
+
export * from './header';
|
|
8
|
+
export * from './inline-confirm';
|
|
9
|
+
export * from './table';
|
|
10
|
+
export * from './prompt';
|
|
11
|
+
export * from './modal-wizard';
|
|
12
|
+
export * from './button';
|
|
13
|
+
export * from './action-icon';
|
|
14
|
+
export * from './menu';
|
|
15
|
+
export * from './copyToClipboard';
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Children, useState } from
|
|
4
|
-
import { InlineConfirmButton } from
|
|
5
|
-
import { InlineConfirmContext } from
|
|
6
|
-
import { InlineConfirmMenuItem } from
|
|
7
|
-
import { InlineConfirmPrompt } from
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return child.type === InlineConfirmPrompt && child.props.id === confirmingId;
|
|
14
|
-
});
|
|
15
|
-
var clearConfirm = function() {
|
|
16
|
-
return setConfirmingId(null);
|
|
17
|
-
};
|
|
2
|
+
import { Children, useState } from 'react';
|
|
3
|
+
import { InlineConfirmButton } from './InlineConfirmButton';
|
|
4
|
+
import { InlineConfirmContext } from './InlineConfirmContext';
|
|
5
|
+
import { InlineConfirmMenuItem } from './InlineConfirmMenuItem';
|
|
6
|
+
import { InlineConfirmPrompt } from './InlineConfirmPrompt';
|
|
7
|
+
export const InlineConfirm = ({ children })=>{
|
|
8
|
+
const [confirmingId, setConfirmingId] = useState(null);
|
|
9
|
+
const convertedChildren = Children.toArray(children);
|
|
10
|
+
const prompt = convertedChildren.find((child)=>child.type === InlineConfirmPrompt && child.props.id === confirmingId);
|
|
11
|
+
const clearConfirm = ()=>setConfirmingId(null);
|
|
18
12
|
return /*#__PURE__*/ _jsx(InlineConfirmContext.Provider, {
|
|
19
13
|
value: {
|
|
20
|
-
confirmingId
|
|
21
|
-
setConfirmingId
|
|
22
|
-
clearConfirm
|
|
14
|
+
confirmingId,
|
|
15
|
+
setConfirmingId,
|
|
16
|
+
clearConfirm
|
|
23
17
|
},
|
|
24
|
-
children: prompt
|
|
18
|
+
children: prompt ?? children
|
|
25
19
|
});
|
|
26
20
|
};
|
|
27
21
|
InlineConfirm.Prompt = InlineConfirmPrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmMenuItem} from './InlineConfirmMenuItem';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren<unknown>> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n MenuItem: typeof InlineConfirmMenuItem;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId,\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\nInlineConfirm.MenuItem = InlineConfirmMenuItem;\n"],"names":["Children","useState","InlineConfirmButton","InlineConfirmContext","InlineConfirmMenuItem","InlineConfirmPrompt","InlineConfirm","children","confirmingId","setConfirmingId","convertedChildren","toArray","prompt","find","child","type","props","id","clearConfirm","Provider","value","Prompt","Button","MenuItem"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirm.tsx"],"sourcesContent":["import {Children, FunctionComponent, PropsWithChildren, ReactElement, useState} from 'react';\n\nimport {InlineConfirmButton} from './InlineConfirmButton';\nimport {InlineConfirmContext} from './InlineConfirmContext';\nimport {InlineConfirmMenuItem} from './InlineConfirmMenuItem';\nimport {InlineConfirmPrompt} from './InlineConfirmPrompt';\n\ntype InlineConfirmType = FunctionComponent<PropsWithChildren<unknown>> & {\n Prompt: typeof InlineConfirmPrompt;\n Button: typeof InlineConfirmButton;\n MenuItem: typeof InlineConfirmMenuItem;\n};\n\nexport const InlineConfirm: InlineConfirmType = ({children}) => {\n const [confirmingId, setConfirmingId] = useState<string | null>(null);\n\n const convertedChildren = Children.toArray(children) as ReactElement[];\n const prompt = convertedChildren.find(\n (child) => child.type === InlineConfirmPrompt && child.props.id === confirmingId,\n );\n const clearConfirm = () => setConfirmingId(null);\n\n return (\n <InlineConfirmContext.Provider value={{confirmingId, setConfirmingId, clearConfirm}}>\n {prompt ?? children}\n </InlineConfirmContext.Provider>\n );\n};\n\nInlineConfirm.Prompt = InlineConfirmPrompt;\nInlineConfirm.Button = InlineConfirmButton;\nInlineConfirm.MenuItem = InlineConfirmMenuItem;\n"],"names":["Children","useState","InlineConfirmButton","InlineConfirmContext","InlineConfirmMenuItem","InlineConfirmPrompt","InlineConfirm","children","confirmingId","setConfirmingId","convertedChildren","toArray","prompt","find","child","type","props","id","clearConfirm","Provider","value","Prompt","Button","MenuItem"],"mappings":";AAAA,SAAQA,QAAQ,EAAsDC,QAAQ,QAAO,QAAQ;AAE7F,SAAQC,mBAAmB,QAAO,wBAAwB;AAC1D,SAAQC,oBAAoB,QAAO,yBAAyB;AAC5D,SAAQC,qBAAqB,QAAO,0BAA0B;AAC9D,SAAQC,mBAAmB,QAAO,wBAAwB;AAQ1D,OAAO,MAAMC,gBAAmC,CAAC,EAACC,QAAQ,EAAC;IACvD,MAAM,CAACC,cAAcC,gBAAgB,GAAGR,SAAwB;IAEhE,MAAMS,oBAAoBV,SAASW,OAAO,CAACJ;IAC3C,MAAMK,SAASF,kBAAkBG,IAAI,CACjC,CAACC,QAAUA,MAAMC,IAAI,KAAKV,uBAAuBS,MAAME,KAAK,CAACC,EAAE,KAAKT;IAExE,MAAMU,eAAe,IAAMT,gBAAgB;IAE3C,qBACI,KAACN,qBAAqBgB,QAAQ;QAACC,OAAO;YAACZ;YAAcC;YAAiBS;QAAY;kBAC7EN,UAAUL;;AAGvB,EAAE;AAEFD,cAAce,MAAM,GAAGhB;AACvBC,cAAcgB,MAAM,GAAGpB;AACvBI,cAAciB,QAAQ,GAAGnB"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
3
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import { forwardRef } from
|
|
5
|
-
import { Button } from
|
|
6
|
-
import { useInlineConfirm } from
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"id"
|
|
11
|
-
]);
|
|
12
|
-
var setConfirmingId = useInlineConfirm().setConfirmingId;
|
|
13
|
-
var handleOnClick = function(e) {
|
|
14
|
-
var _onClick;
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Button } from '../button';
|
|
4
|
+
import { useInlineConfirm } from './useInlineConfirm';
|
|
5
|
+
export const InlineConfirmButton = /*#__PURE__*/ forwardRef(({ onClick, id, ...others }, ref)=>{
|
|
6
|
+
const { setConfirmingId } = useInlineConfirm();
|
|
7
|
+
const handleOnClick = (e)=>{
|
|
15
8
|
setConfirmingId(id);
|
|
16
|
-
|
|
9
|
+
onClick?.(e);
|
|
17
10
|
};
|
|
18
|
-
return /*#__PURE__*/ _jsx(Button,
|
|
11
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
19
12
|
ref: ref,
|
|
20
|
-
onClick: handleOnClick
|
|
21
|
-
|
|
13
|
+
onClick: handleOnClick,
|
|
14
|
+
...others
|
|
15
|
+
});
|
|
22
16
|
});
|
|
23
17
|
|
|
24
18
|
//# sourceMappingURL=InlineConfirmButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\nimport {Button, ButtonProps} from '../button';\n\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmButtonProps extends ButtonProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmButton = forwardRef<HTMLButtonElement, InlineConfirmButtonProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Button ref={ref} onClick={handleOnClick} {...others} />;\n },\n);\n"],"names":["forwardRef","Button","useInlineConfirm","InlineConfirmButton","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmButton.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\nimport {Button, ButtonProps} from '../button';\n\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmButtonProps extends ButtonProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmButton = forwardRef<HTMLButtonElement, InlineConfirmButtonProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Button ref={ref} onClick={handleOnClick} {...others} />;\n },\n);\n"],"names":["forwardRef","Button","useInlineConfirm","InlineConfirmButton","onClick","id","others","ref","setConfirmingId","handleOnClick","e"],"mappings":";AAAA,SAAQA,UAAU,QAA0B,QAAQ;AACpD,SAAQC,MAAM,QAAoB,YAAY;AAE9C,SAAQC,gBAAgB,QAAO,qBAAqB;AAOpD,OAAO,MAAMC,oCAAsBH,WAC/B,CAAC,EAACI,OAAO,EAAEC,EAAE,EAAE,GAAGC,QAAO,EAAEC;IACvB,MAAM,EAACC,eAAe,EAAC,GAAGN;IAC1B,MAAMO,gBAAsD,CAACC;QACzDF,gBAAgBH;QAChBD,UAAUM;IACd;IAEA,qBAAO,KAACT;QAAOM,KAAKA;QAAKH,SAASK;QAAgB,GAAGH,MAAM;;AAC/D,GACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmContext.ts"],"sourcesContent":["import {createContext} from 'react';\n\ntype InlineConfirmContextType = {\n confirmingId: string;\n setConfirmingId: (id: string) => void;\n clearConfirm: () => void;\n};\n\nexport const InlineConfirmContext = createContext<InlineConfirmContextType | null>(null);\n"],"names":["createContext","InlineConfirmContext"],"mappings":"AAAA,SAAQA,aAAa,QAAO,QAAQ;AAQpC,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmContext.ts"],"sourcesContent":["import {createContext} from 'react';\n\ntype InlineConfirmContextType = {\n confirmingId: string;\n setConfirmingId: (id: string) => void;\n clearConfirm: () => void;\n};\n\nexport const InlineConfirmContext = createContext<InlineConfirmContextType | null>(null);\n"],"names":["createContext","InlineConfirmContext"],"mappings":"AAAA,SAAQA,aAAa,QAAO,QAAQ;AAQpC,OAAO,MAAMC,uBAAuBD,cAA+C,MAAM"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
3
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import { forwardRef } from
|
|
5
|
-
import { Menu } from
|
|
6
|
-
import { useInlineConfirm } from
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"id"
|
|
11
|
-
]);
|
|
12
|
-
var setConfirmingId = useInlineConfirm().setConfirmingId;
|
|
13
|
-
var handleOnClick = function(e) {
|
|
14
|
-
var _onClick;
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Menu } from '../menu';
|
|
4
|
+
import { useInlineConfirm } from './useInlineConfirm';
|
|
5
|
+
export const InlineConfirmMenuItem = /*#__PURE__*/ forwardRef(({ onClick, id, ...others }, ref)=>{
|
|
6
|
+
const { setConfirmingId } = useInlineConfirm();
|
|
7
|
+
const handleOnClick = (e)=>{
|
|
15
8
|
setConfirmingId(id);
|
|
16
|
-
|
|
9
|
+
onClick?.(e);
|
|
17
10
|
};
|
|
18
|
-
return /*#__PURE__*/ _jsx(Menu.Item,
|
|
11
|
+
return /*#__PURE__*/ _jsx(Menu.Item, {
|
|
19
12
|
ref: ref,
|
|
20
|
-
onClick: handleOnClick
|
|
21
|
-
|
|
13
|
+
onClick: handleOnClick,
|
|
14
|
+
...others
|
|
15
|
+
});
|
|
22
16
|
});
|
|
23
17
|
|
|
24
18
|
//# sourceMappingURL=InlineConfirmMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\n\nimport {Menu, MenuItemProps} from '../menu';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmMenuItemProps extends MenuItemProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmMenuItem = forwardRef<HTMLButtonElement, InlineConfirmMenuItemProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Menu.Item ref={ref} onClick={handleOnClick} {...others} />;\n },\n);\n"],"names":["forwardRef","Menu","useInlineConfirm","InlineConfirmMenuItem","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/inline-confirm/InlineConfirmMenuItem.tsx"],"sourcesContent":["import {forwardRef, MouseEventHandler} from 'react';\n\nimport {Menu, MenuItemProps} from '../menu';\nimport {useInlineConfirm} from './useInlineConfirm';\n\nexport interface InlineConfirmMenuItemProps extends MenuItemProps {\n id: string;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const InlineConfirmMenuItem = forwardRef<HTMLButtonElement, InlineConfirmMenuItemProps>(\n ({onClick, id, ...others}, ref) => {\n const {setConfirmingId} = useInlineConfirm();\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (e) => {\n setConfirmingId(id);\n onClick?.(e);\n };\n\n return <Menu.Item ref={ref} onClick={handleOnClick} {...others} />;\n },\n);\n"],"names":["forwardRef","Menu","useInlineConfirm","InlineConfirmMenuItem","onClick","id","others","ref","setConfirmingId","handleOnClick","e","Item"],"mappings":";AAAA,SAAQA,UAAU,QAA0B,QAAQ;AAEpD,SAAQC,IAAI,QAAsB,UAAU;AAC5C,SAAQC,gBAAgB,QAAO,qBAAqB;AAOpD,OAAO,MAAMC,sCAAwBH,WACjC,CAAC,EAACI,OAAO,EAAEC,EAAE,EAAE,GAAGC,QAAO,EAAEC;IACvB,MAAM,EAACC,eAAe,EAAC,GAAGN;IAC1B,MAAMO,gBAAsD,CAACC;QACzDF,gBAAgBH;QAChBD,UAAUM;IACd;IAEA,qBAAO,KAACT,KAAKU,IAAI;QAACJ,KAAKA;QAAKH,SAASK;QAAgB,GAAGH,MAAM;;AAClE,GACF"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Group } from
|
|
3
|
-
import { useEffect } from
|
|
4
|
-
import { Button } from
|
|
5
|
-
import { useInlineConfirm } from
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var onClickConfirm = function() {
|
|
2
|
+
import { Group } from '@mantine/core';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { Button } from '../button';
|
|
5
|
+
import { useInlineConfirm } from './useInlineConfirm';
|
|
6
|
+
export const InlineConfirmPrompt = ({ id, label, confirmLabel = 'Delete', cancelLabel = 'Cancel', onConfirm })=>{
|
|
7
|
+
const { confirmingId, clearConfirm } = useInlineConfirm();
|
|
8
|
+
const onClickConfirm = ()=>{
|
|
10
9
|
onConfirm();
|
|
11
10
|
clearConfirm();
|
|
12
11
|
};
|
|
13
|
-
useEffect(
|
|
12
|
+
useEffect(()=>{
|
|
14
13
|
if (confirmingId !== id) {
|
|
15
14
|
clearConfirm();
|
|
16
15
|
}
|