Icon small button variant (#6525)
* Icon small button variant * Rename * Update CVA + Update button WIP * add ticket ref and fix padding * Update button and all uses of Icon button * SB deployment test * Fixing type error * Fix lint * Add icon button to canvas Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
18246e0dc1
commit
cfaecc3e02
37 files changed
+145
-93
No files matched your search
@@ -107,7 +107,7 @@ const IntegrationContainer = ({
|
||||
<CollapsibleTrigger>
|
||||
<Button
|
||||
color="secondary"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
tooltip={t("edit_keys")}
|
||||
onClick={() => setShowKeys(!showKeys)}>
|
||||
<Icon.FiEdit />
|
||||
|
||||
@@ -55,7 +55,8 @@ export default function DisconnectIntegration({
|
||||
<Button
|
||||
color={buttonProps?.color || "destructive"}
|
||||
StartIcon={trashIcon ? Icon.FiTrash : undefined}
|
||||
size={trashIcon && !label ? "icon" : "base"}
|
||||
size="base"
|
||||
variant={trashIcon && !label ? "icon" : "button"}
|
||||
disabled={isGlobal}
|
||||
{...buttonProps}>
|
||||
{label && label}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function SchedulerHeading() {
|
||||
{/* TODO: i18n label with correct view */}
|
||||
<Button
|
||||
StartIcon={Icon.FiChevronLeft}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="secondary"
|
||||
aria-label="Previous Week"
|
||||
onClick={() => {
|
||||
@@ -39,7 +39,7 @@ export function SchedulerHeading() {
|
||||
/>
|
||||
<Button
|
||||
StartIcon={Icon.FiChevronRight}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="secondary"
|
||||
aria-label="Next Week"
|
||||
onClick={() => {
|
||||
|
||||
@@ -66,7 +66,7 @@ const ApiKeyListItem = ({
|
||||
<div>
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button type="button" size="icon" color="secondary" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button type="button" variant="icon" color="secondary" StartIcon={Icon.FiMoreHorizontal} />
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent>
|
||||
|
||||
@@ -164,7 +164,7 @@ const PendingMemberItem = (props: { member: TeamMember; index: number; teamId: n
|
||||
<Button
|
||||
data-testid="remove-member-button"
|
||||
StartIcon={Icon.FiTrash2}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="secondary"
|
||||
className="h-[36px] w-[36px]"
|
||||
onClick={() => {
|
||||
|
||||
@@ -133,7 +133,7 @@ export default function MemberListItem(props: Props) {
|
||||
disabled={!props.member.accepted}
|
||||
onClick={() => (props.member.accepted ? setShowTeamAvailabilityModal(true) : null)}
|
||||
color="secondary"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiClock}
|
||||
/>
|
||||
</Tooltip>
|
||||
@@ -143,7 +143,7 @@ export default function MemberListItem(props: Props) {
|
||||
href={"/" + props.member.username}
|
||||
color="secondary"
|
||||
className={classNames(!editMode ? "rounded-r-md" : "")}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiExternalLink}
|
||||
/>
|
||||
</Tooltip>
|
||||
@@ -154,7 +154,7 @@ export default function MemberListItem(props: Props) {
|
||||
className="h-[36px] w-[36px] bg-transparent px-0 py-0 hover:bg-transparent focus:bg-transparent focus:outline-none focus:ring-0 focus:ring-offset-0">
|
||||
<Button
|
||||
color="secondary"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
className="rounded-r-md"
|
||||
StartIcon={Icon.FiMoreHorizontal}
|
||||
/>
|
||||
@@ -197,7 +197,7 @@ export default function MemberListItem(props: Props) {
|
||||
<div className="flex md:hidden">
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button type="button" size="icon" color="minimal" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button type="button" variant="icon" color="minimal" StartIcon={Icon.FiMoreHorizontal} />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
{props.member.accepted && (
|
||||
|
||||
@@ -90,7 +90,7 @@ export default function TeamInviteListItem(props: Props) {
|
||||
<Button
|
||||
type="button"
|
||||
className="mr-3 border-gray-700"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="secondary"
|
||||
onClick={declineInvite}
|
||||
StartIcon={Icon.FiSlash}
|
||||
@@ -98,7 +98,7 @@ export default function TeamInviteListItem(props: Props) {
|
||||
<Button
|
||||
type="button"
|
||||
className="border-gray-700"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="secondary"
|
||||
onClick={acceptInvite}
|
||||
StartIcon={Icon.FiCheck}
|
||||
@@ -107,7 +107,7 @@ export default function TeamInviteListItem(props: Props) {
|
||||
<div className="block sm:hidden">
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button type="button" color="minimal" size="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button type="button" color="minimal" variant="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem>
|
||||
|
||||
@@ -115,7 +115,7 @@ export default function TeamListItem(props: Props) {
|
||||
<div className="block sm:hidden">
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button type="button" color="minimal" size="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button type="button" color="minimal" variant="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem>
|
||||
@@ -150,14 +150,19 @@ export default function TeamListItem(props: Props) {
|
||||
);
|
||||
showToast(t("link_copied"), "success");
|
||||
}}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiLink}
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild className="radix-state-open:rounded-r-md">
|
||||
<Button type="button" color="secondary" size="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button
|
||||
type="button"
|
||||
color="secondary"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiMoreHorizontal}
|
||||
/>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent hidden={hideDropdown}>
|
||||
{isAdmin && (
|
||||
|
||||
@@ -143,7 +143,7 @@ export default function WorkflowListPage({ workflows }: Props) {
|
||||
<Button
|
||||
type="button"
|
||||
color="secondary"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiEdit2}
|
||||
onClick={async () => await router.replace("/workflows/" + workflow.id)}
|
||||
/>
|
||||
@@ -155,7 +155,7 @@ export default function WorkflowListPage({ workflows }: Props) {
|
||||
setwWorkflowToDeleteId(workflow.id);
|
||||
}}
|
||||
color="secondary"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiTrash2}
|
||||
/>
|
||||
</Tooltip>
|
||||
@@ -167,7 +167,7 @@ export default function WorkflowListPage({ workflows }: Props) {
|
||||
<Button
|
||||
type="button"
|
||||
color="minimal"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiMoreHorizontal}
|
||||
/>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
@@ -296,7 +296,12 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
<div>
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button type="button" color="minimal" size="icon" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button
|
||||
type="button"
|
||||
color="minimal"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiMoreHorizontal}
|
||||
/>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent>
|
||||
<DropdownMenuItem>
|
||||
|
||||
@@ -44,7 +44,7 @@ function WorkflowsPage() {
|
||||
CTA={
|
||||
session.data?.hasValidLicense && data?.workflows && data?.workflows.length > 0 ? (
|
||||
<Button
|
||||
size="fab"
|
||||
variant="fab"
|
||||
StartIcon={Icon.FiPlus}
|
||||
onClick={() => createMutation.mutate()}
|
||||
loading={createMutation.isLoading}>
|
||||
|
||||
@@ -286,7 +286,7 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
|
||||
onClick={() => openModal(props.options[0])}
|
||||
data-testid="new-event-type"
|
||||
StartIcon={Icon.FiPlus}
|
||||
size="fab"
|
||||
variant="fab"
|
||||
disabled={!props.canAddEvents}>
|
||||
{t("new")}
|
||||
</Button>
|
||||
@@ -295,7 +295,7 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
EndIcon={Icon.FiChevronDown}
|
||||
size="fab"
|
||||
variant="fab"
|
||||
className="radix-state-open:!bg-brand-500 radix-state-open:ring-2 radix-state-open:ring-brand-500 ring-offset-2 focus:border-none">
|
||||
{t("new")}
|
||||
</Button>
|
||||
|
||||
@@ -28,7 +28,7 @@ function CustomInputItem({ required, deleteOnClick, editOnClick, type, question
|
||||
</Button>
|
||||
<Button
|
||||
StartIcon={Icon.FiTrash}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="destructive"
|
||||
onClick={deleteOnClick}
|
||||
className="h-[36px] border border-gray-200"
|
||||
|
||||
@@ -75,7 +75,7 @@ const DateOverrideList = ({
|
||||
tooltip={t("edit")}
|
||||
className="text-gray-700"
|
||||
color="minimal"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiEdit2}
|
||||
/>
|
||||
</DialogTrigger>
|
||||
@@ -85,7 +85,7 @@ const DateOverrideList = ({
|
||||
<Button
|
||||
className="text-gray-700"
|
||||
color="destructive"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiTrash2}
|
||||
onClick={() => remove(index)}
|
||||
/>
|
||||
|
||||
@@ -58,7 +58,7 @@ export function NewScheduleButton({ name = "new-schedule" }: { name?: string })
|
||||
return (
|
||||
<Dialog name={name} clearQueryParamsOnClose={["copy-schedule-id"]}>
|
||||
<DialogTrigger asChild>
|
||||
<Button size="fab" data-testid={name} StartIcon={Icon.FiPlus}>
|
||||
<Button variant="fab" data-testid={name} StartIcon={Icon.FiPlus}>
|
||||
{t("new")}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -106,7 +106,7 @@ const CopyButton = ({
|
||||
type="button"
|
||||
tooltip={t("duplicate")}
|
||||
color="minimal"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiCopy}
|
||||
/>
|
||||
</DropdownMenuTrigger>
|
||||
@@ -184,7 +184,7 @@ export const DayRanges = <TFieldValues extends FieldValues>({
|
||||
className=" text-gray-400"
|
||||
type="button"
|
||||
color="minimal"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
StartIcon={Icon.FiPlus}
|
||||
onClick={() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -213,7 +213,7 @@ const RemoveTimeButton = ({
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="minimal"
|
||||
StartIcon={Icon.FiTrash}
|
||||
onClick={() => remove(index)}
|
||||
|
||||
@@ -73,7 +73,7 @@ export function ScheduleListItem({
|
||||
</div>
|
||||
<Dropdown>
|
||||
<DropdownMenuTrigger asChild className="mx-5">
|
||||
<Button type="button" size="icon" color="secondary" StartIcon={Icon.FiMoreHorizontal} />
|
||||
<Button type="button" variant="icon" color="secondary" StartIcon={Icon.FiMoreHorizontal} />
|
||||
</DropdownMenuTrigger>
|
||||
{!isLoading && data && (
|
||||
<DropdownMenuContent>
|
||||
|
||||
@@ -339,7 +339,7 @@ const MobileSettingsContainer = (props: { onSideContainerOpen?: () => void }) =>
|
||||
<>
|
||||
<nav className="sticky top-0 z-20 flex w-full items-center justify-between border-b border-gray-100 bg-gray-50 p-4 sm:relative lg:hidden">
|
||||
<div className="flex items-center space-x-3 ">
|
||||
<Button StartIcon={Icon.FiMenu} color="minimal" size="icon" onClick={props.onSideContainerOpen}>
|
||||
<Button StartIcon={Icon.FiMenu} color="minimal" variant="icon" onClick={props.onSideContainerOpen}>
|
||||
<span className="sr-only">{t("show_navigation")}</span>
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -766,7 +766,7 @@ export function ShellMain(props: LayoutProps) {
|
||||
<div className="mb-6 flex sm:mt-0 lg:mb-10">
|
||||
{!!props.backPath && (
|
||||
<Button
|
||||
size="icon"
|
||||
variant="icon"
|
||||
color="minimal"
|
||||
onClick={() =>
|
||||
typeof props.backPath === "string" ? router.push(props.backPath as string) : router.back()
|
||||
|
||||
@@ -75,7 +75,7 @@ export default function WebhookListItem(props: {
|
||||
<Button
|
||||
color="destructive"
|
||||
StartIcon={Icon.FiTrash}
|
||||
size="icon"
|
||||
variant="icon"
|
||||
onClick={() => {
|
||||
// TODO: Confimation dialog before deleting
|
||||
deleteWebhook.mutate({ id: webhook.id, eventTypeId: webhook.eventTypeId || undefined });
|
||||
|
||||
Reference in new issue
Block a user