@misael703/ui 1.60.0 → 1.62.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/{chunk-UQJU332W.mjs → chunk-2UW2K5MV.mjs} +3 -3
- package/dist/{chunk-UQJU332W.mjs.map → chunk-2UW2K5MV.mjs.map} +1 -1
- package/dist/{chunk-X4EESFGG.js → chunk-324O7B3R.js} +3 -3
- package/dist/{chunk-X4EESFGG.js.map → chunk-324O7B3R.js.map} +1 -1
- package/dist/{chunk-TGSGUOSP.mjs → chunk-4Z5GFOIU.mjs} +3 -3
- package/dist/{chunk-TGSGUOSP.mjs.map → chunk-4Z5GFOIU.mjs.map} +1 -1
- package/dist/{chunk-GL5C55DU.mjs → chunk-5G3DVB5B.mjs} +3 -3
- package/dist/{chunk-GL5C55DU.mjs.map → chunk-5G3DVB5B.mjs.map} +1 -1
- package/dist/{chunk-QRXFKIQF.mjs → chunk-B6PQAH5C.mjs} +101 -20
- package/dist/chunk-B6PQAH5C.mjs.map +1 -0
- package/dist/{chunk-NHSPQDB2.mjs → chunk-DLPTIVZB.mjs} +3 -3
- package/dist/{chunk-NHSPQDB2.mjs.map → chunk-DLPTIVZB.mjs.map} +1 -1
- package/dist/{chunk-V7MNWM6L.js → chunk-E6BTT4I7.js} +4 -4
- package/dist/{chunk-V7MNWM6L.js.map → chunk-E6BTT4I7.js.map} +1 -1
- package/dist/{chunk-ADNQFZ33.js → chunk-F2MD6DAE.js} +117 -35
- package/dist/chunk-F2MD6DAE.js.map +1 -0
- package/dist/{chunk-YKFZCOOB.mjs → chunk-GNI5MH36.mjs} +3 -3
- package/dist/{chunk-YKFZCOOB.mjs.map → chunk-GNI5MH36.mjs.map} +1 -1
- package/dist/{chunk-PUZNB62R.mjs → chunk-HGS3ATU2.mjs} +6 -6
- package/dist/chunk-HGS3ATU2.mjs.map +1 -0
- package/dist/{chunk-KDNO3TOM.js → chunk-HYB7EXRB.js} +9 -9
- package/dist/{chunk-KDNO3TOM.js.map → chunk-HYB7EXRB.js.map} +1 -1
- package/dist/{chunk-2ET7IM4U.js → chunk-IKMKQUUR.js} +42 -18
- package/dist/chunk-IKMKQUUR.js.map +1 -0
- package/dist/{chunk-O4TKMQEY.js → chunk-M7QZCHMM.js} +3 -3
- package/dist/{chunk-O4TKMQEY.js.map → chunk-M7QZCHMM.js.map} +1 -1
- package/dist/{chunk-MVJITG75.js → chunk-MUXOT5KS.js} +16 -2
- package/dist/chunk-MUXOT5KS.js.map +1 -0
- package/dist/{chunk-JNISZPSL.js → chunk-NUTHJQYH.js} +4 -4
- package/dist/{chunk-JNISZPSL.js.map → chunk-NUTHJQYH.js.map} +1 -1
- package/dist/{chunk-4QHE5H36.mjs → chunk-ODE2ROR2.mjs} +16 -3
- package/dist/chunk-ODE2ROR2.mjs.map +1 -0
- package/dist/{chunk-EJY4QWHT.mjs → chunk-ORQPCZNF.mjs} +42 -18
- package/dist/chunk-ORQPCZNF.mjs.map +1 -0
- package/dist/{chunk-V6DNE6RE.js → chunk-VFZ7VMU2.js} +16 -16
- package/dist/chunk-VFZ7VMU2.js.map +1 -0
- package/dist/components/AdvancedPickers.d.mts +29 -2
- package/dist/components/AdvancedPickers.d.ts +29 -2
- package/dist/components/AdvancedPickers.js +10 -6
- package/dist/components/AdvancedPickers.mjs +2 -2
- package/dist/components/AppShell.js +4 -4
- package/dist/components/AppShell.mjs +2 -2
- package/dist/components/Charts.d.mts +18 -4
- package/dist/components/Charts.d.ts +18 -4
- package/dist/components/Charts.js +6 -6
- package/dist/components/Charts.mjs +1 -1
- package/dist/components/Commerce.js +14 -14
- package/dist/components/Commerce.mjs +3 -3
- package/dist/components/Display3.js +8 -8
- package/dist/components/Display3.mjs +2 -2
- package/dist/components/Editing.js +9 -9
- package/dist/components/Editing.mjs +3 -3
- package/dist/components/Overlay.js +4 -4
- package/dist/components/Overlay.mjs +2 -2
- package/dist/components/Pickers.js +7 -7
- package/dist/components/Pickers.mjs +2 -2
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +73 -65
- package/dist/index.mjs +11 -11
- package/dist/styles.css +1 -1
- package/dist/utils/dateFormat.d.mts +17 -1
- package/dist/utils/dateFormat.d.ts +17 -1
- package/dist/utils/dateFormat.js +18 -14
- package/dist/utils/dateFormat.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-2ET7IM4U.js.map +0 -1
- package/dist/chunk-4QHE5H36.mjs.map +0 -1
- package/dist/chunk-ADNQFZ33.js.map +0 -1
- package/dist/chunk-EJY4QWHT.mjs.map +0 -1
- package/dist/chunk-MVJITG75.js.map +0 -1
- package/dist/chunk-PUZNB62R.mjs.map +0 -1
- package/dist/chunk-QRXFKIQF.mjs.map +0 -1
- package/dist/chunk-V6DNE6RE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Display3.tsx"],"names":["jsxs","cx","jsx","Avatar","React","Timeline","ChevronDown","ChevronRight","startOfMonth","useLocale","addMonths","isSameDay"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,SAAS,QAAA,CAAS,EAAE,IAAA,EAAM,IAAA,EAAM,SAAA,EAAW,SAAA,EAAW,IAAA,GAAO,EAAA,EAAI,SAAA,EAAW,GAAG,IAAA,EAAK,EAAkB;AAC3G,EAAA,MAAM,YAAA,GAAe,OAAO,IAAA,KAAS,QAAA,GAAW,IAAA,GAAO,MAAA;AACvD,EAAA,uBACEA,eAAA,CAAC,SAAI,SAAA,EAAWC,mBAAA,CAAG,aAAa,SAAS,CAAA,EAAI,GAAG,IAAA,EAC9C,QAAA,EAAA;AAAA,oBAAAC,cAAA,CAACC,2BAAO,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,IAAA,EAAM,cAAc,IAAA,EAAY,CAAA;AAAA,oBACxEH,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,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gBAAC,MAAA;AAAA,gBAAA;AAAA,kBAEC,WAAWD,mBAAA,CAAG,iBAAA,EAAmB,oBAAoB,EAAA,CAAG,IAAA,IAAQ,SAAS,CAAA,CAAE,CAAA;AAAA,kBAC3E,OAAA,EAAS,CAAC,CAAA,KAAM;AAAE,oBAAA,CAAA,CAAE,eAAA,EAAgB;AAAG,oBAAA,EAAA,CAAG,OAAA,IAAU;AAAA,kBAAG,CAAA;AAAA,kBAEtD,QAAA,EAAA,EAAA,CAAG;AAAA,iBAAA;AAAA,gBAJC;AAAA,eAMR,CAAA;AAAA,cACA,UAAU,MAAA,GAAS,CAAA,oBAAKD,eAAA,CAAC,MAAA,EAAA,EAAK,WAAU,gBAAA,EAAiB,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBAAE,UAAU,MAAA,GAAS;AAAA,eAAA,EAAE;AAAA,aAAA,EACnF;AAAA;AAAA,SAAA;AAAA,QAlBG;AAAA,OAoBP;AAAA,IAEJ,CAAC,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-KDNO3TOM.js","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\nimport { Avatar } from './Display2';\nimport { ChevronRight, ChevronDown } from './Icons';\nimport { useLocale } from '../locale/LocaleProvider';\nimport { startOfMonth, addMonths, isSameDay } from '../utils/dateFormat';\n\n// ---------- UserCell ----------------------------------------------------\nexport interface UserCellProps extends React.HTMLAttributes<HTMLDivElement> {\n name: React.ReactNode;\n meta?: React.ReactNode; // role / email / etc.\n avatarSrc?: string;\n avatarAlt?: string;\n size?: 24 | 32 | 40 | 48;\n}\n\nexport function UserCell({ name, meta, avatarSrc, avatarAlt, size = 32, className, ...rest }: UserCellProps) {\n const initialsName = typeof name === 'string' ? name : undefined;\n return (\n <div className={cx('user-cell', className)} {...rest}>\n <Avatar src={avatarSrc} alt={avatarAlt} name={initialsName} size={size} />\n <div className=\"user-cell__body\">\n <div className=\"user-cell__name\">{name}</div>\n {meta && <div className=\"user-cell__meta\">{meta}</div>}\n </div>\n </div>\n );\n}\n\n// ---------- StatusIndicator (pulsing dot) ------------------------------\nexport type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';\n\nexport interface StatusIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {\n tone?: StatusTone;\n pulse?: boolean;\n label?: React.ReactNode;\n}\n\nexport function StatusIndicator({ tone = 'success', pulse, label, className, ...rest }: StatusIndicatorProps) {\n return (\n <span className={cx('status-indicator', className)} role=\"status\" {...rest}>\n <span className={cx('status-indicator__dot', `status-indicator__dot--${tone}`, pulse && 'is-pulsing')} aria-hidden=\"true\" />\n {label && <span className=\"status-indicator__label\">{label}</span>}\n </span>\n );\n}\n\n// ---------- Timeline ----------------------------------------------------\nexport type TimelineDensity = 'default' | 'compact';\n\nexport interface TimelineProps extends React.HTMLAttributes<HTMLOListElement> {\n /**\n * Visual density (v1.28.0). `compact` shrinks the marker, gap and font\n * sizes for use in cards / list summaries; semantically identical.\n */\n density?: TimelineDensity;\n}\n\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(\n function Timeline({ className, density = 'default', ...rest }, ref) {\n return <ol ref={ref} className={cx('timeline', density === 'compact' && 'timeline--compact', className)} {...rest} />;\n }\n);\n\n/**\n * Progress state of a Timeline entry (v1.28.0), orthogonal to `tone`.\n * - `done` — completed: filled marker (in `tone` color), solid connector above.\n * - `current` — happening now: ringed/pulsing marker, solid connector above.\n * - `pending` — not started: hollow muted marker, **dashed** connector above.\n *\n * Use it to scan progress on a list of events that grow over time (a despachos\n * order accumulating envíos/retiros until the last marks it complete). Default\n * (state omitted) keeps the 1.x look exactly.\n */\nexport type TimelineState = 'done' | 'current' | 'pending';\n\n/**\n * Visual emphasis for the entry's marker (v1.30.0), orthogonal to `state` and\n * `tone`. Default markers are 24×24 hollow with a tone-colored border, ideal\n * for the operational events that fill a timeline. `milestone` upgrades the\n * marker to 32×32 filled in the `tone` color with a subtle halo — for the\n * \"anchor\" events that the rest of the timeline hangs from (e.g. \"Orden\n * creada\" at the top of an order detail). Without this the hollow markers of\n * the operational events out-shout the anchor, inverting the hierarchy.\n *\n * `milestone` keeps the `state` semantics: a `pending` milestone stays hollow\n * (muted, no halo), preserving \"not yet\" while still occupying the larger\n * anchor slot. A `current` milestone gets the pulse halo (overrides the\n * static one).\n */\nexport type TimelineVariant = 'default' | 'milestone';\n\nexport interface TimelineItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'> {\n icon?: React.ReactNode;\n tone?: StatusTone;\n title: React.ReactNode;\n meta?: React.ReactNode;\n /** Progress state (see {@link TimelineState}). Optional. */\n state?: TimelineState;\n /**\n * Trailing slot on the title row, aligned to the right (v1.28.0). Useful for\n * a Badge marking event type (envío / retiro / nota), a timestamp on the\n * right edge, or a small action chip.\n */\n right?: React.ReactNode;\n /** Visual emphasis (see {@link TimelineVariant}). Optional, default unchanged. */\n variant?: TimelineVariant;\n}\n\nexport function TimelineItem({ icon, tone = 'neutral', title, meta, children, state, right, variant, className, ...rest }: TimelineItemProps) {\n return (\n <li\n className={cx(\n 'timeline__item',\n state && `timeline__item--${state}`,\n variant === 'milestone' && 'timeline__item--milestone',\n className,\n )}\n data-state={state}\n {...rest}\n >\n <span\n className={cx(\n 'timeline__marker',\n `timeline__marker--${tone}`,\n variant === 'milestone' && 'timeline__marker--milestone',\n )}\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n <div className=\"timeline__body\">\n {right != null ? (\n // Title row wrapper only renders when there's a trailing slot, so\n // the DOM stays byte-identical for existing consumers (back-compat).\n <div className=\"timeline__title-row\">\n <div className=\"timeline__title\">{title}</div>\n <div className=\"timeline__right\">{right}</div>\n </div>\n ) : (\n <div className=\"timeline__title\">{title}</div>\n )}\n {meta && <div className=\"timeline__meta\">{meta}</div>}\n {children && <div className=\"timeline__content\">{children}</div>}\n </div>\n </li>\n );\n}\n\n// ---------- Tree --------------------------------------------------------\nexport interface TreeNodeData {\n id: string;\n label: React.ReactNode;\n icon?: React.ReactNode;\n children?: TreeNodeData[];\n meta?: React.ReactNode;\n}\n\nexport interface TreeProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onSelect'> {\n nodes: TreeNodeData[];\n defaultExpanded?: string[];\n selectedId?: string;\n onSelect?: (id: string) => void;\n}\n\nfunction firstNodeId(nodes: TreeNodeData[]): string | undefined {\n return nodes[0]?.id;\n}\n\nexport function Tree({\n nodes,\n defaultExpanded = [],\n selectedId,\n onSelect,\n className,\n onKeyDown,\n ...rest\n}: TreeProps) {\n const [expanded, setExpanded] = React.useState<Set<string>>(new Set(defaultExpanded));\n const [activeId, setActiveId] = React.useState<string | undefined>(undefined);\n const rootRef = React.useRef<HTMLUListElement>(null);\n\n // Roving tabindex: one treeitem is tabbable at a time. Falls back to the\n // selected node, then the first node, so the tree is reachable on first Tab.\n const effectiveActive = activeId ?? selectedId ?? firstNodeId(nodes);\n\n const toggle = React.useCallback((id: string) => {\n setExpanded((curr) => {\n const next = new Set(curr);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n const visibleItems = (): HTMLElement[] =>\n Array.from(rootRef.current?.querySelectorAll<HTMLElement>('[role=\"treeitem\"]') ?? []);\n\n const focusItem = (el: HTMLElement | undefined): void => {\n if (!el) return;\n setActiveId(el.dataset.treeId);\n el.focus();\n };\n\n // WAI-ARIA TreeView keyboard model. Focus lives on the treeitem element;\n // querySelectorAll returns items in DOM order, which equals visual order\n // (collapsed branches are not rendered, so they are not navigable).\n const handleKeyDown = (e: React.KeyboardEvent<HTMLUListElement>): void => {\n onKeyDown?.(e);\n const targetEl = (e.target as HTMLElement).closest<HTMLElement>('[role=\"treeitem\"]');\n if (!targetEl || !rootRef.current?.contains(targetEl)) return;\n const list = visibleItems();\n const idx = list.indexOf(targetEl);\n if (idx === -1) return;\n const id = targetEl.dataset.treeId;\n if (!id) return;\n const depth = Number(targetEl.dataset.depth ?? 0);\n const expandedAttr = targetEl.getAttribute('aria-expanded');\n const hasChildren = expandedAttr !== null;\n const isOpen = expandedAttr === 'true';\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n focusItem(list[Math.min(idx + 1, list.length - 1)]);\n break;\n case 'ArrowUp':\n e.preventDefault();\n focusItem(list[Math.max(idx - 1, 0)]);\n break;\n case 'Home':\n e.preventDefault();\n focusItem(list[0]);\n break;\n case 'End':\n e.preventDefault();\n focusItem(list[list.length - 1]);\n break;\n case 'ArrowRight':\n e.preventDefault();\n if (hasChildren && !isOpen) toggle(id);\n else if (hasChildren && isOpen) focusItem(list[idx + 1]);\n break;\n case 'ArrowLeft':\n e.preventDefault();\n if (hasChildren && isOpen) {\n toggle(id);\n } else {\n for (let i = idx - 1; i >= 0; i--) {\n const candidate = list[i];\n if (candidate && Number(candidate.dataset.depth ?? 0) < depth) {\n focusItem(candidate);\n break;\n }\n }\n }\n break;\n case 'Enter':\n case ' ':\n e.preventDefault();\n onSelect?.(id);\n break;\n default:\n break;\n }\n };\n\n return (\n <ul\n ref={rootRef}\n role=\"tree\"\n className={cx('tree', className)}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {nodes.map((n) => (\n <TreeNode\n key={n.id}\n node={n}\n depth={0}\n expanded={expanded}\n toggle={toggle}\n selectedId={selectedId}\n activeId={effectiveActive}\n onSelect={onSelect}\n onFocusItem={setActiveId}\n />\n ))}\n </ul>\n );\n}\n\ninterface TreeNodeProps {\n node: TreeNodeData;\n depth: number;\n expanded: Set<string>;\n toggle: (id: string) => void;\n selectedId?: string;\n activeId?: string;\n onSelect?: (id: string) => void;\n onFocusItem: (id: string) => void;\n}\n\nfunction TreeNode({\n node,\n depth,\n expanded,\n toggle,\n selectedId,\n activeId,\n onSelect,\n onFocusItem,\n}: TreeNodeProps) {\n const hasChildren = !!(node.children && node.children.length);\n const isOpen = expanded.has(node.id);\n const isSelected = selectedId === node.id;\n const isActive = activeId === node.id;\n return (\n <li role=\"none\" className=\"tree__node\">\n <div\n role=\"treeitem\"\n data-tree-id={node.id}\n data-depth={depth}\n aria-expanded={hasChildren ? isOpen : undefined}\n aria-selected={isSelected}\n tabIndex={isActive ? 0 : -1}\n className={cx('tree__row', isSelected && 'is-selected')}\n style={{ paddingLeft: `calc(var(--space-2) + var(--space-4) * ${depth})` }}\n onClick={() => {\n onFocusItem(node.id);\n onSelect?.(node.id);\n }}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className=\"tree__chev\"\n onClick={(e) => { e.stopPropagation(); toggle(node.id); }}\n >\n {isOpen ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </button>\n ) : (\n <span className=\"tree__chev tree__chev--placeholder\" aria-hidden=\"true\" />\n )}\n {node.icon && <span className=\"tree__icon\" aria-hidden=\"true\">{node.icon}</span>}\n <span className=\"tree__label\">{node.label}</span>\n {node.meta && <span className=\"tree__meta\">{node.meta}</span>}\n </div>\n {hasChildren && isOpen && (\n <ul role=\"group\" className=\"tree__children\">\n {node.children!.map((c) => (\n <TreeNode\n key={c.id}\n node={c}\n depth={depth + 1}\n expanded={expanded}\n toggle={toggle}\n selectedId={selectedId}\n activeId={activeId}\n onSelect={onSelect}\n onFocusItem={onFocusItem}\n />\n ))}\n </ul>\n )}\n </li>\n );\n}\n\n// ---------- Calendar (vista mes completa, no picker) -------------------\nexport interface CalendarEvent {\n date: Date;\n label: React.ReactNode;\n tone?: StatusTone;\n onClick?: () => void;\n}\n\nexport interface CalendarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Mes a mostrar. Default: mes actual. */\n month?: Date;\n events?: CalendarEvent[];\n onMonthChange?: (m: Date) => void;\n onDayClick?: (d: Date) => void;\n}\n\nexport function Calendar({ month: monthProp, events = [], onMonthChange, onDayClick, className, ...rest }: CalendarProps) {\n const [internalMonth, setInternalMonth] = React.useState(() => startOfMonth(monthProp ?? new Date()));\n const month = monthProp ? startOfMonth(monthProp) : internalMonth;\n const t = useLocale();\n const weekdays = t['calendar.weekdays'];\n const months = t['calendar.months'];\n const setMonth = (m: Date) => {\n if (!monthProp) setInternalMonth(m);\n onMonthChange?.(m);\n };\n\n const today = new Date();\n\n // primer día visible: lunes anterior al primer día del mes\n const firstDay = startOfMonth(month);\n const firstWeekday = (firstDay.getDay() + 6) % 7; // domingo=0 → 6, lunes=1 → 0\n const gridStart = new Date(firstDay);\n gridStart.setDate(firstDay.getDate() - firstWeekday);\n\n const days: Date[] = Array.from({ length: 42 }, (_, i) => {\n const d = new Date(gridStart);\n d.setDate(gridStart.getDate() + i);\n return d;\n });\n\n const eventsByDay = React.useMemo(() => {\n const m = new Map<string, CalendarEvent[]>();\n for (const ev of events) {\n const key = `${ev.date.getFullYear()}-${ev.date.getMonth()}-${ev.date.getDate()}`;\n const list = m.get(key) ?? [];\n list.push(ev);\n m.set(key, list);\n }\n return m;\n }, [events]);\n\n return (\n <div className={cx('calendar', className)} {...rest}>\n <div className=\"calendar__head\">\n <button type=\"button\" className=\"calendar__nav\" aria-label={t['calendar.prevMonth']} onClick={() => setMonth(addMonths(month, -1))}>\n <ChevronRight size={16} style={{ transform: 'rotate(180deg)' }} />\n </button>\n <div className=\"calendar__title\">{months[month.getMonth()]} {month.getFullYear()}</div>\n <button type=\"button\" className=\"calendar__nav\" aria-label={t['calendar.nextMonth']} onClick={() => setMonth(addMonths(month, 1))}>\n <ChevronRight size={16} />\n </button>\n </div>\n <div className=\"calendar__grid calendar__weekdays\">\n {weekdays.map((w) => <div key={w} className=\"calendar__weekday\">{w}</div>)}\n </div>\n <div className=\"calendar__grid\">\n {days.map((d, i) => {\n const inMonth = d.getMonth() === month.getMonth();\n const isToday = isSameDay(d, today);\n const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;\n const dayEvents = eventsByDay.get(key) ?? [];\n return (\n <button\n key={i}\n type=\"button\"\n className={cx('calendar__day', !inMonth && 'is-out', isToday && 'is-today')}\n onClick={() => onDayClick?.(d)}\n >\n <span className=\"calendar__daynum\">{d.getDate()}</span>\n {dayEvents.length > 0 && (\n <div className=\"calendar__events\">\n {dayEvents.slice(0, 2).map((ev, idx) => (\n <span\n key={idx}\n className={cx('calendar__event', `calendar__event--${ev.tone ?? 'neutral'}`)}\n onClick={(e) => { e.stopPropagation(); ev.onClick?.(); }}\n >\n {ev.label}\n </span>\n ))}\n {dayEvents.length > 2 && <span className=\"calendar__more\">+{dayEvents.length - 2}</span>}\n </div>\n )}\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Display3.tsx"],"names":["jsxs","cx","jsx","Avatar","React","Timeline","ChevronDown","ChevronRight","startOfMonth","useLocale","addMonths","isSameDay"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,SAAS,QAAA,CAAS,EAAE,IAAA,EAAM,IAAA,EAAM,SAAA,EAAW,SAAA,EAAW,IAAA,GAAO,EAAA,EAAI,SAAA,EAAW,GAAG,IAAA,EAAK,EAAkB;AAC3G,EAAA,MAAM,YAAA,GAAe,OAAO,IAAA,KAAS,QAAA,GAAW,IAAA,GAAO,MAAA;AACvD,EAAA,uBACEA,eAAA,CAAC,SAAI,SAAA,EAAWC,mBAAA,CAAG,aAAa,SAAS,CAAA,EAAI,GAAG,IAAA,EAC9C,QAAA,EAAA;AAAA,oBAAAC,cAAA,CAACC,2BAAO,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,IAAA,EAAM,cAAc,IAAA,EAAY,CAAA;AAAA,oBACxEH,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBAAA,EACb,QAAA,EAAA;AAAA,sBAAAE,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBAAA,EAAmB,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,MACtC,IAAA,oBAAQA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAmB,QAAA,EAAA,IAAA,EAAK;AAAA,KAAA,EAClD;AAAA,GAAA,EACF,CAAA;AAE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,kBAEtD,QAAA,EAAA,EAAA,CAAG;AAAA,iBAAA;AAAA,gBAJC;AAAA,eAMR,CAAA;AAAA,cACA,UAAU,MAAA,GAAS,CAAA,oBAAKD,eAAA,CAAC,MAAA,EAAA,EAAK,WAAU,gBAAA,EAAiB,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBAAE,UAAU,MAAA,GAAS;AAAA,eAAA,EAAE;AAAA,aAAA,EACnF;AAAA;AAAA,SAAA;AAAA,QAlBG;AAAA,OAoBP;AAAA,IAEJ,CAAC,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-HYB7EXRB.js","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\nimport { Avatar } from './Display2';\nimport { ChevronRight, ChevronDown } from './Icons';\nimport { useLocale } from '../locale/LocaleProvider';\nimport { startOfMonth, addMonths, isSameDay } from '../utils/dateFormat';\n\n// ---------- UserCell ----------------------------------------------------\nexport interface UserCellProps extends React.HTMLAttributes<HTMLDivElement> {\n name: React.ReactNode;\n meta?: React.ReactNode; // role / email / etc.\n avatarSrc?: string;\n avatarAlt?: string;\n size?: 24 | 32 | 40 | 48;\n}\n\nexport function UserCell({ name, meta, avatarSrc, avatarAlt, size = 32, className, ...rest }: UserCellProps) {\n const initialsName = typeof name === 'string' ? name : undefined;\n return (\n <div className={cx('user-cell', className)} {...rest}>\n <Avatar src={avatarSrc} alt={avatarAlt} name={initialsName} size={size} />\n <div className=\"user-cell__body\">\n <div className=\"user-cell__name\">{name}</div>\n {meta && <div className=\"user-cell__meta\">{meta}</div>}\n </div>\n </div>\n );\n}\n\n// ---------- StatusIndicator (pulsing dot) ------------------------------\nexport type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';\n\nexport interface StatusIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {\n tone?: StatusTone;\n pulse?: boolean;\n label?: React.ReactNode;\n}\n\nexport function StatusIndicator({ tone = 'success', pulse, label, className, ...rest }: StatusIndicatorProps) {\n return (\n <span className={cx('status-indicator', className)} role=\"status\" {...rest}>\n <span className={cx('status-indicator__dot', `status-indicator__dot--${tone}`, pulse && 'is-pulsing')} aria-hidden=\"true\" />\n {label && <span className=\"status-indicator__label\">{label}</span>}\n </span>\n );\n}\n\n// ---------- Timeline ----------------------------------------------------\nexport type TimelineDensity = 'default' | 'compact';\n\nexport interface TimelineProps extends React.HTMLAttributes<HTMLOListElement> {\n /**\n * Visual density (v1.28.0). `compact` shrinks the marker, gap and font\n * sizes for use in cards / list summaries; semantically identical.\n */\n density?: TimelineDensity;\n}\n\nexport const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(\n function Timeline({ className, density = 'default', ...rest }, ref) {\n return <ol ref={ref} className={cx('timeline', density === 'compact' && 'timeline--compact', className)} {...rest} />;\n }\n);\n\n/**\n * Progress state of a Timeline entry (v1.28.0), orthogonal to `tone`.\n * - `done` — completed: filled marker (in `tone` color), solid connector above.\n * - `current` — happening now: ringed/pulsing marker, solid connector above.\n * - `pending` — not started: hollow muted marker, **dashed** connector above.\n *\n * Use it to scan progress on a list of events that grow over time (a despachos\n * order accumulating envíos/retiros until the last marks it complete). Default\n * (state omitted) keeps the 1.x look exactly.\n */\nexport type TimelineState = 'done' | 'current' | 'pending';\n\n/**\n * Visual emphasis for the entry's marker (v1.30.0), orthogonal to `state` and\n * `tone`. Default markers are 24×24 hollow with a tone-colored border, ideal\n * for the operational events that fill a timeline. `milestone` upgrades the\n * marker to 32×32 filled in the `tone` color with a subtle halo — for the\n * \"anchor\" events that the rest of the timeline hangs from (e.g. \"Orden\n * creada\" at the top of an order detail). Without this the hollow markers of\n * the operational events out-shout the anchor, inverting the hierarchy.\n *\n * `milestone` keeps the `state` semantics: a `pending` milestone stays hollow\n * (muted, no halo), preserving \"not yet\" while still occupying the larger\n * anchor slot. A `current` milestone gets the pulse halo (overrides the\n * static one).\n */\nexport type TimelineVariant = 'default' | 'milestone';\n\nexport interface TimelineItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'> {\n icon?: React.ReactNode;\n tone?: StatusTone;\n title: React.ReactNode;\n meta?: React.ReactNode;\n /** Progress state (see {@link TimelineState}). Optional. */\n state?: TimelineState;\n /**\n * Trailing slot on the title row, aligned to the right (v1.28.0). Useful for\n * a Badge marking event type (envío / retiro / nota), a timestamp on the\n * right edge, or a small action chip.\n */\n right?: React.ReactNode;\n /** Visual emphasis (see {@link TimelineVariant}). Optional, default unchanged. */\n variant?: TimelineVariant;\n}\n\nexport function TimelineItem({ icon, tone = 'neutral', title, meta, children, state, right, variant, className, ...rest }: TimelineItemProps) {\n return (\n <li\n className={cx(\n 'timeline__item',\n state && `timeline__item--${state}`,\n variant === 'milestone' && 'timeline__item--milestone',\n className,\n )}\n data-state={state}\n {...rest}\n >\n <span\n className={cx(\n 'timeline__marker',\n `timeline__marker--${tone}`,\n variant === 'milestone' && 'timeline__marker--milestone',\n )}\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n <div className=\"timeline__body\">\n {right != null ? (\n // Title row wrapper only renders when there's a trailing slot, so\n // the DOM stays byte-identical for existing consumers (back-compat).\n <div className=\"timeline__title-row\">\n <div className=\"timeline__title\">{title}</div>\n <div className=\"timeline__right\">{right}</div>\n </div>\n ) : (\n <div className=\"timeline__title\">{title}</div>\n )}\n {meta && <div className=\"timeline__meta\">{meta}</div>}\n {children && <div className=\"timeline__content\">{children}</div>}\n </div>\n </li>\n );\n}\n\n// ---------- Tree --------------------------------------------------------\nexport interface TreeNodeData {\n id: string;\n label: React.ReactNode;\n icon?: React.ReactNode;\n children?: TreeNodeData[];\n meta?: React.ReactNode;\n}\n\nexport interface TreeProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onSelect'> {\n nodes: TreeNodeData[];\n defaultExpanded?: string[];\n selectedId?: string;\n onSelect?: (id: string) => void;\n}\n\nfunction firstNodeId(nodes: TreeNodeData[]): string | undefined {\n return nodes[0]?.id;\n}\n\nexport function Tree({\n nodes,\n defaultExpanded = [],\n selectedId,\n onSelect,\n className,\n onKeyDown,\n ...rest\n}: TreeProps) {\n const [expanded, setExpanded] = React.useState<Set<string>>(new Set(defaultExpanded));\n const [activeId, setActiveId] = React.useState<string | undefined>(undefined);\n const rootRef = React.useRef<HTMLUListElement>(null);\n\n // Roving tabindex: one treeitem is tabbable at a time. Falls back to the\n // selected node, then the first node, so the tree is reachable on first Tab.\n const effectiveActive = activeId ?? selectedId ?? firstNodeId(nodes);\n\n const toggle = React.useCallback((id: string) => {\n setExpanded((curr) => {\n const next = new Set(curr);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n const visibleItems = (): HTMLElement[] =>\n Array.from(rootRef.current?.querySelectorAll<HTMLElement>('[role=\"treeitem\"]') ?? []);\n\n const focusItem = (el: HTMLElement | undefined): void => {\n if (!el) return;\n setActiveId(el.dataset.treeId);\n el.focus();\n };\n\n // WAI-ARIA TreeView keyboard model. Focus lives on the treeitem element;\n // querySelectorAll returns items in DOM order, which equals visual order\n // (collapsed branches are not rendered, so they are not navigable).\n const handleKeyDown = (e: React.KeyboardEvent<HTMLUListElement>): void => {\n onKeyDown?.(e);\n const targetEl = (e.target as HTMLElement).closest<HTMLElement>('[role=\"treeitem\"]');\n if (!targetEl || !rootRef.current?.contains(targetEl)) return;\n const list = visibleItems();\n const idx = list.indexOf(targetEl);\n if (idx === -1) return;\n const id = targetEl.dataset.treeId;\n if (!id) return;\n const depth = Number(targetEl.dataset.depth ?? 0);\n const expandedAttr = targetEl.getAttribute('aria-expanded');\n const hasChildren = expandedAttr !== null;\n const isOpen = expandedAttr === 'true';\n\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n focusItem(list[Math.min(idx + 1, list.length - 1)]);\n break;\n case 'ArrowUp':\n e.preventDefault();\n focusItem(list[Math.max(idx - 1, 0)]);\n break;\n case 'Home':\n e.preventDefault();\n focusItem(list[0]);\n break;\n case 'End':\n e.preventDefault();\n focusItem(list[list.length - 1]);\n break;\n case 'ArrowRight':\n e.preventDefault();\n if (hasChildren && !isOpen) toggle(id);\n else if (hasChildren && isOpen) focusItem(list[idx + 1]);\n break;\n case 'ArrowLeft':\n e.preventDefault();\n if (hasChildren && isOpen) {\n toggle(id);\n } else {\n for (let i = idx - 1; i >= 0; i--) {\n const candidate = list[i];\n if (candidate && Number(candidate.dataset.depth ?? 0) < depth) {\n focusItem(candidate);\n break;\n }\n }\n }\n break;\n case 'Enter':\n case ' ':\n e.preventDefault();\n onSelect?.(id);\n break;\n default:\n break;\n }\n };\n\n return (\n <ul\n ref={rootRef}\n role=\"tree\"\n className={cx('tree', className)}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {nodes.map((n) => (\n <TreeNode\n key={n.id}\n node={n}\n depth={0}\n expanded={expanded}\n toggle={toggle}\n selectedId={selectedId}\n activeId={effectiveActive}\n onSelect={onSelect}\n onFocusItem={setActiveId}\n />\n ))}\n </ul>\n );\n}\n\ninterface TreeNodeProps {\n node: TreeNodeData;\n depth: number;\n expanded: Set<string>;\n toggle: (id: string) => void;\n selectedId?: string;\n activeId?: string;\n onSelect?: (id: string) => void;\n onFocusItem: (id: string) => void;\n}\n\nfunction TreeNode({\n node,\n depth,\n expanded,\n toggle,\n selectedId,\n activeId,\n onSelect,\n onFocusItem,\n}: TreeNodeProps) {\n const hasChildren = !!(node.children && node.children.length);\n const isOpen = expanded.has(node.id);\n const isSelected = selectedId === node.id;\n const isActive = activeId === node.id;\n return (\n <li role=\"none\" className=\"tree__node\">\n <div\n role=\"treeitem\"\n data-tree-id={node.id}\n data-depth={depth}\n aria-expanded={hasChildren ? isOpen : undefined}\n aria-selected={isSelected}\n tabIndex={isActive ? 0 : -1}\n className={cx('tree__row', isSelected && 'is-selected')}\n style={{ paddingLeft: `calc(var(--space-2) + var(--space-4) * ${depth})` }}\n onClick={() => {\n onFocusItem(node.id);\n onSelect?.(node.id);\n }}\n >\n {hasChildren ? (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className=\"tree__chev\"\n onClick={(e) => { e.stopPropagation(); toggle(node.id); }}\n >\n {isOpen ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </button>\n ) : (\n <span className=\"tree__chev tree__chev--placeholder\" aria-hidden=\"true\" />\n )}\n {node.icon && <span className=\"tree__icon\" aria-hidden=\"true\">{node.icon}</span>}\n <span className=\"tree__label\">{node.label}</span>\n {node.meta && <span className=\"tree__meta\">{node.meta}</span>}\n </div>\n {hasChildren && isOpen && (\n <ul role=\"group\" className=\"tree__children\">\n {node.children!.map((c) => (\n <TreeNode\n key={c.id}\n node={c}\n depth={depth + 1}\n expanded={expanded}\n toggle={toggle}\n selectedId={selectedId}\n activeId={activeId}\n onSelect={onSelect}\n onFocusItem={onFocusItem}\n />\n ))}\n </ul>\n )}\n </li>\n );\n}\n\n// ---------- Calendar (vista mes completa, no picker) -------------------\nexport interface CalendarEvent {\n date: Date;\n label: React.ReactNode;\n tone?: StatusTone;\n onClick?: () => void;\n}\n\nexport interface CalendarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Mes a mostrar. Default: mes actual. */\n month?: Date;\n events?: CalendarEvent[];\n onMonthChange?: (m: Date) => void;\n onDayClick?: (d: Date) => void;\n}\n\nexport function Calendar({ month: monthProp, events = [], onMonthChange, onDayClick, className, ...rest }: CalendarProps) {\n const [internalMonth, setInternalMonth] = React.useState(() => startOfMonth(monthProp ?? new Date()));\n const month = monthProp ? startOfMonth(monthProp) : internalMonth;\n const t = useLocale();\n const weekdays = t['calendar.weekdays'];\n const months = t['calendar.months'];\n const setMonth = (m: Date) => {\n if (!monthProp) setInternalMonth(m);\n onMonthChange?.(m);\n };\n\n const today = new Date();\n\n // primer día visible: lunes anterior al primer día del mes\n const firstDay = startOfMonth(month);\n const firstWeekday = (firstDay.getDay() + 6) % 7; // domingo=0 → 6, lunes=1 → 0\n const gridStart = new Date(firstDay);\n gridStart.setDate(firstDay.getDate() - firstWeekday);\n\n const days: Date[] = Array.from({ length: 42 }, (_, i) => {\n const d = new Date(gridStart);\n d.setDate(gridStart.getDate() + i);\n return d;\n });\n\n const eventsByDay = React.useMemo(() => {\n const m = new Map<string, CalendarEvent[]>();\n for (const ev of events) {\n const key = `${ev.date.getFullYear()}-${ev.date.getMonth()}-${ev.date.getDate()}`;\n const list = m.get(key) ?? [];\n list.push(ev);\n m.set(key, list);\n }\n return m;\n }, [events]);\n\n return (\n <div className={cx('calendar', className)} {...rest}>\n <div className=\"calendar__head\">\n <button type=\"button\" className=\"calendar__nav\" aria-label={t['calendar.prevMonth']} onClick={() => setMonth(addMonths(month, -1))}>\n <ChevronRight size={16} style={{ transform: 'rotate(180deg)' }} />\n </button>\n <div className=\"calendar__title\">{months[month.getMonth()]} {month.getFullYear()}</div>\n <button type=\"button\" className=\"calendar__nav\" aria-label={t['calendar.nextMonth']} onClick={() => setMonth(addMonths(month, 1))}>\n <ChevronRight size={16} />\n </button>\n </div>\n <div className=\"calendar__grid calendar__weekdays\">\n {weekdays.map((w) => <div key={w} className=\"calendar__weekday\">{w}</div>)}\n </div>\n <div className=\"calendar__grid\">\n {days.map((d, i) => {\n const inMonth = d.getMonth() === month.getMonth();\n const isToday = isSameDay(d, today);\n const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;\n const dayEvents = eventsByDay.get(key) ?? [];\n return (\n <button\n key={i}\n type=\"button\"\n className={cx('calendar__day', !inMonth && 'is-out', isToday && 'is-today')}\n onClick={() => onDayClick?.(d)}\n >\n <span className=\"calendar__daynum\">{d.getDate()}</span>\n {dayEvents.length > 0 && (\n <div className=\"calendar__events\">\n {dayEvents.slice(0, 2).map((ev, idx) => (\n <span\n key={idx}\n className={cx('calendar__event', `calendar__event--${ev.tone ?? 'neutral'}`)}\n onClick={(e) => { e.stopPropagation(); ev.onClick?.(); }}\n >\n {ev.label}\n </span>\n ))}\n {dayEvents.length > 2 && <span className=\"calendar__more\">+{dayEvents.length - 2}</span>}\n </div>\n )}\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -25,11 +25,26 @@ function categoryTickProps(opts, rotate = true) {
|
|
|
25
25
|
}
|
|
26
26
|
return props;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
28
|
+
function valueAxisProps(valueFormatter, allowDecimals) {
|
|
29
|
+
const props = { allowDecimals };
|
|
30
|
+
if (valueFormatter) props.tickFormatter = (v) => valueFormatter(Number(v));
|
|
31
|
+
return props;
|
|
32
|
+
}
|
|
33
|
+
function tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) {
|
|
34
|
+
const props = {};
|
|
35
|
+
if (valueFormatter) props.formatter = (v) => valueFormatter(Number(v));
|
|
36
|
+
const labelFormatter = tooltipLabelFormatter ?? xTickFormatter;
|
|
37
|
+
if (labelFormatter) props.labelFormatter = (v) => labelFormatter(String(v));
|
|
38
|
+
return props;
|
|
30
39
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
40
|
+
function allIntegerValues(data, keys) {
|
|
41
|
+
for (const row of data) {
|
|
42
|
+
for (const k of keys) {
|
|
43
|
+
const v = row[k];
|
|
44
|
+
if (typeof v === "number" && Number.isFinite(v) && !Number.isInteger(v)) return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
33
48
|
}
|
|
34
49
|
function LineChart({
|
|
35
50
|
recharts: R,
|
|
@@ -46,14 +61,17 @@ function LineChart({
|
|
|
46
61
|
xTickFormatter,
|
|
47
62
|
xTickInterval,
|
|
48
63
|
xTickAngle,
|
|
49
|
-
valueFormatter
|
|
64
|
+
valueFormatter,
|
|
65
|
+
allowDecimals,
|
|
66
|
+
tooltipLabelFormatter
|
|
50
67
|
}) {
|
|
51
68
|
const lineType = curve ?? (smooth ? "monotone" : "linear");
|
|
69
|
+
const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
|
|
52
70
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkPASF6T4H_js.cx("chart", className), role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(R.LineChart, { data, margin: { top: 8, right: 16, bottom: 0, left: 0 }, children: [
|
|
53
71
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
|
|
54
72
|
/* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
|
|
55
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...
|
|
56
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
|
|
57
75
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
|
|
58
76
|
series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
77
|
R.Line,
|
|
@@ -86,14 +104,17 @@ function AreaChart({
|
|
|
86
104
|
xTickFormatter,
|
|
87
105
|
xTickInterval,
|
|
88
106
|
xTickAngle,
|
|
89
|
-
valueFormatter
|
|
107
|
+
valueFormatter,
|
|
108
|
+
allowDecimals,
|
|
109
|
+
tooltipLabelFormatter
|
|
90
110
|
}) {
|
|
91
111
|
const lineType = curve ?? (smooth ? "monotone" : "linear");
|
|
112
|
+
const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
|
|
92
113
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkPASF6T4H_js.cx("chart", className), role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(R.AreaChart, { data, margin: { top: 8, right: 16, bottom: 0, left: 0 }, children: [
|
|
93
114
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
|
|
94
115
|
/* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...
|
|
96
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
|
|
97
118
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
|
|
98
119
|
series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
120
|
R.Area,
|
|
@@ -127,9 +148,12 @@ function BarChart({
|
|
|
127
148
|
xTickFormatter,
|
|
128
149
|
xTickInterval,
|
|
129
150
|
xTickAngle,
|
|
130
|
-
valueFormatter
|
|
151
|
+
valueFormatter,
|
|
152
|
+
allowDecimals,
|
|
153
|
+
tooltipLabelFormatter
|
|
131
154
|
}) {
|
|
132
155
|
const isHorizontal = layout === "horizontal";
|
|
156
|
+
const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
|
|
133
157
|
const endRadius = isHorizontal ? [0, BAR_RADIUS, BAR_RADIUS, 0] : [BAR_RADIUS, BAR_RADIUS, 0, 0];
|
|
134
158
|
const lastIdx = series.length - 1;
|
|
135
159
|
const catTicks = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle });
|
|
@@ -137,13 +161,13 @@ function BarChart({
|
|
|
137
161
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkPASF6T4H_js.cx("chart", className), role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(R.BarChart, { data, layout: isHorizontal ? "vertical" : "horizontal", margin: { top: 8, right: 16, bottom: 0, left: 0 }, children: [
|
|
138
162
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: isHorizontal, horizontal: !isHorizontal }),
|
|
139
163
|
isHorizontal ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
140
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { type: "number", stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { type: "number", stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
|
|
141
165
|
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { dataKey: categoryKey, type: "category", stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, width: 96, ...catTicksNoRotate })
|
|
142
166
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
143
167
|
/* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...catTicks }),
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...
|
|
168
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) })
|
|
145
169
|
] }),
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, cursor: { fill: "var(--bg-subtle)" }, ...
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, cursor: { fill: "var(--bg-subtle)" }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
|
|
147
171
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
|
|
148
172
|
series.map((s, i) => {
|
|
149
173
|
const barRadius = stacked ? i === lastIdx ? endRadius : [0, 0, 0, 0] : endRadius;
|
|
@@ -175,11 +199,11 @@ function DonutChart({
|
|
|
175
199
|
nameFormatter,
|
|
176
200
|
valueFormatter
|
|
177
201
|
}) {
|
|
178
|
-
const
|
|
202
|
+
const tooltipProps2 = nameFormatter || valueFormatter ? { formatter: (v, n) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] } : {};
|
|
179
203
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkPASF6T4H_js.cx("chart chart--donut", className), role: "img", "aria-label": ariaLabel, children: [
|
|
180
204
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "chart__donut-area", style: { height }, children: [
|
|
181
205
|
/* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(R.PieChart, { children: [
|
|
182
|
-
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...
|
|
206
|
+
/* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps2 }),
|
|
183
207
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
184
208
|
R.Pie,
|
|
185
209
|
{
|
|
@@ -238,5 +262,5 @@ exports.BarChart = BarChart;
|
|
|
238
262
|
exports.DonutChart = DonutChart;
|
|
239
263
|
exports.LineChart = LineChart;
|
|
240
264
|
exports.Sparkline = Sparkline;
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
265
|
+
//# sourceMappingURL=chunk-IKMKQUUR.js.map
|
|
266
|
+
//# sourceMappingURL=chunk-IKMKQUUR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Charts.tsx"],"names":["jsx","cx","jsxs","Fragment","tooltipProps"],"mappings":";;;;;AA8CA,IAAM,OAAA,GAAU;AAAA,EACd,sBAAA;AAAA,EACA,wBAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,qBAAA;AA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AAA;AAAA,MACA,MAAA,EAAQ,KAAA;AAAA,MACR,WAAA,EAAa,GAAA;AAAA,MACb,IAAA,EAAM,OAAO,KAAA,GAAQ,MAAA;AAAA,MACrB,WAAA,EAAa,OAAO,IAAA,GAAO,CAAA;AAAA,MAC3B,iBAAA,EAAmB;AAAA;AAAA,GACrB,EACF,GACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-IKMKQUUR.js","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\n\n/**\n * Lightweight chart wrappers. We do NOT bundle Recharts — the host app provides it\n * and passes the modules in via the `recharts` prop so consumers only pay for what they use.\n *\n * Recharts is treated as an implicit peer dependency: install it in the host\n * app if you use any chart component. Use **recharts ≥ 3** — earlier versions use\n * `defaultProps` on function components, which logs a deprecation warning under\n * React 19. recharts 3 removed them; these wrappers use default parameters, so on\n * recharts 3.8+ the console stays clean (verified).\n *\n * Usage in a Next.js client component:\n *\n * import * as Recharts from 'recharts';\n * import { LineChart } from '@misael703/elalba-ui';\n * <LineChart recharts={Recharts} data={...} dataKey=\"value\" categoryKey=\"month\" />\n */\n\n// Structural mirror of the Recharts public API. `any` is intentional here:\n// each Recharts component has a different prop shape, and typing them\n// exhaustively would mean depending on `recharts` types — which would force\n// consumers to install recharts even when they don't use any chart.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype RechartsComp = React.ComponentType<any>;\n\nexport type RechartsLike = {\n ResponsiveContainer: RechartsComp;\n LineChart: RechartsComp;\n AreaChart: RechartsComp;\n BarChart: RechartsComp;\n PieChart: RechartsComp;\n Line: RechartsComp;\n Area: RechartsComp;\n Bar: RechartsComp;\n Pie: RechartsComp;\n Cell: RechartsComp;\n CartesianGrid: RechartsComp;\n XAxis: RechartsComp;\n YAxis: RechartsComp;\n Tooltip: RechartsComp;\n Legend: RechartsComp;\n};\n\nconst PALETTE = [\n 'var(--color-primary)',\n 'var(--color-secondary)',\n 'var(--color-primary-900)',\n 'var(--color-success)',\n 'var(--color-warning)',\n 'var(--color-danger)',\n '#6b7e95',\n '#d4a574',\n];\n\nexport interface BaseChartProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n height?: number;\n className?: string;\n ariaLabel?: string;\n}\n\n// Mirror of Recharts' AxisInterval. Controls how category ticks thin on\n// collision so dense series (e.g. daily points) don't crowd the axis.\nexport type AxisInterval =\n | number\n | 'preserveStart'\n | 'preserveEnd'\n | 'preserveStartEnd'\n | 'equidistantPreserveStart'\n | 'equidistantPreserveEnd';\n\n// Shared cartesian controls (Line/Area/Bar). DonutChart/Sparkline don't have a\n// category axis, so they keep BaseChartProps.\nexport interface CartesianChartProps<D = any> extends BaseChartProps<D> {\n categoryKey: keyof D & string;\n series: Array<{ key: keyof D & string; label?: string; color?: string }>;\n showGrid?: boolean;\n showLegend?: boolean;\n /** Format each category-axis tick label, e.g. shorten `2026-05-23`. → XAxis.tickFormatter */\n xTickFormatter?: (value: string) => string;\n /** Thin out category ticks on collision. → XAxis.interval. Default `preserveStartEnd`. */\n xTickInterval?: AxisInterval;\n /** Rotate category-axis labels N degrees (anchors end + reserves height so they don't clip). */\n xTickAngle?: number;\n /** Format numeric values (value-axis ticks + tooltip). */\n valueFormatter?: (value: number) => string;\n /**\n * Allow fractional value-axis ticks. Default: auto — `false` when every series\n * value is an integer (count data → no `0.25` ticks), `true` otherwise. Pass\n * explicitly to override the auto-detection.\n */\n allowDecimals?: boolean;\n /**\n * Format the category label in the tooltip. Defaults to `xTickFormatter` so the\n * tooltip matches the axis (e.g. both show `18 jun`, not the raw `2026-06-18`).\n */\n tooltipLabelFormatter?: (value: string) => string;\n}\n\nconst DEFAULT_X_INTERVAL: AxisInterval = 'preserveStartEnd';\n\n// Recharts XAxis/YAxis are `any`-typed (structural mirror), so tick controls go\n// in as a spread. `rotate` is off when the category axis is the Y axis\n// (horizontal bars: those labels are already horizontal).\nfunction categoryTickProps(\n opts: Pick<CartesianChartProps, 'xTickFormatter' | 'xTickInterval' | 'xTickAngle'>,\n rotate = true,\n): Record<string, unknown> {\n const props: Record<string, unknown> = { interval: opts.xTickInterval ?? DEFAULT_X_INTERVAL };\n if (opts.xTickFormatter) props.tickFormatter = opts.xTickFormatter;\n if (rotate && opts.xTickAngle) {\n props.angle = opts.xTickAngle;\n props.textAnchor = 'end';\n props.height = 56; // reserve room so the rotated label isn't clipped\n }\n return props;\n}\n\n// Value axis: `allowDecimals` (count data → integer-only ticks) + optional\n// numeric tick formatter.\nfunction valueAxisProps(valueFormatter: ((v: number) => string) | undefined, allowDecimals: boolean): Record<string, unknown> {\n const props: Record<string, unknown> = { allowDecimals };\n if (valueFormatter) props.tickFormatter = (v: number) => valueFormatter(Number(v));\n return props;\n}\n\n// Tooltip: value formatter + a category-label formatter that defaults to the\n// axis tick formatter (so the hovered label matches the axis).\nfunction tooltipProps(\n valueFormatter: ((v: number) => string) | undefined,\n tooltipLabelFormatter: ((v: string) => string) | undefined,\n xTickFormatter: ((v: string) => string) | undefined,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (valueFormatter) props.formatter = (v: unknown) => valueFormatter(Number(v));\n const labelFormatter = tooltipLabelFormatter ?? xTickFormatter;\n if (labelFormatter) props.labelFormatter = (v: unknown) => labelFormatter(String(v));\n return props;\n}\n\n// True when every plotted value is an integer → drives the `allowDecimals` auto-\n// detection (count series shouldn't get `0.25`-style ticks).\nfunction allIntegerValues<D>(data: D[], keys: string[]): boolean {\n for (const row of data) {\n for (const k of keys) {\n const v = (row as Record<string, unknown>)[k];\n if (typeof v === 'number' && Number.isFinite(v) && !Number.isInteger(v)) return false;\n }\n }\n return true;\n}\n\n// ---------- LineChart ---------------------------------------------------\nexport interface LineChartProps<D = any> extends CartesianChartProps<D> {\n smooth?: boolean;\n /** Interpolation. `monotone` smooths (default, back-compat); `linear` draws honest\n * straight segments — recommended for counts/stepped series (no phantom humps over zeros). */\n curve?: 'linear' | 'monotone';\n}\n\nexport function LineChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter,\n}: LineChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.LineChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={{ background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 }} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Line\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n strokeWidth={2}\n dot={false}\n activeDot={{ r: 4 }}\n />\n ))}\n </R.LineChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- AreaChart ---------------------------------------------------\nexport interface AreaChartProps<D = any> extends LineChartProps<D> {\n stacked?: boolean;\n}\n\nexport function AreaChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve, stacked,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter,\n}: AreaChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.AreaChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={{ background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 }} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Area\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n fillOpacity={0.18}\n strokeWidth={2}\n />\n ))}\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- BarChart ----------------------------------------------------\nexport interface BarChartProps<D = any> extends CartesianChartProps<D> {\n layout?: 'vertical' | 'horizontal';\n stacked?: boolean;\n}\n\nconst BAR_RADIUS = 4;\n\nexport function BarChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n layout = 'vertical', stacked, showGrid = true, showLegend = true,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter,\n}: BarChartProps<D>) {\n const isHorizontal = layout === 'horizontal';\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n // Radius must round the VALUE end: top for columns ([tl,tr,br,bl] → [R,R,0,0]),\n // right for horizontal bars ([0,R,R,0]). The old hardcoded [4,4,0,0] left\n // horizontal bars rounded-top / pointed-bottom.\n const endRadius = isHorizontal ? [0, BAR_RADIUS, BAR_RADIUS, 0] : [BAR_RADIUS, BAR_RADIUS, 0, 0];\n const lastIdx = series.length - 1;\n const catTicks = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle });\n const catTicksNoRotate = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }, false);\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.BarChart data={data} layout={isHorizontal ? 'vertical' : 'horizontal'} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={isHorizontal} horizontal={!isHorizontal} />}\n {isHorizontal ? (\n <>\n <R.XAxis type=\"number\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.YAxis dataKey={categoryKey} type=\"category\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} width={96} {...catTicksNoRotate} />\n </>\n ) : (\n <>\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...catTicks} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n </>\n )}\n <R.Tooltip contentStyle={{ background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 }} cursor={{ fill: 'var(--bg-subtle)' }} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => {\n // Stacked: only the outermost (last) segment carries the end radius;\n // inner segments stay square so the stack reads as one bar.\n const barRadius = stacked ? (i === lastIdx ? endRadius : [0, 0, 0, 0]) : endRadius;\n return (\n <R.Bar\n key={s.key}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n radius={barRadius}\n maxBarSize={48}\n />\n );\n })}\n </R.BarChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- DonutChart --------------------------------------------------\nexport interface DonutChartProps extends Omit<BaseChartProps, 'data'> {\n data: Array<{ name: string; value: number; color?: string }>;\n centerLabel?: React.ReactNode;\n showLegend?: boolean;\n innerRadius?: number;\n outerRadius?: number;\n /** Format slice names in tooltip + legend, e.g. `V_REGION` → `V Región` (no need to pre-map the data). */\n nameFormatter?: (name: string) => string;\n /** Format slice values in the tooltip. */\n valueFormatter?: (value: number) => string;\n}\n\nexport function DonutChart({\n recharts: R, data, height = 240, className, ariaLabel,\n centerLabel, showLegend = true, innerRadius = 60, outerRadius = 88,\n nameFormatter, valueFormatter,\n}: DonutChartProps) {\n // Recharts Tooltip formatter returns [formattedValue, formattedName].\n const tooltipProps = (nameFormatter || valueFormatter)\n ? { formatter: (v: unknown, n: unknown) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] }\n : {};\n return (\n <div className={cx('chart chart--donut', className)} role=\"img\" aria-label={ariaLabel}>\n <div className=\"chart__donut-area\" style={{ height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.PieChart>\n <R.Tooltip contentStyle={{ background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 }} {...tooltipProps} />\n <R.Pie\n data={data}\n dataKey=\"value\"\n nameKey=\"name\"\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={2}\n stroke=\"var(--bg-surface)\"\n >\n {data.map((d, i) => <R.Cell key={i} fill={d.color ?? PALETTE[i % PALETTE.length]} />)}\n </R.Pie>\n </R.PieChart>\n </R.ResponsiveContainer>\n {centerLabel && <div className=\"chart__center\">{centerLabel}</div>}\n </div>\n {showLegend && (\n <ul className=\"chart__legend\" aria-hidden=\"true\">\n {data.map((d, i) => (\n <li key={d.name} className=\"chart__legend-item\">\n <span\n className=\"chart__legend-swatch\"\n style={{ background: d.color ?? PALETTE[i % PALETTE.length] }}\n />\n <span className=\"chart__legend-label\">{nameFormatter ? nameFormatter(d.name) : d.name}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n\n// ---------- Sparkline ---------------------------------------------------\nexport interface SparklineProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n dataKey: keyof D & string;\n width?: number;\n height?: number;\n color?: string;\n fill?: boolean;\n className?: string;\n ariaLabel?: string;\n}\n\nexport function Sparkline<D = any>({\n recharts: R, data, dataKey,\n width = 120, height = 32, color = 'var(--color-primary)',\n fill = true, className, ariaLabel,\n}: SparklineProps<D>) {\n return (\n <div className={cx('sparkline', className)} role=\"img\" aria-label={ariaLabel} style={{ width, height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.AreaChart data={data} margin={{ top: 2, right: 0, bottom: 2, left: 0 }}>\n <R.Area\n type=\"monotone\"\n dataKey={dataKey}\n stroke={color}\n strokeWidth={1.5}\n fill={fill ? color : 'none'}\n fillOpacity={fill ? 0.18 : 0}\n isAnimationActive={false}\n />\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunk55P5FA5Q_js = require('./chunk-55P5FA5Q.js');
|
|
5
4
|
var chunkD2H4VZVL_js = require('./chunk-D2H4VZVL.js');
|
|
6
5
|
var chunkNPXEZCTA_js = require('./chunk-NPXEZCTA.js');
|
|
6
|
+
var chunk55P5FA5Q_js = require('./chunk-55P5FA5Q.js');
|
|
7
7
|
var chunkDKOAATV2_js = require('./chunk-DKOAATV2.js');
|
|
8
8
|
var chunkC4AKMVDZ_js = require('./chunk-C4AKMVDZ.js');
|
|
9
9
|
var chunkPASF6T4H_js = require('./chunk-PASF6T4H.js');
|
|
@@ -216,5 +216,5 @@ function PageHeader({ title, description, breadcrumbs, actions, meta, className
|
|
|
216
216
|
|
|
217
217
|
exports.AppShell = AppShell;
|
|
218
218
|
exports.PageHeader = PageHeader;
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
219
|
+
//# sourceMappingURL=chunk-M7QZCHMM.js.map
|
|
220
|
+
//# sourceMappingURL=chunk-M7QZCHMM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AppShell.tsx"],"names":["React","NavItemNode","cx","jsxs","Fragment","jsx","useLocale","useEscape","useFocusTrap","useScrollLock","MenuIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsKA,IAAM,WAAA,GAAoBA,gBAAA,CAAA,IAAA,CAAK,SAASC,YAAAA,CAAY;AAAA,EAClD,IAAA;AAAA,EAAM,KAAA;AAAA,EAAO,MAAA;AAAA,EAAQ;AACvB,CAAA,EAAqB;AACnB,EAAA,MAAM,KAAA,GAAQC,oBAAG,mBAAA,EAAqB,IAAA,CAAK,UAAU,WAAA,EAAa,CAAA,yBAAA,EAA4B,KAAK,CAAA,CAAE,CAAA;AACrG,EAAA,MAAM,wBACJC,eAAA,CAAAC,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,IAAA,CAAK,IAAA,mCAAS,MAAA,EAAA,EAAK,SAAA,EAAU,qBAAoB,aAAA,EAAY,MAAA,EAAQ,eAAK,IAAA,EAAK,CAAA;AAAA,oBAChFC,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,oBAAA,EAAsB,eAAK,KAAA,EAAM,CAAA;AAAA,IAChD,KAAK,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leProvider';\nimport { useFocusTrap, useEscape, useScrollLock } from '../hooks';\nimport { MenuIcon } from './Icons';\n\n// ---------- AppShell (full-width header + sidebar + content) ------------\n// Designed to drop into a Next.js app/layout.tsx as a Client Component shell.\n//\n// v1.31 BREAKING: the kit no longer exposes a `side` layout. Only the\n// `top` shape exists: a full-width header above the body, three header\n// slots (left/center/right), a sidebar below for navigation, and a content\n// area that owns its own scroll. The `headerLayout` prop is removed.\n\nexport interface NavItem {\n id: string;\n label: React.ReactNode;\n icon?: React.ReactNode;\n href?: string;\n active?: boolean;\n badge?: React.ReactNode;\n onSelect?: () => void;\n children?: NavItem[];\n}\n\nexport interface NavSection {\n id?: string;\n label?: React.ReactNode;\n items: NavItem[];\n}\n\nexport type AppShellTheme = 'default' | 'brand';\n\n/**\n * Collapse API handed to header-slot render-props so a consumer-placed control\n * (e.g. a hamburger in `header.left`) can drive the sidebar — crucially in\n * **uncontrolled** mode, where there is no built-in toggle affordance. This\n * is what lets `persistKey` (uncontrolled) coexist with a custom header\n * trigger: the kit owns the state + persistence, the consumer owns the\n * trigger's look and placement.\n *\n * `toggle()` is DWIM by viewport: on desktop it flips `collapsed` (the\n * rail/hide state); below 900px it flips an overlay drawer instead — same\n * single click handler regardless of breakpoint.\n */\nexport interface AppShellHeaderApi {\n /** Current collapsed state. */\n collapsed: boolean;\n /** Flip the collapsed state on desktop, or the drawer in mobile. */\n toggle: () => void;\n /** Set the collapsed state explicitly. */\n setCollapsed: (collapsed: boolean) => void;\n}\n\n/**\n * A header slot: a static node, or a render-prop receiving {@link AppShellHeaderApi}.\n * The function form is the only way to toggle an uncontrolled shell from the\n * header (no built-in toggle exists).\n */\nexport type AppShellHeaderSlot =\n | React.ReactNode\n | ((api: AppShellHeaderApi) => React.ReactNode);\n\nexport interface AppShellHeader {\n /** Left slot — typically a menu/hamburger trigger or back action. */\n left?: AppShellHeaderSlot;\n /** Center slot — typically the brand (Logo). Lands at the true viewport centre. */\n center?: AppShellHeaderSlot;\n /** Right slot — notifications, user avatar, utilities. */\n right?: AppShellHeaderSlot;\n}\n\n/**\n * AppShell props.\n *\n * @example\n * <AppShell\n * sections={sections}\n * header={{\n * left: ({ toggle }) => <button onClick={toggle}>Menu</button>,\n * center: <Logo />,\n * right: <Avatar />,\n * }}\n * >\n * {children}\n * </AppShell>\n */\nexport interface AppShellProps {\n /**\n * Navigation sections that populate the sidebar. Omit (or pass an empty\n * array) to render a **top-bar-only** shell — no sidebar at all, body\n * collapses to a single column. Use when the app is flat-route (no panel\n * nav), e.g. a kiosk/checkout flow.\n */\n sections?: NavSection[];\n /** Slot at the bottom of the sidebar (version label, env tag, etc.). */\n footer?: React.ReactNode;\n /** Initial collapsed state (uncontrolled). */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state — pair with `onCollapsedChange`. */\n collapsed?: boolean;\n /** Called when `collapsed` flips (controlled mode handshake). */\n onCollapsedChange?: (c: boolean) => void;\n /**\n * Persist the collapsed state in `localStorage[persistKey]` so it survives\n * reloads. Opt-in: omit it and the shell keeps the default behaviour (resets\n * to `defaultCollapsed` on each mount). SSR-safe — the initial render still\n * uses `defaultCollapsed` (no hydration mismatch); the stored value is read\n * after mount, so a differing value may flash for one frame. Ignored in\n * controlled mode (when `collapsed` is provided): the host owns persistence.\n */\n persistKey?: string;\n children: React.ReactNode;\n className?: string;\n /**\n * Sidebar color theme:\n * - `default` (light): claro, mejor para apps data-heavy de uso prolongado.\n * - `brand`: superficie azul de marca con texto blanco. Mayor brand recall.\n *\n * The header band's theme is `headerTheme`, defaulting to this value so\n * `theme=\"brand\"` tints both bands by default.\n */\n theme?: AppShellTheme;\n /**\n * Header band theme, independent of the sidebar (`theme`). Defaults to\n * `theme`. Set `theme=\"default\" headerTheme=\"brand\"` for a branded top\n * bar over a neutral, legible sidebar — common in data-heavy admin apps.\n */\n headerTheme?: AppShellTheme;\n /**\n * Collapse to an icon rail (72px) instead of hiding the sidebar entirely.\n * Default `false` → `collapsed` hides the sidebar (slides off-screen).\n * `true` → `collapsed` keeps a 72px rail showing the nav icons (labels\n * hidden, active-item bar kept).\n */\n collapsedRail?: boolean;\n /**\n * Render the kit's standard menu toggle (hamburger) at the start of\n * `header.left`. Default trigger for the drawer (mobile) / collapsed\n * state (desktop), so consumers don't need the `header.left`\n * render-prop just to get a working toggle. The render-prop remains\n * available — when both are provided, the kit toggle renders first\n * and the consumer's slot content renders after it. Ignored when\n * `sections` is empty (top-bar-only shell).\n */\n showMenuToggle?: boolean;\n /** Slots for the full-width header. */\n header?: AppShellHeader;\n /** Render-prop for navigation links so the host app can use Next.js Link, etc. */\n linkAs?: (item: NavItem, content: React.ReactNode, className: string) => React.ReactNode;\n}\n\n// Recursive nav item, memoized so a single item's parent re-render doesn't\n// churn through every other item in the tree. Stability of `linkAs` and\n// `onCloseMobile` is the parent's responsibility (we stabilize\n// `onCloseMobile` via useCallback below; consumers should memoize `linkAs`\n// if they care about avoiding renders, but for typical Next.js Link usage\n// the inline arrow is rarely a hot path).\ninterface NavItemNodeProps {\n item: NavItem;\n depth: number;\n linkAs?: AppShellProps['linkAs'];\n onCloseMobile: () => void;\n}\n\nconst NavItemNode = React.memo(function NavItemNode({\n item, depth, linkAs, onCloseMobile,\n}: NavItemNodeProps) {\n const klass = cx('appshell__navitem', item.active && 'is-active', `appshell__navitem--depth-${depth}`);\n const inner = (\n <>\n {item.icon && <span className=\"appshell__navicon\" aria-hidden=\"true\">{item.icon}</span>}\n <span className=\"appshell__navlabel\">{item.label}</span>\n {item.badge && <span className=\"appshell__navbadge\">{item.badge}</span>}\n </>\n );\n const node = item.href && linkAs\n ? linkAs(item, inner, klass)\n : (\n <a\n href={item.href ?? '#'}\n className={klass}\n aria-current={item.active ? 'page' : undefined}\n onClick={(e) => {\n if (!item.href) e.preventDefault();\n item.onSelect?.();\n onCloseMobile();\n }}\n >\n {inner}\n </a>\n );\n return (\n <li>\n {node}\n {item.children && item.children.length > 0 && (\n <ul className=\"appshell__navchildren\">\n {item.children.map((c) => (\n <NavItemNode key={c.id} item={c} depth={depth + 1} linkAs={linkAs} onCloseMobile={onCloseMobile} />\n ))}\n </ul>\n )}\n </li>\n );\n});\n\n/**\n * Mobile drawer breakpoint. Below this, `toggle()` flips an overlay drawer\n * (`is-mobile-open`) instead of the desktop collapse — see CSS\n * `@media (max-width: 900px)` for the visual shape. Kept in sync with that\n * media query; if you change one, change both.\n */\nconst MOBILE_BREAKPOINT = '(max-width: 900px)';\n\n// Stable id for `aria-controls` on the built-in menu toggle. Static (not\n// per-instance via useId) because a page only renders one AppShell; if a\n// host ever ships two, the duplicate id is the lesser problem vs. losing\n// SSR/CSR id stability for the toggle's aria-controls handshake.\nconst SIDEBAR_ID = 'appshell-sidebar';\n\nexport function AppShell({\n sections = [],\n footer,\n defaultCollapsed = false,\n collapsed: ctrlCollapsed,\n onCollapsedChange,\n persistKey,\n children,\n className,\n theme = 'default',\n headerTheme: ctrlHeaderTheme,\n collapsedRail = false,\n showMenuToggle = false,\n header,\n linkAs,\n}: AppShellProps) {\n const t = useLocale();\n const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);\n const collapsed = ctrlCollapsed ?? internalCollapsed;\n // Header band themes independently of the sidebar; defaults to `theme`\n // so `theme=\"brand\"` keeps tinting both bands.\n const headerTheme = ctrlHeaderTheme ?? theme;\n const hasSidebar = sections.length > 0;\n\n // SSR-safe persistence: the initial render uses `defaultCollapsed` (server\n // and first client render agree → no hydration mismatch), then we sync from\n // localStorage after mount. Only in uncontrolled mode; reads can throw\n // (Safari private mode), so they're guarded. Runs once per persistKey.\n React.useEffect(() => {\n if (persistKey == null || ctrlCollapsed !== undefined) return;\n try {\n const stored = window.localStorage.getItem(persistKey);\n if (stored === '0' || stored === '1') setInternalCollapsed(stored === '1');\n } catch {\n /* localStorage unavailable — keep defaultCollapsed */\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- sync once at mount; ctrlCollapsed read intentionally not tracked\n }, [persistKey]);\n\n const setCollapsed = (v: boolean) => {\n if (ctrlCollapsed === undefined) setInternalCollapsed(v);\n if (persistKey != null && ctrlCollapsed === undefined) {\n try {\n window.localStorage.setItem(persistKey, v ? '1' : '0');\n } catch {\n /* localStorage unavailable — persistence is best-effort */\n }\n }\n onCollapsedChange?.(v);\n };\n\n const [mobileOpen, setMobileOpen] = React.useState(false);\n // Track whether matchMedia says we are below the mobile breakpoint. State\n // (not ref) so React re-renders when it flips — `aria-hidden` on the\n // closed mobile drawer is derived from this, and a ref-only value would\n // never land on the DOM (the ref update doesn't trigger a re-render).\n // Initial render uses `false` (SSR-safe; matchMedia is browser-only) and\n // the effect corrects it post-mount. The listener also clears\n // `mobileOpen` when the user resizes back into desktop, so a stale-open\n // drawer doesn't ghost.\n const [isMobile, setIsMobile] = React.useState(false);\n React.useEffect(() => {\n if (typeof window === 'undefined' || !window.matchMedia) return;\n const mql = window.matchMedia(MOBILE_BREAKPOINT);\n setIsMobile(mql.matches);\n const onChange = (e: MediaQueryListEvent) => {\n setIsMobile(e.matches);\n if (!e.matches) setMobileOpen(false);\n };\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, []);\n\n // Mirror `collapsed` to `mobileOpen` in mobile: any flip of `collapsed`\n // (e.g. a controlled consumer's static hamburger that calls setCollapsed\n // directly instead of going through `headerApi.toggle()`) opens/closes\n // the drawer. Without this sync, a controlled consumer's button reads as\n // dead in mobile — flipping `collapsed` is invisible because the aside\n // is a fixed overlay that ignores collapsed in mobile.\n //\n // Semantics: `collapsed=true` means \"menu hidden\" in BOTH viewports\n // (rail/hide on desktop, drawer-closed on mobile). The DWIM `toggle()`\n // for the render-prop API still does its mobileOpen flip directly, but\n // any out-of-band `collapsed` change also propagates here.\n //\n // Initial render must NOT auto-open the drawer just because\n // `collapsed=false` happens to be the default — track previous value\n // and only mirror when it actually changes.\n const prevCollapsed = React.useRef(collapsed);\n React.useEffect(() => {\n if (!isMobile) return;\n if (prevCollapsed.current === collapsed) return;\n prevCollapsed.current = collapsed;\n setMobileOpen(!collapsed);\n }, [isMobile, collapsed]);\n\n // ESC closes the drawer (only active while open — no leaked listener).\n const closeMobileDrawer = React.useCallback(() => setMobileOpen(false), []);\n useEscape(mobileOpen, closeMobileDrawer);\n // Focus trap inside the open drawer: focuses the first nav link on open,\n // cycles Tab/Shift+Tab within, restores focus to the trigger on close.\n // Same hook used by Modal/Drawer — single source of truth for the trap.\n const drawerRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(drawerRef, mobileOpen);\n // Lock body scroll while the drawer is open so the content behind the\n // scrim doesn't drift on touch. Shares a global counter with Modal/Drawer\n // (kit-wide nesting safe).\n useScrollLock(mobileOpen);\n\n // The DWIM toggle: mobile flips the drawer, desktop flips `collapsed`.\n // Same API surface (`headerApi.toggle`) — the consumer's hamburger keeps\n // its single click handler regardless of viewport.\n const headerApi: AppShellHeaderApi = {\n collapsed,\n toggle: () => {\n if (isMobile) setMobileOpen((o) => !o);\n else setCollapsed(!collapsed);\n },\n setCollapsed,\n };\n const slot = (s: AppShellHeaderSlot): React.ReactNode =>\n typeof s === 'function' ? (s as (api: AppShellHeaderApi) => React.ReactNode)(headerApi) : s;\n\n return (\n <div className={cx(\n 'appshell', `appshell--${theme}`, 'appshell--header-top', `appshell--header-${headerTheme}`,\n collapsedRail && 'appshell--rail',\n !hasSidebar && 'appshell--no-nav',\n collapsed && 'is-collapsed',\n mobileOpen && 'is-mobile-open',\n className,\n )}>\n {/* On a brand header the band is dark, so re-scope foreground tokens\n via data-tone=\"inverse\" — anything inside (Avatar, badges, links)\n becomes band-aware automatically without per-call-site colors. */}\n <header className=\"appshell__header\" role=\"banner\" data-tone={headerTheme === 'brand' ? 'inverse' : undefined}>\n <div className=\"appshell__header-left\">\n {showMenuToggle && hasSidebar && (\n <button\n type=\"button\"\n className=\"appshell__menu-toggle\"\n aria-label={t['appshell.toggleMenu']}\n aria-expanded={isMobile ? mobileOpen : !collapsed}\n aria-controls={SIDEBAR_ID}\n onClick={headerApi.toggle}\n >\n <MenuIcon size={20} />\n </button>\n )}\n {slot(header?.left)}\n </div>\n <div className=\"appshell__header-center\">{slot(header?.center)}</div>\n <div className=\"appshell__header-right\">{slot(header?.right)}</div>\n </header>\n <div className=\"appshell__body\">\n {hasSidebar && (\n <aside\n ref={drawerRef}\n id={SIDEBAR_ID}\n className=\"appshell__sidebar\"\n aria-label={t['appshell.mainNav']}\n /* Closed mobile drawer: hide from assistive tech so a screen\n reader doesn't tab through 30 offscreen links. */\n aria-hidden={isMobile && !mobileOpen ? true : undefined}\n >\n <nav className=\"appshell__nav\">\n {sections.map((s, i) => (\n <div key={s.id ?? i} className=\"appshell__navsection\">\n {s.label && <div className=\"appshell__navlabel-section\">{s.label}</div>}\n <ul>{s.items.map((it) => (\n <NavItemNode key={it.id} item={it} depth={0} linkAs={linkAs} onCloseMobile={closeMobileDrawer} />\n ))}</ul>\n </div>\n ))}\n </nav>\n {footer != null && (\n <div className=\"appshell__sidebar-foot\">{footer}</div>\n )}\n </aside>\n )}\n <main className=\"appshell__content\" role=\"main\">{children}</main>\n {/* Scrim is a child of the body so it MATCHES the body's exact\n bounds via `position: absolute; inset: 0` — not a sibling of\n the body using viewport-relative math, which couldn't keep up\n when the actual header height drifted from the\n `--appshell-header-height` var (e.g., 73 rendered vs 56 in the\n var). Click-anywhere-out closes. */}\n {mobileOpen && (\n <div\n className=\"appshell__scrim\"\n onClick={closeMobileDrawer}\n aria-hidden=\"true\"\n />\n )}\n </div>\n </div>\n );\n}\n\n// ---------- PageHeader --------------------------------------------------\nexport interface PageHeaderProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n breadcrumbs?: Array<{ label: React.ReactNode; href?: string }>;\n actions?: React.ReactNode;\n meta?: React.ReactNode;\n className?: string;\n}\n\nexport function PageHeader({ title, description, breadcrumbs, actions, meta, className }: PageHeaderProps) {\n const t = useLocale();\n return (\n <div className={cx('page-header', className)}>\n {breadcrumbs && breadcrumbs.length > 0 && (\n <nav className=\"page-header__crumbs\" aria-label={t['appshell.breadcrumb']}>\n <ol>\n {breadcrumbs.map((c, i) => (\n <li key={i}>\n {c.href ? <a href={c.href}>{c.label}</a> : <span aria-current=\"page\">{c.label}</span>}\n {i < breadcrumbs.length - 1 && <span className=\"page-header__crumb-sep\" aria-hidden=\"true\">/</span>}\n </li>\n ))}\n </ol>\n </nav>\n )}\n <div className=\"page-header__row\">\n <div className=\"page-header__title-wrap\">\n <h1 className=\"page-header__title\">{title}</h1>\n {description && <p className=\"page-header__desc\">{description}</p>}\n </div>\n {actions && <div className=\"page-header__actions\">{actions}</div>}\n </div>\n {meta && <div className=\"page-header__meta\">{meta}</div>}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/AppShell.tsx"],"names":["React","NavItemNode","cx","jsxs","Fragment","jsx","useLocale","useEscape","useFocusTrap","useScrollLock","MenuIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsKA,IAAM,WAAA,GAAoBA,gBAAA,CAAA,IAAA,CAAK,SAASC,YAAAA,CAAY;AAAA,EAClD,IAAA;AAAA,EAAM,KAAA;AAAA,EAAO,MAAA;AAAA,EAAQ;AACvB,CAAA,EAAqB;AACnB,EAAA,MAAM,KAAA,GAAQC,oBAAG,mBAAA,EAAqB,IAAA,CAAK,UAAU,WAAA,EAAa,CAAA,yBAAA,EAA4B,KAAK,CAAA,CAAE,CAAA;AACrG,EAAA,MAAM,wBACJC,eAAA,CAAAC,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,IAAA,CAAK,IAAA,mCAAS,MAAA,EAAA,EAAK,SAAA,EAAU,qBAAoB,aAAA,EAAY,MAAA,EAAQ,eAAK,IAAA,EAAK,CAAA;AAAA,oBAChFC,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,oBAAA,EAAsB,eAAK,KAAA,EAAM,CAAA;AAAA,IAChD,KAAK,KAAA,oBAASA,cAAA,CAAC,UAAK,SAAA,EAAU,oBAAA,EAAsB,eAAK,KAAA,EAAM;AAAA,GAAA,E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cAAA,CAAC,GAAA,EAAA,EAAE,IAAA,EAAM,EAAE,IAAA,EAAO,QAAA,EAAA,CAAA,CAAE,KAAA,EAAM,CAAA,mBAAOA,cAAA,CAAC,MAAA,EAAA,EAAK,cAAA,EAAa,MAAA,EAAQ,YAAE,KAAA,EAAM,CAAA;AAAA,MAC7E,CAAA,GAAI,WAAA,CAAY,MAAA,GAAS,CAAA,oBAAKA,cAAA,CAAC,UAAK,SAAA,EAAU,wBAAA,EAAyB,aAAA,EAAY,MAAA,EAAO,QAAA,EAAA,GAAA,EAAC;AAAA,KAAA,EAAA,EAFrF,CAGT,CACD,CAAA,EACH,CAAA,EACF,CAAA;AAAA,oBAEFF,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,kBAAA,EACb,QAAA,EAAA;AAAA,sBAAAA,eAAA,CAAC,KAAA,EAAA,EAAI,WAAU,yBAAA,EACb,QAAA,EAAA;AAAA,wBAAAE,cAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,oBAAA,EAAsB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,QACzC,WAAA,oBAAeA,cAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,qBAAqB,QAAA,EAAA,WAAA,EAAY;AAAA,OAAA,EAChE,CAAA;AAAA,MACC,OAAA,oBAAWA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wBAAwB,QAAA,EAAA,OAAA,EAAQ;AAAA,KAAA,EAC7D,CAAA;AAAA,IACC,IAAA,oBAAQA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,qBAAqB,QAAA,EAAA,IAAA,EAAK;AAAA,GAAA,EACpD,CAAA;AAEJ","file":"chunk-M7QZCHMM.js","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\nimport { useLocale } from '../locale/LocaleProvider';\nimport { useFocusTrap, useEscape, useScrollLock } from '../hooks';\nimport { MenuIcon } from './Icons';\n\n// ---------- AppShell (full-width header + sidebar + content) ------------\n// Designed to drop into a Next.js app/layout.tsx as a Client Component shell.\n//\n// v1.31 BREAKING: the kit no longer exposes a `side` layout. Only the\n// `top` shape exists: a full-width header above the body, three header\n// slots (left/center/right), a sidebar below for navigation, and a content\n// area that owns its own scroll. The `headerLayout` prop is removed.\n\nexport interface NavItem {\n id: string;\n label: React.ReactNode;\n icon?: React.ReactNode;\n href?: string;\n active?: boolean;\n badge?: React.ReactNode;\n onSelect?: () => void;\n children?: NavItem[];\n}\n\nexport interface NavSection {\n id?: string;\n label?: React.ReactNode;\n items: NavItem[];\n}\n\nexport type AppShellTheme = 'default' | 'brand';\n\n/**\n * Collapse API handed to header-slot render-props so a consumer-placed control\n * (e.g. a hamburger in `header.left`) can drive the sidebar — crucially in\n * **uncontrolled** mode, where there is no built-in toggle affordance. This\n * is what lets `persistKey` (uncontrolled) coexist with a custom header\n * trigger: the kit owns the state + persistence, the consumer owns the\n * trigger's look and placement.\n *\n * `toggle()` is DWIM by viewport: on desktop it flips `collapsed` (the\n * rail/hide state); below 900px it flips an overlay drawer instead — same\n * single click handler regardless of breakpoint.\n */\nexport interface AppShellHeaderApi {\n /** Current collapsed state. */\n collapsed: boolean;\n /** Flip the collapsed state on desktop, or the drawer in mobile. */\n toggle: () => void;\n /** Set the collapsed state explicitly. */\n setCollapsed: (collapsed: boolean) => void;\n}\n\n/**\n * A header slot: a static node, or a render-prop receiving {@link AppShellHeaderApi}.\n * The function form is the only way to toggle an uncontrolled shell from the\n * header (no built-in toggle exists).\n */\nexport type AppShellHeaderSlot =\n | React.ReactNode\n | ((api: AppShellHeaderApi) => React.ReactNode);\n\nexport interface AppShellHeader {\n /** Left slot — typically a menu/hamburger trigger or back action. */\n left?: AppShellHeaderSlot;\n /** Center slot — typically the brand (Logo). Lands at the true viewport centre. */\n center?: AppShellHeaderSlot;\n /** Right slot — notifications, user avatar, utilities. */\n right?: AppShellHeaderSlot;\n}\n\n/**\n * AppShell props.\n *\n * @example\n * <AppShell\n * sections={sections}\n * header={{\n * left: ({ toggle }) => <button onClick={toggle}>Menu</button>,\n * center: <Logo />,\n * right: <Avatar />,\n * }}\n * >\n * {children}\n * </AppShell>\n */\nexport interface AppShellProps {\n /**\n * Navigation sections that populate the sidebar. Omit (or pass an empty\n * array) to render a **top-bar-only** shell — no sidebar at all, body\n * collapses to a single column. Use when the app is flat-route (no panel\n * nav), e.g. a kiosk/checkout flow.\n */\n sections?: NavSection[];\n /** Slot at the bottom of the sidebar (version label, env tag, etc.). */\n footer?: React.ReactNode;\n /** Initial collapsed state (uncontrolled). */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state — pair with `onCollapsedChange`. */\n collapsed?: boolean;\n /** Called when `collapsed` flips (controlled mode handshake). */\n onCollapsedChange?: (c: boolean) => void;\n /**\n * Persist the collapsed state in `localStorage[persistKey]` so it survives\n * reloads. Opt-in: omit it and the shell keeps the default behaviour (resets\n * to `defaultCollapsed` on each mount). SSR-safe — the initial render still\n * uses `defaultCollapsed` (no hydration mismatch); the stored value is read\n * after mount, so a differing value may flash for one frame. Ignored in\n * controlled mode (when `collapsed` is provided): the host owns persistence.\n */\n persistKey?: string;\n children: React.ReactNode;\n className?: string;\n /**\n * Sidebar color theme:\n * - `default` (light): claro, mejor para apps data-heavy de uso prolongado.\n * - `brand`: superficie azul de marca con texto blanco. Mayor brand recall.\n *\n * The header band's theme is `headerTheme`, defaulting to this value so\n * `theme=\"brand\"` tints both bands by default.\n */\n theme?: AppShellTheme;\n /**\n * Header band theme, independent of the sidebar (`theme`). Defaults to\n * `theme`. Set `theme=\"default\" headerTheme=\"brand\"` for a branded top\n * bar over a neutral, legible sidebar — common in data-heavy admin apps.\n */\n headerTheme?: AppShellTheme;\n /**\n * Collapse to an icon rail (72px) instead of hiding the sidebar entirely.\n * Default `false` → `collapsed` hides the sidebar (slides off-screen).\n * `true` → `collapsed` keeps a 72px rail showing the nav icons (labels\n * hidden, active-item bar kept).\n */\n collapsedRail?: boolean;\n /**\n * Render the kit's standard menu toggle (hamburger) at the start of\n * `header.left`. Default trigger for the drawer (mobile) / collapsed\n * state (desktop), so consumers don't need the `header.left`\n * render-prop just to get a working toggle. The render-prop remains\n * available — when both are provided, the kit toggle renders first\n * and the consumer's slot content renders after it. Ignored when\n * `sections` is empty (top-bar-only shell).\n */\n showMenuToggle?: boolean;\n /** Slots for the full-width header. */\n header?: AppShellHeader;\n /** Render-prop for navigation links so the host app can use Next.js Link, etc. */\n linkAs?: (item: NavItem, content: React.ReactNode, className: string) => React.ReactNode;\n}\n\n// Recursive nav item, memoized so a single item's parent re-render doesn't\n// churn through every other item in the tree. Stability of `linkAs` and\n// `onCloseMobile` is the parent's responsibility (we stabilize\n// `onCloseMobile` via useCallback below; consumers should memoize `linkAs`\n// if they care about avoiding renders, but for typical Next.js Link usage\n// the inline arrow is rarely a hot path).\ninterface NavItemNodeProps {\n item: NavItem;\n depth: number;\n linkAs?: AppShellProps['linkAs'];\n onCloseMobile: () => void;\n}\n\nconst NavItemNode = React.memo(function NavItemNode({\n item, depth, linkAs, onCloseMobile,\n}: NavItemNodeProps) {\n const klass = cx('appshell__navitem', item.active && 'is-active', `appshell__navitem--depth-${depth}`);\n const inner = (\n <>\n {item.icon && <span className=\"appshell__navicon\" aria-hidden=\"true\">{item.icon}</span>}\n <span className=\"appshell__navlabel\">{item.label}</span>\n {item.badge && <span className=\"appshell__navbadge\">{item.badge}</span>}\n </>\n );\n const node = item.href && linkAs\n ? linkAs(item, inner, klass)\n : (\n <a\n href={item.href ?? '#'}\n className={klass}\n aria-current={item.active ? 'page' : undefined}\n onClick={(e) => {\n if (!item.href) e.preventDefault();\n item.onSelect?.();\n onCloseMobile();\n }}\n >\n {inner}\n </a>\n );\n return (\n <li>\n {node}\n {item.children && item.children.length > 0 && (\n <ul className=\"appshell__navchildren\">\n {item.children.map((c) => (\n <NavItemNode key={c.id} item={c} depth={depth + 1} linkAs={linkAs} onCloseMobile={onCloseMobile} />\n ))}\n </ul>\n )}\n </li>\n );\n});\n\n/**\n * Mobile drawer breakpoint. Below this, `toggle()` flips an overlay drawer\n * (`is-mobile-open`) instead of the desktop collapse — see CSS\n * `@media (max-width: 900px)` for the visual shape. Kept in sync with that\n * media query; if you change one, change both.\n */\nconst MOBILE_BREAKPOINT = '(max-width: 900px)';\n\n// Stable id for `aria-controls` on the built-in menu toggle. Static (not\n// per-instance via useId) because a page only renders one AppShell; if a\n// host ever ships two, the duplicate id is the lesser problem vs. losing\n// SSR/CSR id stability for the toggle's aria-controls handshake.\nconst SIDEBAR_ID = 'appshell-sidebar';\n\nexport function AppShell({\n sections = [],\n footer,\n defaultCollapsed = false,\n collapsed: ctrlCollapsed,\n onCollapsedChange,\n persistKey,\n children,\n className,\n theme = 'default',\n headerTheme: ctrlHeaderTheme,\n collapsedRail = false,\n showMenuToggle = false,\n header,\n linkAs,\n}: AppShellProps) {\n const t = useLocale();\n const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);\n const collapsed = ctrlCollapsed ?? internalCollapsed;\n // Header band themes independently of the sidebar; defaults to `theme`\n // so `theme=\"brand\"` keeps tinting both bands.\n const headerTheme = ctrlHeaderTheme ?? theme;\n const hasSidebar = sections.length > 0;\n\n // SSR-safe persistence: the initial render uses `defaultCollapsed` (server\n // and first client render agree → no hydration mismatch), then we sync from\n // localStorage after mount. Only in uncontrolled mode; reads can throw\n // (Safari private mode), so they're guarded. Runs once per persistKey.\n React.useEffect(() => {\n if (persistKey == null || ctrlCollapsed !== undefined) return;\n try {\n const stored = window.localStorage.getItem(persistKey);\n if (stored === '0' || stored === '1') setInternalCollapsed(stored === '1');\n } catch {\n /* localStorage unavailable — keep defaultCollapsed */\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- sync once at mount; ctrlCollapsed read intentionally not tracked\n }, [persistKey]);\n\n const setCollapsed = (v: boolean) => {\n if (ctrlCollapsed === undefined) setInternalCollapsed(v);\n if (persistKey != null && ctrlCollapsed === undefined) {\n try {\n window.localStorage.setItem(persistKey, v ? '1' : '0');\n } catch {\n /* localStorage unavailable — persistence is best-effort */\n }\n }\n onCollapsedChange?.(v);\n };\n\n const [mobileOpen, setMobileOpen] = React.useState(false);\n // Track whether matchMedia says we are below the mobile breakpoint. State\n // (not ref) so React re-renders when it flips — `aria-hidden` on the\n // closed mobile drawer is derived from this, and a ref-only value would\n // never land on the DOM (the ref update doesn't trigger a re-render).\n // Initial render uses `false` (SSR-safe; matchMedia is browser-only) and\n // the effect corrects it post-mount. The listener also clears\n // `mobileOpen` when the user resizes back into desktop, so a stale-open\n // drawer doesn't ghost.\n const [isMobile, setIsMobile] = React.useState(false);\n React.useEffect(() => {\n if (typeof window === 'undefined' || !window.matchMedia) return;\n const mql = window.matchMedia(MOBILE_BREAKPOINT);\n setIsMobile(mql.matches);\n const onChange = (e: MediaQueryListEvent) => {\n setIsMobile(e.matches);\n if (!e.matches) setMobileOpen(false);\n };\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, []);\n\n // Mirror `collapsed` to `mobileOpen` in mobile: any flip of `collapsed`\n // (e.g. a controlled consumer's static hamburger that calls setCollapsed\n // directly instead of going through `headerApi.toggle()`) opens/closes\n // the drawer. Without this sync, a controlled consumer's button reads as\n // dead in mobile — flipping `collapsed` is invisible because the aside\n // is a fixed overlay that ignores collapsed in mobile.\n //\n // Semantics: `collapsed=true` means \"menu hidden\" in BOTH viewports\n // (rail/hide on desktop, drawer-closed on mobile). The DWIM `toggle()`\n // for the render-prop API still does its mobileOpen flip directly, but\n // any out-of-band `collapsed` change also propagates here.\n //\n // Initial render must NOT auto-open the drawer just because\n // `collapsed=false` happens to be the default — track previous value\n // and only mirror when it actually changes.\n const prevCollapsed = React.useRef(collapsed);\n React.useEffect(() => {\n if (!isMobile) return;\n if (prevCollapsed.current === collapsed) return;\n prevCollapsed.current = collapsed;\n setMobileOpen(!collapsed);\n }, [isMobile, collapsed]);\n\n // ESC closes the drawer (only active while open — no leaked listener).\n const closeMobileDrawer = React.useCallback(() => setMobileOpen(false), []);\n useEscape(mobileOpen, closeMobileDrawer);\n // Focus trap inside the open drawer: focuses the first nav link on open,\n // cycles Tab/Shift+Tab within, restores focus to the trigger on close.\n // Same hook used by Modal/Drawer — single source of truth for the trap.\n const drawerRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(drawerRef, mobileOpen);\n // Lock body scroll while the drawer is open so the content behind the\n // scrim doesn't drift on touch. Shares a global counter with Modal/Drawer\n // (kit-wide nesting safe).\n useScrollLock(mobileOpen);\n\n // The DWIM toggle: mobile flips the drawer, desktop flips `collapsed`.\n // Same API surface (`headerApi.toggle`) — the consumer's hamburger keeps\n // its single click handler regardless of viewport.\n const headerApi: AppShellHeaderApi = {\n collapsed,\n toggle: () => {\n if (isMobile) setMobileOpen((o) => !o);\n else setCollapsed(!collapsed);\n },\n setCollapsed,\n };\n const slot = (s: AppShellHeaderSlot): React.ReactNode =>\n typeof s === 'function' ? (s as (api: AppShellHeaderApi) => React.ReactNode)(headerApi) : s;\n\n return (\n <div className={cx(\n 'appshell', `appshell--${theme}`, 'appshell--header-top', `appshell--header-${headerTheme}`,\n collapsedRail && 'appshell--rail',\n !hasSidebar && 'appshell--no-nav',\n collapsed && 'is-collapsed',\n mobileOpen && 'is-mobile-open',\n className,\n )}>\n {/* On a brand header the band is dark, so re-scope foreground tokens\n via data-tone=\"inverse\" — anything inside (Avatar, badges, links)\n becomes band-aware automatically without per-call-site colors. */}\n <header className=\"appshell__header\" role=\"banner\" data-tone={headerTheme === 'brand' ? 'inverse' : undefined}>\n <div className=\"appshell__header-left\">\n {showMenuToggle && hasSidebar && (\n <button\n type=\"button\"\n className=\"appshell__menu-toggle\"\n aria-label={t['appshell.toggleMenu']}\n aria-expanded={isMobile ? mobileOpen : !collapsed}\n aria-controls={SIDEBAR_ID}\n onClick={headerApi.toggle}\n >\n <MenuIcon size={20} />\n </button>\n )}\n {slot(header?.left)}\n </div>\n <div className=\"appshell__header-center\">{slot(header?.center)}</div>\n <div className=\"appshell__header-right\">{slot(header?.right)}</div>\n </header>\n <div className=\"appshell__body\">\n {hasSidebar && (\n <aside\n ref={drawerRef}\n id={SIDEBAR_ID}\n className=\"appshell__sidebar\"\n aria-label={t['appshell.mainNav']}\n /* Closed mobile drawer: hide from assistive tech so a screen\n reader doesn't tab through 30 offscreen links. */\n aria-hidden={isMobile && !mobileOpen ? true : undefined}\n >\n <nav className=\"appshell__nav\">\n {sections.map((s, i) => (\n <div key={s.id ?? i} className=\"appshell__navsection\">\n {s.label && <div className=\"appshell__navlabel-section\">{s.label}</div>}\n <ul>{s.items.map((it) => (\n <NavItemNode key={it.id} item={it} depth={0} linkAs={linkAs} onCloseMobile={closeMobileDrawer} />\n ))}</ul>\n </div>\n ))}\n </nav>\n {footer != null && (\n <div className=\"appshell__sidebar-foot\">{footer}</div>\n )}\n </aside>\n )}\n <main className=\"appshell__content\" role=\"main\">{children}</main>\n {/* Scrim is a child of the body so it MATCHES the body's exact\n bounds via `position: absolute; inset: 0` — not a sibling of\n the body using viewport-relative math, which couldn't keep up\n when the actual header height drifted from the\n `--appshell-header-height` var (e.g., 73 rendered vs 56 in the\n var). Click-anywhere-out closes. */}\n {mobileOpen && (\n <div\n className=\"appshell__scrim\"\n onClick={closeMobileDrawer}\n aria-hidden=\"true\"\n />\n )}\n </div>\n </div>\n );\n}\n\n// ---------- PageHeader --------------------------------------------------\nexport interface PageHeaderProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n breadcrumbs?: Array<{ label: React.ReactNode; href?: string }>;\n actions?: React.ReactNode;\n meta?: React.ReactNode;\n className?: string;\n}\n\nexport function PageHeader({ title, description, breadcrumbs, actions, meta, className }: PageHeaderProps) {\n const t = useLocale();\n return (\n <div className={cx('page-header', className)}>\n {breadcrumbs && breadcrumbs.length > 0 && (\n <nav className=\"page-header__crumbs\" aria-label={t['appshell.breadcrumb']}>\n <ol>\n {breadcrumbs.map((c, i) => (\n <li key={i}>\n {c.href ? <a href={c.href}>{c.label}</a> : <span aria-current=\"page\">{c.label}</span>}\n {i < breadcrumbs.length - 1 && <span className=\"page-header__crumb-sep\" aria-hidden=\"true\">/</span>}\n </li>\n ))}\n </ol>\n </nav>\n )}\n <div className=\"page-header__row\">\n <div className=\"page-header__title-wrap\">\n <h1 className=\"page-header__title\">{title}</h1>\n {description && <p className=\"page-header__desc\">{description}</p>}\n </div>\n {actions && <div className=\"page-header__actions\">{actions}</div>}\n </div>\n {meta && <div className=\"page-header__meta\">{meta}</div>}\n </div>\n );\n}\n"]}
|
|
@@ -95,6 +95,19 @@ function buildMonthGrid(view, offset = 0) {
|
|
|
95
95
|
}
|
|
96
96
|
return { month, cells };
|
|
97
97
|
}
|
|
98
|
+
function buildMonthGrid6(view, offset = 0) {
|
|
99
|
+
const month = addMonths(view, offset);
|
|
100
|
+
const y = month.getFullYear();
|
|
101
|
+
const mo = month.getMonth();
|
|
102
|
+
const startDow = (new Date(y, mo, 1).getDay() + 6) % 7;
|
|
103
|
+
const daysInMonth = new Date(y, mo + 1, 0).getDate();
|
|
104
|
+
const cells = [];
|
|
105
|
+
for (let i = startDow; i > 0; i--) cells.push({ date: new Date(y, mo, 1 - i), outside: true });
|
|
106
|
+
for (let d = 1; d <= daysInMonth; d++) cells.push({ date: new Date(y, mo, d), outside: false });
|
|
107
|
+
let next = 1;
|
|
108
|
+
while (cells.length < 42) cells.push({ date: new Date(y, mo + 1, next++), outside: true });
|
|
109
|
+
return { month, cells };
|
|
110
|
+
}
|
|
98
111
|
function parseLocalDay(iso) {
|
|
99
112
|
if (iso instanceof Date) return new Date(iso.getFullYear(), iso.getMonth(), iso.getDate());
|
|
100
113
|
const m = iso.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
@@ -129,6 +142,7 @@ function formatRelativeDay(iso, opts = {}) {
|
|
|
129
142
|
|
|
130
143
|
exports.addMonths = addMonths;
|
|
131
144
|
exports.buildMonthGrid = buildMonthGrid;
|
|
145
|
+
exports.buildMonthGrid6 = buildMonthGrid6;
|
|
132
146
|
exports.dateFormatPlaceholder = dateFormatPlaceholder;
|
|
133
147
|
exports.detectFormatFromLocale = detectFormatFromLocale;
|
|
134
148
|
exports.formatDate = formatDate;
|
|
@@ -140,5 +154,5 @@ exports.isYesterday = isYesterday;
|
|
|
140
154
|
exports.parseDate = parseDate;
|
|
141
155
|
exports.resolveDateFormat = resolveDateFormat;
|
|
142
156
|
exports.startOfMonth = startOfMonth;
|
|
143
|
-
//# sourceMappingURL=chunk-
|
|
144
|
-
//# sourceMappingURL=chunk-
|
|
157
|
+
//# sourceMappingURL=chunk-MUXOT5KS.js.map
|
|
158
|
+
//# sourceMappingURL=chunk-MUXOT5KS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/dateFormat.ts"],"names":["getBrand"],"mappings":";;;;;AAmBO,SAAS,uBAAuB,MAAA,EAAoC;AACzE,EAAA,IAAI;AACF,IAAA,MAAM,KAAA,GAAQ,IAAI,IAAA,CAAK,cAAA,CAAe,MAAM,CAAA,CAAE,aAAA,CAAc,IAAI,IAAA,CAAK,IAAA,EAAM,CAAA,EAAG,CAAC,CAAC,CAAA;AAChF,IAAA,MAAM,QAAkB,EAAC;AACzB,IAAA,KAAA,MAAW,KAAK,KAAA,EAAO;AACrB,MAAA,IAAI,CAAA,CAAE,IAAA,KAAS,MAAA,EAAQ,KAAA,CAAM,KAAK,GAAG,CAAA;AAAA,WAAA,IAC5B,CAAA,CAAE,IAAA,KAAS,OAAA,EAAS,KAAA,CAAM,KAAK,GAAG,CAAA;AAAA,WAAA,IAClC,CAAA,CAAE,IAAA,KAAS,KAAA,EAAO,KAAA,CAAM,KAAK,GAAG,CAAA;AAAA,IAC3C;AACA,IAAA,MAAM,GAAA,GAAM,KAAA,CAAM,IAAA,CAAK,EAAE,CAAA;AACzB,IAAA,IAAI,GAAA,KAAQ,OAAO,OAAO,KAAA;AAC1B,IAAA,IAAI,GAAA,KAAQ,OAAO,OAAO,KAAA;AAC1B,IAAA,OAAO,KAAA;AAAA,EACT,CAAA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AI,IAAA,CAAK,kBAAA,CAAmB,QAAQ,EAAE,OAAA,EAAS,QAAQ,CAAA;AACnE,IAAA,MAAM,CAAA,GAAI,GAAA,CAAI,MAAA,CAAO,QAAA,EAAU,KAAK,CAAA;AACpC,IAAA,OAAO,CAAA,CAAE,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,CAAA,CAAE,MAAM,CAAC,CAAA;AAAA,EAC9C;AACA,EAAA,OAAO,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ,EAAE,OAAA,EAAS,OAAA,EAAS,GAAA,EAAK,SAAA,EAAW,KAAA,EAAO,OAAA,EAAS,CAAA,CAAE,OAAO,MAAM,CAAA;AAC5G","file":"chunk-MUXOT5KS.js","sourcesContent":["import { getBrand } from '../brand';\n\n/**\n * Date display formats supported by the kit's date pickers.\n *\n * - `iso` → `2026-05-02` (ISO 8601, year-month-day)\n * - `dmy` → `02-05-2026` (day-month-year, common in es-CL, es-ES, en-GB, pt-BR)\n * - `mdy` → `05-02-2026` (month-day-year, en-US)\n * - `auto` → derived from `configureBrand().locale` via Intl.DateTimeFormat\n */\nexport type DateFormat = 'iso' | 'dmy' | 'mdy' | 'auto';\n\n/** A concrete (non-`auto`) format. */\nexport type ResolvedDateFormat = Exclude<DateFormat, 'auto'>;\n\n/**\n * Inspects the locale's date-part order using `Intl.DateTimeFormat.formatToParts`.\n * No hardcoded country lists — uses the runtime's CLDR data.\n */\nexport function detectFormatFromLocale(locale: string): ResolvedDateFormat {\n try {\n const parts = new Intl.DateTimeFormat(locale).formatToParts(new Date(2024, 0, 2));\n const order: string[] = [];\n for (const p of parts) {\n if (p.type === 'year') order.push('y');\n else if (p.type === 'month') order.push('m');\n else if (p.type === 'day') order.push('d');\n }\n const key = order.join('');\n if (key === 'ymd') return 'iso';\n if (key === 'mdy') return 'mdy';\n return 'dmy';\n } catch {\n return 'dmy';\n }\n}\n\n/** Resolves `'auto'` against the current `configureBrand().locale`. */\nexport function resolveDateFormat(format: DateFormat): ResolvedDateFormat {\n if (format === 'auto') return detectFormatFromLocale(getBrand().locale);\n return format;\n}\n\nconst PLACEHOLDERS: Record<ResolvedDateFormat, string> = {\n iso: 'aaaa-mm-dd',\n dmy: 'dd-mm-aaaa',\n mdy: 'mm-dd-aaaa',\n};\n\n/** Localized placeholder for the given resolved format. */\nexport function dateFormatPlaceholder(format: ResolvedDateFormat): string {\n return PLACEHOLDERS[format];\n}\n\n/** Format a Date as a string in the given resolved format. Always uses `-` as separator. */\nexport function formatDate(d: Date, format: ResolvedDateFormat): string {\n const yyyy = d.getFullYear();\n const mm = String(d.getMonth() + 1).padStart(2, '0');\n const dd = String(d.getDate()).padStart(2, '0');\n if (format === 'iso') return `${yyyy}-${mm}-${dd}`;\n if (format === 'dmy') return `${dd}-${mm}-${yyyy}`;\n return `${mm}-${dd}-${yyyy}`;\n}\n\n/**\n * Parse a user-typed date string. Tolerant of `-`, `/`, `.` separators.\n *\n * Always accepts ISO `aaaa-mm-dd` regardless of `format` (it's the canonical\n * wire format, used by APIs and `<input type=\"date\">`). Otherwise, interprets\n * the parts according to the provided format.\n *\n * Returns `null` for invalid dates (out of range, non-existent days like Feb 30,\n * unparseable strings).\n */\nexport function parseDate(s: string, format: ResolvedDateFormat): Date | null {\n const trimmed = s.trim();\n if (!trimmed) return null;\n\n // Always accept ISO as a fallback (wire format).\n const iso = trimmed.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/);\n if (iso) {\n return safeDate(Number(iso[1]), Number(iso[2]), Number(iso[3]));\n }\n\n const m = trimmed.match(/^(\\d{1,4})[\\-\\/.](\\d{1,2})[\\-\\/.](\\d{1,4})$/);\n if (!m) return null;\n\n let y: number, mo: number, d: number;\n if (format === 'iso') {\n y = Number(m[1]); mo = Number(m[2]); d = Number(m[3]);\n } else if (format === 'dmy') {\n d = Number(m[1]); mo = Number(m[2]); y = Number(m[3]);\n } else {\n mo = Number(m[1]); d = Number(m[2]); y = Number(m[3]);\n }\n\n // 2-digit years: assume 2000s.\n if (y < 100) y += 2000;\n\n return safeDate(y, mo, d);\n}\n\nfunction safeDate(y: number, mo: number, d: number): Date | null {\n if (mo < 1 || mo > 12 || d < 1 || d > 31) return null;\n const dt = new Date(y, mo - 1, d);\n if (\n isNaN(dt.getTime()) ||\n dt.getFullYear() !== y ||\n dt.getMonth() !== mo - 1 ||\n dt.getDate() !== d\n ) {\n return null;\n }\n return dt;\n}\n\n// ---------- Calendar helpers (shared by the date pickers) ----------------\n// Previously duplicated verbatim in Pickers.tsx, AdvancedPickers.tsx and\n// Display3.tsx. Single source now; behavior is unchanged.\n\n/** First day of `d`'s month at local midnight. */\nexport function startOfMonth(d: Date): Date {\n return new Date(d.getFullYear(), d.getMonth(), 1);\n}\n\n/** `d` shifted by `n` months, normalized to the first of that month. */\nexport function addMonths(d: Date, n: number): Date {\n return new Date(d.getFullYear(), d.getMonth() + n, 1);\n}\n\n/** True when `a` and `b` are the same calendar day (local time). */\nexport function isSameDay(a: Date, b: Date): boolean {\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\n\n/**\n * Compact month grid used by the date pickers: leading `null`s pad the days\n * before the 1st of a Monday-first week, followed by one `Date` per day of the\n * month (no adjacent-month spillover). The full-month `Calendar` uses a\n * different fixed 42-cell model on purpose, so it does not consume this.\n *\n * @param view Any date within the reference month.\n * @param offset Months to add to `view` (0 = same month, 1 = next, ...).\n */\nexport function buildMonthGrid(\n view: Date,\n offset = 0\n): { month: Date; cells: (Date | null)[] } {\n const month = addMonths(view, offset);\n const startDow = (month.getDay() + 6) % 7; // Monday = 0\n const days = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();\n const cells: (Date | null)[] = [];\n for (let i = 0; i < startDow; i++) cells.push(null);\n for (let d = 1; d <= days; d++) {\n cells.push(new Date(month.getFullYear(), month.getMonth(), d));\n }\n return { month, cells };\n}\n\nexport interface MonthGridCell {\n date: Date;\n /** True for the leading/trailing days that belong to the adjacent month. */\n outside: boolean;\n}\n\n/**\n * Fixed 6-row (42-cell) month grid: leading days from the previous month and\n * trailing days from the next month fill every cell, each tagged `outside`. The\n * row count is constant, so the picker's height never jumps between months with\n * 4, 5 or 6 weeks. Monday-first. Used by the DatePicker/DateRangePicker; the\n * legacy `buildMonthGrid` (ragged, `null`-padded) stays for back-compat.\n */\nexport function buildMonthGrid6(view: Date, offset = 0): { month: Date; cells: MonthGridCell[] } {\n const month = addMonths(view, offset);\n const y = month.getFullYear();\n const mo = month.getMonth();\n const startDow = (new Date(y, mo, 1).getDay() + 6) % 7; // Monday = 0\n const daysInMonth = new Date(y, mo + 1, 0).getDate();\n const cells: MonthGridCell[] = [];\n // Leading days from the previous month (ascending).\n for (let i = startDow; i > 0; i--) cells.push({ date: new Date(y, mo, 1 - i), outside: true });\n for (let d = 1; d <= daysInMonth; d++) cells.push({ date: new Date(y, mo, d), outside: false });\n // Trailing days from the next month until the grid is 6 full weeks.\n let next = 1;\n while (cells.length < 42) cells.push({ date: new Date(y, mo + 1, next++), outside: true });\n return { month, cells };\n}\n\n// ---------- Relative day helpers ----------------------------------------\n\n/**\n * Parse a date-only ISO (`YYYY-MM-DD`, optionally with a time suffix) to a\n * Date at **local midnight**. `new Date('2026-05-22')` parses as UTC\n * midnight, which lands on the 21st in negative-offset timezones — a classic\n * off-by-one-day SSR bug. Reading the Y-M-D parts and constructing a local\n * Date avoids it: the calendar day is always the one written in the string.\n */\nfunction parseLocalDay(iso: string | Date): Date {\n if (iso instanceof Date) return new Date(iso.getFullYear(), iso.getMonth(), iso.getDate());\n const m = iso.match(/^(\\d{4})-(\\d{2})-(\\d{2})/);\n if (m) return new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));\n const d = new Date(iso);\n return new Date(d.getFullYear(), d.getMonth(), d.getDate());\n}\n\n/** True if `iso` is the same calendar day as `now` (default today, local). */\nexport function isToday(iso: string | Date, now: Date = new Date()): boolean {\n return isSameDay(parseLocalDay(iso), now);\n}\n\n/** True if `iso` is the calendar day after `now` (default today, local). */\nexport function isTomorrow(iso: string | Date, now: Date = new Date()): boolean {\n const t = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);\n return isSameDay(parseLocalDay(iso), t);\n}\n\n/** True if `iso` is the calendar day before `now` (default today, local). */\nexport function isYesterday(iso: string | Date, now: Date = new Date()): boolean {\n const y = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);\n return isSameDay(parseLocalDay(iso), y);\n}\n\nexport interface RelativeDayOptions {\n /** BCP-47 locale. Defaults to the configured brand locale (es-CL). */\n locale?: string;\n /** Reference \"today\". Pass a fixed value for deterministic SSR / tests. */\n now?: Date;\n}\n\n/**\n * Human day label: \"Hoy\" / \"Mañana\" / \"Ayer\" for ±1 day, otherwise the\n * localized weekday + day + month (\"mar 26 may\"). The ±1 words come from\n * `Intl.RelativeTimeFormat(..., { numeric: 'auto' })` so they're correct in\n * any locale; capitalized for use as a standalone label.\n *\n * Deterministic across timezones: the day delta is computed from local\n * calendar parts (via `parseLocalDay`), never from UTC timestamps, so an\n * ISO date never renders as the wrong day. Pass `now` to pin it for SSR.\n */\nexport function formatRelativeDay(iso: string | Date, opts: RelativeDayOptions = {}): string {\n const locale = opts.locale ?? getBrand().locale ?? 'es-CL';\n const now = opts.now ?? new Date();\n const target = parseLocalDay(iso);\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const diffDays = Math.round((target.getTime() - today.getTime()) / 86_400_000);\n\n if (Math.abs(diffDays) <= 1) {\n const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });\n const s = rtf.format(diffDays, 'day');\n return s.charAt(0).toUpperCase() + s.slice(1);\n }\n return new Intl.DateTimeFormat(locale, { weekday: 'short', day: 'numeric', month: 'short' }).format(target);\n}\n"]}
|