@eluan/core 0.5.1 → 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 +41 -3
- package/bin/eluan.mjs +75 -0
- package/bin/lib/check.mjs +271 -0
- package/bin/lib/skill.mjs +123 -0
- package/dist/{action-popover-D6K9aVFk.cjs → action-popover-Bt7U0g8y.cjs} +1 -1
- package/dist/{action-popover-BVJQBuky.js → action-popover-jEeycwXM.js} +2 -2
- package/dist/action-popover.cjs +1 -1
- package/dist/action-popover.js +1 -1
- package/dist/{avatar-CS5f1irF.js → avatar-C1LUOzjw.js} +1 -1
- package/dist/{avatar-Co-k8KqV.cjs → avatar-SwIO4oyt.cjs} +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-BLInSFM-.cjs +1 -0
- package/dist/{badge-D9NYZFWH.js → badge-Bj7i1Xf5.js} +20 -18
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{banner-CyYFLZXw.js → banner-BqEziMp4.js} +11 -12
- package/dist/banner-C8OECYHz.cjs +1 -0
- package/dist/banner.cjs +1 -1
- package/dist/banner.js +1 -1
- package/dist/box-DG-tkaYi.cjs +1 -0
- package/dist/box-DKbNgGGG.js +17 -0
- package/dist/box.cjs +1 -0
- package/dist/box.d.ts +1 -0
- package/dist/box.js +5 -0
- package/dist/{breadcrumb-NWXeCH5q.cjs → breadcrumb-BGH_YhOZ.cjs} +1 -1
- package/dist/{breadcrumb-Cm1nb9Xj.js → breadcrumb-BVXSOA4Z.js} +2 -2
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-BUHQOcAo.cjs +1 -0
- package/dist/{button-ANAPDrvs.js → button-fCYiYUPE.js} +69 -60
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-2s_jGUBa.cjs +76 -0
- package/dist/{calendar-BpBsomy5.js → calendar-BN9BkjO_.js} +22 -22
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card-CfSvhkGH.js +81 -0
- package/dist/card-DlP39QSZ.cjs +1 -0
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{carousel-DuP0hvF-.js → carousel-BO6KUdP8.js} +1 -1
- package/dist/{carousel-BfL7oy_q.cjs → carousel-dypuabh8.cjs} +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{checkbox-Bi0Kmuut.js → checkbox-CGUTGery.js} +1 -1
- package/dist/{checkbox-M8DmWKiC.cjs → checkbox-Cq9sHU_S.cjs} +1 -1
- package/dist/{checkbox-group-KBwPhjmW.cjs → checkbox-group-DGXZ4o2-.cjs} +1 -1
- package/dist/{checkbox-group-CQMEJnhD.js → checkbox-group-Tkio3IhK.js} +1 -1
- package/dist/checkbox-group.cjs +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{code-block-C9u140Ob.js → code-block-CAXUOKNI.js} +10 -10
- package/dist/{code-block-_dFw7Su1.cjs → code-block-Co8uGXiG.cjs} +2 -2
- package/dist/code-block.cjs +1 -1
- package/dist/code-block.js +1 -1
- package/dist/command-C50Jkuv7.js +132 -0
- package/dist/command-DqNgPVsf.cjs +9 -0
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/components/box.d.ts +12 -0
- package/dist/components/card.d.ts +7 -2
- package/dist/components/grid.d.ts +35 -0
- package/dist/components/icon.d.ts +26 -0
- package/dist/components/input.d.ts +1 -1
- package/dist/components/layout-shared.d.ts +307 -0
- package/dist/components/navigation-drawer.d.ts +25 -5
- package/dist/components/row.d.ts +18 -0
- package/dist/components/stack.d.ts +14 -0
- package/dist/components/table.d.ts +8 -4
- package/dist/components/tone-shared.d.ts +39 -0
- package/dist/components/typography.d.ts +22 -2
- package/dist/components/visually-hidden.d.ts +11 -0
- package/dist/{context-menu-Bd6m1RYU.js → context-menu-CTyczUjx.js} +34 -34
- package/dist/context-menu-oQ6xMN6t.cjs +1 -0
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{credit-card-input-CUqA9CX3.cjs → credit-card-input-C6oNQBAl.cjs} +1 -1
- package/dist/{credit-card-input-DN-8vaFj.js → credit-card-input-aYftFdRo.js} +1 -1
- package/dist/credit-card-input.cjs +1 -1
- package/dist/credit-card-input.js +1 -1
- package/dist/{date-picker-ni8td8Ru.js → date-picker-DK-G61Nn.js} +3 -3
- package/dist/{date-picker-DGBsfZXx.cjs → date-picker-D_aU_P3A.cjs} +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/{datetime-picker-C1d63MaA.cjs → datetime-picker-897BvwxW.cjs} +1 -1
- package/dist/{datetime-picker-DsnHYRK-.js → datetime-picker-CECtSobs.js} +4 -4
- package/dist/datetime-picker.cjs +1 -1
- package/dist/datetime-picker.js +1 -1
- package/dist/decimal-input-B7IHYVXP.cjs +1 -0
- package/dist/decimal-input-ohejnbQg.js +177 -0
- package/dist/decimal-input.cjs +1 -1
- package/dist/decimal-input.js +1 -1
- package/dist/dialog-DIGW7qln.cjs +1 -0
- package/dist/dialog-DVhnZFqE.js +64 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BV2rX_ow.cjs +1 -0
- package/dist/dropdown-menu-C6NPtU9J.js +115 -0
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/{email-input-pX0hlYV3.js → email-input-CRd87a_c.js} +1 -1
- package/dist/{email-input-DFI4h_KN.cjs → email-input-Dvj1xSzJ.cjs} +1 -1
- package/dist/email-input.cjs +1 -1
- package/dist/email-input.js +1 -1
- package/dist/{fieldset-5V8wx-KE.js → fieldset-BxINrO_H.js} +6 -6
- package/dist/fieldset-C6cahGeV.cjs +1 -0
- package/dist/fieldset.cjs +1 -1
- package/dist/fieldset.js +1 -1
- package/dist/file-input-BzYcnore.cjs +1 -0
- package/dist/{file-input-B_aBgxmT.js → file-input-Ch16hNA1.js} +55 -55
- package/dist/file-input.cjs +1 -1
- package/dist/file-input.js +1 -1
- package/dist/{footer-DB0_-IwN.cjs → footer-B-fRLhqP.cjs} +1 -1
- package/dist/{footer-B3KUIwXW.js → footer-BiiV6-ZD.js} +9 -9
- package/dist/footer.cjs +1 -1
- package/dist/footer.js +1 -1
- package/dist/grid-BDz4Xs6M.cjs +1 -0
- package/dist/grid-BX5vZjDo.js +612 -0
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +5 -0
- package/dist/header-CvhqGcuo.cjs +1 -0
- package/dist/{header-CDOWlOAR.js → header-DwvyTpRi.js} +22 -22
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/hover-card-BQpzaazK.js +21 -0
- package/dist/{hover-card-C5KsTSZR.cjs → hover-card-V5A1HzEu.cjs} +1 -1
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/icon-BmLOodCQ.cjs +1 -0
- package/dist/icon-BwDfkIdR.js +153 -0
- package/dist/icon.cjs +1 -0
- package/dist/icon.d.ts +1 -0
- package/dist/icon.js +5 -0
- package/dist/index.cjs +10 -5
- package/dist/index.d.ts +6 -0
- package/dist/index.js +593 -516
- package/dist/input-Dtr0tlf7.cjs +1 -0
- package/dist/input-Zs45H33i.js +131 -0
- package/dist/input-otp-D-T32R3O.cjs +1 -0
- package/dist/{input-otp-DmEGB1nu.js → input-otp-DwdX6VlR.js} +33 -33
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout-shared-B_1iX4Hj.js +319 -0
- package/dist/layout-shared-CsBZcT4V.cjs +1 -0
- package/dist/{menubar-F1_bhmku.js → menubar-CodcV4b7.js} +28 -28
- package/dist/menubar-bOYi1jKo.cjs +1 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +1 -1
- package/dist/multi-select-ChfbxrG3.js +85 -0
- package/dist/multi-select-D573XqUT.cjs +1 -0
- package/dist/multi-select.cjs +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/navigation-drawer-C7YYtBXz.js +198 -0
- package/dist/navigation-drawer-Cu2q1NMn.cjs +1 -0
- package/dist/navigation-drawer.cjs +1 -1
- package/dist/navigation-drawer.js +1 -1
- package/dist/{navigation-menu-BjA-PdMY.js → navigation-menu-BEp603xA.js} +16 -16
- package/dist/{navigation-menu-BtpLfxHN.cjs → navigation-menu-tw5cD7mL.cjs} +2 -2
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +1 -1
- package/dist/number-input-C1RS-p2C.js +66 -0
- package/dist/number-input-N3-IvxZT.cjs +1 -0
- package/dist/number-input.cjs +1 -1
- package/dist/number-input.js +1 -1
- package/dist/{pagination-4IuE_APs.cjs → pagination-C6e9oVes.cjs} +1 -1
- package/dist/{pagination-DTWRjiOm.js → pagination-XlaE-Plb.js} +32 -32
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/{password-input-B9V45d3Q.js → password-input-CR6FT6Rh.js} +2 -2
- package/dist/{password-input-BwnlHPbX.cjs → password-input-CZ19HPZd.cjs} +1 -1
- package/dist/password-input.cjs +1 -1
- package/dist/password-input.js +1 -1
- package/dist/{phone-input-BQjZj5jI.cjs → phone-input-BZhkLmI6.cjs} +1 -1
- package/dist/{phone-input-CSBpGHvI.js → phone-input-CT9W87M7.js} +2 -2
- package/dist/phone-input.cjs +1 -1
- package/dist/phone-input.js +1 -1
- package/dist/popover-CE0n5BQv.cjs +1 -0
- package/dist/popover-CguR4kP7.js +70 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/{progress-Dz_it5I-.js → progress-BpUNvswZ.js} +8 -7
- package/dist/progress-DSy_jRee.cjs +1 -0
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/providers/create-theme.d.ts +11 -2
- package/dist/providers/eluan-provider.d.ts +8 -6
- package/dist/{radio-group-C--1neiq.cjs → radio-group-9gozRouT.cjs} +1 -1
- package/dist/{radio-group-CNMPZx_2.js → radio-group-Bs9933bk.js} +6 -6
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{rich-text-BZSyuYSo.js → rich-text-CuAa5WkV.js} +21 -21
- package/dist/{rich-text-DerWxzdn.cjs → rich-text-p7H-0qE7.cjs} +2 -2
- package/dist/rich-text.cjs +1 -1
- package/dist/rich-text.js +1 -1
- package/dist/row-BYAk7G5d.js +37 -0
- package/dist/row-Bjn-GQAC.cjs +1 -0
- package/dist/row.cjs +1 -0
- package/dist/row.d.ts +1 -0
- package/dist/row.js +5 -0
- package/dist/{search-input-bFNW6oiE.js → search-input-CxKLBmii.js} +53 -53
- package/dist/{search-input-Dmmo-BEL.cjs → search-input-XmoL2YjY.cjs} +1 -1
- package/dist/search-input.cjs +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select-BCDam7PR.cjs +1 -0
- package/dist/select-QgjG43ye.js +119 -0
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/sheet-BxNmBMti.cjs +1 -0
- package/dist/{sheet-D5HWF66e.js → sheet-D0hVuH9a.js} +7 -7
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/slider-Cv7uIp4z.js +16 -0
- package/dist/slider-Dci7KGjg.cjs +1 -0
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/stack-Ck1w2iJu.cjs +1 -0
- package/dist/stack-D2btWM1t.js +27 -0
- package/dist/stack.cjs +1 -0
- package/dist/stack.d.ts +1 -0
- package/dist/stack.js +5 -0
- package/dist/{stepper-D5nDwJUz.cjs → stepper-ByYKX7qw.cjs} +1 -1
- package/dist/{stepper-BtlKiHtd.js → stepper-Copsj87A.js} +4 -4
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +1205 -189
- package/dist/switch-DQ4R-gjR.cjs +1 -0
- package/dist/switch-WaESqUuN.js +9 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-YKEWGYnI.js +149 -0
- package/dist/table-zbkgP43L.cjs +1 -0
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs-BwNIi7Dl.js +22 -0
- package/dist/tabs-DItFd2o9.cjs +1 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea-BWAPWDRt.js +8 -0
- package/dist/textarea-CniUTipL.cjs +1 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-input-BPoFvoeM.js → time-input-CeJVQKWO.js} +68 -68
- package/dist/time-input-eVFFYo10.cjs +1 -0
- package/dist/time-input.cjs +1 -1
- package/dist/time-input.js +1 -1
- package/dist/{toast-BK0ulAzi.cjs → toast-84RpQJtn.cjs} +1 -1
- package/dist/{toast-hI3pdZ2X.js → toast-BGKaAZwf.js} +1 -1
- package/dist/toast.cjs +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-Dv1VZ5Le.js → toggle-CxHqX2-V.js} +11 -11
- package/dist/toggle-DrJJAflI.cjs +1 -0
- package/dist/toggle-group-DvoxSJMq.cjs +1 -0
- package/dist/{toggle-group-DE8BPZih.js → toggle-group-k-kiBnEe.js} +21 -21
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +1 -1
- package/dist/{tooltip-DZqn4wKl.js → tooltip-1Biy6A0m.js} +3 -3
- package/dist/{tooltip-faf1dIXp.cjs → tooltip-DIerl2vz.cjs} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-CyeJR7cW.js → tree-view-Bswh2RGr.js} +37 -37
- package/dist/tree-view-DDX9QjzF.cjs +1 -0
- package/dist/tree-view.cjs +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/visually-hidden-BQMRYGxP.js +14 -0
- package/dist/visually-hidden-DzxxOswl.cjs +1 -0
- package/dist/visually-hidden.cjs +1 -0
- package/dist/visually-hidden.d.ts +1 -0
- package/dist/visually-hidden.js +5 -0
- package/package.json +12 -8
- package/skills/eluan/DESIGN.md +411 -0
- package/skills/eluan/SKILL.md +202 -0
- package/skills/eluan/components/accordion.md +212 -0
- package/skills/eluan/components/action-popover.md +266 -0
- package/skills/eluan/components/aspect-ratio.md +169 -0
- package/skills/eluan/components/avatar.md +277 -0
- package/skills/eluan/components/badge.md +190 -0
- package/skills/eluan/components/banner.md +247 -0
- package/skills/eluan/components/box.md +166 -0
- package/skills/eluan/components/breadcrumb.md +240 -0
- package/skills/eluan/components/button.md +214 -0
- package/skills/eluan/components/calendar.md +192 -0
- package/skills/eluan/components/card.md +271 -0
- package/skills/eluan/components/carousel.md +274 -0
- package/skills/eluan/components/checkbox-group.md +228 -0
- package/skills/eluan/components/checkbox.md +226 -0
- package/skills/eluan/components/code-block.md +193 -0
- package/skills/eluan/components/collapsible.md +240 -0
- package/skills/eluan/components/command.md +359 -0
- package/skills/eluan/components/context-menu.md +296 -0
- package/skills/eluan/components/credit-card-input.md +217 -0
- package/skills/eluan/components/date-picker.md +255 -0
- package/skills/eluan/components/date-time-picker.md +196 -0
- package/skills/eluan/components/decimal-input.md +232 -0
- package/skills/eluan/components/dialog.md +322 -0
- package/skills/eluan/components/drawer.md +292 -0
- package/skills/eluan/components/dropdown-menu.md +450 -0
- package/skills/eluan/components/email-input.md +200 -0
- package/skills/eluan/components/fieldset.md +219 -0
- package/skills/eluan/components/file-input.md +249 -0
- package/skills/eluan/components/footer.md +290 -0
- package/skills/eluan/components/form-label.md +254 -0
- package/skills/eluan/components/grid.md +192 -0
- package/skills/eluan/components/header.md +242 -0
- package/skills/eluan/components/hover-card.md +215 -0
- package/skills/eluan/components/icon.md +161 -0
- package/skills/eluan/components/input-otp.md +227 -0
- package/skills/eluan/components/input.md +249 -0
- package/skills/eluan/components/kbd.md +216 -0
- package/skills/eluan/components/media.md +244 -0
- package/skills/eluan/components/menubar.md +300 -0
- package/skills/eluan/components/multi-select.md +221 -0
- package/skills/eluan/components/navigation-drawer.md +297 -0
- package/skills/eluan/components/navigation-menu.md +291 -0
- package/skills/eluan/components/number-input.md +190 -0
- package/skills/eluan/components/pagination.md +262 -0
- package/skills/eluan/components/password-input.md +218 -0
- package/skills/eluan/components/phone-input.md +205 -0
- package/skills/eluan/components/popover.md +250 -0
- package/skills/eluan/components/progress.md +185 -0
- package/skills/eluan/components/radio-group.md +232 -0
- package/skills/eluan/components/rich-text.md +195 -0
- package/skills/eluan/components/row.md +174 -0
- package/skills/eluan/components/scroll-area.md +203 -0
- package/skills/eluan/components/search-input.md +281 -0
- package/skills/eluan/components/segmented-control.md +201 -0
- package/skills/eluan/components/select.md +296 -0
- package/skills/eluan/components/separator.md +179 -0
- package/skills/eluan/components/sheet.md +326 -0
- package/skills/eluan/components/skeleton.md +202 -0
- package/skills/eluan/components/slider.md +195 -0
- package/skills/eluan/components/spinner.md +187 -0
- package/skills/eluan/components/stack.md +158 -0
- package/skills/eluan/components/stepper.md +236 -0
- package/skills/eluan/components/switch.md +218 -0
- package/skills/eluan/components/table.md +348 -0
- package/skills/eluan/components/tabs.md +277 -0
- package/skills/eluan/components/textarea.md +202 -0
- package/skills/eluan/components/time-input.md +181 -0
- package/skills/eluan/components/toast.md +251 -0
- package/skills/eluan/components/toggle-group.md +241 -0
- package/skills/eluan/components/toggle.md +198 -0
- package/skills/eluan/components/tooltip.md +222 -0
- package/skills/eluan/components/tree-view.md +213 -0
- package/skills/eluan/components/typography.md +210 -0
- package/skills/eluan/components/visually-hidden.md +132 -0
- package/skills/eluan/foundations/colour.md +257 -0
- package/skills/eluan/foundations/elevation.md +86 -0
- package/skills/eluan/foundations/iconography.md +70 -0
- package/skills/eluan/foundations/look.md +135 -0
- package/skills/eluan/foundations/motion.md +60 -0
- package/skills/eluan/foundations/radius.md +73 -0
- package/skills/eluan/foundations/spacing.md +98 -0
- package/skills/eluan/foundations/theming.md +212 -0
- package/skills/eluan/foundations/typography.md +169 -0
- package/skills/eluan/patterns/app-shell.md +222 -0
- package/skills/eluan/patterns/dashboard.md +249 -0
- package/skills/eluan/patterns/empty-states.md +78 -0
- package/skills/eluan/patterns/feedback.md +95 -0
- package/skills/eluan/patterns/forms.md +138 -0
- package/skills/eluan/patterns/navigation.md +96 -0
- package/skills/eluan/patterns/page-layout.md +185 -0
- package/dist/badge-DXKWztL-.cjs +0 -1
- package/dist/banner-COlEFRuK.cjs +0 -1
- package/dist/button-Ny6OF8Un.cjs +0 -1
- package/dist/calendar-7LX5YGGT.cjs +0 -76
- package/dist/card-BC_4C3ns.js +0 -70
- package/dist/card-C88--zB4.cjs +0 -1
- package/dist/command-BCl0seLL.cjs +0 -9
- package/dist/command-Chs5VlBL.js +0 -132
- package/dist/context-menu-1WehRCpR.cjs +0 -1
- package/dist/decimal-input-BLmifKF2.cjs +0 -1
- package/dist/decimal-input-yTk35W_5.js +0 -177
- package/dist/dialog-B8eWKqzS.js +0 -64
- package/dist/dialog-DWYtFhZl.cjs +0 -1
- package/dist/dropdown-menu-_h_fqgvS.cjs +0 -1
- package/dist/dropdown-menu-p0NkOoTP.js +0 -115
- package/dist/fieldset-C3aAINhi.cjs +0 -1
- package/dist/file-input-D62FEnKg.cjs +0 -1
- package/dist/header-CiZQY_7S.cjs +0 -1
- package/dist/hover-card-C_FCzE41.js +0 -21
- package/dist/input-BrGJn-D9.cjs +0 -1
- package/dist/input-Cccufiqn.js +0 -128
- package/dist/input-otp-DcZ7wyjs.cjs +0 -1
- package/dist/menubar-CKWQEl7c.cjs +0 -1
- package/dist/multi-select-B6NBbDCW.js +0 -85
- package/dist/multi-select-kcoUbSwE.cjs +0 -1
- package/dist/navigation-drawer-BbeDYPhu.js +0 -171
- package/dist/navigation-drawer-DOOHfbY3.cjs +0 -1
- package/dist/number-input-Bc7jUsu-.cjs +0 -1
- package/dist/number-input-vICbRc2y.js +0 -66
- package/dist/popover-DPc4rRsR.js +0 -70
- package/dist/popover-Db6VOysz.cjs +0 -1
- package/dist/progress-DpQjGEyn.cjs +0 -1
- package/dist/select-1Eb3NSrR.cjs +0 -1
- package/dist/select-DDSYjKtj.js +0 -119
- package/dist/sheet-7NP1LuHy.cjs +0 -1
- package/dist/slider-CZQBAXup.js +0 -16
- package/dist/slider-DdEOapYP.cjs +0 -1
- package/dist/switch-C7EBLT5H.js +0 -9
- package/dist/switch-KzBijHMJ.cjs +0 -1
- package/dist/table-DopzfXYj.js +0 -101
- package/dist/table-xNu_KUaU.cjs +0 -1
- package/dist/tabs-C9NKBmH0.js +0 -22
- package/dist/tabs-DztJ2iVc.cjs +0 -1
- package/dist/textarea-DXUk1b_-.js +0 -8
- package/dist/textarea-Dl-daLHR.cjs +0 -1
- package/dist/time-input-DR2snTgB.cjs +0 -1
- package/dist/toggle-Bvh1v32T.cjs +0 -1
- package/dist/toggle-group-SyHMwO90.cjs +0 -1
- package/dist/tree-view-CNvEc1TT.cjs +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Grid
|
|
3
|
+
use_when: Items go in columns, such as a grid of cards or stat tiles, a page split into main and side columns, or a layout whose column count changes with the viewport.
|
|
4
|
+
instead_of: Table for rows users compare across the same attributes; Row with wrap for tags or chips of uneven width; Stack for a single column.
|
|
5
|
+
source: packages/core/src/components/grid.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Grid
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Grid is CSS grid with a `--spacing-*` gap. `cols` takes a column count (1 to 12 equal tracks), a raw `grid-template-columns` value for uneven tracks, or an object per breakpoint, mobile first, keyed by Eluan's breakpoint names. Its children get `min-width: 0`, so long content can't stretch a column past its share. Like the other layout primitives it draws nothing, takes `Box`'s props (padding, `grow`, `shrink`, `height`, `minHeight`, `position`, `inset`, `overflow`), `as` and `asChild`, and drops `className` and `style`.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- A grid of Cards, stat tiles or media that should line up in columns.
|
|
17
|
+
- A page split into a main column and a side column.
|
|
18
|
+
- A label column beside a value column (`cols="auto minmax(0, 1fr)"`).
|
|
19
|
+
- Any layout whose column count changes with the viewport width.
|
|
20
|
+
|
|
21
|
+
### When not to use
|
|
22
|
+
|
|
23
|
+
- Rows users compare across the same attributes → [Table](./table.md).
|
|
24
|
+
- Tags, Badges or chips of different widths → [Row](./row.md) with `wrap`.
|
|
25
|
+
- One column → [Stack](./stack.md).
|
|
26
|
+
- Hierarchical data → [TreeView](./tree-view.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Container**: one element (`div` by default) laid out as a grid. Each direct child is a grid item and gets `min-width: 0`.
|
|
31
|
+
|
|
32
|
+
## 4. Variants
|
|
33
|
+
|
|
34
|
+
Grid has no `variant`. `cols` sets the tracks:
|
|
35
|
+
|
|
36
|
+
| `cols` | Gives |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| unset | One full-width column |
|
|
39
|
+
| `3` | Three equal columns (`repeat(3, minmax(0, 1fr))`); counts run 1 to 12 |
|
|
40
|
+
| `"auto minmax(0, 1fr)"` | Any `grid-template-columns` value |
|
|
41
|
+
| `{ base: 1, m: 2, l: 4 }` | One column, two from 748px, four from 1024px |
|
|
42
|
+
|
|
43
|
+
`align` sets how items sit in their row: `start`, `center`, `end`, `stretch` (the default when unset) or `baseline`.
|
|
44
|
+
|
|
45
|
+
## 5. Sizes
|
|
46
|
+
|
|
47
|
+
Grid has no size prop. `gap` sets the space between rows and columns and `pad`, `padX`, `padY` set padding, each a `--spacing-*` step from `"none"` to `"4xl"`. `gap` defaults to `"md"`.
|
|
48
|
+
|
|
49
|
+
Breakpoints, each a minimum width (`breakpoints` in `@eluan/tokens`):
|
|
50
|
+
|
|
51
|
+
| `xxs` | `xs` | `s` | `m` | `l` | `xl` | `2xl` | `3xl` | `4xl` |
|
|
52
|
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
53
|
+
| 320px | 414px | 480px | 748px | 1024px | 1280px | 1440px | 1920px | 2580px |
|
|
54
|
+
|
|
55
|
+
A level you don't set inherits the nearest level below it: `{ base: 2, l: 4 }` is two columns up to 1024px and four from there on.
|
|
56
|
+
|
|
57
|
+
## 6. States
|
|
58
|
+
|
|
59
|
+
| State | Looks like | Notes |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| Default | Items in columns with the gap | Static. Grid has no interactive states. |
|
|
62
|
+
|
|
63
|
+
## 7. Content guidelines
|
|
64
|
+
|
|
65
|
+
- Start from the smallest screen: `base` is the phone layout, and each breakpoint adds columns as space allows.
|
|
66
|
+
- Keep items in one grid the same kind (all stat tiles, all Cards), so rows read evenly.
|
|
67
|
+
- Two to four columns suit Cards; tiles with a single number can go to five or six on wide screens.
|
|
68
|
+
|
|
69
|
+
## 8. Rules
|
|
70
|
+
|
|
71
|
+
1. Use Eluan's breakpoint names (`s`, `m`, `l`, …), never Tailwind's (`sm`, `md`, `lg`) or px media queries.
|
|
72
|
+
2. Use a column count for equal columns. Use a raw template only for uneven tracks, and write `minmax(0, 1fr)`, not a bare `1fr`, so content can't widen a track.
|
|
73
|
+
3. Space items with `gap`, never margins.
|
|
74
|
+
4. Don't use Grid for tabular data that users compare across rows; use Table.
|
|
75
|
+
5. Don't pass `className` or `style`; they're dropped. To make one item span two columns, wrap the item in your own element with `grid-column: span 2`.
|
|
76
|
+
6. A Grid inside a Grid keeps its own `cols`; nested grids don't inherit the parent's columns.
|
|
77
|
+
|
|
78
|
+
## 9. Dos and don'ts
|
|
79
|
+
|
|
80
|
+
**Do:** give the grid a mobile-first column count.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
<Grid cols={{ base: 1, m: 2, l: 4 }} gap="lg">
|
|
84
|
+
{plans.map((plan) => <PlanCard key={plan.id} plan={plan} />)}
|
|
85
|
+
</Grid>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Don't:** use utility-framework breakpoint names or a hand-written media query.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Grid cols={{ base: 1, md: 2, lg: 4 }}>{cards}</Grid>
|
|
92
|
+
<div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 16 }}>{cards}</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 10. Accessibility
|
|
96
|
+
|
|
97
|
+
- Role: none by default. For a list of items, pass `role="list"` and give each child `role="listitem"`, or use `as="ul"` with `li` children (the browser's list margin stays).
|
|
98
|
+
- Order: visual order is DOM order; Grid doesn't place items out of order. Keep the DOM in reading order.
|
|
99
|
+
- Keyboard: none of its own. Tab order follows the DOM, row by row.
|
|
100
|
+
|
|
101
|
+
## 11. Behaviour
|
|
102
|
+
|
|
103
|
+
- Responsive: column counts change at the breakpoints you set; unset levels inherit the level below.
|
|
104
|
+
- Density: `gap` and padding follow `data-spacing`.
|
|
105
|
+
- Overflow: children have `min-width: 0`, so long words or `truncate` text stay inside their column.
|
|
106
|
+
- Motion: none.
|
|
107
|
+
|
|
108
|
+
## 12. API
|
|
109
|
+
|
|
110
|
+
<!-- api:start -->
|
|
111
|
+
| Prop | Type | Default | Description |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| `cols` | `GridColumns \| GridResponsiveColumns` | | Columns: a count, a template, or per breakpoint. Defaults to one column. |
|
|
114
|
+
| `gap` | `"none" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | `"md"` | Space between rows and columns, as a `--spacing-*` step. |
|
|
115
|
+
| `align` | `"start" \| "center" \| "end" \| "stretch" \| "baseline"` | | Cross-axis alignment of items in their row. Unset, items stretch. |
|
|
116
|
+
| `pad` | `"none" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | | Padding on every side. `padX` / `padY` override it per axis. |
|
|
117
|
+
| `padX` | `"none" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | | Inline padding (left and right in LTR). |
|
|
118
|
+
| `padY` | `"none" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | | Block padding (top and bottom). |
|
|
119
|
+
| `grow` | `boolean` | | Take the remaining space in a flex parent: `flex: 1 1 0` with `min-width: 0`. |
|
|
120
|
+
| `shrink` | `boolean` | | `false` keeps the element at its content size in a flex parent (`flex-shrink: 0`). |
|
|
121
|
+
| `height` | `"full" \| "screen"` | | `full` fills the parent's height; `screen` fills the viewport (`100dvh`, so mobile browser bars don't cover the bottom). |
|
|
122
|
+
| `minHeight` | `"full" \| "screen"` | | At least the parent's height (`full`) or the viewport's (`screen`). |
|
|
123
|
+
| `position` | `"relative" \| "absolute"` | | `relative` makes this the anchor for `inset` children; `absolute` takes it out of flow. |
|
|
124
|
+
| `inset` | `"fill" \| "top" \| "bottom"` | | Pin to the nearest positioned ancestor: `fill` covers it, `top` and `bottom` run along that edge at full width. Sets `position: absolute`. |
|
|
125
|
+
| `overflow` | `"hidden" \| "auto"` | | `hidden` clips the content; `auto` scrolls it when it doesn't fit. |
|
|
126
|
+
| `as` | `"div" \| "span" \| "section" \| "article" \| "aside" \| "header" \| "footer" \| "main" \| "nav" \| "form" \| "fieldset" \| "label" \| "p" \| "ul" \| "ol" \| "li" \| "dl" \| "dt" \| "dd"` | | Element override. Defaults to `div`. |
|
|
127
|
+
| `asChild` | `boolean` | `false` | Render the child element instead (Radix Slot); the layout styles move onto it. |
|
|
128
|
+
| `...props` | `HTMLAttributes<HTMLElement>` without `className`, `style` | | Native attributes: `id`, `role`, `aria-*`, `data-*`, event handlers. |
|
|
129
|
+
<!-- api:end -->
|
|
130
|
+
|
|
131
|
+
`GridColumns` is a count from 1 to 12 or a template string. `GridResponsiveColumns` is `{ base?, xxs?, xs?, s?, m?, l?, xl?, "2xl"?, "3xl"?, "4xl"? }`, each a `GridColumns`.
|
|
132
|
+
|
|
133
|
+
## 13. Examples
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Grid, Stack, Typography } from "@eluan/core";
|
|
137
|
+
|
|
138
|
+
const stats = [
|
|
139
|
+
{ label: "Revenue", value: "$48,210" },
|
|
140
|
+
{ label: "Active users", value: "2,318" },
|
|
141
|
+
{ label: "Open invoices", value: "14" },
|
|
142
|
+
{ label: "Projects", value: "36" },
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
export function DashboardOverview() {
|
|
146
|
+
return (
|
|
147
|
+
<Stack gap="2xl">
|
|
148
|
+
<Grid cols={{ base: 2, l: 4 }} gap="lg">
|
|
149
|
+
{stats.map((stat) => (
|
|
150
|
+
<Card key={stat.label}>
|
|
151
|
+
<CardHeader>
|
|
152
|
+
<CardDescription>{stat.label}</CardDescription>
|
|
153
|
+
<CardTitle>{stat.value}</CardTitle>
|
|
154
|
+
</CardHeader>
|
|
155
|
+
</Card>
|
|
156
|
+
))}
|
|
157
|
+
</Grid>
|
|
158
|
+
|
|
159
|
+
<Grid cols={{ base: 1, l: "minmax(0, 2fr) minmax(0, 1fr)" }} gap="xl" align="start">
|
|
160
|
+
<Card>
|
|
161
|
+
<CardHeader>
|
|
162
|
+
<Typography variant="subheading" as="h3" size="base">Recent invoices</Typography>
|
|
163
|
+
</CardHeader>
|
|
164
|
+
<CardContent>
|
|
165
|
+
<Typography size="sm" tone="muted">Two of four paid.</Typography>
|
|
166
|
+
</CardContent>
|
|
167
|
+
</Card>
|
|
168
|
+
<Card>
|
|
169
|
+
<CardHeader>
|
|
170
|
+
<Typography variant="subheading" as="h3" size="base">Notes</Typography>
|
|
171
|
+
</CardHeader>
|
|
172
|
+
<CardContent>
|
|
173
|
+
<Typography size="sm" tone="muted">The billing run moves to Friday this month.</Typography>
|
|
174
|
+
</CardContent>
|
|
175
|
+
</Card>
|
|
176
|
+
</Grid>
|
|
177
|
+
</Stack>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 14. Related components
|
|
183
|
+
|
|
184
|
+
- [Stack](./stack.md): one column.
|
|
185
|
+
- [Row](./row.md): one line, or wrapping chips of uneven width.
|
|
186
|
+
- [Card](./card.md): the usual grid item.
|
|
187
|
+
- [Table](./table.md): rows users compare.
|
|
188
|
+
- [Skeleton](./skeleton.md): placeholders in the same Grid while items load.
|
|
189
|
+
|
|
190
|
+
## 15. Common agent mistakes
|
|
191
|
+
|
|
192
|
+
_Filled from evals._
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Header
|
|
3
|
+
use_when: A site or simple app needs a top bar with a logo, a flat list of page links and actions such as search or sign-in, collapsing to a menu on small screens.
|
|
4
|
+
instead_of: NavigationMenu for links with dropdown panels; NavigationDrawer for an app shell with a sidebar; Tabs for switching views inside a page.
|
|
5
|
+
source: packages/core/src/components/header.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Header
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Header is a responsive top bar. It renders a `<header>` with three slots: a logo, a row of nav links built from an `items` array, and free-form `actions` (search, sign-in, a primary call to action). Below `mobileBreakpoint` the links and actions move into a right-side Sheet opened by a menu button. Nav links render as ghost Buttons; the active one uses the filled `secondary` variant.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- The top bar of a marketing site, docs site or simple product with a handful of top-level pages.
|
|
17
|
+
- A top nav that needs a search field or sign-in buttons alongside the links (put them in `actions`).
|
|
18
|
+
- A small app shell whose sections fit in one row of links.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- Top-level links that open dropdown panels of sub-links → use [NavigationMenu](./navigation-menu.md). Header's `NavItem.children` isn't rendered.
|
|
23
|
+
- An app with many sections, nested navigation or a collapsible sidebar → use [NavigationDrawer](./navigation-drawer.md) (`NavigationDrawerLayout` gives a sidebar and content shell with its own top bar).
|
|
24
|
+
- Switching between views of the same page → use [Tabs](./tabs.md) or [SegmentedControl](./segmented-control.md).
|
|
25
|
+
- Showing where a page sits in a hierarchy → use [Breadcrumb](./breadcrumb.md).
|
|
26
|
+
- The bottom of a page → use [Footer](./footer.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Bar**: the `<header>` element, full width, `--container-bg`, no border. Your extra props land here.
|
|
31
|
+
2. **Container**: centres the content up to `80rem`, with `--spacing-md` side padding and a height of 1.5 × `--size-xl`.
|
|
32
|
+
3. **Logo** (`logo`): your node at the start of the bar.
|
|
33
|
+
4. **Nav** (`items`): a `<nav>` of small Buttons, one per NavItem. Items with `href` render links; items without render buttons.
|
|
34
|
+
5. **Actions** (`actions`): your node at the end of the bar, laid out in a row with a `--spacing-md` gap.
|
|
35
|
+
6. **Menu button**: below the breakpoint, a ghost icon Button with a menu icon and the visually hidden label "Toggle menu".
|
|
36
|
+
7. **Mobile menu**: a right-side Sheet holding the nav as full-width, start-aligned Buttons and, under a top border, the actions in a column.
|
|
37
|
+
|
|
38
|
+
## 4. Variants
|
|
39
|
+
|
|
40
|
+
Header has no `variant` prop. Two booleans change the look:
|
|
41
|
+
|
|
42
|
+
| Prop | Use for |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| default | An opaque bar with no border, in normal page flow. |
|
|
45
|
+
| `transparent` | A bar laid over a hero image or coloured section: no background. |
|
|
46
|
+
| `sticky` | A bar that stays pinned to the top of its scrolling container (`z-index: 50`). Combine with either look. |
|
|
47
|
+
|
|
48
|
+
## 5. Sizes
|
|
49
|
+
|
|
50
|
+
Header has no size prop. The bar height is 1.5 × `--size-xl`, so it follows density. Desktop nav links use Button `size="sm"`. `mobileBreakpoint` sets where the bar collapses:
|
|
51
|
+
|
|
52
|
+
| `mobileBreakpoint` | Collapses below | Use when |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `sm` | 640px | Two or three short links and one action. |
|
|
55
|
+
| `md` | 768px (default) | Most headers. |
|
|
56
|
+
| `lg` | 1024px | Many links, or a search field in `actions`. |
|
|
57
|
+
|
|
58
|
+
## 6. States
|
|
59
|
+
|
|
60
|
+
| State | Looks like | Notes |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| Default | Ghost links on `--container-bg` | |
|
|
63
|
+
| Hover | Ghost Button hover background on the link | |
|
|
64
|
+
| Focus | Button focus outline on links, actions and the menu button | Never remove or restyle the focus ring. |
|
|
65
|
+
| Active item | Filled `secondary` Button | `href` items also get `aria-current="page"`. |
|
|
66
|
+
| Collapsed | Logo and menu button only | Below `mobileBreakpoint`. |
|
|
67
|
+
| Menu open | Sheet slides in from the right over an overlay | Choosing a nav item closes it. |
|
|
68
|
+
|
|
69
|
+
## 7. Content guidelines
|
|
70
|
+
|
|
71
|
+
- Label links with short nouns for the destination, in sentence case: "Pricing", "Docs", "Customers".
|
|
72
|
+
- Keep labels to one or two words, and keep each label unique.
|
|
73
|
+
- Keep the row short; links never wrap. The stories and docs show four or five.
|
|
74
|
+
- Put one primary Button in `actions`, with secondary actions (Sign in) as `ghost`. The docs demo uses `size="sm"` for actions so they match the nav links.
|
|
75
|
+
- Give a search field an `aria-label` and a placeholder that says what it searches: "Search projects".
|
|
76
|
+
|
|
77
|
+
| Do | Don't |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| Pricing | Our pricing plans |
|
|
80
|
+
| Docs | Click for documentation |
|
|
81
|
+
| Get started | GET STARTED NOW! |
|
|
82
|
+
|
|
83
|
+
## 8. Rules
|
|
84
|
+
|
|
85
|
+
1. Build the nav with `items`. Header renders only its slots and drops any children you pass.
|
|
86
|
+
2. Mark the current page with `active: true` on exactly one item.
|
|
87
|
+
3. Give every item an `href` when it goes to a page. Items without `href` render buttons and get no `aria-current`.
|
|
88
|
+
4. Don't combine `href` and `onClick` on one item: `onClick` is ignored when `href` is set.
|
|
89
|
+
5. Keep item labels unique; Header uses the label as the React key.
|
|
90
|
+
6. Don't nest `children` in a NavItem; they aren't rendered. Use NavigationMenu for dropdowns.
|
|
91
|
+
7. Put search, sign-in and the primary call to action in `actions`. `actions` renders in the bar and again in the mobile menu while it's open, so control any stateful field (`value` plus `onValueChange`) and don't give it a fixed `id`.
|
|
92
|
+
8. Wrap the logo in a link to the home page with an accessible name (brand text, or an image with `alt`).
|
|
93
|
+
9. Use one Header per page. Put layout (margins, max width) on a wrapper you own; Header drops `className` and `style`.
|
|
94
|
+
|
|
95
|
+
## 9. Dos and don'ts
|
|
96
|
+
|
|
97
|
+
**Do:** describe links as data and mark the current page.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<Header
|
|
101
|
+
logo={<a href="/" aria-label="Northwind home"><NorthwindLogo aria-hidden="true" /></a>}
|
|
102
|
+
items={[
|
|
103
|
+
{ label: "Product", href: "/product", active: true },
|
|
104
|
+
{ label: "Pricing", href: "/pricing" },
|
|
105
|
+
{ label: "Docs", href: "/docs" },
|
|
106
|
+
]}
|
|
107
|
+
actions={<Button size="sm">Get started</Button>}
|
|
108
|
+
/>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Don't:** hand-build the nav as children or nest dropdown items.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<Header>
|
|
115
|
+
<a href="/product">Product</a>
|
|
116
|
+
<a href="/pricing">Pricing</a>
|
|
117
|
+
</Header>
|
|
118
|
+
<Header items={[{ label: "Product", children: [{ label: "Analytics", href: "/analytics" }] }]} />
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Do:** put search in `actions` and control its value.
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
<Header
|
|
125
|
+
items={items}
|
|
126
|
+
actions={
|
|
127
|
+
<div role="search">
|
|
128
|
+
<SearchInput aria-label="Search docs" placeholder="Search docs" value={query} onValueChange={setQuery} onSearch={runSearch} />
|
|
129
|
+
</div>
|
|
130
|
+
}
|
|
131
|
+
/>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Don't:** pass an unlabelled, uncontrolled field with a fixed `id`.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<Header items={items} actions={<input id="search" placeholder="Search..." />} />
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 10. Accessibility
|
|
141
|
+
|
|
142
|
+
- Role: the `<header>` is the page's `banner` landmark when it isn't nested inside `<main>`, `<article>`, `<aside>`, `<nav>` or `<section>`. Nav items are links (`href`) or buttons (no `href`); the active link has `aria-current="page"`.
|
|
143
|
+
- Label: links and buttons take their `label`. The menu button is named "Toggle menu" by visually hidden text. The `<nav>` elements have no `aria-label`, and Header gives you no way to set one.
|
|
144
|
+
- Search: wrap a search field in an element with `role="search"` so it's exposed as a search landmark.
|
|
145
|
+
- Keyboard: Tab moves through the logo, links and actions in order. Enter follows a link; Enter or Space activates a button. In the mobile menu, Escape closes it.
|
|
146
|
+
- Focus: the mobile menu is a modal Sheet: focus moves into it and is trapped while it's open, and returns to the menu button when it closes. The menu button carries `aria-expanded` from Radix Dialog.
|
|
147
|
+
- Mobile menu name: the Sheet has no title, so the dialog has no accessible name and Radix warns in development.
|
|
148
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
149
|
+
|
|
150
|
+
## 11. Behaviour
|
|
151
|
+
|
|
152
|
+
- Responsive: at and above `mobileBreakpoint` the nav and actions show inline; below it they're hidden and the menu button appears. The mobile Sheet is 18.75rem wide on small screens.
|
|
153
|
+
- Overflow and truncation: links don't wrap. If the row overflows just above the breakpoint, raise `mobileBreakpoint`.
|
|
154
|
+
- Sticky: `sticky` pins the bar within its nearest scrolling container, not always the viewport.
|
|
155
|
+
- Motion: the mobile Sheet slides in and out; Buttons have their own colour transitions. Don't add your own.
|
|
156
|
+
- Choosing an item in the mobile menu runs its `onClick` (if any) and closes the menu.
|
|
157
|
+
|
|
158
|
+
## 12. API
|
|
159
|
+
|
|
160
|
+
<!-- api:start -->
|
|
161
|
+
### Header
|
|
162
|
+
|
|
163
|
+
| Prop | Type | Default | Description |
|
|
164
|
+
| --- | --- | --- | --- |
|
|
165
|
+
| `logo` | `ReactNode` | | Brand element at the start of the bar. |
|
|
166
|
+
| `items` | `NavItem[]` | `[]` | Nav links, in order. |
|
|
167
|
+
| `actions` | `ReactNode` | | Elements at the end of the bar (search, sign-in, call to action). Also rendered in the mobile menu. |
|
|
168
|
+
| `sticky` | `boolean` | `false` | Pins the bar to the top of its scrolling container. |
|
|
169
|
+
| `transparent` | `boolean` | `false` | Removes the background. |
|
|
170
|
+
| `mobileBreakpoint` | `"sm" \| "md" \| "lg"` | `"md"` | Viewport width below which the nav collapses into the menu (640, 768, 1024px). |
|
|
171
|
+
| `...props` | `HTMLAttributes<HTMLElement>` without `className`, `style` | | Applied to the `<header>`: `id`, `aria-*`, `data-*`. Children are dropped. `className` and `style` are omitted. |
|
|
172
|
+
|
|
173
|
+
### NavItem
|
|
174
|
+
|
|
175
|
+
| Prop | Type | Default | Description |
|
|
176
|
+
| --- | --- | --- | --- |
|
|
177
|
+
| `label` | `string` | | Visible text and accessible name. Also the React key; keep it unique. Required. |
|
|
178
|
+
| `href` | `string` | | Renders the item as a link. `onClick` is ignored when set. |
|
|
179
|
+
| `onClick` | `() => void` | | Renders the item as a button when there's no `href`. |
|
|
180
|
+
| `active` | `boolean` | `false` | Highlights the item; adds `aria-current="page"` on links. |
|
|
181
|
+
| `children` | `NavItem[]` | | Declared but not rendered. |
|
|
182
|
+
<!-- api:end -->
|
|
183
|
+
|
|
184
|
+
## 13. Examples
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
import { useState } from "react";
|
|
188
|
+
import { Button, Header, SearchInput, Typography, type NavItem } from "@eluan/core";
|
|
189
|
+
|
|
190
|
+
const items: NavItem[] = [
|
|
191
|
+
{ label: "Projects", href: "/projects", active: true },
|
|
192
|
+
{ label: "Reports", href: "/reports" },
|
|
193
|
+
{ label: "Team", href: "/team" },
|
|
194
|
+
{ label: "Settings", href: "/settings" },
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
export function AppHeader({ onSearch }: { onSearch: (query: string) => void }) {
|
|
198
|
+
const [query, setQuery] = useState("");
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<Header
|
|
202
|
+
sticky
|
|
203
|
+
mobileBreakpoint="lg"
|
|
204
|
+
logo={
|
|
205
|
+
<a href="/" style={{ color: "inherit", textDecoration: "none" }}>
|
|
206
|
+
<Typography as="span" variant="lead" weight="semibold">Northwind</Typography>
|
|
207
|
+
</a>
|
|
208
|
+
}
|
|
209
|
+
items={items}
|
|
210
|
+
actions={
|
|
211
|
+
<>
|
|
212
|
+
<div role="search">
|
|
213
|
+
<SearchInput
|
|
214
|
+
aria-label="Search projects"
|
|
215
|
+
placeholder="Search projects"
|
|
216
|
+
value={query}
|
|
217
|
+
onValueChange={setQuery}
|
|
218
|
+
onSearch={onSearch}
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
<Button asChild size="sm">
|
|
222
|
+
<a href="/projects/new">New project</a>
|
|
223
|
+
</Button>
|
|
224
|
+
</>
|
|
225
|
+
}
|
|
226
|
+
/>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## 14. Related components
|
|
232
|
+
|
|
233
|
+
- [NavigationMenu](./navigation-menu.md): top-level links with dropdown panels.
|
|
234
|
+
- [NavigationDrawer](./navigation-drawer.md): a collapsible sidebar shell for apps with many sections.
|
|
235
|
+
- [SearchInput](./search-input.md): the search field to place in `actions`.
|
|
236
|
+
- [Sheet](./sheet.md): the panel the mobile menu opens in.
|
|
237
|
+
- [Button](./button.md): renders every nav item and the menu button.
|
|
238
|
+
- [Footer](./footer.md): the matching bottom-of-page component.
|
|
239
|
+
|
|
240
|
+
## 15. Common agent mistakes
|
|
241
|
+
|
|
242
|
+
_Filled from evals._
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: HoverCard
|
|
3
|
+
use_when: A pointer user rests on a link or mention and sees a read-only preview of what it points to, such as a profile card.
|
|
4
|
+
instead_of: Popover for anything interactive or essential; Tooltip for a short text hint; a page or Sheet for full details.
|
|
5
|
+
source: packages/core/src/components/hover-card.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# HoverCard
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
HoverCard shows a floating preview when the pointer rests on its trigger, or when the trigger gets keyboard focus. It's built on Radix HoverCard and portals a 16rem panel next to the trigger. The preview is extra: it never opens on touch, and nothing inside it can be reached with the keyboard.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- A profile preview on a username or @mention: avatar, name, short bio, join date.
|
|
17
|
+
- A preview of a linked record (an issue, a document) next to its link.
|
|
18
|
+
- Supplementary context the user could also get by following the link.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- The content has buttons, links or fields → use [Popover](./popover.md).
|
|
23
|
+
- The information is essential, or needed on touch screens → show it inline, or use [Popover](./popover.md) on click.
|
|
24
|
+
- A one-line hint or label for a control → use [Tooltip](./tooltip.md).
|
|
25
|
+
- Full details → link to the page, or open a [Sheet](./sheet.md).
|
|
26
|
+
|
|
27
|
+
## 3. Anatomy
|
|
28
|
+
|
|
29
|
+
1. **HoverCard**: the root. Holds open state and the open and close delays.
|
|
30
|
+
2. **HoverCardTrigger**: the element that opens the card. Renders an `<a>` by default; give it an `href`, or use `asChild` around your own link.
|
|
31
|
+
3. **HoverCardContent**: the floating panel. Renders in a portal with `--container-bg`, a `--container-border` border, `--curves-md` corners, `--spacing-md` padding and `--container-fg` text, 16rem wide.
|
|
32
|
+
4. **Your content**: read-only preview content inside HoverCardContent.
|
|
33
|
+
|
|
34
|
+
## 4. Variants
|
|
35
|
+
|
|
36
|
+
No variants. The panel's look is fixed; compose its content with Avatar and Typography.
|
|
37
|
+
|
|
38
|
+
## 5. Sizes
|
|
39
|
+
|
|
40
|
+
No size prop. The panel is a fixed 16rem wide and as tall as its content.
|
|
41
|
+
|
|
42
|
+
## 6. States
|
|
43
|
+
|
|
44
|
+
| State | Looks like | Notes |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Closed | Only the trigger renders | Trigger has `data-state="closed"`. |
|
|
47
|
+
| Open | Panel floats beside the trigger | Opens 700ms after the pointer enters, or at once on keyboard focus. Closes 300ms after the pointer leaves both trigger and card, or on blur. |
|
|
48
|
+
| Focus | The trigger's own focus style | Never remove or restyle the focus ring. |
|
|
49
|
+
|
|
50
|
+
## 7. Content guidelines
|
|
51
|
+
|
|
52
|
+
- Preview the destination: who or what it is, plus one or two facts. "Maya Chen, Design lead, Joined March 2024."
|
|
53
|
+
- Keep it short enough to read at a glance. No paragraphs.
|
|
54
|
+
- No buttons, links or fields; they can't be reached by keyboard.
|
|
55
|
+
- Sentence case.
|
|
56
|
+
|
|
57
|
+
| Do | Don't |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| Avatar, name, role, one meta line | A full profile with Follow and Message buttons |
|
|
60
|
+
| "Joined March 2024" | "Click here to see more about this user!" |
|
|
61
|
+
|
|
62
|
+
## 8. Rules
|
|
63
|
+
|
|
64
|
+
1. Make the trigger a real link to the full content (`href`, or `asChild` around your router's link), so the card is a shortcut, not the only route.
|
|
65
|
+
2. Never put the only copy of information or an action in a HoverCard. Touch users never see it, and keyboard users can't reach its contents.
|
|
66
|
+
3. Keep the content read-only. HoverCard sets `tabindex="-1"` on every focusable element inside it.
|
|
67
|
+
4. Use Avatar and Typography inside the card; don't hand-style text.
|
|
68
|
+
5. Never pass `className` or `style` to HoverCard parts; they're dropped. Lay out content with your own wrapper inside HoverCardContent.
|
|
69
|
+
|
|
70
|
+
## 9. Dos and don'ts
|
|
71
|
+
|
|
72
|
+
**Do:** put a read-only preview on a link.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<HoverCard>
|
|
76
|
+
<HoverCardTrigger href="/people/maya-chen">@maya</HoverCardTrigger>
|
|
77
|
+
<HoverCardContent>
|
|
78
|
+
<Typography variant="label" as="p">Maya Chen</Typography>
|
|
79
|
+
<Typography variant="caption" tone="muted">Design lead · Joined March 2024</Typography>
|
|
80
|
+
</HoverCardContent>
|
|
81
|
+
</HoverCard>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Don't:** put actions in it.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
<HoverCardContent>
|
|
88
|
+
<Typography variant="label" as="p">Maya Chen</Typography>
|
|
89
|
+
<Button>Follow</Button>
|
|
90
|
+
<Button variant="outline">Message</Button>
|
|
91
|
+
</HoverCardContent>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Do:** use a Popover when the preview needs actions.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<Popover>
|
|
98
|
+
<PopoverTrigger asChild>
|
|
99
|
+
<Button type="button" variant="link">@maya</Button>
|
|
100
|
+
</PopoverTrigger>
|
|
101
|
+
<PopoverContent aria-label="Maya Chen">{/* profile with Follow and Message */}</PopoverContent>
|
|
102
|
+
</Popover>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Don't:** use a non-focusable trigger; keyboard users can't open the card.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<HoverCardTrigger asChild>
|
|
109
|
+
<span>@maya</span>
|
|
110
|
+
</HoverCardTrigger>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 10. Accessibility
|
|
114
|
+
|
|
115
|
+
- Role: the panel has no role, and its contents can't be focused. Treat it as invisible to screen reader and keyboard users.
|
|
116
|
+
- Label: the trigger's own text names it; give links descriptive text.
|
|
117
|
+
- Keyboard: focusing the trigger opens the card and moving focus away closes it. Escape closes it.
|
|
118
|
+
- Focus: stays on the trigger. Nothing inside the card is in the tab order.
|
|
119
|
+
- Touch: touch input never opens the card.
|
|
120
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
121
|
+
|
|
122
|
+
## 11. Behaviour
|
|
123
|
+
|
|
124
|
+
- Placement: below the trigger and centred on it (`side="bottom"`, `align="center"`), 4px away, keeping 8px from the viewport edge. It flips and shifts to stay inside the viewport.
|
|
125
|
+
- Timing: `openDelay` 700ms and `closeDelay` 300ms by default. The pointer can move from the trigger onto the card without it closing.
|
|
126
|
+
- Overflow and truncation: no maximum height. Keep content short.
|
|
127
|
+
- Motion: appears and disappears without animation. Don't add your own.
|
|
128
|
+
- Portal: HoverCardContent mounts in `document.body`. In a scoped theme, pass `portalContainer` to the scoped EluanProvider or wrap the region in `PortalContainerProvider`; `container` overrides it for one card. See `../foundations/theming.md`.
|
|
129
|
+
|
|
130
|
+
## 12. API
|
|
131
|
+
|
|
132
|
+
<!-- api:start -->
|
|
133
|
+
### HoverCard
|
|
134
|
+
|
|
135
|
+
| Prop | Type | Default | Description |
|
|
136
|
+
| --- | --- | --- | --- |
|
|
137
|
+
| `open` | `boolean` | | Controlled open state. |
|
|
138
|
+
| `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. |
|
|
139
|
+
| `onOpenChange` | `(open: boolean) => void` | | Called on every open and close. |
|
|
140
|
+
| `openDelay` | `number` | `700` | Milliseconds of hover before it opens. |
|
|
141
|
+
| `closeDelay` | `number` | `300` | Milliseconds before it closes after the pointer leaves. |
|
|
142
|
+
|
|
143
|
+
### HoverCardTrigger
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Default | Description |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| `asChild` | `boolean` | `false` | Renders the child (your link) instead of a bare `<a>`. |
|
|
148
|
+
| `...props` | Radix `HoverCard.Trigger` props | | Anchor attributes: `href`, `aria-*`. |
|
|
149
|
+
|
|
150
|
+
### HoverCardContent
|
|
151
|
+
|
|
152
|
+
| Prop | Type | Default | Description |
|
|
153
|
+
| --- | --- | --- | --- |
|
|
154
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Preferred side of the trigger. |
|
|
155
|
+
| `align` | `"start" \| "center" \| "end"` | `"center"` | Alignment along that side. |
|
|
156
|
+
| `sideOffset` | `number` | `4` | Distance from the trigger in px. |
|
|
157
|
+
| `collisionPadding` | `number \| Partial<Record<Side, number>>` | `8` | Space to keep from the viewport edges. |
|
|
158
|
+
| `container` | `HTMLElement \| null` | nearest `PortalContainerProvider`, then `document.body` | Element to portal into. |
|
|
159
|
+
| `...props` | Radix `HoverCard.Content` props without `className`, `style` | | |
|
|
160
|
+
<!-- api:end -->
|
|
161
|
+
|
|
162
|
+
## 13. Examples
|
|
163
|
+
|
|
164
|
+
A comment author's name that previews their profile.
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import {
|
|
168
|
+
Avatar,
|
|
169
|
+
AvatarFallback,
|
|
170
|
+
AvatarImage,
|
|
171
|
+
HoverCard,
|
|
172
|
+
HoverCardContent,
|
|
173
|
+
HoverCardTrigger,
|
|
174
|
+
Typography,
|
|
175
|
+
} from "@eluan/core";
|
|
176
|
+
|
|
177
|
+
type Person = { handle: string; name: string; role: string; joined: string; avatarUrl: string; initials: string };
|
|
178
|
+
|
|
179
|
+
export function CommentAuthor({ person }: { person: Person }) {
|
|
180
|
+
return (
|
|
181
|
+
<HoverCard>
|
|
182
|
+
<HoverCardTrigger href={`/people/${person.handle}`}>{person.name}</HoverCardTrigger>
|
|
183
|
+
<HoverCardContent align="start">
|
|
184
|
+
<div style={{ display: "flex", gap: "var(--spacing-md)" }}>
|
|
185
|
+
<Avatar>
|
|
186
|
+
<AvatarImage src={person.avatarUrl} alt="" />
|
|
187
|
+
<AvatarFallback>{person.initials}</AvatarFallback>
|
|
188
|
+
</Avatar>
|
|
189
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-xxs)" }}>
|
|
190
|
+
<Typography variant="label" as="p">
|
|
191
|
+
{person.name}
|
|
192
|
+
</Typography>
|
|
193
|
+
<Typography variant="caption" tone="muted">
|
|
194
|
+
{person.role}
|
|
195
|
+
</Typography>
|
|
196
|
+
<Typography variant="caption" tone="muted">
|
|
197
|
+
Joined {person.joined}
|
|
198
|
+
</Typography>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</HoverCardContent>
|
|
202
|
+
</HoverCard>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## 14. Related components
|
|
208
|
+
|
|
209
|
+
- [Popover](./popover.md): the click-to-open panel for interactive content.
|
|
210
|
+
- [Tooltip](./tooltip.md): a short text hint.
|
|
211
|
+
- [Avatar](./avatar.md) and [Typography](./typography.md): the usual card content.
|
|
212
|
+
|
|
213
|
+
## 15. Common agent mistakes
|
|
214
|
+
|
|
215
|
+
_Filled from evals._
|