@vvedantb/ui 0.25.0 → 0.25.1

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
@@ -893,6 +893,15 @@ defaults to `currentColor`. `stroke` sets the stroke width in pixels for stroke
893
893
  glyphs (fill glyphs ignore it). `title` gives an accessible name. The ref goes
894
894
  to the `<svg>`.
895
895
 
896
+ `align?: "center" | "start"` (0.25.1, default `"center"`) sets where the glyph sits
897
+ in its equal-size square. `"start"` left-aligns the glyph's ink in the same square
898
+ (same scale, same `size` x `size` box), so labels line up in a vertical list.
899
+ `APP_MARK_VIEWBOX_START` holds the viewBoxes.
900
+
901
+ ```tsx
902
+ <IconVmem size={16} align="start" />
903
+ ```
904
+
896
905
  ### `AppMark` (deprecated)
897
906
 
898
907
  Deprecated in favour of the `Icon*` components for plain marks. Tiles stay here.
@@ -900,11 +909,11 @@ Family app icons: `app` (`projectv`, `vibot`, `vhub`, `vmem`, `verve`, `velth`),
900
909
  `variant`, `size`, `title`.
901
910
 
902
911
  - `variant="mark"` (default) is the plain logo in `currentColor`. It sits
903
- on a square viewBox. The five apps (`vibot`, `vhub`, `vmem`, `verve`, `velth`) share one
904
- crop (`APP_MARK_CROP_VIEWBOX`, `173 197 629 629`): the union of their glyph boxes on the
905
- 1024 tile grid, centred, with about 4% padding, so relative glyph sizes match the tiles and
906
- the widest glyph fills about 92% of the icon box. `projectv` is a brand mark, so it has its
907
- own tight square (`PROJECTV_MARK_VIEWBOX`, `172 181 687 687`). `size` sets both width and
912
+ on a square viewBox. The five apps (`vibot`, `vhub`, `vmem`, `verve`, `velth`) keep one
913
+ frame size, 629 x 629 (`APP_MARK_CROP_VIEWBOX` is the historical `173 197 629 629`), so relative
914
+ glyph sizes match the tiles. Each viewBox origin is centred on that glyph's `markBBox`, so no
915
+ glyph sits off-centre in its square. `projectv` is a brand mark, so it keeps its own 687 frame,
916
+ centred on its bbox (`PROJECTV_MARK_VIEWBOX`, `171.5 181 687 687`). `size` sets both width and
908
917
  height; a string `size` (for example `"2rem"`) is any CSS length. `APP_MARK_VIEWBOX` holds the
909
918
  viewBox for each app; `appMarkSvg()` and `APP_MARK_SVG` use it. `markAspect` returns
910
919
  1 and is kept for API stability only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/ui",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "license": "MIT",
5
5
  "description": "Shared React 19 UI for web apps: one JavaScript entry (primitives, shell pieces, app helpers including the Convex and Clerk provider, VITE env parsing and ensure-user, artifact viewers over the @vvedantb/server artifacts core, native tokens), design-token CSS, shared Tailwind v4 CSS and a Tailwind preset.",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, useId, type ForwardRefExoticComponent, type RefAttributes, type SVGProps } from "react";
2
- import { APP_MARKS, APP_MARK_VIEWBOX, APP_NAMES, markLinecap, markStrokeWidth, type AppName } from "./svg";
2
+ import { APP_MARKS, APP_MARK_VIEWBOX, APP_MARK_VIEWBOX_START, APP_NAMES, markLinecap, markStrokeWidth, type AppName } from "./svg";
3
3
 
4
4
  export type AppIconProps = Omit<SVGProps<SVGSVGElement>, "children" | "height" | "width" | "viewBox" | "stroke" | "color"> & {
5
5
  /** Rendered width and height (the glyph is square). Default 24. A number is in pixels; a string is any CSS length. */
@@ -10,6 +10,8 @@ export type AppIconProps = Omit<SVGProps<SVGSVGElement>, "children" | "height" |
10
10
  stroke?: number | string;
11
11
  /** Accessible name. Without it the icon is `aria-hidden`. */
12
12
  title?: string;
13
+ /** Where the glyph sits in its equal-size square. `"center"` (default) centres it. `"start"` left-aligns the glyph's ink in the same square, so labels line up in a vertical list. The rendered box stays `size` x `size`. */
14
+ align?: "center" | "start";
13
15
  };
14
16
 
15
17
  export type AppIconComponent = ForwardRefExoticComponent<AppIconProps & RefAttributes<SVGSVGElement>>;
@@ -20,7 +22,7 @@ function viewBoxSide(app: AppName): number {
20
22
 
21
23
  function createAppIcon(app: AppName, displayName: string): AppIconComponent {
22
24
  const Icon = forwardRef<SVGSVGElement, AppIconProps>(function Icon(
23
- { size = 24, color = "currentColor", stroke, title, ...rest },
25
+ { size = 24, color = "currentColor", stroke, title, align = "center", ...rest },
24
26
  ref,
25
27
  ) {
26
28
  const titleId = useId();
@@ -38,9 +40,10 @@ function createAppIcon(app: AppName, displayName: string): AppIconComponent {
38
40
  xmlns="http://www.w3.org/2000/svg"
39
41
  width={size}
40
42
  height={size}
41
- viewBox={APP_MARK_VIEWBOX[app]}
43
+ viewBox={align === "start" ? APP_MARK_VIEWBOX_START[app] : APP_MARK_VIEWBOX[app]}
42
44
  preserveAspectRatio="xMidYMid meet"
43
45
  data-app={app}
46
+ data-align={align}
44
47
  role={title ? "img" : undefined}
45
48
  aria-hidden={title ? undefined : true}
46
49
  aria-labelledby={title ? titleId : undefined}
@@ -5,6 +5,7 @@ export {
5
5
  APP_MARKS,
6
6
  APP_MARK_CROP_VIEWBOX,
7
7
  APP_MARK_VIEWBOX,
8
+ APP_MARK_VIEWBOX_START,
8
9
  PROJECTV_MARK_VIEWBOX,
9
10
  APP_MARK_SVG,
10
11
  APP_NAMES,
package/src/brand/svg.ts CHANGED
@@ -175,27 +175,46 @@ export function markBBox(app: AppName): Box {
175
175
 
176
176
 
177
177
  /**
178
- * Shared crop for the five app glyphs (`vibot`, `vhub`, `vmem`, `verve`, `velth`) in the plain logo (`variant="mark"`,
179
- * `appMarkSvg`, `Icon*`): the union of their `markBBox` results on the 1024 tile grid (x 186 to 789, y 259.96 to 761.7),
180
- * centred in a square of side max(width, height) x 1.04 (about 4% padding), then rounded outward to whole units.
181
- * `projectv` is left out so its wide brand mark does not shrink the app glyphs. Not the full tile. Checked in tests.
178
+ * Frame size for the five app glyphs (`vibot`, `vhub`, `vmem`, `verve`, `velth`) in the plain logo (`variant="mark"`,
179
+ * `appMarkSvg`, `Icon*`): a 629 x 629 square, the union of their `markBBox` results on the 1024 tile grid
180
+ * (x 186 to 789, y 259.96 to 761.7) at side max(width, height) x 1.04 (about 4% padding), rounded outward.
181
+ * All five use this side, so glyph scale stays equal. Only the size is shared: each app has its own origin in
182
+ * `APP_MARK_VIEWBOX`. `projectv` is left out so its wide brand mark does not shrink the app glyphs.
182
183
  */
183
184
  export const APP_MARK_CROP_VIEWBOX = "173 197 629 629";
184
185
 
185
186
  /**
186
- * Own tight square for `projectv` (a brand mark, not an app): `markBBox("projectv")` (x 172 to 858, y 377 to 672),
187
- * centred on the shorter axis and rounded outward to whole units, with no extra padding.
187
+ * `projectv` (a brand mark, not an app) keeps a 687 x 687 frame, centred on `markBBox("projectv")`
188
+ * (x 172 to 858, y 377 to 672, centre 515 x 524.5), with no extra padding.
188
189
  */
189
- export const PROJECTV_MARK_VIEWBOX = "172 181 687 687";
190
+ export const PROJECTV_MARK_VIEWBOX = "171.5 181 687 687";
190
191
 
191
- /** Plain-mark viewBox per app: the shared crop for the five apps, a tight square for `projectv`. Always square. */
192
+ /**
193
+ * Plain-mark viewBox per app. Always square. The five apps keep one 629 side (equal scale), and each origin is
194
+ * `markBBox(app)` centre minus 314.5 on both axes, so every glyph sits centred in its own frame. `projectv` uses
195
+ * its 687 frame, centre minus 343.5. Hardcoded; checked against `markBBox` in tests.
196
+ */
192
197
  export const APP_MARK_VIEWBOX: Record<AppName, string> = {
193
198
  projectv: PROJECTV_MARK_VIEWBOX,
194
- vibot: APP_MARK_CROP_VIEWBOX,
195
- vhub: APP_MARK_CROP_VIEWBOX,
196
- vmem: APP_MARK_CROP_VIEWBOX,
197
- verve: APP_MARK_CROP_VIEWBOX,
198
- velth: APP_MARK_CROP_VIEWBOX,
199
+ vibot: "227.5 198.5 629 629",
200
+ vhub: "162.5 197.5 629 629",
201
+ vmem: "197.24772201231343 196.33100022273135 629 629",
202
+ verve: "197.5 210.9 629 629",
203
+ velth: "197.5 202.45 629 629",
204
+ };
205
+
206
+ /**
207
+ * Start-aligned viewBox per app, for `Icon*` `align="start"`. Same side and same y as `APP_MARK_VIEWBOX`; x is
208
+ * `markBBox(app)` minX, so the glyph's left ink edge sits flush with the frame's left edge. Hardcoded; checked
209
+ * against `markBBox` in tests.
210
+ */
211
+ export const APP_MARK_VIEWBOX_START: Record<AppName, string> = {
212
+ projectv: "172 181 687 687",
213
+ vibot: "295 198.5 629 629",
214
+ vhub: "186 197.5 629 629",
215
+ vmem: "255.5301217210191 196.33100022273135 629 629",
216
+ verve: "260.4 210.9 629 629",
217
+ velth: "273.9433593555699 202.45 629 629",
199
218
  };
200
219
 
201
220
  /** Width over height of a mark's viewBox. Always about 1, because the viewBoxes are square. Kept for API stability; do not use it for sizing. */
@@ -11,9 +11,7 @@ export const V_PRO_APP_BENEFITS: readonly PricingPlanAppBenefit[] = [
11
11
  {
12
12
  app: "vibot",
13
13
  items: [
14
- "1000 messages / day",
15
- "100 image gens / day",
16
- "100 deep & 20 extreme searches / day",
14
+ "Higher AI limits/usage",
17
15
  "Smarter AI for chats, documents & sub-agents",
18
16
  ],
19
17
  },