@vvedantb/ui 0.11.0 → 0.12.0
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 +4 -3
- package/package.json +1 -1
- package/src/icons/index.ts +1 -0
- package/src/icons/settings-icon.tsx +22 -3
- package/tokens/src/css/nav-icons.css +38 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Shared React 19 web UI. Source-exported: no build step.
|
|
|
4
4
|
|
|
5
5
|
| Import | What it is |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| `@vvedantb/ui` | The only JavaScript entry. Primitives (Radix-based), AI elements, audio (`playChime`, `useReplyChime`, `playTone`), `toast` and `SonnerToaster`, the composer (`InputArea`, deprecated 0.3 `Composer`), shell (`SidebarHeader`, `PillTabs`, `SessionsHoverCard`, and the app shell: `AppShell`, `AppSidebar`, `SidebarRail`, `RailTile`, `SidebarPanel`, `SidebarAccountMenu`, `SignOutDialog` and related helpers), app helpers (confirm skip, update watcher, settings chrome, `useStableAuth`, and from 0.8.0 `createThemeProvider`, `createPageTitleContext`, `PageMotionProvider` and `formatCompactRelativeTime`), marketing pieces from 0.9.0 (`createLandingKit` and the `Landing*` parts, `SiteFooter`, `PricingModal`), animated nav icons from 0.11.0 (`MemoryIcon`, `BoardIcon`, ... and `NavIconBase`), `cn`, and the native tokens `tokens` and `Tokens`. See `app/README.md` in the repository for the app helpers. |
|
|
7
|
+
| `@vvedantb/ui` | The only JavaScript entry. Primitives (Radix-based), AI elements, audio (`playChime`, `useReplyChime`, `playTone`), `toast` and `SonnerToaster`, the composer (`InputArea`, deprecated 0.3 `Composer`), shell (`SidebarHeader`, `PillTabs`, `SessionsHoverCard`, and the app shell: `AppShell`, `AppSidebar`, `SidebarRail`, `RailTile`, `SidebarPanel`, `SidebarAccountMenu`, `SignOutDialog` and related helpers), app helpers (confirm skip, update watcher, settings chrome, `useStableAuth`, and from 0.8.0 `createThemeProvider`, `createPageTitleContext`, `PageMotionProvider` and `formatCompactRelativeTime`), marketing pieces from 0.9.0 (`createLandingKit` and the `Landing*` parts, `SiteFooter`, `PricingModal`), animated nav icons from 0.11.0 (`MemoryIcon`, `BoardIcon`, ... and `NavIconBase`; `SettingsIcon` `variant` from 0.12.0), `cn`, and the native tokens `tokens` and `Tokens`. See `app/README.md` in the repository for the app helpers. |
|
|
8
8
|
| `@vvedantb/ui/tokens` | `tokens.css`: colour, radius, shadow, ease and font tokens for Tailwind v4. CSS. |
|
|
9
9
|
| `@vvedantb/ui/tokens/tokens.css` | Same file as `@vvedantb/ui/tokens`. CSS. |
|
|
10
10
|
| `@vvedantb/ui/tokens/css/*.css` | `index`, `base`, `dialog`, `modal`, `tabs`, `tabs-pills`, `utilities`, `scrollbar-thin`, `animations`, `nav-icons`, `compat-shadcn-rgb`. CSS. |
|
|
@@ -904,7 +904,7 @@ import { MemoryIcon, TerminalIcon } from "@vvedantb/ui";
|
|
|
904
904
|
| `FilesIcon` | Two stacked files; the back one slides | 1.7 | 1400 ms |
|
|
905
905
|
| `InboxIcon` | Tray; a letter drops in | 1.7 | 1300 ms |
|
|
906
906
|
| `BuildingIcon` | Building; windows blink | 1.7 | 1600 ms |
|
|
907
|
-
| `SettingsIcon` | Gear; spins | 1.7 | 2500 ms |
|
|
907
|
+
| `SettingsIcon` | Gear; spins. `variant="turn"`: clicks round a notch at a time | 1.7 (`turn`: 1.75) | 2500 ms (`turn`: 2400 ms) |
|
|
908
908
|
| `BoardIcon` | Three-column board; cards drop, one travels | 1.75 | 1800 ms |
|
|
909
909
|
| `ChecklistIcon` | Two checked tasks; checks redraw | 1.75 | 1600 ms |
|
|
910
910
|
| `TerminalIcon` | Terminal; prompt, typing, cursor. Has `active` | 1.75 | 1400 ms |
|
|
@@ -930,8 +930,9 @@ Props (type `IconProps`; all optional):
|
|
|
930
930
|
| `animate` | `"hover"` | `"hover"`: animate while a `.group` ancestor is hovered. `true`: always. `false`: never, and no hover scale. Sets `data-animate`. |
|
|
931
931
|
| `duration` | | Length in ms of the icon's longest loop (table). Sets `--vv-icon-duration-scale` to `duration / longest loop`; every duration and delay in the icon is multiplied by it, so staggers keep their proportions. |
|
|
932
932
|
| `active` | `false` | `TerminalIcon`, `InboxArrowIcon`, `AutomationIcon`: solid variant with cut-out details. Other icons: `data-active="true"` only. |
|
|
933
|
-
| `cutoutColor` | sidebar accent | Cut-out tone while `active` (`CutoutIconProps`). Default `var(--color-sidebar-accent, var(--sidebar-accent))`, so the solid icon suits a `bg-sidebar-accent` tile. |
|
|
933
|
+
| `cutoutColor` | sidebar accent | Cut-out tone while `active` (`CutoutIconProps`). Default `var(--color-sidebar-accent, var(--sidebar-accent))`, so the solid icon suits a `bg-sidebar-accent` tile. If neither variable holds a full colour (for example `--sidebar-accent` holds bare RGB channels such as `233 234 236` and there is no `--color-sidebar-accent`), the cut-outs lose their tone and vanish into the solid shape; pass the colour, e.g. `cutoutColor="rgb(var(--sidebar-accent))"`. |
|
|
934
934
|
| `collapsed` | `false` | `SidebarToggleIcon` only: chevron points out (`SidebarToggleIconProps`). |
|
|
935
|
+
| `variant` | `"spin"` | `SettingsIcon` only (`SettingsIconProps`, 0.12.0). `"spin"`: continuous linear spin, stroke 1.7, 1.15 spring hover scale. `"turn"`: a second gear drawing (hub first) that turns 60deg at a time with the emphasized ease over 2400 ms, stroke 1.75, 1.12 hover scale like the other 1.75-stroke icons. `duration` scales against the variant's own loop. |
|
|
935
936
|
|
|
936
937
|
Other SVG props (`id`, `data-*`, handlers, `ref`) go to the svg. On group hover the svg scales to 1.15 (the first six icons, spring ease) or 1.12 (the rest). `NavIconBase` is the shared svg wrapper, for icons drawn in the same style. The stylesheet has no reduced-motion override.
|
|
937
938
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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, native tokens), design-token CSS, shared Tailwind v4 CSS and a Tailwind preset.",
|
|
6
6
|
"type": "module",
|
package/src/icons/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { FilesIcon } from "./files-icon";
|
|
|
7
7
|
export { InboxIcon } from "./inbox-icon";
|
|
8
8
|
export { BuildingIcon } from "./building-icon";
|
|
9
9
|
export { SettingsIcon } from "./settings-icon";
|
|
10
|
+
export type { SettingsIconProps } from "./settings-icon";
|
|
10
11
|
export { BoardIcon } from "./board-icon";
|
|
11
12
|
export { ChecklistIcon } from "./checklist-icon";
|
|
12
13
|
export { TerminalIcon } from "./terminal-icon";
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { NavIconBase, type IconProps } from "./nav-icon-base";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export type SettingsIconProps = IconProps & {
|
|
4
|
+
/**
|
|
5
|
+
* `"spin"` (default): continuous 2.5s linear spin, stroke 1.7, springy 1.15 hover scale.
|
|
6
|
+
* `"turn"`: a gear drawn hub first that clicks round one tooth (60deg) at a time over 2.4s,
|
|
7
|
+
* stroke 1.75, eased 1.12 hover scale like the other 1.75-stroke icons.
|
|
8
|
+
*/
|
|
9
|
+
variant?: "spin" | "turn";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Gear that spins on hover, or turns one notch at a time with `variant="turn"`. */
|
|
13
|
+
export function SettingsIcon({ variant = "spin", strokeWidth, ...props }: SettingsIconProps) {
|
|
14
|
+
if (variant === "turn") {
|
|
15
|
+
return (
|
|
16
|
+
<NavIconBase {...props} strokeWidth={strokeWidth ?? 1.75} hoverScale="1.12" loop={2400}>
|
|
17
|
+
<g className="vv-icon-gear-turn">
|
|
18
|
+
<circle cx="12" cy="12" r="3" />
|
|
19
|
+
<path d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065" />
|
|
20
|
+
</g>
|
|
21
|
+
</NavIconBase>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
5
24
|
return (
|
|
6
|
-
<NavIconBase {...props} strokeWidth={strokeWidth} hoverScale="1.15" loop={2500}>
|
|
25
|
+
<NavIconBase {...props} strokeWidth={strokeWidth ?? 1.7} hoverScale="1.15" loop={2500}>
|
|
7
26
|
<g className="vv-icon-gear">
|
|
8
27
|
<path d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
|
|
9
28
|
<circle cx="12" cy="12" r="3" />
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
.vv-icon-bolt,
|
|
42
42
|
.vv-icon-inbox-letter,
|
|
43
43
|
.vv-icon-gear,
|
|
44
|
+
.vv-icon-gear-turn,
|
|
44
45
|
.vv-icon-memory-core,
|
|
45
46
|
.vv-icon-memory-ring,
|
|
46
47
|
.vv-icon-board-card,
|
|
@@ -210,7 +211,7 @@
|
|
|
210
211
|
animation: vv-icon-inbox-drop calc(1.3s * var(--vv-icon-duration-scale, 1)) ease-in-out infinite;
|
|
211
212
|
}
|
|
212
213
|
|
|
213
|
-
/* ── SettingsIcon: continuous spin */
|
|
214
|
+
/* ── SettingsIcon (default variant="spin"): continuous spin */
|
|
214
215
|
@keyframes vv-icon-gear-spin {
|
|
215
216
|
to {
|
|
216
217
|
transform: rotate(360deg);
|
|
@@ -221,6 +222,42 @@
|
|
|
221
222
|
animation: vv-icon-gear-spin calc(2.5s * var(--vv-icon-duration-scale, 1)) linear infinite;
|
|
222
223
|
}
|
|
223
224
|
|
|
225
|
+
/* ── SettingsIcon variant="turn": six-tooth gear clicks round one notch at a time */
|
|
226
|
+
@keyframes vv-icon-gear-turn {
|
|
227
|
+
0% {
|
|
228
|
+
transform: rotate(0deg);
|
|
229
|
+
}
|
|
230
|
+
10%,
|
|
231
|
+
16.66% {
|
|
232
|
+
transform: rotate(60deg);
|
|
233
|
+
}
|
|
234
|
+
26.66%,
|
|
235
|
+
33.33% {
|
|
236
|
+
transform: rotate(120deg);
|
|
237
|
+
}
|
|
238
|
+
43.33%,
|
|
239
|
+
50% {
|
|
240
|
+
transform: rotate(180deg);
|
|
241
|
+
}
|
|
242
|
+
60%,
|
|
243
|
+
66.66% {
|
|
244
|
+
transform: rotate(240deg);
|
|
245
|
+
}
|
|
246
|
+
76.66%,
|
|
247
|
+
83.33% {
|
|
248
|
+
transform: rotate(300deg);
|
|
249
|
+
}
|
|
250
|
+
93.33%,
|
|
251
|
+
100% {
|
|
252
|
+
transform: rotate(360deg);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
.group:hover .vv-icon[data-animate="hover"] .vv-icon-gear-turn,
|
|
256
|
+
.vv-icon[data-animate="true"] .vv-icon-gear-turn {
|
|
257
|
+
animation: vv-icon-gear-turn calc(2.4s * var(--vv-icon-duration-scale, 1))
|
|
258
|
+
var(--motion-ease-emphasized, cubic-bezier(0.2, 0.8, 0.2, 1)) infinite;
|
|
259
|
+
}
|
|
260
|
+
|
|
224
261
|
/* ── BoardIcon: cards drop in, bounce, then bob while a traveller card
|
|
225
262
|
* sweeps across all columns. */
|
|
226
263
|
@keyframes vv-icon-board-card-drop {
|