From 90d0706da5f280976a8d0493e17671a5cc8491a7 Mon Sep 17 00:00:00 2001 From: mkurczewski Date: Thu, 26 Sep 2024 16:33:30 +0200 Subject: [PATCH] Refactored button --- libs/generic-view/models/src/index.ts | 3 +++ libs/generic-view/models/src/lib/button-primary.ts | 2 +- libs/generic-view/ui/src/lib/buttons/button-primary.tsx | 2 +- libs/generic-view/ui/src/lib/interactive/interactive.ts | 3 +++ .../ui/src/lib/interactive/modal/helpers/modal-title-icon.tsx | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/generic-view/models/src/index.ts b/libs/generic-view/models/src/index.ts index e3ff492249..024087acdd 100644 --- a/libs/generic-view/models/src/index.ts +++ b/libs/generic-view/models/src/index.ts @@ -59,6 +59,7 @@ import { entitiesLoader } from "./lib/entities-loader" import { conditionalRenderer } from "./lib/conditional-renderer" import { toast } from "./lib/toast" import { selectionManager } from "./lib/selection-manager" +import { formatMessage } from "./lib/format-message" export * from "./lib/block-box" export * from "./lib/block-plain" @@ -111,6 +112,7 @@ export * from "./lib/form-conditional-renderer" export * from "./lib/entities-loader" export * from "./lib/common-validators" export * from "./lib/conditional-renderer" +export * from "./lib/format-message" export * from "./lib/toast" export * from "./lib/selection-manager" @@ -169,6 +171,7 @@ export default { [tableCell.key]: tableCell, [entitiesLoader.key]: entitiesLoader, [conditionalRenderer.key]: conditionalRenderer, + [formatMessage.key]: formatMessage, [toast.key]: toast, [selectionManager.key]: selectionManager, } as const diff --git a/libs/generic-view/models/src/lib/button-primary.ts b/libs/generic-view/models/src/lib/button-primary.ts index 96e830a6a1..84a11994b0 100644 --- a/libs/generic-view/models/src/lib/button-primary.ts +++ b/libs/generic-view/models/src/lib/button-primary.ts @@ -10,7 +10,7 @@ import { buttonActionsValidator } from "./common-validators" const dataValidator = z.undefined() const configValidator = z.object({ - text: z.string(), + text: z.string().optional(), icon: z.nativeEnum(IconType).optional(), actions: buttonActionsValidator, disabled: z.boolean().optional(), diff --git a/libs/generic-view/ui/src/lib/buttons/button-primary.tsx b/libs/generic-view/ui/src/lib/buttons/button-primary.tsx index 80d8af3699..a6b26b2703 100644 --- a/libs/generic-view/ui/src/lib/buttons/button-primary.tsx +++ b/libs/generic-view/ui/src/lib/buttons/button-primary.tsx @@ -20,7 +20,7 @@ export const ButtonPrimary: APIFC = ({ ) } diff --git a/libs/generic-view/ui/src/lib/interactive/interactive.ts b/libs/generic-view/ui/src/lib/interactive/interactive.ts index af93db6113..f8a160460e 100644 --- a/libs/generic-view/ui/src/lib/interactive/interactive.ts +++ b/libs/generic-view/ui/src/lib/interactive/interactive.ts @@ -9,7 +9,9 @@ import { ProgressBar } from "./progress-bar/progress-bar" import Form from "./form/form" import Tooltip from "./tooltip/tooltip" import { Toast } from "./toast/toast" +import { ConditionalRenderer } from "./conditional-renderer" import { + conditionalRenderer, form, formatMessage, formCheckboxInput, @@ -56,4 +58,5 @@ export const interactive = { [tooltipContent.key]: Tooltip.Content, [formatMessage.key]: FormatMessage, [toast.key]: Toast, + [conditionalRenderer.key]: ConditionalRenderer, } diff --git a/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-title-icon.tsx b/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-title-icon.tsx index 41715a94aa..2a8f31603f 100644 --- a/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-title-icon.tsx +++ b/libs/generic-view/ui/src/lib/interactive/modal/helpers/modal-title-icon.tsx @@ -14,6 +14,7 @@ export const ModalTitleIcon: APIFC = ({ children, ...rest }) => { + // @ts-ignore return }