@gravityforms/components 6.2.2 → 6.4.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/css/admin/inputs.css +28 -8
- package/css/admin/toggle.css +23 -1
- package/dist/css/admin/inputs.css +16 -5
- package/dist/css/admin/inputs.css.map +1 -1
- package/dist/css/admin/toggle.css +18 -5
- package/dist/css/admin/toggle.css.map +1 -1
- package/dist/js/admin-components.asset.php +1 -1
- package/dist/js/admin-components.js +3 -3
- package/dist/js/admin-components.min.asset.php +1 -1
- package/dist/js/admin-components.min.js +1 -1
- package/dist/mappings/admin.js +64 -59
- package/package.json +4 -4
- package/react/admin/elements/Input/index.js +4 -0
- package/react/admin/elements/Label/index.js +41 -3
- package/react/admin/elements/Svgs/GravityTextLogo/index.js +49 -0
- package/react/admin/elements/Svgs/index.js +1 -0
- package/react/admin/elements/Toggle/index.js +8 -1
- package/react/admin/modules/Cards/IntegrationCard/index.js +9 -0
package/dist/mappings/admin.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
"defaultExport": "Table",
|
|
4
|
+
"importPath": "html/admin/modules/",
|
|
5
|
+
"externalPath": "components.admin.html.modules"
|
|
6
|
+
},
|
|
2
7
|
{
|
|
3
8
|
"defaultExport": "Flyout",
|
|
4
9
|
"namedExports": [
|
|
@@ -15,11 +20,6 @@ module.exports = [
|
|
|
15
20
|
"importPath": "html/admin/modules/",
|
|
16
21
|
"externalPath": "components.admin.html.modules"
|
|
17
22
|
},
|
|
18
|
-
{
|
|
19
|
-
"defaultExport": "Table",
|
|
20
|
-
"importPath": "html/admin/modules/",
|
|
21
|
-
"externalPath": "components.admin.html.modules"
|
|
22
|
-
},
|
|
23
23
|
{
|
|
24
24
|
"defaultExport": "Text",
|
|
25
25
|
"namedExports": [
|
|
@@ -93,50 +93,50 @@ module.exports = [
|
|
|
93
93
|
"externalPath": "components.admin.html.elements"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
"defaultExport": "
|
|
96
|
+
"defaultExport": "Heading",
|
|
97
97
|
"namedExports": [
|
|
98
|
-
"
|
|
98
|
+
"headingTemplate"
|
|
99
99
|
],
|
|
100
100
|
"importPath": "html/admin/elements/",
|
|
101
101
|
"externalPath": "components.admin.html.elements"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
"defaultExport": "
|
|
104
|
+
"defaultExport": "Dropdown",
|
|
105
105
|
"namedExports": [
|
|
106
|
-
"
|
|
106
|
+
"dropdownTemplate",
|
|
107
|
+
"dropdownListItems"
|
|
107
108
|
],
|
|
108
109
|
"importPath": "html/admin/elements/",
|
|
109
110
|
"externalPath": "components.admin.html.elements"
|
|
110
111
|
},
|
|
111
112
|
{
|
|
112
|
-
"defaultExport": "
|
|
113
|
+
"defaultExport": "Button",
|
|
113
114
|
"namedExports": [
|
|
114
|
-
"
|
|
115
|
+
"buttonTemplate"
|
|
115
116
|
],
|
|
116
117
|
"importPath": "html/admin/elements/",
|
|
117
118
|
"externalPath": "components.admin.html.elements"
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
|
-
"defaultExport": "
|
|
121
|
+
"defaultExport": "Alert",
|
|
121
122
|
"namedExports": [
|
|
122
|
-
"
|
|
123
|
-
"dropdownListItems"
|
|
123
|
+
"alertTemplate"
|
|
124
124
|
],
|
|
125
125
|
"importPath": "html/admin/elements/",
|
|
126
126
|
"externalPath": "components.admin.html.elements"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
"defaultExport": "
|
|
129
|
+
"defaultExport": "Textarea",
|
|
130
130
|
"namedExports": [
|
|
131
|
-
"
|
|
131
|
+
"textareaTemplate"
|
|
132
132
|
],
|
|
133
133
|
"importPath": "html/admin/elements/",
|
|
134
134
|
"externalPath": "components.admin.html.elements"
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
|
-
"defaultExport": "
|
|
137
|
+
"defaultExport": "Toggle",
|
|
138
138
|
"namedExports": [
|
|
139
|
-
"
|
|
139
|
+
"toggleTemplate"
|
|
140
140
|
],
|
|
141
141
|
"importPath": "html/admin/elements/",
|
|
142
142
|
"externalPath": "components.admin.html.elements"
|
|
@@ -170,16 +170,6 @@ module.exports = [
|
|
|
170
170
|
"importPath": "react/admin/modules/",
|
|
171
171
|
"externalPath": "components.admin.react.modules"
|
|
172
172
|
},
|
|
173
|
-
{
|
|
174
|
-
"defaultExport": "RouterNavBar",
|
|
175
|
-
"importPath": "react/admin/modules/",
|
|
176
|
-
"externalPath": "components.admin.react.modules"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"defaultExport": "Repeater",
|
|
180
|
-
"importPath": "react/admin/modules/",
|
|
181
|
-
"externalPath": "components.admin.react.modules"
|
|
182
|
-
},
|
|
183
173
|
{
|
|
184
174
|
"defaultExport": "Phone",
|
|
185
175
|
"importPath": "react/admin/modules/",
|
|
@@ -246,7 +236,7 @@ module.exports = [
|
|
|
246
236
|
"externalPath": "components.admin.react.modules"
|
|
247
237
|
},
|
|
248
238
|
{
|
|
249
|
-
"defaultExport": "
|
|
239
|
+
"defaultExport": "Repeater",
|
|
250
240
|
"importPath": "react/admin/modules/",
|
|
251
241
|
"externalPath": "components.admin.react.modules"
|
|
252
242
|
},
|
|
@@ -270,6 +260,11 @@ module.exports = [
|
|
|
270
260
|
"importPath": "react/admin/modules/",
|
|
271
261
|
"externalPath": "components.admin.react.modules"
|
|
272
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"defaultExport": "RouterNavBar",
|
|
265
|
+
"importPath": "react/admin/modules/",
|
|
266
|
+
"externalPath": "components.admin.react.modules"
|
|
267
|
+
},
|
|
273
268
|
{
|
|
274
269
|
"defaultExport": "Calendar",
|
|
275
270
|
"importPath": "react/admin/modules/",
|
|
@@ -291,12 +286,12 @@ module.exports = [
|
|
|
291
286
|
"externalPath": "components.admin.react.modules"
|
|
292
287
|
},
|
|
293
288
|
{
|
|
294
|
-
"defaultExport": "
|
|
289
|
+
"defaultExport": "Alert",
|
|
295
290
|
"importPath": "react/admin/modules/",
|
|
296
291
|
"externalPath": "components.admin.react.modules"
|
|
297
292
|
},
|
|
298
293
|
{
|
|
299
|
-
"defaultExport": "
|
|
294
|
+
"defaultExport": "Address",
|
|
300
295
|
"importPath": "react/admin/modules/",
|
|
301
296
|
"externalPath": "components.admin.react.modules"
|
|
302
297
|
},
|
|
@@ -335,11 +330,6 @@ module.exports = [
|
|
|
335
330
|
"importPath": "react/admin/elements/",
|
|
336
331
|
"externalPath": "components.admin.react.elements"
|
|
337
332
|
},
|
|
338
|
-
{
|
|
339
|
-
"defaultExport": "Pill",
|
|
340
|
-
"importPath": "react/admin/elements/",
|
|
341
|
-
"externalPath": "components.admin.react.elements"
|
|
342
|
-
},
|
|
343
333
|
{
|
|
344
334
|
"defaultExport": "Popover",
|
|
345
335
|
"importPath": "react/admin/elements/",
|
|
@@ -351,12 +341,12 @@ module.exports = [
|
|
|
351
341
|
"externalPath": "components.admin.react.elements"
|
|
352
342
|
},
|
|
353
343
|
{
|
|
354
|
-
"defaultExport": "
|
|
344
|
+
"defaultExport": "Pill",
|
|
355
345
|
"importPath": "react/admin/elements/",
|
|
356
346
|
"externalPath": "components.admin.react.elements"
|
|
357
347
|
},
|
|
358
348
|
{
|
|
359
|
-
"defaultExport": "
|
|
349
|
+
"defaultExport": "Link",
|
|
360
350
|
"importPath": "react/admin/elements/",
|
|
361
351
|
"externalPath": "components.admin.react.elements"
|
|
362
352
|
},
|
|
@@ -366,7 +356,7 @@ module.exports = [
|
|
|
366
356
|
"externalPath": "components.admin.react.elements"
|
|
367
357
|
},
|
|
368
358
|
{
|
|
369
|
-
"defaultExport": "
|
|
359
|
+
"defaultExport": "Label",
|
|
370
360
|
"importPath": "react/admin/elements/",
|
|
371
361
|
"externalPath": "components.admin.react.elements"
|
|
372
362
|
},
|
|
@@ -376,7 +366,7 @@ module.exports = [
|
|
|
376
366
|
"externalPath": "components.admin.react.elements"
|
|
377
367
|
},
|
|
378
368
|
{
|
|
379
|
-
"defaultExport": "
|
|
369
|
+
"defaultExport": "Image",
|
|
380
370
|
"importPath": "react/admin/elements/",
|
|
381
371
|
"externalPath": "components.admin.react.elements"
|
|
382
372
|
},
|
|
@@ -385,6 +375,11 @@ module.exports = [
|
|
|
385
375
|
"importPath": "react/admin/elements/",
|
|
386
376
|
"externalPath": "components.admin.react.elements"
|
|
387
377
|
},
|
|
378
|
+
{
|
|
379
|
+
"defaultExport": "HelpText",
|
|
380
|
+
"importPath": "react/admin/elements/",
|
|
381
|
+
"externalPath": "components.admin.react.elements"
|
|
382
|
+
},
|
|
388
383
|
{
|
|
389
384
|
"defaultExport": "Grid",
|
|
390
385
|
"importPath": "react/admin/elements/",
|
|
@@ -420,6 +415,11 @@ module.exports = [
|
|
|
420
415
|
"importPath": "react/admin/modules/Videos/",
|
|
421
416
|
"externalPath": "components.admin.react.modules"
|
|
422
417
|
},
|
|
418
|
+
{
|
|
419
|
+
"defaultExport": "Dialog",
|
|
420
|
+
"importPath": "react/admin/modules/",
|
|
421
|
+
"externalPath": "components.admin.react.modules"
|
|
422
|
+
},
|
|
423
423
|
{
|
|
424
424
|
"__esModule": true,
|
|
425
425
|
"default": {
|
|
@@ -509,7 +509,7 @@ module.exports = [
|
|
|
509
509
|
"externalPath": "components.admin.react.elements"
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
|
-
"defaultExport": "
|
|
512
|
+
"defaultExport": "TelegramLogo",
|
|
513
513
|
"importPath": "react/admin/elements/Svgs/",
|
|
514
514
|
"externalPath": "components.admin.react.elements"
|
|
515
515
|
},
|
|
@@ -519,7 +519,7 @@ module.exports = [
|
|
|
519
519
|
"externalPath": "components.admin.react.elements"
|
|
520
520
|
},
|
|
521
521
|
{
|
|
522
|
-
"defaultExport": "
|
|
522
|
+
"defaultExport": "TwilioLogo",
|
|
523
523
|
"importPath": "react/admin/elements/Svgs/",
|
|
524
524
|
"externalPath": "components.admin.react.elements"
|
|
525
525
|
},
|
|
@@ -529,12 +529,12 @@ module.exports = [
|
|
|
529
529
|
"externalPath": "components.admin.react.elements"
|
|
530
530
|
},
|
|
531
531
|
{
|
|
532
|
-
"defaultExport": "
|
|
532
|
+
"defaultExport": "SlackLogo",
|
|
533
533
|
"importPath": "react/admin/elements/Svgs/",
|
|
534
534
|
"externalPath": "components.admin.react.elements"
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
|
-
"defaultExport": "
|
|
537
|
+
"defaultExport": "SendGridLogo",
|
|
538
538
|
"importPath": "react/admin/elements/Svgs/",
|
|
539
539
|
"externalPath": "components.admin.react.elements"
|
|
540
540
|
},
|
|
@@ -604,12 +604,12 @@ module.exports = [
|
|
|
604
604
|
"externalPath": "components.admin.react.elements"
|
|
605
605
|
},
|
|
606
606
|
{
|
|
607
|
-
"defaultExport": "
|
|
607
|
+
"defaultExport": "MicrosoftAltLogo",
|
|
608
608
|
"importPath": "react/admin/elements/Svgs/",
|
|
609
609
|
"externalPath": "components.admin.react.elements"
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
|
-
"defaultExport": "
|
|
612
|
+
"defaultExport": "MandrillLogo",
|
|
613
613
|
"importPath": "react/admin/elements/Svgs/",
|
|
614
614
|
"externalPath": "components.admin.react.elements"
|
|
615
615
|
},
|
|
@@ -624,12 +624,12 @@ module.exports = [
|
|
|
624
624
|
"externalPath": "components.admin.react.elements"
|
|
625
625
|
},
|
|
626
626
|
{
|
|
627
|
-
"defaultExport": "
|
|
627
|
+
"defaultExport": "MailgunLogo",
|
|
628
628
|
"importPath": "react/admin/elements/Svgs/",
|
|
629
629
|
"externalPath": "components.admin.react.elements"
|
|
630
630
|
},
|
|
631
631
|
{
|
|
632
|
-
"defaultExport": "
|
|
632
|
+
"defaultExport": "MailgunFullLogo",
|
|
633
633
|
"importPath": "react/admin/elements/Svgs/",
|
|
634
634
|
"externalPath": "components.admin.react.elements"
|
|
635
635
|
},
|
|
@@ -668,6 +668,16 @@ module.exports = [
|
|
|
668
668
|
"importPath": "react/admin/elements/Svgs/",
|
|
669
669
|
"externalPath": "components.admin.react.elements"
|
|
670
670
|
},
|
|
671
|
+
{
|
|
672
|
+
"defaultExport": "MailFailed",
|
|
673
|
+
"importPath": "react/admin/elements/Svgs/",
|
|
674
|
+
"externalPath": "components.admin.react.elements"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"defaultExport": "GravityTextLogo",
|
|
678
|
+
"importPath": "react/admin/elements/Svgs/",
|
|
679
|
+
"externalPath": "components.admin.react.elements"
|
|
680
|
+
},
|
|
671
681
|
{
|
|
672
682
|
"defaultExport": "GravitySMTPTextLogo",
|
|
673
683
|
"importPath": "react/admin/elements/Svgs/",
|
|
@@ -718,11 +728,6 @@ module.exports = [
|
|
|
718
728
|
"importPath": "react/admin/elements/Svgs/",
|
|
719
729
|
"externalPath": "components.admin.react.elements"
|
|
720
730
|
},
|
|
721
|
-
{
|
|
722
|
-
"defaultExport": "EmailitLogo",
|
|
723
|
-
"importPath": "react/admin/elements/Svgs/",
|
|
724
|
-
"externalPath": "components.admin.react.elements"
|
|
725
|
-
},
|
|
726
731
|
{
|
|
727
732
|
"defaultExport": "EmailitFullLogo",
|
|
728
733
|
"importPath": "react/admin/elements/Svgs/",
|
|
@@ -734,12 +739,12 @@ module.exports = [
|
|
|
734
739
|
"externalPath": "components.admin.react.elements"
|
|
735
740
|
},
|
|
736
741
|
{
|
|
737
|
-
"defaultExport": "
|
|
742
|
+
"defaultExport": "EmailitLogo",
|
|
738
743
|
"importPath": "react/admin/elements/Svgs/",
|
|
739
744
|
"externalPath": "components.admin.react.elements"
|
|
740
745
|
},
|
|
741
746
|
{
|
|
742
|
-
"defaultExport": "
|
|
747
|
+
"defaultExport": "ElasticEmailFullLogo",
|
|
743
748
|
"importPath": "react/admin/elements/Svgs/",
|
|
744
749
|
"externalPath": "components.admin.react.elements"
|
|
745
750
|
},
|
|
@@ -764,22 +769,22 @@ module.exports = [
|
|
|
764
769
|
"externalPath": "components.admin.react.elements"
|
|
765
770
|
},
|
|
766
771
|
{
|
|
767
|
-
"defaultExport": "
|
|
772
|
+
"defaultExport": "CustomSMTPFull",
|
|
768
773
|
"importPath": "react/admin/elements/Svgs/",
|
|
769
774
|
"externalPath": "components.admin.react.elements"
|
|
770
775
|
},
|
|
771
776
|
{
|
|
772
|
-
"defaultExport": "
|
|
777
|
+
"defaultExport": "BrevoFullLogo",
|
|
773
778
|
"importPath": "react/admin/elements/Svgs/",
|
|
774
779
|
"externalPath": "components.admin.react.elements"
|
|
775
780
|
},
|
|
776
781
|
{
|
|
777
|
-
"defaultExport": "
|
|
782
|
+
"defaultExport": "AmazonAWSLogo",
|
|
778
783
|
"importPath": "react/admin/elements/Svgs/",
|
|
779
784
|
"externalPath": "components.admin.react.elements"
|
|
780
785
|
},
|
|
781
786
|
{
|
|
782
|
-
"defaultExport": "
|
|
787
|
+
"defaultExport": "AmazonAWSFullLogo",
|
|
783
788
|
"importPath": "react/admin/elements/Svgs/",
|
|
784
789
|
"externalPath": "components.admin.react.elements"
|
|
785
790
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravityforms/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "UI components for use in Gravity Forms development. Both React and vanilla js flavors.",
|
|
5
5
|
"author": "Rocketgenius",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.26.0",
|
|
33
|
-
"@gravityforms/components": "^6.
|
|
33
|
+
"@gravityforms/components": "^6.4.0",
|
|
34
34
|
"@gravityforms/libraries": "^6.0.0",
|
|
35
|
-
"@gravityforms/react-utils": "^5.
|
|
35
|
+
"@gravityforms/react-utils": "^5.2.0",
|
|
36
36
|
"@gravityforms/request": "^6.1.0",
|
|
37
|
-
"@gravityforms/utils": "^5.0.
|
|
37
|
+
"@gravityforms/utils": "^5.0.4",
|
|
38
38
|
"input-format": "0.3.14",
|
|
39
39
|
"libphonenumber-js": "1.11.20",
|
|
40
40
|
"recharts": "2.12.7"
|
|
@@ -26,6 +26,7 @@ const { useState, forwardRef } = React;
|
|
|
26
26
|
* @param {object} props.helpTextAttributes Custom attribute for the help text.
|
|
27
27
|
* @param {string} props.helpTextPosition The position of the help text.
|
|
28
28
|
* @param {string} props.iconAttributes Custom attributes for the icon.
|
|
29
|
+
* @param {string} props.iconPosition The position of the icon, one of `left` or `right`.
|
|
29
30
|
* @param {string} props.id Optional id. Auto generated if not passed.
|
|
30
31
|
* @param {object} props.labelAttributes Any custom attributes for the label.
|
|
31
32
|
* @param {string} props.max The maximum value to accept for the input if type is number.
|
|
@@ -83,6 +84,7 @@ const Input = forwardRef( ( {
|
|
|
83
84
|
},
|
|
84
85
|
helpTextPosition = 'below',
|
|
85
86
|
iconAttributes = {},
|
|
87
|
+
iconPosition = 'right',
|
|
86
88
|
id = '',
|
|
87
89
|
inputPrefix = '',
|
|
88
90
|
labelAttributes = {
|
|
@@ -144,6 +146,7 @@ const Input = forwardRef( ( {
|
|
|
144
146
|
'gform-input-wrapper--required': required,
|
|
145
147
|
[ `gform-input-wrapper--border-${ borderStyle }` ]: true,
|
|
146
148
|
'gform-input-wrapper--with-icon': withIcon,
|
|
149
|
+
[ `gform-input-wrapper--icon-${ iconPosition }` ]: withIcon,
|
|
147
150
|
[ `gform-input-wrapper--text-security-${ textSecurity }` ]: type !== 'password' && textSecurity !== 'none',
|
|
148
151
|
}, wrapperClasses ),
|
|
149
152
|
ref,
|
|
@@ -297,6 +300,7 @@ Input.propTypes = {
|
|
|
297
300
|
helpTextAttributes: PropTypes.object,
|
|
298
301
|
helpTextPosition: PropTypes.string,
|
|
299
302
|
iconAttributes: PropTypes.object,
|
|
303
|
+
iconPosition: PropTypes.oneOf( [ 'left', 'right' ] ),
|
|
300
304
|
id: PropTypes.string,
|
|
301
305
|
labelAttributes: PropTypes.object,
|
|
302
306
|
max: PropTypes.string,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { React, PropTypes, classnames } from '@gravityforms/libraries';
|
|
2
2
|
import { spacerClasses } from '@gravityforms/utils';
|
|
3
|
+
import RingLoader from '../../modules/Loaders/RingLoader';
|
|
3
4
|
import Tooltip from '../../modules/Tooltip';
|
|
4
5
|
|
|
5
|
-
const { forwardRef } = React;
|
|
6
|
+
const { forwardRef, useEffect, useRef, useState } = React;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @module Label
|
|
@@ -19,6 +20,10 @@ const { forwardRef } = React;
|
|
|
19
20
|
* @param {string} props.iconPrefix The icon prefix for the label.
|
|
20
21
|
* @param {boolean} props.isVisible If label is visible (true) or hidden (false).
|
|
21
22
|
* @param {string} props.label Label text.
|
|
23
|
+
* @param {object} props.loaderProps Props passed to the RingLoader when loading. All RingLoader props can be overridden.
|
|
24
|
+
* @param {boolean} props.loading If true, displays a RingLoader inline with the label text.
|
|
25
|
+
* @param {number} props.loadingDelay Delay in ms before the loading indicator appears. Prevents flash for fast operations. Default 0.
|
|
26
|
+
* @param {string} props.loadingText Optional text to display in place of label while loading. If empty, the label text remains.
|
|
22
27
|
* @param {boolean} props.locked If the label is locked (disables form element and puts an icon with optional tooltip next to label).
|
|
23
28
|
* @param {string} props.lockedMessage The message to display when the label is locked, in a tooltip. (optional)
|
|
24
29
|
* @param {string} props.size The font size for the label.
|
|
@@ -44,6 +49,15 @@ const Label = forwardRef( ( {
|
|
|
44
49
|
iconPrefix = 'gravity-component-icon',
|
|
45
50
|
isVisible = true,
|
|
46
51
|
label = '',
|
|
52
|
+
loaderProps = {
|
|
53
|
+
customClasses: 'gform-label__loader',
|
|
54
|
+
lineWeight: 2,
|
|
55
|
+
size: 16,
|
|
56
|
+
spacing: [ 0, 2, 0, 0 ],
|
|
57
|
+
},
|
|
58
|
+
loading = false,
|
|
59
|
+
loadingDelay = 0,
|
|
60
|
+
loadingText = '',
|
|
47
61
|
locked = false,
|
|
48
62
|
lockedMessage = '',
|
|
49
63
|
size = 'text-sm',
|
|
@@ -51,13 +65,32 @@ const Label = forwardRef( ( {
|
|
|
51
65
|
tagName = 'label',
|
|
52
66
|
weight = 'medium',
|
|
53
67
|
}, ref ) => {
|
|
54
|
-
|
|
68
|
+
const [ delayedLoading, setDelayedLoading ] = useState( false );
|
|
69
|
+
const timerRef = useRef( null );
|
|
70
|
+
|
|
71
|
+
useEffect( () => {
|
|
72
|
+
if ( loading && loadingDelay > 0 ) {
|
|
73
|
+
timerRef.current = setTimeout( () => {
|
|
74
|
+
setDelayedLoading( true );
|
|
75
|
+
}, loadingDelay );
|
|
76
|
+
} else {
|
|
77
|
+
clearTimeout( timerRef.current );
|
|
78
|
+
setDelayedLoading( loading );
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return () => clearTimeout( timerRef.current );
|
|
82
|
+
}, [ loading, loadingDelay ] );
|
|
83
|
+
|
|
84
|
+
const isLoading = loadingDelay > 0 ? delayedLoading : loading;
|
|
85
|
+
|
|
86
|
+
if ( ! label && ! children && ! ( isLoading && loadingText ) ) {
|
|
55
87
|
return null;
|
|
56
88
|
}
|
|
57
89
|
|
|
58
90
|
const componentProps = {
|
|
59
91
|
className: classnames( {
|
|
60
92
|
'gform-label': true,
|
|
93
|
+
'gform-label--loading': isLoading,
|
|
61
94
|
'gform-legend': tagName === 'legend',
|
|
62
95
|
[ `gform-typography--size-${ size }` ]: true,
|
|
63
96
|
[ `gform-typography--weight-${ weight }` ]: true,
|
|
@@ -88,7 +121,8 @@ const Label = forwardRef( ( {
|
|
|
88
121
|
|
|
89
122
|
return (
|
|
90
123
|
<Tag { ...componentProps }>
|
|
91
|
-
{
|
|
124
|
+
{ isLoading && <RingLoader { ...loaderProps } /> }
|
|
125
|
+
{ isLoading && loadingText ? loadingText : label }
|
|
92
126
|
{ children }
|
|
93
127
|
{ locked && <Tooltip { ...tooltipProps } /> }
|
|
94
128
|
</Tag>
|
|
@@ -110,6 +144,10 @@ Label.propTypes = {
|
|
|
110
144
|
iconPrefix: PropTypes.string,
|
|
111
145
|
isVisible: PropTypes.bool,
|
|
112
146
|
label: PropTypes.string,
|
|
147
|
+
loaderProps: PropTypes.object,
|
|
148
|
+
loading: PropTypes.bool,
|
|
149
|
+
loadingDelay: PropTypes.number,
|
|
150
|
+
loadingText: PropTypes.string,
|
|
113
151
|
locked: PropTypes.bool,
|
|
114
152
|
lockedMessage: PropTypes.string,
|
|
115
153
|
size: PropTypes.string,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { React, PropTypes } from '@gravityforms/libraries';
|
|
2
|
+
|
|
3
|
+
const { forwardRef } = React;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @module GravityTextLogo
|
|
7
|
+
* @description The Gravity text logo.
|
|
8
|
+
*
|
|
9
|
+
* @since 6.3.0
|
|
10
|
+
*
|
|
11
|
+
* @param {object} props Component props.
|
|
12
|
+
* @param {number} props.height The height of the logo.
|
|
13
|
+
* @param {string} props.primaryFill The primary fill color.
|
|
14
|
+
* @param {string} props.title The title of the logo.
|
|
15
|
+
* @param {number} props.width The width of the logo.
|
|
16
|
+
*
|
|
17
|
+
* @return {JSX.Element} The text component.
|
|
18
|
+
* @example
|
|
19
|
+
* import GravityTextLogo from '@gravityforms/components/react/admin/elements/Svgs/GravityTextLogo';
|
|
20
|
+
*
|
|
21
|
+
* return (
|
|
22
|
+
* <GravityTextLogo height={ 19 } width={ 120 } />
|
|
23
|
+
* );
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
const GravityTextLogo = forwardRef( ( {
|
|
27
|
+
height = 19,
|
|
28
|
+
primaryFill = '#1B2A45',
|
|
29
|
+
title = '',
|
|
30
|
+
width = 120,
|
|
31
|
+
}, ref ) => {
|
|
32
|
+
return (
|
|
33
|
+
<svg xmlns="http://www.w3.org/2000/svg" width={ width } height={ height } fill="none" viewBox="0 0 120 19" ref={ ref }>
|
|
34
|
+
{ title !== '' && <title>{ title }</title> }
|
|
35
|
+
<path fill={ primaryFill } d="M9.233 0c3.591 0 7.182 1.693 8.208 5.9h-3.795c-.924-1.745-2.36-2.412-4.413-2.412-3.385 0-5.283 2.514-5.283 5.745 0 3.386 2.052 5.695 5.283 5.695 2.463 0 4.31-.718 5.08-3.437H9.387V8.26h8.464c.102 1.693.05 3.386-.565 5.027-1.385 3.591-4.617 5.13-8.054 5.13C4.463 18.416 0 15.184 0 9.233 0 3.232 4.463 0 9.233 0Zm49.145 17.596v.512h-4.002l-1.436-2.975H45.4l-1.386 2.975h-4.001v-.512L48.323.052h1.795l8.26 17.544Zm5.54-11.645 2 4.411h.102v-.05l1.899-4.36L70.33.256h4.104V.82l-7.695 17.287h-1.59L57.403.821V.257h4.104l2.411 5.694Zm18.057 12.157h-3.847V.154h3.847v17.954ZM100.904 3.54H95.21v14.568h-3.745V3.54H85.72V.205h15.184V3.54ZM29.958.154c4.104 0 6.361 2.975 6.361 6.156 0 2.257-1.18 4.258-3.231 5.284l4.052 5.95v.514h-4.104l-3.693-5.9H26.11v5.9h-3.847V.154h7.694Zm79.718 3.847 1.693 3.437h.103l1.795-3.54 2.154-3.693h4.104V.77l-6.207 10.157v7.13h-3.847v-7.13L103.264.77V.205h4.155l2.257 3.796ZM46.63 11.952h5.027l-2.513-5.9-2.514 5.9ZM26.06 9.028h3.847c1.642 0 2.667-1.23 2.667-2.77 0-1.487-1.025-2.718-2.667-2.718H26.06v5.488Z" />
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
} );
|
|
39
|
+
|
|
40
|
+
GravityTextLogo.propTypes = {
|
|
41
|
+
height: PropTypes.number,
|
|
42
|
+
primaryFill: PropTypes.string,
|
|
43
|
+
title: PropTypes.string,
|
|
44
|
+
width: PropTypes.number,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
GravityTextLogo.displayName = 'Svgs/GravityTextLogo';
|
|
48
|
+
|
|
49
|
+
export default GravityTextLogo;
|
|
@@ -5,6 +5,7 @@ export { default as GoogleLogo } from './GoogleLogo';
|
|
|
5
5
|
export { default as GravitySMTPFullLogo } from './GravitySMTPFullLogo';
|
|
6
6
|
export { default as GravitySMTPLogo } from './GravitySMTPLogo';
|
|
7
7
|
export { default as GravitySMTPTextLogo } from './GravitySMTPTextLogo';
|
|
8
|
+
export { default as GravityTextLogo } from './GravityTextLogo';
|
|
8
9
|
export { default as MailchimpLogo } from './MailchimpLogo';
|
|
9
10
|
export { default as MailgunLogo } from './MailgunLogo';
|
|
10
11
|
export { default as MandrillLogo } from './MandrillLogo';
|
|
@@ -14,6 +14,7 @@ const { useState, forwardRef } = React;
|
|
|
14
14
|
*
|
|
15
15
|
* @param {object} props Component props.
|
|
16
16
|
* @param {string} props.ariaLabel The aria-label text for the toggle.
|
|
17
|
+
* @param {boolean} props.busy If true, disables interaction without applying visual disabled styles. Useful during async operations.
|
|
17
18
|
* @param {JSX.Element} props.children React element children.
|
|
18
19
|
* @param {object} props.customAttributes Custom attributes for the component.
|
|
19
20
|
* @param {string|Array|object} props.customClasses Custom classes for the component.
|
|
@@ -54,6 +55,7 @@ const { useState, forwardRef } = React;
|
|
|
54
55
|
|
|
55
56
|
const Toggle = forwardRef( ( {
|
|
56
57
|
ariaLabel = '',
|
|
58
|
+
busy = false,
|
|
57
59
|
children = null,
|
|
58
60
|
customAttributes = {},
|
|
59
61
|
customClasses = [],
|
|
@@ -93,6 +95,7 @@ const Toggle = forwardRef( ( {
|
|
|
93
95
|
[ `gform-toggle--label-${ labelPosition }` ]: true,
|
|
94
96
|
[ `gform-toggle--width-${ width }` ]: true,
|
|
95
97
|
[ `gform-toggle--help-text-width-${ helpTextWidth }` ]: helpTextAttributes.content,
|
|
98
|
+
'gform-toggle--busy': busy,
|
|
96
99
|
'gform-toggle--disabled': disabled,
|
|
97
100
|
...spacerClasses( spacing ),
|
|
98
101
|
}, wrapperClasses ),
|
|
@@ -106,7 +109,7 @@ const Toggle = forwardRef( ( {
|
|
|
106
109
|
'gform-toggle__toggle': true,
|
|
107
110
|
'gform-toggle__toggle--has-icons': icons,
|
|
108
111
|
}, customClasses ),
|
|
109
|
-
disabled: disabled || labelAttributes?.locked === true,
|
|
112
|
+
disabled: disabled || busy || labelAttributes?.locked === true,
|
|
110
113
|
id: inputId,
|
|
111
114
|
name,
|
|
112
115
|
onBlur,
|
|
@@ -126,6 +129,9 @@ const Toggle = forwardRef( ( {
|
|
|
126
129
|
if ( ariaLabel ) {
|
|
127
130
|
inputProps[ 'aria-label' ] = ariaLabel;
|
|
128
131
|
}
|
|
132
|
+
if ( busy ) {
|
|
133
|
+
inputProps[ 'aria-busy' ] = true;
|
|
134
|
+
}
|
|
129
135
|
if ( helpTextAttributes.content ) {
|
|
130
136
|
inputProps[ 'aria-describedby' ] = helpTextId;
|
|
131
137
|
}
|
|
@@ -165,6 +171,7 @@ const Toggle = forwardRef( ( {
|
|
|
165
171
|
|
|
166
172
|
Toggle.propTypes = {
|
|
167
173
|
ariaLabel: PropTypes.string,
|
|
174
|
+
busy: PropTypes.bool,
|
|
168
175
|
children: PropTypes.oneOfType( [
|
|
169
176
|
PropTypes.arrayOf( PropTypes.node ),
|
|
170
177
|
PropTypes.node,
|
|
@@ -23,6 +23,7 @@ const { forwardRef } = React;
|
|
|
23
23
|
* @param {object} props.headerGridAttributes Custom attributes for the header grid.
|
|
24
24
|
* @param {JSX.Element|null} props.title React element for the title.
|
|
25
25
|
* @param {object} props.titleGridAttributes Custom attributes for the title grid.
|
|
26
|
+
* @param {string|number|Array|object} props.spacing The spacing for the component, as a string, number, array, or object.
|
|
26
27
|
* @param {object|null} ref Ref to the component.
|
|
27
28
|
*
|
|
28
29
|
* @return {JSX.Element} The integration card component.
|
|
@@ -43,6 +44,7 @@ const IntegrationCard = forwardRef( ( {
|
|
|
43
44
|
customClasses = [],
|
|
44
45
|
description = null,
|
|
45
46
|
disabled = false,
|
|
47
|
+
spacing = 0,
|
|
46
48
|
footerContent = [],
|
|
47
49
|
footerGridAttributes = {},
|
|
48
50
|
headerContent = [],
|
|
@@ -55,6 +57,7 @@ const IntegrationCard = forwardRef( ( {
|
|
|
55
57
|
'gform-card--disabled': disabled,
|
|
56
58
|
}, customClasses ),
|
|
57
59
|
...customAttributes,
|
|
60
|
+
spacing,
|
|
58
61
|
style: 'integration',
|
|
59
62
|
};
|
|
60
63
|
|
|
@@ -167,6 +170,12 @@ IntegrationCard.propTypes = {
|
|
|
167
170
|
headerGridAttributes: PropTypes.object,
|
|
168
171
|
title: PropTypes.node,
|
|
169
172
|
titleGridAttributes: PropTypes.object,
|
|
173
|
+
spacing: PropTypes.oneOfType( [
|
|
174
|
+
PropTypes.string,
|
|
175
|
+
PropTypes.number,
|
|
176
|
+
PropTypes.array,
|
|
177
|
+
PropTypes.object,
|
|
178
|
+
] ),
|
|
170
179
|
};
|
|
171
180
|
|
|
172
181
|
IntegrationCard.displayName = 'Cards/IntegrationCard';
|