diff --git a/README.md b/README.md index 3eff8ec54ca..799f0d2a5b4 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ designers, and content authors build, maintain, and scale best of class digital | [ngx-components](https://github.com/db-ui/mono/tree/main/output/angular) | Native Angular components | [![@db-ui/ngx-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ui%2Fmono%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ui/ngx-components "DB UI – on NPM") | | [react-components](https://github.com/db-ui/mono/tree/main/output/react) | Native React components | [![@db-ui/react-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ui%2Fmono%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ui/react-components "DB UI – on NPM") | | [v-components](https://github.com/db-ui/mono/tree/main/output/vue) | Native Vue 3 components | [![@db-ui/v-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ui%2Fmono%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ui/v-components "DB UI – on NPM") | -| [web-components](https://github.com/db-ui/mono/tree/main/output/stencil) | Web Components | [![@db-ui/web-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ui%2Fmono%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ui/web-components "DB UI – on NPM") | +| [web-components](https://github.com/db-ui/mono/tree/main/output/stencil) | Web Components | [![@db-ui/web-components on Npmjs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2Fdb-ui%2Fmono%2Freleases%2Flatest&query=%24.tag_name&label=npm&color=ed1c24 "npm version")](https://npmjs.com/package/@db-ui/web-components "DB UI – on NPM") | ## How to use 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__/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..257494752e6 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..ea22a4d38e4 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..4d724d2f747 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..15cb343306c 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-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..cfe5f7711d9 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..5c4553913e5 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..140b6552ce6 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..c10d7f77611 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..38c71f39163 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..a31a8025cc1 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/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} - +