storybook: add story for args

This commit is contained in:
Jacob Overgaard
2023-08-01 13:32:01 +02:00
parent ddb81576cf
commit b340e65951
2 changed files with 16 additions and 1 deletions

View File

@@ -9,6 +9,13 @@ const meta: Meta<UmbLocalizeElement> = {
args: {
key: 'general_areyousure',
},
argTypes: {
args: {
control: {
type: 'array',
},
},
},
decorators: [
(story) => {
return html`<div style="padding: 1rem; margin: 1rem; border: 1px solid green; max-width:50%;">
@@ -31,6 +38,13 @@ type Story = StoryObj<UmbLocalizeElement>;
export const Overview: Story = {};
export const WithArguments: Story = {
args: {
key: 'blueprints_createdBlueprintMessage',
args: ['About us'],
},
};
export const KeyNotFound: Story = {
args: {
key: 'general_ok_not_found',

View File

@@ -17,9 +17,10 @@ export class UmbLocalizeElement extends UmbLitElement {
key!: string;
/**
* The comma-separated values to forward to the localization function.
* The values to forward to the localization function (must be JSON compatible).
* @attr
* @example args="[1,2,3]"
* @type {any[] | undefined}
*/
@property({
type: Array,