@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,214 @@
1
+ import { Component, Host, h, Prop } from "@stencil/core";
2
+ import "../../../font-awesome/fontawesome";
3
+ import "../../../font-awesome/regular";
4
+ export class XplButton {
5
+ constructor() {
6
+ this.size = "default";
7
+ this.variant = "primary";
8
+ }
9
+ render() {
10
+ let className = "xpl-button";
11
+ if (this.variant === "secondary")
12
+ className += " xpl-button--secondary";
13
+ if (this.variant === "subtle")
14
+ className += " xpl-button--subtle";
15
+ if (this.variant === "warning")
16
+ className += " xpl-button--warning";
17
+ if (this.size === "sm")
18
+ className += " xpl-button--sm";
19
+ if (this.size === "xs")
20
+ className += " xpl-button--xs";
21
+ if (this.iconOnly)
22
+ className += " xpl-button--icon-only";
23
+ const icon = this.icon ? (h("i", { class: `far fa-${this.icon} ${this.iconTrailing ? "trailing" : this.iconOnly ? "" : "leading"}` })) : null;
24
+ return (h(Host, { role: "button" },
25
+ /**
26
+ * Conditionally render either an <a> or <button> element
27
+ * depending on if there's an `href` or not
28
+ */
29
+ this.href ? (h("a", { class: className, href: this.href, role: "button" },
30
+ !this.iconTrailing && icon,
31
+ this.iconOnly ? (h("span", { class: "sr-only" },
32
+ h("slot", null))) : (h("slot", null)),
33
+ this.iconTrailing && icon)) : (h("button", { class: className, disabled: this.disabled, name: this.name, type: this.type, value: this.value },
34
+ !this.iconTrailing && icon,
35
+ this.iconOnly ? (h("span", { class: "sr-only" },
36
+ h("slot", null))) : (h("slot", null)),
37
+ this.iconTrailing && icon))));
38
+ }
39
+ static get is() { return "xpl-button"; }
40
+ static get properties() { return {
41
+ "disabled": {
42
+ "type": "boolean",
43
+ "mutable": false,
44
+ "complexType": {
45
+ "original": "boolean",
46
+ "resolved": "boolean",
47
+ "references": {}
48
+ },
49
+ "required": false,
50
+ "optional": true,
51
+ "docs": {
52
+ "tags": [],
53
+ "text": ""
54
+ },
55
+ "attribute": "disabled",
56
+ "reflect": false
57
+ },
58
+ "href": {
59
+ "type": "string",
60
+ "mutable": false,
61
+ "complexType": {
62
+ "original": "string",
63
+ "resolved": "string",
64
+ "references": {}
65
+ },
66
+ "required": false,
67
+ "optional": true,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": ""
71
+ },
72
+ "attribute": "href",
73
+ "reflect": false
74
+ },
75
+ "icon": {
76
+ "type": "string",
77
+ "mutable": false,
78
+ "complexType": {
79
+ "original": "string",
80
+ "resolved": "string",
81
+ "references": {}
82
+ },
83
+ "required": false,
84
+ "optional": true,
85
+ "docs": {
86
+ "tags": [],
87
+ "text": ""
88
+ },
89
+ "attribute": "icon",
90
+ "reflect": false
91
+ },
92
+ "iconOnly": {
93
+ "type": "boolean",
94
+ "mutable": false,
95
+ "complexType": {
96
+ "original": "boolean",
97
+ "resolved": "boolean",
98
+ "references": {}
99
+ },
100
+ "required": false,
101
+ "optional": true,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": ""
105
+ },
106
+ "attribute": "icon-only",
107
+ "reflect": false
108
+ },
109
+ "iconTrailing": {
110
+ "type": "boolean",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "boolean",
114
+ "resolved": "boolean",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": true,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": ""
122
+ },
123
+ "attribute": "icon-trailing",
124
+ "reflect": false
125
+ },
126
+ "name": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": true,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "attribute": "name",
141
+ "reflect": false
142
+ },
143
+ "size": {
144
+ "type": "string",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "\"default\" | \"sm\" | \"xs\"",
148
+ "resolved": "\"default\" | \"sm\" | \"xs\"",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": ""
156
+ },
157
+ "attribute": "size",
158
+ "reflect": false,
159
+ "defaultValue": "\"default\""
160
+ },
161
+ "type": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "\"submit\" | \"reset\" | \"button\"",
166
+ "resolved": "\"button\" | \"reset\" | \"submit\"",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": true,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": ""
174
+ },
175
+ "attribute": "type",
176
+ "reflect": false
177
+ },
178
+ "value": {
179
+ "type": "string",
180
+ "mutable": false,
181
+ "complexType": {
182
+ "original": "string",
183
+ "resolved": "string",
184
+ "references": {}
185
+ },
186
+ "required": false,
187
+ "optional": true,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": ""
191
+ },
192
+ "attribute": "value",
193
+ "reflect": false
194
+ },
195
+ "variant": {
196
+ "type": "string",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "\"primary\" | \"secondary\" | \"subtle\" | \"warning\"",
200
+ "resolved": "\"primary\" | \"secondary\" | \"subtle\" | \"warning\"",
201
+ "references": {}
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": ""
208
+ },
209
+ "attribute": "variant",
210
+ "reflect": false,
211
+ "defaultValue": "\"primary\""
212
+ }
213
+ }; }
214
+ }
@@ -0,0 +1,119 @@
1
+ import { Component, Host, h, Prop, Event } from '@stencil/core';
2
+ export class XplButtonRow {
3
+ constructor() {
4
+ this.onPrimary = () => this.clickPrimary.emit();
5
+ this.onSecondary = () => this.clickSecondary.emit();
6
+ this.onTertiary = () => this.clickTertiary.emit();
7
+ }
8
+ render() {
9
+ return (h(Host, { class: "xpl-button-row" },
10
+ h("div", { class: "xpl-button-row-inner" },
11
+ h("div", { class: "xpl-button-row__left" }, this.secondary &&
12
+ h("xpl-button", { variant: "secondary", type: "button", onClick: this.onSecondary }, this.secondary)),
13
+ h("div", { class: "xpl-button-row__right" },
14
+ this.tertiary && h("xpl-button", { variant: "subtle", type: "button", onClick: this.onTertiary }, this.tertiary),
15
+ this.secondary &&
16
+ h("xpl-button", { variant: "secondary", type: "button", onClick: this.onSecondary }, this.secondary),
17
+ this.primary && h("xpl-button", { class: "xpl-button-row__primary", onClick: this.onPrimary }, this.primary)))));
18
+ }
19
+ static get is() { return "xpl-button-row"; }
20
+ static get properties() { return {
21
+ "primary": {
22
+ "type": "string",
23
+ "mutable": false,
24
+ "complexType": {
25
+ "original": "\"string\"",
26
+ "resolved": "\"string\"",
27
+ "references": {}
28
+ },
29
+ "required": false,
30
+ "optional": false,
31
+ "docs": {
32
+ "tags": [],
33
+ "text": "The text for the primary button."
34
+ },
35
+ "attribute": "primary",
36
+ "reflect": false
37
+ },
38
+ "secondary": {
39
+ "type": "string",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "\"string\"",
43
+ "resolved": "\"string\"",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": "The text for the secondary button. If left\nempty, will not render a secondary button."
51
+ },
52
+ "attribute": "secondary",
53
+ "reflect": false
54
+ },
55
+ "tertiary": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "\"string\"",
60
+ "resolved": "\"string\"",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "The text for the tertiary button. If left\nempty, will not render a secondary button."
68
+ },
69
+ "attribute": "tertiary",
70
+ "reflect": false
71
+ }
72
+ }; }
73
+ static get events() { return [{
74
+ "method": "clickPrimary",
75
+ "name": "clickPrimary",
76
+ "bubbles": true,
77
+ "cancelable": true,
78
+ "composed": true,
79
+ "docs": {
80
+ "tags": [],
81
+ "text": "Fires on the primary button.\nIf not set, the button can act as a standard\nsubmit button for a form."
82
+ },
83
+ "complexType": {
84
+ "original": "any",
85
+ "resolved": "any",
86
+ "references": {}
87
+ }
88
+ }, {
89
+ "method": "clickSecondary",
90
+ "name": "clickSecondary",
91
+ "bubbles": true,
92
+ "cancelable": true,
93
+ "composed": true,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": "Adds an event listener to the secondary button."
97
+ },
98
+ "complexType": {
99
+ "original": "any",
100
+ "resolved": "any",
101
+ "references": {}
102
+ }
103
+ }, {
104
+ "method": "clickTertiary",
105
+ "name": "clickTertiary",
106
+ "bubbles": true,
107
+ "cancelable": true,
108
+ "composed": true,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": "Adds an event listener to the tertiary button."
112
+ },
113
+ "complexType": {
114
+ "original": "any",
115
+ "resolved": "any",
116
+ "references": {}
117
+ }
118
+ }]; }
119
+ }
@@ -0,0 +1,185 @@
1
+ import { Component, Host, h, Prop, State, Event } from "@stencil/core";
2
+ import { v4 as uuid } from "uuid";
3
+ export class XplCheckbox {
4
+ constructor() {
5
+ this.id = uuid();
6
+ }
7
+ render() {
8
+ return (h(Host, { class: {
9
+ "xpl-checkbox-radio-container": true,
10
+ "styled": this.styled,
11
+ "disabled": this.disabled,
12
+ } },
13
+ 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 }),
14
+ h("label", { class: {
15
+ "xpl-label": true,
16
+ "xpl-label--disabled": this.disabled
17
+ }, htmlFor: this.id },
18
+ h("slot", null),
19
+ this.description && h("small", { class: {
20
+ "xpl-description": true,
21
+ "xpl-description--disabled": this.disabled
22
+ } }, this.description))));
23
+ }
24
+ static get is() { return "xpl-checkbox"; }
25
+ static get properties() { return {
26
+ "checked": {
27
+ "type": "boolean",
28
+ "mutable": false,
29
+ "complexType": {
30
+ "original": "boolean",
31
+ "resolved": "boolean",
32
+ "references": {}
33
+ },
34
+ "required": false,
35
+ "optional": true,
36
+ "docs": {
37
+ "tags": [],
38
+ "text": ""
39
+ },
40
+ "attribute": "checked",
41
+ "reflect": false
42
+ },
43
+ "description": {
44
+ "type": "string",
45
+ "mutable": false,
46
+ "complexType": {
47
+ "original": "string",
48
+ "resolved": "string",
49
+ "references": {}
50
+ },
51
+ "required": false,
52
+ "optional": true,
53
+ "docs": {
54
+ "tags": [],
55
+ "text": ""
56
+ },
57
+ "attribute": "description",
58
+ "reflect": false
59
+ },
60
+ "disabled": {
61
+ "type": "boolean",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "boolean",
65
+ "resolved": "boolean",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": true,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "disabled",
75
+ "reflect": false
76
+ },
77
+ "indeterminate": {
78
+ "type": "boolean",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "boolean",
82
+ "resolved": "boolean",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": true,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ },
91
+ "attribute": "indeterminate",
92
+ "reflect": false
93
+ },
94
+ "name": {
95
+ "type": "string",
96
+ "mutable": false,
97
+ "complexType": {
98
+ "original": "string",
99
+ "resolved": "string",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": true,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": ""
107
+ },
108
+ "attribute": "name",
109
+ "reflect": false
110
+ },
111
+ "required": {
112
+ "type": "boolean",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "boolean",
116
+ "resolved": "boolean",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": true,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": ""
124
+ },
125
+ "attribute": "required",
126
+ "reflect": false
127
+ },
128
+ "styled": {
129
+ "type": "boolean",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "boolean",
133
+ "resolved": "boolean",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": true,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": ""
141
+ },
142
+ "attribute": "styled",
143
+ "reflect": false
144
+ },
145
+ "value": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": true,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": ""
158
+ },
159
+ "attribute": "value",
160
+ "reflect": false
161
+ }
162
+ }; }
163
+ static get states() { return {
164
+ "id": {}
165
+ }; }
166
+ static get events() { return [{
167
+ "method": "checkboxChange",
168
+ "name": "checkboxChange",
169
+ "bubbles": true,
170
+ "cancelable": true,
171
+ "composed": true,
172
+ "docs": {
173
+ "tags": [{
174
+ "text": undefined,
175
+ "name": "private"
176
+ }],
177
+ "text": ""
178
+ },
179
+ "complexType": {
180
+ "original": "any",
181
+ "resolved": "any",
182
+ "references": {}
183
+ }
184
+ }]; }
185
+ }
@@ -0,0 +1,143 @@
1
+ /// <reference path="./choice.d.ts"></reference>
2
+ import { Component, Host, h, Prop, State } from "@stencil/core";
3
+ export class XplChoicelist {
4
+ componentWillLoad() {
5
+ this.selected = this.choices !== undefined && this.choices !== null && this.choices.length > 0 ? this.choices.map(() => false) : [];
6
+ }
7
+ render() {
8
+ let className = "xpl-choicelist";
9
+ if (this.styled)
10
+ className += " xpl-choicelist--styled";
11
+ return (h(Host, { class: "xpl-choicelist-container" },
12
+ this.heading !== undefined || this.description !== undefined ? h("div", { class: "xpl-choicelist-heading" },
13
+ this.heading && h("h3", null, this.heading),
14
+ this.description && h("p", null, this.description)) : null,
15
+ this.choices && (h("ul", { class: className }, this.choices.map(({ children, description, label }, i) => {
16
+ const inner = this.multi ? (h("xpl-checkbox", { description: description, name: this.name, onCheckboxChange: (e) => {
17
+ const { detail } = e;
18
+ this.selected = this.selected.map((v, j) => i === j ? detail : v);
19
+ } }, label)) : (h("xpl-radio", { description: description, name: this.name, onRadioChange: () => {
20
+ // TypeScript errors since `v` isn't used
21
+ // @ts-expect-error
22
+ this.selected = this.selected.map((v, j) => i === j);
23
+ } }, label));
24
+ let className = this.styled && this.selected[i] ? "selected" : "";
25
+ return (h("li", { class: className },
26
+ inner,
27
+ children && h("ul", null, children.map((child) => {
28
+ const childInner = this.multi ? (h("xpl-checkbox", { description: child.description }, child.label)) : (h("xpl-radio", { description: child.description }, child.label));
29
+ return h("li", null, childInner);
30
+ }))));
31
+ })))));
32
+ }
33
+ static get is() { return "xpl-choicelist"; }
34
+ static get properties() { return {
35
+ "choices": {
36
+ "type": "unknown",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "Choice[]",
40
+ "resolved": "Choice[]",
41
+ "references": {
42
+ "Choice": {
43
+ "location": "global"
44
+ }
45
+ }
46
+ },
47
+ "required": false,
48
+ "optional": false,
49
+ "docs": {
50
+ "tags": [],
51
+ "text": "An array of choices to be displayed in the list.\nEach choice should be an object with keys:\n- `checked` [boolean] - whether to precheck or not\n- `children` [Choice[]] - an array of child choices (recursive)\n- `description` [string]\n- `label` [string]"
52
+ }
53
+ },
54
+ "description": {
55
+ "type": "string",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "string",
59
+ "resolved": "string",
60
+ "references": {}
61
+ },
62
+ "required": false,
63
+ "optional": true,
64
+ "docs": {
65
+ "tags": [],
66
+ "text": "Descriptive text to be displayed above the choicelist."
67
+ },
68
+ "attribute": "description",
69
+ "reflect": false
70
+ },
71
+ "heading": {
72
+ "type": "string",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "string",
76
+ "resolved": "string",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": true,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": "The title text to be displayed above the choicelist."
84
+ },
85
+ "attribute": "heading",
86
+ "reflect": false
87
+ },
88
+ "multi": {
89
+ "type": "boolean",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "boolean",
93
+ "resolved": "boolean",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": true,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": "Whether the user can select more than one choice (true) or only a single choice (false). Corresponds to checkboxes vs. radio buttons."
101
+ },
102
+ "attribute": "multi",
103
+ "reflect": false
104
+ },
105
+ "name": {
106
+ "type": "string",
107
+ "mutable": false,
108
+ "complexType": {
109
+ "original": "string",
110
+ "resolved": "string",
111
+ "references": {}
112
+ },
113
+ "required": false,
114
+ "optional": true,
115
+ "docs": {
116
+ "tags": [],
117
+ "text": "The `name` to be associated with form data."
118
+ },
119
+ "attribute": "name",
120
+ "reflect": false
121
+ },
122
+ "styled": {
123
+ "type": "boolean",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "boolean",
127
+ "resolved": "boolean",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": true,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "If `true`, will include borders around the list and between individual choices."
135
+ },
136
+ "attribute": "styled",
137
+ "reflect": false
138
+ }
139
+ }; }
140
+ static get states() { return {
141
+ "selected": {}
142
+ }; }
143
+ }
@@ -0,0 +1,39 @@
1
+ import { Component, Host, h, Prop } from '@stencil/core';
2
+ export class XplContentArea {
3
+ constructor() {
4
+ /**
5
+ * @property {string} size - The content-area size.
6
+ */
7
+ this.size = "wide";
8
+ }
9
+ render() {
10
+ return (h(Host, null,
11
+ h("main", { class: `xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}` },
12
+ h("div", { class: "xpl-content-area" },
13
+ h("slot", null)))));
14
+ }
15
+ static get is() { return "xpl-content-area"; }
16
+ static get properties() { return {
17
+ "size": {
18
+ "type": "string",
19
+ "mutable": false,
20
+ "complexType": {
21
+ "original": "\"wide\" | \"narrow\" | \"full\"",
22
+ "resolved": "\"full\" | \"narrow\" | \"wide\"",
23
+ "references": {}
24
+ },
25
+ "required": false,
26
+ "optional": false,
27
+ "docs": {
28
+ "tags": [{
29
+ "text": "{string} size - The content-area size.",
30
+ "name": "property"
31
+ }],
32
+ "text": ""
33
+ },
34
+ "attribute": "size",
35
+ "reflect": false,
36
+ "defaultValue": "\"wide\""
37
+ }
38
+ }; }
39
+ }