@shopify/polaris-types 1.0.4 → 1.0.6
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.
- package/README.md +16 -0
- package/dist/custom-elements.json +12130 -0
- package/dist/polaris.d.ts +401 -118
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -31,3 +31,19 @@ Add the following line at the top of your TypeScript files where you need the ty
|
|
|
31
31
|
```typescript
|
|
32
32
|
/// <reference types="@shopify/polaris-types" />
|
|
33
33
|
```
|
|
34
|
+
|
|
35
|
+
## Custom Elements Manifest
|
|
36
|
+
|
|
37
|
+
This package includes a [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest) (`custom-elements.json`) that describes the Polaris web components in a standardized format. The manifest is generated using [`@custom-elements-manifest/analyzer`](https://github.com/open-wc/custom-elements-manifest) with custom Polaris plugins.
|
|
38
|
+
|
|
39
|
+
IDE extensions and other tooling that understand the CEM format can use this to provide autocomplete, documentation, and other rich features for Polaris web components.
|
|
40
|
+
|
|
41
|
+
### Accessing the manifest
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
// Via package.json "customElements" field (recommended for tooling)
|
|
45
|
+
// The field points to: ./dist/custom-elements.json
|
|
46
|
+
|
|
47
|
+
// Via direct import
|
|
48
|
+
import cem from '@shopify/polaris-types/custom-elements';
|
|
49
|
+
```
|