diff --git a/__snapshots__/brand/patternhub/brand-properties-should-match-screenshot.png b/__snapshots__/brand/patternhub/brand-properties-should-match-screenshot.png index 37ef710488c..95a50a32a2c 100644 Binary files a/__snapshots__/brand/patternhub/brand-properties-should-match-screenshot.png and b/__snapshots__/brand/patternhub/brand-properties-should-match-screenshot.png differ diff --git a/__snapshots__/button/patternhub/button-properties-should-match-screenshot.png b/__snapshots__/button/patternhub/button-properties-should-match-screenshot.png index 0f6f631ddcf..76edfefc764 100644 Binary files a/__snapshots__/button/patternhub/button-properties-should-match-screenshot.png and b/__snapshots__/button/patternhub/button-properties-should-match-screenshot.png differ diff --git a/__snapshots__/checkbox/showcase/chromium-highContrast/DBCheckbox-should-match-screenshot-1/DBCheckbox-should-match-screenshot.png b/__snapshots__/checkbox/showcase/chromium-highContrast/DBCheckbox-should-match-screenshot-1/DBCheckbox-should-match-screenshot.png index dbee27630b0..aab717df8e7 100644 Binary files a/__snapshots__/checkbox/showcase/chromium-highContrast/DBCheckbox-should-match-screenshot-1/DBCheckbox-should-match-screenshot.png and b/__snapshots__/checkbox/showcase/chromium-highContrast/DBCheckbox-should-match-screenshot-1/DBCheckbox-should-match-screenshot.png differ diff --git a/__snapshots__/header/patternhub/header-overview-should-match-screenshot.png b/__snapshots__/header/patternhub/header-overview-should-match-screenshot.png index 69c2cf676d6..574146bab40 100644 Binary files a/__snapshots__/header/patternhub/header-overview-should-match-screenshot.png and b/__snapshots__/header/patternhub/header-overview-should-match-screenshot.png differ diff --git a/__snapshots__/header/showcase/chromium-highContrast/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png b/__snapshots__/header/showcase/chromium-highContrast/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png index 8d76c4ffc15..5ac6170d1cc 100644 Binary files a/__snapshots__/header/showcase/chromium-highContrast/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png and b/__snapshots__/header/showcase/chromium-highContrast/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png differ diff --git a/__snapshots__/header/showcase/chromium/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png b/__snapshots__/header/showcase/chromium/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png index adc5c88f1bf..e560fea9388 100644 Binary files a/__snapshots__/header/showcase/chromium/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png and b/__snapshots__/header/showcase/chromium/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png differ diff --git a/__snapshots__/header/showcase/firefox/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png b/__snapshots__/header/showcase/firefox/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png index 217c4f79095..8f6799960a3 100644 Binary files a/__snapshots__/header/showcase/firefox/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png and b/__snapshots__/header/showcase/firefox/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png differ diff --git a/__snapshots__/header/showcase/webkit/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png b/__snapshots__/header/showcase/webkit/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png index 8e13e998309..f79d1c08de3 100644 Binary files a/__snapshots__/header/showcase/webkit/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png and b/__snapshots__/header/showcase/webkit/DBHeader-should-match-screenshot-1/DBHeader-should-match-screenshot.png differ diff --git a/__snapshots__/infotext/patternhub/infotext-properties-should-match-screenshot.png b/__snapshots__/infotext/patternhub/infotext-properties-should-match-screenshot.png index 813b4d55116..8b04709805d 100644 Binary files a/__snapshots__/infotext/patternhub/infotext-properties-should-match-screenshot.png and b/__snapshots__/infotext/patternhub/infotext-properties-should-match-screenshot.png differ diff --git a/__snapshots__/link/patternhub/link-overview-should-match-screenshot.png b/__snapshots__/link/patternhub/link-overview-should-match-screenshot.png index e7b278a1b34..f52a69b692f 100644 Binary files a/__snapshots__/link/patternhub/link-overview-should-match-screenshot.png and b/__snapshots__/link/patternhub/link-overview-should-match-screenshot.png differ diff --git a/__snapshots__/link/patternhub/link-properties-should-match-screenshot.png b/__snapshots__/link/patternhub/link-properties-should-match-screenshot.png index 75cb1f33a25..df2b23e04a2 100644 Binary files a/__snapshots__/link/patternhub/link-properties-should-match-screenshot.png and b/__snapshots__/link/patternhub/link-properties-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/chromium-highContrast/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/chromium-highContrast/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index 9eaf8455612..f75c4b1743a 100644 Binary files a/__snapshots__/link/showcase/chromium-highContrast/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/chromium-highContrast/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/chromium/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/chromium/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index ffd671aeb20..e2a5a05e15b 100644 Binary files a/__snapshots__/link/showcase/chromium/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/chromium/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/firefox/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/firefox/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index 3b70119be56..a699cd32595 100644 Binary files a/__snapshots__/link/showcase/firefox/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/firefox/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/mobile-chrome/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/mobile-chrome/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index 971fd945999..43e40a1886a 100644 Binary files a/__snapshots__/link/showcase/mobile-chrome/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/mobile-chrome/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/mobile-safari/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/mobile-safari/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index ed178387758..6e09f34de9a 100644 Binary files a/__snapshots__/link/showcase/mobile-safari/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/mobile-safari/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/link/showcase/webkit/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png b/__snapshots__/link/showcase/webkit/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png index c3594b7e9fc..210cb45d50a 100644 Binary files a/__snapshots__/link/showcase/webkit/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png and b/__snapshots__/link/showcase/webkit/DBLink-should-match-screenshot-1/DBLink-should-match-screenshot.png differ diff --git a/__snapshots__/notification/patternhub/notification-properties-should-match-screenshot.png b/__snapshots__/notification/patternhub/notification-properties-should-match-screenshot.png index 2bcee43beaa..7dc803f53d3 100644 Binary files a/__snapshots__/notification/patternhub/notification-properties-should-match-screenshot.png and b/__snapshots__/notification/patternhub/notification-properties-should-match-screenshot.png differ diff --git a/__snapshots__/tab-item/patternhub/tab-item-properties-should-match-screenshot.png b/__snapshots__/tab-item/patternhub/tab-item-properties-should-match-screenshot.png index 9eda293c68a..9bf95392ff6 100644 Binary files a/__snapshots__/tab-item/patternhub/tab-item-properties-should-match-screenshot.png and b/__snapshots__/tab-item/patternhub/tab-item-properties-should-match-screenshot.png differ diff --git a/__snapshots__/tag/component/chromium/DBTag-should-be-a-checkbox-checked.png b/__snapshots__/tag/component/chromium/DBTag-should-be-a-checkbox-checked.png index d955b6d3610..8bc5f8cb0bd 100644 Binary files a/__snapshots__/tag/component/chromium/DBTag-should-be-a-checkbox-checked.png and b/__snapshots__/tag/component/chromium/DBTag-should-be-a-checkbox-checked.png differ diff --git a/__snapshots__/tag/component/firefox/DBTag-should-be-a-checkbox-checked.png b/__snapshots__/tag/component/firefox/DBTag-should-be-a-checkbox-checked.png index 03bd8627b3c..303ed8f4376 100644 Binary files a/__snapshots__/tag/component/firefox/DBTag-should-be-a-checkbox-checked.png and b/__snapshots__/tag/component/firefox/DBTag-should-be-a-checkbox-checked.png differ diff --git a/__snapshots__/tag/component/mobile-chrome/DBTag-should-be-a-checkbox-checked.png b/__snapshots__/tag/component/mobile-chrome/DBTag-should-be-a-checkbox-checked.png index d955b6d3610..8bc5f8cb0bd 100644 Binary files a/__snapshots__/tag/component/mobile-chrome/DBTag-should-be-a-checkbox-checked.png and b/__snapshots__/tag/component/mobile-chrome/DBTag-should-be-a-checkbox-checked.png differ diff --git a/packages/components/scripts/utils/index.ts b/packages/components/scripts/utils/index.ts index 2e01b14a794..7ea0b19c7a1 100644 --- a/packages/components/scripts/utils/index.ts +++ b/packages/components/scripts/utils/index.ts @@ -21,6 +21,11 @@ export const runReplacements = ( replacements = [...replacements, ...component.overwrites.global]; } + replacements.push({ + from: ',\n' + ',', + to: ',' + }); + for (const replacement of replacements) { const option = { files: file, diff --git a/packages/components/src/components/accordion-item/accordion-item.lite.tsx b/packages/components/src/components/accordion-item/accordion-item.lite.tsx index edbb92bb1d7..73c5f774a3d 100644 --- a/packages/components/src/components/accordion-item/accordion-item.lite.tsx +++ b/packages/components/src/components/accordion-item/accordion-item.lite.tsx @@ -53,8 +53,9 @@ export default function DBAccordionItem(props: DBAccordionItemProps) {
- {props.content} - {props.children} + + {props.content} +
); diff --git a/packages/components/src/components/badge/badge.lite.tsx b/packages/components/src/components/badge/badge.lite.tsx index 402e6449f3b..c0a11fe0e57 100644 --- a/packages/components/src/components/badge/badge.lite.tsx +++ b/packages/components/src/components/badge/badge.lite.tsx @@ -1,6 +1,7 @@ import { onMount, onUpdate, + Show, useMetadata, useRef, useStore @@ -51,7 +52,9 @@ export default function DBBadge(props: DBBadgeProps) { props.placement?.startsWith('corner') && (props.label ?? DEFAULT_LABEL) }> - {props.children} + + {props.text} + ); } diff --git a/packages/components/src/components/badge/model.ts b/packages/components/src/components/badge/model.ts index 9307b8d2732..3773cfe1936 100644 --- a/packages/components/src/components/badge/model.ts +++ b/packages/components/src/components/badge/model.ts @@ -4,7 +4,8 @@ import { GlobalState, InitializedState, SemanticProps, - SizeProps + SizeProps, + TextProps } from '../../shared/model'; export const BadgePlacementList = [ @@ -34,7 +35,8 @@ export type DBBadgeProps = DBBadgeDefaultProps & GlobalProps & SemanticProps & SizeProps & - EmphasisProps; + EmphasisProps & + TextProps; export type DBBadgeDefaultState = {}; diff --git a/packages/components/src/components/brand/brand.lite.tsx b/packages/components/src/components/brand/brand.lite.tsx index 96e995aef9e..0fac1db160b 100644 --- a/packages/components/src/components/brand/brand.lite.tsx +++ b/packages/components/src/components/brand/brand.lite.tsx @@ -1,5 +1,5 @@ -import { useMetadata, useRef, useStore } from '@builder.io/mitosis'; -import { cls } from '../../utils'; +import { Show, useMetadata, useRef, useStore } from '@builder.io/mitosis'; +import { cls, getHideIcon } from '../../utils'; import { DBBrandProps, DBBrandState } from './model'; import { DEFAULT_ICON } from '../../shared/constants'; @@ -15,9 +15,12 @@ export default function DBBrand(props: DBBrandProps) {
- {props.children} + + {props.text} +
); } diff --git a/packages/components/src/components/brand/model.ts b/packages/components/src/components/brand/model.ts index c18d7387b9f..2b6b2f5ce87 100644 --- a/packages/components/src/components/brand/model.ts +++ b/packages/components/src/components/brand/model.ts @@ -1,13 +1,23 @@ -import { GlobalProps, GlobalState, IconProps } from '../../shared/model'; +import { + GlobalProps, + GlobalState, + IconProps, + ShowIconProps, + TextProps +} from '../../shared/model'; export type DBBrandDefaultProps = { /** - * Disable the default logo svg to pass in a custom `img` + * @deprecated: Disable the default logo svg to pass in a custom `img` */ hideLogo?: boolean; }; -export type DBBrandProps = DBBrandDefaultProps & GlobalProps & IconProps; +export type DBBrandProps = DBBrandDefaultProps & + GlobalProps & + IconProps & + ShowIconProps & + TextProps; export type DBBrandDefaultState = {}; diff --git a/packages/components/src/components/button/button.lite.tsx b/packages/components/src/components/button/button.lite.tsx index ef0d1b20f83..396f04321ae 100644 --- a/packages/components/src/components/button/button.lite.tsx +++ b/packages/components/src/components/button/button.lite.tsx @@ -1,6 +1,6 @@ -import { useMetadata, useRef, useStore } from '@builder.io/mitosis'; +import { Show, useMetadata, useRef, useStore } from '@builder.io/mitosis'; import type { DBButtonProps, DBButtonState } from './model'; -import { cls, getBooleanAsString } from '../../utils'; +import { cls, getBooleanAsString, getHideIcon } from '../../utils'; import { ClickEvent } from '../../shared/model'; useMetadata({}); @@ -27,6 +27,7 @@ export default function DBButton(props: DBButtonProps) { disabled={props.disabled} aria-label={props.label} data-icon={props.icon} + data-hide-icon={getHideIcon(props.showIcon)} data-size={props.size} data-state={props.state} data-width={props.width} @@ -40,7 +41,9 @@ export default function DBButton(props: DBButtonProps) { onClick={(event: ClickEvent) => state.handleClick(event) }> - {props.children} + + {props.text} + ); } diff --git a/packages/components/src/components/button/model.ts b/packages/components/src/components/button/model.ts index 469b2cf6094..752342f7b7d 100644 --- a/packages/components/src/components/button/model.ts +++ b/packages/components/src/components/button/model.ts @@ -4,7 +4,9 @@ import { GlobalProps, GlobalState, IconProps, + ShowIconProps, SizeProps, + TextProps, WidthProps } from '../../shared/model'; @@ -79,7 +81,9 @@ export type DBButtonProps = DBButtonDefaultProps & ClickEventProps & IconProps & WidthProps & - SizeProps; + SizeProps & + ShowIconProps & + TextProps; export type DBButtonDefaultState = {}; diff --git a/packages/components/src/components/checkbox/checkbox.lite.tsx b/packages/components/src/components/checkbox/checkbox.lite.tsx index 40e0083c26c..8acd9cf9ac0 100644 --- a/packages/components/src/components/checkbox/checkbox.lite.tsx +++ b/packages/components/src/components/checkbox/checkbox.lite.tsx @@ -17,7 +17,10 @@ import { DEFAULT_VALID_MESSAGE_ID_SUFFIX } from '../../shared/constants'; import { ChangeEvent, InteractionEvent } from '../../shared/model'; -import { handleFrameworkEvent } from '../../utils/form-components'; +import { + handleFrameworkEvent, + messageVisible +} from '../../utils/form-components'; import DBInfotext from '../infotext/infotext.lite'; useMetadata({}); @@ -167,13 +170,12 @@ export default function DBCheckbox(props: DBCheckboxProps) { } aria-describedby={state._descByIds} /> - - {props.label} + + {props.label} - {props.children} - +