mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## What kind of change does this PR introduce? Mechanical cleanup on top of the Button default-variant change (#50160). ## What is the current behavior? Many callsites still pass `variant="default"` even though that is now the component default. ## What is the new behavior? Removes redundant static `variant="default"` from legacy `Button` and `ButtonTooltip` callsites. Keeps explicit defaults where they document the API: - `button-default.tsx` and `button-sizes.tsx` demos - `DocsButton`, which pins neutral styling at the wrapper boundary ## To test Studio: - [Auth → Rate Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits): dirty the form so Cancel appears; Cancel stays neutral, Save stays green - [Project Settings → API Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys): `DocsButton` in the header actions stays neutral Design system: - [Design system → Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button): `button-default` / `button-sizes` still show explicit default styling; Primary (green) is restricted to the Primary section (and `asChild`) WWW: - [www → Brand assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets): Download logo kit / Download button kit stay neutral
126 lines
4.7 KiB
TypeScript
126 lines
4.7 KiB
TypeScript
import {
|
|
Button,
|
|
Checkbox,
|
|
Field,
|
|
FieldDescription,
|
|
FieldGroup,
|
|
FieldLabel,
|
|
FieldLegend,
|
|
FieldSeparator,
|
|
FieldSet,
|
|
Input,
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
Textarea,
|
|
} from 'ui'
|
|
|
|
export default function FieldDemo() {
|
|
return (
|
|
<div className="w-full max-w-md">
|
|
<form>
|
|
<FieldGroup>
|
|
<FieldSet>
|
|
<FieldLegend>Payment Method</FieldLegend>
|
|
<FieldDescription>All transactions are secure and encrypted</FieldDescription>
|
|
<FieldGroup>
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-7j9-card-name-43j">Name on Card</FieldLabel>
|
|
<Input id="checkout-7j9-card-name-43j" placeholder="Evil Rabbit" required />
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-7j9-card-number-uw1">Card Number</FieldLabel>
|
|
<Input
|
|
id="checkout-7j9-card-number-uw1"
|
|
placeholder="1234 5678 9012 3456"
|
|
required
|
|
/>
|
|
<FieldDescription>Enter your 16-digit card number</FieldDescription>
|
|
</Field>
|
|
<div className="grid grid-cols-3 gap-4">
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-exp-month-ts6">Month</FieldLabel>
|
|
<Select defaultValue="">
|
|
<SelectTrigger id="checkout-exp-month-ts6">
|
|
<SelectValue placeholder="MM" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="01">01</SelectItem>
|
|
<SelectItem value="02">02</SelectItem>
|
|
<SelectItem value="03">03</SelectItem>
|
|
<SelectItem value="04">04</SelectItem>
|
|
<SelectItem value="05">05</SelectItem>
|
|
<SelectItem value="06">06</SelectItem>
|
|
<SelectItem value="07">07</SelectItem>
|
|
<SelectItem value="08">08</SelectItem>
|
|
<SelectItem value="09">09</SelectItem>
|
|
<SelectItem value="10">10</SelectItem>
|
|
<SelectItem value="11">11</SelectItem>
|
|
<SelectItem value="12">12</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-7j9-exp-year-f59">Year</FieldLabel>
|
|
<Select defaultValue="">
|
|
<SelectTrigger id="checkout-7j9-exp-year-f59">
|
|
<SelectValue placeholder="YYYY" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="2024">2024</SelectItem>
|
|
<SelectItem value="2025">2025</SelectItem>
|
|
<SelectItem value="2026">2026</SelectItem>
|
|
<SelectItem value="2027">2027</SelectItem>
|
|
<SelectItem value="2028">2028</SelectItem>
|
|
<SelectItem value="2029">2029</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-7j9-cvv">CVV</FieldLabel>
|
|
<Input id="checkout-7j9-cvv" placeholder="123" required />
|
|
</Field>
|
|
</div>
|
|
</FieldGroup>
|
|
</FieldSet>
|
|
<FieldSeparator />
|
|
<FieldSet>
|
|
<FieldLegend>Billing Address</FieldLegend>
|
|
<FieldDescription>
|
|
The billing address associated with your payment method
|
|
</FieldDescription>
|
|
<FieldGroup>
|
|
<Field orientation="horizontal">
|
|
<Checkbox id="checkout-7j9-same-as-shipping-wgm" defaultChecked />
|
|
<FieldLabel htmlFor="checkout-7j9-same-as-shipping-wgm" className="font-normal">
|
|
Same as shipping address
|
|
</FieldLabel>
|
|
</Field>
|
|
</FieldGroup>
|
|
</FieldSet>
|
|
<FieldSet>
|
|
<FieldGroup>
|
|
<Field>
|
|
<FieldLabel htmlFor="checkout-7j9-optional-comments">Comments</FieldLabel>
|
|
<Textarea
|
|
id="checkout-7j9-optional-comments"
|
|
placeholder="Add any additional comments"
|
|
className="resize-none"
|
|
/>
|
|
</Field>
|
|
</FieldGroup>
|
|
</FieldSet>
|
|
<Field orientation="horizontal">
|
|
<Button variant="primary" type="submit">
|
|
Submit
|
|
</Button>
|
|
<Button type="button">Cancel</Button>
|
|
</Field>
|
|
</FieldGroup>
|
|
</form>
|
|
</div>
|
|
)
|
|
}
|