Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const PricingCardsBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const PricingCardsCtaBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const PricingCardsMutedBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const PricingEnterpriseBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down
16 changes: 16 additions & 0 deletions payload-components/source/blocks/PricingEnterprise/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ export const PricingEnterprise: Block = {
{
name: 'href',
type: 'text',
// Logos link out to arbitrary customer sites, so this can't reuse the
// embed/form allowlists in shared/safeUrls — but still reject anything
// that isn't an absolute http(s) URL (e.g. a `javascript:` payload).
validate: (value: unknown) => {
if (value === null || value === undefined || value === '') return true

try {
const { protocol } = new URL(String(value))

return protocol === 'https:' || protocol === 'http:'
? true
: 'Use an absolute http(s) URL.'
} catch {
return 'Use an absolute http(s) URL.'
}
},
},
],
},
Expand Down
10 changes: 6 additions & 4 deletions payload-components/source/blocks/PricingSplit/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export const PricingSplitBlock: React.FC<Props> = ({
plans,
title,
}) => {
const entry = plans?.[0]
const highlight = plans?.[1]
// The featured plan takes the expanded right panel; the other becomes the
// entry plan on the left. Falls back to source order when none is marked.
const highlight = plans?.find((plan) => plan.featured) ?? plans?.[1]
const entry = plans?.find((plan) => plan !== highlight) ?? plans?.[0]

return (
<section className={cn('container', className)} id={id ? `block-${id}` : undefined}>
Expand Down Expand Up @@ -81,7 +83,7 @@ export const PricingSplitBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down Expand Up @@ -130,7 +132,7 @@ export const PricingSplitBlock: React.FC<Props> = ({
key={item.id ?? `${item.feature}-${featureIndex}`}
className="flex items-center gap-2"
>
<Check className="size-3" />
<Check aria-hidden="true" className="size-3" />
{item.feature}
</li>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/components/site/demos/PricingSplitDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function PricingSplitDemo({
content?: PricingDemoContent
}) {
const { description, eyebrow, plans, title } = content
const entry = plans[0]
const highlight = plans[1]
const highlight = plans.find((plan) => plan.featured) ?? plans[1]
const entry = plans.find((plan) => plan !== highlight) ?? plans[0]

return (
<div aria-hidden="true" className={className}>
Expand Down