@primer-io/primer-js 0.3.12 → 0.5.0
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/CHANGELOG.md +16 -0
- package/README.md +83 -101
- package/dist/custom-elements.json +1671 -364
- package/dist/jsx/index.d.ts +102 -1
- package/dist/primer-loader.d.ts +687 -14
- package/dist/primer-loader.js +10 -10
- package/dist/vscode.html-custom-data.json +61 -1
- package/dist/web-types.json +219 -6
- package/package.json +5 -3
|
@@ -231,6 +231,43 @@
|
|
|
231
231
|
"attributes": [],
|
|
232
232
|
"references": []
|
|
233
233
|
},
|
|
234
|
+
{
|
|
235
|
+
"name": "primer-select",
|
|
236
|
+
"description": "A native select dropdown component\n---\n\n\n### **Events:**\n - **change** - Fired when selection changes\n- **input** - Fired when input value changes\n- **focus** - Fired when select receives focus\n- **blur** - Fired when select loses focus",
|
|
237
|
+
"attributes": [
|
|
238
|
+
{
|
|
239
|
+
"name": "name",
|
|
240
|
+
"description": "The name attribute for the select element",
|
|
241
|
+
"values": []
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "id",
|
|
245
|
+
"description": "The id attribute for the select element",
|
|
246
|
+
"values": []
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "value",
|
|
250
|
+
"description": "The current value of the select",
|
|
251
|
+
"values": []
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "disabled",
|
|
255
|
+
"description": "Whether the select is disabled",
|
|
256
|
+
"values": []
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "has-error",
|
|
260
|
+
"description": "Whether the select is in an error state",
|
|
261
|
+
"values": []
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "placeholder",
|
|
265
|
+
"description": "Placeholder text for the select",
|
|
266
|
+
"values": []
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"references": []
|
|
270
|
+
},
|
|
234
271
|
{
|
|
235
272
|
"name": "primer-spinner",
|
|
236
273
|
"description": "Spinner component with configurable size and color\nAdapted to work both standalone and within input components\n---\n",
|
|
@@ -264,6 +301,29 @@
|
|
|
264
301
|
],
|
|
265
302
|
"references": []
|
|
266
303
|
},
|
|
304
|
+
{
|
|
305
|
+
"name": "primer-billing-address",
|
|
306
|
+
"description": "BillingAddressComponent provides a form for collecting billing address information.\n\nConfiguration is exclusively server-side via SDK Core's checkoutModules. Field visibility\nis determined by the BILLING_ADDRESS module in the client session configuration.\n---\n\n\n### **Events:**\n - **primer-billing-address-change** - Fired when form data changes\n- **primer-billing-address-submit** - Fired when form is submitted\n\n### **Methods:**\n - **validateForSubmission(): _Promise<boolean>_** - Public method to validate billing address fields\nCalled by the parent form (card-form) when submitting\nReturns true if billing address is valid\nNote: Does NOT call setBillingAddress API - that happens after card validation\n- **submitToSDK(): _Promise<boolean>_** - Public method to submit billing address to SDK Core\nCalled by parent form ONLY after both card and billing address validation pass\n\nNote: headlessUtils is guaranteed to be available when this method is called,\nas the component only renders (and becomes interactive) after initialization task completes.",
|
|
307
|
+
"attributes": [],
|
|
308
|
+
"references": []
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "primer-blik",
|
|
312
|
+
"description": "BLIK Payment Component\n\nConsolidated component handling BLIK payment flow from button click through\npayment completion. Uses a 4-state machine for managing the user experience.\n---\n\n\n### **Events:**\n - **primer-payment-success** - Dispatched on successful payment\n- **primer-payment-error** - Dispatched on payment error",
|
|
313
|
+
"attributes": [
|
|
314
|
+
{
|
|
315
|
+
"name": "paymentMethod",
|
|
316
|
+
"description": "Payment method configuration",
|
|
317
|
+
"values": [{ "name": "InitializedPaymentMethod" }]
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "disabled",
|
|
321
|
+
"description": "Disables component interaction when true",
|
|
322
|
+
"values": []
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"references": []
|
|
326
|
+
},
|
|
267
327
|
{
|
|
268
328
|
"name": "primer-card-form",
|
|
269
329
|
"description": "CardFormComponent serves as a container for card input components.\nIt handles form submission, validation, and provides context to child components.\n---\n",
|
|
@@ -432,7 +492,7 @@
|
|
|
432
492
|
"values": []
|
|
433
493
|
},
|
|
434
494
|
{
|
|
435
|
-
"name": "
|
|
495
|
+
"name": "headlessUtils",
|
|
436
496
|
"values": [{ "name": "HeadlessUtilsContextType" }]
|
|
437
497
|
},
|
|
438
498
|
{
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@primer-io/primer-js",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -573,6 +573,126 @@
|
|
|
573
573
|
"events": [{ "name": "eventName", "type": "CustomEvent" }]
|
|
574
574
|
}
|
|
575
575
|
},
|
|
576
|
+
{
|
|
577
|
+
"name": "primer-select",
|
|
578
|
+
"description": "A native select dropdown component\n---\n\n\n### **Events:**\n - **change** - Fired when selection changes\n- **input** - Fired when input value changes\n- **focus** - Fired when select receives focus\n- **blur** - Fired when select loses focus",
|
|
579
|
+
"doc-url": "",
|
|
580
|
+
"attributes": [
|
|
581
|
+
{
|
|
582
|
+
"name": "name",
|
|
583
|
+
"description": "The name attribute for the select element",
|
|
584
|
+
"value": { "type": "string", "default": "''" }
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"name": "id",
|
|
588
|
+
"description": "The id attribute for the select element",
|
|
589
|
+
"value": { "type": "string", "default": "''" }
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"name": "value",
|
|
593
|
+
"description": "The current value of the select",
|
|
594
|
+
"value": { "type": "string", "default": "''" }
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"name": "disabled",
|
|
598
|
+
"description": "Whether the select is disabled",
|
|
599
|
+
"value": { "type": "boolean", "default": "false" }
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"name": "has-error",
|
|
603
|
+
"description": "Whether the select is in an error state",
|
|
604
|
+
"value": { "type": "boolean", "default": "false" }
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
"name": "placeholder",
|
|
608
|
+
"description": "Placeholder text for the select",
|
|
609
|
+
"value": { "type": "string", "default": "''" }
|
|
610
|
+
}
|
|
611
|
+
],
|
|
612
|
+
"events": [
|
|
613
|
+
{
|
|
614
|
+
"name": "change",
|
|
615
|
+
"type": "CustomEvent",
|
|
616
|
+
"description": "Fired when selection changes"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"name": "input",
|
|
620
|
+
"type": "CustomEvent",
|
|
621
|
+
"description": "Fired when input value changes"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "focus",
|
|
625
|
+
"type": "CustomEvent",
|
|
626
|
+
"description": "Fired when select receives focus"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "blur",
|
|
630
|
+
"type": "CustomEvent",
|
|
631
|
+
"description": "Fired when select loses focus"
|
|
632
|
+
}
|
|
633
|
+
],
|
|
634
|
+
"js": {
|
|
635
|
+
"properties": [
|
|
636
|
+
{
|
|
637
|
+
"name": "name",
|
|
638
|
+
"description": "The name attribute for the select element",
|
|
639
|
+
"type": "string"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "id",
|
|
643
|
+
"description": "The id attribute for the select element",
|
|
644
|
+
"type": "string"
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
"name": "value",
|
|
648
|
+
"description": "The current value of the select",
|
|
649
|
+
"type": "string"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"name": "disabled",
|
|
653
|
+
"description": "Whether the select is disabled",
|
|
654
|
+
"type": "boolean"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"name": "hasError",
|
|
658
|
+
"description": "Whether the select is in an error state",
|
|
659
|
+
"type": "boolean"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"name": "placeholder",
|
|
663
|
+
"description": "Placeholder text for the select",
|
|
664
|
+
"type": "string"
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"name": "options",
|
|
668
|
+
"description": "Array of options for the select",
|
|
669
|
+
"type": "SelectOption[]"
|
|
670
|
+
}
|
|
671
|
+
],
|
|
672
|
+
"events": [
|
|
673
|
+
{
|
|
674
|
+
"name": "change",
|
|
675
|
+
"type": "CustomEvent",
|
|
676
|
+
"description": "Fired when selection changes"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"name": "input",
|
|
680
|
+
"type": "CustomEvent",
|
|
681
|
+
"description": "Fired when input value changes"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "focus",
|
|
685
|
+
"type": "CustomEvent",
|
|
686
|
+
"description": "Fired when select receives focus"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "blur",
|
|
690
|
+
"type": "CustomEvent",
|
|
691
|
+
"description": "Fired when select loses focus"
|
|
692
|
+
}
|
|
693
|
+
]
|
|
694
|
+
}
|
|
695
|
+
},
|
|
576
696
|
{
|
|
577
697
|
"name": "primer-spinner",
|
|
578
698
|
"description": "Spinner component with configurable size and color\nAdapted to work both standalone and within input components\n---\n",
|
|
@@ -663,6 +783,102 @@
|
|
|
663
783
|
]
|
|
664
784
|
}
|
|
665
785
|
},
|
|
786
|
+
{
|
|
787
|
+
"name": "primer-billing-address",
|
|
788
|
+
"description": "BillingAddressComponent provides a form for collecting billing address information.\n\nConfiguration is exclusively server-side via SDK Core's checkoutModules. Field visibility\nis determined by the BILLING_ADDRESS module in the client session configuration.\n---\n\n\n### **Events:**\n - **primer-billing-address-change** - Fired when form data changes\n- **primer-billing-address-submit** - Fired when form is submitted\n\n### **Methods:**\n - **validateForSubmission(): _Promise<boolean>_** - Public method to validate billing address fields\nCalled by the parent form (card-form) when submitting\nReturns true if billing address is valid\nNote: Does NOT call setBillingAddress API - that happens after card validation\n- **submitToSDK(): _Promise<boolean>_** - Public method to submit billing address to SDK Core\nCalled by parent form ONLY after both card and billing address validation pass\n\nNote: headlessUtils is guaranteed to be available when this method is called,\nas the component only renders (and becomes interactive) after initialization task completes.",
|
|
789
|
+
"doc-url": "",
|
|
790
|
+
"attributes": [],
|
|
791
|
+
"events": [
|
|
792
|
+
{
|
|
793
|
+
"name": "primer-billing-address-change",
|
|
794
|
+
"type": "CustomEvent",
|
|
795
|
+
"description": "Fired when form data changes"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "primer-billing-address-submit",
|
|
799
|
+
"type": "CustomEvent",
|
|
800
|
+
"description": "Fired when form is submitted"
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"js": {
|
|
804
|
+
"properties": [
|
|
805
|
+
{
|
|
806
|
+
"name": "configuration",
|
|
807
|
+
"description": "Configuration from SDK Core containing checkoutModules configuration",
|
|
808
|
+
"type": "ConfigurationContextType"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"name": "headlessUtils",
|
|
812
|
+
"description": "Headless SDK utilities for API methods like setBillingAddress",
|
|
813
|
+
"type": "HeadlessUtilsContextType"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"events": [
|
|
817
|
+
{
|
|
818
|
+
"name": "primer-billing-address-change",
|
|
819
|
+
"type": "CustomEvent",
|
|
820
|
+
"description": "Fired when form data changes"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"name": "primer-billing-address-submit",
|
|
824
|
+
"type": "CustomEvent",
|
|
825
|
+
"description": "Fired when form is submitted"
|
|
826
|
+
}
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"name": "primer-blik",
|
|
832
|
+
"description": "BLIK Payment Component\n\nConsolidated component handling BLIK payment flow from button click through\npayment completion. Uses a 4-state machine for managing the user experience.\n---\n\n\n### **Events:**\n - **primer-payment-success** - Dispatched on successful payment\n- **primer-payment-error** - Dispatched on payment error",
|
|
833
|
+
"doc-url": "",
|
|
834
|
+
"attributes": [
|
|
835
|
+
{
|
|
836
|
+
"name": "paymentMethod",
|
|
837
|
+
"description": "Payment method configuration",
|
|
838
|
+
"value": { "type": "InitializedPaymentMethod" }
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"name": "disabled",
|
|
842
|
+
"description": "Disables component interaction when true",
|
|
843
|
+
"value": { "type": "boolean", "default": "false" }
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"events": [
|
|
847
|
+
{
|
|
848
|
+
"name": "primer-payment-success",
|
|
849
|
+
"description": "Dispatched on successful payment"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"name": "primer-payment-error",
|
|
853
|
+
"description": "Dispatched on payment error"
|
|
854
|
+
}
|
|
855
|
+
],
|
|
856
|
+
"js": {
|
|
857
|
+
"properties": [
|
|
858
|
+
{
|
|
859
|
+
"name": "paymentMethod",
|
|
860
|
+
"description": "Payment method configuration",
|
|
861
|
+
"type": "InitializedPaymentMethod"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "disabled",
|
|
865
|
+
"description": "Disables component interaction when true",
|
|
866
|
+
"type": "boolean"
|
|
867
|
+
},
|
|
868
|
+
{ "name": "paymentManagers", "type": "InitializedManagersMap" }
|
|
869
|
+
],
|
|
870
|
+
"events": [
|
|
871
|
+
{
|
|
872
|
+
"name": "primer-payment-success",
|
|
873
|
+
"description": "Dispatched on successful payment"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"name": "primer-payment-error",
|
|
877
|
+
"description": "Dispatched on payment error"
|
|
878
|
+
}
|
|
879
|
+
]
|
|
880
|
+
}
|
|
881
|
+
},
|
|
666
882
|
{
|
|
667
883
|
"name": "primer-card-form",
|
|
668
884
|
"description": "CardFormComponent serves as a container for card input components.\nIt handles form submission, validation, and provides context to child components.\n---\n",
|
|
@@ -1084,7 +1300,7 @@
|
|
|
1084
1300
|
"value": { "type": "string" }
|
|
1085
1301
|
},
|
|
1086
1302
|
{
|
|
1087
|
-
"name": "
|
|
1303
|
+
"name": "headlessUtils",
|
|
1088
1304
|
"value": { "type": "HeadlessUtilsContextType", "default": "null" }
|
|
1089
1305
|
},
|
|
1090
1306
|
{
|
|
@@ -1118,10 +1334,7 @@
|
|
|
1118
1334
|
"description": "The button text to display.\nFalls back to localized default if not explicitly set.",
|
|
1119
1335
|
"type": "string"
|
|
1120
1336
|
},
|
|
1121
|
-
{
|
|
1122
|
-
"name": "headlessInstance",
|
|
1123
|
-
"type": "HeadlessUtilsContextType"
|
|
1124
|
-
},
|
|
1337
|
+
{ "name": "headlessUtils", "type": "HeadlessUtilsContextType" },
|
|
1125
1338
|
{ "name": "clientOptions", "type": "ClientOptionsContextType" },
|
|
1126
1339
|
{ "name": "sdkState", "type": "SdkStateContextType" },
|
|
1127
1340
|
{ "name": "cardFormContext", "type": "CardFormContext | null" },
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer-io/primer-js",
|
|
3
|
-
"description": "Primer
|
|
3
|
+
"description": "Primer Checkout is a web component-based SDK for building secure, customizable, and PCI-compliant checkout experiences. Designed with a modular architecture, it integrates seamlessly with any JavaScript framework and supports multiple payment methods.",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.5.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/primer-loader.js",
|
|
8
8
|
"types": "./dist/primer-loader.d.ts",
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
"src/primer-checkout.ts",
|
|
12
12
|
"**/*.styles.ts",
|
|
13
13
|
"src/atoms/**/*.component.ts",
|
|
14
|
+
"src/atoms/**/*.ts",
|
|
15
|
+
"src/containers/native-payment/components/**/*.ts",
|
|
14
16
|
"src/containers/**/*.component.ts",
|
|
15
|
-
"src/containers
|
|
17
|
+
"src/containers/**/*.ts"
|
|
16
18
|
],
|
|
17
19
|
"publishConfig": {
|
|
18
20
|
"access": "public"
|