@commmerce/ui 1.4.0 → 1.5.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/dist/calendar.js +15 -19
- package/dist/cdn.js +1270 -1139
- 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 +22 -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 +19 -4
- package/dist/components/page.js +24 -8
- 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 +933 -158
- 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
|
@@ -77,8 +77,11 @@ export declare class CmSearch extends CmLocalizedElement {
|
|
|
77
77
|
filterLabel: string;
|
|
78
78
|
/** Number of filters applied; shown on the filter button when above 0. */
|
|
79
79
|
filterCount: number;
|
|
80
|
-
/**
|
|
81
|
-
|
|
80
|
+
/**
|
|
81
|
+
* `default` 36px (lists, table headers); `small` 32px (toolbars and filter rows, since 1.5); `large` 40px (page-level
|
|
82
|
+
* search). On touch screens every size is 44px.
|
|
83
|
+
*/
|
|
84
|
+
size: 'default' | 'small' | 'large';
|
|
82
85
|
/** Blocks interaction. Also set by a disabled `<fieldset>`. */
|
|
83
86
|
disabled: boolean;
|
|
84
87
|
static styles: import("lit").CSSResult[];
|
|
@@ -12,6 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
var _CmSearch_instances, _CmSearch_internals, _CmSearch_id, _CmSearch_defaultValue, _CmSearch_fire, _CmSearch_onInput, _CmSearch_onKeyDown, _CmSearch_clear;
|
|
13
13
|
import { LitElement, html, css, nothing } from 'lit';
|
|
14
14
|
import { live } from 'lit/directives/live.js';
|
|
15
|
+
import { fieldStyles } from '../field.js';
|
|
15
16
|
import { base, define, nextId } from '../base.js';
|
|
16
17
|
import { CmLocalizedElement, defineStrings } from '../localize.js';
|
|
17
18
|
import './icon.js';
|
|
@@ -46,7 +47,10 @@ export class CmSearch extends CmLocalizedElement {
|
|
|
46
47
|
this.filter = false;
|
|
47
48
|
/** Number of filters applied; shown on the filter button when above 0. */
|
|
48
49
|
this.filterCount = 0;
|
|
49
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* `default` 36px (lists, table headers); `small` 32px (toolbars and filter rows, since 1.5); `large` 40px (page-level
|
|
52
|
+
* search). On touch screens every size is 44px.
|
|
53
|
+
*/
|
|
50
54
|
this.size = 'default';
|
|
51
55
|
/** Blocks interaction. Also set by a disabled `<fieldset>`. */
|
|
52
56
|
this.disabled = false;
|
|
@@ -65,19 +69,18 @@ export class CmSearch extends CmLocalizedElement {
|
|
|
65
69
|
formStateRestoreCallback(state) { this.value = state; }
|
|
66
70
|
updated() { __classPrivateFieldGet(this, _CmSearch_internals, "f").setFormValue(this.value); }
|
|
67
71
|
render() {
|
|
68
|
-
const big = this.size === 'large';
|
|
69
72
|
return html `<div class="box" part="box">
|
|
70
|
-
<cm-icon class="icon" name="search" size
|
|
73
|
+
<cm-icon class="icon" name="search" size="16"></cm-icon>
|
|
71
74
|
<input id=${__classPrivateFieldGet(this, _CmSearch_id, "f")} part="input" type="search" enterkeyhint="search" autocomplete="off"
|
|
72
75
|
aria-label=${this.label} .value=${live(this.value)} placeholder=${this.placeholder || nothing} ?disabled=${this.disabled}
|
|
73
76
|
@input=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_onInput)} @change=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'change')} @keydown=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_onKeyDown)} />
|
|
74
77
|
${this.value && !this.disabled
|
|
75
|
-
? html `<button type="button" class="clear" part="clear" aria-label=${this.t('clear')} @click=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_clear)}><cm-icon name="close" size="
|
|
78
|
+
? html `<button type="button" class="clear" part="clear" aria-label=${this.t('clear')} @click=${__classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_clear)}><cm-icon name="close" size="16"></cm-icon></button>`
|
|
76
79
|
: nothing}
|
|
77
80
|
${this.filter
|
|
78
81
|
? html `<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
|
|
79
82
|
aria-label=${this.filterCount > 0 ? this.t('filterApplied', { label: this.filterLabel, count: this.filterCount }) : this.filterLabel}
|
|
80
|
-
@click=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'cm-filter')}><cm-icon name="filter" size="
|
|
83
|
+
@click=${() => __classPrivateFieldGet(this, _CmSearch_instances, "m", _CmSearch_fire).call(this, 'cm-filter')}><cm-icon name="filter" size="16"></cm-icon>${this.filterCount > 0 ? html `<span class="count" aria-hidden="true">${this.filterCount}</span>` : nothing}</button>`
|
|
81
84
|
: nothing}
|
|
82
85
|
</div>`;
|
|
83
86
|
}
|
|
@@ -114,34 +117,37 @@ CmSearch.properties = {
|
|
|
114
117
|
};
|
|
115
118
|
CmSearch.styles = [
|
|
116
119
|
base,
|
|
120
|
+
fieldStyles,
|
|
117
121
|
css `
|
|
118
122
|
:host { display: block; }
|
|
123
|
+
:host([size='large']) { --_cm-field-h: var(--cm-control-height-lg, 40px); }
|
|
124
|
+
@media (pointer: coarse) { :host([size='large']) { --_cm-field-h: var(--cm-control-height-touch, 44px); } button { width: 32px; height: 32px; } }
|
|
119
125
|
.box {
|
|
120
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
121
|
-
background: var(--cm-bg-
|
|
126
|
+
display: flex; align-items: center; gap: var(--cm-space-8); height: var(--_cm-field-h); padding-block: 0; padding-inline: var(--_cm-field-pad) var(--cm-space-8);
|
|
127
|
+
background: var(--cm-bg-surface); color: var(--cm-text-default);
|
|
122
128
|
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
|
|
123
129
|
}
|
|
124
|
-
:host([size='large']) .box { height: 46px; padding: 0 var(--cm-space-15); }
|
|
125
130
|
.box:focus-within { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
|
|
126
|
-
.icon { flex: none; color: var(--cm-
|
|
131
|
+
.icon { flex: none; color: var(--cm-text-tertiary); }
|
|
127
132
|
input {
|
|
128
133
|
flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none;
|
|
129
|
-
font: inherit; font-size:
|
|
134
|
+
font: inherit; font-size: var(--_cm-field-font); color: var(--cm-text-default);
|
|
130
135
|
}
|
|
131
136
|
input::placeholder { color: var(--cm-text-tertiary); }
|
|
132
137
|
input::-webkit-search-cancel-button { display: none; }
|
|
133
138
|
button {
|
|
134
139
|
position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
|
|
135
|
-
width:
|
|
140
|
+
width: 24px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: var(--cm-radius-xs);
|
|
136
141
|
background: none; color: var(--cm-icon-selected); cursor: pointer;
|
|
137
142
|
}
|
|
138
143
|
button:hover { background: var(--cm-bg-hover); }
|
|
139
144
|
button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
140
145
|
.count {
|
|
141
|
-
position: absolute; top: -
|
|
142
|
-
background: var(--cm-action-primary); color: var(--cm-action-primary-text);
|
|
146
|
+
position: absolute; top: -4px; inset-inline-end: -4px; min-width: 16px; height: 16px; padding: 0 var(--cm-space-4); border-radius: var(--cm-radius-full);
|
|
147
|
+
background: var(--cm-action-primary); color: var(--cm-action-primary-text);
|
|
148
|
+
font-size: var(--cm-font-size-12); line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
|
|
143
149
|
}
|
|
144
|
-
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-
|
|
150
|
+
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
145
151
|
:host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
146
152
|
:host([disabled]) button { cursor: not-allowed; }
|
|
147
153
|
`,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CmOptionGroup } from './option-group.js';
|
|
2
|
+
declare const strings: {
|
|
3
|
+
/** Validation message when `required` and nothing is chosen. */
|
|
4
|
+
required: string;
|
|
5
|
+
};
|
|
6
|
+
declare module '../localize.js' {
|
|
7
|
+
interface CmStrings {
|
|
8
|
+
segmentedControl: typeof strings;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A compact switch between two to four views or filters of the same content ("Open / Done", "Board / List"): the
|
|
13
|
+
* options sit side by side in one track and exactly one is selected. Since 1.5.
|
|
14
|
+
*
|
|
15
|
+
* It is an option group with a different look, so it behaves exactly like `cm-option-group`: a radio group with one
|
|
16
|
+
* tab stop, arrow keys (mirrored in right-to-left text), Home and End move and select, `change` fires on every new
|
|
17
|
+
* choice, and inside a form it submits its `value`. Options come from `<option>` children or the `options` property.
|
|
18
|
+
* Option `tone`s are not shown: a view switch has no good or bad answer.
|
|
19
|
+
*
|
|
20
|
+
* Use it to change what a page or card shows, right away. To pick a setting that is saved with a form, use
|
|
21
|
+
* `cm-option-group` (bigger, separate buttons); for five or more choices, `cm-select`; for page sections, tabs.
|
|
22
|
+
* @element cm-segmented-control
|
|
23
|
+
* @slot - `<option value="…">Label</option>` elements. `disabled` and `selected` are honoured.
|
|
24
|
+
* @csspart options - The track (`role="radiogroup"`).
|
|
25
|
+
* @csspart option - Each option (`role="radio"`).
|
|
26
|
+
* @csspart label - The visible label, when `label` is set.
|
|
27
|
+
* @fires change - When the merchant picks a different option.
|
|
28
|
+
* @fires input - Same moment as `change`.
|
|
29
|
+
*/
|
|
30
|
+
export declare class CmSegmentedControl extends CmOptionGroup {
|
|
31
|
+
static properties: {
|
|
32
|
+
size: {
|
|
33
|
+
reflect: boolean;
|
|
34
|
+
};
|
|
35
|
+
label: {};
|
|
36
|
+
name: {
|
|
37
|
+
reflect: boolean;
|
|
38
|
+
};
|
|
39
|
+
value: {};
|
|
40
|
+
options: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
};
|
|
43
|
+
required: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
reflect: boolean;
|
|
46
|
+
};
|
|
47
|
+
disabled: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
reflect: boolean;
|
|
50
|
+
};
|
|
51
|
+
_slotted: {
|
|
52
|
+
state: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* `default`: a 36px track, the height of buttons and fields beside it. `small`: 32px, for toolbars, filter rows and
|
|
57
|
+
* card headers next to small fields and slim buttons. On touch screens both are 44px tall.
|
|
58
|
+
*/
|
|
59
|
+
size: 'default' | 'small';
|
|
60
|
+
static styles: import("lit").CSSResult[];
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'cm-segmented-control': CmSegmentedControl;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { base, define } from '../base.js';
|
|
3
|
+
import { defineStrings } from '../localize.js';
|
|
4
|
+
import { CmOptionGroup } from './option-group.js';
|
|
5
|
+
const strings = defineStrings('segmentedControl', {
|
|
6
|
+
/** Validation message when `required` and nothing is chosen. */
|
|
7
|
+
required: 'Please select one of these options.',
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* A compact switch between two to four views or filters of the same content ("Open / Done", "Board / List"): the
|
|
11
|
+
* options sit side by side in one track and exactly one is selected. Since 1.5.
|
|
12
|
+
*
|
|
13
|
+
* It is an option group with a different look, so it behaves exactly like `cm-option-group`: a radio group with one
|
|
14
|
+
* tab stop, arrow keys (mirrored in right-to-left text), Home and End move and select, `change` fires on every new
|
|
15
|
+
* choice, and inside a form it submits its `value`. Options come from `<option>` children or the `options` property.
|
|
16
|
+
* Option `tone`s are not shown: a view switch has no good or bad answer.
|
|
17
|
+
*
|
|
18
|
+
* Use it to change what a page or card shows, right away. To pick a setting that is saved with a form, use
|
|
19
|
+
* `cm-option-group` (bigger, separate buttons); for five or more choices, `cm-select`; for page sections, tabs.
|
|
20
|
+
* @element cm-segmented-control
|
|
21
|
+
* @slot - `<option value="…">Label</option>` elements. `disabled` and `selected` are honoured.
|
|
22
|
+
* @csspart options - The track (`role="radiogroup"`).
|
|
23
|
+
* @csspart option - Each option (`role="radio"`).
|
|
24
|
+
* @csspart label - The visible label, when `label` is set.
|
|
25
|
+
* @fires change - When the merchant picks a different option.
|
|
26
|
+
* @fires input - Same moment as `change`.
|
|
27
|
+
*/
|
|
28
|
+
export class CmSegmentedControl extends CmOptionGroup {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
/**
|
|
32
|
+
* `default`: a 36px track, the height of buttons and fields beside it. `small`: 32px, for toolbars, filter rows and
|
|
33
|
+
* card headers next to small fields and slim buttons. On touch screens both are 44px tall.
|
|
34
|
+
*/
|
|
35
|
+
this.size = 'default';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
CmSegmentedControl.properties = {
|
|
39
|
+
...CmOptionGroup.properties,
|
|
40
|
+
size: { reflect: true },
|
|
41
|
+
};
|
|
42
|
+
CmSegmentedControl.styles = [
|
|
43
|
+
base,
|
|
44
|
+
css `
|
|
45
|
+
:host { display: inline-block; vertical-align: middle; max-width: 100%; --_h: var(--cm-control-height-md, 36px); }
|
|
46
|
+
:host([size='small']) { --_h: var(--cm-control-height-sm, 32px); }
|
|
47
|
+
@media (pointer: coarse) { :host, :host([size='small']) { --_h: var(--cm-control-height-touch, 44px); } }
|
|
48
|
+
.label {
|
|
49
|
+
display: block; margin-bottom: var(--cm-space-8);
|
|
50
|
+
font-size: var(--cm-type-label-size); line-height: var(--cm-type-label-line-height); font-weight: var(--cm-type-label-weight);
|
|
51
|
+
}
|
|
52
|
+
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
53
|
+
.options {
|
|
54
|
+
display: inline-flex; max-width: 100%; height: var(--_h); padding: 2px; gap: 2px;
|
|
55
|
+
background: var(--cm-bg-hover); border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-sm);
|
|
56
|
+
}
|
|
57
|
+
button {
|
|
58
|
+
flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 var(--cm-space-12);
|
|
59
|
+
font: inherit; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); font-weight: 500; white-space: nowrap;
|
|
60
|
+
overflow: hidden; text-overflow: ellipsis;
|
|
61
|
+
color: var(--cm-text-tertiary); background: none; cursor: pointer;
|
|
62
|
+
border: var(--cm-border-1) solid transparent; border-radius: var(--cm-radius-xs);
|
|
63
|
+
}
|
|
64
|
+
:host([size='small']) button { padding: 0 var(--cm-space-8); font-size: var(--cm-font-size-13); }
|
|
65
|
+
button:hover:not(:disabled) { color: var(--cm-text-default); }
|
|
66
|
+
/* Selected: a white segment with the control outline (border-input, 3:1 or more) and dark text, so the choice
|
|
67
|
+
doesn't rest on colour alone. */
|
|
68
|
+
button[aria-checked='true'] { color: var(--cm-text-default); background: var(--cm-bg-surface); border-color: var(--cm-border-input); }
|
|
69
|
+
button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; }
|
|
70
|
+
button:disabled { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
71
|
+
button[aria-checked='true']:disabled { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
72
|
+
:host([disabled]) .options { background: var(--cm-bg-input-filled); }
|
|
73
|
+
slot { display: none; }
|
|
74
|
+
`,
|
|
75
|
+
];
|
|
76
|
+
define('cm-segmented-control', CmSegmentedControl);
|
|
@@ -74,6 +74,9 @@ export declare class CmSelect extends CmLocalizedElement {
|
|
|
74
74
|
type: BooleanConstructor;
|
|
75
75
|
attribute: string;
|
|
76
76
|
};
|
|
77
|
+
size: {
|
|
78
|
+
reflect: boolean;
|
|
79
|
+
};
|
|
77
80
|
_active: {
|
|
78
81
|
state: boolean;
|
|
79
82
|
};
|
|
@@ -106,6 +109,11 @@ export declare class CmSelect extends CmLocalizedElement {
|
|
|
106
109
|
* repeat across groups. The list itself always shows the bare label under its group heading. Since 1.3.
|
|
107
110
|
*/
|
|
108
111
|
showGroup: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 36px box. On touch
|
|
114
|
+
* screens both are 44px. Since 1.5.
|
|
115
|
+
*/
|
|
116
|
+
size: 'default' | 'small';
|
|
109
117
|
_active: number;
|
|
110
118
|
_slotted: SelectOption[];
|
|
111
119
|
static styles: import("lit").CSSResult[];
|
|
@@ -14,6 +14,7 @@ import { LitElement, html, css, nothing } from 'lit';
|
|
|
14
14
|
import { base, define, nextId } from '../base.js';
|
|
15
15
|
import { CmLocalizedElement, defineStrings } from '../localize.js';
|
|
16
16
|
import { groupStyles, sortByGroup, groupRuns } from '../popover.js';
|
|
17
|
+
import { fieldStyles, optionStyles } from '../field.js';
|
|
17
18
|
import './icon.js';
|
|
18
19
|
const strings = defineStrings('select', {
|
|
19
20
|
/** Validation message when `required` and nothing is chosen. */
|
|
@@ -62,6 +63,11 @@ export class CmSelect extends CmLocalizedElement {
|
|
|
62
63
|
* repeat across groups. The list itself always shows the bare label under its group heading. Since 1.3.
|
|
63
64
|
*/
|
|
64
65
|
this.showGroup = false;
|
|
66
|
+
/**
|
|
67
|
+
* `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 36px box. On touch
|
|
68
|
+
* screens both are 44px. Since 1.5.
|
|
69
|
+
*/
|
|
70
|
+
this.size = 'default';
|
|
65
71
|
this._active = -1;
|
|
66
72
|
this._slotted = [];
|
|
67
73
|
_CmSelect_internals.set(this, this.attachInternals());
|
|
@@ -318,49 +324,43 @@ CmSelect.properties = {
|
|
|
318
324
|
disabled: { type: Boolean, reflect: true },
|
|
319
325
|
open: { type: Boolean, reflect: true },
|
|
320
326
|
showGroup: { type: Boolean, attribute: 'show-group' },
|
|
327
|
+
size: { reflect: true },
|
|
321
328
|
_active: { state: true },
|
|
322
329
|
_slotted: { state: true },
|
|
323
330
|
};
|
|
324
331
|
CmSelect.styles = [
|
|
325
332
|
base,
|
|
333
|
+
fieldStyles,
|
|
334
|
+
optionStyles,
|
|
326
335
|
groupStyles,
|
|
327
336
|
css `
|
|
328
337
|
:host { display: block; position: relative; }
|
|
329
|
-
.
|
|
330
|
-
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); cursor: default; }
|
|
331
|
-
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
338
|
+
.label { cursor: default; }
|
|
332
339
|
.wrap { position: relative; }
|
|
333
340
|
.box {
|
|
334
|
-
display: flex; align-items: center; gap: var(--cm-space-
|
|
335
|
-
|
|
341
|
+
display: flex; align-items: center; gap: var(--cm-space-8); width: 100%; height: var(--_cm-field-h);
|
|
342
|
+
padding-block: 0; padding-inline: var(--_cm-field-pad) var(--cm-space-8);
|
|
343
|
+
font-size: var(--_cm-field-font); line-height: var(--cm-line-height-14); color: var(--cm-text-default); background: var(--cm-bg-surface); cursor: pointer;
|
|
336
344
|
border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm); outline: none; user-select: none;
|
|
337
345
|
}
|
|
338
346
|
.box:focus-visible, :host([open]) .box { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
|
|
339
347
|
.text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
340
348
|
.placeholder { color: var(--cm-text-tertiary); }
|
|
341
|
-
.chev { flex: none; color: var(--cm-icon-selected); transition: transform
|
|
349
|
+
.chev { flex: none; color: var(--cm-icon-selected); transition: transform var(--cm-duration-fast) var(--cm-easing-standard); }
|
|
342
350
|
:host([open]) .chev { transform: rotate(180deg); }
|
|
343
351
|
:host([error]:not([error=''])) .box { border-color: var(--cm-border-critical); }
|
|
344
|
-
:host([disabled]) .box { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-
|
|
352
|
+
:host([disabled]) .box { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
|
|
345
353
|
[role='listbox'] {
|
|
346
|
-
position: absolute; z-index: 20; top: calc(100% + var(--cm-space-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-100);
|
|
350
|
-
}
|
|
351
|
-
[role='option'] {
|
|
352
|
-
display: flex; align-items: center; min-height: 40px; padding: 6px var(--cm-space-20);
|
|
353
|
-
font-size: 16px; color: var(--cm-text-default); cursor: pointer;
|
|
354
|
+
position: absolute; z-index: 20; top: calc(100% + var(--cm-space-4)); inset-inline: 0; min-width: max-content;
|
|
355
|
+
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-subtle);
|
|
356
|
+
border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-md);
|
|
354
357
|
}
|
|
355
358
|
[role='option'].active { background: var(--cm-bg-hover); }
|
|
356
359
|
[role='option'][aria-selected='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
|
|
357
360
|
[role='option'][aria-selected='true'].active { background: var(--cm-action-primary-hover); }
|
|
358
361
|
[role='option'][aria-disabled='true'] { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
359
362
|
[role='group'] { display: block; }
|
|
360
|
-
.help, .error { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
|
|
361
|
-
.error { color: var(--cm-text-critical); }
|
|
362
363
|
slot { display: none; }
|
|
363
|
-
@media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
|
|
364
364
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
365
365
|
`,
|
|
366
366
|
];
|
|
@@ -112,7 +112,7 @@ export class CmSideNavigation extends CmLocalizedElement {
|
|
|
112
112
|
${__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_tip).call(this, it, html `<button type="button" class="item parent ${hasCurrent(it) ? 'has-current' : ''}" part="item" data-index=${i}
|
|
113
113
|
aria-expanded=${open ? 'true' : 'false'} aria-controls=${sub} @click=${() => (rail ? __classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_openFromRail).call(this, i) : this.toggle(i))}>
|
|
114
114
|
${__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_icon).call(this, it)}${__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_text).call(this, it)}
|
|
115
|
-
${rail ? nothing : html `<cm-icon class="chev" name="chevron-down" size="
|
|
115
|
+
${rail ? nothing : html `<cm-icon class="chev" name="chevron-down" size="16"></cm-icon>`}
|
|
116
116
|
</button>`)}
|
|
117
117
|
<ul class="sub" id=${sub} ?hidden=${!open} aria-label=${it.label}>
|
|
118
118
|
${__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_flatten).call(this, it.items).map(([s, d]) => html `<li>${__classPrivateFieldGet(this, _CmSideNavigation_instances, "m", _CmSideNavigation_link).call(this, { ...s, icon: undefined }, d ? 'deep' : '', { parent: i })}</li>`)}
|
|
@@ -188,7 +188,7 @@ _CmSideNavigation_seen = new WeakMap(), _CmSideNavigation_observer = new WeakMap
|
|
|
188
188
|
}, _CmSideNavigation_icon = function _CmSideNavigation_icon(it) {
|
|
189
189
|
if (it.icon)
|
|
190
190
|
return html `<cm-icon name=${it.icon} size="20"></cm-icon>`;
|
|
191
|
-
return this.collapsed ? html `<span class="initial" aria-hidden="true">${[...it.label.trim()][0] ?? ''}</span>` : nothing;
|
|
191
|
+
return this.collapsed ? html `<span class="initial" aria-hidden="true">${([...it.label.trim()][0] ?? '').toLocaleUpperCase(this.locale)}</span>` : nothing;
|
|
192
192
|
}, _CmSideNavigation_text = function _CmSideNavigation_text(it) {
|
|
193
193
|
if (!this.collapsed)
|
|
194
194
|
return html `<span class="label">${it.label}</span>${it.badge ? html `<span class="badge">${it.badge}</span>` : nothing}`;
|
|
@@ -225,43 +225,46 @@ CmSideNavigation.styles = [
|
|
|
225
225
|
css `
|
|
226
226
|
:host { display: block; width: var(--cm-side-navigation-width, 250px); }
|
|
227
227
|
nav {
|
|
228
|
-
background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius:
|
|
229
|
-
padding:
|
|
228
|
+
background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: var(--cm-radius-lg);
|
|
229
|
+
padding: var(--cm-space-12) 0; font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14);
|
|
230
230
|
}
|
|
231
231
|
ul { list-style: none; margin: 0; padding: 0; }
|
|
232
232
|
.item {
|
|
233
|
-
display: flex; align-items: center; gap:
|
|
234
|
-
|
|
233
|
+
display: flex; align-items: center; gap: var(--cm-space-8); box-sizing: border-box; width: calc(100% - 2 * var(--cm-space-8));
|
|
234
|
+
min-height: var(--cm-control-height-md); margin: 0 var(--cm-space-8); padding-block: 0; padding-inline: var(--cm-space-12) var(--cm-space-8);
|
|
235
|
+
font: inherit; color: inherit; text-align: start; text-decoration: none; background: none; border: 0; border-radius: var(--cm-radius-sm); cursor: pointer;
|
|
235
236
|
}
|
|
236
237
|
.item:hover { color: var(--cm-text-on-dark); background: var(--cm-nav-active); }
|
|
237
238
|
.item:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: -2px; color: var(--cm-text-on-dark); }
|
|
238
239
|
.item[aria-current='page'] { color: var(--cm-text-on-dark); font-weight: 600; }
|
|
239
240
|
.parent.has-current { color: var(--cm-text-on-dark); }
|
|
240
241
|
.label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
|
|
241
|
-
.chev { transition: transform
|
|
242
|
+
.chev { transition: transform var(--cm-duration-fast) var(--cm-easing-standard); }
|
|
242
243
|
[aria-expanded='true'] .chev { transform: rotate(180deg); }
|
|
243
244
|
.badge {
|
|
244
|
-
flex: none;
|
|
245
|
-
|
|
245
|
+
flex: none; box-sizing: border-box; min-inline-size: var(--cm-space-20); padding: 0 var(--cm-space-4); text-align: center;
|
|
246
|
+
border-radius: var(--cm-radius-full); font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); font-weight: 500;
|
|
247
|
+
font-variant-numeric: tabular-nums; color: var(--cm-text-on-dark); background: var(--cm-nav-badge);
|
|
246
248
|
}
|
|
247
|
-
.sub { padding:
|
|
248
|
-
.sub .item { min-height:
|
|
249
|
-
.sub .item.deep { padding-inline-start:
|
|
249
|
+
.sub { padding: 0 0 var(--cm-space-4); }
|
|
250
|
+
.sub .item { min-height: var(--cm-control-height-sm); padding-inline-start: calc(var(--cm-space-12) + var(--cm-icon-size-md) + var(--cm-space-8)); }
|
|
251
|
+
.sub .item.deep { padding-inline-start: calc(var(--cm-space-12) + var(--cm-icon-size-md) + var(--cm-space-8) + var(--cm-space-16)); }
|
|
250
252
|
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
|
|
253
|
+
/* Touch screens: rows at least 44px tall. */
|
|
254
|
+
@media (pointer: coarse) { .item, .sub .item, :host([collapsed]) .item { min-height: var(--cm-control-height-touch); } }
|
|
251
255
|
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
|
252
|
-
.toggle { margin-block-start:
|
|
253
|
-
.toggle .label { font-size: 14px; }
|
|
256
|
+
.toggle { margin-block-start: var(--cm-space-8); color: var(--cm-text-on-dark-secondary); }
|
|
254
257
|
/* Collapsed: an icon rail. */
|
|
255
258
|
:host([collapsed]) { width: var(--cm-side-navigation-collapsed-width, 72px); }
|
|
256
259
|
:host([collapsed]) cm-tooltip { display: block; color: inherit; }
|
|
257
|
-
:host([collapsed]) .item { position: relative; justify-content: center; min-height:
|
|
260
|
+
:host([collapsed]) .item { position: relative; justify-content: center; min-height: var(--cm-control-height-lg); padding: 0; }
|
|
258
261
|
:host([collapsed]) .item[aria-current='page'], :host([collapsed]) .parent.has-current { background: var(--cm-nav-active); }
|
|
259
|
-
.initial { display: grid; place-items: center; width:
|
|
262
|
+
.initial { display: grid; place-items: center; width: var(--cm-icon-size-md); height: var(--cm-icon-size-md); font-size: var(--cm-font-size-14); font-weight: 600; }
|
|
260
263
|
.dot {
|
|
261
264
|
position: absolute; inset-block-start: 6px; inset-inline-start: calc(50% + 4px); min-width: 8px; height: 8px; border-radius: var(--cm-radius-full);
|
|
262
265
|
background: var(--cm-nav-badge); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
|
|
263
266
|
}
|
|
264
|
-
.dot.count { inset-block-start:
|
|
267
|
+
.dot.count { inset-block-start: 2px; height: 16px; padding: 0 var(--cm-space-4); font-size: var(--cm-font-size-12); font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; color: var(--cm-text-on-dark); }
|
|
265
268
|
`,
|
|
266
269
|
];
|
|
267
270
|
define('cm-side-navigation', CmSideNavigation);
|
|
@@ -59,16 +59,17 @@ CmSidePanel.styles = [
|
|
|
59
59
|
}
|
|
60
60
|
:host([size='small']) dialog { --cm-side-panel-width: 380px; }
|
|
61
61
|
:host([size='large']) dialog { --cm-side-panel-width: 720px; }
|
|
62
|
-
.panel { height: 100%; box-shadow: var(--cm-shadow-
|
|
62
|
+
.panel { height: 100%; box-shadow: var(--cm-shadow-lg); }
|
|
63
63
|
@media (prefers-reduced-motion: no-preference) {
|
|
64
|
-
dialog[open] .panel { animation: cm-side-in
|
|
64
|
+
dialog[open] .panel { animation: cm-side-in var(--cm-duration-base) var(--cm-easing-standard); }
|
|
65
65
|
}
|
|
66
66
|
/* Slides in from the end edge: from the right, or from the left in right-to-left pages. */
|
|
67
67
|
dialog:dir(rtl) { --_cm-side-from: -24px; }
|
|
68
68
|
@keyframes cm-side-in { from { transform: translateX(var(--_cm-side-from, 24px)); opacity: 0; } to { transform: none; opacity: 1; } }
|
|
69
69
|
@media (max-width: 599px) {
|
|
70
70
|
dialog { inset: 16px; width: auto; height: auto; }
|
|
71
|
-
.panel { border-radius: var(--cm-radius-
|
|
71
|
+
.panel { border-radius: var(--cm-radius-lg); }
|
|
72
|
+
|
|
72
73
|
}
|
|
73
74
|
`,
|
|
74
75
|
];
|
|
@@ -593,26 +593,26 @@ CmSignatureField.styles = [
|
|
|
593
593
|
base,
|
|
594
594
|
css `
|
|
595
595
|
:host { display: block; }
|
|
596
|
-
.field { display: flex; flex-direction: column; gap: var(--cm-space-
|
|
596
|
+
.field { display: flex; flex-direction: column; gap: var(--cm-space-8); }
|
|
597
597
|
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
598
598
|
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
599
|
-
.hint { margin-inline-start: var(--cm-space-
|
|
600
|
-
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-
|
|
599
|
+
.hint { margin-inline-start: var(--cm-space-8); font-size: 12px; color: var(--cm-text-tertiary); text-transform: lowercase; }
|
|
600
|
+
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-8); }
|
|
601
601
|
.tabs { display: flex; gap: var(--cm-space-20); }
|
|
602
602
|
.tab {
|
|
603
|
-
position: relative; min-height:
|
|
603
|
+
position: relative; min-height: var(--cm-control-height-sm); padding: 0 2px; font: inherit; font-size: var(--cm-font-size-14); font-weight: 500;
|
|
604
604
|
color: var(--cm-text-tertiary); background: none; border: 0; cursor: pointer;
|
|
605
605
|
}
|
|
606
|
-
.tab::after { content: ''; position: absolute; inset-inline: 0; bottom: 2px; height: 2px; border-radius:
|
|
606
|
+
.tab::after { content: ''; position: absolute; inset-inline: 0; bottom: 2px; height: 2px; border-radius: var(--cm-radius-full); background: transparent; }
|
|
607
607
|
.tab:hover:not(:disabled), .tab[aria-selected='true'] { color: var(--cm-text-default); }
|
|
608
608
|
.tab[aria-selected='true']::after { background: var(--cm-border-strong); }
|
|
609
609
|
.tab:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
|
|
610
610
|
.tab:disabled { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
611
|
-
.actions { display: flex; gap: var(--cm-space-
|
|
612
|
-
/* Secondary
|
|
611
|
+
.actions { display: flex; gap: var(--cm-space-8); margin-inline-start: auto; }
|
|
612
|
+
/* Secondary slim Button (32px): the pad's own small actions. */
|
|
613
613
|
.act {
|
|
614
|
-
display: inline-flex; align-items: center; height:
|
|
615
|
-
font: inherit; font-size:
|
|
614
|
+
display: inline-flex; align-items: center; height: var(--cm-control-height-sm); padding: 0 var(--cm-space-12);
|
|
615
|
+
font: inherit; font-size: var(--cm-font-size-13); font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
|
|
616
616
|
background: var(--cm-bg-hover); color: var(--cm-text-default);
|
|
617
617
|
border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-sm);
|
|
618
618
|
}
|
|
@@ -629,31 +629,33 @@ CmSignatureField.styles = [
|
|
|
629
629
|
canvas {
|
|
630
630
|
position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair;
|
|
631
631
|
/* The ink: read in script. The transition makes a theme change fire transitionend, which repaints the ink. */
|
|
632
|
-
color: var(--cm-text-default); transition: color 1ms;
|
|
632
|
+
color: var(--cm-text-default); transition-property: color; transition-duration: 1ms; /* scale-exempt: not motion; a 1ms colour transition makes a theme change fire transitionend so the ink repaints */
|
|
633
633
|
}
|
|
634
634
|
.line {
|
|
635
|
-
position: absolute; inset-inline: var(--cm-space-
|
|
635
|
+
position: absolute; inset-inline: var(--cm-space-12); top: ${BASELINE * 100}%; height: 0;
|
|
636
636
|
border-top: var(--cm-border-1) dashed var(--cm-border-input); pointer-events: none;
|
|
637
637
|
}
|
|
638
638
|
.here {
|
|
639
|
-
position: absolute; inset-inline-start: var(--cm-space-
|
|
639
|
+
position: absolute; inset-inline-start: var(--cm-space-12); bottom: calc(${(1 - BASELINE) * 100}% + 4px);
|
|
640
640
|
font-size: 12px; color: var(--cm-text-tertiary); pointer-events: none; user-select: none;
|
|
641
641
|
}
|
|
642
642
|
.typed {
|
|
643
|
-
position: absolute; inset-inline: var(--cm-space-
|
|
644
|
-
width: calc(100% - 2 * var(--cm-space-
|
|
643
|
+
position: absolute; inset-inline: var(--cm-space-12); bottom: calc(${(1 - BASELINE) * 100}% - 0.18em);
|
|
644
|
+
width: calc(100% - 2 * var(--cm-space-12)); padding: 0; margin: 0;
|
|
645
645
|
font-family: var(--cm-signature-font, 'Dancing Script', 'Segoe Script', 'Bradley Hand', 'Snell Roundhand', 'Brush Script MT', cursive);
|
|
646
|
-
font-size: clamp(24px, 9cqi, 48px); font-weight: 400; line-height: 1.25; text-align: center;
|
|
646
|
+
font-size: clamp(24px, 9cqi, 48px); font-weight: 400; line-height: 1.25; text-align: center; /* scale-exempt: a typed signature scales with the pad, like handwriting */
|
|
647
647
|
color: var(--cm-text-default); background: transparent; border: 0; outline: none;
|
|
648
648
|
}
|
|
649
649
|
.typed::placeholder {
|
|
650
650
|
font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif); font-size: 14px; color: var(--cm-text-tertiary);
|
|
651
651
|
}
|
|
652
|
-
:host([disabled]) .pad { background: var(--cm-bg-input-filled); border-color: var(--cm-border-
|
|
652
|
+
:host([disabled]) .pad { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
653
653
|
:host([disabled]) canvas, :host([disabled]) .typed { cursor: not-allowed; }
|
|
654
654
|
:host([disabled]) .typed { color: var(--cm-text-secondary); }
|
|
655
|
-
.help { margin: 0; font-size:
|
|
656
|
-
.error { margin: 0; font-size:
|
|
655
|
+
.help { margin: 0; font-size: var(--cm-type-body-sm-size); line-height: var(--cm-type-body-sm-line-height); color: var(--cm-text-tertiary); }
|
|
656
|
+
.error { margin: 0; font-size: var(--cm-type-body-sm-size); line-height: var(--cm-type-body-sm-line-height); color: var(--cm-text-critical); }
|
|
657
|
+
@media (pointer: coarse) { .act, .tab { min-height: var(--cm-control-height-touch); } }
|
|
658
|
+
|
|
657
659
|
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
658
660
|
`,
|
|
659
661
|
];
|
|
@@ -42,13 +42,13 @@ CmSkeletonDisplay.styles = [
|
|
|
42
42
|
base,
|
|
43
43
|
css `
|
|
44
44
|
:host { display: block; }
|
|
45
|
-
.page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-
|
|
45
|
+
.page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-8); }
|
|
46
46
|
:host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
|
|
47
|
-
.nav { grid-row: span 2; border-radius:
|
|
48
|
-
.body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: var(--cm-space-
|
|
47
|
+
.nav { grid-row: span 2; border-radius: var(--cm-radius-lg); min-height: 100%; }
|
|
48
|
+
.body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: var(--cm-space-8); align-items: start; }
|
|
49
49
|
:host([layout='one-column']) .body { grid-template-columns: minmax(0, 1fr); }
|
|
50
50
|
:host([layout='one-column']) .side { display: none; }
|
|
51
|
-
.col { display: grid; gap: var(--cm-space-
|
|
51
|
+
.col { display: grid; gap: var(--cm-space-8); }
|
|
52
52
|
.bone {
|
|
53
53
|
display: block; border-radius: var(--cm-radius-md); background: var(--cm-bg-input-filled);
|
|
54
54
|
animation: pulse 1.6s ease-in-out infinite;
|
|
@@ -27,7 +27,7 @@ export declare class CmSkeleton extends LitElement {
|
|
|
27
27
|
variant: 'text' | 'thumbnail' | 'block';
|
|
28
28
|
/** Number of text lines. The last of several lines is shorter, like a real paragraph. */
|
|
29
29
|
lines: number;
|
|
30
|
-
/** Thumbnail size
|
|
30
|
+
/** Thumbnail size: `small` 34px, `medium` 40px, `large` 50px, `xlarge` 186px. */
|
|
31
31
|
size: keyof typeof THUMB;
|
|
32
32
|
static styles: import("lit").CSSResult[];
|
|
33
33
|
connectedCallback(): void;
|
|
@@ -14,7 +14,7 @@ export class CmSkeleton extends LitElement {
|
|
|
14
14
|
this.variant = 'text';
|
|
15
15
|
/** Number of text lines. The last of several lines is shorter, like a real paragraph. */
|
|
16
16
|
this.lines = 1;
|
|
17
|
-
/** Thumbnail size
|
|
17
|
+
/** Thumbnail size: `small` 34px, `medium` 40px, `large` 50px, `xlarge` 186px. */
|
|
18
18
|
this.size = 'large';
|
|
19
19
|
}
|
|
20
20
|
connectedCallback() {
|
|
@@ -46,7 +46,7 @@ CmSkeleton.styles = [
|
|
|
46
46
|
display: block; border-radius: var(--cm-radius-md); background: var(--cm-bg-input-filled);
|
|
47
47
|
animation: pulse 1.6s ease-in-out infinite;
|
|
48
48
|
}
|
|
49
|
-
.line { height: 12px; margin:
|
|
49
|
+
.line { height: 12px; margin: var(--cm-space-8) 0; border-radius: var(--cm-radius-sm); }
|
|
50
50
|
.line.short { width: 60%; }
|
|
51
51
|
.block { height: var(--cm-skeleton-height); }
|
|
52
52
|
@keyframes pulse { 50% { background: var(--cm-thumb-bg); } }
|
|
@@ -61,7 +61,7 @@ export declare class CmSmartTips extends CmLocalizedElement {
|
|
|
61
61
|
attribute: string;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
/** Title above the tips
|
|
64
|
+
/** Title above the tips. Default: the built-in string `heading` ("Smart tips"). */
|
|
65
65
|
heading: string;
|
|
66
66
|
/** Text of the dark tour banner ("Take a tour of Commmerce"). Leave empty for no banner. */
|
|
67
67
|
tourHeading: string;
|