@commmerce/ui 1.7.2 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +27 -4
- package/dist/cdn.js +256 -239
- package/dist/components/action-menu.js +19 -3
- package/dist/components/board.js +1 -2
- package/dist/components/button.js +5 -3
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/resource-list.d.ts +1 -1
- package/dist/components/resource-list.js +3 -1
- package/dist/components/select.d.ts +4 -3
- package/dist/components/select.js +3 -2
- package/dist/components/side-navigation.js +4 -2
- package/dist/components/signature-field.js +2 -2
- package/dist/components/text-field.d.ts +1 -1
- package/dist/components/text-field.js +2 -2
- package/dist/components/timeline.js +13 -4
- package/dist/custom-elements.json +19 -13
- package/dist/field.js +3 -0
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _CmActionMenu_instances, _CmActionMenu_observer, _CmActionMenu_id, _CmActionMenu_typed, _CmActionMenu_typedAt, _CmActionMenu_read, _CmActionMenu_outside, _CmActionMenu_trigger, _CmActionMenu_enabled, _CmActionMenu_setOpen, _CmActionMenu_focusActive, _CmActionMenu_triggerKey, _CmActionMenu_triggerClick, _CmActionMenu_move, _CmActionMenu_menuKey, _CmActionMenu_choose, _CmActionMenu_item, _CmActionMenu_rows;
|
|
12
|
+
var _CmActionMenu_instances, _CmActionMenu_observer, _CmActionMenu_id, _CmActionMenu_typed, _CmActionMenu_typedAt, _CmActionMenu_read, _CmActionMenu_outside, _CmActionMenu_trigger, _CmActionMenu_enabled, _CmActionMenu_setOpen, _CmActionMenu_focusActive, _CmActionMenu_fit, _CmActionMenu_triggerKey, _CmActionMenu_triggerClick, _CmActionMenu_move, _CmActionMenu_menuKey, _CmActionMenu_choose, _CmActionMenu_item, _CmActionMenu_rows;
|
|
13
13
|
import { html, css, nothing } from 'lit';
|
|
14
14
|
import { base, define, nextId } from '../base.js';
|
|
15
15
|
import { CmLocalizedElement, defineStrings } from '../localize.js';
|
|
@@ -168,6 +168,8 @@ export class CmActionMenu extends CmLocalizedElement {
|
|
|
168
168
|
__classPrivateFieldGet(this, _CmActionMenu_instances, "m", _CmActionMenu_trigger).call(this)?.focus();
|
|
169
169
|
}
|
|
170
170
|
updated(changed) {
|
|
171
|
+
if (changed.has('open') && this.open)
|
|
172
|
+
__classPrivateFieldGet(this, _CmActionMenu_instances, "m", _CmActionMenu_fit).call(this);
|
|
171
173
|
if (this._custom) {
|
|
172
174
|
const t = __classPrivateFieldGet(this, _CmActionMenu_instances, "m", _CmActionMenu_trigger).call(this);
|
|
173
175
|
if (t) {
|
|
@@ -225,7 +227,20 @@ _CmActionMenu_observer = new WeakMap(), _CmActionMenu_id = new WeakMap(), _CmAct
|
|
|
225
227
|
if (!v)
|
|
226
228
|
this._active = -1;
|
|
227
229
|
this.dispatchEvent(new CustomEvent('cm-toggle', { detail: { open: v }, bubbles: true, composed: true }));
|
|
228
|
-
}, _CmActionMenu_focusActive = function _CmActionMenu_focusActive() { this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus(); },
|
|
230
|
+
}, _CmActionMenu_focusActive = function _CmActionMenu_focusActive() { this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus(); }, _CmActionMenu_fit = function _CmActionMenu_fit() {
|
|
231
|
+
const pop = this.renderRoot.querySelector('.pop');
|
|
232
|
+
if (!pop)
|
|
233
|
+
return;
|
|
234
|
+
pop.classList.remove('to-end', 'to-start');
|
|
235
|
+
const r = pop.getBoundingClientRect(), vw = document.documentElement.clientWidth, m = 8;
|
|
236
|
+
const rtl = getComputedStyle(this).direction === 'rtl';
|
|
237
|
+
const endOverflow = rtl ? r.left < m : r.right > vw - m;
|
|
238
|
+
const startOverflow = rtl ? r.right > vw - m : r.left < m;
|
|
239
|
+
if (this.align !== 'end' && endOverflow)
|
|
240
|
+
pop.classList.add('to-end');
|
|
241
|
+
else if (this.align === 'end' && startOverflow)
|
|
242
|
+
pop.classList.add('to-start');
|
|
243
|
+
}, _CmActionMenu_move = function _CmActionMenu_move(to) {
|
|
229
244
|
this._active = to;
|
|
230
245
|
this.updateComplete.then(() => __classPrivateFieldGet(this, _CmActionMenu_instances, "m", _CmActionMenu_focusActive).call(this));
|
|
231
246
|
}, _CmActionMenu_choose = function _CmActionMenu_choose(e, it) {
|
|
@@ -317,7 +332,8 @@ CmActionMenu.styles = [
|
|
|
317
332
|
padding: var(--cm-space-4); text-align: start; background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
318
333
|
border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-md);
|
|
319
334
|
}
|
|
320
|
-
:host([align='end']) .pop { inset-inline-start: auto; inset-inline-end: 0; }
|
|
335
|
+
:host([align='end']) .pop, .pop.to-end { inset-inline-start: auto; inset-inline-end: 0; }
|
|
336
|
+
:host([align='end']) .pop.to-start { inset-inline-start: 0; inset-inline-end: auto; }
|
|
321
337
|
.pop[hidden] { display: none; }
|
|
322
338
|
.head { padding: var(--cm-space-4) var(--cm-space-12) var(--cm-space-8); margin-bottom: 4px; border-bottom: var(--cm-border-1) solid var(--cm-border-subtle); overflow-wrap: anywhere; }
|
|
323
339
|
.head strong { display: block; font-size: 14px; font-weight: 500; }
|
package/dist/components/board.js
CHANGED
|
@@ -56,7 +56,6 @@ const boardStrings = defineStrings('board', {
|
|
|
56
56
|
/** Announced when a move fails and the card goes back (`revert()`, or a rejected `waitUntil()` promise). `{column}` is where it went back to. */
|
|
57
57
|
reverted: 'Couldn\'t move {card}. It is back in {column}.',
|
|
58
58
|
});
|
|
59
|
-
const INTERACTIVE = 'a[href], button, input, select, textarea, label, summary, [contenteditable], [tabindex]:not([tabindex="-1"]), cm-button, cm-action-menu, cm-checkbox, cm-toggle, cm-select';
|
|
60
59
|
const NO_DRAG = 'input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]';
|
|
61
60
|
/**
|
|
62
61
|
* One record on a `cm-board`: a title (`heading`, or a link in the `heading` slot), secondary lines, badges and an
|
|
@@ -365,7 +364,7 @@ CmBoardColumn.styles = [
|
|
|
365
364
|
flex: none; min-width: 24px; padding: 0 8px; font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
|
|
366
365
|
background: var(--cm-bg-surface); color: var(--cm-text-default); border-radius: var(--cm-radius-full);
|
|
367
366
|
}
|
|
368
|
-
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--cm-space-8) var(--cm-space-8); }
|
|
367
|
+
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; /* x left to chain: a sideways swipe over cards scrolls the board (1.8.1) */ padding: 0 var(--cm-space-8) var(--cm-space-8); }
|
|
369
368
|
ul { display: flex; flex-direction: column; gap: var(--cm-space-8); margin: 0; padding: 0; list-style: none; }
|
|
370
369
|
ul:focus { outline: none; }
|
|
371
370
|
li { display: block; min-width: 0; }
|
|
@@ -89,7 +89,7 @@ export class CmButton extends CmLocalizedElement {
|
|
|
89
89
|
const icon = this.loading
|
|
90
90
|
? html `<span class="spinner" aria-hidden="true"></span>`
|
|
91
91
|
: html `<slot name="icon">${this.icon ? html `<cm-icon name=${this.icon} size="16"></cm-icon>` : nothing}</slot>`;
|
|
92
|
-
const text = this.iconOnly ? html `<span class="vh"><slot></slot></span>` : html `<slot></slot>`;
|
|
92
|
+
const text = this.iconOnly ? html `<span class="vh"><slot></slot></span>` : html `<span class="text"><slot></slot></span>`;
|
|
93
93
|
const counter = count
|
|
94
94
|
? html `<span class="count" part="count" aria-hidden="true">${count > COUNT_MAX ? this.t('countOverflow', { max: COUNT_MAX }) : this.formatNumber(count)}</span>${this.iconOnly ? nothing : html `<span class="vh"> ${this.t('count', { count })}</span>`}`
|
|
95
95
|
: nothing;
|
|
@@ -124,10 +124,12 @@ CmButton.properties = {
|
|
|
124
124
|
CmButton.styles = [
|
|
125
125
|
base,
|
|
126
126
|
css `
|
|
127
|
-
:host { display: inline-flex; vertical-align: middle; }
|
|
127
|
+
:host { display: inline-flex; vertical-align: middle; max-width: 100%; }
|
|
128
|
+
/* A label longer than the room (a button in a narrow card) ends with an ellipsis instead of spilling out (1.8.1). */
|
|
129
|
+
.text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
128
130
|
.btn {
|
|
129
131
|
position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--cm-space-8);
|
|
130
|
-
width: 100%; font: inherit; font-weight: 500; line-height: 1; white-space: nowrap;
|
|
132
|
+
width: 100%; min-width: 0; font: inherit; font-weight: 500; line-height: 1; white-space: nowrap;
|
|
131
133
|
border-radius: var(--cm-radius-sm); border: var(--cm-border-1) solid transparent;
|
|
132
134
|
cursor: pointer; text-decoration: none;
|
|
133
135
|
}
|
|
@@ -166,7 +166,7 @@ export declare class CmCombobox extends CmLocalizedElement {
|
|
|
166
166
|
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch
|
|
167
167
|
* screens both are 44px. Since 1.5.
|
|
168
168
|
*/
|
|
169
|
-
size: 'default' | 'small';
|
|
169
|
+
size: 'default' | 'medium' | 'small';
|
|
170
170
|
/** Lets the merchant add what they typed when it isn't an option ("Add “summer”"). Fires a cancelable `cm-create`. */
|
|
171
171
|
allowCustom: boolean;
|
|
172
172
|
/** How typing narrows the list: `contains` (default), `starts-with`, or `none` when you filter on the server from `cm-search`. */
|
|
@@ -91,7 +91,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
91
91
|
cm-data-table[mobile='cards'] > table tr > * { display: flex; justify-content: space-between; gap: var(--cm-space-12); height: auto; padding: var(--cm-space-4) 0; border: 0; background: none; text-align: end; white-space: normal; }
|
|
92
92
|
cm-data-table[mobile='cards'] > table tbody tr:hover > * { background: none; }
|
|
93
93
|
/* The value side of a card row may shrink, so one-line [data-lines] items end in "…" inside the card (CRM 1.7.1). */
|
|
94
|
-
cm-data-table[mobile='cards'] > table tr > * > * { min-inline-size: 0; max-inline-size: 100%; }
|
|
94
|
+
cm-data-table[mobile='cards'] > table tr > * > * { min-inline-size: 0; max-inline-size: 100%; box-sizing: border-box; }
|
|
95
95
|
cm-data-table[mobile='cards'] > table tr > :first-child { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 600; text-align: start; }
|
|
96
96
|
cm-data-table[mobile='cards'] > table tr > :not(:first-child)[data-label]::before { content: attr(data-label); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); text-align: start; font-weight: 400; }
|
|
97
97
|
cm-data-table[mobile='cards'] > table td[data-type='actions'] { justify-content: flex-start; flex-wrap: wrap; padding-block-start: var(--cm-space-8); }
|
|
@@ -180,7 +180,7 @@ export declare class CmDatePicker extends CmLocalizedElement {
|
|
|
180
180
|
/** Whether the calendar is showing. */
|
|
181
181
|
open: boolean;
|
|
182
182
|
/** `small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px. */
|
|
183
|
-
size: 'default' | 'small';
|
|
183
|
+
size: 'default' | 'medium' | 'small';
|
|
184
184
|
/**
|
|
185
185
|
* Adds a time box next to the date box, so the field holds a date and a time. Times are typed (`3:30 pm`, `15:30`)
|
|
186
186
|
* and shown in the locale's clock (12-hour with am/pm for `en-IN`); Up and Down change the time by `step`.
|
|
@@ -215,7 +215,7 @@ export declare class CmDateRangePicker extends CmLocalizedElement {
|
|
|
215
215
|
/** Whether the calendar is showing. */
|
|
216
216
|
open: boolean;
|
|
217
217
|
/** `small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px. */
|
|
218
|
-
size: 'default' | 'small';
|
|
218
|
+
size: 'default' | 'medium' | 'small';
|
|
219
219
|
_startText: string;
|
|
220
220
|
_endText: string;
|
|
221
221
|
_focus: Date;
|
|
@@ -35,7 +35,7 @@ declare module '../localize.js' {
|
|
|
35
35
|
* any content. With `href` the whole row is a link; otherwise clicking a selectable row ticks it.
|
|
36
36
|
* @element cm-resource-item
|
|
37
37
|
* @slot - Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column.
|
|
38
|
-
* @slot media - A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=""` when the row names the product)
|
|
38
|
+
* @slot media - A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=""` when the row names the product), an `<img>`, or a `cm-icon` (centred in the square, for settings and navigation lists).
|
|
39
39
|
* @slot actions - Buttons at the end of the row. They do not toggle selection. When the row is too narrow for the
|
|
40
40
|
* content and the buttons (the content would get narrower than 12rem), they wrap onto a line of their own
|
|
41
41
|
* under the content, at the start: on phones (640px or less) by default, at any width with `actions="wrap"` (issue #31).
|
|
@@ -57,7 +57,7 @@ const checkboxStyles = css `
|
|
|
57
57
|
* any content. With `href` the whole row is a link; otherwise clicking a selectable row ticks it.
|
|
58
58
|
* @element cm-resource-item
|
|
59
59
|
* @slot - Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column.
|
|
60
|
-
* @slot media - A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=""` when the row names the product)
|
|
60
|
+
* @slot media - A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=""` when the row names the product), an `<img>`, or a `cm-icon` (centred in the square, for settings and navigation lists).
|
|
61
61
|
* @slot actions - Buttons at the end of the row. They do not toggle selection. When the row is too narrow for the
|
|
62
62
|
* content and the buttons (the content would get narrower than 12rem), they wrap onto a line of their own
|
|
63
63
|
* under the content, at the start: on phones (640px or less) by default, at any width with `actions="wrap"` (issue #31).
|
|
@@ -178,6 +178,8 @@ CmResourceItem.styles = [
|
|
|
178
178
|
flex: none; width: var(--cm-resource-media-size, 40px); height: var(--cm-resource-media-size, 40px); object-fit: cover; border-radius: var(--cm-radius-sm); background: var(--cm-thumb-bg);
|
|
179
179
|
}
|
|
180
180
|
::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: var(--cm-resource-media-size, 40px); background: none; }
|
|
181
|
+
/* An icon as the media (a settings or navigation list): centred in the square, in the icon colour (1.8.1). */
|
|
182
|
+
::slotted(cm-icon[slot='media']) { display: inline-grid; place-items: center; box-sizing: border-box; color: var(--cm-icon-default); }
|
|
181
183
|
.content { flex: 1; min-width: 0; }
|
|
182
184
|
:host([columns]) .content {
|
|
183
185
|
display: grid; grid-template-columns: var(--cm-table-columns, minmax(0, 1fr)); column-gap: var(--cm-space-20); align-items: center;
|
|
@@ -115,10 +115,11 @@ export declare class CmSelect extends CmLocalizedElement {
|
|
|
115
115
|
*/
|
|
116
116
|
showGroup: boolean;
|
|
117
117
|
/**
|
|
118
|
-
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels.
|
|
119
|
-
*
|
|
118
|
+
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard
|
|
119
|
+
* button, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch
|
|
120
|
+
* screens all are 44px. Since 1.5.
|
|
120
121
|
*/
|
|
121
|
-
size: 'default' | 'small';
|
|
122
|
+
size: 'default' | 'medium' | 'small';
|
|
122
123
|
/**
|
|
123
124
|
* Shows a spinner in place of the chevron while you load the options (the box is `aria-busy`); the list doesn't
|
|
124
125
|
* open until it is cleared. For options fetched as the merchant types, use `cm-combobox`. Since 1.6.
|
|
@@ -65,8 +65,9 @@ export class CmSelect extends CmLocalizedElement {
|
|
|
65
65
|
*/
|
|
66
66
|
this.showGroup = false;
|
|
67
67
|
/**
|
|
68
|
-
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels.
|
|
69
|
-
*
|
|
68
|
+
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard
|
|
69
|
+
* button, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch
|
|
70
|
+
* screens all are 44px. Since 1.5.
|
|
70
71
|
*/
|
|
71
72
|
this.size = 'default';
|
|
72
73
|
/**
|
|
@@ -93,7 +93,10 @@ export class CmSideNavigation extends CmLocalizedElement {
|
|
|
93
93
|
if (next === this._open.has(k))
|
|
94
94
|
return;
|
|
95
95
|
const s = new Set(this._open);
|
|
96
|
-
|
|
96
|
+
if (next)
|
|
97
|
+
s.add(k);
|
|
98
|
+
else
|
|
99
|
+
s.delete(k);
|
|
97
100
|
this._open = s;
|
|
98
101
|
this.dispatchEvent(new CustomEvent('cm-expand', { bubbles: true, composed: true, detail: { item: it, expanded: next } }));
|
|
99
102
|
}
|
|
@@ -180,7 +183,6 @@ _CmSideNavigation_seen = new WeakMap(), _CmSideNavigation_observer = new WeakMap
|
|
|
180
183
|
this.collapsed = next;
|
|
181
184
|
return ok;
|
|
182
185
|
}, _CmSideNavigation_openFromRail = function _CmSideNavigation_openFromRail(i) {
|
|
183
|
-
const it = this.navItems[i];
|
|
184
186
|
if (!__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_setCollapsed).call(this, false))
|
|
185
187
|
return;
|
|
186
188
|
this.toggle(i, true);
|
|
@@ -226,8 +226,8 @@ export class CmSignatureField extends CmLocalizedElement {
|
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
228
228
|
const img = new Image();
|
|
229
|
-
img.
|
|
230
|
-
__classPrivateFieldGet(this, _CmSignatureField_instances, "m", _CmSignatureField_draw).call(this); };
|
|
229
|
+
img.addEventListener('load', () => { if (__classPrivateFieldGet(this, _CmSignatureField_image, "f") === img)
|
|
230
|
+
__classPrivateFieldGet(this, _CmSignatureField_instances, "m", _CmSignatureField_draw).call(this); });
|
|
231
231
|
img.src = v;
|
|
232
232
|
__classPrivateFieldSet(this, _CmSignatureField_image, img, "f");
|
|
233
233
|
this.mode = 'draw';
|
|
@@ -112,7 +112,7 @@ export declare class CmTextField extends CmLocalizedElement {
|
|
|
112
112
|
/** Native autocomplete hint, e.g. `email`, `postal-code`. */
|
|
113
113
|
autocomplete?: string;
|
|
114
114
|
/** `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px. */
|
|
115
|
-
size: 'default' | 'small';
|
|
115
|
+
size: 'default' | 'medium' | 'small';
|
|
116
116
|
/**
|
|
117
117
|
* Lowest allowed value for `number`, `date`, `time` and `datetime-local`, in the value's format (`2026-11-16T15:30`
|
|
118
118
|
* for `datetime-local`). The browser's picker doesn't offer earlier dates; an earlier value makes the field invalid.
|
|
@@ -169,8 +169,8 @@ _CmTextField_internals = new WeakMap(), _CmTextField_id = new WeakMap(), _CmText
|
|
|
169
169
|
const probe = document.createElement('input');
|
|
170
170
|
probe.type = this.type;
|
|
171
171
|
probe.value = this.min ?? '';
|
|
172
|
-
const
|
|
173
|
-
const lower =
|
|
172
|
+
const origin = Number.isFinite(probe.valueAsNumber) ? probe.valueAsNumber : 0;
|
|
173
|
+
const lower = origin + Math.floor((v - origin) / step) * step;
|
|
174
174
|
const show = (n) => {
|
|
175
175
|
if (this.type === 'number')
|
|
176
176
|
return this.formatNumber(Number(n.toPrecision(12)));
|
|
@@ -171,8 +171,8 @@ export class CmTimelineItem extends CmLocalizedElement {
|
|
|
171
171
|
? html `<cm-icon name=${this.icon} size="16"></cm-icon>` : html `<span class="dot"></span>`}</span>
|
|
172
172
|
<div class="main">
|
|
173
173
|
<div class="head">
|
|
174
|
-
<span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
|
|
175
|
-
<slot name="badge"></slot>
|
|
174
|
+
<span class="lead"><span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
|
|
175
|
+
<slot name="badge"></slot></span>
|
|
176
176
|
${timeEl}
|
|
177
177
|
</div>
|
|
178
178
|
<div class="meta" part="meta" ?hidden=${!this.meta && !this._meta}><slot name="meta" @slotchange=${(e) => __classPrivateFieldGet(this, _CmTimelineItem_instances, "m", _CmTimelineItem_has).call(this, e, '_meta')}>${this.meta}</slot></div>
|
|
@@ -230,9 +230,12 @@ CmTimelineItem.styles = [
|
|
|
230
230
|
.icon.critical { background: var(--cm-bg-critical); color: var(--cm-text-critical); border-color: transparent; }
|
|
231
231
|
.dot { width: 8px; height: 8px; border-radius: var(--cm-radius-full); background: currentColor; }
|
|
232
232
|
.main { flex: 1; min-width: 0; padding-block-start: calc((32px - 20px) / 2); } /* the first line centred on the 32px icon */
|
|
233
|
-
.head { display: flex;
|
|
233
|
+
.head { display: flex; align-items: flex-start; gap: var(--cm-space-8); }
|
|
234
|
+
/* Heading and badges wrap inside their own column, so the time keeps its place at the end of the first line
|
|
235
|
+
however long the heading is (1.8.1; before, a long heading pushed the time onto a line of its own). */
|
|
236
|
+
.lead { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--cm-space-8); row-gap: 4px; }
|
|
234
237
|
.title { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
|
|
235
|
-
.when { margin-inline-start: auto; }
|
|
238
|
+
.when { flex: none; display: flex; margin-inline-start: auto; margin-block-start: 2px; } /* 16px time on the 20px first line */
|
|
236
239
|
time {
|
|
237
240
|
position: relative; display: inline-block; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums;
|
|
238
241
|
border-radius: var(--cm-radius-xs);
|
|
@@ -250,6 +253,12 @@ CmTimelineItem.styles = [
|
|
|
250
253
|
}
|
|
251
254
|
.toggle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
252
255
|
.actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); margin-block-start: var(--cm-space-8); }
|
|
256
|
+
/* Phones: the time goes under the heading, left-aligned, so the heading keeps the full width. */
|
|
257
|
+
@media (max-width: 640px) {
|
|
258
|
+
.head { flex-wrap: wrap; row-gap: 2px; }
|
|
259
|
+
.lead { flex-basis: 100%; }
|
|
260
|
+
.when { margin-inline-start: 0; margin-block-start: 0; }
|
|
261
|
+
}
|
|
253
262
|
[hidden] { display: none !important; }
|
|
254
263
|
.sr { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
255
264
|
::slotted([slot='badge']) { flex: none; }
|
|
@@ -709,6 +709,12 @@
|
|
|
709
709
|
"name": "#focusActive",
|
|
710
710
|
"privacy": "private"
|
|
711
711
|
},
|
|
712
|
+
{
|
|
713
|
+
"kind": "method",
|
|
714
|
+
"name": "#fit",
|
|
715
|
+
"privacy": "private",
|
|
716
|
+
"description": "Opens toward the other side when the menu would run off the screen (1.8.1: a More menu at the end of a page header)."
|
|
717
|
+
},
|
|
712
718
|
{
|
|
713
719
|
"kind": "field",
|
|
714
720
|
"name": "#triggerKey",
|
|
@@ -9333,7 +9339,7 @@
|
|
|
9333
9339
|
"name": "size",
|
|
9334
9340
|
"privacy": "public",
|
|
9335
9341
|
"type": {
|
|
9336
|
-
"text": "'default' | 'small'"
|
|
9342
|
+
"text": "'default' | 'medium' | 'small'"
|
|
9337
9343
|
},
|
|
9338
9344
|
"default": "'default'",
|
|
9339
9345
|
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens both are 44px. Since 1.5.",
|
|
@@ -10055,7 +10061,7 @@
|
|
|
10055
10061
|
{
|
|
10056
10062
|
"name": "size",
|
|
10057
10063
|
"type": {
|
|
10058
|
-
"text": "'default' | 'small'"
|
|
10064
|
+
"text": "'default' | 'medium' | 'small'"
|
|
10059
10065
|
},
|
|
10060
10066
|
"default": "'default'",
|
|
10061
10067
|
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens both are 44px. Since 1.5.",
|
|
@@ -13156,7 +13162,7 @@
|
|
|
13156
13162
|
"name": "size",
|
|
13157
13163
|
"privacy": "public",
|
|
13158
13164
|
"type": {
|
|
13159
|
-
"text": "'default' | 'small'"
|
|
13165
|
+
"text": "'default' | 'medium' | 'small'"
|
|
13160
13166
|
},
|
|
13161
13167
|
"default": "'default'",
|
|
13162
13168
|
"description": "`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px.",
|
|
@@ -13898,7 +13904,7 @@
|
|
|
13898
13904
|
{
|
|
13899
13905
|
"name": "size",
|
|
13900
13906
|
"type": {
|
|
13901
|
-
"text": "'default' | 'small'"
|
|
13907
|
+
"text": "'default' | 'medium' | 'small'"
|
|
13902
13908
|
},
|
|
13903
13909
|
"default": "'default'",
|
|
13904
13910
|
"description": "`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px.",
|
|
@@ -14287,7 +14293,7 @@
|
|
|
14287
14293
|
"name": "size",
|
|
14288
14294
|
"privacy": "public",
|
|
14289
14295
|
"type": {
|
|
14290
|
-
"text": "'default' | 'small'"
|
|
14296
|
+
"text": "'default' | 'medium' | 'small'"
|
|
14291
14297
|
},
|
|
14292
14298
|
"default": "'default'",
|
|
14293
14299
|
"description": "`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px.",
|
|
@@ -14893,7 +14899,7 @@
|
|
|
14893
14899
|
{
|
|
14894
14900
|
"name": "size",
|
|
14895
14901
|
"type": {
|
|
14896
|
-
"text": "'default' | 'small'"
|
|
14902
|
+
"text": "'default' | 'medium' | 'small'"
|
|
14897
14903
|
},
|
|
14898
14904
|
"default": "'default'",
|
|
14899
14905
|
"description": "`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px.",
|
|
@@ -25183,7 +25189,7 @@
|
|
|
25183
25189
|
"name": ""
|
|
25184
25190
|
},
|
|
25185
25191
|
{
|
|
25186
|
-
"description": "A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=\"\"` when the row names the product)
|
|
25192
|
+
"description": "A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=\"\"` when the row names the product), an `<img>`, or a `cm-icon` (centred in the square, for settings and navigation lists).",
|
|
25187
25193
|
"name": "media"
|
|
25188
25194
|
},
|
|
25189
25195
|
{
|
|
@@ -27686,10 +27692,10 @@
|
|
|
27686
27692
|
"name": "size",
|
|
27687
27693
|
"privacy": "public",
|
|
27688
27694
|
"type": {
|
|
27689
|
-
"text": "'default' | 'small'"
|
|
27695
|
+
"text": "'default' | 'medium' | 'small'"
|
|
27690
27696
|
},
|
|
27691
27697
|
"default": "'default'",
|
|
27692
|
-
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens
|
|
27698
|
+
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard\nbutton, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens all are 44px. Since 1.5.",
|
|
27693
27699
|
"attribute": "size",
|
|
27694
27700
|
"reflects": true
|
|
27695
27701
|
},
|
|
@@ -28145,10 +28151,10 @@
|
|
|
28145
28151
|
{
|
|
28146
28152
|
"name": "size",
|
|
28147
28153
|
"type": {
|
|
28148
|
-
"text": "'default' | 'small'"
|
|
28154
|
+
"text": "'default' | 'medium' | 'small'"
|
|
28149
28155
|
},
|
|
28150
28156
|
"default": "'default'",
|
|
28151
|
-
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens
|
|
28157
|
+
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard\nbutton, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens all are 44px. Since 1.5.",
|
|
28152
28158
|
"fieldName": "size"
|
|
28153
28159
|
},
|
|
28154
28160
|
{
|
|
@@ -32501,7 +32507,7 @@
|
|
|
32501
32507
|
"name": "size",
|
|
32502
32508
|
"privacy": "public",
|
|
32503
32509
|
"type": {
|
|
32504
|
-
"text": "'default' | 'small'"
|
|
32510
|
+
"text": "'default' | 'medium' | 'small'"
|
|
32505
32511
|
},
|
|
32506
32512
|
"default": "'default'",
|
|
32507
32513
|
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px.",
|
|
@@ -32891,7 +32897,7 @@
|
|
|
32891
32897
|
{
|
|
32892
32898
|
"name": "size",
|
|
32893
32899
|
"type": {
|
|
32894
|
-
"text": "'default' | 'small'"
|
|
32900
|
+
"text": "'default' | 'medium' | 'small'"
|
|
32895
32901
|
},
|
|
32896
32902
|
"default": "'default'",
|
|
32897
32903
|
"description": "`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px.",
|
package/dist/field.js
CHANGED
|
@@ -18,6 +18,9 @@ export const fieldStyles = css `
|
|
|
18
18
|
--_cm-field-pad: var(--cm-space-12, 12px);
|
|
19
19
|
}
|
|
20
20
|
:host([size='small']) { --_cm-field-h: var(--cm-control-height-sm, 32px); --_cm-field-pad: var(--cm-space-8, 8px); }
|
|
21
|
+
/* medium (1.8.1): 36px, the height of a standard button, for fields in a row of buttons (page header actions). */
|
|
22
|
+
:host([size='medium']) { --_cm-field-h: var(--cm-control-height-md, 36px); }
|
|
23
|
+
@media (pointer: coarse) { :host([size='medium']) { --_cm-field-h: var(--cm-control-height-touch, 44px); } }
|
|
21
24
|
@media (pointer: coarse) {
|
|
22
25
|
:host, :host([size='small']) { --_cm-field-h: var(--cm-control-height-touch, 44px); --_cm-field-font: var(--cm-font-size-16, 16px); }
|
|
23
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Commmerce UI web components: build apps that feel native to the Commmerce admin. Works in plain HTML, React, Vue and server-rendered pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"test": "vitest run"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@commmerce/icons": "1.
|
|
54
|
-
"@commmerce/tokens": "1.
|
|
53
|
+
"@commmerce/icons": "1.8.1",
|
|
54
|
+
"@commmerce/tokens": "1.8.1",
|
|
55
55
|
"lit": "3.2.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|