j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

Time picker

A themed time editor with explicit step buttons, backed by native time values and constraints.

stable · light DOM · 4.0.0. Theme-owned date/time editor and controls backed by the original native input for form values and constraints. Native input is the no-JavaScript fallback.

Live variants

default

Between 06:00 and 22:00, in five-minute steps.

✕ Choose a time between 06:00 and 22:00.

Markup
<j3w1-time-picker id="example-time-picker-default"><div class="time-picker">
  <label class="time-picker-label" for="example-time-picker-default-tp-start">Start time</label>
  <div class="time-picker-root">
    <input class="time-picker-input" id="example-time-picker-default-tp-start" type="time" value="09:30" min="06:00" max="22:00" step="300" aria-describedby="example-time-picker-default-tp-start-help example-time-picker-default-tp-start-message" name="example-time-picker-default-tp-start">
  </div>
  <p class="time-picker-help" id="example-time-picker-default-tp-start-help">Between 06:00 and 22:00, in five-minute steps.</p>
  <p class="time-picker-message" id="example-time-picker-default-tp-start-message">✕ Choose a time between 06:00 and 22:00.</p>
</div></j3w1-time-picker>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/time-picker.css';
import '@j3w1/ui/register/time-picker';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy time-picker --out ./vendor/j3w1/time-picker

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.
valueCustomEventForwards value to the primary native control.
requiredCustomEventForwards required to the primary native control.
readonlyCustomEventForwards readonly to the primary native control.
checkedCustomEventForwards checked to the primary native control.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.
valuestringPrimary native value; assignment does not fabricate user events.
checkedbooleanNative checkbox state.
requiredbooleanNative required constraint.
readOnlybooleanNative readonly property.
formHTMLFormElement | nullOwning native form. Read only.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.
checkValidity(): booleanCheck owned native constraints.
reportValidity(): booleanReport the first invalid owned control.
clear(): voidClear an editable primary input and emit native input/change.

events

NameType / signatureMeaning
j3w1-changeCustomEventNative change from an owned control, alongside the original native event.

Dependencies and verification

Registered components: none. Style dependencies: none.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Time picker time-picker

  • Family: Advanced forms
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Custom widget: Labeled textbox with native time constraints and named step buttons — APG pattern
  • specified
  • demonstrated

A themed time editor with explicit step buttons, backed by native time values and constraints.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bgcolor.surface.inputapproveduse#000000Form-control fill.
root.bordercolor.border.controlapproveduse#c81a1aD-041 owner correction: red control and floating-frame borders, distinct from rose text.
root.bg-hovercolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
root.border-focuscolor.border.activeobserveduse#e53935Active or focused control border.
root.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
root.ring-invalidcolor.interaction.focus.ring-containerobserveduse#ffa2a7Focus colour for containers and explicitly mapped filled controls (D-015); component rules determine ring geometry.
root.border-invalidcolor.status.danger.borderobserveduse#e53935Danger border, 2px on invalid inputs.
root.border-disabledcolor.border.disabledapproveduse#482b2bD-041 border.disabled: color.primitive.modern.divider.
root.bg-disabledcolor.interaction.disabled.bgapproveduse#0d0707D-041 interaction.disabled.bg: color.primitive.modern.panel.
input.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
input.text-disabledcolor.text.disabledapproveduse#a3676bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
input.caretcolor.code.caretapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
label.textcolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
help.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
message.textcolor.status.danger.textobserveduse#f07178D-041 readable error text on neutral surfaces and native warning tints.

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateTime
default

Between 06:00 and 22:00, in five-minute steps.

✕ Choose a time between 06:00 and 22:00.

hover
focus-visible
invalid
invalid+focus-visible
disabled

Purpose

Enter a time by typing or with themed step buttons. D-025: theme-owned web controls, not browser popup styling.

Anatomy

A label, editor, increase and decrease buttons, format hint and validation message. The native time input stays the successful form control, owns value, defaults and constraints, and is hidden only after enhancement.

States

StateVisualNon-colour channel
defaultcolor.text.default on color.surface.input, 1px color.border.control—
hoverbackground → color.interaction.hover.bghover-capable pointers only
focus-visibleborder → color.border.active; the canonical focus ringthe ring
invalid2px color.status.danger.border; a linked messageborder 1 → 2px; ✕ glyph; aria-invalid
invalid+focus-visiblethe danger border and the ring in color.interaction.focus.ring-container at −4pxdouble boundary
disabledcolor.text.disabled on color.interaction.disabled.bg, border color.border.disabled; editor and step actions unavailabledisabled; cursor: not-allowed

A read-only value stays readable and cannot change through the step buttons.

Keyboard

As in the key table; the step buttons are named.

Accessibility

The visible editor receives the original label, descriptions, required and error state. Format hints are always available. Native min, max, step and required stay authoritative. Invalid entry focuses the visible editor and shows a theme-owned message. The enhanced control uses no host clock popup or browser segment selection. Form reset restores the native defaults. Automated evidence records its browser, states and limits and is not a manual screen-reader acceptance.

Portability

The package and the complete copy distribution include the renderer; the public control enhancement applies it to existing native markup. Without JavaScript, and on non-web platforms, the control stays native.

Non-examples

An unthemed host popup presented as themed. A second named input duplicating form values. Dropping native constraints, labels or reset. Literal colours or rounded corners.

Contrast report

16 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
time-picker default textdefaulttextcolor.text.default #e99499color.surface.input #0000009.164.5pass
time-picker default borderdefaultuicolor.border.control #c81a1acolor.surface.input #0000003.623pass
time-picker hover texthovertextcolor.text.default #e99499color.interaction.hover.bg #1c10108.104.5pass
time-picker hover borderhoveruicolor.border.control #c81a1acolor.interaction.hover.bg #1c10103.203pass
time-picker focus-visible textfocus-visibletextcolor.text.default #e99499color.surface.input #0000009.164.5pass
time-picker focus-visible borderfocus-visibleuicolor.border.active #e53935color.surface.input #0000004.973pass
time-picker focus-visible outlinefocus-visibleuicolor.interaction.focus.ring #e53935color.surface.input #0000004.973pass
time-picker invalid textinvalidtextcolor.text.default #e99499color.surface.input #0000009.164.5pass
time-picker invalid borderinvaliduicolor.status.danger.border #e53935color.surface.input #0000004.973pass
time-picker invalid+focus-visible textinvalid+focus-visibletextcolor.text.default #e99499color.surface.input #0000009.164.5pass
time-picker invalid+focus-visible borderinvalid+focus-visibleuicolor.status.danger.border #e53935color.surface.input #0000004.973pass
time-picker invalid+focus-visible outlineinvalid+focus-visibleuicolor.interaction.focus.ring-container #ffa2a7color.surface.input #00000010.983pass
validation message on the canvas—textcolor.status.danger.text #f07178color.surface.canvas #0000007.344.5pass
help text on the canvas—textcolor.text.muted #d4868bcolor.surface.canvas #0000007.584.5pass
disabled text (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.interaction.disabled.bg #0d07074.483pass
disabled border (exempt)disableduicolor.border.disabled #482b2bcolor.interaction.disabled.bg #0d07071.581pass

Keys

KeyAction
Tab / Shift+TabMoves between the time editor, step buttons and other controls.
TypingEdits HH:MM or HH:MM:SS text; native min, max and step validate it.
Enter / Space on a step buttonIncreases or decreases by the native step. With step=any, buttons are disabled.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: text-field date-picker number-field field

Stress fixtures: FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-STATE-MATRIX