@stasho/ds 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stasho/ds",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "stasho design system",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,7 +9,11 @@ import {
9
9
  type MouseEvent,
10
10
  type ReactNode,
11
11
  } from "react";
12
- import { CaretDoubleLeft, CaretDoubleRight } from "@phosphor-icons/react";
12
+ import {
13
+ CaretDoubleLeft,
14
+ CaretDoubleRight,
15
+ CaretRight,
16
+ } from "@phosphor-icons/react";
13
17
  import { LogoLetter, LogoWordmark } from "@ac/components/logo/logo";
14
18
  import {
15
19
  Tooltip,
@@ -167,12 +171,16 @@ export function SidebarNav({
167
171
 
168
172
  export interface SidebarSectionProps {
169
173
  title?: string;
174
+ titleHref?: string;
175
+ onTitleClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
170
176
  children: ReactNode;
171
177
  className?: string;
172
178
  }
173
179
 
174
180
  export function SidebarSection({
175
181
  title,
182
+ titleHref,
183
+ onTitleClick,
176
184
  children,
177
185
  className,
178
186
  }: SidebarSectionProps) {
@@ -183,7 +191,24 @@ export function SidebarSection({
183
191
  aria-label={title ?? "Section"}
184
192
  className={cn("flex flex-col gap-1", className)}
185
193
  >
186
- {title && !collapsed && (
194
+ {title && !collapsed && titleHref && (
195
+ <a
196
+ href={titleHref}
197
+ onClick={onTitleClick}
198
+ className={cn(
199
+ "flex items-center gap-0.5 rounded-sm px-2 pb-1 pt-2",
200
+ "text-[10px] font-semibold uppercase tracking-wider text-foreground/50",
201
+ "transition-colors duration-150 hover:text-foreground",
202
+ "focus-visible:outline-none focus-visible:ring-2",
203
+ "focus-visible:ring-accent focus-visible:ring-offset-2",
204
+ "motion-reduce:transition-none",
205
+ )}
206
+ >
207
+ {title}
208
+ <CaretRight size={10} aria-hidden="true" />
209
+ </a>
210
+ )}
211
+ {title && !collapsed && !titleHref && (
187
212
  <div className="px-2 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-foreground/50">
188
213
  {title}
189
214
  </div>
@@ -130,6 +130,8 @@
130
130
  Layer 2: Semantic Surface Tokens (theme-dependent)
131
131
  ────────────────────────────────────────────── */
132
132
  :root {
133
+ /* Native UI (scrollbars, form-control chrome) must render light with the theme. */
134
+ color-scheme: light;
133
135
  --background: oklch(0.99 0.005 270);
134
136
  --foreground: oklch(0.22 0.015 270);
135
137
 
@@ -162,6 +164,8 @@
162
164
  }
163
165
 
164
166
  .theme-dark {
167
+ /* Native UI (scrollbars, form-control chrome) must render dark with the theme. */
168
+ color-scheme: dark;
165
169
  --background: #07080a;
166
170
  --foreground: #f3f3f3;
167
171