[ui] standardize naming

pull/452/head
Yangshun Tay 2 years ago
parent 41e6c346d7
commit d8d4b0f092

@ -8,8 +8,8 @@ const DropdownMenuAlignments: ReadonlyArray<DropdownMenuAlignment> = [
'end', 'end',
]; ];
const DropdownMenuSizes: ReadonlyArray<DropdownMenuSize> = [ const DropdownMenuSizes: ReadonlyArray<DropdownMenuSize> = [
'default',
'inherit', 'inherit',
'regular',
]; ];
export default { export default {
@ -80,7 +80,7 @@ export function Basic({
Basic.args = { Basic.args = {
align: 'start', align: 'start',
label: 'More actions', label: 'More actions',
size: 'regular', size: 'default',
}; };
export function Align() { export function Align() {
@ -103,7 +103,7 @@ export function Align() {
return ( return (
<div className="flex justify-between"> <div className="flex justify-between">
<DropdownMenu align="start" label="Select an action" size="regular"> <DropdownMenu align="start" label="Select an action" size="default">
{menuItems.map(({ label, value }) => ( {menuItems.map(({ label, value }) => (
<DropdownMenu.Item <DropdownMenu.Item
key={value} key={value}
@ -115,7 +115,7 @@ export function Align() {
/> />
))} ))}
</DropdownMenu> </DropdownMenu>
<DropdownMenu align="end" label="Select an action" size="regular"> <DropdownMenu align="end" label="Select an action" size="default">
{menuItems.map(({ label, value }) => ( {menuItems.map(({ label, value }) => (
<DropdownMenu.Item <DropdownMenu.Item
key={value} key={value}

@ -18,7 +18,7 @@ export default function Banner({ children, size = 'md', onHide }: Props) {
size === 'sm' && 'text-sm', size === 'sm' && 'text-sm',
size === 'xs' && 'text-xs', size === 'xs' && 'text-xs',
)}> )}>
<div className="mx-auto max-w-7xl py-3 px-3 sm:px-6 lg:px-8"> <div className="mx-auto max-w-7xl py-2 px-3 sm:px-6 lg:px-8">
<div className="pr-16 sm:px-16 sm:text-center"> <div className="pr-16 sm:px-16 sm:text-center">
<p className="font-medium text-white">{children}</p> <p className="font-medium text-white">{children}</p>
</div> </div>

@ -6,7 +6,7 @@ import { ChevronDownIcon } from '@heroicons/react/24/solid';
import DropdownMenuItem from './DropdownMenuItem'; import DropdownMenuItem from './DropdownMenuItem';
export type DropdownMenuAlignment = 'end' | 'start'; export type DropdownMenuAlignment = 'end' | 'start';
export type DropdownMenuSize = 'inherit' | 'regular'; export type DropdownMenuSize = 'default' | 'inherit';
type Props = Readonly<{ type Props = Readonly<{
align?: DropdownMenuAlignment; align?: DropdownMenuAlignment;
@ -26,15 +26,15 @@ export default function DropdownMenu({
align = 'start', align = 'start',
children, children,
label, label,
size = 'regular', size = 'default',
}: Props) { }: Props) {
return ( return (
<Menu as="div" className="relative inline-block"> <Menu as="div" className="relative inline-block">
<div className="flex"> <div className="flex">
<Menu.Button <Menu.Button
className={clsx( className={clsx(
'group inline-flex justify-center font-medium text-slate-700 hover:text-slate-900', 'group inline-flex items-center justify-center font-medium text-slate-700 hover:text-slate-900',
size === 'regular' && 'text-sm', size === 'default' && 'text-sm',
)}> )}>
<div>{label}</div> <div>{label}</div>
<ChevronDownIcon <ChevronDownIcon

Loading…
Cancel
Save