@vonage/vivid 3.0.0-next.2 → 3.0.0-next.5

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.
Files changed (88) hide show
  1. package/accordion/index.js +61 -0
  2. package/accordion-item/index.js +125 -0
  3. package/badge/index.js +19 -10
  4. package/banner/index.js +212 -0
  5. package/breadcrumb/index.js +100 -0
  6. package/breadcrumb-item/index.js +15 -8
  7. package/button/index.js +24 -15
  8. package/calendar/index.js +1521 -0
  9. package/elevation/index.js +5 -12
  10. package/focus/index.js +2 -2
  11. package/icon/index.js +33 -4
  12. package/index.d.ts +1 -0
  13. package/index.js +21 -5
  14. package/layout/index.js +1 -1
  15. package/lib/accordion/accordion.d.ts +9 -0
  16. package/lib/accordion/accordion.template.d.ts +4 -0
  17. package/lib/accordion/index.d.ts +2 -0
  18. package/lib/accordion-item/accordion-item.d.ts +13 -0
  19. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  20. package/lib/accordion-item/index.d.ts +3 -0
  21. package/lib/badge/badge.d.ts +3 -3
  22. package/lib/banner/banner.d.ts +20 -0
  23. package/lib/banner/banner.template.d.ts +6 -0
  24. package/lib/banner/index.d.ts +2 -0
  25. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  26. package/lib/breadcrumb/index.d.ts +2 -0
  27. package/lib/breadcrumb-item/breadcrumb-item.d.ts +3 -3
  28. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  29. package/lib/breadcrumb-item/index.d.ts +1 -0
  30. package/lib/button/button.d.ts +3 -3
  31. package/lib/calendar/calendar.d.ts +11 -0
  32. package/lib/calendar/calendar.template.d.ts +4 -0
  33. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  34. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  35. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  36. package/lib/calendar/index.d.ts +3 -0
  37. package/lib/components.d.ts +9 -0
  38. package/lib/elevation/elevation.d.ts +1 -1
  39. package/lib/enums.d.ts +3 -2
  40. package/lib/icon/icon.d.ts +1 -3
  41. package/lib/popup/index.d.ts +4 -0
  42. package/lib/popup/popup.d.ts +29 -0
  43. package/lib/popup/popup.template.d.ts +4 -0
  44. package/lib/progress/index.d.ts +2 -0
  45. package/lib/progress/progress.d.ts +9 -0
  46. package/lib/progress/progress.template.d.ts +5 -0
  47. package/lib/progress-ring/index.d.ts +2 -0
  48. package/lib/progress-ring/progress-ring.d.ts +6 -0
  49. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  50. package/lib/side-drawer/index.d.ts +2 -0
  51. package/lib/side-drawer/side-drawer.d.ts +12 -0
  52. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  53. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  54. package/lib/text/index.d.ts +2 -0
  55. package/lib/text/text.d.ts +10 -0
  56. package/lib/text/text.template.d.ts +4 -0
  57. package/lib/text-anchor/text-anchor.d.ts +3 -0
  58. package/lib/tooltip/index.d.ts +3 -0
  59. package/lib/tooltip/tooltip.d.ts +10 -0
  60. package/lib/tooltip/tooltip.template.d.ts +4 -0
  61. package/package.json +9 -5
  62. package/popup/index.js +2087 -0
  63. package/progress/index.js +98 -0
  64. package/progress-ring/index.js +76 -0
  65. package/shared/_has.js +58 -0
  66. package/shared/affix.js +10 -25
  67. package/shared/anchor.js +3 -3
  68. package/shared/aria-global.js +20 -20
  69. package/shared/base-progress.js +65 -0
  70. package/shared/breadcrumb-item.js +25 -0
  71. package/shared/es.object.assign.js +68 -0
  72. package/shared/icon.js +1393 -0
  73. package/shared/index.js +4918 -1427
  74. package/shared/index2.js +15 -4905
  75. package/shared/patterns/affix.d.ts +3 -4
  76. package/shared/slotted.js +119 -0
  77. package/shared/text-anchor.js +21 -0
  78. package/shared/text-anchor.template.js +14 -19
  79. package/shared/web.dom-collections.iterator.js +639 -639
  80. package/shared/when.js +15 -0
  81. package/side-drawer/index.js +103 -0
  82. package/sidenav-item/index.js +15 -56
  83. package/styles/themes/dark.css +4 -4
  84. package/styles/themes/light.css +4 -4
  85. package/text/index.js +45 -0
  86. package/text-anchor/index.js +6 -2
  87. package/tooltip/index.js +73 -0
  88. package/shared/index3.js +0 -21
@@ -0,0 +1,61 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import { c as classNames } from '../shared/class-names.js';
4
+
5
+ var css_248z = ".control {\n display: flex;\n flex-direction: column;\n}\n\n::slotted(vwc-accordion-item:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-30);\n}";
6
+ styleInject(css_248z);
7
+
8
+ class Accordion extends FoundationElement {
9
+ constructor() {
10
+ super();
11
+ this.accordionItems = undefined;
12
+ this.multi = false;
13
+ this.addEventListener('opened', this.handleOpened);
14
+ }
15
+
16
+ connectedCallback() {
17
+ super.connectedCallback();
18
+ this.accordionItems = this.children;
19
+ }
20
+
21
+ handleOpened(e) {
22
+ if (!this.multi && this.accordionItems) {
23
+ for (let i = 0; i < this.accordionItems.length; i++) {
24
+ if (this.accordionItems[i] !== e.target) {
25
+ this.accordionItems[i].open = false;
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ closeAll() {
32
+ if (this.accordionItems) {
33
+ for (let i = 0; i < this.accordionItems.length; i++) {
34
+ this.accordionItems[i].open = false;
35
+ }
36
+ }
37
+ }
38
+
39
+ }
40
+
41
+ __decorate([attr({
42
+ mode: 'boolean'
43
+ }), __metadata("design:type", Object)], Accordion.prototype, "multi", void 0);
44
+
45
+ let _2 = t => t,
46
+ _t;
47
+
48
+ const getClasses = _ => classNames('control');
49
+
50
+ const AccordionTemplate = () => html(_t || (_t = _2`<div class="${0}">
51
+ <slot></slot>
52
+ </div>`), getClasses);
53
+
54
+ const vividAccordion = Accordion.compose({
55
+ baseName: 'accordion',
56
+ template: AccordionTemplate,
57
+ styles: css_248z
58
+ });
59
+ designSystem.register(vividAccordion());
60
+
61
+ export { vividAccordion };
@@ -0,0 +1,125 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import '../shared/web.dom-collections.iterator.js';
4
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
5
+ import { a as applyMixins } from '../shared/apply-mixins.js';
6
+ import { w as when } from '../shared/when.js';
7
+ import { c as classNames } from '../shared/class-names.js';
8
+ import '../icon/index.js';
9
+ import '../shared/icon.js';
10
+ import '../shared/_has.js';
11
+
12
+ var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.body {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n padding: 8px 32px 24px 16px;\n}\n.icon:not(.icon-trailing) .body {\n padding-left: 48px;\n}\n\n.control {\n display: flex;\n flex-direction: column;\n}\n.control:not(.open) .toggle-close,\n.control:not(.open) .body {\n display: none;\n}\n.control.open .toggle-open {\n display: none;\n}\n.control.open .toggle-close {\n display: initial;\n}\n\n.header {\n padding: 0;\n margin: 0;\n}\n\n.button {\n font: 500 condensed 20px / 28px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 16px;\n border: 0 none;\n background: transparent;\n cursor: pointer;\n}\n.button:hover {\n background: var(--vvd-color-neutral-10);\n}\n.button .heading-text {\n flex-grow: 1;\n margin-inline-end: auto;\n text-align: left;\n}\n.button .meta {\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n overflow: hidden;\n max-width: 20%;\n flex-shrink: 0;\n color: var(--vvd-color-neutral-70);\n margin-inline-start: 1rem;\n text-align: end;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.button .indicator {\n display: flex;\n}\n.button .indicator vwc-icon,\n.button .indicator slot[name=indicator i]::slotted(vwc-icon) {\n margin-inline-start: 16px;\n}\n.button .icon {\n margin-inline-end: 16px;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}";
13
+ styleInject(css_248z);
14
+
15
+ class AccordionItem extends FoundationElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.heading = '';
19
+ this.noIndicator = false;
20
+ this.meta = '';
21
+ this.open = false;
22
+ }
23
+
24
+ attributeChangedCallback(name, oldValue, newValue) {
25
+ super.attributeChangedCallback(name, oldValue, newValue);
26
+
27
+ if (name === 'open') {
28
+ newValue === null ? this.emitEvent('closed') : this.emitEvent('opened');
29
+ }
30
+ }
31
+
32
+ emitEvent(name) {
33
+ const init = {
34
+ bubbles: true,
35
+ composed: true
36
+ };
37
+ const ev = new CustomEvent(name, init);
38
+ this.dispatchEvent(ev);
39
+ }
40
+
41
+ }
42
+
43
+ __decorate([attr({
44
+ mode: 'fromView'
45
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "heading", void 0);
46
+
47
+ __decorate([attr({
48
+ attribute: 'heading-level'
49
+ }), __metadata("design:type", Number)], AccordionItem.prototype, "headingLevel", void 0);
50
+
51
+ __decorate([attr({
52
+ mode: 'boolean',
53
+ attribute: 'no-indicator'
54
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
55
+
56
+ __decorate([attr({
57
+ mode: 'fromView'
58
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "meta", void 0);
59
+
60
+ __decorate([attr({
61
+ mode: 'boolean'
62
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "open", void 0);
63
+
64
+ applyMixins(AccordionItem, AffixIconWithTrailing);
65
+
66
+ let _ = t => t,
67
+ _t,
68
+ _t2,
69
+ _t3,
70
+ _t4,
71
+ _t5;
72
+ const PANEL = 'panel';
73
+
74
+ const getClasses = ({
75
+ open,
76
+ iconTrailing,
77
+ icon,
78
+ noIndicator
79
+ }) => classNames('control', ['open', open], ['icon', Boolean(icon)], ['icon-trailing', iconTrailing], ['no-indicator', noIndicator]);
80
+
81
+ const AccordionItemTemplate = context => html(_t || (_t = _`
82
+ <div class="${0}">
83
+ ${0}
84
+ <div class="body" id="${0}" role="region" aria-labelledby="header">
85
+ <slot></slot>
86
+ </div>
87
+ </div>
88
+ `), getClasses, x => renderPanelHeader(context, x.headingLevel), PANEL);
89
+
90
+ const renderPanelHeader = (context, headingLevel) => {
91
+ const header = headingLevel ? 'h' + headingLevel : 'h3';
92
+ return html(_t2 || (_t2 = _`
93
+ <${0} class="header">
94
+ ${0}
95
+ </${0}>
96
+ `), header, renderHeaderButton(context), header);
97
+ };
98
+
99
+ const renderHeaderButton = context => {
100
+ const affixIconTemplate = affixIconTemplateFactory(context);
101
+ return html(_t3 || (_t3 = _`
102
+ <button class="button" id="header" @click=${0}
103
+ ?aria-expanded=${0}
104
+ aria-controls="${0}">
105
+ ${0}
106
+ <span class="heading-text">${0}</span>
107
+ ${0}
108
+ <span class="indicator">
109
+ ${0}
110
+ </span>
111
+ </button>
112
+ `), x => x.open = !x.open, x => x.open, PANEL, x => affixIconTemplate(x.icon), x => x.heading, when(x => x.meta, html(_t4 || (_t4 = _`<span class="meta">${0}</span>`), x => x.meta)), when(x => !x.noIndicator && !x.iconTrailing, html(_t5 || (_t5 = _`
113
+ <vwc-icon class="toggle-open" type='chevron-down-solid'></vwc-icon>
114
+ <vwc-icon class="toggle-close" type='chevron-up-solid'></vwc-icon>
115
+ `))));
116
+ };
117
+
118
+ const vividAccordionItem = AccordionItem.compose({
119
+ baseName: 'accordion-item',
120
+ template: AccordionItemTemplate,
121
+ styles: css_248z
122
+ });
123
+ designSystem.register(vividAccordionItem());
124
+
125
+ export { vividAccordionItem };
package/badge/index.js CHANGED
@@ -1,10 +1,13 @@
1
- import '../shared/index.js';
2
- import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index2.js';
1
+ import '../icon/index.js';
2
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
3
3
  import '../shared/web.dom-collections.iterator.js';
4
- import { P as PrefixOrSuffix, p as prefixOrSuffixTemplate } from '../shared/affix.js';
4
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
5
5
  import { a as applyMixins } from '../shared/apply-mixins.js';
6
6
  import { s as styleInject } from '../shared/style-inject.es.js';
7
7
  import { c as classNames } from '../shared/class-names.js';
8
+ import '../shared/icon.js';
9
+ import '../shared/_has.js';
10
+ import '../shared/when.js';
8
11
 
9
12
  class Badge extends FoundationElement {
10
13
  constructor() {
@@ -22,11 +25,13 @@ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearan
22
25
 
23
26
  __decorate([attr, __metadata("design:type", String)], Badge.prototype, "size", void 0);
24
27
 
25
- __decorate([attr, __metadata("design:type", Object)], Badge.prototype, "text", void 0);
28
+ __decorate([attr({
29
+ mode: 'fromView'
30
+ }), __metadata("design:type", Object)], Badge.prototype, "text", void 0);
26
31
 
27
- applyMixins(Badge, PrefixOrSuffix);
32
+ applyMixins(Badge, AffixIconWithTrailing);
28
33
 
29
- var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.control.appearance-filled, .control:not(.appearance-outlined):not(.appearance-soft) {\n --appearance-color-fill: var(--connotation);\n --appearance-color-text: var(--on-connotation);\n}\n\n.control.appearance-outlined {\n --appearance-color-fill: transparent;\n --appearance-color-outline: var(--connotation);\n --appearance-color-text: var(--connotation-contrast);\n}\n\n.control.appearance-soft {\n --appearance-color-fill: var(--connotation-soft);\n --appearance-color-text: var(--connotation-contrast);\n}\n\n.control {\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--appearance-color-outline);\n color: var(--appearance-color-text);\n column-gap: 8px;\n vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert):not(.connotation-warning):not(.connotation-info) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-soft: var(--vvd-color-neutral-20);\n --connotation-contrast: var(--vvd-color-primary);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-soft: var(--vvd-color-cta-20);\n --connotation-contrast: var(--vvd-color-cta-90);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-soft: var(--vvd-color-success-20);\n --connotation-contrast: var(--vvd-color-success-90);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-soft: var(--vvd-color-alert-20);\n --connotation-contrast: var(--vvd-color-alert-90);\n}\n\n.control.connotation-warning {\n --connotation: var(--vvd-color-warning);\n --on-connotation: var(--vvd-color-on-warning);\n --connotation-soft: var(--vvd-color-warning-20);\n --connotation-contrast: var(--vvd-color-warning-90);\n}\n\n.control.connotation-info {\n --connotation: var(--vvd-color-info);\n --on-connotation: var(--vvd-color-on-info);\n --connotation-soft: var(--vvd-color-info-20);\n --connotation-contrast: var(--vvd-color-info-90);\n}\n\n/* Size */\n.control:not(.size-base-small):not(.size-base-large) {\n block-size: 24px;\n padding-inline: 10px;\n}\n\n.control.size-base-small {\n block-size: 20px;\n padding-inline: 8px;\n}\n\n.control.size-base-large {\n block-size: 28px;\n padding-inline: 12px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 4px;\n}\n\n.control.shape-pill {\n border-radius: 14px;\n}\n\n/* Icon */\n.icon.icon-trailing {\n order: 1;\n}";
34
+ var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.control {\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n column-gap: 8px;\n vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert):not(.connotation-warning):not(.connotation-info) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-soft: var(--vvd-color-neutral-20);\n --connotation-contrast: var(--vvd-color-neutral-90);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-soft: var(--vvd-color-cta-20);\n --connotation-contrast: var(--vvd-color-cta-90);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-soft: var(--vvd-color-success-20);\n --connotation-contrast: var(--vvd-color-success-90);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-soft: var(--vvd-color-alert-20);\n --connotation-contrast: var(--vvd-color-alert-90);\n}\n\n.control.connotation-warning {\n --connotation: var(--vvd-color-warning);\n --on-connotation: var(--vvd-color-on-warning);\n --connotation-soft: var(--vvd-color-warning-20);\n --connotation-contrast: var(--vvd-color-warning-90);\n}\n\n.control.connotation-info {\n --connotation: var(--vvd-color-info);\n --on-connotation: var(--vvd-color-on-info);\n --connotation-soft: var(--vvd-color-info-20);\n --connotation-contrast: var(--vvd-color-info-90);\n}\n\n.control {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--connotation);\n}\n.control.appearance-subtle {\n --_appearance-color-text: var(--connotation-contrast);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: transaprent;\n}\n\n/* Size */\n.control:not(.size-base-small):not(.size-base-large) {\n block-size: 24px;\n padding-inline: 10px;\n}\n\n.control.size-base-small {\n block-size: 20px;\n padding-inline: 8px;\n}\n\n.control.size-base-large {\n block-size: 28px;\n padding-inline: 12px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 4px;\n}\n\n.control.shape-pill {\n border-radius: 14px;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}";
30
35
  styleInject(css_248z);
31
36
 
32
37
  let _ = t => t,
@@ -36,14 +41,18 @@ const getClasses = ({
36
41
  connotation,
37
42
  appearance,
38
43
  shape,
39
- size
40
- }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)]);
44
+ size,
45
+ iconTrailing
46
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-trailing', iconTrailing]);
41
47
 
42
- const badgeTemplate = context => html(_t || (_t = _`
48
+ const badgeTemplate = context => {
49
+ const affixIconTemplate = affixIconTemplateFactory(context);
50
+ return html(_t || (_t = _`
43
51
  <span class="${0}">
44
52
  ${0}
45
53
  ${0}
46
- </span>`), getClasses, () => prefixOrSuffixTemplate(context), x => x.text);
54
+ </span>`), getClasses, x => affixIconTemplate(x.icon), x => x.text);
55
+ };
47
56
 
48
57
  const VIVIDBadge = Badge.compose({
49
58
  baseName: 'badge',
@@ -0,0 +1,212 @@
1
+ import { F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import '../shared/web.dom-collections.iterator.js';
4
+ import { b as AffixIcon, a as affixIconTemplateFactory } from '../shared/affix.js';
5
+ import { a as applyMixins } from '../shared/apply-mixins.js';
6
+ import '../button/index.js';
7
+ import '../text-anchor/index.js';
8
+ import { w as when } from '../shared/when.js';
9
+ import { c as classNames } from '../shared/class-names.js';
10
+ import '../shared/icon.js';
11
+ import '../shared/_has.js';
12
+ import '../icon/index.js';
13
+ import '../shared/index2.js';
14
+ import '../shared/aria-global.js';
15
+ import '../shared/text-anchor.js';
16
+ import '../shared/anchor.js';
17
+ import '../shared/text-anchor.template.js';
18
+
19
+ var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.control {\n overflow: hidden;\n max-height: 10rem;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n transition: max-height var(--transition-delay, 200ms);\n}\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-diverse: var(--vvd-color-success-70);\n}\n\n.control:not(.connotation-success):not(.connotation-alert):not(.connotation-announcement):not(.connotation-warning) {\n --connotation: var(--vvd-color-info);\n --on-connotation: var(--vvd-color-on-info);\n --connotation-diverse: var(--vvd-color-info-70);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-diverse: var(--vvd-color-alert-70);\n}\n\n.control.connotation-announcement {\n --connotation: var(--vvd-color-announcement);\n --on-connotation: var(--vvd-color-on-announcement);\n --connotation-diverse: var(--vvd-color-announcement-70);\n}\n\n.control.connotation-warning {\n --connotation: var(--vvd-color-warning);\n --on-connotation: var(--vvd-color-on-warning);\n --connotation-diverse: var(--vvd-color-warning-70);\n}\n\n.control {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation);\n --_appearance-color-outline: transaprent;\n}\n.control.removing {\n max-height: 0;\n}\n.control > .header {\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: flex;\n min-height: 60px;\n align-items: center;\n justify-content: flex-start;\n}\n.control > .header > .user-content {\n display: flex;\n flex: 1 0;\n align-items: center;\n justify-content: center;\n padding-inline: 16px;\n}\n.control > .header > .user-content > .icon {\n flex: 0 0 auto;\n font-size: 20px;\n margin-inline-end: 15px;\n}\n.control > .header > .user-content > .action-items {\n display: inline-block;\n flex: 0 0 auto;\n padding-inline-start: 15px;\n}\n.control > .header > .user-content > .message {\n padding: 20px 0;\n}\n.control > .header > .dismiss-button {\n --vvd-icon-button-color: inherit;\n flex: 0 0 auto;\n margin-inline-end: 8px;\n}";
20
+ styleInject(css_248z);
21
+
22
+ var Connotation;
23
+
24
+ (function (Connotation) {
25
+ Connotation["Primary"] = "primary";
26
+ Connotation["CTA"] = "cta";
27
+ Connotation["Success"] = "success";
28
+ Connotation["Alert"] = "alert";
29
+ Connotation["Warning"] = "warning";
30
+ Connotation["Info"] = "info";
31
+ Connotation["Announcement"] = "announcement";
32
+ })(Connotation || (Connotation = {}));
33
+
34
+ var ConnotationDecorative;
35
+
36
+ (function (ConnotationDecorative) {
37
+ ConnotationDecorative["Pacific"] = "pacific";
38
+ })(ConnotationDecorative || (ConnotationDecorative = {}));
39
+
40
+ var Shape;
41
+
42
+ (function (Shape) {
43
+ Shape["Rounded"] = "rounded";
44
+ Shape["Pill"] = "pill";
45
+ Shape["Circled"] = "circled";
46
+ Shape["Sharp"] = "sharp";
47
+ })(Shape || (Shape = {}));
48
+
49
+ var Appearance;
50
+
51
+ (function (Appearance) {
52
+ Appearance["Text"] = "text";
53
+ Appearance["Filled"] = "filled";
54
+ Appearance["Outlined"] = "outlined";
55
+ Appearance["Subtle"] = "subtle";
56
+ Appearance["Ghost"] = "ghost";
57
+ })(Appearance || (Appearance = {}));
58
+
59
+ var Size;
60
+
61
+ (function (Size) {
62
+ Size["BaseSmall"] = "base-small";
63
+ Size["Base"] = "base";
64
+ Size["BaseLarge"] = "base-large";
65
+ })(Size || (Size = {}));
66
+
67
+ var Position;
68
+
69
+ (function (Position) {
70
+ Position["Top"] = "TOP";
71
+ Position["Bottom"] = "BOTTOM";
72
+ Position["Start"] = "START";
73
+ Position["Center"] = "CENTER";
74
+ Position["End"] = "END";
75
+ })(Position || (Position = {}));
76
+
77
+ var Role;
78
+
79
+ (function (Role) {
80
+ Role["Status"] = "status";
81
+ Role["Alert"] = "alert";
82
+ })(Role || (Role = {}));
83
+
84
+ var AriaLive;
85
+
86
+ (function (AriaLive) {
87
+ AriaLive["Polite"] = "polite";
88
+ AriaLive["Assertive"] = "assertive";
89
+ })(AriaLive || (AriaLive = {}));
90
+
91
+ var _Banner_handleRemoveEnd, _Banner_closeOnKeyDown;
92
+ const connotationIconMap = new Map([[Connotation.Info, 'info-solid'], [Connotation.Announcement, 'megaphone-solid'], [Connotation.Success, 'check-circle-solid'], [Connotation.Warning, 'warning-solid'], [Connotation.Alert, 'error-solid']]);
93
+
94
+ const defaultConnotation = (connotation = Connotation.Info) => connotationIconMap.get(connotation);
95
+
96
+ class Banner extends FoundationElement {
97
+ constructor() {
98
+ super(...arguments);
99
+ this.removable = false;
100
+
101
+ _Banner_handleRemoveEnd.set(this, () => {
102
+ this.$emit('vwc-banner:removed');
103
+ this.parentElement && this.parentElement.removeChild(this);
104
+ });
105
+
106
+ _Banner_closeOnKeyDown.set(this, e => {
107
+ if (e.key !== 'Escape' || !this.removable) {
108
+ return;
109
+ }
110
+
111
+ this.remove();
112
+ });
113
+ }
114
+
115
+ get conditionedIcon() {
116
+ var _a;
117
+
118
+ return (_a = this.icon) !== null && _a !== void 0 ? _a : defaultConnotation(this.connotation);
119
+ }
120
+
121
+ connectedCallback() {
122
+ super.connectedCallback();
123
+ this.addEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
124
+ }
125
+
126
+ disconnectedCallback() {
127
+ super.disconnectedCallback();
128
+ this.removeEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
129
+ }
130
+
131
+ remove() {
132
+ this.$emit('vwc-banner:removing');
133
+ const banner = this.shadowRoot && this.shadowRoot.querySelector('.banner');
134
+
135
+ if (banner) {
136
+ banner.classList.add('removing');
137
+ banner.addEventListener('transitionend', __classPrivateFieldGet(this, _Banner_handleRemoveEnd, "f"));
138
+ }
139
+ }
140
+
141
+ }
142
+ _Banner_handleRemoveEnd = new WeakMap(), _Banner_closeOnKeyDown = new WeakMap();
143
+
144
+ __decorate([attr({
145
+ attribute: 'action-href'
146
+ }), __metadata("design:type", Object)], Banner.prototype, "actionHref", void 0);
147
+
148
+ __decorate([attr({
149
+ attribute: 'action-text'
150
+ }), __metadata("design:type", Object)], Banner.prototype, "actionText", void 0);
151
+
152
+ __decorate([attr({
153
+ mode: 'boolean'
154
+ }), __metadata("design:type", Object)], Banner.prototype, "removable", void 0);
155
+
156
+ __decorate([attr({
157
+ attribute: 'aria-live'
158
+ }), __metadata("design:type", Object)], Banner.prototype, "ariaLive", void 0);
159
+
160
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "role", void 0);
161
+
162
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "text", void 0);
163
+
164
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "connotation", void 0);
165
+
166
+ applyMixins(Banner, AffixIcon);
167
+
168
+ let _2 = t => t,
169
+ _t,
170
+ _t2;
171
+
172
+ const getClasses = _ => classNames('control', [`connotation-${_.connotation}`, !!_.connotation]);
173
+
174
+ function renderDismissButton() {
175
+ return html(_t || (_t = _2`
176
+ <vwc-button
177
+ size="base-small"
178
+ class="dismiss-button"
179
+ icon="close-line"
180
+ @click="${0}">
181
+ </vwc-button>`), x => x.remove());
182
+ }
183
+
184
+ const BannerTemplate = context => {
185
+ const affixIconTemplate = affixIconTemplateFactory(context);
186
+ return html(_t2 || (_t2 = _2`
187
+ <div class="banner ${0}" tabindex="0">
188
+ <header class="header">
189
+ <div class="user-content">
190
+ ${0}
191
+ <div class="banner--message"
192
+ role="${0}"
193
+ aria-live="${0}">
194
+ ${0}
195
+ </div>
196
+ <slot class="action-items" name="actionItems"></slot>
197
+ </div>
198
+
199
+ ${0}
200
+ </header>
201
+ </div>
202
+ `), getClasses, x => affixIconTemplate(x.conditionedIcon), x => x.role ? x.role : 'status', x => x.ariaLive ? x.ariaLive : 'polite', x => x.text, when(x => x.removable, renderDismissButton()));
203
+ };
204
+
205
+ const vividBanner = Banner.compose({
206
+ baseName: 'banner',
207
+ template: BannerTemplate,
208
+ styles: css_248z
209
+ });
210
+ designSystem.register(vividBanner());
211
+
212
+ export { vividBanner };
@@ -0,0 +1,100 @@
1
+ import { h as html, F as FoundationElement, _ as __decorate, o as observable, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import { B as BreadcrumbItem } from '../shared/breadcrumb-item.js';
4
+ import { s as slotted, e as elements } from '../shared/slotted.js';
5
+ import '../shared/anchor.js';
6
+ import '../shared/apply-mixins.js';
7
+ import '../shared/aria-global.js';
8
+
9
+ /**
10
+ * The template for the {@link @microsoft/fast-foundation#Breadcrumb} component.
11
+ * @public
12
+ */
13
+ const breadcrumbTemplate = (context, definition) => html `
14
+ <template role="navigation">
15
+ <div role="list" class="list" part="list">
16
+ <slot
17
+ ${slotted({ property: "slottedBreadcrumbItems", filter: elements() })}
18
+ ></slot>
19
+ </div>
20
+ </template>
21
+ `;
22
+
23
+ /**
24
+ * A Breadcrumb Custom HTML Element.
25
+ *
26
+ * @public
27
+ */
28
+ class Breadcrumb$1 extends FoundationElement {
29
+ slottedBreadcrumbItemsChanged() {
30
+ if (this.$fastController.isConnected) {
31
+ if (this.slottedBreadcrumbItems === undefined ||
32
+ this.slottedBreadcrumbItems.length === 0) {
33
+ return;
34
+ }
35
+ const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1];
36
+ this.slottedBreadcrumbItems.forEach((item) => {
37
+ const itemIsLastNode = item === lastNode;
38
+ this.setItemSeparator(item, itemIsLastNode);
39
+ this.setAriaCurrent(item, itemIsLastNode);
40
+ });
41
+ }
42
+ }
43
+ setItemSeparator(item, isLastNode) {
44
+ if (item instanceof BreadcrumbItem) {
45
+ item.separator = !isLastNode;
46
+ }
47
+ }
48
+ /**
49
+ * Finds href on childnodes in the light DOM or shadow DOM.
50
+ * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href.
51
+ */
52
+ findChildWithHref(node) {
53
+ var _a, _b;
54
+ if (node.childElementCount > 0) {
55
+ return node.querySelector("a[href]");
56
+ }
57
+ else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) {
58
+ return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]");
59
+ }
60
+ else
61
+ return null;
62
+ }
63
+ /**
64
+ * Sets ARIA Current for the current node
65
+ * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node,
66
+ * otherwise apply aria-current to the host element, with an href
67
+ */
68
+ setAriaCurrent(item, isLastNode) {
69
+ const childNodeWithHref = this.findChildWithHref(item);
70
+ if (childNodeWithHref === null &&
71
+ item.hasAttribute("href") &&
72
+ item instanceof BreadcrumbItem) {
73
+ isLastNode
74
+ ? item.setAttribute("aria-current", "page")
75
+ : item.removeAttribute("aria-current");
76
+ }
77
+ else if (childNodeWithHref !== null) {
78
+ isLastNode
79
+ ? childNodeWithHref.setAttribute("aria-current", "page")
80
+ : childNodeWithHref.removeAttribute("aria-current");
81
+ }
82
+ }
83
+ }
84
+ __decorate([
85
+ observable
86
+ ], Breadcrumb$1.prototype, "slottedBreadcrumbItems", void 0);
87
+
88
+ var css_248z = ".list {\n display: flex;\n}";
89
+ styleInject(css_248z);
90
+
91
+ class Breadcrumb extends Breadcrumb$1 {}
92
+
93
+ const vividBreadcrumb = Breadcrumb.compose({
94
+ baseName: 'breadcrumb',
95
+ template: breadcrumbTemplate,
96
+ styles: css_248z
97
+ });
98
+ designSystem.register(vividBreadcrumb());
99
+
100
+ export { vividBreadcrumb };
@@ -1,25 +1,32 @@
1
- import { _ as __decorate, o as observable, b as __metadata, h as html, d as designSystem } from '../shared/index2.js';
1
+ import '../icon/index.js';
2
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
3
  import { s as styleInject } from '../shared/style-inject.es.js';
3
- import { T as TextAnchor, t as textAnchorTemplate } from '../shared/text-anchor.template.js';
4
- import { w as when } from '../shared/index.js';
4
+ import { B as BreadcrumbItem$1 } from '../shared/breadcrumb-item.js';
5
+ import { t as textAnchorTemplate } from '../shared/text-anchor.template.js';
6
+ import { w as when } from '../shared/when.js';
5
7
  import { c as classNames } from '../shared/class-names.js';
8
+ import '../shared/icon.js';
6
9
  import '../shared/web.dom-collections.iterator.js';
10
+ import '../shared/_has.js';
7
11
  import '../shared/anchor.js';
8
12
  import '../shared/apply-mixins.js';
9
13
  import '../shared/aria-global.js';
14
+ import '../shared/affix.js';
10
15
 
11
- var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.breadcrumb-item {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: flex;\n align-items: center;\n color: var(--vvd-color-neutral-70);\n}\n.breadcrumb-item a {\n color: var(--vvd-color-cta-70);\n text-decoration: none;\n}\n.breadcrumb-item a:hover {\n text-decoration: underline;\n}\n.breadcrumb-item vwc-icon {\n margin: 0 16px;\n color: var(--vvd-color-on-canvas);\n}";
16
+ var css_248z = "/*\n Do not edit directly\n Generated on Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.breadcrumb-item {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: flex;\n align-items: center;\n color: var(--vvd-color-neutral-70);\n}\n.breadcrumb-item a {\n color: var(--vvd-color-cta-70);\n font: inherit;\n text-decoration: none;\n}\n.breadcrumb-item a:hover {\n text-decoration: underline;\n}\n.breadcrumb-item vwc-icon {\n margin: 0 16px;\n color: var(--vvd-color-on-canvas);\n}";
12
17
  styleInject(css_248z);
13
18
 
14
- class BreadcrumbItem extends TextAnchor {
19
+ class BreadcrumbItem extends BreadcrumbItem$1 {
15
20
  constructor() {
16
21
  super();
17
- this.separator = true;
22
+ this.text = '';
18
23
  }
19
24
 
20
25
  }
21
26
 
22
- __decorate([observable, __metadata("design:type", Boolean)], BreadcrumbItem.prototype, "separator", void 0);
27
+ __decorate([attr({
28
+ mode: 'fromView'
29
+ }), __metadata("design:type", String)], BreadcrumbItem.prototype, "text", void 0);
23
30
 
24
31
  let _2 = t => t,
25
32
  _t,
@@ -36,7 +43,7 @@ const BreadcrumbItemTemplate = (context, definition) => html(_t || (_t = _2`
36
43
  ${0}
37
44
 
38
45
  ${0}
39
- </div>`), getClasses, when(x => x.text && !x.href, html(_t2 || (_t2 = _2`${0}`), x => x.text)), when(x => x.text && x.href && x.href.length > 0, html(_t3 || (_t3 = _2`${0}`), textAnchorTemplate())), when(x => x.separator, html(_t4 || (_t4 = _2`<vwc-icon type="chevron-right-line"></vwc-icon>`))));
46
+ </div>`), getClasses, when(x => x.text && !x.href, html(_t2 || (_t2 = _2`${0}`), x => x.text)), when(x => x.text && x.href && x.href.length > 0, html(_t3 || (_t3 = _2`${0}`), textAnchorTemplate(context))), when(x => x.separator, html(_t4 || (_t4 = _2`<vwc-icon type="chevron-right-line"></vwc-icon>`))));
40
47
 
41
48
  const vividBreadcrumbItem = BreadcrumbItem.compose({
42
49
  baseName: 'breadcrumb-item',