@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
package/dist/calendar.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { html, css, nothing } from 'lit';
|
|
2
2
|
import { localeFor, formatDate } from './localize.js';
|
|
3
|
+
import { fieldStyles } from './field.js';
|
|
3
4
|
import './components/icon.js';
|
|
4
5
|
/*
|
|
5
6
|
* Shared, internal helpers for cm-date-picker and cm-date-range-picker: ISO date maths, locale-aware formatting
|
|
@@ -307,14 +308,14 @@ export function renderGrid(o) {
|
|
|
307
308
|
/** Styles for the popover and grid. Hosts render `.pop[role=dialog]` around `renderGrid`. */
|
|
308
309
|
export const calendarStyles = css `
|
|
309
310
|
.pop {
|
|
310
|
-
position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-
|
|
311
|
-
width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-
|
|
311
|
+
position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-8)); inset-inline-start: 0;
|
|
312
|
+
width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-12);
|
|
312
313
|
background: var(--cm-bg-surface); color: var(--cm-text-default);
|
|
313
|
-
border: var(--cm-border-1) solid var(--cm-border-
|
|
314
|
+
border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-md);
|
|
314
315
|
}
|
|
315
316
|
.pop[hidden] { display: none; }
|
|
316
317
|
.cal { width: 280px; max-width: 100%; }
|
|
317
|
-
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-space-
|
|
318
|
+
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--cm-space-8); margin-block-end: var(--cm-space-8); }
|
|
318
319
|
.cal-title { flex: 1; margin: 0; text-align: center; font-size: 14px; line-height: 20px; font-weight: 500; }
|
|
319
320
|
.cal-nav {
|
|
320
321
|
display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--cm-radius-sm);
|
|
@@ -352,38 +353,33 @@ export function trapTab(e, pop) {
|
|
|
352
353
|
}
|
|
353
354
|
/** Shared field and popover styles of the two date pickers. */
|
|
354
355
|
export const dateFieldStyles = css `
|
|
356
|
+
${fieldStyles}
|
|
355
357
|
:host { display: block; position: relative; }
|
|
356
|
-
.field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
|
|
357
|
-
.label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
|
|
358
|
-
.req { color: var(--cm-text-critical); margin-inline-start: 2px; }
|
|
359
358
|
.wrap { position: relative; }
|
|
360
359
|
.box {
|
|
361
|
-
display: flex; align-items: center; gap:
|
|
360
|
+
display: flex; align-items: center; gap: var(--cm-space-4); width: 100%; height: var(--_cm-field-h); padding-block: 0; padding-inline: var(--_cm-field-pad) var(--cm-space-4);
|
|
362
361
|
background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-input); border-radius: var(--cm-radius-sm);
|
|
363
362
|
}
|
|
364
363
|
.box:focus-within { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
|
|
365
364
|
input {
|
|
366
365
|
flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none;
|
|
367
|
-
font: inherit; font-size:
|
|
366
|
+
font: inherit; font-size: var(--_cm-field-font); color: var(--cm-text-default);
|
|
368
367
|
}
|
|
369
368
|
input::placeholder { color: var(--cm-text-tertiary); }
|
|
370
369
|
.trigger {
|
|
371
|
-
flex: none; display: grid; place-items: center; width:
|
|
372
|
-
border-radius: var(--cm-radius-
|
|
370
|
+
flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0;
|
|
371
|
+
border-radius: var(--cm-radius-xs); background: none; color: var(--cm-icon-selected); cursor: pointer;
|
|
373
372
|
}
|
|
373
|
+
:host([size='small']) .trigger { width: 24px; height: 24px; }
|
|
374
|
+
@media (pointer: coarse) { .trigger, :host([size='small']) .trigger { width: 36px; height: 36px; } }
|
|
374
375
|
.trigger:hover { background: var(--cm-bg-hover); }
|
|
375
376
|
.trigger:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
|
|
376
377
|
:host([error]:not([error=''])) .box { border-color: var(--cm-border-critical); }
|
|
377
|
-
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-
|
|
378
|
+
:host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
|
|
378
379
|
:host([disabled]) input, :host([disabled]) .trigger { color: var(--cm-text-secondary); cursor: not-allowed; }
|
|
379
380
|
:host([disabled]) .trigger:hover { background: none; }
|
|
380
|
-
.help, .error { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
|
|
381
|
-
.error { color: var(--cm-text-critical); }
|
|
382
|
-
:host([size='small']) .field { gap: 6px; }
|
|
383
|
-
:host([size='small']) .label { font-size: 12px; }
|
|
384
|
-
:host([size='small']) input { font-size: 14px; }
|
|
385
381
|
/* cm-date-picker with \`time\`: the date box and a time box side by side, wrapping onto two rows when narrow. */
|
|
386
|
-
.wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-
|
|
382
|
+
.wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); }
|
|
387
383
|
.wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
|
|
388
|
-
.wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--
|
|
384
|
+
.wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--_cm-field-pad); }
|
|
389
385
|
`;
|