@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,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: NavigationDrawer
|
|
3
|
+
use_when: An app needs persistent side navigation between its main sections, collapsible to an icon rail on desktop and a slide-in sheet on phones.
|
|
4
|
+
instead_of: NavigationMenu or Header for a website's top navigation; Tabs to switch views within a page; Sheet or Drawer for temporary side content.
|
|
5
|
+
source: packages/core/src/components/navigation-drawer.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# NavigationDrawer
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
NavigationDrawer is an app's primary side navigation. On screens 768px and wider it's a 14rem sidebar that collapses to an icon-only rail; below 768px it becomes a left [Sheet](./sheet.md) behind a menu button, which closes when the user picks an item. `NavigationDrawerLayout` gives you the whole shell: the provider, the sidebar on the page colour, and the content as a raised panel with a bar for the collapse toggle and a scrolling column.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- The main navigation of a dashboard, admin or SaaS app with several top-level sections: Dashboard, Projects, Team, Settings.
|
|
17
|
+
- Navigation that must stay visible while the user works, with an option to shrink it to icons.
|
|
18
|
+
|
|
19
|
+
### When not to use
|
|
20
|
+
|
|
21
|
+
- A marketing or documentation site's top navigation → use [Header](./header.md) or [NavigationMenu](./navigation-menu.md).
|
|
22
|
+
- Switching between views of one page → use [Tabs](./tabs.md).
|
|
23
|
+
- Showing extra content or a form beside the page for a moment → use [Sheet](./sheet.md) or [Drawer](./drawer.md).
|
|
24
|
+
- A deep tree of folders or documents → use [TreeView](./tree-view.md) inside the drawer content or the page.
|
|
25
|
+
|
|
26
|
+
## 3. Anatomy
|
|
27
|
+
|
|
28
|
+
1. **Provider** (`NavigationDrawerProvider`): holds the collapsed state, the phone breakpoint check and the phone sheet's open state. Every other part reads it.
|
|
29
|
+
2. **Layout** (`NavigationDrawerLayout`, optional): provider + sidebar + main column. Puts a `NavigationDrawerToggle` in a `--size-xl` bar above your content, outside the sidebar, so it stays visible when collapsed. Fills its parent's height.
|
|
30
|
+
3. **Drawer** (`NavigationDrawer`): on desktop an `<aside>`, 14rem wide or a rail when collapsed. It has no border. On its own it sits on `--container-bg`; inside NavigationDrawerLayout it sits straight on the page colour. On phones, a menu button fixed at the top-left that opens a left Sheet wrapping the children in a `<nav>`.
|
|
31
|
+
4. **Header** (`NavigationDrawerHeader`): a `--size-xl` row for the logo or app name, with no border. Its children are hidden while collapsed.
|
|
32
|
+
5. **Content** (`NavigationDrawerContent`): the scrolling middle area for groups and items, padded `--spacing-md`. The scrollbar appears on hover.
|
|
33
|
+
6. **Footer** (`NavigationDrawerFooter`): pinned to the bottom, with no border, for the account, help or sign out.
|
|
34
|
+
7. **Group** (`NavigationDrawerGroup`): a column of items with an optional `label`, rendered as an `<h4>` at `--font-size-xs`, weight 600.
|
|
35
|
+
8. **Item** (`NavigationDrawerItem`): a link row, `--size-md` tall, `--font-size-sm` at weight 500 in `--interactive-fg-alt`. A `--size-xxs` icon slot, then the label, which truncates with an ellipsis. Use `asChild` to render your router's link.
|
|
36
|
+
9. **Toggle** (`NavigationDrawerToggle`): a ghost `iconSm` Button with a chevron that collapses or expands the drawer. Renders nothing on phones.
|
|
37
|
+
10. **Hook** (`useNavigationDrawer`): reads `collapsed`, `setCollapsed`, `isMobile`, `mobileOpen` and `setMobileOpen`.
|
|
38
|
+
|
|
39
|
+
## 4. Variants
|
|
40
|
+
|
|
41
|
+
NavigationDrawer has no variant prop. Its look changes with state: expanded, collapsed (rail) or phone sheet.
|
|
42
|
+
|
|
43
|
+
## 5. Sizes
|
|
44
|
+
|
|
45
|
+
NavigationDrawer has no size prop. Expanded it is 14rem wide; collapsed it is one `--size-md` item plus `--spacing-md` on each side. Items and bars use `--size-*` tokens, so they follow the density axis.
|
|
46
|
+
|
|
47
|
+
## 6. States
|
|
48
|
+
|
|
49
|
+
| State | Looks like | Notes |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| Default | Item text `--interactive-fg-alt`, no fill | |
|
|
52
|
+
| Hover | `--interactive-bg-hover` fill, `--interactive-fg` text | |
|
|
53
|
+
| Focus | 1px ring drawn as a `box-shadow` in `--focus-ring` | Never remove or restyle the focus ring. |
|
|
54
|
+
| Active | A raised chip: `--container-bg` fill, `--interactive-fg` text and `--elevation-control`, unchanged on hover | `active` is visual only; also set `aria-current="page"` (Rule 3). |
|
|
55
|
+
| Collapsed | A rail of square icon items; labels and header contents removed; group labels fade to transparent but keep their space | Item labels are removed from the DOM, so give items an `aria-label` (Rule 4). |
|
|
56
|
+
| Phone | Menu button at the top-left; the drawer opens as a left Sheet | Picking an item closes the sheet, even when a client-side router prevents the native navigation. |
|
|
57
|
+
|
|
58
|
+
## 7. Content guidelines
|
|
59
|
+
|
|
60
|
+
- Label items with one or two nouns naming the destination: "Dashboard", "Invoices", "Team settings".
|
|
61
|
+
- Use sentence case.
|
|
62
|
+
- Use a distinct Lucide icon for every item; in the rail the icon is all the user sees.
|
|
63
|
+
- Group items under short labels only when there are more than about six: "Workspace", "Account".
|
|
64
|
+
- Put account, help and sign out in the footer, not among the sections.
|
|
65
|
+
|
|
66
|
+
| Do | Don't |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Invoices | View all invoices |
|
|
69
|
+
| Team settings | Settings for your team members |
|
|
70
|
+
| Help | ? |
|
|
71
|
+
|
|
72
|
+
## 8. Rules
|
|
73
|
+
|
|
74
|
+
1. Render every part inside `NavigationDrawerProvider`, or use `NavigationDrawerLayout`, which includes it. Outside a provider the parts silently fall back to "expanded, desktop" and never collapse; `useNavigationDrawer` doesn't throw.
|
|
75
|
+
2. Give `NavigationDrawerLayout` (or the element holding the drawer) a bounded height, such as a full-viewport wrapper. The sidebar fills its parent's height.
|
|
76
|
+
3. Set `aria-current="page"` on the current item alongside `active`. The component doesn't set it.
|
|
77
|
+
4. When the drawer can collapse, give each item an `aria-label` with its label text. Collapsed items render only the icon and have no other accessible name.
|
|
78
|
+
5. Put `NavigationDrawerToggle` outside `NavigationDrawerHeader`; the header hides its children while collapsed. `NavigationDrawerLayout` places it for you.
|
|
79
|
+
6. Pass router links with `asChild`: `<NavigationDrawerItem asChild icon={<Home />}><Link href="/">Dashboard</Link></NavigationDrawerItem>`. The icon and truncating label render inside your link.
|
|
80
|
+
7. Pass icons through `icon`, not as children. The slot sizes them to `--size-xxs`; don't set Lucide's `size`.
|
|
81
|
+
8. Leave the top-left corner clear on phones. The menu button is fixed there above your page content.
|
|
82
|
+
9. Never pass `className` or `style` to any part. Put page padding on your own content wrapper.
|
|
83
|
+
|
|
84
|
+
## 9. Dos and don'ts
|
|
85
|
+
|
|
86
|
+
**Do:** mark the current page and name items for the rail.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<NavigationDrawerItem
|
|
90
|
+
asChild
|
|
91
|
+
icon={<Receipt aria-hidden="true" />}
|
|
92
|
+
active={pathname === "/invoices"}
|
|
93
|
+
aria-current={pathname === "/invoices" ? "page" : undefined}
|
|
94
|
+
aria-label="Invoices"
|
|
95
|
+
>
|
|
96
|
+
<Link href="/invoices">Invoices</Link>
|
|
97
|
+
</NavigationDrawerItem>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Don't:** rely on `active` alone, or wrap a link in an item that already renders one.
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
<NavigationDrawerItem icon={<Receipt />} active>
|
|
104
|
+
<a href="/invoices">Invoices</a>
|
|
105
|
+
</NavigationDrawerItem>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Do:** let the layout place the toggle.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<div style={{ height: "100dvh" }}>
|
|
112
|
+
<NavigationDrawerLayout sidebar={<AppSidebar />}>
|
|
113
|
+
<main style={{ padding: "var(--spacing-xl)" }}>{children}</main>
|
|
114
|
+
</NavigationDrawerLayout>
|
|
115
|
+
</div>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Don't:** put the toggle in the header, where collapsing hides it.
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<NavigationDrawerProvider>
|
|
122
|
+
<NavigationDrawer>
|
|
123
|
+
<NavigationDrawerHeader>
|
|
124
|
+
Acme
|
|
125
|
+
<NavigationDrawerToggle />
|
|
126
|
+
</NavigationDrawerHeader>
|
|
127
|
+
</NavigationDrawer>
|
|
128
|
+
</NavigationDrawerProvider>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 10. Accessibility
|
|
132
|
+
|
|
133
|
+
- Role: on desktop the drawer is an `<aside>` (`complementary` landmark); on phones its children sit in a `<nav>` inside a `dialog` (the Sheet), titled "Navigation menu" for screen readers. Items are links. Wrap your items in `<nav aria-label="Main">` inside `NavigationDrawerContent` so desktop has a navigation landmark too, as the tests do.
|
|
134
|
+
- Label: items are named by their text while expanded and need `aria-label` when collapsed (Rule 4). The toggle is labelled "Collapse navigation" or "Expand navigation"; the phone menu button "Open navigation".
|
|
135
|
+
- Current page: add `aria-current="page"` yourself (Rule 3).
|
|
136
|
+
- Group labels are `<h4>` elements; check they fit your page's heading outline.
|
|
137
|
+
- Keyboard: Tab moves through items in order; Enter follows a link. On phones the Sheet traps focus, Escape closes it, and focus returns to the menu button.
|
|
138
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
139
|
+
|
|
140
|
+
## 11. Behaviour
|
|
141
|
+
|
|
142
|
+
- Responsive: the breakpoint is 768px, read from `window.innerWidth` on mount and on resize. The first render (including server rendering) is the desktop sidebar, which then switches to the phone button on small screens.
|
|
143
|
+
- Phone sheet: uncontrolled by default; control it with `mobileOpen` and `onMobileOpenChange` on the provider or layout. Clicking any item closes it.
|
|
144
|
+
- Collapse: uncontrolled. Start collapsed with `defaultCollapsed`; change it later with `setCollapsed` from `useNavigationDrawer`. There is no controlled `collapsed` prop.
|
|
145
|
+
- Overflow and truncation: item labels truncate with an ellipsis; `NavigationDrawerContent` scrolls while the header and footer stay put.
|
|
146
|
+
- Motion: the width animates over 300ms when collapsing; item colours transition over 150ms. Don't add more.
|
|
147
|
+
|
|
148
|
+
## 12. API
|
|
149
|
+
|
|
150
|
+
<!-- api:start -->
|
|
151
|
+
### NavigationDrawerProvider
|
|
152
|
+
|
|
153
|
+
| Prop | Type | Default | Description |
|
|
154
|
+
| --- | --- | --- | --- |
|
|
155
|
+
| `children` | `ReactNode` | | Required. |
|
|
156
|
+
| `defaultCollapsed` | `boolean` | `false` | Starts as the icon rail. |
|
|
157
|
+
| `mobileOpen` | `boolean` | | Controlled open state of the phone sheet. |
|
|
158
|
+
| `defaultMobileOpen` | `boolean` | `false` | Initial phone sheet state when uncontrolled. |
|
|
159
|
+
| `onMobileOpenChange` | `(open: boolean) => void` | | Called when the phone sheet opens or closes, including on item clicks. |
|
|
160
|
+
|
|
161
|
+
### NavigationDrawerLayout
|
|
162
|
+
|
|
163
|
+
| Prop | Type | Default | Description |
|
|
164
|
+
| --- | --- | --- | --- |
|
|
165
|
+
| `sidebar` | `ReactNode` | | Required. The drawer's parts: Header, Content, Footer. |
|
|
166
|
+
| `children` | `ReactNode` | | Required. The page content, shown in the scrolling main column. |
|
|
167
|
+
| `defaultCollapsed`, `mobileOpen`, `defaultMobileOpen`, `onMobileOpenChange` | as on the provider | | Passed to the provider it renders. |
|
|
168
|
+
|
|
169
|
+
### NavigationDrawer, NavigationDrawerHeader, NavigationDrawerContent, NavigationDrawerFooter
|
|
170
|
+
|
|
171
|
+
| Prop | Type | Default | Description |
|
|
172
|
+
| --- | --- | --- | --- |
|
|
173
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | `aria-*`, `id`. On phones, props passed to `NavigationDrawer` itself are not applied. |
|
|
174
|
+
|
|
175
|
+
### NavigationDrawerItem
|
|
176
|
+
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `icon` | `ReactNode` | | A Lucide icon, sized to the `--size-xxs` slot. |
|
|
180
|
+
| `active` | `boolean` | `false` | Shows the current-page fill. Visual only. |
|
|
181
|
+
| `asChild` | `boolean` | `false` | Renders your single child (a router link) as the item, with the icon and label inside it. |
|
|
182
|
+
| `...props` | `AnchorHTMLAttributes<HTMLAnchorElement>` without `className`, `style` | | `href`, `onClick`, `aria-current`, `aria-label`. |
|
|
183
|
+
|
|
184
|
+
### NavigationDrawerGroup
|
|
185
|
+
|
|
186
|
+
| Prop | Type | Default | Description |
|
|
187
|
+
| --- | --- | --- | --- |
|
|
188
|
+
| `label` | `string` | | Optional group heading, rendered as an `<h4>`. |
|
|
189
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | |
|
|
190
|
+
|
|
191
|
+
### NavigationDrawerToggle
|
|
192
|
+
|
|
193
|
+
| Prop | Type | Default | Description |
|
|
194
|
+
| --- | --- | --- | --- |
|
|
195
|
+
| `onClick` | `MouseEventHandler<HTMLButtonElement>` | | Called after the drawer toggles. |
|
|
196
|
+
| `...props` | `ButtonHTMLAttributes<HTMLButtonElement>` without `className`, `style` | | `aria-label` overrides the built-in "Collapse navigation" / "Expand navigation". |
|
|
197
|
+
|
|
198
|
+
### useNavigationDrawer
|
|
199
|
+
|
|
200
|
+
| Prop | Type | Default | Description |
|
|
201
|
+
| --- | --- | --- | --- |
|
|
202
|
+
| `collapsed` | `boolean` | `false` | Whether the desktop drawer is a rail. |
|
|
203
|
+
| `setCollapsed` | `(collapsed: boolean) => void` | | Collapses or expands it. |
|
|
204
|
+
| `isMobile` | `boolean` | `false` | `true` below 768px. |
|
|
205
|
+
| `mobileOpen` | `boolean` | `false` | Whether the phone sheet is open; always `false` on desktop. |
|
|
206
|
+
| `setMobileOpen` | `(open: boolean) => void` | | Opens or closes the phone sheet. |
|
|
207
|
+
<!-- api:end -->
|
|
208
|
+
|
|
209
|
+
## 13. Examples
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
import * as React from "react";
|
|
213
|
+
import {
|
|
214
|
+
NavigationDrawerContent,
|
|
215
|
+
NavigationDrawerFooter,
|
|
216
|
+
NavigationDrawerGroup,
|
|
217
|
+
NavigationDrawerHeader,
|
|
218
|
+
NavigationDrawerItem,
|
|
219
|
+
NavigationDrawerLayout,
|
|
220
|
+
Typography,
|
|
221
|
+
} from "@eluan/core";
|
|
222
|
+
import { FolderKanban, HelpCircle, Home, Receipt, Settings, Users } from "lucide-react";
|
|
223
|
+
|
|
224
|
+
const sections = [
|
|
225
|
+
{ href: "/", label: "Dashboard", icon: <Home aria-hidden="true" /> },
|
|
226
|
+
{ href: "/projects", label: "Projects", icon: <FolderKanban aria-hidden="true" /> },
|
|
227
|
+
{ href: "/invoices", label: "Invoices", icon: <Receipt aria-hidden="true" /> },
|
|
228
|
+
];
|
|
229
|
+
|
|
230
|
+
const workspace = [
|
|
231
|
+
{ href: "/team", label: "Team", icon: <Users aria-hidden="true" /> },
|
|
232
|
+
{ href: "/settings", label: "Settings", icon: <Settings aria-hidden="true" /> },
|
|
233
|
+
];
|
|
234
|
+
|
|
235
|
+
function DrawerItem({ href, label, icon, pathname }: { href: string; label: string; icon: React.ReactNode; pathname: string }) {
|
|
236
|
+
const current = pathname === href;
|
|
237
|
+
return (
|
|
238
|
+
<NavigationDrawerItem
|
|
239
|
+
href={href}
|
|
240
|
+
icon={icon}
|
|
241
|
+
active={current}
|
|
242
|
+
aria-current={current ? "page" : undefined}
|
|
243
|
+
aria-label={label}
|
|
244
|
+
>
|
|
245
|
+
{label}
|
|
246
|
+
</NavigationDrawerItem>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export function AppShell({ pathname, children }: { pathname: string; children: React.ReactNode }) {
|
|
251
|
+
return (
|
|
252
|
+
<div style={{ height: "100dvh" }}>
|
|
253
|
+
<NavigationDrawerLayout
|
|
254
|
+
sidebar={
|
|
255
|
+
<>
|
|
256
|
+
<NavigationDrawerHeader>
|
|
257
|
+
<Typography variant="label" weight="semibold">Acme Finance</Typography>
|
|
258
|
+
</NavigationDrawerHeader>
|
|
259
|
+
<NavigationDrawerContent>
|
|
260
|
+
<nav aria-label="Main">
|
|
261
|
+
<NavigationDrawerGroup>
|
|
262
|
+
{sections.map((item) => (
|
|
263
|
+
<DrawerItem key={item.href} {...item} pathname={pathname} />
|
|
264
|
+
))}
|
|
265
|
+
</NavigationDrawerGroup>
|
|
266
|
+
<NavigationDrawerGroup label="Workspace">
|
|
267
|
+
{workspace.map((item) => (
|
|
268
|
+
<DrawerItem key={item.href} {...item} pathname={pathname} />
|
|
269
|
+
))}
|
|
270
|
+
</NavigationDrawerGroup>
|
|
271
|
+
</nav>
|
|
272
|
+
</NavigationDrawerContent>
|
|
273
|
+
<NavigationDrawerFooter>
|
|
274
|
+
<DrawerItem href="/help" label="Help" icon={<HelpCircle aria-hidden="true" />} pathname={pathname} />
|
|
275
|
+
</NavigationDrawerFooter>
|
|
276
|
+
</>
|
|
277
|
+
}
|
|
278
|
+
>
|
|
279
|
+
<main style={{ padding: "var(--spacing-xl)" }}>{children}</main>
|
|
280
|
+
</NavigationDrawerLayout>
|
|
281
|
+
</div>
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## 14. Related components
|
|
287
|
+
|
|
288
|
+
- [Sheet](./sheet.md): what the drawer becomes on phones; also the right choice for temporary side panels.
|
|
289
|
+
- [Header](./header.md): top navigation for websites.
|
|
290
|
+
- [NavigationMenu](./navigation-menu.md): top navigation with link panels.
|
|
291
|
+
- [Breadcrumb](./breadcrumb.md): shows the current page's place inside a section.
|
|
292
|
+
- [TreeView](./tree-view.md): nested hierarchies inside a section.
|
|
293
|
+
- See [navigation patterns](../patterns/navigation.md) and [page layout](../patterns/page-layout.md).
|
|
294
|
+
|
|
295
|
+
## 15. Common agent mistakes
|
|
296
|
+
|
|
297
|
+
_Filled from evals._
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: NavigationMenu
|
|
3
|
+
use_when: A site header needs a row of top-level navigation links, some of which open a panel of further links.
|
|
4
|
+
instead_of: Header for a complete site header with a mobile menu; NavigationDrawer for an app's side navigation; Tabs to switch views within a page; DropdownMenu for actions.
|
|
5
|
+
source: packages/core/src/components/navigation-menu.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# NavigationMenu
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
NavigationMenu is a horizontal row of site navigation: triggers that open panels of links (including multi-column "megamenu" panels) and plain top-level links. It wraps Radix NavigationMenu and renders a `<nav>` landmark. The root adds the shared panel viewport for you. Links are unstyled; you style your own anchors, or give top-level links the trigger look with `navigationMenuTriggerStyle()`.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- A marketing or documentation site header: Products, Solutions, Resources panels plus Pricing and Docs links.
|
|
17
|
+
- Navigation where each top-level area has several destinations worth previewing in a panel.
|
|
18
|
+
|
|
19
|
+
### When not to use
|
|
20
|
+
|
|
21
|
+
- A complete site header with logo, actions and a phone menu → use [Header](./header.md).
|
|
22
|
+
- The main navigation of an app with many sections → use [NavigationDrawer](./navigation-drawer.md).
|
|
23
|
+
- Switching between views of the same page → use [Tabs](./tabs.md).
|
|
24
|
+
- A list of actions → use [DropdownMenu](./dropdown-menu.md).
|
|
25
|
+
- An editor's File/Edit/View commands → use [Menubar](./menubar.md).
|
|
26
|
+
- Showing where the page sits in a hierarchy → use [Breadcrumb](./breadcrumb.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Root** (`NavigationMenu`): a `<nav aria-label="Main">` that also renders the panel viewport.
|
|
31
|
+
2. **List** (`NavigationMenuList`): the row of top-level items, `--spacing-xxs` apart.
|
|
32
|
+
3. **Item** (`NavigationMenuItem`): one top-level entry, holding a trigger and content, or a single link.
|
|
33
|
+
4. **Trigger** (`NavigationMenuTrigger`): a button that opens the item's panel. `--size-lg` tall, `--font-size-sm` at weight 500, `--curves-md` radius, with a chevron that turns up while open.
|
|
34
|
+
5. **Content** (`NavigationMenuContent`): the panel body for one trigger, padded `--spacing-lg`. Put your own layout of links inside.
|
|
35
|
+
6. **Link** (`NavigationMenuLink`): an unstyled Radix link. Use `asChild` around your own `<a>` or router link.
|
|
36
|
+
7. **Viewport** (`NavigationMenuViewport`): the shared floating panel that shows the open content. `--container-bg` with a `--container-border` border, `--curves-md` radius and a shadow, anchored under the left edge of the list. Rendered by the root; never add one yourself.
|
|
37
|
+
8. **Indicator** (`NavigationMenuIndicator`, optional): a small arrow under the open trigger. Place it as the last child of the list.
|
|
38
|
+
9. **Trigger style** (`navigationMenuTriggerStyle()`): returns the trigger's class name so a top-level link can look like a trigger.
|
|
39
|
+
|
|
40
|
+
## 4. Variants
|
|
41
|
+
|
|
42
|
+
NavigationMenu has no variants. Top-level links look like plain text unless you give your anchor `navigationMenuTriggerStyle()`.
|
|
43
|
+
|
|
44
|
+
## 5. Sizes
|
|
45
|
+
|
|
46
|
+
NavigationMenu has no size prop. Triggers are `--size-lg` tall with `--spacing-md` inline padding, so they follow the density axis.
|
|
47
|
+
|
|
48
|
+
## 6. States
|
|
49
|
+
|
|
50
|
+
| State | Looks like | Notes |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| Default | Trigger on `--container-bg`, text inherited | |
|
|
53
|
+
| Hover | `--interactive-bg-hover` fill, `--interactive-fg` text | Hovering a trigger opens its panel after 200ms. |
|
|
54
|
+
| Focus | The same fill as hover; the outline is removed | Never remove or restyle the focus ring. |
|
|
55
|
+
| Open | Trigger keeps the `--interactive-bg-hover` fill; the chevron rotates 180° | |
|
|
56
|
+
| Active | A link styled with `navigationMenuTriggerStyle()` and `active` fills `--interactive-bg-active` but keeps its dark text, so the label disappears | Until this is fixed, don't pass `active` to a link that uses `navigationMenuTriggerStyle()`; set `aria-current="page"` on your anchor instead. |
|
|
57
|
+
| Disabled | `--interactive-bg-disabled` fill, `--interactive-fg-disabled` text, no pointer events | |
|
|
58
|
+
|
|
59
|
+
The indicator arrow is filled with `--container-bg-alt` while the panel is `--container-bg`, so it reads as a separate grey chip rather than part of the panel. Leave the indicator out unless you need it.
|
|
60
|
+
|
|
61
|
+
## 7. Content guidelines
|
|
62
|
+
|
|
63
|
+
- Label triggers and top-level links with one or two nouns: "Products", "Resources", "Pricing".
|
|
64
|
+
- Use sentence case.
|
|
65
|
+
- In panels, give each link a short title and, for megamenus, a one-line description of the destination.
|
|
66
|
+
- Group panel links under small headings when a panel has more than one column.
|
|
67
|
+
- Keep a trigger's panel to links. Put one promotional card at most beside them.
|
|
68
|
+
|
|
69
|
+
| Do | Don't |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Pricing | See our pricing plans |
|
|
72
|
+
| Resources | More |
|
|
73
|
+
| Integrations: connect Slack, GitHub and Linear | Click to learn about integrations |
|
|
74
|
+
|
|
75
|
+
## 8. Rules
|
|
76
|
+
|
|
77
|
+
1. Wrap every destination in `NavigationMenuLink` (use `asChild` around your `<a>` or router link) so keyboard focus and close-on-select work.
|
|
78
|
+
2. Style links on your own anchor. For top-level links, put `className={navigationMenuTriggerStyle()}` on your `<a>` inside `<NavigationMenuLink asChild>`. Never pass `className` or `style` to the Eluan parts themselves.
|
|
79
|
+
3. Never render `NavigationMenuViewport`; the root already does.
|
|
80
|
+
4. Mark the current page: `active` on `NavigationMenuLink` sets `aria-current="page"`. For links styled with `navigationMenuTriggerStyle()`, set `aria-current="page"` on the anchor instead (see States).
|
|
81
|
+
5. Give the root an `aria-label` when the page has more than one `<nav>`, for example `aria-label="Primary"`.
|
|
82
|
+
6. Leave `orientation` horizontal. The list is always laid out as a row; `vertical` changes only the arrow keys.
|
|
83
|
+
7. Pair it with a phone layout. NavigationMenu has no mobile menu; use [Header](./header.md) or a [Sheet](./sheet.md) below 768px.
|
|
84
|
+
|
|
85
|
+
## 9. Dos and don'ts
|
|
86
|
+
|
|
87
|
+
**Do:** give a top-level link the trigger look through your own anchor.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<NavigationMenuItem>
|
|
91
|
+
<NavigationMenuLink asChild>
|
|
92
|
+
<a href="/pricing" className={navigationMenuTriggerStyle()}>
|
|
93
|
+
Pricing
|
|
94
|
+
</a>
|
|
95
|
+
</NavigationMenuLink>
|
|
96
|
+
</NavigationMenuItem>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Don't:** use a bare anchor or a Button outside `NavigationMenuLink`.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<NavigationMenuItem>
|
|
103
|
+
<Button variant="ghost" onClick={() => (window.location.href = "/pricing")}>
|
|
104
|
+
Pricing
|
|
105
|
+
</Button>
|
|
106
|
+
</NavigationMenuItem>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Do:** mark the current page without the active fill on trigger-styled links.
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<NavigationMenuLink asChild>
|
|
113
|
+
<a href="/docs" aria-current="page" className={navigationMenuTriggerStyle()}>
|
|
114
|
+
Docs
|
|
115
|
+
</a>
|
|
116
|
+
</NavigationMenuLink>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Don't:** combine `active` with the trigger style while the active colour pair is broken.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<NavigationMenuLink asChild active>
|
|
123
|
+
<a href="/docs" className={navigationMenuTriggerStyle()}>Docs</a>
|
|
124
|
+
</NavigationMenuLink>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 10. Accessibility
|
|
128
|
+
|
|
129
|
+
- Role: the root is a `navigation` landmark named "Main" by default. Triggers are buttons with `aria-expanded` and `aria-controls`; links are links.
|
|
130
|
+
- Label: triggers and links are named by their text. Override the landmark name with `aria-label` when there are several navs.
|
|
131
|
+
- Keyboard: Tab moves through triggers and top-level links. Enter or Space toggles a panel. ArrowLeft and ArrowRight move between top-level items, Home and End jump to the ends, and ArrowDown moves focus into an open panel. Escape closes the panel and returns focus to its trigger.
|
|
132
|
+
- Focus: a panel doesn't trap focus; tabbing past its last link moves on through the page. Selecting a link closes the panel.
|
|
133
|
+
- Current page: `active` on `NavigationMenuLink` adds `aria-current="page"`.
|
|
134
|
+
- Contrast: handled by the theme. Don't override colours. Trigger focus is shown only by the `--interactive-bg-hover` fill, identical to hover and faint by design; don't patch it per component.
|
|
135
|
+
|
|
136
|
+
## 11. Behaviour
|
|
137
|
+
|
|
138
|
+
- Positioning: the viewport opens under the list, aligned to its left edge, `--spacing-xs` below. It sizes to the open panel's content at 768px and up.
|
|
139
|
+
- Responsive: below 768px the viewport and panels stretch to full width. There is no collapsed or mobile menu.
|
|
140
|
+
- Overflow and truncation: set your panel layout's width yourself (a grid or column inside the content). Nothing truncates.
|
|
141
|
+
- Hover timing: panels open 200ms after the pointer enters a trigger (`delayDuration`); moving between triggers within 300ms skips the delay (`skipDelayDuration`).
|
|
142
|
+
- Motion: trigger colours transition over 150ms and the chevron rotates over 150ms. Don't add more.
|
|
143
|
+
|
|
144
|
+
## 12. API
|
|
145
|
+
|
|
146
|
+
<!-- api:start -->
|
|
147
|
+
### NavigationMenu
|
|
148
|
+
|
|
149
|
+
| Prop | Type | Default | Description |
|
|
150
|
+
| --- | --- | --- | --- |
|
|
151
|
+
| `value` | `string` | | Controlled value of the open item (`""` when none). |
|
|
152
|
+
| `defaultValue` | `string` | | Initially open item when uncontrolled. |
|
|
153
|
+
| `onValueChange` | `(value: string) => void` | | Called when a panel opens or closes. |
|
|
154
|
+
| `delayDuration` | `number` | `200` | Hover delay before a panel opens, in ms. |
|
|
155
|
+
| `skipDelayDuration` | `number` | `300` | Window in which moving to another trigger opens it at once, in ms. |
|
|
156
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Arrow-key direction only; the layout stays a row. |
|
|
157
|
+
| `aria-label` | `string` | `"Main"` | Name of the navigation landmark. |
|
|
158
|
+
| `...props` | Radix `NavigationMenu.Root` props without `className`, `style` | | `dir`. |
|
|
159
|
+
|
|
160
|
+
### NavigationMenuList, NavigationMenuItem
|
|
161
|
+
|
|
162
|
+
| Prop | Type | Default | Description |
|
|
163
|
+
| --- | --- | --- | --- |
|
|
164
|
+
| `value` (Item) | `string` | generated | Identifies the item for the root `value`. |
|
|
165
|
+
| `...props` | Radix `List` / `Item` props | | `className` and `style` are omitted from List. Item is the re-exported Radix part. |
|
|
166
|
+
|
|
167
|
+
### NavigationMenuTrigger, NavigationMenuContent
|
|
168
|
+
|
|
169
|
+
| Prop | Type | Default | Description |
|
|
170
|
+
| --- | --- | --- | --- |
|
|
171
|
+
| `disabled` (Trigger) | `boolean` | `false` | Prevents opening. |
|
|
172
|
+
| `forceMount` (Content) | `true` | | Keeps the panel mounted when closed. |
|
|
173
|
+
| `...props` | Radix `Trigger` / `Content` props without `className`, `style` | | `onEscapeKeyDown`, `onPointerDownOutside` on Content. |
|
|
174
|
+
|
|
175
|
+
### NavigationMenuLink
|
|
176
|
+
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `asChild` | `boolean` | `false` | Renders your anchor or router link with the link behaviour. |
|
|
180
|
+
| `active` | `boolean` | `false` | Marks the current page: adds `aria-current="page"`. |
|
|
181
|
+
| `onSelect` | `(event: Event) => void` | | Called on selection; `event.preventDefault()` keeps the panel open. |
|
|
182
|
+
| `...props` | Radix `NavigationMenu.Link` props | | Re-exported, unstyled Radix part; renders an `<a>` without `asChild`. |
|
|
183
|
+
|
|
184
|
+
### NavigationMenuIndicator, NavigationMenuViewport
|
|
185
|
+
|
|
186
|
+
| Prop | Type | Default | Description |
|
|
187
|
+
| --- | --- | --- | --- |
|
|
188
|
+
| `forceMount` | `true` | | Keeps the part mounted. |
|
|
189
|
+
| `...props` | Radix `Indicator` / `Viewport` props without `className`, `style` | | The root renders the viewport; don't render it yourself. |
|
|
190
|
+
|
|
191
|
+
### navigationMenuTriggerStyle
|
|
192
|
+
|
|
193
|
+
| Prop | Type | Default | Description |
|
|
194
|
+
| --- | --- | --- | --- |
|
|
195
|
+
| `navigationMenuTriggerStyle()` | `() => string` | | Returns the trigger's class name for your own top-level `<a>`. |
|
|
196
|
+
<!-- api:end -->
|
|
197
|
+
|
|
198
|
+
## 13. Examples
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
import * as React from "react";
|
|
202
|
+
import {
|
|
203
|
+
NavigationMenu,
|
|
204
|
+
NavigationMenuContent,
|
|
205
|
+
NavigationMenuItem,
|
|
206
|
+
NavigationMenuLink,
|
|
207
|
+
NavigationMenuList,
|
|
208
|
+
NavigationMenuTrigger,
|
|
209
|
+
navigationMenuTriggerStyle,
|
|
210
|
+
} from "@eluan/core";
|
|
211
|
+
|
|
212
|
+
const products = [
|
|
213
|
+
{ href: "/analytics", title: "Analytics", description: "Dashboards and reports for every team." },
|
|
214
|
+
{ href: "/automation", title: "Automation", description: "Run workflows when data changes." },
|
|
215
|
+
{ href: "/integrations", title: "Integrations", description: "Connect Slack, GitHub and Linear." },
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
// Add a :hover rule with --interactive-bg-hover to these anchors in your stylesheet.
|
|
219
|
+
const panelLinkStyle: React.CSSProperties = {
|
|
220
|
+
display: "flex",
|
|
221
|
+
flexDirection: "column",
|
|
222
|
+
gap: "var(--spacing-xxs)",
|
|
223
|
+
padding: "var(--spacing-sm) var(--spacing-md)",
|
|
224
|
+
borderRadius: "var(--curves-md)",
|
|
225
|
+
color: "var(--container-fg)",
|
|
226
|
+
textDecoration: "none",
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export function SiteNavigation({ pathname }: { pathname: string }) {
|
|
230
|
+
return (
|
|
231
|
+
<NavigationMenu aria-label="Primary">
|
|
232
|
+
<NavigationMenuList>
|
|
233
|
+
<NavigationMenuItem>
|
|
234
|
+
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
235
|
+
<NavigationMenuContent>
|
|
236
|
+
<ul style={{ display: "grid", gap: "var(--spacing-xs)", width: "max-content", margin: 0, padding: 0, listStyle: "none" }}>
|
|
237
|
+
{products.map((product) => (
|
|
238
|
+
<li key={product.href}>
|
|
239
|
+
<NavigationMenuLink asChild active={pathname === product.href}>
|
|
240
|
+
<a href={product.href} style={panelLinkStyle}>
|
|
241
|
+
<span style={{ fontSize: "var(--font-size-sm)", fontWeight: 500 }}>{product.title}</span>
|
|
242
|
+
<span style={{ fontSize: "var(--font-size-xs)", color: "var(--container-fg-alt)" }}>
|
|
243
|
+
{product.description}
|
|
244
|
+
</span>
|
|
245
|
+
</a>
|
|
246
|
+
</NavigationMenuLink>
|
|
247
|
+
</li>
|
|
248
|
+
))}
|
|
249
|
+
</ul>
|
|
250
|
+
</NavigationMenuContent>
|
|
251
|
+
</NavigationMenuItem>
|
|
252
|
+
<NavigationMenuItem>
|
|
253
|
+
<NavigationMenuLink asChild>
|
|
254
|
+
<a
|
|
255
|
+
href="/pricing"
|
|
256
|
+
className={navigationMenuTriggerStyle()}
|
|
257
|
+
aria-current={pathname === "/pricing" ? "page" : undefined}
|
|
258
|
+
>
|
|
259
|
+
Pricing
|
|
260
|
+
</a>
|
|
261
|
+
</NavigationMenuLink>
|
|
262
|
+
</NavigationMenuItem>
|
|
263
|
+
<NavigationMenuItem>
|
|
264
|
+
<NavigationMenuLink asChild>
|
|
265
|
+
<a
|
|
266
|
+
href="/docs"
|
|
267
|
+
className={navigationMenuTriggerStyle()}
|
|
268
|
+
aria-current={pathname.startsWith("/docs") ? "page" : undefined}
|
|
269
|
+
>
|
|
270
|
+
Docs
|
|
271
|
+
</a>
|
|
272
|
+
</NavigationMenuLink>
|
|
273
|
+
</NavigationMenuItem>
|
|
274
|
+
</NavigationMenuList>
|
|
275
|
+
</NavigationMenu>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## 14. Related components
|
|
281
|
+
|
|
282
|
+
- [Header](./header.md): a full site header with logo, actions and a mobile menu.
|
|
283
|
+
- [NavigationDrawer](./navigation-drawer.md): side navigation for apps.
|
|
284
|
+
- [Breadcrumb](./breadcrumb.md): the current page's place in the hierarchy.
|
|
285
|
+
- [Tabs](./tabs.md): views within one page, not destinations.
|
|
286
|
+
- [DropdownMenu](./dropdown-menu.md): actions, not navigation.
|
|
287
|
+
- See [navigation patterns](../patterns/navigation.md).
|
|
288
|
+
|
|
289
|
+
## 15. Common agent mistakes
|
|
290
|
+
|
|
291
|
+
_Filled from evals._
|