@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.
- package/CHANGELOG.md +454 -0
- package/dist/src/layouts/ox-context-page-toolbar.js +15 -13
- package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
- package/dist/src/layouts/ox-context-toolbar.js +21 -25
- package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
- package/dist/src/tools/ox-page-action-context-bar.d.ts +3 -2
- package/dist/src/tools/ox-page-action-context-bar.js +74 -49
- package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
- package/dist/src/tools/ox-page-action-overlay-template.d.ts +1 -0
- package/dist/src/tools/ox-page-action-overlay-template.js +29 -21
- package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
- package/dist/src/tools/ox-page-title-bar.js +9 -8
- package/dist/src/tools/ox-page-title-bar.js.map +1 -1
- package/dist/src/tools/ox-title-bar.js +13 -12
- package/dist/src/tools/ox-title-bar.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +5 -0
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +59 -30
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +5 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.js +60 -25
- package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar.stories.d.ts +5 -0
- package/dist/stories/ox-context-page-toolbar.stories.js +53 -26
- package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -1
- package/dist/stories/ox-context-toolbar-complex.stories.d.ts +7 -1
- package/dist/stories/ox-context-toolbar-complex.stories.js +31 -8
- package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -1
- package/dist/stories/ox-context-toolbar-cooldown.stories.d.ts +18 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.js +100 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar-empty.stories.d.ts +7 -2
- package/dist/stories/ox-context-toolbar-empty.stories.js +32 -18
- package/dist/stories/ox-context-toolbar-empty.stories.js.map +1 -1
- package/dist/stories/ox-context-toolbar-overflow.stories.d.ts +7 -1
- package/dist/stories/ox-context-toolbar-overflow.stories.js +35 -9
- package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -1
- package/dist/stories/ox-context-toolbar.stories.d.ts +1 -0
- package/dist/stories/ox-context-toolbar.stories.js +32 -7
- package/dist/stories/ox-context-toolbar.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/layouts/ox-context-page-toolbar.ts +15 -13
- package/src/layouts/ox-context-toolbar.ts +21 -25
- package/src/tools/ox-page-action-context-bar.ts +76 -48
- package/src/tools/ox-page-action-overlay-template.ts +30 -22
- package/src/tools/ox-page-title-bar.ts +9 -8
- package/src/tools/ox-title-bar.ts +13 -12
- package/stories/ox-context-page-toolbar-select-buttons.stories.ts +122 -91
- package/stories/ox-context-page-toolbar-select.stories.ts +93 -57
- package/stories/ox-context-page-toolbar.stories.ts +92 -63
- package/stories/ox-context-toolbar-complex.stories.ts +34 -9
- package/stories/ox-context-toolbar-cooldown.stories.ts +112 -0
- package/stories/ox-context-toolbar-empty.stories.ts +36 -19
- package/stories/ox-context-toolbar-overflow.stories.ts +38 -10
- package/stories/ox-context-toolbar.stories.ts +35 -8
- package/themes/dark-hc.css +51 -0
- package/themes/dark-mc.css +51 -0
- package/themes/dark.css +51 -0
- package/themes/light-hc.css +51 -0
- package/themes/light-mc.css +51 -0
- package/themes/light.css +57 -0
- package/themes/md-typescale-styles.css +100 -0
- package/themes/spacing.css +13 -0
- package/themes/state-color.css +6 -0
- package/themes/app-theme.css +0 -161
- package/themes/context-theme.css +0 -74
- 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="/
|
|
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="
|
|
34
|
-
<link href="
|
|
35
|
-
<link href="
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
67
|
+
ox-buttons-radio {
|
|
68
|
+
padding: 20px;
|
|
69
|
+
}
|
|
43
70
|
</style>
|
|
44
71
|
|
|
45
|
-
<
|
|
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
|
-
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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="/
|
|
31
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
67
|
+
ox-buttons-radio {
|
|
68
|
+
padding: 20px;
|
|
69
|
+
}
|
|
43
70
|
</style>
|
|
44
71
|
|
|
45
|
-
<
|
|
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
|
-
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
-
<link href="/themes/
|
|
26
|
-
<link href="/themes/
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
<
|
|
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/
|
|
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
|
-
|
|
25
|
-
<link href="/themes/
|
|
26
|
-
<link href="/themes/
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
<
|
|
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=${{
|