@commmerce/ui 1.4.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/dist/calendar.js +15 -19
- package/dist/cdn.js +1267 -1138
- 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 +14 -0
- package/dist/components/app-frame.js +20 -1
- 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.js +29 -28
- 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.js +20 -18
- 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 +929 -160
- package/dist/field.d.ts +15 -0
- package/dist/field.js +47 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -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
|
@@ -27,13 +27,13 @@ let sheetAdded = false;
|
|
|
27
27
|
* from the shadow root). Added to the document once, scoped to `cm-data-table > table`.
|
|
28
28
|
*/
|
|
29
29
|
const LIGHT_CSS = `
|
|
30
|
-
cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size:
|
|
31
|
-
cm-data-table > table caption { text-align: start; font-weight:
|
|
32
|
-
cm-data-table > table th { font-size:
|
|
30
|
+
cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-variant-numeric: tabular-nums; color: var(--cm-text-default); }
|
|
31
|
+
cm-data-table > table caption { text-align: start; font-weight: 600; font-size: var(--cm-font-size-16); line-height: var(--cm-line-height-16); padding-block-end: var(--cm-space-8); }
|
|
32
|
+
cm-data-table > table th { font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500; color: var(--cm-text-tertiary); text-align: start; padding: var(--cm-space-8) var(--cm-space-16); background: var(--cm-bg-hover); border-block: var(--cm-border-1) solid var(--cm-border-subtle); white-space: nowrap; }
|
|
33
33
|
cm-data-table > table th:first-child { border-inline-start: var(--cm-border-1) solid var(--cm-border-subtle); border-start-start-radius: var(--cm-radius-md); }
|
|
34
34
|
cm-data-table > table th:last-child { border-inline-end: var(--cm-border-1) solid var(--cm-border-subtle); border-start-end-radius: var(--cm-radius-md); }
|
|
35
|
-
cm-data-table > table td { padding: var(--cm-space-
|
|
36
|
-
cm-data-table > table tfoot td, cm-data-table > table tfoot th { font-weight: 500; background: var(--cm-bg-surface); border-block: var(--cm-border-1) solid var(--cm-border-
|
|
35
|
+
cm-data-table > table td { padding: var(--cm-space-8) var(--cm-space-16); border-block-end: var(--cm-border-1) solid var(--cm-border-subtle); vertical-align: middle; }
|
|
36
|
+
cm-data-table > table tfoot td, cm-data-table > table tfoot th { font-weight: 500; background: var(--cm-bg-surface); border-block: var(--cm-border-1) solid var(--cm-border-subtle); font-size: var(--cm-font-size-14); color: var(--cm-text-default); }
|
|
37
37
|
cm-data-table > table tbody tr:hover td, cm-data-table > table tbody tr:hover th { background: var(--cm-bg-hover); }
|
|
38
38
|
cm-data-table > table th > button.cm-sort { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
|
|
39
39
|
cm-data-table > table th[data-type='numeric'] > button.cm-sort, cm-data-table > table th[data-type='money'] > button.cm-sort { flex-direction: row-reverse; }
|
|
@@ -311,24 +311,25 @@ CmDataTable.properties = {
|
|
|
311
311
|
CmDataTable.styles = [
|
|
312
312
|
base,
|
|
313
313
|
css `
|
|
314
|
-
:host { display: block; font-size:
|
|
314
|
+
:host { display: block; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-variant-numeric: tabular-nums; }
|
|
315
315
|
.scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
|
|
316
316
|
.scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
317
317
|
table { inline-size: 100%; border-collapse: separate; border-spacing: 0; }
|
|
318
|
-
caption { text-align: start; font-weight:
|
|
318
|
+
caption { text-align: start; font-weight: 600; font-size: var(--cm-font-size-16); line-height: var(--cm-line-height-16); padding-block-end: var(--cm-space-8); }
|
|
319
319
|
:host([caption-hidden]) caption {
|
|
320
320
|
position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
|
|
321
321
|
}
|
|
322
|
-
th, td { padding: var(--cm-space-
|
|
322
|
+
th, td { padding: var(--cm-space-8) var(--cm-space-16); text-align: start; vertical-align: middle; }
|
|
323
323
|
thead th {
|
|
324
|
-
font-size:
|
|
324
|
+
font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500; padding-block: var(--cm-space-8); white-space: nowrap; color: var(--cm-text-tertiary);
|
|
325
|
+
|
|
325
326
|
background: var(--cm-bg-hover); border-block: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
326
327
|
}
|
|
327
328
|
thead th:first-child { border-inline-start: var(--cm-border-1) solid var(--cm-border-subtle); border-start-start-radius: var(--cm-radius-md); }
|
|
328
329
|
thead th:last-child { border-inline-end: var(--cm-border-1) solid var(--cm-border-subtle); border-start-end-radius: var(--cm-radius-md); }
|
|
329
|
-
tbody td, tbody th { font-weight: 400; border-block-end: var(--cm-border-1) solid var(--cm-border-
|
|
330
|
+
tbody td, tbody th { font-weight: 400; border-block-end: var(--cm-border-1) solid var(--cm-border-subtle); background: var(--cm-bg-surface); }
|
|
330
331
|
tbody tr:hover td, tbody tr:hover th { background: var(--cm-bg-hover); }
|
|
331
|
-
tfoot td { font-weight: 500; background: var(--cm-bg-surface); border-block-end: var(--cm-border-1) solid var(--cm-border-
|
|
332
|
+
tfoot td { font-weight: 500; background: var(--cm-bg-surface); border-block-end: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
332
333
|
.end { text-align: end; }
|
|
333
334
|
.num { font-variant-numeric: tabular-nums; }
|
|
334
335
|
:host([sticky-header]) thead th { position: sticky; inset-block-start: 0; z-index: 2; }
|
|
@@ -296,7 +296,7 @@ export class CmDatePicker extends CmLocalizedElement {
|
|
|
296
296
|
<button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
|
|
297
297
|
aria-label=${value ? this.t(name ? 'changeFor' : 'change', { label: name, date: fmt.long(value) }) : this.t(name ? 'chooseFor' : 'choose', { label: name })}
|
|
298
298
|
aria-haspopup="dialog" aria-expanded=${this.open ? 'true' : 'false'} aria-controls="${__classPrivateFieldGet(this, _CmDatePicker_id, "f")}-pop"
|
|
299
|
-
@click=${__classPrivateFieldGet(this, _CmDatePicker_toggle, "f")}><cm-icon name="calendar" size="
|
|
299
|
+
@click=${__classPrivateFieldGet(this, _CmDatePicker_toggle, "f")}><cm-icon name="calendar" size="16"></cm-icon></button>
|
|
300
300
|
</div>
|
|
301
301
|
${this.time ? html `<div class="box time" part="time-box">
|
|
302
302
|
<input class="time-in" part="time-input" type="text" autocomplete="off" spellcheck="false"
|
|
@@ -339,7 +339,7 @@ export class CmDateRangePicker extends CmLocalizedElement {
|
|
|
339
339
|
<button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
|
|
340
340
|
aria-label=${s && e ? this.t(name ? 'changeFor' : 'change', { label: name, start: fmt.long(s), end: fmt.long(e) }) : this.t(name ? 'chooseFor' : 'choose', { label: name })}
|
|
341
341
|
aria-haspopup="dialog" aria-expanded=${this.open ? 'true' : 'false'} aria-controls="${__classPrivateFieldGet(this, _CmDateRangePicker_id, "f")}-pop"
|
|
342
|
-
@click=${__classPrivateFieldGet(this, _CmDateRangePicker_toggle, "f")}><cm-icon name="calendar" size="
|
|
342
|
+
@click=${__classPrivateFieldGet(this, _CmDateRangePicker_toggle, "f")}><cm-icon name="calendar" size="16"></cm-icon></button>
|
|
343
343
|
</div>
|
|
344
344
|
<div class="pop" id="${__classPrivateFieldGet(this, _CmDateRangePicker_id, "f")}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t('dialog')}
|
|
345
345
|
?hidden=${!this.open} @keydown=${__classPrivateFieldGet(this, _CmDateRangePicker_onPopKey, "f")}>
|
|
@@ -464,20 +464,20 @@ CmDateRangePicker.styles = [
|
|
|
464
464
|
input { flex: 0 1 6.6em; }
|
|
465
465
|
:host([size='small']) input { flex-basis: 6.6em; }
|
|
466
466
|
.trigger { margin-inline-start: auto; }
|
|
467
|
-
.body { display: flex; gap: var(--cm-space-
|
|
468
|
-
.presets { display: flex; flex-direction: column; gap: 2px; min-width: 140px; margin: 0; padding: 0; padding-inline-end: var(--cm-space-
|
|
467
|
+
.body { display: flex; gap: var(--cm-space-12); }
|
|
468
|
+
.presets { display: flex; flex-direction: column; gap: 2px; min-width: 140px; margin: 0; padding: 0; padding-inline-end: var(--cm-space-12); list-style: none; border-inline-end: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
469
469
|
.preset {
|
|
470
|
-
width: 100%; min-height:
|
|
470
|
+
width: 100%; min-height: var(--cm-control-height-sm, 32px); padding: var(--cm-space-4) var(--cm-space-8); border: 0; border-radius: var(--cm-radius-sm);
|
|
471
471
|
background: none; font: inherit; font-size: 14px; text-align: start; color: var(--cm-text-default); cursor: pointer;
|
|
472
472
|
}
|
|
473
473
|
.preset:hover { background: var(--cm-bg-hover); }
|
|
474
474
|
.preset[aria-pressed='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
|
|
475
|
-
.status { margin: var(--cm-space-
|
|
475
|
+
.status { margin: var(--cm-space-8) 0 0; font-size: var(--cm-type-body-sm-size); color: var(--cm-text-tertiary); }
|
|
476
476
|
@media (max-width: 640px) {
|
|
477
477
|
.body { flex-direction: column; }
|
|
478
|
-
.presets { flex-direction: row; flex-wrap: wrap; min-width: 0; padding: 0 0 var(--cm-space-
|
|
478
|
+
.presets { flex-direction: row; flex-wrap: wrap; min-width: 0; padding: 0 0 var(--cm-space-8); border-inline-end: 0; border-block-end: var(--cm-border-1) solid var(--cm-border-subtle); }
|
|
479
479
|
.presets li { flex: 0 0 auto; }
|
|
480
|
-
.preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-
|
|
480
|
+
.preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-full); min-height: 32px; }
|
|
481
481
|
}
|
|
482
482
|
`,
|
|
483
483
|
];
|
|
@@ -39,7 +39,7 @@ export declare class CmEmptyState extends LitElement {
|
|
|
39
39
|
/** Heading level, so the page outline stays correct. Default 2. */
|
|
40
40
|
headingLevel: 2 | 3 | 4 | 5 | 6;
|
|
41
41
|
/**
|
|
42
|
-
* `large` (
|
|
42
|
+
* `large` (160px circle, page-level), `small` (120px circle, inside a card or on mobile) or `inline`
|
|
43
43
|
* (since 1.2: no circle, a 20px icon, heading and text on one or two left-aligned lines; for an empty list
|
|
44
44
|
* inside a card, panel or table). Inline shows the `icon` (default `box`); set `icon=""` for text only.
|
|
45
45
|
*/
|
|
@@ -31,7 +31,7 @@ export class CmEmptyState extends LitElement {
|
|
|
31
31
|
/** Heading level, so the page outline stays correct. Default 2. */
|
|
32
32
|
this.headingLevel = 2;
|
|
33
33
|
/**
|
|
34
|
-
* `large` (
|
|
34
|
+
* `large` (160px circle, page-level), `small` (120px circle, inside a card or on mobile) or `inline`
|
|
35
35
|
* (since 1.2: no circle, a 20px icon, heading and text on one or two left-aligned lines; for an empty list
|
|
36
36
|
* inside a card, panel or table). Inline shows the `icon` (default `box`); set `icon=""` for text only.
|
|
37
37
|
*/
|
|
@@ -53,7 +53,8 @@ export class CmEmptyState extends LitElement {
|
|
|
53
53
|
return __classPrivateFieldGet(this, _CmEmptyState_instances, "m", _CmEmptyState_renderInline).call(this, level);
|
|
54
54
|
const fallback = this.image
|
|
55
55
|
? html `<img src=${this.image} alt="" part="image">`
|
|
56
|
-
: this.icon ? html `<cm-icon name=${this.icon} size="
|
|
56
|
+
: this.icon ? html `<cm-icon name=${this.icon} size="48"></cm-icon>
|
|
57
|
+
` : nothing;
|
|
57
58
|
return html `<div class="wrap" part="empty-state">
|
|
58
59
|
<div class="circle" part="circle" aria-hidden=${this.hasImage ? nothing : 'true'}>
|
|
59
60
|
<slot name="image" @slotchange=${(e) => __classPrivateFieldGet(this, _CmEmptyState_instances, "m", _CmEmptyState_slot).call(this, e, 'hasImage')}>${fallback}</slot>
|
|
@@ -105,29 +106,29 @@ CmEmptyState.styles = [
|
|
|
105
106
|
:host { display: block; }
|
|
106
107
|
.wrap {
|
|
107
108
|
display: flex; flex-direction: column; align-items: center; text-align: center;
|
|
108
|
-
padding: var(--cm-space-
|
|
109
|
+
padding: var(--cm-space-32) var(--cm-space-20);
|
|
109
110
|
}
|
|
110
111
|
.circle {
|
|
111
112
|
display: flex; align-items: center; justify-content: center; overflow: hidden;
|
|
112
|
-
width:
|
|
113
|
+
width: 160px; height: 160px; border-radius: var(--cm-radius-full);
|
|
113
114
|
background: var(--cm-bg-input-filled); color: var(--cm-icon-selected);
|
|
114
115
|
}
|
|
115
116
|
.circle img, ::slotted([slot='image']) { max-width: 66%; max-height: 66%; object-fit: contain; }
|
|
116
|
-
.title { margin:
|
|
117
|
-
.text { margin-top: var(--cm-space-
|
|
117
|
+
.title { margin: var(--cm-space-24) 0 0; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600; }
|
|
118
|
+
.text { margin-top: var(--cm-space-4); max-width: 46ch; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); color: var(--cm-text-tertiary); }
|
|
118
119
|
.text[hidden], .actions[hidden] { display: none; }
|
|
119
|
-
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cm-space-
|
|
120
|
-
:host([size='small']) .
|
|
121
|
-
:host([size='small']) .
|
|
122
|
-
:host([size='small']) .
|
|
120
|
+
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cm-space-8); margin-top: var(--cm-space-16); }
|
|
121
|
+
:host([size='small']) .wrap { padding: var(--cm-space-24) var(--cm-space-16); }
|
|
122
|
+
:host([size='small']) .circle { width: 120px; height: 120px; }
|
|
123
|
+
:host([size='small']) .title { margin-top: var(--cm-space-16); font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
|
|
123
124
|
/* Inline (1.2): a line of text with an optional 20px icon, no circle, no extra height. */
|
|
124
|
-
.inline { flex-direction: row; align-items: flex-start; gap: var(--cm-space-
|
|
125
|
+
.inline { flex-direction: row; align-items: flex-start; gap: var(--cm-space-8); padding: 0; text-align: start; font-size: 14px; line-height: 20px; }
|
|
125
126
|
.inline .icon { display: inline-flex; flex: none; width: 20px; height: 20px; overflow: hidden; color: var(--cm-icon-default); }
|
|
126
127
|
.inline .icon img, .inline ::slotted([slot='image']) { width: 20px; height: 20px; max-width: none; max-height: none; object-fit: contain; }
|
|
127
128
|
.inline .line { min-width: 0; text-align: start; }
|
|
128
129
|
.inline .title { display: inline; margin: 0; font-size: inherit; font-weight: 500; color: var(--cm-text-default); }
|
|
129
130
|
.inline .text { display: inline; margin: 0; font-size: inherit; color: var(--cm-text-tertiary); }
|
|
130
|
-
.inline .actions { display: inline-flex; vertical-align: middle; margin: 0; margin-inline-start: var(--cm-space-
|
|
131
|
+
.inline .actions { display: inline-flex; vertical-align: middle; margin: 0; margin-inline-start: var(--cm-space-8); }
|
|
131
132
|
.inline .text[hidden], .inline .actions[hidden], .inline .icon[hidden] { display: none; }
|
|
132
133
|
.text-action {
|
|
133
134
|
display: inline-flex; align-items: center; min-height: 24px; vertical-align: middle;
|
|
@@ -137,11 +138,10 @@ CmEmptyState.styles = [
|
|
|
137
138
|
}
|
|
138
139
|
.text-action:hover { text-decoration-thickness: 2px; }
|
|
139
140
|
.text-action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
|
|
140
|
-
.inline .text-action { display: inline; min-height: 0; vertical-align: baseline; margin: 0; margin-inline-start: var(--cm-space-
|
|
141
|
+
.inline .text-action { display: inline; min-height: 0; vertical-align: baseline; margin: 0; margin-inline-start: var(--cm-space-8); padding-block: 2px; }
|
|
141
142
|
@media (max-width: 640px) {
|
|
142
|
-
.circle { width:
|
|
143
|
-
.title { margin-top:
|
|
144
|
-
.actions { gap: var(--cm-space-10); }
|
|
143
|
+
.circle { width: 120px; height: 120px; }
|
|
144
|
+
.title { margin-top: var(--cm-space-16); }
|
|
145
145
|
}
|
|
146
146
|
`,
|
|
147
147
|
];
|
|
@@ -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
|
];
|