@flamingo-stack/openframe-frontend-core 0.0.634 → 0.0.635-2194.6264.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/components/meeting-scheduler/booking-form.d.ts +8 -1
- package/dist/components/meeting-scheduler/booking-form.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +7 -3
- package/dist/components/meeting-scheduler/index.cjs.map +1 -1
- package/dist/components/meeting-scheduler/index.d.ts +7 -1
- package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.js +7 -3
- package/dist/components/meeting-scheduler/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/meeting-scheduler/booking-form.tsx +17 -4
- package/src/components/meeting-scheduler/index.tsx +8 -0
package/package.json
CHANGED
|
@@ -665,21 +665,34 @@ export function BookingForm({
|
|
|
665
665
|
*/
|
|
666
666
|
export function BookingFormSkeleton({
|
|
667
667
|
fieldRows,
|
|
668
|
+
rowCount,
|
|
668
669
|
consent,
|
|
669
670
|
footerNote,
|
|
670
671
|
}: {
|
|
671
672
|
fieldRows?: BookingFieldRow[];
|
|
673
|
+
/**
|
|
674
|
+
* How many field rows to draw, each full width — a host that knows roughly
|
|
675
|
+
* how tall its link's form is (it cannot know the questions before
|
|
676
|
+
* availability lands) sets it instead of relying on `fieldRows` or the
|
|
677
|
+
* built-in rows plus one block for the questions. Wins over `fieldRows`.
|
|
678
|
+
*/
|
|
679
|
+
rowCount?: number;
|
|
672
680
|
/** Whether the host adds its consent row (drawn only then). A HubSpot
|
|
673
681
|
* `legalConsent` block is unknown until availability lands — the one
|
|
674
682
|
* footprint this skeleton cannot budget for. */
|
|
675
683
|
consent?: boolean;
|
|
676
684
|
footerNote?: string;
|
|
677
685
|
}) {
|
|
686
|
+
// `rowCount` rows are one full-width slot each; host rows (or the built-in
|
|
687
|
+
// layout) go through the loaded form's normalisation (`normalizeFieldRows`).
|
|
688
|
+
const rows =
|
|
689
|
+
rowCount !== undefined
|
|
690
|
+
? Array.from({ length: rowCount }, (_, index): BookingFieldRow => [{ name: `skeleton-row-${index}` }])
|
|
691
|
+
: skeletonRows(fieldRows ?? DEFAULT_FIELD_ROWS);
|
|
678
692
|
return (
|
|
679
693
|
<div className={cn('flex-1', FORM_STACK)}>
|
|
680
|
-
{/*
|
|
681
|
-
|
|
682
|
-
{skeletonRows(fieldRows ?? DEFAULT_FIELD_ROWS).map(row => (
|
|
694
|
+
{/* Every row through the SAME grid and column rule as the loaded form. */}
|
|
695
|
+
{rows.map(row => (
|
|
683
696
|
<div key={row.map(s => s.name).join('|')} className={ROW_GRID}>
|
|
684
697
|
{row.map((slot, slotIndex) => (
|
|
685
698
|
<Skeleton key={slot.name} className={cn(FIELD_SKELETON_CLASS, slotColumnClass(row, slot, slotIndex))} />
|
|
@@ -687,7 +700,7 @@ export function BookingFormSkeleton({
|
|
|
687
700
|
</div>
|
|
688
701
|
))}
|
|
689
702
|
{/* Without rows there is no telling how many questions the link declares: one long answer stands for them. */}
|
|
690
|
-
{!fieldRows && <Skeleton className="h-[7.75rem] w-full" />}
|
|
703
|
+
{rowCount === undefined && !fieldRows && <Skeleton className="h-[7.75rem] w-full" />}
|
|
691
704
|
{consent && <Skeleton className="h-[4.25rem] w-full" />}
|
|
692
705
|
{footerNote ? (
|
|
693
706
|
<div className={FOOTER_ROW_CLASS}>
|
|
@@ -143,6 +143,12 @@ export interface HubSpotMeetingSchedulerProps {
|
|
|
143
143
|
* can pass it across the RSC boundary where a component cannot.
|
|
144
144
|
*/
|
|
145
145
|
detailsFormProps?: Pick<BookingFormProps, 'fieldRows' | 'consent'>;
|
|
146
|
+
/**
|
|
147
|
+
* `flow="details-first"`: how many full-width field rows the cold-start form
|
|
148
|
+
* skeleton draws (see `BookingFormSkeleton`'s `rowCount`). Omit for the
|
|
149
|
+
* `fieldRows` / built-in footprint.
|
|
150
|
+
*/
|
|
151
|
+
skeletonRowCount?: number;
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
type Step = 'slot' | 'details' | 'confirmed';
|
|
@@ -390,6 +396,7 @@ export function HubSpotMeetingScheduler({
|
|
|
390
396
|
flow = DEFAULT_SCHEDULER_FLOW,
|
|
391
397
|
detailsForm: DetailsForm = BookingForm,
|
|
392
398
|
detailsFormProps,
|
|
399
|
+
skeletonRowCount,
|
|
393
400
|
}: HubSpotMeetingSchedulerProps) {
|
|
394
401
|
const {
|
|
395
402
|
availability,
|
|
@@ -718,6 +725,7 @@ export function HubSpotMeetingScheduler({
|
|
|
718
725
|
<div className={stepPanelClass}>
|
|
719
726
|
<BookingFormSkeleton
|
|
720
727
|
fieldRows={detailsFormProps?.fieldRows}
|
|
728
|
+
rowCount={skeletonRowCount}
|
|
721
729
|
consent={Boolean(detailsFormProps?.consent)}
|
|
722
730
|
footerNote={preset.footerNote}
|
|
723
731
|
/>
|