@omicronenergy/oscd-ui 0.0.2 → 0.0.3
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/app-bar/OscdAppBar.d.ts +45 -0
- package/app-bar/OscdAppBar.js +142 -0
- package/app-bar/OscdAppBar.js.map +1 -0
- package/app-bar/OscdAppBar.stories.d.ts +10 -0
- package/app-bar/OscdAppBar.stories.js +85 -0
- package/app-bar/OscdAppBar.stories.js.map +1 -0
- package/app-bar/oscd-app-bar.d.ts +12 -0
- package/app-bar/oscd-app-bar.js +14 -0
- package/app-bar/oscd-app-bar.js.map +1 -0
- package/button/OscdButton.stories.d.ts +7 -0
- package/button/OscdButton.stories.js +60 -0
- package/button/OscdButton.stories.js.map +1 -0
- package/button/OscdFilledButton.d.ts +40 -0
- package/button/OscdFilledButton.js +42 -0
- package/button/OscdFilledButton.js.map +1 -0
- package/button/OscdFilledButton.spec.d.ts +6 -0
- package/button/OscdFilledButton.spec.js +75 -0
- package/button/OscdFilledButton.spec.js.map +1 -0
- package/button/OscdOutlinedButton.d.ts +42 -0
- package/button/OscdOutlinedButton.js +34 -0
- package/button/OscdOutlinedButton.js.map +1 -0
- package/button/OscdTextButton.d.ts +40 -0
- package/button/OscdTextButton.js +32 -0
- package/button/OscdTextButton.js.map +1 -0
- package/button/oscd-filled-button.d.ts +2 -0
- package/button/oscd-filled-button.js +4 -0
- package/button/oscd-filled-button.js.map +1 -0
- package/button/oscd-outlined-button.d.ts +7 -0
- package/button/oscd-outlined-button.js +9 -0
- package/button/oscd-outlined-button.js.map +1 -0
- package/button/oscd-text-button.d.ts +7 -0
- package/button/oscd-text-button.js +9 -0
- package/button/oscd-text-button.js.map +1 -0
- package/dialog/OscdDialog.d.ts +47 -0
- package/dialog/OscdDialog.js +38 -0
- package/dialog/OscdDialog.js.map +1 -0
- package/dialog/OscdDialog.stories.d.ts +5 -0
- package/dialog/OscdDialog.stories.js +50 -0
- package/dialog/OscdDialog.stories.js.map +1 -0
- package/dialog/oscd-dialog.d.ts +2 -0
- package/dialog/oscd-dialog.js +4 -0
- package/dialog/oscd-dialog.js.map +1 -0
- package/divider/OscdDivider.d.ts +30 -0
- package/divider/OscdDivider.js +21 -0
- package/divider/OscdDivider.js.map +1 -0
- package/divider/OscdDivider.stories.d.ts +5 -0
- package/divider/OscdDivider.stories.js +28 -0
- package/divider/OscdDivider.stories.js.map +1 -0
- package/divider/oscd-divider.d.ts +2 -0
- package/divider/oscd-divider.js +4 -0
- package/divider/oscd-divider.js.map +1 -0
- package/elevation/OscdElevation.d.ts +28 -0
- package/elevation/OscdElevation.js +19 -0
- package/elevation/OscdElevation.js.map +1 -0
- package/elevation/oscd-elevation.d.ts +7 -0
- package/elevation/oscd-elevation.js +9 -0
- package/elevation/oscd-elevation.js.map +1 -0
- package/field/OscdFilledField.d.ts +24 -0
- package/field/OscdFilledField.js +16 -0
- package/field/OscdFilledField.js.map +1 -0
- package/field/OscdOutlinedField.d.ts +24 -0
- package/field/OscdOutlinedField.js +16 -0
- package/field/OscdOutlinedField.js.map +1 -0
- package/field/oscd-filled-field.d.ts +2 -0
- package/field/oscd-filled-field.js +4 -0
- package/field/oscd-filled-field.js.map +1 -0
- package/field/oscd-outlined-field.d.ts +2 -0
- package/field/oscd-outlined-field.js +4 -0
- package/field/oscd-outlined-field.js.map +1 -0
- package/icon/OscdIcon.d.ts +25 -0
- package/icon/OscdIcon.js +16 -0
- package/icon/OscdIcon.js.map +1 -0
- package/icon/OscdIcon.stories.d.ts +5 -0
- package/icon/OscdIcon.stories.js +54 -0
- package/icon/OscdIcon.stories.js.map +1 -0
- package/icon/oscd-icon.d.ts +2 -0
- package/icon/oscd-icon.js +4 -0
- package/icon/oscd-icon.js.map +1 -0
- package/iconbutton/OscdFilledIconButton.d.ts +44 -0
- package/iconbutton/OscdFilledIconButton.js +37 -0
- package/iconbutton/OscdFilledIconButton.js.map +1 -0
- package/iconbutton/OscdFilledTonalIconButton.d.ts +44 -0
- package/iconbutton/OscdFilledTonalIconButton.js +37 -0
- package/iconbutton/OscdFilledTonalIconButton.js.map +1 -0
- package/iconbutton/OscdIconButton.d.ts +43 -0
- package/iconbutton/OscdIconButton.js +36 -0
- package/iconbutton/OscdIconButton.js.map +1 -0
- package/iconbutton/OscdIconButton.stories.d.ts +7 -0
- package/iconbutton/OscdIconButton.stories.js +101 -0
- package/iconbutton/OscdIconButton.stories.js.map +1 -0
- package/iconbutton/OutlinedIconButton.d.ts +43 -0
- package/iconbutton/OutlinedIconButton.js +36 -0
- package/iconbutton/OutlinedIconButton.js.map +1 -0
- package/iconbutton/oscd-filled-icon-button.d.ts +2 -0
- package/iconbutton/oscd-filled-icon-button.js +4 -0
- package/iconbutton/oscd-filled-icon-button.js.map +1 -0
- package/iconbutton/oscd-filled-tonal-icon-button.d.ts +2 -0
- package/iconbutton/oscd-filled-tonal-icon-button.js +4 -0
- package/iconbutton/oscd-filled-tonal-icon-button.js.map +1 -0
- package/iconbutton/oscd-icon-button.d.ts +2 -0
- package/iconbutton/oscd-icon-button.js +4 -0
- package/iconbutton/oscd-icon-button.js.map +1 -0
- package/iconbutton/oscd-outlined-icon-button.d.ts +2 -0
- package/iconbutton/oscd-outlined-icon-button.js +4 -0
- package/iconbutton/oscd-outlined-icon-button.js.map +1 -0
- package/list/OscdList.d.ts +39 -0
- package/list/OscdList.js +44 -0
- package/list/OscdList.js.map +1 -0
- package/list/OscdList.stories.d.ts +5 -0
- package/list/OscdList.stories.js +30 -0
- package/list/OscdList.stories.js.map +1 -0
- package/list/OscdListItem.d.ts +59 -0
- package/list/OscdListItem.js +80 -0
- package/list/OscdListItem.js.map +1 -0
- package/list/oscd-list-item.d.ts +2 -0
- package/list/oscd-list-item.js +4 -0
- package/list/oscd-list-item.js.map +1 -0
- package/list/oscd-list.d.ts +2 -0
- package/list/oscd-list.js +4 -0
- package/list/oscd-list.js.map +1 -0
- package/menu/OscdMenu.d.ts +73 -0
- package/menu/OscdMenu.js +62 -0
- package/menu/OscdMenu.js.map +1 -0
- package/menu/OscdMenu.stories.d.ts +5 -0
- package/menu/OscdMenu.stories.js +29 -0
- package/menu/OscdMenu.stories.js.map +1 -0
- package/menu/OscdMenuItem.d.ts +37 -0
- package/menu/OscdMenuItem.js +26 -0
- package/menu/OscdMenuItem.js.map +1 -0
- package/menu/OscdMenuItem.stories.d.ts +5 -0
- package/menu/OscdMenuItem.stories.js +37 -0
- package/menu/OscdMenuItem.stories.js.map +1 -0
- package/menu/oscd-menu-item.d.ts +2 -0
- package/menu/oscd-menu-item.js +4 -0
- package/menu/oscd-menu-item.js.map +1 -0
- package/menu/oscd-menu.d.ts +1 -0
- package/menu/oscd-menu.js +4 -0
- package/menu/oscd-menu.js.map +1 -0
- package/navigation-drawer/OscdNavigationDrawer.d.ts +15 -0
- package/navigation-drawer/OscdNavigationDrawer.js +37 -0
- package/navigation-drawer/OscdNavigationDrawer.js.map +1 -0
- package/navigation-drawer/OscdNavigationDrawer.stories.d.ts +5 -0
- package/navigation-drawer/OscdNavigationDrawer.stories.js +97 -0
- package/navigation-drawer/OscdNavigationDrawer.stories.js.map +1 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.d.ts +15 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.js +61 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.js.map +1 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.d.ts +5 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.js +35 -0
- package/navigation-drawer/OscdNavigationDrawerHeader.stories.js.map +1 -0
- package/navigation-drawer/oscd-navigation-drawer-header.d.ts +2 -0
- package/navigation-drawer/oscd-navigation-drawer-header.js +4 -0
- package/navigation-drawer/oscd-navigation-drawer-header.js.map +1 -0
- package/navigation-drawer/oscd-navigation-drawer.d.ts +7 -0
- package/navigation-drawer/oscd-navigation-drawer.js +4 -0
- package/navigation-drawer/oscd-navigation-drawer.js.map +1 -0
- package/package.json +3 -2
- package/select/OscdFilledSelect.d.ts +47 -0
- package/select/OscdFilledSelect.js +39 -0
- package/select/OscdFilledSelect.js.map +1 -0
- package/select/OscdFilledSelect.stories.d.ts +5 -0
- package/select/OscdFilledSelect.stories.js +29 -0
- package/select/OscdFilledSelect.stories.js.map +1 -0
- package/select/OscdOutlinedSelect.d.ts +47 -0
- package/select/OscdOutlinedSelect.js +39 -0
- package/select/OscdOutlinedSelect.js.map +1 -0
- package/select/OscdOutlinedSelect.stories.d.ts +5 -0
- package/select/OscdOutlinedSelect.stories.js +29 -0
- package/select/OscdOutlinedSelect.stories.js.map +1 -0
- package/select/OscdSelectOption.d.ts +51 -0
- package/select/OscdSelectOption.js +41 -0
- package/select/OscdSelectOption.js.map +1 -0
- package/select/oscd-filled-select.d.ts +2 -0
- package/select/oscd-filled-select.js +4 -0
- package/select/oscd-filled-select.js.map +1 -0
- package/select/oscd-outlined-select.d.ts +2 -0
- package/select/oscd-outlined-select.js +4 -0
- package/select/oscd-outlined-select.js.map +1 -0
- package/select/oscd-select-option.d.ts +2 -0
- package/select/oscd-select-option.js +4 -0
- package/select/oscd-select-option.js.map +1 -0
- package/tabs/OscdPrimaryTab.d.ts +26 -0
- package/tabs/OscdPrimaryTab.js +18 -0
- package/tabs/OscdPrimaryTab.js.map +1 -0
- package/tabs/OscdPrimaryTab.stories.d.ts +5 -0
- package/tabs/OscdPrimaryTab.stories.js +33 -0
- package/tabs/OscdPrimaryTab.stories.js.map +1 -0
- package/tabs/OscdSecondaryTab.d.ts +26 -0
- package/tabs/OscdSecondaryTab.js +18 -0
- package/tabs/OscdSecondaryTab.js.map +1 -0
- package/tabs/OscdSecondaryTab.stories.d.ts +5 -0
- package/tabs/OscdSecondaryTab.stories.js +33 -0
- package/tabs/OscdSecondaryTab.stories.js.map +1 -0
- package/tabs/OscdTabs.d.ts +26 -0
- package/tabs/OscdTabs.js +17 -0
- package/tabs/OscdTabs.js.map +1 -0
- package/tabs/OscdTabs.stories.d.ts +5 -0
- package/tabs/OscdTabs.stories.js +29 -0
- package/tabs/OscdTabs.stories.js.map +1 -0
- package/tabs/oscd-primary-tab.d.ts +2 -0
- package/tabs/oscd-primary-tab.js +4 -0
- package/tabs/oscd-primary-tab.js.map +1 -0
- package/tabs/oscd-secondary-tab.d.ts +2 -0
- package/tabs/oscd-secondary-tab.js +4 -0
- package/tabs/oscd-secondary-tab.js.map +1 -0
- package/tabs/oscd-tabs.d.ts +2 -0
- package/tabs/oscd-tabs.js +4 -0
- package/tabs/oscd-tabs.js.map +1 -0
- package/textfield/OscdFilledTextField.d.ts +31 -0
- package/textfield/OscdFilledTextField.js +30 -0
- package/textfield/OscdFilledTextField.js.map +1 -0
- package/textfield/OscdOutlinedTextField.d.ts +27 -0
- package/textfield/OscdOutlinedTextField.js +24 -0
- package/textfield/OscdOutlinedTextField.js.map +1 -0
- package/textfield/oscd-filled-text-field.d.ts +2 -0
- package/textfield/oscd-filled-text-field.js +4 -0
- package/textfield/oscd-filled-text-field.js.map +1 -0
- package/textfield/oscd-outlined-text-field.d.ts +2 -0
- package/textfield/oscd-outlined-text-field.js +4 -0
- package/textfield/oscd-outlined-text-field.js.map +1 -0
- package/theming/AllComponents.stories.d.ts +5 -0
- package/theming/AllComponents.stories.js +309 -0
- package/theming/AllComponents.stories.js.map +1 -0
- package/utils/storybook/getStorybookHelpers.d.ts +4 -0
- package/utils/storybook/getStorybookHelpers.js +53 -0
- package/utils/storybook/getStorybookHelpers.js.map +1 -0
- package/utils/storybook/scopedWcDecorator.d.ts +2 -0
- package/utils/storybook/scopedWcDecorator.js +27 -0
- package/utils/storybook/scopedWcDecorator.js.map +1 -0
- package/utils/storybook/themingDecorator.d.ts +17 -0
- package/utils/storybook/themingDecorator.js +100 -0
- package/utils/storybook/themingDecorator.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-filled-icon-button.js","sourceRoot":"","sources":["oscd-filled-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,CAAC","sourcesContent":["import { OscdFilledIconButton } from \"./OscdFilledIconButton\";\n\ncustomElements.define(\"oscd-filled-icon-button\", OscdFilledIconButton);\nexport { OscdFilledIconButton };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-filled-tonal-icon-button.js","sourceRoot":"","sources":["oscd-filled-tonal-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,cAAc,CAAC,MAAM,CACnB,+BAA+B,EAC/B,yBAAyB,CAC1B,CAAC;AACF,OAAO,EAAE,yBAAyB,EAAE,CAAC","sourcesContent":["import { OscdFilledTonalIconButton } from \"./OscdFilledTonalIconButton\";\n\ncustomElements.define(\n \"oscd-filled-tonal-icon-button\",\n OscdFilledTonalIconButton\n);\nexport { OscdFilledTonalIconButton };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-icon-button.js","sourceRoot":"","sources":["oscd-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { OscdIconButton } from \"./OscdIconButton\";\n\ncustomElements.define(\"oscd-icon-button\", OscdIconButton);\nexport { OscdIconButton };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-outlined-icon-button.js","sourceRoot":"","sources":["oscd-outlined-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import { OscdOutlinedIconButton } from \"./OutlinedIconButton\";\n\ncustomElements.define(\"oscd-outlined-icon-button\", OscdOutlinedIconButton);\nexport { OscdOutlinedIconButton };\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { CSSResultOrNative } from "lit";
|
|
12
|
+
import { List } from "@material/web/list/internal/list.js";
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
"oscd-list": OscdList;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @summary Lists are continuous, vertical indexes of text or images.
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
22
|
+
* Lists consist of one or more list items, and can contain actions represented
|
|
23
|
+
* by icons and text. List items come in three sizes: one-line, two-line, and
|
|
24
|
+
* three-line.
|
|
25
|
+
*
|
|
26
|
+
* __Takeaways:__
|
|
27
|
+
*
|
|
28
|
+
* - Lists should be sorted in logical ways that make content easy to scan, such
|
|
29
|
+
* as alphabetical, numerical, chronological, or by user preference.
|
|
30
|
+
* - Lists present content in a way that makes it easy to identify a specific
|
|
31
|
+
* item in a collection and act on it.
|
|
32
|
+
* - Lists should present icons, text, and actions in a consistent format.
|
|
33
|
+
*
|
|
34
|
+
* @final
|
|
35
|
+
* @suppress {visibility}
|
|
36
|
+
*/
|
|
37
|
+
export declare class OscdList extends List {
|
|
38
|
+
static styles: CSSResultOrNative[];
|
|
39
|
+
}
|
package/list/OscdList.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { css } from "lit";
|
|
12
|
+
import { List } from "@material/web/list/internal/list.js";
|
|
13
|
+
import { styles } from "@material/web/list/internal/list-styles.js";
|
|
14
|
+
const overrideStyles = css `
|
|
15
|
+
:host {
|
|
16
|
+
--md-list-container-color: var(
|
|
17
|
+
--oscd-list-container-color,
|
|
18
|
+
var(--md-sys-color-surface-container, #fef7ff)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
/**
|
|
23
|
+
* @summary Lists are continuous, vertical indexes of text or images.
|
|
24
|
+
*
|
|
25
|
+
* @description
|
|
26
|
+
* Lists consist of one or more list items, and can contain actions represented
|
|
27
|
+
* by icons and text. List items come in three sizes: one-line, two-line, and
|
|
28
|
+
* three-line.
|
|
29
|
+
*
|
|
30
|
+
* __Takeaways:__
|
|
31
|
+
*
|
|
32
|
+
* - Lists should be sorted in logical ways that make content easy to scan, such
|
|
33
|
+
* as alphabetical, numerical, chronological, or by user preference.
|
|
34
|
+
* - Lists present content in a way that makes it easy to identify a specific
|
|
35
|
+
* item in a collection and act on it.
|
|
36
|
+
* - Lists should present icons, text, and actions in a consistent format.
|
|
37
|
+
*
|
|
38
|
+
* @final
|
|
39
|
+
* @suppress {visibility}
|
|
40
|
+
*/
|
|
41
|
+
export class OscdList extends List {
|
|
42
|
+
static styles = [styles, overrideStyles];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=OscdList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdList.js","sourceRoot":"","sources":["OscdList.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AAQpE,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;CAOzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAI;IAChC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @license\n * Copyright 2025 OMICRON Electronics GmbH\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { css, CSSResultOrNative } from \"lit\";\nimport { List } from \"@material/web/list/internal/list.js\";\nimport { styles } from \"@material/web/list/internal/list-styles.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"oscd-list\": OscdList;\n }\n}\n\nconst overrideStyles = css`\n :host {\n --md-list-container-color: var(\n --oscd-list-container-color,\n var(--md-sys-color-surface-container, #fef7ff)\n );\n }\n`;\n\n/**\n * @summary Lists are continuous, vertical indexes of text or images.\n *\n * @description\n * Lists consist of one or more list items, and can contain actions represented\n * by icons and text. List items come in three sizes: one-line, two-line, and\n * three-line.\n *\n * __Takeaways:__\n *\n * - Lists should be sorted in logical ways that make content easy to scan, such\n * as alphabetical, numerical, chronological, or by user preference.\n * - Lists present content in a way that makes it easy to identify a specific\n * item in a collection and act on it.\n * - Lists should present icons, text, and actions in a consistent format.\n *\n * @final\n * @suppress {visibility}\n */\nexport class OscdList extends List {\n static override styles: CSSResultOrNative[] = [styles, overrideStyles];\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { OscdList } from "list/OscdList";
|
|
3
|
+
import { OscdListItem } from "list/OscdListItem";
|
|
4
|
+
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Open SCD/Lists",
|
|
7
|
+
component: "oscd-list",
|
|
8
|
+
// tags: ["autodocs"],
|
|
9
|
+
decorators: [scopedWcDecorator],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
scopedElements: {
|
|
13
|
+
"oscd-list": OscdList,
|
|
14
|
+
"oscd-list-item": OscdListItem,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
render: () => html `
|
|
18
|
+
<oscd-list>
|
|
19
|
+
<oscd-list-item>Item 1</oscd-list-item>
|
|
20
|
+
<oscd-list-item>Item 2</oscd-list-item>
|
|
21
|
+
<oscd-list-item>Item 3</oscd-list-item>
|
|
22
|
+
</oscd-list>
|
|
23
|
+
`,
|
|
24
|
+
argTypes: {},
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
export const Default = {
|
|
28
|
+
args: {},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=OscdList.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdList.stories.js","sourceRoot":"","sources":["OscdList.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,WAAW;IACtB,sBAAsB;IACtB,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE;YACd,WAAW,EAAE,QAAQ;YACrB,gBAAgB,EAAE,YAAY;SAC/B;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;;GAMjB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC","sourcesContent":["import { html } from \"lit\";\nimport type { Meta, StoryObj } from \"@storybook/web-components\";\n\nimport { OscdList } from \"list/OscdList\";\nimport { OscdListItem } from \"list/OscdListItem\";\nimport { scopedWcDecorator } from \"utils/storybook/scopedWcDecorator.js\";\n\nconst meta: Meta = {\n title: \"Open SCD/Lists\",\n component: \"oscd-list\",\n // tags: [\"autodocs\"],\n decorators: [scopedWcDecorator],\n parameters: {\n layout: \"centered\",\n scopedElements: {\n \"oscd-list\": OscdList,\n \"oscd-list-item\": OscdListItem,\n },\n },\n render: () => html`\n <oscd-list>\n <oscd-list-item>Item 1</oscd-list-item>\n <oscd-list-item>Item 2</oscd-list-item>\n <oscd-list-item>Item 3</oscd-list-item>\n </oscd-list>\n `,\n argTypes: {},\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {},\n};\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { CSSResultOrNative } from "lit";
|
|
12
|
+
import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js";
|
|
13
|
+
export { type ListItemType } from "@material/web/list/internal/listitem/list-item.js";
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
"oscd-list-item": OscdListItem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @summary
|
|
21
|
+
* Lists are continuous, vertical indexes of text or images. Items are placed
|
|
22
|
+
* inside the list.
|
|
23
|
+
*
|
|
24
|
+
* @description
|
|
25
|
+
* Lists consist of one or more list items, and can contain actions represented
|
|
26
|
+
* by icons and text. List items come in three sizes: one-line, two-line, and
|
|
27
|
+
* three-line.
|
|
28
|
+
*
|
|
29
|
+
* __Takeaways:__
|
|
30
|
+
*
|
|
31
|
+
* - Lists should be sorted in logical ways that make content easy to scan, such
|
|
32
|
+
* as alphabetical, numerical, chronological, or by user preference.
|
|
33
|
+
* - Lists present content in a way that makes it easy to identify a specific
|
|
34
|
+
* item in a collection and act on it.
|
|
35
|
+
* - Lists should present icons, text, and actions in a consistent format.
|
|
36
|
+
*
|
|
37
|
+
* Acceptable slot child variants are:
|
|
38
|
+
*
|
|
39
|
+
* - `img[slot=end]`
|
|
40
|
+
* - `img[slot=start]`
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <oscd-list-item
|
|
45
|
+
* headline="User Name"
|
|
46
|
+
* supportingText="user@name.com">
|
|
47
|
+
* <oscd-icon slot="start">account_circle</oscd-icon>
|
|
48
|
+
* <oscd-icon slot="end">check</oscd-icon>
|
|
49
|
+
* </oscd-list-item>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
*
|
|
54
|
+
* @final
|
|
55
|
+
* @suppress {visibility}
|
|
56
|
+
*/
|
|
57
|
+
export declare class OscdListItem extends ListItem {
|
|
58
|
+
static styles: CSSResultOrNative[];
|
|
59
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { css } from "lit";
|
|
12
|
+
import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js";
|
|
13
|
+
import { styles } from "@material/web/list/internal/listitem/list-item-styles.js";
|
|
14
|
+
const styleOverrides = css `
|
|
15
|
+
:host([activated]) {
|
|
16
|
+
--md-list-item-label-text-color: var(
|
|
17
|
+
--oscd-list-item-activated-color,
|
|
18
|
+
var(--md-sys-color-primary, #6750a4)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
background-color: var(
|
|
22
|
+
--oscd-list-item-activated-background-color,
|
|
23
|
+
var(--md-sys-color-surface-bright, #eaddff)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
[slot="start"] {
|
|
27
|
+
color: var(
|
|
28
|
+
--md-list-item-leading-icon-color,
|
|
29
|
+
var(--md-sys-color-on-surface, #49454f)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
[slot="end"] {
|
|
33
|
+
color: var(
|
|
34
|
+
--md-list-item-trailing-icon-color,
|
|
35
|
+
var(--md-sys-color-on-surface, #49454f)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
/**
|
|
40
|
+
* @summary
|
|
41
|
+
* Lists are continuous, vertical indexes of text or images. Items are placed
|
|
42
|
+
* inside the list.
|
|
43
|
+
*
|
|
44
|
+
* @description
|
|
45
|
+
* Lists consist of one or more list items, and can contain actions represented
|
|
46
|
+
* by icons and text. List items come in three sizes: one-line, two-line, and
|
|
47
|
+
* three-line.
|
|
48
|
+
*
|
|
49
|
+
* __Takeaways:__
|
|
50
|
+
*
|
|
51
|
+
* - Lists should be sorted in logical ways that make content easy to scan, such
|
|
52
|
+
* as alphabetical, numerical, chronological, or by user preference.
|
|
53
|
+
* - Lists present content in a way that makes it easy to identify a specific
|
|
54
|
+
* item in a collection and act on it.
|
|
55
|
+
* - Lists should present icons, text, and actions in a consistent format.
|
|
56
|
+
*
|
|
57
|
+
* Acceptable slot child variants are:
|
|
58
|
+
*
|
|
59
|
+
* - `img[slot=end]`
|
|
60
|
+
* - `img[slot=start]`
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```html
|
|
64
|
+
* <oscd-list-item
|
|
65
|
+
* headline="User Name"
|
|
66
|
+
* supportingText="user@name.com">
|
|
67
|
+
* <oscd-icon slot="start">account_circle</oscd-icon>
|
|
68
|
+
* <oscd-icon slot="end">check</oscd-icon>
|
|
69
|
+
* </oscd-list-item>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
*
|
|
74
|
+
* @final
|
|
75
|
+
* @suppress {visibility}
|
|
76
|
+
*/
|
|
77
|
+
export class OscdListItem extends ListItem {
|
|
78
|
+
static styles = [styles, styleOverrides];
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=OscdListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdListItem.js","sourceRoot":"","sources":["OscdListItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,0DAA0D,CAAC;AAUlF,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;CAwBzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @license\n * Copyright 2025 OMICRON Electronics GmbH\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { css, CSSResultOrNative } from \"lit\";\nimport { ListItemEl as ListItem } from \"@material/web/list/internal/listitem/list-item.js\";\nimport { styles } from \"@material/web/list/internal/listitem/list-item-styles.js\";\n\nexport { type ListItemType } from \"@material/web/list/internal/listitem/list-item.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"oscd-list-item\": OscdListItem;\n }\n}\n\nconst styleOverrides = css`\n :host([activated]) {\n --md-list-item-label-text-color: var(\n --oscd-list-item-activated-color,\n var(--md-sys-color-primary, #6750a4)\n );\n\n background-color: var(\n --oscd-list-item-activated-background-color,\n var(--md-sys-color-surface-bright, #eaddff)\n );\n }\n [slot=\"start\"] {\n color: var(\n --md-list-item-leading-icon-color,\n var(--md-sys-color-on-surface, #49454f)\n );\n }\n [slot=\"end\"] {\n color: var(\n --md-list-item-trailing-icon-color,\n var(--md-sys-color-on-surface, #49454f)\n );\n }\n`;\n\n/**\n * @summary\n * Lists are continuous, vertical indexes of text or images. Items are placed\n * inside the list.\n *\n * @description\n * Lists consist of one or more list items, and can contain actions represented\n * by icons and text. List items come in three sizes: one-line, two-line, and\n * three-line.\n *\n * __Takeaways:__\n *\n * - Lists should be sorted in logical ways that make content easy to scan, such\n * as alphabetical, numerical, chronological, or by user preference.\n * - Lists present content in a way that makes it easy to identify a specific\n * item in a collection and act on it.\n * - Lists should present icons, text, and actions in a consistent format.\n *\n * Acceptable slot child variants are:\n *\n * - `img[slot=end]`\n * - `img[slot=start]`\n *\n * @example\n * ```html\n * <oscd-list-item\n * headline=\"User Name\"\n * supportingText=\"user@name.com\">\n * <oscd-icon slot=\"start\">account_circle</oscd-icon>\n * <oscd-icon slot=\"end\">check</oscd-icon>\n * </oscd-list-item>\n * ```\n *\n * @example\n *\n * @final\n * @suppress {visibility}\n */\nexport class OscdListItem extends ListItem {\n static override styles: CSSResultOrNative[] = [styles, styleOverrides];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-list-item.js","sourceRoot":"","sources":["oscd-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { OscdListItem } from \"./OscdListItem\";\n\ncustomElements.define(\"oscd-list-item\", OscdListItem);\nexport { OscdListItem };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oscd-list.js","sourceRoot":"","sources":["oscd-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import { OscdList } from \"./OscdList\";\n\ncustomElements.define(\"oscd-list\", OscdList);\nexport { OscdList };\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { CSSResultOrNative } from "lit";
|
|
12
|
+
import { Menu } from "@material/web/menu/internal/menu.js";
|
|
13
|
+
export { type ListItem } from "@material/web/list/internal/list-navigation-helpers.js";
|
|
14
|
+
export { type MenuItem } from "@material/web/menu/internal/controllers/menuItemController.js";
|
|
15
|
+
export { CloseReason, FocusState, type CloseMenuEvent, type Menu, } from "@material/web/menu/internal/controllers/shared.js";
|
|
16
|
+
export { Corner } from "@material/web/menu/internal/menu.js";
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"oscd-menu": OscdMenu;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @summary Menus display a list of choices on a temporary surface.
|
|
24
|
+
*
|
|
25
|
+
* @description
|
|
26
|
+
* Menus appear when users interact with a button, action, or other control.
|
|
27
|
+
*
|
|
28
|
+
* They can be opened from a variety of elements, most commonly icon buttons,
|
|
29
|
+
* buttons, and text fields.
|
|
30
|
+
*
|
|
31
|
+
* oscd-menu listens for the `close-menu` and `deselect-items` events.
|
|
32
|
+
*
|
|
33
|
+
* - `close-menu` closes the menu when dispatched from a child element.
|
|
34
|
+
* - `deselect-items` deselects all of its immediate menu-item children.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```html
|
|
38
|
+
* <div style="position:relative;">
|
|
39
|
+
* <button
|
|
40
|
+
* id="anchor"
|
|
41
|
+
* @click=${() => this.menuRef.value.show()}>
|
|
42
|
+
* Click to open menu
|
|
43
|
+
* </button>
|
|
44
|
+
* <!--
|
|
45
|
+
* `has-overflow` is required when using a submenu which overflows the
|
|
46
|
+
* menu's contents.
|
|
47
|
+
*
|
|
48
|
+
* Additionally, `anchor` ingests an idref which do not pass through shadow
|
|
49
|
+
* roots. You can also set `.anchorElement` to an element reference if
|
|
50
|
+
* necessary.
|
|
51
|
+
* -->
|
|
52
|
+
* <oscd-menu anchor="anchor" has-overflow ${ref(menuRef)}>
|
|
53
|
+
* <oscd-menu-item headline="This is a headline"></oscd-menu-item>
|
|
54
|
+
* <oscd-sub-menu>
|
|
55
|
+
* <oscd-menu-item
|
|
56
|
+
* slot="item"
|
|
57
|
+
* headline="this is a submenu item">
|
|
58
|
+
* </oscd-menu-item>
|
|
59
|
+
* <oscd-menu slot="menu">
|
|
60
|
+
* <oscd-menu-item headline="This is an item inside a submenu">
|
|
61
|
+
* </oscd-menu-item>
|
|
62
|
+
* </oscd-menu>
|
|
63
|
+
* </oscd-sub-menu>
|
|
64
|
+
* </oscd-menu>
|
|
65
|
+
* </div>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @final
|
|
69
|
+
* @suppress {visibility}
|
|
70
|
+
*/
|
|
71
|
+
export declare class OscdMenu extends Menu {
|
|
72
|
+
static styles: CSSResultOrNative[];
|
|
73
|
+
}
|
package/menu/OscdMenu.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Menu } from "@material/web/menu/internal/menu.js";
|
|
7
|
+
import { styles } from "@material/web/menu/internal/menu-styles.js";
|
|
8
|
+
export { CloseReason, FocusState, } from "@material/web/menu/internal/controllers/shared.js";
|
|
9
|
+
export { Corner } from "@material/web/menu/internal/menu.js";
|
|
10
|
+
/**
|
|
11
|
+
* @summary Menus display a list of choices on a temporary surface.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Menus appear when users interact with a button, action, or other control.
|
|
15
|
+
*
|
|
16
|
+
* They can be opened from a variety of elements, most commonly icon buttons,
|
|
17
|
+
* buttons, and text fields.
|
|
18
|
+
*
|
|
19
|
+
* oscd-menu listens for the `close-menu` and `deselect-items` events.
|
|
20
|
+
*
|
|
21
|
+
* - `close-menu` closes the menu when dispatched from a child element.
|
|
22
|
+
* - `deselect-items` deselects all of its immediate menu-item children.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <div style="position:relative;">
|
|
27
|
+
* <button
|
|
28
|
+
* id="anchor"
|
|
29
|
+
* @click=${() => this.menuRef.value.show()}>
|
|
30
|
+
* Click to open menu
|
|
31
|
+
* </button>
|
|
32
|
+
* <!--
|
|
33
|
+
* `has-overflow` is required when using a submenu which overflows the
|
|
34
|
+
* menu's contents.
|
|
35
|
+
*
|
|
36
|
+
* Additionally, `anchor` ingests an idref which do not pass through shadow
|
|
37
|
+
* roots. You can also set `.anchorElement` to an element reference if
|
|
38
|
+
* necessary.
|
|
39
|
+
* -->
|
|
40
|
+
* <oscd-menu anchor="anchor" has-overflow ${ref(menuRef)}>
|
|
41
|
+
* <oscd-menu-item headline="This is a headline"></oscd-menu-item>
|
|
42
|
+
* <oscd-sub-menu>
|
|
43
|
+
* <oscd-menu-item
|
|
44
|
+
* slot="item"
|
|
45
|
+
* headline="this is a submenu item">
|
|
46
|
+
* </oscd-menu-item>
|
|
47
|
+
* <oscd-menu slot="menu">
|
|
48
|
+
* <oscd-menu-item headline="This is an item inside a submenu">
|
|
49
|
+
* </oscd-menu-item>
|
|
50
|
+
* </oscd-menu>
|
|
51
|
+
* </oscd-sub-menu>
|
|
52
|
+
* </oscd-menu>
|
|
53
|
+
* </div>
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @final
|
|
57
|
+
* @suppress {visibility}
|
|
58
|
+
*/
|
|
59
|
+
export class OscdMenu extends Menu {
|
|
60
|
+
static styles = [styles];
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=OscdMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdMenu.js","sourceRoot":"","sources":["OscdMenu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AAIpE,OAAO,EACL,WAAW,EACX,UAAU,GAGX,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAQ7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAI;IAChC,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @license\n * Copyright 2025 OMICRON Electronics GmbH\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { CSSResultOrNative } from \"lit\";\nimport { Menu } from \"@material/web/menu/internal/menu.js\";\nimport { styles } from \"@material/web/menu/internal/menu-styles.js\";\n\nexport { type ListItem } from \"@material/web/list/internal/list-navigation-helpers.js\";\nexport { type MenuItem } from \"@material/web/menu/internal/controllers/menuItemController.js\";\nexport {\n CloseReason,\n FocusState,\n type CloseMenuEvent,\n type Menu,\n} from \"@material/web/menu/internal/controllers/shared.js\";\nexport { Corner } from \"@material/web/menu/internal/menu.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"oscd-menu\": OscdMenu;\n }\n}\n\n/**\n * @summary Menus display a list of choices on a temporary surface.\n *\n * @description\n * Menus appear when users interact with a button, action, or other control.\n *\n * They can be opened from a variety of elements, most commonly icon buttons,\n * buttons, and text fields.\n *\n * oscd-menu listens for the `close-menu` and `deselect-items` events.\n *\n * - `close-menu` closes the menu when dispatched from a child element.\n * - `deselect-items` deselects all of its immediate menu-item children.\n *\n * @example\n * ```html\n * <div style=\"position:relative;\">\n * <button\n * id=\"anchor\"\n * @click=${() => this.menuRef.value.show()}>\n * Click to open menu\n * </button>\n * <!--\n * `has-overflow` is required when using a submenu which overflows the\n * menu's contents.\n *\n * Additionally, `anchor` ingests an idref which do not pass through shadow\n * roots. You can also set `.anchorElement` to an element reference if\n * necessary.\n * -->\n * <oscd-menu anchor=\"anchor\" has-overflow ${ref(menuRef)}>\n * <oscd-menu-item headline=\"This is a headline\"></oscd-menu-item>\n * <oscd-sub-menu>\n * <oscd-menu-item\n * slot=\"item\"\n * headline=\"this is a submenu item\">\n * </oscd-menu-item>\n * <oscd-menu slot=\"menu\">\n * <oscd-menu-item headline=\"This is an item inside a submenu\">\n * </oscd-menu-item>\n * </oscd-menu>\n * </oscd-sub-menu>\n * </oscd-menu>\n * </div>\n * ```\n *\n * @final\n * @suppress {visibility}\n */\nexport class OscdMenu extends Menu {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { OscdMenu } from "menu/OscdMenu";
|
|
3
|
+
import { OscdMenuItem } from "menu/OscdMenuItem";
|
|
4
|
+
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Open SCD/Menus/Menu",
|
|
7
|
+
component: "oscd-menu",
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
decorators: [scopedWcDecorator],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
scopedElements: {
|
|
13
|
+
"oscd-menu": OscdMenu,
|
|
14
|
+
"oscd-menu-item": OscdMenuItem,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
render: () => html `
|
|
18
|
+
<oscd-menu open>
|
|
19
|
+
<oscd-menu-item value="1">Option 1</oscd-menu-item>
|
|
20
|
+
<oscd-menu-item value="2">Option 2</oscd-menu-item>
|
|
21
|
+
</oscd-menu>
|
|
22
|
+
`,
|
|
23
|
+
argTypes: {},
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
export const Default = {
|
|
27
|
+
args: {},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=OscdMenu.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdMenu.stories.js","sourceRoot":"","sources":["OscdMenu.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE;YACd,WAAW,EAAE,QAAQ;YACrB,gBAAgB,EAAE,YAAY;SAC/B;KACF;IACD,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;GAKjB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC","sourcesContent":["import { html } from \"lit\";\nimport type { Meta, StoryObj } from \"@storybook/web-components\";\n\nimport { OscdMenu } from \"menu/OscdMenu\";\nimport { OscdMenuItem } from \"menu/OscdMenuItem\";\nimport { scopedWcDecorator } from \"utils/storybook/scopedWcDecorator.js\";\n\nconst meta: Meta = {\n title: \"Open SCD/Menus/Menu\",\n component: \"oscd-menu\",\n tags: [\"autodocs\"],\n decorators: [scopedWcDecorator],\n parameters: {\n layout: \"centered\",\n scopedElements: {\n \"oscd-menu\": OscdMenu,\n \"oscd-menu-item\": OscdMenuItem,\n },\n },\n render: () => html`\n <oscd-menu open>\n <oscd-menu-item value=\"1\">Option 1</oscd-menu-item>\n <oscd-menu-item value=\"2\">Option 2</oscd-menu-item>\n </oscd-menu>\n `,\n argTypes: {},\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {},\n};\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { CSSResultOrNative } from "lit";
|
|
12
|
+
import { MenuItemEl } from "@material/web/menu/internal/menuitem/menu-item.js";
|
|
13
|
+
export { type MenuItem } from "@material/web/menu/internal/controllers/menuItemController.js";
|
|
14
|
+
export { type CloseMenuEvent } from "@material/web/menu/internal/controllers/shared.js";
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"oscd-menu-item": OscdMenuItem;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @summary Menus display a list of choices on a temporary surface.
|
|
22
|
+
*
|
|
23
|
+
* @description
|
|
24
|
+
* Menu items are the selectable choices within the menu. Menu items must
|
|
25
|
+
* implement the `MenuItem` interface and also have the `Oscdmenu-item`
|
|
26
|
+
* attribute. Additionally menu items are list items so they must also have the
|
|
27
|
+
* `oscd-list-item` attribute.
|
|
28
|
+
*
|
|
29
|
+
* Menu items can control a menu by selectively firing the `close-menu` and
|
|
30
|
+
* `deselect-items` events.
|
|
31
|
+
*
|
|
32
|
+
* @final
|
|
33
|
+
* @suppress {visibility}
|
|
34
|
+
*/
|
|
35
|
+
export declare class OscdMenuItem extends MenuItemEl {
|
|
36
|
+
static styles: CSSResultOrNative[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { MenuItemEl } from "@material/web/menu/internal/menuitem/menu-item.js";
|
|
7
|
+
import { styles } from "@material/web/menu/internal/menuitem/menu-item-styles.js";
|
|
8
|
+
/**
|
|
9
|
+
* @summary Menus display a list of choices on a temporary surface.
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* Menu items are the selectable choices within the menu. Menu items must
|
|
13
|
+
* implement the `MenuItem` interface and also have the `Oscdmenu-item`
|
|
14
|
+
* attribute. Additionally menu items are list items so they must also have the
|
|
15
|
+
* `oscd-list-item` attribute.
|
|
16
|
+
*
|
|
17
|
+
* Menu items can control a menu by selectively firing the `close-menu` and
|
|
18
|
+
* `deselect-items` events.
|
|
19
|
+
*
|
|
20
|
+
* @final
|
|
21
|
+
* @suppress {visibility}
|
|
22
|
+
*/
|
|
23
|
+
export class OscdMenuItem extends MenuItemEl {
|
|
24
|
+
static styles = [styles];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=OscdMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OscdMenuItem.js","sourceRoot":"","sources":["OscdMenuItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,0DAA0D,CAAC;AAWlF;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAU,MAAM,GAAwB,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @license\n * Copyright 2025 OMICRON Electronics GmbH\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { CSSResultOrNative } from \"lit\";\nimport { MenuItemEl } from \"@material/web/menu/internal/menuitem/menu-item.js\";\nimport { styles } from \"@material/web/menu/internal/menuitem/menu-item-styles.js\";\n\nexport { type MenuItem } from \"@material/web/menu/internal/controllers/menuItemController.js\";\nexport { type CloseMenuEvent } from \"@material/web/menu/internal/controllers/shared.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"oscd-menu-item\": OscdMenuItem;\n }\n}\n\n/**\n * @summary Menus display a list of choices on a temporary surface.\n *\n * @description\n * Menu items are the selectable choices within the menu. Menu items must\n * implement the `MenuItem` interface and also have the `Oscdmenu-item`\n * attribute. Additionally menu items are list items so they must also have the\n * `oscd-list-item` attribute.\n *\n * Menu items can control a menu by selectively firing the `close-menu` and\n * `deselect-items` events.\n *\n * @final\n * @suppress {visibility}\n */\nexport class OscdMenuItem extends MenuItemEl {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
|