mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
Compare commits
30 commits
79f1e38c8a
...
629098e01c
Author | SHA1 | Date | |
---|---|---|---|
|
629098e01c | ||
|
8afd79dd50 | ||
|
65c5897dc3 | ||
|
8c6104305b | ||
|
50ce282284 | ||
|
2272e1dfaa | ||
|
bcb0c4100f | ||
|
8a0b8b60b5 | ||
|
7eeeceea1c | ||
|
073b561db1 | ||
|
487bb264c8 | ||
|
543d1de570 | ||
|
7cf5fab128 | ||
|
eb2ef2298b | ||
|
f5dffe12c2 | ||
|
240ce8b07f | ||
|
ab7cf5dfa9 | ||
|
3b969e55ef | ||
|
a742cc2b53 | ||
|
f4ca72c6f6 | ||
|
d9e8a86688 | ||
|
253bfa1ea2 | ||
|
5a96c0bb54 | ||
|
915e14ddab | ||
|
a7a461309d | ||
|
3bcbe7e386 | ||
|
89c2cd2108 | ||
|
ffaca84aa5 | ||
|
25b9898c09 | ||
|
833010fa52 |
19 changed files with 294 additions and 13 deletions
|
@ -292,10 +292,10 @@ export default function PluginSettings() {
|
||||||
|
|
||||||
if (!pluginFilter(p)) continue;
|
if (!pluginFilter(p)) continue;
|
||||||
|
|
||||||
const isRequired = p.required || depMap[p.name]?.some(d => settings.plugins[d].enabled);
|
const isRequired = p.required || p.isDependency || depMap[p.name]?.some(d => settings.plugins[d].enabled);
|
||||||
|
|
||||||
if (isRequired) {
|
if (isRequired) {
|
||||||
const tooltipText = p.required
|
const tooltipText = p.required || !depMap[p.name]
|
||||||
? "This plugin is required for Vencord to function."
|
? "This plugin is required for Vencord to function."
|
||||||
: makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));
|
: makeDependencyList(depMap[p.name]?.filter(d => settings.plugins[d].enabled));
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ export default definePlugin({
|
||||||
required: true,
|
required: true,
|
||||||
description: "Helps us provide support to you",
|
description: "Helps us provide support to you",
|
||||||
authors: [Devs.Ven],
|
authors: [Devs.Ven],
|
||||||
dependencies: ["CommandsAPI", "UserSettingsAPI", "MessageAccessoriesAPI"],
|
dependencies: ["UserSettingsAPI", "MessageAccessoriesAPI"],
|
||||||
|
|
||||||
settings,
|
settings,
|
||||||
|
|
||||||
|
|
14
src/plugins/customFolderIcons/README.md
Normal file
14
src/plugins/customFolderIcons/README.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# CustomFolderIcons
|
||||||
|
|
||||||
|
Allows you to set custom images/svgs as folder icons
|
||||||
|
|
||||||
|
Available as "Change Icon" in the folder context menu
|
||||||
|
|
||||||
|
![the context menu with the "Change Icon" button](https://github.com/sadan4/Vencord/assets/117494111/3dfb843c-6964-4ac3-a0b9-8772569953d3)
|
||||||
|
|
||||||
|
![an image of some example custom folder icons](https://github.com/sadan4/Vencord/assets/117494111/c5324ab1-3b7a-4286-8cb5-41c0ceb2ea44)
|
||||||
|
|
||||||
|
![the modal used to customize the folder icons](https://github.com/sadan4/Vencord/assets/117494111/1426d350-56db-4687-8052-6c1b1ce873a1)
|
||||||
|
|
||||||
|
|
||||||
|
|
124
src/plugins/customFolderIcons/components.tsx
Normal file
124
src/plugins/customFolderIcons/components.tsx
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 sadan
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { closeModal, ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
|
||||||
|
import { Button, Menu, Slider, TextInput, useState } from "@webpack/common";
|
||||||
|
|
||||||
|
import settings, { folderIconsData } from "./settings";
|
||||||
|
import { folderProp, int2rgba, setFolderData } from "./util";
|
||||||
|
|
||||||
|
export function ImageModal(folderProps: folderProp) {
|
||||||
|
const [data, setData] = useState(((settings.store.folderIcons ?? {}) as folderIconsData)[folderProps.folderId]?.url ?? "");
|
||||||
|
const [size, setSize] = useState(100);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TextInput
|
||||||
|
// this looks like a horrorshow
|
||||||
|
defaultValue={data}
|
||||||
|
onChange={(val, _n) => {
|
||||||
|
setData(val);
|
||||||
|
}}
|
||||||
|
placeholder="https://example.com/image.png"
|
||||||
|
>
|
||||||
|
</TextInput>
|
||||||
|
<RenderPreview folderProps={folderProps} url={data} size={size} />
|
||||||
|
{data && <>
|
||||||
|
<div style={{
|
||||||
|
color: "#FFF"
|
||||||
|
}}>Change the size of the folder icon</div>
|
||||||
|
<Slider
|
||||||
|
initialValue={100}
|
||||||
|
onValueChange={(v: number) => {
|
||||||
|
setSize(v);
|
||||||
|
}}
|
||||||
|
maxValue={200}
|
||||||
|
minValue={25}
|
||||||
|
// [25, 200]
|
||||||
|
markers={Array.apply(0, Array(176)).map((_, i) => i + 25)}
|
||||||
|
stickToMarkers={true}
|
||||||
|
keyboardStep={1}
|
||||||
|
renderMarker={() => null} />
|
||||||
|
</>}
|
||||||
|
<Button onClick={() => {
|
||||||
|
setFolderData(folderProps, {
|
||||||
|
url: data,
|
||||||
|
size: size
|
||||||
|
});
|
||||||
|
closeModal("custom-folder-icon");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
<hr />
|
||||||
|
<Button onClick={() => {
|
||||||
|
// INFO: unset button
|
||||||
|
const folderSettings = settings.store.folderIcons as folderIconsData;
|
||||||
|
if (folderSettings[folderProps.folderId]) {
|
||||||
|
folderSettings[folderProps.folderId] = null;
|
||||||
|
}
|
||||||
|
closeModal("custom-folder-icon");
|
||||||
|
}}>
|
||||||
|
Unset
|
||||||
|
</Button>
|
||||||
|
<hr />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export function RenderPreview({ folderProps, url, size }: { folderProps: folderProp; url: string; size: number; }) {
|
||||||
|
if (!url) return null;
|
||||||
|
return (
|
||||||
|
<div className="test1234" style={{
|
||||||
|
width: "20vh",
|
||||||
|
height: "20vh",
|
||||||
|
overflow: "hidden",
|
||||||
|
// 16/48
|
||||||
|
borderRadius: "33%",
|
||||||
|
backgroundColor: int2rgba(folderProps.folderColor, 0.4),
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center"
|
||||||
|
}}>
|
||||||
|
<img src={url} width={`${size}%`} height={`${size}%`} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function makeContextItem(a: folderProp) {
|
||||||
|
return (
|
||||||
|
<Menu.MenuItem
|
||||||
|
id="custom-folder-icons"
|
||||||
|
key="custom-folder-icons"
|
||||||
|
label="Change Icon"
|
||||||
|
action={() => {
|
||||||
|
openModalLazy(async () => {
|
||||||
|
return props => (
|
||||||
|
<ModalRoot {...props}>
|
||||||
|
<ModalHeader >
|
||||||
|
<div style={{
|
||||||
|
color: "white"
|
||||||
|
}}>
|
||||||
|
Set a New Icon.
|
||||||
|
</div>
|
||||||
|
</ModalHeader>
|
||||||
|
<ModalContent>
|
||||||
|
<ImageModal folderId={a.folderId} folderColor={a.folderColor}/>
|
||||||
|
</ModalContent>
|
||||||
|
<div style={{
|
||||||
|
color: "white",
|
||||||
|
margin: "2.5%",
|
||||||
|
marginTop: "1%"
|
||||||
|
}}>
|
||||||
|
You might have to hover the folder after setting in order for it to refresh.
|
||||||
|
</div>
|
||||||
|
</ModalRoot>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
modalKey: "custom-folder-icon"
|
||||||
|
});
|
||||||
|
}}/>
|
||||||
|
);
|
||||||
|
}
|
60
src/plugins/customFolderIcons/index.tsx
Normal file
60
src/plugins/customFolderIcons/index.tsx
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 sadan
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Devs } from "@utils/constants";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
|
|
||||||
|
import { makeContextItem } from "./components";
|
||||||
|
import settings, { folderIconsData } from "./settings";
|
||||||
|
import { folderProp, int2rgba } from "./util";
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
settings,
|
||||||
|
name: "CustomFolderIcons",
|
||||||
|
description: "Customize folder icons with any png",
|
||||||
|
authors: [
|
||||||
|
Devs.sadan
|
||||||
|
],
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: ".expandedFolderIconWrapper",
|
||||||
|
replacement: {
|
||||||
|
match: /(return.{0,80}expandedFolderIconWrapper.*,)(\(0,..jsxs\)\(.*]}\))/,
|
||||||
|
replace: "$1$self.shouldReplace(arguments[0])?$self.replace(arguments[0]):$2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
contextMenus: {
|
||||||
|
"guild-context": (menuItems, props: folderProp) => {
|
||||||
|
if(!("folderId" in props)) return;
|
||||||
|
menuItems.push(makeContextItem(props));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shouldReplace(props: any): boolean{
|
||||||
|
return !!((settings.store.folderIcons as folderIconsData)?.[props.folderNode.id]?.url);
|
||||||
|
},
|
||||||
|
replace(props: any){
|
||||||
|
const folderSettings = (settings.store.folderIcons as folderIconsData);
|
||||||
|
if(folderSettings && folderSettings[props.folderNode.id]){
|
||||||
|
const data = folderSettings[props.folderNode.id];
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
backgroundColor: int2rgba(props.folderNode.color, +settings.store.solidIcon || .4),
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
width: "100%",
|
||||||
|
height: "100%"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img src={data!.url} width={`${data!.size ?? 100}%`} height={`${data!.size ?? 100}%`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
29
src/plugins/customFolderIcons/settings.tsx
Normal file
29
src/plugins/customFolderIcons/settings.tsx
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 sadan
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
|
import { OptionType } from "@utils/types";
|
||||||
|
|
||||||
|
export interface folderIcon{
|
||||||
|
url: string,
|
||||||
|
size: number,
|
||||||
|
}
|
||||||
|
export type folderIconsData = Record<string, folderIcon | null>;
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
solidIcon: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
default: false,
|
||||||
|
description: "Use a solid background on the background of the image"
|
||||||
|
},
|
||||||
|
folderIcons: {
|
||||||
|
type: OptionType.COMPONENT,
|
||||||
|
hidden: true,
|
||||||
|
description: "folder icon settings",
|
||||||
|
component: () => <></>
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default settings;
|
29
src/plugins/customFolderIcons/util.tsx
Normal file
29
src/plugins/customFolderIcons/util.tsx
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 sadan
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import settings, { folderIcon, folderIconsData } from "./settings";
|
||||||
|
|
||||||
|
export async function setFolderData(props: folderProp, newData: folderIcon) {
|
||||||
|
if(!settings.store.folderIcons){
|
||||||
|
settings.store.folderIcons = {};
|
||||||
|
}
|
||||||
|
const folderSettings = (settings.store.folderIcons as folderIconsData);
|
||||||
|
folderSettings[props.folderId] = newData;
|
||||||
|
}
|
||||||
|
export interface folderProp {
|
||||||
|
folderId: string;
|
||||||
|
folderColor: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param rgbVal RGB value
|
||||||
|
* @param alpha alpha bewteen zero and 1
|
||||||
|
*/
|
||||||
|
export function int2rgba(rgbVal: number, alpha: number = 1) {
|
||||||
|
const b = rgbVal & 0xFF,
|
||||||
|
g = (rgbVal & 0xFF00) >>> 8,
|
||||||
|
r = (rgbVal & 0xFF0000) >>> 16;
|
||||||
|
return `rgba(${[r, g, b].join(",")},${alpha})`;
|
||||||
|
}
|
|
@ -27,7 +27,6 @@ export default definePlugin({
|
||||||
name: "FriendInvites",
|
name: "FriendInvites",
|
||||||
description: "Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",
|
description: "Create and manage friend invite links via slash commands (/create friend invite, /view friend invites, /revoke friend invites).",
|
||||||
authors: [Devs.afn, Devs.Dziurwa],
|
authors: [Devs.afn, Devs.Dziurwa],
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
name: "create friend invite",
|
name: "create friend invite",
|
||||||
|
|
|
@ -105,6 +105,11 @@ for (const p of pluginsValues) if (isPluginEnabled(p.name)) {
|
||||||
settings[d].enabled = true;
|
settings[d].enabled = true;
|
||||||
dep.isDependency = true;
|
dep.isDependency = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (p.commands?.length) {
|
||||||
|
Plugins.CommandsAPI.isDependency = true;
|
||||||
|
settings.CommandsAPI.enabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const p of pluginsValues) {
|
for (const p of pluginsValues) {
|
||||||
|
|
|
@ -82,7 +82,6 @@ export default definePlugin({
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
for (const tag of await getTags()) createTagCommand(tag);
|
for (const tag of await getTags()) createTagCommand(tag);
|
||||||
|
|
|
@ -33,7 +33,6 @@ export default definePlugin({
|
||||||
name: "MoreCommands",
|
name: "MoreCommands",
|
||||||
description: "echo, lenny, mock",
|
description: "echo, lenny, mock",
|
||||||
authors: [Devs.Arjix, Devs.echo, Devs.Samu],
|
authors: [Devs.Arjix, Devs.echo, Devs.Samu],
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
name: "echo",
|
name: "echo",
|
||||||
|
|
|
@ -24,7 +24,6 @@ export default definePlugin({
|
||||||
name: "MoreKaomoji",
|
name: "MoreKaomoji",
|
||||||
description: "Adds more Kaomoji to discord. ヽ(´▽`)/",
|
description: "Adds more Kaomoji to discord. ヽ(´▽`)/",
|
||||||
authors: [Devs.JacobTm],
|
authors: [Devs.JacobTm],
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
commands: [
|
commands: [
|
||||||
{ name: "dissatisfaction", description: " >﹏<" },
|
{ name: "dissatisfaction", description: " >﹏<" },
|
||||||
{ name: "smug", description: "ಠ_ಠ" },
|
{ name: "smug", description: "ಠ_ಠ" },
|
||||||
|
|
|
@ -88,7 +88,6 @@ export default definePlugin({
|
||||||
name: "petpet",
|
name: "petpet",
|
||||||
description: "Adds a /petpet slash command to create headpet gifs from any image",
|
description: "Adds a /petpet slash command to create headpet gifs from any image",
|
||||||
authors: [Devs.Ven],
|
authors: [Devs.Ven],
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
inputType: ApplicationCommandInputType.BUILT_IN,
|
inputType: ApplicationCommandInputType.BUILT_IN,
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default definePlugin({
|
||||||
name: "SilentTyping",
|
name: "SilentTyping",
|
||||||
authors: [Devs.Ven, Devs.Rini, Devs.ImBanana],
|
authors: [Devs.Ven, Devs.Rini, Devs.ImBanana],
|
||||||
description: "Hide that you are typing",
|
description: "Hide that you are typing",
|
||||||
dependencies: ["CommandsAPI", "ChatInputButtonAPI"],
|
dependencies: ["ChatInputButtonAPI"],
|
||||||
settings,
|
settings,
|
||||||
contextMenus: {
|
contextMenus: {
|
||||||
"textarea-context": ChatBarContextCheckbox
|
"textarea-context": ChatBarContextCheckbox
|
||||||
|
|
|
@ -76,7 +76,6 @@ export default definePlugin({
|
||||||
name: "SpotifyShareCommands",
|
name: "SpotifyShareCommands",
|
||||||
description: "Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",
|
description: "Share your current Spotify track, album or artist via slash command (/track, /album, /artist)",
|
||||||
authors: [Devs.katlyn],
|
authors: [Devs.katlyn],
|
||||||
dependencies: ["CommandsAPI"],
|
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
name: "track",
|
name: "track",
|
||||||
|
|
|
@ -72,13 +72,13 @@ export interface PluginDef {
|
||||||
stop?(): void;
|
stop?(): void;
|
||||||
patches?: Omit<Patch, "plugin">[];
|
patches?: Omit<Patch, "plugin">[];
|
||||||
/**
|
/**
|
||||||
* List of commands. If you specify these, you must add CommandsAPI to dependencies
|
* List of commands that your plugin wants to register
|
||||||
*/
|
*/
|
||||||
commands?: Command[];
|
commands?: Command[];
|
||||||
/**
|
/**
|
||||||
* A list of other plugins that your plugin depends on.
|
* A list of other plugins that your plugin depends on.
|
||||||
* These will automatically be enabled and loaded before your plugin
|
* These will automatically be enabled and loaded before your plugin
|
||||||
* Common examples are CommandsAPI, MessageEventsAPI...
|
* Generally these will be API plugins
|
||||||
*/
|
*/
|
||||||
dependencies?: string[],
|
dependencies?: string[],
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,6 +28,8 @@ export let Forms = {} as {
|
||||||
FormText: t.FormText,
|
FormText: t.FormText,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export let Icons = {} as t.Icons;
|
||||||
|
|
||||||
export let Card: t.Card;
|
export let Card: t.Card;
|
||||||
export let Button: t.Button;
|
export let Button: t.Button;
|
||||||
export let Switch: t.Switch;
|
export let Switch: t.Switch;
|
||||||
|
@ -85,4 +87,5 @@ waitFor(["FormItem", "Button"], m => {
|
||||||
Heading
|
Heading
|
||||||
} = m);
|
} = m);
|
||||||
Forms = m;
|
Forms = m;
|
||||||
|
Icons = m;
|
||||||
});
|
});
|
||||||
|
|
11
src/webpack/common/types/components.d.ts
vendored
11
src/webpack/common/types/components.d.ts
vendored
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
||||||
|
|
||||||
|
import { IconNames } from "./iconNames";
|
||||||
|
|
||||||
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code";
|
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code";
|
||||||
export type FormTextTypes = Record<"DEFAULT" | "INPUT_PLACEHOLDER" | "DESCRIPTION" | "LABEL_BOLD" | "LABEL_SELECTED" | "LABEL_DESCRIPTOR" | "ERROR" | "SUCCESS", string>;
|
export type FormTextTypes = Record<"DEFAULT" | "INPUT_PLACEHOLDER" | "DESCRIPTION" | "LABEL_BOLD" | "LABEL_SELECTED" | "LABEL_DESCRIPTOR" | "ERROR" | "SUCCESS", string>;
|
||||||
export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
||||||
|
@ -69,7 +71,7 @@ export type FormText = ComponentType<PropsWithChildren<{
|
||||||
}> & TextProps> & { Types: FormTextTypes; };
|
}> & TextProps> & { Types: FormTextTypes; };
|
||||||
|
|
||||||
export type Tooltip = ComponentType<{
|
export type Tooltip = ComponentType<{
|
||||||
text: ReactNode;
|
text: ReactNode | ComponentType;
|
||||||
children: FunctionComponent<{
|
children: FunctionComponent<{
|
||||||
onClick(): void;
|
onClick(): void;
|
||||||
onMouseEnter(): void;
|
onMouseEnter(): void;
|
||||||
|
@ -502,3 +504,10 @@ export type Avatar = ComponentType<PropsWithChildren<{
|
||||||
type FocusLock = ComponentType<PropsWithChildren<{
|
type FocusLock = ComponentType<PropsWithChildren<{
|
||||||
containerRef: RefObject<HTMLElement>;
|
containerRef: RefObject<HTMLElement>;
|
||||||
}>>;
|
}>>;
|
||||||
|
|
||||||
|
export type Icon = ComponentType<JSX.IntrinsicElements["svg"] & {
|
||||||
|
size?: string;
|
||||||
|
colorClass?: string;
|
||||||
|
} & Record<string, any>>;
|
||||||
|
|
||||||
|
export type Icons = Record<IconNames, Icon>;
|
||||||
|
|
14
src/webpack/common/types/iconNames.d.ts
vendored
Normal file
14
src/webpack/common/types/iconNames.d.ts
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue