@commmerce/ui 1.18.0 → 1.20.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/cdn.js +15 -3
- package/dist/components/account-menu.js +1 -1
- package/dist/components/bottom-navigation.js +5 -2
- package/dist/components/button.d.ts +5 -2
- package/dist/components/button.js +8 -1
- package/dist/components/mobile-menu.js +5 -0
- package/dist/custom-elements.json +4 -4
- package/package.json +3 -3
package/dist/cdn.js
CHANGED
|
@@ -42,6 +42,10 @@ var hb=o=>{throw TypeError(o)};var su=(o,n,e)=>n.has(o)||hb("Cannot "+e);var r=(
|
|
|
42
42
|
background: var(--cm-bg-surface); color: var(--cm-text-default); border-color: var(--cm-border-input);
|
|
43
43
|
}
|
|
44
44
|
:host(:not([variant='primary']):not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-hover); }
|
|
45
|
+
/* Tertiary (1.19): transparent until hovered; the label or icon carries it. */
|
|
46
|
+
:host([variant='tertiary']:not([disabled]):not([loading])) .btn { background: transparent; border-color: transparent; }
|
|
47
|
+
:host([variant='tertiary']:not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-hover); }
|
|
48
|
+
:host([variant='tertiary'][disabled]) .btn { background: transparent; border-color: transparent; }
|
|
45
49
|
:host([disabled]) .btn, :host([loading]) .btn {
|
|
46
50
|
background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed;
|
|
47
51
|
}
|
|
@@ -3591,9 +3595,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
|
|
|
3591
3595
|
color: var(--cm-text-tertiary); text-decoration: none; background: none; border: 0; border-radius: var(--cm-radius-sm); cursor: pointer;
|
|
3592
3596
|
}
|
|
3593
3597
|
.item:hover, .item[aria-current='page'] { color: var(--cm-text-default); }
|
|
3594
|
-
|
|
3598
|
+
/* The current tab (1.19, from the CRM): bold label and a tinted pill behind the icon, so it shows in every look. */
|
|
3599
|
+
.item[aria-current='page'] { font-weight: 600; }
|
|
3600
|
+
.item[aria-current='page']:not(.primary) .icon { background: var(--cm-bg-selected); color: var(--cm-icon-selected); }
|
|
3595
3601
|
.item:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
3596
|
-
.icon { display: grid; place-items: center; width: var(--cm-
|
|
3602
|
+
.icon { display: grid; place-items: center; width: calc(var(--cm-space-48) + var(--cm-space-8)); height: calc(var(--cm-space-24) + var(--cm-space-4)); border-radius: var(--cm-radius-full); }
|
|
3603
|
+
.primary .icon { width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
|
|
3597
3604
|
.primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
|
|
3598
3605
|
.label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3599
3606
|
`];$("cm-bottom-navigation",_o);var AT=z("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),Ld,qs,Qe,Jf,dw,Qf,Zf,hw,To=class extends C{constructor(){super(...arguments);m(this,Qe);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;m(this,Ld);m(this,qs,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,Qe,Jf).call(this),g(this,Ld,vr(this,()=>a(this,Qe,Jf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Ld)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,qs)}-sub"
|
|
@@ -3637,6 +3644,11 @@ ${t.label}</button>
|
|
|
3637
3644
|
}
|
|
3638
3645
|
.row:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; border-radius: var(--cm-radius-sm); }
|
|
3639
3646
|
.row .icon { color: var(--cm-icon-responsive-menu); }
|
|
3647
|
+
/* The current page (1.19, from the CRM): a tinted, bold row that reaches the card's edges less a small inset. */
|
|
3648
|
+
.card .row[aria-current='page'] {
|
|
3649
|
+
width: calc(100% + 2 * var(--cm-space-12)); margin-inline: calc(-1 * var(--cm-space-12)); padding-inline: calc(var(--cm-space-4) + var(--cm-space-12));
|
|
3650
|
+
background: var(--cm-bg-selected); border-radius: var(--cm-radius-sm); font-weight: 600;
|
|
3651
|
+
}
|
|
3640
3652
|
/* Label and badge share a wrapping line (1.13): when both don't fit, the badge moves under the label instead of
|
|
3641
3653
|
squeezing it, and the label breaks between words, never inside one (unless a single word is wider than the row). */
|
|
3642
3654
|
.text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-4) var(--cm-space-8); }
|
|
@@ -3813,7 +3825,7 @@ ${t.label}</button>
|
|
|
3813
3825
|
/* The avatar button: 36px round with a ring (40 and a 44px hit area on touch screens). */
|
|
3814
3826
|
.trigger.account {
|
|
3815
3827
|
position: relative; width: var(--cm-control-height-md, 36px); height: var(--cm-control-height-md, 36px); min-height: 0; padding: 2px;
|
|
3816
|
-
border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-full); background: var(--cm-bg-surface);
|
|
3828
|
+
border: var(--cm-border-1) solid var(--cm-account-ring, var(--cm-border-strong)); border-radius: var(--cm-radius-full); background: var(--cm-bg-surface);
|
|
3817
3829
|
}
|
|
3818
3830
|
.trigger.account:hover { background: var(--cm-bg-hover); }
|
|
3819
3831
|
.trigger.account cm-avatar { --cm-avatar-size: 28px; } /* 36 less the 2px gap and 1px ring on each side */
|
|
@@ -80,7 +80,7 @@ CmAccountMenu.styles = [
|
|
|
80
80
|
/* The avatar button: 36px round with a ring (40 and a 44px hit area on touch screens). */
|
|
81
81
|
.trigger.account {
|
|
82
82
|
position: relative; width: var(--cm-control-height-md, 36px); height: var(--cm-control-height-md, 36px); min-height: 0; padding: 2px;
|
|
83
|
-
border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-full); background: var(--cm-bg-surface);
|
|
83
|
+
border: var(--cm-border-1) solid var(--cm-account-ring, var(--cm-border-strong)); border-radius: var(--cm-radius-full); background: var(--cm-bg-surface);
|
|
84
84
|
}
|
|
85
85
|
.trigger.account:hover { background: var(--cm-bg-hover); }
|
|
86
86
|
.trigger.account cm-avatar { --cm-avatar-size: 28px; } /* 36 less the 2px gap and 1px ring on each side */
|
|
@@ -93,9 +93,12 @@ CmBottomNavigation.styles = [
|
|
|
93
93
|
color: var(--cm-text-tertiary); text-decoration: none; background: none; border: 0; border-radius: var(--cm-radius-sm); cursor: pointer;
|
|
94
94
|
}
|
|
95
95
|
.item:hover, .item[aria-current='page'] { color: var(--cm-text-default); }
|
|
96
|
-
|
|
96
|
+
/* The current tab (1.19, from the CRM): bold label and a tinted pill behind the icon, so it shows in every look. */
|
|
97
|
+
.item[aria-current='page'] { font-weight: 600; }
|
|
98
|
+
.item[aria-current='page']:not(.primary) .icon { background: var(--cm-bg-selected); color: var(--cm-icon-selected); }
|
|
97
99
|
.item:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
98
|
-
.icon { display: grid; place-items: center; width: var(--cm-
|
|
100
|
+
.icon { display: grid; place-items: center; width: calc(var(--cm-space-48) + var(--cm-space-8)); height: calc(var(--cm-space-24) + var(--cm-space-4)); border-radius: var(--cm-radius-full); }
|
|
101
|
+
.primary .icon { width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
|
|
99
102
|
.primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
|
|
100
103
|
.label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
101
104
|
`,
|
|
@@ -59,8 +59,11 @@ export declare class CmButton extends CmLocalizedElement {
|
|
|
59
59
|
reflect: boolean;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
/**
|
|
63
|
-
|
|
62
|
+
/**
|
|
63
|
+
* `primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);
|
|
64
|
+
* `tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading.
|
|
65
|
+
*/
|
|
66
|
+
variant: 'primary' | 'secondary' | 'tertiary';
|
|
64
67
|
/**
|
|
65
68
|
* `large` 40px (save bars, page actions), `medium` 36px (default), `slim` 32px (toolbars, table rows). Text is 14px (13px on slim).
|
|
66
69
|
* On touch screens (`pointer: coarse`) every size is drawn at least 40px tall (icon-only: 40 x 40) and its hit area reaches
|
|
@@ -38,7 +38,10 @@ const strings = defineStrings('button', {
|
|
|
38
38
|
export class CmButton extends CmLocalizedElement {
|
|
39
39
|
constructor() {
|
|
40
40
|
super();
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* `primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);
|
|
43
|
+
* `tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading.
|
|
44
|
+
*/
|
|
42
45
|
this.variant = 'secondary';
|
|
43
46
|
/**
|
|
44
47
|
* `large` 40px (save bars, page actions), `medium` 36px (default), `slim` 32px (toolbars, table rows). Text is 14px (13px on slim).
|
|
@@ -144,6 +147,10 @@ CmButton.styles = [
|
|
|
144
147
|
background: var(--cm-bg-surface); color: var(--cm-text-default); border-color: var(--cm-border-input);
|
|
145
148
|
}
|
|
146
149
|
:host(:not([variant='primary']):not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-hover); }
|
|
150
|
+
/* Tertiary (1.19): transparent until hovered; the label or icon carries it. */
|
|
151
|
+
:host([variant='tertiary']:not([disabled]):not([loading])) .btn { background: transparent; border-color: transparent; }
|
|
152
|
+
:host([variant='tertiary']:not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-hover); }
|
|
153
|
+
:host([variant='tertiary'][disabled]) .btn { background: transparent; border-color: transparent; }
|
|
147
154
|
:host([disabled]) .btn, :host([loading]) .btn {
|
|
148
155
|
background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed;
|
|
149
156
|
}
|
|
@@ -165,6 +165,11 @@ CmMobileMenu.styles = [
|
|
|
165
165
|
}
|
|
166
166
|
.row:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; border-radius: var(--cm-radius-sm); }
|
|
167
167
|
.row .icon { color: var(--cm-icon-responsive-menu); }
|
|
168
|
+
/* The current page (1.19, from the CRM): a tinted, bold row that reaches the card's edges less a small inset. */
|
|
169
|
+
.card .row[aria-current='page'] {
|
|
170
|
+
width: calc(100% + 2 * var(--cm-space-12)); margin-inline: calc(-1 * var(--cm-space-12)); padding-inline: calc(var(--cm-space-4) + var(--cm-space-12));
|
|
171
|
+
background: var(--cm-bg-selected); border-radius: var(--cm-radius-sm); font-weight: 600;
|
|
172
|
+
}
|
|
168
173
|
/* Label and badge share a wrapping line (1.13): when both don't fit, the badge moves under the label instead of
|
|
169
174
|
squeezing it, and the label breaks between words, never inside one (unless a single word is wider than the row). */
|
|
170
175
|
.text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-4) var(--cm-space-8); }
|
|
@@ -6286,10 +6286,10 @@
|
|
|
6286
6286
|
"name": "variant",
|
|
6287
6287
|
"privacy": "public",
|
|
6288
6288
|
"type": {
|
|
6289
|
-
"text": "'primary' | 'secondary'"
|
|
6289
|
+
"text": "'primary' | 'secondary' | 'tertiary'"
|
|
6290
6290
|
},
|
|
6291
6291
|
"default": "'secondary'",
|
|
6292
|
-
"description": "`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline).",
|
|
6292
|
+
"description": "`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);\n`tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading.",
|
|
6293
6293
|
"attribute": "variant",
|
|
6294
6294
|
"reflects": true
|
|
6295
6295
|
},
|
|
@@ -6542,10 +6542,10 @@
|
|
|
6542
6542
|
{
|
|
6543
6543
|
"name": "variant",
|
|
6544
6544
|
"type": {
|
|
6545
|
-
"text": "'primary' | 'secondary'"
|
|
6545
|
+
"text": "'primary' | 'secondary' | 'tertiary'"
|
|
6546
6546
|
},
|
|
6547
6547
|
"default": "'secondary'",
|
|
6548
|
-
"description": "`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline).",
|
|
6548
|
+
"description": "`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);\n`tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading.",
|
|
6549
6549
|
"fieldName": "variant"
|
|
6550
6550
|
},
|
|
6551
6551
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
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",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"test": "vitest run"
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@commmerce/icons": "1.
|
|
132
|
-
"@commmerce/tokens": "1.
|
|
131
|
+
"@commmerce/icons": "1.20.0",
|
|
132
|
+
"@commmerce/tokens": "1.20.0",
|
|
133
133
|
"lit": "3.2.1"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|