@vonage/vivid 3.51.0 → 3.53.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/README.md +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +4 -3
- package/audio-player/index.js +4 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -8
- package/combobox/index.js +5 -8
- package/custom-elements.json +2310 -769
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -9
- package/date-picker/index.js +7 -9
- package/date-range-picker/index.cjs +7 -9
- package/date-range-picker/index.js +7 -9
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -5
- package/file-picker/index.js +4 -5
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +135 -123
- package/index.js +48 -46
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +3 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +25 -24
- package/listbox/index.js +25 -24
- package/locales/en-GB.cjs +34 -0
- package/locales/en-GB.js +34 -0
- package/locales/en-US.cjs +202 -0
- package/locales/en-US.js +202 -0
- package/locales/ja-JP.cjs +202 -1
- package/locales/ja-JP.js +202 -1
- package/locales/zh-CN.cjs +203 -0
- package/locales/zh-CN.js +203 -0
- package/menu/index.cjs +7 -7
- package/menu/index.js +7 -7
- package/menu-item/index.cjs +4 -4
- package/menu-item/index.js +4 -4
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -6
- package/number-field/index.js +5 -6
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +34 -34
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +9 -4
- package/shared/definition.js +9 -4
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +77 -49
- package/shared/definition11.js +78 -50
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +34 -33
- package/shared/definition14.js +34 -33
- package/shared/definition15.cjs +24 -12
- package/shared/definition15.js +24 -12
- package/shared/definition16.cjs +38 -43
- package/shared/definition16.js +38 -43
- package/shared/definition17.cjs +126 -66
- package/shared/definition17.js +127 -67
- package/shared/definition18.cjs +31 -15
- package/shared/definition18.js +31 -15
- package/shared/definition19.cjs +117 -81
- package/shared/definition19.js +117 -81
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +187 -227
- package/shared/definition20.js +183 -223
- package/shared/definition21.cjs +262 -69
- package/shared/definition21.js +261 -67
- package/shared/definition22.cjs +66 -61
- package/shared/definition22.js +64 -60
- package/shared/definition23.cjs +42 -77
- package/shared/definition23.js +41 -76
- package/shared/definition24.cjs +65 -2350
- package/shared/definition24.js +64 -2349
- package/shared/definition25.cjs +2402 -48
- package/shared/definition25.js +2401 -47
- package/shared/definition26.cjs +62 -28
- package/shared/definition26.js +61 -27
- package/shared/definition27.cjs +28 -54
- package/shared/definition27.js +27 -53
- package/shared/definition28.cjs +39 -819
- package/shared/definition28.js +38 -817
- package/shared/definition29.cjs +893 -54
- package/shared/definition29.js +893 -55
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +69 -85
- package/shared/definition30.js +68 -84
- package/shared/definition31.cjs +86 -23
- package/shared/definition31.js +86 -23
- package/shared/definition32.cjs +24 -14
- package/shared/definition32.js +23 -13
- package/shared/definition33.cjs +11 -53
- package/shared/definition33.js +10 -52
- package/shared/definition34.cjs +28 -500
- package/shared/definition34.js +28 -500
- package/shared/definition35.cjs +447 -194
- package/shared/definition35.js +447 -192
- package/shared/definition36.cjs +258 -188
- package/shared/definition36.js +255 -187
- package/shared/definition37.cjs +204 -78
- package/shared/definition37.js +203 -76
- package/shared/definition38.cjs +55 -51
- package/shared/definition38.js +52 -49
- package/shared/definition39.cjs +65 -423
- package/shared/definition39.js +64 -422
- package/shared/definition4.cjs +24 -12
- package/shared/definition4.js +24 -12
- package/shared/definition40.cjs +447 -35
- package/shared/definition40.js +444 -32
- package/shared/definition41.cjs +35 -678
- package/shared/definition41.js +34 -677
- package/shared/definition42.cjs +544 -99
- package/shared/definition42.js +543 -98
- package/shared/definition43.cjs +696 -77
- package/shared/definition43.js +695 -76
- package/shared/definition44.cjs +113 -563
- package/shared/definition44.js +112 -561
- package/shared/definition45.cjs +77 -117
- package/shared/definition45.js +75 -115
- package/shared/definition46.cjs +474 -86
- package/shared/definition46.js +474 -87
- package/shared/definition47.cjs +140 -23
- package/shared/definition47.js +139 -22
- package/shared/definition48.cjs +132 -57
- package/shared/definition48.js +131 -56
- package/shared/definition49.cjs +18 -524
- package/shared/definition49.js +17 -523
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +73 -25
- package/shared/definition50.js +72 -24
- package/shared/definition51.cjs +506 -99
- package/shared/definition51.js +505 -99
- package/shared/definition52.cjs +29 -277
- package/shared/definition52.js +28 -276
- package/shared/definition53.cjs +97 -256
- package/shared/definition53.js +97 -255
- package/shared/definition54.cjs +287 -769
- package/shared/definition54.js +287 -769
- package/shared/definition55.cjs +305 -105
- package/shared/definition55.js +304 -104
- package/shared/definition56.cjs +841 -81
- package/shared/definition56.js +840 -80
- package/shared/definition57.cjs +153 -69
- package/shared/definition57.js +152 -68
- package/shared/definition58.cjs +138 -299
- package/shared/definition58.js +137 -298
- package/shared/definition59.cjs +72 -27
- package/shared/definition59.js +71 -26
- package/shared/definition6.cjs +4 -5
- package/shared/definition6.js +4 -5
- package/shared/definition60.cjs +279 -1780
- package/shared/definition60.js +278 -1779
- package/shared/definition61.cjs +65870 -11
- package/shared/definition61.js +65869 -11
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +8 -6
- package/shared/definition7.js +8 -6
- package/shared/definition8.cjs +27 -20
- package/shared/definition8.js +27 -20
- package/shared/definition9.cjs +7 -10
- package/shared/definition9.js +7 -10
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +67 -38
- package/shared/index2.js +67 -38
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +6 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +140 -81
- package/shared/presentationDate.js +140 -81
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +33 -33
- package/shared/text-anchor.template.js +33 -33
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -6
- package/text-field/index.js +4 -6
- package/time-picker/index.cjs +8 -10
- package/time-picker/index.js +8 -10
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +428 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition13.js
CHANGED
|
@@ -505,7 +505,7 @@ _curry1(function isEmpty(x) {
|
|
|
505
505
|
|
|
506
506
|
const isEmpty$1 = isEmpty;
|
|
507
507
|
|
|
508
|
-
const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;background:var(--vvd-color-surface-2dp);
|
|
508
|
+
const styles = "ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:\". column-headers\" \"row-headers calendar\";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;border-radius:8px;background:var(--vvd-color-surface-2dp);counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:\"\";inset:0}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:\"\";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content;inset-inline-start:0}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}\n";
|
|
509
509
|
|
|
510
510
|
const ARROW_UP = "ArrowUp";
|
|
511
511
|
const ARROW_RIGHT = "ArrowRight";
|
|
@@ -538,9 +538,13 @@ function getHeaderDescendantGridCell(key, activeElement) {
|
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
540
|
const header = activeElement.closest('[role="columnheader"i]');
|
|
541
|
-
const columnHeaders = this.shadowRoot.querySelectorAll(
|
|
541
|
+
const columnHeaders = this.shadowRoot.querySelectorAll(
|
|
542
|
+
'[role="columnheader"i]'
|
|
543
|
+
);
|
|
542
544
|
const i = Array.from(columnHeaders).indexOf(header);
|
|
543
|
-
return this.shadowRoot.querySelector(
|
|
545
|
+
return this.shadowRoot.querySelector(
|
|
546
|
+
`[role="gridcell"i]:nth-child(${i + 1})`
|
|
547
|
+
);
|
|
544
548
|
}
|
|
545
549
|
|
|
546
550
|
function getDay(el) {
|
|
@@ -553,7 +557,9 @@ function getDay(el) {
|
|
|
553
557
|
}
|
|
554
558
|
}
|
|
555
559
|
function getHour(e, el, hours) {
|
|
556
|
-
const rowHeaderOrCell = el.closest(
|
|
560
|
+
const rowHeaderOrCell = el.closest(
|
|
561
|
+
'[role="rowheader"], [role="gridcell"i]'
|
|
562
|
+
);
|
|
557
563
|
if (rowHeaderOrCell) {
|
|
558
564
|
const DOMRect = rowHeaderOrCell.getBoundingClientRect();
|
|
559
565
|
const offsetY = e.clientY - DOMRect.y;
|
|
@@ -564,11 +570,15 @@ function getHour(e, el, hours) {
|
|
|
564
570
|
}
|
|
565
571
|
const getEventContext = function(e) {
|
|
566
572
|
if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
|
|
567
|
-
throw new Error(
|
|
573
|
+
throw new Error(
|
|
574
|
+
"Invalid event. Event must be instance of KeyboardEvent or MouseEvent"
|
|
575
|
+
);
|
|
568
576
|
}
|
|
569
577
|
const [el] = e.composedPath();
|
|
570
578
|
if (!(el && el instanceof HTMLElement && this.shadowRoot.contains(el))) {
|
|
571
|
-
throw new Error(
|
|
579
|
+
throw new Error(
|
|
580
|
+
"Invalid event. Event must contain a target object which is a direct descendant of calendar"
|
|
581
|
+
);
|
|
572
582
|
}
|
|
573
583
|
const day = getDay(el);
|
|
574
584
|
let hour;
|
|
@@ -636,7 +646,9 @@ class Calendar extends FoundationElement {
|
|
|
636
646
|
}
|
|
637
647
|
getCalendarEventContainingCell(calendarEvent) {
|
|
638
648
|
const slotName = calendarEvent.getAttribute("slot");
|
|
639
|
-
const gridCell = this.shadowRoot.querySelector(
|
|
649
|
+
const gridCell = this.shadowRoot.querySelector(
|
|
650
|
+
`slot[name="${slotName}"i]`
|
|
651
|
+
);
|
|
640
652
|
return gridCell.parentElement;
|
|
641
653
|
}
|
|
642
654
|
arrowKeysInteractions(key) {
|
|
@@ -645,11 +657,19 @@ class Calendar extends FoundationElement {
|
|
|
645
657
|
if (isCellOrHeader(activeElement)) {
|
|
646
658
|
focusNext = getNextFocusableGridElement.call(this, key, activeElement);
|
|
647
659
|
} else if (this.#activeCalendarEvent) {
|
|
648
|
-
focusNext = this.getCalendarEventContainingCell(
|
|
660
|
+
focusNext = this.getCalendarEventContainingCell(
|
|
661
|
+
this.#activeCalendarEvent
|
|
662
|
+
);
|
|
649
663
|
} else if (activeElement?.matches('em[role="button"i]')) {
|
|
650
|
-
focusNext = getHeaderDescendantGridCell.call(
|
|
664
|
+
focusNext = getHeaderDescendantGridCell.call(
|
|
665
|
+
this,
|
|
666
|
+
key,
|
|
667
|
+
activeElement
|
|
668
|
+
);
|
|
651
669
|
} else {
|
|
652
|
-
focusNext = this.shadowRoot.querySelector(
|
|
670
|
+
focusNext = this.shadowRoot.querySelector(
|
|
671
|
+
'[role="columnheader"i]'
|
|
672
|
+
);
|
|
653
673
|
}
|
|
654
674
|
this.activateElement(focusNext);
|
|
655
675
|
}
|
|
@@ -660,7 +680,9 @@ class Calendar extends FoundationElement {
|
|
|
660
680
|
el?.focus();
|
|
661
681
|
}
|
|
662
682
|
onKeydown({ key }) {
|
|
663
|
-
const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(
|
|
683
|
+
const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(
|
|
684
|
+
(predefinedKey) => predefinedKey == key
|
|
685
|
+
);
|
|
664
686
|
if (isArrow) {
|
|
665
687
|
this.arrowKeysInteractions(key);
|
|
666
688
|
}
|
|
@@ -682,7 +704,9 @@ __decorateClass([
|
|
|
682
704
|
|
|
683
705
|
function getValidDateString(date) {
|
|
684
706
|
const twoDigit = (num) => `0${num}`.slice(-2);
|
|
685
|
-
return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(
|
|
707
|
+
return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(
|
|
708
|
+
date.getDate()
|
|
709
|
+
)}`;
|
|
686
710
|
}
|
|
687
711
|
const weekdaysMap = /* @__PURE__ */ new Map([
|
|
688
712
|
["sunday", 0],
|
|
@@ -697,78 +721,97 @@ function getFirstDateOfTheWeek(date = /* @__PURE__ */ new Date(), startDay) {
|
|
|
697
721
|
}
|
|
698
722
|
|
|
699
723
|
const HoursTemplate = () => {
|
|
700
|
-
return html`
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
724
|
+
return html` <div class="row-headers" role="row">
|
|
725
|
+
${repeat(
|
|
726
|
+
(x) => x.hoursAsDatetime,
|
|
727
|
+
html`<span role="rowheader">
|
|
728
|
+
<time
|
|
729
|
+
datetime="${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
|
|
730
|
+
hour: "numeric",
|
|
731
|
+
minute: "numeric",
|
|
732
|
+
hour12: false
|
|
733
|
+
}).format(x)}"
|
|
734
|
+
>
|
|
735
|
+
${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
|
|
736
|
+
hour: "numeric",
|
|
737
|
+
hour12: c.parent.hour12
|
|
738
|
+
}).format(x)}
|
|
739
|
+
</time>
|
|
740
|
+
</span>`
|
|
741
|
+
)}
|
|
742
|
+
</div>`;
|
|
715
743
|
};
|
|
716
744
|
const DaysTemplate = () => {
|
|
717
|
-
return html`
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
745
|
+
return html` <div class="column-headers" role="row">
|
|
746
|
+
${repeat(
|
|
747
|
+
(x) => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]),
|
|
748
|
+
html` <div role="columnheader" tabindex="-1">
|
|
749
|
+
<time datetime=${(x) => getValidDateString(x)}>
|
|
750
|
+
<h2>
|
|
751
|
+
<!-- TODO add to column aria-labelledby or describedby to count
|
|
724
752
|
events and related day e.g. "3 events, Sunday, March 8" -->
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
</
|
|
738
|
-
|
|
753
|
+
<em
|
|
754
|
+
tabindex="0"
|
|
755
|
+
role="button"
|
|
756
|
+
aria-label=${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
|
|
757
|
+
weekday: "long",
|
|
758
|
+
month: "long",
|
|
759
|
+
day: "2-digit"
|
|
760
|
+
}).format(x)}
|
|
761
|
+
>
|
|
762
|
+
${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
|
|
763
|
+
day: "2-digit"
|
|
764
|
+
}).format(x)}
|
|
765
|
+
</em>
|
|
766
|
+
<small aria-hidden="true">
|
|
767
|
+
${(x, c) => new Intl.DateTimeFormat(c.parent.locales, {
|
|
768
|
+
weekday: "short"
|
|
769
|
+
}).format(x)}
|
|
770
|
+
</small>
|
|
771
|
+
</h2>
|
|
772
|
+
</time>
|
|
773
|
+
</div>`
|
|
774
|
+
)}
|
|
775
|
+
</div>`;
|
|
739
776
|
};
|
|
740
777
|
const ColumnTemplate = html`
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
778
|
+
<div role="gridcell" tabindex="-1">
|
|
779
|
+
<slot name="day-${(_, c) => c.index}"></slot>
|
|
780
|
+
</div>
|
|
781
|
+
`;
|
|
745
782
|
const CalendarTemplate = () => html`
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
783
|
+
<div role="grid" @keydown=${(x, c) => x.onKeydown(c.event)}>
|
|
784
|
+
${DaysTemplate}
|
|
785
|
+
<div class="calendar-row" role="rowgroup">
|
|
786
|
+
${HoursTemplate}
|
|
787
|
+
<div class="calendar-grid-presentation" role="presentation">
|
|
788
|
+
<div class="hours" role="list">
|
|
789
|
+
${repeat(
|
|
790
|
+
(x) => Array.from({ length: x.hoursAsDatetime.length + 1 }),
|
|
791
|
+
html` <div role="listitem"></div>`
|
|
792
|
+
)}
|
|
793
|
+
</div>
|
|
794
|
+
<div class="columns" role="row">
|
|
795
|
+
${repeat((x) => Array.from(Array(x._days)), ColumnTemplate, {
|
|
796
|
+
positioning: true
|
|
797
|
+
})}
|
|
798
|
+
</div>
|
|
799
|
+
<slot></slot>
|
|
800
|
+
</div>
|
|
801
|
+
</div>
|
|
802
|
+
</div>
|
|
762
803
|
`;
|
|
763
804
|
|
|
764
|
-
const calendarDefinition = Calendar.compose(
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
805
|
+
const calendarDefinition = Calendar.compose(
|
|
806
|
+
{
|
|
807
|
+
baseName: "calendar",
|
|
808
|
+
template: CalendarTemplate,
|
|
809
|
+
styles,
|
|
810
|
+
shadowOptions: {
|
|
811
|
+
delegatesFocus: true
|
|
812
|
+
}
|
|
770
813
|
}
|
|
771
|
-
|
|
814
|
+
);
|
|
772
815
|
const calendarRegistries = [calendarDefinition()];
|
|
773
816
|
const registerCalendar = registerFactory(calendarRegistries);
|
|
774
817
|
|
package/shared/definition14.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition$1 = require('./
|
|
5
|
-
const definition = require('./
|
|
4
|
+
const definition$1 = require('./definition27.cjs');
|
|
5
|
+
const definition = require('./definition62.cjs');
|
|
6
6
|
const enums = require('./enums.cjs');
|
|
7
7
|
const icon = require('./icon.cjs');
|
|
8
8
|
const when = require('./when.cjs');
|
|
9
9
|
const slotted = require('./slotted.cjs');
|
|
10
10
|
const classNames = require('./class-names.cjs');
|
|
11
11
|
|
|
12
|
-
const styles = ":host{display:flex}.base{border-radius:8px;inline-size:100%;text-align:start}.wrapper{display:flex;overflow:hidden;flex-flow:column;block-size:100%;
|
|
12
|
+
const styles = ":host{display:flex}.base{border-radius:8px;inline-size:100%;text-align:start}.wrapper{display:flex;overflow:hidden;flex-flow:column;border-radius:inherit;block-size:100%;color:var(--vvd-color-canvas-text)}.main-content{display:flex;flex-flow:column;padding:24px}.header{display:flex;flex:1;align-items:flex-start;gap:8px}.header-content{flex:1}.header-wrapper{display:flex;gap:8px}.header-headline,.header-subtitle{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}.header-headline{font:var(--vvd-typography-heading-4);-webkit-line-clamp:var(--headline-line-clamp)}.header-subtitle{font:var(--vvd-typography-base);-webkit-line-clamp:var(--subtitle-line-clamp)}.hide-header .header{display:none}.header-subtitle,.text{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base)}.text{padding-right:8px;margin-top:12px}.footer{display:inline-flex;flex-direction:column;align-items:flex-end;padding-bottom:24px;margin-top:auto;padding-inline:24px}.hide-footer .footer{display:none}::slotted([slot=graphic i]),.icon{flex-shrink:0;align-self:baseline;margin-block-start:4px}.icon{font-size:20px}::slotted([slot=meta i]){flex-shrink:0;align-self:flex-start;margin-block-start:-8px;margin-inline:auto -8px}\n";
|
|
13
13
|
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
15
15
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -62,14 +62,10 @@ function renderHeaderIcon(iconTag) {
|
|
|
62
62
|
<${iconTag} class="icon" inline name="${(x) => x.icon}"></${iconTag}>`;
|
|
63
63
|
}
|
|
64
64
|
function Headline() {
|
|
65
|
-
return index.html`
|
|
66
|
-
<div class="header-headline">${(x) => x.headline}</div>
|
|
67
|
-
`;
|
|
65
|
+
return index.html` <div class="header-headline">${(x) => x.headline}</div> `;
|
|
68
66
|
}
|
|
69
67
|
function Subtitle() {
|
|
70
|
-
return index.html`
|
|
71
|
-
<div class="header-subtitle">${(x) => x.subtitle}</div>
|
|
72
|
-
`;
|
|
68
|
+
return index.html` <div class="header-subtitle">${(x) => x.subtitle}</div> `;
|
|
73
69
|
}
|
|
74
70
|
function headerContent() {
|
|
75
71
|
return index.html`
|
|
@@ -80,29 +76,26 @@ function headerContent() {
|
|
|
80
76
|
`;
|
|
81
77
|
}
|
|
82
78
|
function renderHeader(iconTag) {
|
|
83
|
-
return index.html`
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
return index.html` <header class="header">
|
|
80
|
+
<slot name="graphic" ${slotted.slotted("graphicSlottedContent")}
|
|
81
|
+
>${when.when((x) => x.icon, renderHeaderIcon(iconTag))}</slot
|
|
82
|
+
>
|
|
83
|
+
${when.when((x) => x.headline || x.subtitle, headerContent())}
|
|
84
|
+
</header>`;
|
|
88
85
|
}
|
|
89
86
|
function shouldHideHeader(card) {
|
|
90
87
|
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
91
88
|
}
|
|
92
89
|
function renderMetaSlot() {
|
|
93
|
-
return index.html`
|
|
94
|
-
<slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot>
|
|
95
|
-
`;
|
|
90
|
+
return index.html` <slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot> `;
|
|
96
91
|
}
|
|
97
92
|
function text() {
|
|
98
|
-
return index.html`
|
|
99
|
-
<div class="text">${(x) => x.text}</div>
|
|
100
|
-
`;
|
|
93
|
+
return index.html` <div class="text">${(x) => x.text}</div> `;
|
|
101
94
|
}
|
|
102
95
|
function renderCardContent(context) {
|
|
103
96
|
const iconTag = context.tagFor(icon.Icon);
|
|
104
97
|
return index.html`
|
|
105
|
-
|
|
98
|
+
<div class="${getClasses}">
|
|
106
99
|
<div class="wrapper">
|
|
107
100
|
<div class="vwc-card-media">
|
|
108
101
|
<slot name="media"></slot>
|
|
@@ -110,8 +103,7 @@ function renderCardContent(context) {
|
|
|
110
103
|
<slot name="main">
|
|
111
104
|
<div class="main-content">
|
|
112
105
|
<div class="header-wrapper">
|
|
113
|
-
${renderHeader(iconTag)}
|
|
114
|
-
${renderMetaSlot()}
|
|
106
|
+
${renderHeader(iconTag)} ${renderMetaSlot()}
|
|
115
107
|
</div>
|
|
116
108
|
${when.when((x) => x.text, text())}
|
|
117
109
|
</div>
|
|
@@ -126,21 +118,26 @@ function renderCardContent(context) {
|
|
|
126
118
|
const CardTemplate = (context) => {
|
|
127
119
|
const elevationTag = context.tagFor(definition.Elevation);
|
|
128
120
|
return index.html`
|
|
129
|
-
${when.when(
|
|
121
|
+
${when.when(
|
|
122
|
+
(x) => x.appearance !== enums.Appearance.Ghost && x.appearance !== enums.Appearance.Outlined,
|
|
123
|
+
index.html`
|
|
130
124
|
<${elevationTag} dp=${(x) => x.elevation ?? "4"}>
|
|
131
125
|
${renderCardContent(context)}
|
|
132
126
|
</${elevationTag}>
|
|
133
|
-
`
|
|
134
|
-
|
|
135
|
-
${when.when(
|
|
127
|
+
`
|
|
128
|
+
)}
|
|
129
|
+
${when.when(
|
|
130
|
+
(x) => x.appearance === enums.Appearance.Outlined,
|
|
131
|
+
index.html`
|
|
136
132
|
<${elevationTag} dp='0')}>
|
|
137
133
|
${renderCardContent(context)}
|
|
138
134
|
</${elevationTag}>
|
|
139
|
-
`
|
|
140
|
-
|
|
141
|
-
${when.when(
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
`
|
|
136
|
+
)}
|
|
137
|
+
${when.when(
|
|
138
|
+
(x) => x.appearance === enums.Appearance.Ghost,
|
|
139
|
+
index.html` ${renderCardContent(context)} `
|
|
140
|
+
)}
|
|
144
141
|
`;
|
|
145
142
|
};
|
|
146
143
|
|
|
@@ -149,7 +146,11 @@ const cardDefinition = Card.compose({
|
|
|
149
146
|
template: CardTemplate,
|
|
150
147
|
styles
|
|
151
148
|
});
|
|
152
|
-
const cardRegistries = [
|
|
149
|
+
const cardRegistries = [
|
|
150
|
+
cardDefinition(),
|
|
151
|
+
...definition$1.iconRegistries,
|
|
152
|
+
...definition.elevationRegistries
|
|
153
|
+
];
|
|
153
154
|
const registerCard = index.registerFactory(cardRegistries);
|
|
154
155
|
|
|
155
156
|
exports.cardDefinition = cardDefinition;
|
package/shared/definition14.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { F as FoundationElement, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { a as iconRegistries } from './
|
|
3
|
-
import { E as Elevation, e as elevationRegistries } from './
|
|
2
|
+
import { a as iconRegistries } from './definition27.js';
|
|
3
|
+
import { E as Elevation, e as elevationRegistries } from './definition62.js';
|
|
4
4
|
import { A as Appearance } from './enums.js';
|
|
5
5
|
import { I as Icon } from './icon.js';
|
|
6
6
|
import { w as when } from './when.js';
|
|
7
7
|
import { s as slotted } from './slotted.js';
|
|
8
8
|
import { c as classNames } from './class-names.js';
|
|
9
9
|
|
|
10
|
-
const styles = ":host{display:flex}.base{border-radius:8px;inline-size:100%;text-align:start}.wrapper{display:flex;overflow:hidden;flex-flow:column;block-size:100%;
|
|
10
|
+
const styles = ":host{display:flex}.base{border-radius:8px;inline-size:100%;text-align:start}.wrapper{display:flex;overflow:hidden;flex-flow:column;border-radius:inherit;block-size:100%;color:var(--vvd-color-canvas-text)}.main-content{display:flex;flex-flow:column;padding:24px}.header{display:flex;flex:1;align-items:flex-start;gap:8px}.header-content{flex:1}.header-wrapper{display:flex;gap:8px}.header-headline,.header-subtitle{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}.header-headline{font:var(--vvd-typography-heading-4);-webkit-line-clamp:var(--headline-line-clamp)}.header-subtitle{font:var(--vvd-typography-base);-webkit-line-clamp:var(--subtitle-line-clamp)}.hide-header .header{display:none}.header-subtitle,.text{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base)}.text{padding-right:8px;margin-top:12px}.footer{display:inline-flex;flex-direction:column;align-items:flex-end;padding-bottom:24px;margin-top:auto;padding-inline:24px}.hide-footer .footer{display:none}::slotted([slot=graphic i]),.icon{flex-shrink:0;align-self:baseline;margin-block-start:4px}.icon{font-size:20px}::slotted([slot=meta i]){flex-shrink:0;align-self:flex-start;margin-block-start:-8px;margin-inline:auto -8px}\n";
|
|
11
11
|
|
|
12
12
|
var __defProp = Object.defineProperty;
|
|
13
13
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -60,14 +60,10 @@ function renderHeaderIcon(iconTag) {
|
|
|
60
60
|
<${iconTag} class="icon" inline name="${(x) => x.icon}"></${iconTag}>`;
|
|
61
61
|
}
|
|
62
62
|
function Headline() {
|
|
63
|
-
return html`
|
|
64
|
-
<div class="header-headline">${(x) => x.headline}</div>
|
|
65
|
-
`;
|
|
63
|
+
return html` <div class="header-headline">${(x) => x.headline}</div> `;
|
|
66
64
|
}
|
|
67
65
|
function Subtitle() {
|
|
68
|
-
return html`
|
|
69
|
-
<div class="header-subtitle">${(x) => x.subtitle}</div>
|
|
70
|
-
`;
|
|
66
|
+
return html` <div class="header-subtitle">${(x) => x.subtitle}</div> `;
|
|
71
67
|
}
|
|
72
68
|
function headerContent() {
|
|
73
69
|
return html`
|
|
@@ -78,29 +74,26 @@ function headerContent() {
|
|
|
78
74
|
`;
|
|
79
75
|
}
|
|
80
76
|
function renderHeader(iconTag) {
|
|
81
|
-
return html`
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
return html` <header class="header">
|
|
78
|
+
<slot name="graphic" ${slotted("graphicSlottedContent")}
|
|
79
|
+
>${when((x) => x.icon, renderHeaderIcon(iconTag))}</slot
|
|
80
|
+
>
|
|
81
|
+
${when((x) => x.headline || x.subtitle, headerContent())}
|
|
82
|
+
</header>`;
|
|
86
83
|
}
|
|
87
84
|
function shouldHideHeader(card) {
|
|
88
85
|
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
89
86
|
}
|
|
90
87
|
function renderMetaSlot() {
|
|
91
|
-
return html`
|
|
92
|
-
<slot name="meta" ${slotted("metaSlottedContent")}></slot>
|
|
93
|
-
`;
|
|
88
|
+
return html` <slot name="meta" ${slotted("metaSlottedContent")}></slot> `;
|
|
94
89
|
}
|
|
95
90
|
function text() {
|
|
96
|
-
return html`
|
|
97
|
-
<div class="text">${(x) => x.text}</div>
|
|
98
|
-
`;
|
|
91
|
+
return html` <div class="text">${(x) => x.text}</div> `;
|
|
99
92
|
}
|
|
100
93
|
function renderCardContent(context) {
|
|
101
94
|
const iconTag = context.tagFor(Icon);
|
|
102
95
|
return html`
|
|
103
|
-
|
|
96
|
+
<div class="${getClasses}">
|
|
104
97
|
<div class="wrapper">
|
|
105
98
|
<div class="vwc-card-media">
|
|
106
99
|
<slot name="media"></slot>
|
|
@@ -108,8 +101,7 @@ function renderCardContent(context) {
|
|
|
108
101
|
<slot name="main">
|
|
109
102
|
<div class="main-content">
|
|
110
103
|
<div class="header-wrapper">
|
|
111
|
-
${renderHeader(iconTag)}
|
|
112
|
-
${renderMetaSlot()}
|
|
104
|
+
${renderHeader(iconTag)} ${renderMetaSlot()}
|
|
113
105
|
</div>
|
|
114
106
|
${when((x) => x.text, text())}
|
|
115
107
|
</div>
|
|
@@ -124,21 +116,26 @@ function renderCardContent(context) {
|
|
|
124
116
|
const CardTemplate = (context) => {
|
|
125
117
|
const elevationTag = context.tagFor(Elevation);
|
|
126
118
|
return html`
|
|
127
|
-
${when(
|
|
119
|
+
${when(
|
|
120
|
+
(x) => x.appearance !== Appearance.Ghost && x.appearance !== Appearance.Outlined,
|
|
121
|
+
html`
|
|
128
122
|
<${elevationTag} dp=${(x) => x.elevation ?? "4"}>
|
|
129
123
|
${renderCardContent(context)}
|
|
130
124
|
</${elevationTag}>
|
|
131
|
-
`
|
|
132
|
-
|
|
133
|
-
${when(
|
|
125
|
+
`
|
|
126
|
+
)}
|
|
127
|
+
${when(
|
|
128
|
+
(x) => x.appearance === Appearance.Outlined,
|
|
129
|
+
html`
|
|
134
130
|
<${elevationTag} dp='0')}>
|
|
135
131
|
${renderCardContent(context)}
|
|
136
132
|
</${elevationTag}>
|
|
137
|
-
`
|
|
138
|
-
|
|
139
|
-
${when(
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
`
|
|
134
|
+
)}
|
|
135
|
+
${when(
|
|
136
|
+
(x) => x.appearance === Appearance.Ghost,
|
|
137
|
+
html` ${renderCardContent(context)} `
|
|
138
|
+
)}
|
|
142
139
|
`;
|
|
143
140
|
};
|
|
144
141
|
|
|
@@ -147,7 +144,11 @@ const cardDefinition = Card.compose({
|
|
|
147
144
|
template: CardTemplate,
|
|
148
145
|
styles
|
|
149
146
|
});
|
|
150
|
-
const cardRegistries = [
|
|
147
|
+
const cardRegistries = [
|
|
148
|
+
cardDefinition(),
|
|
149
|
+
...iconRegistries,
|
|
150
|
+
...elevationRegistries
|
|
151
|
+
];
|
|
151
152
|
const registerCard = registerFactory(cardRegistries);
|
|
152
153
|
|
|
153
154
|
export { cardRegistries as a, cardDefinition as c, registerCard as r };
|
package/shared/definition15.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
4
|
+
const definition = require('./definition27.cjs');
|
|
5
5
|
require('./affix.cjs');
|
|
6
6
|
const index$1 = require('./index2.cjs');
|
|
7
|
+
const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
|
|
7
8
|
const formAssociated = require('./form-associated.cjs');
|
|
8
9
|
const keyCodes = require('./key-codes.cjs');
|
|
9
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
10
10
|
const icon = require('./icon.cjs');
|
|
11
11
|
const when = require('./when.cjs');
|
|
12
12
|
const slotted = require('./slotted.cjs');
|
|
@@ -98,7 +98,7 @@ index.__decorate([
|
|
|
98
98
|
index.observable
|
|
99
99
|
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
100
100
|
|
|
101
|
-
const styles = ":host{display:inline-flex;flex-direction:column;vertical-align:middle}:host([disabled]){cursor:not-allowed}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base:where(
|
|
101
|
+
const styles = ":host{display:inline-flex;flex-direction:column;vertical-align:middle}:host([disabled]){cursor:not-allowed}.base{display:inline-flex;align-items:center;gap:8px;vertical-align:middle}.base.connotation-cta{--_connotation-color-primary: var(--vvd-checkbox-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-checkbox-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-checkbox-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-intermediate: var(--vvd-checkbox-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-checkbox-cta-firm, var(--vvd-color-cta-600))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-checkbox-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-checkbox-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-checkbox-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-checkbox-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-intermediate: var(--vvd-checkbox-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-checkbox-accent-firm, var(--vvd-color-canvas-text))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.checked,:checked):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base:where(.checked,:checked):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:focus-visible{outline:none}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}.control{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:focus-visible .control{--focus-inset: -3px;--focus-stroke-gap-color: transparent}.base:focus-visible .control:before{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));position:absolute;display:block;border-radius:2px;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));content:\"\";inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.error:not(.checked) .control{background-color:var(--vvd-color-alert-50);box-shadow:inset 0 0 0 2px var(--vvd-color-alert-500)}.indicator{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)) - 4px)}.base:not(.checked) .indicator.checkmark{display:none}.base.checked .indicator.minus,.base:not(.indeterminate) .indicator.minus{display:none}label{display:flex;flex-wrap:wrap;align-items:center;color:var(--vvd-color-canvas-text);column-gap:4px;cursor:pointer;font:var(--vvd-typography-base)}.hide-label label{display:none}.icon{font-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2))*.6);line-height:1}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}\n";
|
|
102
102
|
|
|
103
103
|
var __defProp = Object.defineProperty;
|
|
104
104
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -182,7 +182,11 @@ exports.Checkbox = __decorateClass([
|
|
|
182
182
|
index$1.errorText,
|
|
183
183
|
index$1.formElements
|
|
184
184
|
], exports.Checkbox);
|
|
185
|
-
|
|
185
|
+
applyMixinsWithObservables.applyMixinsWithObservables(
|
|
186
|
+
exports.Checkbox,
|
|
187
|
+
index$1.FormElementHelperText,
|
|
188
|
+
index$1.FormElementSuccessText
|
|
189
|
+
);
|
|
186
190
|
|
|
187
191
|
const getClasses = ({
|
|
188
192
|
connotation,
|
|
@@ -207,7 +211,8 @@ const getClasses = ({
|
|
|
207
211
|
const CheckboxTemplate = (context) => {
|
|
208
212
|
const iconTag = context.tagFor(icon.Icon);
|
|
209
213
|
return index.html`<template role="${(x) => x.ariaLabel ? "presentation" : null}">
|
|
210
|
-
<div
|
|
214
|
+
<div
|
|
215
|
+
class="${getClasses}"
|
|
211
216
|
role="checkbox"
|
|
212
217
|
aria-label="${(x) => x.ariaLabel}"
|
|
213
218
|
aria-checked="${(x) => x.checked}"
|
|
@@ -216,16 +221,23 @@ const CheckboxTemplate = (context) => {
|
|
|
216
221
|
aria-readonly="${(x) => x.readOnly}"
|
|
217
222
|
tabindex="${(x) => x.tabindex !== null ? x.tabindex : x.disabled ? null : 0}"
|
|
218
223
|
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
219
|
-
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
224
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
225
|
+
>
|
|
220
226
|
<div class="control">
|
|
221
|
-
${when.when(
|
|
222
|
-
|
|
227
|
+
${when.when(
|
|
228
|
+
(x) => x.checked,
|
|
229
|
+
index.html`<${iconTag} name="check-solid" class="icon"></${iconTag}>`
|
|
230
|
+
)}
|
|
231
|
+
${when.when(
|
|
232
|
+
(x) => x.indeterminate,
|
|
233
|
+
index.html`<${iconTag} name="minus-solid" class="icon"></${iconTag}>`
|
|
234
|
+
)}
|
|
223
235
|
</div>
|
|
224
|
-
${index.html`<label
|
|
236
|
+
${index.html`<label
|
|
237
|
+
>${(x) => x.label}<slot ${slotted.slotted("slottedContent")}></slot
|
|
238
|
+
></label>`}
|
|
225
239
|
</div>
|
|
226
|
-
${
|
|
227
|
-
${when.when((x) => !x.successText && x.errorValidationMessage, index$1.getFeedbackTemplate("error", context))}
|
|
228
|
-
${when.when((x) => x.successText, index$1.getFeedbackTemplate("success", context))}
|
|
240
|
+
${index$1.getFeedbackTemplate(context)}
|
|
229
241
|
</template>`;
|
|
230
242
|
};
|
|
231
243
|
|