@omicronenergy/oscd-ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -0
- package/app-bar/OscdAppBar.d.ts +13 -11
- package/app-bar/OscdAppBar.js +16 -8
- package/app-bar/OscdAppBar.js.map +1 -1
- package/app-bar/oscd-app-bar.d.ts +6 -6
- package/app-bar/oscd-app-bar.js +2 -7
- package/app-bar/oscd-app-bar.js.map +1 -1
- package/button/OscdFilledButton.d.ts +6 -8
- package/button/OscdFilledButton.js +8 -5
- package/button/OscdFilledButton.js.map +1 -1
- package/button/OscdFilledButton.spec.js +22 -18
- package/button/OscdFilledButton.spec.js.map +1 -1
- package/button/OscdOutlinedButton.d.ts +4 -6
- package/button/OscdOutlinedButton.js +4 -1
- package/button/OscdOutlinedButton.js.map +1 -1
- package/button/OscdTextButton.d.ts +6 -8
- package/button/OscdTextButton.js +7 -4
- package/button/OscdTextButton.js.map +1 -1
- package/button/oscd-filled-button.d.ts +6 -1
- package/button/oscd-filled-button.js +2 -2
- package/button/oscd-filled-button.js.map +1 -1
- package/button/oscd-outlined-button.d.ts +6 -1
- package/button/oscd-outlined-button.js +2 -2
- package/button/oscd-outlined-button.js.map +1 -1
- package/button/oscd-text-button.d.ts +6 -1
- package/button/oscd-text-button.js +2 -2
- package/button/oscd-text-button.js.map +1 -1
- package/dialog/OscdDialog.d.ts +3 -8
- package/dialog/OscdDialog.js +4 -4
- package/dialog/OscdDialog.js.map +1 -1
- package/dialog/oscd-dialog.d.ts +6 -1
- package/dialog/oscd-dialog.js +2 -2
- package/dialog/oscd-dialog.js.map +1 -1
- package/divider/OscdDivider.d.ts +4 -8
- package/divider/OscdDivider.js +4 -3
- package/divider/OscdDivider.js.map +1 -1
- package/divider/oscd-divider.d.ts +6 -1
- package/divider/oscd-divider.js +2 -2
- package/divider/oscd-divider.js.map +1 -1
- package/elevation/OscdElevation.d.ts +2 -6
- package/elevation/OscdElevation.js +2 -1
- package/elevation/OscdElevation.js.map +1 -1
- package/elevation/oscd-elevation.d.ts +6 -1
- package/elevation/oscd-elevation.js +2 -2
- package/elevation/oscd-elevation.js.map +1 -1
- package/field/OscdFilledField.d.ts +4 -7
- package/field/OscdFilledField.js +5 -3
- package/field/OscdFilledField.js.map +1 -1
- package/field/OscdOutlinedField.d.ts +6 -7
- package/field/OscdOutlinedField.js +7 -3
- package/field/OscdOutlinedField.js.map +1 -1
- package/field/oscd-filled-field.d.ts +6 -1
- package/field/oscd-filled-field.js +2 -2
- package/field/oscd-filled-field.js.map +1 -1
- package/field/oscd-outlined-field.d.ts +6 -1
- package/field/oscd-outlined-field.js +2 -2
- package/field/oscd-outlined-field.js.map +1 -1
- package/icon/OscdIcon.d.ts +6 -7
- package/icon/OscdIcon.js +6 -2
- package/icon/OscdIcon.js.map +1 -1
- package/icon/oscd-icon.d.ts +6 -1
- package/icon/oscd-icon.js +2 -2
- package/icon/oscd-icon.js.map +1 -1
- package/iconbutton/OscdFilledIconButton.d.ts +4 -9
- package/iconbutton/OscdFilledIconButton.js +5 -5
- package/iconbutton/OscdFilledIconButton.js.map +1 -1
- package/iconbutton/OscdFilledTonalIconButton.d.ts +5 -10
- package/iconbutton/OscdFilledTonalIconButton.js +6 -6
- package/iconbutton/OscdFilledTonalIconButton.js.map +1 -1
- package/iconbutton/OscdIconButton.d.ts +3 -8
- package/iconbutton/OscdIconButton.js +4 -4
- package/iconbutton/OscdIconButton.js.map +1 -1
- package/iconbutton/{OutlinedIconButton.d.ts → OscdOutlinedIconButton.d.ts} +3 -8
- package/iconbutton/{OutlinedIconButton.js → OscdOutlinedIconButton.js} +5 -5
- package/iconbutton/OscdOutlinedIconButton.js.map +1 -0
- package/iconbutton/oscd-filled-icon-button.d.ts +6 -1
- package/iconbutton/oscd-filled-icon-button.js +2 -2
- package/iconbutton/oscd-filled-icon-button.js.map +1 -1
- package/iconbutton/oscd-filled-tonal-icon-button.d.ts +6 -1
- package/iconbutton/oscd-filled-tonal-icon-button.js +2 -2
- package/iconbutton/oscd-filled-tonal-icon-button.js.map +1 -1
- package/iconbutton/oscd-icon-button.d.ts +6 -1
- package/iconbutton/oscd-icon-button.js +2 -2
- package/iconbutton/oscd-icon-button.js.map +1 -1
- package/iconbutton/oscd-outlined-icon-button.d.ts +6 -1
- package/iconbutton/oscd-outlined-icon-button.js +2 -2
- package/iconbutton/oscd-outlined-icon-button.js.map +1 -1
- package/list/OscdList.d.ts +3 -8
- package/list/OscdList.js +4 -4
- package/list/OscdList.js.map +1 -1
- package/list/OscdListItem.d.ts +4 -11
- package/list/OscdListItem.js +6 -8
- package/list/OscdListItem.js.map +1 -1
- package/list/oscd-list-item.d.ts +6 -1
- package/list/oscd-list-item.js +2 -2
- package/list/oscd-list-item.js.map +1 -1
- package/list/oscd-list.d.ts +6 -1
- package/list/oscd-list.js +2 -2
- package/list/oscd-list.js.map +1 -1
- package/menu/OscdMenu.d.ts +7 -12
- package/menu/OscdMenu.js +5 -5
- package/menu/OscdMenu.js.map +1 -1
- package/menu/OscdMenuItem.d.ts +5 -10
- package/menu/OscdMenuItem.js +3 -3
- package/menu/OscdMenuItem.js.map +1 -1
- package/menu/oscd-menu-item.d.ts +6 -1
- package/menu/oscd-menu-item.js +2 -2
- package/menu/oscd-menu-item.js.map +1 -1
- package/menu/oscd-menu.d.ts +7 -1
- package/menu/oscd-menu.js +3 -3
- package/menu/oscd-menu.js.map +1 -1
- package/navigation-drawer/OscdNavigationDrawer.d.ts +8 -2
- package/navigation-drawer/OscdNavigationDrawer.js +10 -4
- package/navigation-drawer/OscdNavigationDrawer.js.map +1 -1
- package/navigation-drawer/OscdNavigationDrawerHeader.d.ts +7 -7
- package/navigation-drawer/OscdNavigationDrawerHeader.js +8 -3
- package/navigation-drawer/OscdNavigationDrawerHeader.js.map +1 -1
- package/navigation-drawer/oscd-navigation-drawer-header.d.ts +6 -1
- package/navigation-drawer/oscd-navigation-drawer-header.js +2 -2
- package/navigation-drawer/oscd-navigation-drawer-header.js.map +1 -1
- package/navigation-drawer/oscd-navigation-drawer.d.ts +2 -2
- package/navigation-drawer/oscd-navigation-drawer.js +2 -2
- package/navigation-drawer/oscd-navigation-drawer.js.map +1 -1
- package/package.json +169 -15
- package/select/OscdFilledSelect.d.ts +3 -8
- package/select/OscdFilledSelect.js +4 -4
- package/select/OscdFilledSelect.js.map +1 -1
- package/select/OscdOutlinedSelect.d.ts +3 -8
- package/select/OscdOutlinedSelect.js +4 -4
- package/select/OscdOutlinedSelect.js.map +1 -1
- package/select/OscdSelectOption.d.ts +4 -9
- package/select/OscdSelectOption.js +3 -3
- package/select/OscdSelectOption.js.map +1 -1
- package/select/oscd-filled-select.d.ts +6 -1
- package/select/oscd-filled-select.js +2 -2
- package/select/oscd-filled-select.js.map +1 -1
- package/select/oscd-outlined-select.d.ts +6 -1
- package/select/oscd-outlined-select.js +2 -2
- package/select/oscd-outlined-select.js.map +1 -1
- package/select/oscd-select-option.d.ts +6 -1
- package/select/oscd-select-option.js +2 -2
- package/select/oscd-select-option.js.map +1 -1
- package/tabs/OscdPrimaryTab.d.ts +3 -7
- package/tabs/OscdPrimaryTab.js +4 -3
- package/tabs/OscdPrimaryTab.js.map +1 -1
- package/tabs/OscdSecondaryTab.d.ts +3 -7
- package/tabs/OscdSecondaryTab.js +4 -3
- package/tabs/OscdSecondaryTab.js.map +1 -1
- package/tabs/OscdTabs.d.ts +3 -7
- package/tabs/OscdTabs.js +3 -2
- package/tabs/OscdTabs.js.map +1 -1
- package/tabs/oscd-primary-tab.d.ts +6 -1
- package/tabs/oscd-primary-tab.js +2 -2
- package/tabs/oscd-primary-tab.js.map +1 -1
- package/tabs/oscd-secondary-tab.d.ts +6 -1
- package/tabs/oscd-secondary-tab.js +2 -2
- package/tabs/oscd-secondary-tab.js.map +1 -1
- package/tabs/oscd-tabs.d.ts +6 -1
- package/tabs/oscd-tabs.js +2 -2
- package/tabs/oscd-tabs.js.map +1 -1
- package/textfield/OscdFilledTextField.d.ts +10 -11
- package/textfield/OscdFilledTextField.js +12 -12
- package/textfield/OscdFilledTextField.js.map +1 -1
- package/textfield/OscdOutlinedTextField.d.ts +11 -10
- package/textfield/OscdOutlinedTextField.js +15 -11
- package/textfield/OscdOutlinedTextField.js.map +1 -1
- package/textfield/oscd-filled-text-field.d.ts +6 -1
- package/textfield/oscd-filled-text-field.js +2 -2
- package/textfield/oscd-filled-text-field.js.map +1 -1
- package/textfield/oscd-outlined-text-field.d.ts +6 -1
- package/textfield/oscd-outlined-text-field.js +2 -2
- package/textfield/oscd-outlined-text-field.js.map +1 -1
- package/utils/storybook/getStorybookHelpers.d.ts +2 -2
- package/utils/storybook/getStorybookHelpers.js +9 -9
- package/utils/storybook/getStorybookHelpers.js.map +1 -1
- package/utils/storybook/scopedWcDecorator.d.ts +1 -1
- package/utils/storybook/scopedWcDecorator.js +17 -7
- package/utils/storybook/scopedWcDecorator.js.map +1 -1
- package/utils/storybook/themingDecorator.d.ts +4 -15
- package/utils/storybook/themingDecorator.js +62 -62
- package/utils/storybook/themingDecorator.js.map +1 -1
- package/app-bar/OscdAppBar.stories.d.ts +0 -10
- package/app-bar/OscdAppBar.stories.js +0 -85
- package/app-bar/OscdAppBar.stories.js.map +0 -1
- package/button/OscdButton.stories.d.ts +0 -7
- package/button/OscdButton.stories.js +0 -60
- package/button/OscdButton.stories.js.map +0 -1
- package/dialog/OscdDialog.stories.d.ts +0 -5
- package/dialog/OscdDialog.stories.js +0 -50
- package/dialog/OscdDialog.stories.js.map +0 -1
- package/divider/OscdDivider.stories.d.ts +0 -5
- package/divider/OscdDivider.stories.js +0 -28
- package/divider/OscdDivider.stories.js.map +0 -1
- package/icon/OscdIcon.stories.d.ts +0 -5
- package/icon/OscdIcon.stories.js +0 -54
- package/icon/OscdIcon.stories.js.map +0 -1
- package/iconbutton/OscdIconButton.stories.d.ts +0 -7
- package/iconbutton/OscdIconButton.stories.js +0 -101
- package/iconbutton/OscdIconButton.stories.js.map +0 -1
- package/iconbutton/OutlinedIconButton.js.map +0 -1
- package/list/OscdList.stories.d.ts +0 -5
- package/list/OscdList.stories.js +0 -30
- package/list/OscdList.stories.js.map +0 -1
- package/menu/OscdMenu.stories.d.ts +0 -6
- package/menu/OscdMenu.stories.js +0 -55
- package/menu/OscdMenu.stories.js.map +0 -1
- package/menu/OscdMenuItem.stories.d.ts +0 -5
- package/menu/OscdMenuItem.stories.js +0 -37
- package/menu/OscdMenuItem.stories.js.map +0 -1
- package/navigation-drawer/OscdNavigationDrawer.stories.d.ts +0 -5
- package/navigation-drawer/OscdNavigationDrawer.stories.js +0 -97
- package/navigation-drawer/OscdNavigationDrawer.stories.js.map +0 -1
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.d.ts +0 -5
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.js +0 -35
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.js.map +0 -1
- package/select/OscdFilledSelect.stories.d.ts +0 -5
- package/select/OscdFilledSelect.stories.js +0 -29
- package/select/OscdFilledSelect.stories.js.map +0 -1
- package/select/OscdOutlinedSelect.stories.d.ts +0 -5
- package/select/OscdOutlinedSelect.stories.js +0 -29
- package/select/OscdOutlinedSelect.stories.js.map +0 -1
- package/tabs/OscdPrimaryTab.stories.d.ts +0 -5
- package/tabs/OscdPrimaryTab.stories.js +0 -33
- package/tabs/OscdPrimaryTab.stories.js.map +0 -1
- package/tabs/OscdSecondaryTab.stories.d.ts +0 -5
- package/tabs/OscdSecondaryTab.stories.js +0 -33
- package/tabs/OscdSecondaryTab.stories.js.map +0 -1
- package/tabs/OscdTabs.stories.d.ts +0 -5
- package/tabs/OscdTabs.stories.js +0 -29
- package/tabs/OscdTabs.stories.js.map +0 -1
- package/theming/AllComponents.stories.d.ts +0 -5
- package/theming/AllComponents.stories.js +0 -309
- package/theming/AllComponents.stories.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getStorybookHelpers as wcToolkitGetStorybookHelpers } from
|
|
2
|
-
import { html } from
|
|
1
|
+
import { getStorybookHelpers as wcToolkitGetStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
/*
|
|
4
4
|
* This is a Decorator/Helper utility for enriching Storybook stories with CSS variable support.
|
|
5
5
|
* It allows you to define CSS variables in JSDocs, which are then included in the custom-element-manifest.json
|
|
@@ -11,9 +11,9 @@ import { html } from "lit";
|
|
|
11
11
|
export const storybookHelperDecorator = (storyFn, context) => {
|
|
12
12
|
const args = context.args || {};
|
|
13
13
|
const variableDeclarations = Object.entries(args)
|
|
14
|
-
.filter(([key]) => key.startsWith(
|
|
15
|
-
.map(([key, value]) => `${key.replace(/-state$/,
|
|
16
|
-
.join(
|
|
14
|
+
.filter(([key]) => key.startsWith('--'))
|
|
15
|
+
.map(([key, value]) => `${key.replace(/-state$/, '')}: ${value};`)
|
|
16
|
+
.join('\n');
|
|
17
17
|
const styles = `* {\n${variableDeclarations}\n}`;
|
|
18
18
|
return html `
|
|
19
19
|
<style>
|
|
@@ -28,15 +28,15 @@ export const storybookHelperDecorator = (storyFn, context) => {
|
|
|
28
28
|
* It modifies the argTypes to include controls for CSS variables, allowing users to change them in the Storybook UI.
|
|
29
29
|
*/
|
|
30
30
|
export const getStorybookHelpers = (tagName, options) => {
|
|
31
|
-
const {
|
|
31
|
+
const { argTypes, ...rest } = wcToolkitGetStorybookHelpers(tagName, options);
|
|
32
32
|
const updatedArgTypes = Object.entries(argTypes).reduce((acc, [argTypeKey, argTypeValue]) => {
|
|
33
|
-
if (argTypeKey.startsWith(
|
|
33
|
+
if (argTypeKey.startsWith('--')) {
|
|
34
34
|
acc[argTypeKey] = {
|
|
35
35
|
...argTypeValue,
|
|
36
|
-
control: { type: argTypeKey.includes(
|
|
36
|
+
control: { type: argTypeKey.includes('color') ? 'color' : 'text' },
|
|
37
37
|
table: {
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
category:
|
|
39
|
+
category: 'CSS Variables',
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStorybookHelpers.js","sourceRoot":"","sources":["getStorybookHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAGpG,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CACzD,OAAO,EACP,OAAO,EACP,EAAE;IACF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IAEhC,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SAC9C,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC;SACjE,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,MAAM,GAAG,QAAQ,oBAAoB,KAAK,CAAC;IACjD,OAAO,IAAI,CAAA;;QAEL,MAAM;;MAER,OAAO,EAAE;GACZ,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAAe,EACf,OAAsB,EACL,EAAE;IACnB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"getStorybookHelpers.js","sourceRoot":"","sources":["getStorybookHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAGpG,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;;;GAIG;AAEH;;GA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AAQ,EAAE,eAAe;iBAC1B;aACF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;QACjC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAA8D,CAC/D,CAAC;IACF,OAAO;QACL,GAAG,IAAI;QACP,QAAQ,EAAE,eAAe;KACP,CAAC;AACvB,CAAC,CAAC","sourcesContent":["import { getStorybookHelpers as wcToolkitGetStorybookHelpers } from '@wc-toolkit/storybook-helpers';\nimport type { StoryOptions, StoryHelpers } from '@wc-toolkit/storybook-helpers';\n\nimport { html } from 'lit';\nimport { DecoratorFunction } from 'storybook/internal/types';\n\n/*\n * This is a Decorator/Helper utility for enriching Storybook stories with CSS variable support.\n * It allows you to define CSS variables in JSDocs, which are then included in the custom-element-manifest.json\n * which is then used to extract the CSS variables and make them available in Storybook.\n */\n\n/*\n * The decorator injects a style block into the story that sets these CSS variables based on the args provided in the story.\n */\nexport const storybookHelperDecorator: DecoratorFunction = (\n storyFn,\n context,\n) => {\n const args = context.args || {};\n\n const variableDeclarations = Object.entries(args)\n .filter(([key]) => key.startsWith('--'))\n .map(([key, value]) => `${key.replace(/-state$/, '')}: ${value};`)\n .join('\\n');\n const styles = `* {\\n${variableDeclarations}\\n}`;\n return html`\n <style>\n ${styles}\n </style>\n ${storyFn()}\n `;\n};\n\n/*\n * The \"getStorybookHelpers\" is a thin wrapper around the wcToolkit's getStorybookHelpers function,\n * which adds support for CSS variables in the argTypes.\n * It modifies the argTypes to include controls for CSS variables, allowing users to change them in the Storybook UI.\n */\nexport const getStorybookHelpers = <T>(\n tagName: string,\n options?: StoryOptions,\n): StoryHelpers<T> => {\n const { argTypes, ...rest } = wcToolkitGetStorybookHelpers<T>(\n tagName,\n options,\n );\n\n const updatedArgTypes = Object.entries(argTypes).reduce(\n (\n acc: Record<string, (typeof argTypes)[keyof typeof argTypes]>,\n [argTypeKey, argTypeValue],\n ) => {\n if (argTypeKey.startsWith('--')) {\n acc[argTypeKey] = {\n ...argTypeValue,\n control: { type: argTypeKey.includes('color') ? 'color' : 'text' },\n table: {\n // @ts-ignore\n category: 'CSS Variables',\n },\n };\n } else {\n acc[argTypeKey] = argTypeValue;\n }\n return acc;\n },\n {} as Record<string, (typeof argTypes)[keyof typeof argTypes]>,\n );\n return {\n ...rest,\n argTypes: updatedArgTypes,\n } as StoryHelpers<T>;\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DecoratorFunction } from
|
|
1
|
+
import { DecoratorFunction } from 'storybook/internal/types';
|
|
2
2
|
export declare const scopedWcDecorator: DecoratorFunction;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ScopedElementsMixin } from
|
|
3
|
-
import { property } from
|
|
4
|
-
import { LitElement, html } from
|
|
5
|
-
import { html as staticHtml, unsafeStatic } from
|
|
2
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements/lit-element.js';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { LitElement, html } from 'lit';
|
|
5
|
+
import { html as staticHtml, unsafeStatic } from 'lit/static-html.js';
|
|
6
|
+
const documentQuerySelectorFn = document.querySelector;
|
|
6
7
|
export const scopedWcDecorator = (storyFn, context) => {
|
|
7
|
-
const scopedElements = context.parameters
|
|
8
|
-
const storyArgs = context
|
|
8
|
+
const { scopedElements } = context.parameters;
|
|
9
|
+
const storyArgs = context.args || {};
|
|
9
10
|
// Generate a unique tag name to avoid redefinition errors
|
|
10
11
|
const tagName = `dynamic-wrapper-${context.id}`;
|
|
12
|
+
// workaround to allow wc-toolkit/storybook-helpers (template) find the component
|
|
13
|
+
// it believes to be directly accessible from the document (which we're wrapping).
|
|
14
|
+
document.querySelector = (selector) => {
|
|
15
|
+
if (selector === context.component) {
|
|
16
|
+
const wrapper = documentQuerySelectorFn.call(document, tagName);
|
|
17
|
+
return wrapper ? wrapper.shadowRoot?.querySelector(selector) : null;
|
|
18
|
+
}
|
|
19
|
+
return documentQuerySelectorFn.call(document, selector);
|
|
20
|
+
};
|
|
11
21
|
if (!customElements.get(tagName)) {
|
|
12
22
|
class DynamicWrapper extends ScopedElementsMixin(LitElement) {
|
|
13
23
|
static get scopedElements() {
|
|
14
|
-
return scopedElements;
|
|
24
|
+
return scopedElements || {};
|
|
15
25
|
}
|
|
16
26
|
render() {
|
|
17
27
|
return html `${storyFn()}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopedWcDecorator.js","sourceRoot":"","sources":["scopedWcDecorator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;IACvE,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"scopedWcDecorator.js","sourceRoot":"","sources":["scopedWcDecorator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,MAAM,uBAAuB,GAAG,QAAQ,CAAC,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;IACvE,MAAM,EAAE,cA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decorators.js';\nimport { LitElement, html } from 'lit';\nimport { DecoratorFunction } from 'storybook/internal/types';\nimport { html as staticHtml, unsafeStatic } from 'lit/static-html.js';\n\nconst documentQuerySelectorFn = document.querySelector;\n\nexport const scopedWcDecorator: DecoratorFunction = (storyFn, context) => {\n const { scopedElements } = context.parameters;\n const storyArgs = context.args || {};\n\n // Generate a unique tag name to avoid redefinition errors\n const tagName = `dynamic-wrapper-${context.id}`;\n\n // workaround to allow wc-toolkit/storybook-helpers (template) find the component\n // it believes to be directly accessible from the document (which we're wrapping).\n document.querySelector = (selector: string) => {\n if (selector === context.component) {\n const wrapper = documentQuerySelectorFn.call(document, tagName);\n return wrapper ? wrapper.shadowRoot?.querySelector(selector) : null;\n }\n return documentQuerySelectorFn.call(document, selector);\n };\n\n if (!customElements.get(tagName)) {\n class DynamicWrapper extends ScopedElementsMixin(LitElement) {\n static get scopedElements() {\n return scopedElements || {};\n }\n\n @property({ type: Object })\n declare storyArgs: Record<string, unknown>;\n\n override render() {\n return html`${storyFn()}`;\n }\n }\n\n customElements.define(tagName, DynamicWrapper);\n }\n\n return staticHtml`<${unsafeStatic(tagName)} .storyArgs=${storyArgs}></${unsafeStatic(tagName)}>`;\n};\n"]}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import { Args, DecoratorFunction } from
|
|
2
|
-
export declare const themingArgTypes:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type: "color";
|
|
6
|
-
};
|
|
7
|
-
description: string;
|
|
8
|
-
table: {
|
|
9
|
-
category: string;
|
|
10
|
-
defaultValue: {
|
|
11
|
-
summary: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
} | undefined;
|
|
1
|
+
import { Args, ArgTypes, DecoratorFunction } from 'storybook/internal/types';
|
|
2
|
+
export declare const themingArgTypes: Partial<ArgTypes<Args>>;
|
|
3
|
+
export declare const themingArgs: {
|
|
4
|
+
[x: string]: any;
|
|
15
5
|
};
|
|
16
|
-
export declare const themingArgs: Partial<Args>;
|
|
17
6
|
export declare const themingDecorator: DecoratorFunction;
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { html } from
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
const mdSysVarsWithOurDefaults = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
3
|
+
'--md-sys-color-background': 'unset',
|
|
4
|
+
'--md-sys-color-on-background': 'unset',
|
|
5
|
+
'--md-sys-color-primary': 'var(--oscd-primary)',
|
|
6
|
+
'--md-sys-color-primary-container': 'unset',
|
|
7
|
+
'--md-sys-color-primary-fixed': 'unset',
|
|
8
|
+
'--md-sys-color-primary-fixed-dim': 'unset',
|
|
9
|
+
'--md-sys-color-scrim': '#000000',
|
|
10
|
+
'--md-sys-color-secondary': 'var(--oscd-secondary)',
|
|
11
|
+
'--md-sys-color-secondary-container': 'var(--oscd-base2)',
|
|
12
|
+
'--md-sys-color-secondary-fixed': 'unset',
|
|
13
|
+
'--md-sys-color-secondary-fixed-dim': 'unset',
|
|
14
|
+
'--md-sys-color-shadow': 'unset',
|
|
15
|
+
'--md-sys-color-surface': 'var(--oscd-base3)',
|
|
16
|
+
'--md-sys-color-surface-bright': 'var(--oscd-base2)',
|
|
17
|
+
'--md-sys-color-surface-container': 'var(--oscd-base3)',
|
|
18
|
+
'--md-sys-color-surface-container-high': 'var(--oscd-base3)',
|
|
19
|
+
'--md-sys-color-surface-container-highest': 'var(--oscd-base3)',
|
|
20
|
+
'--md-sys-color-surface-container-low': 'unset',
|
|
21
|
+
'--md-sys-color-surface-container-lowest': 'unset',
|
|
22
|
+
'--md-sys-color-surface-dim': 'unset',
|
|
23
|
+
'--md-sys-color-surface-tint': 'unset',
|
|
24
|
+
'--md-sys-color-surface-variant': 'unset',
|
|
25
|
+
'--md-sys-color-outline': 'unset',
|
|
26
|
+
'--md-sys-color-outline-variant': 'var(--oscd-base0)',
|
|
27
|
+
'--md-sys-color-on-error': 'var(--oscd-base3)',
|
|
28
|
+
'--md-sys-color-on-error-container': 'unset',
|
|
29
|
+
'--md-sys-color-on-primary': 'var(--oscd-base3)',
|
|
30
|
+
'--md-sys-color-on-primary-container': 'unset',
|
|
31
|
+
'--md-sys-color-on-primary-fixed': 'unset',
|
|
32
|
+
'--md-sys-color-on-primary-fixed-variant': 'unset',
|
|
33
|
+
'--md-sys-color-on-secondary': 'var(--oscd-base3)',
|
|
34
|
+
'--md-sys-color-on-secondary-container': 'unset',
|
|
35
|
+
'--md-sys-color-on-secondary-fixed': 'unset',
|
|
36
|
+
'--md-sys-color-on-secondary-fixed-variant': 'unset',
|
|
37
|
+
'--md-sys-color-on-surface': 'var(--oscd-base00)',
|
|
38
|
+
'--md-sys-color-on-surface-variant': 'var(--oscd-base3)',
|
|
39
|
+
'--md-sys-color-error': 'var(--oscd-error)',
|
|
40
|
+
'--md-sys-color-error-container': 'unset',
|
|
41
|
+
'--md-sys-color-on-tertiary': 'unset',
|
|
42
|
+
'--md-sys-color-on-tertiary-container': 'unset',
|
|
43
|
+
'--md-sys-color-on-tertiary-fixed': 'unset',
|
|
44
|
+
'--md-sys-color-on-tertiary-fixed-variant': 'unset',
|
|
45
|
+
'--md-sys-color-inverse-on-surface': 'unset',
|
|
46
|
+
'--md-sys-color-inverse-primary': 'unset',
|
|
47
|
+
'--md-sys-color-inverse-surface': 'unset',
|
|
48
|
+
'--md-sys-color-tertiary': 'unset',
|
|
49
|
+
'--md-sys-color-tertiary-container': 'unset',
|
|
50
|
+
'--md-sys-color-tertiary-fixed': 'unset',
|
|
51
|
+
'--md-sys-color-tertiary-fixed-dim': 'unset',
|
|
52
52
|
};
|
|
53
53
|
export const themingArgTypes = Object.entries(mdSysVarsWithOurDefaults).reduce((acc, entry) => {
|
|
54
54
|
const [key, value] = entry;
|
|
55
55
|
return {
|
|
56
56
|
...acc,
|
|
57
57
|
[key]: {
|
|
58
|
-
control: { type:
|
|
59
|
-
description:
|
|
58
|
+
control: { type: 'color' },
|
|
59
|
+
description: 'App Bar Text Color',
|
|
60
60
|
table: {
|
|
61
|
-
category:
|
|
61
|
+
category: 'CSS Variables',
|
|
62
62
|
defaultValue: {
|
|
63
63
|
summary: value,
|
|
64
64
|
},
|
|
@@ -74,22 +74,22 @@ export const themingArgs = Object.entries(mdSysVarsWithOurDefaults).reduce((acc,
|
|
|
74
74
|
};
|
|
75
75
|
}, {});
|
|
76
76
|
export const themingDecorator = (storyFn, { args }) => {
|
|
77
|
-
const style = document.documentElement
|
|
77
|
+
const { style } = document.documentElement;
|
|
78
78
|
const applyVarFromArgs = (cssKey, argKey) => {
|
|
79
79
|
const cssValue = args[argKey];
|
|
80
80
|
if (cssValue) {
|
|
81
81
|
style.setProperty(cssKey, cssValue);
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
applyVarFromArgs(
|
|
85
|
-
applyVarFromArgs(
|
|
86
|
-
applyVarFromArgs(
|
|
87
|
-
applyVarFromArgs(
|
|
84
|
+
applyVarFromArgs('color', '--md-sys-color-on-background');
|
|
85
|
+
applyVarFromArgs('color-background', '--md-sys-color-background');
|
|
86
|
+
applyVarFromArgs('border-color', '--md-sys-color-outline');
|
|
87
|
+
applyVarFromArgs('box-shadow', '--md-sys-color-shadow');
|
|
88
88
|
const styleVariables = Object.entries(args)
|
|
89
|
-
.filter(([key, value]) => key.startsWith(
|
|
90
|
-
.map(([key, value]) => key
|
|
91
|
-
.join(
|
|
92
|
-
const cssVariableStyleBlock =
|
|
89
|
+
.filter(([key, value]) => key.startsWith('--') && value && value !== 'unset')
|
|
90
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
91
|
+
.join('\n');
|
|
92
|
+
const cssVariableStyleBlock = `:root {\n${styleVariables}\n};`;
|
|
93
93
|
return html `
|
|
94
94
|
<style>
|
|
95
95
|
${cssVariableStyleBlock}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themingDecorator.js","sourceRoot":"","sources":["themingDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,MAAM,wBAAwB,GAAG;IAC/B,2BAA2B,EAAE,OAAO;IACpC,8BAA8B,EAAE,OAAO;IAEvC,wBAAwB,EAAE,qBAAqB;IAC/C,kCAAkC,EAAE,OAAO;IAC3C,8BAA8B,EAAE,OAAO;IACvC,kCAAkC,EAAE,OAAO;IAC3C,sBAAsB,EAAE,SAAS;IACjC,0BAA0B,EAAE,uBAAuB;IACnD,oCAAoC,EAAE,mBAAmB;IACzD,gCAAgC,EAAE,OAAO;IACzC,oCAAoC,EAAE,OAAO;IAC7C,uBAAuB,EAAE,OAAO;IAChC,wBAAwB,EAAE,mBAAmB;IAC7C,+BAA+B,EAAE,mBAAmB;IACpD,kCAAkC,EAAE,mBAAmB;IACvD,uCAAuC,EAAE,mBAAmB;IAC5D,0CAA0C,EAAE,mBAAmB;IAC/D,sCAAsC,EAAE,OAAO;IAC/C,yCAAyC,EAAE,OAAO;IAClD,4BAA4B,EAAE,OAAO;IACrC,6BAA6B,EAAE,OAAO;IACtC,gCAAgC,EAAE,OAAO;IAEzC,wBAAwB,EAAE,OA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AAE,EAAE;IACvE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;IAC3C,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,EAAE;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC;IACF,gBAAgB,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;IAC1D,gBAAgB,CAAC,kBAAkB,EAAE,2BAA2B,CAAC,CAAC;IAClE,gBAAgB,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAC3D,gBAAgB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IAExD,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SACxC,MAAM,CACL,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO,CACrE;SACA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;SAC1C,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,qBAAqB,GAAG,YAAY,cAAc,MAAM,CAAC;IAE/D,OAAO,IAAI,CAAA;;QAEL,qBAAqB;;MAEvB,OAAO,EAAE;GACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { Args, ArgTypes, DecoratorFunction } from 'storybook/internal/types';\n\nconst mdSysVarsWithOurDefaults = {\n '--md-sys-color-background': 'unset',\n '--md-sys-color-on-background': 'unset',\n\n '--md-sys-color-primary': 'var(--oscd-primary)',\n '--md-sys-color-primary-container': 'unset',\n '--md-sys-color-primary-fixed': 'unset',\n '--md-sys-color-primary-fixed-dim': 'unset',\n '--md-sys-color-scrim': '#000000',\n '--md-sys-color-secondary': 'var(--oscd-secondary)',\n '--md-sys-color-secondary-container': 'var(--oscd-base2)',\n '--md-sys-color-secondary-fixed': 'unset',\n '--md-sys-color-secondary-fixed-dim': 'unset',\n '--md-sys-color-shadow': 'unset',\n '--md-sys-color-surface': 'var(--oscd-base3)',\n '--md-sys-color-surface-bright': 'var(--oscd-base2)',\n '--md-sys-color-surface-container': 'var(--oscd-base3)',\n '--md-sys-color-surface-container-high': 'var(--oscd-base3)',\n '--md-sys-color-surface-container-highest': 'var(--oscd-base3)',\n '--md-sys-color-surface-container-low': 'unset',\n '--md-sys-color-surface-container-lowest': 'unset',\n '--md-sys-color-surface-dim': 'unset',\n '--md-sys-color-surface-tint': 'unset',\n '--md-sys-color-surface-variant': 'unset',\n\n '--md-sys-color-outline': 'unset',\n '--md-sys-color-outline-variant': 'var(--oscd-base0)',\n\n '--md-sys-color-on-error': 'var(--oscd-base3)',\n '--md-sys-color-on-error-container': 'unset',\n '--md-sys-color-on-primary': 'var(--oscd-base3)',\n '--md-sys-color-on-primary-container': 'unset',\n '--md-sys-color-on-primary-fixed': 'unset',\n '--md-sys-color-on-primary-fixed-variant': 'unset',\n '--md-sys-color-on-secondary': 'var(--oscd-base3)',\n '--md-sys-color-on-secondary-container': 'unset',\n '--md-sys-color-on-secondary-fixed': 'unset',\n '--md-sys-color-on-secondary-fixed-variant': 'unset',\n '--md-sys-color-on-surface': 'var(--oscd-base00)',\n '--md-sys-color-on-surface-variant': 'var(--oscd-base3)',\n\n '--md-sys-color-error': 'var(--oscd-error)',\n '--md-sys-color-error-container': 'unset',\n\n '--md-sys-color-on-tertiary': 'unset',\n '--md-sys-color-on-tertiary-container': 'unset',\n '--md-sys-color-on-tertiary-fixed': 'unset',\n '--md-sys-color-on-tertiary-fixed-variant': 'unset',\n\n '--md-sys-color-inverse-on-surface': 'unset',\n '--md-sys-color-inverse-primary': 'unset',\n '--md-sys-color-inverse-surface': 'unset',\n\n '--md-sys-color-tertiary': 'unset',\n '--md-sys-color-tertiary-container': 'unset',\n '--md-sys-color-tertiary-fixed': 'unset',\n '--md-sys-color-tertiary-fixed-dim': 'unset',\n};\n\nexport const themingArgTypes = Object.entries(mdSysVarsWithOurDefaults).reduce(\n (acc: Partial<ArgTypes>, entry) => {\n const [key, value] = entry;\n return {\n ...acc,\n [key]: {\n control: { type: 'color' as const },\n description: 'App Bar Text Color',\n table: {\n category: 'CSS Variables',\n defaultValue: {\n summary: value,\n },\n },\n },\n };\n },\n {} as Partial<ArgTypes>,\n);\n\nexport const themingArgs = Object.entries(mdSysVarsWithOurDefaults).reduce(\n (acc: Partial<Args>, entry) => {\n const [key, value] = entry;\n return {\n ...acc,\n [key]: value,\n };\n },\n {} as Partial<Args>,\n);\n\nexport const themingDecorator: DecoratorFunction = (storyFn, { args }) => {\n const { style } = document.documentElement;\n const applyVarFromArgs = (cssKey: string, argKey: string) => {\n const cssValue = args[argKey];\n if (cssValue) {\n style.setProperty(cssKey, cssValue);\n }\n };\n applyVarFromArgs('color', '--md-sys-color-on-background');\n applyVarFromArgs('color-background', '--md-sys-color-background');\n applyVarFromArgs('border-color', '--md-sys-color-outline');\n applyVarFromArgs('box-shadow', '--md-sys-color-shadow');\n\n const styleVariables = Object.entries(args)\n .filter(\n ([key, value]) => key.startsWith('--') && value && value !== 'unset',\n )\n .map(([key, value]) => `${key}: ${value};`)\n .join('\\n');\n const cssVariableStyleBlock = `:root {\\n${styleVariables}\\n};`;\n\n return html`\n <style>\n ${cssVariableStyleBlock}\n </style>\n ${storyFn()}\n `;\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TemplateResult } from "lit";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/web-components";
|
|
3
|
-
import { OscdAppBar } from "./OscdAppBar.js";
|
|
4
|
-
declare const meta: Meta<OscdAppBar & {
|
|
5
|
-
subHeader: () => TemplateResult;
|
|
6
|
-
}>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj;
|
|
9
|
-
export declare const Default: Story;
|
|
10
|
-
export declare const WithSubHeader: Story;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
import { OscdAppBar } from "./OscdAppBar.js";
|
|
3
|
-
import { OscdList } from "list/OscdList";
|
|
4
|
-
import { OscdListItem } from "list/OscdListItem";
|
|
5
|
-
import { OscdIcon } from "icon/OscdIcon";
|
|
6
|
-
import { OscdTabs } from "tabs/OscdTabs";
|
|
7
|
-
import { OscdSecondaryTab } from "tabs/OscdSecondaryTab";
|
|
8
|
-
import { OscdDivider } from "../divider/OscdDivider.js";
|
|
9
|
-
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
10
|
-
import { OscdFilledIconButton } from "iconbutton/OscdFilledIconButton.js";
|
|
11
|
-
import { getStorybookHelpers, storybookHelperDecorator, } from "utils/storybook/getStorybookHelpers.js";
|
|
12
|
-
const { args, argTypes } = getStorybookHelpers("oscd-app-bar");
|
|
13
|
-
const meta = {
|
|
14
|
-
title: "Open SCD/App Bar",
|
|
15
|
-
component: "oscd-app-bar",
|
|
16
|
-
tags: ["autodocs"],
|
|
17
|
-
decorators: [scopedWcDecorator, storybookHelperDecorator],
|
|
18
|
-
args,
|
|
19
|
-
parameters: {
|
|
20
|
-
layout: "fullscreen",
|
|
21
|
-
scopedElements: {
|
|
22
|
-
"oscd-app-bar": OscdAppBar,
|
|
23
|
-
"oscd-divider": OscdDivider,
|
|
24
|
-
"oscd-filled-icon-button": OscdFilledIconButton,
|
|
25
|
-
"oscd-icon": OscdIcon,
|
|
26
|
-
"oscd-list": OscdList,
|
|
27
|
-
"oscd-list-item": OscdListItem,
|
|
28
|
-
"oscd-tabs": OscdTabs,
|
|
29
|
-
"oscd-secondary-tab": OscdSecondaryTab,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
render: ({ title, subHeader, ...rest }) => {
|
|
33
|
-
console.log("args", rest);
|
|
34
|
-
return html `
|
|
35
|
-
<oscd-app-bar>
|
|
36
|
-
<oscd-filled-icon-button
|
|
37
|
-
slot="actionStart"
|
|
38
|
-
aria-label="Menu"
|
|
39
|
-
@click=${() => console.log("actionStart clicked")}
|
|
40
|
-
>
|
|
41
|
-
<oscd-icon>menu</oscd-icon></oscd-filled-icon-button
|
|
42
|
-
>
|
|
43
|
-
<div slot="title">${title}</div>
|
|
44
|
-
<oscd-filled-icon-button
|
|
45
|
-
slot="actionEnd"
|
|
46
|
-
aria-label="Menu"
|
|
47
|
-
@click=${() => console.log("actionStart clicked")}
|
|
48
|
-
>
|
|
49
|
-
<oscd-icon>more_vert</oscd-icon></oscd-filled-icon-button
|
|
50
|
-
>
|
|
51
|
-
${subHeader && subHeader()}
|
|
52
|
-
</oscd-app-bar>
|
|
53
|
-
`;
|
|
54
|
-
},
|
|
55
|
-
argTypes: {
|
|
56
|
-
title: {
|
|
57
|
-
control: { type: "text" },
|
|
58
|
-
description: "App Bar Title",
|
|
59
|
-
table: {
|
|
60
|
-
category: "Web Component Properties",
|
|
61
|
-
defaultValue: { summary: "" },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
...argTypes,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
export default meta;
|
|
68
|
-
export const Default = {
|
|
69
|
-
args: {
|
|
70
|
-
title: "My App Bar",
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
export const WithSubHeader = {
|
|
74
|
-
args: {
|
|
75
|
-
title: "My App Bar (with subheader)",
|
|
76
|
-
subHeader: () => html `
|
|
77
|
-
<oscd-tabs>
|
|
78
|
-
<oscd-secondary-tab>Video</oscd-secondary-tab>
|
|
79
|
-
<oscd-secondary-tab>Photos</oscd-secondary-tab>
|
|
80
|
-
<oscd-secondary-tab>Audio</oscd-secondary-tab>
|
|
81
|
-
</oscd-tabs>
|
|
82
|
-
`,
|
|
83
|
-
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,WAAW,EAAE,QAAQ;YACrB,oBAAoB,EAAE,gBAAgB;SACvC;KACF;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;QACxC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAA;;;;;mBAKI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;;;;4BAI/B,KAAK;;;;mBAId,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;;;;UAIjD,SAAS,IAAI,SAAS,EAAE;;KAE7B,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,eAAe;YAC5B,KAAK,EAAE;gBACL,QAAQ,EAAE,0BAA0B;gBACpC,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAC9B;SACF;QACD,GAAG,QAAQ;KACZ;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,YAAY;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE;QACJ,KAAK,EAAE,6BAA6B;QACpC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;;KAMpB;KACF;CACF,CAAC","sourcesContent":["import { html, TemplateResult } from \"lit\";\nimport type { Meta, StoryObj } from \"@storybook/web-components\";\n\nimport { OscdAppBar } from \"./OscdAppBar.js\";\nimport { OscdList } from \"list/OscdList\";\nimport { OscdListItem } from \"list/OscdListItem\";\nimport { OscdIcon } from \"icon/OscdIcon\";\nimport { OscdTabs } from \"tabs/OscdTabs\";\nimport { OscdSecondaryTab } from \"tabs/OscdSecondaryTab\";\nimport { OscdDivider } from \"../divider/OscdDivider.js\";\nimport { scopedWcDecorator } from \"utils/storybook/scopedWcDecorator.js\";\nimport { OscdFilledIconButton } from \"iconbutton/OscdFilledIconButton.js\";\nimport {\n getStorybookHelpers,\n storybookHelperDecorator,\n} from \"utils/storybook/getStorybookHelpers.js\";\n\nconst { args, argTypes } = getStorybookHelpers(\"oscd-app-bar\");\n\nconst meta: Meta<OscdAppBar & { subHeader: () => TemplateResult }> = {\n title: \"Open SCD/App Bar\",\n component: \"oscd-app-bar\",\n tags: [\"autodocs\"],\n decorators: [scopedWcDecorator, storybookHelperDecorator],\n\n args,\n parameters: {\n layout: \"fullscreen\",\n scopedElements: {\n \"oscd-app-bar\": OscdAppBar,\n \"oscd-divider\": OscdDivider,\n \"oscd-filled-icon-button\": OscdFilledIconButton,\n \"oscd-icon\": OscdIcon,\n \"oscd-list\": OscdList,\n \"oscd-list-item\": OscdListItem,\n \"oscd-tabs\": OscdTabs,\n \"oscd-secondary-tab\": OscdSecondaryTab,\n },\n },\n render: ({ title, subHeader, ...rest }) => {\n console.log(\"args\", rest);\n return html`\n <oscd-app-bar>\n <oscd-filled-icon-button\n slot=\"actionStart\"\n aria-label=\"Menu\"\n @click=${() => console.log(\"actionStart clicked\")}\n >\n <oscd-icon>menu</oscd-icon></oscd-filled-icon-button\n >\n <div slot=\"title\">${title}</div>\n <oscd-filled-icon-button\n slot=\"actionEnd\"\n aria-label=\"Menu\"\n @click=${() => console.log(\"actionStart clicked\")}\n >\n <oscd-icon>more_vert</oscd-icon></oscd-filled-icon-button\n >\n ${subHeader && subHeader()}\n </oscd-app-bar>\n `;\n },\n argTypes: {\n title: {\n control: { type: \"text\" },\n description: \"App Bar Title\",\n table: {\n category: \"Web Component Properties\",\n defaultValue: { summary: \"\" },\n },\n },\n ...argTypes,\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {\n title: \"My App Bar\",\n },\n};\n\nexport const WithSubHeader: Story = {\n args: {\n title: \"My App Bar (with subheader)\",\n subHeader: () => html`\n <oscd-tabs>\n <oscd-secondary-tab>Video</oscd-secondary-tab>\n <oscd-secondary-tab>Photos</oscd-secondary-tab>\n <oscd-secondary-tab>Audio</oscd-secondary-tab>\n </oscd-tabs>\n `,\n },\n};\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/web-components";
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
type Story = StoryObj;
|
|
5
|
-
export declare const FilledButton: Story;
|
|
6
|
-
export declare const OutlinedButton: Story;
|
|
7
|
-
export declare const TextButton: Story;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
import { OscdTextButton } from "button/OscdTextButton";
|
|
3
|
-
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
4
|
-
import { OscdFilledButton } from "./OscdFilledButton";
|
|
5
|
-
import { OscdOutlinedButton } from "./OscdOutlinedButton";
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Open SCD/Buttons",
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
decorators: [scopedWcDecorator],
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: "centered",
|
|
12
|
-
scopedElements: {
|
|
13
|
-
"oscd-filled-button": OscdFilledButton,
|
|
14
|
-
"oscd-outlined-button": OscdOutlinedButton,
|
|
15
|
-
"oscd-text-button": OscdTextButton,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
argTypes: {
|
|
19
|
-
label: {
|
|
20
|
-
control: { type: "text" },
|
|
21
|
-
description: "Button label",
|
|
22
|
-
table: {
|
|
23
|
-
category: "Web Component Properties",
|
|
24
|
-
defaultValue: { summary: "Click Me" },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
export default meta;
|
|
30
|
-
export const FilledButton = {
|
|
31
|
-
args: {
|
|
32
|
-
label: "Filled Button",
|
|
33
|
-
},
|
|
34
|
-
render: ({ label }) => html `
|
|
35
|
-
<oscd-filled-button @click=${() => console.log("Clicked!")}>
|
|
36
|
-
${label}
|
|
37
|
-
</oscd-filled-button>
|
|
38
|
-
`,
|
|
39
|
-
};
|
|
40
|
-
export const OutlinedButton = {
|
|
41
|
-
args: {
|
|
42
|
-
label: "Outlined Button",
|
|
43
|
-
},
|
|
44
|
-
render: ({ label }) => html `
|
|
45
|
-
<oscd-outlined-button @click=${() => console.log("Clicked!")}>
|
|
46
|
-
${label}
|
|
47
|
-
</oscd-outlined-button>
|
|
48
|
-
`,
|
|
49
|
-
};
|
|
50
|
-
export const TextButton = {
|
|
51
|
-
args: {
|
|
52
|
-
label: "Text Button",
|
|
53
|
-
},
|
|
54
|
-
render: ({ label }) => html `
|
|
55
|
-
<oscd-text-button @click=${() => console.log("Clicked!")}>
|
|
56
|
-
${label}
|
|
57
|
-
</oscd-text-button>
|
|
58
|
-
`,
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=OscdButton.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OscdButton.stories.js","sourceRoot":"","sources":["OscdButton.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE;YACd,oBAAoB,EAAE,gBAAgB;YACtC,sBAAsB,EAAE,kBAAkB;YAC1C,kBAAkB,EAAE,cAAc;SACnC;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,cAAc;YAC3B,KAAK,EAAE;gBACL,QAAQ,EAAE,0BAA0B;gBACpC,YAAY,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;aACtC;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,KAAK,EAAE,eAAe;KACvB;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;iCACI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QACtD,KAAK;;GAEV;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,KAAK,EAAE,iBAAiB;KACzB;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;mCACM,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QACxD,KAAK;;GAEV;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;KACrB;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;+BACE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QACpD,KAAK;;GAEV;CACF,CAAC","sourcesContent":["import { html } from \"lit\";\nimport type { Meta, StoryObj } from \"@storybook/web-components\";\n\nimport { OscdTextButton } from \"button/OscdTextButton\";\nimport { scopedWcDecorator } from \"utils/storybook/scopedWcDecorator.js\";\nimport { OscdFilledButton } from \"./OscdFilledButton\";\nimport { OscdOutlinedButton } from \"./OscdOutlinedButton\";\n\nconst meta: Meta = {\n title: \"Open SCD/Buttons\",\n tags: [\"autodocs\"],\n decorators: [scopedWcDecorator],\n parameters: {\n layout: \"centered\",\n scopedElements: {\n \"oscd-filled-button\": OscdFilledButton,\n \"oscd-outlined-button\": OscdOutlinedButton,\n \"oscd-text-button\": OscdTextButton,\n },\n },\n argTypes: {\n label: {\n control: { type: \"text\" },\n description: \"Button label\",\n table: {\n category: \"Web Component Properties\",\n defaultValue: { summary: \"Click Me\" },\n },\n },\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const FilledButton: Story = {\n args: {\n label: \"Filled Button\",\n },\n render: ({ label }) => html`\n <oscd-filled-button @click=${() => console.log(\"Clicked!\")}>\n ${label}\n </oscd-filled-button>\n `,\n};\n\nexport const OutlinedButton: Story = {\n args: {\n label: \"Outlined Button\",\n },\n render: ({ label }) => html`\n <oscd-outlined-button @click=${() => console.log(\"Clicked!\")}>\n ${label}\n </oscd-outlined-button>\n `,\n};\n\nexport const TextButton: Story = {\n args: {\n label: \"Text Button\",\n },\n render: ({ label }) => html`\n <oscd-text-button @click=${() => console.log(\"Clicked!\")}>\n ${label}\n </oscd-text-button>\n `,\n};\n"]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
import { OscdDialog } from "dialog/OscdDialog";
|
|
3
|
-
import { OscdFilledButton } from "button/OscdFilledButton";
|
|
4
|
-
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Open SCD/Dialog",
|
|
7
|
-
component: "oscd-dialog",
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
decorators: [scopedWcDecorator],
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: "centered",
|
|
12
|
-
scopedElements: {
|
|
13
|
-
"oscd-dialog": OscdDialog,
|
|
14
|
-
"oscd-filled-button": OscdFilledButton,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
render: ({ open }) => html `
|
|
18
|
-
<oscd-dialog ?open=${open}>
|
|
19
|
-
<div slot="headline">Confirm Action</div>
|
|
20
|
-
<div slot="content">
|
|
21
|
-
Are you sure you want to proceed with this operation? This action cannot
|
|
22
|
-
be undone.
|
|
23
|
-
</div>
|
|
24
|
-
<div slot="actions">
|
|
25
|
-
<oscd-filled-button @click=${() => console.log("Cancelled")}
|
|
26
|
-
>Cancel</oscd-filled-button
|
|
27
|
-
>
|
|
28
|
-
<oscd-filled-button @click=${() => console.log("Confirmed")}
|
|
29
|
-
>Confirm</oscd-filled-button
|
|
30
|
-
>
|
|
31
|
-
</div>
|
|
32
|
-
</oscd-dialog>
|
|
33
|
-
`,
|
|
34
|
-
argTypes: {
|
|
35
|
-
open: {
|
|
36
|
-
control: { type: "boolean" },
|
|
37
|
-
description: "Defines whether the dialog is open or closed.",
|
|
38
|
-
table: {
|
|
39
|
-
defaultValue: { summary: "true" },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
export default meta;
|
|
45
|
-
export const Default = {
|
|
46
|
-
args: {
|
|
47
|
-
open: true,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=OscdDialog.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OscdDialog.stories.js","sourceRoot":"","sources":["OscdDialog.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE;YACd,aAAa,EAAE,UAAU;YACzB,oBAAoB,EAAE,gBAAgB;SACvC;KACF;IACD,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;yBACH,IAAI;;;;;;;qCAOQ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;;;qCAG9B,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;;;;;GAKhE;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5B,WAAW,EAAE,+CAA+C;YAC5D,KAAK,EAAE;gBACL,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aAClC;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,IAAI;KACX;CACF,CAAC","sourcesContent":["import { html } from \"lit\";\nimport type { Meta, StoryObj } from \"@storybook/web-components\";\n\nimport { OscdDialog } from \"dialog/OscdDialog\";\nimport { OscdFilledButton } from \"button/OscdFilledButton\";\nimport { scopedWcDecorator } from \"utils/storybook/scopedWcDecorator.js\";\n\nconst meta: Meta = {\n title: \"Open SCD/Dialog\",\n component: \"oscd-dialog\",\n tags: [\"autodocs\"],\n decorators: [scopedWcDecorator],\n parameters: {\n layout: \"centered\",\n scopedElements: {\n \"oscd-dialog\": OscdDialog,\n \"oscd-filled-button\": OscdFilledButton,\n },\n },\n render: ({ open }) => html`\n <oscd-dialog ?open=${open}>\n <div slot=\"headline\">Confirm Action</div>\n <div slot=\"content\">\n Are you sure you want to proceed with this operation? This action cannot\n be undone.\n </div>\n <div slot=\"actions\">\n <oscd-filled-button @click=${() => console.log(\"Cancelled\")}\n >Cancel</oscd-filled-button\n >\n <oscd-filled-button @click=${() => console.log(\"Confirmed\")}\n >Confirm</oscd-filled-button\n >\n </div>\n </oscd-dialog>\n `,\n argTypes: {\n open: {\n control: { type: \"boolean\" },\n description: \"Defines whether the dialog is open or closed.\",\n table: {\n defaultValue: { summary: \"true\" },\n },\n },\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {\n open: true,\n },\n};\n"]}
|