@xplortech/apollo-core 0.5.0 → 0.5.2

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 (188) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/style.css +102 -142
  3. package/dist/apollo-core/apollo-core.css +9 -5508
  4. package/dist/apollo-core/apollo-core.esm.js +1 -125
  5. package/dist/apollo-core/index.esm.js +0 -1
  6. package/dist/apollo-core/p-0203d4e8.entry.js +1 -0
  7. package/dist/apollo-core/p-0b2c612e.entry.js +1 -0
  8. package/dist/apollo-core/p-128a0240.entry.js +1 -0
  9. package/dist/apollo-core/p-2f90296c.js +10 -0
  10. package/dist/apollo-core/p-30003b15.entry.js +1 -0
  11. package/dist/apollo-core/p-4e56a2ca.entry.js +1 -0
  12. package/dist/apollo-core/p-5854d1e4.entry.js +1 -0
  13. package/dist/apollo-core/p-611536d8.entry.js +1 -0
  14. package/dist/apollo-core/p-7c9fee7e.entry.js +1 -0
  15. package/dist/apollo-core/p-8b6633c7.js +1 -0
  16. package/dist/apollo-core/p-97cd1f73.entry.js +1 -0
  17. package/dist/apollo-core/p-9c5ca308.entry.js +1 -0
  18. package/dist/apollo-core/p-ad90fe4d.js +1 -0
  19. package/dist/apollo-core/p-bd4a7e3c.entry.js +1 -0
  20. package/dist/apollo-core/p-dab8e7a1.entry.js +1 -0
  21. package/dist/apollo-core/p-eb63b401.entry.js +1 -0
  22. package/dist/apollo-core/p-ee2f4422.entry.js +1 -0
  23. package/dist/apollo-core/p-f167aa05.entry.js +1 -0
  24. package/dist/cjs/apollo-core.cjs.js +19 -0
  25. package/dist/cjs/index-944adb2e.js +1609 -0
  26. package/dist/cjs/index.cjs.js +2 -0
  27. package/dist/cjs/loader.cjs.js +21 -0
  28. package/dist/{apollo-core/regular-133c23b5.js → cjs/regular-872f5226.js} +3 -12
  29. package/dist/cjs/v4-14140ff3.js +77 -0
  30. package/dist/cjs/xpl-application-shell_11.cjs.entry.js +230 -0
  31. package/dist/cjs/xpl-badge.cjs.entry.js +21 -0
  32. package/dist/cjs/xpl-button-row.cjs.entry.js +24 -0
  33. package/dist/cjs/xpl-checkbox_2.cjs.entry.js +51 -0
  34. package/dist/cjs/xpl-choicelist.cjs.entry.js +36 -0
  35. package/dist/cjs/xpl-divider.cjs.entry.js +18 -0
  36. package/dist/cjs/xpl-grid-item.cjs.entry.js +25 -0
  37. package/dist/cjs/xpl-grid.cjs.entry.js +35 -0
  38. package/dist/cjs/xpl-input.cjs.entry.js +2527 -0
  39. package/dist/cjs/xpl-list.cjs.entry.js +63 -0
  40. package/dist/cjs/xpl-pagination.cjs.entry.js +76 -0
  41. package/dist/cjs/xpl-select.cjs.entry.js +623 -0
  42. package/dist/cjs/xpl-table.cjs.entry.js +89 -0
  43. package/dist/cjs/xpl-tag.cjs.entry.js +21 -0
  44. package/dist/cjs/xpl-toggle.cjs.entry.js +34 -0
  45. package/dist/collection/collection-manifest.json +37 -0
  46. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +143 -0
  47. package/dist/collection/components/xpl-avatar/xpl-avatar.js +158 -0
  48. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +41 -0
  49. package/dist/collection/components/xpl-badge/xpl-badge.js +50 -0
  50. package/dist/{apollo-core/xpl-breadcrumb-item.entry.js → collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js} +12 -9
  51. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +15 -0
  52. package/dist/collection/components/xpl-button/xpl-button.js +214 -0
  53. package/dist/collection/components/xpl-button-row/xpl-button-row.js +119 -0
  54. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +185 -0
  55. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +143 -0
  56. package/dist/collection/components/xpl-content-area/xpl-content-area.js +39 -0
  57. package/dist/collection/components/xpl-divider/xpl-divider.js +30 -0
  58. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +32 -0
  59. package/dist/collection/components/xpl-grid/xpl-grid.js +26 -0
  60. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +93 -0
  61. package/dist/collection/components/xpl-input/xpl-input.js +471 -0
  62. package/dist/collection/components/xpl-list/xpl-list.js +93 -0
  63. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +72 -0
  64. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +10 -0
  65. package/dist/collection/components/xpl-pagination/xpl-pagination.js +189 -0
  66. package/dist/collection/components/xpl-radio/xpl-radio.js +168 -0
  67. package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +9 -0
  68. package/dist/collection/components/xpl-select/xpl-select.js +311 -0
  69. package/dist/collection/components/xpl-table/xpl-table.js +194 -0
  70. package/dist/collection/components/xpl-tag/xpl-tag.js +30 -0
  71. package/dist/collection/components/xpl-toggle/xpl-toggle.js +157 -0
  72. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +70 -0
  73. package/dist/custom-elements/index.js +19959 -0
  74. package/dist/esm/apollo-core.js +17 -0
  75. package/dist/esm/index-899dba3b.js +1580 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/loader.js +17 -0
  78. package/dist/esm/polyfills/core-js.js +11 -0
  79. package/dist/esm/polyfills/css-shim.js +1 -0
  80. package/dist/esm/polyfills/dom.js +79 -0
  81. package/dist/esm/polyfills/es5-html-element.js +1 -0
  82. package/dist/esm/polyfills/index.js +34 -0
  83. package/dist/esm/polyfills/system.js +6 -0
  84. package/dist/esm/regular-86225e9d.js +16041 -0
  85. package/dist/esm/v4-929670b7.js +75 -0
  86. package/dist/esm/xpl-application-shell_11.entry.js +216 -0
  87. package/dist/{apollo-core → esm}/xpl-badge.entry.js +1 -1
  88. package/dist/{apollo-core → esm}/xpl-button-row.entry.js +1 -1
  89. package/dist/esm/xpl-checkbox_2.entry.js +46 -0
  90. package/dist/{apollo-core → esm}/xpl-choicelist.entry.js +1 -1
  91. package/dist/{apollo-core → esm}/xpl-divider.entry.js +1 -1
  92. package/dist/{apollo-core → esm}/xpl-grid-item.entry.js +1 -1
  93. package/dist/{apollo-core → esm}/xpl-grid.entry.js +1 -1
  94. package/dist/{apollo-core → esm}/xpl-input.entry.js +3 -20
  95. package/dist/{apollo-core → esm}/xpl-list.entry.js +2 -2
  96. package/dist/{apollo-core → esm}/xpl-pagination.entry.js +1 -1
  97. package/dist/{apollo-core → esm}/xpl-select.entry.js +2 -43
  98. package/dist/{apollo-core → esm}/xpl-table.entry.js +1 -1
  99. package/dist/{apollo-core → esm}/xpl-tag.entry.js +1 -1
  100. package/dist/{apollo-core → esm}/xpl-toggle.entry.js +2 -2
  101. package/dist/index.cjs.js +1 -0
  102. package/dist/index.js +1 -0
  103. package/dist/stories/application-shell.stories.js +766 -0
  104. package/dist/stories/avatar.stories.js +173 -0
  105. package/dist/stories/backdrop.stories.js +18 -0
  106. package/dist/stories/badge.stories.js +48 -0
  107. package/dist/stories/breadcrumbs.stories.js +115 -0
  108. package/dist/stories/button-row.stories.js +64 -0
  109. package/dist/stories/button.stories.js +98 -0
  110. package/dist/stories/checkbox.stories.js +76 -0
  111. package/dist/stories/choicelist.stories.js +112 -0
  112. package/dist/stories/content-area.stories.js +53 -0
  113. package/dist/stories/divider.stories.js +34 -0
  114. package/dist/stories/grid.stories.js +100 -0
  115. package/dist/stories/input.stories.js +252 -0
  116. package/dist/stories/list.stories.js +134 -0
  117. package/dist/stories/main-nav.stories.js +308 -0
  118. package/dist/stories/pagination.stories.js +84 -0
  119. package/dist/stories/radio.stories.js +66 -0
  120. package/dist/stories/secondary-nav.stories.js +76 -0
  121. package/dist/stories/select.stories.js +111 -0
  122. package/dist/stories/table.stories.js +107 -0
  123. package/dist/stories/tabs.stories.js +24 -0
  124. package/dist/stories/toggle.stories.js +80 -0
  125. package/dist/stories/utility-bar.stories.js +94 -0
  126. package/package.json +1 -1
  127. package/dist/apollo-core/app-globals-0f993ce5.js +0 -3
  128. package/dist/apollo-core/css-shim-bbdf0cc6.js +0 -4
  129. package/dist/apollo-core/dom-1f98a75f.js +0 -73
  130. package/dist/apollo-core/index-3c9f25ef.js +0 -2938
  131. package/dist/apollo-core/index-3eb5568f.js +0 -2938
  132. package/dist/apollo-core/index-912d1a21.js +0 -584
  133. package/dist/apollo-core/shadow-css-67b66845.js +0 -389
  134. package/dist/apollo-core/xpl-application-shell.entry.js +0 -52
  135. package/dist/apollo-core/xpl-avatar.entry.js +0 -19
  136. package/dist/apollo-core/xpl-backdrop.entry.js +0 -21
  137. package/dist/apollo-core/xpl-breadcrumbs.entry.js +0 -14
  138. package/dist/apollo-core/xpl-button.entry.js +0 -34
  139. package/dist/apollo-core/xpl-checkbox.entry.js +0 -25
  140. package/dist/apollo-core/xpl-content-area.entry.js +0 -16
  141. package/dist/apollo-core/xpl-main-nav.entry.js +0 -26
  142. package/dist/apollo-core/xpl-nav-item.entry.js +0 -12
  143. package/dist/apollo-core/xpl-radio.entry.js +0 -25
  144. package/dist/apollo-core/xpl-secondary-nav.entry.js +0 -12
  145. package/dist/apollo-core/xpl-utility-bar.entry.js +0 -25
  146. package/dist/types/components/xpl-application-shell/test/xpl-application-shell.e2e.d.ts +0 -1
  147. package/dist/types/components/xpl-avatar/test/xpl-avatar.e2e.d.ts +0 -1
  148. package/dist/types/components/xpl-avatar/test/xpl-avatar.spec.d.ts +0 -1
  149. package/dist/types/components/xpl-backdrop/test/xpl-backdrop.e2e.d.ts +0 -1
  150. package/dist/types/components/xpl-badge/test/xpl-badge.e2e.d.ts +0 -1
  151. package/dist/types/components/xpl-badge/test/xpl-badge.spec.d.ts +0 -1
  152. package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/test/xpl-breadcrumb-item.e2e.d.ts +0 -1
  153. package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/test/xpl-breadcrumbs.e2e.d.ts +0 -1
  154. package/dist/types/components/xpl-button/test/xpl-button.e2e.d.ts +0 -1
  155. package/dist/types/components/xpl-button/test/xpl-button.spec.d.ts +0 -1
  156. package/dist/types/components/xpl-button-row/test/xpl-button-row.e2e.d.ts +0 -1
  157. package/dist/types/components/xpl-button-row/test/xpl-button-row.spec.d.ts +0 -1
  158. package/dist/types/components/xpl-checkbox/test/xpl-checkbox.e2e.d.ts +0 -1
  159. package/dist/types/components/xpl-checkbox/test/xpl-checkbox.spec.d.ts +0 -1
  160. package/dist/types/components/xpl-choicelist/test/xpl-choicelist.e2e.d.ts +0 -1
  161. package/dist/types/components/xpl-choicelist/test/xpl-choicelist.spec.d.ts +0 -1
  162. package/dist/types/components/xpl-content-area/test/xpl-content-area.e2e.d.ts +0 -1
  163. package/dist/types/components/xpl-divider/test/xpl-divider.e2e.d.ts +0 -1
  164. package/dist/types/components/xpl-divider/test/xpl-divider.spec.d.ts +0 -1
  165. package/dist/types/components/xpl-grid/test/xpl-grid.e2e.d.ts +0 -1
  166. package/dist/types/components/xpl-grid/test/xpl-grid.spec.d.ts +0 -1
  167. package/dist/types/components/xpl-grid-item/test/xpl-grid-item.e2e.d.ts +0 -1
  168. package/dist/types/components/xpl-grid-item/test/xpl-grid-item.spec.d.ts +0 -1
  169. package/dist/types/components/xpl-input/test/xpl-input.e2e.d.ts +0 -1
  170. package/dist/types/components/xpl-input/test/xpl-input.spec.d.ts +0 -1
  171. package/dist/types/components/xpl-list/test/xpl-list.e2e.d.ts +0 -1
  172. package/dist/types/components/xpl-list/test/xpl-list.spec.d.ts +0 -1
  173. package/dist/types/components/xpl-main-nav/test/xpl-main-nav.e2e.d.ts +0 -1
  174. package/dist/types/components/xpl-nav-item/test/xpl-nav-item.e2e.d.ts +0 -1
  175. package/dist/types/components/xpl-pagination/test/xpl-pagination.e2e.d.ts +0 -1
  176. package/dist/types/components/xpl-pagination/test/xpl-pagination.spec.d.ts +0 -1
  177. package/dist/types/components/xpl-radio/test/xpl-radio.e2e.d.ts +0 -1
  178. package/dist/types/components/xpl-radio/test/xpl-radio.spec.d.ts +0 -1
  179. package/dist/types/components/xpl-secondary-nav/test/secondary-nav.e2e.d.ts +0 -1
  180. package/dist/types/components/xpl-select/test/xpl-select.e2e.d.ts +0 -1
  181. package/dist/types/components/xpl-select/test/xpl-select.spec.d.ts +0 -1
  182. package/dist/types/components/xpl-table/test/xpl-table.e2e.d.ts +0 -1
  183. package/dist/types/components/xpl-table/test/xpl-table.spec.d.ts +0 -1
  184. package/dist/types/components/xpl-tag/test/xpl-tag.e2e.d.ts +0 -1
  185. package/dist/types/components/xpl-tag/test/xpl-tag.spec.d.ts +0 -1
  186. package/dist/types/components/xpl-toggle/test/xpl-toggle.e2e.d.ts +0 -1
  187. package/dist/types/components/xpl-toggle/test/xpl-toggle.spec.d.ts +0 -1
  188. package/dist/types/components/xpl-utility-bar/test/xpl-utility-bar.e2e.d.ts +0 -1
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-944adb2e.js');
6
+ require('./regular-872f5226.js');
7
+
8
+ const ListItemCpt = ({ avatar, avatars, badges, href, title, subtext, metadata }) => {
9
+ const hasRight = avatars || badges || subtext;
10
+ const inner = (index.h(index.Fragment, null, avatar && (avatar.slice(0, 1) === "/" || avatar.slice(0, 4) === "http" ?
11
+ index.h("xpl-avatar", { src: avatar, name: title }) :
12
+ index.h("xpl-avatar", { name: title }, avatar)), index.h("div", { class: "xpl-list-item-content" }, index.h("div", { class: "xpl-list-left" }, index.h("div", null, index.h("h4", null, title), metadata && (index.h("ul", { class: "xpl-list-item-metadata" }, metadata.map(d => {
13
+ if (typeof d === "string") {
14
+ return index.h("li", null, d);
15
+ }
16
+ else {
17
+ return index.h("li", null, index.h("span", { class: `far fa-${d.icon}` }), " ", d.text);
18
+ }
19
+ }))))), hasRight && (index.h("div", { class: "xpl-list-right" }, subtext && index.h("div", { class: "xpl-list-item-subtext" }, subtext), avatars && (index.h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, avatars.map(a => index.h("img", { src: a, alt: "" })))), badges && badges.map(b => {
20
+ if (typeof b === "string") {
21
+ return index.h("xpl-badge", null, b);
22
+ }
23
+ else {
24
+ return index.h("xpl-badge", { dot: b.dot, variant: b.variant }, b.text);
25
+ }
26
+ }))))));
27
+ return href ?
28
+ index.h("a", { class: "xpl-list-item", href: href }, inner) :
29
+ index.h("div", { class: "xpl-list-item" }, inner);
30
+ };
31
+ const XplList = class {
32
+ constructor(hostRef) {
33
+ index.registerInstance(this, hostRef);
34
+ /**
35
+ * `items` should be an array of objects with the following signature:
36
+ * {
37
+ * avatar?: string; // The URL of the avatar, or the placeholder initials (ex. "SPD").
38
+ * avatars?: string[]; // The URLs of multiple avatars to be displayed in a group on the right.
39
+ * badges?: string[] | { // An array of strings or badge-like objects to be displayed as badges
40
+ * dot?: boolean; // in a group on the right. See <xpl-badge> for more details.
41
+ * text: string;
42
+ * variant?: string;
43
+ * }[];
44
+ * href?: string; // A URL, if this list item is meant to link somewhere.
45
+ * title: string; // The text to be displayed for the list item.
46
+ * metadata?: string[] | { // An array of strings or strings with icons (reference the allowed
47
+ * icon: string; // Font Awesome icons) to be displayed as metadata below the title.
48
+ * text: string;
49
+ * }[];
50
+ * subtext?: string; // Subtext to be displayed on the right.
51
+ * }
52
+ *
53
+ * - Note that you should *only use one of* `avatars`, `badges`, or `subtext`, to avoid cluttering
54
+ * the right-hand side of the list item.
55
+ */
56
+ this.items = [];
57
+ }
58
+ render() {
59
+ return (index.h(index.Host, null, this.items.map(item => index.h(ListItemCpt, Object.assign({}, item)))));
60
+ }
61
+ };
62
+
63
+ exports.xpl_list = XplList;
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-944adb2e.js');
6
+
7
+ const XplPagination = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.page = index.createEvent(this, "page", 7);
11
+ this.current = 1;
12
+ /**
13
+ * Private `_goto` method respects the `waitForCallback` prop --
14
+ * it will always emit the `page` event, but won't actually update
15
+ * the state of what the current page is, leaving that to the caller
16
+ * to update once (presumably) some other data has loaded.
17
+ */
18
+ this._goto = (n) => {
19
+ this.page.emit(n);
20
+ if (!this.waitForCallback) {
21
+ this.current = n;
22
+ }
23
+ };
24
+ this.goPrev = () => {
25
+ if (this.current > 1)
26
+ this._goto(this.current - 1);
27
+ };
28
+ this.goNext = () => {
29
+ const numPages = Math.ceil(this.total / this.perPage);
30
+ if (this.current < numPages)
31
+ this._goto(this.current + 1);
32
+ };
33
+ }
34
+ /**
35
+ * Calling `goto` with a page number (which should probably be
36
+ * taken from the `page` event) updates the pagination's state
37
+ * and re-renders it, showing the appropriate buttons given the current page.
38
+ * @param n
39
+ */
40
+ async goto(n) {
41
+ this.current = n;
42
+ }
43
+ render() {
44
+ const numPages = Math.ceil(this.total / this.perPage);
45
+ let showing = [1];
46
+ if (numPages < 7)
47
+ showing = [1, 2, 3, 4, 5, 6];
48
+ if (this.current <= 3 || this.current >= numPages - 2) {
49
+ showing = [1, 2, 3, "...", numPages - 2, numPages - 1, numPages];
50
+ }
51
+ else {
52
+ showing = [
53
+ 1,
54
+ "...",
55
+ this.current - 1,
56
+ this.current,
57
+ this.current + 1,
58
+ "...",
59
+ numPages,
60
+ ];
61
+ }
62
+ const showingFirst = (this.current - 1) * this.perPage + 1;
63
+ const showingLast = Math.min(showingFirst + this.perPage - 1, this.total);
64
+ return (index.h(index.Host, null, index.h("div", { class: "xpl-pagination" }, index.h("div", null, index.h("p", null, "Showing ", index.h("span", null, showingFirst), " to ", index.h("span", null, showingLast), " ", "of ", index.h("span", null, this.total), " results")), index.h("div", null, index.h("nav", { "aria-label": "Pagination" }, index.h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" }, index.h("span", null, "Previous"), index.h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", "clip-rule": "evenodd" }))), showing.map((n) => {
65
+ if (n === "...") {
66
+ return index.h("span", { class: "xpl-pagination-ellipsis" }, "...");
67
+ }
68
+ if (n === this.current) {
69
+ return (index.h("button", { "aria-current": "page", class: "xpl-pagination-current" }, n));
70
+ }
71
+ return index.h("button", { onClick: () => this._goto(n) }, n);
72
+ }), index.h("button", { onClick: this.goNext, class: "xpl-pagination-next" }, index.h("span", null, "Next"), index.h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clip-rule": "evenodd" }))))))));
73
+ }
74
+ };
75
+
76
+ exports.xpl_pagination = XplPagination;