Compare commits
7 Commits
@dangerous
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3ab5d892c | ||
|
|
1951cf98da | ||
|
|
2d49471ebb | ||
|
|
e33bf70896 | ||
|
|
a459b643e8 | ||
|
|
1aeceb8f24 | ||
|
|
e664cdaf3d |
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dt-design-system",
|
"name": "dt-design-system",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
|
||||||
"description": "Dangerous Things design system — shared tokens, web CSS, and React Native components",
|
"description": "Dangerous Things design system — shared tokens, web CSS, and React Native components",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* .dt-filter-overlay-content
|
* .dt-filter-overlay-content
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useEffect, useCallback, useRef, type ReactNode, type CSSProperties } from 'react';
|
import { useEffect, useCallback, useRef, useId, type ReactNode, type CSSProperties } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import type { DTVariant } from '@dangerousthings/tokens';
|
import type { DTVariant } from '@dangerousthings/tokens';
|
||||||
import { cx } from '../utils/cx';
|
import { cx } from '../utils/cx';
|
||||||
@@ -40,6 +40,7 @@ export function DTMobileFilterOverlay({
|
|||||||
}: DTMobileFilterOverlayProps) {
|
}: DTMobileFilterOverlayProps) {
|
||||||
const panelRef = useRef<HTMLDivElement>(null);
|
const panelRef = useRef<HTMLDivElement>(null);
|
||||||
const triggerRef = useRef<HTMLElement | null>(null);
|
const triggerRef = useRef<HTMLElement | null>(null);
|
||||||
|
const headingId = useId();
|
||||||
|
|
||||||
const handleKeyDown = useCallback(
|
const handleKeyDown = useCallback(
|
||||||
(e: KeyboardEvent) => {
|
(e: KeyboardEvent) => {
|
||||||
@@ -105,8 +106,18 @@ export function DTMobileFilterOverlay({
|
|||||||
|
|
||||||
return createPortal(
|
return createPortal(
|
||||||
<div className={cx('dt-filter-overlay', getVariantClass(variant), className)} style={style}>
|
<div className={cx('dt-filter-overlay', getVariantClass(variant), className)} style={style}>
|
||||||
<div className="dt-filter-overlay-backdrop" onClick={onDismiss} />
|
<div
|
||||||
<div ref={panelRef} className="dt-filter-overlay-content">
|
className="dt-filter-overlay-backdrop"
|
||||||
|
onClick={onDismiss}
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
ref={panelRef}
|
||||||
|
className="dt-filter-overlay-content"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-labelledby={headingId}
|
||||||
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -116,7 +127,7 @@ export function DTMobileFilterOverlay({
|
|||||||
padding: '16px',
|
padding: '16px',
|
||||||
borderBottom: '1px solid rgba(var(--color-primary-rgb), 0.2)',
|
borderBottom: '1px solid rgba(var(--color-primary-rgb), 0.2)',
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontWeight: 700, fontSize: '1.125rem', letterSpacing: '0.05em' }}>
|
<span id={headingId} style={{ fontWeight: 700, fontSize: '1.125rem', letterSpacing: '0.05em' }}>
|
||||||
{heading}
|
{heading}
|
||||||
{activeFilterCount !== undefined && activeFilterCount > 0 && (
|
{activeFilterCount !== undefined && activeFilterCount > 0 && (
|
||||||
<span
|
<span
|
||||||
@@ -144,6 +155,7 @@ export function DTMobileFilterOverlay({
|
|||||||
<button
|
<button
|
||||||
onClick={onDismiss}
|
onClick={onDismiss}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-label={`Close ${heading}`}
|
||||||
style={{
|
style={{
|
||||||
background: 'none',
|
background: 'none',
|
||||||
border: 'none',
|
border: 'none',
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dangerousthings/showcase-desktop",
|
"name": "@dangerousthings/showcase-desktop",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Desktop showcase for the Dangerous Things design system",
|
"description": "Desktop showcase for the Dangerous Things design system",
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dangerousthings/showcase-mobile",
|
"name": "@dangerousthings/showcase-mobile",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @dangerousthings/web
|
# @dangerousthings/web
|
||||||
|
|
||||||
|
## 0.5.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- `dt-scale-in` keyframes now hold `transform: none, opacity: 0` during `animation-delay` (the period when `animation-fill-mode: both` shows the first keyframe), then snap to `scale(0)` at animation start before scaling/fading to 1. Visual difference vs prior is a subtle fade-in alongside the scale-in. **Why:** prior keyframes held descendants at `transform: scale(0)` during the delay, which caused any child performing `getBoundingClientRect()`-based self-measurement on mount (R3F `<Canvas>`, ResizeObserver-driven charts, virtualized lists, etc.) to read a near-zero rect and never recover — `transform` changes don't fire `ResizeObserver` when they end. Fixes the SuggestedPlacements 3D viewer "blank teal block until scroll" bug on the Hydrogen storefront product pages.
|
||||||
|
|
||||||
## 0.4.1
|
## 0.4.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dangerousthings/web",
|
"name": "@dangerousthings/web",
|
||||||
"version": "0.4.1",
|
"version": "0.5.1",
|
||||||
"description": "Web CSS theme for the Dangerous Things design system — bevels, glows, form styles",
|
"description": "Web CSS theme for the Dangerous Things design system — bevels, glows, form styles",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
@@ -7,8 +7,16 @@
|
|||||||
============================================================================ */
|
============================================================================ */
|
||||||
|
|
||||||
@keyframes dt-scale-in {
|
@keyframes dt-scale-in {
|
||||||
from { transform: scale(0); }
|
/* During animation-delay (with fill-mode: both), this 0% keyframe holds.
|
||||||
to { transform: scale(1); }
|
transform: none lets descendants self-measure correctly on mount —
|
||||||
|
critical for ResizeObserver-based components (R3F Canvas, charts,
|
||||||
|
virtualized lists) whose initial getBoundingClientRect() would
|
||||||
|
otherwise be transform-multiplied to ~0 inside a scale(0) ancestor. */
|
||||||
|
0% { opacity: 0; transform: none; }
|
||||||
|
/* Snap to scale(0) at animation start so the entrance is still a
|
||||||
|
visible scale-in (with a brief fade-in alongside). */
|
||||||
|
0.001% { opacity: 0; transform: scale(0); }
|
||||||
|
100% { opacity: 1; transform: scale(1); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes dt-fade-in {
|
@keyframes dt-fade-in {
|
||||||
|
|||||||
@@ -226,6 +226,9 @@
|
|||||||
[data-brand="dt"] .badge {
|
[data-brand="dt"] .badge {
|
||||||
--badge-border-color: var(--color-border);
|
--badge-border-color: var(--color-border);
|
||||||
--badge-fill: var(--color-surface);
|
--badge-fill: var(--color-surface);
|
||||||
|
/* inline-block so a wrapping badge stays one box — clip-path and the
|
||||||
|
::before fill fragment across line boxes on a plain inline span */
|
||||||
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
isolation: isolate;
|
isolation: isolate;
|
||||||
background: var(--badge-border-color);
|
background: var(--badge-border-color);
|
||||||
@@ -404,9 +407,10 @@
|
|||||||
|
|
||||||
/* Media frame placeholder — shows when no image/video is present.
|
/* Media frame placeholder — shows when no image/video is present.
|
||||||
Surface-colored background is already provided by ::before.
|
Surface-colored background is already provided by ::before.
|
||||||
This adds centered "MISSING MEDIA" text via ::after. */
|
This adds centered "LOADING MEDIA" text via ::after. Mostly seen while
|
||||||
|
lazy media loads, so it must read as a loading state, not an error. */
|
||||||
.dt-bevel-media::after {
|
.dt-bevel-media::after {
|
||||||
content: 'MISSING MEDIA';
|
content: 'LOADING MEDIA';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -424,7 +428,7 @@
|
|||||||
Uses surface background and centered placeholder text. */
|
Uses surface background and centered placeholder text. */
|
||||||
.dt-badge-parent:empty::after,
|
.dt-badge-parent:empty::after,
|
||||||
.card-body-flush:empty::after {
|
.card-body-flush:empty::after {
|
||||||
content: 'MISSING MEDIA';
|
content: 'LOADING MEDIA';
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user