@stasho/ds 0.10.0 → 0.12.0

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.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "stasho design system",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,6 +45,7 @@ const AccordionTrigger = forwardRef<
45
45
  "size-4 shrink-0 text-accent-500 dark:text-accent",
46
46
  "transition-transform duration-200",
47
47
  "group-data-[state=open]:rotate-180",
48
+ "group-data-[state=closed]:group-hover:translate-y-[3px]",
48
49
  "motion-reduce:transition-none",
49
50
  )}
50
51
  />
@@ -57,10 +58,21 @@ const AccordionContent = forwardRef<
57
58
  HTMLDivElement,
58
59
  ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
59
60
  >(({ className, children, ...rest }, ref) => (
60
- <AccordionPrimitive.Content ref={ref} {...rest}>
61
+ <AccordionPrimitive.Content
62
+ ref={ref}
63
+ className={cn(
64
+ "group overflow-hidden",
65
+ "motion-safe:data-[state=open]:animate-accordion-down",
66
+ "motion-safe:data-[state=closed]:animate-accordion-up",
67
+ )}
68
+ {...rest}
69
+ >
61
70
  <div
62
71
  className={cn(
63
72
  "pb-4 text-sm leading-relaxed text-muted-foreground",
73
+ "opacity-0 -translate-y-1 transition-[opacity,transform] duration-200 ease-out",
74
+ "group-data-[state=open]:opacity-100 group-data-[state=open]:translate-y-0",
75
+ "motion-reduce:transition-none motion-reduce:opacity-100 motion-reduce:translate-y-0",
64
76
  className,
65
77
  )}
66
78
  >
@@ -64,5 +64,71 @@ const LogoFull = forwardRef<SVGSVGElement, LogoProps>(
64
64
 
65
65
  LogoFull.displayName = "LogoFull";
66
66
 
67
- export { Logo, LogoFull };
67
+ /**
68
+ * stasho wordmark only, no icon (placeholder logotype, rebrand still deferred).
69
+ * Set in Anybody 800 italic to match the brand headings; the consuming app must
70
+ * load Anybody or it falls back to sans-serif. viewBox is fitted to "stasho" at
71
+ * that cut. Inherits color from parent via `currentColor`.
72
+ */
73
+ const LogoWordmark = forwardRef<SVGSVGElement, LogoProps>(
74
+ ({ className, ...rest }, ref) => (
75
+ <svg
76
+ ref={ref}
77
+ viewBox="0 0 654 229"
78
+ xmlns="http://www.w3.org/2000/svg"
79
+ fill="currentColor"
80
+ className={cn("shrink-0", className)}
81
+ {...rest}
82
+ >
83
+ <text
84
+ x="0"
85
+ y="180"
86
+ fill="currentColor"
87
+ fontFamily="Anybody, sans-serif"
88
+ fontSize="200"
89
+ fontWeight="800"
90
+ fontStyle="italic"
91
+ >
92
+ stasho
93
+ </text>
94
+ </svg>
95
+ ),
96
+ );
97
+
98
+ LogoWordmark.displayName = "LogoWordmark";
99
+
100
+ /**
101
+ * stasho letter mark "s", for collapsed / compact placements (placeholder
102
+ * logotype, rebrand still deferred). Set in Anybody 800 italic to match the
103
+ * brand headings; the consuming app must load Anybody or it falls back to
104
+ * sans-serif. Inherits color from parent via `currentColor`.
105
+ */
106
+ const LogoLetter = forwardRef<SVGSVGElement, LogoProps>(
107
+ ({ className, ...rest }, ref) => (
108
+ <svg
109
+ ref={ref}
110
+ viewBox="0 0 119 229"
111
+ xmlns="http://www.w3.org/2000/svg"
112
+ fill="currentColor"
113
+ className={cn("shrink-0", className)}
114
+ {...rest}
115
+ >
116
+ <text
117
+ x="0"
118
+ y="180"
119
+ fill="currentColor"
120
+ fontFamily="Anybody, sans-serif"
121
+ fontSize="200"
122
+ fontWeight="800"
123
+ fontStyle="italic"
124
+ >
125
+ s
126
+ </text>
127
+ </svg>
128
+ ),
129
+ );
130
+
131
+ LogoLetter.displayName = "LogoLetter";
132
+
133
+ export { Logo, LogoFull, LogoWordmark, LogoLetter };
68
134
  export type { LogoProps };
@@ -375,4 +375,27 @@
375
375
  animation: none;
376
376
  opacity: 1;
377
377
  }
378
+ }
379
+
380
+ /* ── Accordion open/close (height) ───────────── */
381
+
382
+ /* Registered as real Tailwind utilities so the `data-[state=...]:` variant can
383
+ compose (a plain `.animate-accordion-*` CSS class can't carry a Tailwind
384
+ variant). Applied in the component as `motion-safe:data-[state=open]:…` — the
385
+ `data-[state]` attribute selector out-specifies `motion-reduce:animate-none`,
386
+ so reduced motion is honored by gating the animation INTO motion-safe rather
387
+ than disabling it OUT, which sidesteps the specificity conflict entirely. */
388
+ @theme {
389
+ --animate-accordion-down: accordion-down 200ms ease-out;
390
+ --animate-accordion-up: accordion-up 200ms ease-out;
391
+ }
392
+
393
+ @keyframes accordion-down {
394
+ from { height: 0; }
395
+ to { height: var(--radix-accordion-content-height); }
396
+ }
397
+
398
+ @keyframes accordion-up {
399
+ from { height: var(--radix-accordion-content-height); }
400
+ to { height: 0; }
378
401
  }