demos: homogenize input chrome across all demo Controls

The `[data-uix-control] input[type='text|number']` rule only covered
two input types, so demos that used `<input type='date'>` (date- and
date-range pickers' min/max/start/end inputs, calendar bounds, etc.)
or `<input type='email|search|tel|url|password|time|month|week|
datetime-local'>` (form/field demos) fell back to the user-agent
chrome — different padding, borders, fonts, and the native
calendar/clock indicator with no theme alignment.

Replaced the type-specific selector with an exclusion list:

  [data-uix-control] input:not([type='checkbox']):not([type='radio']):not([type='range'])

Every text-like input now picks up the demo's standard chrome
(6px / 32px / `--uix-line` border / `--uix-surface` bg / focus ring).
Checkbox + radio keep their bespoke toggle treatments; range keeps
its native track with the demo accent.

Added:
- Consistent `min-block-size: 32px` + `box-sizing: border-box` so
  inputs line up vertically with the demo's button-style pill
  controls.
- Disabled state: 0.55 opacity + `not-allowed` cursor.
- `::-webkit-calendar-picker-indicator` recolored for
  date/datetime-local/month/time/week inputs — inverted 70% so the
  calendar/clock icon reads on dark theme and matches the field
  text tone, with full opacity on hover.
- `::-webkit-search-cancel-button` recolored.

Verified in browser: date-range-picker demo's start/end/minValue/
maxValue inputs now match minDays/maxDays (number) and label/name
(text) inputs. Form demo Field-rendered inputs and the controls
panel both read as one consistent surface. date-field controls
panel (locale select + name text + min/max date inputs) matches.

Closes #47 in the task list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
active-uix
dev 5 months ago
parent 539d9fac39
commit 8ccd9de033

@ -962,8 +962,14 @@
font-weight: var(--uix-weight-regular); font-weight: var(--uix-weight-regular);
font-size: 10px; font-size: 10px;
} }
[data-uix-control] input[type="text"], /* Generic chrome for every text-like input + select + textarea inside a
[data-uix-control] input[type="number"], demo control. The selector explicitly excludes the input types that
have their own bespoke affordances (checkbox + radio → custom toggle
chrome; range → native track + accent-color). Anything else — text,
number, email, search, date, time, datetime-local, month, week, tel,
url, password, etc. — gets the same neutral chrome so the controls
panel reads as one consistent thing across all demos. */
[data-uix-control] input:not([type='checkbox']):not([type='radio']):not([type='range']),
[data-uix-control] select, [data-uix-control] select,
[data-uix-control] textarea { [data-uix-control] textarea {
padding: 6px var(--uix-space-3); padding: 6px var(--uix-space-3);
@ -973,21 +979,59 @@
color: var(--uix-text); color: var(--uix-text);
font: inherit; font: inherit;
font-size: var(--uix-text-sm); font-size: var(--uix-text-sm);
line-height: var(--uix-leading-ui, 1.4);
min-inline-size: 0; min-inline-size: 0;
min-block-size: 32px;
box-sizing: border-box;
} }
[data-uix-control] input[type="text"]:focus,
[data-uix-control] input[type="number"]:focus, [data-uix-control] input:not([type='checkbox']):not([type='radio']):not([type='range']):focus,
[data-uix-control] select:focus, [data-uix-control] select:focus,
[data-uix-control] textarea:focus { [data-uix-control] textarea:focus {
outline: none; outline: none;
border-color: var(--uix-accent-line); border-color: var(--uix-accent-line);
box-shadow: var(--uix-ring); box-shadow: var(--uix-ring);
} }
[data-uix-control] input:not([type='checkbox']):not([type='radio']):not([type='range']):disabled,
[data-uix-control] select:disabled,
[data-uix-control] textarea:disabled {
opacity: 0.55;
cursor: not-allowed;
}
[data-uix-control] input[type="range"] { [data-uix-control] input[type="range"] {
inline-size: 100%; inline-size: 100%;
accent-color: var(--uix-accent); accent-color: var(--uix-accent);
} }
/* Native date/time pickers ship a calendar/clock indicator icon that
shows in browser-default tone. Force inherit so it matches our chrome. */
[data-uix-control] input[type='date']::-webkit-calendar-picker-indicator,
[data-uix-control] input[type='datetime-local']::-webkit-calendar-picker-indicator,
[data-uix-control] input[type='month']::-webkit-calendar-picker-indicator,
[data-uix-control] input[type='time']::-webkit-calendar-picker-indicator,
[data-uix-control] input[type='week']::-webkit-calendar-picker-indicator {
filter: invert(0.7);
cursor: pointer;
opacity: 0.7;
transition: opacity var(--uix-duration-fast, 120ms) ease;
}
[data-uix-control] input[type='date']::-webkit-calendar-picker-indicator:hover,
[data-uix-control] input[type='datetime-local']::-webkit-calendar-picker-indicator:hover,
[data-uix-control] input[type='month']::-webkit-calendar-picker-indicator:hover,
[data-uix-control] input[type='time']::-webkit-calendar-picker-indicator:hover,
[data-uix-control] input[type='week']::-webkit-calendar-picker-indicator:hover {
opacity: 1;
}
/* Search has a browser-default cancel button that may not match the theme. */
[data-uix-control] input[type='search']::-webkit-search-cancel-button {
filter: invert(0.7);
cursor: pointer;
}
/* Switch (boolean) */ /* Switch (boolean) */
[data-uix-switch] { [data-uix-switch] {
display: inline-flex; display: inline-flex;

Loading…
Cancel
Save

Powered by TurnKey Linux.