@operato/popup 7.1.30 → 7.1.32

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/src/ox-prompt.ts DELETED
@@ -1,553 +0,0 @@
1
- import '@material/web/button/filled-button.js'
2
- import '@material/web/button/outlined-button.js'
3
- import '@material/web/icon/icon.js'
4
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
5
-
6
- import { css, html, nothing, LitElement } from 'lit'
7
- import { render } from 'lit-html'
8
- import { customElement, property, state } from 'lit/decorators.js'
9
- import { ScrollbarStyles } from '@operato/styles'
10
-
11
- const TYPES_ICON = {
12
- success: 'verified',
13
- error: 'error',
14
- warning: 'warning',
15
- info: 'info',
16
- question: 'question_mark'
17
- }
18
-
19
- /**
20
- * The `ox-prompt` custom element represents a modal popup that provides information or options for the user, such as confirmation or cancellation.
21
- */
22
- @customElement('ox-prompt')
23
- export class OxPrompt extends LitElement {
24
- static styles = [
25
- MDTypeScaleStyles,
26
- ScrollbarStyles,
27
- css`
28
- :host {
29
- position: absolute;
30
- display: flex;
31
- flex-direction: column;
32
- gap: var(--ox-prompt-gap, var(--spacing-medium));
33
- background-color: var(--ox-popup-list-background-color, var(--md-sys-color-surface));
34
- z-index: 100;
35
- padding: var(--ox-prompt-container-padding, var(--spacing-medium));
36
- box-shadow: var(--ox-prompt-container-box-shadow, 2px 3px 10px 5px rgba(0, 0, 0, 0.15));
37
- border-radius: var(--ox-prompt-container-border-radius, var(--md-sys-shape-corner-medium));
38
- box-sizing: border-box;
39
- min-width: 300;
40
- line-height: initial;
41
- text-align: initial;
42
- }
43
-
44
- :host([active]) {
45
- display: block;
46
- }
47
-
48
- :host(*:focus) {
49
- outline: none;
50
- }
51
-
52
- [titler] {
53
- padding: var(--ox-prompt-title-padding, var(--spacing-medium));
54
- padding-bottom: 0;
55
- color: var(--ox-prompt-title-color, var(--md-sys-color-primary));
56
- font-size: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));
57
- font-weight: var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500));
58
- text-align: var(--ox-prompt-title-text-align, 'left');
59
- }
60
-
61
- [content] {
62
- display: flex;
63
- flex-direction: column;
64
- gap: var(--ox-prompt-content-gap, var(--spacing-medium));
65
- padding: var(--ox-prompt-content-padding, var(--spacing-medium));
66
- color: var(--ox-prompt-body-color, var(--md-sys-color-on-surface));
67
- word-break: keep-all;
68
- white-space: pre-line;
69
- text-align: var(--ox-prompt-content-text-align, 'left');
70
-
71
- md-icon {
72
- align-self: center;
73
- --md-icon-size: var(--icon-size-huge);
74
- color: var(--ox-prompt-body-color-variant, var(--md-sys-color-primary));
75
- }
76
- }
77
-
78
- [content].warning md-icon {
79
- color: var(--status-warning-color, #ee8d03);
80
- }
81
-
82
- [content].error md-icon {
83
- color: var(--md-sys-color-error, var(--md-sys-color-error));
84
- }
85
-
86
- [content].info md-icon {
87
- color: var(--status-info-color, #398ace);
88
- }
89
-
90
- [content].success md-icon {
91
- color: var(--status-success-color, #35a24a);
92
- }
93
-
94
- [buttons] {
95
- display: flex;
96
- border-top: 1px solid var(--md-sys-color-surface-variant);
97
- gap: var(--ox-prompt-buttons-spacing, var(--spacing-large));
98
- padding: var(--ox-prompt-buttons-padding, var(--spacing-medium));
99
- padding-top: var(--spacing-large);
100
- justify-content: center;
101
- }
102
-
103
- #confirm {
104
- --md-filled-button-container-color: var(--md-sys-color-primary);
105
- --md-filled-button-label-text-color: var(--md-sys-color-on-primary);
106
- --md-filled-button-label-text-size: var(--md-sys-typescale-label-large-size, 0.875rem);
107
- --md-filled-button-container-height: var(--form-element-height-medium);
108
- --md-filled-button-container-shape: var(--md-sys-shape-corner-small);
109
- --md-filled-button-leading-space: var(--spacing-large);
110
- --md-filled-button-trailing-space: var(--spacing-large);
111
- }
112
-
113
- #cancel {
114
- --md-outlined-button-container-color: var(--md-sys-color-surface-variant);
115
- --md-outlined-button-label-text-color: var(--md-sys-color-on-surface-variant);
116
- --md-outlined-button-label-text-size: var(--md-sys-typescale-label-large-size, 0.875rem);
117
- --md-outlined-button-container-height: var(--form-element-height-medium);
118
- --md-outlined-button-container-shape: var(--md-sys-shape-corner-small);
119
- --md-outlined-button-leading-space: var(--spacing-large);
120
- --md-outlined-button-trailing-space: var(--spacing-large);
121
- }
122
- `
123
- ]
124
-
125
- /**
126
- * Specifies the type of the popup. Possible values are 'success', 'error', 'warning', 'info', 'question'.
127
- */
128
- @property({ type: String }) type?: 'success' | 'error' | 'warning' | 'info' | 'question'
129
-
130
- /**
131
- * Specifies the icon of the popup.
132
- */
133
- @property({ type: String }) icon?: string
134
-
135
- /**
136
- * Specifies the title of the popup.
137
- */
138
- @property({ type: String }) titler?: string = ''
139
-
140
- /**
141
- * Specifies the text content of the popup.
142
- */
143
- @property({ type: String }) text?: string
144
-
145
- /**
146
- * Specifies the footer (additional information at the bottom) of the popup.
147
- */
148
- @property({ type: String }) footer?: string
149
-
150
- /**
151
- * Determines whether the popup is displayed as a toast.
152
- */
153
- @property({ type: Boolean }) toast?: boolean
154
-
155
- /**
156
- * Specifies settings for the confirmation button.
157
- */
158
- @property({ type: Object }) confirmButton?: { text: string; color?: string }
159
-
160
- /**
161
- * Specifies settings for the cancel button.
162
- */
163
- @property({ type: Object }) cancelButton?: { text: string; color?: string }
164
-
165
- /**
166
- * Prevents the popup from closing when it loses focus (blur event).
167
- */
168
- @property({ type: Boolean, attribute: 'prevent-close-on-blur' }) preventCloseOnBlur: boolean = false
169
-
170
- /**
171
- * A callback function called when the popup is closed, providing the result of the user's interaction.
172
- */
173
- @property({ type: Object }) callback?: (result: { value: boolean }) => void
174
-
175
- @state() _parent?: Element
176
-
177
- private resolveFn: ((value: boolean) => void) | null = null
178
-
179
- render() {
180
- return html`
181
- ${this.titler ? html` <div titler class="md-typescale-title-large">${this.titler}</div> ` : nothing}
182
- <div content class="${this.type || 'info'} md-typescale-body-large">
183
- ${this.icon || this.type
184
- ? html` <md-icon icon>${this.icon || TYPES_ICON[this.type || 'info']}</md-icon> `
185
- : nothing}
186
- ${this.text ? html` <div text>${this.text}</div> ` : nothing}
187
- <slot> </slot>
188
- ${this.footer ? html` <div footer class="md-typescale-body-large">${this.footer}</div> ` : nothing}
189
- </div>
190
- <div buttons>
191
- ${this.confirmButton
192
- ? html`
193
- <md-filled-button id="confirm" type="button" @click=${(e: Event) => this.onConfirm()}
194
- >${this.confirmButton?.text}</md-filled-button
195
- >
196
- `
197
- : nothing}
198
- ${this.cancelButton
199
- ? html`
200
- <md-outlined-button id="cancel" type="button" @click=${(e: Event) => this.onCancel()}
201
- >${this.cancelButton?.text}</md-outlined-button
202
- >
203
- `
204
- : nothing}
205
- </div>
206
- `
207
- }
208
-
209
- resolve(result: boolean) {
210
- if (this.resolveFn) {
211
- this.resolveFn(result)
212
- this.resolveFn = null
213
- }
214
- }
215
-
216
- /**
217
- * Function called when the confirm button is clicked.
218
- */
219
- onConfirm() {
220
- this.resolve(true)
221
- this.close()
222
- }
223
-
224
- /**
225
- * Function called when the cancel button is clicked.
226
- */
227
- onCancel() {
228
- this.resolve(false)
229
- this.close()
230
- }
231
-
232
- protected _onfocusout: (e: FocusEvent) => void = function (this: OxPrompt, e: FocusEvent) {
233
- const to = e.relatedTarget as HTMLElement
234
-
235
- if (!this.contains(to)) {
236
- /* 분명히 내 범위가 아닌 엘리먼트로 포커스가 옮겨졌다면, ox-prompt은 닫혀야 한다. */
237
- // @ts-ignore for debug
238
- if (this.preventCloseOnBlur || window.POPUP_DEBUG) {
239
- return
240
- }
241
-
242
- this.resolve(false)
243
- this.close()
244
- }
245
- }.bind(this)
246
-
247
- protected _onkeydown: (e: KeyboardEvent) => void = function (this: OxPrompt, e: KeyboardEvent) {
248
- e.stopPropagation()
249
-
250
- switch (e.key) {
251
- case 'Esc': // for IE/Edge
252
- case 'Escape':
253
- this.resolve(false)
254
- this.close()
255
- break
256
- }
257
- }.bind(this)
258
-
259
- protected _onkeyup: (e: KeyboardEvent) => void = function (this: OxPrompt, e: KeyboardEvent) {
260
- e.stopPropagation()
261
- }.bind(this)
262
-
263
- protected _onmouseup: (e: MouseEvent) => void = function (this: OxPrompt, e: MouseEvent) {
264
- e.stopPropagation()
265
- }.bind(this)
266
-
267
- protected _onmousedown: (e: MouseEvent) => void = function (this: OxPrompt, e: MouseEvent) {
268
- e.stopPropagation()
269
- }.bind(this)
270
-
271
- protected _oncontextmenu: (e: Event) => void = function (this: OxPrompt, e: Event) {
272
- e.stopPropagation()
273
- }.bind(this)
274
-
275
- protected _onclick: (e: MouseEvent) => void = function (this: OxPrompt, e: MouseEvent) {
276
- e.stopPropagation()
277
- }.bind(this)
278
-
279
- protected _onclose: (e: Event) => void = function (this: OxPrompt, e: Event) {
280
- this.resolve(false)
281
- this.close()
282
- }.bind(this)
283
-
284
- protected _oncollapse: (e: Event) => void = function (this: OxPrompt, e: Event) {
285
- e.stopPropagation()
286
-
287
- this.resolve(false)
288
- this.close()
289
- }.bind(this)
290
-
291
- protected _onwindowblur: (e: Event) => void = function (this: OxPrompt, e: Event) {
292
- // @ts-ignore for debug
293
- if (this.preventCloseOnBlur || window.POPUP_DEBUG) {
294
- return
295
- }
296
-
297
- this.resolve(false)
298
- this.close()
299
- }.bind(this)
300
-
301
- connectedCallback() {
302
- super.connectedCallback()
303
-
304
- this.addEventListener('focusout', this._onfocusout)
305
- this.addEventListener('keydown', this._onkeydown)
306
- this.addEventListener('keyup', this._onkeyup)
307
- this.addEventListener('click', this._onclick)
308
- this.addEventListener('mouseup', this._onmouseup)
309
- this.addEventListener('mousedown', this._onmousedown)
310
- this.addEventListener('contextmenu', this._oncontextmenu)
311
- this.addEventListener('ox-close', this._onclose)
312
- this.addEventListener('ox-collapse', this._oncollapse)
313
-
314
- this.setAttribute('tabindex', '0') // make this element focusable
315
- this.guaranteeFocus()
316
- }
317
-
318
- /**
319
- * Static method to open the `ox-prompt` popup.
320
- * @param {object} options - An object containing popup options.
321
- * @param {unknown} [options.template] - An optional content template to render inside the popup.
322
- * @param {'success' | 'error' | 'warning' | 'info' | 'question'} [options.type] - The type of the popup, which can be one of: 'success', 'error', 'warning', 'info', 'question'.
323
- * @param {string} [options.icon] - The icon to be displayed in the popup header.
324
- * @param {string} [options.title] - The title to be displayed in the popup header.
325
- * @param {string} [options.text] - The main text content of the popup.
326
- * @param {string} [options.footer] - Additional information to be displayed at the bottom of the popup.
327
- * @param {object} [options.confirmButton] - Configuration for the confirmation button in the popup.
328
- * @param {string} options.confirmButton.text - The text to be displayed on the confirmation button.
329
- * @param {string} [options.confirmButton.color] - The color of the confirmation button (CSS color).
330
- * @param {object} [options.cancelButton] - Configuration for the cancel button in the popup.
331
- * @param {string} options.cancelButton.text - The text to be displayed on the cancel button.
332
- * @param {string} [options.cancelButton.color] - The color of the cancel button (CSS color).
333
- * @param {number} [options.top] - The top position of the popup (in pixels).
334
- * @param {number} [options.left] - The left position of the popup (in pixels).
335
- * @param {number} [options.right] - The right position of the popup (in pixels).
336
- * @param {number} [options.bottom] - The bottom position of the popup (in pixels).
337
- * @param {string} [options.width] - The maximum width of the popup (CSS string).
338
- * @param {string} [options.height] - The maximum height of the popup (CSS string).
339
- * @param {Element | null} [options.parent] - The parent element to which the popup should be attached. If not provided, it will be attached to the document body.
340
- * @param {boolean} [options.preventCloseOnBlur] - Prevents the popup from closing when it loses focus (blur event).
341
- * @param {(result: { value: boolean }) => void} [options.callback] - A callback function that will be invoked when the user interacts with the popup, providing the result of the interaction.
342
- * @returns {Promise<boolean>} A Promise that resolves based on user interaction with the popup.
343
- */
344
- public static async open({
345
- template,
346
- type,
347
- icon,
348
- title,
349
- text,
350
- footer,
351
- confirmButton,
352
- cancelButton,
353
- top,
354
- left,
355
- right,
356
- bottom,
357
- width,
358
- height,
359
- parent,
360
- preventCloseOnBlur,
361
- callback
362
- }: {
363
- template?: unknown
364
- type?: 'success' | 'error' | 'warning' | 'info' | 'question'
365
- icon?: string
366
- title?: string
367
- text?: string
368
- footer?: string
369
- confirmButton?: { text: string; color?: string }
370
- cancelButton?: { text: string; color?: string }
371
- top?: number
372
- left?: number
373
- right?: number
374
- bottom?: number
375
- width?: string
376
- height?: string
377
- parent?: Element | null
378
- preventCloseOnBlur?: boolean
379
- callback?: (result: { value: boolean }) => void
380
- }): Promise<boolean> {
381
- const owner = parent || document.body
382
- const target = document.createElement('ox-prompt') as OxPrompt
383
-
384
- target.type = type
385
- target.icon = icon
386
- target.text = text
387
- target.titler = title
388
- target.footer = footer
389
- target.confirmButton = confirmButton
390
- target.cancelButton = cancelButton
391
- target.preventCloseOnBlur = !!preventCloseOnBlur
392
-
393
- render(template, target)
394
-
395
- target._parent = owner
396
- owner.appendChild(target)
397
-
398
- const result = await target.open({ top, left, right, bottom, width, height })
399
-
400
- if (callback) {
401
- await callback.call(null, { value: result })
402
- }
403
-
404
- return result
405
- }
406
-
407
- /**
408
- * Opens the popup with specified position and dimensions.
409
- * @param {object} options - An object specifying the position and dimensions of the popup.
410
- * @param {number} [options.left] - The left position of the popup (in pixels). If not provided, the popup will be horizontally centered.
411
- * @param {number} [options.top] - The top position of the popup (in pixels). If not provided, the popup will be vertically centered.
412
- * @param {number} [options.right] - The right position of the popup (in pixels). Overrides 'left' if both 'left' and 'right' are provided.
413
- * @param {number} [options.bottom] - The bottom position of the popup (in pixels). Overrides 'top' if both 'top' and 'bottom' are provided.
414
- * @param {string} [options.width] - The maximum width of the popup (CSS string). If not provided, no width restriction is applied.
415
- * @param {string} [options.height] - The maximum height of the popup (CSS string). If not provided, no height restriction is applied.
416
- * @param {boolean} [options.silent=false] - Determines whether to focus the popup automatically (true) or not (false).
417
- * @returns {Promise<boolean>} A Promise that resolves based on user interaction with the popup.
418
- */
419
- open({
420
- left,
421
- top,
422
- right,
423
- bottom,
424
- width,
425
- height,
426
- silent = false
427
- }: {
428
- left?: number
429
- top?: number
430
- right?: number
431
- bottom?: number
432
- width?: string
433
- height?: string
434
- silent?: boolean
435
- }): Promise<boolean> {
436
- if (width) {
437
- this.style.maxWidth = width
438
- this.style.overflowX = 'auto'
439
- }
440
-
441
- if (height) {
442
- this.style.maxHeight = height
443
- this.style.overflowY = 'auto'
444
- }
445
-
446
- if (left === undefined && top === undefined && right === undefined && bottom === undefined) {
447
- this.style.left = '50%'
448
- this.style.top = '50%'
449
- this.style.transform = 'translateX(-50%) translateY(-50%)'
450
- } else {
451
- if (left !== undefined) this.style.left = `${left}px`
452
- if (top !== undefined) this.style.top = `${top}px`
453
- if (right !== undefined) this.style.right = `${right}px`
454
- if (bottom !== undefined) this.style.bottom = `${bottom}px`
455
- }
456
-
457
- this.setAttribute('active', '')
458
-
459
- // adjust popup position
460
- requestAnimationFrame(() => {
461
- const vh = document.body.clientHeight
462
- const vw = document.body.clientWidth
463
-
464
- var bounding = this.getBoundingClientRect()
465
-
466
- var h = bounding.height
467
- var w = bounding.width
468
- var t = bounding.top
469
- var l = bounding.left
470
-
471
- // If the popup is too large, it will cause overflow scrolling.
472
- if (vh < h) {
473
- this.style.height = `${Math.min(Math.max(Math.floor((vh * 2) / 3), vh - (t + 20)), vh)}px`
474
- this.style.overflow = 'auto'
475
- h = vh
476
- }
477
-
478
- if (vw < w) {
479
- this.style.width = `${Math.min(Math.max(Math.floor((vw * 2) / 3), vw - (l + 20)), vw)}px`
480
- this.style.overflow = 'auto'
481
- w = vw
482
- }
483
-
484
- // To prevent pop-ups from crossing screen boundaries, use the
485
- const computedStyle = getComputedStyle(this)
486
-
487
- if (t < 0) {
488
- this.style.top = `calc(${computedStyle.top} + ${t}px)`
489
- this.style.bottom = ''
490
- } else if (vh <= t + h) {
491
- this.style.top = `calc(${computedStyle.top} - ${t + h - vh}px)`
492
- this.style.bottom = ''
493
- }
494
-
495
- if (l < 0) {
496
- this.style.left = `calc(${computedStyle.left} + ${l}px)`
497
- this.style.right = ''
498
- } else if (vw < l + w) {
499
- this.style.left = `calc(${computedStyle.left} - ${l + w - vw}px)`
500
- this.style.right = ''
501
- }
502
- })
503
-
504
- // auto focusing
505
- setTimeout(() => {
506
- !silent && this.guaranteeFocus()
507
- }, 100)
508
-
509
- /* When the window is out of focus, all pop-ups should disappear. */
510
- window.addEventListener('blur', this._onwindowblur)
511
-
512
- return new Promise(resolve => {
513
- this.resolveFn = resolve
514
- })
515
- }
516
-
517
- guaranteeFocus(target?: HTMLElement) {
518
- const focusible = (target || this.renderRoot)?.querySelector(
519
- ':scope > button, :scope > [href], :scope > input, :scope > select, :scope > textarea, :scope > [tabindex]:not([tabindex="-1"]), :scope [type="button"]'
520
- )
521
-
522
- if (focusible) {
523
- ;(focusible as HTMLElement).focus()
524
- } else {
525
- this.focus()
526
- }
527
- }
528
-
529
- /**
530
- * Closes the popup.
531
- */
532
- close() {
533
- this.removeAttribute('active')
534
-
535
- window.removeEventListener('blur', this._onwindowblur)
536
-
537
- if (this._parent) {
538
- /* this case is when the popup is opened by OxPrompt.open(...) */
539
- this.removeEventListener('focusout', this._onfocusout)
540
- this.removeEventListener('keydown', this._onkeydown)
541
- this.removeEventListener('keyup', this._onkeyup)
542
- this.removeEventListener('click', this._onclick)
543
- this.removeEventListener('ox-close', this._onclose)
544
- this.removeEventListener('ox-collapse', this._oncollapse)
545
- this.removeEventListener('mouseup', this._onmouseup)
546
- this.removeEventListener('mousedown', this._onmousedown)
547
- this.removeEventListener('contextmenu', this._oncontextmenu)
548
-
549
- this._parent.removeChild(this)
550
- delete this._parent
551
- }
552
- }
553
- }
@@ -1,37 +0,0 @@
1
- interface PositionOptions {
2
- left?: number
3
- top?: number
4
- right?: number
5
- bottom?: number
6
- relativeElement: HTMLElement
7
- }
8
-
9
- interface FixedPosition {
10
- left?: number
11
- top?: number
12
- right?: number
13
- bottom?: number
14
- }
15
-
16
- export function convertToFixedPosition({ left, top, right, bottom, relativeElement }: PositionOptions): FixedPosition {
17
- // Get bounding rectangle of the relative element
18
- const rect = relativeElement.getBoundingClientRect()
19
-
20
- // Get the viewport dimensions
21
- const viewportHeight = window.innerHeight
22
- const viewportWidth = window.innerWidth
23
-
24
- // Calculate fixed positions
25
- const fixedLeft = left !== undefined ? rect.left + left : undefined
26
- const fixedTop = top !== undefined ? rect.top + top : undefined
27
- const fixedRight = right !== undefined ? viewportWidth - rect.right + right : undefined
28
- const fixedBottom = bottom !== undefined ? viewportHeight - rect.bottom + bottom : undefined
29
-
30
- // Return the new fixed position values
31
- return {
32
- left: fixedLeft,
33
- top: fixedTop,
34
- right: fixedRight,
35
- bottom: fixedBottom
36
- }
37
- }
@@ -1,104 +0,0 @@
1
- import '@material/web/all.js'
2
- import { html, TemplateResult } from 'lit'
3
-
4
- import { openPopup, PopupOptions } from '../src/open-popup'
5
- import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
-
7
- export default {
8
- title: 'openPopup',
9
- component: 'ox-popup',
10
- argTypes: {
11
- title: { constol: 'string' },
12
- size: { control: 'select', options: ['large', 'medium', 'small'] },
13
- hovering: { control: 'select', options: ['center', 'next', 'edge'] },
14
- closable: { control: 'boolean' },
15
- escapable: { control: 'boolean' },
16
- backdrop: { control: 'boolean' },
17
- help: { constol: 'string' }
18
- }
19
- }
20
-
21
- interface Story<T> {
22
- (args: T): TemplateResult
23
- args?: Partial<T>
24
- argTypes?: Record<string, unknown>
25
- }
26
-
27
- interface ArgTypes {
28
- title: string
29
- size: 'large' | 'medium' | 'small'
30
- hovering: 'center' | 'next' | 'edge'
31
- closable: boolean
32
- escapable: boolean
33
- backdrop: boolean
34
- help: string
35
- }
36
-
37
- function popup(e: MouseEvent, options: PopupOptions) {
38
- const noImage = new URL('/assets/images/no-image.png', import.meta.url).href
39
-
40
- return openPopup(html`<img src=${noImage} />`, options)
41
- }
42
-
43
- const Template: Story<ArgTypes> = ({
44
- title = '',
45
- size = 'medium',
46
- hovering = 'center',
47
- closable,
48
- escapable,
49
- backdrop,
50
- help
51
- }: ArgTypes) => html`
52
- <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
53
-
54
- <link href="/themes/light.css" rel="stylesheet" />
55
- <link href="/themes/dark.css" rel="stylesheet" />
56
- <link href="/themes/spacing.css" rel="stylesheet" />
57
-
58
- <link
59
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
60
- rel="stylesheet"
61
- />
62
- <link
63
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
64
- rel="stylesheet"
65
- />
66
- <link
67
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
68
- rel="stylesheet"
69
- />
70
-
71
- <style>
72
- ${MDTypeScaleStyles.cssText}
73
- </style>
74
-
75
- <style>
76
- #place {
77
- width: 100%;
78
- height: 500px;
79
- text-align: center;
80
-
81
- background-color: var(--md-sys-color-primary-container);
82
- color: var(--md-sys-color-on-primary-container);
83
- }
84
- </style>
85
-
86
- <div
87
- id="place"
88
- @click=${(e: MouseEvent) => popup(e, { title, size, hovering, closable, escapable, backdrop, help })}
89
- class="md-typescale-display-medium"
90
- >
91
- Click this to popup image
92
- </div>
93
- `
94
-
95
- export const Regular = Template.bind({})
96
- Regular.args = {
97
- title: 'Regular popup',
98
- size: 'medium',
99
- hovering: 'center',
100
- closable: true,
101
- escapable: true,
102
- backdrop: true,
103
- help: ''
104
- }