@dstackai/sqircle 0.1.1 → 0.1.2

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
@@ -64,7 +64,13 @@ const layers: SquircleLayerConfig[] = [
64
64
  {
65
65
  id: "top",
66
66
  offset: { y: 0 },
67
- base: { material: "solid", paletteId: "15", text: "GPU", dash: true },
67
+ base: {
68
+ material: "solid",
69
+ paletteId: "15",
70
+ effect: "fluid",
71
+ text: "GPU",
72
+ dash: true
73
+ },
68
74
  hover: { material: "wireframe", paletteId: "20" }
69
75
  }
70
76
  ];
@@ -116,6 +122,7 @@ Each layer has a required `base` variant and an optional `hover` variant. Hover
116
122
  | --- | --- | --- | --- |
117
123
  | `material` | `solid`, `transparent`, `wireframe` | `wireframe` | Prism rendering mode. |
118
124
  | `paletteId` | `13` through `20` | `15` | Palette from `SQUIRCLE_PALETTES`. |
125
+ | `effect` | `off`, `fluid`, `frosted` | `off` | Solid-material top-face effect. Ignored by transparent and wireframe materials. |
119
126
  | `text` | `string`, `boolean` | none | Render top-plane text. Pass a string such as `"GPU"` or `"{}"`; `true` is a compatibility shorthand for `"GPU"`. |
120
127
  | `dash` | `boolean` | `false` | Render the dashed inlay. |
121
128
  | `textStyle` | `solid`, `wireframe` | `solid` | Filled or outlined text. |
@@ -181,6 +188,16 @@ Each layer has a required `base` variant and an optional `hover` variant. Hover
181
188
  | `sideEdge` | Side-wall hairline stroke color. |
182
189
  | `swatch` | Two-color UI swatch. |
183
190
 
191
+ `effect: "off"` uses the normal static top gradient. `fluid` and `frosted` clip animated blurred color fields to the top face, with the color field authored in local squircle-plane coordinates and projected through the same isometric matrix as text. `frosted` adds a screen-space pale veil and brighter rim. Effect colors are derived from the selected alpha palette.
192
+
193
+ ## Surface Effects
194
+
195
+ Solid squircles can opt into animated top-surface effects with `effect: "fluid"` or `effect: "frosted"`. Both effects keep the prism geometry fixed: only the top face paint changes.
196
+
197
+ The color field is built in the flat squircle plane, blurred in that local coordinate system, and then projected onto the top face. The generated top polygon remains the screen-space clip path, while the frosted veil and rim stay screen-space overlays. This keeps the gradients reading as surface paint instead of flat circles floating above the prism.
198
+
199
+ Use [Rendering Contract](docs/design/rendering.md) for the exact ratios and SVG nesting rules before changing these effects.
200
+
184
201
  ## HTML Pages
185
202
 
186
203
  The root HTML files are intentionally thin shells. They mount React entrypoints from `src/pages`, and those pages render examples built on the package components.
@@ -229,4 +246,6 @@ Start at [Documentation Index](docs/README.md). The docs are split by purpose:
229
246
  - Keep hover swaps opacity-only: no transform, scale, filter, halo, or layer-gap changes.
230
247
  - Render top-plane text as one SVG text element on the projected top plane. Do not duplicate it for filled and wireframe states.
231
248
  - Keep variant colors synchronized with [Color System](docs/design/colors.md).
249
+ - Keep animated top effects clipped to the generated full-resolution top polygon; annotations still draw above the effect.
250
+ - Keep fluid/frosted color fields in local top-plane coordinates before projection; do not place their blobs directly in screen space.
232
251
  - Keep the body background transparent.
package/dist/index.d.ts CHANGED
@@ -2,7 +2,8 @@ export { SquircleScene } from "./SquircleScene";
2
2
  export { SquircleEditor, createDefaultSquircleEditorLayers } from "./SquircleEditor";
3
3
  export { createSquircleReactCode, toComponentName } from "./codeExport";
4
4
  export { DEFAULT_GEOMETRY, createSquircleGeometry, createSquircleLayers, reflowLayerOffsets } from "./geometry";
5
- export { DEFAULT_PALETTE_ID, SQUIRCLE_PALETTE_IDS, SQUIRCLE_PALETTES, getSquirclePalette } from "./palettes";
5
+ export { DEFAULT_PALETTE_ID, SQUIRCLE_PALETTE_IDS, SQUIRCLE_PALETTES, getSquirclePalette, isSquirclePaletteId } from "./palettes";
6
6
  export type { SquircleReactCodeOptions } from "./codeExport";
7
7
  export type { SquircleEditorProps } from "./SquircleEditor";
8
- export type { SquircleAnnotationColor, SquircleGeometryConfig, SquircleLayerConfig, SquircleMaterial, SquircleOpacityConfig, SquircleSceneProps, SquircleStrokeConfig, SquircleTextStyle, SquircleTheme, SquircleVariantConfig } from "./types";
8
+ export type { SquircleGradientStop, SquirclePalette, SquirclePaletteId } from "./palettes";
9
+ export type { SquircleAnnotationColor, SquircleEffect, SquircleGeometryConfig, SquircleLayerConfig, SquircleMaterial, SquircleOpacityConfig, SquircleSceneProps, SquircleStrokeConfig, SquircleTextStyle, SquircleTheme, SquircleVariantConfig } from "./types";
@@ -179,3 +179,4 @@ export type SquirclePaletteId = keyof typeof SQUIRCLE_PALETTES;
179
179
  export declare const SQUIRCLE_PALETTE_IDS: SquirclePaletteId[];
180
180
  export declare const DEFAULT_PALETTE_ID: SquirclePaletteId;
181
181
  export declare function getSquirclePalette(paletteId: string | undefined): SquirclePalette;
182
+ export declare function isSquirclePaletteId(paletteId: string | undefined): paletteId is SquirclePaletteId;