Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
38289f8
feat: add mitosis plugins for showcases and storybook
nmerget Oct 28, 2025
be83b1f
chore: update examples structure
nmerget Oct 28, 2025
c5148c6
chore: add button examples for every framework
nmerget Oct 28, 2025
ae581fb
chore: update mitosis.config.cjs
nmerget Oct 28, 2025
b9be380
chore: update patternhub to use button showcase
nmerget Oct 29, 2025
8b091b0
fix: linting issues
nmerget Oct 29, 2025
2f18755
fix: linting issues
nmerget Oct 29, 2025
9f35296
fix: build issues
nmerget Oct 29, 2025
20c5dfc
Merge branch 'main' into feat-examples-plugins
nmerget Oct 29, 2025
e8a1d13
fix: build issues
nmerget Oct 29, 2025
017cf49
fix: issue with remaining slot code
nmerget Oct 30, 2025
843e5f9
chore: update button.showcase.lite.tsx
nmerget Oct 30, 2025
83dc632
fix: issue with version-switcher.tsx
nmerget Oct 30, 2025
8007ab7
Merge branch 'main' into feat-examples-plugins
nmerget Oct 30, 2025
4b453d0
auto update snapshots (#5395)
github-actions[bot] Oct 30, 2025
41bc489
chore: update timeouts for patternhub
nmerget Oct 30, 2025
6d6c8c0
chore: update button.showcase.lite.tsx
nmerget Oct 30, 2025
365daeb
fix: replace pages with +
nmerget Oct 30, 2025
c3a43bc
fix: replace pages with +
nmerget Oct 30, 2025
61b80d4
auto update snapshots (#5398)
github-actions[bot] Oct 30, 2025
81f1f8e
feat: add contract for examples and integrate it into config and butt…
michaelmkraus Nov 18, 2025
ba5636d
feat: add plugin for button showcase
michaelmkraus Nov 19, 2025
9e7a32e
chore: merge main to resolve conflicts
michaelmkraus Nov 19, 2025
a6523f8
feat: change meta from tsx to ts
michaelmkraus Nov 19, 2025
bd93f30
auto update snapshots (#5488)
github-actions[bot] Nov 19, 2025
6702f6f
Merge branch 'main' into feat-examples-plugins
michaelmkraus Nov 20, 2025
44976ad
fix: normalize url with spaces
michaelmkraus Nov 20, 2025
cc1ed5f
Merge remote-tracking branch 'origin/feat-examples-plugins' into feat…
michaelmkraus Nov 20, 2025
804a777
feat: use basepath for group in url for tests
michaelmkraus Nov 20, 2025
5c86107
feat: fix basepath for group in url for overview
michaelmkraus Nov 21, 2025
0a7f24e
Merge branch 'main' into feat-examples-plugins
michaelmkraus Nov 21, 2025
82fd6f5
feat: adapt screenreader test for button to tab into document
michaelmkraus Nov 24, 2025
b989038
Merge remote-tracking branch 'origin/feat-examples-plugins' into feat…
michaelmkraus Nov 24, 2025
fd8b7b5
feat: revert adapt screenreader test for button to tab into document
michaelmkraus Nov 24, 2025
903e352
Merge branch 'main' into feat-examples-plugins
michaelmkraus Nov 24, 2025
c6dad55
refactor: order
mfranzke Nov 28, 2025
ee0ef58
Update button.examples.meta.ts
mfranzke Nov 28, 2025
0502b3c
auto update snapshots (#5539)
github-actions[bot] Nov 28, 2025
e37030a
Merge branch 'main' into feat-examples-plugins
michaelmkraus Dec 1, 2025
e5082fe
feat: revert vertical center alignment of items
michaelmkraus Dec 2, 2025
b399f43
Merge branch 'main' into feat-examples-plugins
michaelmkraus Dec 2, 2025
c45938e
auto update snapshots (#5557)
github-actions[bot] Dec 2, 2025
f662b4a
Merge branch 'main' into feat-examples-plugins
mfranzke Dec 3, 2025
094ac0c
Update default.spec.ts
mfranzke Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@ import ignoreFolders from './.config/ignores.js';
export default defineConfig([
xoConfig,
eslintConfigPrettier,
globalIgnores([...ignoreFolders])
globalIgnores([...ignoreFolders]),
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: { jsx: true }
},
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended']
}
]);
2 changes: 1 addition & 1 deletion output/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"target": "es2015"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "src/**/*.spec.tsx"],
"exclude": ["node_modules", "src/**/*.spec.tsx", "src/**/*.example.tsx", "src/**/*.showcase.tsx"],
"compileOnSave": false,
"buildOnSave": false
}
2 changes: 1 addition & 1 deletion output/vue/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"skipLibCheck": true
},
"include": ["src/**/*.ts", "src/**/*.vue"],
"exclude": ["node_modules", "src/**/*.scss", "src/**/*.spec.tsx"],
"exclude": ["node_modules", "src/**/*.scss", "src/**/*.spec.tsx", "src/**/*.example.vue", "src/**/*.showcase.vue"],
"compileOnSave": false,
"buildOnSave": false
}
22 changes: 22 additions & 0 deletions packages/components/configs/mitosis.showcase.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @type {import('@builder.io/mitosis').MitosisConfig}
*/
module.exports = {
files: [
'src/components/**/*.showcase.lite.tsx',
'src/components/**/*.example.lite.tsx'
],
targets: ['angular', 'vue', 'react', 'stencil'],
dest: '../../output',
options: {
angular: {
api: 'signals'
},
vue: {
api: 'composition'
}
},
commonOptions: {
typescript: true
}
};
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"dev:stencil": "nodemon --watch src --watch scripts --ext tsx,ts --exec \"npm run compile:stencil\"",
"dev:vue": "nodemon --watch src --watch scripts --ext tsx,ts --exec \"npm run compile:vue\"",
"generate:agent": "mitosis build --config=configs/mitosis.agent.config.cjs",
"generate:showcase": "mitosis build --config=configs/mitosis.showcase.config.cjs",
"generate:component": "hygen mitosis new",
"generate:docs": "hygen update-docs new",
"prepack": "npm run copy-assets",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
export type ButtonExampleIdentifier =
| 'density'
| 'variant'
| 'disabled'
| 'size'
| 'show-icon-leading'
| 'show-icon-trailing'
| 'no-text'
| 'width'
| 'multi-line-text';

export type ButtonExampleGroup =
| 'Content'
| 'Density'
| 'Icons'
| 'Layout'
| 'Size'
| 'State'
| 'Variants';

export type ButtonExampleMeta = {
/** Technical identifier */
id: ButtonExampleIdentifier;

/** Readable name */
exampleName: string;

/** Group to which the example belongs */
group?: ButtonExampleGroup;

/** Names of the Storybook stories that are created from this example. */
storybookNames?: string[];
};

/**
* All button examples, defined centrally.
*/
export const buttonExamplesMeta: ButtonExampleMeta[] = [
{
id: 'density',
exampleName: 'Density',
group: 'Density',
storybookNames: ['Density']
},
{
id: 'variant',
exampleName: 'Variant',
group: 'Variants',
storybookNames: ['Outlined', 'Filled', 'Ghost', 'Brand']
},
{
id: 'disabled',
exampleName: 'Disabled',
group: 'State',
storybookNames: ['Disabled']
},
{
id: 'size',
exampleName: 'Size',
group: 'Size',
storybookNames: ['Size']
},
{
id: 'show-icon-leading',
exampleName: 'Show Icon Leading',
group: 'Icons',
storybookNames: ['Show Icon Leading']
},
{
id: 'show-icon-trailing',
exampleName: 'Show Icon Trailing',
group: 'Icons',
storybookNames: ['Show Icon Trailing']
},
{
id: 'no-text',
exampleName: 'No Text',
group: 'Content',
storybookNames: ['Icon Only']
},
{
id: 'width',
exampleName: 'Width',
group: 'Layout',
storybookNames: ['Width']
},
{
id: 'multi-line-text',
exampleName: 'Multi-line Text With Line Breaks',
group: 'Content',
storybookNames: ['Multi-line Text']
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonDensity() {
return (
<Fragment>
<DBButton data-density="functional">Functional</DBButton>
<DBButton data-density="regular">(Default) Regular</DBButton>
<DBButton data-density="expressive">Expressive</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonDisabled() {
return (
<Fragment>
<DBButton disabled={false}>(Default) False</DBButton>
<DBButton disabled={true}>True</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonMultiLineText() {
return (
<Fragment>
<div style={{ width: '300px' }}>
<DBButton width="full">
Multi-line Text With Automatic Line Breaks
</DBButton>
</div>
<div style={{ width: '300px' }}>
<DBButton width="full" icon="x_placeholder">
Multi-line Text With Automatic Line Breaks and Icon
</DBButton>
</div>
<div style={{ width: '300px' }}>
<DBButton size="small">
Button Small Multi-line Text With Automatic Line Breaks
</DBButton>
</div>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonNoText() {
return (
<Fragment>
<DBButton icon="x_placeholder">(Default) False</DBButton>
<DBButton icon="x_placeholder" noText={true}>True</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonShowIconLeading() {
return (
<Fragment>
<DBButton icon="x_placeholder" showIcon={false}>(Default) False</DBButton>
<DBButton icon="x_placeholder" showIcon={true}>True</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonShowIconTrailing() {
return (
<Fragment>
<DBButton iconTrailing="x_placeholder" showIconTrailing={false}>(Default) False</DBButton>
<DBButton iconTrailing="x_placeholder" showIconTrailing={true}>True</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonSize() {
return (
<Fragment>
<DBButton size="medium">(Default) Medium</DBButton>
<DBButton size="small">Small</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Fragment, useMetadata } from '@builder.io/mitosis';
import DBButton from '../button.lite';

useMetadata({
storybookNames: ['Outlined', 'Filled', 'Ghost', 'Brand']
});

export default function ButtonVariant() {
return (
<Fragment>
<DBButton variant="outlined">
(Default) Outlined - Adaptive
</DBButton>
<DBButton variant="filled">Filled - Adaptive</DBButton>
<DBButton variant="ghost">Ghost - Adaptive</DBButton>
<DBButton variant="brand">Brand</DBButton>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Fragment } from '@builder.io/mitosis';
import DBButton from '../button.lite';

export default function ButtonWidth() {
return (
<Fragment>
<DBButton width="auto">(Default) Auto</DBButton>
<div style={{ width: '500px' }}>
<DBButton width="full">Width</DBButton>
</div>
</Fragment>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { PatternhubProps } from '../../../shared/model';
import CardWrapperShowcase from '../../../shared/showcase/card-wrapper.showcase.lite';
import ContainerWrapperShowcase from '../../../shared/showcase/container-wrapper.showcase.lite';
import LinkWrapperShowcase from '../../../shared/showcase/link-wrapper.showcase.lite';

import ButtonDensity from '../examples/density.example.lite';
import ButtonDisabled from '../examples/disabled.example.lite';
import ButtonMultiLineText from '../examples/multi-line-text.example.lite';
import ButtonNoText from '../examples/no-text.example.lite';
import ButtonShowIconLeading from '../examples/show-icon-leading.example.lite';
import ButtonShowIconTrailing from '../examples/show-icon-trailing.example.lite';
import ButtonSize from '../examples/size.example.lite';
import ButtonVariant from '../examples/variant.example.lite';
import ButtonWidth from '../examples/width.example.lite';

import {
buttonExamplesMeta,
type ButtonExampleIdentifier
} from '../examples/button.examples.meta';

const getExampleName = (id: ButtonExampleIdentifier): string =>
(buttonExamplesMeta.find((example) => example.id === id)?.exampleName ??
id) as string;

export default function ButtonShowcase(props: PatternhubProps) {
return (
<ContainerWrapperShowcase
title="DBButton"
isPatternhub={props.isPatternhub}>
<LinkWrapperShowcase exampleName={getExampleName('density')}>
<CardWrapperShowcase>
<ButtonDensity />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase exampleName={getExampleName('variant')}>
<CardWrapperShowcase>
<ButtonVariant />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase exampleName={getExampleName('disabled')}>
<CardWrapperShowcase>
<ButtonDisabled />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase exampleName={getExampleName('size')}>
<CardWrapperShowcase>
<ButtonSize />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase
exampleName={getExampleName('show-icon-leading')}>
<CardWrapperShowcase>
<ButtonShowIconLeading />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase
exampleName={getExampleName('show-icon-trailing')}>
<CardWrapperShowcase>
<ButtonShowIconTrailing />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase exampleName={getExampleName('no-text')}>
<CardWrapperShowcase>
<ButtonNoText />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase exampleName={getExampleName('width')}>
<CardWrapperShowcase>
<ButtonWidth />
</CardWrapperShowcase>
</LinkWrapperShowcase>
<LinkWrapperShowcase
exampleName={getExampleName('multi-line-text')}>
<CardWrapperShowcase>
<ButtonMultiLineText />
</CardWrapperShowcase>
</LinkWrapperShowcase>
</ContainerWrapperShowcase>
);
}
8 changes: 8 additions & 0 deletions packages/components/src/shared/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,3 +723,11 @@ export type PopoverState = {
handleEnter: (parent?: HTMLElement) => void;
handleLeave: (event?: any) => void;
} & DocumentScrollState;

// TODO: Remove this after we migrate to one-platform
export interface PatternhubProps {
/**
* Used for Patternhub
*/
isPatternhub?: boolean;
}
Loading
Loading