diff --git a/package.json b/package.json index 386bfef..f11ef14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@near-pagoda/ui", - "version": "2.0.17", + "version": "2.0.18", "description": "A React component library that implements the official NEAR design system.", "license": "MIT", "repository": { diff --git a/src/components/Accordion/Accordion.module.scss b/src/components/Accordion/Accordion.module.scss index 3e98cc9..1aaf847 100644 --- a/src/components/Accordion/Accordion.module.scss +++ b/src/components/Accordion/Accordion.module.scss @@ -1,15 +1,16 @@ .root { - display: block; + display: flex; + flex-direction: column; + flex-grow: 1; + gap: var(--gap-m); + + &[data-gap='l'] { + gap: var(--gap-l); + } } .item { - border-radius: 6px; - box-shadow: 0 0 0 0px var(--violet-5); transition: var(--transitions); - - &:focus-within { - box-shadow: 0 0 0 4px var(--violet-5); - } } .header { @@ -26,13 +27,20 @@ font: var(--text-s); font-weight: 600; color: var(--sand-12); - padding: var(--gap-m); + padding: 0; cursor: pointer; transition: var(--transitions); + border-radius: 2px; + outline: 0px solid var(--violet-5); + outline-offset: var(--gap-s); &:hover { color: var(--violet-11); } + + &:focus-visible { + outline: 4px solid var(--violet-5); + } } .indicator { @@ -56,6 +64,7 @@ .content { overflow: hidden; font: var(--text-s); + padding-block: var(--gap-m); &[data-state='open'] { animation: slideDown var(--transition-speed); @@ -67,7 +76,7 @@ @keyframes slideDown { from { height: 0; - padding-bottom: 0; + padding-block: 0; } to { height: var(--radix-accordion-content-height); @@ -80,7 +89,7 @@ } to { height: 0; - padding-bottom: 0; + padding-block: 0; } } } @@ -89,5 +98,4 @@ display: flex; flex-direction: column; gap: var(--gap-m); - padding: 0 var(--gap-m) var(--gap-m) var(--gap-m); } diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index 152dc15..cfb4e8f 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -8,13 +8,15 @@ import { forwardRef } from 'react'; import { Flex } from '../Flex'; import s from './Accordion.module.scss'; -type RootProps = ComponentProps; +type RootProps = ComponentProps & { + gap?: 'm' | 'l'; +}; type ContentProps = ComponentProps; type TriggerProps = ComponentProps; type ItemProps = ComponentProps; -export const Root = forwardRef((props, ref) => { - return ; +export const Root = forwardRef(({ gap = 'm', ...props }, ref) => { + return ; }); Root.displayName = 'Root'; diff --git a/src/components/Card.module.scss b/src/components/Card.module.scss index dab4a5d..b1da2d1 100644 --- a/src/components/Card.module.scss +++ b/src/components/Card.module.scss @@ -61,11 +61,10 @@ cursor: pointer; &:hover { + --card-background-color: var(--sand-0) !important; box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.075); - - &[data-background='black'], - &[data-background='sand-12'] { - --card-background-color: var(--white-A4) !important; + &[data-background='sand-0'] { + --card-background-color: var(--sand-1) !important; } } &:focus-visible { diff --git a/src/components/Text.module.scss b/src/components/Text.module.scss index 486bc74..42bccde 100644 --- a/src/components/Text.module.scss +++ b/src/components/Text.module.scss @@ -8,11 +8,12 @@ a.text { .text { text-wrap: pretty; - text-underline-offset: 0.2em; + text-underline-offset: 0.25em; outline: none; background: none; padding: 0; border: none; + transition: var(--transitions); &[role='button'] { cursor: pointer; diff --git a/src/styles/_theme.scss b/src/styles/_theme.scss index 82d2294..53bbc81 100644 --- a/src/styles/_theme.scss +++ b/src/styles/_theme.scss @@ -19,7 +19,7 @@ --transitions: color var(--transition-speed), border-color var(--transition-speed), background-color var(--transition-speed), box-shadow var(--transition-speed), opacity var(--transition-speed), transform var(--transition-speed), fill var(--transition-speed), outline-color var(--transition-speed), - width var(--transition-speed), height var(--transition-speed); + outline-width var(--transition-speed), width var(--transition-speed), height var(--transition-speed); --gap-none: 0; --gap-xs: 0.25rem;