@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.634",
3
+ "version": "0.0.635-2194.6264.1",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -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
- {/* The host's rows (or the built-in layout) through the SAME grid, column
681
- rule and normalisation as the loaded form — see `normalizeFieldRows`. */}
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
  />