@shopify/polaris-types 1.0.0 → 1.0.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.
- package/README.md +2 -2
- package/dist/polaris.d.ts +34 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @shopify/polaris-types
|
|
2
2
|
|
|
3
|
-
Type definitions for
|
|
3
|
+
Type definitions for [Polaris web components](https://shopify.dev/docs/api/app-home/polaris-web-components).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ npm i -D @shopify/polaris-types
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
Since
|
|
15
|
+
Since Polaris web components are not imported directly, you need to add the types to your TypeScript configuration in one of the following ways:
|
|
16
16
|
|
|
17
17
|
### Method 1: Add to tsconfig.json
|
|
18
18
|
|
package/dist/polaris.d.ts
CHANGED
|
@@ -3408,6 +3408,15 @@ interface ReactProps$M extends Partial<ChoiceProps>, Pick<ChoiceProps$1, 'id' |
|
|
|
3408
3408
|
* any markup or element structure is ignored.
|
|
3409
3409
|
*/
|
|
3410
3410
|
children?: ComponentChildren$1;
|
|
3411
|
+
/**
|
|
3412
|
+
* Additional text to provide context or guidance for the input.
|
|
3413
|
+
*
|
|
3414
|
+
* This text is displayed along with the input and its label
|
|
3415
|
+
* to offer more information or instructions to the user.
|
|
3416
|
+
*
|
|
3417
|
+
* @implementation this content should be linked to the input with an `aria-describedby` attribute.
|
|
3418
|
+
*/
|
|
3419
|
+
details?: ComponentChildren$1;
|
|
3411
3420
|
}
|
|
3412
3421
|
|
|
3413
3422
|
declare class Choice extends PreactCustomElement implements ChoiceProps {
|
|
@@ -3703,7 +3712,7 @@ declare global {
|
|
|
3703
3712
|
declare module 'preact' {
|
|
3704
3713
|
namespace createElement.JSX {
|
|
3705
3714
|
interface IntrinsicElements {
|
|
3706
|
-
[tagName$H]: ReactProps$H
|
|
3715
|
+
[tagName$H]: ReactProps$H & PreactBaseElementProps<ColorPicker>;
|
|
3707
3716
|
}
|
|
3708
3717
|
}
|
|
3709
3718
|
}
|
|
@@ -3741,7 +3750,7 @@ declare global {
|
|
|
3741
3750
|
declare module 'preact' {
|
|
3742
3751
|
namespace createElement.JSX {
|
|
3743
3752
|
interface IntrinsicElements {
|
|
3744
|
-
[tagName$G]: ReactProps$G
|
|
3753
|
+
[tagName$G]: ReactProps$G & PreactBaseElementProps<DateField>;
|
|
3745
3754
|
}
|
|
3746
3755
|
}
|
|
3747
3756
|
}
|
|
@@ -3871,7 +3880,7 @@ declare class DropZone extends BaseClass implements DropZoneProps {
|
|
|
3871
3880
|
oninput: CallbackEventListener<typeof tagName$D>;
|
|
3872
3881
|
ondroprejected: CallbackEventListener<typeof tagName$D>;
|
|
3873
3882
|
get value(): string;
|
|
3874
|
-
/** This sets the input value for a
|
|
3883
|
+
/** This sets the input value for a file type, which cannot be set programatically, so it can only be reset. */
|
|
3875
3884
|
set value(value: '' | null);
|
|
3876
3885
|
get files(): File[];
|
|
3877
3886
|
set files(files: File[]);
|
|
@@ -3891,7 +3900,7 @@ declare global {
|
|
|
3891
3900
|
declare module 'preact' {
|
|
3892
3901
|
namespace createElement.JSX {
|
|
3893
3902
|
interface IntrinsicElements {
|
|
3894
|
-
[tagName$D]: ReactProps$D
|
|
3903
|
+
[tagName$D]: ReactProps$D & PreactBaseElementProps<DropZone>;
|
|
3895
3904
|
}
|
|
3896
3905
|
}
|
|
3897
3906
|
}
|
|
@@ -4084,11 +4093,7 @@ declare module 'preact' {
|
|
|
4084
4093
|
}
|
|
4085
4094
|
}
|
|
4086
4095
|
|
|
4087
|
-
|
|
4088
|
-
interface HeadingProps extends Pick<HeadingProps$1, 'accessibilityRole' | 'accessibilityVisibility' | 'lineClamp'> {
|
|
4089
|
-
accessibilityRole: RequiredHeadingProps['accessibilityRole'];
|
|
4090
|
-
accessibilityVisibility: RequiredHeadingProps['accessibilityVisibility'];
|
|
4091
|
-
lineClamp: RequiredHeadingProps['lineClamp'];
|
|
4096
|
+
interface HeadingProps extends Required<Pick<HeadingProps$1, 'accessibilityRole' | 'accessibilityVisibility' | 'lineClamp'>> {
|
|
4092
4097
|
}
|
|
4093
4098
|
|
|
4094
4099
|
declare const tagName$z = "s-heading";
|
|
@@ -4319,7 +4324,7 @@ declare global {
|
|
|
4319
4324
|
declare module 'preact' {
|
|
4320
4325
|
namespace createElement.JSX {
|
|
4321
4326
|
interface IntrinsicElements {
|
|
4322
|
-
[tagName$u]: ReactProps$u
|
|
4327
|
+
[tagName$u]: ReactProps$u & PreactBaseElementPropsWithChildren<Menu>;
|
|
4323
4328
|
}
|
|
4324
4329
|
}
|
|
4325
4330
|
}
|
|
@@ -4393,10 +4398,11 @@ declare global {
|
|
|
4393
4398
|
|
|
4394
4399
|
declare const hasOpenChildModal: unique symbol;
|
|
4395
4400
|
|
|
4396
|
-
declare const open: unique symbol;
|
|
4397
4401
|
declare const show: unique symbol;
|
|
4398
4402
|
declare const hide: unique symbol;
|
|
4403
|
+
declare const isOpen: unique symbol;
|
|
4399
4404
|
declare const dialog: unique symbol;
|
|
4405
|
+
declare const dismiss: unique symbol;
|
|
4400
4406
|
declare const focusedElement: unique symbol;
|
|
4401
4407
|
declare const onEscape: unique symbol;
|
|
4402
4408
|
declare const nestedModals: unique symbol;
|
|
@@ -4433,7 +4439,9 @@ declare class Modal extends PreactOverlayElement implements ModalProps {
|
|
|
4433
4439
|
/** @private */
|
|
4434
4440
|
[onChildModalChange]: EventListenerOrEventListenerObject;
|
|
4435
4441
|
/** @private */
|
|
4436
|
-
get [
|
|
4442
|
+
get [isOpen](): boolean;
|
|
4443
|
+
/** @private */
|
|
4444
|
+
[dismiss](): void;
|
|
4437
4445
|
/** @private */
|
|
4438
4446
|
get [hasOpenChildModal](): boolean;
|
|
4439
4447
|
/** @private */
|
|
@@ -4457,7 +4465,7 @@ declare global {
|
|
|
4457
4465
|
declare module 'preact' {
|
|
4458
4466
|
namespace createElement.JSX {
|
|
4459
4467
|
interface IntrinsicElements {
|
|
4460
|
-
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'>;
|
|
4468
|
+
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'> & PreactBaseElementPropsWithChildren<Modal>;
|
|
4461
4469
|
}
|
|
4462
4470
|
}
|
|
4463
4471
|
}
|
|
@@ -4673,7 +4681,6 @@ declare module 'preact' {
|
|
|
4673
4681
|
|
|
4674
4682
|
interface ParagraphProps extends Required<Pick<ParagraphProps$1, 'accessibilityVisibility' | 'fontVariantNumeric' | 'tone' | 'dir' | 'color' | 'lineClamp'>> {
|
|
4675
4683
|
color: Extract<ParagraphProps$1['color'], 'base' | 'subdued'>;
|
|
4676
|
-
lineClamp: Extract<ParagraphProps$1['lineClamp'], number>;
|
|
4677
4684
|
}
|
|
4678
4685
|
|
|
4679
4686
|
declare const tagName$m = "s-paragraph";
|
|
@@ -4798,7 +4805,7 @@ declare global {
|
|
|
4798
4805
|
declare module 'preact' {
|
|
4799
4806
|
namespace createElement.JSX {
|
|
4800
4807
|
interface IntrinsicElements {
|
|
4801
|
-
[tagName$j]: ReactProps$j
|
|
4808
|
+
[tagName$j]: ReactProps$j & PreactBaseElementPropsWithChildren<QueryContainer>;
|
|
4802
4809
|
}
|
|
4803
4810
|
}
|
|
4804
4811
|
}
|
|
@@ -5747,28 +5754,28 @@ declare global {
|
|
|
5747
5754
|
declare module 'react' {
|
|
5748
5755
|
namespace JSX {
|
|
5749
5756
|
interface IntrinsicElements {
|
|
5750
|
-
[tagName$H]: ReactProps$H
|
|
5757
|
+
[tagName$H]: ReactProps$H & ReactBaseElementProps<ColorPicker>;
|
|
5751
5758
|
}
|
|
5752
5759
|
}
|
|
5753
5760
|
}
|
|
5754
5761
|
declare global {
|
|
5755
5762
|
namespace JSX {
|
|
5756
5763
|
interface IntrinsicElements {
|
|
5757
|
-
[tagName$H]: ReactProps$H
|
|
5764
|
+
[tagName$H]: ReactProps$H & ReactBaseElementProps<ColorPicker>;
|
|
5758
5765
|
}
|
|
5759
5766
|
}
|
|
5760
5767
|
}
|
|
5761
5768
|
declare module 'react' {
|
|
5762
5769
|
namespace JSX {
|
|
5763
5770
|
interface IntrinsicElements {
|
|
5764
|
-
[tagName$G]: ReactProps$G
|
|
5771
|
+
[tagName$G]: ReactProps$G & ReactBaseElementProps<DateField>;
|
|
5765
5772
|
}
|
|
5766
5773
|
}
|
|
5767
5774
|
}
|
|
5768
5775
|
declare global {
|
|
5769
5776
|
namespace JSX {
|
|
5770
5777
|
interface IntrinsicElements {
|
|
5771
|
-
[tagName$G]: ReactProps$G
|
|
5778
|
+
[tagName$G]: ReactProps$G & ReactBaseElementProps<DateField>;
|
|
5772
5779
|
}
|
|
5773
5780
|
}
|
|
5774
5781
|
}
|
|
@@ -5803,14 +5810,14 @@ declare global {
|
|
|
5803
5810
|
declare module 'react' {
|
|
5804
5811
|
namespace JSX {
|
|
5805
5812
|
interface IntrinsicElements {
|
|
5806
|
-
[tagName$D]: ReactProps$D
|
|
5813
|
+
[tagName$D]: ReactProps$D & ReactBaseElementProps<DropZone>;
|
|
5807
5814
|
}
|
|
5808
5815
|
}
|
|
5809
5816
|
}
|
|
5810
5817
|
declare global {
|
|
5811
5818
|
namespace JSX {
|
|
5812
5819
|
interface IntrinsicElements {
|
|
5813
|
-
[tagName$D]: ReactProps$D
|
|
5820
|
+
[tagName$D]: ReactProps$D & ReactBaseElementProps<DropZone>;
|
|
5814
5821
|
}
|
|
5815
5822
|
}
|
|
5816
5823
|
}
|
|
@@ -5929,28 +5936,28 @@ declare global {
|
|
|
5929
5936
|
declare module 'react' {
|
|
5930
5937
|
namespace JSX {
|
|
5931
5938
|
interface IntrinsicElements {
|
|
5932
|
-
[tagName$u]: ReactProps$u
|
|
5939
|
+
[tagName$u]: ReactProps$u & ReactBaseElementPropsWithChildren<Menu>;
|
|
5933
5940
|
}
|
|
5934
5941
|
}
|
|
5935
5942
|
}
|
|
5936
5943
|
declare global {
|
|
5937
5944
|
namespace JSX {
|
|
5938
5945
|
interface IntrinsicElements {
|
|
5939
|
-
[tagName$u]: ReactProps$u
|
|
5946
|
+
[tagName$u]: ReactProps$u & ReactBaseElementPropsWithChildren<Menu>;
|
|
5940
5947
|
}
|
|
5941
5948
|
}
|
|
5942
5949
|
}
|
|
5943
5950
|
declare module 'react' {
|
|
5944
5951
|
namespace JSX {
|
|
5945
5952
|
interface IntrinsicElements {
|
|
5946
|
-
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'>;
|
|
5953
|
+
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'> & ReactBaseElementPropsWithChildren<Modal>;
|
|
5947
5954
|
}
|
|
5948
5955
|
}
|
|
5949
5956
|
}
|
|
5950
5957
|
declare global {
|
|
5951
5958
|
namespace JSX {
|
|
5952
5959
|
interface IntrinsicElements {
|
|
5953
|
-
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'>;
|
|
5960
|
+
[tagName$t]: Omit<ReactProps$t, 'primaryAction' | 'secondaryActions'> & ReactBaseElementPropsWithChildren<Modal>;
|
|
5954
5961
|
}
|
|
5955
5962
|
}
|
|
5956
5963
|
}
|
|
@@ -6083,14 +6090,14 @@ declare global {
|
|
|
6083
6090
|
declare module 'react' {
|
|
6084
6091
|
namespace JSX {
|
|
6085
6092
|
interface IntrinsicElements {
|
|
6086
|
-
[tagName$j]: ReactProps$j
|
|
6093
|
+
[tagName$j]: ReactProps$j & ReactBaseElementPropsWithChildren<QueryContainer>;
|
|
6087
6094
|
}
|
|
6088
6095
|
}
|
|
6089
6096
|
}
|
|
6090
6097
|
declare global {
|
|
6091
6098
|
namespace JSX {
|
|
6092
6099
|
interface IntrinsicElements {
|
|
6093
|
-
[tagName$j]: ReactProps$j
|
|
6100
|
+
[tagName$j]: ReactProps$j & ReactBaseElementPropsWithChildren<QueryContainer>;
|
|
6094
6101
|
}
|
|
6095
6102
|
}
|
|
6096
6103
|
}
|