From 358ecb05cb74ae9c1369a9b20f5146bf03ade547 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 7 Mar 2026 10:43:42 -0800 Subject: [PATCH] Prepare all packages for npm publishing - Add author, repository, homepage, keywords, and engines fields to all 6 publishable package.json files - Add README.md to react, tailwind-preset, and hex-background packages - Add "type": "module" to web and react-native for consistency - Rename web build script to .cjs for ESM package compatibility - Remove overly broad "./dist/*" export from web package Co-Authored-By: Claude Opus 4.6 --- packages/hex-background/README.md | 84 ++++++++++++ packages/hex-background/package.json | 22 ++++ packages/react-native/package.json | 21 +++ packages/react/README.md | 131 +++++++++++++++++++ packages/react/package.json | 20 +++ packages/tailwind-preset/README.md | 109 +++++++++++++++ packages/tailwind-preset/package.json | 21 +++ packages/tokens/package.json | 20 +++ packages/web/package.json | 27 +++- packages/web/scripts/{build.js => build.cjs} | 0 10 files changed, 452 insertions(+), 3 deletions(-) create mode 100644 packages/hex-background/README.md create mode 100644 packages/react/README.md create mode 100644 packages/tailwind-preset/README.md rename packages/web/scripts/{build.js => build.cjs} (100%) diff --git a/packages/hex-background/README.md b/packages/hex-background/README.md new file mode 100644 index 0000000..57b536c --- /dev/null +++ b/packages/hex-background/README.md @@ -0,0 +1,84 @@ +# @dangerousthings/hex-background + +3D hexagon grid background for the Dangerous Things design system. Renders an animated, instanced WebGL hex grid using Three.js and React Three Fiber. Hexagons animate to random heights on a loop, with a slowly orbiting camera. + +## Install + +```bash +npm install @dangerousthings/hex-background +``` + +### Peer Dependencies + +```bash +npm install react @react-three/fiber three +``` + +For React Native, also install `expo-gl`. + +## Web Usage + +Drop-in full-viewport background that renders behind page content: + +```tsx +import { HexGridBackground } from "@dangerousthings/hex-background"; + +function App() { + return ( + <> + +
{/* your content */}
+ + ); +} +``` + +The component renders a fixed-position Canvas at `z-index: -1` with `pointer-events: none`, so it sits behind all other content. It automatically sizes the grid to the viewport and skips rendering in automated browsers (Selenium, Puppeteer). + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `opacity` | `number` | `0.5` | Canvas opacity | +| `hexRadius` | `number` | `0.5` | Hexagon radius | +| `margin` | `number` | `0.05` | Spacing between hexagons | +| `maxHeight` | `number` | `3` | Maximum animation height | +| `animationInterval` | `number` | `1500` | Height target refresh interval in ms | +| `cameraSpeed` | `number` | `0.02` | Camera orbital speed | +| `cameraRadius` | `number` | `8` | Camera orbital radius | +| `fov` | `number` | `40` | Camera field of view | + +## React Native Usage + +The full-viewport `HexGridBackground` wrapper uses web-specific APIs. For React Native, use the lower-level `HexGrid` and `HexCamera` components directly within a native Canvas: + +```tsx +import { Canvas } from "@react-three/fiber/native"; +import { HexGrid, HexCamera } from "@dangerousthings/hex-background/native"; + +function Background() { + return ( + + + + + + + ); +} +``` + +## Exports + +| Path | Description | +|------|-------------| +| `@dangerousthings/hex-background` | `HexGridBackground`, `HexGrid`, `HexCamera` (web) | +| `@dangerousthings/hex-background/native` | `HexGrid`, `HexCamera` (React Native) | + +## Monorepo + +Part of the [DT Design System](https://github.com/nicholasgriffintn/dt-design-system) monorepo. + +## License + +[MIT](LICENSE) diff --git a/packages/hex-background/package.json b/packages/hex-background/package.json index 7996523..820da5f 100644 --- a/packages/hex-background/package.json +++ b/packages/hex-background/package.json @@ -3,6 +3,28 @@ "version": "0.1.0", "description": "3D hexagon grid background for the Dangerous Things design system", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/hex-background" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "three.js", + "react-three-fiber", + "3d", + "hexagon", + "background" + ], + "engines": { + "node": ">=18.0.0" + }, "type": "module", "exports": { ".": { diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 89774bf..4ce32d9 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -3,6 +3,27 @@ "version": "0.2.1", "description": "React Native themed components for the Dangerous Things design system", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/react-native" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "react-native", + "components", + "theming" + ], + "engines": { + "node": ">=18.0.0" + }, + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { diff --git a/packages/react/README.md b/packages/react/README.md new file mode 100644 index 0000000..0a2b670 --- /dev/null +++ b/packages/react/README.md @@ -0,0 +1,131 @@ +# @dangerousthings/react + +React web components for the Dangerous Things design system — 20 themed components wrapping `@dangerousthings/web` CSS with React APIs matching `@dangerousthings/react-native` for cross-platform parity. + +## Install + +```bash +npm install @dangerousthings/react +``` + +### Peer Dependencies + +```bash +npm install react react-dom @dangerousthings/tokens @dangerousthings/web +``` + +## Setup + +Wrap your app with `DTWebThemeProvider` and import the web CSS bundle: + +```tsx +import "@dangerousthings/web"; +import { DTWebThemeProvider } from "@dangerousthings/react"; + +export default function App() { + return ( + + {/* your app */} + + ); +} +``` + +The provider sets `data-brand` and `data-theme` attributes on a wrapper div and exposes brand/theme via React context. + +## Components + +### Bevel & Layout + +| Component | Description | +|-----------|-------------| +| `DTCard` | Beveled card with header, progress bar, and mode colors | +| `DTButton` | Beveled button with variant colors | +| `DTLabel` | Top-right beveled label with status colors | +| `DTChip` | Compact labeled element | +| `DTMediaFrame` | Diagonal beveled frame for images | +| `DTModal` | Modal dialog with beveled corners | +| `DTDrawer` | Side drawer with edge bevels | +| `DTHexagon` | Decorative hexagon SVG shape | + +### Forms + +| Component | Description | +|-----------|-------------| +| `DTTextInput` | Sharp-cornered input with focus glow | +| `DTCheckbox` | Beveled checkbox with opposing corner cuts | +| `DTSwitch` | Angular toggle switch | +| `DTRadioGroup` | Hexagonal radio buttons | +| `DTQuantityStepper` | Beveled +/- increment buttons | +| `DTSearchInput` | Search-styled text input | + +### Layout & Animation + +| Component | Description | +|-----------|-------------| +| `DTProgressBar` | Angular progress bar with optional label | +| `DTAccordion` | Collapsible sections with accent border | +| `DTStaggerContainer` | Staggered scale-in entrance animation for children | +| `DTBadgeOverlay` | Absolute-positioned badge wrapper | + +### Filter & Feature + +| Component | Description | +|-----------|-------------| +| `DTMenu` | Dropdown menu with item variants | +| `DTFeatureLegend` | Product feature grid with icons and rotated labels | +| `DTMobileFilterOverlay` | Full-screen slide-up filter overlay with backdrop | +| `DTGallery` | Image gallery | + +### Animation Hooks + +| Hook | Description | +|------|-------------| +| `useScaleIn` | Scale 0 to 1 entrance animation | +| `usePulse` | Looping opacity pulse animation | + +## Usage Examples + +```tsx +import { DTButton, DTCard, DTTextInput } from "@dangerousthings/react"; + +// Button with variant + + Scan NFC + + +// Card with title and progress bar + +

60% progress

+
+ +// Text input + +``` + +## Theme Utilities + +```tsx +import { useDTWebTheme } from "@dangerousthings/react"; + +const { brand, theme } = useDTWebTheme(); +// brand: "dt" | "classic" +// theme: "dark" | "light" +``` + +## Variant Utilities + +```tsx +import { getVariantClass, variantToClassName } from "@dangerousthings/react"; + +getVariantClass("emphasis"); // mode class name for CSS +variantToClassName("warning"); // token-level variant mapping +``` + +## Monorepo + +Part of the [DT Design System](https://github.com/nicholasgriffintn/dt-design-system) monorepo. + +## License + +[MIT](LICENSE) diff --git a/packages/react/package.json b/packages/react/package.json index a815aed..05a2f24 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -3,6 +3,26 @@ "version": "0.1.0", "description": "React web components for the Dangerous Things design system", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/react" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "react", + "components", + "theming" + ], + "engines": { + "node": ">=18.0.0" + }, "type": "module", "exports": { ".": { diff --git a/packages/tailwind-preset/README.md b/packages/tailwind-preset/README.md new file mode 100644 index 0000000..6df0541 --- /dev/null +++ b/packages/tailwind-preset/README.md @@ -0,0 +1,109 @@ +# @dangerousthings/tailwind-preset + +Tailwind CSS v3 preset that maps Dangerous Things design tokens to Tailwind theme values. Uses CSS custom property references so the same utility classes work across both DT and Classic brands at runtime. + +## Install + +```bash +npm install @dangerousthings/tailwind-preset +``` + +### Peer Dependencies + +```bash +npm install tailwindcss@^3.4 +``` + +You also need a brand token CSS file loaded (from `@dangerousthings/web` or `@dangerousthings/tokens`). + +## Setup + +Add the preset to your `tailwind.config.js`: + +```js +import dtPreset from "@dangerousthings/tailwind-preset"; + +export default { + presets: [dtPreset], + content: ["./src/**/*.{tsx,ts,html}"], +}; +``` + +## Available Utilities + +### Colors + +All DT design token colors are available under the `dt-` prefix. Colors with `-rgb` variants support Tailwind opacity modifiers. + +```html +
+

Heading

+

Body text

+ +
+``` + +| Utility | Token | +|---------|-------| +| `bg-dt-bg`, `text-dt-bg` | `--color-bg` | +| `bg-dt-surface` | `--color-surface` | +| `bg-dt-primary`, `text-dt-primary` | `--color-primary` | +| `bg-dt-secondary` | `--color-secondary` | +| `bg-dt-accent` | `--color-accent` | +| `bg-dt-error` | `--color-error` | +| `text-dt-text-primary` | `--color-text-primary` | +| `text-dt-text-secondary` | `--color-text-secondary` | +| `text-dt-text-muted` | `--color-text-muted` | + +### Mode Colors + +Card mode colors are available under the `mode-` prefix: + +```html +
Normal
+
Emphasis
+
Warning
+``` + +### Spacing + +```html +
...
+``` + +| Utility | Token | +|---------|-------| +| `*-dt-1` through `*-dt-8` | `--space-1` through `--space-8` | + +### Border Radius + +```html +
Default
+
Small
+
Large
+``` + +### Font Family + +```html +

Tektur heading

+

Body text

+Monospace +``` + +## Brand Switching + +Because the preset uses `var()` references, switching brands at runtime requires only changing the CSS custom properties (e.g., via `data-brand` attribute). No Tailwind rebuild is needed. + +```html +
Cyan neon theme
+
Navy magenta theme
+``` + +## Monorepo + +Part of the [DT Design System](https://github.com/nicholasgriffintn/dt-design-system) monorepo. + +## License + +[MIT](LICENSE) diff --git a/packages/tailwind-preset/package.json b/packages/tailwind-preset/package.json index 593d9fb..d4ef290 100644 --- a/packages/tailwind-preset/package.json +++ b/packages/tailwind-preset/package.json @@ -3,6 +3,27 @@ "version": "0.1.0", "description": "Tailwind CSS v3 preset mapping DT design tokens to Tailwind theme", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/tailwind-preset" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "tailwind", + "tailwindcss", + "preset", + "design-tokens" + ], + "engines": { + "node": ">=18.0.0" + }, "type": "module", "exports": { ".": { diff --git a/packages/tokens/package.json b/packages/tokens/package.json index 2593c71..f505b32 100644 --- a/packages/tokens/package.json +++ b/packages/tokens/package.json @@ -3,6 +3,26 @@ "version": "0.2.1", "description": "Canonical design tokens for the Dangerous Things design system", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/tokens" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "design-tokens", + "css-custom-properties", + "theming" + ], + "engines": { + "node": ">=18.0.0" + }, "type": "module", "exports": { ".": { diff --git a/packages/web/package.json b/packages/web/package.json index 0d63305..cc280f1 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -3,6 +3,28 @@ "version": "0.2.1", "description": "Web CSS theme for the Dangerous Things design system — bevels, glows, form styles", "license": "MIT", + "author": { + "name": "Dangerous Things", + "email": "info@dangerousthings.com" + }, + "repository": { + "type": "git", + "url": "https://github.com/dangerous-tac0s/dt-design-system.git", + "directory": "packages/web" + }, + "homepage": "https://github.com/dangerous-tac0s/dt-design-system#readme", + "keywords": [ + "dangerousthings", + "design-system", + "css", + "theming", + "bevels", + "cyberpunk" + ], + "engines": { + "node": ">=18.0.0" + }, + "type": "module", "main": "dist/index.css", "exports": { ".": "./dist/index.css", @@ -13,8 +35,7 @@ "types": "./dist/theme-registry.d.ts", "import": "./dist/theme-registry.js", "default": "./dist/theme-registry.js" - }, - "./dist/*": "./dist/*" + } }, "publishConfig": { "access": "public" @@ -23,7 +44,7 @@ "dist" ], "scripts": { - "build": "node scripts/build.js", + "build": "node scripts/build.cjs", "clean": "rm -rf dist" }, "dependencies": { diff --git a/packages/web/scripts/build.js b/packages/web/scripts/build.cjs similarity index 100% rename from packages/web/scripts/build.js rename to packages/web/scripts/build.cjs