@flamingo-stack/openframe-frontend-core 0.0.596-2034.5686.1 → 0.0.596-2034.5696.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/dist/{chunk-QVOGALQE.cjs → chunk-4S5E7NOM.cjs} +5 -5
- package/dist/{chunk-QVOGALQE.cjs.map → chunk-4S5E7NOM.cjs.map} +1 -1
- package/dist/{chunk-FGHJ3BC7.js → chunk-6EBKO275.js} +3 -3
- package/dist/{chunk-Y6JB7X5Y.js → chunk-7L5ROE3Z.js} +3 -3
- package/dist/{chunk-A6YERC4N.js → chunk-AVIZUQRW.js} +2 -2
- package/dist/{chunk-D3Q3VYRU.cjs → chunk-AYVTVUZT.cjs} +15 -15
- package/dist/{chunk-D3Q3VYRU.cjs.map → chunk-AYVTVUZT.cjs.map} +1 -1
- package/dist/{chunk-25LZZY6E.cjs → chunk-B3NX4GZS.cjs} +3 -3
- package/dist/{chunk-25LZZY6E.cjs.map → chunk-B3NX4GZS.cjs.map} +1 -1
- package/dist/{chunk-OI7RNQAS.cjs → chunk-DVSTM6QK.cjs} +33 -33
- package/dist/{chunk-OI7RNQAS.cjs.map → chunk-DVSTM6QK.cjs.map} +1 -1
- package/dist/{chunk-SLIUM3VO.cjs → chunk-EQ3DAGD7.cjs} +43 -43
- package/dist/{chunk-SLIUM3VO.cjs.map → chunk-EQ3DAGD7.cjs.map} +1 -1
- package/dist/{chunk-MN4TFBRA.cjs → chunk-FCNICDWP.cjs} +9 -9
- package/dist/{chunk-MN4TFBRA.cjs.map → chunk-FCNICDWP.cjs.map} +1 -1
- package/dist/{chunk-YP56SX7C.cjs → chunk-FV5VGJE6.cjs} +3 -3
- package/dist/{chunk-YP56SX7C.cjs.map → chunk-FV5VGJE6.cjs.map} +1 -1
- package/dist/{chunk-QNZM43HU.js → chunk-GOD47MJM.js} +6 -4
- package/dist/{chunk-QNZM43HU.js.map → chunk-GOD47MJM.js.map} +1 -1
- package/dist/{chunk-AYMBMVOD.js → chunk-HFJSBIXL.js} +3 -3
- package/dist/{chunk-ZXEYS2XP.cjs → chunk-IMIR5V6E.cjs} +26 -24
- package/dist/chunk-IMIR5V6E.cjs.map +1 -0
- package/dist/{chunk-J5EA7PMY.js → chunk-KU3JQWYJ.js} +5 -5
- package/dist/{chunk-TYURDSIN.js → chunk-MF324FSD.js} +30 -30
- package/dist/chunk-MF324FSD.js.map +1 -0
- package/dist/{chunk-FIQIT6HX.js → chunk-MGBWMZEL.js} +2 -2
- package/dist/{chunk-YQYOEGAT.cjs → chunk-MIC4HHVZ.cjs} +23 -21
- package/dist/chunk-MIC4HHVZ.cjs.map +1 -0
- package/dist/{chunk-PO4ATWE4.js → chunk-N7SFQMCH.js} +2 -2
- package/dist/{chunk-E4YWJY3A.cjs → chunk-OEDUVTPT.cjs} +10 -10
- package/dist/{chunk-E4YWJY3A.cjs.map → chunk-OEDUVTPT.cjs.map} +1 -1
- package/dist/{chunk-3IT35YDV.cjs → chunk-OGTXZFFE.cjs} +71 -70
- package/dist/chunk-OGTXZFFE.cjs.map +1 -0
- package/dist/{chunk-GZ76RASF.js → chunk-P2SECY3U.js} +5 -5
- package/dist/{chunk-S7LV66HD.js → chunk-PTXOWFRB.js} +8 -7
- package/dist/chunk-PTXOWFRB.js.map +1 -0
- package/dist/{chunk-AGKFT4FA.js → chunk-PYWF5JJW.js} +5 -5
- package/dist/{chunk-TZK5N6AH.cjs → chunk-R5IWJONE.cjs} +187 -187
- package/dist/chunk-R5IWJONE.cjs.map +1 -0
- package/dist/{chunk-JVYNMMNE.js → chunk-SSSZ64YG.js} +5 -3
- package/dist/chunk-SSSZ64YG.js.map +1 -0
- package/dist/{chunk-IDDGXYES.cjs → chunk-SXVGFJ24.cjs} +22 -22
- package/dist/{chunk-IDDGXYES.cjs.map → chunk-SXVGFJ24.cjs.map} +1 -1
- package/dist/{chunk-ZVBYWM5Z.js → chunk-TRJJMZSQ.js} +2 -2
- package/dist/{chunk-BLYQD3PG.js → chunk-VD3ZAA2O.js} +3 -3
- package/dist/{chunk-E7MTTLKC.js → chunk-VNSRNVPD.js} +2 -2
- package/dist/{chunk-E7MTTLKC.js.map → chunk-VNSRNVPD.js.map} +1 -1
- package/dist/{chunk-TDLETTI4.cjs → chunk-WRWXND3X.cjs} +10 -10
- package/dist/{chunk-TDLETTI4.cjs.map → chunk-WRWXND3X.cjs.map} +1 -1
- package/dist/{chunk-L7GNBUXF.cjs → chunk-YBPFIXV4.cjs} +2 -2
- package/dist/{chunk-L7GNBUXF.cjs.map → chunk-YBPFIXV4.cjs.map} +1 -1
- package/dist/{chunk-HPUD7X67.cjs → chunk-YNO4DEXK.cjs} +4 -4
- package/dist/{chunk-HPUD7X67.cjs.map → chunk-YNO4DEXK.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +9 -9
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/contact-form.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/auth/terms-agreement-label.d.ts.map +1 -1
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +38 -38
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/booking-form.d.ts +9 -3
- package/dist/components/meeting-scheduler/booking-form.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +75 -50
- package/dist/components/meeting-scheduler/index.cjs.map +1 -1
- package/dist/components/meeting-scheduler/index.d.ts +12 -1
- package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.js +53 -28
- package/dist/components/meeting-scheduler/index.js.map +1 -1
- package/dist/components/navigation/header-global-search.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/tickets/ticket-open-form.d.ts.map +1 -1
- package/dist/components/ui/admin-form-modal.d.ts.map +1 -1
- package/dist/components/ui/benefit-card.d.ts +1 -1
- package/dist/components/ui/benefit-card.d.ts.map +1 -1
- package/dist/components/ui/checkbox-block.d.ts +2 -1
- package/dist/components/ui/checkbox-block.d.ts.map +1 -1
- package/dist/components/ui/icon-tile.d.ts +3 -2
- package/dist/components/ui/icon-tile.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui/policy-link.d.ts +9 -1
- package/dist/components/ui/policy-link.d.ts.map +1 -1
- package/dist/hooks/use-meeting-booking.d.ts +2 -0
- package/dist/hooks/use-meeting-booking.d.ts.map +1 -1
- package/dist/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/schemas/meeting-booking-schema.cjs +4 -0
- package/dist/schemas/meeting-booking-schema.cjs.map +1 -1
- package/dist/schemas/meeting-booking-schema.d.ts +2 -0
- package/dist/schemas/meeting-booking-schema.d.ts.map +1 -1
- package/dist/schemas/meeting-booking-schema.js +4 -1
- package/dist/schemas/meeting-booking-schema.js.map +1 -1
- package/dist/utils/hubspot-collected-forms.d.ts +22 -0
- package/dist/utils/hubspot-collected-forms.d.ts.map +1 -0
- package/dist/utils/hubspot-meetings-convention.d.ts +3 -1
- package/dist/utils/hubspot-meetings-convention.d.ts.map +1 -1
- package/dist/utils/index.cjs +5 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/meeting-scheduler-details-first.test.tsx +25 -3
- package/src/components/contact/contact-form.tsx +2 -0
- package/src/components/features/auth/terms-agreement-label.tsx +6 -16
- package/src/components/features/video-center-badge.tsx +2 -2
- package/src/components/meeting-scheduler/booking-form.tsx +37 -13
- package/src/components/meeting-scheduler/index.tsx +56 -32
- package/src/components/navigation/header-global-search.tsx +2 -0
- package/src/components/tickets/ticket-open-form.tsx +2 -1
- package/src/components/ui/admin-form-modal.tsx +2 -0
- package/src/components/ui/benefit-card.tsx +5 -1
- package/src/components/ui/checkbox-block.tsx +4 -1
- package/src/components/ui/icon-tile.tsx +3 -2
- package/src/components/ui/policy-link.tsx +20 -2
- package/src/hooks/use-meeting-booking.ts +4 -1
- package/src/schemas/meeting-booking-schema.ts +5 -0
- package/src/styles/app-globals.css +1 -1
- package/src/styles/index.css +1 -0
- package/src/styles/ods-effects.css +53 -0
- package/src/utils/hubspot-collected-forms.ts +19 -0
- package/src/utils/hubspot-meetings-convention.ts +4 -2
- package/src/utils/index.ts +1 -0
- package/dist/chunk-3IT35YDV.cjs.map +0 -1
- package/dist/chunk-JVYNMMNE.js.map +0 -1
- package/dist/chunk-S7LV66HD.js.map +0 -1
- package/dist/chunk-TYURDSIN.js.map +0 -1
- package/dist/chunk-TZK5N6AH.cjs.map +0 -1
- package/dist/chunk-YQYOEGAT.cjs.map +0 -1
- package/dist/chunk-ZXEYS2XP.cjs.map +0 -1
- /package/dist/{chunk-FGHJ3BC7.js.map → chunk-6EBKO275.js.map} +0 -0
- /package/dist/{chunk-Y6JB7X5Y.js.map → chunk-7L5ROE3Z.js.map} +0 -0
- /package/dist/{chunk-A6YERC4N.js.map → chunk-AVIZUQRW.js.map} +0 -0
- /package/dist/{chunk-AYMBMVOD.js.map → chunk-HFJSBIXL.js.map} +0 -0
- /package/dist/{chunk-J5EA7PMY.js.map → chunk-KU3JQWYJ.js.map} +0 -0
- /package/dist/{chunk-FIQIT6HX.js.map → chunk-MGBWMZEL.js.map} +0 -0
- /package/dist/{chunk-PO4ATWE4.js.map → chunk-N7SFQMCH.js.map} +0 -0
- /package/dist/{chunk-GZ76RASF.js.map → chunk-P2SECY3U.js.map} +0 -0
- /package/dist/{chunk-AGKFT4FA.js.map → chunk-PYWF5JJW.js.map} +0 -0
- /package/dist/{chunk-ZVBYWM5Z.js.map → chunk-TRJJMZSQ.js.map} +0 -0
- /package/dist/{chunk-BLYQD3PG.js.map → chunk-VD3ZAA2O.js.map} +0 -0
package/package.json
CHANGED
|
@@ -14,8 +14,12 @@ const availability: MeetingAvailability = {
|
|
|
14
14
|
const book = vi.fn<(payload: Record<string, unknown>) => Promise<unknown>>();
|
|
15
15
|
const refetchAvailability = vi.fn(() => Promise.resolve());
|
|
16
16
|
const toast = vi.fn();
|
|
17
|
+
/** Mutable so a test can flip the hook's in-flight flag between renders. */
|
|
18
|
+
const hookState = { isSubmitting: false };
|
|
17
19
|
|
|
18
|
-
vi.mock('../hooks/use-meeting-booking',
|
|
20
|
+
vi.mock('../hooks/use-meeting-booking', async importOriginal => ({
|
|
21
|
+
// The sentinel keeps its ONE owner: only the hook itself is replaced.
|
|
22
|
+
...(await importOriginal()),
|
|
19
23
|
useMeetingBooking: () => ({
|
|
20
24
|
availability,
|
|
21
25
|
isLoadingAvailability: false,
|
|
@@ -25,19 +29,25 @@ vi.mock('../hooks/use-meeting-booking', () => ({
|
|
|
25
29
|
setMonthOffset: vi.fn(),
|
|
26
30
|
refetchAvailability,
|
|
27
31
|
book,
|
|
28
|
-
isSubmitting:
|
|
32
|
+
isSubmitting: hookState.isSubmitting,
|
|
29
33
|
}),
|
|
30
34
|
}));
|
|
31
35
|
vi.mock('../hooks/use-toast', () => ({ useToast: () => ({ toast }) }));
|
|
32
36
|
|
|
37
|
+
// A factory, not a shared element: React bails out of re-rendering the SAME element object.
|
|
38
|
+
const scheduler = () => (
|
|
39
|
+
<HubSpotMeetingScheduler meetingId="1" flow="details-first" initialAvailability={availability} />
|
|
40
|
+
);
|
|
41
|
+
|
|
33
42
|
async function continueFromDetails() {
|
|
34
|
-
|
|
43
|
+
const view = render(scheduler());
|
|
35
44
|
await screen.findByLabelText(/^Email/);
|
|
36
45
|
fillIdentity();
|
|
37
46
|
fireEvent.click(screen.getByRole('button', { name: 'Continue' }));
|
|
38
47
|
// The calendar step: Back exists here (it never does on the form step).
|
|
39
48
|
await screen.findByRole('button', { name: 'Back' });
|
|
40
49
|
expect(screen.queryByLabelText(/^Email/)).not.toBeInTheDocument();
|
|
50
|
+
return view;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
const timeChip = async () => {
|
|
@@ -50,6 +60,7 @@ const timeChip = async () => {
|
|
|
50
60
|
};
|
|
51
61
|
|
|
52
62
|
beforeEach(() => {
|
|
63
|
+
hookState.isSubmitting = false;
|
|
53
64
|
book.mockReset();
|
|
54
65
|
refetchAvailability.mockClear();
|
|
55
66
|
toast.mockClear();
|
|
@@ -84,4 +95,15 @@ describe('HubSpotMeetingScheduler — details-first flow', () => {
|
|
|
84
95
|
expect(await screen.findByLabelText(/^Email/)).toHaveValue('a@b.co');
|
|
85
96
|
expect(toast).toHaveBeenCalledWith(expect.objectContaining({ title: 'Booking failed' }));
|
|
86
97
|
});
|
|
98
|
+
|
|
99
|
+
it('while a POST is in flight the chips are disabled and the calendar cannot be paged', async () => {
|
|
100
|
+
const { rerender } = await continueFromDetails();
|
|
101
|
+
const chipsBefore = await timeChip();
|
|
102
|
+
expect(chipsBefore).not.toBeDisabled();
|
|
103
|
+
hookState.isSubmitting = true;
|
|
104
|
+
rerender(scheduler());
|
|
105
|
+
const chips = screen.getAllByRole('button').filter(b => /\d{1,2}:\d{2}/.test(b.textContent ?? ''));
|
|
106
|
+
expect(chips.length).toBeGreaterThan(0);
|
|
107
|
+
expect(chips.every(b => (b as HTMLButtonElement).disabled)).toBe(true);
|
|
108
|
+
});
|
|
87
109
|
});
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
referralSourceOptions,
|
|
34
34
|
defaultHelpCategoryOptions,
|
|
35
35
|
} from '../../schemas/contact-schema';
|
|
36
|
+
import { HUBSPOT_DO_NOT_COLLECT_FORM_PROPS } from '../../utils/hubspot-collected-forms';
|
|
36
37
|
import { ChatAttachmentAddButton, ChatAttachmentChipStrip } from '../chat/chat-attachment-bar';
|
|
37
38
|
import { useChatAttachments } from '../chat/hooks/use-chat-attachments';
|
|
38
39
|
import type { ChatAttachment } from '../chat/utils/chat-attachment-markdown';
|
|
@@ -262,6 +263,7 @@ export function ContactForm({
|
|
|
262
263
|
);
|
|
263
264
|
})}
|
|
264
265
|
className="flex flex-grow flex-col space-y-4 md:space-y-6"
|
|
266
|
+
{...HUBSPOT_DO_NOT_COLLECT_FORM_PROPS}
|
|
265
267
|
>
|
|
266
268
|
{/* Hidden inputs for fields that are required by `ContactSchema`
|
|
267
269
|
but suppressed from the visible UI via `hideFields`. Without
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { PolicyLink } from '../../ui/policy-link';
|
|
4
|
+
|
|
3
5
|
export interface TermsAgreementLabelProps {
|
|
4
6
|
termsUrl?: string;
|
|
5
7
|
privacyPolicyUrl?: string;
|
|
@@ -10,25 +12,13 @@ export function TermsAgreementLabel({ termsUrl = '#', privacyPolicyUrl = '#' }:
|
|
|
10
12
|
return (
|
|
11
13
|
<span className="text-ods-text-primary text-h4">
|
|
12
14
|
{'Agree to '}
|
|
13
|
-
<
|
|
14
|
-
href={termsUrl}
|
|
15
|
-
target="_blank"
|
|
16
|
-
rel="noopener noreferrer"
|
|
17
|
-
className="text-ods-text-secondary underline"
|
|
18
|
-
onClick={event => event.stopPropagation()}
|
|
19
|
-
>
|
|
15
|
+
<PolicyLink href={termsUrl} tone="secondary">
|
|
20
16
|
Terms
|
|
21
|
-
</
|
|
17
|
+
</PolicyLink>
|
|
22
18
|
{' & '}
|
|
23
|
-
<
|
|
24
|
-
href={privacyPolicyUrl}
|
|
25
|
-
target="_blank"
|
|
26
|
-
rel="noopener noreferrer"
|
|
27
|
-
className="text-ods-text-secondary underline"
|
|
28
|
-
onClick={event => event.stopPropagation()}
|
|
29
|
-
>
|
|
19
|
+
<PolicyLink href={privacyPolicyUrl} tone="secondary">
|
|
30
20
|
Privacy Policy
|
|
31
|
-
</
|
|
21
|
+
</PolicyLink>
|
|
32
22
|
{' by signing up.'}
|
|
33
23
|
</span>
|
|
34
24
|
);
|
|
@@ -36,8 +36,8 @@ const SIZES: Record<VideoCenterBadgeSize, number> = {
|
|
|
36
36
|
lg: 64, // hero facades
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
/** Soft legibility shadow — NOT a background (per design: bare glyphs). */
|
|
40
|
-
const GLYPH_SHADOW = '
|
|
39
|
+
/** Soft legibility shadow — NOT a background (per design: bare glyphs). ODS effects own the value. */
|
|
40
|
+
const GLYPH_SHADOW = 'var(--ods-shadow-glyph)';
|
|
41
41
|
|
|
42
42
|
export interface VideoPlayBadgeProps {
|
|
43
43
|
size?: VideoCenterBadgeSize;
|
|
@@ -15,10 +15,12 @@ import {
|
|
|
15
15
|
type BuiltInBookingField,
|
|
16
16
|
type MeetingAvailability,
|
|
17
17
|
type SupportedFormFieldType,
|
|
18
|
+
type MeetingFormField,
|
|
18
19
|
type SupportedMeetingFormField,
|
|
19
20
|
type BookingFormValues,
|
|
20
21
|
} from '../../schemas/meeting-booking-schema';
|
|
21
22
|
import { cn } from '../../utils/cn';
|
|
23
|
+
import { HUBSPOT_DO_NOT_COLLECT_FORM_PROPS } from '../../utils/hubspot-collected-forms';
|
|
22
24
|
import {
|
|
23
25
|
Button,
|
|
24
26
|
FieldWrapper,
|
|
@@ -97,7 +99,9 @@ const SPAN_CLASS = {
|
|
|
97
99
|
4: 'md:col-span-4',
|
|
98
100
|
} as const;
|
|
99
101
|
|
|
100
|
-
/** One field's skeleton: label + control footprint
|
|
102
|
+
/** One field's skeleton: label + control footprint — the CSS twin of `FieldWrapper`'s
|
|
103
|
+
* label row over `Input`'s `h-11 md:h-12` (the other skeleton heights below are
|
|
104
|
+
* the same kind of twin: the textarea, the consent row, the `Button`). */
|
|
101
105
|
const FIELD_SKELETON_CLASS = 'h-[4.75rem] w-full';
|
|
102
106
|
|
|
103
107
|
/** The submit copy every standalone `BookingForm` gets; the slot-first preset reads the same constant. */
|
|
@@ -131,7 +135,8 @@ const slotColumnClass = (row: BookingFieldRow, slot: BookingFieldSlot, index: nu
|
|
|
131
135
|
/** What one control needs: the field, its DOM id, where it registers in the
|
|
132
136
|
* form, and the form's own register/control. */
|
|
133
137
|
interface ControlArgs {
|
|
134
|
-
|
|
138
|
+
/** A declared question, or a built-in carrying its control hints (everything on the declaration that is not wire data). */
|
|
139
|
+
field: SupportedMeetingFormField & Partial<Omit<BuiltInBookingField, keyof MeetingFormField | 'requiredMessage'>>;
|
|
135
140
|
id: string;
|
|
136
141
|
/** Top-level for the built-ins (`email`), `formFields.<name>` for declared questions. */
|
|
137
142
|
registerName: string;
|
|
@@ -512,8 +517,9 @@ export function BookingForm({
|
|
|
512
517
|
</Button>
|
|
513
518
|
);
|
|
514
519
|
|
|
520
|
+
// Opted out of HubSpot's collected-forms script — see HUBSPOT_DO_NOT_COLLECT_FORM_PROPS.
|
|
515
521
|
return (
|
|
516
|
-
<form onSubmit={submit} className={FORM_STACK} noValidate>
|
|
522
|
+
<form onSubmit={submit} className={FORM_STACK} noValidate {...HUBSPOT_DO_NOT_COLLECT_FORM_PROPS}>
|
|
517
523
|
<HoneypotField {...honeypotInputProps} />
|
|
518
524
|
|
|
519
525
|
{/* Email first, name pair below — the order the desktop and mobile mocks
|
|
@@ -652,10 +658,23 @@ export function BookingForm({
|
|
|
652
658
|
*
|
|
653
659
|
* The slot-first skeleton (`SlotPickerSkeleton`) would put a grey calendar
|
|
654
660
|
* where the form belongs — above the fold on a page whose entire content is
|
|
655
|
-
* this card. Same footprint discipline as its sibling: fixed heights, no
|
|
656
|
-
* when the real form swaps in.
|
|
661
|
+
* this card. Same footprint discipline as its sibling: fixed heights, and no
|
|
662
|
+
* shift when the real form swaps in for single-line fields. Two footprints it
|
|
663
|
+
* cannot know: a textarea row is taller than its placeholder (the rows carry no
|
|
664
|
+
* type), and a HubSpot `legalConsent` block only exists once availability lands.
|
|
657
665
|
*/
|
|
658
|
-
export function BookingFormSkeleton({
|
|
666
|
+
export function BookingFormSkeleton({
|
|
667
|
+
fieldRows,
|
|
668
|
+
consent,
|
|
669
|
+
footerNote,
|
|
670
|
+
}: {
|
|
671
|
+
fieldRows?: BookingFieldRow[];
|
|
672
|
+
/** Whether the host adds its consent row (drawn only then). A HubSpot
|
|
673
|
+
* `legalConsent` block is unknown until availability lands — the one
|
|
674
|
+
* footprint this skeleton cannot budget for. */
|
|
675
|
+
consent?: boolean;
|
|
676
|
+
footerNote?: string;
|
|
677
|
+
}) {
|
|
659
678
|
return (
|
|
660
679
|
<div className={cn('flex-1', FORM_STACK)}>
|
|
661
680
|
{/* The host's rows (or the built-in layout) through the SAME grid, column
|
|
@@ -669,7 +688,7 @@ export function BookingFormSkeleton({ fieldRows, footerNote }: { fieldRows?: Boo
|
|
|
669
688
|
))}
|
|
670
689
|
{/* Without rows there is no telling how many questions the link declares: one long answer stands for them. */}
|
|
671
690
|
{!fieldRows && <Skeleton className="h-[7.75rem] w-full" />}
|
|
672
|
-
<Skeleton className="h-[4.25rem] w-full" />
|
|
691
|
+
{consent && <Skeleton className="h-[4.25rem] w-full" />}
|
|
673
692
|
{footerNote ? (
|
|
674
693
|
<div className={FOOTER_ROW_CLASS}>
|
|
675
694
|
<Skeleton className="h-5 min-w-40 flex-1" />
|
|
@@ -700,12 +719,17 @@ export function BookingFormSkeleton({ fieldRows, footerNote }: { fieldRows?: Boo
|
|
|
700
719
|
*/
|
|
701
720
|
function normalizeFieldRows(fieldRows: BookingFieldRow[], resolves: (name: string) => boolean = () => true) {
|
|
702
721
|
const seen = new Set<string>();
|
|
703
|
-
const rows =
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
722
|
+
const rows: BookingFieldRow[] = [];
|
|
723
|
+
for (const row of fieldRows) {
|
|
724
|
+
const kept: BookingFieldSlot[] = [];
|
|
725
|
+
for (const slot of row) {
|
|
726
|
+
if (!resolves(slot.name) || seen.has(slot.name)) continue;
|
|
727
|
+
seen.add(slot.name);
|
|
728
|
+
kept.push(slot);
|
|
729
|
+
}
|
|
730
|
+
if (kept.length === 0) continue;
|
|
731
|
+
rows.push(kept.length === row.length ? kept : kept.map((slot): BookingFieldSlot => ({ name: slot.name })));
|
|
732
|
+
}
|
|
709
733
|
const named = new Set(fieldRows.flat().map(slot => slot.name));
|
|
710
734
|
const unplacedBuiltIns = BUILT_IN_BOOKING_FIELDS.filter(f => !named.has(f.name));
|
|
711
735
|
return { rows, unplacedBuiltIns, named };
|
|
@@ -43,7 +43,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
43
43
|
import type { ComponentType, ReactNode } from 'react';
|
|
44
44
|
import { useIsHydrated } from '../../hooks/ui/use-is-hydrated';
|
|
45
45
|
import { useHumanitySignals } from '../../hooks/use-humanity-signals';
|
|
46
|
-
import { useMeetingBooking } from '../../hooks/use-meeting-booking';
|
|
46
|
+
import { BOOKING_IN_FLIGHT_MESSAGE, useMeetingBooking } from '../../hooks/use-meeting-booking';
|
|
47
47
|
import { useToast } from '../../hooks/use-toast';
|
|
48
48
|
import {
|
|
49
49
|
isSupportedFormField,
|
|
@@ -251,9 +251,20 @@ export const MEETING_SCHEDULER_H = 'md:h-[34.375rem] lg:h-[23.75rem]';
|
|
|
251
251
|
* tablet and desktop, and the calendar stage fits the same box at both — the
|
|
252
252
|
* times column scrolls inside it as it always has.
|
|
253
253
|
*
|
|
254
|
+
* PHONES get a stated height too — the one place this flow departs from
|
|
255
|
+
* slot-first's "the page is the scroller". Slot-first's two stages are the
|
|
256
|
+
* same shape on a phone (calendar + a capped times list either way), so it
|
|
257
|
+
* needs none. Details-first's are not: the form stage, the calendar stage and
|
|
258
|
+
* the two-line confirmation each have their own natural height, and a paid
|
|
259
|
+
* landing page that grows and shrinks by tens of pixels on every step reads as
|
|
260
|
+
* broken. 812px is the calendar stage's natural height at 375px (header strip
|
|
261
|
+
* + six fixed weeks + the 9.75rem chip cap), so that stage fits exactly and the
|
|
262
|
+
* form stage — shorter on the shipped links — sits in it; a link declaring more
|
|
263
|
+
* questions scrolls the form inside the card, as it already does from `md`.
|
|
264
|
+
*
|
|
254
265
|
* Hosts read it through `SCHEDULER_FLOW_PRESETS[flow].height`, never directly.
|
|
255
266
|
*/
|
|
256
|
-
export const MEETING_SCHEDULER_DETAILS_FIRST_H = 'md:h-[39.875rem]';
|
|
267
|
+
export const MEETING_SCHEDULER_DETAILS_FIRST_H = 'h-[50.75rem] md:h-[39.875rem]';
|
|
257
268
|
|
|
258
269
|
export type SchedulerFlow = 'slot-first' | 'details-first';
|
|
259
270
|
|
|
@@ -562,14 +573,14 @@ export function HubSpotMeetingScheduler({
|
|
|
562
573
|
const backToDetails = useCallback(() => {
|
|
563
574
|
// Not while a slot's POST is in flight — the step must stay on the
|
|
564
575
|
// calendar the spinner lives on until the result routes it.
|
|
565
|
-
if (
|
|
576
|
+
if (postInFlight()) return;
|
|
566
577
|
// No slot rides back to the form: in this flow the form never legitimately
|
|
567
578
|
// holds one (the slot IS the submit), and a chip the server rejected with a
|
|
568
579
|
// slot-step toast would otherwise print in the form's summary line.
|
|
569
580
|
setSelectedSlot(null);
|
|
570
581
|
setStep('details');
|
|
571
582
|
setBookingError(null);
|
|
572
|
-
}, []);
|
|
583
|
+
}, [postInFlight]);
|
|
573
584
|
|
|
574
585
|
/**
|
|
575
586
|
* details-first: Continue does not POST. It validates, freezes the answers
|
|
@@ -599,7 +610,7 @@ export function HubSpotMeetingScheduler({
|
|
|
599
610
|
const handleSubmit = useCallback(
|
|
600
611
|
async (payload: Record<string, unknown>) => {
|
|
601
612
|
// Captured BEFORE the clear below: `book()` reports a re-entrant call as
|
|
602
|
-
// a VALIDATION code carrying
|
|
613
|
+
// a VALIDATION code carrying `BOOKING_IN_FLIGHT_MESSAGE`, and by
|
|
603
614
|
// then this clear has already run — so a double-click would wipe a
|
|
604
615
|
// visible SLOT_TAKEN alert on its way to being ignored.
|
|
605
616
|
const priorError = bookingError;
|
|
@@ -607,7 +618,7 @@ export function HubSpotMeetingScheduler({
|
|
|
607
618
|
const result = await book(payload);
|
|
608
619
|
|
|
609
620
|
// Not an error: the hook's in-flight guard. No toast, no step change.
|
|
610
|
-
if (!result.ok && result.message ===
|
|
621
|
+
if (!result.ok && result.message === BOOKING_IN_FLIGHT_MESSAGE) {
|
|
611
622
|
setBookingError(priorError);
|
|
612
623
|
return;
|
|
613
624
|
}
|
|
@@ -631,12 +642,14 @@ export function HubSpotMeetingScheduler({
|
|
|
631
642
|
if (!detailsFirst) resetSignals();
|
|
632
643
|
void refetchAvailability();
|
|
633
644
|
} else {
|
|
645
|
+
// details-first: the chip that submitted is un-picked on EVERY failure —
|
|
646
|
+
// selection means submit in this flow, so a rejected chip must not sit
|
|
647
|
+
// in the selected variant (and the form's summary must never show a
|
|
648
|
+
// slot the server did not accept).
|
|
649
|
+
if (detailsFirst) setSelectedSlot(null);
|
|
634
650
|
if (detailsFirst && (code === 'VALIDATION' || code === 'INVALID_EMAIL')) {
|
|
635
|
-
// DETAILS errors
|
|
636
|
-
//
|
|
637
|
-
// The chip that submitted is un-picked too — the form's summary
|
|
638
|
-
// must not show a slot the server never accepted.
|
|
639
|
-
setSelectedSlot(null);
|
|
651
|
+
// DETAILS errors: the form is unmounted by now, so send the visitor
|
|
652
|
+
// back to it (the stash repopulates every answer).
|
|
640
653
|
setStep('details');
|
|
641
654
|
}
|
|
642
655
|
// The error surface is the TOAST, full stop (host-mounted Toaster —
|
|
@@ -660,6 +673,11 @@ export function HubSpotMeetingScheduler({
|
|
|
660
673
|
|
|
661
674
|
// ---- terminal / degraded states -----------------------------------------
|
|
662
675
|
|
|
676
|
+
/** The card's ONE back edge, per flow and step — the skeleton and the loaded
|
|
677
|
+
* panel wire the same one, so a month load can never swap it for the host's
|
|
678
|
+
* exit under a details-first visitor. */
|
|
679
|
+
const backEdge = detailsFirst ? (step === 'slot' ? backToDetails : onBack) : step === 'details' ? backToSlot : onBack;
|
|
680
|
+
|
|
663
681
|
/**
|
|
664
682
|
* The card states ONE height and everything inside derives from it (see
|
|
665
683
|
* `MEETING_SCHEDULER_H`). details-first's tallest stage is the form, so it
|
|
@@ -670,12 +688,12 @@ export function HubSpotMeetingScheduler({
|
|
|
670
688
|
* last-wins, so appending it after would make a host's own `h-*` unreachable,
|
|
671
689
|
* which is the override the height-inside-CARD_CLASS arrangement allows today.
|
|
672
690
|
*/
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
*
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
const
|
|
691
|
+
const cardClass = cn(CARD_CLASS, preset.height, detailsFirst && 'flex flex-col', formOnly && 'bg-ods-bg', className);
|
|
692
|
+
/** details-first states a height on phones too (see MEETING_SCHEDULER_DETAILS_FIRST_H), so
|
|
693
|
+
* the wrappers that let content shrink into a stated height run at every width here. */
|
|
694
|
+
const innerClass = cn(CARD_INNER_CLASS, detailsFirst && 'min-h-0 flex-1');
|
|
695
|
+
const actionPanelClass = cn(ACTION_PANEL_CLASS, detailsFirst && 'min-h-0 overflow-y-auto');
|
|
696
|
+
const stepPanelClass = cn(STEP_PANEL_CLASS, detailsFirst && 'min-h-0 overflow-y-auto');
|
|
679
697
|
|
|
680
698
|
/** One card SHAPE for every degraded return below. */
|
|
681
699
|
const degraded = (message: string) => (
|
|
@@ -690,18 +708,22 @@ export function HubSpotMeetingScheduler({
|
|
|
690
708
|
// shifts when it swaps.
|
|
691
709
|
return (
|
|
692
710
|
<div className={cardClass}>
|
|
693
|
-
<div className={
|
|
711
|
+
<div className={innerClass}>
|
|
694
712
|
{!formOnly && <ContextPanelSkeleton onBack={backEdge} className={CONTEXT_PANEL_CLASS} />}
|
|
695
|
-
<div className={
|
|
713
|
+
<div className={actionPanelClass}>
|
|
696
714
|
{/* Both terms matter. Without `flow` this stays a calendar where
|
|
697
715
|
the form belongs; without the step term, paging a month AFTER
|
|
698
716
|
Continue (which happens at `step === 'slot'`) would swap the
|
|
699
717
|
calendar out for a form skeleton and back. */}
|
|
700
|
-
{
|
|
718
|
+
{formOnly ? (
|
|
701
719
|
// The SAME wrapper the loaded form gets, so the skeleton never
|
|
702
720
|
// states its own inset.
|
|
703
|
-
<div className={
|
|
704
|
-
<BookingFormSkeleton
|
|
721
|
+
<div className={stepPanelClass}>
|
|
722
|
+
<BookingFormSkeleton
|
|
723
|
+
fieldRows={detailsFormProps?.fieldRows}
|
|
724
|
+
consent={Boolean(detailsFormProps?.consent)}
|
|
725
|
+
footerNote={preset.footerNote}
|
|
726
|
+
/>
|
|
705
727
|
</div>
|
|
706
728
|
) : (
|
|
707
729
|
<SlotPickerSkeleton monthOffset={monthOffset} />
|
|
@@ -724,7 +746,7 @@ export function HubSpotMeetingScheduler({
|
|
|
724
746
|
|
|
725
747
|
return (
|
|
726
748
|
<div className={cardClass}>
|
|
727
|
-
<div className={
|
|
749
|
+
<div className={innerClass}>
|
|
728
750
|
{!formOnly && (
|
|
729
751
|
<SchedulerContextPanel
|
|
730
752
|
hosts={shownHosts}
|
|
@@ -771,21 +793,21 @@ export function HubSpotMeetingScheduler({
|
|
|
771
793
|
{/* Scrolls INSIDE the fixed card rather than growing it — see
|
|
772
794
|
MEETING_SCHEDULER_H. `min-h-0` is what lets it: a flex item's
|
|
773
795
|
default `min-height:auto` refuses to shrink below its content. */}
|
|
774
|
-
<div className={
|
|
796
|
+
<div className={actionPanelClass}>
|
|
775
797
|
{step === 'confirmed' && confirmation && timezone ? (
|
|
776
|
-
<div className={
|
|
798
|
+
<div className={stepPanelClass}>
|
|
777
799
|
<Confirmation confirmation={confirmation} timezone={timezone} />
|
|
778
800
|
</div>
|
|
779
801
|
) : step === 'details' &&
|
|
780
802
|
(detailsFirst
|
|
781
803
|
? // The form is step ONE here: no slot yet, and `timezone` is null
|
|
782
804
|
// on the server render, so neither may gate the PANEL. A link
|
|
783
|
-
// publishing no durations has no form worth showing
|
|
784
|
-
//
|
|
785
|
-
// the
|
|
786
|
-
durations.length > 0
|
|
805
|
+
// publishing no durations has no form worth showing; it gets the
|
|
806
|
+
// "nothing published" message below at every moment, refetch or
|
|
807
|
+
// not — never a calendar skeleton in the form-only layout.
|
|
808
|
+
durations.length > 0
|
|
787
809
|
: durationMs != null && selectedSlot != null && timezone) ? (
|
|
788
|
-
<div className={cn(
|
|
810
|
+
<div className={cn(stepPanelClass, 'gap-[var(--spacing-system-m)]')}>
|
|
789
811
|
{/* Top-aligned, and no back edge of its own: the ONE back edge
|
|
790
812
|
lives in the context panel at every step (the `onBack` wired on `SchedulerContextPanel`),
|
|
791
813
|
which is where the design puts it and the only spot that
|
|
@@ -900,10 +922,12 @@ export function HubSpotMeetingScheduler({
|
|
|
900
922
|
// clicked chip spinning.
|
|
901
923
|
isSubmitting={detailsFirst ? isSubmitting : undefined}
|
|
902
924
|
/>
|
|
903
|
-
) : durations.length === 0 && !isFetchingAvailability ? (
|
|
925
|
+
) : durations.length === 0 && (!isFetchingAvailability || formOnly) ? (
|
|
904
926
|
// The LINK publishes nothing at all — a different thing from a
|
|
905
927
|
// fully-booked month, and the only case the escape hatch is
|
|
906
|
-
// the right answer to.
|
|
928
|
+
// the right answer to. In the form-only layout it holds through
|
|
929
|
+
// a refetch too: the alternative frame is a calendar skeleton
|
|
930
|
+
// where a form belongs.
|
|
907
931
|
<div className="flex flex-col items-start gap-[var(--spacing-system-m)]">
|
|
908
932
|
<p className="text-ods-text-secondary text-h6">No call times are published right now.</p>
|
|
909
933
|
{escapeHatch}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
|
+
import { HUBSPOT_DO_NOT_COLLECT_FORM_PROPS } from '../../utils/hubspot-collected-forms';
|
|
5
6
|
import { SearchIcon } from '../icons-v2-generated';
|
|
6
7
|
|
|
7
8
|
export interface HeaderGlobalSearchProps {
|
|
@@ -51,6 +52,7 @@ export function HeaderGlobalSearch({
|
|
|
51
52
|
return (
|
|
52
53
|
<form
|
|
53
54
|
onSubmit={handleSubmit}
|
|
55
|
+
{...HUBSPOT_DO_NOT_COLLECT_FORM_PROPS}
|
|
54
56
|
className={cn(
|
|
55
57
|
'flex h-full flex-1 items-center gap-2 px-3',
|
|
56
58
|
// Transparent so the cell inherits the bar's background
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { useState } from 'react';
|
|
20
20
|
import type { FormEvent } from 'react';
|
|
21
|
+
import { HUBSPOT_DO_NOT_COLLECT_FORM_PROPS } from '../../utils/hubspot-collected-forms';
|
|
21
22
|
import { ChatAttachmentAddButton, ChatAttachmentChipStrip } from '../chat/chat-attachment-bar';
|
|
22
23
|
import { useChatAttachments } from '../chat/hooks/use-chat-attachments';
|
|
23
24
|
import type { ChatAttachment } from '../chat/utils/chat-attachment-markdown';
|
|
@@ -76,7 +77,7 @@ export function TicketOpenForm({ onSubmit, isSubmitting, supportSystemDown }: Ti
|
|
|
76
77
|
|
|
77
78
|
return (
|
|
78
79
|
<Card className="p-6">
|
|
79
|
-
<form onSubmit={handleSubmit} className="flex flex-col gap-6 md:flex-row">
|
|
80
|
+
<form onSubmit={handleSubmit} className="flex flex-col gap-6 md:flex-row" {...HUBSPOT_DO_NOT_COLLECT_FORM_PROPS}>
|
|
80
81
|
<div className="min-w-0 flex-1 md:max-w-md">
|
|
81
82
|
<h2 className="mb-2 text-ods-text-primary text-h2">Need Support?</h2>
|
|
82
83
|
<p className="text-ods-text-secondary text-h6">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useId, type ReactNode } from 'react';
|
|
4
|
+
import { HUBSPOT_DO_NOT_COLLECT_FORM_PROPS } from '../../utils/hubspot-collected-forms';
|
|
4
5
|
import { Button } from './button';
|
|
5
6
|
import { UnsavedChangesChip, useGuardedClose } from './modal-guarded-close';
|
|
6
7
|
import {
|
|
@@ -146,6 +147,7 @@ export function AdminFormModal({
|
|
|
146
147
|
admin modal routed through this shell. */}
|
|
147
148
|
<form
|
|
148
149
|
id={formId}
|
|
150
|
+
{...HUBSPOT_DO_NOT_COLLECT_FORM_PROPS}
|
|
149
151
|
// Inherit the ModalV2 flex chain — an unstyled form between the shell
|
|
150
152
|
// and ModalV2Content made flex-1/min-h-0 inert, so tall modals pushed
|
|
151
153
|
// the Cancel/Save footer past 90vh.
|
|
@@ -67,7 +67,11 @@ interface BenefitCardGridProps {
|
|
|
67
67
|
* card's row differs per breakpoint) is what needs testing, and the grid itself
|
|
68
68
|
* is a `cloneElement` over children.
|
|
69
69
|
*/
|
|
70
|
-
export function benefitCardBorderClass(
|
|
70
|
+
export function benefitCardBorderClass(
|
|
71
|
+
index: number,
|
|
72
|
+
totalItems: number,
|
|
73
|
+
columns: NonNullable<BenefitCardGridProps['columns']>,
|
|
74
|
+
): string {
|
|
71
75
|
const isLastItem = index === totalItems - 1;
|
|
72
76
|
if (columns === 4) {
|
|
73
77
|
// 4-column grid borders
|
|
@@ -4,6 +4,7 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
4
4
|
import { type ComponentRef, type ReactNode, forwardRef } from 'react';
|
|
5
5
|
import { cn } from '../../utils/cn';
|
|
6
6
|
import { CheckboxCheckmarkIcon } from '../icons-v2-generated/signs-and-symbols/checkbox-checkmark-icon';
|
|
7
|
+
import { RequiredMark } from './required-mark';
|
|
7
8
|
|
|
8
9
|
interface CheckboxBlockProps {
|
|
9
10
|
id?: string;
|
|
@@ -23,7 +24,8 @@ interface CheckboxBlockProps {
|
|
|
23
24
|
*/
|
|
24
25
|
trailing?: ReactNode;
|
|
25
26
|
disabled?: boolean;
|
|
26
|
-
/** Marks the box `aria-required`
|
|
27
|
+
/** Marks the box `aria-required` AND draws the `RequiredMark` after the label — the
|
|
28
|
+
* same pairing every required field carries, so neither signal stands alone. */
|
|
27
29
|
required?: boolean;
|
|
28
30
|
/** Error message displayed below the block (also triggers red border) */
|
|
29
31
|
error?: string;
|
|
@@ -121,6 +123,7 @@ const CheckboxBlock = forwardRef<ComponentRef<typeof CheckboxPrimitive.Root>, Ch
|
|
|
121
123
|
)}
|
|
122
124
|
>
|
|
123
125
|
{label}
|
|
126
|
+
{required && <RequiredMark />}
|
|
124
127
|
</span>
|
|
125
128
|
{description && (
|
|
126
129
|
<span className={cn('!leading-4 text-h6', 'select-none break-words text-ods-text-secondary')}>
|
|
@@ -3,8 +3,9 @@ import { cn } from '../../utils/cn';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The inset icon tile — the bordered `ods-bg` square (or panel) an icon sits
|
|
6
|
-
* in. The
|
|
7
|
-
*
|
|
6
|
+
* in. The one home for the chrome going forward (older inline tiles migrate as
|
|
7
|
+
* they are touched); the size is the caller's (`size-16` in a card row,
|
|
8
|
+
* `h-40 w-full` as a step panel).
|
|
8
9
|
*/
|
|
9
10
|
export function IconTile({ className, children }: { className?: string; children: ReactNode }) {
|
|
10
11
|
return (
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import type { ReactNode } from 'react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
|
|
6
|
+
const TONE_CLASS = {
|
|
7
|
+
/** Consent rows: the accent, as every form's policy links draw it. */
|
|
8
|
+
accent: 'text-ods-accent underline underline-offset-2 hover:text-ods-accent/80',
|
|
9
|
+
/** Quiet copy (the sign-up agreement line): secondary text, plain underline. */
|
|
10
|
+
secondary: 'text-ods-text-secondary underline',
|
|
11
|
+
} as const;
|
|
2
12
|
|
|
3
13
|
/**
|
|
4
14
|
* A link to a policy page inside consent copy (Terms, Privacy) — opens in a
|
|
5
15
|
* new tab and does NOT toggle the checkbox whose label it sits in.
|
|
6
16
|
*/
|
|
7
|
-
export function PolicyLink({
|
|
17
|
+
export function PolicyLink({
|
|
18
|
+
href,
|
|
19
|
+
tone = 'accent',
|
|
20
|
+
children,
|
|
21
|
+
}: {
|
|
22
|
+
href: string;
|
|
23
|
+
tone?: keyof typeof TONE_CLASS;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}) {
|
|
8
26
|
return (
|
|
9
27
|
<a
|
|
10
28
|
href={href}
|
|
11
|
-
className=
|
|
29
|
+
className={cn(TONE_CLASS[tone])}
|
|
12
30
|
target="_blank"
|
|
13
31
|
rel="noopener noreferrer"
|
|
14
32
|
onClick={e => e.stopPropagation()}
|
|
@@ -64,6 +64,9 @@ export function meetingAvailabilityKey(apiBaseUrl: string, meetingId: string, mo
|
|
|
64
64
|
return ['meeting-availability', apiBaseUrl, meetingId, monthOffset] as const;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** The message `book()` returns for a re-entrant call — a sentinel, not an error; the scheduler matches on it. */
|
|
68
|
+
export const BOOKING_IN_FLIGHT_MESSAGE = 'Already submitting';
|
|
69
|
+
|
|
67
70
|
export function useMeetingBooking(options: {
|
|
68
71
|
meetingId: string;
|
|
69
72
|
apiBaseUrl?: string;
|
|
@@ -155,7 +158,7 @@ export function useMeetingBooking(options: {
|
|
|
155
158
|
const { mutateAsync } = bookMutation;
|
|
156
159
|
const book = useCallback(
|
|
157
160
|
async (payload: Record<string, unknown>): Promise<BookingResult> => {
|
|
158
|
-
if (submittingRef.current !== null) return { ok: false, code: 'VALIDATION', message:
|
|
161
|
+
if (submittingRef.current !== null) return { ok: false, code: 'VALIDATION', message: BOOKING_IN_FLIGHT_MESSAGE };
|
|
159
162
|
const submitToken: object = {};
|
|
160
163
|
submittingRef.current = submitToken;
|
|
161
164
|
try {
|
|
@@ -236,6 +236,11 @@ export const FORM_FIELD_TYPES_WITH_OPTIONS: readonly SupportedFormFieldType[] =
|
|
|
236
236
|
type => FORM_FIELD_TYPES[type].hasOptions,
|
|
237
237
|
);
|
|
238
238
|
|
|
239
|
+
/** Whether a raw HubSpot field type is one whose answers come from declared options. */
|
|
240
|
+
export function formFieldTypeHasOptions(type: string): boolean {
|
|
241
|
+
return (FORM_FIELD_TYPES_WITH_OPTIONS as readonly string[]).includes(type);
|
|
242
|
+
}
|
|
243
|
+
|
|
239
244
|
export function isSupportedFormField(field: MeetingFormField): field is SupportedMeetingFormField {
|
|
240
245
|
return Object.prototype.hasOwnProperty.call(FORM_FIELD_TYPES, field.type);
|
|
241
246
|
}
|
|
@@ -196,7 +196,7 @@ mux-player::part(button):hover {
|
|
|
196
196
|
}
|
|
197
197
|
mux-player::part(center play button) {
|
|
198
198
|
background: transparent;
|
|
199
|
-
filter:
|
|
199
|
+
filter: var(--ods-shadow-glyph);
|
|
200
200
|
}
|
|
201
201
|
mux-player::part(center play button):hover {
|
|
202
202
|
background: transparent;
|
package/src/styles/index.css
CHANGED