You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/soma/components/date-picker/date-picker-provider.svelte.ts

225 lines
7.2 KiB

date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import { untrack } from 'svelte';
import { watch } from 'runed';
import { context, type ProviderOpts } from '../../provider';
import { createAttrs } from '$uix/morfo';
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import { boolToEmptyStrOrUndef, boolToStr, getDataOpenClosed } from '$adom';
import { type ActiveProps, type StateProps } from '$libs/reactive';
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
import type { OnChangeFn, Direction } from '../../types';
import { Soma } from '../../core/soma.svelte';
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import { isBefore } from '$libs/days';
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
import type {
DateValue,
DateMatcher,
DateOnInvalid,
DateValidator,
EditableSegmentPart,
Granularity,
HourCycle,
WeekStartsOn
} from '$libs/days';
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Picker interaction mode. `inline` (default) auto-closes the popover when
* a date is selected (subject to `closeOnDateSelect`). `modal` keeps the
* popover open until the user explicitly confirms via the Save action in
* the footer; Cancel restores the value snapshot taken at open.
*/
export type DatePickerMode = 'inline' | 'modal';
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
// ── Contract ─────────────────────────────────────────────────────────────────
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
import { datePickerMorfo } from '../../../morfo/components/date-picker';
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
const attrs = createAttrs(datePickerMorfo);
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
// ── Provider (context — shared state for DateField + Popover + Calendar) ────
interface DatePickerOpts
extends
ProviderOpts,
StateProps<{
value: DateValue | undefined;
placeholder: DateValue;
open: boolean;
}>,
ActiveProps<{
// Validation
validate: DateValidator | undefined;
onInvalid: DateOnInvalid | undefined;
minValue: DateValue | undefined;
maxValue: DateValue | undefined;
isDateDisabled: DateMatcher | undefined;
isDateUnavailable: DateMatcher | undefined;
// State flags
disabled: boolean;
readonly: boolean;
readonlySegments: EditableSegmentPart[];
required: boolean;
closeOnDateSelect: boolean;
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
mode: DatePickerMode;
clearButton: boolean;
cancelButton: boolean;
closeButton: boolean;
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
// Format / i18n
granularity: Granularity | undefined;
hideTimeZone: boolean;
hourCycle: HourCycle | undefined;
locale: string | undefined;
dir: Direction;
// Calendar options
pagedNavigation: boolean;
weekStartsOn: WeekStartsOn | undefined;
weekdayFormat: Intl.DateTimeFormatOptions['weekday'];
fixedWeeks: boolean;
numberOfMonths: number;
calendarLabel: string | undefined;
disableDaysOutsideMonth: boolean;
preventDeselect: boolean;
initialFocus: boolean;
monthFormat: Intl.DateTimeFormatOptions['month'] | ((month: number) => string);
yearFormat: Intl.DateTimeFormatOptions['year'] | ((year: number) => string);
showWeekNumbers: boolean;
weekNumberFormat: 'iso' | 'simple';
isDateHoliday: DateMatcher | undefined;
announceNavigation: boolean;
// ARIA
errorMessageId: string | undefined;
// Callbacks
onOpenChangeComplete: OnChangeFn<boolean>;
}> {}
/**
* Shared-state coordinator for DatePicker. The wrapper also creates a
* `PopoverProvider` and a `DateFieldProvider` pointing at the same reactive
* sources; `DatePicker.Calendar` creates a `CalendarProvider` likewise. This
* class exists so every sub-part can reach the same value / placeholder /
* open flags through a single context.
*/
export class DatePickerProvider {
readonly opts: DatePickerOpts;
readonly runtimePart: SomaRuntimePart;
readonly soma: Soma;
readonly runtime: SomaRuntime;
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
static readonly ctx = context<DatePickerProvider>('DatePicker');
static get(): DatePickerProvider | undefined {
return this.ctx.getOr(undefined) as DatePickerProvider | undefined;
}
static require(): DatePickerProvider {
return this.ctx.get();
}
static create(opts: DatePickerOpts) {
return new DatePickerProvider(opts);
}
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Snapshot of `value` captured on the OPEN edge. Used by `cancel()` to
* revert any mid-session edits back to the value the popover opened with.
*/
private valueOnOpen: DateValue | undefined = undefined;
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
private constructor(opts: DatePickerOpts) {
this.opts = opts;
this.soma = Soma.require();
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
this.runtime = this.soma.runtime(datePickerMorfo, {
states: { open: () => this.opts.open.current },
props: {
disabled: () => this.opts.disabled.current,
readonly: () => this.opts.readonly.current,
required: () => this.opts.required.current,
invalid: () => this.isInvalid
}
});
this.runtimePart = this.runtime.part('provider', {
id: opts.id,
ref: opts.ref,
owner: this,
context: DatePickerProvider.ctx
});
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// Capture value on the opening edge so `cancel()` can revert.
watch(
() => this.opts.open.current,
(now, prev) => {
if (now && !prev) {
this.valueOnOpen = untrack(() => this.opts.value.current);
}
}
);
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
}
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
readonly validationStatus = $derived.by(() => {
const value = this.opts.value.current;
if (!value) return false as const;
const message = this.opts.validate.current?.(value);
if (message) return { reason: 'custom', message } as const;
const minValue = this.opts.minValue.current;
if (minValue && isBefore(value, minValue)) return { reason: 'min' } as const;
const maxValue = this.opts.maxValue.current;
if (maxValue && isBefore(maxValue, value)) return { reason: 'max' } as const;
return false;
});
readonly isInvalid = $derived.by(() => this.validationStatus !== false);
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Close the popover if `closeOnDateSelect` is `true` AND mode is inline.
* Modal mode never auto-closes on selection — the user must commit via
* the explicit Save action in the footer.
*/
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
handleDateSelect(): void {
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
if (this.opts.mode.current === 'modal') return;
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
if (this.opts.closeOnDateSelect.current) {
this.opts.open.current = false;
}
}
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
date-picker: mode='modal' + footer (clear/cancel/closeButton) Replicates the date-range-picker pattern on the single date-picker: soma: - DatePickerMode type ('inline' | 'modal') exported. - Provider gains mode/clearButton/cancelButton/closeButton opts plus commit() / cancel() / clear() action helpers; cancel() reverts the value snapshot taken via watch() on the OPEN edge of opts.open. - handleDateSelect now early-returns when mode === 'modal' so modal pickers don't auto-close on selection. - exports.ts surfaces DatePickerProvider + DatePickerMode for demo / footer wiring (mirrors date-range-picker's barrel). - Test fixture extended with the new opts (closeOnDateSelect stays true by default; mode='inline', all buttons false). morfo: - scope=['soma','sema'], apg=dialog-modal. - 6 events: open / close-commit / close-cancel / close-dismiss / close-dismiss-outside / commit-clear. prewrite stamps data-last-action with the causal exit reason so Sema can tint the exit animation. - Calendar part declares the state machine (open/closed, data-last-action, data-starting-style, data-ending-style) and the modal-keyboard surface (Escape / Tab / Shift+Tab). demo: - New picker-actions.svelte mirrors the range demo: pulls provider via context, renders Clear / Cancel / Close conditionally, forces Close in modal mode. CSS is local to the file (uses --color-primary-* + --color-surface-overlay tokens, no raw colors). - +page.svelte adds mode radio chip group + 3 footer-button switches and passes mode/clearButton/cancelButton/closeButton through to the Eidos wrapper (which spreads to soma). The Eidos wrapper needs no change — it already spreads everything via ...rest, so the new soma opts reach Soma without further wiring. Verification: 0 type errors, 3/3 soma tests pass, morfo:check PASS, component:audit 67/67 PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// ── Action helpers (footer wiring) ────────────────────────────────────────
/**
* Commit the current value and close the popover. The default behavior
* for a "Save" or "Done" button in the footer, especially in modal mode.
*/
commit(): void {
this.opts.open.current = false;
}
/**
* Discard any edits made since the popover opened and close. Used by
* the Cancel button in the footer.
*/
cancel(): void {
this.opts.value.current = this.valueOnOpen;
this.opts.open.current = false;
}
/**
* Reset the value to undefined without closing the popover. Used by
* the Clear button in the footer.
*/
clear(): void {
this.opts.value.current = undefined;
}
uix: date-picker + date-range-picker components + component audit infra Two new Eidos components shipped end-to-end (wrapper + recipe + demo + Soma provider hardening) plus a checklist-driven audit pipeline that scores all 67 morfo components against doctrinal completion criteria. New components: - date-picker: full popover-anchored picker over date-field + calendar, with calendar/content/trigger parts and demo route. - date-range-picker: standalone wrapper with own calendar/grid/segment surface, demo route, and recipe CSS. - Both wrappers follow Option C disciplined (root + parts attached via explicit assignment, no Object.assign). Supporting Soma changes: - range-calendar provider tightened (211 LOC of behavior, 167 LOC of tests), README brought up to component doctrine. - date-field, date-picker, date-range-field, date-range-picker Soma providers + READMEs updated for new wrappers. - popover provider/close gain props needed by the picker wrappers. Morfo updates: - date-picker / date-range-picker / range-calendar morfos refined for the new APIs (parts, events, ARIA). Audit infrastructure (new): - src/uix/COMPONENT_COMPLETION_CHECKLIST.md — 81 doctrinal rules across morfo / eidos wrapper / recipe CSS / demo / README / cross-layer scripts. Each rule keyed to active_architecture.md, GUIA_IMPLEMENTACION and DEMO_AUTHORING_GUIDE. - scripts/component-audit.ts + `npm run component:audit` — regex parser over all 67 components, emits tmp/component-audit.md with summary scoreboard + per-component findings. Validates against canonical SEMA_FAMILIES / SEMA_VERBS / ARCHETYPE_VOCABULARY / INTENTS. - Initial baseline: 1 PASS, 64 NEEDS-WORK, 2 BROKEN (tooltip, date-range-picker). Top systemic gaps: translations.label (49), README Gaps/Comparativa/Baseline sections (87 combined), keyboard /event ratio under-declaration (15), apg URL absent (19). Misc: - src/uix/kimi-audit-eidos.md — supplementary audit notes. - .gitignore: ignore .codex-* agent scratch artifacts at repo root. - continue.md + READMEs updated through the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
readonly props = $derived.by(() =>
this.runtimePart.assert({
...this.runtimePart.props,
'data-state': getDataOpenClosed(this.opts.open.current),
'data-disabled': boolToEmptyStrOrUndef(this.opts.disabled.current),
'data-readonly': boolToEmptyStrOrUndef(this.opts.readonly.current),
'data-required': boolToEmptyStrOrUndef(this.opts.required.current),
'data-invalid': boolToEmptyStrOrUndef(this.isInvalid),
'aria-disabled': boolToStr(this.opts.disabled.current),
'aria-readonly': boolToStr(this.opts.readonly.current),
'aria-required': boolToStr(this.opts.required.current)
} as const)
);
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs Tier 3 (complete): DateField, DatePicker, DateRangeField, DateRangePicker Tier 4 (partial): TimeField, TimePicker (TimeRangeField pending) Core: $lib/util/dias/segments.ts — pure domain primitives for segmented date/time inputs (constants, guards, initializers, reconciliation, content generation, Intl opts) soma/external/dates re-exports everything (no façades inside soma) soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav, SegmentState, KEYS predicates, description writers) Conventions established (A23–A29): A23 — never re-implement date helpers; extend dias A24 — readonlySegments without value anchor logs warning A25 — range components split readonly per-endpoint A26 — contenteditable segments use onbeforeinput to block IME/paste A27 — picker composition pattern with shared writableActive refs A28 — time placeholders render as hh/mm/ss via dias/segments A29 — demo pages are interactive testbeds, not static galleries Demo pages: Material Design 3 styled, every public prop wired to a live control, Field integration + state readout. Day-period uses real radio group in 12h mode. Auto-anchor on range pickers keeps the end month visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly. Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29, checklist items 28–31, picker composition section, dias boundary, directory structure note for soma/datetime/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
}
export { attrs as datePickerAttrs };

Powered by TurnKey Linux.