ui-ux-hardening #14

Open
kens wants to merge 0 commits from ui-ux-hardening into main
Collaborator
No description provided.
kens added 54 commits 2026-10-07 10:29:26 +00:00
--color-base-400 lived in a static @theme block, so no daisyUI theme could
override it: daisyUI only emits base-100/200/300. Every surface using it
stayed white regardless of theme, with near-white base-content on top.

base-100 is what these surfaces always meant — the library already agreed
with itself, since all three real dropdown panels (Phone, DataSelect,
NavMenuList) overrode back to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
--color-gray-200 is a Tailwind palette default and identical on every
theme, so a bare `border` was nearly invisible on light surfaces and
glaring on dark ones. base-300 tracks the active theme.

DataSelect's listbox relied on that default, so it gets the token
explicitly instead of inheriting it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bg-error's readable foreground is error-content; white only happened to
work because every theme so far had a dark error colour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The selector matched only consumers whose dark theme is literally named
'dark', so it never fired for dpl-dark and silently did nothing. slate-*
is also outside the semantic palette.

text-secondary on the base rule already covers hover; a muted variant
should use base-content/60, which resolves on every theme.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bg-red-100 was a leftover, dormant only because no component renders a
tfoot yet. The tfoot tr th rule below already gives the footer its
base-100 surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Besides painting a panel red, the selector could never match:
.dropdown-content is a child of .dropdown, not a sibling, so '~' has
nothing to select.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
It referenced appState, apiPUT and ApiRoute, none of which exist in
src/lib, and imported toast from 'kuku-ui' — the library importing itself
by package name. It shipped in the tarball and was scanned by @source
despite never being exportable.

Finishing it would mean inventing a public API for auth state, API
transport and settings persistence: consumer concerns, not library ones.
It also set data-theme unconditionally, which pins the theme and breaks
OS dark mode, since daisyUI keys prefers-color-scheme off
:root:not([data-theme]).

Navbar and NavMenuList are kept: both compile, are self-contained, and
Navbar has a story. Only the dangling NavbarUser references are removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The prop was destructured and discarded while the attribute was pinned to
"off", so a consumer's login form could not hint username or
current-password to a password manager.

Widened to boolean | string additively: the existing false default still
resolves to 'off', so no consumer changes behaviour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
'../**' resolves to src/ from this file, so Tailwind also scanned
src/routes and src/stories. Both ship in the tarball but neither is
reachable through package.json exports, so every consumer was emitting
demo- and story-only utilities into production CSS.

Verified against an isolated build (tailwindcss source(none) + base.css):
all twelve sm:col-span-* classes from getColSpanClass are still generated,
while grid-cols-3/grid-cols-4/gap-4/p-3 — story-only — are gone. Output
dropped 164,783 to 158,480 bytes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A floating panel's only separator is its shadow, so consumers running
--depth: 0 got no boundary at all, and a black shadow is invisible on a
dark base-100.

.dropdown .dropdown-content and NavMenuList's submenu now carry
border-base-300, matching what Phone, DataSelect and Textbox already did.
Shadows in Form's sticky legend and Navbar's scrolled state are mixed from
base-content instead of black, so they track the theme — the same
color-mix approach the disabled-field rules already use.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Minor rather than patch: the global default border colour and the new
panel borders change appearance for every consumer, which is more than a
bug-fix bump even though each change is a correctness fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
daisyui 5.7.0 -> 5.7.19, storybook and its addons 10.5.4 -> 10.5.10.

@chromatic-com/storybook 4.1.3 -> 5.3.0 is a major, taken deliberately:
v4 declares peer support only up to storybook ^10.3.0-0 while this project
is on 10.5, so the previous pairing was already out of range.

tailwindcss's devDependency range moves ^4.1.17 -> ^4.3.3 to match the
@tailwindcss/* siblings and what npm was already resolving.

peerDependencies are left alone on purpose — nothing here needs daisyUI
5.7 or Tailwind 4.3 specifically, so narrowing the ranges would only lock
consumers out of older-but-working versions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
prettier-plugin-tailwindcss orders classes from the installed daisyUI
registry, which now sorts 'menu' before 'dropdown-content' and 'tooltip'
before its modifiers. Attribute order carries no specificity, so this is
formatting only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The legend sat inside the tooltip span, so the error tooltip anchored to
the label as well as the options. Options now sit in a wrapping flex row
with a field-height minimum so they align with neighbouring inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tailwind 4.3 added a tab utility that clashes with daisyUI's .tab until
daisyUI 5.6.5, so the old peer floor (daisyUI 5.5.5 / Tailwind 4.1.17)
let consumers install a broken pair.

@tailwindcss/forms in its default mode restyles every field and fights
daisyUI; daisyUI's FAQ recommends the class strategy. Verified on
Tailwind 4.3.3: no forms base rules are emitted and bare inputs inside
.input wrappers lose the stray border/padding. README documents both.

Checklist: record that daisyUI 5.7 lives in a sub-layer of utilities,
which changes how base.css overrides must be layered, and log the first
Form Components page findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daisyUI 5.7 emits components into a sub-layer of utilities, so the
overrides now live in a sibling 'kuku' sub-layer ordered after it: they
beat daisyUI, and any utility class a consumer adds still beats them.
Previously several rules were unlayered and beat every consumer class.

Diffing computed styles against stock daisyUI 5.7 (light and dark)
showed most overrides were no-ops or harmful, so they are gone: field
background and ghost-at-rest, disabled border/background, the
checkbox/radio reset (broke checked radio-primary), the forms focus
guard, global .dropdown-content (lowered z-index 999 -> 20), .menu
active colour, .join pill ends, the link underline removal, and the
fieldset-legend override. Dead utilities (link-icon, link-hover,
filter-*, breadcrumbs) are deleted.

Table styles move to an opt-in data-table utility used by DataTable, so
consumers' own .table is stock daisyUI. link-nav sets no-underline
itself now that the global link override is gone.

Verified: DataTable, Navbar, ConfirmAction and DataList stories are
pixel-identical in light and dark; field labels now use daisyUI's
default legend style (logged as P8 for a decision).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
base.css restyled the whole consumer app: it resized text-xl..text-4xl,
set h1-h6/p sizes and margins, forced overflow on body, and set the font
to 'Inter', sans-serif without loading Inter, so apps without Inter fell
back to bare sans-serif instead of Tailwind's platform stack.

base.css now holds only what components need (source scan, border
colour, focus-visible, the kuku override layer). The type scale and
heading/paragraph defaults move to typography.css, exported as
kuku-ui/typography.css and imported by the showcase. While moving them:
fix the xl and 2xl line-height divisors (1.175 -> 1.375, 1.6 -> 1.5),
give 4xl a 44px line-height to match its comment, drop entries equal to
Tailwind's defaults, and put Inter in front of Tailwind's 4.3.3 platform
font stack. body overflow becomes demo-only in src/app.css.

Verified with compiled CSS under daisyUI cupcake/dracula: base.css alone
leaves headings, fonts and body at Tailwind defaults while colours follow
the theme. Showcase stories are pixel-identical before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Focus switched the border from 1px to 2px, shifting field text 1px on
every focus. It now changes only the border colour and adds a 1px inset
accent ring; the field box is identical focused and unfocused.

Placeholders were 20% of base-content (about 1.6:1); now 50%, which is
daisyUI's own default (3.45:1 light, 3.89:1 dark in the showcase).

Disabled fields used base-200 for both border and background, leaving no
edge on a base-100 page; they now get a base-300 edge while keeping the
value legible at 65%.

Unchecked checkbox and radio edges were daisyUI's 20% mix (1.3:1); they
now mix the same --input-color at 50% (3.45:1 / 3.89:1), so colour
variants still work. :indeterminate is excluded for checkboxes only,
since an unchecked radio in a group with nothing checked also matches it.
Checked checkbox-primary and radio-primary are identical to stock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The light theme declared color-scheme 'dark' and prefersdark true, so in
light mode native controls, scrollbars and UA popover colours rendered
dark, and an OS dark preference got the light palette.

Light now declares color-scheme light and prefersdark false. Dark moves
from a raw [data-theme='dark'] block, which only overrode daisyUI's
built-in dark theme, to its own daisyui/theme block with prefersdark
true, so OS-dark visitors without a data-theme get the kuku dark theme.

Verified: colorScheme is light/dark per theme in Storybook; with no
data-theme, prefers-color-scheme light/dark resolves to kuku light/dark;
dark stories are pixel-identical before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It compiled to font-weight: 7px, which browsers ignore, so it never
changed anything; tooltips keep daisyUI's own text size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds Theme/Typography, Theme/Buttons and Theme/Feedback, and moves Form
Components under Theme/ so the section nests consistently. Every Theme
page gets a 'Light vs Dark' story that renders both themes side by side
through nested data-theme, so dark-mode problems show without toggling.

Typography prints live computed size/line-height for headings and the
type scale, and WCAG contrast for every text colour, so the page shows
what the active theme really produces. Story-only helpers live in
src/stories/theme/. No library code changes.

The pages already surfaced theme issues, logged in the checklist: the
light showcase palette fails as text (1.3-2.0:1), dark neutral nearly
vanishes in outline/soft variants, busy buttons draw the spinner over
the label, and FormField.icon is typed for Svelte 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- base.css: hover darkens the field's own border (ghost fields fill), focus/error/disabled
  colours behind --kuku-field-* variables; all selectors zero-specificity so consumer
  utilities still win and daisyUI colour variants keep working
- fields set aria-invalid while they have errors, so server errors show red immediately;
  drop daisyUI validator (no green on valid input); Phone now shows errors too
- fix: enabled TimePicker looked disabled (rule matched its disabled placeholder option)
- storybook: Theme/Field States matrix, light vs dark
- README: Customising field states

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daisyUI 5.7's customisable <select> is :open (not :focus) while its list is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
legacy.css restores every global style base.css dropped since v0.10.0 (type scale, Inter,
h1-h6/p/body, fieldset-legend, link utilities, menu, table, join, filters, breadcrumbs,
dropdown). Compiled and compared against v0.10.0: 0 computed-style differences.
MIGRATION.md documents the rollback procedure, breaking changes and visible fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Checkbox takes col (default 12), so it no longer squeezes into one grid column
- literal size maps: radio-*/checkbox-* now generated in consumer builds; showcase safelist
  for them removed; Radio default size md (what consumers always rendered)
- one label style (14px, grows with lg/xl, wraps); corner radius capped at 30% so
  checkbox-xs isn't round; disabled at 50% opacity instead of 20%
- aria-invalid on Checkbox and on a labelled Radio radiogroup; both turn red via
  --kuku-field-error
- remove Radio's unused crypto.randomUUID() (crashed on non-HTTPS origins)
- Field States story: Checkbox and Radio rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
input-{size}/select-{size}/textarea-{size} templates are invisible to Tailwind's scanner,
so consumer builds never generated textarea-*, input-xl or select-xl and size silently
did nothing. Shared literal maps in form/sizes.ts; DataSelect gains xl; SearchList's
text-md (not a class) maps to text-sm, which is what it rendered. The showcase safelist
that hid the problem is removed; every size renders identically without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
new Date('2025-11-30') is UTC midnight, i.e. 29 Nov anywhere west of UTC, so the date
pickers showed and saved back the previous day. Date-only strings are now built in local
time and overflow (2025-02-31) is rejected. Zoned date-times are unchanged. Checked in
New York, Kolkata and Auckland.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selectedTime started at '00:00', so an empty TimePicker displayed 12:00 AM while its
value was undefined, and picking midnight from empty fired no change. It now starts at ''
(the placeholder option). A select showing its empty option is greyed like an input
placeholder. minuteInterval below 1 no longer loops forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A busy Button still delivered clicks, so a form could be submitted twice. Clicks are
swallowed while busy (preventDefault cancels the implicit submit from Enter); the
button stays enabled so its look and focus don't change, and gets aria-busy.
aria-disabled is deliberately not used: daisyUI styles it as disabled.
The spinner was absolute with no positioned ancestor (offsetParent = body); the button
is now relative and the spinner inset-0 m-auto.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ids were Date.now(), which repeats within a millisecond: duplicate keys in Toaster's
keyed each and remove() taking out the wrong toast. The module-level store is shared
across SSR requests, so add() is now a no-op on the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both declared value as $bindable but their change handlers only called onChange, so
bind:value never updated outside Form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fields report changes after 100ms, so Enter right after typing submitted the previous
value. form/debounce.ts keeps the debounce but registers each pending change with the
enclosing Form (context), which flushes them before validating. Pending changes are
dropped on destroy, so onChange no longer fires after unmount. Standalone fields behave
as before.

validateForm used 'if (err as ValidationError)', always true, so a non-yup error crashed
on err.inner; now instanceof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selectCountry changed the flag but not the value, so Form kept +91... while the user saw
the US flag. It now moves the typed digits to the new dial code and reports it.
A stored value is matched to its country by dial code (longest match; selected, then
defaultCountry, wins a shared code like +1), and the dial code is stripped only as a
prefix. Value normalisation on load is still not emitted, so forms don't turn dirty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DataTable, DataList, DataSelect and SearchList applied responses in arrival order, so a
slow earlier search overwrote a newer one (reproduced: typing 'ab' showed the results
for 'a'). Each now tags requests and ignores stale ones.
DataTable had try/finally with no catch: a failed onFetch showed 'No records found' and
an unhandled rejection; it now shows the error with a Try again button. Failed appends
roll back the page so the next scroll retries it (DataTable and DataList).
SearchList: rejected onSearch no longer leaves busy=true; clearing the box cancels a
pending search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DateRangePicker filled its dates only while they were empty, so resets and outside
changes were ignored; it now syncs on every value change (untracked compare, so an
in-progress selection isn't touched) and clears on ''. DateTimePicker compared only the
day and its time effect ran before the date sync, so a same-day time change was ignored;
it now compares the timestamp and syncs first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
numRequired turned a cleared field ('') into NaN and reported yup's raw cast error; it now
maps '' to undefined ('Required') and non-numbers to 'Must be a number'.
validateNumberRange rejects NaN. Kept as-is on purpose (projects may rely on them):
validate* helpers requiring a value, validatePhoneLength counting dial-code digits; both
now documented. Fixed a wrong comment, dropped an unused import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isDateDisabled compared a midnight cell with the full min timestamp, so min={new Date()}
disabled today. date-utils gains startOfDay/isDayOutside, used by both pickers. Range
presets are clamped to min/max. The range end stays at T00:00:00 (documented) since
backends may already compensate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bind:group compares strictly, so value 2 never matched the '2' radio and the group showed
nothing selected. Radio now sets checked by string comparison and writes value on change.
Form's computeDirty compares primitives as strings, so re-picking a numeric initial
value isn't counted as an edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DataTable/DataList clear the search debounce and pending scroll rAF, DataSelect its search
and focus timeouts, so nothing fires after unmount (e.g. a Modal closing mid-search).
DateTimePicker's minuteInterval loop now uses an interval of at least 1, as TimePicker does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enter was always prevented when dataListOptions existed, so the form couldn't be
submitted from the field; now only while the list is open. Pressing an option no longer
blurs the input (mousedown preventDefault), so a press longer than the 150ms blur delay
still selects. searchTerm follows value unconditionally, so clearing resets the filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages loaded only on scroll, so a first page shorter than the box stalled forever. After
each fetch, load the next page while the rows are shorter than the box. A box without a
height limit hugs its rows and is left alone, so this can't fetch a whole large dataset.
Verified: 600px table with pageSize 5 loads 15 rows then continues on scroll; an
unconstrained table stays at 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Avatar captured name in $state at init, so late names stayed 'N/A', and imgReady never
reset, so a new src after a failure was ignored; both are derived now. The image class
was w-2 (8px). Image resets loaded/failed per src and drops stale onload/onerror from
the previous src.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DataSelect: repeated Enter while onCreate runs no longer creates duplicates (verified:
3 Enters -> 1 call); a rejected onCreate keeps the text instead of an unhandled rejection.
ButtonLink: wire the declared onclick prop. ConfirmAction: document that the toggle's
value is the caller's to set (changing it would double-flip existing usages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared FieldMessage renders <p class="kuku-field-error"> under all 11 field
components, linked with aria-describedby and replacing the labelBottom hint
while there are errors. Checkbox/Radio lose the always-open tooltip. The text
colour mixes the error colour toward base-content for 4.5:1 in any theme;
restyle with --kuku-field-error-text / --kuku-field-error-size. Form sets
novalidate so a stale custom validity no longer blocks resubmit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FieldLabel puts the label text in <label for> inside the existing legend (custom widgets use
  aria-labelledby); clicking a label focuses its field
- Form focuses the first invalid field after a failed submit
- labelBottom linked with aria-describedby and wraps
- optional required prop: marker after the label (--kuku-field-required) + aria-required
- Textbox suggestions and Phone country list: listbox/combobox ARIA, arrows, Escape returns focus
- Select placeholder no longer repeated as an optgroup label
- autoFocus on Radio and Textarea

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- field icons, icon gap, Phone flag/code/chevron and skeletons follow size; md unchanged
- hard-coded radii -> rounded-box/field/selector
- secondary text 30-50% -> 70%, icon buttons -> 60%
- src/lib/transitions.ts: Svelte transitions that respect prefers-reduced-motion; Modal 1ms
  animation under reduce; BtnFloat bounce motion-safe
- dead daisyUI 4 classes fixed (card-border, card-actions, menu-active, ...)
- Card/Modal/Phone viewport maths; kuku- keyframes; toast hover colour; --kuku-form-heading-bg

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ui-ux-hardening:ui-ux-hardening
git switch ui-ux-hardening

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff ui-ux-hardening
git switch ui-ux-hardening
git rebase main
git switch main
git merge --ff-only ui-ux-hardening
git switch ui-ux-hardening
git rebase main
git switch main
git merge --no-ff ui-ux-hardening
git switch main
git merge --squash ui-ux-hardening
git switch main
git merge --ff-only ui-ux-hardening
git switch main
git merge ui-ux-hardening
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
js/kuku-ui!14
No description provided.