-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7749206
commit 99b41db
Showing
11 changed files
with
308 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{ | ||
"extends": "stylelint-config-standard", | ||
"rules": { | ||
"indentation": 4 | ||
"indentation": 4, | ||
"selector-class-pattern": [ | ||
"^[a-z][a-zA-Z0-9]*(-[a-z0-9][a-zA-Z0-9]*)*$", | ||
{ | ||
"message": "Expected class selector to be kebab-case with camelCase segments" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.vc-settings-quickActions-card { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(200px, max-content)); | ||
gap: 0.5em; | ||
justify-content: center; | ||
padding: 0.5em 0; | ||
margin-bottom: 1em; | ||
} | ||
|
||
.vc-settings-quickActions-pill { | ||
all: unset; | ||
background: var(--background-secondary); | ||
color: var(--header-secondary); | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5em; | ||
padding: 8px 12px; | ||
border-radius: 9999px; | ||
} | ||
|
||
.vc-settings-quickActions-pill:hover { | ||
background: var(--background-secondary-alt); | ||
} | ||
|
||
.vc-settings-quickActions-pill:focus-visible { | ||
outline: 2px solid var(--focus-primary); | ||
outline-offset: 2px; | ||
} | ||
|
||
.vc-settings-quickActions-img { | ||
width: 24px; | ||
height: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Vencord, a Discord client mod | ||
* Copyright (c) 2024 Vendicated and contributors | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
import "./quickActions.css"; | ||
|
||
import { classNameFactory } from "@api/Styles"; | ||
import { Card } from "@webpack/common"; | ||
import type { ComponentType, PropsWithChildren, ReactNode } from "react"; | ||
|
||
const cl = classNameFactory("vc-settings-quickActions-"); | ||
|
||
export interface QuickActionProps { | ||
Icon: ComponentType<{ className?: string; }>; | ||
text: ReactNode; | ||
action?: () => void; | ||
disabled?: boolean; | ||
} | ||
|
||
export function QuickAction(props: QuickActionProps) { | ||
const { Icon, action, text, disabled } = props; | ||
|
||
return ( | ||
<button className={cl("pill")} onClick={action} disabled={disabled}> | ||
<Icon className={cl("img")} /> | ||
{text} | ||
</button> | ||
); | ||
} | ||
|
||
export function QuickActionCard(props: PropsWithChildren) { | ||
return ( | ||
<Card className={cl("card")}> | ||
{props.children} | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.