@operato/context 10.29.86 → 10.29.88

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.
@@ -1,7 +1,7 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import { css, html, nothing } from 'lit';
3
3
  import { notify } from '@operato/layout';
4
- import { dangerButtonStyles } from '@operato/styles';
4
+ import { actionHeight, dangerButtonStyles } from '@operato/styles';
5
5
  import { isButtonAction, pageActionRunner } from './page-action.js';
6
6
  /**
7
7
  * One action drawn the same way wherever it stands - the bar and 「더보기」 both call this.
@@ -16,6 +16,10 @@ import { isButtonAction, pageActionRunner } from './page-action.js';
16
16
  export function renderPageAction(action, role, options = {}) {
17
17
  var _a, _b, _c, _d;
18
18
  const { type, title, icon, select, href, disabled, disabledTitle } = action;
19
+ /* A note says something in the bar and does nothing - why the step's action is not there yet, when it will be. */
20
+ if (type === 'note') {
21
+ return html `<span note role="note">${icon ? html `<md-icon>${icon}</md-icon>` : nothing}${title}</span>`;
22
+ }
19
23
  if (type === 'text') {
20
24
  return html `<span role="button" tabindex="0" @click=${(e) => run(action, e, options)} @keydown=${keyRun(action, options)}>${title}</span>`;
21
25
  }
@@ -83,6 +87,26 @@ export const PageActionStyles = css `
83
87
  border-color: var(--md-sys-color-error);
84
88
  }
85
89
 
90
+ /* A note reads as quiet text on its own surface, as tall as the buttons beside it. */
91
+ [note] {
92
+ box-sizing: border-box;
93
+ display: inline-flex;
94
+ align-items: center;
95
+ gap: var(--spacing-small, 4px);
96
+ height: ${actionHeight('--context-action-height')};
97
+ padding: 0 var(--spacing-large);
98
+ border-radius: var(--button-border-radius, var(--md-sys-shape-corner-small));
99
+ color: var(--md-sys-color-on-surface-variant);
100
+ background-color: var(--md-sys-color-surface-container-high);
101
+ font-size: var(--fontsize-small);
102
+ white-space: nowrap;
103
+ cursor: default;
104
+ }
105
+
106
+ [note] md-icon {
107
+ --md-icon-size: 18px;
108
+ }
109
+
86
110
  md-icon[working] {
87
111
  animation: page-action-rotate 1s linear infinite;
88
112
  }
@@ -31,7 +31,7 @@ export interface PageAction {
31
31
  icon?: string;
32
32
  /** What the action does. A promise keeps the action running until it settles. */
33
33
  action?: (event?: Event) => unknown;
34
- /** `button` (default), `icon` (icon only, the title is its name), `text`, `select`, `link`. */
34
+ /** `button` (default), `icon` (icon only, the title is its name), `text`, `select`, `link`, `note` (says something, does nothing). */
35
35
  type?: string;
36
36
  select?: string[];
37
37
  href?: string;
@@ -43,7 +43,7 @@ export function roleOf(action) {
43
43
  /** Whether the action is drawn as a button (not a text, select or link). */
44
44
  export function isButtonAction(action) {
45
45
  const { type, select } = action;
46
- return !(type === 'text' || type === 'select' || type === 'link' || (select && select.length > 0));
46
+ return !(type === 'text' || type === 'note' || type === 'select' || type === 'link' || (select && select.length > 0));
47
47
  }
48
48
  export function actionKey(action) {
49
49
  var _a, _b, _c;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/context",
3
3
  "description": "Webcomponent context following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "10.29.86",
5
+ "version": "10.29.88",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -80,9 +80,9 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@material/web": "^2.0.0",
83
- "@operato/help": "^10.29.86",
84
- "@operato/input": "^10.29.85",
85
- "@operato/layout": "^10.29.85",
83
+ "@operato/help": "^10.29.87",
84
+ "@operato/input": "^10.29.87",
85
+ "@operato/layout": "^10.29.87",
86
86
  "@operato/shell": "^10.29.85",
87
87
  "@operato/styles": "^10.29.83",
88
88
  "@operato/utils": "^10.29.85",
@@ -121,5 +121,5 @@
121
121
  "prettier --write"
122
122
  ]
123
123
  },
124
- "gitHead": "82d02ea4ee30d49a87017e578b74ac960098ae7f"
124
+ "gitHead": "a10af60c6aee09289c88ef7a95da5f1d66840f19"
125
125
  }