@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,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Collapsible
|
|
3
|
+
use_when: One region of the page shows and hides in place behind a single trigger, such as advanced options or extra details.
|
|
4
|
+
instead_of: Accordion for several stacked sections; Tabs for switching views; Popover, Sheet or Drawer for content that should float or slide in.
|
|
5
|
+
source: packages/core/src/components/collapsible.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Collapsible
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Collapsible shows and hides one region of content in place. It re-exports Radix Collapsible with no styles of its own: you supply the trigger (an Eluan Button) and the layout of the content. Unlike [Accordion](./accordion.md), it has no built-in look, icons or animation.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- "Advanced options" or "More settings" in a form, hidden by default.
|
|
17
|
+
- Extra details under a summary: order line items, release notes, a stack trace.
|
|
18
|
+
- A filter section in a sidebar that the user can fold away.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- Several related sections, each with a heading → use [Accordion](./accordion.md).
|
|
23
|
+
- Switching between views of the same content → use [Tabs](./tabs.md) or [SegmentedControl](./segmented-control.md).
|
|
24
|
+
- Content that floats next to a control → use [Popover](./popover.md).
|
|
25
|
+
- A side panel → use [Sheet](./sheet.md) or [Drawer](./drawer.md).
|
|
26
|
+
- A nested hierarchy of items → use [TreeView](./tree-view.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Collapsible**: the root. Holds open state; renders a `div`.
|
|
31
|
+
2. **CollapsibleTrigger**: a native `<button type="button">` that toggles the content. Unstyled; wrap a [Button](./button.md) with `asChild`.
|
|
32
|
+
3. **CollapsibleContent**: the region that shows and hides. Unstyled; put your own wrapper inside it for spacing.
|
|
33
|
+
4. **Indicator** (optional): a Lucide chevron inside the trigger Button that reflects the state.
|
|
34
|
+
|
|
35
|
+
## 4. Variants
|
|
36
|
+
|
|
37
|
+
No variants. The trigger Button's `variant` and your content wrapper decide the look.
|
|
38
|
+
|
|
39
|
+
## 5. Sizes
|
|
40
|
+
|
|
41
|
+
No size prop. Use the trigger Button's `size`.
|
|
42
|
+
|
|
43
|
+
## 6. States
|
|
44
|
+
|
|
45
|
+
| State | Looks like | Notes |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| Closed | Only the trigger shows | Content is unmounted. Trigger has `aria-expanded="false"` and `data-state="closed"`. |
|
|
48
|
+
| Open | Content appears below the trigger | Trigger has `aria-expanded="true"` and `data-state="open"`. |
|
|
49
|
+
| Focus | The trigger Button's focus outline | Never remove or restyle the focus ring. |
|
|
50
|
+
| Disabled | The trigger Button's disabled style | Set `disabled` on Collapsible; the trigger can't toggle. |
|
|
51
|
+
|
|
52
|
+
## 7. Content guidelines
|
|
53
|
+
|
|
54
|
+
- Label the trigger with what it reveals: "Advanced options", "Show 4 line items", "Release notes".
|
|
55
|
+
- Keep the label the same when open; the chevron and `aria-expanded` carry the state.
|
|
56
|
+
- Show the most-used settings outside the Collapsible; hide only what most users can skip.
|
|
57
|
+
- Sentence case.
|
|
58
|
+
|
|
59
|
+
| Do | Don't |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| Advanced options | More |
|
|
62
|
+
| Show 4 line items | Click to expand |
|
|
63
|
+
|
|
64
|
+
## 8. Rules
|
|
65
|
+
|
|
66
|
+
1. Use `CollapsibleTrigger asChild` around a Button. A bare trigger is an unstyled browser button.
|
|
67
|
+
2. Put spacing and layout on a wrapper `div` inside CollapsibleContent.
|
|
68
|
+
3. Never pass `className` or `style` to Collapsible parts. They aren't dropped here, unlike every other Eluan component, but styling them bypasses the system.
|
|
69
|
+
4. Mark the chevron `aria-hidden="true"` and size it with `--size-xxs`.
|
|
70
|
+
5. Don't stack Collapsibles to build an accordion; use Accordion.
|
|
71
|
+
6. Don't hide required fields or validation errors inside a closed Collapsible.
|
|
72
|
+
|
|
73
|
+
## 9. Dos and don'ts
|
|
74
|
+
|
|
75
|
+
**Do:** use a Button as the trigger and a wrapper for the content.
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Collapsible>
|
|
79
|
+
<CollapsibleTrigger asChild>
|
|
80
|
+
<Button type="button" variant="ghost" size="sm">Advanced options</Button>
|
|
81
|
+
</CollapsibleTrigger>
|
|
82
|
+
<CollapsibleContent>
|
|
83
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-lg)" }}>
|
|
84
|
+
{/* fields */}
|
|
85
|
+
</div>
|
|
86
|
+
</CollapsibleContent>
|
|
87
|
+
</Collapsible>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Don't:** style the parts directly or hand-roll the toggle.
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<Collapsible>
|
|
94
|
+
<CollapsibleTrigger style={{ background: "none", border: 0 }}>Advanced options</CollapsibleTrigger>
|
|
95
|
+
<CollapsibleContent className="advanced-panel">{/* fields */}</CollapsibleContent>
|
|
96
|
+
</Collapsible>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Do:** use Accordion for a set of headed sections.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<Accordion type="single" collapsible>
|
|
103
|
+
<AccordionItem value="billing">
|
|
104
|
+
<AccordionTrigger>Billing</AccordionTrigger>
|
|
105
|
+
<AccordionContent>{/* billing settings */}</AccordionContent>
|
|
106
|
+
</AccordionItem>
|
|
107
|
+
</Accordion>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Don't:** stack Collapsibles to imitate one.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<Collapsible>{/* Billing */}</Collapsible>
|
|
114
|
+
<Collapsible>{/* Notifications */}</Collapsible>
|
|
115
|
+
<Collapsible>{/* Security */}</Collapsible>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 10. Accessibility
|
|
119
|
+
|
|
120
|
+
- Role: the trigger is a native `button` with `aria-expanded` and `aria-controls` pointing at the content.
|
|
121
|
+
- Label: the trigger's text.
|
|
122
|
+
- Keyboard: Enter and Space toggle the content. Tab moves focus in DOM order.
|
|
123
|
+
- Focus: stays on the trigger when it toggles. Closed content is removed from the page, so nothing inside it can be focused.
|
|
124
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
125
|
+
|
|
126
|
+
## 11. Behaviour
|
|
127
|
+
|
|
128
|
+
- Responsive: the content takes the width of its container.
|
|
129
|
+
- Overflow and truncation: the content grows to its natural height and pushes the page down.
|
|
130
|
+
- Motion: none. The content appears and disappears at once. Don't add a height animation of your own.
|
|
131
|
+
- Controlled or uncontrolled: pass `open` and `onOpenChange` to control it, or `defaultOpen` to start open.
|
|
132
|
+
- Closing unmounts the content, so uncontrolled fields inside lose what the user typed and drop out of a submitted `FormData`. Keep their values in state (controlled fields) or in your form library.
|
|
133
|
+
|
|
134
|
+
## 12. API
|
|
135
|
+
|
|
136
|
+
<!-- api:start -->
|
|
137
|
+
### Collapsible
|
|
138
|
+
|
|
139
|
+
| Prop | Type | Default | Description |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| `open` | `boolean` | | Controlled open state. |
|
|
142
|
+
| `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. |
|
|
143
|
+
| `onOpenChange` | `(open: boolean) => void` | | Called on every toggle. |
|
|
144
|
+
| `disabled` | `boolean` | `false` | Stops the trigger from toggling. |
|
|
145
|
+
| `asChild` | `boolean` | `false` | Renders the child element instead of the `div`. |
|
|
146
|
+
| `...props` | Radix `Collapsible.Root` props | | Don't pass `className` or `style`. |
|
|
147
|
+
|
|
148
|
+
### CollapsibleTrigger
|
|
149
|
+
|
|
150
|
+
| Prop | Type | Default | Description |
|
|
151
|
+
| --- | --- | --- | --- |
|
|
152
|
+
| `asChild` | `boolean` | `false` | Renders the child (a Button) instead of a bare `<button type="button">`. |
|
|
153
|
+
| `...props` | Radix `Collapsible.Trigger` props | | Native button attributes. Don't pass `className` or `style`. |
|
|
154
|
+
|
|
155
|
+
### CollapsibleContent
|
|
156
|
+
|
|
157
|
+
| Prop | Type | Default | Description |
|
|
158
|
+
| --- | --- | --- | --- |
|
|
159
|
+
| `forceMount` | `true` | | Keeps the content mounted and visible while closed; you'd have to hide it yourself. Avoid. |
|
|
160
|
+
| `asChild` | `boolean` | `false` | Renders the child element instead of the `div`. |
|
|
161
|
+
| `...props` | Radix `Collapsible.Content` props | | Don't pass `className` or `style`. |
|
|
162
|
+
<!-- api:end -->
|
|
163
|
+
|
|
164
|
+
## 13. Examples
|
|
165
|
+
|
|
166
|
+
Advanced options in a webhook form, closed by default. The fields are controlled so their values survive closing the section.
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import * as React from "react";
|
|
170
|
+
import { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Input, Label } from "@eluan/core";
|
|
171
|
+
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
172
|
+
|
|
173
|
+
type AdvancedValues = { timeout: string; header: string };
|
|
174
|
+
|
|
175
|
+
export function WebhookAdvancedOptions({
|
|
176
|
+
values,
|
|
177
|
+
onChange,
|
|
178
|
+
}: {
|
|
179
|
+
values: AdvancedValues;
|
|
180
|
+
onChange: (values: AdvancedValues) => void;
|
|
181
|
+
}) {
|
|
182
|
+
const [open, setOpen] = React.useState(false);
|
|
183
|
+
const Chevron = open ? ChevronDown : ChevronRight;
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<Collapsible open={open} onOpenChange={setOpen}>
|
|
187
|
+
<CollapsibleTrigger asChild>
|
|
188
|
+
<Button type="button" variant="ghost" size="sm">
|
|
189
|
+
<Chevron aria-hidden="true" style={{ width: "var(--size-xxs)", height: "var(--size-xxs)" }} />
|
|
190
|
+
Advanced options
|
|
191
|
+
</Button>
|
|
192
|
+
</CollapsibleTrigger>
|
|
193
|
+
<CollapsibleContent>
|
|
194
|
+
<div
|
|
195
|
+
style={{
|
|
196
|
+
display: "flex",
|
|
197
|
+
flexDirection: "column",
|
|
198
|
+
gap: "var(--spacing-lg)",
|
|
199
|
+
paddingTop: "var(--spacing-md)",
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
|
|
203
|
+
<Label htmlFor="webhook-timeout" hint="Seconds">
|
|
204
|
+
Request timeout
|
|
205
|
+
</Label>
|
|
206
|
+
<Input
|
|
207
|
+
id="webhook-timeout"
|
|
208
|
+
type="number"
|
|
209
|
+
value={values.timeout}
|
|
210
|
+
onChange={(event) => onChange({ ...values, timeout: event.target.value })}
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
|
|
214
|
+
<Label htmlFor="webhook-header" optional>
|
|
215
|
+
Custom header
|
|
216
|
+
</Label>
|
|
217
|
+
<Input
|
|
218
|
+
id="webhook-header"
|
|
219
|
+
placeholder="X-Signature"
|
|
220
|
+
value={values.header}
|
|
221
|
+
onChange={(event) => onChange({ ...values, header: event.target.value })}
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</CollapsibleContent>
|
|
226
|
+
</Collapsible>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## 14. Related components
|
|
232
|
+
|
|
233
|
+
- [Accordion](./accordion.md): a styled set of collapsible sections.
|
|
234
|
+
- [Button](./button.md): the trigger.
|
|
235
|
+
- [Tabs](./tabs.md): switch views instead of revealing more.
|
|
236
|
+
- [Popover](./popover.md): content that floats instead of pushing the page.
|
|
237
|
+
|
|
238
|
+
## 15. Common agent mistakes
|
|
239
|
+
|
|
240
|
+
_Filled from evals._
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Command
|
|
3
|
+
use_when: A searchable, keyboard-driven list of commands or options, as a Cmd+K palette (CommandDialog), an inline filterable list or a searchable picker in a Popover.
|
|
4
|
+
instead_of: Select for a short fixed list; MultiSelect for several choices; SearchInput for a plain search field; DropdownMenu for a few actions behind a button. Eluan has no Combobox; Command is that primitive.
|
|
5
|
+
source: packages/core/src/components/command.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Command
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Command is a filterable, keyboard-first list built on cmdk. Typing in its input filters and ranks the items; arrow keys move a highlight and Enter runs the highlighted item. Use it as a Cmd+K palette inside `CommandDialog`, inline on a surface, or inside a Popover as a searchable picker. Eluan has no separate Combobox: Command is the primitive, and MultiSelect is built from it.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- An app-wide command palette for navigation and actions, opened with Cmd/Ctrl+K and a visible trigger (`CommandDialog`).
|
|
17
|
+
- A filterable list that is a permanent part of the layout, such as a "Jump to setting" panel (inline `Command`).
|
|
18
|
+
- A searchable single-choice picker with many options, in a Popover.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- A short, fixed list of options in a form → use [Select](./select.md).
|
|
23
|
+
- Several choices from a searchable list → use [MultiSelect](./multi-select.md).
|
|
24
|
+
- A search field that filters page content, or one that just focuses on Cmd+K → use [SearchInput](./search-input.md) (`SearchInput` or `CommandSearch`).
|
|
25
|
+
- Suggestions under a text field as the user types → use [SearchInput](./search-input.md)'s `AutocompleteSearch`.
|
|
26
|
+
- A few actions behind a button → use [DropdownMenu](./dropdown-menu.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Root** (`Command`): the container. Inline, it draws a `--container-border` border, `--curves-md` corners and a shadow, and fills its parent.
|
|
31
|
+
2. **Input** (`CommandInput`): a search icon and a borderless text input, with a `--container-border` line beneath.
|
|
32
|
+
3. **List** (`CommandList`): the scrolling listbox that holds everything below.
|
|
33
|
+
4. **Empty** (`CommandEmpty`): text shown only when nothing matches.
|
|
34
|
+
5. **Group** (`CommandGroup`): items under an optional `heading`, which renders small, in `--container-fg-alt` at weight 500.
|
|
35
|
+
6. **Item** (`CommandItem`): one row, with an optional leading icon, the label and an optional shortcut.
|
|
36
|
+
7. **Shortcut** (`CommandShortcut`): a muted hint pushed to the end of the row, at `--font-size-xs`.
|
|
37
|
+
8. **Separator** (`CommandSeparator`): the shared Separator line between groups, hidden while the user is searching.
|
|
38
|
+
|
|
39
|
+
## 4. Variants
|
|
40
|
+
|
|
41
|
+
There's no `variant` prop. Pick the presentation:
|
|
42
|
+
|
|
43
|
+
| Presentation | Use for |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `CommandDialog` | The Cmd+K palette. A modal Dialog with a visually hidden title and description; the inner Command drops its own border and uses roomier rows. |
|
|
46
|
+
| Inline `Command` | A palette on the page or inside a Popover. Draws its own border and shadow. |
|
|
47
|
+
| `Dialog` with `DialogContent layout="command"` | What CommandDialog is built from: no padding and no close button. Compose it yourself only when you need Command props that CommandDialog doesn't pass through (`shouldFilter`, `filter`, `loop`, `label`, `value`). The inner Command then keeps its own border and the compact row padding. |
|
|
48
|
+
|
|
49
|
+
`CommandSearch` in [SearchInput](./search-input.md) is not part of Command: it is an Input with a Cmd+K hint that focuses itself on Cmd/Ctrl+K, with no list.
|
|
50
|
+
|
|
51
|
+
`CommandEmpty` has a `tone`: `default`, or `muted` (`--interactive-fg-alt`, less padding) for a compact picker.
|
|
52
|
+
|
|
53
|
+
## 5. Sizes
|
|
54
|
+
|
|
55
|
+
No size prop.
|
|
56
|
+
|
|
57
|
+
| Setting | Use in |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `CommandInput density="default"` | Palettes and inline lists (`--size-xl` tall). |
|
|
60
|
+
| `CommandInput density="compact"` | A picker inside a Popover (`--size-lg`), as MultiSelect does. |
|
|
61
|
+
|
|
62
|
+
Inside `CommandDialog`, rows pad with `--spacing-sm` instead of `--spacing-xs` and the search icon grows from `--size-xxs` to `--size-xs`.
|
|
63
|
+
|
|
64
|
+
## 6. States
|
|
65
|
+
|
|
66
|
+
| State | Looks like | Notes |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| Default | Rows in `--interactive-fg` | |
|
|
69
|
+
| Highlighted | The row under the keyboard cursor or pointer fills with `--interactive-bg-selected` and its text turns `--interactive-fg-selected` | cmdk calls this "selected" (`aria-selected`, `data-selected`). Moving the pointer over a row highlights it; there is no separate hover style. The CommandShortcut keeps `--container-fg-alt` and goes dark on the dark row; don't recolour it, and keep the full action name in the row so it reads without the hint. |
|
|
70
|
+
| Chosen | Weight 500 in `--interactive-fg` | Eluan's `selected` prop: the current value in a picker. It is visual only, with no ARIA state; add a Check icon as MultiSelect does. Not the same as Highlighted. |
|
|
71
|
+
| Focus | Focus stays in the input; the input draws no outline | Never remove or restyle the focus ring. The caret and the highlighted row show where the user is; don't add an outline to rows. |
|
|
72
|
+
| Disabled item | `--interactive-bg-disabled` fill, `--interactive-fg-disabled` text, no pointer events | Arrow keys skip it. |
|
|
73
|
+
| Empty | CommandEmpty text, centred | Only rendered when no item matches. |
|
|
74
|
+
| Loading | No built-in loading state | For results fetched as the user types, show a [Spinner](./spinner.md) in CommandEmpty's place. |
|
|
75
|
+
|
|
76
|
+
## 7. Content guidelines
|
|
77
|
+
|
|
78
|
+
- Write items as the page name or a verb phrase: "Settings", "New project", "Invite teammate". Sentence case.
|
|
79
|
+
- Write group headings as short nouns: "Go to", "Actions", "Recent".
|
|
80
|
+
- Write the placeholder as what can be searched: "Search pages and actions".
|
|
81
|
+
- Write the empty text as a plain statement: "No pages or actions match."
|
|
82
|
+
- Pass `title` and `description` to CommandDialog in sentence case; the defaults are "Command Menu" and "Search for a command to run."
|
|
83
|
+
- Write shortcut hints with symbols, matching what the app actually binds: "⌘P", "⌘,".
|
|
84
|
+
|
|
85
|
+
| Do | Don't |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| New project | Click to create a new project |
|
|
88
|
+
| No pages or actions match. | Oops! Nothing here |
|
|
89
|
+
| Go to | NAVIGATION |
|
|
90
|
+
|
|
91
|
+
## 8. Rules
|
|
92
|
+
|
|
93
|
+
1. Use `CommandDialog` for a Cmd+K palette. Bind Cmd/Ctrl+K yourself on `document`, and give it a visible trigger Button as well.
|
|
94
|
+
2. Put every item inside `CommandList`, with `CommandEmpty` first in the list.
|
|
95
|
+
3. Give every `CommandItem` a unique `value`. Without one, cmdk infers it from the row's text, shortcut hint included, and items with the same value highlight together. Add `keywords` for synonyms.
|
|
96
|
+
4. Run the item's action in `onSelect`. Enter and click both call it; an `onClick` on CommandItem is overwritten.
|
|
97
|
+
5. Close the dialog in `onSelect` when the item navigates or opens something else.
|
|
98
|
+
6. Use the `selected` prop only to mark the current value in a picker, with a Check icon. Never use it to show the highlight; cmdk handles that.
|
|
99
|
+
7. Use `CommandShortcut` for shortcut hints inside items, and [Kbd](./kbd.md) everywhere else.
|
|
100
|
+
8. Don't wrap an inline Command in another bordered or shadowed box; it draws its own.
|
|
101
|
+
9. Never pass `className` or `style`; they're omitted. Use a wrapper for width and height.
|
|
102
|
+
|
|
103
|
+
## 9. Dos and don'ts
|
|
104
|
+
|
|
105
|
+
**Do:** name items with a value, and act in `onSelect`.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<CommandItem value="Billing" keywords={["invoices", "payment"]} onSelect={() => run(() => navigate("/billing"))}>
|
|
109
|
+
Billing
|
|
110
|
+
<CommandShortcut>⌘B</CommandShortcut>
|
|
111
|
+
</CommandItem>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Don't:** use `onClick` or leave values to be guessed from text.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
<CommandItem onClick={() => navigate("/billing")}>
|
|
118
|
+
Billing <CommandShortcut>⌘B</CommandShortcut>
|
|
119
|
+
</CommandItem>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Do:** build a searchable picker from Popover and Command, marking the chosen value.
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
126
|
+
<PopoverTrigger asChild>
|
|
127
|
+
<Button id="time-zone" type="button" variant={zone ? "input" : "inputMuted"} fullWidth align="start" textAlign="left">
|
|
128
|
+
{zone ?? "Choose a time zone"}
|
|
129
|
+
</Button>
|
|
130
|
+
</PopoverTrigger>
|
|
131
|
+
<PopoverContent layout="matchTrigger" align="start">
|
|
132
|
+
<Command label="Time zones">
|
|
133
|
+
<CommandInput placeholder="Search time zones" density="compact" />
|
|
134
|
+
<CommandList>
|
|
135
|
+
<CommandEmpty tone="muted">No time zones match.</CommandEmpty>
|
|
136
|
+
<CommandGroup>
|
|
137
|
+
{zones.map((name) => (
|
|
138
|
+
<CommandItem key={name} value={name} selected={name === zone} onSelect={() => { setZone(name); setOpen(false); }}>
|
|
139
|
+
{name}
|
|
140
|
+
{name === zone && <Check aria-hidden="true" style={{ marginLeft: "auto", width: "var(--size-xxs)", height: "var(--size-xxs)" }} />}
|
|
141
|
+
</CommandItem>
|
|
142
|
+
))}
|
|
143
|
+
</CommandGroup>
|
|
144
|
+
</CommandList>
|
|
145
|
+
</Command>
|
|
146
|
+
</PopoverContent>
|
|
147
|
+
</Popover>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Don't:** hand-roll a filtered list with an Input and buttons.
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<Input value={query} onChange={(e) => setQuery(e.target.value)} />
|
|
154
|
+
{zones.filter((z) => z.includes(query)).map((z) => <button key={z} onClick={() => setZone(z)}>{z}</button>)}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## 10. Accessibility
|
|
158
|
+
|
|
159
|
+
- Role: the input is a `combobox` with `aria-expanded`, `aria-controls` and `aria-activedescendant`; the list is a `listbox`; items are `option`s, with `aria-selected` on the highlighted one; groups are `group`s named by their heading; separators are `separator`s.
|
|
160
|
+
- Label: the input is labelled by Command's visually hidden `label`; set it on an inline Command. CommandDialog doesn't pass one, so give its CommandInput a descriptive placeholder and an `aria-label`. The listbox is named "Suggestions" unless you pass CommandList `label`. CommandDialog's `title` names the dialog.
|
|
161
|
+
- Keyboard: Down and Up move the highlight (wrapping only with `loop`); Home and End jump to the first and last item; Alt with Down or Up jumps between groups; Enter runs the highlighted item; Ctrl+N or Ctrl+J and Ctrl+P or Ctrl+K also move down and up. Escape closes CommandDialog. Typing filters.
|
|
162
|
+
- Focus: focus stays in the input while the highlight moves. CommandDialog traps focus, focuses the input on open and puts focus back where it was on close. Inline Command doesn't trap focus.
|
|
163
|
+
- Contrast: handled by the theme. Don't override colours, including the shortcut hint on the highlighted row (States).
|
|
164
|
+
|
|
165
|
+
## 11. Behaviour
|
|
166
|
+
|
|
167
|
+
- Filtering: items are filtered and ranked by match score as the user types. Groups with no matches hide, separators hide while there's a query, and CommandEmpty shows when nothing matches. Set `shouldFilter={false}` on Command to filter the items yourself.
|
|
168
|
+
- Responsive: inline Command fills the width and height of its parent; constrain it with a wrapper. CommandDialog takes the Dialog's width.
|
|
169
|
+
- Overflow: CommandList has a fixed maximum height and scrolls; the highlighted item scrolls into view.
|
|
170
|
+
- Motion: none of its own; CommandDialog uses the Dialog's. Don't add any.
|
|
171
|
+
|
|
172
|
+
## 12. API
|
|
173
|
+
|
|
174
|
+
<!-- api:start -->
|
|
175
|
+
### Command
|
|
176
|
+
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| --- | --- | --- | --- |
|
|
179
|
+
| `label` | `string` | | Visually hidden label for the input. |
|
|
180
|
+
| `shouldFilter` | `boolean` | `true` | Set `false` to filter and sort items yourself. |
|
|
181
|
+
| `filter` | `(value: string, search: string, keywords?: string[]) => number` | cmdk's scorer | Match score from 0 (hidden) to 1 (best). |
|
|
182
|
+
| `value` | `string` | | Controlled value of the highlighted item. |
|
|
183
|
+
| `defaultValue` | `string` | | Initially highlighted item. |
|
|
184
|
+
| `onValueChange` | `(value: string) => void` | | Called when the highlight moves. |
|
|
185
|
+
| `loop` | `boolean` | `false` | Arrow keys wrap around. |
|
|
186
|
+
| `vimBindings` | `boolean` | `true` | Ctrl+N/J/P/K navigation. |
|
|
187
|
+
| `disablePointerSelection` | `boolean` | `false` | Stops the pointer moving the highlight. |
|
|
188
|
+
| `...props` | cmdk `Command` (div attributes) without `className`, `style` | | |
|
|
189
|
+
|
|
190
|
+
### CommandDialog
|
|
191
|
+
|
|
192
|
+
| Prop | Type | Default | Description |
|
|
193
|
+
| --- | --- | --- | --- |
|
|
194
|
+
| `open` | `boolean` | | Controlled open state. |
|
|
195
|
+
| `onOpenChange` | `(open: boolean) => void` | | Called on open and close. |
|
|
196
|
+
| `defaultOpen` | `boolean` | | Initial state when uncontrolled. |
|
|
197
|
+
| `title` | `string` | `"Command Menu"` | Visually hidden dialog title. |
|
|
198
|
+
| `description` | `string` | `"Search for a command to run."` | Visually hidden dialog description. |
|
|
199
|
+
| `...props` | Radix `Dialog` root props | | `modal` and the rest. Command props are not passed to the inner Command. |
|
|
200
|
+
|
|
201
|
+
### CommandInput
|
|
202
|
+
|
|
203
|
+
| Prop | Type | Default | Description |
|
|
204
|
+
| --- | --- | --- | --- |
|
|
205
|
+
| `density` | `"default" \| "compact"` | `"default"` | Input height: `--size-xl` or `--size-lg`. |
|
|
206
|
+
| `value` | `string` | | Controlled search text. |
|
|
207
|
+
| `onValueChange` | `(search: string) => void` | | Called as the search text changes. |
|
|
208
|
+
| `placeholder` | `string` | | Hint for what can be searched. |
|
|
209
|
+
| `...props` | cmdk `Command.Input` (input attributes) without `className`, `size`, `style` | | |
|
|
210
|
+
|
|
211
|
+
### CommandList
|
|
212
|
+
|
|
213
|
+
| Prop | Type | Default | Description |
|
|
214
|
+
| --- | --- | --- | --- |
|
|
215
|
+
| `label` | `string` | `"Suggestions"` | Accessible name of the listbox. |
|
|
216
|
+
| `...props` | cmdk `Command.List` without `className`, `style` | | |
|
|
217
|
+
|
|
218
|
+
### CommandEmpty
|
|
219
|
+
|
|
220
|
+
| Prop | Type | Default | Description |
|
|
221
|
+
| --- | --- | --- | --- |
|
|
222
|
+
| `tone` | `"default" \| "muted"` | `"default"` | `muted` uses `--interactive-fg-alt` and less padding. |
|
|
223
|
+
| `...props` | cmdk `Command.Empty` without `className`, `style` | | |
|
|
224
|
+
|
|
225
|
+
### CommandGroup
|
|
226
|
+
|
|
227
|
+
| Prop | Type | Default | Description |
|
|
228
|
+
| --- | --- | --- | --- |
|
|
229
|
+
| `heading` | `ReactNode` | | Group label; also names the group. |
|
|
230
|
+
| `value` | `string` | | Group identity. |
|
|
231
|
+
| `forceMount` | `boolean` | | Keeps the group rendered when nothing in it matches. |
|
|
232
|
+
| `...props` | cmdk `Command.Group` without `className`, `style` | | |
|
|
233
|
+
|
|
234
|
+
### CommandItem
|
|
235
|
+
|
|
236
|
+
| Prop | Type | Default | Description |
|
|
237
|
+
| --- | --- | --- | --- |
|
|
238
|
+
| `onSelect` | `(value: string) => void` | | Runs on Enter or click. |
|
|
239
|
+
| `value` | `string` | the row's text | Unique identity used for filtering and the highlight. |
|
|
240
|
+
| `keywords` | `string[]` | | Extra terms that match this item. |
|
|
241
|
+
| `disabled` | `boolean` | `false` | Skipped by the keyboard and the pointer. |
|
|
242
|
+
| `selected` | `boolean` | `false` | Eluan: marks the current value (weight 500). Not the highlight. |
|
|
243
|
+
| `forceMount` | `boolean` | | Keeps the item rendered when it doesn't match. |
|
|
244
|
+
| `...props` | cmdk `Command.Item` without `className`, `style` | | `onClick` is overwritten; use `onSelect`. |
|
|
245
|
+
|
|
246
|
+
### CommandShortcut
|
|
247
|
+
|
|
248
|
+
| Prop | Type | Default | Description |
|
|
249
|
+
| --- | --- | --- | --- |
|
|
250
|
+
| `...props` | `HTMLAttributes<HTMLSpanElement>` without `className`, `style` | | The hint text as children. |
|
|
251
|
+
|
|
252
|
+
### CommandSeparator
|
|
253
|
+
|
|
254
|
+
| Prop | Type | Default | Description |
|
|
255
|
+
| --- | --- | --- | --- |
|
|
256
|
+
| `alwaysRender` | `boolean` | `false` | Keeps the line visible while searching. |
|
|
257
|
+
<!-- api:end -->
|
|
258
|
+
|
|
259
|
+
## 13. Examples
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
import * as React from "react";
|
|
263
|
+
import {
|
|
264
|
+
Button,
|
|
265
|
+
CommandDialog,
|
|
266
|
+
CommandEmpty,
|
|
267
|
+
CommandGroup,
|
|
268
|
+
CommandInput,
|
|
269
|
+
CommandItem,
|
|
270
|
+
CommandList,
|
|
271
|
+
CommandSeparator,
|
|
272
|
+
CommandShortcut,
|
|
273
|
+
Kbd,
|
|
274
|
+
} from "@eluan/core";
|
|
275
|
+
import { FilePlus, FolderOpen, Settings, Users } from "lucide-react";
|
|
276
|
+
|
|
277
|
+
const icon = { width: "var(--size-xxs)", height: "var(--size-xxs)" };
|
|
278
|
+
|
|
279
|
+
export function AppCommandMenu({
|
|
280
|
+
navigate,
|
|
281
|
+
createProject,
|
|
282
|
+
}: {
|
|
283
|
+
navigate: (path: string) => void;
|
|
284
|
+
createProject: () => void;
|
|
285
|
+
}) {
|
|
286
|
+
const [open, setOpen] = React.useState(false);
|
|
287
|
+
|
|
288
|
+
React.useEffect(() => {
|
|
289
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
290
|
+
if (event.key.toLowerCase() === "k" && (event.metaKey || event.ctrlKey)) {
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
setOpen((value) => !value);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
document.addEventListener("keydown", onKeyDown);
|
|
296
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
297
|
+
}, []);
|
|
298
|
+
|
|
299
|
+
const run = (action: () => void) => {
|
|
300
|
+
setOpen(false);
|
|
301
|
+
action();
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
<>
|
|
306
|
+
<Button type="button" variant="outline" aria-keyshortcuts="Meta+K Control+K" onClick={() => setOpen(true)}>
|
|
307
|
+
Search
|
|
308
|
+
<Kbd keys="cmd+k" size="sm" variant="ghost" aria-hidden="true" />
|
|
309
|
+
</Button>
|
|
310
|
+
<CommandDialog
|
|
311
|
+
open={open}
|
|
312
|
+
onOpenChange={setOpen}
|
|
313
|
+
title="Command menu"
|
|
314
|
+
description="Search for a page or an action."
|
|
315
|
+
>
|
|
316
|
+
<CommandInput placeholder="Search pages and actions" aria-label="Search pages and actions" />
|
|
317
|
+
<CommandList>
|
|
318
|
+
<CommandEmpty>No pages or actions match.</CommandEmpty>
|
|
319
|
+
<CommandGroup heading="Go to">
|
|
320
|
+
<CommandItem value="Projects" onSelect={() => run(() => navigate("/projects"))}>
|
|
321
|
+
<FolderOpen aria-hidden="true" style={icon} />
|
|
322
|
+
Projects
|
|
323
|
+
</CommandItem>
|
|
324
|
+
<CommandItem value="Team members" keywords={["people", "users"]} onSelect={() => run(() => navigate("/team"))}>
|
|
325
|
+
<Users aria-hidden="true" style={icon} />
|
|
326
|
+
Team members
|
|
327
|
+
</CommandItem>
|
|
328
|
+
<CommandItem value="Settings" onSelect={() => run(() => navigate("/settings"))}>
|
|
329
|
+
<Settings aria-hidden="true" style={icon} />
|
|
330
|
+
Settings
|
|
331
|
+
<CommandShortcut>⌘,</CommandShortcut>
|
|
332
|
+
</CommandItem>
|
|
333
|
+
</CommandGroup>
|
|
334
|
+
<CommandSeparator />
|
|
335
|
+
<CommandGroup heading="Actions">
|
|
336
|
+
<CommandItem value="New project" onSelect={() => run(createProject)}>
|
|
337
|
+
<FilePlus aria-hidden="true" style={icon} />
|
|
338
|
+
New project
|
|
339
|
+
</CommandItem>
|
|
340
|
+
</CommandGroup>
|
|
341
|
+
</CommandList>
|
|
342
|
+
</CommandDialog>
|
|
343
|
+
</>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## 14. Related components
|
|
349
|
+
|
|
350
|
+
- [Dialog](./dialog.md): CommandDialog is a Dialog with `layout="command"`.
|
|
351
|
+
- [SearchInput](./search-input.md): plain search fields, `CommandSearch` (focus on Cmd+K, no list) and `AutocompleteSearch`.
|
|
352
|
+
- [MultiSelect](./multi-select.md): a searchable multi-choice picker built from Command in a Popover.
|
|
353
|
+
- [Popover](./popover.md): the surface for a searchable picker.
|
|
354
|
+
- [Kbd](./kbd.md): shortcut keycaps outside Command rows, such as on the trigger Button.
|
|
355
|
+
- [DropdownMenu](./dropdown-menu.md): a short menu of actions without search.
|
|
356
|
+
|
|
357
|
+
## 15. Common agent mistakes
|
|
358
|
+
|
|
359
|
+
_Filled from evals._
|