@operato/context 2.0.0-alpha.146 → 2.0.0-alpha.149

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/src/layouts/ox-context-page-toolbar.js +15 -9
  3. package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
  4. package/dist/src/layouts/ox-context-toolbar.js +20 -21
  5. package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
  6. package/dist/src/tools/ox-page-action-context-bar.js +15 -13
  7. package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
  8. package/dist/src/tools/ox-page-action-overlay-template.js +1 -1
  9. package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
  10. package/dist/src/tools/ox-page-title-bar.js +9 -8
  11. package/dist/src/tools/ox-page-title-bar.js.map +1 -1
  12. package/dist/src/tools/ox-title-bar.js +7 -8
  13. package/dist/src/tools/ox-title-bar.js.map +1 -1
  14. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +5 -0
  15. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +59 -30
  16. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -1
  17. package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +5 -0
  18. package/dist/stories/ox-context-page-toolbar-select.stories.js +51 -25
  19. package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -1
  20. package/dist/stories/ox-context-page-toolbar.stories.d.ts +5 -0
  21. package/dist/stories/ox-context-page-toolbar.stories.js +53 -26
  22. package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -1
  23. package/dist/stories/ox-context-toolbar-complex.stories.d.ts +7 -1
  24. package/dist/stories/ox-context-toolbar-complex.stories.js +31 -8
  25. package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -1
  26. package/dist/stories/ox-context-toolbar-empty.stories.d.ts +7 -1
  27. package/dist/stories/ox-context-toolbar-empty.stories.js +31 -8
  28. package/dist/stories/ox-context-toolbar-empty.stories.js.map +1 -1
  29. package/dist/stories/ox-context-toolbar-overflow.stories.d.ts +7 -1
  30. package/dist/stories/ox-context-toolbar-overflow.stories.js +35 -9
  31. package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -1
  32. package/dist/stories/ox-context-toolbar.stories.d.ts +1 -0
  33. package/dist/stories/ox-context-toolbar.stories.js +32 -7
  34. package/dist/stories/ox-context-toolbar.stories.js.map +1 -1
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +7 -7
  37. package/src/layouts/ox-context-page-toolbar.ts +15 -9
  38. package/src/layouts/ox-context-toolbar.ts +20 -21
  39. package/src/tools/ox-page-action-context-bar.ts +15 -13
  40. package/src/tools/ox-page-action-overlay-template.ts +1 -1
  41. package/src/tools/ox-page-title-bar.ts +9 -8
  42. package/src/tools/ox-title-bar.ts +7 -8
  43. package/stories/ox-context-page-toolbar-select-buttons.stories.ts +122 -91
  44. package/stories/ox-context-page-toolbar-select.stories.ts +91 -64
  45. package/stories/ox-context-page-toolbar.stories.ts +92 -63
  46. package/stories/ox-context-toolbar-complex.stories.ts +34 -9
  47. package/stories/ox-context-toolbar-empty.stories.ts +34 -9
  48. package/stories/ox-context-toolbar-overflow.stories.ts +38 -10
  49. package/stories/ox-context-toolbar.stories.ts +35 -8
  50. package/themes/dark-hc.css +51 -0
  51. package/themes/dark-mc.css +51 -0
  52. package/themes/dark.css +51 -0
  53. package/themes/light-hc.css +51 -0
  54. package/themes/light-mc.css +51 -0
  55. package/themes/light.css +57 -0
  56. package/themes/md-typescale-styles.css +100 -0
  57. package/themes/spacing.css +13 -0
  58. package/themes/state-color.css +6 -0
  59. package/themes/app-theme.css +0 -161
  60. package/themes/context-theme.css +0 -74
  61. package/themes/material-theme.css +0 -88
@@ -17,20 +17,21 @@ export class PageTitleBar extends connect(store)(LitElement) {
17
17
  display: flex;
18
18
  align-items: center;
19
19
 
20
- --help-icon-color: var(--primary-text-color);
21
- --help-icon-hover-color: var(--secondary-text-color);
20
+ --help-icon-color: var(--md-sys-color-on-primary-container);
21
+ --help-icon-hover-color: var(--md-sys-color-primary);
22
22
  --help-icon-opacity: 0.2;
23
23
  --help-icon-size: 20px;
24
24
 
25
25
  --md-icon-size: 20px;
26
26
 
27
- --input-search-padding: var(--padding-narrow);
27
+ --input-search-padding: var(--spacing-small);
28
28
  --input-search-font: normal 14px var(--theme-font);
29
29
  }
30
30
 
31
31
  [titler] {
32
32
  display: flex;
33
- padding: var(--padding-default) var(--padding-narrow) var(--padding-narrow) var(--padding-narrow);
33
+ padding: var(--spacing-small);
34
+ padding-top: var(--spacing-medium);
34
35
  font: var(--context-toolbar-title);
35
36
  color: var(--title-text-color);
36
37
  }
@@ -52,7 +53,7 @@ export class PageTitleBar extends connect(store)(LitElement) {
52
53
  }
53
54
 
54
55
  [search] [help] {
55
- color: var(--secondary-color);
56
+ color: var(--md-sys-color-on-secondary-container);
56
57
  }
57
58
 
58
59
  [search] {
@@ -61,11 +62,11 @@ export class PageTitleBar extends connect(store)(LitElement) {
61
62
  align-items: center;
62
63
 
63
64
  align-self: center;
64
- color: var(--secondary-color);
65
+ color: var(--md-sys-color-on-secondary-container);
65
66
  background-color: var(--opacity-light-color);
66
- border-radius: 999em;
67
+ border-radius: var(--md-sys-shape-corner-full);
67
68
  margin-left: auto;
68
- padding: 0 10px;
69
+ padding: 0 var(--spacing-medium);
69
70
  }
70
71
 
71
72
  [search] > * {
@@ -16,15 +16,14 @@ export class TitleBar extends connect(store)(LitElement) {
16
16
  display: flex;
17
17
  align-items: center;
18
18
 
19
- --help-icon-color: #fff;
20
- --help-icon-hover-color: #fff;
19
+ --help-icon-color: var(--md-sys-color-on-primary);
20
+ --help-icon-hover-color: var(--md-sys-color-on-primary);
21
21
  --help-icon-opacity: 0.2;
22
22
  --help-icon-size: 20px;
23
23
 
24
24
  --md-icon-size: 20px;
25
25
 
26
- --input-search-padding: 7px;
27
- --input-search-border-bottom: none;
26
+ --input-search-padding: var(--spacing-medium);
28
27
  --input-search-focus-border-bottom: none;
29
28
  --input-search-font: normal 16px var(--theme-font);
30
29
  }
@@ -51,7 +50,7 @@ export class TitleBar extends connect(store)(LitElement) {
51
50
  }
52
51
 
53
52
  [search] [help] {
54
- color: var(--secondary-color);
53
+ color: var(--md-sys-color-on-secondary-container);
55
54
  }
56
55
 
57
56
  [search] {
@@ -60,10 +59,10 @@ export class TitleBar extends connect(store)(LitElement) {
60
59
  align-items: center;
61
60
 
62
61
  align-self: center;
63
- color: var(--secondary-color);
62
+ color: var(--md-sys-color-on-secondary-container);
64
63
  background-color: var(--opacity-light-color);
65
- border-radius: 999em;
66
- padding: 0 10px;
64
+ border-radius: var(--md-sys-shape-corner-full);
65
+ padding: 0 var(--spacing-medium);
67
66
  }
68
67
 
69
68
  [search] > * {
@@ -8,12 +8,14 @@ import { TOOL_POSITION } from '@operato/layout'
8
8
  import '@operato/styles'
9
9
 
10
10
  import { css, html, render, TemplateResult } from 'lit'
11
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
11
12
 
12
13
  export default {
13
14
  title: 'ox-context-page-toolbar select buttons',
14
15
  component: 'ox-context-page-toolbar',
15
16
  argTypes: {
16
- label: { control: 'string' }
17
+ label: { control: 'string' },
18
+ theme: { control: 'select', options: ['light', 'dark'] }
17
19
  }
18
20
  }
19
21
 
@@ -25,112 +27,141 @@ interface Story<T> {
25
27
 
26
28
  interface ArgTypes {
27
29
  label?: string
30
+ theme?: string
28
31
  }
29
32
 
30
- const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
31
- <link href="/themes/app-theme.css" rel="stylesheet" />
32
- <link href="/themes/material-theme.css" rel="stylesheet" />
33
-
34
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
35
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
36
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
33
+ const Template: Story<ArgTypes> = ({ label = '', theme = 'light' }: ArgTypes) => html`
34
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
35
+
36
+ <link href="/themes/light.css" rel="stylesheet" />
37
+ <link href="/themes/dark.css" rel="stylesheet" />
38
+ <link href="/themes/spacing.css" rel="stylesheet" />
39
+
40
+ <link
41
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
42
+ rel="stylesheet"
43
+ />
44
+ <link
45
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
46
+ rel="stylesheet"
47
+ />
48
+ <link
49
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
50
+ rel="stylesheet"
51
+ />
52
+
53
+ <style>
54
+ ${MDTypeScaleStyles.cssText}
55
+ </style>
37
56
 
38
57
  <style>
39
- body {
40
- background-color: white;
58
+ .container {
59
+ height: 500px;
60
+ text-align: center;
61
+ padding: 20px;
62
+ background-color: var(--md-sys-color-primary-container);
63
+ color: var(--md-sys-color-on-primary-container);
64
+
65
+ padding: 20px;
41
66
  }
42
67
 
43
- ${CommonHeaderStyles.cssText}
68
+ ox-buttons-radio {
69
+ padding: 20px;
70
+ }
44
71
  </style>
45
72
 
46
- <div style="height:600px;">
73
+ <script>
74
+ document.body.classList.add('${theme}')
75
+ </script>
76
+
77
+ <div class="container md-typescale-body-large-prominent">
47
78
  <div class="header">
48
- <div class="title">
49
- ${label}
50
- </div>
79
+ <div class="title">${label}</div>
51
80
 
52
81
  <div class="filters">
53
- <label>Filter-X</label><input type="text" name="name"></input>
82
+ <label>Filter-X</label><input type="text" name="name" />
54
83
  <ox-input-select-buttons
55
- @change=${(e: Event) => {
56
- console.log((e.target as HTMLInputElement).value)
57
- }}
58
- name="wearables"
59
- .value=${'Gloves'}
60
- .options=${[
61
- { display: 'SHOOSE', value: 'Shoose' },
62
- { display: 'CHOTHES', value: 'Clothes' },
63
- { display: 'GLOVES', value: 'Gloves' }
64
- ]}
65
- multiple
66
- ></ox-input-select-buttons>
84
+ @change=${(e: Event) => {
85
+ console.log((e.target as HTMLInputElement).value)
86
+ }}
87
+ name="wearables"
88
+ .value=${'Gloves'}
89
+ .options=${[
90
+ { display: 'SHOOSE', value: 'Shoose' },
91
+ { display: 'CHOTHES', value: 'Clothes' },
92
+ { display: 'GLOVES', value: 'Gloves' }
93
+ ]}
94
+ multiple
95
+ ></ox-input-select-buttons>
67
96
  </div>
68
97
 
69
- <ox-context-page-toolbar class="actions"
70
- .tools=${[
71
- {
72
- position: TOOL_POSITION.FRONT,
73
- template: html` <md-icon>download</md-icon> `,
74
- context: 'exportable'
75
- },
76
- {
77
- position: TOOL_POSITION.FRONT,
78
- template: html` <md-icon>upload</md-icon> `,
79
- context: 'importable'
80
- },
81
- {
82
- position: TOOL_POSITION.CENTER,
83
- template: html`<ox-page-action-context-bar
84
- .actions=${[
85
- {
86
- title: 'save',
87
- action: () => {},
88
- icon: 'save'
89
- },
90
- {
91
- title: 'copy',
92
- action: () => {},
93
- icon: 'content_copy',
94
- emphasis: {
95
- outlined: true
96
- }
97
- },
98
- {
99
- title: 'edit',
100
- action: () => {},
101
- icon: 'content_copy',
102
- emphasis: {
103
- outlined: true
98
+ <ox-context-page-toolbar
99
+ class="actions"
100
+ .tools=${[
101
+ {
102
+ position: TOOL_POSITION.FRONT,
103
+ template: html` <md-icon>download</md-icon> `,
104
+ context: 'exportable'
105
+ },
106
+ {
107
+ position: TOOL_POSITION.FRONT,
108
+ template: html` <md-icon>upload</md-icon> `,
109
+ context: 'importable'
110
+ },
111
+ {
112
+ position: TOOL_POSITION.CENTER,
113
+ template: html`<ox-page-action-context-bar
114
+ .actions=${[
115
+ {
116
+ title: 'save',
117
+ action: () => {},
118
+ icon: 'save'
119
+ },
120
+ {
121
+ title: 'copy',
122
+ action: () => {},
123
+ icon: 'content_copy',
124
+ emphasis: {
125
+ outlined: true
126
+ }
127
+ },
128
+ {
129
+ title: 'edit',
130
+ action: () => {},
131
+ icon: 'content_copy',
132
+ emphasis: {
133
+ outlined: true
134
+ }
135
+ },
136
+ {
137
+ title: 'hoppaang',
138
+ action: () => {},
139
+ icon: '',
140
+ emphasis: {
141
+ outlined: true
142
+ }
143
+ },
144
+ {
145
+ title: 'delete',
146
+ action: () => {},
147
+ icon: 'delete',
148
+ emphasis: {
149
+ danger: true,
150
+ filled: true
151
+ }
104
152
  }
105
- },
106
- {
107
- title: 'hoppaang',
108
- action: () => {},
109
- icon: '',
110
- emphasis: {
111
- outlined: true
112
- }
113
- },
114
- {
115
- title: 'delete',
116
- action: () => {},
117
- icon: 'delete',
118
- emphasis: {
119
- danger: true,
120
- filled: true
121
- }
122
- }
123
- ]}
124
- ></ox-page-action-context-bar>`
153
+ ]}
154
+ ></ox-page-action-context-bar>`
155
+ }
156
+ ]}
157
+ .context=${{
158
+ exportable: true,
159
+ importable: true,
160
+ toolbar: false
161
+ }}
125
162
  }
126
- ]}
127
- .context=${{
128
- exportable: true,
129
- importable: true,
130
- toolbar: false
131
- }}
132
-
133
- }> </ox-context-page-toolbar>
163
+ >
164
+ </ox-context-page-toolbar>
134
165
  </div>
135
166
  </div>
136
167
  `
@@ -1,19 +1,20 @@
1
1
  import '@material/web/icon/icon.js'
2
2
  import '../src/layouts/ox-context-page-toolbar.js'
3
3
  import '../src/tools/ox-page-action-context-bar.js'
4
- import { CommonHeaderStyles } from '@operato/styles'
5
4
  import { TOOL_POSITION } from '@operato/layout'
6
5
  import { sleep } from '@operato/utils'
7
6
 
8
7
  import '@operato/styles'
9
8
 
10
9
  import { css, html, render, TemplateResult } from 'lit'
10
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
11
11
 
12
12
  export default {
13
13
  title: 'ox-context-page-toolbar-select',
14
14
  component: 'ox-context-page-toolbar',
15
15
  argTypes: {
16
- label: { control: 'string' }
16
+ label: { control: 'string' },
17
+ theme: { control: 'select', options: ['light', 'dark'] }
17
18
  }
18
19
  }
19
20
 
@@ -25,79 +26,105 @@ interface Story<T> {
25
26
 
26
27
  interface ArgTypes {
27
28
  label?: string
29
+ theme?: string
28
30
  }
29
31
 
30
- const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
31
- <link href="/themes/app-theme.css" rel="stylesheet" />
32
- <link href="/themes/material-theme.css" rel="stylesheet" />
32
+ const Template: Story<ArgTypes> = ({ label = '', theme = 'light' }: ArgTypes) => html`
33
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
33
34
 
34
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
35
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
36
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
35
+ <link href="/themes/light.css" rel="stylesheet" />
36
+ <link href="/themes/dark.css" rel="stylesheet" />
37
+ <link href="/themes/spacing.css" rel="stylesheet" />
38
+
39
+ <link
40
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
41
+ rel="stylesheet"
42
+ />
43
+ <link
44
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
45
+ rel="stylesheet"
46
+ />
47
+ <link
48
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
49
+ rel="stylesheet"
50
+ />
37
51
 
38
52
  <style>
39
- body {
40
- background-color: white;
53
+ ${MDTypeScaleStyles.cssText}
54
+ </style>
55
+
56
+ <style>
57
+ .container {
58
+ height: 500px;
59
+ text-align: center;
60
+ padding: 20px;
61
+ background-color: var(--md-sys-color-primary-container);
62
+ color: var(--md-sys-color-on-primary-container);
63
+
64
+ padding: 20px;
41
65
  }
42
66
 
43
- ${CommonHeaderStyles.cssText}
67
+ ox-buttons-radio {
68
+ padding: 20px;
69
+ }
44
70
  </style>
45
71
 
46
- <div style="height:600px;">
72
+ <script>
73
+ document.body.classList.add('${theme}')
74
+ </script>
75
+
76
+ <div class="container md-typescale-body-large-prominent">
47
77
  <div class="header">
48
- <div class="title">
49
- ${label}
50
- </div>
51
-
52
- <div class="filters">
53
- <label>Filter</label><input type="text"></input>
54
- </div>
55
-
56
- <ox-context-page-toolbar class="actions"
57
- .tools=${[
58
- {
59
- position: TOOL_POSITION.FRONT,
60
- template: html` <md-icon>download</md-icon> `,
61
- context: 'exportable'
62
- },
63
- {
64
- position: TOOL_POSITION.FRONT,
65
- template: html` <md-icon>upload</md-icon> `,
66
- context: 'importable'
67
- },
68
- {
69
- position: TOOL_POSITION.CENTER,
70
- template: html`<ox-page-action-context-bar
71
- .actions=${[
72
- {
73
- type: 'icon',
74
- title: 'favorite',
75
- icon: 'favorite',
76
- action: async () => {
77
- await sleep(1000)
78
+ <div class="title">${label}</div>
79
+
80
+ <div class="filters"><label>Filter</label><input type="text" /></div>
81
+
82
+ <ox-context-page-toolbar
83
+ class="actions"
84
+ .tools=${[
85
+ {
86
+ position: TOOL_POSITION.FRONT,
87
+ template: html` <md-icon>download</md-icon> `,
88
+ context: 'exportable'
89
+ },
90
+ {
91
+ position: TOOL_POSITION.FRONT,
92
+ template: html` <md-icon>upload</md-icon> `,
93
+ context: 'importable'
94
+ },
95
+ {
96
+ position: TOOL_POSITION.CENTER,
97
+ template: html`<ox-page-action-context-bar
98
+ .actions=${[
99
+ {
100
+ type: 'icon',
101
+ title: 'favorite',
102
+ icon: 'favorite',
103
+ action: async () => {
104
+ await sleep(1000)
105
+ }
106
+ },
107
+ {
108
+ title: 'smile',
109
+ action: () => {},
110
+ select: ['', 'delete', 'hahaha', 'hohoho']
111
+ },
112
+ {
113
+ title: 'save',
114
+ action: () => {},
115
+ icon: 'save'
78
116
  }
79
- },
80
- {
81
- title: 'smile',
82
- action: () => {},
83
- select: ['', 'delete', 'hahaha', 'hohoho']
84
- },
85
- {
86
- title: 'save',
87
- action: () => {},
88
- icon: 'save'
89
- }
90
- ]}
91
- ></ox-page-action-context-bar>`
92
- }
93
- ]}
94
- .context=${{
95
- exportable: true,
96
- importable: true,
97
- toolbar: false
98
- }}
99
-
100
- }> </ox-context-page-toolbar>
117
+ ]}
118
+ ></ox-page-action-context-bar>`
119
+ }
120
+ ]}
121
+ .context=${{
122
+ exportable: true,
123
+ importable: true,
124
+ toolbar: false
125
+ }}
126
+ >
127
+ </ox-context-page-toolbar>
101
128
  </div>
102
129
  </div>
103
130
  `