@chromvoid/uikit 0.1.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/LICENSE +8 -0
- package/README.md +96 -0
- package/dist/components/cv-accordion-item.d.ts +69 -0
- package/dist/components/cv-accordion-item.js +176 -0
- package/dist/components/cv-accordion.d.ts +79 -0
- package/dist/components/cv-accordion.js +310 -0
- package/dist/components/cv-alert-dialog.d.ts +86 -0
- package/dist/components/cv-alert-dialog.js +393 -0
- package/dist/components/cv-alert.d.ts +48 -0
- package/dist/components/cv-alert.js +156 -0
- package/dist/components/cv-badge.d.ts +56 -0
- package/dist/components/cv-badge.js +280 -0
- package/dist/components/cv-breadcrumb-item.d.ts +35 -0
- package/dist/components/cv-breadcrumb-item.js +64 -0
- package/dist/components/cv-breadcrumb.d.ts +39 -0
- package/dist/components/cv-breadcrumb.js +160 -0
- package/dist/components/cv-button.d.ts +83 -0
- package/dist/components/cv-button.js +541 -0
- package/dist/components/cv-callout.d.ts +32 -0
- package/dist/components/cv-callout.js +221 -0
- package/dist/components/cv-card.d.ts +48 -0
- package/dist/components/cv-card.js +269 -0
- package/dist/components/cv-carousel-slide.d.ts +25 -0
- package/dist/components/cv-carousel-slide.js +51 -0
- package/dist/components/cv-carousel.d.ts +96 -0
- package/dist/components/cv-carousel.js +457 -0
- package/dist/components/cv-checkbox.d.ts +84 -0
- package/dist/components/cv-checkbox.js +274 -0
- package/dist/components/cv-combobox-group.d.ts +15 -0
- package/dist/components/cv-combobox-group.js +34 -0
- package/dist/components/cv-combobox-option.d.ts +30 -0
- package/dist/components/cv-combobox-option.js +66 -0
- package/dist/components/cv-combobox.d.ts +135 -0
- package/dist/components/cv-combobox.js +834 -0
- package/dist/components/cv-command-item.d.ts +30 -0
- package/dist/components/cv-command-item.js +68 -0
- package/dist/components/cv-command-palette.d.ts +105 -0
- package/dist/components/cv-command-palette.js +578 -0
- package/dist/components/cv-context-menu.d.ts +98 -0
- package/dist/components/cv-context-menu.js +515 -0
- package/dist/components/cv-copy-button.d.ts +61 -0
- package/dist/components/cv-copy-button.js +318 -0
- package/dist/components/cv-date-picker.d.ts +161 -0
- package/dist/components/cv-date-picker.js +803 -0
- package/dist/components/cv-dialog.d.ts +89 -0
- package/dist/components/cv-dialog.js +459 -0
- package/dist/components/cv-disclosure.d.ts +57 -0
- package/dist/components/cv-disclosure.js +241 -0
- package/dist/components/cv-drawer.d.ts +102 -0
- package/dist/components/cv-drawer.js +595 -0
- package/dist/components/cv-feed-article.d.ts +26 -0
- package/dist/components/cv-feed-article.js +52 -0
- package/dist/components/cv-feed.d.ts +62 -0
- package/dist/components/cv-feed.js +310 -0
- package/dist/components/cv-grid-cell.d.ts +30 -0
- package/dist/components/cv-grid-cell.js +57 -0
- package/dist/components/cv-grid-column.d.ts +30 -0
- package/dist/components/cv-grid-column.js +43 -0
- package/dist/components/cv-grid-row.d.ts +30 -0
- package/dist/components/cv-grid-row.js +42 -0
- package/dist/components/cv-grid.d.ts +119 -0
- package/dist/components/cv-grid.js +567 -0
- package/dist/components/cv-icon.d.ts +57 -0
- package/dist/components/cv-icon.js +352 -0
- package/dist/components/cv-input.d.ts +127 -0
- package/dist/components/cv-input.js +482 -0
- package/dist/components/cv-landmark.d.ts +32 -0
- package/dist/components/cv-landmark.js +62 -0
- package/dist/components/cv-link.d.ts +22 -0
- package/dist/components/cv-link.js +99 -0
- package/dist/components/cv-listbox-group.d.ts +15 -0
- package/dist/components/cv-listbox-group.js +42 -0
- package/dist/components/cv-listbox.d.ts +81 -0
- package/dist/components/cv-listbox.js +388 -0
- package/dist/components/cv-menu-button.d.ts +118 -0
- package/dist/components/cv-menu-button.js +822 -0
- package/dist/components/cv-menu-group.d.ts +20 -0
- package/dist/components/cv-menu-group.js +48 -0
- package/dist/components/cv-menu-item.d.ts +52 -0
- package/dist/components/cv-menu-item.js +105 -0
- package/dist/components/cv-menu.d.ts +62 -0
- package/dist/components/cv-menu.js +414 -0
- package/dist/components/cv-meter.d.ts +66 -0
- package/dist/components/cv-meter.js +154 -0
- package/dist/components/cv-number.d.ts +139 -0
- package/dist/components/cv-number.js +553 -0
- package/dist/components/cv-option.d.ts +30 -0
- package/dist/components/cv-option.js +84 -0
- package/dist/components/cv-popover.d.ts +87 -0
- package/dist/components/cv-popover.js +373 -0
- package/dist/components/cv-progress-ring.d.ts +45 -0
- package/dist/components/cv-progress-ring.js +169 -0
- package/dist/components/cv-progress.d.ts +45 -0
- package/dist/components/cv-progress.js +148 -0
- package/dist/components/cv-radio-group.d.ts +79 -0
- package/dist/components/cv-radio-group.js +398 -0
- package/dist/components/cv-radio.d.ts +36 -0
- package/dist/components/cv-radio.js +123 -0
- package/dist/components/cv-select-group.d.ts +15 -0
- package/dist/components/cv-select-group.js +44 -0
- package/dist/components/cv-select-option.d.ts +30 -0
- package/dist/components/cv-select-option.js +66 -0
- package/dist/components/cv-select.d.ts +128 -0
- package/dist/components/cv-select.js +666 -0
- package/dist/components/cv-sidebar-item.d.ts +26 -0
- package/dist/components/cv-sidebar-item.js +142 -0
- package/dist/components/cv-sidebar.d.ts +171 -0
- package/dist/components/cv-sidebar.js +767 -0
- package/dist/components/cv-slider-multi-thumb.d.ts +73 -0
- package/dist/components/cv-slider-multi-thumb.js +374 -0
- package/dist/components/cv-slider.d.ts +84 -0
- package/dist/components/cv-slider.js +328 -0
- package/dist/components/cv-spinbutton.d.ts +121 -0
- package/dist/components/cv-spinbutton.js +486 -0
- package/dist/components/cv-spinner.d.ts +18 -0
- package/dist/components/cv-spinner.js +95 -0
- package/dist/components/cv-switch.d.ts +81 -0
- package/dist/components/cv-switch.js +285 -0
- package/dist/components/cv-tab-panel.d.ts +20 -0
- package/dist/components/cv-tab-panel.js +37 -0
- package/dist/components/cv-tab.d.ts +40 -0
- package/dist/components/cv-tab.js +132 -0
- package/dist/components/cv-table-cell.d.ts +31 -0
- package/dist/components/cv-table-cell.js +49 -0
- package/dist/components/cv-table-column.d.ts +37 -0
- package/dist/components/cv-table-column.js +63 -0
- package/dist/components/cv-table-row.d.ts +30 -0
- package/dist/components/cv-table-row.js +45 -0
- package/dist/components/cv-table.d.ts +147 -0
- package/dist/components/cv-table.js +607 -0
- package/dist/components/cv-tabs.d.ts +70 -0
- package/dist/components/cv-tabs.js +524 -0
- package/dist/components/cv-textarea.d.ts +108 -0
- package/dist/components/cv-textarea.js +328 -0
- package/dist/components/cv-toast-region.d.ts +39 -0
- package/dist/components/cv-toast-region.js +162 -0
- package/dist/components/cv-toast.d.ts +67 -0
- package/dist/components/cv-toast.js +315 -0
- package/dist/components/cv-toolbar-item.d.ts +25 -0
- package/dist/components/cv-toolbar-item.js +72 -0
- package/dist/components/cv-toolbar-separator.d.ts +25 -0
- package/dist/components/cv-toolbar-separator.js +45 -0
- package/dist/components/cv-toolbar.d.ts +63 -0
- package/dist/components/cv-toolbar.js +295 -0
- package/dist/components/cv-tooltip.d.ts +83 -0
- package/dist/components/cv-tooltip.js +455 -0
- package/dist/components/cv-treegrid-cell.d.ts +30 -0
- package/dist/components/cv-treegrid-cell.js +57 -0
- package/dist/components/cv-treegrid-column.d.ts +37 -0
- package/dist/components/cv-treegrid-column.js +53 -0
- package/dist/components/cv-treegrid-row.d.ts +55 -0
- package/dist/components/cv-treegrid-row.js +90 -0
- package/dist/components/cv-treegrid.d.ts +96 -0
- package/dist/components/cv-treegrid.js +632 -0
- package/dist/components/cv-treeitem.d.ts +58 -0
- package/dist/components/cv-treeitem.js +144 -0
- package/dist/components/cv-treeview.d.ts +70 -0
- package/dist/components/cv-treeview.js +396 -0
- package/dist/components/cv-window-splitter.d.ts +79 -0
- package/dist/components/cv-window-splitter.js +316 -0
- package/dist/components/index.d.ts +94 -0
- package/dist/components/index.js +79 -0
- package/dist/dialog/create-dialog-controller.d.ts +31 -0
- package/dist/dialog/create-dialog-controller.js +320 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +1 -0
- package/dist/form-associated/FormAssociatedReatomElement.d.ts +25 -0
- package/dist/form-associated/FormAssociatedReatomElement.js +70 -0
- package/dist/form-associated/withFormAssociated.d.ts +5 -0
- package/dist/form-associated/withFormAssociated.js +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/reatom-lit/ReatomLitElement.d.ts +27 -0
- package/dist/reatom-lit/ReatomLitElement.js +118 -0
- package/dist/reatom-lit/html.d.ts +4 -0
- package/dist/reatom-lit/html.js +10 -0
- package/dist/reatom-lit/index.d.ts +4 -0
- package/dist/reatom-lit/index.js +4 -0
- package/dist/reatom-lit/watch.d.ts +15 -0
- package/dist/reatom-lit/watch.js +40 -0
- package/dist/reatom-lit/withReatomElement.d.ts +4 -0
- package/dist/reatom-lit/withReatomElement.js +57 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +84 -0
- package/dist/styles/component-styles.d.ts +4 -0
- package/dist/styles/component-styles.js +78 -0
- package/dist/theme/cv-theme-provider.d.ts +32 -0
- package/dist/theme/cv-theme-provider.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/theme-engine.d.ts +4 -0
- package/dist/theme/theme-engine.js +67 -0
- package/dist/theme/tokens.css +265 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/types.js +1 -0
- package/dist/toast/create-toast-controller.d.ts +12 -0
- package/dist/toast/create-toast-controller.js +12 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +1 -0
- package/package.json +146 -0
- package/specs/_template.md +110 -0
- package/specs/components/accordion.md +207 -0
- package/specs/components/alert.md +83 -0
- package/specs/components/badge.md +183 -0
- package/specs/components/breadcrumb.md +152 -0
- package/specs/components/button.md +227 -0
- package/specs/components/callout.md +153 -0
- package/specs/components/card.md +192 -0
- package/specs/components/carousel.md +232 -0
- package/specs/components/checkbox.md +141 -0
- package/specs/components/combobox.md +427 -0
- package/specs/components/context-menu.md +375 -0
- package/specs/components/copy-button.md +236 -0
- package/specs/components/date-picker.md +290 -0
- package/specs/components/dialog.md +184 -0
- package/specs/components/disclosure.md +151 -0
- package/specs/components/drawer.md +216 -0
- package/specs/components/feed.md +266 -0
- package/specs/components/grid.md +423 -0
- package/specs/components/input.md +237 -0
- package/specs/components/landmark.md +92 -0
- package/specs/components/link.md +117 -0
- package/specs/components/listbox.md +327 -0
- package/specs/components/menu.md +508 -0
- package/specs/components/meter.md +148 -0
- package/specs/components/number.md +268 -0
- package/specs/components/option.md +167 -0
- package/specs/components/popover.md +207 -0
- package/specs/components/progress-ring.md +134 -0
- package/specs/components/progress.md +110 -0
- package/specs/components/radio.md +208 -0
- package/specs/components/select.md +305 -0
- package/specs/components/sidebar.md +204 -0
- package/specs/components/spinbutton.md +157 -0
- package/specs/components/spinner.md +83 -0
- package/specs/components/switch.md +145 -0
- package/specs/components/table.md +372 -0
- package/specs/components/tabs.md +242 -0
- package/specs/components/textarea.md +166 -0
- package/specs/components/theme.md +364 -0
- package/specs/components/toast.md +198 -0
- package/specs/components/toolbar.md +258 -0
- package/specs/components/tooltip.md +152 -0
- package/specs/components/treegrid.md +363 -0
- package/specs/components/treeview.md +263 -0
- package/specs/components/window-splitter.md +225 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
import { createDrawer } from '@chromvoid/headless-ui/drawer';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
let cvDrawerNonce = 0;
|
|
5
|
+
export class CVDrawer extends ReatomLitElement {
|
|
6
|
+
static elementName = 'cv-drawer';
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
open: { type: Boolean, reflect: true },
|
|
10
|
+
modal: { type: Boolean, reflect: true },
|
|
11
|
+
placement: { type: String, reflect: true },
|
|
12
|
+
type: { type: String, reflect: true },
|
|
13
|
+
closeOnEscape: { type: Boolean, attribute: 'close-on-escape', reflect: true },
|
|
14
|
+
closeOnOutsidePointer: { type: Boolean, attribute: 'close-on-outside-pointer', reflect: true },
|
|
15
|
+
closeOnOutsideFocus: { type: Boolean, attribute: 'close-on-outside-focus', reflect: true },
|
|
16
|
+
initialFocusId: { type: String, attribute: 'initial-focus-id' },
|
|
17
|
+
noHeader: { type: Boolean, attribute: 'no-header', reflect: true },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
idBase = `cv-drawer-${++cvDrawerNonce}`;
|
|
21
|
+
model;
|
|
22
|
+
lockScrollApplied = false;
|
|
23
|
+
previousBodyOverflow = '';
|
|
24
|
+
suppressLifecycleFromUpdate = false;
|
|
25
|
+
lifecycleToken = 0;
|
|
26
|
+
overlayVisible = false;
|
|
27
|
+
renderState = 'closed';
|
|
28
|
+
openAnimationFrame = 0;
|
|
29
|
+
closeAnimationTimeout = 0;
|
|
30
|
+
shouldAnimatePresence = false;
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
this.open = false;
|
|
34
|
+
this.modal = true;
|
|
35
|
+
this.placement = 'end';
|
|
36
|
+
this.type = 'dialog';
|
|
37
|
+
this.closeOnEscape = true;
|
|
38
|
+
this.closeOnOutsidePointer = true;
|
|
39
|
+
this.closeOnOutsideFocus = true;
|
|
40
|
+
this.initialFocusId = '';
|
|
41
|
+
this.noHeader = false;
|
|
42
|
+
this.model = this.createModel();
|
|
43
|
+
this.overlayVisible = this.open;
|
|
44
|
+
this.renderState = this.open ? 'open' : 'closed';
|
|
45
|
+
}
|
|
46
|
+
static styles = [
|
|
47
|
+
css `
|
|
48
|
+
:host {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[part='trigger'] {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
min-block-size: 36px;
|
|
57
|
+
padding: 0 var(--cv-space-3, 12px);
|
|
58
|
+
border-radius: var(--cv-radius-sm, 6px);
|
|
59
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
60
|
+
background: var(--cv-color-surface, #141923);
|
|
61
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[part='trigger']:focus-visible {
|
|
66
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
67
|
+
outline-offset: 1px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[part='overlay'] {
|
|
71
|
+
position: fixed;
|
|
72
|
+
inset: 0;
|
|
73
|
+
z-index: var(--cv-drawer-z-index, 40);
|
|
74
|
+
display: flex;
|
|
75
|
+
overflow: clip;
|
|
76
|
+
contain: paint;
|
|
77
|
+
background: var(--cv-drawer-overlay-color, color-mix(in oklab, black 56%, transparent));
|
|
78
|
+
opacity: var(--cv-drawer-overlay-closed-opacity, 1);
|
|
79
|
+
transition: opacity var(--cv-drawer-overlay-transition-duration, 0ms) ease;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part='overlay'][hidden] {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[part='overlay'][data-state='open'] {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[part='panel'] {
|
|
91
|
+
position: fixed;
|
|
92
|
+
overflow: auto;
|
|
93
|
+
display: grid;
|
|
94
|
+
grid-template-rows: auto 1fr auto;
|
|
95
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
96
|
+
background: var(--cv-color-surface-elevated, #1d2432);
|
|
97
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
98
|
+
opacity: 0;
|
|
99
|
+
will-change: transform, opacity;
|
|
100
|
+
transition:
|
|
101
|
+
transform var(--cv-drawer-transition-duration, 250ms) ease,
|
|
102
|
+
opacity var(--cv-drawer-transition-duration, 250ms) ease;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[part='panel']:focus-visible {
|
|
106
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
107
|
+
outline-offset: 1px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Placement: start (inline-start edge) */
|
|
111
|
+
[part='panel'][data-placement='start'] {
|
|
112
|
+
inset-block: 0;
|
|
113
|
+
inset-inline-start: 0;
|
|
114
|
+
inline-size: var(--cv-drawer-size, 360px);
|
|
115
|
+
max-inline-size: var(--cv-drawer-max-size, calc(100dvh - 32px));
|
|
116
|
+
border-radius: 0 var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px))
|
|
117
|
+
var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px)) 0;
|
|
118
|
+
transform: translate3d(-100%, 0, 0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Placement: end (inline-end edge) */
|
|
122
|
+
[part='panel'][data-placement='end'] {
|
|
123
|
+
inset-block: 0;
|
|
124
|
+
inset-inline-end: 0;
|
|
125
|
+
inline-size: var(--cv-drawer-size, 360px);
|
|
126
|
+
max-inline-size: var(--cv-drawer-max-size, calc(100dvh - 32px));
|
|
127
|
+
border-radius: var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px)) 0 0
|
|
128
|
+
var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px));
|
|
129
|
+
transform: translate3d(100%, 0, 0);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Placement: top */
|
|
133
|
+
[part='panel'][data-placement='top'] {
|
|
134
|
+
inset-inline: 0;
|
|
135
|
+
inset-block-start: 0;
|
|
136
|
+
block-size: var(--cv-drawer-size, 360px);
|
|
137
|
+
max-block-size: var(--cv-drawer-max-size, calc(100dvh - 32px));
|
|
138
|
+
border-radius: 0 0 var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px))
|
|
139
|
+
var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px));
|
|
140
|
+
transform: translate3d(0, -100%, 0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Placement: bottom */
|
|
144
|
+
[part='panel'][data-placement='bottom'] {
|
|
145
|
+
inset-inline: 0;
|
|
146
|
+
inset-block-end: 0;
|
|
147
|
+
block-size: var(--cv-drawer-size, 360px);
|
|
148
|
+
max-block-size: var(--cv-drawer-max-size, calc(100dvh - 32px));
|
|
149
|
+
border-radius: var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px))
|
|
150
|
+
var(--cv-drawer-border-radius, var(--cv-radius-lg, 14px)) 0 0;
|
|
151
|
+
transform: translate3d(0, 100%, 0);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
[part='panel'][data-state='open'] {
|
|
155
|
+
opacity: 1;
|
|
156
|
+
transform: translate3d(0, 0, 0);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media (prefers-reduced-motion: reduce) {
|
|
160
|
+
[part='overlay'],
|
|
161
|
+
[part='panel'] {
|
|
162
|
+
transition-duration: 0ms;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[part='header'] {
|
|
167
|
+
display: grid;
|
|
168
|
+
gap: var(--cv-space-1, 4px);
|
|
169
|
+
padding: var(--cv-drawer-header-spacing, var(--cv-space-4, 16px));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[part='title'] {
|
|
173
|
+
margin: 0;
|
|
174
|
+
font-size: 1.05rem;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[part='description'] {
|
|
178
|
+
margin: 0;
|
|
179
|
+
color: var(--cv-color-text-muted, #9aa6bf);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[part='header-close'] {
|
|
183
|
+
display: inline-flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
min-block-size: 28px;
|
|
187
|
+
min-inline-size: 28px;
|
|
188
|
+
padding: 0;
|
|
189
|
+
border-radius: var(--cv-radius-sm, 6px);
|
|
190
|
+
border: none;
|
|
191
|
+
background: transparent;
|
|
192
|
+
color: var(--cv-color-text-muted, #9aa6bf);
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[part='header-close']:focus-visible {
|
|
197
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
198
|
+
outline-offset: 1px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[part='body'] {
|
|
202
|
+
padding: var(--cv-drawer-body-spacing, var(--cv-space-4, 16px));
|
|
203
|
+
overflow: auto;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[part='footer'] {
|
|
207
|
+
display: flex;
|
|
208
|
+
gap: var(--cv-space-2, 8px);
|
|
209
|
+
justify-content: flex-end;
|
|
210
|
+
padding: var(--cv-drawer-footer-spacing, var(--cv-space-4, 16px));
|
|
211
|
+
}
|
|
212
|
+
`,
|
|
213
|
+
];
|
|
214
|
+
static define() {
|
|
215
|
+
if (!customElements.get(this.elementName)) {
|
|
216
|
+
customElements.define(this.elementName, this);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
connectedCallback() {
|
|
220
|
+
super.connectedCallback();
|
|
221
|
+
this.syncOutsideFocusListener();
|
|
222
|
+
this.syncScrollLock();
|
|
223
|
+
}
|
|
224
|
+
disconnectedCallback() {
|
|
225
|
+
super.disconnectedCallback();
|
|
226
|
+
this.syncOutsideFocusListener(true);
|
|
227
|
+
this.releaseScrollLock();
|
|
228
|
+
this.clearAnimationQueue();
|
|
229
|
+
}
|
|
230
|
+
willUpdate(changedProperties) {
|
|
231
|
+
super.willUpdate(changedProperties);
|
|
232
|
+
this.shouldAnimatePresence = false;
|
|
233
|
+
if (changedProperties.has('modal') ||
|
|
234
|
+
changedProperties.has('type') ||
|
|
235
|
+
changedProperties.has('closeOnEscape') ||
|
|
236
|
+
changedProperties.has('closeOnOutsidePointer') ||
|
|
237
|
+
changedProperties.has('closeOnOutsideFocus') ||
|
|
238
|
+
changedProperties.has('initialFocusId') ||
|
|
239
|
+
changedProperties.has('placement')) {
|
|
240
|
+
const wasOpen = this.model.state.isOpen();
|
|
241
|
+
this.model = this.createModel(wasOpen);
|
|
242
|
+
}
|
|
243
|
+
if (changedProperties.has('open') && this.model.state.isOpen() !== this.open) {
|
|
244
|
+
if (this.open) {
|
|
245
|
+
this.model.actions.open();
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.model.actions.close();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (changedProperties.has('open')) {
|
|
252
|
+
this.clearAnimationQueue();
|
|
253
|
+
if (this.open) {
|
|
254
|
+
this.overlayVisible = true;
|
|
255
|
+
this.renderState = this.hasUpdated ? 'closed' : 'open';
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
this.renderState = 'closed';
|
|
259
|
+
if (!this.hasUpdated) {
|
|
260
|
+
this.overlayVisible = false;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
this.shouldAnimatePresence = this.hasUpdated;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
updated(changedProperties) {
|
|
267
|
+
super.updated(changedProperties);
|
|
268
|
+
this.syncOutsideFocusListener();
|
|
269
|
+
this.syncScrollLock();
|
|
270
|
+
if (changedProperties.has('open')) {
|
|
271
|
+
this.syncRenderedState();
|
|
272
|
+
if (this.suppressLifecycleFromUpdate) {
|
|
273
|
+
this.suppressLifecycleFromUpdate = false;
|
|
274
|
+
}
|
|
275
|
+
else if (changedProperties.get('open') !== this.open) {
|
|
276
|
+
this.dispatchLifecycleTransition(this.open);
|
|
277
|
+
}
|
|
278
|
+
if (this.shouldAnimatePresence) {
|
|
279
|
+
if (this.open) {
|
|
280
|
+
this.startOpenAnimation();
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
this.startCloseAnimation();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
this.shouldAnimatePresence = false;
|
|
287
|
+
if (this.open) {
|
|
288
|
+
this.focusInitialTarget();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
clearAnimationQueue() {
|
|
293
|
+
if (this.openAnimationFrame) {
|
|
294
|
+
cancelAnimationFrame(this.openAnimationFrame);
|
|
295
|
+
this.openAnimationFrame = 0;
|
|
296
|
+
}
|
|
297
|
+
if (this.closeAnimationTimeout) {
|
|
298
|
+
window.clearTimeout(this.closeAnimationTimeout);
|
|
299
|
+
this.closeAnimationTimeout = 0;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
startOpenAnimation() {
|
|
303
|
+
this.openAnimationFrame = requestAnimationFrame(() => {
|
|
304
|
+
this.openAnimationFrame = 0;
|
|
305
|
+
if (!this.open)
|
|
306
|
+
return;
|
|
307
|
+
this.renderState = 'open';
|
|
308
|
+
this.syncRenderedState();
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
startCloseAnimation() {
|
|
312
|
+
const duration = this.getTransitionDuration();
|
|
313
|
+
if (duration === 0) {
|
|
314
|
+
this.overlayVisible = false;
|
|
315
|
+
this.syncRenderedState();
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
this.closeAnimationTimeout = window.setTimeout(() => {
|
|
319
|
+
this.closeAnimationTimeout = 0;
|
|
320
|
+
if (this.open)
|
|
321
|
+
return;
|
|
322
|
+
this.overlayVisible = false;
|
|
323
|
+
this.syncRenderedState();
|
|
324
|
+
}, duration);
|
|
325
|
+
}
|
|
326
|
+
syncRenderedState() {
|
|
327
|
+
const overlay = this.shadowRoot?.querySelector('[part="overlay"]');
|
|
328
|
+
const panel = this.shadowRoot?.querySelector('[part="panel"]');
|
|
329
|
+
if (overlay) {
|
|
330
|
+
overlay.hidden = !this.overlayVisible;
|
|
331
|
+
overlay.dataset['state'] = this.renderState;
|
|
332
|
+
}
|
|
333
|
+
if (panel) {
|
|
334
|
+
panel.dataset['state'] = this.renderState;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
getTransitionDuration() {
|
|
338
|
+
const overlay = this.shadowRoot?.querySelector('[part="overlay"]');
|
|
339
|
+
const panel = this.shadowRoot?.querySelector('[part="panel"]');
|
|
340
|
+
return Math.max(this.readTransitionDuration(overlay), this.readTransitionDuration(panel));
|
|
341
|
+
}
|
|
342
|
+
readTransitionDuration(element) {
|
|
343
|
+
if (!element)
|
|
344
|
+
return 0;
|
|
345
|
+
const styles = getComputedStyle(element);
|
|
346
|
+
const durations = this.parseTimeValues(styles.transitionDuration);
|
|
347
|
+
const delays = this.parseTimeValues(styles.transitionDelay);
|
|
348
|
+
const transitionCount = Math.max(durations.length, delays.length);
|
|
349
|
+
let maxDuration = 0;
|
|
350
|
+
for (let index = 0; index < transitionCount; index += 1) {
|
|
351
|
+
const duration = durations[index] ?? durations[durations.length - 1] ?? 0;
|
|
352
|
+
const delay = delays[index] ?? delays[delays.length - 1] ?? 0;
|
|
353
|
+
maxDuration = Math.max(maxDuration, duration + delay);
|
|
354
|
+
}
|
|
355
|
+
return maxDuration;
|
|
356
|
+
}
|
|
357
|
+
parseTimeValues(value) {
|
|
358
|
+
return value
|
|
359
|
+
.split(',')
|
|
360
|
+
.map((entry) => entry.trim())
|
|
361
|
+
.filter(Boolean)
|
|
362
|
+
.map((entry) => {
|
|
363
|
+
if (entry.endsWith('ms'))
|
|
364
|
+
return Number.parseFloat(entry);
|
|
365
|
+
if (entry.endsWith('s'))
|
|
366
|
+
return Number.parseFloat(entry) * 1000;
|
|
367
|
+
return Number.parseFloat(entry) || 0;
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
createModel(initialOpen = this.open) {
|
|
371
|
+
return createDrawer({
|
|
372
|
+
idBase: this.idBase,
|
|
373
|
+
initialOpen,
|
|
374
|
+
isModal: this.modal,
|
|
375
|
+
type: this.type,
|
|
376
|
+
placement: this.placement,
|
|
377
|
+
closeOnEscape: this.closeOnEscape,
|
|
378
|
+
closeOnOutsidePointer: this.closeOnOutsidePointer,
|
|
379
|
+
closeOnOutsideFocus: this.closeOnOutsideFocus,
|
|
380
|
+
initialFocusId: this.initialFocusId || undefined,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
captureState() {
|
|
384
|
+
return {
|
|
385
|
+
open: this.model.state.isOpen(),
|
|
386
|
+
restoreTargetId: this.model.state.restoreTargetId(),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
dispatchInput(detail) {
|
|
390
|
+
this.dispatchEvent(new CustomEvent('cv-input', {
|
|
391
|
+
detail,
|
|
392
|
+
bubbles: true,
|
|
393
|
+
composed: true,
|
|
394
|
+
}));
|
|
395
|
+
}
|
|
396
|
+
dispatchChange(detail) {
|
|
397
|
+
this.dispatchEvent(new CustomEvent('cv-change', {
|
|
398
|
+
detail,
|
|
399
|
+
bubbles: true,
|
|
400
|
+
composed: true,
|
|
401
|
+
}));
|
|
402
|
+
}
|
|
403
|
+
dispatchLifecycleEvent(name) {
|
|
404
|
+
this.dispatchEvent(new CustomEvent(name, {
|
|
405
|
+
bubbles: true,
|
|
406
|
+
composed: true,
|
|
407
|
+
}));
|
|
408
|
+
}
|
|
409
|
+
dispatchLifecycleTransition(open) {
|
|
410
|
+
const token = ++this.lifecycleToken;
|
|
411
|
+
this.dispatchLifecycleEvent(open ? 'cv-show' : 'cv-hide');
|
|
412
|
+
this.updateComplete.then(() => {
|
|
413
|
+
if (this.lifecycleToken !== token)
|
|
414
|
+
return;
|
|
415
|
+
this.dispatchLifecycleEvent(open ? 'cv-after-show' : 'cv-after-hide');
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
applyInteractionResult(previous) {
|
|
419
|
+
const nextOpen = this.model.state.isOpen();
|
|
420
|
+
if (previous.open !== nextOpen) {
|
|
421
|
+
const detail = { open: nextOpen };
|
|
422
|
+
this.suppressLifecycleFromUpdate = true;
|
|
423
|
+
this.open = nextOpen;
|
|
424
|
+
this.dispatchLifecycleTransition(nextOpen);
|
|
425
|
+
this.dispatchInput(detail);
|
|
426
|
+
this.dispatchChange(detail);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
this.open = nextOpen;
|
|
430
|
+
}
|
|
431
|
+
const restoreTargetId = this.model.state.restoreTargetId();
|
|
432
|
+
if (restoreTargetId && previous.restoreTargetId !== restoreTargetId) {
|
|
433
|
+
const trigger = this.shadowRoot?.querySelector(`[id="${restoreTargetId}"]`);
|
|
434
|
+
trigger?.focus();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
syncOutsideFocusListener(forceOff = false) {
|
|
438
|
+
const shouldListen = !forceOff && this.open;
|
|
439
|
+
if (shouldListen) {
|
|
440
|
+
document.addEventListener('focusin', this.handleDocumentFocusIn);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
document.removeEventListener('focusin', this.handleDocumentFocusIn);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
syncScrollLock() {
|
|
447
|
+
if (!this.model.state.shouldLockScroll()) {
|
|
448
|
+
this.releaseScrollLock();
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (this.lockScrollApplied)
|
|
452
|
+
return;
|
|
453
|
+
this.previousBodyOverflow = document.body.style.overflow;
|
|
454
|
+
document.body.style.overflow = 'hidden';
|
|
455
|
+
this.lockScrollApplied = true;
|
|
456
|
+
}
|
|
457
|
+
releaseScrollLock() {
|
|
458
|
+
if (!this.lockScrollApplied)
|
|
459
|
+
return;
|
|
460
|
+
document.body.style.overflow = this.previousBodyOverflow;
|
|
461
|
+
this.lockScrollApplied = false;
|
|
462
|
+
}
|
|
463
|
+
focusInitialTarget() {
|
|
464
|
+
const panelProps = this.model.contracts.getPanelProps();
|
|
465
|
+
const requestedId = panelProps['data-initial-focus'];
|
|
466
|
+
if (requestedId) {
|
|
467
|
+
const explicit = this.querySelector(`#${requestedId}`) ??
|
|
468
|
+
this.shadowRoot?.querySelector(`#${requestedId}`);
|
|
469
|
+
if (explicit) {
|
|
470
|
+
explicit.focus();
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
const panel = this.shadowRoot?.querySelector('[part="panel"]');
|
|
475
|
+
panel?.focus();
|
|
476
|
+
}
|
|
477
|
+
handleDocumentFocusIn = (event) => {
|
|
478
|
+
if (!this.open)
|
|
479
|
+
return;
|
|
480
|
+
const path = event.composedPath();
|
|
481
|
+
if (path.includes(this))
|
|
482
|
+
return;
|
|
483
|
+
const previous = this.captureState();
|
|
484
|
+
this.model.actions.handleOutsideFocus();
|
|
485
|
+
this.applyInteractionResult(previous);
|
|
486
|
+
};
|
|
487
|
+
handleTriggerClick() {
|
|
488
|
+
const previous = this.captureState();
|
|
489
|
+
this.model.contracts.getTriggerProps().onClick();
|
|
490
|
+
this.applyInteractionResult(previous);
|
|
491
|
+
}
|
|
492
|
+
handleTriggerKeyDown(event) {
|
|
493
|
+
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
494
|
+
event.preventDefault();
|
|
495
|
+
}
|
|
496
|
+
const previous = this.captureState();
|
|
497
|
+
this.model.contracts.getTriggerProps().onKeyDown({ key: event.key });
|
|
498
|
+
this.applyInteractionResult(previous);
|
|
499
|
+
}
|
|
500
|
+
handleOverlayPointerDown(event) {
|
|
501
|
+
if (event.target !== event.currentTarget)
|
|
502
|
+
return;
|
|
503
|
+
const previous = this.captureState();
|
|
504
|
+
this.model.contracts.getOverlayProps().onPointerDownOutside();
|
|
505
|
+
this.applyInteractionResult(previous);
|
|
506
|
+
}
|
|
507
|
+
handlePanelKeyDown(event) {
|
|
508
|
+
if (event.key === 'Escape') {
|
|
509
|
+
event.preventDefault();
|
|
510
|
+
}
|
|
511
|
+
const previous = this.captureState();
|
|
512
|
+
this.model.contracts.getPanelProps().onKeyDown({ key: event.key });
|
|
513
|
+
this.applyInteractionResult(previous);
|
|
514
|
+
}
|
|
515
|
+
handleHeaderCloseClick() {
|
|
516
|
+
const previous = this.captureState();
|
|
517
|
+
this.model.contracts.getHeaderCloseButtonProps().onClick();
|
|
518
|
+
this.applyInteractionResult(previous);
|
|
519
|
+
}
|
|
520
|
+
render() {
|
|
521
|
+
const triggerProps = this.model.contracts.getTriggerProps();
|
|
522
|
+
const overlayProps = this.model.contracts.getOverlayProps();
|
|
523
|
+
const panelProps = this.model.contracts.getPanelProps();
|
|
524
|
+
const titleProps = this.model.contracts.getTitleProps();
|
|
525
|
+
const descriptionProps = this.model.contracts.getDescriptionProps();
|
|
526
|
+
const headerCloseProps = this.model.contracts.getHeaderCloseButtonProps();
|
|
527
|
+
return html `
|
|
528
|
+
<button
|
|
529
|
+
id=${triggerProps.id}
|
|
530
|
+
role=${triggerProps.role}
|
|
531
|
+
tabindex=${triggerProps.tabindex}
|
|
532
|
+
aria-haspopup=${triggerProps['aria-haspopup']}
|
|
533
|
+
aria-expanded=${triggerProps['aria-expanded']}
|
|
534
|
+
aria-controls=${triggerProps['aria-controls']}
|
|
535
|
+
part="trigger"
|
|
536
|
+
type="button"
|
|
537
|
+
@click=${this.handleTriggerClick}
|
|
538
|
+
@keydown=${this.handleTriggerKeyDown}
|
|
539
|
+
>
|
|
540
|
+
<slot name="trigger">Open drawer</slot>
|
|
541
|
+
</button>
|
|
542
|
+
|
|
543
|
+
<div
|
|
544
|
+
id=${overlayProps.id}
|
|
545
|
+
data-open=${overlayProps['data-open']}
|
|
546
|
+
data-state=${this.renderState}
|
|
547
|
+
?hidden=${!this.overlayVisible}
|
|
548
|
+
part="overlay"
|
|
549
|
+
@mousedown=${this.handleOverlayPointerDown}
|
|
550
|
+
>
|
|
551
|
+
<section
|
|
552
|
+
id=${panelProps.id}
|
|
553
|
+
role=${panelProps.role}
|
|
554
|
+
tabindex=${panelProps.tabindex}
|
|
555
|
+
aria-modal=${panelProps['aria-modal']}
|
|
556
|
+
aria-labelledby=${panelProps['aria-labelledby'] ?? nothing}
|
|
557
|
+
aria-describedby=${panelProps['aria-describedby'] ?? nothing}
|
|
558
|
+
data-placement=${panelProps['data-placement']}
|
|
559
|
+
data-state=${this.renderState}
|
|
560
|
+
data-initial-focus=${panelProps['data-initial-focus'] ?? nothing}
|
|
561
|
+
part="panel"
|
|
562
|
+
@keydown=${this.handlePanelKeyDown}
|
|
563
|
+
>
|
|
564
|
+
<header part="header" ?hidden=${this.noHeader}>
|
|
565
|
+
<h2 id=${titleProps.id} part="title">
|
|
566
|
+
<slot name="title">Drawer</slot>
|
|
567
|
+
</h2>
|
|
568
|
+
<p id=${descriptionProps.id} part="description">
|
|
569
|
+
<slot name="description"></slot>
|
|
570
|
+
</p>
|
|
571
|
+
<button
|
|
572
|
+
id=${headerCloseProps.id}
|
|
573
|
+
role=${headerCloseProps.role}
|
|
574
|
+
tabindex=${headerCloseProps.tabindex}
|
|
575
|
+
aria-label=${headerCloseProps['aria-label']}
|
|
576
|
+
type="button"
|
|
577
|
+
part="header-close"
|
|
578
|
+
@click=${this.handleHeaderCloseClick}
|
|
579
|
+
>
|
|
580
|
+
<slot name="header-close">✕</slot>
|
|
581
|
+
</button>
|
|
582
|
+
</header>
|
|
583
|
+
|
|
584
|
+
<div part="body">
|
|
585
|
+
<slot></slot>
|
|
586
|
+
</div>
|
|
587
|
+
|
|
588
|
+
<footer part="footer">
|
|
589
|
+
<slot name="footer"></slot>
|
|
590
|
+
</footer>
|
|
591
|
+
</section>
|
|
592
|
+
</div>
|
|
593
|
+
`;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
2
|
+
export declare class CVFeedArticle extends ReatomLitElement {
|
|
3
|
+
static elementName: string;
|
|
4
|
+
static get properties(): {
|
|
5
|
+
articleId: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
attribute: string;
|
|
8
|
+
reflect: boolean;
|
|
9
|
+
};
|
|
10
|
+
active: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
reflect: boolean;
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
reflect: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
articleId: string;
|
|
20
|
+
active: boolean;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
constructor();
|
|
23
|
+
static styles: import("lit").CSSResult[];
|
|
24
|
+
static define(): void;
|
|
25
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { css, html } from 'lit';
|
|
2
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
export class CVFeedArticle extends ReatomLitElement {
|
|
4
|
+
static elementName = 'cv-feed-article';
|
|
5
|
+
static get properties() {
|
|
6
|
+
return {
|
|
7
|
+
articleId: { type: String, attribute: 'article-id', reflect: true },
|
|
8
|
+
active: { type: Boolean, reflect: true },
|
|
9
|
+
disabled: { type: Boolean, reflect: true },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.articleId = '';
|
|
15
|
+
this.active = false;
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
}
|
|
18
|
+
static styles = [
|
|
19
|
+
css `
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part='base'] {
|
|
26
|
+
padding: var(--cv-feed-article-padding, var(--cv-space-3, 12px));
|
|
27
|
+
border-radius: var(--cv-feed-article-border-radius, var(--cv-radius-sm, 6px));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([active]) [part='base'] {
|
|
31
|
+
outline: var(--cv-feed-article-focus-ring, 2px solid var(--cv-color-primary, #65d7ff));
|
|
32
|
+
outline-offset: -2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([disabled]) {
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
];
|
|
40
|
+
static define() {
|
|
41
|
+
if (!customElements.get(this.elementName)) {
|
|
42
|
+
customElements.define(this.elementName, this);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return html `
|
|
47
|
+
<div part="base" role="article">
|
|
48
|
+
<slot></slot>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
}
|