@xplortech/apollo-core 0.3.0 → 0.4.1

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 (123) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/style.css +2934 -417
  3. package/dist/apollo-core/apollo-core.css +6 -4
  4. package/dist/apollo-core/apollo-core.esm.js +1 -1
  5. package/dist/apollo-core/p-0027c582.entry.js +1 -0
  6. package/dist/apollo-core/p-2c551f4d.entry.js +1 -0
  7. package/dist/apollo-core/{p-43013b35.entry.js → p-2f90296c.js} +2 -3
  8. package/dist/apollo-core/p-6081e432.entry.js +1 -0
  9. package/dist/apollo-core/p-612984e5.entry.js +1 -0
  10. package/dist/apollo-core/p-63ea199d.entry.js +1 -0
  11. package/dist/apollo-core/p-650f6416.entry.js +1 -0
  12. package/dist/apollo-core/p-6ad97405.entry.js +1 -0
  13. package/dist/apollo-core/{p-21872e0f.entry.js → p-9b9511e4.entry.js} +1 -1
  14. package/dist/apollo-core/p-ad90fe4d.js +1 -0
  15. package/dist/apollo-core/p-c6fec744.entry.js +1 -0
  16. package/dist/apollo-core/p-ea8e0991.js +1 -0
  17. package/dist/apollo-core/p-ed04cedd.entry.js +1 -0
  18. package/dist/apollo-core/p-eec5a0f1.entry.js +1 -0
  19. package/dist/apollo-core/p-f4f646d9.entry.js +1 -0
  20. package/dist/cjs/apollo-core.cjs.js +2 -2
  21. package/dist/cjs/{index-716d8f57.js → index-9662f096.js} +134 -35
  22. package/dist/cjs/loader.cjs.js +2 -2
  23. package/dist/cjs/regular-872f5226.js +16043 -0
  24. package/dist/cjs/v4-14140ff3.js +77 -0
  25. package/dist/cjs/xpl-avatar_14.cjs.entry.js +30 -16122
  26. package/dist/cjs/xpl-button-row.cjs.entry.js +24 -0
  27. package/dist/cjs/xpl-choicelist.cjs.entry.js +22 -2
  28. package/dist/cjs/xpl-divider.cjs.entry.js +18 -0
  29. package/dist/cjs/xpl-grid-item.cjs.entry.js +25 -0
  30. package/dist/cjs/xpl-grid.cjs.entry.js +35 -0
  31. package/dist/cjs/xpl-input.cjs.entry.js +2527 -0
  32. package/dist/cjs/xpl-list.cjs.entry.js +63 -0
  33. package/dist/cjs/xpl-pagination.cjs.entry.js +1 -1
  34. package/dist/cjs/xpl-select.cjs.entry.js +623 -0
  35. package/dist/cjs/xpl-tag.cjs.entry.js +21 -0
  36. package/dist/cjs/xpl-toggle.cjs.entry.js +34 -0
  37. package/dist/collection/collection-manifest.json +9 -0
  38. package/dist/collection/components/xpl-button-row/xpl-button-row.js +119 -0
  39. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +51 -5
  40. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +138 -4
  41. package/dist/collection/components/xpl-divider/xpl-divider.js +30 -0
  42. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +32 -0
  43. package/dist/collection/components/xpl-grid/xpl-grid.js +26 -0
  44. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +93 -0
  45. package/dist/collection/components/xpl-input/xpl-input.js +471 -0
  46. package/dist/collection/components/xpl-list/xpl-list.js +93 -0
  47. package/dist/collection/components/xpl-radio/xpl-radio.js +51 -5
  48. package/dist/collection/components/xpl-select/xpl-select.js +311 -0
  49. package/dist/collection/components/xpl-table/xpl-table.js +6 -6
  50. package/dist/collection/components/xpl-tag/xpl-tag.js +30 -0
  51. package/dist/collection/components/xpl-toggle/xpl-toggle.js +157 -0
  52. package/dist/custom-elements/index.d.ts +54 -0
  53. package/dist/custom-elements/index.js +3447 -77
  54. package/dist/esm/apollo-core.js +2 -2
  55. package/dist/esm/{index-4c8962a5.js → index-619763f9.js} +133 -36
  56. package/dist/esm/loader.js +2 -2
  57. package/dist/esm/regular-86225e9d.js +16041 -0
  58. package/dist/esm/v4-929670b7.js +75 -0
  59. package/dist/esm/xpl-avatar_14.entry.js +28 -16120
  60. package/dist/esm/xpl-button-row.entry.js +20 -0
  61. package/dist/esm/xpl-choicelist.entry.js +22 -2
  62. package/dist/esm/xpl-divider.entry.js +14 -0
  63. package/dist/esm/xpl-grid-item.entry.js +21 -0
  64. package/dist/esm/xpl-grid.entry.js +31 -0
  65. package/dist/esm/xpl-input.entry.js +2523 -0
  66. package/dist/esm/xpl-list.entry.js +59 -0
  67. package/dist/esm/xpl-pagination.entry.js +1 -1
  68. package/dist/esm/xpl-select.entry.js +619 -0
  69. package/dist/esm/xpl-tag.entry.js +17 -0
  70. package/dist/esm/xpl-toggle.entry.js +30 -0
  71. package/dist/stories/button-row.stories.js +64 -0
  72. package/dist/stories/checkbox.stories.js +16 -6
  73. package/dist/stories/choicelist.stories.js +112 -0
  74. package/dist/stories/divider.stories.js +34 -0
  75. package/dist/stories/grid.stories.js +100 -0
  76. package/dist/stories/input.stories.js +252 -0
  77. package/dist/stories/list.stories.js +134 -0
  78. package/dist/stories/radio.stories.js +16 -6
  79. package/dist/stories/select.stories.js +111 -0
  80. package/dist/stories/toggle.stories.js +80 -0
  81. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button-row.stories.d.ts +49 -0
  82. package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/checkbox.stories.d.ts +10 -2
  83. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/choicelist.stories.d.ts +41 -0
  84. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/divider.stories.d.ts +40 -0
  85. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/grid.stories.d.ts +150 -0
  86. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/input.stories.d.ts +190 -0
  87. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/list.stories.d.ts +71 -0
  88. package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/radio.stories.d.ts +10 -2
  89. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/select.stories.d.ts +74 -0
  90. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/toggle.stories.d.ts +74 -0
  91. package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +35 -0
  92. package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +5 -0
  93. package/dist/types/components/xpl-choicelist/choice.d.ts +6 -0
  94. package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +31 -0
  95. package/dist/types/components/xpl-divider/xpl-divider.d.ts +9 -0
  96. package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +6 -0
  97. package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +10 -0
  98. package/dist/types/components/xpl-grid/xpl-grid.d.ts +5 -0
  99. package/dist/types/components/xpl-grid-item/xpl-grid-item.d.ts +7 -0
  100. package/dist/types/components/xpl-input/xpl-input.d.ts +87 -0
  101. package/dist/types/components/xpl-list/listitem.d.ts +16 -0
  102. package/dist/types/components/xpl-list/xpl-list.d.ts +28 -0
  103. package/dist/types/components/xpl-radio/xpl-radio.d.ts +4 -0
  104. package/dist/types/components/xpl-select/xpl-select.d.ts +52 -0
  105. package/dist/types/components/xpl-table/xpl-table.d.ts +6 -6
  106. package/dist/types/components/xpl-tag/xpl-tag.d.ts +5 -0
  107. package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +23 -0
  108. package/dist/types/components.d.ts +447 -5
  109. package/package.json +3 -2
  110. package/dist/apollo-core/p-00996870.js +0 -1
  111. package/dist/apollo-core/p-d8ea7d80.entry.js +0 -1
  112. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
  113. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/backdrop.stories.d.ts +0 -0
  114. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
  115. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -0
  116. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/button.stories.d.ts +0 -0
  117. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/content-area.stories.d.ts +0 -0
  118. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/main-nav.stories.d.ts +0 -0
  119. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
  120. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -0
  121. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/table.stories.d.ts +0 -0
  122. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
  123. /package/dist/types/Users/{awentt/Sites → fernandogelin/Projects}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-9662f096.js');
6
+
7
+ const XplTag = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.close = index.createEvent(this, "close", 7);
11
+ }
12
+ render() {
13
+ return (index.h(index.Host, { class: "xpl-tag-container" }, index.h("button", { class: "xpl-tag", onClick: () => {
14
+ this.close.emit();
15
+ } }, index.h("slot", null)), index.h("button", { class: "xpl-tag__close", onClick: () => {
16
+ this.close.emit();
17
+ } }, "\u00D7")));
18
+ }
19
+ };
20
+
21
+ exports.xpl_tag = XplTag;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-9662f096.js');
6
+ const v4 = require('./v4-14140ff3.js');
7
+
8
+ const XplToggle = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ /**
12
+ * The size of the toggle -- `default` or `small`
13
+ */
14
+ this.variant = "default";
15
+ this.id = v4.v4();
16
+ }
17
+ render() {
18
+ let containerClassName = "xpl-toggle-container";
19
+ if (this.disabled)
20
+ containerClassName += " xpl-toggle-container--disabled";
21
+ let className = "xpl-toggle";
22
+ if (this.variant === "small")
23
+ className += " xpl-toggle--small";
24
+ return (index.h(index.Host, { class: containerClassName }, (this.heading || this.description) && (index.h("label", { class: {
25
+ "xpl-label": true,
26
+ "xpl-label--disabled": this.disabled
27
+ }, htmlFor: this.id }, this.heading, this.description && index.h("small", { class: {
28
+ "xpl-description": true,
29
+ "xpl-description--disabled": this.disabled
30
+ } }, this.description))), index.h("input", { class: className, type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name }), this.label && index.h("label", { htmlFor: this.id }, this.label)));
31
+ }
32
+ };
33
+
34
+ exports.xpl_toggle = XplToggle;
@@ -6,15 +6,24 @@
6
6
  "./components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js",
7
7
  "./components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js",
8
8
  "./components/xpl-button/xpl-button.js",
9
+ "./components/xpl-button-row/xpl-button-row.js",
9
10
  "./components/xpl-checkbox/xpl-checkbox.js",
10
11
  "./components/xpl-choicelist/xpl-choicelist.js",
11
12
  "./components/xpl-content-area/xpl-content-area.js",
13
+ "./components/xpl-divider/xpl-divider.js",
14
+ "./components/xpl-grid/xpl-grid.js",
15
+ "./components/xpl-grid-item/xpl-grid-item.js",
16
+ "./components/xpl-input/xpl-input.js",
17
+ "./components/xpl-list/xpl-list.js",
12
18
  "./components/xpl-main-nav/xpl-main-nav.js",
13
19
  "./components/xpl-nav-item/xpl-nav-item.js",
14
20
  "./components/xpl-pagination/xpl-pagination.js",
15
21
  "./components/xpl-radio/xpl-radio.js",
16
22
  "./components/xpl-secondary-nav/xpl-secondary-nav.js",
23
+ "./components/xpl-select/xpl-select.js",
17
24
  "./components/xpl-table/xpl-table.js",
25
+ "./components/xpl-tag/xpl-tag.js",
26
+ "./components/xpl-toggle/xpl-toggle.js",
18
27
  "./components/xpl-utility-bar/xpl-utility-bar.js"
19
28
  ],
20
29
  "compiler": {
@@ -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
+ }
@@ -1,15 +1,25 @@
1
- import { Component, Host, h, Prop, State } from "@stencil/core";
1
+ import { Component, Host, h, Prop, State, Event } from "@stencil/core";
2
2
  import { v4 as uuid } from "uuid";
3
3
  export class XplCheckbox {
4
4
  constructor() {
5
5
  this.id = uuid();
6
6
  }
7
7
  render() {
8
- return (h(Host, { class: "xpl-checkbox-container" },
9
- h("input", { class: "xpl-checkbox", type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, name: this.name, required: this.required, value: this.value }),
10
- h("label", { htmlFor: this.id },
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 },
11
18
  h("slot", null),
12
- this.description && h("small", null, this.description))));
19
+ this.description && h("small", { class: {
20
+ "xpl-description": true,
21
+ "xpl-description--disabled": this.disabled
22
+ } }, this.description))));
13
23
  }
14
24
  static get is() { return "xpl-checkbox"; }
15
25
  static get properties() { return {
@@ -115,6 +125,23 @@ export class XplCheckbox {
115
125
  "attribute": "required",
116
126
  "reflect": false
117
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
+ },
118
145
  "value": {
119
146
  "type": "string",
120
147
  "mutable": false,
@@ -136,4 +163,23 @@ export class XplCheckbox {
136
163
  static get states() { return {
137
164
  "id": {}
138
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
+ }]; }
139
185
  }
@@ -1,9 +1,143 @@
1
- import { Component, Host, h } from "@stencil/core";
1
+ /// <reference path="./choice.d.ts"></reference>
2
+ import { Component, Host, h, Prop, State } from "@stencil/core";
2
3
  export class XplChoicelist {
4
+ componentWillLoad() {
5
+ this.selected = this.choices !== undefined && this.choices !== null && this.choices.length > 0 ? this.choices.map(() => false) : [];
6
+ }
3
7
  render() {
4
- return (h(Host, null,
5
- h("slot", null)));
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
+ })))));
6
32
  }
7
33
  static get is() { return "xpl-choicelist"; }
8
- static get encapsulation() { return "shadow"; }
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
+ }; }
9
143
  }
@@ -0,0 +1,30 @@
1
+ import { Component, Host, h, Prop } from '@stencil/core';
2
+ export class XplDivider {
3
+ render() {
4
+ let className = "xpl-divider";
5
+ className += ` xpl-divider--${this.tier}`;
6
+ return (h(Host, { class: className },
7
+ h("span", null,
8
+ h("slot", null))));
9
+ }
10
+ static get is() { return "xpl-divider"; }
11
+ static get properties() { return {
12
+ "tier": {
13
+ "type": "number",
14
+ "mutable": false,
15
+ "complexType": {
16
+ "original": "number",
17
+ "resolved": "number",
18
+ "references": {}
19
+ },
20
+ "required": false,
21
+ "optional": true,
22
+ "docs": {
23
+ "tags": [],
24
+ "text": "The tier should be an integer between 0 and 3.\nTier 0 dividers do not display text, and 1-3 increase\nin size with each increasing tier."
25
+ },
26
+ "attribute": "tier",
27
+ "reflect": false
28
+ }
29
+ }; }
30
+ }
@@ -0,0 +1,32 @@
1
+ /// <reference path="./dropdownchoice.d.ts"></reference>
2
+ import { h } from '@stencil/core';
3
+ export const XplDropdown = ({ active, choices, mode, selected, update, }) => {
4
+ return (h("div", { class: {
5
+ "xpl-dropdown": true,
6
+ "xpl-dropdown--multi": mode === "multi",
7
+ "active": active,
8
+ } },
9
+ h("ul", null, choices.map(({ label, isGroupHeading }, i) => {
10
+ return isGroupHeading ?
11
+ h("span", null, label) :
12
+ h("li", null,
13
+ h("button", { class: {
14
+ selected: selected[i]
15
+ }, onClick: () => {
16
+ let newSelected;
17
+ if (mode === "single") {
18
+ // @ts-expect-error
19
+ newSelected = selected.map((v, j) => {
20
+ return i === j ? !selected[i] : false;
21
+ });
22
+ active = false;
23
+ }
24
+ else if (mode === "multi") {
25
+ newSelected = selected.map((v, j) => {
26
+ return i === j ? !selected[i] : v;
27
+ });
28
+ }
29
+ update(newSelected);
30
+ }, tabIndex: active ? 0 : -1 }, label));
31
+ }))));
32
+ };
@@ -0,0 +1,26 @@
1
+ import { Component, Host, h, Element } from '@stencil/core';
2
+ export class XplGrid {
3
+ componentDidLoad() {
4
+ const items = Array.from(this.container.querySelectorAll(".xpl-grid-item"));
5
+ let lgCounter = 0, mdCounter = 0, smCounter = 0, xsCounter = 0;
6
+ items.forEach(item => {
7
+ lgCounter += +item.getAttribute("lg") || 6;
8
+ mdCounter += +item.getAttribute("md") || 6;
9
+ smCounter += +item.getAttribute("sm") || 6;
10
+ xsCounter += +item.getAttribute("xs") || 6;
11
+ if (lgCounter % 6 === 0)
12
+ item.classList.add("xpl-grid-item-lg-last");
13
+ if (mdCounter % 6 === 0)
14
+ item.classList.add("xpl-grid-item-md-last");
15
+ if (smCounter % 6 === 0)
16
+ item.classList.add("xpl-grid-item-sm-last");
17
+ if (xsCounter % 6 === 0)
18
+ item.classList.add("xpl-grid-item-xs-last");
19
+ });
20
+ }
21
+ render() {
22
+ return (h(Host, { class: "xpl-grid" }));
23
+ }
24
+ static get is() { return "xpl-grid"; }
25
+ static get elementRef() { return "container"; }
26
+ }
@@ -0,0 +1,93 @@
1
+ import { Component, Host, h, Prop } from '@stencil/core';
2
+ export class XplGridItem {
3
+ constructor() {
4
+ this.xs = 6;
5
+ this.sm = 6;
6
+ this.md = 6;
7
+ this.lg = 6;
8
+ }
9
+ render() {
10
+ let className = "xpl-grid-item";
11
+ className += ` xpl-grid-item-xs-${this.xs}`;
12
+ className += ` xpl-grid-item-sm-${this.sm}`;
13
+ className += ` xpl-grid-item-md-${this.md}`;
14
+ className += ` xpl-grid-item-lg-${this.lg}`;
15
+ return (h(Host, { class: className },
16
+ h("slot", null)));
17
+ }
18
+ static get is() { return "xpl-grid-item"; }
19
+ static get properties() { return {
20
+ "xs": {
21
+ "type": "number",
22
+ "mutable": false,
23
+ "complexType": {
24
+ "original": "number",
25
+ "resolved": "number",
26
+ "references": {}
27
+ },
28
+ "required": false,
29
+ "optional": false,
30
+ "docs": {
31
+ "tags": [],
32
+ "text": ""
33
+ },
34
+ "attribute": "xs",
35
+ "reflect": false,
36
+ "defaultValue": "6"
37
+ },
38
+ "sm": {
39
+ "type": "number",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "number",
43
+ "resolved": "number",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "sm",
53
+ "reflect": false,
54
+ "defaultValue": "6"
55
+ },
56
+ "md": {
57
+ "type": "number",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "number",
61
+ "resolved": "number",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "md",
71
+ "reflect": false,
72
+ "defaultValue": "6"
73
+ },
74
+ "lg": {
75
+ "type": "number",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "number",
79
+ "resolved": "number",
80
+ "references": {}
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": ""
87
+ },
88
+ "attribute": "lg",
89
+ "reflect": false,
90
+ "defaultValue": "6"
91
+ }
92
+ }; }
93
+ }