@omicronenergy/oscd-ui 0.0.20 → 0.1.1
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/CHANGELOG.md +27 -0
- package/MIGRATION-0.1.0.md +201 -0
- package/README.md +7 -1
- package/THEMING.md +180 -0
- package/custom-elements.json +1799 -1485
- package/dist/about/{Catalog.stories.d.ts → ComponentCatalog.stories.d.ts} +1 -1
- package/dist/about/ComponentCatalog.stories.js +300 -0
- package/dist/about/ComponentCatalog.stories.js.map +1 -0
- package/dist/ace-editor/OscdAceEditor.d.ts +25 -2
- package/dist/ace-editor/OscdAceEditor.js +25 -2
- package/dist/ace-editor/OscdAceEditor.js.map +1 -1
- package/dist/ace-editor/OscdAceEditor.stories.d.ts +3 -1
- package/dist/ace-editor/OscdAceEditor.stories.js +11 -2
- package/dist/ace-editor/OscdAceEditor.stories.js.map +1 -1
- package/dist/ace-editor/internal/ace-editor-base/AceEditorBase.js +2 -1
- package/dist/ace-editor/internal/ace-editor-base/AceEditorBase.js.map +1 -1
- package/dist/ace-editor/internal/ace-theme-oscd.js +174 -99
- package/dist/ace-editor/internal/ace-theme-oscd.js.map +1 -1
- package/dist/action-icon/OscdActionIcon.d.ts +12 -5
- package/dist/action-icon/OscdActionIcon.js +53 -46
- package/dist/action-icon/OscdActionIcon.js.map +1 -1
- package/dist/action-icon/OscdActionIcon.spec.d.ts +1 -0
- package/dist/action-icon/OscdActionIcon.spec.js +81 -0
- package/dist/action-icon/OscdActionIcon.spec.js.map +1 -0
- package/dist/action-list/OscdActionList.js +1 -1
- package/dist/action-list/OscdActionList.js.map +1 -1
- package/dist/action-pane/OscdActionPane.d.ts +8 -6
- package/dist/action-pane/OscdActionPane.js +49 -33
- package/dist/action-pane/OscdActionPane.js.map +1 -1
- package/dist/action-pane/OscdActionPane.spec.d.ts +1 -0
- package/dist/action-pane/OscdActionPane.spec.js +95 -0
- package/dist/action-pane/OscdActionPane.spec.js.map +1 -0
- package/dist/action-tree/OscdActionTree.d.ts +6 -0
- package/dist/action-tree/OscdActionTree.js +28 -7
- package/dist/action-tree/OscdActionTree.js.map +1 -1
- package/dist/app-bar/OscdAppBar.d.ts +20 -11
- package/dist/app-bar/OscdAppBar.js +98 -59
- package/dist/app-bar/OscdAppBar.js.map +1 -1
- package/dist/app-bar/OscdAppBar.spec.d.ts +1 -0
- package/dist/app-bar/OscdAppBar.spec.js +73 -0
- package/dist/app-bar/OscdAppBar.spec.js.map +1 -0
- package/dist/app-bar/OscdAppBar.stories.d.ts +1 -0
- package/dist/app-bar/OscdAppBar.stories.js +11 -0
- package/dist/app-bar/OscdAppBar.stories.js.map +1 -1
- package/dist/dialog/warning/OscdWarnDialog.stories.d.ts +5 -0
- package/dist/dialog/warning/OscdWarnDialog.stories.js +43 -0
- package/dist/dialog/warning/OscdWarnDialog.stories.js.map +1 -0
- package/dist/filter-button/OscdFilterButton.js +0 -4
- package/dist/filter-button/OscdFilterButton.js.map +1 -1
- package/dist/icon/internal/icon.js +1 -1
- package/dist/icon/internal/icon.js.map +1 -1
- package/dist/navigation-drawer/OscdNavigationDrawer.stories.js +4 -2
- package/dist/navigation-drawer/OscdNavigationDrawer.stories.js.map +1 -1
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.d.ts +10 -1
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.js +11 -57
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.js.map +1 -1
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.spec.d.ts +1 -0
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.spec.js +51 -0
- package/dist/navigation-drawer/OscdNavigationDrawerHeader.spec.js.map +1 -0
- package/dist/oscd-md3-mappings.d.ts +2 -0
- package/dist/oscd-md3-mappings.js +59 -0
- package/dist/oscd-md3-mappings.js.map +1 -0
- package/dist/oscd-md3-mappings.spec.d.ts +1 -0
- package/dist/oscd-md3-mappings.spec.js +82 -0
- package/dist/oscd-md3-mappings.spec.js.map +1 -0
- package/dist/scl-icon/OscdSclIcon.d.ts +3 -19
- package/dist/scl-icon/OscdSclIcon.js +3 -114
- package/dist/scl-icon/OscdSclIcon.js.map +1 -1
- package/dist/scl-icon/internal/scl-icons.d.ts +18 -0
- package/dist/scl-icon/internal/scl-icons.js +92 -0
- package/dist/scl-icon/internal/scl-icons.js.map +1 -0
- package/dist/scl-icon/internal/scl-icons.spec.d.ts +1 -0
- package/dist/scl-icon/internal/scl-icons.spec.js +18 -0
- package/dist/scl-icon/internal/scl-icons.spec.js.map +1 -0
- package/dist/search-field/OscdOutlinedSearchField.d.ts +2 -1
- package/dist/search-field/OscdOutlinedSearchField.js +2 -1
- package/dist/search-field/OscdOutlinedSearchField.js.map +1 -1
- package/dist/selection-list/OscdSelectionList.js +1 -1
- package/dist/selection-list/OscdSelectionList.js.map +1 -1
- package/dist/snackbar/OscdSnackbar.d.ts +32 -18
- package/dist/snackbar/OscdSnackbar.js +191 -67
- package/dist/snackbar/OscdSnackbar.js.map +1 -1
- package/dist/snackbar/OscdSnackbar.spec.js +67 -0
- package/dist/snackbar/OscdSnackbar.spec.js.map +1 -1
- package/dist/snackbar/OscdSnackbar.stories.d.ts +3 -1
- package/dist/snackbar/OscdSnackbar.stories.js +69 -0
- package/dist/snackbar/OscdSnackbar.stories.js.map +1 -1
- package/dist/tree/OscdTree.d.ts +3 -0
- package/dist/tree/OscdTree.js +3 -0
- package/dist/tree/OscdTree.js.map +1 -1
- package/dist/tree/OscdTreeItem.d.ts +2 -0
- package/dist/tree/OscdTreeItem.js +2 -0
- package/dist/tree/OscdTreeItem.js.map +1 -1
- package/dist/tree/OscdTreeItem.stories.d.ts +5 -0
- package/dist/tree/OscdTreeItem.stories.js +23 -0
- package/dist/tree/OscdTreeItem.stories.js.map +1 -0
- package/dist/tree/internal/Tree.js +30 -76
- package/dist/tree/internal/Tree.js.map +1 -1
- package/dist/tree/internal/TreeItem.js +17 -70
- package/dist/tree/internal/TreeItem.js.map +1 -1
- package/dist/tree-grid/OscdTreeGrid.js +2 -2
- package/dist/tree-grid/OscdTreeGrid.js.map +1 -1
- package/dist/tree-grid/oscd-tree-grid.spec.js +15 -0
- package/dist/tree-grid/oscd-tree-grid.spec.js.map +1 -1
- package/dist/utils/storybook/story-overrides/divider-overrides.js +1 -1
- package/dist/utils/storybook/story-overrides/divider-overrides.js.map +1 -1
- package/package.json +3 -1
- package/dist/about/Catalog.stories.js +0 -305
- package/dist/about/Catalog.stories.js.map +0 -1
- package/dist/utils/storybook/themingDecorator.d.ts +0 -19
- package/dist/utils/storybook/themingDecorator.js +0 -100
- package/dist/utils/storybook/themingDecorator.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
For the planned `0.1.0` breaking theming changes, see the
|
|
4
|
+
[migration guide](./MIGRATION-0.1.0.md).
|
|
5
|
+
|
|
6
|
+
## [0.1.1](https://github.com/OMICRONEnergyOSS/oscd-ui/compare/oscd-ui-v0.1.0...oscd-ui-v0.1.1) (2026-10-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* action-pane center label with icon ([ee78bfa](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/ee78bfaa3be54ba54d9751bd7e93911ef2841e21))
|
|
12
|
+
|
|
13
|
+
## [0.1.0](https://github.com/OMICRONEnergyOSS/oscd-ui/compare/oscd-ui-v0.0.20...oscd-ui-v0.1.0) (2026-10-01)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add dynamic component catalog story ([681c376](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/681c376c3a77a6aa2cdd38921ca0c594b8f51fd7))
|
|
19
|
+
* add opt-in MD3 theme mappings ([21c4abe](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/21c4abe767c611232e6e720b75ff472926e5bb94))
|
|
20
|
+
* add Solarized MD3 defaults and app-bar height facets ([4aaa621](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/4aaa6212a633322aa746252091589e278143d5cc))
|
|
21
|
+
* **storybook:** add switchable palettes and theming previews ([4161f78](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/4161f78172aef301ddc07f5f413bec0b534b6489))
|
|
22
|
+
* switch to new logo ([8d91f58](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/8d91f58bec200c8e6ff787c1c98c1e49d285de1d))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* complete non-breaking theming fixes ([83ea931](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/83ea9317259d22894d8c7b1f6fececdedf7db404))
|
|
28
|
+
* resolve circular import bundler warning ([c6c1b63](https://github.com/OMICRONEnergyOSS/oscd-ui/commit/c6c1b6361a5546f76511fb976414df3d399bd334))
|
|
29
|
+
|
|
3
30
|
## [0.0.20](https://github.com/OMICRONEnergyOSS/oscd-ui/compare/oscd-ui-v0.0.19...oscd-ui-v0.0.20) (2026-08-31)
|
|
4
31
|
|
|
5
32
|
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Migration guide: oscd-ui 0.1.0
|
|
2
|
+
|
|
3
|
+
Version `0.1.0` changes styling tokens, not existing component properties,
|
|
4
|
+
events, or slots. Snackbar adds optional `variantLabel` for localizing its
|
|
5
|
+
variant prefix. Renamed or removed CSS properties have no compatibility
|
|
6
|
+
aliases, so old overrides stop applying.
|
|
7
|
+
|
|
8
|
+
## Theme setup
|
|
9
|
+
|
|
10
|
+
Components consume MD3 and documented component tokens; they do not read
|
|
11
|
+
`--oscd-theme-*` directly. To use the OpenSCD palette, opt in to the mapper
|
|
12
|
+
at your Lit root (omit it if you set MD3 tokens yourself):
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { css, LitElement } from 'lit';
|
|
16
|
+
import { oscdMd3Mappings } from '@omicronenergy/oscd-ui/oscd-md3-mappings.js';
|
|
17
|
+
|
|
18
|
+
class PluginRoot extends LitElement {
|
|
19
|
+
static override styles = [oscdMd3Mappings, css``];
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The mapper is a Lit `CSSResult`, not a global stylesheet. Apply it at the
|
|
24
|
+
root, not `*`. See the [theming guide](./THEMING.md).
|
|
25
|
+
|
|
26
|
+
## Token migrations
|
|
27
|
+
|
|
28
|
+
### Search fields and grids
|
|
29
|
+
|
|
30
|
+
| Old token/input | Replacement |
|
|
31
|
+
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `--oscd-outlined-text-field-container-shape` | `--md-outlined-text-field-container-shape` |
|
|
33
|
+
| `--mdc-theme-text-hint-on-background` | Use the modern MD3 role `--md-sys-color-on-surface-variant` where that semantic role is intended. |
|
|
34
|
+
| `--mdc-theme-on-surface` on the filter button | Style its embedded icon button with `--md-icon-button-icon-color`, or remove the redundant override. |
|
|
35
|
+
| `--oscd-search-field-container-color` | Unsupported before and after this release; use supported `--md-outlined-text-field-*` tokens. |
|
|
36
|
+
|
|
37
|
+
Search fields now use the rounded MD3 shape (32px in lists, 28px in the grid).
|
|
38
|
+
Tree-grid and filter-button no longer read legacy `--mdc-*` tokens.
|
|
39
|
+
|
|
40
|
+
### Action tree
|
|
41
|
+
|
|
42
|
+
| Old token | Replacement |
|
|
43
|
+
| ------------------------------------- | ------------------------------------------ |
|
|
44
|
+
| `--action-tree-background-color` | `--oscd-action-tree-background-color` |
|
|
45
|
+
| `--action-tree-font-color` | `--oscd-action-tree-font-color` |
|
|
46
|
+
| `--action-tree-horizontal-grid-color` | `--oscd-action-tree-horizontal-grid-color` |
|
|
47
|
+
| `--action-tree-vertical-grid-color` | `--oscd-action-tree-vertical-grid-color` |
|
|
48
|
+
| `--action-tree-fold-duration` | `--oscd-action-tree-fold-duration` |
|
|
49
|
+
|
|
50
|
+
### Action pane and action icon
|
|
51
|
+
|
|
52
|
+
Replace the removed `--oscd-action-{pane,icon}-theme-*` tokens:
|
|
53
|
+
|
|
54
|
+
| Old token | New facet token |
|
|
55
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| `--oscd-action-pane-theme-surface` | `--oscd-action-pane-container-color` |
|
|
57
|
+
| `--oscd-action-pane-theme-on-primary` | `--oscd-action-pane-contrasted-container-color` |
|
|
58
|
+
| `--oscd-action-pane-theme-primary` | `--oscd-action-pane-outline-color` |
|
|
59
|
+
| `--oscd-action-pane-theme-secondary` | `--oscd-action-pane-secondary-outline-color` |
|
|
60
|
+
| `--oscd-action-pane-theme-on-surface` | `--oscd-action-pane-headline-color` |
|
|
61
|
+
| `--oscd-action-pane-theme-font` | `--oscd-action-pane-headline-font-family` |
|
|
62
|
+
| `--oscd-action-icon-theme-primary` | `--oscd-action-icon-icon-outline-color` and `--oscd-action-icon-header-container-color` |
|
|
63
|
+
| `--oscd-action-icon-theme-secondary` | `--oscd-action-icon-secondary-icon-outline-color` and `--oscd-action-icon-secondary-header-container-color` |
|
|
64
|
+
| `--oscd-action-icon-theme-on-primary` | `--oscd-action-icon-header-color` |
|
|
65
|
+
| `--oscd-action-icon-theme-on-surface` | `--oscd-action-icon-icon-color`, `--oscd-action-icon-action-color`, and `--oscd-action-icon-footer-color` |
|
|
66
|
+
| `--oscd-action-icon-theme-font` | `--oscd-action-icon-header-font-family` and `--oscd-action-icon-footer-font-family` |
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
oscd-action-pane {
|
|
70
|
+
--oscd-action-pane-container-color: var(--md-sys-color-surface);
|
|
71
|
+
--oscd-action-pane-outline-color: var(--md-sys-color-primary);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`--oscd-base2` and `--oscd-text-font` are no longer read; use MD3 tokens or
|
|
76
|
+
the new facets.
|
|
77
|
+
|
|
78
|
+
### Ace editor
|
|
79
|
+
|
|
80
|
+
Only the custom `ace/theme/oscd` theme is affected.
|
|
81
|
+
|
|
82
|
+
| Old palette input | Replacement |
|
|
83
|
+
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| `--oscd-base00`, `--oscd-base01`, `--oscd-base1`, `--oscd-base2`, `--oscd-base3` | Set the relevant editor or syntax facet: `--oscd-ace-editor-container-color`, `-text-color`, `-gutter-color`, `-gutter-text-color`, `-active-line-color`, `-selection-color`, or `-syntax-*-color`. |
|
|
85
|
+
| `--oscd-primary`, `--oscd-secondary`, `--oscd-error`, `--oscd-warning` | Set the syntax facet you intend to change, such as `--oscd-ace-editor-syntax-keyword-color` or `--oscd-ace-editor-syntax-invalid-color`. |
|
|
86
|
+
| `--oscd-text-font-mono` | `--oscd-ace-editor-font-family` |
|
|
87
|
+
|
|
88
|
+
Choose facets by what they style; palette colors have no one-to-one
|
|
89
|
+
replacement. See the [component manifest](./custom-elements.json).
|
|
90
|
+
|
|
91
|
+
### App bar
|
|
92
|
+
|
|
93
|
+
| Old token/input | Replacement |
|
|
94
|
+
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `--app-bar-background-color`, `--oscd-app-bar-background-color` | `--oscd-app-bar-container-color` |
|
|
96
|
+
| `--app-bar-color`, `--oscd-app-bar-color` | Set `--oscd-app-bar-headline-color`, `--oscd-app-bar-leading-icon-color`, and/or `--oscd-app-bar-trailing-icon-color` as needed. |
|
|
97
|
+
| `--oscd-app-bar-elevation` | `--oscd-app-bar-container-elevation` |
|
|
98
|
+
| `--oscd-app-bar-shadow-color` | `--oscd-app-bar-container-shadow-color` |
|
|
99
|
+
| `--app-bar-title-font-family`, `--oscd-app-bar-title-font-family` | `--oscd-app-bar-headline-font` |
|
|
100
|
+
| `--app-bar-title-font-size`, `--oscd-app-bar-title-font-size` | `--oscd-app-bar-headline-size` |
|
|
101
|
+
| `--app-bar-title-font-weight`, `--oscd-app-bar-title-font-weight` | `--oscd-app-bar-headline-weight` |
|
|
102
|
+
| `--app-bar-title-line-height`, `--oscd-app-bar-title-line-height` | `--oscd-app-bar-headline-line-height` |
|
|
103
|
+
| `--app-bar-height` | `--oscd-app-bar-container-height` (defaults to `64px`) |
|
|
104
|
+
| `--app-bar-small-height` | `--oscd-app-bar-container-small-height` (defaults to `64px`) |
|
|
105
|
+
|
|
106
|
+
The main row defaults to the MD3 small app bar (64px, surface, level-0).
|
|
107
|
+
Both height tokens apply at desktop and at viewport widths up to 599px
|
|
108
|
+
respectively. Shells with established non-MD3 heights should bridge their
|
|
109
|
+
public tokens to these facets to preserve their existing layout.
|
|
110
|
+
Set `scrolled` for surface-container and level-2; the sub-bar is unchanged.
|
|
111
|
+
|
|
112
|
+
### Tree and tree item
|
|
113
|
+
|
|
114
|
+
The row-level value is now private `--_level`; do not set
|
|
115
|
+
`--oscd-tree-row-level`. The tree calculates indentation from its data and
|
|
116
|
+
`--oscd-tree-indent-step`.
|
|
117
|
+
|
|
118
|
+
In the table, braces list token-name alternatives; for example,
|
|
119
|
+
`--oscd-tree-item-headline-{color,font}` means both literal names.
|
|
120
|
+
|
|
121
|
+
| Removed alias | Replacement |
|
|
122
|
+
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
123
|
+
| `--oscd-tree-row-level` | No replacement; row depth is private tree state. Use `--oscd-tree-indent-step` to control indentation globally. |
|
|
124
|
+
| `--oscd-tree-item-headline-{color,font,size,weight,line-height}` | Corresponding `--md-list-item-label-text-*` tokens |
|
|
125
|
+
| `--oscd-tree-item-supporting-text-{color,font,size,weight,line-height}` | Corresponding `--md-list-item-supporting-text-*` tokens |
|
|
126
|
+
| `--oscd-tree-item-font-family`, `--oscd-tree-item-font-size` | Set the relevant `--md-list-item-label-text-*` and `--md-list-item-supporting-text-*` typography tokens. |
|
|
127
|
+
| `--oscd-tree-item-min-height` | `--md-list-item-one-line-container-height` |
|
|
128
|
+
| `--oscd-tree-item-disabled-opacity` | `--md-list-item-disabled-opacity` |
|
|
129
|
+
| `--oscd-tree-item-leading-icon-color`, `--oscd-tree-item-trailing-icon-color` | `--md-list-item-leading-icon-color`, `--md-list-item-trailing-icon-color` |
|
|
130
|
+
| `--oscd-tree-row-focus-ring-{color,width,duration}` | `--md-focus-ring-color`, `--md-focus-ring-width`, `--md-focus-ring-duration` |
|
|
131
|
+
| `--oscd-tree-row-{hover,pressed}-state-layer-{color,opacity}` | Corresponding `--md-ripple-hover-*` and `--md-ripple-pressed-*` tokens |
|
|
132
|
+
| `--oscd-tree-accessory-icon-size`, `--oscd-tree-selection-checkbox-{icon-size,size}`, `--oscd-tree-toggle-icon-size` | No one-to-one tree token remains; customize the accessory, checkbox, or icon through its own supported component API/tokens. |
|
|
133
|
+
|
|
134
|
+
Other documented tree facets remain supported. Set MD list-item tokens on
|
|
135
|
+
`oscd-tree-item` or an ancestor; custom properties inherit into its shadow
|
|
136
|
+
tree.
|
|
137
|
+
|
|
138
|
+
### Snackbar
|
|
139
|
+
|
|
140
|
+
| Old token | Replacement or change |
|
|
141
|
+
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| `--oscd-snackbar-elevation-level` | `--oscd-snackbar-container-elevation` |
|
|
143
|
+
| `--oscd-snackbar-text-color` | `--oscd-snackbar-supporting-text-color` |
|
|
144
|
+
| `--oscd-snackbar-{info,success,warning,error}-text-color` | `--oscd-snackbar-{info,success,warning,error}-supporting-text-color` |
|
|
145
|
+
| Existing per-variant `container-color` and `icon-color` tokens | Names remain; defaults and variant behavior changed as described below. |
|
|
146
|
+
| Per-variant action-label and close-icon overrides | New `--oscd-snackbar-<variant>-action-label-text-color` and `--oscd-snackbar-<variant>-close-icon-color` tokens. |
|
|
147
|
+
|
|
148
|
+
Info, success, and warning default to inverse-surface; error uses MD3
|
|
149
|
+
error-container roles. Each variant exposes container, text, icon, action,
|
|
150
|
+
and close-icon colors. Set all five for a colored container. `variantLabel`
|
|
151
|
+
localizes the hidden prefix; error remains an alert, others status messages.
|
|
152
|
+
|
|
153
|
+
Example colors (consumer choices, not palette slots or MD3 roles):
|
|
154
|
+
|
|
155
|
+
```html
|
|
156
|
+
<div
|
|
157
|
+
style="
|
|
158
|
+
--oscd-snackbar-info-container-color: #1f74b0;
|
|
159
|
+
--oscd-snackbar-info-supporting-text-color: #fdf6e3;
|
|
160
|
+
--oscd-snackbar-info-icon-color: #fdf6e3;
|
|
161
|
+
--oscd-snackbar-info-action-label-text-color: #fdf6e3;
|
|
162
|
+
--oscd-snackbar-info-close-icon-color: #fdf6e3;
|
|
163
|
+
--oscd-snackbar-warning-container-color: #b58900;
|
|
164
|
+
--oscd-snackbar-warning-supporting-text-color: #002b36;
|
|
165
|
+
--oscd-snackbar-warning-icon-color: #002b36;
|
|
166
|
+
--oscd-snackbar-warning-action-label-text-color: #002b36;
|
|
167
|
+
--oscd-snackbar-warning-close-icon-color: #002b36;
|
|
168
|
+
--oscd-snackbar-success-container-color: #859900;
|
|
169
|
+
--oscd-snackbar-success-supporting-text-color: #002b36;
|
|
170
|
+
--oscd-snackbar-success-icon-color: #002b36;
|
|
171
|
+
--oscd-snackbar-success-action-label-text-color: #002b36;
|
|
172
|
+
--oscd-snackbar-success-close-icon-color: #002b36;
|
|
173
|
+
"
|
|
174
|
+
>
|
|
175
|
+
<oscd-snackbar></oscd-snackbar>
|
|
176
|
+
</div>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Navigation drawer header
|
|
180
|
+
|
|
181
|
+
Replace the removed header aliases with embedded list-item tokens:
|
|
182
|
+
|
|
183
|
+
| Removed alias | Replacement |
|
|
184
|
+
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| `--oscd-navigation-drawer-header-background-color` | No replacement token: the old alias was not forwarded to a supported list-item token. Style a surrounding drawer surface/container if needed. |
|
|
186
|
+
| `--oscd-navigation-drawer-header-color` | `--md-list-item-label-text-color` |
|
|
187
|
+
| `--oscd-navigation-drawer-header-text-{font,size,weight,line-height}` | Corresponding `--md-list-item-label-text-*` tokens |
|
|
188
|
+
| `--oscd-navigation-drawer-header-supporting-text-{font,size,weight,line-height}` | Corresponding `--md-list-item-supporting-text-*` tokens |
|
|
189
|
+
|
|
190
|
+
Other visual changes: corrected MD3 fallbacks; action pane/icon elevation now
|
|
191
|
+
uses `oscd-elevation`; tree and drawer header styling follows embedded MD
|
|
192
|
+
component tokens.
|
|
193
|
+
|
|
194
|
+
## Coming from `@openenergytools/oscd-action-pane` or `-icon`
|
|
195
|
+
|
|
196
|
+
Use the action pane/icon mappings above for the shared `-theme-*` tokens.
|
|
197
|
+
Replace the unsupported `--oscd-action-icon-theme-surface` with the relevant
|
|
198
|
+
documented facet or remove it.
|
|
199
|
+
|
|
200
|
+
See the [theming guide](./THEMING.md) and
|
|
201
|
+
[component manifest](./custom-elements.json) for supported tokens.
|
package/README.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
[](https://github.com/OMICRONEnergyOSS/oscd-ui/actions/workflows/test.yml) 
|
|
2
2
|
|
|
3
|
-
# <img src="https://omicronenergyoss.github.io/oscd-ui/assets/
|
|
3
|
+
# <img src="https://omicronenergyoss.github.io/oscd-ui/assets/openscd-logo.svg" alt="Open SCD Logo" width="40" height="40" /> Open SCD UI Component Library
|
|
4
4
|
|
|
5
5
|
This library is intended to be used for OpenSCD Plugins. This library is intended to be used for OpenSCD Plugins. Currently this is a subset of the existing [@omicronenergy/oscd-material-web-base](https://github.com/material-components/material-web) components. We plan to add more and more of the [@omicronenergy/oscd-material-web-base](https://github.com/material-components/material-web) components as and when they are needed, adding our own as the need arrises.
|
|
6
6
|
|
|
7
7
|
The original [@omicronenergy/oscd-material-web-base](https://github.com/material-components/material-web) documentation can be found here:
|
|
8
8
|
https://material-web.dev/about/intro/
|
|
9
9
|
|
|
10
|
+
For palettes, MD3 system tokens and the optional Lit mappings, see the
|
|
11
|
+
[theming guide](./THEMING.md).
|
|
12
|
+
|
|
13
|
+
For the planned 0.1.0 breaking theming changes, see the
|
|
14
|
+
[migration guide](./MIGRATION-0.1.0.md).
|
|
15
|
+
|
|
10
16
|
The predecessor [Material Web Components (mwc)](https://github.com/material-components/material-components-web) are officially depricated and the newer [Material Design components (md)](https://github.com/material-components/material-web) are in maintenance mode. So we plan to maintain this set of components moving forward no matter what happens to the [@omicronenergy/oscd-material-web-base](https://github.com/material-components/material-web) project.
|
|
11
17
|
|
|
12
18
|
For plugins which used the mwc-\* components, these used the older Material Icons (legacy) which were glyph-based and relatively simple but fixed to a style. @omicronenergy/oscd-ui components all use the newer Material Symbol font icons, which are variable fonts and far more flexible.
|
package/THEMING.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Theming oscd-ui
|
|
2
|
+
|
|
3
|
+
oscd-ui uses Material Web's MD3 system tokens. Without any theme adapter,
|
|
4
|
+
components use Material's baseline appearance. A distribution can supply an
|
|
5
|
+
[OpenSCD colour palette](https://github.com/stee-re/oscd-api/blob/main/docs/theming.md);
|
|
6
|
+
the opt-in mappings below translate it to MD3 tokens.
|
|
7
|
+
|
|
8
|
+
## Choosing tokens
|
|
9
|
+
|
|
10
|
+
Choose tokens by the scope of the change:
|
|
11
|
+
|
|
12
|
+
- **Palette:** Set `--oscd-theme-*` on the distribution or plugin root for
|
|
13
|
+
broad colour changes. oscd-ui responds to these slots only where its
|
|
14
|
+
opt-in MD3 mappings are applied.
|
|
15
|
+
- **System:** Set `--md-sys-*` or `--md-ref-*` to change every component
|
|
16
|
+
under that root that reads the token. For example, `--md-sys-color-surface`
|
|
17
|
+
affects components using the shared surface role.
|
|
18
|
+
- **Component:** Set `--md-<component>-*` for an embedded Material component,
|
|
19
|
+
or `--oscd-<component>-*` for an oscd-ui component. For example,
|
|
20
|
+
`--md-icon-button-icon-color` changes icon buttons, while
|
|
21
|
+
`--oscd-tree-indent-step` changes tree indentation. Set a token on a
|
|
22
|
+
specific component instance to limit the change to that instance.
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
--oscd-theme-* palette
|
|
26
|
+
│ optional Lit mappings
|
|
27
|
+
▼
|
|
28
|
+
--md-sys-* shared roles ────────┐
|
|
29
|
+
│ │
|
|
30
|
+
▼ ▼
|
|
31
|
+
Material component token oscd-ui component token
|
|
32
|
+
└──────────┬──────────┘
|
|
33
|
+
▼
|
|
34
|
+
component facet
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A component token can be set directly for a narrower override. Otherwise,
|
|
38
|
+
its facet may fall back to an MD3 role or a component default; not every
|
|
39
|
+
facet uses every layer.
|
|
40
|
+
|
|
41
|
+
Components consume MD3 and component tokens, not palette slots directly.
|
|
42
|
+
Do not declare mappings on `*`: it overrides inherited values on every
|
|
43
|
+
descendant and prevents subtree overrides.
|
|
44
|
+
|
|
45
|
+
See the supported `@cssprop` overrides in the
|
|
46
|
+
[component manifest](./custom-elements.json) or
|
|
47
|
+
[Storybook docs](https://omicronenergyoss.github.io/oscd-ui/?path=/docs/open-scd-overview--docs).
|
|
48
|
+
|
|
49
|
+
## Opt-in Lit mappings
|
|
50
|
+
|
|
51
|
+
Place the mappings first in the shell/plugin root's `static styles`:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { css, LitElement } from 'lit';
|
|
55
|
+
import { oscdMd3Mappings } from '@omicronenergy/oscd-ui/oscd-md3-mappings.js';
|
|
56
|
+
|
|
57
|
+
class PluginRoot extends LitElement {
|
|
58
|
+
static override styles = [
|
|
59
|
+
oscdMd3Mappings,
|
|
60
|
+
css`
|
|
61
|
+
:host {
|
|
62
|
+
color: var(--md-sys-color-on-surface);
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Set `--oscd-theme-*` on the host or an ancestor. The `:host` mappings
|
|
70
|
+
inherit to descendants; don't repeat them in children. They are a Lit
|
|
71
|
+
`CSSResult`, **not** a document-wide stylesheet. Omit them if you set MD3
|
|
72
|
+
tokens directly; importing them would overwrite those values on the host.
|
|
73
|
+
Missing palette slots use the Solarized reference palette. Check contrast
|
|
74
|
+
with partial palettes: the mappings neither derive colours nor validate
|
|
75
|
+
pairs. Avoid mapping a system role on an element whose component token derives
|
|
76
|
+
from it (CSS cycle).
|
|
77
|
+
|
|
78
|
+
### Material role mapping
|
|
79
|
+
|
|
80
|
+
`oscd-md3-mappings.ts` implements these **28 roles**: 26 from imported
|
|
81
|
+
Material styles, the snackbar's `error-container`, and `on-secondary` used by
|
|
82
|
+
the shell. When no `--oscd-theme-*` value is inherited, the mapper supplies
|
|
83
|
+
the Solarized reference palette. Without the mapper, components use their
|
|
84
|
+
Material Web baselines. Update the table and mappings if a new role is read;
|
|
85
|
+
this is not the full MD3 scheme. Palette slot meanings are defined in oscd-api.
|
|
86
|
+
|
|
87
|
+
| `--md-sys-color-*` role | `--oscd-theme-*` slot | Solarized default | Foreground/background relationship |
|
|
88
|
+
| --------------------------- | --------------------- | ----------------- | ------------------------------------------------------------ |
|
|
89
|
+
| `error` | `error` | `#dc322f` | Accent on surfaces; not a background by itself |
|
|
90
|
+
| `error-container` | `base2` | `#eee8d5` | With `on-error-container`; no dedicated error-container slot |
|
|
91
|
+
| `inverse-on-surface` | `base3` | `#fdf6e3` | On `inverse-surface` |
|
|
92
|
+
| `inverse-surface` | `base03` | `#002b36` | With `inverse-on-surface` |
|
|
93
|
+
| `on-error` | `base3` | `#fdf6e3` | On `error` |
|
|
94
|
+
| `on-error-container` | `base00` | `#657b83` | On `error-container` |
|
|
95
|
+
| `on-primary` | `base3` | `#fdf6e3` | On `primary` |
|
|
96
|
+
| `on-primary-container` | `base00` | `#657b83` | On `primary-container` |
|
|
97
|
+
| `on-secondary` | `base3` | `#fdf6e3` | On `secondary`; used by shell |
|
|
98
|
+
| `on-secondary-container` | `base00` | `#657b83` | On `secondary-container` |
|
|
99
|
+
| `on-surface` | `base00` | `#657b83` | On `surface` and its containers |
|
|
100
|
+
| `on-surface-variant` | `base0` | `#839496` | On surfaces; subdued foreground |
|
|
101
|
+
| `on-tertiary-container` | `base00` | `#657b83` | On `tertiary-container` |
|
|
102
|
+
| `outline` | `base01` | `#586e75` | Borders on surfaces |
|
|
103
|
+
| `outline-variant` | `base1` | `#93a1a1` | Subtle dividers on surfaces |
|
|
104
|
+
| `primary` | `primary` | `#2aa198` | With `on-primary` |
|
|
105
|
+
| `primary-container` | `base2` | `#eee8d5` | With `on-primary-container` |
|
|
106
|
+
| `scrim` | — | `#000` | Black, independent of palette |
|
|
107
|
+
| `secondary` | `secondary` | `#6c71c4` | Accent; pairs with `on-secondary` |
|
|
108
|
+
| `secondary-container` | `base2` | `#eee8d5` | With `on-secondary-container` |
|
|
109
|
+
| `shadow` | — | `#000` | Black, independent of palette |
|
|
110
|
+
| `surface` | `base3` | `#fdf6e3` | With `on-surface` |
|
|
111
|
+
| `surface-container` | `base2` | `#eee8d5` | With `on-surface` |
|
|
112
|
+
| `surface-container-high` | `base2` | `#eee8d5` | With `on-surface` |
|
|
113
|
+
| `surface-container-highest` | `base2` | `#eee8d5` | With `on-surface` |
|
|
114
|
+
| `surface-container-low` | `base3` | `#fdf6e3` | With `on-surface` |
|
|
115
|
+
| `tertiary` | `secondary` | `#6c71c4` | Secondary accent reused; no distinct tertiary slot |
|
|
116
|
+
| `tertiary-container` | `base2` | `#eee8d5` | With `on-tertiary-container` |
|
|
117
|
+
|
|
118
|
+
With fewer tonal steps than MD3, several containers share `base2` and
|
|
119
|
+
`tertiary` reuses `secondary`. `scrim` and `shadow` stay black even in dark
|
|
120
|
+
mode; a light surface colour would break overlays.
|
|
121
|
+
|
|
122
|
+
### Solarized reference for Storybook
|
|
123
|
+
|
|
124
|
+
Storybook's light/dark palettes use these private
|
|
125
|
+
`--_solarized-*` references. Both modes fill the same public slots;
|
|
126
|
+
distributions may use different values.
|
|
127
|
+
|
|
128
|
+
| Public slot | Light `--_solarized-*` | Dark `--_solarized-*` |
|
|
129
|
+
| ----------- | ---------------------- | --------------------- |
|
|
130
|
+
| `base03` | `base03` (`#002b36`) | `base3` (`#fdf6e3`) |
|
|
131
|
+
| `base02` | `base02` (`#073642`) | `base2` (`#eee8d5`) |
|
|
132
|
+
| `base01` | `base01` (`#586e75`) | `base1` (`#93a1a1`) |
|
|
133
|
+
| `base00` | `base00` (`#657b83`) | `base0` (`#839496`) |
|
|
134
|
+
| `base0` | `base0` (`#839496`) | `base00` (`#657b83`) |
|
|
135
|
+
| `base1` | `base1` (`#93a1a1`) | `base01` (`#586e75`) |
|
|
136
|
+
| `base2` | `base2` (`#eee8d5`) | `base02` (`#073642`) |
|
|
137
|
+
| `base3` | `base3` (`#fdf6e3`) | `base03` (`#002b36`) |
|
|
138
|
+
| `primary` | `cyan` (`#2aa198`) | `cyan` (`#2aa198`) |
|
|
139
|
+
| `secondary` | `violet` (`#6c71c4`) | `violet` (`#6c71c4`) |
|
|
140
|
+
| `error` | `red` (`#dc322f`) | `red` (`#dc322f`) |
|
|
141
|
+
| `warning` | `yellow` (`#b58900`) | `yellow` (`#b58900`) |
|
|
142
|
+
|
|
143
|
+
### Reference contrast review (informative)
|
|
144
|
+
|
|
145
|
+
Resolved ratios for the **reference** Solarized values, not limits on
|
|
146
|
+
consumer palettes. [MD3's contrast guidance](https://m3.material.io/foundations/designing/color-contrast)
|
|
147
|
+
follows [4.5:1 for normal text (3:1 for large text)](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html)
|
|
148
|
+
and [3:1 for necessary non-text UI](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html).
|
|
149
|
+
Values below are rounded for display; notes flag relevant shortfalls.
|
|
150
|
+
|
|
151
|
+
| Foreground on background | Light | Dark | Note |
|
|
152
|
+
| --------------------------------------------------------------------- | -----------------: | -----------------: | ------------------------------------------------------------------------------- |
|
|
153
|
+
| `on-primary` on `primary` | 2.93 | 4.75 | Light misses 4.5:1 text and 3:1 non-text |
|
|
154
|
+
| `on-error` on `error` | 4.29 | 3.25 | Both miss 4.5:1 text |
|
|
155
|
+
| `on-{primary,secondary,tertiary,error}-container` on their containers | 3.64 | 4.11 | Both miss 4.5:1 text |
|
|
156
|
+
| `on-surface` on `surface` / `surface-container-low` | 4.13 | 4.75 | Light misses 4.5:1 text |
|
|
157
|
+
| `on-surface` on `surface-container{,-high,-highest}` | 3.64 | 4.11 | Both miss 4.5:1 text |
|
|
158
|
+
| `on-surface-variant` on `surface` | 2.93 | 3.37 | Both miss 4.5:1 text; light misses 3:1 non-text |
|
|
159
|
+
| `inverse-on-surface` on `inverse-surface` | 13.92 | 13.92 | Meets 4.5:1 |
|
|
160
|
+
| `outline` on `surface` | 4.99 | 5.61 | Meets 3:1 when used for a necessary boundary |
|
|
161
|
+
| `outline-variant` on `surface` | 2.48 | 2.79 | Misses 3:1 if used for a necessary boundary; decorative dividers are exempt |
|
|
162
|
+
| `primary` / `secondary` / `error` on `surface` | 2.93 / 4.06 / 4.29 | 4.75 / 3.43 / 3.25 | Accent text misses 4.5:1 except dark primary; light primary misses 3:1 non-text |
|
|
163
|
+
|
|
164
|
+
Ace `ace/theme/oscd` still reads legacy `--oscd-*` tokens. **If** those
|
|
165
|
+
tokens resolve to this palette, its editor is `base3` and its active line
|
|
166
|
+
is `base2`. Syntax text has these ratios:
|
|
167
|
+
|
|
168
|
+
| Ace text on editor `base3` / active line `base2` | Light | Dark | Note |
|
|
169
|
+
| -------------------------------------------------- | ----------: | ----------: | --------------------------------------------------------------------- |
|
|
170
|
+
| Default, identifiers, strings, numbers (`base00`) | 4.13 / 3.64 | 4.75 / 4.11 | Light editor and both active-line modes miss 4.5:1 |
|
|
171
|
+
| Comments, punctuation (`base01`) | 4.99 / 4.39 | 5.61 / 4.86 | Light active line misses 4.5:1 |
|
|
172
|
+
| Keywords, tags (`secondary`) | 4.06 / 3.57 | 3.43 / 2.97 | Both editor and active line miss 4.5:1 |
|
|
173
|
+
| Attributes, storage (`primary`) | 2.93 / 2.58 | 4.75 / 4.12 | Light editor and both active-line modes miss 4.5:1 |
|
|
174
|
+
| Regex/invalid (`error`) | 4.29 / 3.77 | 3.25 / 2.81 | Both modes miss 4.5:1 |
|
|
175
|
+
| Parameters (`warning`, `#b58900`) | 2.98 / 2.62 | 4.68 / 4.05 | Light editor and both active-line modes miss 4.5:1 |
|
|
176
|
+
| Invalid foreground (`base3`) on `error` background | 4.29 | 3.25 | Current invalid syntax misses 4.5:1; A-24 removes the background fill |
|
|
177
|
+
|
|
178
|
+
The mappings do **not** set Ace's legacy tokens: without a separate legacy
|
|
179
|
+
palette, its hard-coded fallbacks apply instead. Recheck rendered Ace
|
|
180
|
+
contrast after A-24 replaces those reads.
|