Fix: remove unused classNames
This commit is contained in:
@@ -3,7 +3,7 @@ import tseslint from "typescript-eslint";
|
|||||||
import tailwind from "eslint-plugin-tailwindcss";
|
import tailwind from "eslint-plugin-tailwindcss";
|
||||||
import pluginQuery from "@tanstack/eslint-plugin-query";
|
import pluginQuery from "@tanstack/eslint-plugin-query";
|
||||||
|
|
||||||
export default tseslint.config(
|
const config = tseslint.config(
|
||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
...pluginQuery.configs["flat/recommended"],
|
...pluginQuery.configs["flat/recommended"],
|
||||||
...tseslint.configs.strict,
|
...tseslint.configs.strict,
|
||||||
@@ -30,3 +30,5 @@ export default tseslint.config(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { JSX } from "solid-js";
|
|||||||
|
|
||||||
import { Typography } from "@/src/components/Typography";
|
import { Typography } from "@/src/components/Typography";
|
||||||
|
|
||||||
type FieldsetProps = {
|
interface FieldsetProps {
|
||||||
legend?: string;
|
legend?: string;
|
||||||
children: JSX.Element;
|
children: JSX.Element;
|
||||||
class?: string;
|
class?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
export default function Fieldset(props: FieldsetProps) {
|
export default function Fieldset(props: FieldsetProps) {
|
||||||
return (
|
return (
|
||||||
@@ -24,7 +24,7 @@ export default function Fieldset(props: FieldsetProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div class="flex flex-col gap-y-3 p-5 border border-secondary-200 bg-secondary-50 rounded-md">
|
<div class="flex flex-col gap-y-3 rounded-md border border-secondary-200 bg-secondary-50 p-5">
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ export function ListValueDisplay<T extends FieldValues, R extends ResponseData>(
|
|||||||
const bottomMost = () => props.idx === 0;
|
const bottomMost = () => props.idx === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="w-full px-2 pb-4 border-b border-secondary-200">
|
<div class="w-full border-b border-secondary-200 px-2 pb-4">
|
||||||
<div class="flex w-full items-center gap-2">
|
<div class="flex w-full items-center gap-2">
|
||||||
{props.children}
|
{props.children}
|
||||||
<div class="ml-4 min-w-fit">
|
<div class="ml-4 min-w-fit">
|
||||||
@@ -629,7 +629,7 @@ export function ArrayFields<T extends FieldValues, R extends ResponseData>(
|
|||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
<Show when={fieldArray.error}>
|
<Show when={fieldArray.error}>
|
||||||
<span class="label-text-alt font-bold text-error-700">
|
<span class="font-bold text-error-700">
|
||||||
{fieldArray.error}
|
{fieldArray.error}
|
||||||
</span>
|
</span>
|
||||||
</Show>
|
</Show>
|
||||||
@@ -652,7 +652,7 @@ export function ArrayFields<T extends FieldValues, R extends ResponseData>(
|
|||||||
// Button for adding new items
|
// Button for adding new items
|
||||||
components={{
|
components={{
|
||||||
before: (
|
before: (
|
||||||
<div class="w-full flex justify-end pb-2">
|
<div class="flex w-full justify-end pb-2">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|||||||
@@ -110,18 +110,18 @@ export const MachineListItem = (props: MachineListItemProps) => {
|
|||||||
setUpdating(false);
|
setUpdating(false);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div class="border rounded-lg border-def-2 p-3 m-2 w-64">
|
<div class="m-2 w-64 rounded-lg border p-3 border-def-2">
|
||||||
<figure class="h-fit rounded-xl border bg-def-2 border-def-5">
|
<figure class="h-fit rounded-xl border bg-def-2 border-def-5">
|
||||||
<RndThumbnail name={name} width={220} height={120} />
|
<RndThumbnail name={name} width={220} height={120} />
|
||||||
</figure>
|
</figure>
|
||||||
<div class="flex-row justify-between gap-4 pt-2 px-2">
|
<div class="flex-row justify-between gap-4 px-2 pt-2">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<A href={`/machines/${name}`}>
|
<A href={`/machines/${name}`}>
|
||||||
<Typography hierarchy="title" size="m" weight="bold">
|
<Typography hierarchy="title" size="m" weight="bold">
|
||||||
{name}
|
{name}
|
||||||
</Typography>
|
</Typography>
|
||||||
</A>
|
</A>
|
||||||
<div class="text-slate-600 flex justify-between">
|
<div class="flex justify-between text-slate-600">
|
||||||
<div class="flex flex-nowrap">
|
<div class="flex flex-nowrap">
|
||||||
<span class="h-4">
|
<span class="h-4">
|
||||||
<Icon icon="Flash" class="h-4" font-size="inherit" />
|
<Icon icon="Flash" class="h-4" font-size="inherit" />
|
||||||
@@ -138,7 +138,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
|
|||||||
popoverid={`menu-${props.name}`}
|
popoverid={`menu-${props.name}`}
|
||||||
label={<Icon icon={"More"} />}
|
label={<Icon icon={"More"} />}
|
||||||
>
|
>
|
||||||
<ul class="z-[1] w-64 p-2 shadow bg-white ">
|
<ul class="z-[1] w-64 bg-white p-2 shadow ">
|
||||||
<li>
|
<li>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { A } from "@solidjs/router";
|
import { A } from "@solidjs/router";
|
||||||
|
|
||||||
import { Typography } from "@/src/components/Typography";
|
import { Typography } from "@/src/components/Typography";
|
||||||
|
import "./css/sidebar.css";
|
||||||
|
|
||||||
interface SidebarListItem {
|
interface SidebarListItem {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -11,7 +11,7 @@ export const SidebarListItem = (props: SidebarListItem) => {
|
|||||||
const { title, href } = props;
|
const { title, href } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li class="sidebar__list__item">
|
<li class="">
|
||||||
<A class="sidebar__list__link" href={href}>
|
<A class="sidebar__list__link" href={href}>
|
||||||
<Typography
|
<Typography
|
||||||
class="sidebar__list__content"
|
class="sidebar__list__content"
|
||||||
|
|||||||
10
pkgs/webview-ui/app/src/components/accordion/accordion.css
Normal file
10
pkgs/webview-ui/app/src/components/accordion/accordion.css
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.accordion {
|
||||||
|
@apply flex flex-col gap-y-5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion__title {
|
||||||
|
@apply flex h-5 cursor-pointer items-center justify-end gap-x-0.5 px-1 font-medium;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion__body {
|
||||||
|
}
|
||||||
@@ -1,27 +1,21 @@
|
|||||||
import { createSignal, JSX, Show } from "solid-js";
|
import { createSignal, JSX, Show } from "solid-js";
|
||||||
|
|
||||||
import Icon from "../icon";
|
import Icon from "../icon";
|
||||||
import { Typography } from "../Typography";
|
|
||||||
import { Button } from "../button";
|
import { Button } from "../button";
|
||||||
|
import cx from "classnames";
|
||||||
|
import "./accordion.css";
|
||||||
|
|
||||||
type AccordionProps = {
|
interface AccordionProps {
|
||||||
title: string;
|
title: string;
|
||||||
children: JSX.Element;
|
children: JSX.Element;
|
||||||
class?: string;
|
class?: string;
|
||||||
initiallyOpen?: boolean;
|
initiallyOpen?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
export default function Accordion(props: AccordionProps) {
|
export default function Accordion(props: AccordionProps) {
|
||||||
const [isOpen, setIsOpen] = createSignal(props.initiallyOpen ?? false);
|
const [isOpen, setIsOpen] = createSignal(props.initiallyOpen ?? false);
|
||||||
return (
|
return (
|
||||||
<div
|
<div class={cx(`accordion`, props.class)} tabindex="0">
|
||||||
class={`accordion flex flex-col gap-y-5 ${props.class ?? ""}`}
|
<div onClick={() => setIsOpen(!isOpen())} class="accordion__title">
|
||||||
tabindex="0"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
onClick={() => setIsOpen(!isOpen())}
|
|
||||||
class="accordion__title h-5 flex gap-x-0.5 items-center justify-end font-medium cursor-pointer px-1"
|
|
||||||
>
|
|
||||||
<Show
|
<Show
|
||||||
when={isOpen()}
|
when={isOpen()}
|
||||||
fallback={
|
fallback={
|
||||||
|
|||||||
@@ -24,15 +24,12 @@ const variantColors: (
|
|||||||
!disabled && "button--light-hover", // Hover state
|
!disabled && "button--light-hover", // Hover state
|
||||||
!disabled && "button--light-focus", // Focus state
|
!disabled && "button--light-focus", // Focus state
|
||||||
!disabled && "button--light-active", // Active state
|
!disabled && "button--light-active", // Active state
|
||||||
|
|
||||||
"button--light-disabled", // Disabled state
|
|
||||||
),
|
),
|
||||||
ghost: cx(
|
ghost: cx(
|
||||||
// "shadow-inner-secondary",
|
// "shadow-inner-secondary",
|
||||||
!disabled && "hover:bg-secondary-200 hover:text-secondary-900", // Hover state
|
!disabled && "hover:bg-secondary-200 hover:text-secondary-900", // Hover state
|
||||||
!disabled && "focus:bg-secondary-200 focus:text-secondary-900", // Focus state
|
!disabled && "focus:bg-secondary-200 focus:text-secondary-900", // Focus state
|
||||||
!disabled && "button--light-active", // Active state
|
!disabled && "button--light-active", // Active state
|
||||||
"button--light-disabled", // Disabled state
|
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ interface HeaderProps {
|
|||||||
}
|
}
|
||||||
export const Header = (props: HeaderProps) => {
|
export const Header = (props: HeaderProps) => {
|
||||||
return (
|
return (
|
||||||
<div class="sticky top-0 z-20 navbar border-b px-6 py-4 border-def-3 bg-white bg-opacity-80 backdrop-blur-md">
|
<div class="sticky top-0 z-20 border-b bg-white/80 px-6 py-4 backdrop-blur-md border-def-3">
|
||||||
<div class="flex-none">
|
<div class="flex-none">
|
||||||
{props.showBack && <BackButton />}
|
{props.showBack && <BackButton />}
|
||||||
<span class=" lg:hidden" data-tip="Menu">
|
<span class=" lg:hidden" data-tip="Menu">
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ export const Layout: Component<RouteSectionProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="h-screen w-full p-4 bg-def-2">
|
<div class="h-screen w-full p-4 bg-def-2">
|
||||||
<div class="flex flex-row-reverse w-full h-full">
|
<div class="flex size-full flex-row-reverse">
|
||||||
<div class="flex-1 my-2 ml-8 overflow-x-hidden overflow-y-scroll rounded-lg border bg-def-1 border-def-3">
|
<div class="my-2 ml-8 flex-1 overflow-x-hidden overflow-y-scroll rounded-lg border bg-def-1 border-def-3">
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
<Sidebar {...props} />
|
<Sidebar {...props} />
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export function CreateMachine() {
|
|||||||
<div class="mt-4 w-full self-stretch px-8">
|
<div class="mt-4 w-full self-stretch px-8">
|
||||||
<Form
|
<Form
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
class="mx-auto w-full max-w-2xl flex flex-col gap-y-6"
|
class="mx-auto flex w-full max-w-2xl flex-col gap-y-6"
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
name="opts.machine.name"
|
name="opts.machine.name"
|
||||||
@@ -86,7 +86,7 @@ export function CreateMachine() {
|
|||||||
>
|
>
|
||||||
{(field, props) => (
|
{(field, props) => (
|
||||||
<>
|
<>
|
||||||
<div class="flex justify-center mb-4 pb-4 border-b">
|
<div class="mb-4 flex justify-center border-b pb-4">
|
||||||
<MachineAvatar name={field.value} />
|
<MachineAvatar name={field.value} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@@ -165,7 +165,7 @@ export function CreateMachine() {
|
|||||||
</Fieldset>
|
</Fieldset>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
<footer class="gap-y-3 pt-5 border-t border-secondary-200 flex justify-end">
|
<footer class="flex justify-end gap-y-3 border-t border-secondary-200 pt-5">
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={formStore.submitting}
|
disabled={formStore.submitting}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const ModuleItem = (props: {
|
|||||||
|
|
||||||
<header class="flex flex-col gap-4">
|
<header class="flex flex-col gap-4">
|
||||||
<A href={`/modules/details/${name}`}>
|
<A href={`/modules/details/${name}`}>
|
||||||
<div class="stat-value">
|
<div class="">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<Categories categories={info.categories} />
|
<Categories categories={info.categories} />
|
||||||
<Typography hierarchy="title" size="m" weight="medium">
|
<Typography hierarchy="title" size="m" weight="medium">
|
||||||
@@ -162,7 +162,7 @@ export const ModuleList = () => {
|
|||||||
<Match when={modulesQuery.isFetching}>Loading....</Match>
|
<Match when={modulesQuery.isFetching}>Loading....</Match>
|
||||||
<Match when={modulesQuery.data}>
|
<Match when={modulesQuery.data}>
|
||||||
<div
|
<div
|
||||||
class="p-6 grid gap-6"
|
class="grid gap-6 p-6"
|
||||||
classList={{
|
classList={{
|
||||||
"grid-cols-1": view() === "list",
|
"grid-cols-1": view() === "list",
|
||||||
"grid-cols-2": view() === "grid",
|
"grid-cols-2": view() === "grid",
|
||||||
|
|||||||
Reference in New Issue
Block a user