@xapp/form-widget 1.98.1 → 1.100.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.
@@ -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";
@@ -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;
@@ -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: 24px;
16
- padding-right: 24px;
15
+ padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(env(safe-area-inset-bottom) + var(--xapp-keyboard-inset, 0px)) 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,17 +40,14 @@
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
-
47
- body.ModalDialog-module_xapp_search_opened__jgDSX {
48
- overflow: hidden;
49
- }
50
46
  .SearchResponseBubble-module_xapp_search_response_bubble__UtmuK {
51
47
  --xapp-bubble-background: #fff;
52
48
  }
53
49
  .Card-module_xapp_search_card__9iVCv {
54
- border: solid 0 #d3d3df;
50
+ border: solid 0 var(--xapp-form-widget-border-color, #d3d3df);
55
51
  border-radius: 12px;
56
52
  margin-top: 0;
57
53
  margin-right: 0;
@@ -417,6 +413,21 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
417
413
  .FormFieldTextInput-module_xapp_text_input_text__3rHVn .MuiInputBase-multiline {
418
414
  padding: 0px;
419
415
  }
416
+ .FormFieldDropdown-module_xapp_dropdown_container__4oRlr {
417
+ margin-top: 20px;
418
+ margin-bottom: 20px;
419
+ }
420
+ .FormFieldDropdown-module_xapp_dropdown_container__4oRlr .MuiInputBase-input,
421
+ .FormFieldDropdown-module_xapp_dropdown_container__4oRlr select {
422
+ font-size: var(--xapp-form-widget-dropdown-font-size, 14px);
423
+ font-family: var(--xapp-form-widget-dropdown-font-family, var(--xapp-form-widget-font-family, RobotoRegular, serif));
424
+ }
425
+ @media (max-width: 640px) {
426
+ .FormFieldDropdown-module_xapp_dropdown_container__4oRlr .MuiInputBase-input,
427
+ .FormFieldDropdown-module_xapp_dropdown_container__4oRlr select {
428
+ font-size: var(--xapp-form-widget-dropdown-font-size-mobile, 16px);
429
+ }
430
+ }
420
431
  .FormFieldDate-module_xapp_date_picker_container__d8LYB {
421
432
  height: 100%;
422
433
  display: flex;
@@ -500,6 +511,47 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
500
511
  font-weight: 600 !important;
501
512
  font-size: 0.75rem !important;
502
513
  }
514
+
515
+ /* Mobile: 44x44 tappable day cells.
516
+ *
517
+ * Date selection is the most expensive mis-tap in this funnel - the visitor either books the
518
+ * wrong day or gives up - and MUI ships 36x36 cells (30x30 once the rules above apply). Both
519
+ * are under the 44x44 that Apple's HIG and WCAG 2.5.8 ask for.
520
+ *
521
+ * `:global(...)` rather than the bare MUI class names used above, and that difference is not
522
+ * cosmetic. The two builds treat this file differently: rollup's postcss-modules is
523
+ * configured with a `generateScopedName` that returns every name unchanged, so the plain
524
+ * selectors above do match MUI's classes in the published bundle - but Storybook's css-loader
525
+ * hashes them, so up there they match nothing and the calendar renders at MUI's own defaults.
526
+ * `:global` is honoured by both, so these rules land either way. (The rules above are left as
527
+ * they are: making them global too would change the shipped calendar, which is not what this
528
+ * issue is about.)
529
+ *
530
+ * The seven columns have to keep fitting inside MUI's 320px-wide calendar, and 7 x 44 = 308
531
+ * only fits once the 2px side margins on each cell go - hence dropping the gap rather than
532
+ * the cell, per the issue.
533
+ */
534
+ @media (max-width: 640px) {
535
+ .FormFieldDate-module_xapp_date_picker__Rvtj1 .MuiPickersDay-root,
536
+ .FormFieldDate-module_xapp_date_picker__Rvtj1 .MuiPickersDay-dayWithMargin {
537
+ width: 44px !important;
538
+ height: 44px !important;
539
+ margin: 0 !important;
540
+ font-size: 0.875rem !important;
541
+ }
542
+ .FormFieldDate-module_xapp_date_picker__Rvtj1 .MuiDayCalendar-weekDayLabel {
543
+ width: 44px !important;
544
+ height: 44px !important;
545
+ margin: 0 !important;
546
+ }
547
+ .FormFieldDate-module_xapp_date_picker__Rvtj1 .MuiDayCalendar-slideTransition {
548
+ min-height: 264px !important;
549
+ }
550
+ .FormFieldDate-module_xapp_date_picker__Rvtj1 .MuiPickersArrowSwitcher-button {
551
+ width: 44px !important;
552
+ height: 44px !important;
553
+ }
554
+ }
503
555
  .FormFieldTextInputAddress-module_xapp_text_input_address_container__title__IbovL p {
504
556
  margin: 0;
505
557
  font-family: var(--xapp-form-widget-text-font-family, var(--xapp-form-widget-font-family, RobotoRegular, serif));
@@ -569,8 +621,8 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
569
621
  }
570
622
  @media (max-width: 640px) {
571
623
  .FormStepDisplay-module_xapp_step_full_bleed__rhGGK {
572
- margin-left: -32px;
573
- margin-right: -32px;
624
+ margin-left: calc(-1 * (8px + env(safe-area-inset-left, 0px)));
625
+ margin-right: calc(-1 * (8px + env(safe-area-inset-right, 0px)));
574
626
  }
575
627
  }
576
628
 
@@ -592,6 +644,35 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
592
644
  font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
593
645
  }
594
646
 
647
+ .FormStepDisplay-module_xapp_external_widget_loading__aRtx6 {
648
+ display: flex;
649
+ flex-direction: column;
650
+ align-items: center;
651
+ justify-content: center;
652
+ gap: 14px;
653
+ min-height: 240px;
654
+ padding: 40px 20px;
655
+ text-align: center;
656
+ font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
657
+ color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
658
+ }
659
+ .FormStepDisplay-module_xapp_external_widget_loading__aRtx6 p {
660
+ margin: 0;
661
+ font-size: 0.95em;
662
+ opacity: 0.7;
663
+ }
664
+
665
+ .FormStepDisplay-module_xapp_external_widget_spinner__ga0X7 {
666
+ display: inline-block;
667
+ width: 44px;
668
+ height: 44px;
669
+ color: var(--xapp-form-widget-primary-button-color, #ea6539);
670
+ }
671
+ .FormStepDisplay-module_xapp_external_widget_spinner__ga0X7 svg {
672
+ width: 100%;
673
+ height: 100%;
674
+ }
675
+
595
676
  .FormStepDisplay-module_xapp_submit_error__Zbqdj {
596
677
  padding: 12px 20px;
597
678
  text-align: center;
@@ -631,6 +712,11 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
631
712
  font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
632
713
  }
633
714
 
715
+ .FormStepDisplay-module_xapp_formfield_subtitle__8VQC2 {
716
+ font-size: 0.875em;
717
+ opacity: 0.8;
718
+ }
719
+
634
720
  .FormStepDisplay-module_xapp_final_button_container__Gco-E {
635
721
  display: flex;
636
722
  justify-content: center;
@@ -761,6 +847,67 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
761
847
  #airo-anchor .btn-back:focus {
762
848
  outline-color: var(--xapp-form-widget-focus-ring-color, #012b54) !important;
763
849
  }
850
+ .FormFrame-module_xapp_form_frame_root__BLTha {
851
+ display: block;
852
+ }
853
+
854
+ .FormFrame-module_xapp_form_frame_intro__S4kWd {
855
+ background-color: #ffffff;
856
+ padding: 28px 16px 18px;
857
+ text-align: center;
858
+ }
859
+
860
+ .FormFrame-module_xapp_form_frame_title__GA8dy {
861
+ margin: 0;
862
+ font-family: Poppins, Arial, Verdana, sans-serif;
863
+ font-size: 24px;
864
+ font-weight: 700;
865
+ line-height: 1.15;
866
+ color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
867
+ }
868
+
869
+ .FormFrame-module_xapp_form_frame_subtitle__WOeJI {
870
+ margin: 6px 0 0 0;
871
+ font-family: Poppins, Arial, Verdana, sans-serif;
872
+ font-size: 14px;
873
+ font-weight: 400;
874
+ line-height: 1.4;
875
+ color: var(--xapp-form-widget-text-color, rgba(0, 0, 0, 0.87));
876
+ opacity: 0.75;
877
+ }
878
+
879
+ .FormFrame-module_xapp_form_frame_framed__9E311 {
880
+ position: relative;
881
+ border: 4px solid var(--xapp-form-widget-border-color, #d3d3df);
882
+ border-radius: 0;
883
+ background-color: var(--xapp-form-widget-background-color, #f3f8fb);
884
+ margin-top: -2px;
885
+ padding: 24px 22px 8px;
886
+ }
887
+
888
+ .FormFrame-module_xapp_form_frame_plain__rBarK {
889
+ display: block;
890
+ }
891
+
892
+ .FormFrame-module_xapp_form_frame_tab_row__osSVR {
893
+ background-color: #ffffff;
894
+ text-align: center;
895
+ }
896
+
897
+ .FormFrame-module_xapp_form_frame_tab__0O2ga {
898
+ display: inline-block;
899
+ position: relative;
900
+ z-index: 1;
901
+ padding: 12px 30px;
902
+ border-radius: 12px 12px 0 0;
903
+ background-color: var(--xapp-form-widget-header-background-color, #012b54);
904
+ color: var(--xapp-form-widget-header-text-color, #b7c5d1);
905
+ font-family: var(--xapp-form-widget-font-family, RobotoRegular, serif);
906
+ font-size: 14px;
907
+ font-weight: 700;
908
+ letter-spacing: 1px;
909
+ white-space: nowrap;
910
+ }
764
911
  .SimpleNavigationHeader-module_xapp_navigation_header__YhCD1 {
765
912
  background-color: inherit !important;
766
913
  }
@@ -841,7 +988,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
841
988
  .Button-module_xapp_search_btn__cQf3T {
842
989
  display: inline-block;
843
990
  border-radius: var(--xapp-form-widget-border-radius-md, 12px);
844
- border: solid 1px #d3d3df;
991
+ border: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
845
992
  background: white;
846
993
  padding: 4px 24px;
847
994
  color: black;
@@ -928,7 +1075,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
928
1075
  .FormWidget-module_xapp_form_widget__V-G-H {
929
1076
  display: flex;
930
1077
  flex-direction: column;
931
- border: solid 1px #d3d3df;
1078
+ border: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
932
1079
  background: var(--xapp-form-widget-background-color, #f3f8fb);
933
1080
  border-radius: var(--xapp-form-widget-border-radius-xl, 20px);
934
1081
  overflow: hidden;
@@ -941,7 +1088,7 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
941
1088
  .FormWidget-module_xapp_form_widget__content__a9NXC {
942
1089
  display: flex;
943
1090
  flex-direction: column;
944
- border-top: solid 1px #d3d3df;
1091
+ border-top: solid 1px var(--xapp-form-widget-border-color, #d3d3df);
945
1092
  max-height: 100%;
946
1093
  min-height: 128px;
947
1094
  overflow: hidden;
@@ -975,6 +1122,15 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
975
1122
  transition: background-color 200ms ease-in-out, transform 150ms ease-in-out, box-shadow 200ms ease-in-out;
976
1123
  box-shadow: var(--xapp-form-widget-box-shadow-subtle, 0 2px 8px rgba(0, 0, 0, 0.08));
977
1124
  }
1125
+ .FormWidget-module_xapp_form_widget__close__0lp0O::before {
1126
+ content: "";
1127
+ position: absolute;
1128
+ top: 50%;
1129
+ left: 50%;
1130
+ transform: translate(-50%, -50%);
1131
+ width: 44px;
1132
+ height: 44px;
1133
+ }
978
1134
  .FormWidget-module_xapp_form_widget__close__0lp0O:hover {
979
1135
  background-color: rgb(255, 255, 255);
980
1136
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
@@ -1020,12 +1176,16 @@ body.ModalDialog-module_xapp_search_opened__jgDSX {
1020
1176
  @media (max-width: 640px) {
1021
1177
  .FormWidget-module_xapp_form_widget__V-G-H {
1022
1178
  width: 100%;
1179
+ height: 100%;
1023
1180
  border-radius: 0;
1024
1181
  border: 0;
1025
1182
  }
1026
1183
  .FormWidget-module_xapp_form_widget__content__a9NXC {
1027
1184
  width: 100%;
1028
1185
  border-top: 0;
1186
+ flex: 1 1 auto;
1187
+ min-height: 0;
1188
+ overflow-y: auto;
1029
1189
  }
1030
1190
  }
1031
1191
  .SideButton-module_xapp_form_sticky_button__YqORL {