@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,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Button
|
|
3
|
+
use_when: The user triggers an action, submits a form or opens an overlay.
|
|
4
|
+
instead_of: Link or your router's link for navigation (Button asChild only to style one); Toggle or Switch for on/off state; DropdownMenu for a list of actions.
|
|
5
|
+
source: packages/core/src/components/button.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Button
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Button triggers an action. It renders a native `<button>` (or its child, with `asChild`) and comes in fourteen variants and seven sizes, including square icon-only sizes.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- Submitting or cancelling a form.
|
|
17
|
+
- Running an action on the current page: save, delete, export, add.
|
|
18
|
+
- Opening a Dialog, Sheet, Popover or DropdownMenu (as the trigger, with `asChild` on the trigger part).
|
|
19
|
+
- An icon-only action, with an `icon*` size and an `aria-label`.
|
|
20
|
+
|
|
21
|
+
### When not to use
|
|
22
|
+
|
|
23
|
+
- Moving to another page or URL → use your router's link, or [Button](./button.md) `variant="link"` with `asChild` around an `<a>` when it must look like a button.
|
|
24
|
+
- Turning a setting on or off → use [Switch](./switch.md).
|
|
25
|
+
- A pressed/unpressed state that stays visible → use [Toggle](./toggle.md) or [ToggleGroup](./toggle-group.md).
|
|
26
|
+
- Picking one view of several → use [Tabs](./tabs.md) or [SegmentedControl](./segmented-control.md).
|
|
27
|
+
- Several related actions behind one control → use [DropdownMenu](./dropdown-menu.md) or [ActionPopover](./action-popover.md).
|
|
28
|
+
|
|
29
|
+
## 3. Anatomy
|
|
30
|
+
|
|
31
|
+
1. **Container**: the `<button>` element; carries the variant colours, radius and focus outline.
|
|
32
|
+
2. **Label**: the text child. Required unless the button is icon-only.
|
|
33
|
+
3. **Icon** (optional): a Lucide icon before or after the label, or alone for icon-only sizes. Content sits in a row with a `--spacing-xs` gap.
|
|
34
|
+
|
|
35
|
+
## 4. Variants
|
|
36
|
+
|
|
37
|
+
| Variant | Use for |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `default` | The single main action in a view or form: Save, Create, Continue. |
|
|
40
|
+
| `secondary` | A neutral filled action next to a primary one. |
|
|
41
|
+
| `outline` | Secondary actions: Cancel, Back, Export. |
|
|
42
|
+
| `ghost` | Low-emphasis actions in toolbars, table rows and headers. |
|
|
43
|
+
| `mutedGhost` | Even quieter toolbar actions on busy surfaces. |
|
|
44
|
+
| `fadedGhost` | Actions that should recede until hovered (60% opacity at rest). |
|
|
45
|
+
| `destructive` | The confirm action of a destructive flow: Delete project. |
|
|
46
|
+
| `dangerGhost` | A low-emphasis destructive entry point, such as Remove in a row. |
|
|
47
|
+
| `caution` | An action with a reversible but notable consequence. |
|
|
48
|
+
| `positive` | An action that confirms a successful or approving outcome: Approve. |
|
|
49
|
+
| `dashed` | Adding an item to a list or an empty slot: Add field. |
|
|
50
|
+
| `input` | A button that opens a picker and should look like a form field (DatePicker and Select-like triggers). |
|
|
51
|
+
| `inputMuted` | The same, showing placeholder-weight text. |
|
|
52
|
+
| `link` | An inline text action that looks like a link. |
|
|
53
|
+
|
|
54
|
+
## 5. Sizes
|
|
55
|
+
|
|
56
|
+
| Size | Use in |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `default` | Most buttons (`--size-lg` tall). |
|
|
59
|
+
| `sm` | Dense toolbars, table rows, inline with small text (`--size-md`). |
|
|
60
|
+
| `lg` | A hero or marketing call to action (`--size-xl`). |
|
|
61
|
+
| `icon` | Icon-only, next to default-size controls. |
|
|
62
|
+
| `iconSm` | Icon-only, in dense rows. |
|
|
63
|
+
| `iconXs` | Icon-only, inside another control (clear buttons, chips). |
|
|
64
|
+
| `iconInline` | Icon-only, inline with text, no fixed box. |
|
|
65
|
+
|
|
66
|
+
## 6. States
|
|
67
|
+
|
|
68
|
+
| State | Looks like | Notes |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| Default | Variant colours | |
|
|
71
|
+
| Hover | Variant `-hover` background | |
|
|
72
|
+
| Focus | 1px outline in `--focus-ring`, 1px offset | Never remove or restyle the focus ring. |
|
|
73
|
+
| Active | Variant `-active` background; solid variants nudge down slightly | `destructive` and `dashed` lose label contrast while pressed. |
|
|
74
|
+
| Disabled | 50% opacity, no pointer events | `input` variants switch to the disabled interactive tokens instead. |
|
|
75
|
+
| Loading | No built-in loading state | Put a [Spinner](./spinner.md) before the label, keep the label, set `aria-busy` and `aria-disabled`, and ignore clicks until the work settles. Don't set `disabled` on the button that was pressed: it drops keyboard focus. |
|
|
76
|
+
|
|
77
|
+
## 7. Content guidelines
|
|
78
|
+
|
|
79
|
+
- Start with a verb and say what happens: "Save changes", "Delete project".
|
|
80
|
+
- Use sentence case. Keep labels to one to three words.
|
|
81
|
+
- Match the label to the result the user expects, and reuse the same verb in the confirmation (Dialog title "Delete project?", button "Delete project").
|
|
82
|
+
- Don't end with punctuation.
|
|
83
|
+
|
|
84
|
+
| Do | Don't |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| Save changes | Click here |
|
|
87
|
+
| Delete project | OK |
|
|
88
|
+
| Add teammate | Submit |
|
|
89
|
+
| Cancel | No thanks! |
|
|
90
|
+
|
|
91
|
+
## 8. Rules
|
|
92
|
+
|
|
93
|
+
1. Use one `default` (primary) button per view or form.
|
|
94
|
+
2. Set `type="button"` on every button that doesn't submit a form. Button has no default type, so inside a `<form>` it submits.
|
|
95
|
+
3. Give icon-only buttons an `aria-label`. Mark the icon `aria-hidden="true"`.
|
|
96
|
+
4. Put the primary action last in a button row (rightmost in left-to-right layouts), with secondary actions before it.
|
|
97
|
+
5. Use `destructive` only for the action that actually destroys, usually inside a confirmation Dialog.
|
|
98
|
+
6. Never pass `className` or `style`; they're dropped. Use `fullWidth` or a wrapper for layout.
|
|
99
|
+
7. Use `asChild` to render a link with button styling, never `onClick` with `window.location`.
|
|
100
|
+
|
|
101
|
+
## 9. Dos and don'ts
|
|
102
|
+
|
|
103
|
+
**Do:** one primary action, secondary actions in `outline`.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<div style={{ display: "flex", gap: "var(--spacing-sm)", justifyContent: "flex-end" }}>
|
|
107
|
+
<Button type="button" variant="outline">Cancel</Button>
|
|
108
|
+
<Button type="submit">Save changes</Button>
|
|
109
|
+
</div>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Don't:** stack several primary buttons or make Cancel primary.
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<div>
|
|
116
|
+
<Button>Cancel</Button>
|
|
117
|
+
<Button>Save draft</Button>
|
|
118
|
+
<Button>Publish</Button>
|
|
119
|
+
</div>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Do:** name icon-only buttons.
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<Button type="button" variant="ghost" size="icon" aria-label="Close panel">
|
|
126
|
+
<X aria-hidden="true" style={{ width: "var(--size-xxs)", height: "var(--size-xxs)" }} />
|
|
127
|
+
</Button>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Don't:** leave them unlabeled or style them by hand.
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
<Button size="icon" style={{ background: "#eee" }}>
|
|
134
|
+
<X />
|
|
135
|
+
</Button>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Do:** navigate with a link styled as a button.
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
<Button asChild variant="outline">
|
|
142
|
+
<a href="/billing">View billing</a>
|
|
143
|
+
</Button>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Don't:** navigate from a click handler.
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
<Button onClick={() => (window.location.href = "/billing")}>View billing</Button>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 10. Accessibility
|
|
153
|
+
|
|
154
|
+
- Role: `button` (native `<button>`); with `asChild`, the child's role (a link stays a link).
|
|
155
|
+
- Label: the text content; `aria-label` for icon-only buttons.
|
|
156
|
+
- Keyboard: Enter and Space activate. Tab moves focus in DOM order.
|
|
157
|
+
- Focus: visible outline on `:focus-visible`. Disabled buttons use `pointer-events: none` and the native `disabled` attribute, so they're skipped by Tab.
|
|
158
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
159
|
+
|
|
160
|
+
## 11. Behaviour
|
|
161
|
+
|
|
162
|
+
- Responsive: Button sizes to its content; `fullWidth` stretches it to the container. Use `fullWidth` for stacked mobile actions.
|
|
163
|
+
- Overflow and truncation: labels don't wrap (`white-space: nowrap`). Keep them short; don't rely on truncation.
|
|
164
|
+
- Motion: colour transitions over 150ms; solid variants nudge down on press. Don't add your own.
|
|
165
|
+
- `attachment="start"` or `"end"` flattens one edge so the button sits flush against an adjacent Input.
|
|
166
|
+
|
|
167
|
+
## 12. API
|
|
168
|
+
|
|
169
|
+
<!-- api:start -->
|
|
170
|
+
| Prop | Type | Default | Description |
|
|
171
|
+
| --- | --- | --- | --- |
|
|
172
|
+
| `variant` | `"default" \| "destructive" \| "caution" \| "positive" \| "outline" \| "dashed" \| "secondary" \| "ghost" \| "mutedGhost" \| "dangerGhost" \| "fadedGhost" \| "input" \| "inputMuted" \| "link"` | `"default"` | Visual style. |
|
|
173
|
+
| `size` | `"default" \| "sm" \| "lg" \| "icon" \| "iconSm" \| "iconXs" \| "iconInline"` | `"default"` | Height and padding; `icon*` sizes are square for icon-only buttons. |
|
|
174
|
+
| `align` | `"center" \| "start"` | `"center"` | Horizontal alignment of the content. |
|
|
175
|
+
| `attachment` | `"none" \| "start" \| "end"` | `"none"` | Flattens one edge to sit flush against an adjacent control. |
|
|
176
|
+
| `shape` | `"default" \| "round"` | `"default"` | `"round"` makes a pill. |
|
|
177
|
+
| `textAlign` | `"center" \| "left"` | `"center"` | Text alignment inside the button. |
|
|
178
|
+
| `fullWidth` | `boolean` | `false` | Stretches to the container width. |
|
|
179
|
+
| `asChild` | `boolean` | `false` | Renders the child element with Button's props and styles (Radix Slot). |
|
|
180
|
+
| `...props` | `ButtonHTMLAttributes` without `className`, `style` | | Native button attributes: `type`, `disabled`, `onClick`, `aria-*`. |
|
|
181
|
+
<!-- api:end -->
|
|
182
|
+
|
|
183
|
+
## 13. Examples
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { Button } from "@eluan/core";
|
|
187
|
+
import { Plus } from "lucide-react";
|
|
188
|
+
|
|
189
|
+
export function ProjectToolbar({ onCreate }: { onCreate: () => void }) {
|
|
190
|
+
return (
|
|
191
|
+
<div style={{ display: "flex", alignItems: "center", gap: "var(--spacing-sm)" }}>
|
|
192
|
+
<Button asChild variant="ghost" size="sm">
|
|
193
|
+
<a href="/projects/archive">View archive</a>
|
|
194
|
+
</Button>
|
|
195
|
+
<Button type="button" onClick={onCreate}>
|
|
196
|
+
<Plus aria-hidden="true" style={{ width: "var(--size-xxs)", height: "var(--size-xxs)" }} />
|
|
197
|
+
New project
|
|
198
|
+
</Button>
|
|
199
|
+
</div>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 14. Related components
|
|
205
|
+
|
|
206
|
+
- [Toggle](./toggle.md): a button that stays pressed.
|
|
207
|
+
- [ToggleGroup](./toggle-group.md): a set of pressable options.
|
|
208
|
+
- [DropdownMenu](./dropdown-menu.md): several actions behind one trigger Button.
|
|
209
|
+
- [Dialog](./dialog.md): confirm destructive actions before running them.
|
|
210
|
+
- [Spinner](./spinner.md): in-button loading feedback.
|
|
211
|
+
|
|
212
|
+
## 15. Common agent mistakes
|
|
213
|
+
|
|
214
|
+
- Setting `disabled` on the button that started a save or delete. Focus drops to the page the moment it's pressed. Set `aria-busy` and `aria-disabled` and ignore clicks until the work settles; the Spinner and label show it's busy.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Calendar
|
|
3
|
+
use_when: A month grid stays visible on the page for picking one date, several dates or a range.
|
|
4
|
+
instead_of: DatePicker or DateRangePicker for a date field in a form or filter bar; DateTimePicker when the time matters too.
|
|
5
|
+
source: packages/core/src/components/calendar.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Calendar
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Calendar is an inline month grid built on react-day-picker v9. It replaces the library's caption with month and year Selects, puts previous and next month buttons on either side, and supports single, multiple and range selection. DatePicker, DateRangePicker and DateTimePicker all render it inside a Popover.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- A date choice that stays on the page: a booking or availability view, a side panel that filters by day.
|
|
17
|
+
- Picking several separate dates (`mode="multiple"`). No picker wraps this mode.
|
|
18
|
+
- A custom panel or popover around a month grid that the pickers don't cover.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- A date field in a form → use [DatePicker](./date-picker.md).
|
|
23
|
+
- A start and end date in a form or filter bar → use DateRangePicker, documented in [DatePicker](./date-picker.md).
|
|
24
|
+
- A date plus a time of day → use [DateTimePicker](./date-time-picker.md).
|
|
25
|
+
- A time of day on its own → use [TimeInput](./time-input.md).
|
|
26
|
+
- A birth date or any date many years from today → use an [Input](./input.md) with a format hint. The year Select only lists ten years around the current one.
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Previous and next buttons**: ghost icon Buttons on the left and right edges, named "Go to previous month" and "Go to next month".
|
|
31
|
+
2. **Caption**: a month Select and a year Select for each month shown.
|
|
32
|
+
3. **Weekday row**: short weekday names in `--interactive-fg-alt`.
|
|
33
|
+
4. **Day grid**: one grid per month. Each day is a button with its number in `--font-mono`.
|
|
34
|
+
5. **Outside days** (optional): trailing and leading days of the adjacent months, shown by default.
|
|
35
|
+
|
|
36
|
+
Calendar draws no border or background of its own. Put it on a surface you own: a Card, a Popover, or a bordered wrapper.
|
|
37
|
+
|
|
38
|
+
## 4. Variants
|
|
39
|
+
|
|
40
|
+
Calendar has no `variant` prop. `mode` sets how selection works:
|
|
41
|
+
|
|
42
|
+
| Mode | Use for |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `single` | One date. Clicking the selected date again clears it unless `required` is set. |
|
|
45
|
+
| `multiple` | Several separate dates, each toggled on click. |
|
|
46
|
+
| `range` | A start and end date. The first click selects that day as a one-day range; the next click before or after it extends the range. Use `numberOfMonths={2}`. |
|
|
47
|
+
|
|
48
|
+
## 5. Sizes
|
|
49
|
+
|
|
50
|
+
Calendar has no size prop. Day cells are `--size-md` tall and the grid stretches to fill its container, so the wrapper's width sets the cell width.
|
|
51
|
+
|
|
52
|
+
## 6. States
|
|
53
|
+
|
|
54
|
+
| State | Looks like | Notes |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Default | Day numbers in `--font-mono`, `--font-size-sm` | |
|
|
57
|
+
| Hover | Day fills with `--interactive-bg-hover` and rounds to `--curves-lg` | |
|
|
58
|
+
| Focus | 1px outline in `--focus-ring`, 1px offset, on the focused day | Never remove or restyle the focus ring. |
|
|
59
|
+
| Selected | `--interactive-bg-selected` fill with `--interactive-fg-selected` text; hovering it uses `--action-primary-bg-hover` | |
|
|
60
|
+
| Range | Start and end days take the selected fill with rounded outer corners; days between use `--interactive-bg-alt2` with `--interactive-fg-alt` text and square corners | The start day squares its inner corner once both ends are chosen. This is deliberate; don't restyle it. |
|
|
61
|
+
| Today | Bold number with a short keyline under it | The keyline offset is in `em` on purpose so it tracks density. |
|
|
62
|
+
| Outside day | `--interactive-fg-disabled` text | A selected outside day (a range that crosses a month boundary) renders pale text on a pale fill and is close to invisible. In `mode="range"`, set `showOutsideDays={false}` to avoid it. |
|
|
63
|
+
| Disabled | Whole calendar at 50% opacity, no pointer events, `aria-disabled` on the root | Set with `disabled`. |
|
|
64
|
+
|
|
65
|
+
## 7. Content guidelines
|
|
66
|
+
|
|
67
|
+
- Calendar has no text props. Name what the date is for in a heading or label right above it: "Delivery day", "Out of office".
|
|
68
|
+
- Show the chosen date in words near an inline calendar when it drives the rest of the page ("Arrives Thursday, 30 October").
|
|
69
|
+
- Month names in the caption are English whatever `locale` you pass.
|
|
70
|
+
|
|
71
|
+
| Do | Don't |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| Delivery day | Select |
|
|
74
|
+
| Days off | Calendar |
|
|
75
|
+
|
|
76
|
+
## 8. Rules
|
|
77
|
+
|
|
78
|
+
1. Always pass `mode`. Without it, days render as plain text, not buttons, and nothing can be selected.
|
|
79
|
+
2. Pass `selected` and `onSelect` together. The shape follows `mode`: a `Date`, a `Date[]`, or `{ from, to }`.
|
|
80
|
+
3. Give Calendar a container. It fills the width it's given, so constrain it with a wrapper (`width: "fit-content"` or a fixed column) and put it on a Card, a Popover or a bordered wrapper.
|
|
81
|
+
4. Use `disabled` only as a boolean for the whole calendar. Any truthy value, including a date matcher, disables every day. To restrict dates, check the date in `onSelect` and explain with a [Label](./form-label.md) hint or FormMessage.
|
|
82
|
+
5. Use `numberOfMonths={2}` for ranges, as DateRangePicker does.
|
|
83
|
+
6. Declare the range type yourself (`{ from: Date | undefined; to?: Date | undefined }`) instead of importing `DateRange` from `react-day-picker`, which is Eluan's dependency, not your app's.
|
|
84
|
+
7. Never pass `className`, `classNames`, `style` or a `MonthCaption` component. Calendar overwrites `className`, `classNames` and the caption.
|
|
85
|
+
|
|
86
|
+
## 9. Dos and don'ts
|
|
87
|
+
|
|
88
|
+
**Do:** set a mode and control the selection.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
const [day, setDay] = React.useState<Date | undefined>();
|
|
92
|
+
|
|
93
|
+
<Calendar mode="single" selected={day} onSelect={setDay} />
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Don't:** leave out `mode`, or restyle the grid.
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
<Calendar selected={day} className="my-calendar" />
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Do:** hide outside days on an inline range calendar.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<Calendar mode="range" selected={range} onSelect={setRange} numberOfMonths={2} showOutsideDays={false} />
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Don't:** pass a date matcher to `disabled`; it disables the whole calendar.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<Calendar mode="single" selected={day} onSelect={setDay} disabled={{ before: new Date() }} />
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 10. Accessibility
|
|
115
|
+
|
|
116
|
+
- Role: each month is a `grid` named by its month and year ("October 2026"); in `multiple` and `range` modes it is `aria-multiselectable`. Days are `gridcell`s holding buttons.
|
|
117
|
+
- Label: each day button is named with the full date ("Monday, October 27th, 2026"), with "Today, " before it and ", selected" after it where they apply. Name the calendar as a whole by wrapping it in `role="group"` with `aria-labelledby` pointing at your visible heading. The month and year Selects are named only by their current value ("October", "2026").
|
|
118
|
+
- Keyboard: Arrow keys move one day or one week; Shift with Left or Right moves a month, with Up or Down a year. Page Up and Page Down move a month (with Shift, a year). Home and End go to the start and end of the week. Enter or Space selects the focused day. Tab moves through the previous button, the month and year Selects, the grid and the next button.
|
|
119
|
+
- Focus: only one day is in the tab order at a time (roving focus); arrow keys move it, and the displayed month follows. Calendar doesn't trap focus.
|
|
120
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
121
|
+
- Text size: the weekday row uses a fixed size that doesn't follow the fluid type scale or density. Don't compensate per calendar.
|
|
122
|
+
|
|
123
|
+
## 11. Behaviour
|
|
124
|
+
|
|
125
|
+
- Responsive: the grid fills its container. With `numberOfMonths={2}`, months sit side by side from a 640px viewport and stack below it, with a divider between them.
|
|
126
|
+
- Navigation: the arrows step one month. The month Select lists all twelve months; the year Select lists ten years, from five before the current year to four after. Dates outside that window are still reachable with the arrows, but the year Select then shows no matching year.
|
|
127
|
+
- Month state: uncontrolled by default (starts at `defaultMonth` or today). Pass `month` and `onMonthChange` to control it; the arrows, Selects and keyboard all report through `onMonthChange`.
|
|
128
|
+
- Motion: day colours and corners transition over 150ms. Don't add your own.
|
|
129
|
+
|
|
130
|
+
## 12. API
|
|
131
|
+
|
|
132
|
+
<!-- api:start -->
|
|
133
|
+
| Prop | Type | Default | Description |
|
|
134
|
+
| --- | --- | --- | --- |
|
|
135
|
+
| `mode` | `"single" \| "multiple" \| "range"` | | Selection mode. Required in practice: without it days aren't selectable. |
|
|
136
|
+
| `selected` | `Date \| Date[] \| { from: Date \| undefined; to?: Date \| undefined }` | | Controlled selection; the shape follows `mode`. |
|
|
137
|
+
| `onSelect` | `(selected) => void` | | Called with the new selection, or `undefined` when the user clears it. |
|
|
138
|
+
| `required` | `boolean` | `false` | Stops the user clearing the selection by clicking the selected day again. |
|
|
139
|
+
| `numberOfMonths` | `number` | `1` | Months shown together. |
|
|
140
|
+
| `month` | `Date` | | Controlled displayed month. Pair with `onMonthChange`. |
|
|
141
|
+
| `defaultMonth` | `Date` | today | Initial month when uncontrolled. |
|
|
142
|
+
| `onMonthChange` | `(month: Date) => void` | | Called when the displayed month changes. |
|
|
143
|
+
| `showOutsideDays` | `boolean` | `true` | Shows days from the adjacent months. |
|
|
144
|
+
| `disabled` | `boolean` | `false` | Disables the whole calendar. Date matchers aren't supported. |
|
|
145
|
+
| `min` / `max` | `number` | | `multiple` mode: fewest and most dates; `range` mode: shortest and longest range, in days. |
|
|
146
|
+
| `weekStartsOn` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6` | from `locale` | First day of the week; `0` is Sunday. |
|
|
147
|
+
| `locale` | react-day-picker locale | en-US | Weekday names and day labels. The month Select stays in English. |
|
|
148
|
+
| `...props` | react-day-picker `DayPicker` props | | Passed through, for example `footer`, `fixedWeeks`, `aria-labelledby`. `className` and `classNames` are overwritten, and `components.MonthCaption` is replaced. |
|
|
149
|
+
<!-- api:end -->
|
|
150
|
+
|
|
151
|
+
## 13. Examples
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import * as React from "react";
|
|
155
|
+
import { Calendar, Card, CardContent, CardHeader, CardTitle, Typography } from "@eluan/core";
|
|
156
|
+
|
|
157
|
+
export function DeliveryDayCard() {
|
|
158
|
+
const [day, setDay] = React.useState<Date | undefined>();
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div style={{ width: "fit-content" }}>
|
|
162
|
+
<Card>
|
|
163
|
+
<CardHeader>
|
|
164
|
+
<CardTitle id="delivery-day-title">Delivery day</CardTitle>
|
|
165
|
+
</CardHeader>
|
|
166
|
+
<CardContent>
|
|
167
|
+
<div role="group" aria-labelledby="delivery-day-title">
|
|
168
|
+
<Calendar mode="single" required selected={day} onSelect={setDay} />
|
|
169
|
+
</div>
|
|
170
|
+
<Typography variant="caption" tone="muted" aria-live="polite">
|
|
171
|
+
{day
|
|
172
|
+
? `Arrives ${day.toLocaleDateString(undefined, { weekday: "long", day: "numeric", month: "long" })}`
|
|
173
|
+
: "Pick a day to see when your order arrives."}
|
|
174
|
+
</Typography>
|
|
175
|
+
</CardContent>
|
|
176
|
+
</Card>
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 14. Related components
|
|
183
|
+
|
|
184
|
+
- [DatePicker](./date-picker.md): Calendar in a Popover behind a field-style trigger; also covers DateRangePicker.
|
|
185
|
+
- [DateTimePicker](./date-time-picker.md): Calendar plus a TimeInput in one Popover.
|
|
186
|
+
- [Popover](./popover.md): the surface to use if you build your own calendar popover.
|
|
187
|
+
- [Select](./select.md): the caption's month and year controls.
|
|
188
|
+
- [Card](./card.md): a surface for an inline calendar.
|
|
189
|
+
|
|
190
|
+
## 15. Common agent mistakes
|
|
191
|
+
|
|
192
|
+
_Filled from evals._
|