diff --git a/pkgs/clan-app/ui/src/components/Button/Button.module.css b/pkgs/clan-app/ui/src/components/Button/Button.module.css index e90db2c98..13a90425d 100644 --- a/pkgs/clan-app/ui/src/components/Button/Button.module.css +++ b/pkgs/clan-app/ui/src/components/Button/Button.module.css @@ -125,10 +125,6 @@ &.loading { @apply cursor-wait; } - - & > .typography { - @apply max-w-full overflow-hidden whitespace-nowrap text-ellipsis; - } } .button.in-HostFileInput-horizontal { diff --git a/pkgs/clan-app/ui/src/components/Button/Button.tsx b/pkgs/clan-app/ui/src/components/Button/Button.tsx index 419a00d25..b9149b3b4 100644 --- a/pkgs/clan-app/ui/src/components/Button/Button.tsx +++ b/pkgs/clan-app/ui/src/components/Button/Button.tsx @@ -90,12 +90,11 @@ export const Button = (props: ButtonProps) => { {local.children && ( {local.children} diff --git a/pkgs/clan-app/ui/src/components/Icon/Icon.module.css b/pkgs/clan-app/ui/src/components/Icon/Icon.module.css index c537c062c..8aca31cde 100644 --- a/pkgs/clan-app/ui/src/components/Icon/Icon.module.css +++ b/pkgs/clan-app/ui/src/components/Icon/Icon.module.css @@ -30,3 +30,9 @@ .icon.in-ConfigureRole { @apply ml-auto; } +.icon.in-SidebarBody-AccordionTrigger { + transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1); +} +[data-expanded] > .icon.in-SidebarBody-AccordionTrigger { + transform: rotate(180deg); +} diff --git a/pkgs/clan-app/ui/src/components/Icon/Icon.tsx b/pkgs/clan-app/ui/src/components/Icon/Icon.tsx index 0234d9576..0c0c05c1c 100644 --- a/pkgs/clan-app/ui/src/components/Icon/Icon.tsx +++ b/pkgs/clan-app/ui/src/components/Icon/Icon.tsx @@ -131,7 +131,8 @@ type In = | "MachineTags-s" | "ConfigureRole" // TODO: better name - | "WorkflowPanelTitle"; + | "WorkflowPanelTitle" + | "SidebarBody-AccordionTrigger"; export interface IconProps extends JSX.SvgSVGAttributes { icon: IconVariant; size?: number | string; @@ -153,8 +154,8 @@ const Icon: Component = (props) => { component={component()} class={cx( styles.icon, - colorsStyles[local.color], getInClasses(styles, local.in), + colorsStyles[local.color], { [colorsStyles.inverted]: local.inverted, }, diff --git a/pkgs/clan-app/ui/src/components/Modal/Modal.module.css b/pkgs/clan-app/ui/src/components/Modal/Modal.module.css index 063962e98..30f51cbd4 100644 --- a/pkgs/clan-app/ui/src/components/Modal/Modal.module.css +++ b/pkgs/clan-app/ui/src/components/Modal/Modal.module.css @@ -19,10 +19,6 @@ border-bottom: solid 1px theme(colors.border.def.2); } -.modal_title { - @apply mx-auto; -} - .modal_body { overflow-y: auto; @apply rounded-b-md p-4 pt-4 bg-def-1 flex-grow; diff --git a/pkgs/clan-app/ui/src/components/Modal/Modal.tsx b/pkgs/clan-app/ui/src/components/Modal/Modal.tsx index 21fb4b402..e8127c90f 100644 --- a/pkgs/clan-app/ui/src/components/Modal/Modal.tsx +++ b/pkgs/clan-app/ui/src/components/Modal/Modal.tsx @@ -67,10 +67,10 @@ export const Modal = (props: ModalProps) => { <>
{props.title} diff --git a/pkgs/clan-app/ui/src/components/Search/Search.stories.tsx b/pkgs/clan-app/ui/src/components/Search/Search.stories.tsx index 676b44d15..bf8331629 100644 --- a/pkgs/clan-app/ui/src/components/Search/Search.stories.tsx +++ b/pkgs/clan-app/ui/src/components/Search/Search.stories.tsx @@ -75,6 +75,7 @@ export const Default: Story = { height: "14.5rem", // Test with lots of modules options: generateModules(1000), + // FIXME: replace with a component renderItem: (item: Module) => { return (
@@ -93,7 +94,6 @@ export const Default: Story = { weight="normal" color="quaternary" inverted - class="flex justify-between" > {item.description} diff --git a/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx b/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx index 320cbc8d9..4c48ea981 100644 --- a/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx +++ b/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx @@ -29,10 +29,11 @@ export function TagSelect( {props.label} diff --git a/pkgs/clan-app/ui/src/components/Select/Select.tsx b/pkgs/clan-app/ui/src/components/Select/Select.tsx index e680591c0..06fd55aae 100644 --- a/pkgs/clan-app/ui/src/components/Select/Select.tsx +++ b/pkgs/clan-app/ui/src/components/Select/Select.tsx @@ -113,7 +113,7 @@ export const Select = (props: SelectProps) => { size="s" weight="bold" family="condensed" - class="flex w-full items-center" + in="Select-item-label" > {props.item.rawValue.label} @@ -129,8 +129,8 @@ export const Select = (props: SelectProps) => { size="s" weight="bold" family="condensed" - class="flex w-full items-center" color="secondary" + in="Select-item-label" > Loading... @@ -144,8 +144,8 @@ export const Select = (props: SelectProps) => { size="s" weight="normal" family="condensed" - class="flex w-full items-center" color="secondary" + in="Select-item-label" > {props.noOptionsText || "No options available"} @@ -157,7 +157,7 @@ export const Select = (props: SelectProps) => { size="s" weight="bold" family="condensed" - class="flex w-full items-center" + in="Select-item-label" > {props.placeholder} @@ -186,7 +186,7 @@ export const Select = (props: SelectProps) => { size="s" weight="bold" family="condensed" - class="flex w-full items-center" + in="Select-item-label" > {state.selectedOption().label} @@ -219,7 +219,7 @@ export const Select = (props: SelectProps) => { hierarchy="body" size="xs" weight="bold" - class="flex w-full items-center" + in="Select-item-label" > {state.selectedOption().label} diff --git a/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.css b/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.css deleted file mode 100644 index 1335223c2..000000000 --- a/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.css +++ /dev/null @@ -1,133 +0,0 @@ -div.sidebar-body { - @apply py-4 px-2; - /* full - (y padding) */ - height: calc(100% - 2rem); - - @apply border border-inv-3 rounded-bl-md rounded-br-md; - - /* TODO: This is weird, we shouldn't disable native browser features, a11y impacts incomming */ - &::-webkit-scrollbar { - display: none; - } - - background: - linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%), - linear-gradient( - 180deg, - theme(colors.bg.inv.1) 0%, - theme(colors.bg.inv.3) 100% - ); - - @apply backdrop-blur-sm; - - .accordion { - @apply w-full mb-4 h-full flex flex-col justify-start gap-4; - - &:last-child { - @apply mb-0; - } - - & > .item { - max-height: 50%; - &:last-child { - @apply mb-0; - } - - & > .header { - @apply flex mb-2 px-2; - - & > .trigger { - @apply inline-flex items-center justify-between w-full; - - &:focus-visible { - @apply z-10; - outline: 2px solid hsl(200 98% 39%); - outline-offset: 2px; - } - - & > .icon { - transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1); - } - - &[data-expanded] > .icon { - transform: rotate(180deg); - } - - .section-title { - @apply uppercase; - } - } - } - - & > .content { - @apply flex flex-col; - @apply py-3 px-1.5 bg-inv-4 rounded-md mb-4; - - max-height: calc(100% - 24px); - overflow-y: auto; - scrollbar-width: none; - - animation: slideAccordionUp 300ms cubic-bezier(0.87, 0, 0.13, 1); - - &[data-expanded] { - animation: slideAccordionDown 300ms cubic-bezier(0.87, 0, 0.13, 1); - } - - nav * { - @apply outline-none; - } - - nav > a { - @apply block w-full px-2 py-1.5 min-h-7 my-2 rounded-md; - - &:first-child { - @apply mt-0; - } - - &:last-child { - @apply mb-0; - } - - &:focus-visible { - background: linear-gradient( - 90deg, - theme(colors.secondary.900), - 60%, - theme(colors.secondary.600) 100% - ); - } - - &:hover { - @apply bg-inv-acc-2; - } - - &:active { - @apply bg-inv-acc-3; - } - - &.active { - @apply bg-inv-acc-2; - } - } - } - } - } -} - -@keyframes slideAccordionDown { - from { - height: 0; - } - to { - height: var(--kb-accordion-content-height); - } -} - -@keyframes slideAccordionUp { - from { - height: var(--kb-accordion-content-height); - } - to { - height: 0; - } -} diff --git a/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.module.css b/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.module.css new file mode 100644 index 000000000..3fb36f55f --- /dev/null +++ b/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.module.css @@ -0,0 +1,115 @@ +.sidebarBody { + @apply py-4 px-2; + /* full - (y padding) */ + height: calc(100% - 2rem); + + @apply border border-inv-3 rounded-bl-md rounded-br-md; + + /* TODO: This is weird, we shouldn't disable native browser features, a11y impacts incomming */ + &::-webkit-scrollbar { + display: none; + } + + background: + linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%), + linear-gradient( + 180deg, + theme(colors.bg.inv.1) 0%, + theme(colors.bg.inv.3) 100% + ); + + @apply backdrop-blur-sm; +} + +.accordion { + @apply w-full mb-4 h-full flex flex-col justify-start gap-4; + + &:last-child { + @apply mb-0; + } +} +.accordionItem { + max-height: 50%; + &:last-child { + @apply mb-0; + } +} +.accordionHeader { + @apply flex mb-2 px-2; +} + +.accordionTrigger { + @apply inline-flex items-center justify-between w-full; + + &:focus-visible { + @apply z-10; + outline: 2px solid hsl(200 98% 39%); + outline-offset: 2px; + } +} + +.accordionContent { + @apply flex flex-col; + @apply py-3 px-1.5 bg-inv-4 rounded-md mb-4; + + max-height: calc(100% - 24px); + overflow-y: auto; + scrollbar-width: none; + + animation: slideAccordionUp 300ms cubic-bezier(0.87, 0, 0.13, 1); + + &[data-expanded] { + animation: slideAccordionDown 300ms cubic-bezier(0.87, 0, 0.13, 1); + } + + nav * { + @apply outline-none; + } + + nav > a { + @apply block w-full px-2 py-1.5 min-h-7 my-2 rounded-md; + + &:first-child { + @apply mt-0; + } + + &:last-child { + @apply mb-0; + } + + &:focus-visible { + background: linear-gradient( + 90deg, + theme(colors.secondary.900), + 60%, + theme(colors.secondary.600) 100% + ); + } + + &:hover { + @apply bg-inv-acc-2; + } + + &:active { + @apply bg-inv-acc-3; + } + } +} + +@keyframes slideAccordionDown { + from { + height: 0; + } + to { + height: var(--kb-accordion-content-height); + } +} + +@keyframes slideAccordionUp { + from { + height: var(--kb-accordion-content-height); + } + to { + height: 0; + } +} diff --git a/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.tsx b/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.tsx index 91bab4813..db6b423dd 100644 --- a/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.tsx +++ b/pkgs/clan-app/ui/src/components/Sidebar/SidebarBody.tsx @@ -1,4 +1,4 @@ -import "./SidebarBody.css"; +import styles from "./SidebarBody.module.css"; import { A } from "@solidjs/router"; import { Accordion } from "@kobalte/core/accordion"; import Icon from "../Icon/Icon"; @@ -75,23 +75,29 @@ const Machines = () => { }; return ( - - - + + + Your Machines - + - + { }; return ( - - - + + + Services - + - +