@vonage/vivid 3.0.0-next.10 → 3.0.0-next.101

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 (207) hide show
  1. package/README.md +141 -4
  2. package/accordion/index.js +3 -12
  3. package/accordion-item/index.js +31 -38
  4. package/action-group/index.js +41 -0
  5. package/avatar/index.js +61 -0
  6. package/badge/index.js +17 -30
  7. package/banner/index.js +26 -111
  8. package/breadcrumb/index.js +21 -18
  9. package/breadcrumb-item/index.js +24 -20
  10. package/button/index.js +20 -757
  11. package/calendar/index.js +72 -67
  12. package/calendar-event/index.js +112 -0
  13. package/card/index.js +114 -0
  14. package/checkbox/index.js +179 -0
  15. package/dialog/index.js +230 -0
  16. package/divider/index.js +4 -0
  17. package/elevation/index.js +3 -31
  18. package/fab/index.js +100 -0
  19. package/focus/index.js +18 -3
  20. package/header/index.js +61 -0
  21. package/icon/index.js +11 -9
  22. package/index.js +64 -20
  23. package/layout/index.js +5 -15
  24. package/lib/accordion-item/accordion-item.d.ts +2 -2
  25. package/lib/accordion-item/index.d.ts +2 -1
  26. package/lib/action-group/action-group.d.ts +10 -0
  27. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  28. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  29. package/lib/avatar/avatar.d.ts +15 -0
  30. package/lib/avatar/avatar.template.d.ts +4 -0
  31. package/lib/avatar/index.d.ts +3 -0
  32. package/lib/badge/badge.d.ts +3 -5
  33. package/lib/badge/index.d.ts +1 -1
  34. package/lib/banner/banner.d.ts +1 -1
  35. package/lib/banner/banner.template.d.ts +0 -2
  36. package/lib/banner/index.d.ts +1 -0
  37. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  38. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  39. package/lib/breadcrumb-item/index.d.ts +1 -0
  40. package/lib/button/button.d.ts +4 -3
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +3 -1
  43. package/lib/calendar/index.d.ts +0 -1
  44. package/lib/calendar-event/calendar-event.d.ts +14 -0
  45. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  46. package/lib/calendar-event/index.d.ts +2 -0
  47. package/lib/card/card.d.ts +10 -0
  48. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  49. package/lib/card/index.d.ts +4 -0
  50. package/lib/checkbox/checkbox.d.ts +5 -0
  51. package/lib/checkbox/checkbox.template.d.ts +4 -0
  52. package/lib/checkbox/index.d.ts +4 -0
  53. package/lib/components.d.ts +32 -10
  54. package/lib/dialog/dialog.d.ts +20 -0
  55. package/lib/dialog/dialog.template.d.ts +4 -0
  56. package/lib/dialog/index.d.ts +5 -0
  57. package/lib/divider/divider.d.ts +3 -0
  58. package/lib/divider/divider.template.d.ts +4 -0
  59. package/lib/divider/index.d.ts +2 -0
  60. package/lib/elevation/elevation.d.ts +1 -0
  61. package/lib/elevation/index.d.ts +1 -1
  62. package/lib/enums.d.ts +19 -6
  63. package/lib/fab/fab.d.ts +13 -0
  64. package/lib/fab/fab.template.d.ts +4 -0
  65. package/lib/fab/index.d.ts +4 -0
  66. package/lib/focus/index.d.ts +1 -1
  67. package/lib/header/header.d.ts +5 -0
  68. package/lib/header/header.template.d.ts +4 -0
  69. package/lib/header/index.d.ts +3 -0
  70. package/lib/icon/icon.d.ts +4 -3
  71. package/lib/layout/index.d.ts +1 -1
  72. package/lib/layout/layout.d.ts +4 -4
  73. package/lib/listbox/index.d.ts +4 -0
  74. package/lib/listbox/listbox.d.ts +9 -0
  75. package/lib/listbox/listbox.template.d.ts +4 -0
  76. package/lib/listbox-option/index.d.ts +4 -0
  77. package/lib/listbox-option/listbox-option.d.ts +9 -0
  78. package/lib/listbox-option/listbox-option.template.d.ts +4 -0
  79. package/lib/menu/index.d.ts +12 -0
  80. package/lib/menu/menu.d.ts +10 -0
  81. package/lib/menu/menu.template.d.ts +3 -0
  82. package/lib/menu-item/index.d.ts +3 -0
  83. package/lib/menu-item/menu-item.d.ts +7 -0
  84. package/lib/menu-item/menu-item.template.d.ts +5 -0
  85. package/lib/nav/index.d.ts +2 -0
  86. package/lib/nav/nav.d.ts +3 -0
  87. package/lib/nav/nav.template.d.ts +4 -0
  88. package/lib/nav-disclosure/index.d.ts +4 -0
  89. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  90. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  91. package/lib/nav-item/index.d.ts +4 -0
  92. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  93. package/lib/nav-item/nav-item.template.d.ts +4 -0
  94. package/lib/{text → note}/index.d.ts +1 -1
  95. package/lib/note/note.d.ts +10 -0
  96. package/lib/note/note.template.d.ts +5 -0
  97. package/lib/number-field/index.d.ts +4 -0
  98. package/lib/number-field/number-field.d.ts +14 -0
  99. package/lib/number-field/number-field.template.d.ts +4 -0
  100. package/lib/popup/index.d.ts +1 -1
  101. package/lib/popup/popup.d.ts +2 -1
  102. package/lib/progress/progress.d.ts +1 -1
  103. package/lib/progress-ring/progress-ring.d.ts +2 -1
  104. package/lib/radio/index.d.ts +3 -0
  105. package/lib/radio/radio.d.ts +4 -0
  106. package/lib/radio/radio.template.d.ts +4 -0
  107. package/lib/radio-group/index.d.ts +10 -0
  108. package/lib/radio-group/radio-group.d.ts +4 -0
  109. package/lib/radio-group/radio-group.template.d.ts +4 -0
  110. package/lib/side-drawer/index.d.ts +1 -1
  111. package/lib/side-drawer/side-drawer.d.ts +3 -2
  112. package/lib/slider/index.d.ts +3 -0
  113. package/lib/slider/slider.d.ts +4 -0
  114. package/lib/slider/slider.template.d.ts +4 -0
  115. package/lib/switch/index.d.ts +4 -0
  116. package/lib/switch/switch.d.ts +7 -0
  117. package/lib/switch/switch.template.d.ts +4 -0
  118. package/lib/text-anchor/text-anchor.d.ts +1 -1
  119. package/lib/text-area/index.d.ts +4 -0
  120. package/lib/text-area/text-area.d.ts +9 -0
  121. package/lib/text-area/text-area.template.d.ts +4 -0
  122. package/lib/text-field/index.d.ts +4 -0
  123. package/lib/text-field/text-field.d.ts +14 -0
  124. package/lib/text-field/text-field.template.d.ts +5 -0
  125. package/lib/tooltip/tooltip.d.ts +2 -2
  126. package/listbox/index.js +1090 -0
  127. package/listbox-option/index.js +22 -0
  128. package/menu/index.js +371 -0
  129. package/menu-item/index.js +21 -0
  130. package/nav/index.js +17 -0
  131. package/nav-disclosure/index.js +82 -0
  132. package/nav-item/index.js +46 -0
  133. package/note/index.js +59 -0
  134. package/number-field/index.js +461 -0
  135. package/package.json +61 -10
  136. package/popup/index.js +23 -2061
  137. package/progress/index.js +35 -36
  138. package/progress-ring/index.js +11 -11
  139. package/radio/index.js +47 -0
  140. package/radio-group/index.js +435 -0
  141. package/shared/affix.js +1 -6
  142. package/shared/anchor.js +10 -2
  143. package/shared/apply-mixins.js +5 -4
  144. package/shared/aria-global.js +2 -86
  145. package/shared/aria.js +9 -0
  146. package/shared/base-progress.js +5 -0
  147. package/shared/breadcrumb-item.js +1 -1
  148. package/shared/button.js +200 -0
  149. package/shared/calendar-event.js +19 -0
  150. package/shared/dialog-polyfill.esm.js +858 -0
  151. package/shared/direction.js +20 -0
  152. package/shared/dom.js +8 -0
  153. package/shared/enums.js +70 -0
  154. package/shared/es.object.assign.js +3 -2
  155. package/shared/es.regexp.to-string.js +59 -0
  156. package/shared/export.js +1017 -0
  157. package/shared/focus.js +5 -0
  158. package/shared/focus2.js +11 -0
  159. package/shared/form-associated.js +466 -0
  160. package/shared/form-elements.js +331 -0
  161. package/shared/icon.js +532 -564
  162. package/shared/index.js +108 -79
  163. package/shared/index2.js +100 -14
  164. package/shared/index3.js +31 -0
  165. package/shared/index4.js +77 -0
  166. package/shared/index5.js +261 -0
  167. package/shared/index6.js +1525 -0
  168. package/shared/index7.js +349 -0
  169. package/shared/iterators.js +61 -0
  170. package/shared/key-codes.js +97 -0
  171. package/shared/numbers.js +25 -0
  172. package/shared/object-keys.js +13 -0
  173. package/shared/patterns/focus.d.ts +3 -0
  174. package/shared/patterns/form-elements/form-elements.d.ts +28 -0
  175. package/shared/patterns/form-elements/index.d.ts +1 -0
  176. package/shared/patterns/index.d.ts +2 -0
  177. package/shared/radio.js +127 -0
  178. package/shared/ref.js +41 -0
  179. package/shared/slotted.js +1 -1
  180. package/shared/start-end.js +50 -0
  181. package/shared/string-trim.js +40 -0
  182. package/shared/text-anchor.js +2 -13
  183. package/shared/text-anchor.template.js +6 -5
  184. package/shared/to-string.js +51 -0
  185. package/shared/web.dom-collections.iterator.js +74 -1081
  186. package/side-drawer/index.js +41 -33
  187. package/slider/index.js +596 -0
  188. package/styles/core/all.css +75 -0
  189. package/styles/core/theme.css +11 -0
  190. package/styles/core/typography.css +69 -0
  191. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  192. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  193. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  194. package/styles/fonts/spezia.css +9 -12
  195. package/styles/tokens/theme-dark.css +230 -0
  196. package/styles/tokens/theme-light.css +230 -0
  197. package/switch/index.js +153 -0
  198. package/text-anchor/index.js +10 -1
  199. package/text-area/index.js +289 -0
  200. package/text-field/index.js +130 -0
  201. package/tooltip/index.js +24 -24
  202. package/lib/text/text.d.ts +0 -10
  203. package/shared/style-inject.es.js +0 -28
  204. package/sidenav-item/index.js +0 -38
  205. package/styles/themes/dark.css +0 -205
  206. package/styles/themes/light.css +0 -205
  207. package/text/index.js +0 -45
@@ -0,0 +1,179 @@
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
4
+ import '../shared/web.dom-collections.iterator.js';
5
+ import { C as CheckableFormAssociated } from '../shared/form-associated.js';
6
+ import { a as keySpace$1 } from '../shared/key-codes.js';
7
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
8
+ import { I as Icon } from '../shared/icon.js';
9
+ import { w as when } from '../shared/when.js';
10
+ import { c as classNames } from '../shared/class-names.js';
11
+ import '../shared/export.js';
12
+ import '../shared/iterators.js';
13
+ import '../shared/to-string.js';
14
+ import '../shared/string-trim.js';
15
+ import '../shared/_has.js';
16
+ import '../shared/focus.js';
17
+ import '../shared/object-keys.js';
18
+
19
+ class _Checkbox extends FoundationElement {
20
+ }
21
+ /**
22
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
23
+ *
24
+ * @internal
25
+ */
26
+ class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
27
+ constructor() {
28
+ super(...arguments);
29
+ this.proxy = document.createElement("input");
30
+ }
31
+ }
32
+
33
+ /**
34
+ * A Checkbox Custom HTML Element.
35
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
36
+ *
37
+ * @slot checked-indicator - The checked indicator
38
+ * @slot indeterminate-indicator - The indeterminate indicator
39
+ * @slot - The default slot for the label
40
+ * @csspart control - The element representing the visual checkbox control
41
+ * @csspart label - The label
42
+ * @fires change - Emits a custom change event when the checked state changes
43
+ *
44
+ * @public
45
+ */
46
+ class Checkbox$1 extends FormAssociatedCheckbox {
47
+ constructor() {
48
+ super();
49
+ /**
50
+ * The element's value to be included in form submission when checked.
51
+ * Default to "on" to reach parity with input[type="checkbox"]
52
+ *
53
+ * @internal
54
+ */
55
+ this.initialValue = "on";
56
+ /**
57
+ * The indeterminate state of the control
58
+ */
59
+ this.indeterminate = false;
60
+ /**
61
+ * @internal
62
+ */
63
+ this.keypressHandler = (e) => {
64
+ if (this.readOnly) {
65
+ return;
66
+ }
67
+ switch (e.key) {
68
+ case keySpace$1:
69
+ if (this.indeterminate) {
70
+ this.indeterminate = false;
71
+ }
72
+ this.checked = !this.checked;
73
+ break;
74
+ }
75
+ };
76
+ /**
77
+ * @internal
78
+ */
79
+ this.clickHandler = (e) => {
80
+ if (!this.disabled && !this.readOnly) {
81
+ if (this.indeterminate) {
82
+ this.indeterminate = false;
83
+ }
84
+ this.checked = !this.checked;
85
+ }
86
+ };
87
+ this.proxy.setAttribute("type", "checkbox");
88
+ }
89
+ readOnlyChanged() {
90
+ if (this.proxy instanceof HTMLInputElement) {
91
+ this.proxy.readOnly = this.readOnly;
92
+ }
93
+ }
94
+ }
95
+ __decorate([
96
+ attr({ attribute: "readonly", mode: "boolean" })
97
+ ], Checkbox$1.prototype, "readOnly", void 0);
98
+ __decorate([
99
+ observable
100
+ ], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
101
+ __decorate([
102
+ observable
103
+ ], Checkbox$1.prototype, "indeterminate", void 0);
104
+
105
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 16 Nov 2022 09:48:51 GMT\n */\n.base {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n vertical-align: middle;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:checked, .checked):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-500);\n}\n@supports selector(:focus-visible) {\n .base:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n}\n\n.control {\n position: relative;\n display: flex;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 3px;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n}\n\n.indicator {\n font-size: 16px;\n}\n.base:not(.checked) .indicator.checkmark {\n display: none;\n}\n\n.base:not(.indeterminate) .indicator.minus, .base.checked .indicator.minus {\n display: none;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 6px;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}";
106
+
107
+ const keySpace = ' ';
108
+ class Checkbox extends Checkbox$1 {
109
+ constructor() {
110
+ super(...arguments);
111
+ this.keypressHandler = e => {
112
+ switch (e.key) {
113
+ case keySpace:
114
+ if (this.indeterminate) {
115
+ this.indeterminate = false;
116
+ }
117
+ this.checked = !this.checked;
118
+ break;
119
+ }
120
+ };
121
+ this.clickHandler = () => {
122
+ if (!this.disabled && !this.readOnly) {
123
+ if (this.indeterminate) {
124
+ this.indeterminate = false;
125
+ }
126
+ this.checked = !this.checked;
127
+ }
128
+ };
129
+ }
130
+ }
131
+ __decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
132
+
133
+ let _ = t => t,
134
+ _t,
135
+ _t2,
136
+ _t3,
137
+ _t4;
138
+ const getClasses = ({
139
+ readOnly,
140
+ checked,
141
+ disabled,
142
+ indeterminate
143
+ }) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked) || Boolean(indeterminate)], ['disabled', Boolean(disabled)]);
144
+ const CheckboxTemplate = context => {
145
+ const focusTemplate = focusTemplateFactory(context);
146
+ const iconTag = context.tagFor(Icon);
147
+ return html(_t || (_t = _`<span
148
+ role="checkbox"
149
+ aria-checked="${0}"
150
+ aria-required="${0}"
151
+ aria-disabled="${0}"
152
+ aria-readonly="${0}"
153
+ tabindex="${0}"
154
+ @keypress="${0}"
155
+ @click="${0}"
156
+ class="${0}"
157
+ >
158
+ <div class="control">
159
+ ${0}
160
+ ${0}
161
+ ${0}
162
+ </div>
163
+
164
+ ${0}
165
+
166
+ </span>`), x => x.checked, x => x.required, x => x.disabled, x => x.readOnly, x => x.disabled ? null : 0, (x, c) => x.keypressHandler(c.event), x => x.clickHandler(), getClasses, when(x => x.checked, html(_t2 || (_t2 = _`<${0} type="check-solid"></${0}>`), iconTag, iconTag)), when(x => x.indeterminate, html(_t3 || (_t3 = _`<${0} type="minus-solid"></${0}>`), iconTag, iconTag)), () => focusTemplate, when(x => x.label, html(_t4 || (_t4 = _`<label>${0}</label>`), x => x.label)));
167
+ };
168
+
169
+ const vividCheckbox = Checkbox.compose({
170
+ baseName: 'checkbox',
171
+ template: CheckboxTemplate,
172
+ styles: css_248z,
173
+ shadowOptions: {
174
+ delegatesFocus: true
175
+ }
176
+ });
177
+ designSystem.register(vividCheckbox());
178
+
179
+ export { vividCheckbox };
@@ -0,0 +1,230 @@
1
+ import '../icon/index.js';
2
+ import '../shared/index2.js';
3
+ import '../shared/index3.js';
4
+ import { F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, j as __classPrivateFieldSet, h as html, d as designSystem } from '../shared/index.js';
5
+ import '../shared/icon.js';
6
+ import '../shared/web.dom-collections.iterator.js';
7
+ import { w as when } from '../shared/when.js';
8
+ import { c as classNames } from '../shared/class-names.js';
9
+ import '../shared/export.js';
10
+ import '../shared/iterators.js';
11
+ import '../shared/to-string.js';
12
+ import '../shared/string-trim.js';
13
+ import '../shared/_has.js';
14
+ import '../focus/index.js';
15
+ import '../shared/focus.js';
16
+ import '../shared/affix.js';
17
+ import '../shared/button.js';
18
+ import '../shared/apply-mixins.js';
19
+ import '../shared/form-associated.js';
20
+ import '../shared/key-codes.js';
21
+ import '../shared/aria-global.js';
22
+ import '../shared/start-end.js';
23
+ import '../shared/ref.js';
24
+ import '../shared/focus2.js';
25
+ import '../shared/object-keys.js';
26
+
27
+ var css_248z$1 = "dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: -webkit-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: -webkit-fit-content;\n height: fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black;\n display: block;\n}\n\ndialog:not([open]) {\n display: none;\n}\n\ndialog + .backdrop {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background: rgba(0,0,0,0.1);\n}\n\n._dialog_overlay {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n}\n\ndialog.fixed {\n position: fixed;\n top: 50%;\n transform: translate(0, -50%);\n}";
28
+
29
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 16 Nov 2022 09:48:51 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n max-block-size: var(--dialog-max-block-size, calc(100vh - 64px));\n max-inline-size: var(--dialog-max-inline-size);\n min-inline-size: var(--dialog-min-inline-size, 280px);\n overflow-x: hidden;\n overflow-y: auto;\n}\n@media not all and (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n\n.main-wrapper {\n display: flex;\n flex-direction: column;\n padding: 24px;\n gap: 8px;\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 4px;\n inline-size: 100%;\n}\n\n.dismiss-button {\n flex-shrink: 0;\n margin-top: -8px;\n margin-right: -8px;\n}\n\n.headline {\n font: var(--vvd-typography-heading-4);\n}\n.headline-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n row-gap: 24px;\n}\n\n.content {\n font: var(--vvd-typography-base);\n}";
30
+
31
+ var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
32
+ let dialogPolyfill;
33
+ (async () => {
34
+ if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
35
+ delete window.HTMLDialogElement;
36
+ dialogPolyfill = await import('../shared/dialog-polyfill.esm.js');
37
+ }
38
+ })();
39
+ class Dialog extends FoundationElement {
40
+ constructor() {
41
+ super(...arguments);
42
+ _Dialog_instances.add(this);
43
+ this.open = false;
44
+ this.ariaLabelledBy = null;
45
+ this.ariaLabel = null;
46
+ this.ariaDescribedBy = null;
47
+ _Dialog_modal.set(this, false);
48
+ _Dialog_dialogElement.set(this, void 0);
49
+ _Dialog_handleScrimClick.set(this, event => {
50
+ if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
51
+ return;
52
+ }
53
+ const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
54
+ const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
55
+ this.open = clickedInDialog;
56
+ });
57
+ _Dialog_handleInternalFormSubmit.set(this, event => {
58
+ if (event.target.method !== 'dialog') {
59
+ return;
60
+ }
61
+ this.open = false;
62
+ });
63
+ }
64
+ set returnValue(value) {
65
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
66
+ }
67
+ get returnValue() {
68
+ var _a;
69
+ return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
70
+ }
71
+ get modal() {
72
+ return __classPrivateFieldGet(this, _Dialog_modal, "f");
73
+ }
74
+ openChanged(oldValue, newValue) {
75
+ if (oldValue === undefined) {
76
+ return;
77
+ }
78
+ if (!newValue) {
79
+ this.close();
80
+ } else {
81
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
82
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
83
+ }
84
+ }
85
+ }
86
+ close() {
87
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
88
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
89
+ this.dispatchEvent(new CustomEvent('close', {
90
+ bubbles: true,
91
+ composed: true,
92
+ detail: this.returnValue
93
+ }));
94
+ }
95
+ this.open = false;
96
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
97
+ }
98
+ show() {
99
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
100
+ this.open = true;
101
+ }
102
+ showModal() {
103
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
104
+ this.open = true;
105
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
106
+ }
107
+ connectedCallback() {
108
+ super.connectedCallback();
109
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
110
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
111
+ }
112
+ disconnectedCallback() {
113
+ super.disconnectedCallback();
114
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
115
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
116
+ }
117
+ }
118
+ _Dialog_modal = new WeakMap(), _Dialog_dialogElement = new WeakMap(), _Dialog_handleScrimClick = new WeakMap(), _Dialog_handleInternalFormSubmit = new WeakMap(), _Dialog_instances = new WeakSet(), _Dialog_dialog_get = function _Dialog_dialog_get() {
119
+ if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
120
+ __classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
121
+ if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
122
+ __classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
123
+ if (dialogPolyfill) {
124
+ dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
125
+ }
126
+ }
127
+ }
128
+ return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
129
+ }, _Dialog_handleModal = function _Dialog_handleModal(show) {
130
+ __classPrivateFieldSet(this, _Dialog_modal, show, "f");
131
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
132
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
133
+ };
134
+ __decorate([attr({
135
+ mode: 'boolean'
136
+ }), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
137
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
138
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
139
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
140
+ __decorate([attr({
141
+ attribute: 'aria-labelledby'
142
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
143
+ __decorate([attr({
144
+ attribute: 'aria-label'
145
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
146
+ __decorate([attr({
147
+ attribute: 'aria-describedby'
148
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
149
+
150
+ let _2 = t => t,
151
+ _t,
152
+ _t2,
153
+ _t3,
154
+ _t4,
155
+ _t5;
156
+ const getClasses = _ => classNames('base');
157
+ function icon() {
158
+ return html(_t || (_t = _2`
159
+ <vwc-icon class="icon" size="expanded" type="${0}"></vwc-icon>
160
+ `), x => x.icon);
161
+ }
162
+ function headline() {
163
+ return html(_t2 || (_t2 = _2`
164
+ <div class="headline">
165
+ ${0}
166
+ </div>
167
+ `), x => x.headline);
168
+ }
169
+ function renderDismissButton() {
170
+ return html(_t3 || (_t3 = _2`
171
+ <vwc-button
172
+ size="condensed"
173
+ class="dismiss-button"
174
+ icon="close-line"
175
+ @click="${0}">
176
+ </vwc-button>`), x => {
177
+ x.open = false;
178
+ });
179
+ }
180
+ function handleEscapeKey(dialog, event) {
181
+ if (event.key === 'Escape' && dialog.modal) {
182
+ dialog.open = false;
183
+ }
184
+ }
185
+ function content() {
186
+ return html(_t4 || (_t4 = _2`
187
+ <div class="content">
188
+ ${0}
189
+ </div>
190
+ `), x => x.text);
191
+ }
192
+ const DialogTemplate = () => html(_t5 || (_t5 = _2`
193
+ <vwc-elevation dp="12">
194
+ <div>
195
+ <dialog class="${0}"
196
+ @keydown="${0}"
197
+ returnValue="${0}"
198
+ aria-labelledby="${0}"
199
+ aria-label="${0}"
200
+ aria-describedby="${0}"
201
+ >
202
+ <slot name="main">
203
+ <div class="main-wrapper">
204
+ <div class="header">
205
+ <div class="headline-wrapper">
206
+ <slot name="graphic">
207
+ ${0}
208
+ </slot>
209
+ ${0}
210
+ </div>
211
+ ${0}
212
+ </div>
213
+ <slot name="content">
214
+ ${0}
215
+ </slot>
216
+ <slot name="footer"></slot>
217
+ </div>
218
+ </slot>
219
+ </dialog>
220
+ </div>
221
+ </vwc-elevation>`), getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon()), when(x => x.headline, headline()), renderDismissButton(), when(x => x.text, content()));
222
+
223
+ const vividDialog = Dialog.compose({
224
+ baseName: 'dialog',
225
+ template: DialogTemplate,
226
+ styles: [css_248z, css_248z$1]
227
+ });
228
+ designSystem.register(vividDialog());
229
+
230
+ export { vividDialog };
@@ -0,0 +1,4 @@
1
+ import '../shared/index.js';
2
+ export { v as vividDivider } from '../shared/index4.js';
3
+ import '../shared/aria.js';
4
+ import '../shared/class-names.js';
@@ -1,31 +1,3 @@
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
- class Elevation extends FoundationElement {}
6
-
7
- __decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
8
-
9
- var css_248z = ".control.dp-0 ::slotted(*) {\n background-color: var(--vvd-color-surface-0dp);\n filter: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-2 ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}\n.control.dp-4 ::slotted(*) {\n background-color: var(--vvd-color-surface-4dp);\n filter: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 ::slotted(*) {\n background-color: var(--vvd-color-surface-8dp);\n filter: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 ::slotted(*) {\n background-color: var(--vvd-color-surface-12dp);\n filter: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 ::slotted(*) {\n background-color: var(--vvd-color-surface-16dp);\n filter: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 ::slotted(*) {\n background-color: var(--vvd-color-surface-24dp);\n filter: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}";
10
- styleInject(css_248z);
11
-
12
- let _ = t => t,
13
- _t;
14
-
15
- const getClasses = ({
16
- dp
17
- }) => classNames('control', [`dp-${dp}`, Boolean(dp)]);
18
-
19
- const elevationTemplate = () => html(_t || (_t = _`
20
- <div class="${0}" part="base">
21
- <slot></slot>
22
- </div>`), getClasses);
23
-
24
- const VIVIDElevation = Elevation.compose({
25
- baseName: 'elevation',
26
- template: elevationTemplate,
27
- styles: css_248z
28
- });
29
- designSystem.register(VIVIDElevation());
30
-
31
- export { VIVIDElevation };
1
+ import '../shared/index.js';
2
+ export { v as vividElevation } from '../shared/index3.js';
3
+ import '../shared/class-names.js';
package/fab/index.js ADDED
@@ -0,0 +1,100 @@
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
4
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
5
+ import { B as Button } from '../shared/button.js';
6
+ import { a as applyMixins } from '../shared/apply-mixins.js';
7
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
8
+ import { r as ref } from '../shared/ref.js';
9
+ import { c as classNames } from '../shared/class-names.js';
10
+ import '../shared/icon.js';
11
+ import '../shared/export.js';
12
+ import '../shared/iterators.js';
13
+ import '../shared/to-string.js';
14
+ import '../shared/string-trim.js';
15
+ import '../shared/_has.js';
16
+ import '../shared/when.js';
17
+ import '../shared/focus.js';
18
+ import '../shared/web.dom-collections.iterator.js';
19
+ import '../shared/object-keys.js';
20
+ import '../shared/form-associated.js';
21
+ import '../shared/key-codes.js';
22
+ import '../shared/aria-global.js';
23
+ import '../shared/start-end.js';
24
+
25
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 16 Nov 2022 09:48:51 GMT\n */\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background: var(--_appearance-color-fill, var(--_elevation-fill));\n block-size: var(--_fab-block-size);\n border-radius: var(--_fab-border-radius);\n color: var(--_appearance-color-text, var(--vvd-color-canvas-text));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\n font: var(--vvd-typography-base-bold);\n transition: background-color 0.15s linear, filter 0.15s linear;\n vertical-align: middle;\n /* Size */\n}\n.control.connotation-accent {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transparent;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control.size-Expanded {\n --_fab-border-radius: 30px;\n --_fab-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) + 16));\n}\n.control:not(.size-expanded) {\n --_fab-border-radius: 24px;\n --_fab-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1)));\n}\n.control.icon-only {\n border-radius: 50%;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--_fab-block-size);\n }\n}\n.control:not(.icon-only) {\n --fab-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:disabled {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n cursor: not-allowed;\n}\n.control:not(:disabled) {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n cursor: pointer;\n}\n.control:not(:disabled):hover {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control:not(:disabled):active {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n.size-expanded .icon {\n font-size: 24px;\n}\n.icon:not(.size-expanded) .icon {\n font-size: 20px;\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
26
+
27
+ class Fab extends Button {}
28
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
29
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "size", void 0);
30
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
31
+ applyMixins(Fab, AffixIconWithTrailing);
32
+
33
+ let _ = t => t,
34
+ _t;
35
+ const getClasses = ({
36
+ connotation,
37
+ size,
38
+ icon,
39
+ label,
40
+ iconTrailing,
41
+ disabled
42
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
43
+ const FabTemplate = context => {
44
+ const affixIconTemplate = affixIconTemplateFactory(context);
45
+ const focusTemplate = focusTemplateFactory(context);
46
+ return html(_t || (_t = _`
47
+ <button
48
+ class="${0} "
49
+ ?autofocus="${0}"
50
+ ?disabled="${0}"
51
+ form="${0}"
52
+ formaction="${0}"
53
+ formenctype="${0}"
54
+ formmethod="${0}"
55
+ formnovalidate="${0}"
56
+ formtarget="${0}"
57
+ name="${0}"
58
+ type="${0}"
59
+ value="${0}"
60
+ aria-atomic="${0}"
61
+ aria-busy="${0}"
62
+ aria-controls="${0}"
63
+ aria-current="${0}"
64
+ aria-describedby="${0}"
65
+ aria-details="${0}"
66
+ aria-disabled="${0}"
67
+ aria-errormessage="${0}"
68
+ aria-expanded="${0}"
69
+ aria-flowto="${0}"
70
+ aria-haspopup="${0}"
71
+ aria-hidden="${0}"
72
+ aria-invalid="${0}"
73
+ aria-keyshortcuts="${0}"
74
+ aria-label="${0}"
75
+ aria-labelledby="${0}"
76
+ aria-live="${0}"
77
+ aria-owns="${0}"
78
+ aria-pressed="${0}"
79
+ aria-relevant="${0}"
80
+ aria-roledescription="${0}"
81
+ ${0}
82
+ >
83
+ ${0}
84
+ ${0}
85
+ ${0}
86
+ </button>
87
+ `), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
88
+ };
89
+
90
+ const vividFab = Fab.compose({
91
+ baseName: 'fab',
92
+ template: FabTemplate,
93
+ styles: css_248z,
94
+ shadowOptions: {
95
+ delegatesFocus: true
96
+ }
97
+ });
98
+ designSystem.register(vividFab());
99
+
100
+ export { vividFab };
package/focus/index.js CHANGED
@@ -1,3 +1,18 @@
1
- import '../shared/index.js';
2
- export { V as VIVIDFocus } from '../shared/index2.js';
3
- import '../shared/style-inject.es.js';
1
+ import { h as html, d as designSystem } from '../shared/index.js';
2
+ import { F as Focus } from '../shared/focus.js';
3
+
4
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 16 Nov 2022 09:48:51 GMT\n */\n:host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n z-index: 1;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: var(--focus-inset, 0);\n outline: 2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));\n outline-offset: -2px;\n}";
5
+
6
+ let _ = t => t,
7
+ _t;
8
+ const focusTemplate = () => html(_t || (_t = _`
9
+ <span class="control"></span>`));
10
+
11
+ const vividFocus = Focus.compose({
12
+ baseName: 'focus',
13
+ template: focusTemplate,
14
+ styles: css_248z
15
+ });
16
+ designSystem.register(vividFocus());
17
+
18
+ export { vividFocus };
@@ -0,0 +1,61 @@
1
+ import { E as Elevation } from '../shared/index3.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 '../shared/web.dom-collections.iterator.js';
4
+ import { c as classNames } from '../shared/class-names.js';
5
+ import '../shared/export.js';
6
+ import '../shared/object-keys.js';
7
+ import '../shared/iterators.js';
8
+
9
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 16 Nov 2022 09:48:51 GMT\n */\n.base {\n z-index: 1;\n block-size: calc(calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1))) + calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 16)));\n font: var(--vvd-typography-heading-4);\n inline-size: 100%;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n\n.app-content {\n --vvd-header-block-size: calc(calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1))) + calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 16)));\n}";
10
+
11
+ class Header extends FoundationElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.elevationShadow = false;
15
+ this.alternate = false;
16
+ }
17
+ }
18
+ __decorate([attr({
19
+ attribute: 'elevation-shadow',
20
+ mode: 'boolean'
21
+ }), __metadata("design:type", Object)], Header.prototype, "elevationShadow", void 0);
22
+ __decorate([attr({
23
+ mode: 'boolean'
24
+ }), __metadata("design:type", Object)], Header.prototype, "alternate", void 0);
25
+
26
+ let _ = t => t,
27
+ _t;
28
+ const getPartAlternate = ({
29
+ alternate
30
+ }) => classNames(['vvd-theme-alternate', Boolean(alternate)]);
31
+ const headerTemplate = context => {
32
+ const elevationTag = context.tagFor(Elevation);
33
+ return html(_t || (_t = _`
34
+ <${0} dp="4" ?no-shadow=${0}>
35
+ <header class="base" part="base">
36
+ <!-- a container is needed to distinguish the surface background color of the
37
+ element from its shadow when applying elevation with alternate -->
38
+ <div class="container" part="${0}">
39
+ <section class="header-content">
40
+ <slot></slot>
41
+ </section>
42
+ <section class="header-content">
43
+ <slot name="action-items"></slot>
44
+ </section>
45
+ </div>
46
+ </header>
47
+ </${0}>
48
+ <div class="app-content">
49
+ <slot name="app-content"></slot>
50
+ </div>
51
+ `), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
52
+ };
53
+
54
+ const vividHeader = Header.compose({
55
+ baseName: 'header',
56
+ template: headerTemplate,
57
+ styles: css_248z
58
+ });
59
+ designSystem.register(vividHeader());
60
+
61
+ export { vividHeader };