@primer-io/primer-js 0.14.0 → 0.14.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/CHANGELOG.md +6 -0
- package/dist/custom-elements.json +368 -368
- package/dist/jsx/index.d.ts +21 -21
- package/dist/primer-loader.js +2 -2
- package/dist/vscode.html-custom-data.json +14 -14
- package/dist/web-types.json +53 -53
- package/package.json +1 -1
|
@@ -10908,21 +10908,42 @@
|
|
|
10908
10908
|
},
|
|
10909
10909
|
{
|
|
10910
10910
|
"kind": "javascript-module",
|
|
10911
|
-
"path": "src/containers/
|
|
10911
|
+
"path": "src/containers/card-form/card-form-context.ts",
|
|
10912
|
+
"declarations": [
|
|
10913
|
+
{
|
|
10914
|
+
"kind": "variable",
|
|
10915
|
+
"name": "cardFormContext"
|
|
10916
|
+
}
|
|
10917
|
+
],
|
|
10918
|
+
"exports": [
|
|
10919
|
+
{
|
|
10920
|
+
"kind": "js",
|
|
10921
|
+
"name": "cardFormContext",
|
|
10922
|
+
"declaration": {
|
|
10923
|
+
"name": "cardFormContext",
|
|
10924
|
+
"module": "src/containers/card-form/card-form-context.ts"
|
|
10925
|
+
}
|
|
10926
|
+
}
|
|
10927
|
+
]
|
|
10928
|
+
},
|
|
10929
|
+
{
|
|
10930
|
+
"kind": "javascript-module",
|
|
10931
|
+
"path": "src/containers/card-form/card-form.component.ts",
|
|
10912
10932
|
"declarations": [
|
|
10913
10933
|
{
|
|
10914
10934
|
"kind": "class",
|
|
10915
|
-
"description": "
|
|
10916
|
-
"name": "
|
|
10935
|
+
"description": "CardFormComponent serves as a container for card input components.\nIt handles form submission, validation, and provides context to child components.",
|
|
10936
|
+
"name": "CardFormComponent",
|
|
10917
10937
|
"members": [
|
|
10918
10938
|
{
|
|
10919
10939
|
"kind": "field",
|
|
10920
|
-
"name": "
|
|
10940
|
+
"name": "hideLabels",
|
|
10921
10941
|
"type": {
|
|
10922
|
-
"text": "
|
|
10942
|
+
"text": "boolean"
|
|
10923
10943
|
},
|
|
10924
|
-
"
|
|
10925
|
-
"attribute": "
|
|
10944
|
+
"default": "false",
|
|
10945
|
+
"attribute": "hide-labels",
|
|
10946
|
+
"reflects": true
|
|
10926
10947
|
},
|
|
10927
10948
|
{
|
|
10928
10949
|
"kind": "field",
|
|
@@ -10931,200 +10952,296 @@
|
|
|
10931
10952
|
"text": "boolean"
|
|
10932
10953
|
},
|
|
10933
10954
|
"default": "false",
|
|
10934
|
-
"description": "Disables component interaction when true",
|
|
10935
10955
|
"attribute": "disabled"
|
|
10936
10956
|
},
|
|
10937
10957
|
{
|
|
10938
10958
|
"kind": "field",
|
|
10939
|
-
"name": "
|
|
10959
|
+
"name": "hasAssignedContent",
|
|
10940
10960
|
"type": {
|
|
10941
|
-
"text": "
|
|
10961
|
+
"text": "boolean"
|
|
10942
10962
|
},
|
|
10943
|
-
"
|
|
10963
|
+
"privacy": "private",
|
|
10964
|
+
"default": "false",
|
|
10965
|
+
"description": "Tracks whether custom content has been provided via slot"
|
|
10944
10966
|
},
|
|
10945
10967
|
{
|
|
10946
10968
|
"kind": "field",
|
|
10947
|
-
"name": "
|
|
10969
|
+
"name": "selectedCardNetwork",
|
|
10948
10970
|
"type": {
|
|
10949
|
-
"text": "
|
|
10971
|
+
"text": "string | null"
|
|
10950
10972
|
},
|
|
10951
10973
|
"privacy": "private",
|
|
10952
|
-
"default": "
|
|
10974
|
+
"default": "null"
|
|
10953
10975
|
},
|
|
10954
10976
|
{
|
|
10955
10977
|
"kind": "field",
|
|
10956
|
-
"name": "
|
|
10978
|
+
"name": "formErrorMessage",
|
|
10957
10979
|
"type": {
|
|
10958
|
-
"text": "string"
|
|
10980
|
+
"text": "string | null"
|
|
10959
10981
|
},
|
|
10960
10982
|
"privacy": "private",
|
|
10961
|
-
"default": "
|
|
10983
|
+
"default": "null",
|
|
10984
|
+
"description": "Form-level error message to display"
|
|
10962
10985
|
},
|
|
10963
10986
|
{
|
|
10964
10987
|
"kind": "field",
|
|
10965
|
-
"name": "
|
|
10988
|
+
"name": "paymentMethodSelectionSent",
|
|
10966
10989
|
"type": {
|
|
10967
|
-
"text": "
|
|
10990
|
+
"text": "boolean"
|
|
10968
10991
|
},
|
|
10969
10992
|
"privacy": "private",
|
|
10970
|
-
"default": "
|
|
10993
|
+
"default": "false",
|
|
10994
|
+
"description": "Flag to track if PAYMENT_METHOD_SELECTION event has been sent"
|
|
10971
10995
|
},
|
|
10972
10996
|
{
|
|
10973
10997
|
"kind": "field",
|
|
10974
|
-
"name": "
|
|
10998
|
+
"name": "paymentManagers",
|
|
10975
10999
|
"type": {
|
|
10976
|
-
"text": "
|
|
11000
|
+
"text": "InitializedManagersMap"
|
|
10977
11001
|
},
|
|
10978
|
-
"
|
|
10979
|
-
"
|
|
11002
|
+
"default": "new Map()",
|
|
11003
|
+
"description": "Payment managers injected from context",
|
|
11004
|
+
"attribute": "paymentManagers"
|
|
10980
11005
|
},
|
|
10981
11006
|
{
|
|
10982
11007
|
"kind": "field",
|
|
10983
|
-
"name": "
|
|
11008
|
+
"name": "clientOptions",
|
|
10984
11009
|
"type": {
|
|
10985
|
-
"text": "
|
|
11010
|
+
"text": "ClientOptionsContextType"
|
|
11011
|
+
},
|
|
11012
|
+
"default": "null",
|
|
11013
|
+
"description": "Client options for configuration"
|
|
11014
|
+
},
|
|
11015
|
+
{
|
|
11016
|
+
"kind": "field",
|
|
11017
|
+
"name": "headlessUtils",
|
|
11018
|
+
"type": {
|
|
11019
|
+
"text": "HeadlessUtilsContextType"
|
|
11020
|
+
},
|
|
11021
|
+
"default": "null",
|
|
11022
|
+
"description": "Headless utils for accessing server configuration"
|
|
11023
|
+
},
|
|
11024
|
+
{
|
|
11025
|
+
"kind": "field",
|
|
11026
|
+
"name": "analyticsUtils",
|
|
11027
|
+
"type": {
|
|
11028
|
+
"text": "AnalyticsContextType"
|
|
10986
11029
|
},
|
|
11030
|
+
"default": "null",
|
|
11031
|
+
"description": "Analytics utils for sending analytics events"
|
|
11032
|
+
},
|
|
11033
|
+
{
|
|
11034
|
+
"kind": "field",
|
|
11035
|
+
"name": "contextEventsController",
|
|
11036
|
+
"type": {
|
|
11037
|
+
"text": "EventsContextType"
|
|
11038
|
+
},
|
|
11039
|
+
"default": "null",
|
|
11040
|
+
"description": "Events controller from context for receiving forwarded events"
|
|
11041
|
+
},
|
|
11042
|
+
{
|
|
11043
|
+
"kind": "field",
|
|
11044
|
+
"name": "cardFormProvider",
|
|
10987
11045
|
"privacy": "private",
|
|
10988
|
-
"
|
|
11046
|
+
"readonly": true,
|
|
11047
|
+
"default": "new ContextProvider(this, { context: cardFormContext, initialValue: null, })",
|
|
11048
|
+
"description": "Context provider for card form data"
|
|
10989
11049
|
},
|
|
10990
11050
|
{
|
|
10991
11051
|
"kind": "field",
|
|
10992
|
-
"name": "
|
|
11052
|
+
"name": "shouldShowCardholderName",
|
|
11053
|
+
"type": {
|
|
11054
|
+
"text": "boolean"
|
|
11055
|
+
},
|
|
11056
|
+
"description": "Determines whether to show the cardholder name field\nUses client configuration with fallback to default (true)",
|
|
11057
|
+
"readonly": true
|
|
11058
|
+
},
|
|
11059
|
+
{
|
|
11060
|
+
"kind": "field",
|
|
11061
|
+
"name": "shouldRequireCardholderName",
|
|
11062
|
+
"type": {
|
|
11063
|
+
"text": "boolean"
|
|
11064
|
+
},
|
|
11065
|
+
"description": "Determines whether the cardholder name field is required\nUses client configuration with fallback to default (false)",
|
|
11066
|
+
"readonly": true
|
|
11067
|
+
},
|
|
11068
|
+
{
|
|
11069
|
+
"kind": "field",
|
|
11070
|
+
"name": "eventsController",
|
|
10993
11071
|
"privacy": "private",
|
|
10994
|
-
"
|
|
10995
|
-
"
|
|
11072
|
+
"readonly": true,
|
|
11073
|
+
"default": "new PrimerEventsController(this)",
|
|
11074
|
+
"description": "Events controller for dispatching form events"
|
|
10996
11075
|
},
|
|
10997
11076
|
{
|
|
10998
11077
|
"kind": "field",
|
|
10999
|
-
"name": "
|
|
11078
|
+
"name": "_contextCardSubmitListener",
|
|
11079
|
+
"type": {
|
|
11080
|
+
"text": "((event: CustomEvent) => void) | null"
|
|
11081
|
+
},
|
|
11000
11082
|
"privacy": "private",
|
|
11001
|
-
"
|
|
11083
|
+
"default": "null",
|
|
11084
|
+
"description": "External event listener reference for cleanup"
|
|
11002
11085
|
},
|
|
11003
11086
|
{
|
|
11004
11087
|
"kind": "field",
|
|
11005
|
-
"name": "
|
|
11088
|
+
"name": "_isHandlingContextEvent",
|
|
11089
|
+
"type": {
|
|
11090
|
+
"text": "boolean"
|
|
11091
|
+
},
|
|
11006
11092
|
"privacy": "private",
|
|
11007
|
-
"
|
|
11093
|
+
"default": "false",
|
|
11094
|
+
"description": "Flag to prevent circular event loop when handling events"
|
|
11008
11095
|
},
|
|
11009
11096
|
{
|
|
11010
11097
|
"kind": "field",
|
|
11011
|
-
"name": "
|
|
11098
|
+
"name": "inputControllers",
|
|
11012
11099
|
"privacy": "private",
|
|
11013
|
-
"
|
|
11100
|
+
"readonly": true,
|
|
11101
|
+
"default": "new Map< HostedInputType, IHostedInputController >()",
|
|
11102
|
+
"description": "Registry for input controllers to enable context-driven meta state management"
|
|
11014
11103
|
},
|
|
11015
11104
|
{
|
|
11016
11105
|
"kind": "field",
|
|
11017
|
-
"name": "
|
|
11106
|
+
"name": "setupCardFormTask",
|
|
11018
11107
|
"privacy": "private",
|
|
11019
|
-
"
|
|
11108
|
+
"readonly": true,
|
|
11109
|
+
"default": "new Task(this, { task: ([cardManager]) => { if (!cardManager?.manager) return initialState; const { manager } = cardManager; const hostedInputs = manager.createHostedInputs(); const { cardNumberInput, expiryInput, cvvInput } = hostedInputs; this.cardFormProvider.setValue({ // Temporarily set any so we can toggle between sdk v2 and new sdk core cardholderNameInput: ( hostedInputs as { cardholderNameInput?: IHeadlessHostedInput } ).cardholderNameInput, cardNumberInput, expiryInput, cvvInput, setCardholderName: (val: string) => { manager.setCardholderName(val); if (this.shouldRequireCardholderName) { manager.validate?.().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => manager.validate(), submit: (args) => manager.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) return; errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.paymentManagers.get('PAYMENT_CARD')], })",
|
|
11110
|
+
"description": "Task to set up the card form with hosted inputs"
|
|
11020
11111
|
},
|
|
11021
11112
|
{
|
|
11022
11113
|
"kind": "method",
|
|
11023
|
-
"name": "
|
|
11114
|
+
"name": "sendPaymentMethodSelectionEvent",
|
|
11024
11115
|
"privacy": "private",
|
|
11025
11116
|
"return": {
|
|
11026
11117
|
"type": {
|
|
11027
11118
|
"text": "void"
|
|
11028
11119
|
}
|
|
11029
11120
|
},
|
|
11030
|
-
"description": "
|
|
11121
|
+
"description": "Sends PAYMENT_METHOD_SELECTION analytics event when user first interacts with card form"
|
|
11031
11122
|
},
|
|
11032
11123
|
{
|
|
11033
11124
|
"kind": "method",
|
|
11034
|
-
"name": "
|
|
11125
|
+
"name": "checkAndSendPaymentDetailsEnteredEvent",
|
|
11035
11126
|
"privacy": "private",
|
|
11036
11127
|
"return": {
|
|
11037
11128
|
"type": {
|
|
11038
11129
|
"text": "void"
|
|
11039
11130
|
}
|
|
11040
11131
|
},
|
|
11041
|
-
"description": "
|
|
11132
|
+
"description": "Checks if all required fields are filled and sends PAYMENT_DETAILS_ENTERED event"
|
|
11042
11133
|
},
|
|
11043
11134
|
{
|
|
11044
|
-
"kind": "
|
|
11045
|
-
"name": "
|
|
11046
|
-
"
|
|
11047
|
-
|
|
11048
|
-
"type": {
|
|
11049
|
-
"text": "Promise<void>"
|
|
11050
|
-
}
|
|
11135
|
+
"kind": "field",
|
|
11136
|
+
"name": "paymentDetailsEnteredSent",
|
|
11137
|
+
"type": {
|
|
11138
|
+
"text": "boolean"
|
|
11051
11139
|
},
|
|
11052
|
-
"
|
|
11140
|
+
"privacy": "private",
|
|
11141
|
+
"default": "false"
|
|
11053
11142
|
},
|
|
11054
11143
|
{
|
|
11055
11144
|
"kind": "method",
|
|
11056
|
-
"name": "
|
|
11145
|
+
"name": "sendPaymentDetailsEnteredEvent",
|
|
11057
11146
|
"privacy": "private",
|
|
11058
11147
|
"return": {
|
|
11059
11148
|
"type": {
|
|
11060
|
-
"text": "
|
|
11149
|
+
"text": "void"
|
|
11061
11150
|
}
|
|
11062
11151
|
},
|
|
11063
|
-
"description": "
|
|
11152
|
+
"description": "Sends PAYMENT_DETAILS_ENTERED analytics event when all payment details are complete and valid"
|
|
11153
|
+
},
|
|
11154
|
+
{
|
|
11155
|
+
"kind": "field",
|
|
11156
|
+
"name": "handleSlotButtonClick",
|
|
11157
|
+
"privacy": "private",
|
|
11158
|
+
"description": "Handles click events from slotted content.\nSupports both native <button> and custom <primer-button> elements."
|
|
11159
|
+
},
|
|
11160
|
+
{
|
|
11161
|
+
"kind": "field",
|
|
11162
|
+
"name": "handleDirectSubmit",
|
|
11163
|
+
"privacy": "private",
|
|
11164
|
+
"description": "Handles direct submit events from child components\nThis is a backup method to catch all possible submission events"
|
|
11064
11165
|
},
|
|
11065
11166
|
{
|
|
11066
11167
|
"kind": "method",
|
|
11067
|
-
"name": "
|
|
11168
|
+
"name": "setupContextEventListeners",
|
|
11068
11169
|
"privacy": "private",
|
|
11069
11170
|
"return": {
|
|
11070
11171
|
"type": {
|
|
11071
|
-
"text": "
|
|
11172
|
+
"text": "void"
|
|
11072
11173
|
}
|
|
11073
11174
|
},
|
|
11074
|
-
"description": "
|
|
11175
|
+
"description": "Sets up event listeners for context-forwarded events"
|
|
11075
11176
|
},
|
|
11076
11177
|
{
|
|
11077
11178
|
"kind": "method",
|
|
11078
|
-
"name": "
|
|
11179
|
+
"name": "cleanupContextEventListeners",
|
|
11079
11180
|
"privacy": "private",
|
|
11080
11181
|
"return": {
|
|
11081
11182
|
"type": {
|
|
11082
|
-
"text": "
|
|
11183
|
+
"text": "void"
|
|
11083
11184
|
}
|
|
11084
11185
|
},
|
|
11085
|
-
"description": "
|
|
11186
|
+
"description": "Cleans up context event listeners"
|
|
11187
|
+
},
|
|
11188
|
+
{
|
|
11189
|
+
"kind": "field",
|
|
11190
|
+
"name": "handleContextCardSubmit",
|
|
11191
|
+
"privacy": "private",
|
|
11192
|
+
"description": "Handles primer:card-submit events received from the events context\nThis allows the card form to respond to external submit triggers"
|
|
11086
11193
|
},
|
|
11087
11194
|
{
|
|
11088
11195
|
"kind": "method",
|
|
11089
|
-
"name": "
|
|
11196
|
+
"name": "isSubmitButton",
|
|
11090
11197
|
"privacy": "private",
|
|
11091
11198
|
"return": {
|
|
11092
11199
|
"type": {
|
|
11093
|
-
"text": "
|
|
11200
|
+
"text": "boolean"
|
|
11094
11201
|
}
|
|
11095
11202
|
},
|
|
11096
|
-
"
|
|
11203
|
+
"parameters": [
|
|
11204
|
+
{
|
|
11205
|
+
"name": "button",
|
|
11206
|
+
"type": {
|
|
11207
|
+
"text": "HTMLElement"
|
|
11208
|
+
}
|
|
11209
|
+
}
|
|
11210
|
+
],
|
|
11211
|
+
"description": "Determines if a button is a submit button based on its attributes"
|
|
11212
|
+
},
|
|
11213
|
+
{
|
|
11214
|
+
"kind": "field",
|
|
11215
|
+
"name": "onSlotChange",
|
|
11216
|
+
"privacy": "private",
|
|
11217
|
+
"description": "Handles slot change events to detect custom content"
|
|
11097
11218
|
},
|
|
11098
11219
|
{
|
|
11099
11220
|
"kind": "method",
|
|
11100
|
-
"name": "
|
|
11221
|
+
"name": "submitCardPayment",
|
|
11101
11222
|
"privacy": "private",
|
|
11102
11223
|
"return": {
|
|
11103
11224
|
"type": {
|
|
11104
|
-
"text": "
|
|
11225
|
+
"text": "Promise<void>"
|
|
11105
11226
|
}
|
|
11106
11227
|
},
|
|
11107
|
-
"description": "
|
|
11108
|
-
}
|
|
11109
|
-
],
|
|
11110
|
-
"events": [
|
|
11111
|
-
{
|
|
11112
|
-
"description": "Dispatched on successful payment",
|
|
11113
|
-
"name": "primer-payment-success"
|
|
11228
|
+
"description": "Handles the card form submission.\nValidates the form and dispatches either a submit success or errors event."
|
|
11114
11229
|
},
|
|
11115
11230
|
{
|
|
11116
|
-
"
|
|
11117
|
-
"name": "
|
|
11231
|
+
"kind": "field",
|
|
11232
|
+
"name": "handleFormSubmit",
|
|
11233
|
+
"privacy": "private",
|
|
11234
|
+
"description": "Event handler for form submission\nHandles both native form submissions and custom events"
|
|
11118
11235
|
}
|
|
11119
11236
|
],
|
|
11120
11237
|
"attributes": [
|
|
11121
11238
|
{
|
|
11122
|
-
"name": "
|
|
11239
|
+
"name": "hide-labels",
|
|
11123
11240
|
"type": {
|
|
11124
|
-
"text": "
|
|
11241
|
+
"text": "boolean"
|
|
11125
11242
|
},
|
|
11126
|
-
"
|
|
11127
|
-
"fieldName": "
|
|
11243
|
+
"default": "false",
|
|
11244
|
+
"fieldName": "hideLabels"
|
|
11128
11245
|
},
|
|
11129
11246
|
{
|
|
11130
11247
|
"name": "disabled",
|
|
@@ -11132,111 +11249,145 @@
|
|
|
11132
11249
|
"text": "boolean"
|
|
11133
11250
|
},
|
|
11134
11251
|
"default": "false",
|
|
11135
|
-
"description": "Disables component interaction when true",
|
|
11136
11252
|
"fieldName": "disabled"
|
|
11253
|
+
},
|
|
11254
|
+
{
|
|
11255
|
+
"name": "paymentManagers",
|
|
11256
|
+
"type": {
|
|
11257
|
+
"text": "InitializedManagersMap"
|
|
11258
|
+
},
|
|
11259
|
+
"default": "new Map()",
|
|
11260
|
+
"description": "Payment managers injected from context",
|
|
11261
|
+
"fieldName": "paymentManagers"
|
|
11137
11262
|
}
|
|
11138
11263
|
],
|
|
11139
11264
|
"superclass": {
|
|
11140
11265
|
"name": "LitElement",
|
|
11141
11266
|
"package": "lit"
|
|
11142
11267
|
},
|
|
11143
|
-
"tagName": "primer-
|
|
11268
|
+
"tagName": "primer-card-form",
|
|
11144
11269
|
"customElement": true
|
|
11145
11270
|
}
|
|
11146
11271
|
],
|
|
11147
11272
|
"exports": [
|
|
11148
11273
|
{
|
|
11149
11274
|
"kind": "js",
|
|
11150
|
-
"name": "
|
|
11275
|
+
"name": "CardFormComponent",
|
|
11151
11276
|
"declaration": {
|
|
11152
|
-
"name": "
|
|
11153
|
-
"module": "src/containers/
|
|
11277
|
+
"name": "CardFormComponent",
|
|
11278
|
+
"module": "src/containers/card-form/card-form.component.ts"
|
|
11154
11279
|
}
|
|
11155
11280
|
},
|
|
11156
11281
|
{
|
|
11157
11282
|
"kind": "custom-element-definition",
|
|
11158
|
-
"name": "primer-
|
|
11283
|
+
"name": "primer-card-form",
|
|
11159
11284
|
"declaration": {
|
|
11160
|
-
"name": "
|
|
11161
|
-
"module": "src/containers/
|
|
11285
|
+
"name": "CardFormComponent",
|
|
11286
|
+
"module": "src/containers/card-form/card-form.component.ts"
|
|
11162
11287
|
}
|
|
11163
11288
|
}
|
|
11164
11289
|
]
|
|
11165
11290
|
},
|
|
11166
11291
|
{
|
|
11167
11292
|
"kind": "javascript-module",
|
|
11168
|
-
"path": "src/containers/
|
|
11169
|
-
"declarations": [
|
|
11170
|
-
{
|
|
11171
|
-
"kind": "variable",
|
|
11172
|
-
"name": "styles",
|
|
11173
|
-
"default": "css` :host { display: flex; width: 100%; } .blik-container { width: 100%; display: flex; flex-direction: column; transition: all var(--primer-animation-duration) var(--primer-animation-easing); } .blik-container.expanded { border-radius: var(--primer-radius-medium); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); padding: var(--primer-space-large); } /* Button styles (collapsed state) */ primer-button.blik-button { width: 100%; } /* Override primer-button part styles for BLIK branding */ primer-button.blik-button::part(button) { /* BLIK brand requirement: Black background (#000000) with white logo */ background-color: #000000; border: none; color: var(--primer-color-text-primary); padding: 2px; display: flex; align-items: center; justify-content: center; gap: var(--primer-space-small); /* Fixed height for button - matches redirect payment method calculation */ height: calc( ${unsafeCSS(PAYMENT_METHOD_LINE_HEIGHT)} + calc(2 * var(--primer-space-medium)) ); flex-shrink: 0; /* Prevent button from shrinking when form appears */ } /* Image container for button logo */ .image-container { display: flex; justify-content: center; align-items: center; min-width: 100px; height: 100%; flex-shrink: 0; flex-grow: 1; } /* Button logo */ img { max-width: 100px; width: 100%; height: auto; object-fit: cover; max-height: 98%; } /* Expanded content (form, loading, error states) */ .blik-expanded-content { width: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--primer-animation-duration) var(--primer-animation-easing); overflow: hidden; margin-top: var(--primer-space-medium); } .blik-container.expanded .blik-expanded-content { grid-template-rows: 1fr; } .blik-content-wrapper { overflow: hidden; } /* Input wrapper */ .blik-input-wrapper { display: flex; flex-direction: column; gap: var(--primer-space-small); } /* Input label */ .blik-label { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); } /* Input field */ .blik-input { width: 100%; padding: var(--primer-space-medium); font-family: var(--primer-typography-body-large-font); font-size: var(--primer-typography-body-large-size); font-weight: var(--primer-typography-body-large-weight); line-height: var(--primer-typography-body-large-line-height); /* Increase spacing between digits for better 6-digit code readability */ letter-spacing: 0.25em; text-align: center; color: var(--primer-color-text-primary); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); border-radius: var(--primer-radius-medium); outline: none; transition: border-color var(--primer-animation-duration) var(--primer-animation-easing); } .blik-input::placeholder { color: var(--primer-color-text-secondary); /* Reduce placeholder visibility to emphasize user input */ opacity: 0.5; } .blik-input:focus { border-color: var(--primer-color-border-outlined-focus); } .blik-input:disabled { background-color: var(--primer-color-background-outlined-disabled); border-color: var(--primer-color-border-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Loading state */ .blik-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--primer-space-large); padding: var(--primer-space-xlarge) var(--primer-space-medium); } /* Timeout warning */ .blik-timeout-warning { margin-top: var(--primer-space-medium); padding: var(--primer-space-small); font-size: var(--primer-typography-body-small-size); color: var(--primer-color-text-warning); text-align: center; border-radius: var(--primer-radius-small); background-color: var(--primer-color-surface-warning); } /* Error state */ .blik-error { display: flex; flex-direction: column; align-items: center; gap: var(--primer-space-medium); } .blik-error-message { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); text-align: center; } /* Retry button */ .blik-retry-button { padding: var(--primer-space-medium) var(--primer-space-large); font-family: var(--primer-typography-title-large-font); font-size: var(--primer-typography-title-large-size); font-weight: var(--primer-typography-title-large-weight); line-height: var(--primer-typography-title-large-line-height); color: var(--primer-color-background-outlined-default); background-color: var(--primer-color-brand); border: none; border-radius: var(--primer-radius-medium); cursor: pointer; outline: none; transition: filter var(--primer-animation-duration) var(--primer-animation-easing); } .blik-retry-button:hover:not(:disabled) { filter: brightness(105%); } .blik-retry-button:active:not(:disabled) { filter: brightness(98%); } .blik-retry-button:focus-visible { outline: 2px solid var(--primer-color-brand); outline-offset: 2px; } .blik-retry-button:disabled { background-color: var(--primer-color-background-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Disabled state styling */ :host([disabled]) { opacity: 0.6; cursor: not-allowed; } :host([disabled]) primer-button::part(button) { pointer-events: none; cursor: not-allowed; } :host([disabled]) img { filter: grayscale(100%); } /* Responsive typography for larger screens */ @media (min-width: 768px) { .blik-input { font-size: var(--primer-typography-title-large-size); } } `"
|
|
11174
|
-
}
|
|
11175
|
-
],
|
|
11293
|
+
"path": "src/containers/card-form/card-form.styles.ts",
|
|
11294
|
+
"declarations": [],
|
|
11176
11295
|
"exports": [
|
|
11177
11296
|
{
|
|
11178
11297
|
"kind": "js",
|
|
11179
|
-
"name": "
|
|
11298
|
+
"name": "default",
|
|
11180
11299
|
"declaration": {
|
|
11181
|
-
"
|
|
11182
|
-
"module": "src/containers/blik/blik.styles.ts"
|
|
11300
|
+
"module": "src/containers/card-form/card-form.styles.ts"
|
|
11183
11301
|
}
|
|
11184
11302
|
}
|
|
11185
11303
|
]
|
|
11186
11304
|
},
|
|
11187
11305
|
{
|
|
11188
11306
|
"kind": "javascript-module",
|
|
11189
|
-
"path": "src/containers/
|
|
11307
|
+
"path": "src/containers/card-form/card-form.ts",
|
|
11190
11308
|
"declarations": [],
|
|
11191
11309
|
"exports": [
|
|
11192
11310
|
{
|
|
11193
11311
|
"kind": "js",
|
|
11194
|
-
"name": "
|
|
11312
|
+
"name": "CardFormCardNumber",
|
|
11195
11313
|
"declaration": {
|
|
11196
|
-
"name": "
|
|
11197
|
-
"module": "
|
|
11314
|
+
"name": "CardFormCardNumber",
|
|
11315
|
+
"module": "./components"
|
|
11198
11316
|
}
|
|
11199
|
-
}
|
|
11200
|
-
]
|
|
11201
|
-
},
|
|
11202
|
-
{
|
|
11203
|
-
"kind": "javascript-module",
|
|
11204
|
-
"path": "src/containers/card-form/card-form-context.ts",
|
|
11205
|
-
"declarations": [
|
|
11317
|
+
},
|
|
11206
11318
|
{
|
|
11207
|
-
"kind": "
|
|
11208
|
-
"name": "
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11319
|
+
"kind": "js",
|
|
11320
|
+
"name": "CardFormCVV",
|
|
11321
|
+
"declaration": {
|
|
11322
|
+
"name": "CardFormCVV",
|
|
11323
|
+
"module": "./components"
|
|
11324
|
+
}
|
|
11325
|
+
},
|
|
11212
11326
|
{
|
|
11213
11327
|
"kind": "js",
|
|
11214
|
-
"name": "
|
|
11328
|
+
"name": "CardFormExpiry",
|
|
11215
11329
|
"declaration": {
|
|
11216
|
-
"name": "
|
|
11217
|
-
"module": "
|
|
11330
|
+
"name": "CardFormExpiry",
|
|
11331
|
+
"module": "./components"
|
|
11332
|
+
}
|
|
11333
|
+
},
|
|
11334
|
+
{
|
|
11335
|
+
"kind": "js",
|
|
11336
|
+
"name": "CardFormName",
|
|
11337
|
+
"declaration": {
|
|
11338
|
+
"name": "CardFormName",
|
|
11339
|
+
"module": "./components"
|
|
11340
|
+
}
|
|
11341
|
+
},
|
|
11342
|
+
{
|
|
11343
|
+
"kind": "js",
|
|
11344
|
+
"name": "CardFormSubmit",
|
|
11345
|
+
"declaration": {
|
|
11346
|
+
"name": "CardFormSubmit",
|
|
11347
|
+
"module": "./components"
|
|
11348
|
+
}
|
|
11349
|
+
},
|
|
11350
|
+
{
|
|
11351
|
+
"kind": "js",
|
|
11352
|
+
"name": "CardFormCardNetworkSelector",
|
|
11353
|
+
"declaration": {
|
|
11354
|
+
"name": "CardFormCardNetworkSelector",
|
|
11355
|
+
"module": "./components"
|
|
11356
|
+
}
|
|
11357
|
+
},
|
|
11358
|
+
{
|
|
11359
|
+
"kind": "js",
|
|
11360
|
+
"name": "CardForm",
|
|
11361
|
+
"declaration": {
|
|
11362
|
+
"name": "CardFormComponent",
|
|
11363
|
+
"module": "src/containers/card-form/card-form.ts"
|
|
11218
11364
|
}
|
|
11219
11365
|
}
|
|
11220
11366
|
]
|
|
11221
11367
|
},
|
|
11222
11368
|
{
|
|
11223
11369
|
"kind": "javascript-module",
|
|
11224
|
-
"path": "src/containers/card-form/
|
|
11370
|
+
"path": "src/containers/card-form/types.ts",
|
|
11371
|
+
"declarations": [],
|
|
11372
|
+
"exports": []
|
|
11373
|
+
},
|
|
11374
|
+
{
|
|
11375
|
+
"kind": "javascript-module",
|
|
11376
|
+
"path": "src/containers/blik/blik.component.ts",
|
|
11225
11377
|
"declarations": [
|
|
11226
11378
|
{
|
|
11227
11379
|
"kind": "class",
|
|
11228
|
-
"description": "
|
|
11229
|
-
"name": "
|
|
11380
|
+
"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.",
|
|
11381
|
+
"name": "BlikComponent",
|
|
11230
11382
|
"members": [
|
|
11231
11383
|
{
|
|
11232
11384
|
"kind": "field",
|
|
11233
|
-
"name": "
|
|
11385
|
+
"name": "paymentMethod",
|
|
11234
11386
|
"type": {
|
|
11235
|
-
"text": "
|
|
11387
|
+
"text": "InitializedPaymentMethod"
|
|
11236
11388
|
},
|
|
11237
|
-
"
|
|
11238
|
-
"attribute": "
|
|
11239
|
-
"reflects": true
|
|
11389
|
+
"description": "Payment method configuration",
|
|
11390
|
+
"attribute": "paymentMethod"
|
|
11240
11391
|
},
|
|
11241
11392
|
{
|
|
11242
11393
|
"kind": "field",
|
|
@@ -11245,296 +11396,200 @@
|
|
|
11245
11396
|
"text": "boolean"
|
|
11246
11397
|
},
|
|
11247
11398
|
"default": "false",
|
|
11399
|
+
"description": "Disables component interaction when true",
|
|
11248
11400
|
"attribute": "disabled"
|
|
11249
11401
|
},
|
|
11250
|
-
{
|
|
11251
|
-
"kind": "field",
|
|
11252
|
-
"name": "hasAssignedContent",
|
|
11253
|
-
"type": {
|
|
11254
|
-
"text": "boolean"
|
|
11255
|
-
},
|
|
11256
|
-
"privacy": "private",
|
|
11257
|
-
"default": "false",
|
|
11258
|
-
"description": "Tracks whether custom content has been provided via slot"
|
|
11259
|
-
},
|
|
11260
|
-
{
|
|
11261
|
-
"kind": "field",
|
|
11262
|
-
"name": "selectedCardNetwork",
|
|
11263
|
-
"type": {
|
|
11264
|
-
"text": "string | null"
|
|
11265
|
-
},
|
|
11266
|
-
"privacy": "private",
|
|
11267
|
-
"default": "null"
|
|
11268
|
-
},
|
|
11269
|
-
{
|
|
11270
|
-
"kind": "field",
|
|
11271
|
-
"name": "formErrorMessage",
|
|
11272
|
-
"type": {
|
|
11273
|
-
"text": "string | null"
|
|
11274
|
-
},
|
|
11275
|
-
"privacy": "private",
|
|
11276
|
-
"default": "null",
|
|
11277
|
-
"description": "Form-level error message to display"
|
|
11278
|
-
},
|
|
11279
|
-
{
|
|
11280
|
-
"kind": "field",
|
|
11281
|
-
"name": "paymentMethodSelectionSent",
|
|
11282
|
-
"type": {
|
|
11283
|
-
"text": "boolean"
|
|
11284
|
-
},
|
|
11285
|
-
"privacy": "private",
|
|
11286
|
-
"default": "false",
|
|
11287
|
-
"description": "Flag to track if PAYMENT_METHOD_SELECTION event has been sent"
|
|
11288
|
-
},
|
|
11289
11402
|
{
|
|
11290
11403
|
"kind": "field",
|
|
11291
11404
|
"name": "paymentManagers",
|
|
11292
11405
|
"type": {
|
|
11293
11406
|
"text": "InitializedManagersMap"
|
|
11294
11407
|
},
|
|
11295
|
-
"default": "new Map()"
|
|
11296
|
-
"description": "Payment managers injected from context",
|
|
11297
|
-
"attribute": "paymentManagers"
|
|
11298
|
-
},
|
|
11299
|
-
{
|
|
11300
|
-
"kind": "field",
|
|
11301
|
-
"name": "clientOptions",
|
|
11302
|
-
"type": {
|
|
11303
|
-
"text": "ClientOptionsContextType"
|
|
11304
|
-
},
|
|
11305
|
-
"default": "null",
|
|
11306
|
-
"description": "Client options for configuration"
|
|
11408
|
+
"default": "new Map()"
|
|
11307
11409
|
},
|
|
11308
11410
|
{
|
|
11309
11411
|
"kind": "field",
|
|
11310
|
-
"name": "
|
|
11412
|
+
"name": "currentState",
|
|
11311
11413
|
"type": {
|
|
11312
|
-
"text": "
|
|
11414
|
+
"text": "BlikState"
|
|
11313
11415
|
},
|
|
11314
|
-
"
|
|
11315
|
-
"
|
|
11416
|
+
"privacy": "private",
|
|
11417
|
+
"default": "'collapsed'"
|
|
11316
11418
|
},
|
|
11317
11419
|
{
|
|
11318
11420
|
"kind": "field",
|
|
11319
|
-
"name": "
|
|
11421
|
+
"name": "blikCode",
|
|
11320
11422
|
"type": {
|
|
11321
|
-
"text": "
|
|
11423
|
+
"text": "string"
|
|
11322
11424
|
},
|
|
11323
|
-
"
|
|
11324
|
-
"
|
|
11425
|
+
"privacy": "private",
|
|
11426
|
+
"default": "''"
|
|
11325
11427
|
},
|
|
11326
11428
|
{
|
|
11327
11429
|
"kind": "field",
|
|
11328
|
-
"name": "
|
|
11430
|
+
"name": "errorMessage",
|
|
11329
11431
|
"type": {
|
|
11330
|
-
"text": "
|
|
11432
|
+
"text": "string"
|
|
11331
11433
|
},
|
|
11332
|
-
"default": "null",
|
|
11333
|
-
"description": "Events controller from context for receiving forwarded events"
|
|
11334
|
-
},
|
|
11335
|
-
{
|
|
11336
|
-
"kind": "field",
|
|
11337
|
-
"name": "cardFormProvider",
|
|
11338
11434
|
"privacy": "private",
|
|
11339
|
-
"
|
|
11340
|
-
"default": "new ContextProvider(this, { context: cardFormContext, initialValue: null, })",
|
|
11341
|
-
"description": "Context provider for card form data"
|
|
11435
|
+
"default": "''"
|
|
11342
11436
|
},
|
|
11343
11437
|
{
|
|
11344
11438
|
"kind": "field",
|
|
11345
|
-
"name": "
|
|
11439
|
+
"name": "pollingDuration",
|
|
11346
11440
|
"type": {
|
|
11347
|
-
"text": "
|
|
11441
|
+
"text": "number"
|
|
11348
11442
|
},
|
|
11349
|
-
"
|
|
11350
|
-
"
|
|
11443
|
+
"privacy": "private",
|
|
11444
|
+
"default": "0"
|
|
11351
11445
|
},
|
|
11352
11446
|
{
|
|
11353
11447
|
"kind": "field",
|
|
11354
|
-
"name": "
|
|
11448
|
+
"name": "pollingTimer",
|
|
11355
11449
|
"type": {
|
|
11356
|
-
"text": "
|
|
11450
|
+
"text": "number | null"
|
|
11357
11451
|
},
|
|
11358
|
-
"
|
|
11359
|
-
"
|
|
11452
|
+
"privacy": "private",
|
|
11453
|
+
"default": "null"
|
|
11360
11454
|
},
|
|
11361
11455
|
{
|
|
11362
11456
|
"kind": "field",
|
|
11363
|
-
"name": "
|
|
11457
|
+
"name": "loadManagerTask",
|
|
11364
11458
|
"privacy": "private",
|
|
11365
|
-
"
|
|
11366
|
-
"
|
|
11367
|
-
"description": "Events controller for dispatching form events"
|
|
11459
|
+
"default": "new Task(this, { args: () => [this.paymentMethod?.type], task: ([type]) => { if (!type) { return initialState; } const managerEntry = this.paymentManagers.get(type); if (!managerEntry) { throw new Error('BLIK payment method manager not initialized'); } // TypeScript narrows the union type based on the payment method type check if (managerEntry.type !== 'ADYEN_BLIK') { throw new Error('Invalid payment method type for BLIK component'); } return managerEntry.manager; }, })",
|
|
11460
|
+
"description": "Manager loading task\nValidates BLIK manager exists before allowing payment flow\n\nThis Task provides reactive validation of manager availability:\n- Automatically re-runs when paymentMethod or paymentManagers change\n- Provides type-safe access to the BLIK manager\n- Enables early error detection before user interaction\n\nUnlike native payment methods (Apple Pay, Google Pay, PayPal) which use a\ntwo-task pattern (manager loading + button rendering), BLIK only needs the\nmanager loading task because it renders its own UI via Lit templates."
|
|
11368
11461
|
},
|
|
11369
11462
|
{
|
|
11370
11463
|
"kind": "field",
|
|
11371
|
-
"name": "
|
|
11372
|
-
"type": {
|
|
11373
|
-
"text": "((event: CustomEvent) => void) | null"
|
|
11374
|
-
},
|
|
11464
|
+
"name": "handleButtonClick",
|
|
11375
11465
|
"privacy": "private",
|
|
11376
|
-
"
|
|
11377
|
-
"description": "External event listener reference for cleanup"
|
|
11466
|
+
"description": "Handles button click to toggle between collapsed and expanded states"
|
|
11378
11467
|
},
|
|
11379
11468
|
{
|
|
11380
11469
|
"kind": "field",
|
|
11381
|
-
"name": "
|
|
11382
|
-
"type": {
|
|
11383
|
-
"text": "boolean"
|
|
11384
|
-
},
|
|
11470
|
+
"name": "handleCollapse",
|
|
11385
11471
|
"privacy": "private",
|
|
11386
|
-
"
|
|
11387
|
-
"description": "Flag to prevent circular event loop when handling events"
|
|
11472
|
+
"description": "Handles collapsing the form back to button-only view\nResets form state when user clicks button to collapse"
|
|
11388
11473
|
},
|
|
11389
11474
|
{
|
|
11390
11475
|
"kind": "field",
|
|
11391
|
-
"name": "
|
|
11476
|
+
"name": "handleInput",
|
|
11392
11477
|
"privacy": "private",
|
|
11393
|
-
"
|
|
11394
|
-
"default": "new Map< HostedInputType, IHostedInputController >()",
|
|
11395
|
-
"description": "Registry for input controllers to enable context-driven meta state management"
|
|
11478
|
+
"description": "Handles input changes, validates numeric input, and auto-submits on 6 digits"
|
|
11396
11479
|
},
|
|
11397
11480
|
{
|
|
11398
11481
|
"kind": "field",
|
|
11399
|
-
"name": "
|
|
11482
|
+
"name": "handleRetry",
|
|
11400
11483
|
"privacy": "private",
|
|
11401
|
-
"
|
|
11402
|
-
"default": "new Task(this, { task: ([cardManager]) => { if (!cardManager?.manager) return initialState; const { manager } = cardManager; const hostedInputs = manager.createHostedInputs(); const { cardNumberInput, expiryInput, cvvInput } = hostedInputs; this.cardFormProvider.setValue({ // Temporarily set any so we can toggle between sdk v2 and new sdk core cardholderNameInput: ( hostedInputs as { cardholderNameInput?: IHeadlessHostedInput } ).cardholderNameInput, cardNumberInput, expiryInput, cvvInput, setCardholderName: (val: string) => { manager.setCardholderName(val); if (this.shouldRequireCardholderName) { manager.validate?.().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => manager.validate(), submit: (args) => manager.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) return; errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.paymentManagers.get('PAYMENT_CARD')], })",
|
|
11403
|
-
"description": "Task to set up the card form with hosted inputs"
|
|
11484
|
+
"description": "Handles retry button click"
|
|
11404
11485
|
},
|
|
11405
11486
|
{
|
|
11406
11487
|
"kind": "method",
|
|
11407
|
-
"name": "
|
|
11488
|
+
"name": "startPollingTimer",
|
|
11408
11489
|
"privacy": "private",
|
|
11409
11490
|
"return": {
|
|
11410
11491
|
"type": {
|
|
11411
11492
|
"text": "void"
|
|
11412
11493
|
}
|
|
11413
11494
|
},
|
|
11414
|
-
"description": "
|
|
11495
|
+
"description": "Starts polling timer to track payment duration"
|
|
11415
11496
|
},
|
|
11416
11497
|
{
|
|
11417
11498
|
"kind": "method",
|
|
11418
|
-
"name": "
|
|
11499
|
+
"name": "stopPollingTimer",
|
|
11419
11500
|
"privacy": "private",
|
|
11420
11501
|
"return": {
|
|
11421
11502
|
"type": {
|
|
11422
11503
|
"text": "void"
|
|
11423
11504
|
}
|
|
11424
11505
|
},
|
|
11425
|
-
"description": "
|
|
11426
|
-
},
|
|
11427
|
-
{
|
|
11428
|
-
"kind": "field",
|
|
11429
|
-
"name": "paymentDetailsEnteredSent",
|
|
11430
|
-
"type": {
|
|
11431
|
-
"text": "boolean"
|
|
11432
|
-
},
|
|
11433
|
-
"privacy": "private",
|
|
11434
|
-
"default": "false"
|
|
11506
|
+
"description": "Stops and resets polling timer"
|
|
11435
11507
|
},
|
|
11436
11508
|
{
|
|
11437
11509
|
"kind": "method",
|
|
11438
|
-
"name": "
|
|
11510
|
+
"name": "submitBlikCode",
|
|
11439
11511
|
"privacy": "private",
|
|
11440
11512
|
"return": {
|
|
11441
11513
|
"type": {
|
|
11442
|
-
"text": "void"
|
|
11514
|
+
"text": "Promise<void>"
|
|
11443
11515
|
}
|
|
11444
11516
|
},
|
|
11445
|
-
"description": "
|
|
11446
|
-
},
|
|
11447
|
-
{
|
|
11448
|
-
"kind": "field",
|
|
11449
|
-
"name": "handleSlotButtonClick",
|
|
11450
|
-
"privacy": "private",
|
|
11451
|
-
"description": "Handles click events from slotted content.\nSupports both native <button> and custom <primer-button> elements."
|
|
11452
|
-
},
|
|
11453
|
-
{
|
|
11454
|
-
"kind": "field",
|
|
11455
|
-
"name": "handleDirectSubmit",
|
|
11456
|
-
"privacy": "private",
|
|
11457
|
-
"description": "Handles direct submit events from child components\nThis is a backup method to catch all possible submission events"
|
|
11517
|
+
"description": "Validates and submits the BLIK code"
|
|
11458
11518
|
},
|
|
11459
11519
|
{
|
|
11460
11520
|
"kind": "method",
|
|
11461
|
-
"name": "
|
|
11521
|
+
"name": "renderCollapsed",
|
|
11462
11522
|
"privacy": "private",
|
|
11463
11523
|
"return": {
|
|
11464
11524
|
"type": {
|
|
11465
|
-
"text": "
|
|
11525
|
+
"text": "TemplateResult"
|
|
11466
11526
|
}
|
|
11467
11527
|
},
|
|
11468
|
-
"description": "
|
|
11528
|
+
"description": "Renders the collapsed button state"
|
|
11469
11529
|
},
|
|
11470
11530
|
{
|
|
11471
11531
|
"kind": "method",
|
|
11472
|
-
"name": "
|
|
11532
|
+
"name": "renderExpandedInput",
|
|
11473
11533
|
"privacy": "private",
|
|
11474
11534
|
"return": {
|
|
11475
11535
|
"type": {
|
|
11476
|
-
"text": "
|
|
11536
|
+
"text": "TemplateResult"
|
|
11477
11537
|
}
|
|
11478
11538
|
},
|
|
11479
|
-
"description": "
|
|
11480
|
-
},
|
|
11481
|
-
{
|
|
11482
|
-
"kind": "field",
|
|
11483
|
-
"name": "handleContextCardSubmit",
|
|
11484
|
-
"privacy": "private",
|
|
11485
|
-
"description": "Handles primer:card-submit events received from the events context\nThis allows the card form to respond to external submit triggers"
|
|
11539
|
+
"description": "Renders the expanded input state"
|
|
11486
11540
|
},
|
|
11487
11541
|
{
|
|
11488
11542
|
"kind": "method",
|
|
11489
|
-
"name": "
|
|
11543
|
+
"name": "renderLoading",
|
|
11490
11544
|
"privacy": "private",
|
|
11491
11545
|
"return": {
|
|
11492
11546
|
"type": {
|
|
11493
|
-
"text": "
|
|
11547
|
+
"text": "TemplateResult"
|
|
11494
11548
|
}
|
|
11495
11549
|
},
|
|
11496
|
-
"
|
|
11497
|
-
{
|
|
11498
|
-
"name": "button",
|
|
11499
|
-
"type": {
|
|
11500
|
-
"text": "HTMLElement"
|
|
11501
|
-
}
|
|
11502
|
-
}
|
|
11503
|
-
],
|
|
11504
|
-
"description": "Determines if a button is a submit button based on its attributes"
|
|
11550
|
+
"description": "Renders the loading state"
|
|
11505
11551
|
},
|
|
11506
11552
|
{
|
|
11507
|
-
"kind": "
|
|
11508
|
-
"name": "
|
|
11553
|
+
"kind": "method",
|
|
11554
|
+
"name": "renderError",
|
|
11509
11555
|
"privacy": "private",
|
|
11510
|
-
"
|
|
11556
|
+
"return": {
|
|
11557
|
+
"type": {
|
|
11558
|
+
"text": "TemplateResult"
|
|
11559
|
+
}
|
|
11560
|
+
},
|
|
11561
|
+
"description": "Renders the error state"
|
|
11511
11562
|
},
|
|
11512
11563
|
{
|
|
11513
11564
|
"kind": "method",
|
|
11514
|
-
"name": "
|
|
11565
|
+
"name": "renderExpandedState",
|
|
11515
11566
|
"privacy": "private",
|
|
11516
11567
|
"return": {
|
|
11517
11568
|
"type": {
|
|
11518
|
-
"text": "
|
|
11569
|
+
"text": "TemplateResult | typeof nothing"
|
|
11519
11570
|
}
|
|
11520
11571
|
},
|
|
11521
|
-
"description": "
|
|
11572
|
+
"description": "Renders the appropriate expanded state based on current state"
|
|
11573
|
+
}
|
|
11574
|
+
],
|
|
11575
|
+
"events": [
|
|
11576
|
+
{
|
|
11577
|
+
"description": "Dispatched on successful payment",
|
|
11578
|
+
"name": "primer-payment-success"
|
|
11522
11579
|
},
|
|
11523
11580
|
{
|
|
11524
|
-
"
|
|
11525
|
-
"name": "
|
|
11526
|
-
"privacy": "private",
|
|
11527
|
-
"description": "Event handler for form submission\nHandles both native form submissions and custom events"
|
|
11581
|
+
"description": "Dispatched on payment error",
|
|
11582
|
+
"name": "primer-payment-error"
|
|
11528
11583
|
}
|
|
11529
11584
|
],
|
|
11530
11585
|
"attributes": [
|
|
11531
11586
|
{
|
|
11532
|
-
"name": "
|
|
11587
|
+
"name": "paymentMethod",
|
|
11533
11588
|
"type": {
|
|
11534
|
-
"text": "
|
|
11589
|
+
"text": "InitializedPaymentMethod"
|
|
11535
11590
|
},
|
|
11536
|
-
"
|
|
11537
|
-
"fieldName": "
|
|
11591
|
+
"description": "Payment method configuration",
|
|
11592
|
+
"fieldName": "paymentMethod"
|
|
11538
11593
|
},
|
|
11539
11594
|
{
|
|
11540
11595
|
"name": "disabled",
|
|
@@ -11542,128 +11597,73 @@
|
|
|
11542
11597
|
"text": "boolean"
|
|
11543
11598
|
},
|
|
11544
11599
|
"default": "false",
|
|
11600
|
+
"description": "Disables component interaction when true",
|
|
11545
11601
|
"fieldName": "disabled"
|
|
11546
|
-
},
|
|
11547
|
-
{
|
|
11548
|
-
"name": "paymentManagers",
|
|
11549
|
-
"type": {
|
|
11550
|
-
"text": "InitializedManagersMap"
|
|
11551
|
-
},
|
|
11552
|
-
"default": "new Map()",
|
|
11553
|
-
"description": "Payment managers injected from context",
|
|
11554
|
-
"fieldName": "paymentManagers"
|
|
11555
11602
|
}
|
|
11556
11603
|
],
|
|
11557
11604
|
"superclass": {
|
|
11558
11605
|
"name": "LitElement",
|
|
11559
11606
|
"package": "lit"
|
|
11560
11607
|
},
|
|
11561
|
-
"tagName": "primer-
|
|
11608
|
+
"tagName": "primer-blik",
|
|
11562
11609
|
"customElement": true
|
|
11563
11610
|
}
|
|
11564
11611
|
],
|
|
11565
11612
|
"exports": [
|
|
11566
11613
|
{
|
|
11567
11614
|
"kind": "js",
|
|
11568
|
-
"name": "
|
|
11615
|
+
"name": "BlikComponent",
|
|
11569
11616
|
"declaration": {
|
|
11570
|
-
"name": "
|
|
11571
|
-
"module": "src/containers/
|
|
11617
|
+
"name": "BlikComponent",
|
|
11618
|
+
"module": "src/containers/blik/blik.component.ts"
|
|
11572
11619
|
}
|
|
11573
11620
|
},
|
|
11574
11621
|
{
|
|
11575
11622
|
"kind": "custom-element-definition",
|
|
11576
|
-
"name": "primer-
|
|
11623
|
+
"name": "primer-blik",
|
|
11577
11624
|
"declaration": {
|
|
11578
|
-
"name": "
|
|
11579
|
-
"module": "src/containers/
|
|
11625
|
+
"name": "BlikComponent",
|
|
11626
|
+
"module": "src/containers/blik/blik.component.ts"
|
|
11580
11627
|
}
|
|
11581
11628
|
}
|
|
11582
11629
|
]
|
|
11583
11630
|
},
|
|
11584
11631
|
{
|
|
11585
11632
|
"kind": "javascript-module",
|
|
11586
|
-
"path": "src/containers/
|
|
11587
|
-
"declarations": [
|
|
11633
|
+
"path": "src/containers/blik/blik.styles.ts",
|
|
11634
|
+
"declarations": [
|
|
11635
|
+
{
|
|
11636
|
+
"kind": "variable",
|
|
11637
|
+
"name": "styles",
|
|
11638
|
+
"default": "css` :host { display: flex; width: 100%; } .blik-container { width: 100%; display: flex; flex-direction: column; transition: all var(--primer-animation-duration) var(--primer-animation-easing); } .blik-container.expanded { border-radius: var(--primer-radius-medium); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); padding: var(--primer-space-large); } /* Button styles (collapsed state) */ primer-button.blik-button { width: 100%; } /* Override primer-button part styles for BLIK branding */ primer-button.blik-button::part(button) { /* BLIK brand requirement: Black background (#000000) with white logo */ background-color: #000000; border: none; color: var(--primer-color-text-primary); padding: 2px; display: flex; align-items: center; justify-content: center; gap: var(--primer-space-small); /* Fixed height for button - matches redirect payment method calculation */ height: calc( ${unsafeCSS(PAYMENT_METHOD_LINE_HEIGHT)} + calc(2 * var(--primer-space-medium)) ); flex-shrink: 0; /* Prevent button from shrinking when form appears */ } /* Image container for button logo */ .image-container { display: flex; justify-content: center; align-items: center; min-width: 100px; height: 100%; flex-shrink: 0; flex-grow: 1; } /* Button logo */ img { max-width: 100px; width: 100%; height: auto; object-fit: cover; max-height: 98%; } /* Expanded content (form, loading, error states) */ .blik-expanded-content { width: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--primer-animation-duration) var(--primer-animation-easing); overflow: hidden; margin-top: var(--primer-space-medium); } .blik-container.expanded .blik-expanded-content { grid-template-rows: 1fr; } .blik-content-wrapper { overflow: hidden; } /* Input wrapper */ .blik-input-wrapper { display: flex; flex-direction: column; gap: var(--primer-space-small); } /* Input label */ .blik-label { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); } /* Input field */ .blik-input { width: 100%; padding: var(--primer-space-medium); font-family: var(--primer-typography-body-large-font); font-size: var(--primer-typography-body-large-size); font-weight: var(--primer-typography-body-large-weight); line-height: var(--primer-typography-body-large-line-height); /* Increase spacing between digits for better 6-digit code readability */ letter-spacing: 0.25em; text-align: center; color: var(--primer-color-text-primary); background-color: var(--primer-color-background-outlined-default); border: 1px solid var(--primer-color-border-outlined-default); border-radius: var(--primer-radius-medium); outline: none; transition: border-color var(--primer-animation-duration) var(--primer-animation-easing); } .blik-input::placeholder { color: var(--primer-color-text-secondary); /* Reduce placeholder visibility to emphasize user input */ opacity: 0.5; } .blik-input:focus { border-color: var(--primer-color-border-outlined-focus); } .blik-input:disabled { background-color: var(--primer-color-background-outlined-disabled); border-color: var(--primer-color-border-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Loading state */ .blik-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--primer-space-large); padding: var(--primer-space-xlarge) var(--primer-space-medium); } /* Timeout warning */ .blik-timeout-warning { margin-top: var(--primer-space-medium); padding: var(--primer-space-small); font-size: var(--primer-typography-body-small-size); color: var(--primer-color-text-warning); text-align: center; border-radius: var(--primer-radius-small); background-color: var(--primer-color-surface-warning); } /* Error state */ .blik-error { display: flex; flex-direction: column; align-items: center; gap: var(--primer-space-medium); } .blik-error-message { font-family: var(--primer-typography-body-medium-font); font-size: var(--primer-typography-body-medium-size); font-weight: var(--primer-typography-body-medium-weight); line-height: var(--primer-typography-body-medium-line-height); color: var(--primer-color-text-primary); text-align: center; } /* Retry button */ .blik-retry-button { padding: var(--primer-space-medium) var(--primer-space-large); font-family: var(--primer-typography-title-large-font); font-size: var(--primer-typography-title-large-size); font-weight: var(--primer-typography-title-large-weight); line-height: var(--primer-typography-title-large-line-height); color: var(--primer-color-background-outlined-default); background-color: var(--primer-color-brand); border: none; border-radius: var(--primer-radius-medium); cursor: pointer; outline: none; transition: filter var(--primer-animation-duration) var(--primer-animation-easing); } .blik-retry-button:hover:not(:disabled) { filter: brightness(105%); } .blik-retry-button:active:not(:disabled) { filter: brightness(98%); } .blik-retry-button:focus-visible { outline: 2px solid var(--primer-color-brand); outline-offset: 2px; } .blik-retry-button:disabled { background-color: var(--primer-color-background-outlined-disabled); color: var(--primer-color-text-disabled); cursor: not-allowed; } /* Disabled state styling */ :host([disabled]) { opacity: 0.6; cursor: not-allowed; } :host([disabled]) primer-button::part(button) { pointer-events: none; cursor: not-allowed; } :host([disabled]) img { filter: grayscale(100%); } /* Responsive typography for larger screens */ @media (min-width: 768px) { .blik-input { font-size: var(--primer-typography-title-large-size); } } `"
|
|
11639
|
+
}
|
|
11640
|
+
],
|
|
11588
11641
|
"exports": [
|
|
11589
11642
|
{
|
|
11590
11643
|
"kind": "js",
|
|
11591
|
-
"name": "
|
|
11644
|
+
"name": "styles",
|
|
11592
11645
|
"declaration": {
|
|
11593
|
-
"
|
|
11646
|
+
"name": "styles",
|
|
11647
|
+
"module": "src/containers/blik/blik.styles.ts"
|
|
11594
11648
|
}
|
|
11595
11649
|
}
|
|
11596
11650
|
]
|
|
11597
11651
|
},
|
|
11598
11652
|
{
|
|
11599
11653
|
"kind": "javascript-module",
|
|
11600
|
-
"path": "src/containers/
|
|
11654
|
+
"path": "src/containers/blik/blik.ts",
|
|
11601
11655
|
"declarations": [],
|
|
11602
11656
|
"exports": [
|
|
11603
11657
|
{
|
|
11604
11658
|
"kind": "js",
|
|
11605
|
-
"name": "
|
|
11606
|
-
"declaration": {
|
|
11607
|
-
"name": "CardFormCardNumber",
|
|
11608
|
-
"module": "./components"
|
|
11609
|
-
}
|
|
11610
|
-
},
|
|
11611
|
-
{
|
|
11612
|
-
"kind": "js",
|
|
11613
|
-
"name": "CardFormCVV",
|
|
11614
|
-
"declaration": {
|
|
11615
|
-
"name": "CardFormCVV",
|
|
11616
|
-
"module": "./components"
|
|
11617
|
-
}
|
|
11618
|
-
},
|
|
11619
|
-
{
|
|
11620
|
-
"kind": "js",
|
|
11621
|
-
"name": "CardFormExpiry",
|
|
11622
|
-
"declaration": {
|
|
11623
|
-
"name": "CardFormExpiry",
|
|
11624
|
-
"module": "./components"
|
|
11625
|
-
}
|
|
11626
|
-
},
|
|
11627
|
-
{
|
|
11628
|
-
"kind": "js",
|
|
11629
|
-
"name": "CardFormName",
|
|
11630
|
-
"declaration": {
|
|
11631
|
-
"name": "CardFormName",
|
|
11632
|
-
"module": "./components"
|
|
11633
|
-
}
|
|
11634
|
-
},
|
|
11635
|
-
{
|
|
11636
|
-
"kind": "js",
|
|
11637
|
-
"name": "CardFormSubmit",
|
|
11638
|
-
"declaration": {
|
|
11639
|
-
"name": "CardFormSubmit",
|
|
11640
|
-
"module": "./components"
|
|
11641
|
-
}
|
|
11642
|
-
},
|
|
11643
|
-
{
|
|
11644
|
-
"kind": "js",
|
|
11645
|
-
"name": "CardFormCardNetworkSelector",
|
|
11646
|
-
"declaration": {
|
|
11647
|
-
"name": "CardFormCardNetworkSelector",
|
|
11648
|
-
"module": "./components"
|
|
11649
|
-
}
|
|
11650
|
-
},
|
|
11651
|
-
{
|
|
11652
|
-
"kind": "js",
|
|
11653
|
-
"name": "CardForm",
|
|
11659
|
+
"name": "Blik",
|
|
11654
11660
|
"declaration": {
|
|
11655
|
-
"name": "
|
|
11656
|
-
"module": "src/containers/
|
|
11661
|
+
"name": "BlikComponent",
|
|
11662
|
+
"module": "src/containers/blik/blik.ts"
|
|
11657
11663
|
}
|
|
11658
11664
|
}
|
|
11659
11665
|
]
|
|
11660
11666
|
},
|
|
11661
|
-
{
|
|
11662
|
-
"kind": "javascript-module",
|
|
11663
|
-
"path": "src/containers/card-form/types.ts",
|
|
11664
|
-
"declarations": [],
|
|
11665
|
-
"exports": []
|
|
11666
|
-
},
|
|
11667
11667
|
{
|
|
11668
11668
|
"kind": "javascript-module",
|
|
11669
11669
|
"path": "src/containers/dynamic-payment/dynamic-payment.component.ts",
|