@alfadocs/ui-kit-debug 1.94.0 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{anamnesis-summary-rows-IMohuz0D.js → anamnesis-summary-rows-DTZ3per6.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-IMohuz0D.js.map → anamnesis-summary-rows-DTZ3per6.js.map} +1 -1
- package/dist/_chunks/{calendar-appointment-editor-dialog-CsVWoRcP.js → calendar-appointment-editor-dialog-WDKc3jMA.js} +3 -3
- package/dist/_chunks/{calendar-appointment-editor-dialog-CsVWoRcP.js.map → calendar-appointment-editor-dialog-WDKc3jMA.js.map} +1 -1
- package/dist/_chunks/chart-pMkQN-qy.js +1550 -0
- package/dist/_chunks/chart-pMkQN-qy.js.map +1 -0
- package/dist/_chunks/{date-time-picker-n-yrlMJq.js → date-time-picker-cwsWiB4q.js} +2 -2
- package/dist/_chunks/{date-time-picker-n-yrlMJq.js.map → date-time-picker-cwsWiB4q.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-K41Wy7LB.js → hcg-doubling-DQe1ptNB.js} +2 -2
- package/dist/_chunks/{hcg-doubling-K41Wy7LB.js.map → hcg-doubling-DQe1ptNB.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-XU88crNW.js → reserved.agent-BvwjDyne.js} +2 -2
- package/dist/_chunks/{reserved.agent-XU88crNW.js.map → reserved.agent-BvwjDyne.js.map} +1 -1
- package/dist/_chunks/{slot-grid-B-IAFX3C.js → slot-grid-BhjaLJ0o.js} +229 -214
- package/dist/_chunks/{slot-grid-B-IAFX3C.js.map → slot-grid-BhjaLJ0o.js.map} +1 -1
- package/dist/_chunks/{task-editor-BZeSBxwU.js → task-editor-Cv7xSakv.js} +2 -2
- package/dist/_chunks/{task-editor-BZeSBxwU.js.map → task-editor-Cv7xSakv.js.map} +1 -1
- package/dist/_chunks/time-picker-DSt-ns5F.js +914 -0
- package/dist/_chunks/time-picker-DSt-ns5F.js.map +1 -0
- package/dist/agent-catalog.json +12 -4
- package/dist/agent-i18n/en.json +2 -2
- package/dist/apexcharts.css +4 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/chart/chart-axis-scale.d.ts +21 -0
- package/dist/components/chart/chart-axis-scale.d.ts.map +1 -0
- package/dist/components/chart/chart.agent.d.ts.map +1 -1
- package/dist/components/chart/chart.d.ts +55 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.d.ts +1 -1
- package/dist/components/chart/index.d.ts.map +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts +15 -8
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +6 -3
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +5 -2
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +7 -4
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +5 -2
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +7 -4
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +5 -2
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +6 -3
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +5 -2
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +7 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +6 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +5 -2
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +7 -4
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +5 -2
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +7 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +5 -2
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +7 -4
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +5 -2
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +7 -4
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +5 -2
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +7 -4
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +6 -3
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +5 -2
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +7 -4
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +5 -2
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +7 -4
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +5 -2
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +7 -4
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +5 -2
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +7 -4
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +5 -2
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +7 -4
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +5 -2
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +7 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/locales/ar.json +6 -3
- package/dist/locales/de.json +7 -4
- package/dist/locales/el.json +7 -4
- package/dist/locales/en.json +6 -3
- package/dist/locales/es.json +7 -4
- package/dist/locales/fr.json +6 -3
- package/dist/locales/hi.json +7 -4
- package/dist/locales/it.json +7 -4
- package/dist/locales/ja.json +7 -4
- package/dist/locales/nl.json +7 -4
- package/dist/locales/pl.json +7 -4
- package/dist/locales/pt.json +6 -3
- package/dist/locales/ro.json +7 -4
- package/dist/locales/ru.json +7 -4
- package/dist/locales/sq.json +7 -4
- package/dist/locales/sv.json +7 -4
- package/dist/locales/tr.json +7 -4
- package/dist/locales/zh.json +7 -4
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +3 -0
- package/package.json +1 -1
- package/dist/_chunks/chart-D4huJSru.js +0 -1340
- package/dist/_chunks/chart-D4huJSru.js.map +0 -1
- package/dist/_chunks/time-picker-DVfyAR81.js +0 -871
- package/dist/_chunks/time-picker-DVfyAR81.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker-n-yrlMJq.js","sources":["../../node_modules/date-fns/setHours.js","../../node_modules/date-fns/setMinutes.js","../../src/components/date-time-picker/date-time-picker.agent.ts","../../src/components/date-time-picker/date-time-picker.tsx"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMinutes} function options.\n */\n\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param minutes - The minutes of the new date\n * @param options - An object with options\n *\n * @returns The new date with the minutes set\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nexport function setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setMinutes;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — DateTimePicker. */\n/* */\n/* DateTimePicker composes a react-day-picker calendar grid with the */\n/* TimePicker segments inside a single Radix Popover. The agent surface */\n/* exposes a combined datetime — set / clear / open / close. The handle */\n/* is the curated surface; consumers don't address the inner sub-widgets.*/\n/* */\n/* See `src/docs/26-agent-readiness.mdx` §15. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DateTimePickerHandle } from './date-time-picker';\n\nexport const dateTimePickerAgent: AgentAdapter<DateTimePickerHandle> = {\n id: 'date-time-picker',\n // Persisted single datetime (value state + set_datetime) → select_single +\n // set_value, plus open/close of the combined popover.\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'iso-datetime',\n descriptionKey: 'ui.agent.dateTimePicker.state.value',\n description: 'Currently-selected ISO datetime, or null.',\n read: (handle) => handle.getValue()?.toISOString() ?? null,\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.dateTimePicker.state.isOpen',\n description: 'Whether the datetime popover is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_datetime: {\n safety: 'write',\n argsType: '{ datetime: string }',\n argsSchema: {\n type: 'object',\n properties: {\n datetime: {\n type: 'string',\n format: 'date-time',\n description: 'ISO datetime, e.g. \"2026-06-23T14:30:00Z\".',\n },\n },\n required: ['datetime'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.setDatetime',\n description: 'Select a specific datetime (ISO string).',\n examples: [\n {\n args: { datetime: '2026-06-23T14:30:00Z' },\n note: 'Select 23 Jun 2026, 14:30 UTC.',\n },\n ],\n invoke: (handle, args: { datetime: string }) => {\n handle.setValue(new Date(args.datetime));\n },\n },\n clear: {\n // Discards the selected datetime — loses the user's input.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.clear',\n description: 'Clear the selected datetime.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.open',\n description: 'Open the datetime popover.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.close',\n description: 'Close the datetime popover.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'date-time-picker',\n description: 'Marks the DateTimePicker wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n findPopoverTrigger,\n useNonModalTabExit,\n} from '../_shared/non-modal-tab-exit';\nimport { Spinner } from '../spinner';\nimport { useDayPickerLabels } from '../_shared/day-picker-labels';\nimport { DayPicker } from 'react-day-picker';\nimport { isBefore, isAfter, setHours, setMinutes } from 'date-fns';\nimport { CalendarDays } from 'lucide-react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport {\n useDateFnsLocale,\n buildDisabledMatcher,\n CalendarChevron,\n calendarClassNames,\n triggerVariants,\n calendarIconVariants,\n popoverContentVariants,\n} from '../_shared';\nimport { TimePicker } from '../time-picker/time-picker';\nimport type { TimeValue } from '../_shared/time';\nimport { formatLocale } from '../_shared/intl-locale';\nimport { useAgentRegistration } from '../../agent';\nimport { dateTimePickerAgent } from './date-time-picker.agent';\n\n/* -------------------------------------------------------------------------- */\n/* Imperative handle */\n/* -------------------------------------------------------------------------- */\n\n/** Curated imperative handle exposed via `ref` — also consumed by the agent adapter. */\nexport interface DateTimePickerHandle {\n /** Get the current selected datetime, or undefined. */\n getValue: () => Date | undefined;\n /** Set the selected datetime. */\n setValue: (date: Date | undefined) => void;\n /** Clear the selected datetime. */\n clear: () => void;\n /** Whether the popover is open. */\n isOpen: () => boolean;\n /** Open the popover. */\n open: () => void;\n /** Close the popover. */\n close: () => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------------- */\n\n/** Get timezone short name. */\nfunction getTimezoneLabel(locale: string, timezone?: string): string {\n try {\n const opts: Intl.DateTimeFormatOptions = { timeZoneName: 'short' };\n if (timezone && timezone !== 'local') {\n opts.timeZone = timezone === 'utc' ? 'UTC' : timezone;\n }\n const parts = new Intl.DateTimeFormat(locale, opts).formatToParts(\n new Date(),\n );\n return parts.find((p) => p.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n/** Check if a timezone differs from the browser's. */\nfunction tzDiffersFromBrowser(timezone?: string): boolean {\n if (!timezone || timezone === 'local') return false;\n try {\n const browserTz = Intl.DateTimeFormat().resolvedOptions().timeZone;\n if (timezone === 'utc') return browserTz !== 'UTC';\n return browserTz !== timezone;\n } catch {\n return false;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* CVA variants */\n/* -------------------------------------------------------------------------- */\n\nconst applyButtonVariants = cva(\n [\n 'ds:w-full ds:rounded-[var(--radius-sm)]',\n 'ds:bg-primary ds:text-primary-foreground',\n 'ds:hover:bg-primary-hover ds:cursor-pointer',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\n/* -------------------------------------------------------------------------- */\n/* Props */\n/* -------------------------------------------------------------------------- */\n\nexport interface DateTimePickerProps extends Pick<\n VariantProps<typeof triggerVariants>,\n 'size'\n> {\n /** Current datetime — controlled. */\n value?: Date;\n /** Default datetime — uncontrolled. */\n defaultValue?: Date;\n /** Called when the datetime changes. */\n onChange?: (date: Date | undefined) => void;\n /** Timezone — IANA string, 'local', or 'utc'. */\n timezone?: string;\n /** Show timezone annotation. Defaults to true when tz differs from browser. */\n showTimezone?: boolean;\n /** Minimum datetime. */\n minDate?: Date;\n /** Maximum datetime. */\n maxDate?: Date;\n /** Force 12h/24h mode. */\n hour12?: boolean;\n /** Minute step for TimePicker. */\n minuteStep?: 1 | 5 | 10 | 15 | 30;\n /** Component size. */\n size?: 'sm' | 'md' | 'lg';\n /** Disabled state. */\n disabled?: boolean;\n /** Placeholder text. */\n placeholder?: string;\n /** Additional class names. */\n className?: string;\n /** id override. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------------- */\n\nexport const DateTimePicker = forwardRef<\n DateTimePickerHandle,\n DateTimePickerProps\n>(\n (\n {\n value,\n defaultValue,\n onChange,\n timezone,\n showTimezone: showTimezoneProp,\n minDate,\n maxDate,\n hour12,\n minuteStep = 1,\n size = 'md',\n disabled,\n placeholder,\n className,\n id,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const ctx = useFormField();\n const effectiveId = useFormFieldControlId(ctx, id);\n const effectiveDisabled = ctx.disabled || disabled;\n const effectiveTone = ctx.invalid ? 'error' : 'default';\n\n const locale = useDateFnsLocale(i18n.language);\n const calendarLabels = useDayPickerLabels();\n const placeholderText =\n placeholder ??\n t('inputs.dateTimePicker.placeholder', 'Select date and time');\n const applyLabel = t('inputs.dateTimePicker.apply', 'Apply');\n const outOfRangeLabel = t(\n 'inputs.dateTimePicker.outOfRange',\n 'Date/time is out of allowed range',\n );\n\n const showTimezone =\n showTimezoneProp !== undefined\n ? showTimezoneProp\n : tzDiffersFromBrowser(timezone);\n const timezoneLabel = showTimezone\n ? getTimezoneLabel(i18n.language, timezone)\n : '';\n\n const [currentValueRaw, setDateTimeValue] = useControllableState<\n Date | undefined\n >({\n value,\n defaultValue,\n onChange,\n });\n const currentValue = currentValueRaw;\n\n // Draft state while popover is open\n const [draftDate, setDraftDate] = useState<Date | undefined>(currentValue);\n const [open, setOpen] = useState(false);\n const [month, setMonth] = useState<Date>(currentValue ?? new Date());\n const [rangeError, setRangeError] = useState(false);\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const emit = useCallback(\n (date: Date | undefined) => {\n setDateTimeValue(date);\n },\n [setDateTimeValue],\n );\n\n const disabledMatcher = buildDisabledMatcher(minDate, maxDate);\n\n /** Check if a full datetime is within range. */\n const isInRange = useCallback(\n (date: Date): boolean => {\n if (minDate && isBefore(date, minDate)) return false;\n if (maxDate && isAfter(date, maxDate)) return false;\n return true;\n },\n [minDate, maxDate],\n );\n\n // Sync draft when popover opens\n const handleOpenChange = (nextOpen: boolean) => {\n if (nextOpen) {\n setDraftDate(currentValue ?? new Date());\n setMonth(currentValue ?? new Date());\n setRangeError(false);\n }\n setOpen(nextOpen);\n };\n\n const handleDaySelect = (date: Date | undefined) => {\n if (!date) return;\n const prev = draftDate ?? new Date();\n const merged = setMinutes(\n setHours(date, prev.getHours()),\n prev.getMinutes(),\n );\n setDraftDate(merged);\n setRangeError(!isInRange(merged));\n };\n\n const handleTimeChange = (time: TimeValue) => {\n const prev = draftDate ?? new Date();\n const merged = setMinutes(setHours(prev, time.hours), time.minutes);\n setDraftDate(merged);\n setRangeError(!isInRange(merged));\n };\n\n const handleApply = () => {\n if (!draftDate) return;\n if (!isInRange(draftDate)) {\n setRangeError(true);\n return;\n }\n emit(draftDate);\n setOpen(false);\n triggerRef.current?.focus();\n };\n\n // Format display text\n const displayText = currentValue\n ? new Intl.DateTimeFormat(formatLocale(i18n.language), {\n calendar: 'gregory',\n dateStyle: 'medium',\n timeStyle: 'short',\n hourCycle: 'h23',\n }).format(currentValue)\n : '';\n\n const calendarLabel = t('inputs.datePicker.gridLabel', 'Calendar');\n const timeLabel = t('inputs.timePicker.groupLabel', 'Time');\n\n const handle = useMemo<DateTimePickerHandle>(\n () => ({\n getValue: () => currentValue,\n setValue: (date) => emit(date),\n clear: () => emit(undefined),\n isOpen: () => open,\n // Mirror the trigger's open behaviour so draft state seeds correctly.\n open: () => {\n setDraftDate(currentValue ?? new Date());\n setMonth(currentValue ?? new Date());\n setRangeError(false);\n setOpen(true);\n },\n close: () => setOpen(false),\n }),\n [currentValue, emit, open],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(dateTimePickerAgent, handle, effectiveId);\n const exitOnTab = useNonModalTabExit(true, {\n getAnchor: findPopoverTrigger,\n onReturnToTrigger: () => handleOpenChange(false),\n });\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <div\n className={className}\n data-component=\"date-time-picker\"\n data-component-id={effectiveId}\n >\n <Popover.Trigger asChild disabled={effectiveDisabled}>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- FormField propagates invalid state to its trigger; users rely on this for validation announcements */}\n <button\n ref={triggerRef}\n id={effectiveId}\n type=\"button\"\n disabled={effectiveDisabled}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n // `aria-required` is not valid on `<button>` per ARIA 1.2 — the\n // FormField label's visible asterisk + `aria-describedby` link\n // communicate the required state instead.\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={triggerVariants({ size, tone: effectiveTone })}\n >\n <span\n className={\n displayText\n ? 'ds:text-foreground'\n : 'ds:text-muted-foreground'\n }\n >\n {displayText || placeholderText}\n </span>\n <span\n aria-hidden=\"true\"\n className={calendarIconVariants({ size })}\n >\n <CalendarDays />\n </span>\n </button>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n align=\"start\"\n onKeyDown={exitOnTab}\n className={popoverContentVariants()}\n >\n <div className=\"ds:flex ds:flex-col ds:sm:flex-row ds:gap-[var(--spacing-md)]\">\n {/* Calendar region */}\n <div role=\"region\" aria-label={calendarLabel}>\n {locale ? (\n <DayPicker\n mode=\"single\"\n selected={draftDate}\n onSelect={handleDaySelect}\n month={month}\n onMonthChange={setMonth}\n disabled={disabledMatcher}\n locale={locale}\n labels={calendarLabels}\n dir={i18n.dir()}\n showOutsideDays\n fixedWeeks\n classNames={calendarClassNames}\n components={{ Chevron: CalendarChevron }}\n />\n ) : (\n <Spinner />\n )}\n </div>\n\n {/* Time + Apply region */}\n <div\n role=\"region\"\n aria-label={timeLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:sm:border-s ds:sm:border-border ds:sm:ps-[var(--spacing-md)] ds:min-w-[10rem]\"\n >\n <TimePicker\n /* Its own id: inside a FormField it would otherwise\n take the field's, the same one as the trigger. */\n id={`${effectiveId}-time`}\n value={\n draftDate\n ? {\n hours: draftDate.getHours(),\n minutes: draftDate.getMinutes(),\n }\n : { hours: 0, minutes: 0 }\n }\n onChange={handleTimeChange}\n hour12={hour12}\n minuteStep={minuteStep}\n size={size}\n />\n\n {/* Timezone annotation */}\n {timezoneLabel ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {timezoneLabel}\n </span>\n ) : null}\n\n {/* Range error */}\n {rangeError ? (\n <span\n role=\"alert\"\n className=\"type-meta ds:text-destructive\"\n >\n {outOfRangeLabel}\n </span>\n ) : null}\n\n {/* Apply button */}\n <button\n type=\"button\"\n onClick={handleApply}\n disabled={!draftDate || rangeError}\n className={applyButtonVariants({ size })}\n >\n {applyLabel}\n </button>\n </div>\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n },\n);\n\nDateTimePicker.displayName = 'DateTimePicker';\n"],"names":["setHours","date","hours","options","_date","toDate","setMinutes","minutes","date_","dateTimePickerAgent","handle","_a","args","getTimezoneLabel","locale","timezone","opts","p","tzDiffersFromBrowser","browserTz","applyButtonVariants","cva","DateTimePicker","forwardRef","value","defaultValue","onChange","showTimezoneProp","minDate","maxDate","hour12","minuteStep","size","disabled","placeholder","className","id","ref","t","i18n","useTranslation","ctx","useFormField","effectiveId","useFormFieldControlId","effectiveDisabled","effectiveTone","useDateFnsLocale","calendarLabels","useDayPickerLabels","placeholderText","applyLabel","outOfRangeLabel","timezoneLabel","currentValueRaw","setDateTimeValue","useControllableState","currentValue","draftDate","setDraftDate","useState","open","setOpen","month","setMonth","rangeError","setRangeError","triggerRef","useRef","emit","useCallback","disabledMatcher","buildDisabledMatcher","isInRange","isBefore","isAfter","handleOpenChange","nextOpen","handleDaySelect","prev","merged","handleTimeChange","time","handleApply","displayText","formatLocale","calendarLabel","timeLabel","useMemo","useImperativeHandle","useAgentRegistration","exitOnTab","useNonModalTabExit","findPopoverTrigger","Popover","jsxs","jsx","triggerVariants","calendarIconVariants","CalendarDays","popoverContentVariants","DayPicker","calendarClassNames","CalendarChevron","Spinner","TimePicker"],"mappings":";;;;;;;;;;;;;;;AA4BO,SAASA,EAASC,GAAMC,GAAOC,GAAS;AAC7C,QAAMC,IAAQC,EAAOJ,GAAME,KAAA,gBAAAA,EAAS,EAAE;AACtC,SAAAC,EAAM,SAASF,CAAK,GACbE;AACT;ACJO,SAASE,EAAWL,GAAMM,GAASJ,GAAS;AACjD,QAAMK,IAAQH,EAAOJ,GAAME,KAAA,gBAAAA,EAAS,EAAE;AACtC,SAAAK,EAAM,WAAWD,CAAO,GACjBC;AACT;AClBO,MAAMC,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAA;;AAAW,iBAAAC,IAAAD,EAAO,SAAA,MAAP,gBAAAC,EAAmB,kBAAiB;AAAA;AAAA,IAAA;AAAA,IAExD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACD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OAAO,GAAG,SAAS,EAAA;AAAA,0BAE3B,UAAUuB;AAAA,0BACV,QAAAnD;AAAA,0BACA,YAAAC;AAAA,0BACA,MAAAC;AAAA,wBAAA;AAAA,sBAAA;AAAA,sBAIDqB,IACC,gBAAA2C,EAAC,QAAA,EAAK,WAAU,sCACb,aACH,IACE;AAAA,sBAGH/B,IACC,gBAAA+B;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,MAAK;AAAA,0BACL,WAAU;AAAA,0BAET,UAAA5C;AAAA,wBAAA;AAAA,sBAAA,IAED;AAAA,sBAGJ,gBAAA4C;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,MAAK;AAAA,0BACL,SAASb;AAAA,0BACT,UAAU,CAACzB,KAAaO;AAAA,0BACxB,WAAW7C,GAAoB,EAAE,MAAAY,GAAM;AAAA,0BAEtC,UAAAmB;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF,EAAA,CACF;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA7B,GAAe,cAAc;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"date-time-picker-cwsWiB4q.js","sources":["../../node_modules/date-fns/setHours.js","../../node_modules/date-fns/setMinutes.js","../../src/components/date-time-picker/date-time-picker.agent.ts","../../src/components/date-time-picker/date-time-picker.tsx"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setHours} function options.\n */\n\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param hours - The hours of the new date\n * @param options - An object with options\n *\n * @returns The new date with the hours set\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * const result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nexport function setHours(date, hours, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(hours);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMinutes} function options.\n */\n\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, returned from the context function, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param minutes - The minutes of the new date\n * @param options - An object with options\n *\n * @returns The new date with the minutes set\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nexport function setMinutes(date, minutes, options) {\n const date_ = toDate(date, options?.in);\n date_.setMinutes(minutes);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default setMinutes;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — DateTimePicker. */\n/* */\n/* DateTimePicker composes a react-day-picker calendar grid with the */\n/* TimePicker segments inside a single Radix Popover. The agent surface */\n/* exposes a combined datetime — set / clear / open / close. The handle */\n/* is the curated surface; consumers don't address the inner sub-widgets.*/\n/* */\n/* See `src/docs/26-agent-readiness.mdx` §15. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { DateTimePickerHandle } from './date-time-picker';\n\nexport const dateTimePickerAgent: AgentAdapter<DateTimePickerHandle> = {\n id: 'date-time-picker',\n // Persisted single datetime (value state + set_datetime) → select_single +\n // set_value, plus open/close of the combined popover.\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'iso-datetime',\n descriptionKey: 'ui.agent.dateTimePicker.state.value',\n description: 'Currently-selected ISO datetime, or null.',\n read: (handle) => handle.getValue()?.toISOString() ?? null,\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.dateTimePicker.state.isOpen',\n description: 'Whether the datetime popover is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_datetime: {\n safety: 'write',\n argsType: '{ datetime: string }',\n argsSchema: {\n type: 'object',\n properties: {\n datetime: {\n type: 'string',\n format: 'date-time',\n description: 'ISO datetime, e.g. \"2026-06-23T14:30:00Z\".',\n },\n },\n required: ['datetime'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.setDatetime',\n description: 'Select a specific datetime (ISO string).',\n examples: [\n {\n args: { datetime: '2026-06-23T14:30:00Z' },\n note: 'Select 23 Jun 2026, 14:30 UTC.',\n },\n ],\n invoke: (handle, args: { datetime: string }) => {\n handle.setValue(new Date(args.datetime));\n },\n },\n clear: {\n // Discards the selected datetime — loses the user's input.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.clear',\n description: 'Clear the selected datetime.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.open',\n description: 'Open the datetime popover.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.dateTimePicker.actions.close',\n description: 'Close the datetime popover.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'date-time-picker',\n description: 'Marks the DateTimePicker wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n findPopoverTrigger,\n useNonModalTabExit,\n} from '../_shared/non-modal-tab-exit';\nimport { Spinner } from '../spinner';\nimport { useDayPickerLabels } from '../_shared/day-picker-labels';\nimport { DayPicker } from 'react-day-picker';\nimport { isBefore, isAfter, setHours, setMinutes } from 'date-fns';\nimport { CalendarDays } from 'lucide-react';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport {\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport {\n useDateFnsLocale,\n buildDisabledMatcher,\n CalendarChevron,\n calendarClassNames,\n triggerVariants,\n calendarIconVariants,\n popoverContentVariants,\n} from '../_shared';\nimport { TimePicker } from '../time-picker/time-picker';\nimport type { TimeValue } from '../_shared/time';\nimport { formatLocale } from '../_shared/intl-locale';\nimport { useAgentRegistration } from '../../agent';\nimport { dateTimePickerAgent } from './date-time-picker.agent';\n\n/* -------------------------------------------------------------------------- */\n/* Imperative handle */\n/* -------------------------------------------------------------------------- */\n\n/** Curated imperative handle exposed via `ref` — also consumed by the agent adapter. */\nexport interface DateTimePickerHandle {\n /** Get the current selected datetime, or undefined. */\n getValue: () => Date | undefined;\n /** Set the selected datetime. */\n setValue: (date: Date | undefined) => void;\n /** Clear the selected datetime. */\n clear: () => void;\n /** Whether the popover is open. */\n isOpen: () => boolean;\n /** Open the popover. */\n open: () => void;\n /** Close the popover. */\n close: () => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------------- */\n\n/** Get timezone short name. */\nfunction getTimezoneLabel(locale: string, timezone?: string): string {\n try {\n const opts: Intl.DateTimeFormatOptions = { timeZoneName: 'short' };\n if (timezone && timezone !== 'local') {\n opts.timeZone = timezone === 'utc' ? 'UTC' : timezone;\n }\n const parts = new Intl.DateTimeFormat(locale, opts).formatToParts(\n new Date(),\n );\n return parts.find((p) => p.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n/** Check if a timezone differs from the browser's. */\nfunction tzDiffersFromBrowser(timezone?: string): boolean {\n if (!timezone || timezone === 'local') return false;\n try {\n const browserTz = Intl.DateTimeFormat().resolvedOptions().timeZone;\n if (timezone === 'utc') return browserTz !== 'UTC';\n return browserTz !== timezone;\n } catch {\n return false;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* CVA variants */\n/* -------------------------------------------------------------------------- */\n\nconst applyButtonVariants = cva(\n [\n 'ds:w-full ds:rounded-[var(--radius-sm)]',\n 'ds:bg-primary ds:text-primary-foreground',\n 'ds:hover:bg-primary-hover ds:cursor-pointer',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\n/* -------------------------------------------------------------------------- */\n/* Props */\n/* -------------------------------------------------------------------------- */\n\nexport interface DateTimePickerProps extends Pick<\n VariantProps<typeof triggerVariants>,\n 'size'\n> {\n /** Current datetime — controlled. */\n value?: Date;\n /** Default datetime — uncontrolled. */\n defaultValue?: Date;\n /** Called when the datetime changes. */\n onChange?: (date: Date | undefined) => void;\n /** Timezone — IANA string, 'local', or 'utc'. */\n timezone?: string;\n /** Show timezone annotation. Defaults to true when tz differs from browser. */\n showTimezone?: boolean;\n /** Minimum datetime. */\n minDate?: Date;\n /** Maximum datetime. */\n maxDate?: Date;\n /** Force 12h/24h mode. */\n hour12?: boolean;\n /** Minute step for TimePicker. */\n minuteStep?: 1 | 5 | 10 | 15 | 30;\n /** Component size. */\n size?: 'sm' | 'md' | 'lg';\n /** Disabled state. */\n disabled?: boolean;\n /** Placeholder text. */\n placeholder?: string;\n /** Additional class names. */\n className?: string;\n /** id override. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------------- */\n\nexport const DateTimePicker = forwardRef<\n DateTimePickerHandle,\n DateTimePickerProps\n>(\n (\n {\n value,\n defaultValue,\n onChange,\n timezone,\n showTimezone: showTimezoneProp,\n minDate,\n maxDate,\n hour12,\n minuteStep = 1,\n size = 'md',\n disabled,\n placeholder,\n className,\n id,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const ctx = useFormField();\n const effectiveId = useFormFieldControlId(ctx, id);\n const effectiveDisabled = ctx.disabled || disabled;\n const effectiveTone = ctx.invalid ? 'error' : 'default';\n\n const locale = useDateFnsLocale(i18n.language);\n const calendarLabels = useDayPickerLabels();\n const placeholderText =\n placeholder ??\n t('inputs.dateTimePicker.placeholder', 'Select date and time');\n const applyLabel = t('inputs.dateTimePicker.apply', 'Apply');\n const outOfRangeLabel = t(\n 'inputs.dateTimePicker.outOfRange',\n 'Date/time is out of allowed range',\n );\n\n const showTimezone =\n showTimezoneProp !== undefined\n ? showTimezoneProp\n : tzDiffersFromBrowser(timezone);\n const timezoneLabel = showTimezone\n ? getTimezoneLabel(i18n.language, timezone)\n : '';\n\n const [currentValueRaw, setDateTimeValue] = useControllableState<\n Date | undefined\n >({\n value,\n defaultValue,\n onChange,\n });\n const currentValue = currentValueRaw;\n\n // Draft state while popover is open\n const [draftDate, setDraftDate] = useState<Date | undefined>(currentValue);\n const [open, setOpen] = useState(false);\n const [month, setMonth] = useState<Date>(currentValue ?? new Date());\n const [rangeError, setRangeError] = useState(false);\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const emit = useCallback(\n (date: Date | undefined) => {\n setDateTimeValue(date);\n },\n [setDateTimeValue],\n );\n\n const disabledMatcher = buildDisabledMatcher(minDate, maxDate);\n\n /** Check if a full datetime is within range. */\n const isInRange = useCallback(\n (date: Date): boolean => {\n if (minDate && isBefore(date, minDate)) return false;\n if (maxDate && isAfter(date, maxDate)) return false;\n return true;\n },\n [minDate, maxDate],\n );\n\n // Sync draft when popover opens\n const handleOpenChange = (nextOpen: boolean) => {\n if (nextOpen) {\n setDraftDate(currentValue ?? new Date());\n setMonth(currentValue ?? new Date());\n setRangeError(false);\n }\n setOpen(nextOpen);\n };\n\n const handleDaySelect = (date: Date | undefined) => {\n if (!date) return;\n const prev = draftDate ?? new Date();\n const merged = setMinutes(\n setHours(date, prev.getHours()),\n prev.getMinutes(),\n );\n setDraftDate(merged);\n setRangeError(!isInRange(merged));\n };\n\n const handleTimeChange = (time: TimeValue) => {\n const prev = draftDate ?? new Date();\n const merged = setMinutes(setHours(prev, time.hours), time.minutes);\n setDraftDate(merged);\n setRangeError(!isInRange(merged));\n };\n\n const handleApply = () => {\n if (!draftDate) return;\n if (!isInRange(draftDate)) {\n setRangeError(true);\n return;\n }\n emit(draftDate);\n setOpen(false);\n triggerRef.current?.focus();\n };\n\n // Format display text\n const displayText = currentValue\n ? new Intl.DateTimeFormat(formatLocale(i18n.language), {\n calendar: 'gregory',\n dateStyle: 'medium',\n timeStyle: 'short',\n hourCycle: 'h23',\n }).format(currentValue)\n : '';\n\n const calendarLabel = t('inputs.datePicker.gridLabel', 'Calendar');\n const timeLabel = t('inputs.timePicker.groupLabel', 'Time');\n\n const handle = useMemo<DateTimePickerHandle>(\n () => ({\n getValue: () => currentValue,\n setValue: (date) => emit(date),\n clear: () => emit(undefined),\n isOpen: () => open,\n // Mirror the trigger's open behaviour so draft state seeds correctly.\n open: () => {\n setDraftDate(currentValue ?? new Date());\n setMonth(currentValue ?? new Date());\n setRangeError(false);\n setOpen(true);\n },\n close: () => setOpen(false),\n }),\n [currentValue, emit, open],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(dateTimePickerAgent, handle, effectiveId);\n const exitOnTab = useNonModalTabExit(true, {\n getAnchor: findPopoverTrigger,\n onReturnToTrigger: () => handleOpenChange(false),\n });\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <div\n className={className}\n data-component=\"date-time-picker\"\n data-component-id={effectiveId}\n >\n <Popover.Trigger asChild disabled={effectiveDisabled}>\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- FormField propagates invalid state to its trigger; users rely on this for validation announcements */}\n <button\n ref={triggerRef}\n id={effectiveId}\n type=\"button\"\n disabled={effectiveDisabled}\n aria-describedby={ctx.describedBy || undefined}\n aria-invalid={ctx.invalid || undefined}\n // `aria-required` is not valid on `<button>` per ARIA 1.2 — the\n // FormField label's visible asterisk + `aria-describedby` link\n // communicate the required state instead.\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={triggerVariants({ size, tone: effectiveTone })}\n >\n <span\n className={\n displayText\n ? 'ds:text-foreground'\n : 'ds:text-muted-foreground'\n }\n >\n {displayText || placeholderText}\n </span>\n <span\n aria-hidden=\"true\"\n className={calendarIconVariants({ size })}\n >\n <CalendarDays />\n </span>\n </button>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n align=\"start\"\n onKeyDown={exitOnTab}\n className={popoverContentVariants()}\n >\n <div className=\"ds:flex ds:flex-col ds:sm:flex-row ds:gap-[var(--spacing-md)]\">\n {/* Calendar region */}\n <div role=\"region\" aria-label={calendarLabel}>\n {locale ? (\n <DayPicker\n mode=\"single\"\n selected={draftDate}\n onSelect={handleDaySelect}\n month={month}\n onMonthChange={setMonth}\n disabled={disabledMatcher}\n locale={locale}\n labels={calendarLabels}\n dir={i18n.dir()}\n showOutsideDays\n fixedWeeks\n classNames={calendarClassNames}\n components={{ Chevron: CalendarChevron }}\n />\n ) : (\n <Spinner />\n )}\n </div>\n\n {/* Time + Apply region */}\n <div\n role=\"region\"\n aria-label={timeLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:sm:border-s ds:sm:border-border ds:sm:ps-[var(--spacing-md)] ds:min-w-[10rem]\"\n >\n <TimePicker\n /* Its own id: inside a FormField it would otherwise\n take the field's, the same one as the trigger. */\n id={`${effectiveId}-time`}\n value={\n draftDate\n ? {\n hours: draftDate.getHours(),\n minutes: draftDate.getMinutes(),\n }\n : { hours: 0, minutes: 0 }\n }\n onChange={handleTimeChange}\n hour12={hour12}\n minuteStep={minuteStep}\n size={size}\n />\n\n {/* Timezone annotation */}\n {timezoneLabel ? (\n <span className=\"type-meta ds:text-muted-foreground\">\n {timezoneLabel}\n </span>\n ) : null}\n\n {/* Range error */}\n {rangeError ? (\n <span\n role=\"alert\"\n className=\"type-meta ds:text-destructive\"\n >\n {outOfRangeLabel}\n </span>\n ) : null}\n\n {/* Apply button */}\n <button\n type=\"button\"\n onClick={handleApply}\n disabled={!draftDate || rangeError}\n className={applyButtonVariants({ size })}\n >\n {applyLabel}\n </button>\n </div>\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n },\n);\n\nDateTimePicker.displayName = 'DateTimePicker';\n"],"names":["setHours","date","hours","options","_date","toDate","setMinutes","minutes","date_","dateTimePickerAgent","handle","_a","args","getTimezoneLabel","locale","timezone","opts","p","tzDiffersFromBrowser","browserTz","applyButtonVariants","cva","DateTimePicker","forwardRef","value","defaultValue","onChange","showTimezoneProp","minDate","maxDate","hour12","minuteStep","size","disabled","placeholder","className","id","ref","t","i18n","useTranslation","ctx","useFormField","effectiveId","useFormFieldControlId","effectiveDisabled","effectiveTone","useDateFnsLocale","calendarLabels","useDayPickerLabels","placeholderText","applyLabel","outOfRangeLabel","timezoneLabel","currentValueRaw","setDateTimeValue","useControllableState","currentValue","draftDate","setDraftDate","useState","open","setOpen","month","setMonth","rangeError","setRangeError","triggerRef","useRef","emit","useCallback","disabledMatcher","buildDisabledMatcher","isInRange","isBefore","isAfter","handleOpenChange","nextOpen","handleDaySelect","prev","merged","handleTimeChange","time","handleApply","displayText","formatLocale","calendarLabel","timeLabel","useMemo","useImperativeHandle","useAgentRegistration","exitOnTab","useNonModalTabExit","findPopoverTrigger","Popover","jsxs","jsx","triggerVariants","calendarIconVariants","CalendarDays","popoverContentVariants","DayPicker","calendarClassNames","CalendarChevron","Spinner","TimePicker"],"mappings":";;;;;;;;;;;;;;;AA4BO,SAASA,EAASC,GAAMC,GAAOC,GAAS;AAC7C,QAAMC,IAAQC,EAAOJ,GAAME,KAAA,gBAAAA,EAAS,EAAE;AACtC,SAAAC,EAAM,SAASF,CAAK,GACbE;AACT;ACJO,SAASE,EAAWL,GAAMM,GAASJ,GAAS;AACjD,QAAMK,IAAQH,EAAOJ,GAAME,KAAA,gBAAAA,EAAS,EAAE;AACtC,SAAAK,EAAM,WAAWD,CAAO,GACjBC;AACT;AClBO,MAAMC,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAA;;AAAW,iBAAAC,IAAAD,EAAO,SAAA,MAAP,gBAAAC,EAAmB,kBAAiB;AAAA;AAAA,IAAA;AAAA,IAExD,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACD,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,cAAc;AAAA,MACZ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,UAAU;AAAA,YACR,MAAM;AAAA,YACN,QAAQ;AAAA,YACR,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,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,MAAK;AAAA,0BACL,WAAU;AAAA,0BAET,UAAA5C;AAAA,wBAAA;AAAA,sBAAA,IAED;AAAA,sBAGJ,gBAAA4C;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,MAAK;AAAA,0BACL,SAASb;AAAA,0BACT,UAAU,CAACzB,KAAaO;AAAA,0BACxB,WAAW7C,GAAoB,EAAE,MAAAY,GAAM;AAAA,0BAEtC,UAAAmB;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF,EAAA,CACF;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA7B,GAAe,cAAc;","x_google_ignoreList":[0,1]}
|
|
@@ -5,7 +5,7 @@ import { useTranslation as J } from "react-i18next";
|
|
|
5
5
|
import { u as Q } from "./registry-DvAUVLHh.js";
|
|
6
6
|
import { F as S } from "./form-field-CyHfOVKF.js";
|
|
7
7
|
import { N as P } from "./number-input-CVwI1ltI.js";
|
|
8
|
-
import { D as G } from "./date-time-picker-
|
|
8
|
+
import { D as G } from "./date-time-picker-cwsWiB4q.js";
|
|
9
9
|
import { C as B } from "./card-BA4Ig_kn.js";
|
|
10
10
|
import { B as X } from "./badge-BUk4RjTS.js";
|
|
11
11
|
import { I as ee } from "./insert-result-CDMMt7q8.js";
|
|
@@ -309,4 +309,4 @@ export {
|
|
|
309
309
|
re as M,
|
|
310
310
|
oe as a
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=hcg-doubling-
|
|
312
|
+
//# sourceMappingURL=hcg-doubling-DQe1ptNB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hcg-doubling-K41Wy7LB.js","sources":["../../node_modules/date-fns/formatISO.js","../../src/components/hcg-doubling/hcg-doubling.agent.ts","../../src/components/hcg-doubling/hcg.ts","../../src/components/hcg-doubling/hcg-doubling.tsx"],"sourcesContent":["import { addLeadingZeros } from \"./_lib/addLeadingZeros.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link formatISO} function options.\n */\n\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param date - The original date\n * @param options - An object with options.\n *\n * @returns The formatted date string (in local time zone)\n *\n * @throws `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport function formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const format = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n\n let result = \"\";\n let tzOffset = \"\";\n\n const dateDelimiter = format === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format === \"extended\" ? \":\" : \"\";\n\n // Representation is either 'date' or 'complete'\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== \"date\") {\n // Add the timezone.\n const offset = date_.getTimezoneOffset();\n\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = offset < 0 ? \"+\" : \"-\";\n\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n const separator = result === \"\" ? \"\" : \"T\";\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n const time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = `${result}${separator}${time}${tzOffset}`;\n }\n\n return result;\n}\n\n// Fallback for modularized imports:\nexport default formatISO;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — HcgDoubling. */\n/* */\n/* Clinical calculator: two timed serum β-hCG values → doubling time, */\n/* 48-hour-normalised rise and a viability trend band. The agent surface */\n/* is the two timed samples plus the computed trend; the handle is the */\n/* curated `HcgDoublingHandle` (the public `ref` stays the root <div>, */\n/* exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset, so */\n/* the interval between the two draws survives serialisation. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural lab figures and the numbers derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HcgDoublingHandle } from './hcg-doubling';\n\n/** JSON Schema fragment for one optional β-hCG value, mIU/mL. */\nconst hcgValue = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in mIU/mL, or null to clear it.`,\n});\n\n/** JSON Schema fragment for one optional sample time. */\nconst sampleTime = (label: string) => ({\n oneOf: [{ type: 'string', format: 'date-time' }, { type: 'null' }],\n description: `${label} as an ISO-8601 timestamp with offset (e.g. 2026-08-01T09:30:00+02:00), not in the future, or null to clear it.`,\n});\n\nexport const hcgDoublingAgent: AgentAdapter<HcgDoublingHandle> = {\n id: 'hcg-doubling',\n // set_value → the `set_samples` action + the `samples` state slot.\n capabilities: ['set_value'],\n state: {\n samples: {\n type: '{ hcg1: number | null, date1: string | null, hcg2: number | null, date2: string | null }',\n descriptionKey: 'ui.agent.hcgDoubling.state.samples',\n description:\n 'The two timed β-hCG samples as entered — value in mIU/mL plus the draw time as an ISO-8601 timestamp. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getSamples(),\n },\n result: {\n type: \"{ intervalHours: number, ratio: number, percentRise: number, twoDayRisePercent: number, doublingTimeHours: number | null, trend: 'rising-normal' | 'rising-slow' | 'plateau-falling' } | null\",\n descriptionKey: 'ui.agent.hcgDoubling.state.result',\n description:\n 'Computed doubling time in hours (null when not rising), the rise normalised to 48 hours, and the trend band against the minimal-rise benchmark. Null until both samples are set and the second is after the first.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_samples: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ hcg1?: number | null, date1?: string | null, hcg2?: number | null, date2?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n hcg1: hcgValue('First β-hCG value'),\n date1: sampleTime('When the first sample was drawn'),\n hcg2: hcgValue('Second β-hCG value'),\n date2: sampleTime('When the second sample was drawn'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the samples were applied.',\n },\n errors: [\n 'Returns false and writes nothing when a value is not positive, a timestamp is unparseable, or a timestamp is in the future — the payload applies all-or-nothing.',\n 'Applies cleanly but leaves `result` null when the second sample is not strictly after the first — the analysis needs a forward interval.',\n ],\n examples: [\n {\n args: {\n hcg1: 1200,\n date1: '2026-08-01T09:00:00+02:00',\n hcg2: 2500,\n date2: '2026-08-03T09:00:00+02:00',\n },\n note: 'A doubling over 48 hours → the rising-normal band.',\n },\n ],\n descriptionKey: 'ui.agent.hcgDoubling.actions.setSamples',\n description:\n 'Set any subset of the two timed β-hCG samples. Omitted keys are left unchanged; an explicit null clears one. All four are needed before a trend is computed.',\n invoke: (\n handle,\n args: {\n hcg1?: number | null;\n date1?: string | null;\n hcg2?: number | null;\n date2?: string | null;\n },\n ) => handle.setSamples(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'hcg-doubling',\n description:\n 'Marks the HcgDoubling calculator (serum β-hCG doubling time from two timed values).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven action/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Serum β-hCG doubling time — early-pregnancy viability. */\n/* */\n/* Pure, framework-free, unit-testable. From two timed β-hCG values it */\n/* derives the doubling time, the rise over the actual interval, and the */\n/* rise normalised to 48 hours (the standard comparison window). */\n/* A 35% rise is a conservative threshold when assessing a potentially */\n/* viable early pregnancy, interpreted alongside ultrasound and the */\n/* clinical picture. Seeber et al. Fertil Steril 2006;86:454-9. */\n/* https://pubmed.ncbi.nlm.nih.gov/16753158/ */\n/* ------------------------------------------------------------------ */\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n/** Conservative minimal 48-hour rise for a potentially viable IUP, %. */\nexport const MINIMAL_48H_RISE_PERCENT = 35;\n\nexport interface HcgInput {\n /** First β-hCG value, mIU/mL. */\n hcg1: number;\n /** When the first sample was drawn. */\n date1: Date;\n /** Second β-hCG value, mIU/mL. */\n hcg2: number;\n /** When the second sample was drawn (must be after `date1`). */\n date2: Date;\n}\n\nexport type HcgTrend = 'rising-normal' | 'rising-slow' | 'plateau-falling';\n\nexport interface HcgResult {\n /** Hours between the two samples. */\n intervalHours: number;\n /** hcg2 / hcg1. */\n ratio: number;\n /** Rise over the actual interval, %. */\n percentRise: number;\n /** Rise normalised to a 48-hour window, % (comparable to the benchmark). */\n twoDayRisePercent: number;\n /** Doubling time in hours, or `null` when not rising. */\n doublingTimeHours: number | null;\n /** Trend band against the conservative Seeber 48-hour rise threshold. */\n trend: HcgTrend;\n}\n\n/**\n * Analyse a two-point β-hCG series. Returns `null` unless both values are\n * positive and the second sample is strictly after the first.\n */\nexport function analyseHcg(input: HcgInput): HcgResult | null {\n const { hcg1, hcg2, date1, date2 } = input;\n if (!(hcg1 > 0) || !(hcg2 > 0)) return null;\n\n const intervalHours = (date2.getTime() - date1.getTime()) / MS_PER_HOUR;\n if (!(intervalHours > 0)) return null;\n\n const ratio = hcg2 / hcg1;\n const percentRise = (ratio - 1) * 100;\n const twoDayRisePercent = (ratio ** (48 / intervalHours) - 1) * 100;\n const doublingTimeHours =\n ratio > 1 ? (intervalHours * Math.LN2) / Math.log(ratio) : null;\n\n const trend: HcgTrend =\n ratio <= 1\n ? 'plateau-falling'\n : twoDayRisePercent >= MINIMAL_48H_RISE_PERCENT\n ? 'rising-normal'\n : 'rising-slow';\n\n return {\n intervalHours,\n ratio,\n percentRise,\n twoDayRisePercent,\n doublingTimeHours,\n trend,\n };\n}\n","/* ------------------------------------------------------------------ */\n/* HcgDoubling — serum β-hCG doubling time from two timed values. */\n/* */\n/* Maths in `./hcg` (pure, tested). Two timepoints (value + datetime) */\n/* → doubling time, 48-hour-normalised rise and a viability trend band. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { formatISO, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { hcgDoublingAgent } from './hcg-doubling.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { DateTimePicker } from '../date-time-picker';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport { type HcgResult, type HcgTrend, analyseHcg } from './hcg';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\nconst TREND_BADGE: Record<HcgTrend, 'success' | 'warning' | 'error'> = {\n 'rising-normal': 'success',\n 'rising-slow': 'warning',\n 'plateau-falling': 'error',\n};\nconst TREND_TOKEN: Record<HcgTrend, string> = {\n 'rising-normal': '--success',\n 'rising-slow': '--warning-readable',\n 'plateau-falling': '--destructive',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset */\n/* (`2026-08-01T09:30:00+02:00`), never `Date` objects — the doubling */\n/* maths is a difference between two instants, so the offset has to */\n/* survive the trip. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDateTime = (d: Date): string => formatISO(d);\n\nconst fromIsoDateTime = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** A β-hCG figure is usable when it is a positive finite number, or cleared. */\nconst isHcgValue = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** The two timed samples as entered. */\nexport interface HcgSamplesSnapshot {\n /** First β-hCG value, mIU/mL, or null. */\n hcg1: number | null;\n /** When the first sample was drawn, ISO-8601 with offset, or null. */\n date1: string | null;\n /** Second β-hCG value, mIU/mL, or null. */\n hcg2: number | null;\n /** When the second sample was drawn, ISO-8601 with offset, or null. */\n date2: string | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the two\n * timed samples and the computed trend, and writes the samples the way a user\n * would enter them. Never exposes patient identity — only structural lab\n * figures, sample times and the derived doubling numbers. Consumed by\n * `hcg-doubling.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface HcgDoublingHandle {\n /** The two timed samples as entered, or null where unset. */\n getSamples: () => HcgSamplesSnapshot;\n /** Computed doubling time, 48-hour rise and trend band, or null. */\n getResult: () => HcgResult | null;\n /**\n * Set any subset of the two timed samples. Omitted keys are left unchanged;\n * an explicit `null` clears one. Applies all-or-nothing — returns false and\n * writes nothing if any value is unusable.\n */\n setSamples: (next: Partial<HcgSamplesSnapshot>) => boolean;\n}\n\nexport interface HcgDoublingProps extends VariantProps<typeof rootVariants> {\n /** Pre-fill the first sample's date/time (e.g. from the lab record). */\n defaultDate1?: Date;\n /** Pre-fill the second sample's date/time. */\n defaultDate2?: Date;\n /** Fires whenever both timed values resolve (and `null` when not). */\n onResultChange?: (result: HcgResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const HcgDoubling = forwardRef<HTMLDivElement, HcgDoublingProps>(\n (\n {\n defaultDate1,\n defaultDate2,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [hcg1, setHcg1] = useState<number | null>(null);\n const [date1, setDate1] = useState<Date | undefined>(defaultDate1);\n const [hcg2, setHcg2] = useState<number | null>(null);\n const [date2, setDate2] = useState<Date | undefined>(defaultDate2);\n\n const today = useMemo(() => new Date(), []);\n\n const result = useMemo(() => {\n if (hcg1 === null || hcg2 === null || !date1 || !date2) return null;\n return analyseHcg({ hcg1, date1, hcg2, date2 });\n }, [hcg1, date1, hcg2, date2]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ hcg1, date1, hcg2, date2, result });\n liveRef.current = { hcg1, date1, hcg2, date2, result };\n\n const agentHandle = useMemo<HcgDoublingHandle>(\n () => ({\n getSamples: () => {\n const live = liveRef.current;\n return {\n hcg1: live.hcg1,\n date1: live.date1 ? toIsoDateTime(live.date1) : null,\n hcg2: live.hcg2,\n date2: live.date2 ? toIsoDateTime(live.date2) : null,\n };\n },\n getResult: () => liveRef.current.result,\n setSamples: (next) => {\n const now = new Date();\n const parsed: { date1?: Date | undefined; date2?: Date | undefined } =\n {};\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const key of ['hcg1', 'hcg2'] as const) {\n if (key in next && !isHcgValue(next[key])) return false;\n }\n for (const key of ['date1', 'date2'] as const) {\n if (!(key in next)) continue;\n const iso = next[key];\n if (iso === null || iso === undefined) {\n parsed[key] = undefined;\n continue;\n }\n const d = fromIsoDateTime(iso);\n // The DateTimePickers cap at now; the handle honours the same bound.\n if (!d || isAfter(d, now)) return false;\n parsed[key] = d;\n }\n if ('hcg1' in next) setHcg1(next.hcg1 ?? null);\n if ('hcg2' in next) setHcg2(next.hcg2 ?? null);\n if ('date1' in next) setDate1(parsed.date1);\n if ('date2' in next) setDate2(parsed.date2);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(hcgDoublingAgent, agentHandle, id);\n\n const num = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const doublingText = (r: HcgResult): string =>\n r.doublingTimeHours === null\n ? '—'\n : t('hcgDoubling.hoursValue', {\n hours: num.format(r.doublingTimeHours),\n });\n const riseText = (r: HcgResult): string =>\n t('hcgDoubling.percentValue', { value: num.format(r.twoDayRisePercent) });\n\n return (\n <div\n ref={ref}\n data-component=\"hcg-doubling\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={`${t('hcgDoubling.hcg1')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg1}\n onChange={setHcg1}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date1')}>\n <DateTimePicker value={date1} onChange={setDate1} maxDate={today} />\n </FormField>\n <FormField\n label={`${t('hcgDoubling.hcg2')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg2}\n onChange={setHcg2}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date2')}>\n <DateTimePicker value={date2} onChange={setDate2} maxDate={today} />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('hcgDoubling.doublingLabel')}: ${doublingText(result)}. ${t(\n `hcgDoubling.trend.${result.trend}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.doublingLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {doublingText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.riseLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {riseText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.trendLabel')}\n </dt>\n <dd>\n <Badge variant={TREND_BADGE[result.trend]} size=\"lg\">\n {t(`hcgDoubling.trend.${result.trend}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('hcgDoubling.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.hcg'),\n icon: 'activity',\n highlight: t(`hcgDoubling.trend.${result.trend}`),\n highlightToken: TREND_TOKEN[result.trend],\n brand: insertBrand,\n fields: [\n {\n icon: 'clock',\n label: t('hcgDoubling.doublingLabel'),\n value: doublingText(result),\n },\n {\n icon: 'trending-up',\n label: t('hcgDoubling.riseLabel'),\n value: riseText(result),\n },\n {\n icon: 'tag',\n label: t('hcgDoubling.trendLabel'),\n value: t(`hcgDoubling.trend.${result.trend}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('hcgDoubling.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nHcgDoubling.displayName = 'HcgDoubling';\n"],"names":["formatISO","date","options","date_","toDate","result","tzOffset","dateDelimiter","timeDelimiter","day","addLeadingZeros","month","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","hcgValue","label","sampleTime","hcgDoublingAgent","handle","args","MS_PER_HOUR","MINIMAL_48H_RISE_PERCENT","analyseHcg","input","hcg1","hcg2","date1","date2","intervalHours","ratio","percentRise","twoDayRisePercent","doublingTimeHours","trend","rootVariants","cva","TREND_BADGE","TREND_TOKEN","toIsoDateTime","d","fromIsoDateTime","iso","parseISO","isHcgValue","n","HcgDoubling","forwardRef","defaultDate1","defaultDate2","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","setHcg1","useState","setDate1","setHcg2","setDate2","today","useMemo","useEffect","liveRef","useRef","agentHandle","live","next","now","parsed","key","isAfter","useAgentRegistration","num","doublingText","r","riseText","jsxs","jsx","FormField","NumberInput","DateTimePicker","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;;;;;AA0CO,SAASA,GAAUC,GAAMC,GAAS;AACvC,QAAMC,IAAQC,GAAOH,GAAMC,KAAA,gBAAAA,EAAS,EAAE;AAEtC,MAAI,MAAM,CAACC,CAAK;AACd,UAAM,IAAI,WAAW,oBAAoB;AAM3C,MAAIE,IAAS,IACTC,IAAW;AAEf,QAAMC,IAAwC,KACxCC,IAAwC;AAGf;AAC7B,UAAMC,IAAMC,EAAgBP,EAAM,QAAO,GAAI,CAAC,GACxCQ,IAAQD,EAAgBP,EAAM,SAAQ,IAAK,GAAG,CAAC;AAIrD,IAAAE,IAAS,GAHIK,EAAgBP,EAAM,YAAW,GAAI,CAAC,CAGnC,GAAGI,CAAa,GAAGI,CAAK,GAAGJ,CAAa,GAAGE,CAAG;AAAA,EAChE;AAG+B;AAE7B,UAAMG,IAAST,EAAM,kBAAiB;AAEtC,QAAIS,MAAW,GAAG;AAChB,YAAMC,IAAiB,KAAK,IAAID,CAAM,GAChCE,IAAaJ,EAAgB,KAAK,MAAMG,IAAiB,EAAE,GAAG,CAAC,GAC/DE,IAAeL,EAAgBG,IAAiB,IAAI,CAAC;AAI3D,MAAAP,IAAW,GAFEM,IAAS,IAAI,MAAM,GAEd,GAAGE,CAAU,IAAIC,CAAY;AAAA,IACjD;AACE,MAAAT,IAAW;AAGb,UAAMU,IAAON,EAAgBP,EAAM,SAAQ,GAAI,CAAC,GAC1Cc,IAASP,EAAgBP,EAAM,WAAU,GAAI,CAAC,G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E,MAAM;AAAA,sBACN,OAAO,EAAE,wBAAwB;AAAA,sBACjC,OAAO,EAAE,qBAAqBA,EAAO,KAAK,EAAE;AAAA,oBAAA;AAAA,kBAC9C;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAsF,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAvC,GAAY,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"hcg-doubling-DQe1ptNB.js","sources":["../../node_modules/date-fns/formatISO.js","../../src/components/hcg-doubling/hcg-doubling.agent.ts","../../src/components/hcg-doubling/hcg.ts","../../src/components/hcg-doubling/hcg-doubling.tsx"],"sourcesContent":["import { addLeadingZeros } from \"./_lib/addLeadingZeros.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link formatISO} function options.\n */\n\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param date - The original date\n * @param options - An object with options.\n *\n * @returns The formatted date string (in local time zone)\n *\n * @throws `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport function formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const format = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n\n let result = \"\";\n let tzOffset = \"\";\n\n const dateDelimiter = format === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format === \"extended\" ? \":\" : \"\";\n\n // Representation is either 'date' or 'complete'\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== \"date\") {\n // Add the timezone.\n const offset = date_.getTimezoneOffset();\n\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = offset < 0 ? \"+\" : \"-\";\n\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n const separator = result === \"\" ? \"\" : \"T\";\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n const time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = `${result}${separator}${time}${tzOffset}`;\n }\n\n return result;\n}\n\n// Fallback for modularized imports:\nexport default formatISO;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — HcgDoubling. */\n/* */\n/* Clinical calculator: two timed serum β-hCG values → doubling time, */\n/* 48-hour-normalised rise and a viability trend band. The agent surface */\n/* is the two timed samples plus the computed trend; the handle is the */\n/* curated `HcgDoublingHandle` (the public `ref` stays the root <div>, */\n/* exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset, so */\n/* the interval between the two draws survives serialisation. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural lab figures and the numbers derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HcgDoublingHandle } from './hcg-doubling';\n\n/** JSON Schema fragment for one optional β-hCG value, mIU/mL. */\nconst hcgValue = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in mIU/mL, or null to clear it.`,\n});\n\n/** JSON Schema fragment for one optional sample time. */\nconst sampleTime = (label: string) => ({\n oneOf: [{ type: 'string', format: 'date-time' }, { type: 'null' }],\n description: `${label} as an ISO-8601 timestamp with offset (e.g. 2026-08-01T09:30:00+02:00), not in the future, or null to clear it.`,\n});\n\nexport const hcgDoublingAgent: AgentAdapter<HcgDoublingHandle> = {\n id: 'hcg-doubling',\n // set_value → the `set_samples` action + the `samples` state slot.\n capabilities: ['set_value'],\n state: {\n samples: {\n type: '{ hcg1: number | null, date1: string | null, hcg2: number | null, date2: string | null }',\n descriptionKey: 'ui.agent.hcgDoubling.state.samples',\n description:\n 'The two timed β-hCG samples as entered — value in mIU/mL plus the draw time as an ISO-8601 timestamp. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getSamples(),\n },\n result: {\n type: \"{ intervalHours: number, ratio: number, percentRise: number, twoDayRisePercent: number, doublingTimeHours: number | null, trend: 'rising-normal' | 'rising-slow' | 'plateau-falling' } | null\",\n descriptionKey: 'ui.agent.hcgDoubling.state.result',\n description:\n 'Computed doubling time in hours (null when not rising), the rise normalised to 48 hours, and the trend band against the minimal-rise benchmark. Null until both samples are set and the second is after the first.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_samples: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ hcg1?: number | null, date1?: string | null, hcg2?: number | null, date2?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n hcg1: hcgValue('First β-hCG value'),\n date1: sampleTime('When the first sample was drawn'),\n hcg2: hcgValue('Second β-hCG value'),\n date2: sampleTime('When the second sample was drawn'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the samples were applied.',\n },\n errors: [\n 'Returns false and writes nothing when a value is not positive, a timestamp is unparseable, or a timestamp is in the future — the payload applies all-or-nothing.',\n 'Applies cleanly but leaves `result` null when the second sample is not strictly after the first — the analysis needs a forward interval.',\n ],\n examples: [\n {\n args: {\n hcg1: 1200,\n date1: '2026-08-01T09:00:00+02:00',\n hcg2: 2500,\n date2: '2026-08-03T09:00:00+02:00',\n },\n note: 'A doubling over 48 hours → the rising-normal band.',\n },\n ],\n descriptionKey: 'ui.agent.hcgDoubling.actions.setSamples',\n description:\n 'Set any subset of the two timed β-hCG samples. Omitted keys are left unchanged; an explicit null clears one. All four are needed before a trend is computed.',\n invoke: (\n handle,\n args: {\n hcg1?: number | null;\n date1?: string | null;\n hcg2?: number | null;\n date2?: string | null;\n },\n ) => handle.setSamples(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'hcg-doubling',\n description:\n 'Marks the HcgDoubling calculator (serum β-hCG doubling time from two timed values).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven action/state are unreachable.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Serum β-hCG doubling time — early-pregnancy viability. */\n/* */\n/* Pure, framework-free, unit-testable. From two timed β-hCG values it */\n/* derives the doubling time, the rise over the actual interval, and the */\n/* rise normalised to 48 hours (the standard comparison window). */\n/* A 35% rise is a conservative threshold when assessing a potentially */\n/* viable early pregnancy, interpreted alongside ultrasound and the */\n/* clinical picture. Seeber et al. Fertil Steril 2006;86:454-9. */\n/* https://pubmed.ncbi.nlm.nih.gov/16753158/ */\n/* ------------------------------------------------------------------ */\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n/** Conservative minimal 48-hour rise for a potentially viable IUP, %. */\nexport const MINIMAL_48H_RISE_PERCENT = 35;\n\nexport interface HcgInput {\n /** First β-hCG value, mIU/mL. */\n hcg1: number;\n /** When the first sample was drawn. */\n date1: Date;\n /** Second β-hCG value, mIU/mL. */\n hcg2: number;\n /** When the second sample was drawn (must be after `date1`). */\n date2: Date;\n}\n\nexport type HcgTrend = 'rising-normal' | 'rising-slow' | 'plateau-falling';\n\nexport interface HcgResult {\n /** Hours between the two samples. */\n intervalHours: number;\n /** hcg2 / hcg1. */\n ratio: number;\n /** Rise over the actual interval, %. */\n percentRise: number;\n /** Rise normalised to a 48-hour window, % (comparable to the benchmark). */\n twoDayRisePercent: number;\n /** Doubling time in hours, or `null` when not rising. */\n doublingTimeHours: number | null;\n /** Trend band against the conservative Seeber 48-hour rise threshold. */\n trend: HcgTrend;\n}\n\n/**\n * Analyse a two-point β-hCG series. Returns `null` unless both values are\n * positive and the second sample is strictly after the first.\n */\nexport function analyseHcg(input: HcgInput): HcgResult | null {\n const { hcg1, hcg2, date1, date2 } = input;\n if (!(hcg1 > 0) || !(hcg2 > 0)) return null;\n\n const intervalHours = (date2.getTime() - date1.getTime()) / MS_PER_HOUR;\n if (!(intervalHours > 0)) return null;\n\n const ratio = hcg2 / hcg1;\n const percentRise = (ratio - 1) * 100;\n const twoDayRisePercent = (ratio ** (48 / intervalHours) - 1) * 100;\n const doublingTimeHours =\n ratio > 1 ? (intervalHours * Math.LN2) / Math.log(ratio) : null;\n\n const trend: HcgTrend =\n ratio <= 1\n ? 'plateau-falling'\n : twoDayRisePercent >= MINIMAL_48H_RISE_PERCENT\n ? 'rising-normal'\n : 'rising-slow';\n\n return {\n intervalHours,\n ratio,\n percentRise,\n twoDayRisePercent,\n doublingTimeHours,\n trend,\n };\n}\n","/* ------------------------------------------------------------------ */\n/* HcgDoubling — serum β-hCG doubling time from two timed values. */\n/* */\n/* Maths in `./hcg` (pure, tested). Two timepoints (value + datetime) */\n/* → doubling time, 48-hour-normalised rise and a viability trend band. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { formatISO, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { hcgDoublingAgent } from './hcg-doubling.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { DateTimePicker } from '../date-time-picker';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport { type HcgResult, type HcgTrend, analyseHcg } from './hcg';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\nconst TREND_BADGE: Record<HcgTrend, 'success' | 'warning' | 'error'> = {\n 'rising-normal': 'success',\n 'rising-slow': 'warning',\n 'plateau-falling': 'error',\n};\nconst TREND_TOKEN: Record<HcgTrend, string> = {\n 'rising-normal': '--success',\n 'rising-slow': '--warning-readable',\n 'plateau-falling': '--destructive',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset */\n/* (`2026-08-01T09:30:00+02:00`), never `Date` objects — the doubling */\n/* maths is a difference between two instants, so the offset has to */\n/* survive the trip. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDateTime = (d: Date): string => formatISO(d);\n\nconst fromIsoDateTime = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** A β-hCG figure is usable when it is a positive finite number, or cleared. */\nconst isHcgValue = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** The two timed samples as entered. */\nexport interface HcgSamplesSnapshot {\n /** First β-hCG value, mIU/mL, or null. */\n hcg1: number | null;\n /** When the first sample was drawn, ISO-8601 with offset, or null. */\n date1: string | null;\n /** Second β-hCG value, mIU/mL, or null. */\n hcg2: number | null;\n /** When the second sample was drawn, ISO-8601 with offset, or null. */\n date2: string | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the two\n * timed samples and the computed trend, and writes the samples the way a user\n * would enter them. Never exposes patient identity — only structural lab\n * figures, sample times and the derived doubling numbers. Consumed by\n * `hcg-doubling.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface HcgDoublingHandle {\n /** The two timed samples as entered, or null where unset. */\n getSamples: () => HcgSamplesSnapshot;\n /** Computed doubling time, 48-hour rise and trend band, or null. */\n getResult: () => HcgResult | null;\n /**\n * Set any subset of the two timed samples. Omitted keys are left unchanged;\n * an explicit `null` clears one. Applies all-or-nothing — returns false and\n * writes nothing if any value is unusable.\n */\n setSamples: (next: Partial<HcgSamplesSnapshot>) => boolean;\n}\n\nexport interface HcgDoublingProps extends VariantProps<typeof rootVariants> {\n /** Pre-fill the first sample's date/time (e.g. from the lab record). */\n defaultDate1?: Date;\n /** Pre-fill the second sample's date/time. */\n defaultDate2?: Date;\n /** Fires whenever both timed values resolve (and `null` when not). */\n onResultChange?: (result: HcgResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const HcgDoubling = forwardRef<HTMLDivElement, HcgDoublingProps>(\n (\n {\n defaultDate1,\n defaultDate2,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n\n const [hcg1, setHcg1] = useState<number | null>(null);\n const [date1, setDate1] = useState<Date | undefined>(defaultDate1);\n const [hcg2, setHcg2] = useState<number | null>(null);\n const [date2, setDate2] = useState<Date | undefined>(defaultDate2);\n\n const today = useMemo(() => new Date(), []);\n\n const result = useMemo(() => {\n if (hcg1 === null || hcg2 === null || !date1 || !date2) return null;\n return analyseHcg({ hcg1, date1, hcg2, date2 });\n }, [hcg1, date1, hcg2, date2]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ hcg1, date1, hcg2, date2, result });\n liveRef.current = { hcg1, date1, hcg2, date2, result };\n\n const agentHandle = useMemo<HcgDoublingHandle>(\n () => ({\n getSamples: () => {\n const live = liveRef.current;\n return {\n hcg1: live.hcg1,\n date1: live.date1 ? toIsoDateTime(live.date1) : null,\n hcg2: live.hcg2,\n date2: live.date2 ? toIsoDateTime(live.date2) : null,\n };\n },\n getResult: () => liveRef.current.result,\n setSamples: (next) => {\n const now = new Date();\n const parsed: { date1?: Date | undefined; date2?: Date | undefined } =\n {};\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const key of ['hcg1', 'hcg2'] as const) {\n if (key in next && !isHcgValue(next[key])) return false;\n }\n for (const key of ['date1', 'date2'] as const) {\n if (!(key in next)) continue;\n const iso = next[key];\n if (iso === null || iso === undefined) {\n parsed[key] = undefined;\n continue;\n }\n const d = fromIsoDateTime(iso);\n // The DateTimePickers cap at now; the handle honours the same bound.\n if (!d || isAfter(d, now)) return false;\n parsed[key] = d;\n }\n if ('hcg1' in next) setHcg1(next.hcg1 ?? null);\n if ('hcg2' in next) setHcg2(next.hcg2 ?? null);\n if ('date1' in next) setDate1(parsed.date1);\n if ('date2' in next) setDate2(parsed.date2);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(hcgDoublingAgent, agentHandle, id);\n\n const num = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const doublingText = (r: HcgResult): string =>\n r.doublingTimeHours === null\n ? '—'\n : t('hcgDoubling.hoursValue', {\n hours: num.format(r.doublingTimeHours),\n });\n const riseText = (r: HcgResult): string =>\n t('hcgDoubling.percentValue', { value: num.format(r.twoDayRisePercent) });\n\n return (\n <div\n ref={ref}\n data-component=\"hcg-doubling\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={`${t('hcgDoubling.hcg1')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg1}\n onChange={setHcg1}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date1')}>\n <DateTimePicker value={date1} onChange={setDate1} maxDate={today} />\n </FormField>\n <FormField\n label={`${t('hcgDoubling.hcg2')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg2}\n onChange={setHcg2}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date2')}>\n <DateTimePicker value={date2} onChange={setDate2} maxDate={today} />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('hcgDoubling.doublingLabel')}: ${doublingText(result)}. ${t(\n `hcgDoubling.trend.${result.trend}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.doublingLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {doublingText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.riseLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {riseText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.trendLabel')}\n </dt>\n <dd>\n <Badge variant={TREND_BADGE[result.trend]} size=\"lg\">\n {t(`hcgDoubling.trend.${result.trend}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('hcgDoubling.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.hcg'),\n icon: 'activity',\n highlight: t(`hcgDoubling.trend.${result.trend}`),\n highlightToken: TREND_TOKEN[result.trend],\n brand: insertBrand,\n fields: [\n {\n icon: 'clock',\n label: t('hcgDoubling.doublingLabel'),\n value: doublingText(result),\n },\n {\n icon: 'trending-up',\n label: t('hcgDoubling.riseLabel'),\n value: riseText(result),\n },\n {\n icon: 'tag',\n label: t('hcgDoubling.trendLabel'),\n value: t(`hcgDoubling.trend.${result.trend}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('hcgDoubling.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nHcgDoubling.displayName = 'HcgDoubling';\n"],"names":["formatISO","date","options","date_","toDate","result","tzOffset","dateDelimiter","timeDelimiter","day","addLeadingZeros","month","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","hcgValue","label","sampleTime","hcgDoublingAgent","handle","args","MS_PER_HOUR","MINIMAL_48H_RISE_PERCENT","analyseHcg","input","hcg1","hcg2","date1","date2","intervalHours","ratio","percentRise","twoDayRisePercent","doublingTimeHours","trend","rootVariants","cva","TREND_BADGE","TREND_TOKEN","toIsoDateTime","d","fromIsoDateTime","iso","parseISO","isHcgValue","n","HcgDoubling","forwardRef","defaultDate1","defaultDate2","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","setHcg1","useState","setDate1","setHcg2","setDate2","today","useMemo","useEffect","liveRef","useRef","agentHandle","live","next","now","parsed","key","isAfter","useAgentRegistration","num","doublingText","r","riseText","jsxs","jsx","FormField","NumberInput","DateTimePicker","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;;;;;AA0CO,SAASA,GAAUC,GAAMC,GAAS;AACvC,QAAMC,IAAQC,GAAOH,GAAMC,KAAA,gBAAAA,EAAS,EAAE;AAEtC,MAAI,MAAM,CAACC,CAAK;AACd,UAAM,IAAI,WAAW,oBAAoB;AAM3C,MAAIE,IAAS,IACTC,IAAW;AAEf,QAAMC,IAAwC,KACxCC,IAAwC;AAGf;AAC7B,UAAMC,IAAMC,EAAgBP,EAAM,QAAO,GAAI,CAAC,GACxCQ,IAAQD,EAAgBP,EAAM,SAAQ,IAAK,GAAG,CAAC;AAIrD,IAAAE,IA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AAA;AAAA,gBACC,UAAAxC;AAAA,gBACA,SAASC;AAAA,gBACT,QAAAC;AAAA,gBACA,SAAAC;AAAA,gBACA,MAAM;AAAA,kBACJ,OAAO,EAAE,kBAAkB;AAAA,kBAC3B,MAAM;AAAA,kBACN,WAAW,EAAE,qBAAqBvD,EAAO,KAAK,EAAE;AAAA,kBAChD,gBAAgBuC,GAAYvC,EAAO,KAAK;AAAA,kBACxC,OAAOwD;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,2BAA2B;AAAA,sBACpC,OAAO0B,EAAalF,CAAM;AAAA,oBAAA;AAAA,oBAE5B;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,uBAAuB;AAAA,sBAChC,OAAOoF,EAASpF,CAAM;AAAA,oBAAA;AAAA,oBAExB;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,wBAAwB;AAAA,sBACjC,OAAO,EAAE,qBAAqBA,EAAO,KAAK,EAAE;AAAA,oBAAA;AAAA,kBAC9C;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAsF,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAvC,GAAY,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -32,7 +32,7 @@ import { S as rn } from "./skeleton-tTWJpvAq.js";
|
|
|
32
32
|
import { E as kn } from "./empty-state-DwJ5YNzz.js";
|
|
33
33
|
import { S as Er } from "./stepper-accordion-DDTSOUHc.js";
|
|
34
34
|
import { S as Fr } from "./stepper-progress-D6H8wQiV.js";
|
|
35
|
-
import { S as _r } from "./slot-grid-
|
|
35
|
+
import { S as _r } from "./slot-grid-BhjaLJ0o.js";
|
|
36
36
|
import { p as fe } from "./parseISO-DZZ5a-zK.js";
|
|
37
37
|
import { C as Br } from "./chevron-down-DWE7GSq9.js";
|
|
38
38
|
import { s as rt, f as nn, d as Rn } from "./format--x5jypvH.js";
|
|
@@ -4607,4 +4607,4 @@ export {
|
|
|
4607
4607
|
bs as b,
|
|
4608
4608
|
Ao as c
|
|
4609
4609
|
};
|
|
4610
|
-
//# sourceMappingURL=reserved.agent-
|
|
4610
|
+
//# sourceMappingURL=reserved.agent-BvwjDyne.js.map
|