Commit Graph

13 Commits

Author SHA1 Message Date
Amiram_se 297f0b2cbd feat(island): focusable choice cards and file fields, state skeleton, timed toasts
- ChoiceCard and FileField forward a ref to their real input, so a form can move focus to the first empty card or upload box.
- SkeletonPreset gains a `state` preset (art, heading, line, action).
- Every toast closes by itself: errors after 8 s (10 with an action), others after 4 s (6 with an action).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:47:18 +04:00
Amiram_se cfa8cce1b0 refactor: code review 2026-10-06 17:12:50 +04:00
Amiram_se 9216bc8177 feat(island,tools): form pieces for the profile step
- Atoms: Chip (toggle with aria-pressed), Checkbox, FieldError (alert line
  under a group), LinkButton (a button that looks like a link; SupportLink now
  uses it), RowButton (56px choice row for sheets), and a 96px Avatar size.
- Molecules: ChipGroup (named fieldset of chips with its error), FormSection
  (titled form part with an optional marker and hint), AvatarField (photo
  pick, change, remove, upload progress, failed state with retry).
- Dialog, Sheet and Modal take `onExited`, called once the dialog has left
  the top layer. The page is inert until then, so focus moves there.
- tools/format: `time()` for a time of day in Tehran (`14:05`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:32:43 +04:00
Amiram_se 025c68dd0d feat(island): file field, form skeleton, toast details and link start icon
- FileField molecule: one file for a form, with a picker box, thumbnail,
  name, size, remove button, inline error and upload progress.
- SkeletonPreset gains a `form` preset (heading, n fields, button, link).
- Toast takes a second `description` line; showToast takes a stable `id`,
  so a repeated failure replaces its toast instead of stacking.
- Link takes a leading `iconStart`, such as edit before «ویرایش شماره».

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:06:42 +04:00
Amiram_se 86944adb97 feat(island,apps): serve fonts and icon sprite under fixed names
Replace the hashing asset plugin with two build-time plugins that never
rename their files, so an unchanged font or sprite stays in every
visitor's cache across deploys (0011, 0012):

- icon-sprite-plugin builds icons/*.svg with svgo into
  public/icons/symbol-defs.svg. The Icon atom links it as
  symbol-defs.svg?v=<ICON_SPRITE_VERSION>; the file's first line stamps
  its version, so dev warns when the sprite changes without a bump.
- font-copy-plugin copies island fonts/ byte for byte into public/fonts/
  and warns when a font changes under its old name.
- island fonts.css declares both Yekan Bakh faces with root paths and a
  fallback face; theme.css points font-sans and font-latin at them.
- Root layouts preload CRITICAL_FONT_URL. next/font is gone.
- Both apps serve /fonts and /icons as immutable.
- island env, the apps' island-env bootstrap, NEXT_PUBLIC_ISLAND_* and
  NEXT_PUBLIC_CDN_ORIGIN are removed; paths live in island constants.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:00:46 +04:00
Amiram_se 0bee35290d refactor(island): move dialog to atoms, modal and sheet to molecules
Imports and the root index follow the new paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:00:28 +04:00
Amiram_se bbf84069c9 feat(island,apps): island asset plugin writes hashed fonts and icon sprite
Add withIslandAssets (island tools/asset-plugin) per ADR 0008. On next dev
and next build it builds the svgo sprite from src/icons and copies the
Yekan Bakh fonts into the app's public/ under content-hashed names, puts
their paths in env (NEXT_PUBLIC_ISLAND_*) and serves them with an
immutable Cache-Control. Files are written in headers(), which only Next
calls, because Nx's next plugin also evaluates the config from the
workspace root.

- island env (setEnv/getEnv); Icon reads the sprite path from it
- icon-sprite-plugin becomes icon-name-extraction (IconName type only);
  the committed sprite.svg is removed
- bull and bear register the plugin, validate the paths, pass them to
  island through their bootstraps, and add an optional CDN origin for fonts
- gitignore the generated files; Nx build outputs include them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:58:56 +04:00
Amiram_se cd082e5ed9 feat(libs,island): carry API error details and let fallbacks focus their heading
- HttpError keeps the server's structured `details` (set by mapErrorBody), so
  callers can read a changed price or a frozen unfollow
- ErrorState and StateMessage accept a headingRef; page fallbacks move focus to it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 21:33:07 +04:00
Amiram_se d68ae9d0a4 feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset

Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP

Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
  panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
  ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
  the spinner keeps turning under reduced motion

Adds sonner and svgo; island gets the icons target and the hooks subpath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:23:59 +04:00
Amiram_se 368c49ce67 feat(tools): align format helpers with the Lumina design system
- number/signed/signedPercent no longer print −0 or a sign for values that round to zero
- price guards null/NaN, caps at 6 decimals and avoids exponent notation
- date uses the fixed «، ساعت» joiner; relative says «همین الان» under a minute
- sheba groups as banks print it with or without the IR prefix
- add duration() and horizon(); export clock from the package root

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:23:59 +04:00
Amiram_se 5e35fbd6f2 feat: libs, tools 2026-10-02 19:42:11 +04:00
Amiram_se 486f86fcea fix: gitignore 2026-10-02 19:30:30 +04:00
Amiram_se 7dde8dd6f8 feat: scaffold 2026-10-02 18:19:11 +04:00