@commmerce/ui 1.3.0 → 1.5.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/THIRD_PARTY_NOTICES.txt +101 -0
- package/dist/calendar.js +15 -19
- package/dist/cdn.js +1669 -1193
- package/dist/components/accordion.js +9 -8
- package/dist/components/action-bar.js +15 -15
- package/dist/components/action-menu.js +10 -9
- package/dist/components/app-card.js +15 -14
- package/dist/components/app-frame.d.ts +15 -0
- package/dist/components/app-frame.js +22 -2
- package/dist/components/badge.d.ts +2 -1
- package/dist/components/badge.js +4 -3
- package/dist/components/banner.js +6 -5
- package/dist/components/board.js +18 -18
- package/dist/components/bottom-navigation.d.ts +1 -1
- package/dist/components/bottom-navigation.js +9 -7
- package/dist/components/bottom-sheet.d.ts +1 -1
- package/dist/components/bottom-sheet.js +9 -8
- package/dist/components/button.d.ts +3 -3
- package/dist/components/button.js +22 -19
- package/dist/components/calendar.d.ts +380 -0
- package/dist/components/calendar.js +1480 -0
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +18 -12
- package/dist/components/checkbox.js +8 -7
- package/dist/components/color-field.js +9 -13
- package/dist/components/combobox.d.ts +8 -0
- package/dist/components/combobox.js +18 -18
- package/dist/components/comment.d.ts +1 -1
- package/dist/components/comment.js +12 -13
- package/dist/components/data-table.js +12 -11
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +7 -7
- package/dist/components/empty-state.d.ts +1 -1
- package/dist/components/empty-state.js +16 -16
- package/dist/components/file-upload.js +18 -16
- package/dist/components/filter-panel.js +1 -1
- package/dist/components/flash-offer-bar.js +8 -7
- package/dist/components/global-search.d.ts +1 -1
- package/dist/components/global-search.js +12 -9
- package/dist/components/grid.d.ts +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/header-bar.js +38 -31
- package/dist/components/info-panel.d.ts +1 -1
- package/dist/components/info-panel.js +11 -10
- package/dist/components/layout.d.ts +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link-tabs.js +8 -7
- package/dist/components/metric.js +4 -4
- package/dist/components/mobile-menu.js +16 -15
- package/dist/components/modal.js +2 -1
- package/dist/components/nested-list.d.ts +2 -2
- package/dist/components/nested-list.js +21 -22
- package/dist/components/notification-panel.js +12 -11
- package/dist/components/option-group.js +10 -11
- package/dist/components/page-header.js +16 -15
- package/dist/components/page.d.ts +18 -4
- package/dist/components/page.js +22 -7
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +16 -9
- package/dist/components/progress-bar.js +4 -3
- package/dist/components/radio.js +12 -12
- package/dist/components/report-tile.d.ts +2 -2
- package/dist/components/report-tile.js +18 -18
- package/dist/components/resource-list.d.ts +22 -6
- package/dist/components/resource-list.js +92 -52
- package/dist/components/save-bar.js +8 -8
- package/dist/components/search.d.ts +5 -2
- package/dist/components/search.js +20 -14
- package/dist/components/segmented-control.d.ts +67 -0
- package/dist/components/segmented-control.js +76 -0
- package/dist/components/select.d.ts +8 -0
- package/dist/components/select.js +18 -18
- package/dist/components/side-navigation.js +20 -17
- package/dist/components/side-panel.js +4 -3
- package/dist/components/signature-field.d.ts +153 -0
- package/dist/components/signature-field.js +728 -0
- package/dist/components/skeleton-display.js +4 -4
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/skeleton.js +2 -2
- package/dist/components/smart-tip.d.ts +1 -1
- package/dist/components/smart-tip.js +16 -16
- package/dist/components/spinner.js +1 -1
- package/dist/components/stack.d.ts +1 -1
- package/dist/components/stack.js +1 -1
- package/dist/components/status-tabs.d.ts +4 -3
- package/dist/components/status-tabs.js +26 -12
- package/dist/components/table-header.d.ts +4 -3
- package/dist/components/table-header.js +22 -15
- package/dist/components/tag.js +3 -4
- package/dist/components/text-field.d.ts +1 -1
- package/dist/components/text-field.js +8 -15
- package/dist/components/thumbnail.js +1 -1
- package/dist/components/timeline.js +12 -11
- package/dist/components/toast.js +6 -6
- package/dist/components/toggle.js +12 -11
- package/dist/components/tooltip.js +4 -3
- package/dist/custom-elements.json +13655 -9770
- package/dist/field.d.ts +15 -0
- package/dist/field.js +47 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/overlay.js +5 -4
- package/dist/popover.js +8 -8
- package/dist/spacing.d.ts +14 -4
- package/dist/spacing.js +13 -4
- package/package.json +3 -3
|
@@ -215,7 +215,8 @@ _CmFileUpload_internals = new WeakMap(), _CmFileUpload_id = new WeakMap(), _CmFi
|
|
|
215
215
|
aria-labelledby=${[this.label && `${__classPrivateFieldGet(this, _CmFileUpload_id, "f")}-l`, `${__classPrivateFieldGet(this, _CmFileUpload_id, "f")}-p`].filter(Boolean).join(' ')}
|
|
216
216
|
aria-describedby=${described || nothing} aria-invalid=${this.error || this._rejected ? 'true' : nothing}
|
|
217
217
|
@change=${__classPrivateFieldGet(this, _CmFileUpload_instances, "m", _CmFileUpload_onInputChange)} @cancel=${(e) => e.stopPropagation()} />
|
|
218
|
-
<cm-icon name=${tile ? 'plus' : 'upload'} size=${tile ? 24 :
|
|
218
|
+
<cm-icon name=${tile ? 'plus' : 'upload'} size=${tile ? 24 : 32}
|
|
219
|
+
></cm-icon>
|
|
219
220
|
<span id="${__classPrivateFieldGet(this, _CmFileUpload_id, "f")}-p">${tile ? this.t('addMore') : this.prompt}</span>
|
|
220
221
|
</label>`;
|
|
221
222
|
}, _CmFileUpload_retake = function _CmFileUpload_retake() { this.renderRoot.querySelector('input[type=file]')?.click(); }, _CmFileUpload_renderPhoto = function _CmFileUpload_renderPhoto() {
|
|
@@ -274,14 +275,14 @@ CmFileUpload.styles = [
|
|
|
274
275
|
base,
|
|
275
276
|
css `
|
|
276
277
|
:host { display: block; }
|
|
277
|
-
.head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-
|
|
278
|
-
.label { font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
|
|
278
|
+
.head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-8); margin-bottom: var(--cm-space-12); }
|
|
279
|
+
.label { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
|
|
279
280
|
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
280
281
|
.hint { font-size: 12px; color: var(--cm-text-tertiary); }
|
|
281
|
-
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 186px)); gap: var(--cm-space-
|
|
282
|
+
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 186px)); gap: var(--cm-space-24); }
|
|
282
283
|
.zone {
|
|
283
|
-
position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-
|
|
284
|
-
min-height:
|
|
284
|
+
position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-8);
|
|
285
|
+
min-height: 160px; padding: var(--cm-space-20); text-align: center; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); color: var(--cm-text-default);
|
|
285
286
|
background: var(--cm-bg-surface); border: var(--cm-border-1) dashed var(--cm-border-strong); cursor: pointer;
|
|
286
287
|
}
|
|
287
288
|
.zone:hover, :host([data-over]) .zone { background: var(--cm-bg-hover); }
|
|
@@ -290,10 +291,10 @@ CmFileUpload.styles = [
|
|
|
290
291
|
.zone:focus-within { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
291
292
|
.file {
|
|
292
293
|
position: relative; aspect-ratio: 1; border-radius: var(--cm-radius-md); background: var(--cm-bg-inset);
|
|
293
|
-
border: var(--cm-border-1) solid var(--cm-border-
|
|
294
|
+
border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
294
295
|
}
|
|
295
296
|
.file img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
|
|
296
|
-
.doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap:
|
|
297
|
+
.doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-4); height: 100%; padding: var(--cm-space-8); text-align: center; }
|
|
297
298
|
.doc .name { font-size: 12px; word-break: break-all; }
|
|
298
299
|
.doc .size, .tile .size { font-size: 12px; color: var(--cm-text-tertiary); }
|
|
299
300
|
.remove {
|
|
@@ -302,8 +303,8 @@ CmFileUpload.styles = [
|
|
|
302
303
|
background: var(--cm-bg-surface); color: var(--cm-icon-selected); border: var(--cm-border-1) solid var(--cm-border-input);
|
|
303
304
|
}
|
|
304
305
|
.remove:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
305
|
-
.msg { margin: var(--cm-space-
|
|
306
|
-
:host([disabled]) .zone { cursor: not-allowed; background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-
|
|
306
|
+
.msg { margin: var(--cm-space-8) 0 0; font-size: 12px; color: var(--cm-text-critical); }
|
|
307
|
+
:host([disabled]) .zone { cursor: not-allowed; background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); }
|
|
307
308
|
:host([disabled]) .remove { display: none; }
|
|
308
309
|
/* variant="photo" (1.3) */
|
|
309
310
|
.zone.photo { min-height: 0; aspect-ratio: 4 / 3; border-radius: var(--cm-radius-md); font-size: 14px; }
|
|
@@ -311,22 +312,23 @@ CmFileUpload.styles = [
|
|
|
311
312
|
.photo-label { font-weight: 500; overflow-wrap: anywhere; }
|
|
312
313
|
.shot {
|
|
313
314
|
aspect-ratio: 4 / 3; border-radius: var(--cm-radius-md); overflow: hidden;
|
|
314
|
-
background: var(--cm-bg-inset); border: var(--cm-border-1) solid var(--cm-border-
|
|
315
|
+
background: var(--cm-bg-inset); border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
315
316
|
}
|
|
316
317
|
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
317
|
-
.caption { margin: var(--cm-space-
|
|
318
|
+
.caption { margin: var(--cm-space-8) 0 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
|
|
318
319
|
.caption:empty { display: none; }
|
|
319
|
-
.actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-
|
|
320
|
+
.actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); margin-top: var(--cm-space-8); }
|
|
320
321
|
.action {
|
|
321
|
-
display: inline-flex; align-items: center; justify-content: center; gap:
|
|
322
|
-
min-height:
|
|
322
|
+
display: inline-flex; align-items: center; justify-content: center; gap: var(--cm-space-8); flex: 1 1 0; min-width: max-content;
|
|
323
|
+
min-height: var(--cm-control-height-md); padding: 0 var(--cm-space-12); font: inherit; font-size: var(--cm-font-size-14); font-weight: 500; cursor: pointer;
|
|
323
324
|
background: var(--cm-bg-hover); color: var(--cm-text-default);
|
|
324
325
|
border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-sm);
|
|
325
326
|
}
|
|
326
327
|
.action:hover { background: var(--cm-bg-surface); }
|
|
327
328
|
.action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
329
|
+
@media (pointer: coarse) { .action { min-height: var(--cm-control-height-touch); } }
|
|
328
330
|
@media (max-width: 640px) {
|
|
329
|
-
.zone:not(.tile):not(.photo) { min-height: 100px;
|
|
331
|
+
.zone:not(.tile):not(.photo) { min-height: 100px; }
|
|
330
332
|
.label { font-size: var(--cm-type-heading-sm-resp-size); }
|
|
331
333
|
}
|
|
332
334
|
`,
|
|
@@ -124,7 +124,7 @@ CmFilterPanel.styles = [
|
|
|
124
124
|
css `
|
|
125
125
|
.search { display: block; margin-bottom: var(--cm-space-20); }
|
|
126
126
|
.foot { justify-content: center; }
|
|
127
|
-
::slotted(form) { display: grid; gap: var(--cm-space-
|
|
127
|
+
::slotted(form) { display: grid; gap: var(--cm-space-12); }
|
|
128
128
|
`,
|
|
129
129
|
];
|
|
130
130
|
define('cm-filter-panel', CmFilterPanel);
|
|
@@ -35,7 +35,8 @@ export class CmFlashOfferBar extends CmLocalizedElement {
|
|
|
35
35
|
return html `<div class="bar" part="bar" role="region" aria-label=${this.label || this.t('label')}>
|
|
36
36
|
<span class="icon" aria-hidden="true"><slot name="icon">${this.icon ? html `<cm-icon name=${this.icon} size="20"></cm-icon>` : nothing}</slot></span>
|
|
37
37
|
<span class="text"><slot></slot></span>
|
|
38
|
-
${this.dismissible ? html `<button type="button" class="close" part="close" aria-label=${this.t('dismiss')} @click=${__classPrivateFieldGet(this, _CmFlashOfferBar_instances, "m", _CmFlashOfferBar_dismiss)}><cm-icon name="close" size="
|
|
38
|
+
${this.dismissible ? html `<button type="button" class="close" part="close" aria-label=${this.t('dismiss')} @click=${__classPrivateFieldGet(this, _CmFlashOfferBar_instances, "m", _CmFlashOfferBar_dismiss)}><cm-icon name="close" size="16"></cm-icon>
|
|
39
|
+
</button>` : nothing}
|
|
39
40
|
</div>`;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -54,16 +55,16 @@ CmFlashOfferBar.styles = [
|
|
|
54
55
|
css `
|
|
55
56
|
:host { display: block; }
|
|
56
57
|
.bar {
|
|
57
|
-
position: relative; display: flex; align-items: center; justify-content: center; gap:
|
|
58
|
-
padding:
|
|
59
|
-
font-size:
|
|
58
|
+
position: relative; display: flex; align-items: center; justify-content: center; gap: var(--cm-space-8); min-height: 48px;
|
|
59
|
+
padding: var(--cm-space-8) var(--cm-space-20); background: var(--cm-bg-flash-bar); color: var(--cm-text-on-dark);
|
|
60
|
+
font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); text-align: center;
|
|
60
61
|
}
|
|
61
|
-
:host([dismissible]) .bar { padding-inline:
|
|
62
|
+
:host([dismissible]) .bar { padding-inline: 48px; }
|
|
62
63
|
.icon { display: inline-flex; color: var(--cm-text-speciality-on-dark); flex: none; }
|
|
63
64
|
/* !important: page link colours (usually blue) would otherwise win over ::slotted and fail contrast on the dark bar. */
|
|
64
65
|
::slotted(a) { color: var(--cm-text-speciality-on-dark) !important; font-weight: 500; text-decoration: none; }
|
|
65
66
|
::slotted(a:hover) { text-decoration: underline; }
|
|
66
|
-
::slotted(a:focus-visible) { outline: 2px solid var(--cm-text-on-dark); outline-offset: 2px; border-radius:
|
|
67
|
+
::slotted(a:focus-visible) { outline: 2px solid var(--cm-text-on-dark); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
67
68
|
.close {
|
|
68
69
|
position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
|
|
69
70
|
width: 32px; height: 32px; padding: 0; color: var(--cm-text-on-dark); background: none; border: 0; border-radius: 50%; cursor: pointer;
|
|
@@ -71,7 +72,7 @@ CmFlashOfferBar.styles = [
|
|
|
71
72
|
.close:hover { background: var(--cm-nav-active); }
|
|
72
73
|
.close:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 0; }
|
|
73
74
|
@media (max-width: 640px) {
|
|
74
|
-
.bar {
|
|
75
|
+
.bar { min-height: 44px; justify-content: flex-start; text-align: start; }
|
|
75
76
|
}
|
|
76
77
|
`,
|
|
77
78
|
];
|
|
@@ -67,7 +67,7 @@ declare module '../localize.js' {
|
|
|
67
67
|
* @csspart listbox - The grouped list of results.
|
|
68
68
|
* @cssprop --cm-global-search-results-position - `position` of the results panel. Default `absolute` (over the page); the header bar's full-screen layer sets `static`.
|
|
69
69
|
* @cssprop --cm-global-search-results-max-height - Tallest the results panel gets before it scrolls. Default `min(480px, 100dvh - 140px)`.
|
|
70
|
-
* @cssprop --cm-global-search-results-shadow - Shadow of the results panel. Default `var(--cm-shadow-
|
|
70
|
+
* @cssprop --cm-global-search-results-shadow - Shadow of the results panel. Default `var(--cm-shadow-md)`.
|
|
71
71
|
*/
|
|
72
72
|
export declare class CmGlobalSearch extends CmLocalizedElement {
|
|
73
73
|
#private;
|
|
@@ -48,7 +48,7 @@ const strings = defineStrings('globalSearch', {
|
|
|
48
48
|
* @csspart listbox - The grouped list of results.
|
|
49
49
|
* @cssprop --cm-global-search-results-position - `position` of the results panel. Default `absolute` (over the page); the header bar's full-screen layer sets `static`.
|
|
50
50
|
* @cssprop --cm-global-search-results-max-height - Tallest the results panel gets before it scrolls. Default `min(480px, 100dvh - 140px)`.
|
|
51
|
-
* @cssprop --cm-global-search-results-shadow - Shadow of the results panel. Default `var(--cm-shadow-
|
|
51
|
+
* @cssprop --cm-global-search-results-shadow - Shadow of the results panel. Default `var(--cm-shadow-md)`.
|
|
52
52
|
*/
|
|
53
53
|
export class CmGlobalSearch extends CmLocalizedElement {
|
|
54
54
|
constructor() {
|
|
@@ -163,7 +163,8 @@ export class CmGlobalSearch extends CmLocalizedElement {
|
|
|
163
163
|
return html `<div class="wrap">
|
|
164
164
|
<div class="box" part="box" @click=${(e) => { if (e.target === e.currentTarget)
|
|
165
165
|
this.focus(); }}>
|
|
166
|
-
<cm-icon class="icon" name="search" size="
|
|
166
|
+
<cm-icon class="icon" name="search" size="16"></cm-icon>
|
|
167
|
+
|
|
167
168
|
<input id="${__classPrivateFieldGet(this, _CmGlobalSearch_id, "f")}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
|
|
168
169
|
aria-label=${this.label} placeholder=${this.placeholder || nothing} .value=${live(this.value)}
|
|
169
170
|
aria-autocomplete="list" aria-expanded=${showing ? 'true' : 'false'} aria-controls="${__classPrivateFieldGet(this, _CmGlobalSearch_id, "f")}-list"
|
|
@@ -251,7 +252,7 @@ CmGlobalSearch.styles = [
|
|
|
251
252
|
:host { display: block; position: relative; }
|
|
252
253
|
.wrap { position: relative; }
|
|
253
254
|
.box {
|
|
254
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
255
|
+
display: flex; align-items: center; gap: var(--cm-space-8); height: var(--cm-control-height-md); padding-block: 0; padding-inline: var(--cm-space-12) var(--cm-space-8);
|
|
255
256
|
background: var(--cm-bg-page); color: var(--cm-text-default);
|
|
256
257
|
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
|
|
257
258
|
}
|
|
@@ -271,19 +272,19 @@ CmGlobalSearch.styles = [
|
|
|
271
272
|
.clear:hover { background: var(--cm-bg-hover); }
|
|
272
273
|
.clear:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
273
274
|
kbd {
|
|
274
|
-
flex: none; min-width: 20px; padding: 0
|
|
275
|
-
color: var(--cm-text-tertiary); border: var(--cm-border-1) solid var(--cm-border-
|
|
275
|
+
flex: none; min-width: 20px; padding: 0 var(--cm-space-4); font: inherit; font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); text-align: center;
|
|
276
|
+
color: var(--cm-text-tertiary); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-xs);
|
|
276
277
|
}
|
|
277
278
|
.box:focus-within kbd { display: none; }
|
|
278
279
|
.pop {
|
|
279
280
|
position: var(--cm-global-search-results-position, absolute);
|
|
280
|
-
box-shadow: var(--cm-global-search-results-shadow, var(--cm-shadow-
|
|
281
|
+
box-shadow: var(--cm-global-search-results-shadow, var(--cm-shadow-md));
|
|
281
282
|
overflow-y: auto; max-height: var(--cm-global-search-results-max-height, min(480px, calc(100dvh - 140px)));
|
|
282
283
|
}
|
|
283
|
-
[role='listbox'] { padding-block:
|
|
284
|
+
[role='listbox'] { padding-block: var(--cm-space-4); }
|
|
284
285
|
[role='listbox'][hidden] { display: none; }
|
|
285
286
|
[role='option'] {
|
|
286
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
287
|
+
display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md); padding: var(--cm-space-8) var(--cm-space-12);
|
|
287
288
|
font-size: 14px; line-height: 20px; color: var(--cm-text-default); text-decoration: none; cursor: pointer;
|
|
288
289
|
}
|
|
289
290
|
[role='option'].active { background: var(--cm-bg-hover); box-shadow: inset 2px 0 0 var(--cm-border-strong); }
|
|
@@ -292,7 +293,9 @@ CmGlobalSearch.styles = [
|
|
|
292
293
|
.text { flex: 1; min-width: 0; }
|
|
293
294
|
.title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
294
295
|
.desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
|
|
295
|
-
.all { font-size:
|
|
296
|
+
.all { font-size: var(--cm-font-size-13); text-decoration: underline; }
|
|
297
|
+
.gh { padding-inline: var(--cm-space-12); }
|
|
298
|
+
@media (pointer: coarse) { .box { min-height: var(--cm-control-height-touch); } input { font-size: var(--cm-font-size-16); } }
|
|
296
299
|
`,
|
|
297
300
|
];
|
|
298
301
|
define('cm-global-search', CmGlobalSearch);
|
|
@@ -27,7 +27,7 @@ export declare class CmGrid extends LitElement {
|
|
|
27
27
|
* Never wider than the grid, so it reaches one column on its own on narrow screens.
|
|
28
28
|
*/
|
|
29
29
|
minColumnWidth?: string;
|
|
30
|
-
/** Space between items: a spacing step (`0`, `
|
|
30
|
+
/** Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`. */
|
|
31
31
|
gap: SpaceStep;
|
|
32
32
|
static styles: import("lit").CSSResult[];
|
|
33
33
|
render(): import("lit-html").TemplateResult<1>;
|
package/dist/components/grid.js
CHANGED
|
@@ -13,7 +13,7 @@ export class CmGrid extends LitElement {
|
|
|
13
13
|
super(...arguments);
|
|
14
14
|
/** Number of columns. Default 2. Ignored when `min-column-width` is set. */
|
|
15
15
|
this.columns = 2;
|
|
16
|
-
/** Space between items: a spacing step (`0`, `
|
|
16
|
+
/** Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`. */
|
|
17
17
|
this.gap = '20';
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
@@ -142,7 +142,7 @@ export class CmHeaderBar extends CmLocalizedElement {
|
|
|
142
142
|
<header part="bar" role="banner" aria-label=${this.label || nothing}>
|
|
143
143
|
<div class="logo"><slot name="logo"></slot></div>
|
|
144
144
|
${this.store ? html `<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t('store', { store: this.store })}
|
|
145
|
-
@click=${() => __classPrivateFieldGet(this, _CmHeaderBar_instances, "m", _CmHeaderBar_fire).call(this, 'cm-store-switch')}><span>${this.store}</span><cm-icon name="chevron-down" size="
|
|
145
|
+
@click=${() => __classPrivateFieldGet(this, _CmHeaderBar_instances, "m", _CmHeaderBar_fire).call(this, 'cm-store-switch')}><span>${this.store}</span><cm-icon name="chevron-down" size="16"></cm-icon></button>` : nothing}
|
|
146
146
|
${this._narrow ? nothing : html `<div class="search${this._hasSearch ? ' has' : ''}" part="search"><slot name="search" @slotchange=${__classPrivateFieldGet(this, _CmHeaderBar_instances, "m", _CmHeaderBar_onSearchSlot)}></slot></div>`}
|
|
147
147
|
<span class="grow"></span>
|
|
148
148
|
<div class="end">
|
|
@@ -196,41 +196,50 @@ CmHeaderBar.properties = {
|
|
|
196
196
|
CmHeaderBar.styles = [
|
|
197
197
|
base,
|
|
198
198
|
css `
|
|
199
|
-
:host {
|
|
199
|
+
:host {
|
|
200
|
+
display: block; background: var(--cm-bg-surface); container-type: inline-size;
|
|
201
|
+
--_h: var(--cm-control-height-md); --_touch: var(--cm-control-height-touch);
|
|
202
|
+
}
|
|
203
|
+
/* 56px: a 40px row with space-8 above and below. Every control in the bar is control-height-md (36px). */
|
|
200
204
|
header {
|
|
201
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
205
|
+
display: flex; align-items: center; gap: var(--cm-space-16);
|
|
206
|
+
min-height: calc(var(--cm-control-height-lg) + 2 * var(--cm-space-8));
|
|
207
|
+
padding-block: var(--cm-space-8); padding-inline: var(--cm-space-20);
|
|
208
|
+
font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14);
|
|
202
209
|
}
|
|
203
210
|
.logo { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
|
|
204
|
-
::slotted([slot='logo']) { display: block; max-height:
|
|
211
|
+
::slotted([slot='logo']) { display: block; max-height: var(--cm-space-24); width: auto; max-width: 100%; object-fit: contain; }
|
|
205
212
|
.store, .pill, .user {
|
|
206
|
-
display: inline-flex; align-items: center; gap:
|
|
207
|
-
background: none; cursor: pointer;
|
|
213
|
+
display: inline-flex; align-items: center; gap: var(--cm-space-8); min-height: var(--_h); box-sizing: border-box;
|
|
214
|
+
font: inherit; font-weight: 500; color: var(--cm-text-default); background: none; cursor: pointer;
|
|
208
215
|
}
|
|
209
216
|
.store {
|
|
210
|
-
margin-inline-start:
|
|
217
|
+
margin-inline-start: var(--cm-space-24); padding: 0 var(--cm-space-8); border: 0; border-radius: var(--cm-radius-sm);
|
|
218
|
+
min-width: 0; flex: 0 1 auto;
|
|
211
219
|
}
|
|
212
220
|
.store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
213
221
|
.store:hover { background: var(--cm-bg-hover); }
|
|
214
222
|
.grow { flex: 1; }
|
|
215
|
-
.end { display: flex; align-items: center; gap: var(--cm-space-
|
|
216
|
-
.actions { display: flex; align-items: center; gap: var(--cm-space-
|
|
223
|
+
.end { display: flex; align-items: center; gap: var(--cm-space-12); flex: none; white-space: nowrap; }
|
|
224
|
+
.actions { display: flex; align-items: center; gap: var(--cm-space-8); }
|
|
217
225
|
.pill {
|
|
218
|
-
|
|
219
|
-
border: var(--cm-border-1) solid var(--cm-border-
|
|
226
|
+
padding: 0 var(--cm-space-12); font-variant-numeric: tabular-nums;
|
|
227
|
+
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
|
|
220
228
|
}
|
|
221
229
|
.pill:hover, .user:hover { background: var(--cm-bg-hover); }
|
|
230
|
+
/* The user pill: 36px, 14px name, 28px avatar (the pill's height less space-4), centred. */
|
|
222
231
|
.user {
|
|
223
|
-
|
|
224
|
-
border: var(--cm-border-1) solid var(--cm-border-
|
|
232
|
+
padding-block: 0; padding-inline: var(--cm-space-12) var(--cm-space-4);
|
|
233
|
+
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-full);
|
|
225
234
|
}
|
|
226
|
-
.avatar { --cm-avatar-size:
|
|
235
|
+
.avatar { --cm-avatar-size: calc(var(--_h) - 2 * var(--cm-space-4)); }
|
|
227
236
|
.search { display: none; flex: 1 1 240px; min-width: 200px; max-width: 560px; }
|
|
228
237
|
.search.has { display: block; }
|
|
229
|
-
.search-btn {
|
|
230
|
-
display: inline-grid; place-items: center; flex: none; width:
|
|
238
|
+
.search-btn, .layer-close {
|
|
239
|
+
display: inline-grid; place-items: center; flex: none; width: var(--_h); height: var(--_h); padding: 0; border: 0;
|
|
231
240
|
border-radius: var(--cm-radius-sm); background: none; color: var(--cm-icon-selected); cursor: pointer;
|
|
232
241
|
}
|
|
233
|
-
.search-btn:hover { background: var(--cm-bg-hover); }
|
|
242
|
+
.search-btn:hover, .layer-close:hover { background: var(--cm-bg-hover); }
|
|
234
243
|
.layer {
|
|
235
244
|
position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
|
|
236
245
|
background: var(--cm-bg-surface); color: var(--cm-text-default); font: inherit;
|
|
@@ -238,33 +247,31 @@ CmHeaderBar.styles = [
|
|
|
238
247
|
}
|
|
239
248
|
.layer[open] { display: flex; flex-direction: column; }
|
|
240
249
|
.layer::backdrop { background: var(--cm-bg-surface); }
|
|
241
|
-
.layer-bar { display: flex; align-items: flex-start; gap: var(--cm-space-
|
|
250
|
+
.layer-bar { display: flex; align-items: flex-start; gap: var(--cm-space-8); flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--cm-space-8) var(--cm-space-16); }
|
|
242
251
|
.layer-search { flex: 1; min-width: 0; }
|
|
243
|
-
.layer-close {
|
|
244
|
-
display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0;
|
|
245
|
-
border-radius: var(--cm-radius-sm); background: none; color: var(--cm-icon-selected); cursor: pointer;
|
|
246
|
-
}
|
|
247
|
-
.layer-close:hover { background: var(--cm-bg-hover); }
|
|
248
252
|
button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
/* Touch screens: every control in the bar is at least 44 x 44. */
|
|
254
|
+
@media (pointer: coarse) {
|
|
255
|
+
.store, .pill, .user, .search-btn, .layer-close { min-height: var(--_touch); }
|
|
256
|
+
.search-btn, .layer-close { width: var(--_touch); height: var(--_touch); }
|
|
251
257
|
}
|
|
252
258
|
@container (max-width: 1100px) {
|
|
253
|
-
.store {
|
|
259
|
+
.store { margin-inline-start: 0; }
|
|
254
260
|
}
|
|
255
261
|
@container (max-width: 900px) {
|
|
256
262
|
.actions { display: none; }
|
|
257
263
|
}
|
|
258
264
|
@container (max-width: 640px) {
|
|
259
|
-
header {
|
|
265
|
+
header { gap: var(--cm-space-8); padding-inline: var(--cm-space-16); }
|
|
260
266
|
.actions, .pill { display: none; }
|
|
261
|
-
.
|
|
262
|
-
.user { padding: 2px; min-height: 0; border-color: transparent; }
|
|
267
|
+
.user { padding: 0; min-width: var(--_h); justify-content: center; border-color: transparent; }
|
|
263
268
|
.user .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
264
|
-
|
|
265
|
-
/* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
|
|
269
|
+
/* The controls on the right keep their touch areas, so they need no gap between them; the logo gives way first. */
|
|
266
270
|
.end { gap: 0; }
|
|
267
271
|
}
|
|
272
|
+
@media (pointer: coarse) {
|
|
273
|
+
@container (max-width: 640px) { .user { min-width: var(--_touch); } }
|
|
274
|
+
}
|
|
268
275
|
`,
|
|
269
276
|
];
|
|
270
277
|
define('cm-header-bar', CmHeaderBar);
|
|
@@ -23,7 +23,7 @@ export declare class CmInfoPanel extends LitElement {
|
|
|
23
23
|
};
|
|
24
24
|
/** Panel title. */
|
|
25
25
|
heading: string;
|
|
26
|
-
/** Text of the header action,
|
|
26
|
+
/** Text of the header action, in sentence case ("Remove", "Edit"). Leave empty for none. */
|
|
27
27
|
action: string;
|
|
28
28
|
/** Accessible name of the header action when the text alone is unclear, e.g. "Remove order details". */
|
|
29
29
|
actionLabel: string;
|
|
@@ -12,7 +12,7 @@ export class CmInfoPanel extends LitElement {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
/** Panel title. */
|
|
14
14
|
this.heading = '';
|
|
15
|
-
/** Text of the header action,
|
|
15
|
+
/** Text of the header action, in sentence case ("Remove", "Edit"). Leave empty for none. */
|
|
16
16
|
this.action = '';
|
|
17
17
|
/** Accessible name of the header action when the text alone is unclear, e.g. "Remove order details". */
|
|
18
18
|
this.actionLabel = '';
|
|
@@ -51,19 +51,19 @@ CmInfoPanel.styles = [
|
|
|
51
51
|
css `
|
|
52
52
|
:host { display: block; }
|
|
53
53
|
section {
|
|
54
|
-
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-
|
|
54
|
+
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
55
55
|
border-radius: var(--cm-radius-md); padding: var(--cm-space-20);
|
|
56
56
|
}
|
|
57
|
-
header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--cm-space-
|
|
58
|
-
.title { margin: 0; font-size:
|
|
57
|
+
header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--cm-space-16); margin-bottom: var(--cm-space-16); }
|
|
58
|
+
.title { margin: 0; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
|
|
59
59
|
.action {
|
|
60
60
|
padding: 2px 4px; margin: -2px -4px; border: 0; background: none; color: var(--cm-text-default); cursor: pointer;
|
|
61
|
-
font: inherit; font-size:
|
|
61
|
+
font: inherit; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
|
|
62
62
|
border-radius: var(--cm-radius-xs);
|
|
63
63
|
}
|
|
64
|
-
.action:hover { text-decoration:
|
|
64
|
+
.action:hover { text-decoration-thickness: 2px; }
|
|
65
65
|
.action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
66
|
-
.items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-
|
|
66
|
+
.items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-12) var(--cm-space-20); }
|
|
67
67
|
`,
|
|
68
68
|
];
|
|
69
69
|
define('cm-info-panel', CmInfoPanel);
|
|
@@ -98,10 +98,11 @@ CmInfoItem.styles = [
|
|
|
98
98
|
css `
|
|
99
99
|
:host { display: block; grid-column: 1 / -1; min-width: 0; }
|
|
100
100
|
:host([half]) { grid-column: auto; }
|
|
101
|
-
.label { font-size:
|
|
101
|
+
.label { font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); color: var(--cm-text-tertiary); }
|
|
102
102
|
.value {
|
|
103
|
-
display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-
|
|
104
|
-
margin-top:
|
|
103
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-8);
|
|
104
|
+
margin-top: var(--cm-space-4); font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; overflow-wrap: anywhere;
|
|
105
|
+
|
|
105
106
|
}
|
|
106
107
|
`,
|
|
107
108
|
];
|
|
@@ -13,7 +13,7 @@ export declare class CmLayout extends LitElement {
|
|
|
13
13
|
reflect: boolean;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
/** Space between sections, across and down: a spacing step (`0`, `
|
|
16
|
+
/** Space between sections, across and down: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`. */
|
|
17
17
|
gap: SpaceStep;
|
|
18
18
|
static styles: import("lit").CSSResult[];
|
|
19
19
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -11,7 +11,7 @@ import { spaceRules } from '../spacing.js';
|
|
|
11
11
|
export class CmLayout extends LitElement {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
|
-
/** Space between sections, across and down: a spacing step (`0`, `
|
|
14
|
+
/** Space between sections, across and down: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`. */
|
|
15
15
|
this.gap = '20';
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
@@ -68,21 +68,22 @@ CmLinkTabs.styles = [
|
|
|
68
68
|
css `
|
|
69
69
|
:host { display: block; }
|
|
70
70
|
ul {
|
|
71
|
-
display: flex; gap:
|
|
72
|
-
border-bottom: var(--cm-border-1) solid var(--cm-border-
|
|
71
|
+
display: flex; gap: var(--cm-space-24); margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto; scrollbar-width: thin;
|
|
72
|
+
border-bottom: var(--cm-border-1) solid var(--cm-border-subtle); white-space: nowrap;
|
|
73
73
|
}
|
|
74
74
|
li { flex: none; display: flex; }
|
|
75
75
|
a {
|
|
76
|
-
position: relative; display: inline-flex; align-items: center; gap:
|
|
77
|
-
font-size:
|
|
76
|
+
position: relative; display: inline-flex; align-items: center; gap: var(--cm-space-8); padding: var(--cm-space-4) 0 var(--cm-space-12);
|
|
77
|
+
font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; color: var(--cm-text-tertiary); text-decoration: none;
|
|
78
78
|
}
|
|
79
|
-
a::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; border-radius:
|
|
79
|
+
a::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; border-radius: var(--cm-radius-full); background: transparent; }
|
|
80
80
|
a:hover { color: var(--cm-text-default); }
|
|
81
81
|
a[aria-current='page'] { color: var(--cm-text-default); }
|
|
82
82
|
a[aria-current='page']::after { background: var(--cm-border-strong); }
|
|
83
83
|
a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
84
|
-
.badge { font-size:
|
|
85
|
-
@media (max-width: 640px) { ul { gap:
|
|
84
|
+
.badge { font-size: var(--cm-font-size-12); color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
|
|
85
|
+
@media (max-width: 640px) { ul { gap: var(--cm-space-16); } }
|
|
86
|
+
|
|
86
87
|
`,
|
|
87
88
|
];
|
|
88
89
|
define('cm-link-tabs', CmLinkTabs);
|
|
@@ -132,18 +132,18 @@ CmMetric.styles = [
|
|
|
132
132
|
.tile {
|
|
133
133
|
display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
|
|
134
134
|
padding: var(--cm-space-20); color: var(--cm-text-default); text-decoration: none; text-align: start;
|
|
135
|
-
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-
|
|
135
|
+
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-md);
|
|
136
136
|
}
|
|
137
137
|
a.tile { cursor: pointer; }
|
|
138
138
|
a.tile:hover { border-color: var(--cm-border-strong); }
|
|
139
139
|
a.tile:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
140
140
|
.label { font-size: var(--cm-type-body-md-size); font-weight: 500; line-height: var(--cm-type-body-md-line-height); overflow-wrap: anywhere; }
|
|
141
141
|
.value {
|
|
142
|
-
font-size: var(--cm-type-heading-lg-size); font-weight: var(--cm-type-heading-lg-weight); line-height:
|
|
142
|
+
font-size: var(--cm-type-heading-lg-size); font-weight: var(--cm-type-heading-lg-weight); line-height: var(--cm-type-heading-lg-line-height);
|
|
143
143
|
font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-block-size: 1.25em;
|
|
144
144
|
}
|
|
145
145
|
.value cm-skeleton { inline-size: 6ch; max-inline-size: 100%; --cm-skeleton-height: 0.9em; margin-block: 0.175em; }
|
|
146
|
-
.foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--cm-space-
|
|
146
|
+
.foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--cm-space-8); row-gap: 2px; }
|
|
147
147
|
.foot:not(.on) { display: none; }
|
|
148
148
|
.change {
|
|
149
149
|
display: inline-flex; align-items: center; gap: 2px; font-size: var(--cm-type-body-sm-size); font-weight: 500;
|
|
@@ -159,7 +159,7 @@ CmMetric.styles = [
|
|
|
159
159
|
.hint:not(.on) { display: none; }
|
|
160
160
|
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
161
161
|
@media (max-width: 640px) {
|
|
162
|
-
.tile { padding: var(--cm-space-
|
|
162
|
+
.tile { padding: var(--cm-space-12); }
|
|
163
163
|
.value { font-size: var(--cm-type-heading-lg-resp-size); }
|
|
164
164
|
}
|
|
165
165
|
@media (forced-colors: active) { .change { color: CanvasText; } }
|
|
@@ -83,7 +83,8 @@ export class CmMobileMenu extends CmLocalizedElement {
|
|
|
83
83
|
e.preventDefault();
|
|
84
84
|
this.back();
|
|
85
85
|
} }}>
|
|
86
|
-
<button type="button" class="back" part="back" @click=${() => this.back()}><cm-icon name="arrow-left" size="
|
|
86
|
+
<button type="button" class="back" part="back" @click=${() => this.back()}><cm-icon name="arrow-left" size="16"></cm-icon>
|
|
87
|
+
${page.label}</button>
|
|
87
88
|
<ul class="card" aria-label=${page.label}>${page.items.map((it) => html `<li>${__classPrivateFieldGet(this, _CmMobileMenu_instances, "m", _CmMobileMenu_row).call(this, it, 0, 0, true)}</li>`)}</ul>
|
|
88
89
|
<slot hidden></slot>
|
|
89
90
|
</nav>`;
|
|
@@ -109,7 +110,7 @@ _CmMobileMenu_observer = new WeakMap(), _CmMobileMenu_id = new WeakMap(), _CmMob
|
|
|
109
110
|
e.preventDefault(); };
|
|
110
111
|
if (it.primary && !sub)
|
|
111
112
|
return html `<button type="button" class="row action" part="row" @click=${go}>${it.label}</button>`;
|
|
112
|
-
const icon = it.icon && !sub ? html `<cm-icon class="icon" name=${it.icon} size="
|
|
113
|
+
const icon = it.icon && !sub ? html `<cm-icon class="icon" name=${it.icon} size="20"></cm-icon>` : nothing;
|
|
113
114
|
const badge = it.badge ? html `<span class="badge">${it.badge}</span>` : nothing;
|
|
114
115
|
if (it.items?.length && !sub) {
|
|
115
116
|
return html `<button type="button" class="row" part="row" data-row="${s}-${r}"
|
|
@@ -152,14 +153,14 @@ CmMobileMenu.styles = [
|
|
|
152
153
|
:host { display: block; background: var(--cm-bg-page); }
|
|
153
154
|
nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
|
|
154
155
|
.heading {
|
|
155
|
-
margin: 0 0
|
|
156
|
-
color: var(--cm-text-
|
|
156
|
+
margin: 0 0 var(--cm-space-8); font-size: var(--cm-font-size-13); line-height: var(--cm-line-height-13); font-weight: 500;
|
|
157
|
+
color: var(--cm-text-tertiary);
|
|
157
158
|
}
|
|
158
|
-
.card { list-style: none; margin: 0; padding: 0
|
|
159
|
-
.card > li + li { border-top: var(--cm-border-1) solid var(--cm-border-
|
|
159
|
+
.card { list-style: none; margin: 0; padding: 0 var(--cm-space-16); background: var(--cm-bg-surface); border-radius: var(--cm-radius-lg); }
|
|
160
|
+
.card > li + li { border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
160
161
|
.row {
|
|
161
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
162
|
-
font: inherit; font-size:
|
|
162
|
+
display: flex; align-items: center; gap: var(--cm-space-12); width: 100%; min-height: 48px; padding-block: var(--cm-space-8); padding-inline: var(--cm-space-4);
|
|
163
|
+
font: inherit; font-size: var(--cm-font-size-16); line-height: var(--cm-line-height-16); font-weight: 500; color: var(--cm-text-default); text-align: start; text-decoration: none;
|
|
163
164
|
background: none; border: 0; cursor: pointer;
|
|
164
165
|
}
|
|
165
166
|
.row:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; border-radius: var(--cm-radius-sm); }
|
|
@@ -167,24 +168,24 @@ CmMobileMenu.styles = [
|
|
|
167
168
|
.label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
168
169
|
.chev { color: var(--cm-icon-selected); }
|
|
169
170
|
.badge {
|
|
170
|
-
flex: none; padding:
|
|
171
|
-
|
|
171
|
+
flex: none; padding: 2px var(--cm-space-8); border-radius: var(--cm-radius-full); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500;
|
|
172
|
+
font-variant-numeric: tabular-nums; color: var(--cm-text-on-dark); background: var(--cm-nav-badge);
|
|
172
173
|
}
|
|
173
|
-
.action { justify-content: center;
|
|
174
|
-
.eyebrow { display: block; font-size:
|
|
174
|
+
.action { justify-content: center; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
|
|
175
|
+
.eyebrow { display: block; font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 400; color: var(--cm-text-tertiary); }
|
|
175
176
|
.stack { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
|
|
176
|
-
.email { font-size:
|
|
177
|
+
.email { font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 400; color: var(--cm-text-tertiary); }
|
|
177
178
|
.avatar {
|
|
178
179
|
display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
|
|
179
180
|
font-size: 12px; background: var(--cm-avatar-bg); border: var(--cm-border-1) solid var(--cm-border-strong); color: var(--cm-text-default);
|
|
180
181
|
}
|
|
181
182
|
.avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|
182
183
|
.back {
|
|
183
|
-
display: inline-flex; align-items: center; gap:
|
|
184
|
+
display: inline-flex; align-items: center; gap: var(--cm-space-8); align-self: flex-start; min-height: var(--cm-control-height-md); padding: var(--cm-space-4); font: inherit; font-size: var(--cm-font-size-16); font-weight: 500;
|
|
184
185
|
color: var(--cm-text-default); background: none; border: 0; cursor: pointer; border-radius: var(--cm-radius-sm);
|
|
185
186
|
}
|
|
186
187
|
.back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
187
|
-
.sub .row { font-size:
|
|
188
|
+
.sub .row { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
|
|
188
189
|
`,
|
|
189
190
|
];
|
|
190
191
|
define('cm-mobile-menu', CmMobileMenu);
|
package/dist/components/modal.js
CHANGED
|
@@ -53,7 +53,8 @@ CmModal.styles = [
|
|
|
53
53
|
dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
|
|
54
54
|
:host([size='small']) dialog { --cm-modal-width: 400px; }
|
|
55
55
|
:host([size='large']) dialog { --cm-modal-width: 900px; }
|
|
56
|
-
.panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-
|
|
56
|
+
.panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-lg); box-shadow: var(--cm-shadow-lg); }
|
|
57
|
+
|
|
57
58
|
`,
|
|
58
59
|
];
|
|
59
60
|
define('cm-modal', CmModal);
|
|
@@ -23,7 +23,7 @@ declare module '../localize.js' {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* One row in a `cm-nested-list`: a
|
|
26
|
+
* One row in a `cm-nested-list`: a 48px bordered row with a label and actions (toggle, edit, delete).
|
|
27
27
|
* Put more `cm-nested-item`s inside it to nest them; each level is indented.
|
|
28
28
|
* @element cm-nested-item
|
|
29
29
|
* @slot - Child `cm-nested-item`s.
|
|
@@ -77,7 +77,7 @@ export declare class CmNestedItem extends CmLocalizedElement {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* A titled group of rows that nest inside each other, such as a navigation menu with links and
|
|
80
|
-
* sub-links, or categories and sub-categories. The heading sits in a
|
|
80
|
+
* sub-links, or categories and sub-categories. The heading sits in a 64px grey bar with its own
|
|
81
81
|
* actions; rows below are indented one step per level. With `sortable`, each row gets a drag
|
|
82
82
|
* handle that also works from the keyboard (↑/↓, Home/End). With `collapsible`, the bar gets a
|
|
83
83
|
* round button that shows and hides the rows. Give sortable lists the same `group` to let top-level rows move
|