@42-central/ui-react 0.25.0 → 0.27.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-YZJUPYPO.js → chunk-2W7H43WL.js} +3 -3
- package/dist/{chunk-YZJUPYPO.js.map → chunk-2W7H43WL.js.map} +1 -1
- package/dist/{chunk-NLSJ6T7V.js → chunk-4D2V4JE4.js} +3 -3
- package/dist/{chunk-NLSJ6T7V.js.map → chunk-4D2V4JE4.js.map} +1 -1
- package/dist/{chunk-QZ4N5LYG.js → chunk-5H5YOPCF.js} +3 -3
- package/dist/{chunk-QZ4N5LYG.js.map → chunk-5H5YOPCF.js.map} +1 -1
- package/dist/{chunk-6II2DVYR.js → chunk-7KFUFAVP.js} +4 -4
- package/dist/{chunk-6II2DVYR.js.map → chunk-7KFUFAVP.js.map} +1 -1
- package/dist/{chunk-XUFCI262.js → chunk-7OGZT7U2.js} +12 -4
- package/dist/chunk-7OGZT7U2.js.map +1 -0
- package/dist/{chunk-PI7X5YFJ.js → chunk-BGDVUC3B.js} +5 -5
- package/dist/{chunk-PI7X5YFJ.js.map → chunk-BGDVUC3B.js.map} +1 -1
- package/dist/{chunk-7247WBTV.js → chunk-DJ72KP32.js} +3 -3
- package/dist/{chunk-7247WBTV.js.map → chunk-DJ72KP32.js.map} +1 -1
- package/dist/{chunk-FZSLSUSX.js → chunk-HCHGERDB.js} +3 -3
- package/dist/{chunk-FZSLSUSX.js.map → chunk-HCHGERDB.js.map} +1 -1
- package/dist/{chunk-H7WOMZXO.js → chunk-HWBFRDX7.js} +16 -8
- package/dist/chunk-HWBFRDX7.js.map +1 -0
- package/dist/{chunk-HQPU73WV.js → chunk-I4IJOLNA.js} +4 -4
- package/dist/{chunk-HQPU73WV.js.map → chunk-I4IJOLNA.js.map} +1 -1
- package/dist/{chunk-UDCCOUWR.js → chunk-IA6DCC3N.js} +6 -6
- package/dist/{chunk-UDCCOUWR.js.map → chunk-IA6DCC3N.js.map} +1 -1
- package/dist/{chunk-36NWC4GV.js → chunk-ISX3AM32.js} +3 -3
- package/dist/{chunk-36NWC4GV.js.map → chunk-ISX3AM32.js.map} +1 -1
- package/dist/{chunk-LMCUGYHT.js → chunk-L24N5EON.js} +6 -6
- package/dist/chunk-L24N5EON.js.map +1 -0
- package/dist/{chunk-HRNWWL3Y.js → chunk-L5GH7LLD.js} +61 -29
- package/dist/chunk-L5GH7LLD.js.map +1 -0
- package/dist/chunk-LJVIZNPE.js +9 -0
- package/dist/chunk-LJVIZNPE.js.map +1 -0
- package/dist/{chunk-AHKMN3YQ.js → chunk-MCRTAUSZ.js} +6 -6
- package/dist/chunk-MCRTAUSZ.js.map +1 -0
- package/dist/{chunk-LHUWOA2U.js → chunk-MNYY7UU2.js} +6 -6
- package/dist/{chunk-LHUWOA2U.js.map → chunk-MNYY7UU2.js.map} +1 -1
- package/dist/{chunk-7HZBD4YZ.js → chunk-NF2PBGD3.js} +36 -23
- package/dist/chunk-NF2PBGD3.js.map +1 -0
- package/dist/{chunk-54W6VAI3.js → chunk-NNPSBC7O.js} +5 -5
- package/dist/{chunk-54W6VAI3.js.map → chunk-NNPSBC7O.js.map} +1 -1
- package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
- package/dist/chunk-PBSVX5DB.js.map +1 -0
- package/dist/{chunk-2CL3FKEY.js → chunk-QEMXXQQO.js} +3 -3
- package/dist/{chunk-2CL3FKEY.js.map → chunk-QEMXXQQO.js.map} +1 -1
- package/dist/{chunk-6UIQJJNJ.js → chunk-QRNQQIQM.js} +5 -5
- package/dist/{chunk-6UIQJJNJ.js.map → chunk-QRNQQIQM.js.map} +1 -1
- package/dist/{chunk-N66NC6QK.js → chunk-RKCUXOU2.js} +4 -4
- package/dist/{chunk-N66NC6QK.js.map → chunk-RKCUXOU2.js.map} +1 -1
- package/dist/{chunk-N5M4PDBK.js → chunk-SBZJGFZ6.js} +3 -3
- package/dist/{chunk-N5M4PDBK.js.map → chunk-SBZJGFZ6.js.map} +1 -1
- package/dist/{chunk-7P32XCEU.js → chunk-SLUOF7XW.js} +2 -2
- package/dist/chunk-SLUOF7XW.js.map +1 -0
- package/dist/{chunk-SAXWCGWR.js → chunk-SOUDKESO.js} +14 -7
- package/dist/chunk-SOUDKESO.js.map +1 -0
- package/dist/{chunk-T44RW5DW.js → chunk-ULF5LOBS.js} +4 -4
- package/dist/{chunk-T44RW5DW.js.map → chunk-ULF5LOBS.js.map} +1 -1
- package/dist/components/ambient-background/index.js +9 -23
- package/dist/components/ambient-background/index.js.map +1 -1
- package/dist/components/ambient-background/starfield.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +55 -10
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/app-shell/index.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +299 -38
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/index.js +4 -4
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.js +10 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/button-group/button-group.d.ts +10 -2
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/button-multi-select/index.js +2 -2
- package/dist/components/button-select/button-select-control.d.ts +4 -1
- package/dist/components/button-select/button-select-control.d.ts.map +1 -1
- package/dist/components/button-select/button-select.d.ts +4 -1
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +2 -2
- package/dist/components/calendar-heatmap/index.js +2 -2
- package/dist/components/camera/index.js +6 -6
- package/dist/components/code-block/chrome.js +5 -5
- package/dist/components/code-block/index.js +6 -6
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/combobox-list/index.js +6 -6
- package/dist/components/data-table/data-table-features.d.ts +8 -0
- package/dist/components/data-table/data-table-features.d.ts.map +1 -1
- package/dist/components/data-table/data-table-group.d.ts +128 -0
- package/dist/components/data-table/data-table-group.d.ts.map +1 -0
- package/dist/components/data-table/data-table-grouping.d.ts +72 -0
- package/dist/components/data-table/data-table-grouping.d.ts.map +1 -0
- package/dist/components/data-table/data-table-icons.d.ts +4 -2
- package/dist/components/data-table/data-table-icons.d.ts.map +1 -1
- package/dist/components/data-table/data-table-meta.d.ts +9 -0
- package/dist/components/data-table/data-table-meta.d.ts.map +1 -1
- package/dist/components/data-table/data-table-pagination.d.ts +4 -1
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-schema.d.ts +4 -0
- package/dist/components/data-table/data-table-schema.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +16 -3
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +33 -2
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +35 -0
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +55 -3
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +3 -1
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +878 -230
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +8 -8
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/geodesic/a11y.d.ts +3 -3
- package/dist/components/geodesic/a11y.d.ts.map +1 -1
- package/dist/components/geodesic/badge-frame.d.ts +13 -1
- package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
- package/dist/components/geodesic/exam-badge.d.ts +4 -1
- package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
- package/dist/components/geodesic/geometry.d.ts +14 -9
- package/dist/components/geodesic/geometry.d.ts.map +1 -1
- package/dist/components/geodesic/index.js +62 -23
- package/dist/components/geodesic/index.js.map +1 -1
- package/dist/components/geodesic/status.d.ts +8 -6
- package/dist/components/geodesic/status.d.ts.map +1 -1
- package/dist/components/geodesic/styles.css +15 -2
- package/dist/components/hover-card/index.js +3 -3
- package/dist/components/indicator/index.js +23 -8
- package/dist/components/indicator/index.js.map +1 -1
- package/dist/components/indicator/indicator.d.ts +15 -6
- package/dist/components/indicator/indicator.d.ts.map +1 -1
- package/dist/components/kbd/index.js +3 -3
- package/dist/components/lightbox/index.js +4 -4
- package/dist/components/menu/index.js +4 -4
- package/dist/components/modal/index.js +4 -4
- package/dist/components/multi-combobox-list/index.js +6 -6
- package/dist/components/multi-select/index.js +4 -4
- package/dist/components/nav-link/index.js +5 -1
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +5 -1
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.js +15 -3
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/types.d.ts +5 -0
- package/dist/components/notification/types.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/overlays/index.js +5 -5
- package/dist/components/photo-capture/index.js +6 -6
- package/dist/components/popover/index.js +3 -3
- package/dist/components/schedule/index.js +4 -4
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/segment-group/segment-group.d.ts +6 -1
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +5 -5
- package/dist/components/spotlight/index.js +8 -8
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tabs-data.d.ts +4 -1
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +4 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +3 -3
- package/dist/components/time-input/index.js +6 -6
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.js +4 -4
- package/dist/components/tree-select/index.js +4 -4
- package/dist/index.js +2 -2
- package/dist/lib/overlay-container.d.ts.map +1 -1
- package/dist/lib/overlay-layer.d.ts +10 -3
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/sidebar-rail.d.ts +21 -0
- package/dist/lib/sidebar-rail.d.ts.map +1 -0
- package/dist/theme.css +21 -18
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +6 -0
- package/src/components/ambient-background/starfield.tsx +14 -41
- package/src/components/app-shell/app-shell.test.tsx +430 -5
- package/src/components/app-shell/app-shell.tsx +484 -24
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/avatar/avatar.test.tsx +12 -0
- package/src/components/avatar/avatar.tsx +9 -0
- package/src/components/button-group/button-group.test.tsx +24 -0
- package/src/components/button-group/button-group.tsx +21 -4
- package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
- package/src/components/button-select/button-select-control.tsx +5 -0
- package/src/components/button-select/button-select.test.tsx +25 -0
- package/src/components/button-select/button-select.tsx +13 -2
- package/src/components/data-table/data-table-features.ts +11 -0
- package/src/components/data-table/data-table-group.test.tsx +1007 -0
- package/src/components/data-table/data-table-group.tsx +474 -0
- package/src/components/data-table/data-table-grouping.ts +160 -0
- package/src/components/data-table/data-table-icons.tsx +8 -1
- package/src/components/data-table/data-table-meta.ts +9 -0
- package/src/components/data-table/data-table-pagination.tsx +5 -1
- package/src/components/data-table/data-table-stack.tsx +165 -43
- package/src/components/data-table/data-table-toolbar.tsx +110 -2
- package/src/components/data-table/data-table-translations.ts +44 -0
- package/src/components/data-table/data-table.tsx +420 -150
- package/src/components/data-table/index.ts +4 -0
- package/src/components/drawer/drawer.tsx +1 -1
- package/src/components/geodesic/badge-frame.tsx +67 -13
- package/src/components/geodesic/exam-badge.tsx +8 -4
- package/src/components/geodesic/geometry.ts +8 -6
- package/src/components/geodesic/status.test.ts +11 -2
- package/src/components/geodesic/status.ts +11 -7
- package/src/components/geodesic/styles.css +15 -2
- package/src/components/indicator/indicator.test.tsx +45 -0
- package/src/components/indicator/indicator.tsx +40 -13
- package/src/components/modal/modal.tsx +1 -1
- package/src/components/nav-link/nav-link.test.tsx +121 -1
- package/src/components/nav-link/nav-link.tsx +78 -29
- package/src/components/notification/create-notifier.tsx +18 -2
- package/src/components/notification/notify-in-modal.test.tsx +128 -0
- package/src/components/notification/types.ts +5 -0
- package/src/components/segment-group/segment-group.test.tsx +22 -0
- package/src/components/segment-group/segment-group.tsx +35 -19
- package/src/components/tabs/tabs-data.tsx +5 -1
- package/src/components/tabs/tabs.test.tsx +28 -0
- package/src/components/tabs/tabs.tsx +14 -4
- package/src/lib/overlay-container.tsx +2 -1
- package/src/lib/overlay-layer.test.tsx +63 -1
- package/src/lib/overlay-layer.tsx +29 -6
- package/src/lib/sidebar-rail.ts +24 -0
- package/src/theme.css +21 -18
- package/src/theme.test.ts +14 -11
- package/dist/chunk-7HZBD4YZ.js.map +0 -1
- package/dist/chunk-7P32XCEU.js.map +0 -1
- package/dist/chunk-AHKMN3YQ.js.map +0 -1
- package/dist/chunk-H7WOMZXO.js.map +0 -1
- package/dist/chunk-HRNWWL3Y.js.map +0 -1
- package/dist/chunk-LMCUGYHT.js.map +0 -1
- package/dist/chunk-MW42XVPD.js.map +0 -1
- package/dist/chunk-SAXWCGWR.js.map +0 -1
- package/dist/chunk-XUFCI262.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAg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AAU,cAAA,CAAe,KAAoB,CAAA;AAAA,cAGxD,IAAA;AAAA,cACA,QAAA;AAAA,cACA,QAAA;AAAA,cACA,OAAA;AAAA,cACA,WAAW,UAAA,EAAY,MAAA;AAAA,cAOvB,UAAA,EAAY,EAAE,KAAA,EAAO,iBAAA,EAAmB,OAAO,SAAA;AAAU;AAAA;AAC3D;AAAA;AAAA;AAEJ;AAEJ","file":"chunk-T44RW5DW.js","sourcesContent":["export type HourCycle = \"h11\" | \"h12\" | \"h23\" | \"h24\"\n\n/**\n * Resolve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/time-input/hour-cycle.ts","../src/components/time-input/time-row.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,mBAAmB,CAAC;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAIiB;AACf,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,MAAA,KAAW,KAAK,KAAA,GAAQ,KAAA;AACzD,EAAA,OAAO,IAAA,CAAK,eAAe,MAAA,EAAQ,EAAE,MAAM,SAAA,EAAW,CAAA,CAAE,eAAA,EAAgB,CAAE,SAAA;AAC5E;AAGO,IAAM,QAAA,GAAW,CAAC,KAAA,KAA8B,KAAA,KAAU,SAAS,KAAA,KAAU;AAI7E,IAAM,WAAA,GAA+D;AAAA,EAC1E,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAAG;AAAA,EACvB,GAAA,EAAK,EAAE,GAAA,EAAK,CAAA,EAAG,KAAK,EAAA,EAA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olve 12h vs 24h display (Req #6): an explicit `hourCycle` wins, then\n * `format`, else the locale's own convention via `Intl.DateTimeFormat`. Shared\n * by `TimeInput` and `DatePicker`'s embedded time panel so both pick the same\n * cycle for the same locale.\n */\nexport const resolveHourCycle = ({\n locale,\n format,\n hourCycle,\n}: {\n locale: string\n format?: 12 | 24\n hourCycle?: HourCycle\n}): HourCycle => {\n if (hourCycle) return hourCycle\n if (format !== undefined) return format === 12 ? \"h12\" : \"h23\"\n return Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hourCycle as HourCycle\n}\n\n/** Whether a resolved cycle displays 12 hours + AM/PM (`h11`/`h12`) rather than all 24. */\nexport const is12Hour = (cycle: HourCycle): boolean => cycle === \"h11\" || cycle === \"h12\"\n\n/** The hours each cycle displays: `h11` 0–11, `h12` 1–12, `h23` 0–23, `h24` 1–24. In the two\n * cycles that start at 1, midnight (and, for `h12`, noon) reads as the top of the range. */\nexport const HOUR_RANGES: Record<HourCycle, { min: number; max: number }> = {\n h11: { min: 0, max: 11 },\n h12: { min: 1, max: 12 },\n h23: { min: 0, max: 23 },\n h24: { min: 1, max: 24 },\n}\n\n/** Convert a stored 24h hour (`0`–`23`) to the hour `cycle` displays, plus its period in the\n * 12-hour cycles (`null` otherwise) — e.g. midnight is `12` AM in `h12`, `0` AM in `h11`, `0` in\n * `h23` and `24` in `h24`. */\nexport const toDisplayHour = (\n hour24: number,\n cycle: HourCycle,\n): { hour: number; period: \"AM\" | \"PM\" | null } => {\n const twelveHour = is12Hour(cycle)\n const hour = twelveHour ? hour24 % 12 : hour24\n return {\n hour: hour === 0 && HOUR_RANGES[cycle].min === 1 ? HOUR_RANGES[cycle].max : hour,\n period: twelveHour ? (hour24 < 12 ? \"AM\" : \"PM\") : null,\n }\n}\n\n/** The inverse of `toDisplayHour`: a displayed hour (+ period in the 12-hour cycles) back to a\n * stored 24h hour. A missing hour reads as the start of its half of the day — midnight, or noon\n * once PM is picked — and a missing period as AM. */\nexport const fromDisplayHour = (\n hour: number | null,\n period: \"AM\" | \"PM\" | null,\n cycle: HourCycle,\n): number => {\n const offset = is12Hour(cycle) && period === \"PM\" ? 12 : 0\n if (hour === null) return offset\n return is12Hour(cycle) ? (hour % 12) + offset : hour % 24\n}\n\n/** Locale-correct AM/PM display strings (e.g. \"AM\"/\"PM\" en-US, \"午前\"/\"午後\" ja-JP), read via\n * `Intl.DateTimeFormat`'s own `dayPeriod` part rather than a hardcoded English literal. Keyed by\n * the same `\"AM\" | \"PM\"` domain value `toDisplayHour`/`fromDisplayHour` use throughout, so this only ever\n * changes what's *displayed*, never what's stored/serialized. */\nexport const dayPeriodLabels = (locale: string): Record<\"AM\" | \"PM\", string> => {\n const dayPeriod = (hour: number) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", hour12: true })\n .formatToParts(new Date(2000, 0, 1, hour))\n .find((part) => part.type === \"dayPeriod\")?.value ?? (hour < 12 ? \"AM\" : \"PM\")\n return { AM: dayPeriod(9), PM: dayPeriod(21) }\n}\n\n/** Locale-correct narrow unit abbreviations for the Hour/Minute/Second suffix (e.g. \"h\"/\"m\"/\"s\"\n * en-US, \"h\"/\"min\"/\"s\" fr-FR), read via `Intl.NumberFormat`'s own unit formatting rather than\n * hardcoded English literals. */\nconst UNIT_FALLBACK = { hour: \"h\", minute: \"m\", second: \"s\" } as const\n\nexport const timeUnitLabels = (\n locale: string,\n): { hour: string; minute: string; second: string } => {\n const unit = (u: \"hour\" | \"minute\" | \"second\") =>\n new Intl.NumberFormat(locale, { style: \"unit\", unit: u, unitDisplay: \"narrow\" })\n .formatToParts(1)\n .find((part) => part.type === \"unit\")?.value ?? UNIT_FALLBACK[u]\n return { hour: unit(\"hour\"), minute: unit(\"minute\"), second: unit(\"second\") }\n}\n","\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport type { FocusEvent, KeyboardEvent, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { InputVariant } from \"../input/input\"\nimport { NumberInput, type NumberInputTranslations } from \"../number-input/number-input\"\nimport { SegmentGroup } from \"../segment-group/segment-group\"\nimport {\n dayPeriodLabels,\n HOUR_RANGES,\n type HourCycle,\n is12Hour,\n timeUnitLabels,\n} from \"./hour-cycle\"\n\n/**\n * The HOUR/MINUTE (+ SECOND) + AM/PM row — the piece `TimeInput` wraps with\n * state, and `DatePicker`'s embedded time panel wraps with `api.setTime()`\n * (one implementation, two call sites). Operates entirely in *display* units\n * (the cycle's own hours — 0–11, 1–12, 0–23 or 1–24) — the always-24h stored `hour` conversion\n * happens at the caller's boundary, not here.\n */\n\ntype TimeRowClassNames = {\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** Overrides the sr-only accessible names for Hour/Minute/Second/Period — English by default.\n * Arbitrary microcopy with no locale-derivation path (unlike AM/PM and the unit suffixes,\n * which read from `Intl` instead). `incrementLabel`/`decrementLabel` are `NumberInput`'s own\n * keys, forwarded to each field's steppers (defaults `\"Increment\"` / `\"Decrement\"`). */\nexport type TimeRowTranslations = Pick<\n NumberInputTranslations,\n \"incrementLabel\" | \"decrementLabel\"\n> & {\n /** The whole row's group name when nothing visible labels it. Default `\"Time\"`. */\n time?: string\n hour?: string\n minute?: string\n second?: string\n period?: string\n}\n\n/** The row's English accessible names, merged once under `translations`. `NumberInput` keeps\n * its own stepper defaults. */\nconst TIME_ROW_DEFAULT_TRANSLATIONS = {\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n second: \"Second\",\n period: \"Period\",\n} as const satisfies TimeRowTranslations\n\n/** Starting *and floor* size for the Hour/Minute/Second fields, per `size` — `flex-1`'s basis so\n * each field still grows to fill the row, plus an equal `min-width` so it never shrinks back\n * below that. Without the `min-width`, the field's inner `<input>` has `min-w-0` (needed so the\n * value can shrink instead of forcing the row to overflow when it's genuinely too narrow), which\n * otherwise lets `flex-1` starve it arbitrarily close to zero — that's exactly how the `<input>`\n * was measured shrinking to ~11px in a too-narrow `DatePicker` popover column, clipping the\n * 2-digit value. A too-narrow row now genuinely overflows (or wraps, if a wrapping ancestor\n * provides one) instead of silently clipping — the honest failure mode; `DatePicker`'s own\n * column-width fix (`timeRowMinWidth` below) is what actually prevents hitting it in practice.\n *\n * Calibrated against a real measurement, minus `shellGap`'s own per-size pixel value (6/6/8/10/12px\n * for xs/sm/md/lg/xl) — `NumberInput`'s value↔suffix pair no longer carries that gap (glued\n * together in their own nested row, see its own comment), so each field's true minimum content\n * width shrank by exactly that much. */\nexport const TIME_FIELD_BASIS_PX: Record<Size, number> = { xs: 64, sm: 72, md: 78, lg: 86, xl: 100 }\n/** The same widths as Tailwind classes, written out in full: Tailwind finds classes by scanning\n * source text (a consumer's build scans the shipped `dist`), so a class assembled from a template\n * literal is never generated. `time-row.test.ts` keeps these in step with `TIME_FIELD_BASIS_PX`. */\nexport const timeFieldBasis: Record<Size, string> = {\n xs: \"basis-[64px] min-w-[64px]\",\n sm: \"basis-[72px] min-w-[72px]\",\n md: \"basis-[78px] min-w-[78px]\",\n lg: \"basis-[86px] min-w-[86px]\",\n xl: \"basis-[100px] min-w-[100px]\",\n}\n\n/** The row's own gap between Hour/Minute/Second/Period (`gap-2` below) — flat across `size`,\n * unlike each field's *internal* value↔suffix↔steppers gap (`shellGap`, size-dependent). */\nconst ROW_GAP_PX = 8\n\n/** The AM/PM toggle's own natural (unstretched — it's `shrink-0`, not `flex-1`) rendered width\n * per `size`, measured directly rather than estimated. It wraps onto its own line below\n * Hour/Minute (the row's `flex-wrap` below) instead of forcing the whole row wider, so this\n * only matters for `timeRowMinWidth` as a floor *in case* it's ever wider than Hour+Minute\n * themselves — not as an unconditional addition to their combined width (see below). */\nconst PERIOD_WIDTH_PX: Record<Size, number> = { xs: 60, sm: 74, md: 88, lg: 110, xl: 133 }\n\n/** The row's own minimum rendered width for a given configuration. `DatePicker` uses this (see\n * its own `calendarColumnWidth` comment) to keep its popover column at least as wide as the\n * embedded time row needs, instead of only ever sizing off the calendar grid — otherwise the\n * row's `flex-1` + `min-w-0` fields silently shrink below their content size to fit.\n *\n * This is deliberately just Hour/Minute/[Second] at their basis plus the gaps *between* them —\n * not the AM/PM toggle's width added on top. The toggle wraps onto its own line (the row's\n * `flex-wrap` below) rather than forcing the row wider, so at a single narrow month it drops\n * below Hour/Minute instead of pushing the popover past the calendar's own width — the row only\n * needs to be as wide as the toggle itself in the (currently never hit — Hour+Minute together\n * are wider than the toggle at every size) case where that's the larger requirement. */\nexport const timeRowMinWidth = (\n size: Size,\n hourCycle: HourCycle,\n withSeconds: boolean | undefined,\n): number => {\n const fieldCount = 2 + (withSeconds ? 1 : 0)\n const fieldsWidth = fieldCount * TIME_FIELD_BASIS_PX[size] + (fieldCount - 1) * ROW_GAP_PX\n return is12Hour(hourCycle) ? Math.max(fieldsWidth, PERIOD_WIDTH_PX[size]) : fieldsWidth\n}\n\n/** ArrowLeft/ArrowRight at the edge of a field's text moves to the neighbouring field — caret at\n * its far side, so the motion reads as one continuous caret across the row — and from the last\n * number field \"next\" lands on the AM/PM toggle's checked (or first) radio. Inside the toggle the\n * arrows stay the radio group's own (switching AM/PM); Shift+Tab leaves it. `dir=\"rtl\"` mirrors\n * the keys, since the row's visual order is mirrored too. Anything else — a modifier, a\n * selection, a caret mid-text — keeps the native caret movement. */\nconst moveAcrossFields = (event: KeyboardEvent<HTMLDivElement>, dir: \"ltr\" | \"rtl\") => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.target\n if (!(input instanceof HTMLInputElement) || input.type !== \"text\") return\n const { selectionStart, selectionEnd, value } = input\n if (selectionStart !== selectionEnd) return\n const forward = (event.key === \"ArrowRight\") !== (dir === \"rtl\")\n if (forward ? selectionEnd !== value.length : selectionStart !== 0) return\n\n const row = event.currentTarget\n const fields = [...row.querySelectorAll<HTMLInputElement>('input[type=\"text\"]:not(:disabled)')]\n const next =\n fields[fields.indexOf(input) + (forward ? 1 : -1)] ??\n (forward\n ? (row.querySelector<HTMLInputElement>('input[type=\"radio\"]:checked:not(:disabled)') ??\n row.querySelector<HTMLInputElement>('input[type=\"radio\"]:not(:disabled)'))\n : null)\n if (!next) return\n event.preventDefault()\n next.focus()\n if (next.type === \"text\") {\n const caret = forward ? 0 : next.value.length\n next.setSelectionRange(caret, caret)\n }\n}\n\nexport type TimeRowProps = {\n hour: number | null\n minute: number | null\n second?: number | null\n onHourChange: (hour: number | null) => void\n onMinuteChange: (minute: number | null) => void\n onSecondChange?: (second: number | null) => void\n period: \"AM\" | \"PM\" | null\n onPeriodChange: (period: \"AM\" | \"PM\") => void\n hourCycle: HourCycle\n minuteStep?: number\n withSeconds?: boolean\n /** Placeholder shown in each empty Hour/Minute/Second field. Default `\"--\"`. */\n placeholder?: string\n /** Resolves the locale-correct AM/PM labels + Hour/Minute/Second unit suffixes via `Intl`.\n * Falls back to `useLocaleContext()` when omitted. */\n locale?: string\n /** Overrides the sr-only Hour/Minute/Second/Period accessible names. English by default. */\n translations?: TimeRowTranslations\n size?: Size\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n invalid?: boolean\n /** Lands on the hour field's `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hour field's `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Names the row's `role=\"group\"` directly when no visible label points at it. Defaults to\n * `translations.time` (`\"Time\"`), so the group is never anonymous. */\n \"aria-label\"?: string\n /** Names the row's `role=\"group\"` from a visible label, e.g. `TimeInput`'s field label or\n * `DatePicker`'s \"Start time\" / \"End time\". Without a name a screen reader enters the group\n * hearing only \"Hour\". */\n \"aria-labelledby\"?: string\n /** Helper / error text read after the group's name. */\n \"aria-describedby\"?: string\n className?: string\n classNames?: TimeRowClassNames\n}\n\nexport const TimeRow = ({\n hour,\n minute,\n second,\n onHourChange,\n onMinuteChange,\n onSecondChange,\n period,\n onPeriodChange,\n hourCycle,\n minuteStep = 1,\n withSeconds,\n placeholder = \"--\",\n locale,\n translations,\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n invalid,\n ref,\n onBlur,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n className,\n classNames,\n}: TimeRowProps) => {\n const { locale: contextLocale, dir } = useLocaleContext()\n const resolvedLocale = locale ?? contextLocale\n const twelveHour = is12Hour(hourCycle)\n const units = timeUnitLabels(resolvedLocale)\n const periodLabels = twelveHour ? dayPeriodLabels(resolvedLocale) : null\n const t = { ...TIME_ROW_DEFAULT_TRANSLATIONS, ...translations }\n\n return (\n // `flex-wrap`: at a single narrow month under `DatePicker`, Hour/Minute/[Second] fit the\n // calendar's own width but the AM/PM toggle doesn't (see `timeRowMinWidth`'s comment) — this\n // drops it to its own line there instead of forcing the whole popover wider than the\n // calendar to fit it on the same line. No visual change wherever there's already enough\n // width (every other context) — wrapping only kicks in once it's genuinely too narrow.\n // `role=\"group\"`: Hour/Minute/[Second]/Period are the parts of one time value — and the\n // row owns keyboard behaviour across them (`moveAcrossFields`), which a bare `<div>` can't.\n // biome-ignore lint/a11y/useSemanticElements: a `<fieldset>` brings UA border/padding/`min-inline-size` that fight this wrapping flex row, for the same `group` semantics\n <div\n role=\"group\"\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? t.time)}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\"flex flex-wrap items-end gap-2\", className)}\n onKeyDown={(event) => moveAcrossFields(event, dir)}\n >\n <NumberInput\n ref={ref}\n onBlur={onBlur}\n label={t.hour}\n placeholder={placeholder}\n value={hour}\n onChange={onHourChange}\n min={HOUR_RANGES[hourCycle].min}\n max={HOUR_RANGES[hourCycle].max}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n // \"Hour\" stays the accessible name (sr-only keeps it in the a11y tree,\n // just visually hidden) — the unit suffix is a decorative stand-in,\n // right next to the value once it's right-aligned (`text-end`).\n translations={t}\n suffix={units.hour}\n className={classNames?.hour}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n <NumberInput\n label={t.minute}\n placeholder={placeholder}\n value={minute}\n onChange={onMinuteChange}\n min={0}\n max={59}\n step={minuteStep}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.minute}\n className={classNames?.minute}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n {withSeconds && (\n <NumberInput\n label={t.second}\n placeholder={placeholder}\n value={second ?? null}\n onChange={onSecondChange}\n min={0}\n max={59}\n step={1}\n wrap\n formatOptions={{ minimumIntegerDigits: 2 }}\n size={size}\n variant={variant}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n translations={t}\n suffix={units.second}\n className={classNames?.second}\n classNames={{\n field: cn(\"flex-1\", timeFieldBasis[size]),\n label: \"sr-only\",\n input: \"text-end\",\n }}\n />\n )}\n {twelveHour && periodLabels && (\n <SegmentGroup\n data={[\n { value: \"AM\", label: periodLabels.AM },\n { value: \"PM\", label: periodLabels.PM },\n ]}\n label={t.period}\n value={period}\n onChange={(value) => onPeriodChange(value as \"AM\" | \"PM\")}\n // `SegmentGroup`'s sizes match `NumberInput`'s box height exactly, so\n // the AM/PM toggle sits flush with the Hour/Minute fields.\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={invalid}\n className={classNames?.period}\n // Unlike Hour/Minute/Second, the AM/PM toggle has a fixed, small set of labels — it\n // doesn't need (or look right) stretching to share the row's leftover width. `w-auto`\n // cancels the Field wrapper's own default `w-full` (which would otherwise still set its\n // flex-basis to the full row width even without `flex-1`); `shrink-0` keeps it stable.\n // \"Period\" keeps the accessible name (sr-only) but no visible label or suffix — the\n // segment control itself already shows \"AM\"/\"PM\", self-descriptive.\n classNames={{ field: \"w-auto shrink-0\", label: \"sr-only\" }}\n />\n )}\n </div>\n )\n}\n"]}
|
|
@@ -51,54 +51,40 @@ var BRIGHT_STARS = [
|
|
|
51
51
|
{ x: "93%", y: "90%", sparkle: false, delay: "-2.5s", duration: "7s" }
|
|
52
52
|
];
|
|
53
53
|
var SPARKLE = "M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z";
|
|
54
|
-
var
|
|
55
|
-
var SPAN = 100 + 2 * BLEED;
|
|
56
|
-
var inLayer = (viewport, offset = 0) => `${round((viewport + offset) / SPAN * 100)}%`;
|
|
57
|
-
var cloud = ({ rx, ry, x, y }, { color, strength }) => `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`;
|
|
54
|
+
var cloud = ({ rx, ry, x, y }, { color, strength }) => `radial-gradient(ellipse ${rx}% ${ry}% at ${x}% ${y}%, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`;
|
|
58
55
|
var CLOUDS = [
|
|
59
56
|
{
|
|
60
57
|
// Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,
|
|
61
58
|
// whose lower-left glows violet behind the first column (2026-10-29).
|
|
62
59
|
at: { rx: 35, ry: 34, x: 23, y: 72 },
|
|
63
60
|
dark: { color: "--color-purple-400", strength: 17 },
|
|
64
|
-
light: { color: "--color-purple-200", strength: 14 }
|
|
65
|
-
drift: { x: "6vw", y: "-4vh", scale: 1.12, fade: 0.7, duration: "70s", delay: "-20s" }
|
|
61
|
+
light: { color: "--color-purple-200", strength: 14 }
|
|
66
62
|
},
|
|
67
63
|
{
|
|
68
64
|
at: { rx: 60, ry: 38, x: 42, y: 104 },
|
|
69
65
|
dark: { color: "--color-purple-800", strength: 20 },
|
|
70
|
-
light: { color: "--color-purple-200", strength: 26 }
|
|
71
|
-
drift: { x: "-8vw", y: "-3vh", scale: 1.08, fade: 0.85, duration: "95s", delay: "-50s" }
|
|
66
|
+
light: { color: "--color-purple-200", strength: 26 }
|
|
72
67
|
},
|
|
73
68
|
{
|
|
74
69
|
at: { rx: 40, ry: 34, x: 92, y: 4 },
|
|
75
70
|
dark: { color: "--color-purple-800", strength: 22 },
|
|
76
|
-
light: { color: "--color-purple-200", strength: 28 }
|
|
77
|
-
drift: { x: "-5vw", y: "5vh", scale: 1.15, fade: 0.8, duration: "85s", delay: "-10s" }
|
|
71
|
+
light: { color: "--color-purple-200", strength: 28 }
|
|
78
72
|
},
|
|
79
73
|
{
|
|
80
74
|
at: { rx: 46, ry: 40, x: 24, y: 20 },
|
|
81
75
|
dark: { color: "--color-brand-700", strength: 18 },
|
|
82
|
-
light: { color: "--color-brand-200", strength: 24 }
|
|
83
|
-
drift: { x: "7vw", y: "4vh", scale: 1.1, fade: 0.85, duration: "110s", delay: "-70s" }
|
|
76
|
+
light: { color: "--color-brand-200", strength: 24 }
|
|
84
77
|
},
|
|
85
78
|
{
|
|
86
79
|
at: { rx: 36, ry: 30, x: 4, y: 92 },
|
|
87
80
|
dark: { color: "--color-pink-800", strength: 10 },
|
|
88
|
-
light: { color: "--color-pink-200", strength: 16 }
|
|
89
|
-
drift: { x: "5vw", y: "-6vh", scale: 1.2, fade: 0.6, duration: "75s", delay: "-35s" }
|
|
81
|
+
light: { color: "--color-pink-200", strength: 16 }
|
|
90
82
|
}
|
|
91
83
|
];
|
|
92
|
-
var cloudStyle = ({ at, dark, light
|
|
84
|
+
var cloudStyle = ({ at, dark, light }) => ({
|
|
93
85
|
"--nebula-light": cloud(at, light),
|
|
94
86
|
"--nebula-dark": cloud(at, dark),
|
|
95
|
-
|
|
96
|
-
"--drift-y": drift.y,
|
|
97
|
-
"--drift-scale": drift.scale,
|
|
98
|
-
"--drift-fade": drift.fade,
|
|
99
|
-
inset: `-${BLEED}%`,
|
|
100
|
-
animationDuration: drift.duration,
|
|
101
|
-
animationDelay: drift.delay
|
|
87
|
+
inset: 0
|
|
102
88
|
});
|
|
103
89
|
var METEORS = [
|
|
104
90
|
{ x: "72%", y: "8%", angle: "152deg", duration: "37s", delay: "9s" },
|
|
@@ -117,7 +103,7 @@ var Starfield = ({
|
|
|
117
103
|
"aria-hidden": "true",
|
|
118
104
|
className: cn(
|
|
119
105
|
LAYER,
|
|
120
|
-
"[background-image:var(--nebula-light)]
|
|
106
|
+
"[background-image:var(--nebula-light)] dark:[background-image:var(--nebula-dark)]",
|
|
121
107
|
classNames?.nebula
|
|
122
108
|
),
|
|
123
109
|
style: cloudStyle(c),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ambient-background/starfield.tsx","../../../src/components/ambient-background/ambient-background.tsx"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAoBA,IAAM,IAAA,GAAO,CAAC,IAAA,KAAiB,MAAM;AACnC,EAAA,IAAA,GAAQ,OAAO,UAAA,GAAc,CAAA;AAC7B,EAAA,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAQ,IAAA,KAAS,EAAA,EAAK,IAAI,IAAI,CAAA;AAChD,EAAA,CAAA,GAAK,CAAA,GAAI,KAAK,IAAA,CAAK,CAAA,GAAK,MAAM,CAAA,EAAI,EAAA,GAAK,CAAC,CAAA,GAAK,CAAA;AAC7C,EAAA,OAAA,CAAA,CAAS,CAAA,GAAK,CAAA,KAAM,EAAA,MAAS,CAAA,IAAK,UAAA;AACpC,CAAA;AAEA,IAAM,QAAQ,CAAC,CAAA,KAAc,KAAK,KAAA,CAAM,CAAA,GAAI,GAAG,CAAA,GAAI,GAAA;AAMnD,IAAM,KAAA,GAAQ;AAAA,EAC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,SAAA,EAAW,EAAA;AAAA,UACT,8DAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,qBAAA,EAAsB;AAAA,QAC/C,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,SAAS;AAAA;AAAA,KACzD;AAAA,IAED,6BACCA,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,wEAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,sBAAA,EAAuB;AAAA,QAChD,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,UAAU;AAAA;AAAA,KAC1D;AAAA,IAED,aAAA,oBAAiBA,GAAAA,CAAC,SAAA,EAAA,EAAU,YAAwB,MAAA,EAAgB;AAAA,GAAA,EACvE,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { CSSProperties } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\n\n// The starfield AmbientBackground draws with `withStarfield`: a starry sky over\n// soft violet nebulae, stacked on the glow and noise (the noise is what\n// dithers these gradients so they never band). Every layer takes the same\n// recipe as glow and noise (fixed, -z-10, no shared wrapper) and paints over\n// them, still under every piece of the app.\n//\n// Everything is computed once at module load from a seeded PRNG, so the sky\n// is identical on every render, on the server and the client, and on every\n// visit. It moves, slowly: the clouds drift and swell, the dust dims and comes\n// back, the brighter stars breathe, and now and then a meteor crosses. All of\n// it is CSS animation of transform and opacity (keyframes in theme.css), so\n// the compositor runs it and no script does per frame; and all of it sits\n// behind `motion-safe:` and the `data-motion=\"reduced\"` rule in theme.css, so\n// with reduced motion the sky is a still picture, without the meteors.\n\n// mulberry32: tiny, fast, and good enough to scatter dots.\nconst prng = (seed: number) => () => {\n seed = (seed + 0x6d2b79f5) | 0\n let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100\n\ntype Star = { x: number; y: number; r: number; opacity: number }\n\n// Most stars are a cool white; a few lean violet or pink, as in the design.\n// On a light sky the same hues go dark, so the dots read as ink, not glare.\nconst TONES = [\n \"fill-brand-500 dark:fill-brand-100\",\n \"fill-purple-500 dark:fill-purple-200\",\n \"fill-pink-500 dark:fill-pink-200\",\n] as const\n\ntype Tone = (typeof TONES)[number]\n\nconst pickTone = (n: number): Tone => (n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2])\n\n// The dust dims in a few groups, each on its own slow beat, so at any moment\n// some stars are fading and others coming back. A group is a whole layer\n// fading (cheap: the compositor does it), and its stars are scattered all\n// over, so it reads as single stars dimming, not as a region pulsing. The\n// beats share no common factor, so the groups never line up into one blink.\nconst DIM_BEATS = [\n { duration: \"11s\", delay: \"-3s\" },\n { duration: \"17s\", delay: \"-11s\" },\n { duration: \"23s\", delay: \"-7s\" },\n] as const\n\n// Dots for one repeating tile, by dimming group, then by tone so each tone\n// is one <g>.\nconst scatter = (seed: number, size: number, count: number) => {\n const random = prng(seed)\n // Its own sequence, so sorting the dots into groups doesn't move them.\n const group = prng(seed + 1)\n const phases = DIM_BEATS.map(() => new Map<Tone, Star[]>(TONES.map((tone) => [tone, []])))\n for (let i = 0; i < count; i++) {\n // Skewed towards the faintest, smallest dots: a real sky is mostly dust.\n const weight = random() ** 2.4\n const star = {\n // Kept off the tile's edge so no dot is cut in half where tiles meet.\n x: round(2 + random() * (size - 4)),\n y: round(2 + random() * (size - 4)),\n r: round(0.4 + weight * 0.75),\n opacity: round(0.22 + weight * 0.4 + random() * 0.1),\n }\n phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star)\n }\n return { size, phases: phases.map((phase) => [...phase]) }\n}\n\n// Two tiles of coprime-ish sizes overlap into a pattern that only repeats\n// every few thousand pixels, so the eye never catches the tiling. Fixed pixel\n// tiles (not a scaled viewBox) keep the same density on a phone and a wide\n// screen. Together about one dot per 6000px², the design's own density.\nconst TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)]\n\n// The few brighter stars, placed by viewport percentage so they spread over\n// any screen. A soft halo rather than a hard disc; the three with `sparkle`\n// carry the design's diffraction spikes, kept thin and short.\nconst BRIGHT_STARS = [\n { x: \"8%\", y: \"14%\", sparkle: true, delay: \"0s\", duration: \"7s\" },\n { x: \"31%\", y: \"6%\", sparkle: false, delay: \"-2s\", duration: \"9s\" },\n { x: \"62%\", y: \"11%\", sparkle: false, delay: \"-5s\", duration: \"8s\" },\n { x: \"88%\", y: \"22%\", sparkle: true, delay: \"-3s\", duration: \"10s\" },\n { x: \"18%\", y: \"58%\", sparkle: false, delay: \"-6s\", duration: \"8s\" },\n { x: \"47%\", y: \"41%\", sparkle: false, delay: \"-1s\", duration: \"11s\" },\n { x: \"76%\", y: \"63%\", sparkle: true, delay: \"-4s\", duration: \"9s\" },\n { x: \"36%\", y: \"86%\", sparkle: false, delay: \"-7s\", duration: \"10s\" },\n { x: \"93%\", y: \"90%\", sparkle: false, delay: \"-2.5s\", duration: \"7s\" },\n] as const\n\n// A four-point sparkle with concave sides: reads as a lens glint, not a shape.\nconst SPARKLE = \"M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z\"\n\n// Each cloud's layer overhangs the viewport by this much on every side, so a\n// cloud cut by the screen's edge (several are) can drift without the cut\n// ever coming into view.\nconst BLEED = 15\nconst SPAN = 100 + 2 * BLEED\n\n// A length or a position given in viewport %, as % of the overhanging layer.\nconst inLayer = (viewport: number, offset = 0) => `${round(((viewport + offset) / SPAN) * 100)}%`\n\ntype Ellipse = { rx: number; ry: number; x: number; y: number }\ntype Hue = { color: string; strength: number }\n\n// Violet and indigo clouds after the design's \"Nébuleuse\", softened: wide\n// ellipses that fade out over their whole radius so no edge ever shows. The\n// design's blue core is already the kit's ambient glow; this adds the purple.\nconst cloud = ({ rx, ry, x, y }: Ellipse, { color, strength }: Hue) =>\n `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`\n\n// Each cloud drifts on its own long, slow swing (there and back, eased at\n// both ends), swelling a little and thinning as it goes: a few px a second,\n// so the sky is never seen moving, only found changed. On a light sky the\n// same clouds are pale tints, so the light theme keeps the violet without\n// muddying the page.\nconst CLOUDS: {\n at: Ellipse\n dark: Hue\n light: Hue\n drift: { x: string; y: string; scale: number; fade: number; duration: string; delay: string }\n}[] = [\n {\n // Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,\n // whose lower-left glows violet behind the first column (2026-10-29).\n at: { rx: 35, ry: 34, x: 23, y: 72 },\n dark: { color: \"--color-purple-400\", strength: 17 },\n light: { color: \"--color-purple-200\", strength: 14 },\n drift: { x: \"6vw\", y: \"-4vh\", scale: 1.12, fade: 0.7, duration: \"70s\", delay: \"-20s\" },\n },\n {\n at: { rx: 60, ry: 38, x: 42, y: 104 },\n dark: { color: \"--color-purple-800\", strength: 20 },\n light: { color: \"--color-purple-200\", strength: 26 },\n drift: { x: \"-8vw\", y: \"-3vh\", scale: 1.08, fade: 0.85, duration: \"95s\", delay: \"-50s\" },\n },\n {\n at: { rx: 40, ry: 34, x: 92, y: 4 },\n dark: { color: \"--color-purple-800\", strength: 22 },\n light: { color: \"--color-purple-200\", strength: 28 },\n drift: { x: \"-5vw\", y: \"5vh\", scale: 1.15, fade: 0.8, duration: \"85s\", delay: \"-10s\" },\n },\n {\n at: { rx: 46, ry: 40, x: 24, y: 20 },\n dark: { color: \"--color-brand-700\", strength: 18 },\n light: { color: \"--color-brand-200\", strength: 24 },\n drift: { x: \"7vw\", y: \"4vh\", scale: 1.1, fade: 0.85, duration: \"110s\", delay: \"-70s\" },\n },\n {\n at: { rx: 36, ry: 30, x: 4, y: 92 },\n dark: { color: \"--color-pink-800\", strength: 10 },\n light: { color: \"--color-pink-200\", strength: 16 },\n drift: { x: \"5vw\", y: \"-6vh\", scale: 1.2, fade: 0.6, duration: \"75s\", delay: \"-35s\" },\n },\n]\n\n// The cloud's picture per theme and its drift, as variables the classes and\n// the ambient-nebula-drift keyframes (theme.css) read.\nconst cloudStyle = ({ at, dark, light, drift }: (typeof CLOUDS)[number]) =>\n ({\n \"--nebula-light\": cloud(at, light),\n \"--nebula-dark\": cloud(at, dark),\n \"--drift-x\": drift.x,\n \"--drift-y\": drift.y,\n \"--drift-scale\": drift.scale,\n \"--drift-fade\": drift.fade,\n inset: `-${BLEED}%`,\n animationDuration: drift.duration,\n animationDelay: drift.delay,\n }) as CSSProperties\n\n// The meteors: three, each on its own long cycle and visible for about a\n// second of it, so one crosses every twenty seconds or so, never on arrival\n// and almost never two at once. Thin, short and faint, high in the sky,\n// falling down and to the left. Seen from the corner of the eye, not watched.\nconst METEORS = [\n { x: \"72%\", y: \"8%\", angle: \"152deg\", duration: \"37s\", delay: \"9s\" },\n { x: \"50%\", y: \"20%\", angle: \"160deg\", duration: \"53s\", delay: \"24s\" },\n { x: \"92%\", y: \"30%\", angle: \"148deg\", duration: \"71s\", delay: \"41s\" },\n] as const\n\n// The halo's stops, per theme: a gradient stop takes no `dark:` class.\nconst HALO_THEME =\n \"[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]\"\n\n// Every layer's recipe: decorative, out of the pointer's way and out of a\n// forced palette's. `ambient-starfield` is the hook theme.css's\n// `data-motion=\"reduced\"` rule stills it by.\nconst LAYER = \"ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden\"\n\nexport type StarfieldClassNames = {\n /** Each nebula cloud's layer. */\n nebula?: string\n /** The layer holding the dust and the brighter stars. */\n stars?: string\n /** The meteors' layer. */\n meteors?: string\n}\n\nexport const Starfield = ({\n classNames,\n testId,\n}: {\n classNames?: StarfieldClassNames\n testId?: string\n}) => (\n <>\n {CLOUDS.map((c, i) => (\n <div\n key={`${c.at.x}-${c.at.y}`}\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"[background-image:var(--nebula-light)] motion-safe:animate-ambient-nebula-drift dark:[background-image:var(--nebula-dark)]\",\n classNames?.nebula,\n )}\n style={cloudStyle(c)}\n {...props({ \"data-testid\": testId && `${testId}-nebula-${i}` })}\n />\n ))}\n\n {/* Fainter on a light sky: dark dots at the dark sky's strength read\n as specks rather than dust. Set on the wrapper, because the layers\n inside animate their own opacity. */}\n <div\n aria-hidden=\"true\"\n className={cn(LAYER, \"inset-0 opacity-70 dark:opacity-100\", HALO_THEME, classNames?.stars)}\n {...props({ \"data-testid\": testId && `${testId}-stars` })}\n >\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n {TILES.flatMap(({ size, phases }, i) =>\n phases.map((groups, phase) => (\n <pattern\n // biome-ignore lint/suspicious/noArrayIndexKey: a static, never-reordered list\n key={`${i}-${phase}`}\n id={`ambient-starfield-tile-${i}-${phase}`}\n width={size}\n height={size}\n patternUnits=\"userSpaceOnUse\"\n >\n {groups.map(([tone, stars]) => (\n <g key={tone} className={tone}>\n {stars.map(({ x, y, r, opacity }) => (\n <circle key={`${x}-${y}`} cx={x} cy={y} r={r} fillOpacity={opacity} />\n ))}\n </g>\n ))}\n </pattern>\n )),\n )}\n <radialGradient id=\"ambient-starfield-halo\">\n <stop offset=\"0%\" style={{ stopColor: \"var(--star-halo-core)\" }} stopOpacity={0.32} />\n <stop offset=\"35%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0.1} />\n <stop offset=\"100%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0} />\n </radialGradient>\n </defs>\n </svg>\n\n {DIM_BEATS.map(({ duration, delay }, phase) => (\n <svg\n key={duration}\n aria-hidden=\"true\"\n className=\"absolute inset-0 size-full motion-safe:animate-ambient-star-dim\"\n style={{ animationDuration: duration, animationDelay: delay }}\n >\n {TILES.map(({ size }, i) => (\n <rect\n key={size}\n width=\"100%\"\n height=\"100%\"\n fill={`url(#ambient-starfield-tile-${i}-${phase})`}\n />\n ))}\n </svg>\n ))}\n\n <svg aria-hidden=\"true\" className=\"absolute inset-0 size-full\">\n {BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => (\n <svg key={`${x}-${y}`} aria-hidden=\"true\" x={x} y={y} overflow=\"visible\">\n <g\n className=\"motion-safe:animate-ambient-star-twinkle\"\n style={{ animationDelay: delay, animationDuration: duration }}\n >\n <circle r={7} fill=\"url(#ambient-starfield-halo)\" />\n {sparkle ? (\n <path\n d={SPARKLE}\n className=\"fill-purple-400 dark:fill-purple-100\"\n fillOpacity={0.4}\n />\n ) : null}\n <circle r={1.1} className=\"fill-brand-500 dark:fill-brand-50\" fillOpacity={0.85} />\n </g>\n </svg>\n ))}\n </svg>\n </div>\n\n {/* Only where motion is welcome: a meteor standing still is a scratch. */}\n <div\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block\",\n classNames?.meteors,\n )}\n {...props({ \"data-testid\": testId && `${testId}-meteors` })}\n >\n {METEORS.map(({ x, y, angle, duration, delay }) => (\n // A zero-size anchor turned to the meteor's heading; the streak\n // ends at it, head first, and flies along that heading.\n <span\n key={`${x}-${y}`}\n className=\"absolute size-0\"\n style={{ left: x, top: y, rotate: angle }}\n >\n <span\n className=\"absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60\"\n style={{ animationDuration: duration, animationDelay: delay }}\n />\n </span>\n ))}\n </div>\n </>\n)\n","import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Starfield, type StarfieldClassNames } from \"./starfield\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * `withStarfield` adds a third, opt-in layer set: a slowly moving starry sky\n * over soft violet nebulae (dimming dust, breathing bright stars, a rare\n * meteor), seeded so it is identical on every render. It follows the same\n * recipe — separate fixed layers, no shared wrapper — and stills under reduced\n * motion, either the OS setting or `data-motion=\"reduced\"` on `<html>`.\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``, and with the\n * starfield `` `${testId}-nebula-<n>` ``, `` `${testId}-stars` `` and\n * `` `${testId}-meteors` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** Render the starfield over the glow and noise: nebulae, stars and meteors. Default `false`. */\n withStarfield?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: StarfieldClassNames & {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n withStarfield = false,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n {withStarfield && <Starfield classNames={classNames} testId={testId} />}\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ambient-background/starfield.tsx","../../../src/components/ambient-background/ambient-background.tsx"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAsBA,IAAM,IAAA,GAAO,CAAC,IAAA,KAAiB,MAAM;AACnC,EAAA,IAAA,GAAQ,OAAO,UAAA,GAAc,CAAA;AAC7B,EAAA,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAQ,IAAA,KAAS,EAAA,EAAK,IAAI,IAAI,CAAA;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qB,SAAS,WAAW,CAAA;AAClF,EAAA,uBACEA,IAAAA,CAAAC,QAAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,QAAA,oBACCC,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,8DAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,qBAAA,EAAsB;AAAA,QAC/C,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,SAAS;AAAA;AAAA,KACzD;AAAA,IAED,6BACCA,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,wEAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,sBAAA,EAAuB;AAAA,QAChD,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,UAAU;AAAA;AAAA,KAC1D;AAAA,IAED,aAAA,oBAAiBA,GAAAA,CAAC,SAAA,EAAA,EAAU,YAAwB,MAAA,EAAgB;AAAA,GAAA,EACvE,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { CSSProperties } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\n\n// The starfield AmbientBackground draws with `withStarfield`: a starry sky over\n// soft violet nebulae, stacked on the glow and noise (the noise is what\n// dithers these gradients so they never band). Every layer takes the same\n// recipe as glow and noise (fixed, -z-10, no shared wrapper) and paints over\n// them, still under every piece of the app.\n//\n// Everything is computed once at module load from a seeded PRNG, so the sky\n// is identical on every render, on the server and the client, and on every\n// visit. The clouds hold still: a drifting full-screen gradient is redrawn\n// whole on every frame in Firefox, which kept its GPU busy for as long as a\n// page was open. The rest moves, slowly: the dust dims and comes back, the\n// brighter stars breathe, and now and then a meteor crosses. All of it is CSS\n// animation of opacity and transform (keyframes in theme.css), so the\n// compositor runs it and no script does per frame; and all of it sits\n// behind `motion-safe:` and the `data-motion=\"reduced\"` rule in theme.css, so\n// with reduced motion the sky is a still picture, without the meteors.\n\n// mulberry32: tiny, fast, and good enough to scatter dots.\nconst prng = (seed: number) => () => {\n seed = (seed + 0x6d2b79f5) | 0\n let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100\n\ntype Star = { x: number; y: number; r: number; opacity: number }\n\n// Most stars are a cool white; a few lean violet or pink, as in the design.\n// On a light sky the same hues go dark, so the dots read as ink, not glare.\nconst TONES = [\n \"fill-brand-500 dark:fill-brand-100\",\n \"fill-purple-500 dark:fill-purple-200\",\n \"fill-pink-500 dark:fill-pink-200\",\n] as const\n\ntype Tone = (typeof TONES)[number]\n\nconst pickTone = (n: number): Tone => (n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2])\n\n// The dust dims in a few groups, each on its own slow beat, so at any moment\n// some stars are fading and others coming back. A group is a whole layer\n// fading (cheap: the compositor does it), and its stars are scattered all\n// over, so it reads as single stars dimming, not as a region pulsing. The\n// beats share no common factor, so the groups never line up into one blink.\nconst DIM_BEATS = [\n { duration: \"11s\", delay: \"-3s\" },\n { duration: \"17s\", delay: \"-11s\" },\n { duration: \"23s\", delay: \"-7s\" },\n] as const\n\n// Dots for one repeating tile, by dimming group, then by tone so each tone\n// is one <g>.\nconst scatter = (seed: number, size: number, count: number) => {\n const random = prng(seed)\n // Its own sequence, so sorting the dots into groups doesn't move them.\n const group = prng(seed + 1)\n const phases = DIM_BEATS.map(() => new Map<Tone, Star[]>(TONES.map((tone) => [tone, []])))\n for (let i = 0; i < count; i++) {\n // Skewed towards the faintest, smallest dots: a real sky is mostly dust.\n const weight = random() ** 2.4\n const star = {\n // Kept off the tile's edge so no dot is cut in half where tiles meet.\n x: round(2 + random() * (size - 4)),\n y: round(2 + random() * (size - 4)),\n r: round(0.4 + weight * 0.75),\n opacity: round(0.22 + weight * 0.4 + random() * 0.1),\n }\n phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star)\n }\n return { size, phases: phases.map((phase) => [...phase]) }\n}\n\n// Two tiles of coprime-ish sizes overlap into a pattern that only repeats\n// every few thousand pixels, so the eye never catches the tiling. Fixed pixel\n// tiles (not a scaled viewBox) keep the same density on a phone and a wide\n// screen. Together about one dot per 6000px², the design's own density.\nconst TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)]\n\n// The few brighter stars, placed by viewport percentage so they spread over\n// any screen. A soft halo rather than a hard disc; the three with `sparkle`\n// carry the design's diffraction spikes, kept thin and short.\nconst BRIGHT_STARS = [\n { x: \"8%\", y: \"14%\", sparkle: true, delay: \"0s\", duration: \"7s\" },\n { x: \"31%\", y: \"6%\", sparkle: false, delay: \"-2s\", duration: \"9s\" },\n { x: \"62%\", y: \"11%\", sparkle: false, delay: \"-5s\", duration: \"8s\" },\n { x: \"88%\", y: \"22%\", sparkle: true, delay: \"-3s\", duration: \"10s\" },\n { x: \"18%\", y: \"58%\", sparkle: false, delay: \"-6s\", duration: \"8s\" },\n { x: \"47%\", y: \"41%\", sparkle: false, delay: \"-1s\", duration: \"11s\" },\n { x: \"76%\", y: \"63%\", sparkle: true, delay: \"-4s\", duration: \"9s\" },\n { x: \"36%\", y: \"86%\", sparkle: false, delay: \"-7s\", duration: \"10s\" },\n { x: \"93%\", y: \"90%\", sparkle: false, delay: \"-2.5s\", duration: \"7s\" },\n] as const\n\n// A four-point sparkle with concave sides: reads as a lens glint, not a shape.\nconst SPARKLE = \"M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z\"\n\ntype Ellipse = { rx: number; ry: number; x: number; y: number }\ntype Hue = { color: string; strength: number }\n\n// Violet and indigo clouds after the design's \"Nébuleuse\", softened: wide\n// ellipses that fade out over their whole radius so no edge ever shows. The\n// design's blue core is already the kit's ambient glow; this adds the purple.\nconst cloud = ({ rx, ry, x, y }: Ellipse, { color, strength }: Hue) =>\n `radial-gradient(ellipse ${rx}% ${ry}% at ${x}% ${y}%, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`\n\n// On a light sky the same clouds are pale tints, so the light theme keeps\n// the violet without muddying the page.\nconst CLOUDS: { at: Ellipse; dark: Hue; light: Hue }[] = [\n {\n // Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,\n // whose lower-left glows violet behind the first column (2026-10-29).\n at: { rx: 35, ry: 34, x: 23, y: 72 },\n dark: { color: \"--color-purple-400\", strength: 17 },\n light: { color: \"--color-purple-200\", strength: 14 },\n },\n {\n at: { rx: 60, ry: 38, x: 42, y: 104 },\n dark: { color: \"--color-purple-800\", strength: 20 },\n light: { color: \"--color-purple-200\", strength: 26 },\n },\n {\n at: { rx: 40, ry: 34, x: 92, y: 4 },\n dark: { color: \"--color-purple-800\", strength: 22 },\n light: { color: \"--color-purple-200\", strength: 28 },\n },\n {\n at: { rx: 46, ry: 40, x: 24, y: 20 },\n dark: { color: \"--color-brand-700\", strength: 18 },\n light: { color: \"--color-brand-200\", strength: 24 },\n },\n {\n at: { rx: 36, ry: 30, x: 4, y: 92 },\n dark: { color: \"--color-pink-800\", strength: 10 },\n light: { color: \"--color-pink-200\", strength: 16 },\n },\n]\n\n// The cloud's picture per theme, as variables the classes read.\nconst cloudStyle = ({ at, dark, light }: (typeof CLOUDS)[number]) =>\n ({\n \"--nebula-light\": cloud(at, light),\n \"--nebula-dark\": cloud(at, dark),\n inset: 0,\n }) as CSSProperties\n\n// The meteors: three, each on its own long cycle and visible for about a\n// second of it, so one crosses every twenty seconds or so, never on arrival\n// and almost never two at once. Thin, short and faint, high in the sky,\n// falling down and to the left. Seen from the corner of the eye, not watched.\nconst METEORS = [\n { x: \"72%\", y: \"8%\", angle: \"152deg\", duration: \"37s\", delay: \"9s\" },\n { x: \"50%\", y: \"20%\", angle: \"160deg\", duration: \"53s\", delay: \"24s\" },\n { x: \"92%\", y: \"30%\", angle: \"148deg\", duration: \"71s\", delay: \"41s\" },\n] as const\n\n// The halo's stops, per theme: a gradient stop takes no `dark:` class.\nconst HALO_THEME =\n \"[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]\"\n\n// Every layer's recipe: decorative, out of the pointer's way and out of a\n// forced palette's. `ambient-starfield` is the hook theme.css's\n// `data-motion=\"reduced\"` rule stills it by.\nconst LAYER = \"ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden\"\n\nexport type StarfieldClassNames = {\n /** Each nebula cloud's layer. */\n nebula?: string\n /** The layer holding the dust and the brighter stars. */\n stars?: string\n /** The meteors' layer. */\n meteors?: string\n}\n\nexport const Starfield = ({\n classNames,\n testId,\n}: {\n classNames?: StarfieldClassNames\n testId?: string\n}) => (\n <>\n {CLOUDS.map((c, i) => (\n <div\n key={`${c.at.x}-${c.at.y}`}\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"[background-image:var(--nebula-light)] dark:[background-image:var(--nebula-dark)]\",\n classNames?.nebula,\n )}\n style={cloudStyle(c)}\n {...props({ \"data-testid\": testId && `${testId}-nebula-${i}` })}\n />\n ))}\n\n {/* Fainter on a light sky: dark dots at the dark sky's strength read\n as specks rather than dust. Set on the wrapper, because the layers\n inside animate their own opacity. */}\n <div\n aria-hidden=\"true\"\n className={cn(LAYER, \"inset-0 opacity-70 dark:opacity-100\", HALO_THEME, classNames?.stars)}\n {...props({ \"data-testid\": testId && `${testId}-stars` })}\n >\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n {TILES.flatMap(({ size, phases }, i) =>\n phases.map((groups, phase) => (\n <pattern\n // biome-ignore lint/suspicious/noArrayIndexKey: a static, never-reordered list\n key={`${i}-${phase}`}\n id={`ambient-starfield-tile-${i}-${phase}`}\n width={size}\n height={size}\n patternUnits=\"userSpaceOnUse\"\n >\n {groups.map(([tone, stars]) => (\n <g key={tone} className={tone}>\n {stars.map(({ x, y, r, opacity }) => (\n <circle key={`${x}-${y}`} cx={x} cy={y} r={r} fillOpacity={opacity} />\n ))}\n </g>\n ))}\n </pattern>\n )),\n )}\n <radialGradient id=\"ambient-starfield-halo\">\n <stop offset=\"0%\" style={{ stopColor: \"var(--star-halo-core)\" }} stopOpacity={0.32} />\n <stop offset=\"35%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0.1} />\n <stop offset=\"100%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0} />\n </radialGradient>\n </defs>\n </svg>\n\n {DIM_BEATS.map(({ duration, delay }, phase) => (\n <svg\n key={duration}\n aria-hidden=\"true\"\n className=\"absolute inset-0 size-full motion-safe:animate-ambient-star-dim\"\n style={{ animationDuration: duration, animationDelay: delay }}\n >\n {TILES.map(({ size }, i) => (\n <rect\n key={size}\n width=\"100%\"\n height=\"100%\"\n fill={`url(#ambient-starfield-tile-${i}-${phase})`}\n />\n ))}\n </svg>\n ))}\n\n <svg aria-hidden=\"true\" className=\"absolute inset-0 size-full\">\n {BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => (\n <svg key={`${x}-${y}`} aria-hidden=\"true\" x={x} y={y} overflow=\"visible\">\n <g\n className=\"motion-safe:animate-ambient-star-twinkle\"\n style={{ animationDelay: delay, animationDuration: duration }}\n >\n <circle r={7} fill=\"url(#ambient-starfield-halo)\" />\n {sparkle ? (\n <path\n d={SPARKLE}\n className=\"fill-purple-400 dark:fill-purple-100\"\n fillOpacity={0.4}\n />\n ) : null}\n <circle r={1.1} className=\"fill-brand-500 dark:fill-brand-50\" fillOpacity={0.85} />\n </g>\n </svg>\n ))}\n </svg>\n </div>\n\n {/* Only where motion is welcome: a meteor standing still is a scratch. */}\n <div\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block\",\n classNames?.meteors,\n )}\n {...props({ \"data-testid\": testId && `${testId}-meteors` })}\n >\n {METEORS.map(({ x, y, angle, duration, delay }) => (\n // A zero-size anchor turned to the meteor's heading; the streak\n // ends at it, head first, and flies along that heading.\n <span\n key={`${x}-${y}`}\n className=\"absolute size-0\"\n style={{ left: x, top: y, rotate: angle }}\n >\n <span\n className=\"absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60\"\n style={{ animationDuration: duration, animationDelay: delay }}\n />\n </span>\n ))}\n </div>\n </>\n)\n","import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Starfield, type StarfieldClassNames } from \"./starfield\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * `withStarfield` adds a third, opt-in layer set: a slowly moving starry sky\n * over soft violet nebulae (dimming dust, breathing bright stars, a rare\n * meteor), seeded so it is identical on every render. It follows the same\n * recipe — separate fixed layers, no shared wrapper — and stills under reduced\n * motion, either the OS setting or `data-motion=\"reduced\"` on `<html>`.\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``, and with the\n * starfield `` `${testId}-nebula-<n>` ``, `` `${testId}-stars` `` and\n * `` `${testId}-meteors` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** Render the starfield over the glow and noise: nebulae, stars and meteors. Default `false`. */\n withStarfield?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: StarfieldClassNames & {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n withStarfield = false,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n {withStarfield && <Starfield classNames={classNames} testId={testId} />}\n </>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../src/components/ambient-background/starfield.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../src/components/ambient-background/starfield.tsx"],"names":[],"mappings":"AA0KA,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,SAAS,4BAGnB;IACD,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,gCAwHA,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { type ComponentPropsWithoutRef, type Dispatch, type Ref, type SetStateAc
|
|
|
3
3
|
import type { NoAsChild } from "../../lib/as-child";
|
|
4
4
|
import type { Size } from "../../lib/sizes";
|
|
5
5
|
import type { WithTestId } from "../../lib/test-id";
|
|
6
|
+
import { type Updater } from "../../lib/use-uncontrolled";
|
|
6
7
|
/**
|
|
7
8
|
* AppShell — header / sidebar / main / aside app frame, laid out with CSS
|
|
8
9
|
* Grid named areas. Sidebar spans the full height on the left; Header
|
|
@@ -11,10 +12,14 @@ import type { WithTestId } from "../../lib/test-id";
|
|
|
11
12
|
* Aside sits below Header, full height only within the remaining row,
|
|
12
13
|
* beside Main. No Footer — add one only once a real consumer needs it.
|
|
13
14
|
*
|
|
14
|
-
* Sidebar is
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* On desktop, Sidebar is a grid column that can be collapsed — opt in by
|
|
16
|
+
* rendering an `AppShell.SidebarCollapseTrigger` (or driving `collapsed`):
|
|
17
|
+
* the column animates to zero and the sidebar slides off the start edge,
|
|
18
|
+
* coming back as a floating card while the pointer rests on that edge
|
|
19
|
+
* (fumadocs' docs sidebar behaves the same way). Below `breakpoint`, it
|
|
20
|
+
* becomes an overlay `Drawer` instead, toggled by `AppShell.SidebarTrigger`
|
|
21
|
+
* (which renders nothing on desktop — `SidebarCollapseTrigger` is its
|
|
22
|
+
* desktop counterpart, and renders nothing on mobile). Aside works
|
|
18
23
|
* differently: it's always mounted (no JS/container-query gating at all,
|
|
19
24
|
* unlike Sidebar) and purely CSS-driven — hidden below a `@xl` container
|
|
20
25
|
* breakpoint, visible above it — mirroring how fumadocs' own docs layout
|
|
@@ -50,7 +55,14 @@ export type AppShellState = {
|
|
|
50
55
|
setMobileOpen: Dispatch<SetStateAction<boolean>>;
|
|
51
56
|
/** Whether `AppShell` is narrower than its `breakpoint`, so Sidebar is a drawer. */
|
|
52
57
|
isMobile: boolean;
|
|
53
|
-
/**
|
|
58
|
+
/** Whether the desktop sidebar is collapsed. Has no effect below
|
|
59
|
+
* `breakpoint`, where the sidebar is a drawer either way. */
|
|
60
|
+
collapsed: boolean;
|
|
61
|
+
/** Collapses or expands the desktop sidebar — e.g. from a keyboard
|
|
62
|
+
* shortcut. Goes through `onCollapsedChange` when `collapsed` is controlled. */
|
|
63
|
+
setCollapsed: (updater: Updater<boolean>) => void;
|
|
64
|
+
/** Id of the sidebar — the drawer's content on mobile, the docked column on
|
|
65
|
+
* desktop — which both triggers' `aria-controls` point at. */
|
|
54
66
|
sidebarId: string;
|
|
55
67
|
};
|
|
56
68
|
/**
|
|
@@ -67,14 +79,28 @@ export type AppShellProps = HTMLArkProps<"div"> & WithTestId & {
|
|
|
67
79
|
* overlay `Drawer` instead of a grid column — measured against the
|
|
68
80
|
* container itself via `ResizeObserver`, not the viewport. @default 768 */
|
|
69
81
|
breakpoint?: number;
|
|
82
|
+
/** Whether the desktop sidebar is collapsed (controlled). Ignored below
|
|
83
|
+
* `breakpoint`. */
|
|
84
|
+
collapsed?: boolean;
|
|
85
|
+
/** Initial collapsed state (uncontrolled). @default false */
|
|
86
|
+
defaultCollapsed?: boolean;
|
|
87
|
+
/** Called when a `SidebarCollapseTrigger` (or `useAppShell().setCollapsed`)
|
|
88
|
+
* collapses or expands the desktop sidebar. */
|
|
89
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
70
90
|
/** Lands on the grid root; also used internally to measure `breakpoint`
|
|
71
91
|
* against the container's own width. */
|
|
72
92
|
ref?: Ref<HTMLDivElement>;
|
|
73
93
|
};
|
|
74
|
-
declare const AppShellRoot: ({ breakpoint, className, style, children, ref, testId, onClick, ...rest }: AppShellProps) => import("react").JSX.Element;
|
|
94
|
+
declare const AppShellRoot: ({ breakpoint, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, className, style, children, ref, testId, onClick, ...rest }: AppShellProps) => import("react").JSX.Element;
|
|
95
|
+
export type AppShellSidebarCollapse = "hide" | "icons";
|
|
75
96
|
export type AppShellSidebarProps = NoAsChild<HTMLArkProps<"aside">> & WithTestId & {
|
|
76
97
|
/** Width when expanded, from the kit's Size scale. @default "md" */
|
|
77
98
|
size?: Size;
|
|
99
|
+
/** What collapsing does on desktop. `"hide"` slides the sidebar off the
|
|
100
|
+
* edge, peeking back as a card on hover at the edge. `"icons"` shrinks it
|
|
101
|
+
* to a 68px icon rail: labels turn into tooltips, and resting on the rail
|
|
102
|
+
* peeks the full sidebar over the page. @default "hide" */
|
|
103
|
+
collapse?: AppShellSidebarCollapse;
|
|
78
104
|
};
|
|
79
105
|
/**
|
|
80
106
|
* Below `breakpoint`, renders through the kit's own `Drawer` instead of the
|
|
@@ -106,12 +132,13 @@ export type AppShellSidebarProps = NoAsChild<HTMLArkProps<"aside">> & WithTestId
|
|
|
106
132
|
* no `title`, so without one of those it is a dialog with no name (and
|
|
107
133
|
* `Drawer` warns in development).
|
|
108
134
|
*/
|
|
109
|
-
declare const AppShellSidebar: ({ size, className, children, testId, asChild: _asChild, ...rest }: AppShellSidebarProps) => import("react").JSX.Element;
|
|
135
|
+
declare const AppShellSidebar: ({ size, collapse, className, children, testId, asChild: _asChild, ...rest }: AppShellSidebarProps) => import("react").JSX.Element;
|
|
110
136
|
export type AppShellSidebarHeaderProps = ComponentPropsWithoutRef<"div"> & WithTestId;
|
|
111
137
|
declare const AppShellSidebarHeader: ({ className, testId, ...rest }: AppShellSidebarHeaderProps) => import("react").JSX.Element;
|
|
112
138
|
export type AppShellSidebarBodyProps = ComponentPropsWithoutRef<"div"> & WithTestId;
|
|
113
139
|
/**
|
|
114
|
-
* The scroll region — the only part of Sidebar that scrolls.
|
|
140
|
+
* The scroll region — the only part of Sidebar that scrolls. On an icon rail
|
|
141
|
+
* its scrollbar is hidden (no room for one). The mask fades
|
|
115
142
|
* content at the top/bottom edges instead of clipping it on a hard line
|
|
116
143
|
* (fumadocs' own docs sidebar uses the same static mask on its nav
|
|
117
144
|
* viewport); `overscroll-contain` stops scrolling the list from chaining
|
|
@@ -226,18 +253,36 @@ export type AppShellAsideProps = HTMLArkProps<"aside"> & WithTestId & {
|
|
|
226
253
|
declare const AppShellAside: ({ size, className, testId, ...rest }: AppShellAsideProps) => import("react").JSX.Element;
|
|
227
254
|
export type AppShellSidebarTriggerProps = HTMLArkProps<"button"> & WithTestId;
|
|
228
255
|
/**
|
|
229
|
-
* Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint
|
|
230
|
-
*
|
|
256
|
+
* Opens/closes the mobile `Drawer`. Renders nothing above `breakpoint`,
|
|
257
|
+
* where the sidebar is a grid column — `SidebarCollapseTrigger` is the
|
|
258
|
+
* desktop counterpart that collapses it.
|
|
231
259
|
* `asChild`-able, like every other kit trigger. Carries `aria-expanded` and
|
|
232
260
|
* `aria-controls` (the drawer's content), like any disclosure button.
|
|
233
261
|
*/
|
|
234
262
|
declare const AppShellSidebarTrigger: ({ onClick, testId, ...rest }: AppShellSidebarTriggerProps) => import("react").JSX.Element | null;
|
|
263
|
+
export type AppShellSidebarCollapseTriggerProps = HTMLArkProps<"button"> & WithTestId;
|
|
264
|
+
/**
|
|
265
|
+
* Collapses/expands the desktop sidebar — `SidebarTrigger`'s desktop
|
|
266
|
+
* counterpart, and its mirror image: renders nothing below `breakpoint`,
|
|
267
|
+
* where the sidebar is a drawer and there's nothing to collapse. Rendering one
|
|
268
|
+
* is what opts a shell into collapsing. `asChild`-able; carries
|
|
269
|
+
* `aria-expanded`, `aria-controls` and `data-collapsed`.
|
|
270
|
+
*
|
|
271
|
+
* Usually rendered twice: in `SidebarHeader` to collapse, and in `Header` to
|
|
272
|
+
* expand again (the one in the sidebar slides away with it) — the Header one
|
|
273
|
+
* often only while `useAppShell().collapsed`. Collapsing from the one inside
|
|
274
|
+
* the sidebar hands focus to a collapse trigger outside it, including one
|
|
275
|
+
* that only just rendered, since the collapsed sidebar is `inert` and would
|
|
276
|
+
* otherwise drop focus on the floor.
|
|
277
|
+
*/
|
|
278
|
+
declare const AppShellSidebarCollapseTrigger: ({ onClick, testId, ...rest }: AppShellSidebarCollapseTriggerProps) => import("react").JSX.Element | null;
|
|
235
279
|
export declare const AppShell: typeof AppShellRoot & {
|
|
236
280
|
Sidebar: typeof AppShellSidebar;
|
|
237
281
|
SidebarHeader: typeof AppShellSidebarHeader;
|
|
238
282
|
SidebarBody: typeof AppShellSidebarBody;
|
|
239
283
|
SidebarFooter: typeof AppShellSidebarFooter;
|
|
240
284
|
SidebarTrigger: typeof AppShellSidebarTrigger;
|
|
285
|
+
SidebarCollapseTrigger: typeof AppShellSidebarCollapseTrigger;
|
|
241
286
|
Header: typeof AppShellHeader;
|
|
242
287
|
Main: typeof AppShellMain;
|
|
243
288
|
Full: typeof AppShellFull;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,QAAQ,EAGb,KAAK,GAAG,EAER,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,4BAA4B,CAAA;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAA;IACnB;mFAC+E;IAC/E,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAA;IACjB;kEAC8D;IAC9D,SAAS,EAAE,OAAO,CAAA;IAClB;qFACiF;IACjF,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IACjD;mEAC+D;IAC/D,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAID;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,aAAa,CAI3C;AAeD,MAAM,MAAM,aAAa,GA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GAAG,UAAU,CAAA;AAErF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,8BAA8B,iCAIjC,mCAAmC,uCAiCrC,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAYnB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AppShell, type AppShellAsideProps, type AppShellContentProps, type AppShellFullProps, type AppShellHeaderProps, type AppShellMainProps, type AppShellMainSize, type AppShellProps, type AppShellSidebarBodyProps, type AppShellSidebarFooterProps, type AppShellSidebarHeaderProps, type AppShellSidebarProps, type AppShellSidebarTriggerProps, type AppShellState, useAppShell, } from "./app-shell";
|
|
1
|
+
export { AppShell, type AppShellAsideProps, type AppShellContentProps, type AppShellFullProps, type AppShellHeaderProps, type AppShellMainProps, type AppShellMainSize, type AppShellProps, type AppShellSidebarBodyProps, type AppShellSidebarCollapse, type AppShellSidebarCollapseTriggerProps, type AppShellSidebarFooterProps, type AppShellSidebarHeaderProps, type AppShellSidebarProps, type AppShellSidebarTriggerProps, type AppShellState, useAppShell, } from "./app-shell";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,WAAW,GACZ,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app-shell/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,WAAW,GACZ,MAAM,aAAa,CAAA"}
|