fune/toolkit/content/widgets/moz-button-group/moz-button-group.stories.mjs
Hanna Jones eb9fd58f2b Bug 1799699 - expand storybook args table docs r=mstriemer,tgiles
This is still far from perfect given the limitations of the Storybook web components package, but I figured this was worth putting up since it's still an improvement over the current state of our args tables (I think).

I'm mostly leaving the default generated `custom-elements-manifest.json` alone save for filtering some internal properties we don't want documented since they shouldn't really be accessed directly. If it seems too strange to just have the `aria-label` attr documented we could possibly remove `attributes` from the docs for now (this happens because it's the only attr where the name is different from the property name).

Open to feedback/thoughts on if this is useful or too wonky for now given the weirdness around how Storybook creates naming collisions.

Differential Revision: https://phabricator.services.mozilla.com/D162599
2023-01-23 23:52:36 +00:00

49 lines
1.2 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { html } from "../vendor/lit.all.mjs";
import {
PLATFORM_LINUX,
PLATFORM_MACOS,
PLATFORM_WINDOWS,
} from "./moz-button-group.mjs";
export default {
title: "Design System/Experiments/MozButtonGroup",
component: "moz-button-group",
argTypes: {
platform: {
options: [PLATFORM_LINUX, PLATFORM_MACOS, PLATFORM_WINDOWS],
control: { type: "select" },
},
},
};
const Template = ({ platform }) => html`
<div class="card card-no-hover" style="max-width: 400px">
<p>The button group is below. Card for emphasis.</p>
<moz-button-group .platform=${platform}>
<button class="primary">OK</button>
<button>Cancel</button>
</moz-button-group>
</div>
`;
export const Default = Template.bind({});
Default.args = {
// Platform will auto-detected.
};
export const Windows = Template.bind({});
Windows.args = {
platform: PLATFORM_WINDOWS,
};
export const Mac = Template.bind({});
Mac.args = {
platform: PLATFORM_MACOS,
};
export const Linux = Template.bind({});
Linux.args = {
platform: PLATFORM_LINUX,
};