65 Commits

Author SHA1 Message Date
Florian Schroedl
6fec58ef80 refactor: move scrollbar styles to global utilities
Apply thin subtle scrollbars globally via utilities.css instead of
only on .sidebar-content. Uses scrollbar-width/scrollbar-color for
Firefox and ::-webkit-scrollbar for Chrome/Safari. Removes the
now-redundant sidebar-specific scrollbar rules.
2026-03-30 09:05:07 +02:00
Florian Schroedl
293df10590 feat: add tasks list recipe and small badge size variant
Add a shadcn-inspired tasks list recipe (src/recipes/tasks.cljc) that
composes card, table, badge, button, form, and icon components into a
full task management page with toolbar, data table, and pagination.

Add :size :sm prop to the badge component for compact inline labels
used in the tasks table. Small badges have tighter padding, smaller
font, and full pill border-radius.

Wire the tasks page into all three dev targets (hiccup, replicant,
squint) with navigation and routing. Add small badge demos to the
components overview in all targets.
2026-03-30 09:05:07 +02:00
Florian Schroedl
63e853b6ac style: spacing 2026-03-29 20:09:55 +02:00
Florian Schroedl
b9406cc024 style: spacing 2026-03-29 20:02:07 +02:00
Florian Schroedl
fd4eb8415b chore: add .editorconfig with 2-space indentation 2026-03-29 19:54:41 +02:00
Florian Schroedl
5449d3c0f3 feat(dialog): add overlay-based dialog pattern (dialog-overlay + dialog-panel)
For reactive frameworks (Eucalypt, etc.) where native <dialog> with
.showModal() isn't practical. dialog-overlay provides the fixed backdrop,
dialog-panel provides the content box with padding/gap/animation.

Shared inner styles (dialog-header, dialog-body, dialog-footer) work
with both native <dialog> and overlay-based patterns.
2026-03-29 13:21:19 +02:00
Florian Schroedl
5994f1d1da fix(calendar-events): remove border-radius from event pills 2026-03-29 12:23:08 +02:00
Florian Schroedl
7f1a679b74 Revert "feat(calendar-events): add view toggle, source filters, detail dialog, error banner, loading indicator"
This reverts commit d8e280df2a.
2026-03-29 11:20:55 +02:00
Florian Schroedl
d8e280df2a feat(calendar-events): add view toggle, source filters, detail dialog, error banner, loading indicator
New stateless components ported from org-mode-agenda-cli reference app:
- view-toggle: Grid/Agenda segmented control
- source-toggles: colored pill buttons for event source filtering
- event-detail-dialog: overlay with title, date, time, tags, source
- error-banner: dismissible error bar
- loading-indicator: pulsing dot for async state

Enhanced existing components:
- calendar-event-grid: added :loading?, :header-actions slots
- agenda-day-group/agenda-list: added :day-actions slot per day header
- Event data format extended with :tags and :source fields

CSS: view toggle, loading pulse animation, error banner, source toggles,
detail dialog overlay — all using theme tokens with dark mode support.

Tests: 126 tests, 794 assertions, 0 failures.
Dev demos updated in all 3 targets with full interactive calendar app.
2026-03-29 11:17:24 +02:00
Florian Schroedl
d6d205cb3b feat: add calendar docs with inline markdown rendering
Add src/ui/calendar.md with full documentation for both calendar
namespaces (picker props, event grid, ticker, agenda, event data
format, date utilities, CSS classes).

Add a minimal markdown-to-hiccup renderer (ui.markdown) that handles
headings, fenced code blocks, tables, lists, inline code, and bold.
Styled with ui/markdown.css using theme tokens.

Each dev target renders the docs inline on the Calendar page:
- Hiccup: slurps the .md file at render time
- Replicant: embeds via compile-time macro (ui.macros/inline-file)
- Squint: fetches from /calendar.md served by Vite

Also fixes calendar event grid day cells to be square (aspect-ratio: 1
with overflow: hidden instead of min-height).
2026-03-29 09:59:31 +02:00
Florian Schroedl
25f868fb69 feat: add calendar widget components
Add date picker and event calendar components inspired by shadcn/radix
Calendar and org-mode-agenda-cli.

Components:
- ui.calendar: Month grid date picker with navigation, today/selected
  highlighting, outside-month dimming. Pure date math utilities
  (days-in-month, day-of-week, calendar-days, etc.)
- ui.calendar-events: Event-aware grid with colored pills, horizontal
  day ticker strip with dot indicators, and agenda list view with
  grouped events by day

CSS: Token-based styling with dark mode support for event color
variants (accent/danger/success/warning). Responsive breakpoints.

All three targets supported (squint/cljs/clj). Dev pages show calendar
on its own page with interactive demos (date selection, month nav,
event grid, ticker, agenda list).

Tests: 27 new assertions covering date math, class generation,
component structure, event filtering/sorting.
2026-03-29 09:42:29 +02:00
Florian Schroedl
d4f21f80a5 feat(hiccup): add live reload via file watcher + browser polling
The hiccup dev server now auto-reloads when source files change:
- Background thread polls src/ and dev/hiccup/src/ every 500ms
- On change, reloads dev.hiccup namespace and all transitive deps
- Injects a polling script that hits /dev/changes and reloads the
  browser when the version counter bumps
- Server uses #'handler (var ref) so httpkit picks up redefined fns

No more manual server restarts needed for hiccup development.
2026-03-23 10:19:40 +01:00
Florian Schroedl
93edebf144 feat: add icon support to button, alert, badge, and form input
Button:
- :icon-left, :icon-right props for buttons with leading/trailing icons
- :icon prop for icon-only buttons (square padding via .btn-icon class)
- Icon size scales with button size (sm→sm, md/lg→sm/md)

Alert:
- Auto-assigns variant-specific icons (circle-check, alert-triangle,
  alert-circle, info) per variant
- :icon-name prop to override default, false to suppress
- Layout restructured with .alert-icon + .alert-content wrapper

Badge:
- :icon-name prop adds a leading icon before text
- .badge-icon CSS scales icon to match badge font size

Form input:
- :icon-left and :icon-right props on form-input
- Wraps input in .form-input-wrap with absolutely-positioned icon spans
- Padding adjusts automatically via .form-input--icon-left/right

All three dev targets (hiccup, replicant, squint) updated with demos.
2026-03-23 10:19:14 +01:00
Florian Schroedl
e3132a3cb4 chore: gitignore copied dev assets in replicant/public
Untrack theme-adapter.js and ignore all three files copied by
`bb build-theme` (theme.css, theme-adapter.js, css-live-reload.js).
These are generated artifacts, not source files.
2026-03-11 18:56:14 +01:00
Florian Schroedl
e305109324 fix(form): increase form-field gap from size-1 to size-2
The tighter size-1 gap left too little space between the label and input.
2026-03-11 18:51:10 +01:00
Florian Schroedl
9d5db65746 feat: add CSS live reload for dev setup
Two-part solution for automatic CSS updates during development:

1. `bb watch-theme` — polls src/ui/*.css and tokens.edn every 500ms,
   rebuilds dist/theme.css and copies to dev targets on change.

2. `dev/css-live-reload.js` — browser-side script that polls /theme.css
   and hot-swaps the stylesheet without a full page reload (no FOUC).

The watcher runs automatically in the hiccup tmux pane when using
`bb dev-all`. It can also be run standalone with `bb watch-theme`.

The live-reload script is included in all three dev targets (hiccup,
replicant, squint) and copied by `bb build-theme`.
2026-03-11 18:46:20 +01:00
Florian Schroedl
e9e0b15e16 feat: add separator component
Horizontal and vertical separator (divider) with CSS classes, ARIA
role="none", and data-orientation attribute. Includes dark mode support,
unit tests, and demos in all three dev targets.
2026-03-11 18:38:20 +01:00
Florian Schroedl
660723179c feat(theme-adapter): add font scale and border radius controls
Add interactive sliders for font base size, font ratio, and border
radius scale to the theme adapter panel. Font values follow the
geometric scale (base × ratio^power) matching the EDN token system.
Radius values scale the base px values by a 0–2× multiplier.

Includes apply/reset logic, localStorage persistence, EDN export,
and dirty-state detection for the new parameters.
2026-03-11 18:35:22 +01:00
Florian Schroedl
64bf5e029c feat(card): add card-list component with full and inset dividers
Adds `card-list` and `card-list-item` to the card module for rendering
a list of items inside a single card background with border separators.

The `:divider` prop controls separator style:
- `:full` (default) — borders go edge-to-edge
- `:inset` — borders are inset from edges by `--size-4`h
2026-03-11 18:29:39 +01:00
Florian Schroedl
e356bc2e6a fix(form): remove left border-radius from buttons inside form-group
The `.form-group` CSS reset `border-radius: 0` only for `.form-input`
and `.form-select`, leaving `.btn` elements with their default radius
on all sides. This caused buttons inside input groups to have rounded
left corners instead of flush edges against adjacent inputs.
2026-03-11 17:09:18 +01:00
Florian Schroedl
051d79d65d feat(dev): add border radius scale control to theme adapter panel
Adds a "Radius" section with a Scale slider (0–200%) that
proportionally scales all three radius tokens (sm/md/lg).
At 0% corners are sharp, at 100% they match defaults (6/10/16px),
at 200% they're doubled. Persists in localStorage, resets with
Reset, and is included in the Copy EDN output.
2026-03-11 17:06:21 +01:00
Florian Schroedl
705c4fbfc8 feat(dev): add font base and ratio controls to theme adapter panel
Adds a "Font" section with two sliders:
- Base (0.75–1.25 rem) — the root font size
- Ratio (1.05–1.50) — the geometric scale factor

Live-updates all --font-{xs,sm,base,md,lg,xl,2xl,3xl} variables.
Persists in localStorage, resets with Reset, and is included in
the Copy EDN output.
2026-03-11 17:04:24 +01:00
Florian Schroedl
bfc6cf4c53 feat(dev): add spacing base step control to theme adapter panel
Adds a "Spacing" section with a Base slider (0.10–0.50 rem) that
live-updates all --size-1 through --size-16 CSS variables. The value
persists in localStorage, resets with the Reset button, and is
included in the Copy EDN output.
2026-03-11 17:02:05 +01:00
Florian Schroedl
a7a57f6f5f docs: add git submodule installation and usage instructions
README gets a full Installation section with per-target setup
(Babashka, shadow-cljs, Squint) plus CSS linking and updating.
AGENTS.md gets a compact summary for agent context.
2026-03-11 16:57:37 +01:00
Florian Schroedl
e01cb075c6 style: change button and badge font-weight to semi-bold (600) 2026-03-11 16:55:18 +01:00
Florian Schroedl
9f3ebe453f refactor(dev): dogfood framework CSS in theme adapter panel
Replace all inline styles in theme-adapter.js with framework classes.
The panel now uses its own tokens (var(--bg-1), var(--fg-0), etc.) so
it visually adapts when you change theme colors — true dogfooding.

New framework components added to fill gaps:
- popover.css — fixed-position floating panel (.popover, .popover-br)
- chip.css + chip.cljc — selectable preset buttons (.chip, .chip-active)
- swatch.css — color preview strips (.swatch-row, .swatch)
- button.css — icon-only buttons (.btn-icon, .btn-icon-round)
- card.css — sectioned card variant (.card-flush, .card-section)
- utilities.css — text/flex helpers (.text-xs, .font-semibold, .flex-1, etc.)

Theme adapter JS shrunk from 340 to 250 lines by removing the 60-line
inline style object and applyStyle() helper.
2026-03-11 16:53:08 +01:00
Florian Schroedl
59d46700bc refactor(theme): switch color generation from HSL to OKLCH
OKLCH is a perceptually uniform color space — equal lightness values
produce equal perceived brightness across all hues, unlike HSL where
blue at 50% looks much darker than yellow at 50%.

Color scales now output oklch() CSS values directly:
  --gray-500: oklch(0.530 0.035 285);
  --accent-500: oklch(0.595 0.230 286);

The browser handles gamut mapping natively. Scale definitions in
tokens.edn use [label lightness chroma] tuples where L is 0-1
perceptual lightness, C is chroma (colorfulness), H is hue degrees.

Theme adapter updated: sliders now control OKLCH hue/chroma,
swatches render with oklch() CSS, Copy EDN outputs OKLCH config.

gen.clj includes oklch->srgb and oklch->hex for validation/tools.
2026-03-11 12:04:33 +01:00
Florian Schroedl
41811dba88 feat(dev): add live theme adapter panel for color customization
Floating panel in bottom-right of all dev targets lets you:
- Switch presets (Purple, Blue, Neutral, Warm, Rose, Emerald)
- Adjust gray hue/saturation and accent hue/saturation with sliders
- Preview color swatches in real-time
- Copy EDN config to paste into tokens.edn

State persists in localStorage. Panel collapses to a small toggle button.
Hiccup handler changed to use #'handler var for hot-reload.
2026-03-11 11:51:59 +01:00
Florian Schroedl
07f18872cf docs: add README with color system documentation 2026-03-11 11:35:10 +01:00
Florian Schroedl
fa38d9f9c3 feat(theme): add HSL-based color scale generation with jon/color-tools
Replace hardcoded hex color tokens with algorithmic color scales generated
from HSL parameters. Each scale is defined by hue, saturation, and
lightness steps in tokens.edn, then converted to hex via jon/color-tools.

Color scales (gray, accent, danger, success, warning) generate 11 stops
each (50–950) into :root. Semantic tokens (bg-0, fg-0, accent, etc.)
reference scale variables with var(--gray-50), var(--accent-500), etc.
Dark theme switches which stop each semantic token points to.

Gray scale uses hue 240 with tapered saturation for a purplish tint
matching the activity-tracker aesthetic. Accent is vivid purple (hue 252).
Border radii bumped to 6/10/16px for a rounder feel.

To shift the entire palette (e.g. warm gray), change hue/saturation in
tokens.edn and run `bb build-theme`.
2026-03-11 11:31:47 +01:00
Florian Schroedl
13508f4654 fix: improve CSS layout with box-sizing reset, responsive alerts, and form spacing
- Add universal box-sizing: border-box reset to base styles
- Make alert component responsive with container queries (flex-wrap,
  full-width title/body at narrow widths)
- Increase form legend margin-bottom from --size-1 to --size-3
2026-03-11 11:09:47 +01:00
Florian Schroedl
828d467226 chore: add bb check-dev script for pre-commit server verification
Babashka script that checks all ui-dev tmux panes for compile errors,
verifies hiccup serves content, ensures squint .mjs files aren't
truncated, and confirms replicant JS is compiled. Replaces the manual
tmux capture-pane + curl checks documented in AGENTS.md.
2026-03-05 19:20:27 +01:00
Florian Schroedl
4f42dce649 refactor: use #shadow/env for replicant dev-http port instead of rewriting config
Replace the pattern of reading shadow-cljs.edn, mutating it with
pr-str (which destroyed formatting), and writing it back. Instead,
use shadow-cljs's built-in `#shadow/env` reader tag to read the port
from the SHADOW_HTTP_PORT environment variable at startup, with a
default of 3001.

Both `dev-replicant` and `dev-all` tasks now pass the port via env var
instead of file mutation. This eliminates the dirty-file problem where
the rewritten single-line config would show up as an unrelated change.
2026-03-05 14:43:29 +01:00
Florian Schroedl
e003e1c4a8 docs: add agent rules for dev server management and browser verification
- Section 6: Never start dev servers from the agent (prevents orphan
  processes and broken tmux panes)
- Section 7: Check tmux panes for compile errors (renumbered)
- Section 8: Verify compiled output in browser before committing
  (catches squint's silent empty-file failures)
2026-03-05 14:30:01 +01:00
Florian Schroedl
2500cc4b1a docs: document squint watcher blank page pitfall and recovery
The squint watcher can produce truncated .mjs files when it detects
file changes mid-save, causing Vite to serve a broken module and the
browser page to go blank with no terminal errors. Document how to
detect this (check .mjs line count) and recover (touch source file +
hard refresh, or restart the tmux pane).
2026-03-05 14:12:36 +01:00
Florian Schroedl
b52361ebf1 refactor(form): replace inline error text with tooltip icon
Instead of rendering error messages as `<small class="form-error">`
below inputs, errors now display as a circle-x icon inside the input
area. Hovering the icon shows the error text in a danger-styled tooltip.

- Wrap children in `.form-field-control` when error is present
- Use existing tooltip + icon components for the error indicator
- Add CSS for positioning, padding-right offset, and danger color overrides
- Update tests to match new structure
- Add pre-commit tmux server check instructions to AGENTS.md
2026-03-05 14:01:26 +01:00
Florian Schroedl
d5473b1bbf chore: ignore .claude and .vite generated files in .gitignore 2026-03-05 13:42:46 +01:00
Florian Schroedl
3976bac7c9 chore: rename "UI Framework" to "Clojure UI Framework" across dev targets
Update sidebar brand title and page title in all three dev targets
(hiccup, replicant, squint) and the index shell.
2026-03-05 13:33:50 +01:00
Florian Schroedl
5d4eceab95 fix(form): add spacing between inline fieldset legend and radio buttons
<legend> elements have special rendering behavior inside <fieldset>
that doesn't participate properly in flexbox gap. Change
margin-bottom from 0 to var(--size-1) on .form-fieldset--inline
.form-legend to add visible spacing.
2026-03-05 13:32:52 +01:00
Florian Schroedl
d2395fda44 feat: persist theme across dev targets via ?theme= query param
Each target reads the theme from ?theme=dark|light on load and applies
it to data-theme before first paint. A MutationObserver syncs theme
changes back to the URL via replaceState, and a click handler appends
?theme= to cross-port navigation links automatically.

The outer iframe shell (dev/index.html) uses postMessage to track theme
changes from iframes and passes the param when switching tabs.

For hiccup, the server also reads ?theme= and sets data-theme on the
<html> element server-side to prevent any flash of wrong theme.
2026-03-05 13:29:01 +01:00
Florian Schroedl
6a1e185877 fix(button): remove color override on anchor buttons
`a.btn` had `color: inherit` which overrode variant-specific colors
(e.g. `--fg-on-accent` on `.btn-primary`) due to higher specificity
(element+class > class). This caused black text on primary link buttons
in light mode. Let variant classes control text color instead.
2026-03-05 13:24:41 +01:00
Florian Schroedl
7ef565e271 fix(squint): use removeAttribute instead of js-delete for theme toggle
js-delete inside an anonymous function produces `return return delete`
in squint output, causing a syntax error that breaks the entire app.
2026-03-05 13:19:57 +01:00
Florian Schroedl
425d00529e fix: disable CSS transitions during dark/light theme toggle
Add a `[data-no-transitions]` CSS rule that suppresses all transitions.
The theme toggle in all three dev targets (hiccup, replicant, squint)
sets this attribute before switching, then removes it on the next
animation frame, preventing the jarring animated color shift.
2026-03-05 13:16:07 +01:00
Florian Schroedl
cd49da661d feat: dogfood sidebar as app shell with multi-page nav and target switcher
Restructures all three dev targets (hiccup, replicant, squint) to use
the sidebar component as the actual app shell. The sidebar navigates
between three pages:

- Components — all UI component demos
- Icons — categorized gallery with all 50+ icons and size variants
- Sidebar — embedded sidebar example with dashboard layout

The sidebar includes a Targets section that links between all three dev
servers, with ports derived dynamically from the current port so they
stay correct when using a custom base port (bb dev-all 5000).

Port scheme: replicant=base+1, squint=base+2, hiccup=base+3.
2026-03-05 13:14:07 +01:00
Florian Schroedl
c857954845 feat: add icon component with 50+ Lucide-based SVG icons
Adds a general-purpose icon system (ui.icon) with inline SVG rendering:
- 50+ icons from the Lucide icon set (navigation, actions, objects, UI,
  status, dev/technical categories)
- Size variants: sm (--size-4), md (--size-5), lg (--size-6), xl (--size-8)
- Pure data approach: icon paths stored as hiccup vectors, rendered into
  SVG with stroke="currentColor" so icons inherit text color
- API: (icon/icon {:icon-name :home :size :lg :class "custom"})

Integrates icons into the sidebar component:
- sidebar-menu-item now accepts :icon-name prop
- Renders icon in a .sidebar-menu-item-icon wrapper at :sm size

All three dev targets updated with icon gallery demo and sidebar icons.
2026-03-05 12:49:22 +01:00
Florian Schroedl
e3787363d2 feat: add focus-visible rings and refactor accordion chevron
Add global :focus-visible outline style and migrate form components
from :focus box-shadow to :focus-visible outline. Refactor accordion
chevron from CSS ::after pseudo-element to explicit span element.
2026-03-05 11:34:07 +01:00
Florian Schroedl
aa3370565f fix: squint dev server running from wrong directory
The `bash -c 'cd dir && cmd1 & cmd2'` pattern splits into two
command lists — cmd2 runs in the original cwd, not after the cd.
Fix by repeating the cd after the `&` in the tmux pane command,
and using `exec` in the standalone dev-squint task.
2026-03-05 09:42:01 +01:00
Florian Schroedl
ce39804f1f feat: add configurable base port to dev-all
`bb dev-all 4000` starts all servers offset from base port:
  - Replicant: base+1 (4001)
  - Squint:    base+2 (4002)
  - Hiccup:    base+3 (4003)

Default base port remains 3000.

Individual tasks also accept PORT env var:
  PORT=4003 bb dev-hiccup

For replicant, shadow-cljs.edn is rewritten with the target port
before launching since shadow-cljs has no CLI port override.
2026-03-05 09:37:00 +01:00
Florian Schroedl
10647ac58b fix(replicant): replace external :paths with :local/root dependency
Shadow-cljs deprecated external paths (`../../src`). Add a root
`deps.edn` exposing `src/` and reference it via `:local/root` from
`dev/replicant/deps.edn` instead.
2026-03-05 09:28:22 +01:00
Florian Schroedl
d7ca825566 fix: auto-install node_modules in dev-all and dev-replicant/squint
Add `ensure-npm` task that runs `npm install` in dev/replicant and
dev/squint when their node_modules directories are missing. Wire it
as a dependency for dev-replicant, dev-squint, and dev-all.
2026-03-05 09:27:31 +01:00