@swisspost/design-system-components 1.3.7 → 1.3.8

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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{index-2e693855.js → index-0e16bf18.js} +5 -9
  3. package/dist/cjs/index-0e16bf18.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -10
  5. package/dist/cjs/loader.cjs.js.map +1 -1
  6. package/dist/cjs/{package-7fd2c844.js → package-e69a4462.js} +2 -2
  7. package/dist/cjs/package-e69a4462.js.map +1 -0
  8. package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
  9. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  10. package/dist/cjs/post-components.cjs.js +2 -5
  11. package/dist/cjs/post-components.cjs.js.map +1 -1
  12. package/dist/cjs/post-icon.cjs.entry.js +2 -2
  13. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  14. package/dist/collection/collection-manifest.json +3 -3
  15. package/dist/collection/components/post-collapsible/post-collapsible.js +5 -4
  16. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  17. package/dist/collection/components/post-icon/post-icon.js +5 -4
  18. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  19. package/dist/collection/utils/on-transition-end.js +1 -1
  20. package/dist/collection/utils/property-checkers/check-non-empty.js +1 -1
  21. package/dist/collection/utils/property-checkers/empty-or.js +1 -1
  22. package/dist/collection/utils/property-checkers/index.js +3 -3
  23. package/dist/collection/utils/property-checkers/tests/check-non-empty.spec.js +2 -2
  24. package/dist/collection/utils/property-checkers/tests/check-one-of.spec.js +1 -1
  25. package/dist/collection/utils/property-checkers/tests/check-type.spec.js +1 -1
  26. package/dist/collection/utils/property-checkers/tests/empty-or.spec.js +1 -1
  27. package/dist/collection/utils/tests/should-reduce-motion.spec.js +1 -1
  28. package/dist/components/package.js +1 -1
  29. package/dist/components/package.js.map +1 -1
  30. package/dist/components/post-collapsible.js.map +1 -1
  31. package/dist/components/post-icon.js.map +1 -1
  32. package/dist/docs.d.ts +192 -1
  33. package/dist/docs.json +72 -5
  34. package/dist/esm/{index-cfac2b9c.js → index-fc5f363d.js} +5 -9
  35. package/dist/esm/index-fc5f363d.js.map +1 -0
  36. package/dist/esm/loader.js +2 -11
  37. package/dist/esm/loader.js.map +1 -1
  38. package/dist/esm/{package-bd73aa5f.js → package-e41b18ed.js} +2 -2
  39. package/dist/esm/package-e41b18ed.js.map +1 -0
  40. package/dist/esm/post-collapsible.entry.js +2 -2
  41. package/dist/esm/post-collapsible.entry.js.map +1 -1
  42. package/dist/esm/post-components.js +3 -6
  43. package/dist/esm/post-components.js.map +1 -1
  44. package/dist/esm/post-icon.entry.js +2 -2
  45. package/dist/esm/post-icon.entry.js.map +1 -1
  46. package/dist/post-components/{p-2a5781d1.js → p-0484ba12.js} +2 -2
  47. package/dist/post-components/p-0484ba12.js.map +1 -0
  48. package/dist/post-components/{p-6bc7135d.entry.js → p-23b39cf3.entry.js} +2 -2
  49. package/dist/post-components/p-23b39cf3.entry.js.map +1 -0
  50. package/dist/post-components/{p-d38f726e.entry.js → p-32e2283f.entry.js} +2 -2
  51. package/dist/post-components/p-32e2283f.entry.js.map +1 -0
  52. package/dist/post-components/p-96ca500c.js +3 -0
  53. package/dist/post-components/p-96ca500c.js.map +1 -0
  54. package/dist/post-components/post-components.esm.js +1 -1
  55. package/dist/post-components/post-components.esm.js.map +1 -1
  56. package/package.json +9 -9
  57. package/dist/cjs/index-2e693855.js.map +0 -1
  58. package/dist/cjs/package-7fd2c844.js.map +0 -1
  59. package/dist/esm/index-cfac2b9c.js.map +0 -1
  60. package/dist/esm/package-bd73aa5f.js.map +0 -1
  61. package/dist/esm/polyfills/css-shim.js +0 -1
  62. package/dist/post-components/p-2a5781d1.js.map +0 -1
  63. package/dist/post-components/p-5550fb3f.js +0 -3
  64. package/dist/post-components/p-5550fb3f.js.map +0 -1
  65. package/dist/post-components/p-6bc7135d.entry.js.map +0 -1
  66. package/dist/post-components/p-d38f726e.entry.js.map +0 -1
package/dist/docs.d.ts CHANGED
@@ -3,48 +3,170 @@
3
3
  * This is an autogenerated file created by the Stencil compiler.
4
4
  * DO NOT MODIFY IT MANUALLY
5
5
  */
6
+ import { ComponentCompilerEventComplexType, ComponentCompilerMethodComplexType, ComponentCompilerPropertyComplexType, ComponentCompilerReferencedType } from './stencil-private';
7
+ /**
8
+ * The Type Library holds information about the types which are used in a
9
+ * Stencil project. During compilation, Stencil gathers information about the
10
+ * types which form part of a component's public API, such as properties
11
+ * decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
12
+ * then added to the Type Library, where it can be accessed later on for
13
+ * generating documentation.
14
+ *
15
+ * This information is included in the file written by the `docs-json` output
16
+ * target (see {@link JsonDocs.typeLibrary}).
17
+ */
18
+ export type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
19
+ /**
20
+ * A container for JSDoc metadata for a project
21
+ */
6
22
  export interface JsonDocs {
23
+ /**
24
+ * The metadata for the JSDocs for each component in a Stencil project
25
+ */
7
26
  components: JsonDocsComponent[];
27
+ /**
28
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
29
+ */
8
30
  timestamp: string;
9
31
  compiler: {
32
+ /**
33
+ * The name of the compiler that generated the metadata
34
+ */
10
35
  name: string;
36
+ /**
37
+ * The version of the Stencil compiler that generated the metadata
38
+ */
11
39
  version: string;
40
+ /**
41
+ * The version of TypeScript that was used to generate the metadata
42
+ */
12
43
  typescriptVersion: string;
13
44
  };
45
+ typeLibrary: JsonDocsTypeLibrary;
14
46
  }
47
+ /**
48
+ * Container for JSDoc metadata for a single Stencil component
49
+ */
15
50
  export interface JsonDocsComponent {
51
+ /**
52
+ * The directory containing the Stencil component, minus the file name.
53
+ *
54
+ * @example /workspaces/stencil-project/src/components/my-component
55
+ */
16
56
  dirPath?: string;
57
+ /**
58
+ * The name of the file containing the Stencil component, with no path
59
+ *
60
+ * @example my-component.tsx
61
+ */
17
62
  fileName?: string;
63
+ /**
64
+ * The full path of the file containing the Stencil component
65
+ *
66
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
67
+ */
18
68
  filePath?: string;
69
+ /**
70
+ * The path to the component's `readme.md` file, including the filename
71
+ *
72
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
73
+ */
19
74
  readmePath?: string;
75
+ /**
76
+ * The path to the component's `usage` directory
77
+ *
78
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
79
+ */
20
80
  usagesDir?: string;
81
+ /**
82
+ * The encapsulation strategy for a component
83
+ */
21
84
  encapsulation: 'shadow' | 'scoped' | 'none';
85
+ /**
86
+ * The tag name for the component, for use in HTML
87
+ */
22
88
  tag: string;
89
+ /**
90
+ * The contents of a component's `readme.md` that are user generated.
91
+ *
92
+ * Auto-generated contents are not stored in this reference.
93
+ */
23
94
  readme: string;
95
+ /**
96
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
97
+ */
24
98
  docs: string;
99
+ /**
100
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
101
+ */
25
102
  docsTags: JsonDocsTag[];
26
103
  /**
27
104
  * The text from the class-level JSDoc for a Stencil component, if present.
28
105
  */
29
106
  overview?: string;
107
+ /**
108
+ * A mapping of usage example file names to their contents for the component.
109
+ */
30
110
  usage: JsonDocsUsage;
111
+ /**
112
+ * Array of metadata for a component's `@Prop`s
113
+ */
31
114
  props: JsonDocsProp[];
115
+ /**
116
+ * Array of metadata for a component's `@Method`s
117
+ */
32
118
  methods: JsonDocsMethod[];
119
+ /**
120
+ * Array of metadata for a component's `@Event`s
121
+ */
33
122
  events: JsonDocsEvent[];
123
+ /**
124
+ * Array of metadata for a component's `@Listen` handlers
125
+ */
34
126
  listeners: JsonDocsListener[];
127
+ /**
128
+ * Array of metadata for a component's CSS styling information
129
+ */
35
130
  styles: JsonDocsStyle[];
131
+ /**
132
+ * Array of component Slot information, generated from `@slot` tags
133
+ */
36
134
  slots: JsonDocsSlot[];
135
+ /**
136
+ * Array of component Parts information, generate from `@part` tags
137
+ */
37
138
  parts: JsonDocsPart[];
139
+ /**
140
+ * Array of metadata describing where the current component is used
141
+ */
38
142
  dependents: string[];
143
+ /**
144
+ * Array of metadata listing the components which are used in current component
145
+ */
39
146
  dependencies: string[];
147
+ /**
148
+ * Describes a tree of components coupling
149
+ */
40
150
  dependencyGraph: JsonDocsDependencyGraph;
151
+ /**
152
+ * A deprecation reason/description found following a `@deprecated` tag
153
+ */
41
154
  deprecation?: string;
42
155
  }
43
156
  export interface JsonDocsDependencyGraph {
44
157
  [tagName: string]: string[];
45
158
  }
159
+ /**
160
+ * A descriptor for a single JSDoc tag found in a block comment
161
+ */
46
162
  export interface JsonDocsTag {
163
+ /**
164
+ * The tag name (immediately following the '@')
165
+ */
47
166
  name: string;
167
+ /**
168
+ * The description that immediately follows the tag name
169
+ */
48
170
  text?: string;
49
171
  }
50
172
  export interface JsonDocsValue {
@@ -74,21 +196,65 @@ export interface JsonDocsValue {
74
196
  export interface JsonDocsUsage {
75
197
  [key: string]: string;
76
198
  }
199
+ /**
200
+ * An intermediate representation of a `@Prop` decorated member's JSDoc
201
+ */
77
202
  export interface JsonDocsProp {
203
+ /**
204
+ * the name of the prop
205
+ */
78
206
  name: string;
207
+ complexType?: ComponentCompilerPropertyComplexType;
208
+ /**
209
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
210
+ */
79
211
  type: string;
212
+ /**
213
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
214
+ */
80
215
  mutable: boolean;
81
216
  /**
82
217
  * The name of the attribute that is exposed to configure a compiled web component
83
218
  */
84
219
  attr?: string;
220
+ /**
221
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
222
+ */
85
223
  reflectToAttr: boolean;
224
+ /**
225
+ * the JSDoc description text associated with the prop
226
+ */
86
227
  docs: string;
228
+ /**
229
+ * JSDoc tags associated with the prop
230
+ */
87
231
  docsTags: JsonDocsTag[];
88
- default: string;
232
+ /**
233
+ * The default value of the prop
234
+ */
235
+ default?: string;
236
+ /**
237
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
238
+ */
89
239
  deprecation?: string;
90
240
  values: JsonDocsValue[];
241
+ /**
242
+ * `true` if a component is declared with a '?', `false` otherwise
243
+ *
244
+ * @example
245
+ * ```tsx
246
+ * @Prop() componentProps?: any;
247
+ * ```
248
+ */
91
249
  optional: boolean;
250
+ /**
251
+ * `true` if a component is declared with a '!', `false` otherwise
252
+ *
253
+ * @example
254
+ * ```tsx
255
+ * @Prop() componentProps!: any;
256
+ * ```
257
+ */
92
258
  required: boolean;
93
259
  }
94
260
  export interface JsonDocsMethod {
@@ -99,6 +265,7 @@ export interface JsonDocsMethod {
99
265
  signature: string;
100
266
  returns: JsonDocsMethodReturn;
101
267
  parameters: JsonDocMethodParameter[];
268
+ complexType: ComponentCompilerMethodComplexType;
102
269
  }
103
270
  export interface JsonDocsMethodReturn {
104
271
  type: string;
@@ -114,6 +281,7 @@ export interface JsonDocsEvent {
114
281
  bubbles: boolean;
115
282
  cancelable: boolean;
116
283
  composed: boolean;
284
+ complexType: ComponentCompilerEventComplexType;
117
285
  docs: string;
118
286
  docsTags: JsonDocsTag[];
119
287
  deprecation?: string;
@@ -130,12 +298,35 @@ export interface JsonDocsListener {
130
298
  capture: boolean;
131
299
  passive: boolean;
132
300
  }
301
+ /**
302
+ * A descriptor for a slot
303
+ *
304
+ * Objects of this type are translated from the JSDoc tag, `@slot`
305
+ */
133
306
  export interface JsonDocsSlot {
307
+ /**
308
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
309
+ */
134
310
  name: string;
311
+ /**
312
+ * A textual description of the slot.
313
+ */
135
314
  docs: string;
136
315
  }
316
+ /**
317
+ * A descriptor of a CSS Shadow Part
318
+ *
319
+ * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
320
+ * attribute on a component in TSX
321
+ */
137
322
  export interface JsonDocsPart {
323
+ /**
324
+ * The name of the Shadow part
325
+ */
138
326
  name: string;
327
+ /**
328
+ * A textual description of the Shadow part.
329
+ */
139
330
  docs: string;
140
331
  }
141
332
  export interface StyleDoc {
package/dist/docs.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
- "timestamp": "2023-07-03T08:30:13",
2
+ "timestamp": "2023-07-17T08:58:45",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
- "version": "3.4.0",
5
+ "version": "4.0.1",
6
6
  "typescriptVersion": "5.0.4"
7
7
  },
8
8
  "components": [
9
9
  {
10
- "filePath": "./src/components/post-collapsible/post-collapsible.tsx",
10
+ "filePath": "src/components/post-collapsible/post-collapsible.tsx",
11
11
  "encapsulation": "shadow",
12
12
  "tag": "post-collapsible",
13
13
  "readme": "# post-collapsible\n\n\n",
@@ -18,6 +18,11 @@
18
18
  {
19
19
  "name": "collapsed",
20
20
  "type": "boolean",
21
+ "complexType": {
22
+ "original": "boolean",
23
+ "resolved": "boolean",
24
+ "references": {}
25
+ },
21
26
  "mutable": false,
22
27
  "attr": "collapsed",
23
28
  "reflectToAttr": false,
@@ -35,6 +40,11 @@
35
40
  {
36
41
  "name": "headingLevel",
37
42
  "type": "number",
43
+ "complexType": {
44
+ "original": "number",
45
+ "resolved": "number",
46
+ "references": {}
47
+ },
38
48
  "mutable": false,
39
49
  "attr": "heading-level",
40
50
  "reflectToAttr": false,
@@ -57,6 +67,22 @@
57
67
  "type": "Promise<boolean>",
58
68
  "docs": ""
59
69
  },
70
+ "complexType": {
71
+ "signature": "(open?: boolean) => Promise<boolean>",
72
+ "parameters": [
73
+ {
74
+ "tags": [],
75
+ "text": ""
76
+ }
77
+ ],
78
+ "references": {
79
+ "Promise": {
80
+ "location": "global",
81
+ "id": "global::Promise"
82
+ }
83
+ },
84
+ "return": "Promise<boolean>"
85
+ },
60
86
  "signature": "toggle(open?: boolean) => Promise<boolean>",
61
87
  "parameters": [],
62
88
  "docs": "Triggers the collapse programmatically.",
@@ -73,7 +99,7 @@
73
99
  "dependencyGraph": {}
74
100
  },
75
101
  {
76
- "filePath": "./src/components/post-icon/post-icon.tsx",
102
+ "filePath": "src/components/post-icon/post-icon.tsx",
77
103
  "encapsulation": "shadow",
78
104
  "tag": "post-icon",
79
105
  "readme": "# post-icon\n\nsome content\n",
@@ -89,6 +115,16 @@
89
115
  {
90
116
  "name": "animation",
91
117
  "type": "\"cylon\" | \"cylon-vertical\" | \"fade\" | \"spin\" | \"spin-reverse\" | \"throb\"",
118
+ "complexType": {
119
+ "original": "Animation | null",
120
+ "resolved": "\"cylon\" | \"cylon-vertical\" | \"fade\" | \"spin\" | \"spin-reverse\" | \"throb\"",
121
+ "references": {
122
+ "Animation": {
123
+ "location": "global",
124
+ "id": "global::Animation"
125
+ }
126
+ }
127
+ },
92
128
  "mutable": false,
93
129
  "attr": "animation",
94
130
  "reflectToAttr": false,
@@ -127,6 +163,11 @@
127
163
  {
128
164
  "name": "base",
129
165
  "type": "string",
166
+ "complexType": {
167
+ "original": "string | null",
168
+ "resolved": "string",
169
+ "references": {}
170
+ },
130
171
  "mutable": false,
131
172
  "attr": "base",
132
173
  "reflectToAttr": false,
@@ -144,6 +185,11 @@
144
185
  {
145
186
  "name": "flipH",
146
187
  "type": "boolean",
188
+ "complexType": {
189
+ "original": "boolean",
190
+ "resolved": "boolean",
191
+ "references": {}
192
+ },
147
193
  "mutable": false,
148
194
  "attr": "flip-h",
149
195
  "reflectToAttr": false,
@@ -161,6 +207,11 @@
161
207
  {
162
208
  "name": "flipV",
163
209
  "type": "boolean",
210
+ "complexType": {
211
+ "original": "boolean",
212
+ "resolved": "boolean",
213
+ "references": {}
214
+ },
164
215
  "mutable": false,
165
216
  "attr": "flip-v",
166
217
  "reflectToAttr": false,
@@ -178,6 +229,11 @@
178
229
  {
179
230
  "name": "name",
180
231
  "type": "string",
232
+ "complexType": {
233
+ "original": "string",
234
+ "resolved": "string",
235
+ "references": {}
236
+ },
181
237
  "mutable": false,
182
238
  "attr": "name",
183
239
  "reflectToAttr": false,
@@ -194,6 +250,11 @@
194
250
  {
195
251
  "name": "rotate",
196
252
  "type": "number",
253
+ "complexType": {
254
+ "original": "number | null",
255
+ "resolved": "number",
256
+ "references": {}
257
+ },
197
258
  "mutable": false,
198
259
  "attr": "rotate",
199
260
  "reflectToAttr": false,
@@ -211,6 +272,11 @@
211
272
  {
212
273
  "name": "scale",
213
274
  "type": "number",
275
+ "complexType": {
276
+ "original": "number | null",
277
+ "resolved": "number",
278
+ "references": {}
279
+ },
214
280
  "mutable": false,
215
281
  "attr": "scale",
216
282
  "reflectToAttr": false,
@@ -236,5 +302,6 @@
236
302
  "dependencies": [],
237
303
  "dependencyGraph": {}
238
304
  }
239
- ]
305
+ ],
306
+ "typeLibrary": {}
240
307
  }
@@ -286,9 +286,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
286
286
  }
287
287
  styles.set(scopeId, style);
288
288
  };
289
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
289
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
290
290
  var _a;
291
- let scopeId = getScopeId(cmpMeta);
291
+ const scopeId = getScopeId(cmpMeta);
292
292
  const style = styles.get(scopeId);
293
293
  // if an element is NOT connected then getRootNode() will return the wrong root node
294
294
  // so the fallback is to always use the document for the root node in those cases
@@ -303,11 +303,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
303
303
  }
304
304
  if (!appliedStyles.has(scopeId)) {
305
305
  {
306
- // TODO(STENCIL-659): Remove code implementing the CSS variable shim
307
- {
308
- styleElm = doc.createElement('style');
309
- styleElm.innerHTML = style;
310
- }
306
+ styleElm = doc.createElement('style');
307
+ styleElm.innerHTML = style;
311
308
  // Apply CSP nonce to the style tag if it exists
312
309
  const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
313
310
  if (nonce != null) {
@@ -332,7 +329,6 @@ const attachStyles = (hostRef) => {
332
329
  const flags = cmpMeta.$flags$;
333
330
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
334
331
  const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
335
- // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
336
332
  if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
337
333
  // only required when we're NOT using native shadow dom (slot)
338
334
  // or this browser doesn't support native shadow dom
@@ -1587,4 +1583,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1587
1583
 
1588
1584
  export { Host as H, bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1589
1585
 
1590
- //# sourceMappingURL=index-cfac2b9c.js.map
1586
+ //# sourceMappingURL=index-fc5f363d.js.map