@operato/popup 1.0.0-beta.39 → 1.0.0-beta.41
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 +17 -0
- package/assets/images/no-image.png +0 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.js +5 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/open-popup.d.ts +59 -0
- package/dist/src/open-popup.js +84 -0
- package/dist/src/open-popup.js.map +1 -0
- package/dist/src/ox-floating-overlay.d.ts +21 -0
- package/dist/src/ox-floating-overlay.js +349 -0
- package/dist/src/ox-floating-overlay.js.map +1 -0
- package/dist/src/ox-popup.js +4 -2
- package/dist/src/ox-popup.js.map +1 -1
- package/dist/stories/open-popup.stories.d.ts +46 -0
- package/dist/stories/open-popup.stories.js +51 -0
- package/dist/stories/open-popup.stories.js.map +1 -0
- package/dist/stories/ox-popup-list.stories.d.ts +18 -0
- package/dist/stories/ox-popup-list.stories.js +50 -0
- package/dist/stories/ox-popup-list.stories.js.map +1 -0
- package/dist/stories/ox-popup-menu.stories.d.ts +19 -0
- package/dist/stories/ox-popup-menu.stories.js +131 -0
- package/dist/stories/ox-popup-menu.stories.js.map +1 -0
- package/dist/stories/ox-popup.stories.d.ts +15 -0
- package/dist/stories/ox-popup.stories.js +32 -0
- package/dist/stories/ox-popup.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/src/index.ts +6 -4
- package/src/open-popup.ts +140 -0
- package/src/ox-floating-overlay.ts +330 -0
- package/src/ox-popup.ts +4 -2
- package/stories/open-popup.stories.ts +81 -0
- package/stories/ox-popup-list.stories.ts +65 -0
- package/stories/ox-popup-menu.stories.ts +145 -0
- package/stories/ox-popup.stories.ts +46 -0
- package/themes/app-theme.css +142 -0
- package/themes/input-theme.css +19 -0
- package/dist/stories/index.stories.d.ts +0 -33
- package/dist/stories/index.stories.js +0 -33
- package/dist/stories/index.stories.js.map +0 -1
- package/stories/index.stories.ts +0 -52
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import '../src/ox-popup-menu.js'
|
|
2
|
+
import '../src/ox-popup-menuitem.js'
|
|
3
|
+
import '@material/mwc-icon'
|
|
4
|
+
import '@operato/input/ox-checkbox.js'
|
|
5
|
+
|
|
6
|
+
import { html, TemplateResult } from 'lit'
|
|
7
|
+
|
|
8
|
+
import { OxPopupMenu } from '../src/ox-popup-menu.js'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'OxPopuMenu',
|
|
12
|
+
component: 'ox-popup-menu',
|
|
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
|
+
function popup(e: MouseEvent) {
|
|
25
|
+
OxPopupMenu.open({
|
|
26
|
+
template: html`
|
|
27
|
+
<ox-popup-menuitem
|
|
28
|
+
label="article - click me"
|
|
29
|
+
@selected=${function (e: Event) {
|
|
30
|
+
console.log('first level article selected')
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<mwc-icon slot="icon">article</mwc-icon>
|
|
34
|
+
</ox-popup-menuitem>
|
|
35
|
+
|
|
36
|
+
<ox-popup-menuitem label="home">
|
|
37
|
+
<mwc-icon slot="icon">home</mwc-icon>
|
|
38
|
+
</ox-popup-menuitem>
|
|
39
|
+
|
|
40
|
+
<ox-popup-menuitem label="empty"> </ox-popup-menuitem>
|
|
41
|
+
|
|
42
|
+
<ox-popup-menuitem
|
|
43
|
+
label="click me to toggle"
|
|
44
|
+
@selected=${function (e: Event) {
|
|
45
|
+
const icon = (e.target as HTMLElement).querySelector('mwc-icon')
|
|
46
|
+
icon && (icon.innerHTML = icon.innerHTML == 'check' ? '' : 'check')
|
|
47
|
+
}}
|
|
48
|
+
alive-on-select
|
|
49
|
+
>
|
|
50
|
+
<mwc-icon slot="icon" style="width: 20px;height: 20px;"></mwc-icon>
|
|
51
|
+
</ox-popup-menuitem>
|
|
52
|
+
|
|
53
|
+
<ox-popup-menuitem label="verified" @selected=${(e: Event) => console.log('selected verified')}>
|
|
54
|
+
<mwc-icon slot="icon">verified</mwc-icon>
|
|
55
|
+
<ox-popup-menu>
|
|
56
|
+
<ox-popup-menuitem
|
|
57
|
+
label="article"
|
|
58
|
+
@selected=${function (e: Event) {
|
|
59
|
+
console.log('article selected')
|
|
60
|
+
}}
|
|
61
|
+
alive-on-select
|
|
62
|
+
>
|
|
63
|
+
<mwc-icon slot="icon">article</mwc-icon>
|
|
64
|
+
</ox-popup-menuitem>
|
|
65
|
+
|
|
66
|
+
<ox-popup-menuitem label="home">
|
|
67
|
+
<mwc-icon slot="icon">home</mwc-icon>
|
|
68
|
+
</ox-popup-menuitem>
|
|
69
|
+
|
|
70
|
+
<ox-popup-menuitem label="verified">
|
|
71
|
+
<mwc-icon slot="icon">verified</mwc-icon>
|
|
72
|
+
<ox-popup-menu>
|
|
73
|
+
<ox-popup-menuitem label="article">
|
|
74
|
+
<mwc-icon slot="icon">article</mwc-icon>
|
|
75
|
+
</ox-popup-menuitem>
|
|
76
|
+
|
|
77
|
+
<ox-popup-menuitem label="home">
|
|
78
|
+
<mwc-icon slot="icon">home</mwc-icon>
|
|
79
|
+
</ox-popup-menuitem>
|
|
80
|
+
|
|
81
|
+
<ox-popup-menuitem label="verified">
|
|
82
|
+
<mwc-icon slot="icon">verified</mwc-icon>
|
|
83
|
+
</ox-popup-menuitem>
|
|
84
|
+
|
|
85
|
+
<ox-popup-menuitem label="checkbox">
|
|
86
|
+
<input type="checkbox" slot="icon" />
|
|
87
|
+
</ox-popup-menuitem>
|
|
88
|
+
|
|
89
|
+
<div separator></div>
|
|
90
|
+
</ox-popup-menu>
|
|
91
|
+
</ox-popup-menuitem>
|
|
92
|
+
|
|
93
|
+
<div separator></div>
|
|
94
|
+
|
|
95
|
+
<ox-popup-menuitem label="checkbox">
|
|
96
|
+
<input type="checkbox" slot="icon" />
|
|
97
|
+
</ox-popup-menuitem>
|
|
98
|
+
</ox-popup-menu>
|
|
99
|
+
</ox-popup-menuitem>
|
|
100
|
+
|
|
101
|
+
<ox-popup-menuitem label="checkbox in icon area" alive-on-select>
|
|
102
|
+
<input type="checkbox" slot="icon" />
|
|
103
|
+
</ox-popup-menuitem>
|
|
104
|
+
|
|
105
|
+
<div separator></div>
|
|
106
|
+
|
|
107
|
+
<div menu>Plain Text</div>
|
|
108
|
+
|
|
109
|
+
<div menu alive-on-select>
|
|
110
|
+
<ox-checkbox label="checkbox" slot="icon" checked />checkbox</ox-checkbox>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div menu alive-on-select>
|
|
114
|
+
<input id="checkbox-01" type="checkbox" />
|
|
115
|
+
<label for="checkbox-01">custom menu</label>
|
|
116
|
+
</div>
|
|
117
|
+
<div menu alive-on-select>
|
|
118
|
+
<label for="text-01">value</label>
|
|
119
|
+
<input id="text-01" type="text" value="Plain text input" />
|
|
120
|
+
</div>
|
|
121
|
+
`,
|
|
122
|
+
top: e.pageY,
|
|
123
|
+
left: e.pageX,
|
|
124
|
+
parent: e.target as HTMLElement
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
|
129
|
+
html`
|
|
130
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
131
|
+
<style>
|
|
132
|
+
#place {
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 500px;
|
|
135
|
+
background: lightgreen;
|
|
136
|
+
text-align: center;
|
|
137
|
+
line-height: 500px;
|
|
138
|
+
}
|
|
139
|
+
</style>
|
|
140
|
+
|
|
141
|
+
<div id="place" @click=${(e: MouseEvent) => popup(e)}>Click this to popup menu</div>
|
|
142
|
+
`
|
|
143
|
+
|
|
144
|
+
export const Regular = Template.bind({})
|
|
145
|
+
Regular.args = {}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { html, TemplateResult } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { OxPopup } from '../src/ox-popup'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'ContextMenu',
|
|
7
|
+
component: 'ox-popup',
|
|
8
|
+
argTypes: {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Story<T> {
|
|
12
|
+
(args: T): TemplateResult
|
|
13
|
+
args?: Partial<T>
|
|
14
|
+
argTypes?: Record<string, unknown>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ArgTypes {}
|
|
18
|
+
|
|
19
|
+
function popup(e: MouseEvent) {
|
|
20
|
+
const noImage = new URL('/assets/images/no-image.png', import.meta.url).href
|
|
21
|
+
|
|
22
|
+
OxPopup.open({
|
|
23
|
+
template: html`<img src=${noImage} />`,
|
|
24
|
+
top: e.pageY,
|
|
25
|
+
left: e.pageX,
|
|
26
|
+
parent: e.target as HTMLElement
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) =>
|
|
31
|
+
html`
|
|
32
|
+
<style>
|
|
33
|
+
#place {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 500px;
|
|
36
|
+
background: lightgreen;
|
|
37
|
+
text-align: center;
|
|
38
|
+
line-height: 500px;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
|
|
42
|
+
<div id="place" @click=${(e: MouseEvent) => popup(e)}>Click this to popup image</div>
|
|
43
|
+
`
|
|
44
|
+
|
|
45
|
+
export const Regular = Template.bind({})
|
|
46
|
+
Regular.args = {}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
body {
|
|
2
|
+
/* theme color */
|
|
3
|
+
--primary-color-rgb: 56, 162, 91;
|
|
4
|
+
--primary-color: rgb(var(--primary-color-rgb));
|
|
5
|
+
--secondary-color-rgb: 71, 97, 114;
|
|
6
|
+
--secondary-color: rgb(var(--secondary-color-rgb));
|
|
7
|
+
--focus-color: var(--theme-white-color);
|
|
8
|
+
--primary-background-color: var(--secondary-color);
|
|
9
|
+
--secondary-background-color: #183936;
|
|
10
|
+
--main-section-background-color: #f7f6f4;
|
|
11
|
+
--theme-white-color: #fff;
|
|
12
|
+
--theme-black-color: rgba(0, 0, 0, 0.9);
|
|
13
|
+
|
|
14
|
+
--focus-background-color: var(--primary-color);
|
|
15
|
+
--primary-text-color: var(--theme-black-color);
|
|
16
|
+
--secondary-text-color: #218f62;
|
|
17
|
+
|
|
18
|
+
--opacity-dark-color: rgba(0, 0, 0, 0.4);
|
|
19
|
+
--opacity-light-color: rgba(255, 255, 255, 0.8);
|
|
20
|
+
|
|
21
|
+
/* status color */
|
|
22
|
+
--status-success-color: #35a24a;
|
|
23
|
+
--status-warning-color: #ee8d03;
|
|
24
|
+
--status-danger-color: #d14946;
|
|
25
|
+
--status-info-color: #398ace;
|
|
26
|
+
|
|
27
|
+
/* common style */
|
|
28
|
+
--border-radius: 4px;
|
|
29
|
+
--border-dark-color: 1px solid rgba(0, 0, 0, 0.15);
|
|
30
|
+
--border-light-color: 1px solid rgba(255, 255, 255, 0.3);
|
|
31
|
+
|
|
32
|
+
--box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.1);
|
|
33
|
+
|
|
34
|
+
--theme-font: 'Noto', Helvetica;
|
|
35
|
+
|
|
36
|
+
--margin-default: 9px;
|
|
37
|
+
--margin-narrow: 4px;
|
|
38
|
+
--margin-wide: 15px;
|
|
39
|
+
--padding-default: var(--margin-default);
|
|
40
|
+
--padding-narrow: var(--margin-narrow);
|
|
41
|
+
--padding-wide: var(--margin-wide);
|
|
42
|
+
|
|
43
|
+
--scrollbar-thumb-color: rgba(57, 78, 100, 0.5);
|
|
44
|
+
--scrollbar-thumb-hover-color: var(--primary-color);
|
|
45
|
+
|
|
46
|
+
--fontsize-default: 14px;
|
|
47
|
+
--fontsize-small: 13px;
|
|
48
|
+
--fontsize-large: 16px;
|
|
49
|
+
|
|
50
|
+
/* app layout style */
|
|
51
|
+
--app-grid-template-area: 'header header header' 'nav main aside' 'nav footer aside';
|
|
52
|
+
|
|
53
|
+
/* title & description style */
|
|
54
|
+
--title-margin: var(--margin-narrow) 0;
|
|
55
|
+
--title-font: bold 24px var(--theme-font);
|
|
56
|
+
--title-text-color: var(--secondary-color);
|
|
57
|
+
--title-font-mobile: bold 20px var(--theme-font);
|
|
58
|
+
|
|
59
|
+
--page-description-margin: var(--margin-narrow) 0 var(--margin-wide) 0;
|
|
60
|
+
--page-description-font: normal var(--fontsize-default) / 1.2rem var(--theme-font);
|
|
61
|
+
--page-description-color: var(--secondary-text-color);
|
|
62
|
+
|
|
63
|
+
--subtitle-padding: 12px 5px 3px 5px;
|
|
64
|
+
--subtitle-font: bold 18px var(--theme-font);
|
|
65
|
+
--subtitle-text-color: var(--primary-color);
|
|
66
|
+
--subtitle-border-bottom: 1px solid var(--primary-color);
|
|
67
|
+
|
|
68
|
+
/* icon style */
|
|
69
|
+
--icon-tiny-size: 24px;
|
|
70
|
+
--icon-default-size: 36px;
|
|
71
|
+
--icon-big-size: 48px;
|
|
72
|
+
--icon-default-color: var(--theme-white-color);
|
|
73
|
+
|
|
74
|
+
/* material design component themes */
|
|
75
|
+
--mdc-theme-on-primary: var(--theme-white-color);
|
|
76
|
+
--mdc-theme-primary: var(--secondary-text-color);
|
|
77
|
+
--mdc-theme-on-secondary: var(--theme-white-color);
|
|
78
|
+
--mdc-theme-secondary: var(--primary-color);
|
|
79
|
+
--mdc-button-outline-color: var(--primary-color);
|
|
80
|
+
--mdc-danger-button-primary-color: var(--status-danger-color);
|
|
81
|
+
--mdc-danger-button-outline-color: var(--status-danger-color);
|
|
82
|
+
--mdc-button-outline-width: 1px;
|
|
83
|
+
--mdc-button-horizontal-padding: 16px;
|
|
84
|
+
|
|
85
|
+
/* button style */
|
|
86
|
+
--button-background-color: #fafbfc;
|
|
87
|
+
--button-background-focus-color: var(--primary-color);
|
|
88
|
+
--button-border: var(--border-dark-color);
|
|
89
|
+
--button-border-radius: var(--border-radius);
|
|
90
|
+
--button-margin: var(--margin-default) var(--margin-default) var(--margin-default) 0;
|
|
91
|
+
--button-padding: var(--padding-default);
|
|
92
|
+
--button-color: var(--secondary-color);
|
|
93
|
+
--button-font: normal 15px var(--theme-font);
|
|
94
|
+
--button-text-transform: capitalize;
|
|
95
|
+
--button-active-box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.2);
|
|
96
|
+
--button-activ-border: 1px solid var(--primary-color);
|
|
97
|
+
|
|
98
|
+
--button-primary-background-color: var(--primary-color);
|
|
99
|
+
--button-primary-active-background-color: var(--status-success-color);
|
|
100
|
+
--button-primary-padding: var(--margin-default) var(--margin-wide);
|
|
101
|
+
--button-primary-color: var(--theme-white-color);
|
|
102
|
+
--button-primary-font: bold 16px var(--theme-font);
|
|
103
|
+
|
|
104
|
+
/* table style */
|
|
105
|
+
--th-padding: var(--padding-default) 0 var(--padding-default) var(--padding-default);
|
|
106
|
+
--th-border-top: 2px solid var(--secondary-color);
|
|
107
|
+
--th-text-transform: capitalize;
|
|
108
|
+
--th-font: bold var(--fontsize-small) var(--theme-font);
|
|
109
|
+
--th-color: rgba(var(--secondary-color-rgb), 0.8);
|
|
110
|
+
|
|
111
|
+
--tr-background-color: var(--theme-white-color);
|
|
112
|
+
--tr-background-odd-color: rgba(255, 255, 255, 0.4);
|
|
113
|
+
--tr-background-hover-color: #e1f5fe;
|
|
114
|
+
--td-border-bottom: 1px solid rgba(0, 0, 0, 0.09);
|
|
115
|
+
--td-padding: var(--padding-default);
|
|
116
|
+
--td-font: normal 13px var(--theme-font);
|
|
117
|
+
--td-color: var(--secondary-color);
|
|
118
|
+
|
|
119
|
+
/* form style */
|
|
120
|
+
--label-font: normal var(--fontsize-default) var(--theme-font);
|
|
121
|
+
--label-color: var(--secondary-color);
|
|
122
|
+
--label-text-transform: capitalize;
|
|
123
|
+
--input-margin: var(--margin-narrow) 0;
|
|
124
|
+
--input-padding: var(--padding-default);
|
|
125
|
+
--input-min-width: 200px;
|
|
126
|
+
--input-font: normal var(--fontsize-default) var(--theme-font);
|
|
127
|
+
--input-hint-font: normal var(--fontsize-small) var(--theme-font);
|
|
128
|
+
--input-hint-color: #666;
|
|
129
|
+
--input-container-max-width: 900px;
|
|
130
|
+
--fieldset-margin: var(--padding-wide) 0;
|
|
131
|
+
--fieldset-padding: 0 var(--padding-wide) var(--padding-wide) var(--padding-wide);
|
|
132
|
+
--legend-padding: var(--padding-default) 0;
|
|
133
|
+
--legend-color: var(--secondary-text-color);
|
|
134
|
+
--legend-font: bold 16px var(--theme-font);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media only screen and (max-width: 460px) {
|
|
138
|
+
body {
|
|
139
|
+
/* subtitle style */
|
|
140
|
+
--subtitle-margin: 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
body {
|
|
2
|
+
--ox-input-border: 1px solid rgba(0, 0, 0, 0.1);
|
|
3
|
+
--ox-input-border-radius: var(--border-radius);
|
|
4
|
+
--ox-input-padding: var(--input-padding);
|
|
5
|
+
--ox-input-font: normal 15px var(--theme-font);
|
|
6
|
+
--ox-input-color: var(--secondary-color);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media screen and (max-width: 480px) {
|
|
10
|
+
body {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (min-width: 481px) and (max-width: 1024px) {
|
|
15
|
+
body {
|
|
16
|
+
--ox-input-font: normal 16px var(--theme-font);
|
|
17
|
+
--ox-input-padding: 4px 5px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import '../src/ox-popup';
|
|
2
|
-
import { TemplateResult } from 'lit';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: string;
|
|
6
|
-
argTypes: {
|
|
7
|
-
title: {
|
|
8
|
-
control: string;
|
|
9
|
-
};
|
|
10
|
-
counter: {
|
|
11
|
-
control: string;
|
|
12
|
-
};
|
|
13
|
-
textColor: {
|
|
14
|
-
control: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
19
|
-
interface Story<T> {
|
|
20
|
-
(args: T): TemplateResult;
|
|
21
|
-
args?: Partial<T>;
|
|
22
|
-
argTypes?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
interface ArgTypes {
|
|
25
|
-
title?: string;
|
|
26
|
-
counter?: number;
|
|
27
|
-
textColor?: string;
|
|
28
|
-
slot?: TemplateResult;
|
|
29
|
-
}
|
|
30
|
-
export declare const Regular: Story<ArgTypes>;
|
|
31
|
-
export declare const CustomTitle: Story<ArgTypes>;
|
|
32
|
-
export declare const CustomCounter: Story<ArgTypes>;
|
|
33
|
-
export declare const SlottedContent: Story<ArgTypes>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import '../src/ox-popup';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'ContextMenu',
|
|
5
|
-
component: 'ox-popup',
|
|
6
|
-
argTypes: {
|
|
7
|
-
title: { control: 'text' },
|
|
8
|
-
counter: { control: 'number' },
|
|
9
|
-
textColor: { control: 'color' }
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const Template = ({ title = 'Hello world', counter = 5, textColor, slot }) => html `
|
|
13
|
-
<ox-popup style="--ox-popup-text-color: ${textColor || 'black'}" .title=${title} .counter=${counter}>
|
|
14
|
-
${slot}
|
|
15
|
-
</ox-popup>
|
|
16
|
-
`;
|
|
17
|
-
export const Regular = Template.bind({});
|
|
18
|
-
export const CustomTitle = Template.bind({});
|
|
19
|
-
CustomTitle.args = {
|
|
20
|
-
title: 'My title'
|
|
21
|
-
};
|
|
22
|
-
export const CustomCounter = Template.bind({});
|
|
23
|
-
CustomCounter.args = {
|
|
24
|
-
counter: 123456
|
|
25
|
-
};
|
|
26
|
-
export const SlottedContent = Template.bind({});
|
|
27
|
-
SlottedContent.args = {
|
|
28
|
-
slot: html `<p>Slotted content</p>`
|
|
29
|
-
};
|
|
30
|
-
SlottedContent.argTypes = {
|
|
31
|
-
slot: { table: { disable: true } }
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=index.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../stories/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KAChC;CACF,CAAA;AAeD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,GAAG,aAAa,EAAE,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;4CACjE,SAAS,IAAI,OAAO,YAAY,KAAK,aAAa,OAAO;MAC/F,IAAI;;CAET,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC5C,WAAW,CAAC,IAAI,GAAG;IACjB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC9C,aAAa,CAAC,IAAI,GAAG;IACnB,OAAO,EAAE,MAAM;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/C,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,IAAI,CAAA,wBAAwB;CACnC,CAAA;AACD,cAAc,CAAC,QAAQ,GAAG;IACxB,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CACnC,CAAA","sourcesContent":["import '../src/ox-popup'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'ContextMenu',\n component: 'ox-popup',\n argTypes: {\n title: { control: 'text' },\n counter: { control: 'number' },\n textColor: { control: 'color' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n title?: string\n counter?: number\n textColor?: string\n slot?: TemplateResult\n}\n\nconst Template: Story<ArgTypes> = ({ title = 'Hello world', counter = 5, textColor, slot }: ArgTypes) => html`\n <ox-popup style=\"--ox-popup-text-color: ${textColor || 'black'}\" .title=${title} .counter=${counter}>\n ${slot}\n </ox-popup>\n`\n\nexport const Regular = Template.bind({})\n\nexport const CustomTitle = Template.bind({})\nCustomTitle.args = {\n title: 'My title'\n}\n\nexport const CustomCounter = Template.bind({})\nCustomCounter.args = {\n counter: 123456\n}\n\nexport const SlottedContent = Template.bind({})\nSlottedContent.args = {\n slot: html`<p>Slotted content</p>`\n}\nSlottedContent.argTypes = {\n slot: { table: { disable: true } }\n}\n"]}
|
package/stories/index.stories.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import '../src/ox-popup'
|
|
2
|
-
|
|
3
|
-
import { html, TemplateResult } from 'lit'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'ContextMenu',
|
|
7
|
-
component: 'ox-popup',
|
|
8
|
-
argTypes: {
|
|
9
|
-
title: { control: 'text' },
|
|
10
|
-
counter: { control: 'number' },
|
|
11
|
-
textColor: { control: 'color' }
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface Story<T> {
|
|
16
|
-
(args: T): TemplateResult
|
|
17
|
-
args?: Partial<T>
|
|
18
|
-
argTypes?: Record<string, unknown>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface ArgTypes {
|
|
22
|
-
title?: string
|
|
23
|
-
counter?: number
|
|
24
|
-
textColor?: string
|
|
25
|
-
slot?: TemplateResult
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const Template: Story<ArgTypes> = ({ title = 'Hello world', counter = 5, textColor, slot }: ArgTypes) => html`
|
|
29
|
-
<ox-popup style="--ox-popup-text-color: ${textColor || 'black'}" .title=${title} .counter=${counter}>
|
|
30
|
-
${slot}
|
|
31
|
-
</ox-popup>
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
export const Regular = Template.bind({})
|
|
35
|
-
|
|
36
|
-
export const CustomTitle = Template.bind({})
|
|
37
|
-
CustomTitle.args = {
|
|
38
|
-
title: 'My title'
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const CustomCounter = Template.bind({})
|
|
42
|
-
CustomCounter.args = {
|
|
43
|
-
counter: 123456
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const SlottedContent = Template.bind({})
|
|
47
|
-
SlottedContent.args = {
|
|
48
|
-
slot: html`<p>Slotted content</p>`
|
|
49
|
-
}
|
|
50
|
-
SlottedContent.argTypes = {
|
|
51
|
-
slot: { table: { disable: true } }
|
|
52
|
-
}
|