@xapp/form-widget 1.98.0 → 1.99.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/dist/api/__test__/stentor-api.test.d.ts +1 -9
- package/dist/api/index.d.ts +0 -0
- package/dist/api/stentor-api.d.ts +0 -0
- package/dist/components/FormDisplay/FormDisplay.d.ts +0 -0
- package/dist/components/FormFieldDropdown/FormFieldDropdown.d.ts +0 -0
- package/dist/components/FormFieldTextInput/FormFieldTextInput.d.ts +0 -0
- package/dist/components/FormFrame/FormFrame.d.ts +0 -0
- package/dist/components/FormFrame/FormFrame.test.d.ts +1 -0
- package/dist/components/FormFrame/index.d.ts +0 -0
- package/dist/components/FormResponse/FormResponse.d.ts +0 -0
- package/dist/components/FormStepDisplay/FormStepDisplay.d.ts +0 -0
- package/dist/components/FormStepDisplay/index.d.ts +0 -0
- package/dist/components/ResponseDisplay/ResponseDisplay.d.ts +0 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/config/form-widget-config.d.ts +0 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.es.js +55 -55
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +55 -55
- package/dist/presets/costguide.d.ts +19 -0
- package/dist/presets/index.d.ts +1 -0
- package/dist/services/EventTrackingService.d.ts +0 -0
- package/dist/stories/handoff-form.d.ts +10 -0
- package/dist/types/events.d.ts +0 -0
- package/dist/utils/__test__/formatToInputProps.test.d.ts +1 -0
- package/dist/utils/formatToInputProps.d.ts +0 -0
- package/dist/utils/stylePreset.d.ts +64 -0
- package/dist/utils/stylePreset.test.d.ts +1 -0
- package/dist/xapp-form-widget.css +130 -9
- package/dist/xapp-form-widget.js +26 -26
- package/package.json +4 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PartnerFormStyle } from "@xapp/stentor-form-widget-channel";
|
|
2
|
+
/**
|
|
3
|
+
* CostGuide's approved form look, as a named style bundle.
|
|
4
|
+
*
|
|
5
|
+
* ONE definition, exported so every consumer reads the same values: the code
|
|
6
|
+
* fallback in contact-app's partner registry, and the Storybook story that shows
|
|
7
|
+
* the look. Duplicating it drifts -- the story and the registry had already
|
|
8
|
+
* diverged on the button colours, which is how a CostGuide-preset form ended up
|
|
9
|
+
* rendering a stock magenta Continue button inside a teal frame.
|
|
10
|
+
*
|
|
11
|
+
* Once `public.partnerBranding.formStyle` ships (XappMedia/stentor-api#5753) the
|
|
12
|
+
* API-served bundle wins and this is only reached when that fetch fails.
|
|
13
|
+
*
|
|
14
|
+
* Colour notes, all from the approved design:
|
|
15
|
+
* - #1aacbe is the frame border, the buttons and the selected chip/date state.
|
|
16
|
+
* - #22a2b4 is the tab -- deliberately a DIFFERENT teal from the border.
|
|
17
|
+
* - #eef8fa is the card interior the framed step sits on.
|
|
18
|
+
*/
|
|
19
|
+
export declare const COST_GUIDE_FORM_STYLE: PartnerFormStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { COST_GUIDE_FORM_STYLE } from "./costguide";
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MultistepForm } from "stentor-models";
|
|
2
|
+
/**
|
|
3
|
+
* A two step booking form: our own request step, then a handoff to a partner's
|
|
4
|
+
* booking embed.
|
|
5
|
+
*
|
|
6
|
+
* The step titles/subtitles are what a partner frame renders in its intro block,
|
|
7
|
+
* and the second step is the one that must render UNframed -- the partner's embed
|
|
8
|
+
* brings its own frame.
|
|
9
|
+
*/
|
|
10
|
+
export declare const handoffForm: MultistepForm;
|
package/dist/types/events.d.ts
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FormWidgetTheme, PartnerFormFraming, PartnerFormStyle } from "@xapp/stentor-form-widget-channel";
|
|
2
|
+
/**
|
|
3
|
+
* The reserved preset name that forces the partner style off for a single form,
|
|
4
|
+
* whatever the partner record says. A permanent per-form exception.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STYLE_PRESET_NONE = "none";
|
|
7
|
+
export interface FormStyleContext {
|
|
8
|
+
/**
|
|
9
|
+
* True only for the stand-alone booking page. A form embedded on the customer's
|
|
10
|
+
* own website is the customer's own chrome -- the preset must never apply there,
|
|
11
|
+
* or every embedded form belonging to a styled partner would silently change
|
|
12
|
+
* appearance.
|
|
13
|
+
*/
|
|
14
|
+
readonly standalone?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The form's own tri-state preset -- see FormWidgetEnv.stylePreset.
|
|
17
|
+
*/
|
|
18
|
+
readonly stylePreset?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Canonical code of the partner the form belongs to.
|
|
21
|
+
*/
|
|
22
|
+
readonly partnerCode?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The customer's own theme, which the preset merges over.
|
|
25
|
+
*/
|
|
26
|
+
readonly customerTheme?: FormWidgetTheme;
|
|
27
|
+
/**
|
|
28
|
+
* Looks a named style bundle up. API-served, with a code fallback.
|
|
29
|
+
*/
|
|
30
|
+
readonly getPresetStyle?: (preset: string) => PartnerFormStyle | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface ResolvedFormStyle {
|
|
33
|
+
/**
|
|
34
|
+
* The preset that applied, or undefined when the form is left alone.
|
|
35
|
+
*/
|
|
36
|
+
readonly preset?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The theme to hand the widget: the customer's, with the preset merged over it.
|
|
39
|
+
*/
|
|
40
|
+
readonly theme?: FormWidgetTheme;
|
|
41
|
+
/**
|
|
42
|
+
* The partner chrome to draw around the form, if the preset defines any.
|
|
43
|
+
*/
|
|
44
|
+
readonly framing?: PartnerFormFraming;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Works out which named style bundle applies to a form, or undefined for none.
|
|
48
|
+
*
|
|
49
|
+
* `stylePreset` is tri-state and overrides the partner record either way:
|
|
50
|
+
* absent inherits `formStyle.enabled`, a name forces on, "none" forces off.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveStylePresetName(context: FormStyleContext): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Resolves the preset and applies it, returning the theme the widget should use and
|
|
55
|
+
* the framing it should draw.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveFormStyle(context: FormStyleContext): ResolvedFormStyle;
|
|
58
|
+
/**
|
|
59
|
+
* Merges a preset theme *over* a customer theme: the preset wins where it defines a
|
|
60
|
+
* value, and the customer's values survive everywhere the preset is silent. Nested
|
|
61
|
+
* groups (font, text, card, standAlone, ...) merge rather than replace, so a preset
|
|
62
|
+
* that only sets `font.fontFamily` keeps the customer's `font.link`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function mergeFormWidgetTheme(base?: FormWidgetTheme, override?: FormWidgetTheme): FormWidgetTheme | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
@media (max-width: 640px) {
|
|
14
14
|
.ModalDialog-module_xapp_search_modal__WpGiJ {
|
|
15
|
-
padding-left
|
|
16
|
-
padding-right: 24px;
|
|
15
|
+
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
@media (max-height: 640px) {
|
|
18
|
+
@media (max-height: 640px) and (min-width: 641px) {
|
|
20
19
|
.ModalDialog-module_xapp_search_modal__WpGiJ {
|
|
21
20
|
padding-bottom: 24px;
|
|
22
21
|
}
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
@media (max-width: 640px) {
|
|
42
41
|
.ModalDialog-module_xapp_search_modal__body__qK17C {
|
|
43
42
|
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
51
51
|
--xapp-bubble-background: #fff;
|
|
52
52
|
}
|
|
53
53
|
.Card-module_xapp_search_card__9iVCv {
|
|
54
|
-
border: solid 0 #d3d3df;
|
|
54
|
+
border: solid 0 var(--xapp-form-widget-border-color, #d3d3df);
|
|
55
55
|
border-radius: 12px;
|
|
56
56
|
margin-top: 0;
|
|
57
57
|
margin-right: 0;
|
|
@@ -417,6 +417,21 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
417
417
|
.FormFieldTextInput-module_xapp_text_input_text__3rHVn .MuiInputBase-multiline {
|
|
418
418
|
padding: 0px;
|
|
419
419
|
}
|
|
420
|
+
.FormFieldDropdown-module_xapp_dropdown_container__4oRlr {
|
|
421
|
+
margin-top: 20px;
|
|
422
|
+
margin-bottom: 20px;
|
|
423
|
+
}
|
|
424
|
+
.FormFieldDropdown-module_xapp_dropdown_container__4oRlr .MuiInputBase-input,
|
|
425
|
+
.FormFieldDropdown-module_xapp_dropdown_container__4oRlr select {
|
|
426
|
+
font-size: var(--xapp-form-widget-dropdown-font-size, 14px);
|
|
427
|
+
font-family: var(--xapp-form-widget-dropdown-font-family, var(--xapp-form-widget-font-family, RobotoRegular, serif));
|
|
428
|
+
}
|
|
429
|
+
@media (max-width: 640px) {
|
|
430
|
+
.FormFieldDropdown-module_xapp_dropdown_container__4oRlr .MuiInputBase-input,
|
|
431
|
+
.FormFieldDropdown-module_xapp_dropdown_container__4oRlr select {
|
|
432
|
+
font-size: var(--xapp-form-widget-dropdown-font-size-mobile, 16px);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
420
435
|
.FormFieldDate-module_xapp_date_picker_container__d8LYB {
|
|
421
436
|
height: 100%;
|
|
422
437
|
display: flex;
|
|
@@ -569,8 +584,8 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
569
584
|
}
|
|
570
585
|
@media (max-width: 640px) {
|
|
571
586
|
.FormStepDisplay-module_xapp_step_full_bleed__rhGGK {
|
|
572
|
-
margin-left: -
|
|
573
|
-
margin-right: -
|
|
587
|
+
margin-left: -8px;
|
|
588
|
+
margin-right: -8px;
|
|
574
589
|
}
|
|
575
590
|
}
|
|
576
591
|
|
|
@@ -592,6 +607,42 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
592
607
|
font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
|
|
593
608
|
}
|
|
594
609
|
|
|
610
|
+
.FormStepDisplay-module_xapp_external_widget_loading__aRtx6 {
|
|
611
|
+
display: flex;
|
|
612
|
+
flex-direction: column;
|
|
613
|
+
align-items: center;
|
|
614
|
+
justify-content: center;
|
|
615
|
+
gap: 14px;
|
|
616
|
+
min-height: 240px;
|
|
617
|
+
padding: 40px 20px;
|
|
618
|
+
text-align: center;
|
|
619
|
+
font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
|
|
620
|
+
color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
|
|
621
|
+
}
|
|
622
|
+
.FormStepDisplay-module_xapp_external_widget_loading__aRtx6 p {
|
|
623
|
+
margin: 0;
|
|
624
|
+
font-size: 0.95em;
|
|
625
|
+
opacity: 0.7;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.FormStepDisplay-module_xapp_external_widget_spinner__ga0X7 {
|
|
629
|
+
display: inline-block;
|
|
630
|
+
width: 44px;
|
|
631
|
+
height: 44px;
|
|
632
|
+
color: var(--xapp-form-widget-primary-button-color, #ea6539);
|
|
633
|
+
}
|
|
634
|
+
.FormStepDisplay-module_xapp_external_widget_spinner__ga0X7 svg {
|
|
635
|
+
width: 100%;
|
|
636
|
+
height: 100%;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.FormStepDisplay-module_xapp_submit_error__Zbqdj {
|
|
640
|
+
padding: 12px 20px;
|
|
641
|
+
text-align: center;
|
|
642
|
+
font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
|
|
643
|
+
color: #b3261e;
|
|
644
|
+
}
|
|
645
|
+
|
|
595
646
|
.FormStepDisplay-module_xapp_formfield__hRmVx {
|
|
596
647
|
display: none;
|
|
597
648
|
font-family: inherit !important;
|
|
@@ -624,6 +675,11 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
624
675
|
font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
|
|
625
676
|
}
|
|
626
677
|
|
|
678
|
+
.FormStepDisplay-module_xapp_formfield_subtitle__8VQC2 {
|
|
679
|
+
font-size: 0.875em;
|
|
680
|
+
opacity: 0.8;
|
|
681
|
+
}
|
|
682
|
+
|
|
627
683
|
.FormStepDisplay-module_xapp_final_button_container__Gco-E {
|
|
628
684
|
display: flex;
|
|
629
685
|
justify-content: center;
|
|
@@ -754,6 +810,67 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
754
810
|
#airo-anchor .btn-back:focus {
|
|
755
811
|
outline-color: var(--xapp-form-widget-focus-ring-color, #012b54) !important;
|
|
756
812
|
}
|
|
813
|
+
.FormFrame-module_xapp_form_frame_root__BLTha {
|
|
814
|
+
display: block;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
.FormFrame-module_xapp_form_frame_intro__S4kWd {
|
|
818
|
+
background-color: #ffffff;
|
|
819
|
+
padding: 28px 16px 18px;
|
|
820
|
+
text-align: center;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.FormFrame-module_xapp_form_frame_title__GA8dy {
|
|
824
|
+
margin: 0;
|
|
825
|
+
font-family: Poppins, Arial, Verdana, sans-serif;
|
|
826
|
+
font-size: 24px;
|
|
827
|
+
font-weight: 700;
|
|
828
|
+
line-height: 1.15;
|
|
829
|
+
color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.FormFrame-module_xapp_form_frame_subtitle__WOeJI {
|
|
833
|
+
margin: 6px 0 0 0;
|
|
834
|
+
font-family: Poppins, Arial, Verdana, sans-serif;
|
|
835
|
+
font-size: 14px;
|
|
836
|
+
font-weight: 400;
|
|
837
|
+
line-height: 1.4;
|
|
838
|
+
color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
|
|
839
|
+
opacity: 0.75;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.FormFrame-module_xapp_form_frame_framed__9E311 {
|
|
843
|
+
position: relative;
|
|
844
|
+
border: 4px solid var(--xapp-form-widget-border-color, #d3d3df);
|
|
845
|
+
border-radius: 0;
|
|
846
|
+
background-color: var(--xapp-form-widget-background-color, #f3f8fb);
|
|
847
|
+
margin-top: -2px;
|
|
848
|
+
padding: 24px 22px 8px;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.FormFrame-module_xapp_form_frame_plain__rBarK {
|
|
852
|
+
display: block;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.FormFrame-module_xapp_form_frame_tab_row__osSVR {
|
|
856
|
+
background-color: #ffffff;
|
|
857
|
+
text-align: center;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.FormFrame-module_xapp_form_frame_tab__0O2ga {
|
|
861
|
+
display: inline-block;
|
|
862
|
+
position: relative;
|
|
863
|
+
z-index: 1;
|
|
864
|
+
padding: 12px 30px;
|
|
865
|
+
border-radius: 12px 12px 0 0;
|
|
866
|
+
background-color: var(--xapp-form-widget-header-background-color, #012b54);
|
|
867
|
+
color: var(--xapp-form-widget-header-text-color, #b7c5d1);
|
|
868
|
+
font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
|
|
869
|
+
font-size: 14px;
|
|
870
|
+
font-weight: 700;
|
|
871
|
+
letter-spacing: 1px;
|
|
872
|
+
white-space: nowrap;
|
|
873
|
+
}
|
|
757
874
|
.SimpleNavigationHeader-module_xapp_navigation_header__YhCD1 {
|
|
758
875
|
background-color: inherit !important;
|
|
759
876
|
}
|
|
@@ -834,7 +951,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
834
951
|
.Button-module_xapp_search_btn__cQf3T {
|
|
835
952
|
display: inline-block;
|
|
836
953
|
border-radius: var(--xapp-form-widget-border-radius-md, 12px);
|
|
837
|
-
border: solid 1px #d3d3df;
|
|
954
|
+
border: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
|
|
838
955
|
background: white;
|
|
839
956
|
padding: 4px 24px;
|
|
840
957
|
color: black;
|
|
@@ -921,7 +1038,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
921
1038
|
.FormWidget-module_xapp_form_widget__V-G-H {
|
|
922
1039
|
display: flex;
|
|
923
1040
|
flex-direction: column;
|
|
924
|
-
border: solid 1px #d3d3df;
|
|
1041
|
+
border: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
|
|
925
1042
|
background: var(--xapp-form-widget-background-color, #f3f8fb);
|
|
926
1043
|
border-radius: var(--xapp-form-widget-border-radius-xl, 20px);
|
|
927
1044
|
overflow: hidden;
|
|
@@ -934,7 +1051,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
934
1051
|
.FormWidget-module_xapp_form_widget__content__a9NXC {
|
|
935
1052
|
display: flex;
|
|
936
1053
|
flex-direction: column;
|
|
937
|
-
border-top: solid 1px #d3d3df;
|
|
1054
|
+
border-top: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
|
|
938
1055
|
max-height: 100%;
|
|
939
1056
|
min-height: 128px;
|
|
940
1057
|
overflow: hidden;
|
|
@@ -1013,12 +1130,16 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
|
|
|
1013
1130
|
@media (max-width: 640px) {
|
|
1014
1131
|
.FormWidget-module_xapp_form_widget__V-G-H {
|
|
1015
1132
|
width: 100%;
|
|
1133
|
+
height: 100%;
|
|
1016
1134
|
border-radius: 0;
|
|
1017
1135
|
border: 0;
|
|
1018
1136
|
}
|
|
1019
1137
|
.FormWidget-module_xapp_form_widget__content__a9NXC {
|
|
1020
1138
|
width: 100%;
|
|
1021
1139
|
border-top: 0;
|
|
1140
|
+
flex: 1 1 auto;
|
|
1141
|
+
min-height: 0;
|
|
1142
|
+
overflow-y: auto;
|
|
1022
1143
|
}
|
|
1023
1144
|
}
|
|
1024
1145
|
.SideButton-module_xapp_form_sticky_button__YqORL {
|