-
-
-
-
- {compute.identifier === 'ci_nano' && 'Up to '}
- {compute.meta?.memory_gb ?? 0} GB memory
-
+ )}
+
+
+
+
+ {lockedOption ? (
+
+
+
+ ) : (
+ showComputePrice && (
+ <>
+
+ ${price}
+
+
+ {' '}
+ /{' '}
+ {compute.price_interval === 'monthly'
+ ? 'month'
+ : 'hour'}
+
+ >
+ )
+ )}
-
-
- {cpuLabel}
+
+
+
+
+
+
+
+ {compute.identifier === 'ci_nano' && 'Up to '}
+ {compute.meta?.memory_gb ?? 0} GB memory
+
+
+
+
+ {cpuLabel}
+
+
+ {lockedMicroDueToPITR && (
+
+ Project has PITR enabled which requires a minimum of Small
+ compute. Please{' '}
+
+ disable PITR
+ {' '}
+ first before selecting Micro
+
+ )}
+
+ }
+ />
+ )
+ })}
+
+ {showAllSizes && (
+
e.preventDefault()}
+ className={cn(
+ 'relative text-sm text-left flex flex-col gap-0 px-0 py-3 [&_label]:w-full group w-full h-[110px]'
+ )}
+ label={
+
+
+
-
- {lockedMicroDueToPITR && (
-
- Project has PITR enabled which requires a minimum of Small compute.
- Please{' '}
-
- disable PITR
- {' '}
- first before selecting Micro
-
- )}
-
+
+
+
+
+ Custom memory
+
+
+
+ Custom CPU
+
+
+
+
+
}
/>
- )
- })}
-
- {showAllSizes && (
- e.preventDefault()}
- className={cn(
- 'relative text-sm text-left flex flex-col gap-0 px-0 py-3 [&_label]:w-full group w-full h-[110px]'
- )}
- label={
-
-
-
-
-
-
-
- Custom memory
-
-
-
- Custom CPU
-
-
-
-
-
- }
- />
- )}
- >
- )}
+ )}
+ >
+ )}
+
{!isLoading && !addonsError && hasHiddenOptions && (
diff --git a/packages/ui-patterns/src/form/Layout/FormLayout.tsx b/packages/ui-patterns/src/form/Layout/FormLayout.tsx
index b6db8bcaec2..863bc0dd6e3 100644
--- a/packages/ui-patterns/src/form/Layout/FormLayout.tsx
+++ b/packages/ui-patterns/src/form/Layout/FormLayout.tsx
@@ -18,6 +18,14 @@ type Props = {
isReactForm?: boolean
hideMessage?: boolean
name?: string
+ /**
+ * For layout="horizontal", switches the label/content split to react to the nearest
+ * `@container` ancestor's width instead of the viewport width. Use when the layout sits
+ * inside a narrower column (e.g. next to a sidebar) so it stacks to a single column as
+ * soon as that column gets tight, rather than waiting for a viewport breakpoint that may
+ * never reflect the column's actual available space.
+ */
+ isContainerResponsive?: boolean
}
const ContainerVariants = cva('relative grid gap-10', {
@@ -35,7 +43,7 @@ const ContainerVariants = cva('relative grid gap-10', {
false: '',
},
layout: {
- horizontal: 'flex flex-col gap-2 md:grid md:grid-cols-12',
+ horizontal: 'flex flex-col gap-2',
vertical: 'flex flex-col gap-2',
flex: 'flex flex-row gap-3',
'flex-row-reverse':
@@ -57,8 +65,20 @@ const ContainerVariants = cva('relative grid gap-10', {
align: 'right',
className: 'justify-between',
},
+ {
+ layout: 'horizontal',
+ responsive: false,
+ className: 'md:grid md:grid-cols-12',
+ },
+ {
+ layout: 'horizontal',
+ responsive: true,
+ className: '@xl:grid @xl:grid-cols-12',
+ },
],
- defaultVariants: {},
+ defaultVariants: {
+ responsive: false,
+ },
})
const LabelContainerVariants = cva('transition-all duration-500 ease-in-out', {
@@ -287,6 +307,7 @@ export const FormLayout = React.forwardRef<
hideMessage = false,
isReactForm,
error,
+ isContainerResponsive = false,
...props
},
ref
@@ -356,7 +377,10 @@ export const FormLayout = React.forwardRef<