@helpwave/hightide-design
v0.0.6
Published
helpwave design tokens for hightide
Readme
@helpwave/hightide-design
TypeScript design tokens extracted from @helpwave/hightide CSS theme files. Intended for React Native and other non-CSS consumers that need the same palettes, semantic colors, and layout values as the web library.
Install
pnpm add @helpwave/hightide-designUsage
There is no package root export. Import from folder entry points:
import { ThemeTokens, colorPalettes, componentLayouts, typography } from "@helpwave/hightide-design/tokens";
import { coloringTypes, constructThemeTokens, hexWithAlpha } from "@helpwave/hightide-design/utils";
import type { HightideThemeTokens, ElementSize } from "@helpwave/hightide-design/types";
const theme = ThemeTokens.dark;
const background = theme.semanticColors.background;
const buttonHeight = componentLayouts.element.md.height;
const headline = typography.scales.headline.large;| Subpath | Contents |
| --- | --- |
| @helpwave/hightide-design/tokens | Static token values (palettes, themes, layout, typography) |
| @helpwave/hightide-design/types | Token type definitions |
| @helpwave/hightide-design/utils | Theme construction and color utilities |
Structure
src/
types/ Token type definitions
tokens/ Fully static token values
utils/ Theme construction and color utilitiesToken types
ColorPaletteBasic,ColorPaletteDetailed— palette steps using#hexvaluesScalingUnitToken— unitless layout numbers (reference pixels at 16px root)FixedUnitToken— unitless fixed values (stroke widths, font sizes, etc.)SemanticColorTokens— fixed semantic color set per themeComponentColorTokens— component colors grouped by component (e.g.menu.background,input.text)ComponentLayoutTokens— per-component sizes, padding, radii, and shared spacingTypographyTokens/TypographyStyleToken— semantic typography styles
Static tokens
tokens/color-palettes.ts— color palettes shared across themestokens/themes/light.ts,tokens/themes/dark.ts— complete themestokens/layout.ts— component layout definitionstokens/typography/— font weights, sizes, line heights, and the composedtypographyscaletokens/mappings/— semantic / component / theme mappers
Utils
utils/color.ts—hexWithAlphautils/coloring.ts—coloringTypes,ColoringType,getColoringTokenutils/constructThemeTokens.ts— theme token construction pipeline
Source of truth
Tokens mirror:
packages/hightide/src/style/theme/colors/basic.csspackages/hightide/src/style/theme/colors/semantic.csspackages/hightide/src/style/theme/colors/component.csspackages/hightide/src/style/theme/variables.csspackages/hightide/src/style/theme/element.csspackages/hightide/src/style/theme/typography.csspackages/hightide/src/style/theme/components/button.csspackages/hightide/src/style/theme/components/chip.csspackages/hightide/src/style/theme/components/input-elements.css
