@six-vallees/ui-react 0.6.0 → 0.7.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/README.md +9 -13
- package/dist/actions/button-group.d.ts +21 -0
- package/dist/actions/button-group.js +8 -0
- package/dist/actions/button-group.js.map +1 -0
- package/dist/actions/context-menu.d.ts +48 -0
- package/dist/actions/context-menu.js +38 -0
- package/dist/actions/context-menu.js.map +1 -0
- package/dist/actions/dropdown-menu.d.ts +49 -0
- package/dist/actions/dropdown-menu.js +38 -0
- package/dist/actions/dropdown-menu.js.map +1 -0
- package/dist/actions/icon-button.d.ts +34 -0
- package/dist/actions/icon-button.js +10 -0
- package/dist/actions/icon-button.js.map +1 -0
- package/dist/actions/link.d.ts +23 -0
- package/dist/actions/link.js +8 -0
- package/dist/actions/link.js.map +1 -0
- package/dist/actions/menu-styles.d.ts +25 -0
- package/dist/actions/menu-styles.js +23 -0
- package/dist/actions/menu-styles.js.map +1 -0
- package/dist/avatar/avatar.d.ts +1 -1
- package/dist/avatar/avatar.js +1 -1
- package/dist/badge/badge.d.ts +3 -3
- package/dist/badge/badge.js +1 -1
- package/dist/button/button.d.ts +7 -4
- package/dist/button/button.js +1 -1
- package/dist/card/card.d.ts +11 -3
- package/dist/card/card.js +1 -1
- package/dist/charts/bar-chart.d.ts +50 -11
- package/dist/charts/bar-chart.js +7 -2
- package/dist/charts/benchmark-table.d.ts +47 -0
- package/dist/charts/benchmark-table.js +10 -0
- package/dist/charts/benchmark-table.js.map +1 -0
- package/dist/charts/delta.d.ts +23 -0
- package/dist/charts/delta.js +8 -0
- package/dist/charts/delta.js.map +1 -0
- package/dist/charts/dot-matrix.d.ts +38 -0
- package/dist/charts/dot-matrix.js +13 -0
- package/dist/charts/dot-matrix.js.map +1 -0
- package/dist/charts/heatmap.d.ts +33 -0
- package/dist/charts/heatmap.js +13 -0
- package/dist/charts/heatmap.js.map +1 -0
- package/dist/charts/lib/scale.d.ts +17 -0
- package/dist/charts/lib/scale.js +15 -0
- package/dist/charts/lib/scale.js.map +1 -0
- package/dist/charts/lib/series.d.ts +76 -44
- package/dist/charts/lib/series.js +25 -11
- package/dist/charts/lib/use-chart.d.ts +48 -0
- package/dist/charts/lib/use-chart.js +16 -0
- package/dist/charts/lib/use-chart.js.map +1 -0
- package/dist/charts/line-chart.d.ts +52 -19
- package/dist/charts/line-chart.js +11 -2
- package/dist/charts/meter.d.ts +30 -0
- package/dist/charts/meter.js +12 -0
- package/dist/charts/meter.js.map +1 -0
- package/dist/charts/primitives/chart-frame.d.ts +25 -0
- package/dist/charts/primitives/chart-frame.js +8 -0
- package/dist/charts/primitives/chart-frame.js.map +1 -0
- package/dist/charts/primitives/chart-grid.d.ts +29 -0
- package/dist/charts/primitives/chart-grid.js +9 -0
- package/dist/charts/primitives/chart-grid.js.map +1 -0
- package/dist/charts/primitives/chart-legend.d.ts +23 -0
- package/dist/charts/primitives/chart-legend.js +9 -0
- package/dist/charts/primitives/chart-legend.js.map +1 -0
- package/dist/charts/primitives/chart-tooltip.d.ts +31 -0
- package/dist/charts/primitives/chart-tooltip.js +9 -0
- package/dist/charts/primitives/chart-tooltip.js.map +1 -0
- package/dist/charts/rank-list.d.ts +29 -0
- package/dist/charts/rank-list.js +12 -0
- package/dist/charts/rank-list.js.map +1 -0
- package/dist/charts/ring.d.ts +25 -24
- package/dist/charts/ring.js +4 -2
- package/dist/charts/scatter-chart.d.ts +42 -0
- package/dist/charts/scatter-chart.js +14 -0
- package/dist/charts/scatter-chart.js.map +1 -0
- package/dist/charts/segmented-bar.d.ts +16 -11
- package/dist/charts/segmented-bar.js +6 -2
- package/dist/charts/sparkline.d.ts +32 -0
- package/dist/charts/sparkline.js +10 -0
- package/dist/charts/sparkline.js.map +1 -0
- package/dist/charts/stat.d.ts +13 -7
- package/dist/charts/stat.js +2 -1
- package/dist/chunk-24T7KWXQ.js +84 -0
- package/dist/chunk-24T7KWXQ.js.map +1 -0
- package/dist/chunk-2NJFAPRG.js +40 -0
- package/dist/chunk-2NJFAPRG.js.map +1 -0
- package/dist/chunk-3PHVZB3A.js +73 -0
- package/dist/chunk-3PHVZB3A.js.map +1 -0
- package/dist/chunk-5EGRSN37.js +102 -0
- package/dist/chunk-5EGRSN37.js.map +1 -0
- package/dist/chunk-7FRDEE43.js +35 -0
- package/dist/chunk-7FRDEE43.js.map +1 -0
- package/dist/{chunk-ULEDFFUJ.js → chunk-7YKHLP4S.js} +1 -1
- package/dist/chunk-7YKHLP4S.js.map +1 -0
- package/dist/{chunk-7GXL7U5X.js → chunk-A65X3XYB.js} +4 -3
- package/dist/chunk-A65X3XYB.js.map +1 -0
- package/dist/chunk-AGKLGZSW.js +74 -0
- package/dist/chunk-AGKLGZSW.js.map +1 -0
- package/dist/chunk-AQHYE6EF.js +109 -0
- package/dist/chunk-AQHYE6EF.js.map +1 -0
- package/dist/chunk-AWVTRQZJ.js +117 -0
- package/dist/chunk-AWVTRQZJ.js.map +1 -0
- package/dist/chunk-BDQUFQE7.js +30 -0
- package/dist/chunk-BDQUFQE7.js.map +1 -0
- package/dist/chunk-BJKQSXX4.js +54 -0
- package/dist/chunk-BJKQSXX4.js.map +1 -0
- package/dist/chunk-BKSKRGK7.js +81 -0
- package/dist/chunk-BKSKRGK7.js.map +1 -0
- package/dist/chunk-BVNDNRPW.js +44 -0
- package/dist/chunk-BVNDNRPW.js.map +1 -0
- package/dist/chunk-CN6QNKYV.js +24 -0
- package/dist/chunk-CN6QNKYV.js.map +1 -0
- package/dist/chunk-DD6QBBV2.js +119 -0
- package/dist/chunk-DD6QBBV2.js.map +1 -0
- package/dist/chunk-DHPFIP7P.js +50 -0
- package/dist/chunk-DHPFIP7P.js.map +1 -0
- package/dist/chunk-DRJWJ7KG.js +109 -0
- package/dist/chunk-DRJWJ7KG.js.map +1 -0
- package/dist/chunk-DUJEWU5O.js +72 -0
- package/dist/chunk-DUJEWU5O.js.map +1 -0
- package/dist/chunk-EKQQBSFF.js +79 -0
- package/dist/chunk-EKQQBSFF.js.map +1 -0
- package/dist/{chunk-RXDJPRH5.js → chunk-EM5UHI3U.js} +2 -2
- package/dist/chunk-EM5UHI3U.js.map +1 -0
- package/dist/chunk-ENL5WNFM.js +101 -0
- package/dist/chunk-ENL5WNFM.js.map +1 -0
- package/dist/chunk-EVKFEIM2.js +37 -0
- package/dist/chunk-EVKFEIM2.js.map +1 -0
- package/dist/chunk-EXEJG4IG.js +101 -0
- package/dist/chunk-EXEJG4IG.js.map +1 -0
- package/dist/chunk-FSVKQPMR.js +45 -0
- package/dist/chunk-FSVKQPMR.js.map +1 -0
- package/dist/chunk-GASC427L.js +34 -0
- package/dist/chunk-GASC427L.js.map +1 -0
- package/dist/chunk-GGQ6GQ75.js +24 -0
- package/dist/chunk-GGQ6GQ75.js.map +1 -0
- package/dist/chunk-GHXR4PCK.js +147 -0
- package/dist/chunk-GHXR4PCK.js.map +1 -0
- package/dist/{chunk-WHD5CSTB.js → chunk-HC3SNY5O.js} +5 -5
- package/dist/chunk-HC3SNY5O.js.map +1 -0
- package/dist/chunk-HJ7ICELB.js +76 -0
- package/dist/chunk-HJ7ICELB.js.map +1 -0
- package/dist/chunk-I355QWHH.js +40 -0
- package/dist/chunk-I355QWHH.js.map +1 -0
- package/dist/chunk-I6D5E5ZD.js +34 -0
- package/dist/chunk-I6D5E5ZD.js.map +1 -0
- package/dist/chunk-IBY25I76.js +49 -0
- package/dist/chunk-IBY25I76.js.map +1 -0
- package/dist/chunk-IGOTX5DA.js +19 -0
- package/dist/chunk-IGOTX5DA.js.map +1 -0
- package/dist/{chunk-WHJ4JVO6.js → chunk-JI4UZW6G.js} +2 -2
- package/dist/chunk-JI4UZW6G.js.map +1 -0
- package/dist/chunk-JZNXMBZ6.js +93 -0
- package/dist/chunk-JZNXMBZ6.js.map +1 -0
- package/dist/chunk-LAATHRKX.js +39 -0
- package/dist/chunk-LAATHRKX.js.map +1 -0
- package/dist/{chunk-POUL3ZTV.js → chunk-LL5GBPQN.js} +8 -4
- package/dist/chunk-LL5GBPQN.js.map +1 -0
- package/dist/chunk-ML3IXSZV.js +78 -0
- package/dist/chunk-ML3IXSZV.js.map +1 -0
- package/dist/chunk-MNECWWTU.js +62 -0
- package/dist/chunk-MNECWWTU.js.map +1 -0
- package/dist/chunk-MPYL4ED3.js +171 -0
- package/dist/chunk-MPYL4ED3.js.map +1 -0
- package/dist/chunk-MS7ZK2O6.js +65 -0
- package/dist/chunk-MS7ZK2O6.js.map +1 -0
- package/dist/chunk-MZVQ32JU.js +29 -0
- package/dist/chunk-MZVQ32JU.js.map +1 -0
- package/dist/chunk-NC4IUB2C.js +33 -0
- package/dist/chunk-NC4IUB2C.js.map +1 -0
- package/dist/chunk-NCAHIMIB.js +96 -0
- package/dist/chunk-NCAHIMIB.js.map +1 -0
- package/dist/chunk-NJVKZ5DE.js +114 -0
- package/dist/chunk-NJVKZ5DE.js.map +1 -0
- package/dist/chunk-OGSHLSI2.js +22 -0
- package/dist/chunk-OGSHLSI2.js.map +1 -0
- package/dist/chunk-OIAZH5EU.js +36 -0
- package/dist/chunk-OIAZH5EU.js.map +1 -0
- package/dist/chunk-P22B7HQS.js +45 -0
- package/dist/chunk-P22B7HQS.js.map +1 -0
- package/dist/{chunk-DCKWB3EY.js → chunk-P2CWISVU.js} +2 -2
- package/dist/chunk-P2CWISVU.js.map +1 -0
- package/dist/chunk-P4G5WFHH.js +18 -0
- package/dist/chunk-P4G5WFHH.js.map +1 -0
- package/dist/chunk-QNIIWNSR.js +78 -0
- package/dist/chunk-QNIIWNSR.js.map +1 -0
- package/dist/chunk-R23U2FRV.js +23 -0
- package/dist/chunk-R23U2FRV.js.map +1 -0
- package/dist/chunk-RB6DUG3M.js +9 -0
- package/dist/chunk-RB6DUG3M.js.map +1 -0
- package/dist/chunk-RKG72NSW.js +26 -0
- package/dist/chunk-RKG72NSW.js.map +1 -0
- package/dist/chunk-SAVUGRDZ.js +31 -0
- package/dist/chunk-SAVUGRDZ.js.map +1 -0
- package/dist/chunk-SEMDDFFB.js +37 -0
- package/dist/chunk-SEMDDFFB.js.map +1 -0
- package/dist/{chunk-R7BM6J75.js → chunk-SNTRWOF6.js} +2 -5
- package/dist/chunk-SNTRWOF6.js.map +1 -0
- package/dist/chunk-SOWWBAOB.js +36 -0
- package/dist/chunk-SOWWBAOB.js.map +1 -0
- package/dist/chunk-SYGAPDKX.js +45 -0
- package/dist/chunk-SYGAPDKX.js.map +1 -0
- package/dist/chunk-TBZIUIP2.js +87 -0
- package/dist/chunk-TBZIUIP2.js.map +1 -0
- package/dist/chunk-TD2NGENS.js +43 -0
- package/dist/chunk-TD2NGENS.js.map +1 -0
- package/dist/chunk-TH6WBEEL.js +58 -0
- package/dist/chunk-TH6WBEEL.js.map +1 -0
- package/dist/chunk-TUY3ZMDE.js +42 -0
- package/dist/chunk-TUY3ZMDE.js.map +1 -0
- package/dist/chunk-U4G72DSG.js +67 -0
- package/dist/chunk-U4G72DSG.js.map +1 -0
- package/dist/chunk-UG5TRIRZ.js +42 -0
- package/dist/chunk-UG5TRIRZ.js.map +1 -0
- package/dist/chunk-UOJZEP6N.js +39 -0
- package/dist/chunk-UOJZEP6N.js.map +1 -0
- package/dist/chunk-V5QWZ3LA.js +77 -0
- package/dist/chunk-V5QWZ3LA.js.map +1 -0
- package/dist/chunk-VDKJLIEZ.js +291 -0
- package/dist/chunk-VDKJLIEZ.js.map +1 -0
- package/dist/chunk-W2NESPKL.js +100 -0
- package/dist/chunk-W2NESPKL.js.map +1 -0
- package/dist/{chunk-HHUI32DT.js → chunk-W3RIYQPO.js} +3 -2
- package/dist/chunk-W3RIYQPO.js.map +1 -0
- package/dist/chunk-WO33CSUW.js +52 -0
- package/dist/chunk-WO33CSUW.js.map +1 -0
- package/dist/chunk-WSTHL6H7.js +33 -0
- package/dist/chunk-WSTHL6H7.js.map +1 -0
- package/dist/chunk-WZONN76V.js +55 -0
- package/dist/chunk-WZONN76V.js.map +1 -0
- package/dist/chunk-XGFM7GVN.js +39 -0
- package/dist/chunk-XGFM7GVN.js.map +1 -0
- package/dist/chunk-XSYY67X3.js +142 -0
- package/dist/chunk-XSYY67X3.js.map +1 -0
- package/dist/chunk-YFKM4ZLH.js +111 -0
- package/dist/chunk-YFKM4ZLH.js.map +1 -0
- package/dist/{chunk-OVF2VS3L.js → chunk-YM2TZ5UT.js} +4 -4
- package/dist/{chunk-OVF2VS3L.js.map → chunk-YM2TZ5UT.js.map} +1 -1
- package/dist/chunk-YP766ABA.js +268 -0
- package/dist/chunk-YP766ABA.js.map +1 -0
- package/dist/chunk-YT2PR4LF.js +38 -0
- package/dist/chunk-YT2PR4LF.js.map +1 -0
- package/dist/chunk-ZI4AJKES.js +29 -0
- package/dist/chunk-ZI4AJKES.js.map +1 -0
- package/dist/chunk-ZXVCMTM2.js +57 -0
- package/dist/chunk-ZXVCMTM2.js.map +1 -0
- package/dist/data-display/code-block.d.ts +26 -0
- package/dist/data-display/code-block.js +9 -0
- package/dist/data-display/code-block.js.map +1 -0
- package/dist/data-display/separator.d.ts +11 -0
- package/dist/data-display/separator.js +9 -0
- package/dist/data-display/separator.js.map +1 -0
- package/dist/data-display/stepper.d.ts +27 -0
- package/dist/data-display/stepper.js +8 -0
- package/dist/data-display/stepper.js.map +1 -0
- package/dist/data-display/table.d.ts +43 -0
- package/dist/data-display/table.js +24 -0
- package/dist/data-display/table.js.map +1 -0
- package/dist/data-display/tag.d.ts +27 -0
- package/dist/data-display/tag.js +10 -0
- package/dist/data-display/tag.js.map +1 -0
- package/dist/data-display/timeline.d.ts +24 -0
- package/dist/data-display/timeline.js +10 -0
- package/dist/data-display/timeline.js.map +1 -0
- package/dist/disclosure/accordion.d.ts +18 -0
- package/dist/disclosure/accordion.js +15 -0
- package/dist/disclosure/accordion.js.map +1 -0
- package/dist/disclosure/collapsible.d.ts +14 -0
- package/dist/disclosure/collapsible.js +13 -0
- package/dist/disclosure/collapsible.js.map +1 -0
- package/dist/disclosure/dialog.d.ts +43 -0
- package/dist/disclosure/dialog.js +27 -0
- package/dist/disclosure/dialog.js.map +1 -0
- package/dist/disclosure/hover-card.d.ts +21 -0
- package/dist/disclosure/hover-card.js +13 -0
- package/dist/disclosure/hover-card.js.map +1 -0
- package/dist/dots/dots.d.ts +41 -0
- package/dist/dots/dots.js +8 -0
- package/dist/dots/dots.js.map +1 -0
- package/dist/feedback/alert.d.ts +27 -0
- package/dist/feedback/alert.js +13 -0
- package/dist/feedback/alert.js.map +1 -0
- package/dist/feedback/empty-state.d.ts +28 -0
- package/dist/feedback/empty-state.js +8 -0
- package/dist/feedback/empty-state.js.map +1 -0
- package/dist/feedback/progress.d.ts +19 -0
- package/dist/feedback/progress.js +9 -0
- package/dist/feedback/progress.js.map +1 -0
- package/dist/feedback/skeleton.d.ts +16 -0
- package/dist/feedback/skeleton.js +8 -0
- package/dist/feedback/skeleton.js.map +1 -0
- package/dist/feedback/spinner.d.ts +19 -0
- package/dist/feedback/spinner.js +8 -0
- package/dist/feedback/spinner.js.map +1 -0
- package/dist/feedback/toast.d.ts +35 -0
- package/dist/feedback/toast.js +22 -0
- package/dist/feedback/toast.js.map +1 -0
- package/dist/feedback/tone.d.ts +20 -0
- package/dist/feedback/tone.js +11 -0
- package/dist/feedback/tone.js.map +1 -0
- package/dist/index.d.ts +78 -4
- package/dist/index.js +527 -41
- package/dist/input/chat-composer.d.ts +40 -0
- package/dist/input/chat-composer.js +9 -0
- package/dist/input/chat-composer.js.map +1 -0
- package/dist/input/checkbox.d.ts +15 -0
- package/dist/input/checkbox.js +9 -0
- package/dist/input/checkbox.js.map +1 -0
- package/dist/input/combobox.d.ts +121 -0
- package/dist/input/combobox.js +25 -0
- package/dist/input/combobox.js.map +1 -0
- package/dist/input/field-styles.d.ts +14 -0
- package/dist/input/field-styles.js +9 -0
- package/dist/input/field-styles.js.map +1 -0
- package/dist/input/input.d.ts +6 -11
- package/dist/input/input.js +2 -1
- package/dist/input/kbd.d.ts +11 -0
- package/dist/input/kbd.js +8 -0
- package/dist/input/kbd.js.map +1 -0
- package/dist/input/label.d.ts +10 -4
- package/dist/input/label.js +1 -1
- package/dist/input/radio-group.d.ts +15 -0
- package/dist/input/radio-group.js +11 -0
- package/dist/input/radio-group.js.map +1 -0
- package/dist/input/search-field.d.ts +24 -0
- package/dist/input/search-field.js +11 -0
- package/dist/input/search-field.js.map +1 -0
- package/dist/input/select.d.ts +29 -0
- package/dist/input/select.js +25 -0
- package/dist/input/select.js.map +1 -0
- package/dist/input/slider.d.ts +19 -0
- package/dist/input/slider.js +9 -0
- package/dist/input/slider.js.map +1 -0
- package/dist/input/switch.d.ts +15 -0
- package/dist/input/switch.js +9 -0
- package/dist/input/switch.js.map +1 -0
- package/dist/input/textarea.d.ts +1 -5
- package/dist/input/textarea.js +2 -1
- package/dist/logo/cairn-mark.d.ts +24 -0
- package/dist/logo/cairn-mark.js +8 -0
- package/dist/logo/cairn-mark.js.map +1 -0
- package/dist/marketing/carousel-dots.d.ts +22 -0
- package/dist/marketing/carousel-dots.js +8 -0
- package/dist/marketing/carousel-dots.js.map +1 -0
- package/dist/marketing/cta-band.d.ts +24 -0
- package/dist/marketing/cta-band.js +9 -0
- package/dist/marketing/cta-band.js.map +1 -0
- package/dist/marketing/feature-grid.d.ts +30 -0
- package/dist/marketing/feature-grid.js +10 -0
- package/dist/marketing/feature-grid.js.map +1 -0
- package/dist/marketing/footer.d.ts +33 -0
- package/dist/marketing/footer.js +18 -0
- package/dist/marketing/footer.js.map +1 -0
- package/dist/marketing/hero-badge.d.ts +19 -0
- package/dist/marketing/hero-badge.js +8 -0
- package/dist/marketing/hero-badge.js.map +1 -0
- package/dist/marketing/logo-strip.d.ts +28 -0
- package/dist/marketing/logo-strip.js +8 -0
- package/dist/marketing/logo-strip.js.map +1 -0
- package/dist/marketing/pricing-card.d.ts +37 -0
- package/dist/marketing/pricing-card.js +10 -0
- package/dist/marketing/pricing-card.js.map +1 -0
- package/dist/marketing/section-header.d.ts +23 -0
- package/dist/marketing/section-header.js +8 -0
- package/dist/marketing/section-header.js.map +1 -0
- package/dist/navigation/anchor-rail.d.ts +27 -0
- package/dist/navigation/anchor-rail.js +9 -0
- package/dist/navigation/anchor-rail.js.map +1 -0
- package/dist/navigation/breadcrumb.d.ts +33 -0
- package/dist/navigation/breadcrumb.js +20 -0
- package/dist/navigation/breadcrumb.js.map +1 -0
- package/dist/navigation/nav-bar.d.ts +47 -0
- package/dist/navigation/nav-bar.js +21 -0
- package/dist/navigation/nav-bar.js.map +1 -0
- package/dist/navigation/navigation-menu.d.ts +23 -0
- package/dist/navigation/navigation-menu.js +25 -0
- package/dist/navigation/navigation-menu.js.map +1 -0
- package/dist/navigation/pagination.d.ts +31 -0
- package/dist/navigation/pagination.js +20 -0
- package/dist/navigation/pagination.js.map +1 -0
- package/dist/navigation/side-nav.d.ts +31 -0
- package/dist/navigation/side-nav.js +13 -0
- package/dist/navigation/side-nav.js.map +1 -0
- package/dist/overlay/alert-dialog.d.ts +3 -3
- package/dist/overlay/alert-dialog.js +1 -1
- package/dist/overlay/popover.d.ts +3 -4
- package/dist/overlay/popover.js +1 -1
- package/dist/overlay/sheet.d.ts +4 -4
- package/dist/overlay/sheet.js +1 -1
- package/dist/overlay/tooltip.d.ts +1 -1
- package/dist/overlay/tooltip.js +1 -1
- package/dist/tabs/tabs.d.ts +1 -1
- package/dist/tabs/tabs.js +1 -1
- package/dist/tabs/toggle-group.js +1 -1
- package/package.json +17 -7
- package/dist/chunk-7GXL7U5X.js.map +0 -1
- package/dist/chunk-BWYWI4BC.js +0 -43
- package/dist/chunk-BWYWI4BC.js.map +0 -1
- package/dist/chunk-BYZCFI7X.js +0 -32
- package/dist/chunk-BYZCFI7X.js.map +0 -1
- package/dist/chunk-CZ3JB37A.js +0 -72
- package/dist/chunk-CZ3JB37A.js.map +0 -1
- package/dist/chunk-DCKWB3EY.js.map +0 -1
- package/dist/chunk-G2XJK244.js +0 -96
- package/dist/chunk-G2XJK244.js.map +0 -1
- package/dist/chunk-GNHNTI5A.js +0 -30
- package/dist/chunk-GNHNTI5A.js.map +0 -1
- package/dist/chunk-HHUI32DT.js.map +0 -1
- package/dist/chunk-OWIUMX76.js +0 -91
- package/dist/chunk-OWIUMX76.js.map +0 -1
- package/dist/chunk-POUL3ZTV.js.map +0 -1
- package/dist/chunk-R7BM6J75.js.map +0 -1
- package/dist/chunk-RXDJPRH5.js.map +0 -1
- package/dist/chunk-S4HVXD6Z.js +0 -92
- package/dist/chunk-S4HVXD6Z.js.map +0 -1
- package/dist/chunk-ULEDFFUJ.js.map +0 -1
- package/dist/chunk-WHD5CSTB.js.map +0 -1
- package/dist/chunk-WHJ4JVO6.js.map +0 -1
- package/dist/chunk-XGYKA3GE.js +0 -30
- package/dist/chunk-XGYKA3GE.js.map +0 -1
- package/dist/chunk-YX6MSLUB.js +0 -98
- package/dist/chunk-YX6MSLUB.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dots/dots.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Dots: SV's signature motif. Two rules, never broken:\n * 1. The dots always form a complete grid. Every cell holds a dot; no dot is removed.\n * 2. The dots never draw a shape (no silhouette, relief, letter or dissolving edge).\n * Variation lives in tone only: `fade` runs the four-step flare (or ink to muted) across the\n * grid along one axis, `animate` moves a wave of opacity through it, and `signal` lets one\n * single dot take the orange accent. Decorative only (aria-hidden), never behind text, never\n * carrying meaning.\n */\n\ntype Tone = 'flare' | 'ink' | 'muted';\ntype Fade = 'none' | 'left' | 'right' | 'up' | 'down';\ntype Animate = 'none' | 'lane' | 'pulse' | 'flag';\n\nexport interface DotsProps extends React.SVGAttributes<SVGSVGElement> {\n /** Columns of the grid. */\n cols?: number;\n /** Rows of the grid. */\n rows?: number;\n /** Distance between dot centres, in px. */\n pitch?: number;\n /** Dot diameter as a share of the pitch (0 to 1). */\n size?: number;\n /** `flare` runs the four-step flare ramp along the fade axis; `ink` and `muted` are flat\n * neutrals (with a fade, ink runs to muted). */\n tone?: Tone;\n /** Edge the tone fades toward (flare step 1 at the opposite edge, step 4 at this one). The\n * grid stays complete: a fade changes colour, never removes a dot. */\n fade?: Fade;\n /** `lane` is a travelling opacity wave, `pulse` a slow breath, `flag` a tone wave rippling\n * across the whole grid like cloth in the wind (the fill runs through the flare steps). Off\n * under reduced motion. */\n animate?: Animate;\n /** Changes the `pulse` timing pattern. */\n seed?: number;\n /** One dot, `[column, row]`, takes the orange accent. Never more than one. */\n signal?: [number, number];\n}\n\nfunction hash(i: number, seed: number) {\n let x = (i + 1) * 374761393 + seed * 668265263;\n x = (x ^ (x >>> 13)) * 1274126177;\n return ((x ^ (x >>> 16)) >>> 0) / 4294967295;\n}\n\nconst FLARE = [1, 2, 3, 4].map((n) => `var(--sv-sys-color-flare-${n})`);\nconst INK = 'var(--sv-sys-color-on-surface)';\nconst MUTED = 'var(--sv-sys-color-outline-strong)';\n\nexport const Dots = React.forwardRef<SVGSVGElement, DotsProps>(\n (\n { cols = 24, rows = 8, pitch = 12, size = 0.5, tone = 'flare', fade = 'right', animate = 'none', seed = 1, signal, className, ...props },\n ref\n ) => {\n const r = (pitch * Math.min(Math.max(size, 0.05), 1)) / 2;\n const dots: React.ReactNode[] = [];\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n const u = cols > 1 ? x / (cols - 1) : 0;\n const v = rows > 1 ? y / (rows - 1) : 0;\n // t = position along the fade axis: 0 at the solid edge, 1 at the faded edge.\n const t = fade === 'left' ? 1 - u : fade === 'right' ? u : fade === 'up' ? 1 - v : fade === 'down' ? v : 0;\n const step = Math.min(3, Math.floor(t * 4));\n const isSignal = !!signal && signal[0] === x && signal[1] === y;\n const fill = isSignal\n ? 'var(--sv-sys-color-accent)'\n : tone === 'flare' ? FLARE[fade === 'none' ? 0 : step]\n : tone === 'ink' ? (fade !== 'none' && t > 0.5 ? MUTED : INK)\n : MUTED;\n // flag: the phase advances along x and bends with a sine of y, so the wavefronts curve\n // like a flag; negative delays start the wave mid-flight, no blank first frame.\n const delay = animate === 'lane' ? `${((x + y) % 12) * 0.12}s`\n : animate === 'pulse' ? `${(hash(x * 31 + y, seed) * 1.6).toFixed(2)}s`\n : animate === 'flag' ? `calc(var(--sv-dot-flag-period) * ${(-(u * 1.5 + Math.sin(v * Math.PI * 1.5) * 0.35)).toFixed(3)})`\n : undefined;\n dots.push(\n <circle\n key={`${x}-${y}`}\n cx={x * pitch + pitch / 2}\n cy={y * pitch + pitch / 2}\n r={r}\n style={{ fill, animationDelay: delay }}\n className={animate === 'lane' ? 'animate-sv-dot-lane motion-reduce:animate-none' : animate === 'pulse' ? 'animate-sv-blink motion-reduce:animate-none' : animate === 'flag' ? 'sv-dot-flag' : undefined}\n />\n );\n }\n }\n return (\n <svg\n ref={ref}\n aria-hidden\n focusable=\"false\"\n viewBox={`0 0 ${cols * pitch} ${rows * pitch}`}\n width={cols * pitch}\n height={rows * pitch}\n className={cn('block max-w-full h-auto', className)}\n {...props}\n >\n {dots}\n </svg>\n );\n }\n);\nDots.displayName = 'Dots';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AA+Eb;AArCV,SAAS,KAAK,GAAW,MAAc;AACrC,MAAI,KAAK,IAAI,KAAK,YAAY,OAAO;AACrC,OAAK,IAAK,MAAM,MAAO;AACvB,WAAS,IAAK,MAAM,QAAS,KAAK;AACpC;AAEA,IAAM,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,4BAA4B,CAAC,GAAG;AACtE,IAAM,MAAM;AACZ,IAAM,QAAQ;AAEP,IAAM,OAAa;AAAA,EACxB,CACE,EAAE,OAAO,IAAI,OAAO,GAAG,QAAQ,IAAI,OAAO,KAAK,OAAO,SAAS,OAAO,SAAS,UAAU,QAAQ,OAAO,GAAG,QAAQ,WAAW,GAAG,MAAM,GACvI,QACG;AACH,UAAM,IAAK,QAAQ,KAAK,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,CAAC,IAAK;AACxD,UAAM,OAA0B,CAAC;AACjC,aAAS,IAAI,GAAG,IAAI,MAAM,KAAK;AAC7B,eAAS,IAAI,GAAG,IAAI,MAAM,KAAK;AAC7B,cAAM,IAAI,OAAO,IAAI,KAAK,OAAO,KAAK;AACtC,cAAM,IAAI,OAAO,IAAI,KAAK,OAAO,KAAK;AAEtC,cAAM,IAAI,SAAS,SAAS,IAAI,IAAI,SAAS,UAAU,IAAI,SAAS,OAAO,IAAI,IAAI,SAAS,SAAS,IAAI;AACzG,cAAM,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC;AAC1C,cAAM,WAAW,CAAC,CAAC,UAAU,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;AAC9D,cAAM,OAAO,WACT,+BACA,SAAS,UAAU,MAAM,SAAS,SAAS,IAAI,IAAI,IACnD,SAAS,QAAS,SAAS,UAAU,IAAI,MAAM,QAAQ,MACvD;AAGJ,cAAM,QAAQ,YAAY,SAAS,IAAK,IAAI,KAAK,KAAM,IAAI,MACvD,YAAY,UAAU,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,MAClE,YAAY,SAAS,qCAAqC,EAAE,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,OAAO,QAAQ,CAAC,CAAC,MACrH;AACJ,aAAK;AAAA,UACH;AAAA,YAAC;AAAA;AAAA,cAEC,IAAI,IAAI,QAAQ,QAAQ;AAAA,cACxB,IAAI,IAAI,QAAQ,QAAQ;AAAA,cACxB;AAAA,cACA,OAAO,EAAE,MAAM,gBAAgB,MAAM;AAAA,cACrC,WAAW,YAAY,SAAS,mDAAmD,YAAY,UAAU,gDAAgD,YAAY,SAAS,gBAAgB;AAAA;AAAA,YALzL,GAAG,CAAC,IAAI,CAAC;AAAA,UAMhB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW;AAAA,QACX,WAAU;AAAA,QACV,SAAS,OAAO,OAAO,KAAK,IAAI,OAAO,KAAK;AAAA,QAC5C,OAAO,OAAO;AAAA,QACd,QAAQ,OAAO;AAAA,QACf,WAAW,GAAG,2BAA2B,SAAS;AAAA,QACjD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,KAAK,cAAc;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/marketing/section-header.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var SectionHeader = React.forwardRef(
|
|
9
|
+
({ className, eyebrow, title, lede, actions, as: Heading = "h2", size = "lg", align = "start", ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
10
|
+
"header",
|
|
11
|
+
{
|
|
12
|
+
ref,
|
|
13
|
+
className: cn("flex flex-col gap-gap-md", align === "center" ? "items-center text-center" : "items-start text-left", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [
|
|
16
|
+
eyebrow ? /* @__PURE__ */ jsx("p", { className: "sv-eyebrow text-on-surface-variant", children: eyebrow }) : null,
|
|
17
|
+
/* @__PURE__ */ jsx(Heading, { className: cn("text-on-surface", size === "lg" ? "sv-display-md" : "sv-headline-lg"), children: title }),
|
|
18
|
+
lede ? /* @__PURE__ */ jsx("p", { className: "max-w-measure sv-body-lg text-on-surface-variant", children: lede }) : null,
|
|
19
|
+
actions ? /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap items-center gap-gap-sm", children: actions }) : null
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
SectionHeader.displayName = "SectionHeader";
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
SectionHeader
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-MZVQ32JU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marketing/section-header.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn SectionHeader. The opening of a page section in this order: an eyebrow (the one\n * uppercase role), a headline, a lede in the variant tone, and an optional row of actions. Every\n * part is a slot; the words are the consumer's.\n *\n * `size=\"lg\"` sets the headline in `display-md` (56px), `md` in `headline-lg`.\n * The heading level is `as` (`h2` by default) so the outline stays correct whatever the size.\n * The lede is held to the reading measure.\n */\nexport interface SectionHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n eyebrow?: React.ReactNode;\n title: React.ReactNode;\n lede?: React.ReactNode;\n actions?: React.ReactNode;\n as?: 'h1' | 'h2' | 'h3';\n size?: 'md' | 'lg';\n align?: 'start' | 'center';\n}\n\nexport const SectionHeader = React.forwardRef<HTMLElement, SectionHeaderProps>(\n ({ className, eyebrow, title, lede, actions, as: Heading = 'h2', size = 'lg', align = 'start', ...props }, ref) => (\n <header\n ref={ref}\n className={cn('flex flex-col gap-gap-md', align === 'center' ? 'items-center text-center' : 'items-start text-left', className)}\n {...props}\n >\n {eyebrow ? <p className=\"sv-eyebrow text-on-surface-variant\">{eyebrow}</p> : null}\n <Heading className={cn('text-on-surface', size === 'lg' ? 'sv-display-md' : 'sv-headline-lg')}>{title}</Heading>\n {lede ? <p className=\"max-w-measure sv-body-lg text-on-surface-variant\">{lede}</p> : null}\n {actions ? <div className=\"mt-2 flex flex-wrap items-center gap-gap-sm\">{actions}</div> : null}\n </header>\n )\n);\nSectionHeader.displayName = 'SectionHeader';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAwBnB,SAKa,KALb;AAFG,IAAM,gBAAsB;AAAA,EACjC,CAAC,EAAE,WAAW,SAAS,OAAO,MAAM,SAAS,IAAI,UAAU,MAAM,OAAO,MAAM,QAAQ,SAAS,GAAG,MAAM,GAAG,QACzG;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,4BAA4B,UAAU,WAAW,6BAA6B,yBAAyB,SAAS;AAAA,MAC7H,GAAG;AAAA,MAEH;AAAA,kBAAU,oBAAC,OAAE,WAAU,sCAAsC,mBAAQ,IAAO;AAAA,QAC7E,oBAAC,WAAQ,WAAW,GAAG,mBAAmB,SAAS,OAAO,kBAAkB,gBAAgB,GAAI,iBAAM;AAAA,QACrG,OAAO,oBAAC,OAAE,WAAU,oDAAoD,gBAAK,IAAO;AAAA,QACpF,UAAU,oBAAC,SAAI,WAAU,+CAA+C,mBAAQ,IAAS;AAAA;AAAA;AAAA,EAC5F;AAEJ;AACA,cAAc,cAAc;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/marketing/hero-badge.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
+
import { ArrowRight } from "@phosphor-icons/react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var HeroBadge = React.forwardRef(({ className, icon, asChild, children, ...props }, ref) => {
|
|
11
|
+
const cls = cn(
|
|
12
|
+
"group/badge inline-flex items-center gap-3 border border-outline bg-surface p-1 pr-4 sv-label-sm text-on-surface",
|
|
13
|
+
"transition-[gap,background-color] duration-(--sv-sys-motion-duration-fast) ease-standard hover:gap-5 hover:bg-surface-subtle motion-reduce:transition-none",
|
|
14
|
+
"outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
15
|
+
className
|
|
16
|
+
);
|
|
17
|
+
const body = (label) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
icon ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "inline-flex size-9 shrink-0 items-center justify-center bg-inverse-surface text-on-inverse-surface", children: icon }) : null,
|
|
19
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
20
|
+
/* @__PURE__ */ jsx(ArrowRight, { size: 16, "aria-hidden": true, className: "shrink-0" })
|
|
21
|
+
] });
|
|
22
|
+
if (asChild && React.isValidElement(children)) {
|
|
23
|
+
const child = children;
|
|
24
|
+
return /* @__PURE__ */ jsx(Slot, { ref, className: cls, ...props, children: React.cloneElement(child, void 0, body(child.props.children)) });
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx("span", { ref, className: cls, ...props, children: body(children) });
|
|
27
|
+
});
|
|
28
|
+
HeroBadge.displayName = "HeroBadge";
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
HeroBadge
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=chunk-NC4IUB2C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marketing/hero-badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { ArrowRight } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn HeroBadge, an announcement pill above a hero headline (22/11/2026): a\n * 4px-inset box on one hairline holding a 36px ink tile with a glyph, the consumer's line, and\n * an arrow. On hover the gap opens from 12px to 20px and the fill steps to paper 100, both on\n * the fast motion token: the badge leans toward its link. Square, as everything is.\n *\n * Render it as a link (`asChild` with an `<a>`): it is a way in, not a label. The glyph and\n * the arrow are decorative; the words name the destination.\n */\nexport interface HeroBadgeProps extends React.HTMLAttributes<HTMLElement> {\n /** A Phosphor glyph element for the ink tile. */\n icon?: React.ReactNode;\n asChild?: boolean;\n}\n\nexport const HeroBadge = React.forwardRef<HTMLElement, HeroBadgeProps>(({ className, icon, asChild, children, ...props }, ref) => {\n const cls = cn(\n 'group/badge inline-flex items-center gap-3 border border-outline bg-surface p-1 pr-4 sv-label-sm text-on-surface',\n 'transition-[gap,background-color] duration-(--sv-sys-motion-duration-fast) ease-standard hover:gap-5 hover:bg-surface-subtle motion-reduce:transition-none',\n 'outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',\n className\n );\n const body = (label: React.ReactNode) => (\n <>\n {icon ? (\n <span aria-hidden className=\"inline-flex size-9 shrink-0 items-center justify-center bg-inverse-surface text-on-inverse-surface\">\n {icon}\n </span>\n ) : null}\n <span>{label}</span>\n <ArrowRight size={16} aria-hidden className=\"shrink-0\" />\n </>\n );\n if (asChild && React.isValidElement(children)) {\n const child = children as React.ReactElement<{ children?: React.ReactNode }>;\n return (\n <Slot ref={ref} className={cls} {...props}>\n {React.cloneElement(child, undefined, body(child.props.children))}\n </Slot>\n );\n }\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={cls} {...props}>\n {body(children)}\n </span>\n );\n});\nHeroBadge.displayName = 'HeroBadge';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AA0BvB,mBAEI,KAFJ;AARG,IAAM,YAAkB,iBAAwC,CAAC,EAAE,WAAW,MAAM,SAAS,UAAU,GAAG,MAAM,GAAG,QAAQ;AAChI,QAAM,MAAM;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,OAAO,CAAC,UACZ,iCACG;AAAA,WACC,oBAAC,UAAK,eAAW,MAAC,WAAU,sGACzB,gBACH,IACE;AAAA,IACJ,oBAAC,UAAM,iBAAM;AAAA,IACb,oBAAC,cAAW,MAAM,IAAI,eAAW,MAAC,WAAU,YAAW;AAAA,KACzD;AAEF,MAAI,WAAiB,qBAAe,QAAQ,GAAG;AAC7C,UAAM,QAAQ;AACd,WACE,oBAAC,QAAK,KAAU,WAAW,KAAM,GAAG,OACjC,UAAM,mBAAa,OAAO,QAAW,KAAK,MAAM,MAAM,QAAQ,CAAC,GAClE;AAAA,EAEJ;AACA,SACE,oBAAC,UAAK,KAAwC,WAAW,KAAM,GAAG,OAC/D,eAAK,QAAQ,GAChB;AAEJ,CAAC;AACD,UAAU,cAAc;","names":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
FIELD,
|
|
5
|
+
FIELD_BOX
|
|
6
|
+
} from "./chunk-RB6DUG3M.js";
|
|
7
|
+
import {
|
|
8
|
+
MENU_CONTENT,
|
|
9
|
+
MENU_INDICATOR,
|
|
10
|
+
MENU_INSET,
|
|
11
|
+
MENU_ITEM,
|
|
12
|
+
MENU_LABEL,
|
|
13
|
+
MENU_SEPARATOR
|
|
14
|
+
} from "./chunk-R23U2FRV.js";
|
|
15
|
+
import {
|
|
16
|
+
cn
|
|
17
|
+
} from "./chunk-DXRY7AS4.js";
|
|
18
|
+
|
|
19
|
+
// src/input/select.tsx
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
22
|
+
import { CaretDown, CaretUp, Check } from "@phosphor-icons/react";
|
|
23
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
var Select = SelectPrimitive.Root;
|
|
25
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
26
|
+
var SelectValue = SelectPrimitive.Value;
|
|
27
|
+
var SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
28
|
+
SelectPrimitive.Trigger,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
className: cn(
|
|
32
|
+
FIELD,
|
|
33
|
+
FIELD_BOX,
|
|
34
|
+
"group/select flex items-center justify-between gap-gap-sm text-left data-[state=open]:border-outline-strong data-[placeholder]:text-on-surface-variant [&>span]:truncate",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
children,
|
|
40
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
41
|
+
CaretDown,
|
|
42
|
+
{
|
|
43
|
+
size: 16,
|
|
44
|
+
"aria-hidden": true,
|
|
45
|
+
className: "shrink-0 text-on-surface transition-transform duration-(--sv-sys-motion-duration-base) ease-standard group-data-[state=open]/select:rotate-180 motion-reduce:transition-none"
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
));
|
|
51
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
52
|
+
var SCROLL = "flex h-8 cursor-default items-center justify-center bg-surface text-on-surface-variant";
|
|
53
|
+
var SelectContent = React.forwardRef(
|
|
54
|
+
({ className, children, position = "popper", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsxs(
|
|
55
|
+
SelectPrimitive.Content,
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
position,
|
|
59
|
+
sideOffset,
|
|
60
|
+
className: cn(
|
|
61
|
+
MENU_CONTENT,
|
|
62
|
+
"relative max-h-(--radix-select-content-available-height) overflow-hidden",
|
|
63
|
+
position === "popper" && "w-full min-w-(--radix-select-trigger-width)",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, { className: SCROLL, children: /* @__PURE__ */ jsx(CaretUp, { size: 16, "aria-hidden": true }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "[&>:first-child]:border-t-0 [&>[role=group]:first-child>:first-child]:border-t-0", children }),
|
|
70
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, { className: SCROLL, children: /* @__PURE__ */ jsx(CaretDown, { size: 16, "aria-hidden": true }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
);
|
|
75
|
+
SelectContent.displayName = "SelectContent";
|
|
76
|
+
var SelectLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, { ref, className: cn(MENU_LABEL, MENU_INSET, className), ...props }));
|
|
77
|
+
SelectLabel.displayName = "SelectLabel";
|
|
78
|
+
var SelectItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, { ref, className: cn(MENU_ITEM, MENU_INSET, "w-full", className), ...props, children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: MENU_INDICATOR, children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 16, weight: "bold", "aria-hidden": true }) }) }),
|
|
80
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
81
|
+
] }));
|
|
82
|
+
SelectItem.displayName = "SelectItem";
|
|
83
|
+
var SelectSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, { ref, className: cn(MENU_SEPARATOR, className), ...props }));
|
|
84
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
Select,
|
|
88
|
+
SelectGroup,
|
|
89
|
+
SelectValue,
|
|
90
|
+
SelectTrigger,
|
|
91
|
+
SelectContent,
|
|
92
|
+
SelectLabel,
|
|
93
|
+
SelectItem,
|
|
94
|
+
SelectSeparator
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=chunk-NCAHIMIB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/input/select.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { CaretDown, CaretUp, Check } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\nimport { FIELD, FIELD_BOX } from './field-styles';\nimport { MENU_CONTENT, MENU_ITEM, MENU_INSET, MENU_INDICATOR, MENU_LABEL, MENU_SEPARATOR } from '../actions/menu-styles';\n\n/**\n * Cairn Select, on Radix Select: a `combobox` trigger with a `listbox` of options, arrow keys,\n * typeahead, Home and End, the selected option focused on open, a hidden native select inside a\n * form. Nothing of it is hand-rolled.\n *\n * The trigger is a field (`field-styles.ts`, 58px, hairline, square) so a select sits in a form\n * row with inputs without a seam; the caret turns on open. The list is the menu panel\n * (`menu-styles.ts`): square paper, one hairline, the light nav shadow, flush 57px rows, and\n * it opens instantly under the trigger, at the trigger's width.\n *\n * The placeholder is the consumer's text (`<SelectValue placeholder>`), never baked in.\n */\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectGroup = SelectPrimitive.Group;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n FIELD,\n FIELD_BOX,\n 'group/select flex items-center justify-between gap-gap-sm text-left data-[state=open]:border-outline-strong data-[placeholder]:text-on-surface-variant [&>span]:truncate',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretDown\n size={16}\n aria-hidden\n className=\"shrink-0 text-on-surface transition-transform duration-(--sv-sys-motion-duration-base) ease-standard group-data-[state=open]/select:rotate-180 motion-reduce:transition-none\"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst SCROLL = 'flex h-8 cursor-default items-center justify-center bg-surface text-on-surface-variant';\n\nexport interface SelectContentProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n /** Where the portal mounts. Defaults to `document.body`. See `PopoverContent`. */\n container?: HTMLElement | null;\n}\n\nexport const SelectContent = React.forwardRef<React.ComponentRef<typeof SelectPrimitive.Content>, SelectContentProps>(\n ({ className, children, position = 'popper', sideOffset = 4, container, ...props }, ref) => (\n <SelectPrimitive.Portal container={container ?? undefined}>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n className={cn(\n MENU_CONTENT,\n 'relative max-h-(--radix-select-content-available-height) overflow-hidden',\n position === 'popper' && 'w-full min-w-(--radix-select-trigger-width)',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ScrollUpButton className={SCROLL}>\n <CaretUp size={16} aria-hidden />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport className=\"[&>:first-child]:border-t-0 [&>[role=group]:first-child>:first-child]:border-t-0\">\n {children}\n </SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className={SCROLL}>\n <CaretDown size={16} aria-hidden />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n);\nSelectContent.displayName = 'SelectContent';\n\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label ref={ref} className={cn(MENU_LABEL, MENU_INSET, className)} {...props} />\n));\nSelectLabel.displayName = 'SelectLabel';\n\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item ref={ref} className={cn(MENU_ITEM, MENU_INSET, 'w-full', className)} {...props}>\n <span className={MENU_INDICATOR}>\n <SelectPrimitive.ItemIndicator>\n <Check size={16} weight=\"bold\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator ref={ref} className={cn(MENU_SEPARATOR, className)} {...props} />\n));\nSelectSeparator.displayName = 'SelectSeparator';\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAAW,SAAS,aAAa;AA0BxC,SAYI,KAZJ;AARK,IAAM,SAAyB;AAC/B,IAAM,cAA8B;AACpC,IAAM,cAA8B;AAEpC,IAAM,gBAAsB,iBAGjC,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEH;AAAA;AAAA,MACD,oBAAiB,sBAAhB,EAAqB,SAAO,MAC3B;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,eAAW;AAAA,UACX,WAAU;AAAA;AAAA,MACZ,GACF;AAAA;AAAA;AACF,CACD;AACD,cAAc,cAAc;AAE5B,IAAM,SAAS;AAOR,IAAM,gBAAsB;AAAA,EACjC,CAAC,EAAE,WAAW,UAAU,WAAW,UAAU,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,QAClF,oBAAiB,wBAAhB,EAAuB,WAAW,aAAa,QAC9C;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA,aAAa,YAAY;AAAA,QACzB;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAiB,gCAAhB,EAA+B,WAAW,QACzC,8BAAC,WAAQ,MAAM,IAAI,eAAW,MAAC,GACjC;AAAA,QACA,oBAAiB,0BAAhB,EAAyB,WAAU,oFACjC,UACH;AAAA,QACA,oBAAiB,kCAAhB,EAAiC,WAAW,QAC3C,8BAAC,aAAU,MAAM,IAAI,eAAW,MAAC,GACnC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AACA,cAAc,cAAc;AAErB,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAiB,uBAAhB,EAAsB,KAAU,WAAW,GAAG,YAAY,YAAY,SAAS,GAAI,GAAG,OAAO,CAC/F;AACD,YAAY,cAAc;AAEnB,IAAM,aAAmB,iBAG9B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAiB,sBAAhB,EAAqB,KAAU,WAAW,GAAG,WAAW,YAAY,UAAU,SAAS,GAAI,GAAG,OAC7F;AAAA,sBAAC,UAAK,WAAW,gBACf,8BAAiB,+BAAhB,EACC,8BAAC,SAAM,MAAM,IAAI,QAAO,QAAO,eAAW,MAAC,GAC7C,GACF;AAAA,EACA,oBAAiB,0BAAhB,EAA0B,UAAS;AAAA,GACtC,CACD;AACD,WAAW,cAAc;AAElB,IAAM,kBAAwB,iBAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAiB,2BAAhB,EAA0B,KAAU,WAAW,GAAG,gBAAgB,SAAS,GAAI,GAAG,OAAO,CAC3F;AACD,gBAAgB,cAAc;","names":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
cn
|
|
5
|
+
} from "./chunk-DXRY7AS4.js";
|
|
6
|
+
|
|
7
|
+
// src/input/chat-composer.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { ArrowUp } from "@phosphor-icons/react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var ChatComposer = React.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
sendLabel,
|
|
14
|
+
onSubmit,
|
|
15
|
+
value,
|
|
16
|
+
defaultValue = "",
|
|
17
|
+
onValueChange,
|
|
18
|
+
busy = false,
|
|
19
|
+
leading,
|
|
20
|
+
trailing,
|
|
21
|
+
maxHeight = 240,
|
|
22
|
+
clearOnSubmit = true,
|
|
23
|
+
disabled,
|
|
24
|
+
className,
|
|
25
|
+
boxClassName,
|
|
26
|
+
onKeyDown,
|
|
27
|
+
...props
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const inner = React.useRef(null);
|
|
30
|
+
React.useImperativeHandle(ref, () => inner.current);
|
|
31
|
+
const [own, setOwn] = React.useState(defaultValue);
|
|
32
|
+
const text = value ?? own;
|
|
33
|
+
const canSend = !busy && !disabled && text.trim().length > 0;
|
|
34
|
+
const setText = (next) => {
|
|
35
|
+
if (value === void 0) setOwn(next);
|
|
36
|
+
onValueChange?.(next);
|
|
37
|
+
};
|
|
38
|
+
React.useLayoutEffect(() => {
|
|
39
|
+
const el = inner.current;
|
|
40
|
+
if (!el) return;
|
|
41
|
+
el.style.height = "auto";
|
|
42
|
+
el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;
|
|
43
|
+
el.style.overflowY = el.scrollHeight > maxHeight ? "auto" : "hidden";
|
|
44
|
+
}, [text, maxHeight]);
|
|
45
|
+
const submit = () => {
|
|
46
|
+
if (!canSend) return;
|
|
47
|
+
onSubmit(text.trim());
|
|
48
|
+
if (clearOnSubmit) setText("");
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
"form",
|
|
52
|
+
{
|
|
53
|
+
onSubmit: (e) => {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
submit();
|
|
56
|
+
},
|
|
57
|
+
className: cn(
|
|
58
|
+
"flex items-end gap-3 border border-outline bg-surface p-3 text-on-surface shadow-overlay",
|
|
59
|
+
"transition-colors duration-(--sv-sys-motion-duration-fast) ease-standard focus-within:border-outline-strong",
|
|
60
|
+
"has-[textarea:focus-visible]:outline-solid has-[textarea:focus-visible]:outline-2 has-[textarea:focus-visible]:outline-offset-2 has-[textarea:focus-visible]:outline-focus",
|
|
61
|
+
disabled && "opacity-40",
|
|
62
|
+
boxClassName
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
leading ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-gap-xs", children: leading }) : null,
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"textarea",
|
|
68
|
+
{
|
|
69
|
+
ref: inner,
|
|
70
|
+
rows: 1,
|
|
71
|
+
value: text,
|
|
72
|
+
disabled,
|
|
73
|
+
onChange: (e) => setText(e.target.value),
|
|
74
|
+
onKeyDown: (e) => {
|
|
75
|
+
onKeyDown?.(e);
|
|
76
|
+
if (e.defaultPrevented) return;
|
|
77
|
+
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
submit();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
className: cn(
|
|
83
|
+
"min-h-8 min-w-0 flex-1 resize-none self-center bg-transparent py-1 sv-body-md text-on-surface outline-hidden placeholder:text-on-surface-variant disabled:cursor-not-allowed",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
trailing ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-gap-xs", children: trailing }) : null,
|
|
90
|
+
/* @__PURE__ */ jsx(
|
|
91
|
+
"button",
|
|
92
|
+
{
|
|
93
|
+
type: "submit",
|
|
94
|
+
"aria-label": sendLabel,
|
|
95
|
+
disabled: !canSend,
|
|
96
|
+
className: cn(
|
|
97
|
+
"inline-flex size-8 shrink-0 items-center justify-center bg-primary text-on-primary transition-colors duration-(--sv-sys-motion-duration-fast) ease-standard hover:bg-primary-hover active:bg-primary-active",
|
|
98
|
+
"outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
99
|
+
"disabled:bg-ghost-hover disabled:text-on-surface-variant"
|
|
100
|
+
),
|
|
101
|
+
children: /* @__PURE__ */ jsx(ArrowUp, { size: 16, weight: "bold", "aria-hidden": true })
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
ChatComposer.displayName = "ChatComposer";
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
ChatComposer
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=chunk-NJVKZ5DE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/input/chat-composer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ArrowUp } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn ChatComposer (22/11/2026): one\n * hairline box on the paper surface lifted by the `overlay` elevation, 12px inset and 12px gap,\n * a textarea that grows with its text, and a 32px square send button in ink.\n *\n * Enter sends, Shift+Enter breaks the line, and nothing fires while an input method is\n * composing (Japanese, Chinese, Korean). The send button is disabled while the text is blank or\n * `busy` is set, and its name is `sendLabel`, required because the button shows a glyph only.\n * No word is baked in: the placeholder and the send label are the consumer's.\n *\n * `leading` and `trailing` take extra controls (attach, model picker, dictation) as\n * `IconButton size=\"sm\"`, which matches the send button's 32px.\n */\nexport interface ChatComposerProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onSubmit' | 'value' | 'defaultValue' | 'onChange'> {\n /** Accessible name of the send button. Required. */\n sendLabel: string;\n /** Called with the trimmed text on Enter or on the send button. */\n onSubmit: (value: string) => void;\n /** Controlled text. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Disables sending (a reply is streaming). The field stays editable. */\n busy?: boolean;\n /** Controls before the field. */\n leading?: React.ReactNode;\n /** Controls between the field and the send button. */\n trailing?: React.ReactNode;\n /** Tallest the field grows before it scrolls, in px. */\n maxHeight?: number;\n /** Clear the field after a submit (uncontrolled use). */\n clearOnSubmit?: boolean;\n /** Class for the outer box; `className` goes to the textarea. */\n boxClassName?: string;\n}\n\nexport const ChatComposer = React.forwardRef<HTMLTextAreaElement, ChatComposerProps>(\n (\n {\n sendLabel,\n onSubmit,\n value,\n defaultValue = '',\n onValueChange,\n busy = false,\n leading,\n trailing,\n maxHeight = 240,\n clearOnSubmit = true,\n disabled,\n className,\n boxClassName,\n onKeyDown,\n ...props\n },\n ref\n ) => {\n const inner = React.useRef<HTMLTextAreaElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLTextAreaElement);\n const [own, setOwn] = React.useState(defaultValue);\n const text = value ?? own;\n const canSend = !busy && !disabled && text.trim().length > 0;\n\n const setText = (next: string) => {\n if (value === undefined) setOwn(next);\n onValueChange?.(next);\n };\n\n // Grow with the text: reset, then take the scroll height up to the cap.\n React.useLayoutEffect(() => {\n const el = inner.current;\n if (!el) return;\n el.style.height = 'auto';\n el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;\n el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden';\n }, [text, maxHeight]);\n\n const submit = () => {\n if (!canSend) return;\n onSubmit(text.trim());\n if (clearOnSubmit) setText('');\n };\n\n return (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n submit();\n }}\n className={cn(\n 'flex items-end gap-3 border border-outline bg-surface p-3 text-on-surface shadow-overlay',\n 'transition-colors duration-(--sv-sys-motion-duration-fast) ease-standard focus-within:border-outline-strong',\n 'has-[textarea:focus-visible]:outline-solid has-[textarea:focus-visible]:outline-2 has-[textarea:focus-visible]:outline-offset-2 has-[textarea:focus-visible]:outline-focus',\n disabled && 'opacity-40',\n boxClassName\n )}\n >\n {leading ? <div className=\"flex shrink-0 items-center gap-gap-xs\">{leading}</div> : null}\n <textarea\n ref={inner}\n rows={1}\n value={text}\n disabled={disabled}\n onChange={(e) => setText(e.target.value)}\n onKeyDown={(e) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {\n e.preventDefault();\n submit();\n }\n }}\n className={cn(\n 'min-h-8 min-w-0 flex-1 resize-none self-center bg-transparent py-1 sv-body-md text-on-surface outline-hidden placeholder:text-on-surface-variant disabled:cursor-not-allowed',\n className\n )}\n {...props}\n />\n {trailing ? <div className=\"flex shrink-0 items-center gap-gap-xs\">{trailing}</div> : null}\n <button\n type=\"submit\"\n aria-label={sendLabel}\n disabled={!canSend}\n className={cn(\n 'inline-flex size-8 shrink-0 items-center justify-center bg-primary text-on-primary transition-colors duration-(--sv-sys-motion-duration-fast) ease-standard hover:bg-primary-hover active:bg-primary-active',\n 'outline-hidden focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',\n 'disabled:bg-ghost-hover disabled:text-on-surface-variant'\n )}\n >\n <ArrowUp size={16} weight=\"bold\" aria-hidden />\n </button>\n </form>\n );\n }\n);\nChatComposer.displayName = 'ChatComposer';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,SAAS,eAAe;AAwFlB,SAaa,KAbb;AAhDC,IAAM,eAAqB;AAAA,EAChC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,QAAc,aAA4B,IAAI;AACpD,IAAM,0BAAoB,KAAK,MAAM,MAAM,OAA8B;AACzE,UAAM,CAAC,KAAK,MAAM,IAAU,eAAS,YAAY;AACjD,UAAM,OAAO,SAAS;AACtB,UAAM,UAAU,CAAC,QAAQ,CAAC,YAAY,KAAK,KAAK,EAAE,SAAS;AAE3D,UAAM,UAAU,CAAC,SAAiB;AAChC,UAAI,UAAU,OAAW,QAAO,IAAI;AACpC,sBAAgB,IAAI;AAAA,IACtB;AAGA,IAAM,sBAAgB,MAAM;AAC1B,YAAM,KAAK,MAAM;AACjB,UAAI,CAAC,GAAI;AACT,SAAG,MAAM,SAAS;AAClB,SAAG,MAAM,SAAS,GAAG,KAAK,IAAI,GAAG,cAAc,SAAS,CAAC;AACzD,SAAG,MAAM,YAAY,GAAG,eAAe,YAAY,SAAS;AAAA,IAC9D,GAAG,CAAC,MAAM,SAAS,CAAC;AAEpB,UAAM,SAAS,MAAM;AACnB,UAAI,CAAC,QAAS;AACd,eAAS,KAAK,KAAK,CAAC;AACpB,UAAI,cAAe,SAAQ,EAAE;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,CAAC,MAAM;AACf,YAAE,eAAe;AACjB,iBAAO;AAAA,QACT;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QAEC;AAAA,oBAAU,oBAAC,SAAI,WAAU,yCAAyC,mBAAQ,IAAS;AAAA,UACpF;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL,MAAM;AAAA,cACN,OAAO;AAAA,cACP;AAAA,cACA,UAAU,CAAC,MAAM,QAAQ,EAAE,OAAO,KAAK;AAAA,cACvC,WAAW,CAAC,MAAM;AAChB,4BAAY,CAAC;AACb,oBAAI,EAAE,iBAAkB;AACxB,oBAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,YAAY,CAAC,EAAE,YAAY,aAAa;AAClE,oBAAE,eAAe;AACjB,yBAAO;AAAA,gBACT;AAAA,cACF;AAAA,cACA,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,cACF;AAAA,cACC,GAAG;AAAA;AAAA,UACN;AAAA,UACC,WAAW,oBAAC,SAAI,WAAU,yCAAyC,oBAAS,IAAS;AAAA,UACtF;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAY;AAAA,cACZ,UAAU,CAAC;AAAA,cACX,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,cAEA,8BAAC,WAAQ,MAAM,IAAI,QAAO,QAAO,eAAW,MAAC;AAAA;AAAA,UAC/C;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/feedback/skeleton.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var Skeleton = React.forwardRef(({ className, circle, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
"aria-hidden": true,
|
|
13
|
+
className: cn("bg-surface-muted animate-sv-breathe motion-reduce:animate-none", circle && "rounded-full", className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
Skeleton.displayName = "Skeleton";
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
Skeleton
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-OGSHLSI2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/feedback/skeleton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Skeleton. A placeholder block on the paper step that breathes while content loads\n * (`animate-sv-breathe`, a slow opacity change, never a sweeping highlight). Square like every\n * shape; `circle` is for an avatar's place only.\n *\n * Hidden from assistive tech: it is shape, not content. The region it fills says it is busy\n * (`aria-busy` on the container) or a `Spinner` names the wait. Reduced motion holds it still.\n */\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n circle?: boolean;\n}\n\nexport const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(({ className, circle, ...props }, ref) => (\n <div\n ref={ref}\n aria-hidden\n className={cn('bg-surface-muted animate-sv-breathe motion-reduce:animate-none', circle && 'rounded-full', className)}\n {...props}\n />\n));\nSkeleton.displayName = 'Skeleton';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAgBrB;AADK,IAAM,WAAiB,iBAA0C,CAAC,EAAE,WAAW,QAAQ,GAAG,MAAM,GAAG,QACxG;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW;AAAA,IACX,WAAW,GAAG,kEAAkE,UAAU,gBAAgB,SAAS;AAAA,IAClH,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/charts/delta.tsx
|
|
6
|
+
import { ArrowUpRight, ArrowDownRight, Minus } from "@phosphor-icons/react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Delta({ value, direction, sentiment, format, className, ...props }) {
|
|
9
|
+
const num = typeof value === "number" ? value : null;
|
|
10
|
+
const sign = num != null ? Math.sign(num) : /^\s*\+/.test(String(value)) ? 1 : /^\s*[-\u2212]/.test(String(value)) ? -1 : 0;
|
|
11
|
+
const dir = direction ?? (sign > 0 ? "up" : sign < 0 ? "down" : "flat");
|
|
12
|
+
const mood = sentiment ?? (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral");
|
|
13
|
+
const text = num == null ? value : format ? format(num) : `${num > 0 ? "+" : ""}${num.toLocaleString("en-US", { maximumFractionDigits: 1 })}%`;
|
|
14
|
+
const Glyph = dir === "up" ? ArrowUpRight : dir === "down" ? ArrowDownRight : Minus;
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: cn(
|
|
19
|
+
"inline-flex items-center gap-1 px-1.5 py-0.5 sv-body-sm font-medium tabular-nums whitespace-nowrap",
|
|
20
|
+
mood === "positive" ? "bg-success-container text-on-success-container" : mood === "negative" ? "bg-error-container text-on-error-container" : "bg-ghost text-on-surface",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...props,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Glyph, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
26
|
+
text
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
Delta.displayName = "Delta";
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Delta
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-OIAZH5EU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/delta.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowUpRight, ArrowDownRight, Minus } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\n\nexport interface DeltaProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** The change, pre-formatted (\"+7%\") or a number (its sign sets the direction). */\n value: string | number;\n /** Direction of the change; derived from a numeric `value` when omitted. */\n direction?: 'up' | 'down' | 'flat';\n /** Whether the change is good news. Defaults: up positive, down negative. Invert it for a\n * metric where lower is better (latency, cost). */\n sentiment?: 'positive' | 'negative' | 'neutral';\n format?: (v: number) => string;\n}\n\n/**\n * Cairn Delta: a trend badge. The meaning sits in a message container (`success` / `error`\n * container with its on-* text, rule 4), and never on hue alone: the arrow glyph and the signed\n * value say the direction too. Square, the eyebrow-free body size.\n */\nexport function Delta({ value, direction, sentiment, format, className, ...props }: DeltaProps) {\n const num = typeof value === 'number' ? value : null;\n const sign = num != null ? Math.sign(num) : /^\\s*\\+/.test(String(value)) ? 1 : /^\\s*[-\\u2212]/.test(String(value)) ? -1 : 0;\n const dir = direction ?? (sign > 0 ? 'up' : sign < 0 ? 'down' : 'flat');\n const mood = sentiment ?? (dir === 'up' ? 'positive' : dir === 'down' ? 'negative' : 'neutral');\n const text =\n num == null ? value : format ? format(num) : `${num > 0 ? '+' : ''}${num.toLocaleString('en-US', { maximumFractionDigits: 1 })}%`;\n const Glyph = dir === 'up' ? ArrowUpRight : dir === 'down' ? ArrowDownRight : Minus;\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 px-1.5 py-0.5 sv-body-sm font-medium tabular-nums whitespace-nowrap',\n mood === 'positive'\n ? 'bg-success-container text-on-success-container'\n : mood === 'negative'\n ? 'bg-error-container text-on-error-container'\n : 'bg-ghost text-on-surface',\n className\n )}\n {...props}\n >\n <Glyph size={14} weight=\"bold\" aria-hidden=\"true\" />\n {text}\n </span>\n );\n}\nDelta.displayName = 'Delta';\n"],"mappings":";;;;;AACA,SAAS,cAAc,gBAAgB,aAAa;AA4BhD,SAYE,KAZF;AATG,SAAS,MAAM,EAAE,OAAO,WAAW,WAAW,QAAQ,WAAW,GAAG,MAAM,GAAe;AAC9F,QAAM,MAAM,OAAO,UAAU,WAAW,QAAQ;AAChD,QAAM,OAAO,OAAO,OAAO,KAAK,KAAK,GAAG,IAAI,SAAS,KAAK,OAAO,KAAK,CAAC,IAAI,IAAI,gBAAgB,KAAK,OAAO,KAAK,CAAC,IAAI,KAAK;AAC1H,QAAM,MAAM,cAAc,OAAO,IAAI,OAAO,OAAO,IAAI,SAAS;AAChE,QAAM,OAAO,cAAc,QAAQ,OAAO,aAAa,QAAQ,SAAS,aAAa;AACrF,QAAM,OACJ,OAAO,OAAO,QAAQ,SAAS,OAAO,GAAG,IAAI,GAAG,MAAM,IAAI,MAAM,EAAE,GAAG,IAAI,eAAe,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAChI,QAAM,QAAQ,QAAQ,OAAO,eAAe,QAAQ,SAAS,iBAAiB;AAC9E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS,aACL,mDACA,SAAS,aACP,+CACA;AAAA,QACN;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAM,MAAM,IAAI,QAAO,QAAO,eAAY,QAAO;AAAA,QACjD;AAAA;AAAA;AAAA,EACH;AAEJ;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
markMotion,
|
|
5
|
+
useChartEntrance
|
|
6
|
+
} from "./chunk-W2NESPKL.js";
|
|
7
|
+
import {
|
|
8
|
+
formatNumber,
|
|
9
|
+
safe
|
|
10
|
+
} from "./chunk-I355QWHH.js";
|
|
11
|
+
import {
|
|
12
|
+
brand,
|
|
13
|
+
neutral
|
|
14
|
+
} from "./chunk-5EGRSN37.js";
|
|
15
|
+
import {
|
|
16
|
+
cn
|
|
17
|
+
} from "./chunk-DXRY7AS4.js";
|
|
18
|
+
|
|
19
|
+
// src/charts/rank-list.tsx
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
function RankList({ items, max, sort = "desc", ranked = false, format = formatNumber, className, ...props }) {
|
|
22
|
+
const { ref, style } = useChartEntrance();
|
|
23
|
+
const rows = sort ? [...items].sort((a, b) => sort === "desc" ? b.value - a.value : a.value - b.value) : items;
|
|
24
|
+
const top = max ?? Math.max(...rows.map((r) => safe(r.value)), 1);
|
|
25
|
+
return /* @__PURE__ */ jsx("ol", { ref, style, className: cn("grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4", className), ...props, children: rows.map((r, i) => /* @__PURE__ */ jsxs("li", { className: "col-span-3 grid grid-cols-subgrid items-center border-b border-outline py-2.5 last:border-b-0", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("span", { className: cn("flex items-baseline gap-2 sv-body-sm whitespace-nowrap", r.focus ? "font-medium text-chart-value" : "text-chart-label"), children: [
|
|
27
|
+
ranked && /* @__PURE__ */ jsx("span", { className: "w-5 tabular-nums text-chart-label", children: i + 1 }),
|
|
28
|
+
r.label
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "relative h-2.5 w-full", children: /* @__PURE__ */ jsx(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: "absolute inset-y-0 left-0 origin-left motion-safe:animate-sv-chart-grow-x",
|
|
34
|
+
style: { width: `${Math.min(safe(r.value), top) / top * 100}%`, background: r.focus ? brand(0) : neutral(0), ...markMotion(i) }
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: cn("sv-body-sm tabular-nums text-right text-chart-value", r.focus && "font-medium"), children: format(r.value) })
|
|
38
|
+
] }, r.label)) });
|
|
39
|
+
}
|
|
40
|
+
RankList.displayName = "RankList";
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
RankList
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-P22B7HQS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/rank-list.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { brand, neutral } from './lib/series';\nimport { formatNumber, safe } from './lib/scale';\nimport { useChartEntrance, markMotion } from './lib/use-chart';\n\nexport interface RankItem {\n label: string;\n value: number;\n /** The subject row: warm bar, label in the value colour. */\n focus?: boolean;\n}\n\nexport interface RankListProps extends React.HTMLAttributes<HTMLOListElement> {\n items: RankItem[];\n /** Bar scale maximum; defaults to the largest value. */\n max?: number;\n /** Sort by value, largest first (default) or keep the given order. */\n sort?: 'desc' | 'asc' | false;\n /** Print the rank number before each label. */\n ranked?: boolean;\n format?: (v: number) => string;\n}\n\n/**\n * Cairn RankList: a ranked list of horizontal bars, label on the left, value printed on the\n * right, the subject row warm and the rest neutral. A real ordered list, so it reads in order\n * without the bars; bars grow from the left in turn.\n */\nexport function RankList({ items, max, sort = 'desc', ranked = false, format = formatNumber, className, ...props }: RankListProps) {\n const { ref, style } = useChartEntrance<HTMLOListElement>();\n const rows = sort ? [...items].sort((a, b) => (sort === 'desc' ? b.value - a.value : a.value - b.value)) : items;\n const top = max ?? Math.max(...rows.map((r) => safe(r.value)), 1);\n return (\n <ol ref={ref} style={style} className={cn('grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-4', className)} {...props}>\n {rows.map((r, i) => (\n <li key={r.label} className=\"col-span-3 grid grid-cols-subgrid items-center border-b border-outline py-2.5 last:border-b-0\">\n <span className={cn('flex items-baseline gap-2 sv-body-sm whitespace-nowrap', r.focus ? 'font-medium text-chart-value' : 'text-chart-label')}>\n {ranked && <span className=\"w-5 tabular-nums text-chart-label\">{i + 1}</span>}\n {r.label}\n </span>\n <span aria-hidden=\"true\" className=\"relative h-2.5 w-full\">\n <span\n className=\"absolute inset-y-0 left-0 origin-left motion-safe:animate-sv-chart-grow-x\"\n style={{ width: `${(Math.min(safe(r.value), top) / top) * 100}%`, background: r.focus ? brand(0) : neutral(0), ...markMotion(i) }}\n />\n </span>\n <span className={cn('sv-body-sm tabular-nums text-right text-chart-value', r.focus && 'font-medium')}>{format(r.value)}</span>\n </li>\n ))}\n </ol>\n );\n}\nRankList.displayName = 'RankList';\n"],"mappings":";;;;;;;;;;;;;;;;;AAsCU,SACa,KADb;AARH,SAAS,SAAS,EAAE,OAAO,KAAK,OAAO,QAAQ,SAAS,OAAO,SAAS,cAAc,WAAW,GAAG,MAAM,GAAkB;AACjI,QAAM,EAAE,KAAK,MAAM,IAAI,iBAAmC;AAC1D,QAAM,OAAO,OAAO,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,MAAO,SAAS,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAM,IAAI;AAC3G,QAAM,MAAM,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC;AAChE,SACE,oBAAC,QAAG,KAAU,OAAc,WAAW,GAAG,wEAAwE,SAAS,GAAI,GAAG,OAC/H,eAAK,IAAI,CAAC,GAAG,MACZ,qBAAC,QAAiB,WAAU,iGAC1B;AAAA,yBAAC,UAAK,WAAW,GAAG,0DAA0D,EAAE,QAAQ,iCAAiC,kBAAkB,GACxI;AAAA,gBAAU,oBAAC,UAAK,WAAU,qCAAqC,cAAI,GAAE;AAAA,MACrE,EAAE;AAAA,OACL;AAAA,IACA,oBAAC,UAAK,eAAY,QAAO,WAAU,yBACjC;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO,EAAE,OAAO,GAAI,KAAK,IAAI,KAAK,EAAE,KAAK,GAAG,GAAG,IAAI,MAAO,GAAG,KAAK,YAAY,EAAE,QAAQ,MAAM,CAAC,IAAI,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,EAAE;AAAA;AAAA,IAClI,GACF;AAAA,IACA,oBAAC,UAAK,WAAW,GAAG,uDAAuD,EAAE,SAAS,aAAa,GAAI,iBAAO,EAAE,KAAK,GAAE;AAAA,OAXhH,EAAE,KAYX,CACD,GACH;AAEJ;AACA,SAAS,cAAc;","names":[]}
|
|
@@ -18,7 +18,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 6, collisionPad
|
|
|
18
18
|
sideOffset,
|
|
19
19
|
collisionPadding,
|
|
20
20
|
className: cn(
|
|
21
|
-
"z-50 max-w-64
|
|
21
|
+
"z-50 max-w-64 bg-inverse-surface px-3 py-1 sv-body-xs text-on-inverse-surface shadow-overlay",
|
|
22
22
|
className
|
|
23
23
|
),
|
|
24
24
|
...props
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
TooltipTrigger,
|
|
33
33
|
TooltipContent
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-P2CWISVU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/overlay/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Tooltip. Radix, because the `title` attribute is not an accessible\n * alternative to one.\n *\n * `title` looks like the free version of a tooltip and behaves like nothing at\n * all: it never appears on keyboard focus, most screen readers ignore or\n * duplicate it, it cannot be dismissed, and its delay belongs to the operating\n * system. Any information a sighted mouse user gets from it is information a\n * keyboard user does not get. Radix gives focus and hover parity, Escape to\n * dismiss, and a real `aria-describedby` link.\n *\n * The rule that survives all of it: a tooltip may only ever carry information\n * that is *supplementary*. If the interface does not make sense without it, the\n * text belongs on the surface (rule 4, meaning never rests on a hover).\n *\n * Inverse surface, not a hue: a tooltip is a small dense mark and the inverse\n * pairing is the one that reads at that size on both themes.\n */\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\nexport const Tooltip = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /** Where the portal mounts. Defaults to `document.body`. See `PopoverContent`. */\n container?: HTMLElement | null;\n}\n\nexport const TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, sideOffset = 6, collisionPadding = 12, container, ...props }, ref) => (\n <TooltipPrimitive.Portal container={container ?? undefined}>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n 'z-50 max-w-64 bg-inverse-surface px-3 py-1 sv-body-xs text-on-inverse-surface shadow-overlay',\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = 'TooltipContent';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAqC9B;AAfG,IAAM,kBAAmC;AACzC,IAAM,UAA2B;AACjC,IAAM,iBAAkC;AAQxC,IAAM,iBAAuB,iBAGlC,CAAC,EAAE,WAAW,aAAa,GAAG,mBAAmB,IAAI,WAAW,GAAG,MAAM,GAAG,QAC5E,oBAAkB,yBAAjB,EAAwB,WAAW,aAAa,QAC/C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,GACF,CACD;AACD,eAAe,cAAc;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FIELD,
|
|
3
|
+
FIELD_BOX
|
|
4
|
+
} from "./chunk-RB6DUG3M.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-DXRY7AS4.js";
|
|
8
|
+
|
|
9
|
+
// src/input/input.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var Input = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("input", { ref, className: cn(FIELD, FIELD_BOX, className), ...props }));
|
|
13
|
+
Input.displayName = "Input";
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
Input
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-P4G5WFHH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/input/input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { FIELD, FIELD_BOX } from './field-styles';\n\n/**\n * Cairn Input. A text field, and nothing more.\n *\n * No Radix here on purpose: an `<input>` has no behaviour to borrow. Radix earns its place where\n * there is focus management, dismissal or ARIA wiring to get right, not here.\n *\n * See `field-styles.ts`: 58px paper field on a hairline, square, the border\n * steps to `outline-strong` on hover and focus, the focus ring is the `focus-visible` outline.\n * The placeholder sits on `on-surface-variant` so it reads as absent text. Pair it with `Label`:\n * a field whose only label is its placeholder loses that label the moment someone types.\n */\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => (\n <input ref={ref} className={cn(FIELD, FIELD_BOX, className)} {...props} />\n));\nInput.displayName = 'Input';\n"],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AAkBrB;AADK,IAAM,QAAc,iBAAyC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC5F,oBAAC,WAAM,KAAU,WAAW,GAAG,OAAO,WAAW,SAAS,GAAI,GAAG,OAAO,CACzE;AACD,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Kbd
|
|
5
|
+
} from "./chunk-GGQ6GQ75.js";
|
|
6
|
+
import {
|
|
7
|
+
FIELD
|
|
8
|
+
} from "./chunk-RB6DUG3M.js";
|
|
9
|
+
import {
|
|
10
|
+
cn
|
|
11
|
+
} from "./chunk-DXRY7AS4.js";
|
|
12
|
+
|
|
13
|
+
// src/input/search-field.tsx
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { MagnifyingGlass } from "@phosphor-icons/react";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var SearchField = React.forwardRef(
|
|
18
|
+
({ className, boxClassName, kbd, shortcut, value, defaultValue, onChange, ...props }, ref) => {
|
|
19
|
+
const inner = React.useRef(null);
|
|
20
|
+
React.useImperativeHandle(ref, () => inner.current);
|
|
21
|
+
const [filled, setFilled] = React.useState(Boolean(value ?? defaultValue));
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (value !== void 0) setFilled(String(value).length > 0);
|
|
24
|
+
}, [value]);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (!shortcut) return;
|
|
27
|
+
const onKey = (e) => {
|
|
28
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === shortcut.toLowerCase()) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
inner.current?.focus();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener("keydown", onKey);
|
|
34
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
35
|
+
}, [shortcut]);
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: cn(
|
|
40
|
+
FIELD,
|
|
41
|
+
"flex h-12 items-center gap-gap-sm px-4",
|
|
42
|
+
"focus-within:border-outline-strong has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus",
|
|
43
|
+
"has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-40",
|
|
44
|
+
boxClassName
|
|
45
|
+
),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(MagnifyingGlass, { size: 20, "aria-hidden": true, className: "shrink-0 text-on-surface-variant" }),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
ref: inner,
|
|
52
|
+
type: "search",
|
|
53
|
+
value,
|
|
54
|
+
defaultValue,
|
|
55
|
+
onChange: (e) => {
|
|
56
|
+
setFilled(e.target.value.length > 0);
|
|
57
|
+
onChange?.(e);
|
|
58
|
+
},
|
|
59
|
+
className: cn(
|
|
60
|
+
"h-full min-w-0 flex-1 bg-transparent text-on-surface outline-hidden placeholder:text-on-surface-variant disabled:cursor-not-allowed",
|
|
61
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
kbd && !filled ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "flex shrink-0 items-center gap-gap-xs", children: typeof kbd === "string" ? /* @__PURE__ */ jsx(Kbd, { children: kbd }) : kbd }) : null
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
SearchField.displayName = "SearchField";
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
SearchField
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-QNIIWNSR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/input/search-field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { MagnifyingGlass } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\nimport { FIELD } from './field-styles';\nimport { Kbd } from './kbd';\n\n/**\n * Cairn SearchField. A `type=\"search\"` input in a field box with a magnifier on the left and an\n * optional keyboard hint on the right (one hairline box, the input\n * borderless inside it). The box takes the field states through `focus-within`, so the ring\n * draws around the whole control, magnifier included.\n *\n * `shortcut` binds Cmd or Ctrl plus that key to focus the field, and `kbd` is what the hint\n * shows; both are the consumer's, and the hint is hidden from assistive tech, which reaches the\n * field by its label (pass `aria-label` or wire a `Label`). The hint hides while the field has a\n * value, when it would only crowd the text.\n */\nexport interface SearchFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /** Keyboard hint shown at the right, e.g. one `Kbd` per key. Strings are wrapped in a `Kbd`. */\n kbd?: React.ReactNode;\n /** Key that focuses the field with Cmd (macOS) or Ctrl. */\n shortcut?: string;\n /** Class for the outer box; `className` goes to the input. */\n boxClassName?: string;\n}\n\nexport const SearchField = React.forwardRef<HTMLInputElement, SearchFieldProps>(\n ({ className, boxClassName, kbd, shortcut, value, defaultValue, onChange, ...props }, ref) => {\n const inner = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLInputElement);\n const [filled, setFilled] = React.useState(Boolean(value ?? defaultValue));\n React.useEffect(() => {\n if (value !== undefined) setFilled(String(value).length > 0);\n }, [value]);\n\n React.useEffect(() => {\n if (!shortcut) return;\n const onKey = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === shortcut.toLowerCase()) {\n e.preventDefault();\n inner.current?.focus();\n }\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [shortcut]);\n\n return (\n <div\n className={cn(\n FIELD,\n 'flex h-12 items-center gap-gap-sm px-4',\n 'focus-within:border-outline-strong has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus',\n 'has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-40',\n boxClassName\n )}\n >\n <MagnifyingGlass size={20} aria-hidden className=\"shrink-0 text-on-surface-variant\" />\n <input\n ref={inner}\n type=\"search\"\n value={value}\n defaultValue={defaultValue}\n onChange={(e) => {\n setFilled(e.target.value.length > 0);\n onChange?.(e);\n }}\n className={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-on-surface outline-hidden placeholder:text-on-surface-variant disabled:cursor-not-allowed',\n '[&::-webkit-search-cancel-button]:appearance-none',\n className\n )}\n {...props}\n />\n {kbd && !filled ? (\n <span aria-hidden className=\"flex shrink-0 items-center gap-gap-xs\">\n {typeof kbd === 'string' ? <Kbd>{kbd}</Kbd> : kbd}\n </span>\n ) : null}\n </div>\n );\n }\n);\nSearchField.displayName = 'SearchField';\n"],"mappings":";;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AA+C1B,SASE,KATF;AAtBC,IAAM,cAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,cAAc,KAAK,UAAU,OAAO,cAAc,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC5F,UAAM,QAAc,aAAyB,IAAI;AACjD,IAAM,0BAAoB,KAAK,MAAM,MAAM,OAA2B;AACtE,UAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,QAAQ,SAAS,YAAY,CAAC;AACzE,IAAM,gBAAU,MAAM;AACpB,UAAI,UAAU,OAAW,WAAU,OAAO,KAAK,EAAE,SAAS,CAAC;AAAA,IAC7D,GAAG,CAAC,KAAK,CAAC;AAEV,IAAM,gBAAU,MAAM;AACpB,UAAI,CAAC,SAAU;AACf,YAAM,QAAQ,CAAC,MAAqB;AAClC,aAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,YAAY,MAAM,SAAS,YAAY,GAAG;AAC9E,YAAE,eAAe;AACjB,gBAAM,SAAS,MAAM;AAAA,QACvB;AAAA,MACF;AACA,aAAO,iBAAiB,WAAW,KAAK;AACxC,aAAO,MAAM,OAAO,oBAAoB,WAAW,KAAK;AAAA,IAC1D,GAAG,CAAC,QAAQ,CAAC;AAEb,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAEA;AAAA,8BAAC,mBAAgB,MAAM,IAAI,eAAW,MAAC,WAAU,oCAAmC;AAAA,UACpF;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL,MAAK;AAAA,cACL;AAAA,cACA;AAAA,cACA,UAAU,CAAC,MAAM;AACf,0BAAU,EAAE,OAAO,MAAM,SAAS,CAAC;AACnC,2BAAW,CAAC;AAAA,cACd;AAAA,cACA,WAAW;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,cACC,GAAG;AAAA;AAAA,UACN;AAAA,UACC,OAAO,CAAC,SACP,oBAAC,UAAK,eAAW,MAAC,WAAU,yCACzB,iBAAO,QAAQ,WAAW,oBAAC,OAAK,eAAI,IAAS,KAChD,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,YAAY,cAAc;","names":[]}
|