@xplortech/apollo-core 1.0.0-beta.3 → 1.0.0-beta.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 (158) hide show
  1. package/build/style.css +10 -10
  2. package/dist/apollo-core/apollo-core.css +5841 -9
  3. package/dist/apollo-core/apollo-core.esm.js +125 -1
  4. package/dist/apollo-core/app-globals-0f993ce5.js +3 -0
  5. package/dist/apollo-core/css-shim-bbdf0cc6.js +4 -0
  6. package/dist/apollo-core/dom-1f98a75f.js +73 -0
  7. package/dist/apollo-core/index-5b4a209e.js +2938 -0
  8. package/dist/apollo-core/index-912d1a21.js +584 -0
  9. package/dist/apollo-core/index.esm.js +1 -0
  10. package/dist/apollo-core/p-25f84d39.entry.js +1 -0
  11. package/dist/apollo-core/{p-13e7d3ea.entry.js → p-50eb8239.entry.js} +1 -1
  12. package/dist/apollo-core/regular-133c23b5.js +16052 -0
  13. package/dist/apollo-core/shadow-css-67b66845.js +389 -0
  14. package/dist/apollo-core/xpl-application-shell.entry.js +60 -0
  15. package/dist/apollo-core/xpl-avatar.entry.js +19 -0
  16. package/dist/apollo-core/xpl-backdrop.entry.js +21 -0
  17. package/dist/apollo-core/xpl-badge.entry.js +17 -0
  18. package/dist/apollo-core/xpl-breadcrumb-item.entry.js +17 -0
  19. package/dist/apollo-core/xpl-breadcrumbs.entry.js +12 -0
  20. package/dist/apollo-core/xpl-button-row.entry.js +18 -0
  21. package/dist/apollo-core/xpl-button.entry.js +60 -0
  22. package/dist/apollo-core/xpl-checkbox.entry.js +25 -0
  23. package/dist/apollo-core/xpl-choicelist.entry.js +39 -0
  24. package/dist/apollo-core/xpl-content-area.entry.js +16 -0
  25. package/dist/apollo-core/xpl-divider.entry.js +14 -0
  26. package/dist/apollo-core/xpl-dropdown-group.entry.js +31 -0
  27. package/dist/apollo-core/xpl-dropdown-heading.entry.js +12 -0
  28. package/dist/apollo-core/xpl-dropdown-option.entry.js +61 -0
  29. package/dist/apollo-core/xpl-dropdown.entry.js +104 -0
  30. package/dist/apollo-core/xpl-grid-item.entry.js +21 -0
  31. package/dist/apollo-core/xpl-grid.entry.js +31 -0
  32. package/dist/apollo-core/xpl-input.entry.js +2547 -0
  33. package/dist/apollo-core/xpl-list.entry.js +57 -0
  34. package/dist/apollo-core/xpl-main-nav.entry.js +26 -0
  35. package/dist/apollo-core/xpl-nav-item.entry.js +26 -0
  36. package/dist/apollo-core/xpl-pagination.entry.js +72 -0
  37. package/dist/apollo-core/xpl-radio.entry.js +25 -0
  38. package/dist/apollo-core/xpl-secondary-nav.entry.js +12 -0
  39. package/dist/apollo-core/xpl-select.entry.js +662 -0
  40. package/dist/apollo-core/xpl-table.entry.js +91 -0
  41. package/dist/apollo-core/xpl-tag.entry.js +17 -0
  42. package/dist/apollo-core/xpl-toggle.entry.js +30 -0
  43. package/dist/apollo-core/xpl-utility-bar.entry.js +27 -0
  44. package/dist/cjs/apollo-core.cjs.js +112 -4
  45. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  46. package/dist/cjs/css-shim-a7379e2b.js +6 -0
  47. package/dist/cjs/dom-3e7d9c3b.js +75 -0
  48. package/dist/cjs/index-318d5fc7.js +586 -0
  49. package/dist/cjs/index-88e58962.js +2975 -0
  50. package/dist/cjs/index.cjs.js +1 -0
  51. package/dist/cjs/loader.cjs.js +18 -2
  52. package/dist/cjs/regular-503465f4.js +16054 -0
  53. package/dist/cjs/shadow-css-09555044.js +391 -0
  54. package/dist/cjs/xpl-application-shell.cjs.entry.js +8 -2
  55. package/dist/cjs/xpl-avatar.cjs.entry.js +23 -0
  56. package/dist/cjs/xpl-avatar_12.cjs.entry.js +6 -0
  57. package/dist/cjs/xpl-backdrop.cjs.entry.js +1 -1
  58. package/dist/cjs/xpl-badge.cjs.entry.js +21 -0
  59. package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +21 -0
  60. package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +16 -0
  61. package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
  62. package/dist/cjs/xpl-button.cjs.entry.js +64 -0
  63. package/dist/cjs/xpl-checkbox.cjs.entry.js +29 -0
  64. package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
  65. package/dist/cjs/xpl-content-area.cjs.entry.js +20 -0
  66. package/dist/cjs/xpl-divider.cjs.entry.js +1 -1
  67. package/dist/cjs/xpl-dropdown-group.cjs.entry.js +35 -0
  68. package/dist/cjs/xpl-dropdown-heading.cjs.entry.js +16 -0
  69. package/dist/cjs/xpl-dropdown-option.cjs.entry.js +65 -0
  70. package/dist/cjs/xpl-dropdown.cjs.entry.js +108 -0
  71. package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
  72. package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
  73. package/dist/cjs/xpl-input.cjs.entry.js +21 -4
  74. package/dist/cjs/xpl-list.cjs.entry.js +2 -2
  75. package/dist/cjs/xpl-main-nav.cjs.entry.js +1 -1
  76. package/dist/cjs/xpl-nav-item.cjs.entry.js +30 -0
  77. package/dist/cjs/xpl-pagination.cjs.entry.js +1 -1
  78. package/dist/cjs/xpl-radio.cjs.entry.js +29 -0
  79. package/dist/cjs/xpl-secondary-nav.cjs.entry.js +16 -0
  80. package/dist/cjs/xpl-select.cjs.entry.js +44 -3
  81. package/dist/cjs/xpl-table.cjs.entry.js +95 -0
  82. package/dist/cjs/xpl-tag.cjs.entry.js +21 -0
  83. package/dist/cjs/xpl-toggle.cjs.entry.js +3 -3
  84. package/dist/cjs/xpl-utility-bar.cjs.entry.js +31 -0
  85. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +31 -2
  86. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +27 -1
  87. package/dist/custom-elements/index.js +599 -4
  88. package/dist/esm/apollo-core.js +112 -4
  89. package/dist/esm/app-globals-0f993ce5.js +3 -0
  90. package/dist/esm/css-shim-bbdf0cc6.js +4 -0
  91. package/dist/esm/dom-1f98a75f.js +73 -0
  92. package/dist/esm/index-5b4a209e.js +2938 -0
  93. package/dist/esm/index-912d1a21.js +584 -0
  94. package/dist/esm/index.js +1 -1
  95. package/dist/esm/loader.js +18 -2
  96. package/dist/esm/regular-133c23b5.js +16052 -0
  97. package/dist/esm/shadow-css-67b66845.js +389 -0
  98. package/dist/esm/xpl-application-shell.entry.js +8 -2
  99. package/dist/esm/xpl-avatar.entry.js +19 -0
  100. package/dist/esm/xpl-avatar_12.entry.js +6 -0
  101. package/dist/esm/xpl-backdrop.entry.js +1 -1
  102. package/dist/esm/xpl-badge.entry.js +17 -0
  103. package/dist/esm/xpl-breadcrumb-item.entry.js +17 -0
  104. package/dist/esm/xpl-breadcrumbs.entry.js +12 -0
  105. package/dist/esm/xpl-button-row.entry.js +1 -1
  106. package/dist/esm/xpl-button.entry.js +60 -0
  107. package/dist/esm/xpl-checkbox.entry.js +25 -0
  108. package/dist/esm/xpl-choicelist.entry.js +1 -1
  109. package/dist/esm/xpl-content-area.entry.js +16 -0
  110. package/dist/esm/xpl-divider.entry.js +1 -1
  111. package/dist/esm/xpl-dropdown-group.entry.js +31 -0
  112. package/dist/esm/xpl-dropdown-heading.entry.js +12 -0
  113. package/dist/esm/xpl-dropdown-option.entry.js +61 -0
  114. package/dist/esm/xpl-dropdown.entry.js +104 -0
  115. package/dist/esm/xpl-grid-item.entry.js +1 -1
  116. package/dist/esm/xpl-grid.entry.js +1 -1
  117. package/dist/esm/xpl-input.entry.js +20 -3
  118. package/dist/esm/xpl-list.entry.js +2 -2
  119. package/dist/esm/xpl-main-nav.entry.js +1 -1
  120. package/dist/esm/xpl-nav-item.entry.js +26 -0
  121. package/dist/esm/xpl-pagination.entry.js +1 -1
  122. package/dist/esm/xpl-radio.entry.js +25 -0
  123. package/dist/esm/xpl-secondary-nav.entry.js +12 -0
  124. package/dist/esm/xpl-select.entry.js +43 -2
  125. package/dist/esm/xpl-table.entry.js +91 -0
  126. package/dist/esm/xpl-tag.entry.js +17 -0
  127. package/dist/esm/xpl-toggle.entry.js +2 -2
  128. package/dist/esm/xpl-utility-bar.entry.js +27 -0
  129. package/dist/stories/application-shell.stories.js +17 -8
  130. package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/application-shell.stories.d.ts +14 -5
  131. package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +6 -1
  132. package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +5 -0
  133. package/dist/types/components.d.ts +18 -0
  134. package/package.json +1 -1
  135. package/dist/apollo-core/p-97bdb450.entry.js +0 -1
  136. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
  137. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/backdrop.stories.d.ts +0 -0
  138. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
  139. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -0
  140. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/button-row.stories.d.ts +0 -0
  141. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/button.stories.d.ts +0 -0
  142. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/checkbox.stories.d.ts +0 -0
  143. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/choicelist.stories.d.ts +0 -0
  144. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/content-area.stories.d.ts +0 -0
  145. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/divider.stories.d.ts +0 -0
  146. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/dropdown.stories.d.ts +0 -0
  147. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/grid.stories.d.ts +0 -0
  148. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/input.stories.d.ts +0 -0
  149. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/list.stories.d.ts +0 -0
  150. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/main-nav.stories.d.ts +0 -0
  151. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
  152. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/radio.stories.d.ts +0 -0
  153. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -0
  154. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/select.stories.d.ts +0 -0
  155. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/table.stories.d.ts +0 -0
  156. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
  157. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/toggle.stories.d.ts +0 -0
  158. /package/dist/types/Users/{fernandogelin/Projects/apollo-admin/packages → roc/Sites}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
@@ -0,0 +1,389 @@
1
+ /*
2
+ Stencil Client Platform v2.8.0 | MIT Licensed | https://stenciljs.com
3
+ */
4
+ /**
5
+ * @license
6
+ * Copyright Google Inc. All Rights Reserved.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://angular.io/license
10
+ *
11
+ * This file is a port of shadowCSS from webcomponents.js to TypeScript.
12
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
13
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
14
+ */
15
+ const safeSelector = (selector) => {
16
+ const placeholders = [];
17
+ let index = 0;
18
+ let content;
19
+ // Replaces attribute selectors with placeholders.
20
+ // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
21
+ selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
22
+ const replaceBy = `__ph-${index}__`;
23
+ placeholders.push(keep);
24
+ index++;
25
+ return replaceBy;
26
+ });
27
+ // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
28
+ // WS and "+" would otherwise be interpreted as selector separators.
29
+ content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
30
+ const replaceBy = `__ph-${index}__`;
31
+ placeholders.push(exp);
32
+ index++;
33
+ return pseudo + replaceBy;
34
+ });
35
+ const ss = {
36
+ content,
37
+ placeholders,
38
+ };
39
+ return ss;
40
+ };
41
+ const restoreSafeSelector = (placeholders, content) => {
42
+ return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
43
+ };
44
+ const _polyfillHost = '-shadowcsshost';
45
+ const _polyfillSlotted = '-shadowcssslotted';
46
+ // note: :host-context pre-processed to -shadowcsshostcontext.
47
+ const _polyfillHostContext = '-shadowcsscontext';
48
+ const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
49
+ const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
50
+ const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
51
+ const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
52
+ const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
53
+ const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
54
+ const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
55
+ const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
56
+ const _polyfillHostRe = /-shadowcsshost/gim;
57
+ const _colonHostRe = /:host/gim;
58
+ const _colonSlottedRe = /::slotted/gim;
59
+ const _colonHostContextRe = /:host-context/gim;
60
+ const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
61
+ const stripComments = (input) => {
62
+ return input.replace(_commentRe, '');
63
+ };
64
+ const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
65
+ const extractCommentsWithHash = (input) => {
66
+ return input.match(_commentWithHashRe) || [];
67
+ };
68
+ const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
69
+ const _curlyRe = /([{}])/g;
70
+ const OPEN_CURLY = '{';
71
+ const CLOSE_CURLY = '}';
72
+ const BLOCK_PLACEHOLDER = '%BLOCK%';
73
+ const processRules = (input, ruleCallback) => {
74
+ const inputWithEscapedBlocks = escapeBlocks(input);
75
+ let nextBlockIndex = 0;
76
+ return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
77
+ const selector = m[2];
78
+ let content = '';
79
+ let suffix = m[4];
80
+ let contentPrefix = '';
81
+ if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
82
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
83
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
84
+ contentPrefix = '{';
85
+ }
86
+ const cssRule = {
87
+ selector,
88
+ content,
89
+ };
90
+ const rule = ruleCallback(cssRule);
91
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
92
+ });
93
+ };
94
+ const escapeBlocks = (input) => {
95
+ const inputParts = input.split(_curlyRe);
96
+ const resultParts = [];
97
+ const escapedBlocks = [];
98
+ let bracketCount = 0;
99
+ let currentBlockParts = [];
100
+ for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
101
+ const part = inputParts[partIndex];
102
+ if (part === CLOSE_CURLY) {
103
+ bracketCount--;
104
+ }
105
+ if (bracketCount > 0) {
106
+ currentBlockParts.push(part);
107
+ }
108
+ else {
109
+ if (currentBlockParts.length > 0) {
110
+ escapedBlocks.push(currentBlockParts.join(''));
111
+ resultParts.push(BLOCK_PLACEHOLDER);
112
+ currentBlockParts = [];
113
+ }
114
+ resultParts.push(part);
115
+ }
116
+ if (part === OPEN_CURLY) {
117
+ bracketCount++;
118
+ }
119
+ }
120
+ if (currentBlockParts.length > 0) {
121
+ escapedBlocks.push(currentBlockParts.join(''));
122
+ resultParts.push(BLOCK_PLACEHOLDER);
123
+ }
124
+ const strEscapedBlocks = {
125
+ escapedString: resultParts.join(''),
126
+ blocks: escapedBlocks,
127
+ };
128
+ return strEscapedBlocks;
129
+ };
130
+ const insertPolyfillHostInCssText = (selector) => {
131
+ selector = selector
132
+ .replace(_colonHostContextRe, _polyfillHostContext)
133
+ .replace(_colonHostRe, _polyfillHost)
134
+ .replace(_colonSlottedRe, _polyfillSlotted);
135
+ return selector;
136
+ };
137
+ const convertColonRule = (cssText, regExp, partReplacer) => {
138
+ // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
139
+ return cssText.replace(regExp, (...m) => {
140
+ if (m[2]) {
141
+ const parts = m[2].split(',');
142
+ const r = [];
143
+ for (let i = 0; i < parts.length; i++) {
144
+ const p = parts[i].trim();
145
+ if (!p)
146
+ break;
147
+ r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
148
+ }
149
+ return r.join(',');
150
+ }
151
+ else {
152
+ return _polyfillHostNoCombinator + m[3];
153
+ }
154
+ });
155
+ };
156
+ const colonHostPartReplacer = (host, part, suffix) => {
157
+ return host + part.replace(_polyfillHost, '') + suffix;
158
+ };
159
+ const convertColonHost = (cssText) => {
160
+ return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
161
+ };
162
+ const colonHostContextPartReplacer = (host, part, suffix) => {
163
+ if (part.indexOf(_polyfillHost) > -1) {
164
+ return colonHostPartReplacer(host, part, suffix);
165
+ }
166
+ else {
167
+ return host + part + suffix + ', ' + part + ' ' + host + suffix;
168
+ }
169
+ };
170
+ const convertColonSlotted = (cssText, slotScopeId) => {
171
+ const slotClass = '.' + slotScopeId + ' > ';
172
+ const selectors = [];
173
+ cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
174
+ if (m[2]) {
175
+ const compound = m[2].trim();
176
+ const suffix = m[3];
177
+ const slottedSelector = slotClass + compound + suffix;
178
+ let prefixSelector = '';
179
+ for (let i = m[4] - 1; i >= 0; i--) {
180
+ const char = m[5][i];
181
+ if (char === '}' || char === ',') {
182
+ break;
183
+ }
184
+ prefixSelector = char + prefixSelector;
185
+ }
186
+ const orgSelector = prefixSelector + slottedSelector;
187
+ const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
188
+ if (orgSelector.trim() !== addedSelector.trim()) {
189
+ const updatedSelector = `${addedSelector}, ${orgSelector}`;
190
+ selectors.push({
191
+ orgSelector,
192
+ updatedSelector,
193
+ });
194
+ }
195
+ return slottedSelector;
196
+ }
197
+ else {
198
+ return _polyfillHostNoCombinator + m[3];
199
+ }
200
+ });
201
+ return {
202
+ selectors,
203
+ cssText,
204
+ };
205
+ };
206
+ const convertColonHostContext = (cssText) => {
207
+ return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
208
+ };
209
+ const convertShadowDOMSelectors = (cssText) => {
210
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
211
+ };
212
+ const makeScopeMatcher = (scopeSelector) => {
213
+ const lre = /\[/g;
214
+ const rre = /\]/g;
215
+ scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
216
+ return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
217
+ };
218
+ const selectorNeedsScoping = (selector, scopeSelector) => {
219
+ const re = makeScopeMatcher(scopeSelector);
220
+ return !re.test(selector);
221
+ };
222
+ const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
223
+ // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
224
+ _polyfillHostRe.lastIndex = 0;
225
+ if (_polyfillHostRe.test(selector)) {
226
+ const replaceBy = `.${hostSelector}`;
227
+ return selector
228
+ .replace(_polyfillHostNoCombinatorRe, (_, selector) => {
229
+ return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
230
+ return before + replaceBy + colon + after;
231
+ });
232
+ })
233
+ .replace(_polyfillHostRe, replaceBy + ' ');
234
+ }
235
+ return scopeSelector + ' ' + selector;
236
+ };
237
+ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
238
+ const isRe = /\[is=([^\]]*)\]/g;
239
+ scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
240
+ const className = '.' + scopeSelector;
241
+ const _scopeSelectorPart = (p) => {
242
+ let scopedP = p.trim();
243
+ if (!scopedP) {
244
+ return '';
245
+ }
246
+ if (p.indexOf(_polyfillHostNoCombinator) > -1) {
247
+ scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
248
+ }
249
+ else {
250
+ // remove :host since it should be unnecessary
251
+ const t = p.replace(_polyfillHostRe, '');
252
+ if (t.length > 0) {
253
+ const matches = t.match(/([^:]*)(:*)(.*)/);
254
+ if (matches) {
255
+ scopedP = matches[1] + className + matches[2] + matches[3];
256
+ }
257
+ }
258
+ }
259
+ return scopedP;
260
+ };
261
+ const safeContent = safeSelector(selector);
262
+ selector = safeContent.content;
263
+ let scopedSelector = '';
264
+ let startIndex = 0;
265
+ let res;
266
+ const sep = /( |>|\+|~(?!=))\s*/g;
267
+ // If a selector appears before :host it should not be shimmed as it
268
+ // matches on ancestor elements and not on elements in the host's shadow
269
+ // `:host-context(div)` is transformed to
270
+ // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
271
+ // the `div` is not part of the component in the 2nd selectors and should not be scoped.
272
+ // Historically `component-tag:host` was matching the component so we also want to preserve
273
+ // this behavior to avoid breaking legacy apps (it should not match).
274
+ // The behavior should be:
275
+ // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
276
+ // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
277
+ // `:host-context(tag)`)
278
+ const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
279
+ // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
280
+ let shouldScope = !hasHost;
281
+ while ((res = sep.exec(selector)) !== null) {
282
+ const separator = res[1];
283
+ const part = selector.slice(startIndex, res.index).trim();
284
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
285
+ const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
286
+ scopedSelector += `${scopedPart} ${separator} `;
287
+ startIndex = sep.lastIndex;
288
+ }
289
+ const part = selector.substring(startIndex);
290
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
291
+ scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
292
+ // replace the placeholders with their original values
293
+ return restoreSafeSelector(safeContent.placeholders, scopedSelector);
294
+ };
295
+ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
296
+ return selector
297
+ .split(',')
298
+ .map((shallowPart) => {
299
+ if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
300
+ return shallowPart.trim();
301
+ }
302
+ if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
303
+ return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
304
+ }
305
+ else {
306
+ return shallowPart.trim();
307
+ }
308
+ })
309
+ .join(', ');
310
+ };
311
+ const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
312
+ return processRules(cssText, (rule) => {
313
+ let selector = rule.selector;
314
+ let content = rule.content;
315
+ if (rule.selector[0] !== '@') {
316
+ selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
317
+ }
318
+ else if (rule.selector.startsWith('@media') ||
319
+ rule.selector.startsWith('@supports') ||
320
+ rule.selector.startsWith('@page') ||
321
+ rule.selector.startsWith('@document')) {
322
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
323
+ }
324
+ const cssRule = {
325
+ selector: selector.replace(/\s{2,}/g, ' ').trim(),
326
+ content,
327
+ };
328
+ return cssRule;
329
+ });
330
+ };
331
+ const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
332
+ cssText = insertPolyfillHostInCssText(cssText);
333
+ cssText = convertColonHost(cssText);
334
+ cssText = convertColonHostContext(cssText);
335
+ const slotted = convertColonSlotted(cssText, slotScopeId);
336
+ cssText = slotted.cssText;
337
+ cssText = convertShadowDOMSelectors(cssText);
338
+ if (scopeId) {
339
+ cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
340
+ }
341
+ cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
342
+ cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
343
+ return {
344
+ cssText: cssText.trim(),
345
+ slottedSelectors: slotted.selectors,
346
+ };
347
+ };
348
+ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
349
+ const hostScopeId = scopeId + '-h';
350
+ const slotScopeId = scopeId + '-s';
351
+ const commentsWithHash = extractCommentsWithHash(cssText);
352
+ cssText = stripComments(cssText);
353
+ const orgSelectors = [];
354
+ if (commentOriginalSelector) {
355
+ const processCommentedSelector = (rule) => {
356
+ const placeholder = `/*!@___${orgSelectors.length}___*/`;
357
+ const comment = `/*!@${rule.selector}*/`;
358
+ orgSelectors.push({ placeholder, comment });
359
+ rule.selector = placeholder + rule.selector;
360
+ return rule;
361
+ };
362
+ cssText = processRules(cssText, (rule) => {
363
+ if (rule.selector[0] !== '@') {
364
+ return processCommentedSelector(rule);
365
+ }
366
+ else if (rule.selector.startsWith('@media') ||
367
+ rule.selector.startsWith('@supports') ||
368
+ rule.selector.startsWith('@page') ||
369
+ rule.selector.startsWith('@document')) {
370
+ rule.content = processRules(rule.content, processCommentedSelector);
371
+ return rule;
372
+ }
373
+ return rule;
374
+ });
375
+ }
376
+ const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
377
+ cssText = [scoped.cssText, ...commentsWithHash].join('\n');
378
+ if (commentOriginalSelector) {
379
+ orgSelectors.forEach(({ placeholder, comment }) => {
380
+ cssText = cssText.replace(placeholder, comment);
381
+ });
382
+ }
383
+ scoped.slottedSelectors.forEach((slottedSelector) => {
384
+ cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
385
+ });
386
+ return cssText;
387
+ };
388
+
389
+ export { scopeCss };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-e3c4bb97.js';
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
2
 
3
3
  const XplApplicationShell = class {
4
4
  constructor(hostRef) {
@@ -16,7 +16,7 @@ const XplApplicationShell = class {
16
16
  */
17
17
  this.navWidth = 'default';
18
18
  /**
19
- * @state {boolean} - Whether or not the main nav is open, updates when the nav-open envent is emitted.
19
+ * @state {boolean} - Whether or not the main nav is open, updates when the nav-open event is emitted.
20
20
  */
21
21
  this.navOpen = true;
22
22
  }
@@ -37,6 +37,12 @@ const XplApplicationShell = class {
37
37
  connectedCallback() {
38
38
  this.closeNavOnMobile();
39
39
  }
40
+ componentWillLoad() {
41
+ this.navOpen =
42
+ this.isNavOpenAtStartup !== undefined
43
+ ? this.isNavOpenAtStartup
44
+ : this.navOpen;
45
+ }
40
46
  render() {
41
47
  let applicationShellClasses = 'xpl-application-shell';
42
48
  if (this.withUtility)
@@ -0,0 +1,19 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ const XplAvatar = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.disabled = false;
7
+ }
8
+ render() {
9
+ let className = 'xpl-avatar';
10
+ if (this.size)
11
+ className += ` xpl-avatar--${this.size}`;
12
+ if (this.color)
13
+ className += ` xpl-avatar--${this.color}`;
14
+ const inner = (h("div", null, this.src ? (h("img", { alt: this.name, src: this.src })) : (h("div", { class: "xpl-avatar__placeholder" }, h("slot", null))), this.status && (h("div", { class: `xpl-avatar__dot--${this.status}` }))));
15
+ return (h(Host, null, this.href && !this.disabled ? (h("a", { href: this.href, class: className, target: this.target }, inner)) : this.href && this.disabled ? (h("div", { class: className + ' xpl-avatar--disabled' }, inner)) : (h("div", { class: className }, inner))));
16
+ }
17
+ };
18
+
19
+ export { XplAvatar as xpl_avatar };
@@ -299,6 +299,12 @@ const XplUtilityBar = class {
299
299
  this.open = !this.open;
300
300
  this.navOpen.emit(this.open);
301
301
  }
302
+ componentWillLoad() {
303
+ this.open =
304
+ this.isNavOpenAtStartup !== undefined
305
+ ? this.isNavOpenAtStartup
306
+ : this.open;
307
+ }
302
308
  render() {
303
309
  return (h(Host, null, h("nav", { "aria-label": "utility navigation bar", class: "xpl-utility-bar" }, this.navControl ? (h("div", null, h("button", { class: "xpl-utility-bar__nav-control", onClick: () => this.onNavToggle(), innerHTML: `${this.bars}` }), h("slot", { name: "aside" }))) : (h("slot", { name: "aside" })), h("slot", { name: "main" }))));
304
310
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-e3c4bb97.js';
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
2
 
3
3
  const XplBackdrop = class {
4
4
  constructor(hostRef) {
@@ -0,0 +1,17 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ const XplBadge = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ }
7
+ render() {
8
+ let className = 'xpl-badge';
9
+ if (this.dot)
10
+ className += ' xpl-badge--dot';
11
+ if (this.variant)
12
+ className += ' xpl-badge--' + this.variant;
13
+ return (h(Host, null, h("div", { class: className }, h("slot", null))));
14
+ }
15
+ };
16
+
17
+ export { XplBadge as xpl_badge };
@@ -0,0 +1,17 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ const XplBreadcrumbItem = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ // This is temporary as we still don't have a xpl-icon component. When that's created we should update this code.
7
+ this.chevron = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
8
+ <path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path>
9
+ </svg>
10
+ `;
11
+ }
12
+ render() {
13
+ return (h(Host, { class: "xpl-breadcrumb-item", role: "listitem" }, h("li", { role: "none" }, h("slot", null)), h("span", { innerHTML: `${this.chevron}` })));
14
+ }
15
+ };
16
+
17
+ export { XplBreadcrumbItem as xpl_breadcrumb_item };
@@ -0,0 +1,12 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ const XplBreadcrumbs = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ }
7
+ render() {
8
+ return (h(Host, null, h("nav", { class: "xpl-breadcrumbs", "aria-label": "Breadcrumb" }, h("ol", { role: "list" }, h("slot", null)))));
9
+ }
10
+ };
11
+
12
+ export { XplBreadcrumbs as xpl_breadcrumbs };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-e3c4bb97.js';
1
+ import { r as registerInstance, f as createEvent, h, e as Host } from './index-5b4a209e.js';
2
2
 
3
3
  const XplButtonRow = class {
4
4
  constructor(hostRef) {
@@ -0,0 +1,60 @@
1
+ import { r as registerInstance, h, e as Host, g as getElement } from './index-5b4a209e.js';
2
+
3
+ const XplButton = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ /**
7
+ * @property {"default" | "sm" | "xs"} - button size
8
+ */
9
+ this.size = 'default';
10
+ /**
11
+ * @property {"primary" | "secondary" | "subtle"} - button variant
12
+ */
13
+ this.variant = 'primary';
14
+ /**
15
+ * @property {"neutral" | "warning" | "success"} - button state (color) neutral=purple, success=green, warning=red
16
+ */
17
+ this.state = 'neutral';
18
+ }
19
+ componentDidRender() {
20
+ const attrs = this.el.attributes;
21
+ const dataAttrs = Object.keys(attrs)
22
+ .filter((k) => {
23
+ const propertyName = attrs[k].name;
24
+ if (propertyName) {
25
+ return (propertyName.includes('data-test') ||
26
+ propertyName.includes('aria-'));
27
+ }
28
+ return false;
29
+ })
30
+ .reduce((acc, k) => {
31
+ return Object.assign(Object.assign({}, acc), { [attrs[k].name]: attrs[k].value });
32
+ }, {});
33
+ const child = this.el.querySelector('button');
34
+ Object.keys(dataAttrs).forEach((k) => {
35
+ child.setAttribute(k, dataAttrs[k]);
36
+ this.el.removeAttribute(k);
37
+ });
38
+ }
39
+ render() {
40
+ let className = `xpl-button
41
+ xpl-button--${this.size}
42
+ xpl-button--${this.state}
43
+ xpl-button--${this.variant}`;
44
+ if (this.iconOnly)
45
+ className += ' xpl-button--icon-only';
46
+ if (this.fullWidth)
47
+ className += ' xpl-button--full-width';
48
+ if (this.link && this.disabled)
49
+ className += ' xpl-button--link-disabled';
50
+ return (h(Host, { class: className },
51
+ /**
52
+ * Conditionally render either an <slot> or <button> element
53
+ * depending on if there's an `link` or not
54
+ */
55
+ this.link ? (h("slot", null)) : (h("button", { disabled: this.disabled, name: this.name, type: this.type, value: this.value }, h("slot", null)))));
56
+ }
57
+ get el() { return getElement(this); }
58
+ };
59
+
60
+ export { XplButton as xpl_button };
@@ -0,0 +1,25 @@
1
+ import { r as registerInstance, f as createEvent, h, e as Host } from './index-5b4a209e.js';
2
+ import { v as v4 } from './index-912d1a21.js';
3
+
4
+ const XplCheckbox = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ this.checkboxChange = createEvent(this, "checkboxChange", 7);
8
+ this.id = v4();
9
+ }
10
+ render() {
11
+ return (h(Host, { class: {
12
+ 'xpl-checkbox-radio-container': true,
13
+ styled: this.styled,
14
+ disabled: this.disabled,
15
+ } }, h("input", { class: "xpl-checkbox", type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, onChange: () => this.checkboxChange.emit(this.input.checked), name: this.name, ref: (el) => (this.input = el), required: this.required, value: this.value }), h("label", { class: {
16
+ 'xpl-label': true,
17
+ 'xpl-label--disabled': this.disabled,
18
+ }, htmlFor: this.id }, h("slot", null), this.description && (h("small", { class: {
19
+ 'xpl-description': true,
20
+ 'xpl-description--disabled': this.disabled,
21
+ } }, this.description)))));
22
+ }
23
+ };
24
+
25
+ export { XplCheckbox as xpl_checkbox };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-e3c4bb97.js';
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
2
 
3
3
  const XplChoicelist = class {
4
4
  constructor(hostRef) {
@@ -0,0 +1,16 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ const XplContentArea = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ /**
7
+ * @property {string} size - The content-area size.
8
+ */
9
+ this.size = 'wide';
10
+ }
11
+ render() {
12
+ return (h(Host, null, h("main", { class: `xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}` }, h("div", { class: "xpl-content-area" }, h("slot", null)))));
13
+ }
14
+ };
15
+
16
+ export { XplContentArea as xpl_content_area };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-e3c4bb97.js';
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
2
 
3
3
  const XplDivider = class {
4
4
  constructor(hostRef) {
@@ -0,0 +1,31 @@
1
+ import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
2
+
3
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
4
+ var t = {};
5
+ for (var p in s)
6
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7
+ t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
9
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
11
+ t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
15
+ const XplDropdownGroup = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ }
19
+ render() {
20
+ const { groupName, options } = this;
21
+ const hasOptions = options && options.length;
22
+ const mappedOptions = hasOptions &&
23
+ options.map((_a) => {
24
+ var { groupName } = _a, properties = __rest(_a, ["groupName"]);
25
+ return groupName ? (h("xpl-dropdown-group", Object.assign({ label: groupName }, properties))) : (h("xpl-dropdown-option", Object.assign({}, properties)));
26
+ });
27
+ return (h(Host, { role: "group", "aria-label": groupName }, h("li", { class: "xpl-dropdown-list-item" }, h("xpl-dropdown-heading", { label: groupName }), h("ul", { class: "xpl-dropdown-list" }, mappedOptions || h("slot", { name: "options" })))));
28
+ }
29
+ };
30
+
31
+ export { XplDropdownGroup as xpl_dropdown_group };