@vonage/vivid 2.30.0 → 3.0.0-next.12

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 (114) hide show
  1. package/README.md +7 -0
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +120 -0
  4. package/badge/index.js +57 -0
  5. package/banner/index.js +214 -0
  6. package/breadcrumb/index.js +100 -0
  7. package/breadcrumb-item/index.js +53 -0
  8. package/button/index.js +754 -0
  9. package/calendar/index.js +1522 -0
  10. package/elevation/index.js +31 -0
  11. package/focus/index.js +3 -0
  12. package/icon/index.js +38 -0
  13. package/index.d.ts +2 -0
  14. package/index.js +33 -63
  15. package/layout/index.js +53 -0
  16. package/lib/accordion/accordion.d.ts +9 -0
  17. package/lib/accordion/accordion.template.d.ts +4 -0
  18. package/lib/accordion/index.d.ts +2 -0
  19. package/lib/accordion-item/accordion-item.d.ts +13 -0
  20. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  21. package/lib/accordion-item/index.d.ts +3 -0
  22. package/lib/badge/badge.d.ts +17 -0
  23. package/lib/badge/badge.template.d.ts +4 -0
  24. package/lib/badge/index.d.ts +3 -0
  25. package/lib/banner/banner.d.ts +20 -0
  26. package/lib/banner/banner.template.d.ts +6 -0
  27. package/lib/banner/index.d.ts +2 -0
  28. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  29. package/lib/breadcrumb/index.d.ts +2 -0
  30. package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -0
  31. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -0
  32. package/lib/breadcrumb-item/index.d.ts +3 -0
  33. package/lib/button/button.d.ts +17 -0
  34. package/lib/button/button.template.d.ts +4 -0
  35. package/lib/button/index.d.ts +21 -0
  36. package/lib/calendar/calendar.d.ts +11 -0
  37. package/lib/calendar/calendar.template.d.ts +4 -0
  38. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  39. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  40. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  41. package/lib/calendar/index.d.ts +3 -0
  42. package/lib/components.d.ts +16 -0
  43. package/lib/elevation/elevation.d.ts +4 -0
  44. package/lib/elevation/elevation.template.d.ts +4 -0
  45. package/lib/elevation/index.d.ts +2 -0
  46. package/lib/enums.d.ts +46 -0
  47. package/lib/focus/focus.d.ts +3 -0
  48. package/lib/focus/focus.template.d.ts +4 -0
  49. package/lib/focus/index.d.ts +2 -0
  50. package/lib/icon/icon.d.ts +11 -0
  51. package/lib/icon/icon.placeholder.d.ts +1 -0
  52. package/lib/icon/icon.template.d.ts +4 -0
  53. package/lib/icon/index.d.ts +2 -0
  54. package/lib/layout/index.d.ts +2 -0
  55. package/lib/layout/layout.d.ts +16 -0
  56. package/lib/layout/layout.template.d.ts +4 -0
  57. package/lib/popup/index.d.ts +4 -0
  58. package/lib/popup/popup.d.ts +17 -0
  59. package/lib/popup/popup.template.d.ts +4 -0
  60. package/lib/progress/index.d.ts +2 -0
  61. package/lib/progress/progress.d.ts +9 -0
  62. package/lib/progress/progress.template.d.ts +5 -0
  63. package/lib/progress-ring/index.d.ts +2 -0
  64. package/lib/progress-ring/progress-ring.d.ts +6 -0
  65. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  66. package/lib/side-drawer/index.d.ts +2 -0
  67. package/lib/side-drawer/side-drawer.d.ts +8 -0
  68. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  69. package/lib/sidenav-item/index.d.ts +3 -0
  70. package/lib/sidenav-item/sidenav-item.d.ts +6 -0
  71. package/lib/sidenav-item/sidenav-item.template.d.ts +4 -0
  72. package/lib/text/index.d.ts +2 -0
  73. package/lib/text/text.d.ts +10 -0
  74. package/lib/text/text.template.d.ts +4 -0
  75. package/lib/text-anchor/index.d.ts +2 -0
  76. package/lib/text-anchor/text-anchor.d.ts +7 -0
  77. package/lib/text-anchor/text-anchor.template.d.ts +4 -0
  78. package/lib/tooltip/index.d.ts +3 -0
  79. package/lib/tooltip/tooltip.d.ts +8 -0
  80. package/lib/tooltip/tooltip.template.d.ts +4 -0
  81. package/package.json +13 -317
  82. package/popup/index.js +2066 -0
  83. package/progress/index.js +99 -0
  84. package/progress-ring/index.js +76 -0
  85. package/shared/_has.js +58 -0
  86. package/shared/affix.js +29 -0
  87. package/shared/anchor.js +78 -0
  88. package/shared/apply-mixins.js +22 -0
  89. package/shared/aria-global.js +156 -0
  90. package/shared/base-progress.js +65 -0
  91. package/shared/breadcrumb-item.js +25 -0
  92. package/shared/class-names.js +15 -0
  93. package/shared/design-system/index.d.ts +3 -0
  94. package/shared/es.object.assign.js +69 -0
  95. package/shared/icon.js +1388 -0
  96. package/shared/index.js +4998 -0
  97. package/shared/index2.js +21 -0
  98. package/shared/object-set-prototype-of.js +1009 -0
  99. package/shared/patterns/affix.d.ts +9 -0
  100. package/shared/patterns/index.d.ts +1 -0
  101. package/shared/slotted.js +119 -0
  102. package/shared/style-inject.es.js +28 -0
  103. package/shared/text-anchor.js +12 -0
  104. package/shared/text-anchor.template.js +54 -0
  105. package/shared/web.dom-collections.iterator.js +473 -0
  106. package/shared/when.js +15 -0
  107. package/side-drawer/index.js +82 -0
  108. package/sidenav-item/index.js +39 -0
  109. package/styles/fonts/spezia.css +23 -0
  110. package/styles/themes/dark.css +205 -0
  111. package/styles/themes/light.css +205 -0
  112. package/text/index.js +46 -0
  113. package/text-anchor/index.js +20 -0
  114. package/tooltip/index.js +63 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # components
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test components` to execute the unit tests via [Jest](https://jestjs.io).
@@ -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,120 @@
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/object-set-prototype-of.js';
10
+ import '../shared/icon.js';
11
+ import '../shared/_has.js';
12
+
13
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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}";
14
+ styleInject(css_248z);
15
+
16
+ class AccordionItem extends FoundationElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.noIndicator = false;
20
+ this.open = false;
21
+ }
22
+
23
+ attributeChangedCallback(name, oldValue, newValue) {
24
+ super.attributeChangedCallback(name, oldValue, newValue);
25
+
26
+ if (name === 'open') {
27
+ newValue === null ? this.emitEvent('closed') : this.emitEvent('opened');
28
+ }
29
+ }
30
+
31
+ emitEvent(name) {
32
+ const init = {
33
+ bubbles: true,
34
+ composed: true
35
+ };
36
+ const ev = new CustomEvent(name, init);
37
+ this.dispatchEvent(ev);
38
+ }
39
+
40
+ }
41
+
42
+ __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "heading", void 0);
43
+
44
+ __decorate([attr({
45
+ attribute: 'heading-level'
46
+ }), __metadata("design:type", Number)], AccordionItem.prototype, "headingLevel", void 0);
47
+
48
+ __decorate([attr({
49
+ mode: 'boolean',
50
+ attribute: 'no-indicator'
51
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
52
+
53
+ __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "meta", void 0);
54
+
55
+ __decorate([attr({
56
+ mode: 'boolean'
57
+ }), __metadata("design:type", Object)], AccordionItem.prototype, "open", void 0);
58
+
59
+ applyMixins(AccordionItem, AffixIconWithTrailing);
60
+
61
+ let _ = t => t,
62
+ _t,
63
+ _t2,
64
+ _t3,
65
+ _t4,
66
+ _t5;
67
+ const PANEL = 'panel';
68
+
69
+ const getClasses = ({
70
+ open,
71
+ iconTrailing,
72
+ icon,
73
+ noIndicator
74
+ }) => classNames('control', ['open', open], ['icon', Boolean(icon)], ['icon-trailing', iconTrailing], ['no-indicator', noIndicator]);
75
+
76
+ const AccordionItemTemplate = context => html(_t || (_t = _`
77
+ <div class="${0}">
78
+ ${0}
79
+ <div class="body" id="${0}" role="region" aria-labelledby="header">
80
+ <slot></slot>
81
+ </div>
82
+ </div>
83
+ `), getClasses, x => renderPanelHeader(context, x.headingLevel), PANEL);
84
+
85
+ const renderPanelHeader = (context, headingLevel) => {
86
+ const header = headingLevel ? 'h' + headingLevel : 'h3';
87
+ return html(_t2 || (_t2 = _`
88
+ <${0} class="header">
89
+ ${0}
90
+ </${0}>
91
+ `), header, renderHeaderButton(context), header);
92
+ };
93
+
94
+ const renderHeaderButton = context => {
95
+ const affixIconTemplate = affixIconTemplateFactory(context);
96
+ return html(_t3 || (_t3 = _`
97
+ <button class="button" id="header" @click=${0}
98
+ ?aria-expanded=${0}
99
+ aria-controls="${0}">
100
+ ${0}
101
+ <span class="heading-text">${0}</span>
102
+ ${0}
103
+ <span class="indicator">
104
+ ${0}
105
+ </span>
106
+ </button>
107
+ `), 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 = _`
108
+ <vwc-icon class="toggle-open" type='chevron-down-solid'></vwc-icon>
109
+ <vwc-icon class="toggle-close" type='chevron-up-solid'></vwc-icon>
110
+ `))));
111
+ };
112
+
113
+ const vividAccordionItem = AccordionItem.compose({
114
+ baseName: 'accordion-item',
115
+ template: AccordionItemTemplate,
116
+ styles: css_248z
117
+ });
118
+ designSystem.register(vividAccordionItem());
119
+
120
+ export { vividAccordionItem };
package/badge/index.js ADDED
@@ -0,0 +1,57 @@
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
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
4
+ import { a as applyMixins } from '../shared/apply-mixins.js';
5
+ import { s as styleInject } from '../shared/style-inject.es.js';
6
+ import { c as classNames } from '../shared/class-names.js';
7
+ import '../shared/icon.js';
8
+ import '../shared/object-set-prototype-of.js';
9
+ import '../shared/_has.js';
10
+ import '../shared/when.js';
11
+ import '../shared/web.dom-collections.iterator.js';
12
+
13
+ class Badge extends FoundationElement {}
14
+
15
+ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "connotation", void 0);
16
+
17
+ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "shape", void 0);
18
+
19
+ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearance", void 0);
20
+
21
+ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "size", void 0);
22
+
23
+ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "text", void 0);
24
+
25
+ applyMixins(Badge, AffixIconWithTrailing);
26
+
27
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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-basis: var(--vvd-color-neutral);\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-basis: var(--vvd-color-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-basis: var(--vvd-color-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-basis: var(--vvd-color-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-basis: var(--vvd-color-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-basis: var(--vvd-color-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-duotone {\n --_appearance-color-text: var(--connotation-contrast);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--connotation-basis);\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}";
28
+ styleInject(css_248z);
29
+
30
+ let _ = t => t,
31
+ _t;
32
+
33
+ const getClasses = ({
34
+ connotation,
35
+ appearance,
36
+ shape,
37
+ size,
38
+ iconTrailing
39
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-trailing', iconTrailing]);
40
+
41
+ const badgeTemplate = context => {
42
+ const affixIconTemplate = affixIconTemplateFactory(context);
43
+ return html(_t || (_t = _`
44
+ <span class="${0}">
45
+ ${0}
46
+ ${0}
47
+ </span>`), getClasses, x => affixIconTemplate(x.icon), x => x.text);
48
+ };
49
+
50
+ const VIVIDBadge = Badge.compose({
51
+ baseName: 'badge',
52
+ template: badgeTemplate,
53
+ styles: css_248z
54
+ });
55
+ designSystem.register(VIVIDBadge());
56
+
57
+ export { VIVIDBadge };
@@ -0,0 +1,214 @@
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/object-set-prototype-of.js';
11
+ import '../shared/icon.js';
12
+ import '../shared/_has.js';
13
+ import '../icon/index.js';
14
+ import '../shared/index2.js';
15
+ import '../shared/aria-global.js';
16
+ import '../shared/text-anchor.js';
17
+ import '../shared/anchor.js';
18
+ import '../shared/text-anchor.template.js';
19
+
20
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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-firm: 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-firm: 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-firm: 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-firm: 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-firm: 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}";
21
+ styleInject(css_248z);
22
+
23
+ var Connotation;
24
+
25
+ (function (Connotation) {
26
+ Connotation["Primary"] = "primary";
27
+ Connotation["CTA"] = "cta";
28
+ Connotation["Success"] = "success";
29
+ Connotation["Alert"] = "alert";
30
+ Connotation["Warning"] = "warning";
31
+ Connotation["Info"] = "info";
32
+ Connotation["Announcement"] = "announcement";
33
+ })(Connotation || (Connotation = {}));
34
+
35
+ var ConnotationDecorative;
36
+
37
+ (function (ConnotationDecorative) {
38
+ ConnotationDecorative["Pacific"] = "pacific";
39
+ })(ConnotationDecorative || (ConnotationDecorative = {}));
40
+
41
+ var Shape;
42
+
43
+ (function (Shape) {
44
+ Shape["Rounded"] = "rounded";
45
+ Shape["Pill"] = "pill";
46
+ Shape["Circled"] = "circled";
47
+ Shape["Sharp"] = "sharp";
48
+ })(Shape || (Shape = {}));
49
+
50
+ var Appearance;
51
+
52
+ (function (Appearance) {
53
+ Appearance["Text"] = "text";
54
+ Appearance["Filled"] = "filled";
55
+ Appearance["Outlined"] = "outlined";
56
+ Appearance["Duotone"] = "duotone";
57
+ Appearance["Subtle"] = "subtle";
58
+ Appearance["Ghost"] = "ghost";
59
+ })(Appearance || (Appearance = {}));
60
+
61
+ var Size;
62
+
63
+ (function (Size) {
64
+ Size["BaseSmall"] = "base-small";
65
+ Size["Base"] = "base";
66
+ Size["BaseLarge"] = "base-large";
67
+ })(Size || (Size = {}));
68
+
69
+ var Position;
70
+
71
+ (function (Position) {
72
+ Position["Top"] = "TOP";
73
+ Position["Bottom"] = "BOTTOM";
74
+ Position["Start"] = "START";
75
+ Position["Center"] = "CENTER";
76
+ Position["End"] = "END";
77
+ })(Position || (Position = {}));
78
+
79
+ var Role;
80
+
81
+ (function (Role) {
82
+ Role["Status"] = "status";
83
+ Role["Alert"] = "alert";
84
+ })(Role || (Role = {}));
85
+
86
+ var AriaLive;
87
+
88
+ (function (AriaLive) {
89
+ AriaLive["Polite"] = "polite";
90
+ AriaLive["Assertive"] = "assertive";
91
+ })(AriaLive || (AriaLive = {}));
92
+
93
+ var _Banner_handleRemoveEnd, _Banner_closeOnKeyDown;
94
+ 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']]);
95
+
96
+ const defaultConnotation = (connotation = Connotation.Info) => connotationIconMap.get(connotation);
97
+
98
+ class Banner extends FoundationElement {
99
+ constructor() {
100
+ super(...arguments);
101
+ this.removable = false;
102
+
103
+ _Banner_handleRemoveEnd.set(this, () => {
104
+ this.$emit('vwc-banner:removed');
105
+ this.parentElement && this.parentElement.removeChild(this);
106
+ });
107
+
108
+ _Banner_closeOnKeyDown.set(this, e => {
109
+ if (e.key !== 'Escape' || !this.removable) {
110
+ return;
111
+ }
112
+
113
+ this.remove();
114
+ });
115
+ }
116
+
117
+ get conditionedIcon() {
118
+ var _a;
119
+
120
+ return (_a = this.icon) !== null && _a !== void 0 ? _a : defaultConnotation(this.connotation);
121
+ }
122
+
123
+ connectedCallback() {
124
+ super.connectedCallback();
125
+ this.addEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
126
+ }
127
+
128
+ disconnectedCallback() {
129
+ super.disconnectedCallback();
130
+ this.removeEventListener('keydown', __classPrivateFieldGet(this, _Banner_closeOnKeyDown, "f"));
131
+ }
132
+
133
+ remove() {
134
+ this.$emit('vwc-banner:removing');
135
+ const banner = this.shadowRoot && this.shadowRoot.querySelector('.banner');
136
+
137
+ if (banner) {
138
+ banner.classList.add('removing');
139
+ banner.addEventListener('transitionend', __classPrivateFieldGet(this, _Banner_handleRemoveEnd, "f"));
140
+ }
141
+ }
142
+
143
+ }
144
+ _Banner_handleRemoveEnd = new WeakMap(), _Banner_closeOnKeyDown = new WeakMap();
145
+
146
+ __decorate([attr({
147
+ attribute: 'action-href'
148
+ }), __metadata("design:type", Object)], Banner.prototype, "actionHref", void 0);
149
+
150
+ __decorate([attr({
151
+ attribute: 'action-text'
152
+ }), __metadata("design:type", Object)], Banner.prototype, "actionText", void 0);
153
+
154
+ __decorate([attr({
155
+ mode: 'boolean'
156
+ }), __metadata("design:type", Object)], Banner.prototype, "removable", void 0);
157
+
158
+ __decorate([attr({
159
+ attribute: 'aria-live'
160
+ }), __metadata("design:type", Object)], Banner.prototype, "ariaLive", void 0);
161
+
162
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "role", void 0);
163
+
164
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "text", void 0);
165
+
166
+ __decorate([attr(), __metadata("design:type", Object)], Banner.prototype, "connotation", void 0);
167
+
168
+ applyMixins(Banner, AffixIcon);
169
+
170
+ let _2 = t => t,
171
+ _t,
172
+ _t2;
173
+
174
+ const getClasses = _ => classNames('control', [`connotation-${_.connotation}`, !!_.connotation]);
175
+
176
+ function renderDismissButton() {
177
+ return html(_t || (_t = _2`
178
+ <vwc-button
179
+ size="base-small"
180
+ class="dismiss-button"
181
+ icon="close-line"
182
+ @click="${0}">
183
+ </vwc-button>`), x => x.remove());
184
+ }
185
+
186
+ const BannerTemplate = context => {
187
+ const affixIconTemplate = affixIconTemplateFactory(context);
188
+ return html(_t2 || (_t2 = _2`
189
+ <div class="banner ${0}" tabindex="0">
190
+ <header class="header">
191
+ <div class="user-content">
192
+ ${0}
193
+ <div class="banner--message"
194
+ role="${0}"
195
+ aria-live="${0}">
196
+ ${0}
197
+ </div>
198
+ <slot class="action-items" name="actionItems"></slot>
199
+ </div>
200
+
201
+ ${0}
202
+ </header>
203
+ </div>
204
+ `), 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()));
205
+ };
206
+
207
+ const vividBanner = Banner.compose({
208
+ baseName: 'banner',
209
+ template: BannerTemplate,
210
+ styles: css_248z
211
+ });
212
+ designSystem.register(vividBanner());
213
+
214
+ 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 };
@@ -0,0 +1,53 @@
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';
3
+ import { s as styleInject } from '../shared/style-inject.es.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';
7
+ import { c as classNames } from '../shared/class-names.js';
8
+ import '../shared/icon.js';
9
+ import '../shared/object-set-prototype-of.js';
10
+ import '../shared/_has.js';
11
+ import '../shared/anchor.js';
12
+ import '../shared/apply-mixins.js';
13
+ import '../shared/aria-global.js';
14
+ import '../shared/affix.js';
15
+ import '../shared/web.dom-collections.iterator.js';
16
+
17
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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-on-canvas);\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-neutral-70);\n font-size: 12px;\n}";
18
+ styleInject(css_248z);
19
+
20
+ class BreadcrumbItem extends BreadcrumbItem$1 {
21
+ constructor() {
22
+ super();
23
+ }
24
+
25
+ }
26
+
27
+ __decorate([attr, __metadata("design:type", String)], BreadcrumbItem.prototype, "text", void 0);
28
+
29
+ let _2 = t => t,
30
+ _t,
31
+ _t2,
32
+ _t3,
33
+ _t4;
34
+
35
+ const getClasses = _ => classNames('control', 'breadcrumb-item');
36
+
37
+ const BreadcrumbItemTemplate = (context, definition) => html(_t || (_t = _2`
38
+ <div roll="listitem" part="listitem" class="${0}">
39
+ ${0}
40
+
41
+ ${0}
42
+
43
+ ${0}
44
+ </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-solid"></vwc-icon>`))));
45
+
46
+ const vividBreadcrumbItem = BreadcrumbItem.compose({
47
+ baseName: 'breadcrumb-item',
48
+ template: BreadcrumbItemTemplate,
49
+ styles: css_248z
50
+ });
51
+ designSystem.register(vividBreadcrumbItem());
52
+
53
+ export { vividBreadcrumbItem };