@operato/context 2.0.0-alpha.99 → 2.0.0-beta.0

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 (67) hide show
  1. package/CHANGELOG.md +454 -0
  2. package/dist/src/layouts/ox-context-page-toolbar.js +15 -13
  3. package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
  4. package/dist/src/layouts/ox-context-toolbar.js +21 -25
  5. package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
  6. package/dist/src/tools/ox-page-action-context-bar.d.ts +3 -2
  7. package/dist/src/tools/ox-page-action-context-bar.js +74 -49
  8. package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
  9. package/dist/src/tools/ox-page-action-overlay-template.d.ts +1 -0
  10. package/dist/src/tools/ox-page-action-overlay-template.js +29 -21
  11. package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
  12. package/dist/src/tools/ox-page-title-bar.js +9 -8
  13. package/dist/src/tools/ox-page-title-bar.js.map +1 -1
  14. package/dist/src/tools/ox-title-bar.js +13 -12
  15. package/dist/src/tools/ox-title-bar.js.map +1 -1
  16. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +5 -0
  17. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +59 -30
  18. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -1
  19. package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +5 -0
  20. package/dist/stories/ox-context-page-toolbar-select.stories.js +60 -25
  21. package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -1
  22. package/dist/stories/ox-context-page-toolbar.stories.d.ts +5 -0
  23. package/dist/stories/ox-context-page-toolbar.stories.js +53 -26
  24. package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -1
  25. package/dist/stories/ox-context-toolbar-complex.stories.d.ts +7 -1
  26. package/dist/stories/ox-context-toolbar-complex.stories.js +31 -8
  27. package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -1
  28. package/dist/stories/ox-context-toolbar-cooldown.stories.d.ts +18 -0
  29. package/dist/stories/ox-context-toolbar-cooldown.stories.js +100 -0
  30. package/dist/stories/ox-context-toolbar-cooldown.stories.js.map +1 -0
  31. package/dist/stories/ox-context-toolbar-empty.stories.d.ts +7 -2
  32. package/dist/stories/ox-context-toolbar-empty.stories.js +32 -18
  33. package/dist/stories/ox-context-toolbar-empty.stories.js.map +1 -1
  34. package/dist/stories/ox-context-toolbar-overflow.stories.d.ts +7 -1
  35. package/dist/stories/ox-context-toolbar-overflow.stories.js +35 -9
  36. package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -1
  37. package/dist/stories/ox-context-toolbar.stories.d.ts +1 -0
  38. package/dist/stories/ox-context-toolbar.stories.js +32 -7
  39. package/dist/stories/ox-context-toolbar.stories.js.map +1 -1
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +8 -8
  42. package/src/layouts/ox-context-page-toolbar.ts +15 -13
  43. package/src/layouts/ox-context-toolbar.ts +21 -25
  44. package/src/tools/ox-page-action-context-bar.ts +76 -48
  45. package/src/tools/ox-page-action-overlay-template.ts +30 -22
  46. package/src/tools/ox-page-title-bar.ts +9 -8
  47. package/src/tools/ox-title-bar.ts +13 -12
  48. package/stories/ox-context-page-toolbar-select-buttons.stories.ts +122 -91
  49. package/stories/ox-context-page-toolbar-select.stories.ts +93 -57
  50. package/stories/ox-context-page-toolbar.stories.ts +92 -63
  51. package/stories/ox-context-toolbar-complex.stories.ts +34 -9
  52. package/stories/ox-context-toolbar-cooldown.stories.ts +112 -0
  53. package/stories/ox-context-toolbar-empty.stories.ts +36 -19
  54. package/stories/ox-context-toolbar-overflow.stories.ts +38 -10
  55. package/stories/ox-context-toolbar.stories.ts +35 -8
  56. package/themes/dark-hc.css +51 -0
  57. package/themes/dark-mc.css +51 -0
  58. package/themes/dark.css +51 -0
  59. package/themes/light-hc.css +51 -0
  60. package/themes/light-mc.css +51 -0
  61. package/themes/light.css +57 -0
  62. package/themes/md-typescale-styles.css +100 -0
  63. package/themes/spacing.css +13 -0
  64. package/themes/state-color.css +6 -0
  65. package/themes/app-theme.css +0 -161
  66. package/themes/context-theme.css +0 -74
  67. package/themes/material-theme.css +0 -88
@@ -1,18 +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'
5
+ import { sleep } from '@operato/utils'
6
6
 
7
7
  import '@operato/styles'
8
8
 
9
9
  import { css, html, render, TemplateResult } from 'lit'
10
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
10
11
 
11
12
  export default {
12
13
  title: 'ox-context-page-toolbar-select',
13
14
  component: 'ox-context-page-toolbar',
14
15
  argTypes: {
15
- label: { control: 'string' }
16
+ label: { control: 'string' },
17
+ theme: { control: 'select', options: ['light', 'dark'] }
16
18
  }
17
19
  }
18
20
 
@@ -24,71 +26,105 @@ interface Story<T> {
24
26
 
25
27
  interface ArgTypes {
26
28
  label?: string
29
+ theme?: string
27
30
  }
28
31
 
29
- const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
30
- <link href="/themes/app-theme.css" rel="stylesheet" />
31
- <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" />
32
34
 
33
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
34
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
35
- <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
+ />
36
51
 
37
52
  <style>
38
- body {
39
- 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;
40
65
  }
41
66
 
42
- ${CommonHeaderStyles.cssText}
67
+ ox-buttons-radio {
68
+ padding: 20px;
69
+ }
43
70
  </style>
44
71
 
45
- <div style="height:600px;">
72
+ <script>
73
+ document.body.classList.add('${theme}')
74
+ </script>
75
+
76
+ <div class="container md-typescale-body-large-prominent">
46
77
  <div class="header">
47
- <div class="title">
48
- ${label}
49
- </div>
50
-
51
- <div class="filters">
52
- <label>Filter</label><input type="text"></input>
53
- </div>
54
-
55
- <ox-context-page-toolbar class="actions"
56
- .tools=${[
57
- {
58
- position: TOOL_POSITION.FRONT,
59
- template: html` <md-icon>download</md-icon> `,
60
- context: 'exportable'
61
- },
62
- {
63
- position: TOOL_POSITION.FRONT,
64
- template: html` <md-icon>upload</md-icon> `,
65
- context: 'importable'
66
- },
67
- {
68
- position: TOOL_POSITION.CENTER,
69
- template: html`<ox-page-action-context-bar
70
- .actions=${[
71
- {
72
- title: 'smile',
73
- action: () => {},
74
- select: ['', 'delete', 'hahaha', 'hohoho']
75
- },
76
- {
77
- title: 'save',
78
- action: () => {},
79
- icon: 'save'
80
- }
81
- ]}
82
- ></ox-page-action-context-bar>`
83
- }
84
- ]}
85
- .context=${{
86
- exportable: true,
87
- importable: true,
88
- toolbar: false
89
- }}
90
-
91
- }> </ox-context-page-toolbar>
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'
116
+ }
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>
92
128
  </div>
93
129
  </div>
94
130
  `
@@ -7,12 +7,14 @@ import { TOOL_POSITION } from '@operato/layout'
7
7
  import '@operato/styles'
8
8
 
9
9
  import { css, html, render, TemplateResult } from 'lit'
10
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
10
11
 
11
12
  export default {
12
13
  title: 'ox-context-page-toolbar',
13
14
  component: 'ox-context-page-toolbar',
14
15
  argTypes: {
15
- label: { control: 'string' }
16
+ label: { control: 'string' },
17
+ theme: { control: 'select', options: ['light', 'dark'] }
16
18
  }
17
19
  }
18
20
 
@@ -24,79 +26,106 @@ interface Story<T> {
24
26
 
25
27
  interface ArgTypes {
26
28
  label?: string
29
+ theme?: string
27
30
  }
28
31
 
29
- const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
30
- <link href="/themes/app-theme.css" rel="stylesheet" />
31
- <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" />
34
+
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
+ />
51
+
52
+ <style>
53
+ ${MDTypeScaleStyles.cssText}
54
+ </style>
32
55
 
33
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
34
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
35
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
36
-
37
56
  <style>
38
- body {
39
- background-color: white;
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;
40
65
  }
41
66
 
42
- ${CommonHeaderStyles.cssText}
67
+ ox-buttons-radio {
68
+ padding: 20px;
69
+ }
43
70
  </style>
44
71
 
45
- <div style="height:600px;">
72
+ <script>
73
+ document.body.classList.add('${theme}')
74
+ </script>
75
+
76
+ <div class="container md-typescale-body-large-prominent">
46
77
  <div class="header">
47
- <div class="title">
48
- ${label}
49
- </div>
50
-
51
- <div class="filters">
52
- <label>Filter</label><input type="text"></input>
53
- </div>
54
-
55
- <ox-context-page-toolbar class="actions"
56
- .tools=${[
57
- {
58
- position: TOOL_POSITION.FRONT,
59
- template: html` <md-icon>download</md-icon> `,
60
- context: 'exportable'
61
- },
62
- {
63
- position: TOOL_POSITION.FRONT,
64
- template: html` <md-icon>upload</md-icon> `,
65
- context: 'importable'
66
- },
67
- {
68
- position: TOOL_POSITION.CENTER,
69
- template: html`<ox-page-action-context-bar
70
- .actions=${[
71
- {
72
- title: 'save',
73
- action: () => {},
74
- icon: 'save'
75
- },
76
- {
77
- title: 'copy',
78
- action: () => {},
79
- icon: 'content_copy'
80
- },
81
- {
82
- title: 'delete',
83
- action: () => {},
84
- icon: 'delete',
85
- emphasis: {
86
- danger: true
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
+ title: 'save',
101
+ action: () => {},
102
+ icon: 'save'
103
+ },
104
+ {
105
+ title: 'copy',
106
+ action: () => {},
107
+ icon: 'content_copy'
108
+ },
109
+ {
110
+ title: 'delete',
111
+ action: () => {},
112
+ icon: 'delete',
113
+ emphasis: {
114
+ danger: true
115
+ }
87
116
  }
88
- }
89
- ]}
90
- ></ox-page-action-context-bar>`
117
+ ]}
118
+ ></ox-page-action-context-bar>`
119
+ }
120
+ ]}
121
+ .context=${{
122
+ exportable: true,
123
+ importable: true,
124
+ toolbar: false
125
+ }}
91
126
  }
92
- ]}
93
- .context=${{
94
- exportable: true,
95
- importable: true,
96
- toolbar: false
97
- }}
98
-
99
- }> </ox-context-page-toolbar>
127
+ >
128
+ </ox-context-page-toolbar>
100
129
  </div>
101
130
  </div>
102
131
  `
@@ -6,11 +6,14 @@ import { TOOL_POSITION } from '@operato/layout'
6
6
  import '@operato/styles'
7
7
 
8
8
  import { css, html, render, TemplateResult } from 'lit'
9
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
9
10
 
10
11
  export default {
11
12
  title: 'ox-context-toolbar complex',
12
13
  component: 'ox-context-toolbar',
13
- argTypes: {}
14
+ argTypes: {
15
+ theme: { control: 'select', options: ['light', 'dark'] }
16
+ }
14
17
  }
15
18
 
16
19
  interface Story<T> {
@@ -19,12 +22,16 @@ interface Story<T> {
19
22
  argTypes?: Record<string, unknown>
20
23
  }
21
24
 
22
- interface ArgTypes {}
25
+ interface ArgTypes {
26
+ theme?: string
27
+ }
28
+
29
+ const Template: Story<ArgTypes> = ({ theme = 'light' }: ArgTypes) => html`
30
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
23
31
 
24
- const Template: Story<ArgTypes> = () => html`
25
- <link href="/themes/app-theme.css" rel="stylesheet" />
26
- <link href="/themes/material-theme.css" rel="stylesheet" />
27
- <link href="/themes/context-theme.css" rel="stylesheet" />
32
+ <link href="/themes/light.css" rel="stylesheet" />
33
+ <link href="/themes/dark.css" rel="stylesheet" />
34
+ <link href="/themes/spacing.css" rel="stylesheet" />
28
35
 
29
36
  <link
30
37
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
@@ -40,12 +47,30 @@ const Template: Story<ArgTypes> = () => html`
40
47
  />
41
48
 
42
49
  <style>
43
- body {
44
- background-color: white;
50
+ ${MDTypeScaleStyles.cssText}
51
+ </style>
52
+
53
+ <style>
54
+ .container {
55
+ height: 500px;
56
+ text-align: center;
57
+ padding: 20px;
58
+ background-color: var(--md-sys-color-primary-container);
59
+ color: var(--md-sys-color-on-primary-container);
60
+
61
+ padding: 20px;
62
+ }
63
+
64
+ ox-buttons-radio {
65
+ padding: 20px;
45
66
  }
46
67
  </style>
47
68
 
48
- <div style="height:100px; padding: 10px; background-color: black;">
69
+ <script>
70
+ document.body.classList.add('${theme}')
71
+ </script>
72
+
73
+ <div class="container md-typescale-body-large-prominent">
49
74
  <ox-context-toolbar
50
75
  .tools=${[
51
76
  {
@@ -0,0 +1,112 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '../src/layouts/ox-context-toolbar.js'
3
+ import '../src/tools/ox-page-action-context-bar.js'
4
+ import { TOOL_POSITION } from '@operato/layout'
5
+
6
+ import { sleep } from '@operato/utils'
7
+
8
+ import { css, html, render, TemplateResult } from 'lit'
9
+
10
+ export default {
11
+ title: 'ox-context-toolbar empty',
12
+ component: 'ox-context-toolbar',
13
+ argTypes: {}
14
+ }
15
+
16
+ interface Story<T> {
17
+ (args: T): TemplateResult
18
+ args?: Partial<T>
19
+ argTypes?: Record<string, unknown>
20
+ }
21
+
22
+ interface ArgTypes {}
23
+
24
+ const Template: Story<ArgTypes> = () => html`
25
+ <link href="/themes/app-theme.css" rel="stylesheet" />
26
+ <link href="/themes/material-theme.css" rel="stylesheet" />
27
+ <link href="/themes/context-theme.css" rel="stylesheet" />
28
+
29
+ <link
30
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
+ rel="stylesheet"
32
+ />
33
+ <link
34
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
+ rel="stylesheet"
36
+ />
37
+ <link
38
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
+ rel="stylesheet"
40
+ />
41
+
42
+ <style>
43
+ body {
44
+ background-color: var(--md-sys-color-surface);
45
+ }
46
+ </style>
47
+
48
+ <div style="display: flex; flex-direction: column; gap: 10px; padding: 10px; background-color: black;">
49
+ <ox-context-toolbar
50
+ .tools=${[]}
51
+ .context=${{
52
+ exportable: true,
53
+ importable: true,
54
+ toolbar: true
55
+ }}
56
+ >
57
+ </ox-context-toolbar>
58
+
59
+ <ox-context-toolbar
60
+ .tools=${[
61
+ {
62
+ position: TOOL_POSITION.CENTER,
63
+ template: html`<ox-page-action-context-bar .actions=${[]}></ox-page-action-context-bar>`
64
+ }
65
+ ]}
66
+ .context=${{
67
+ exportable: true,
68
+ importable: true,
69
+ toolbar: true
70
+ }}
71
+ >
72
+ </ox-context-toolbar>
73
+
74
+ <ox-context-toolbar
75
+ .tools=${[
76
+ {
77
+ position: TOOL_POSITION.CENTER,
78
+ template: html`<ox-page-action-context-bar
79
+ .actions=${[
80
+ {
81
+ type: 'icon',
82
+ action: async () => {},
83
+ icon: 'check'
84
+ },
85
+ {
86
+ title: 'short-take(0secs)',
87
+ action: async () => {},
88
+ icon: 'delete'
89
+ },
90
+ {
91
+ title: 'long-take(3secs)',
92
+ action: async () => {
93
+ await sleep(3000)
94
+ },
95
+ icon: 'save'
96
+ }
97
+ ]}
98
+ ></ox-page-action-context-bar>`
99
+ }
100
+ ]}
101
+ .context=${{
102
+ exportable: true,
103
+ importable: true,
104
+ toolbar: true
105
+ }}
106
+ >
107
+ </ox-context-toolbar>
108
+ </div>
109
+ `
110
+
111
+ export const Regular = Template.bind({})
112
+ Regular.args = {}
@@ -3,14 +3,17 @@ import '../src/layouts/ox-context-toolbar.js'
3
3
  import '../src/tools/ox-page-action-context-bar.js'
4
4
  import { TOOL_POSITION } from '@operato/layout'
5
5
 
6
- import '@operato/styles'
6
+ import { sleep } from '@operato/utils'
7
7
 
8
8
  import { css, html, render, TemplateResult } from 'lit'
9
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
9
10
 
10
11
  export default {
11
12
  title: 'ox-context-toolbar empty',
12
13
  component: 'ox-context-toolbar',
13
- argTypes: {}
14
+ argTypes: {
15
+ theme: { control: 'select', options: ['light', 'dark'] }
16
+ }
14
17
  }
15
18
 
16
19
  interface Story<T> {
@@ -19,12 +22,16 @@ interface Story<T> {
19
22
  argTypes?: Record<string, unknown>
20
23
  }
21
24
 
22
- interface ArgTypes {}
25
+ interface ArgTypes {
26
+ theme?: string
27
+ }
28
+
29
+ const Template: Story<ArgTypes> = ({ theme = 'light' }: ArgTypes) => html`
30
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
23
31
 
24
- const Template: Story<ArgTypes> = () => html`
25
- <link href="/themes/app-theme.css" rel="stylesheet" />
26
- <link href="/themes/material-theme.css" rel="stylesheet" />
27
- <link href="/themes/context-theme.css" rel="stylesheet" />
32
+ <link href="/themes/light.css" rel="stylesheet" />
33
+ <link href="/themes/dark.css" rel="stylesheet" />
34
+ <link href="/themes/spacing.css" rel="stylesheet" />
28
35
 
29
36
  <link
30
37
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
@@ -40,12 +47,30 @@ const Template: Story<ArgTypes> = () => html`
40
47
  />
41
48
 
42
49
  <style>
43
- body {
44
- background-color: white;
50
+ ${MDTypeScaleStyles.cssText}
51
+ </style>
52
+
53
+ <style>
54
+ .container {
55
+ height: 500px;
56
+ text-align: center;
57
+ padding: 20px;
58
+ background-color: var(--md-sys-color-primary-container);
59
+ color: var(--md-sys-color-on-primary-container);
60
+
61
+ padding: 20px;
62
+ }
63
+
64
+ ox-buttons-radio {
65
+ padding: 20px;
45
66
  }
46
67
  </style>
47
68
 
48
- <div style="display: flex; flex-direction: column; gap: 10px; padding: 10px; background-color: black;">
69
+ <script>
70
+ document.body.classList.add('${theme}')
71
+ </script>
72
+
73
+ <div class="container md-typescale-body-large-prominent">
49
74
  <ox-context-toolbar
50
75
  .tools=${[]}
51
76
  .context=${{
@@ -75,15 +100,7 @@ const Template: Story<ArgTypes> = () => html`
75
100
  .tools=${[
76
101
  {
77
102
  position: TOOL_POSITION.CENTER,
78
- template: html`<ox-page-action-context-bar
79
- .actions=${[
80
- {
81
- title: 'save',
82
- action: () => {},
83
- icon: 'save'
84
- }
85
- ]}
86
- ></ox-page-action-context-bar>`
103
+ template: html`<ox-page-action-context-bar .actions=${[]}></ox-page-action-context-bar>`
87
104
  }
88
105
  ]}
89
106
  .context=${{