@agimon-ai/po-web-components 0.0.0-alpha.160 → 0.0.0-alpha.162
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/README.md
CHANGED
|
@@ -6,14 +6,9 @@ The primitives are [shadcn/ui](https://ui.shadcn.com) components on [Radix](http
|
|
|
6
6
|
(the unified `radix-ui` package), restyled with Tailwind utilities that name theme tokens only.
|
|
7
7
|
Because every colour is a token, a theme config recolours the whole cockpit at runtime.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Entry points
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| `.` | Actions and chips: `Button`, `Badge`, `StatusBadge`, `Dot`, `Kbd`, `NavTab*`, `Tabs*`. Fields: `Input`, `Textarea`, `Label`, `Checkbox`, `Switch`, `RadioGroup*`, `Select*`. Overlays: `Dialog*`, `Sheet*`, `Popover*`, `DropdownMenu*`, `Tooltip*`, `Toast*`, `Command*`. Layout and content: `Panel*`, `SectionLabel`, `Separator`, `EmptyState`, `ScrollArea`, `Collapsible*`, `Accordion*`, `OptionList`, `OptionRow`, `MessageItem*`, `MessageLines`. Feedback: `Spinner`, `Progress`, `Skeleton`, `Avatar*`, `StreamCursor`. Files: `CodeEditor`, `MediaPreview`. Review: `DiffView`, `ReviewCommentDraft`. Plus the curated icon set, `cn`, `collapseLines`, `grammarKeyOf`, `mediaKindOf`, the review helpers (`buildReviewPrompt`, `reviewCommentAnchor`, `diffRangeOf`), `groupByDirectory`, the option-list key helpers, and the tone vocabularies with the maps between them |
|
|
14
|
-
| `./theme` | `ThemeConfig`, the token lists, `BUILTIN_THEMES`, `applyTheme`, `parseThemeConfig`, `themeFromPiTheme`, the stored-preference helpers |
|
|
15
|
-
| `./styles.css` | The token stylesheet: the bundled fonts, then `styles/theme.css` (`:root` defaults, the Tailwind `@theme inline` mapping, shadcn semantic aliases, base styles, and the `@source` for this package's classes) |
|
|
16
|
-
| `./themes/*.json` | The shipped theme configs: `po-one-light` (default), `po-nord-dark` |
|
|
11
|
+
The root exports React components and shared view helpers. `./theme` supplies validation, preferences, and runtime theme application; `./styles.css` supplies tokens and bundled fonts; `./themes/*.json` supplies complete theme examples. Native consumers use the separate `./nativeTheme` contract rather than importing the browser root.
|
|
17
12
|
|
|
18
13
|
## Using it from the cockpit host
|
|
19
14
|
|
|
@@ -90,9 +85,9 @@ places inline content, such as an open draft, under a row.
|
|
|
90
85
|
<DiffView hunks={hunks} testId="review-diff" onSelect={setDraft} />
|
|
91
86
|
```
|
|
92
87
|
|
|
93
|
-
## Using it from
|
|
88
|
+
## Using it from frontend routes
|
|
94
89
|
|
|
95
|
-
A web plugin's client code may import `react`, the `@tanstack` store packages,
|
|
90
|
+
A web plugin's client code belongs under `src/extensions/**/(frontend)`. It may import `react`, the `@tanstack` store packages,
|
|
96
91
|
`@agimon-ai/po-core/web`, and this package. Declare it as a `workspace:*` dependency and
|
|
97
92
|
import the same way the host does; the cockpit bundler dedupes it so one copy renders everywhere.
|
|
98
93
|
Do not import `radix-ui` or `class-variance-authority` directly from plugin code: the po-web
|
|
@@ -129,7 +124,7 @@ supply their own shadows.
|
|
|
129
124
|
Po Bloom bundles two families (`@fontsource-variable`, OFL): IBM Plex Sans (`font-sans`) for every
|
|
130
125
|
word of UI, headings included, and JetBrains Mono (`font-mono`) for code, paths, keys, and terminal
|
|
131
126
|
output. `font-display` remains as an alias of the sans family. Hierarchy comes from size, weight, and
|
|
132
|
-
ink; the role ladder is in [
|
|
127
|
+
ink; the role ladder is in [Architecture: Type](https://github.com/AgiFlow/po/blob/main/docs/architecture.md#type). `./mcp.css` carries the
|
|
133
128
|
same tokens without the fonts: a Po-generated MCP app gets them inlined by its build, and a
|
|
134
129
|
third-party app keeps its own.
|
|
135
130
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubChannel.d.mts","names":[],"sources":["../../../../../../../../po-core/dist/src/schemas/hubChannel.d.mts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"hubChannel.d.mts","names":[],"sources":["../../../../../../../../po-core/dist/src/schemas/hubChannel.d.mts"],"mappings":";;;;;;;;iBAsSiB;WACN;aACE;aACA;aACA;aACA;aACA;;WAEF;WACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeTheme.mjs","names":["NATIVE_SPACING_BASE","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","PALETTE_TOKENS","resolve","fallback","accent","ACCENT_TOKENS","steps","em","shippedNative","theme","builtinTheme","name","NATIVE_THEMES"],"sources":["../../../../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/design.md bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+IAuBA,MAAaA,EAAsB,EAGtBC,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IAAK,EAGjEE,EAAmB,CAC9B,MAAO,CAAE,KAAM,EAAG,QAAS,IAAK,EAChC,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,KAAM,CAAE,KAAM,GAAI,QAAS,GAAI,EA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,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAO1B,EAAiB0B,EAAK,CAAC,OAAO,CAAC,EACzG,kBAAmBF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAOxB,CAAsB,CAAC,EACxG,cAAesB,EAAY,GAAS,CAClC,IAAMe,EAAMtC,EAAqEyB,IAAS,EAC1F,OAAO,KAAK,MAAM1B,EAAiB0B,EAAK,CAAC,KAAOa,EAAK,GAAY,EAAI,GACvE,CAAC,EACD,WAAYpC,EACZ,WAAYE,EACZ,OAAQD,CACV,CACF,CAEA,SAASoC,EAAc,EAA6B,CAClD,IAAMC,EAAQC,EAAaC,CAAI,EAC/B,GAAIF,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBE,EAAK,aAAa,EAChF,OAAOf,EAAYa,CAAK,CAC1B,CAGA,MAAaG,EAAmE,CAC9E,KAAMJ,EAAc,cAAc,EAClC,MAAOA,EAAc,cAAc,CACrC,E"}
|
|
1
|
+
{"version":3,"file":"nativeTheme.mjs","names":["NATIVE_SPACING_BASE","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","PALETTE_TOKENS","resolve","fallback","accent","ACCENT_TOKENS","steps","em","shippedNative","theme","builtinTheme","name","NATIVE_THEMES"],"sources":["../../../../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/architecture.md#type bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+IAuBA,MAAaA,EAAsB,EAGtBC,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EA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AA2BL,EAAO,MAAM,CAAC,EAIzF,OAFAG,EAAQ,kBAAqBtB,EAAOmB,EAAO,SAAA,GAAmC,SAAgB,CAAC,EAExF,CACL,OAAQD,EAAO,OACf,SACA,QAAU,GAAUQ,EAAA,EACpB,aAAcvC,EACd,SAAUyB,EAAY,GAASxB,EAAiB0B,EAAK,CAAC,IAAI,EAC1D,WAAYF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAO1B,EAAiB0B,EAAK,CAAC,OAAO,CAAC,EACzG,kBAAmBF,EAAY,GAAS,KAAK,MAAMxB,EAAiB0B,EAAK,CAAC,KAAOxB,CAAsB,CAAC,EACxG,cAAesB,EAAY,GAAS,CAClC,IAAMe,EAAMtC,EAAqEyB,IAAS,EAC1F,OAAO,KAAK,MAAM1B,EAAiB0B,EAAK,CAAC,KAAOa,EAAK,GAAY,EAAI,GACvE,CAAC,EACD,WAAYpC,EACZ,WAAYE,EACZ,OAAQD,CACV,CACF,CAEA,SAASoC,EAAc,EAA6B,CAClD,IAAMC,EAAQC,EAAaC,CAAI,EAC/B,GAAIF,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBE,EAAK,aAAa,EAChF,OAAOf,EAAYa,CAAK,CAC1B,CAGA,MAAaG,EAAmE,CAC9E,KAAMJ,EAAc,cAAc,EAClC,MAAOA,EAAc,cAAc,CACrC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeTheme.cjs","names":["PALETTE_TOKENS","ACCENT_TOKENS","builtinTheme","require_theme","require_builtinThemes","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","resolve","fallback","accent","steps","em","shippedNative","theme","name","NATIVE_THEMES"],"sources":["../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/design.md bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+FAuBA,MAGaK,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IAAK,EAGjEE,EAAmB,CAC9B,MAAO,CAAE,KAAM,EAAG,QAAS,IAAK,EAChC,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,KAAM,CAAE,KAAM,GAAI,QAAS,GAAI,EAC/B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,MAAO,CAAE,KAAM,GAAI,QAAS,IAAK,EACjC,MAAO,CAAE,KAAM,GAAI,QAAS,GAAI,CAClC,EAGaC,EAA2B,CAAE,GAAI,KAAO,MAAO,KAAO,MAAO,IAAM,EAGnEC,EAAyB,MAGzBC,EAAqB,CAAE,QAAS,MAAO,OAAQ,MAAO,SAAU,KAAM,EAOtEC,EAAgB,CAC3B,KAAM,IACN,IAAK,IACL,KAAM,IACN,MAAO,IACP,OAAQ,CAAC,IAAM,EAAG,GAAK,CAAC,CAC1B,EAUaC,EAAyF,CACpG,KAAM,CAAE,OAAQ,gBAAiB,IAAK,SAAU,QAAS,YAAa,EACtE,KAAM,CAAE,OAAQ,iBAAkB,IAAK,QAAS,QAAS,WAAY,CACvE,EAIMC,EAAY,kCA4BlB,SAASC,EAAY,EAAuC,CAC1D,GAAI,CAACD,EAAU,KAAKE,CAAG,EAAG,MAAU,MAAM,wCAAwCA,EAAI,GAAG,EACzF,IAAMC,EACJD,EAAI,SAAW,EACXA,EACG,MAAM,CAAC,CAAC,CACR,MAA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","NATIVE_RADII","NATIVE_BORDER_RADIUS","NATIVE_TYPE_RAMP","NATIVE_LETTER_SPACING_EM","NATIVE_LEADING_RELAXED","NATIVE_FONT_WEIGHT","NATIVE_MOTION","NATIVE_FONT_FAMILY","HEX_COLOR","hexChannels","hex","digits","digit","offset","mixHex","weight","percent","a","first","b","second","mixed","channel","index","withAlpha","alpha","rampValues","values","step","pick","nativeTheme","pinned","config","colors","token","resolve","fallback","accent","steps","em","shippedNative","theme","name","NATIVE_THEMES"],"sources":["../../../src/theme/nativeTheme.ts"],"sourcesContent":["import { ACCENT_TOKENS, PALETTE_TOKENS, type ThemeConfig, type ThemeScheme, type ThemeToken } from '../types/theme';\nimport { builtinTheme } from './builtinThemes';\nimport { EDGE_MIX_PERCENT, ON_SELECTED_MIX_PERCENT, TINT_MIX_PERCENT } from './derive';\n\n/*\n * The React Native copy of the web theme. Native styles cannot read CSS\n * custom properties or evaluate color-mix(), so this module resolves the same\n * tokens to plain values. The scales below mirror styles/theme.css by hand\n * (CSS cannot import TypeScript); tests/nativeTheme.test.ts fails when the two\n * drift.\n *\n * ponytail: bundle IBM Plex Sans and JetBrains Mono through expo-font when the\n * native visual review starts; until then the named families fall back to the\n * platform fonts below.\n * ponytail: add a native theme picker later; the shell follows the system\n * scheme between `light` and `dark` for now.\n * ponytail: `--tracking-*` (tracked uppercase micro-labels) is not ported;\n * docs/architecture.md#type bans tracked uppercase on new surfaces.\n * ponytail: `shadow-2xl` is not ported; native surfaces (sheets, modals,\n * headers) draw their own platform shadows.\n */\n\n/** The spacing unit, matching `--spacing: 0.25rem` at a 16px root. */\nexport const NATIVE_SPACING_BASE = 4;\n\n/** Corner radii in px, matching `--radius-*`. */\nexport const NATIVE_RADII = { xs: 2, sm: 3, md: 5, lg: 10 } as const;\n\n/**\n * Every radius a native style may name: the retunable `--radius-*` steps, plus\n * Tailwind's hardcoded bare `rounded` (4px) and `rounded-full`.\n */\nexport const NATIVE_BORDER_RADIUS = { ...NATIVE_RADII, DEFAULT: 4, full: 9999 } as const;\n\n/** The type ramp, matching `--text-*` (px) and `--text-*--line-height` (a multiple of the size). */\nexport const NATIVE_TYPE_RAMP = {\n '2xs': { size: 9, leading: 1.45 },\n xs: { size: 10, leading: 1.45 },\n sm: { size: 12, leading: 1.45 },\n base: { size: 13, leading: 1.5 },\n lg: { size: 15, leading: 1.4 },\n xl: { size: 18, leading: 1.3 },\n '2xl': { size: 22, leading: 1.25 },\n '3xl': { size: 28, leading: 1.2 },\n} as const;\n\n/** Title tracking in em, matching `--text-*--letter-spacing`; steps not listed track at 0. */\nexport const NATIVE_LETTER_SPACING_EM = { xl: -0.01, '2xl': -0.01, '3xl': -0.01 } as const;\n\n/** Tailwind's `leading-relaxed` multiple, which theme.css does not override. */\nexport const NATIVE_LEADING_RELAXED = 1.625;\n\n/** Font weights as React Native takes them, matching `font-normal`, `font-medium` and `font-semibold`. */\nexport const NATIVE_FONT_WEIGHT = { regular: '400', medium: '500', semibold: '600' } as const;\n\n/**\n * Durations in ms and the shared easing curve of `--animate-po-*`. `slide`\n * covers both slide directions; `easing` is the `cubic-bezier()` control points\n * for Reanimated's `Easing.bezier`.\n */\nexport const NATIVE_MOTION = {\n fade: 140,\n pop: 160,\n rise: 160,\n slide: 180,\n easing: [0.16, 1, 0.3, 1],\n} as const;\n\n/** A font as native styles name it: one family, plus the platform font to use until it is bundled. */\nexport interface NativeFontStack {\n family: string;\n ios: string;\n android: string;\n}\n\n/** The sans and mono families of `--font-sans` and `--po-font-mono`, with system fallbacks. */\nexport const NATIVE_FONT_FAMILY: { readonly sans: NativeFontStack; readonly mono: NativeFontStack } = {\n sans: { family: 'IBM Plex Sans', ios: 'System', android: 'sans-serif' },\n mono: { family: 'JetBrains Mono', ios: 'Menlo', android: 'monospace' },\n};\n\n/** The foreground `on-selected` mixes toward, as `white` in derive.ts. */\nconst ON_SELECTED_BASE = '#ffffff';\nconst HEX_COLOR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst PERCENT = 100;\nconst CHANNEL_MAX = 255;\n/** Rounds px values to hundredths so `18 * -0.01` reads -0.18, not a float tail. */\nconst PX_PRECISION = 100;\n\nexport type NativeColorToken = Exclude<ThemeToken, 'font-mono'>;\nexport type NativeTypeStep = keyof typeof NATIVE_TYPE_RAMP;\nexport type NativeNamedTheme = 'dark' | 'light';\n\nexport interface PoNativeTheme {\n scheme: ThemeScheme;\n colors: Record<NativeColorToken, string>;\n /** `spacing(n)` is n steps of the 4px base, as Tailwind's `p-n`. */\n spacing: (steps: number) => number;\n borderRadius: typeof NATIVE_BORDER_RADIUS;\n fontSize: Record<NativeTypeStep, number>;\n /** Absolute line heights in px, since native styles take no unitless multiple. */\n lineHeight: Record<NativeTypeStep, number>;\n /** `leading-relaxed` line heights in px, for reading text such as markdown bodies. */\n lineHeightRelaxed: Record<NativeTypeStep, number>;\n /** Letter spacing in px per step; titles track slightly tight, the rest at 0. */\n letterSpacing: Record<NativeTypeStep, number>;\n fontWeight: typeof NATIVE_FONT_WEIGHT;\n fontFamily: typeof NATIVE_FONT_FAMILY;\n motion: typeof NATIVE_MOTION;\n}\n\nfunction hexChannels(hex: string): [number, number, number] {\n if (!HEX_COLOR.test(hex)) throw new Error(`Native themes need hex colours; got \"${hex}\".`);\n const digits =\n hex.length === 4\n ? hex\n .slice(1)\n .split('')\n .map((digit) => digit + digit)\n .join('')\n : hex.slice(1);\n return [0, 2, 4].map((offset) => Number.parseInt(digits.slice(offset, offset + 2), 16)) as [number, number, number];\n}\n\n/**\n * `color-mix(in srgb, first percent%, second)` for hex inputs: a straight\n * per-channel blend, rounded to the nearest 8-bit value.\n */\nexport function mixHex(first: string, percent: number, second: string): string {\n const weight = percent / PERCENT;\n const a = hexChannels(first);\n const b = hexChannels(second);\n return `#${a\n .map((channel, index) => {\n const mixed = Math.round(channel * weight + b[index]! * (1 - weight));\n return Math.min(CHANNEL_MAX, Math.max(0, mixed)).toString(16).padStart(2, '0');\n })\n .join('')}`;\n}\n\n/**\n * A hex colour at `percent` opacity as `#rrggbbaa`: the native form of\n * Tailwind's `/40`-style opacity modifiers.\n */\nexport function withAlpha(hex: string, percent: number): string {\n const alpha = Math.min(CHANNEL_MAX, Math.max(0, Math.round((percent / PERCENT) * CHANNEL_MAX)));\n const channels = [...hexChannels(hex), alpha];\n return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nfunction rampValues(pick: (step: NativeTypeStep) => number): Record<NativeTypeStep, number> {\n const values = {} as Record<NativeTypeStep, number>;\n for (const step of Object.keys(NATIVE_TYPE_RAMP) as NativeTypeStep[]) values[step] = pick(step);\n return values;\n}\n\n/** Resolves a web theme config to native values; tokens the theme pins win over the derived mix. */\nexport function nativeTheme(config: ThemeConfig): PoNativeTheme {\n const pinned = config.tokens as Partial<Record<ThemeToken, string>>;\n const colors = {} as Record<NativeColorToken, string>;\n for (const token of PALETTE_TOKENS) colors[token] = config.tokens[token];\n const resolve = (token: NativeColorToken, fallback: () => string): void => {\n colors[token] = pinned[token] ?? fallback();\n };\n for (const accent of ACCENT_TOKENS) {\n resolve(`tint-${accent}`, () => mixHex(colors[accent], TINT_MIX_PERCENT, colors.panel));\n }\n for (const accent of ACCENT_TOKENS) {\n resolve(`edge-${accent}`, () => mixHex(colors[accent], EDGE_MIX_PERCENT, colors.border));\n }\n resolve('on-selected', () => mixHex(colors.selected, ON_SELECTED_MIX_PERCENT, ON_SELECTED_BASE));\n\n return {\n scheme: config.scheme,\n colors,\n spacing: (steps) => steps * NATIVE_SPACING_BASE,\n borderRadius: NATIVE_BORDER_RADIUS,\n fontSize: rampValues((step) => NATIVE_TYPE_RAMP[step].size),\n lineHeight: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_TYPE_RAMP[step].leading)),\n lineHeightRelaxed: rampValues((step) => Math.round(NATIVE_TYPE_RAMP[step].size * NATIVE_LEADING_RELAXED)),\n letterSpacing: rampValues((step) => {\n const em = (NATIVE_LETTER_SPACING_EM as Partial<Record<NativeTypeStep, number>>)[step] ?? 0;\n return Math.round(NATIVE_TYPE_RAMP[step].size * em * PX_PRECISION) / PX_PRECISION;\n }),\n fontWeight: NATIVE_FONT_WEIGHT,\n fontFamily: NATIVE_FONT_FAMILY,\n motion: NATIVE_MOTION,\n };\n}\n\nfunction shippedNative(name: string): PoNativeTheme {\n const theme = builtinTheme(name);\n if (theme === undefined) throw new Error(`The shipped theme ${name} is missing.`);\n return nativeTheme(theme);\n}\n\n/** The native themes by the names the native shell registers: `dark` and `light`. */\nexport const NATIVE_THEMES: Readonly<Record<NativeNamedTheme, PoNativeTheme>> = {\n dark: shippedNative('po-nord-dark'),\n light: shippedNative('po-one-light'),\n};\n"],"mappings":"A,+FAuBA,MAGaK,EAAe,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,EAM7CC,EAAuB,CAAE,GAAGD,EAAc,QAAS,EAAG,KAAM,IAAK,EAGjEE,EAAmB,CAC9B,MAAO,CAAE,KAAM,EAAG,QAAS,IAAK,EAChC,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,GAAI,CAAE,KAAM,GAAI,QAAS,IAAK,EAC9B,KAAM,CAAE,KAAM,GAAI,QAAS,GAAI,EAC/B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,GAAI,CAAE,KAAM,GAAI,QAAS,GAAI,EAC7B,MAAO,CAAE,KAAM,GAAI,QAAS,IAAK,EACjC,MAAO,CAAE,KAAM,GAAI,QAAS,GAAI,CAClC,EAGaC,EAA2B,CAAE,GAAI,KAAO,MAAO,KAAO,MAAO,IAAM,EAGnEC,EAAyB,MAGzBC,EAAqB,CAAE,QAAS,MAAO,OAAQ,MAAO,SAAU,KAAM,EAOtEC,EAAgB,CAC3B,KAAM,IACN,IAAK,IACL,KAAM,IACN,MAAO,IACP,OAAQ,CAAC,IAAM,EAAG,GAAK,CAAC,CAC1B,EAUaC,EAAyF,CACpG,KAAM,CAAE,OAAQ,gBAAiB,IAAK,SAA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AID,IAAU,IAAA,GAAW,MAAU,MAAM,qBAAqBC,EAAK,aAAa,EAChF,OAAOZ,EAAYW,CAAK,CAC1B,CAGA,MAAaE,EAAmE,CAC9E,KAAMH,EAAc,cAAc,EAClC,MAAOA,EAAc,cAAc,CACrC,E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-web-components",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.162",
|
|
4
4
|
"description": "Shared web components and theme tokens for the Po cockpit and its web plugins: shadcn-style primitives on Radix, tuned to the Po palette, with runtime theme configs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"tailwind-merge": "3.7.0"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
121
|
-
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.
|
|
120
|
+
"@agimon-ai/po-core": "0.0.0-alpha.162",
|
|
121
|
+
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.162",
|
|
122
122
|
"@types/node": "26.6.5",
|
|
123
123
|
"@types/react": "19.3.0",
|
|
124
124
|
"@types/react-dom": "19.3.0",
|