@omicronenergy/oscd-ui 0.0.3 → 0.0.4
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/dialog/OscdDialog.js
CHANGED
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2025 OMICRON Electronics GmbH
|
|
9
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
import { css } from "lit";
|
|
6
12
|
import { Dialog } from "@material/web/dialog/internal/dialog.js";
|
|
7
13
|
import { styles } from "@material/web/dialog/internal/dialog-styles.js";
|
|
14
|
+
const styleOverrides = css `
|
|
15
|
+
.scrim {
|
|
16
|
+
z-index: 6;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
8
19
|
/**
|
|
9
20
|
* @summary Dialogs can require an action, communicate information, or help
|
|
10
21
|
* users accomplish a task. There are two types of dialogs: basic and
|
|
@@ -33,6 +44,6 @@ import { styles } from "@material/web/dialog/internal/dialog-styles.js";
|
|
|
33
44
|
* @suppress {visibility}
|
|
34
45
|
*/
|
|
35
46
|
export class OscdDialog extends Dialog {
|
|
36
|
-
static styles = [styles];
|
|
47
|
+
static styles = [styles, styleOverrides];
|
|
37
48
|
}
|
|
38
49
|
//# sourceMappingURL=OscdDialog.js.map
|
package/dialog/OscdDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OscdDialog.js","sourceRoot":"","sources":["OscdDialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"OscdDialog.js","sourceRoot":"","sources":["OscdDialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAqB,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AAQxE,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,UAAW,SAAQ,MAAM;IACpC,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 */\n\nimport { css, CSSResultOrNative } from \"lit\";\nimport { Dialog } from \"@material/web/dialog/internal/dialog.js\";\nimport { styles } from \"@material/web/dialog/internal/dialog-styles.js\";\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"oscd-dialog\": OscdDialog;\n }\n}\n\nconst styleOverrides = css`\n .scrim {\n z-index: 6;\n }\n`;\n\n/**\n * @summary Dialogs can require an action, communicate information, or help\n * users accomplish a task. There are two types of dialogs: basic and\n * full-screen.\n *\n * @description\n * A dialog is a modal window that appears in front of app content to provide\n * critical information or ask for a decision. Dialogs disable all app\n * functionality when they appear, and remain on screen until confirmed,\n * dismissed, or a required action has been taken.\n *\n * Dialogs are purposefully interruptive, so they should be used sparingly.\n * A less disruptive alternative is to use a menu, which provides options\n * without interrupting a user’s experience.\n *\n * On mobile devices only, complex dialogs should be displayed fullscreen.\n *\n * __Example usages:__\n * - Common use cases for basic dialogs include alerts, quick selection, and\n * confirmation.\n * - More complex dialogs may contain actions that require a series of tasks\n * to complete. One example is creating a calendar entry with the event title,\n * date, location, and time.\n *\n * @final\n * @suppress {visibility}\n */\nexport class OscdDialog extends Dialog {\n static override styles: CSSResultOrNative[] = [styles, styleOverrides];\n}\n"]}
|
package/menu/OscdMenu.stories.js
CHANGED
|
@@ -2,25 +2,51 @@ import { html } from "lit";
|
|
|
2
2
|
import { OscdMenu } from "menu/OscdMenu";
|
|
3
3
|
import { OscdMenuItem } from "menu/OscdMenuItem";
|
|
4
4
|
import { scopedWcDecorator } from "utils/storybook/scopedWcDecorator.js";
|
|
5
|
+
import { useArgs } from "@storybook/preview-api";
|
|
6
|
+
import { OscdOutlinedButton } from "button/OscdOutlinedButton";
|
|
7
|
+
import { getStorybookHelpers, storybookHelperDecorator, } from "utils/storybook/getStorybookHelpers.js";
|
|
8
|
+
const { args, argTypes } = getStorybookHelpers("oscd-menu");
|
|
5
9
|
const meta = {
|
|
6
10
|
title: "Open SCD/Menus/Menu",
|
|
7
11
|
component: "oscd-menu",
|
|
8
12
|
tags: ["autodocs"],
|
|
9
|
-
decorators: [scopedWcDecorator],
|
|
13
|
+
decorators: [scopedWcDecorator, storybookHelperDecorator],
|
|
14
|
+
args,
|
|
15
|
+
argTypes,
|
|
10
16
|
parameters: {
|
|
11
17
|
layout: "centered",
|
|
12
18
|
scopedElements: {
|
|
13
19
|
"oscd-menu": OscdMenu,
|
|
14
20
|
"oscd-menu-item": OscdMenuItem,
|
|
21
|
+
"oscd-outlined-button": OscdOutlinedButton,
|
|
15
22
|
},
|
|
16
23
|
},
|
|
17
|
-
render: () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
render: (args) => {
|
|
25
|
+
const [_, updateArgs] = useArgs();
|
|
26
|
+
return html `
|
|
27
|
+
<div style="position: relative;">
|
|
28
|
+
<oscd-outlined-button
|
|
29
|
+
id="menu-button"
|
|
30
|
+
@click=${() => updateArgs({ open: !args["open"] })}
|
|
31
|
+
>Open Menu</oscd-outlined-button
|
|
32
|
+
>
|
|
33
|
+
<oscd-menu
|
|
34
|
+
?open=${args["open"]}
|
|
35
|
+
id="menu"
|
|
36
|
+
anchor="menu-button"
|
|
37
|
+
surfaceCorner="end-end"
|
|
38
|
+
anchorCorner="start-start"
|
|
39
|
+
@closed=${() => updateArgs({ open: false })}
|
|
40
|
+
>
|
|
41
|
+
<oscd-menu-item value="1">Option 1</oscd-menu-item>
|
|
42
|
+
<oscd-menu-item value="2">Option 2</oscd-menu-item>
|
|
43
|
+
<oscd-menu-item value="2">Option 3</oscd-menu-item>
|
|
44
|
+
<oscd-menu-item value="2">Option 4</oscd-menu-item>
|
|
45
|
+
<oscd-menu-item value="2">Option 5</oscd-menu-item>
|
|
46
|
+
</oscd-menu>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
},
|
|
24
50
|
};
|
|
25
51
|
export default meta;
|
|
26
52
|
export const Default = {
|
|
@@ -1 +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;
|
|
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;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAE5D,MAAM,IAAI,GAAmB;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;IACzD,IAAI;IACJ,QAAQ;IACR,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE;YACd,WAAW,EAAE,QAAQ;YACrB,gBAAgB,EAAE,YAAY;YAC9B,sBAAsB,EAAE,kBAAkB;SAC3C;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACf,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,OAAO,EAAE,CAAC;QAClC,OAAO,IAAI,CAAA;;;;mBAII,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;;;;kBAI1C,IAAI,CAAC,MAAM,CAAC;;;;;oBAKV,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;;;;;;;;KAShD,CAAC;IACJ,CAAC;CACF,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\";\nimport { useArgs } from \"@storybook/preview-api\";\nimport { OscdOutlinedButton } from \"button/OscdOutlinedButton\";\nimport {\n getStorybookHelpers,\n storybookHelperDecorator,\n} from \"utils/storybook/getStorybookHelpers.js\";\n\nconst { args, argTypes } = getStorybookHelpers(\"oscd-menu\");\n\nconst meta: Meta<OscdMenu> = {\n title: \"Open SCD/Menus/Menu\",\n component: \"oscd-menu\",\n tags: [\"autodocs\"],\n decorators: [scopedWcDecorator, storybookHelperDecorator],\n args,\n argTypes,\n parameters: {\n layout: \"centered\",\n scopedElements: {\n \"oscd-menu\": OscdMenu,\n \"oscd-menu-item\": OscdMenuItem,\n \"oscd-outlined-button\": OscdOutlinedButton,\n },\n },\n render: (args) => {\n const [_, updateArgs] = useArgs();\n return html`\n <div style=\"position: relative;\">\n <oscd-outlined-button\n id=\"menu-button\"\n @click=${() => updateArgs({ open: !args[\"open\"] })}\n >Open Menu</oscd-outlined-button\n >\n <oscd-menu\n ?open=${args[\"open\"]}\n id=\"menu\"\n anchor=\"menu-button\"\n surfaceCorner=\"end-end\"\n anchorCorner=\"start-start\"\n @closed=${() => updateArgs({ open: false })}\n >\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-item value=\"2\">Option 3</oscd-menu-item>\n <oscd-menu-item value=\"2\">Option 4</oscd-menu-item>\n <oscd-menu-item value=\"2\">Option 5</oscd-menu-item>\n </oscd-menu>\n </div>\n `;\n },\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {},\n};\n"]}
|