@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,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Card
|
|
3
|
+
use_when: Grouping content about one item or topic on its own surface, such as a project, a plan or a settings group.
|
|
4
|
+
instead_of: Table for items compared across the same attributes; Fieldset for a group of form fields; Dialog or Sheet for content over the page.
|
|
5
|
+
source: packages/core/src/components/card.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Card
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Card is a bordered surface that groups content about one thing. It renders a `<div>` with optional header, content and footer parts, and takes an `elevation` (shadow depth) and a `clickable` flag. It's the only component with its own elevation prop; see [elevation.md](../foundations/elevation.md).
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- Items that stand alone and are browsed in a grid: projects, articles, integrations.
|
|
17
|
+
- A few plans or options side by side, one of them recommended (pricing).
|
|
18
|
+
- A settings group or summary block inside a page section.
|
|
19
|
+
- A surface that must lift off a busy background (`elevation="sm"` or `"md"`).
|
|
20
|
+
|
|
21
|
+
### When not to use
|
|
22
|
+
|
|
23
|
+
- Items compared across the same attributes (users, invoices, line items) → use [Table](./table.md).
|
|
24
|
+
- A group of related form fields with a legend → use [Fieldset](./fieldset.md).
|
|
25
|
+
- Content that floats over the page or blocks it → use [Popover](./popover.md), [Dialog](./dialog.md) or [Sheet](./sheet.md).
|
|
26
|
+
- Long secondary content the user may skip → use [Accordion](./accordion.md).
|
|
27
|
+
- Dividing sections inside one card → use [Separator](./separator.md) or headings, never a nested Card.
|
|
28
|
+
|
|
29
|
+
## 3. Anatomy
|
|
30
|
+
|
|
31
|
+
1. **Card**: the container. Background `--container-bg`, `--curves-lg` corners, and an edge and shadow from `elevation`.
|
|
32
|
+
2. **CardHeader** (optional): a column holding the title and description, padded `--spacing-2xl` on all sides.
|
|
33
|
+
3. **CardTitle** (optional): the card's heading text, `--font-size-xl` at weight 600. Renders a `<div>`, not a heading element (see Accessibility). On an app screen that is the size of the page title, so keep CardTitle for the figure in a stat tile and name other cards with `<Typography variant="subheading" as="h3" size="base">` in the CardHeader (see [dashboard.md](../patterns/dashboard.md)).
|
|
34
|
+
4. **CardDescription** (optional): muted supporting text under the title, `--font-size-sm`.
|
|
35
|
+
5. **CardContent**: the body. Padded `--spacing-2xl` on the sides and bottom; no top padding, so it sits under the header (see Rules 3 for cards without one).
|
|
36
|
+
6. **CardFooter** (optional): a row for actions, padded like CardContent. It has no gap between children.
|
|
37
|
+
|
|
38
|
+
## 4. Variants
|
|
39
|
+
|
|
40
|
+
Card has no `variant` prop. Its look comes from `elevation` and `clickable`.
|
|
41
|
+
|
|
42
|
+
| Elevation | Use for |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `auto` (default) | Almost every card. It lifts one level above the surface it sits in: level 1 on the page, level 2 inside a panel or another card. |
|
|
45
|
+
| `sm`, `md`, `lg` | Pinning level 1, 2 or 3, when one card must stand out from its siblings, such as the recommended option in a row. |
|
|
46
|
+
| `none` | A flat, bordered card that should read as an outline: a drop zone, a placeholder. |
|
|
47
|
+
|
|
48
|
+
The levels are the `--elevation-*` tokens; see [elevation.md](../foundations/elevation.md). A raised card's edge is the token's hairline ring, so only `elevation="none"` shows the border.
|
|
49
|
+
|
|
50
|
+
`clickable` makes the whole card respond to hover: a deeper shadow, a 1px lift and a pointer cursor. It adds no role, focus or keyboard handling (see Rules and Accessibility).
|
|
51
|
+
|
|
52
|
+
## 5. Sizes
|
|
53
|
+
|
|
54
|
+
Card has no size prop. It fills the width of its parent; set width or grid placement on a wrapper you own. Inner padding is fixed at `--spacing-2xl`, which scales with density.
|
|
55
|
+
|
|
56
|
+
## 6. States
|
|
57
|
+
|
|
58
|
+
| State | Looks like | Notes |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| Default | `--container-bg` surface, edge and shadow from `elevation` | The shadows are cast in the theme's darkest neutral; dark mode adds a hairline and a light on the top edge, so depth reads in every mode. |
|
|
61
|
+
| Hover | `clickable` only: deeper shadow and a 1px upward lift | Non-clickable cards don't react. |
|
|
62
|
+
| Focus | No focus style of its own | A Card is only focusable if you add `tabIndex`; then the browser's default ring shows. Never remove or restyle the focus ring. |
|
|
63
|
+
| Active | `clickable` only: shadow drops back to `md`, lift resets | |
|
|
64
|
+
|
|
65
|
+
## 7. Content guidelines
|
|
66
|
+
|
|
67
|
+
- Give each card a short title that names the item: "Pro", "Billing contact", "Q3 roadmap".
|
|
68
|
+
- Keep the description to one sentence that says what the card is for or what changed.
|
|
69
|
+
- Use sentence case for titles and descriptions. Don't end titles with punctuation.
|
|
70
|
+
- Keep cards in a grid parallel: same parts, same order, similar length.
|
|
71
|
+
- Put at most one primary Button in a card, in the footer.
|
|
72
|
+
|
|
73
|
+
| Do | Don't |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| Pro | Our amazing Pro plan! |
|
|
76
|
+
| Manage how you receive notifications. | This card lets you manage your notification settings below. |
|
|
77
|
+
| Team members | Members of your team that you have invited |
|
|
78
|
+
|
|
79
|
+
## 8. Rules
|
|
80
|
+
|
|
81
|
+
1. Don't nest a Card inside a Card. Divide a card with [Separator](./separator.md) or headings.
|
|
82
|
+
2. Never add `box-shadow` to a card or a wrapper; choose an `elevation` instead.
|
|
83
|
+
3. Don't add padding around card parts; they already pad with `--spacing-2xl`. The exception: CardContent has no top padding, so a card without a CardHeader starts flush with its top border. Start cards with a CardHeader, or give your own element inside CardContent `paddingTop: "var(--spacing-2xl)"`.
|
|
84
|
+
4. CardFooter has no gap. Put two or more actions in a wrapper with `display: flex` and a `--spacing-*` gap, or use one `fullWidth` Button.
|
|
85
|
+
5. Use one `default` (primary) Button per card. In a row of plan cards, only the recommended card gets the primary Button; the others use `outline`.
|
|
86
|
+
6. Don't set `clickable` on a card that contains its own Buttons or links; nested interactive elements inside a clickable surface conflict.
|
|
87
|
+
7. If the whole card must be clickable, give it `role`, `tabIndex={0}`, an `aria-label`, and handle Enter and Space in `onKeyDown`. Prefer a Button or link inside a non-clickable card.
|
|
88
|
+
8. Never pass `className` or `style`; they're dropped. Size and place cards with a wrapper or a grid parent.
|
|
89
|
+
|
|
90
|
+
## 9. Dos and don'ts
|
|
91
|
+
|
|
92
|
+
**Do:** space footer actions with a wrapper.
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
<CardFooter>
|
|
96
|
+
<div style={{ display: "flex", gap: "var(--spacing-sm)", justifyContent: "flex-end", width: "100%" }}>
|
|
97
|
+
<Button type="button" variant="outline">Cancel</Button>
|
|
98
|
+
<Button type="submit">Save changes</Button>
|
|
99
|
+
</div>
|
|
100
|
+
</CardFooter>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Don't:** drop Buttons straight into CardFooter; they touch.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<CardFooter>
|
|
107
|
+
<Button variant="outline">Cancel</Button>
|
|
108
|
+
<Button>Save changes</Button>
|
|
109
|
+
</CardFooter>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Do:** get depth from `elevation`.
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<Card elevation="md">
|
|
116
|
+
<CardHeader>
|
|
117
|
+
<CardTitle>Quarterly revenue</CardTitle>
|
|
118
|
+
<CardDescription>Up 12% on last quarter.</CardDescription>
|
|
119
|
+
</CardHeader>
|
|
120
|
+
</Card>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Don't:** add a shadow or restyle the card.
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Card style={{ boxShadow: "0 8px 24px rgba(0, 0, 0, 0.2)", padding: 32 }}>
|
|
127
|
+
<CardContent>Quarterly revenue is up 12% on last quarter.</CardContent>
|
|
128
|
+
</Card>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Do:** divide one card with a Separator.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Card elevation="none">
|
|
135
|
+
<CardHeader>
|
|
136
|
+
<CardTitle>Email</CardTitle>
|
|
137
|
+
</CardHeader>
|
|
138
|
+
<CardContent>
|
|
139
|
+
<p>Product updates</p>
|
|
140
|
+
<Separator />
|
|
141
|
+
<p>Weekly digest</p>
|
|
142
|
+
</CardContent>
|
|
143
|
+
</Card>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Don't:** nest cards.
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
<Card>
|
|
150
|
+
<CardContent>
|
|
151
|
+
<Card><CardContent>Product updates</CardContent></Card>
|
|
152
|
+
<Card><CardContent>Weekly digest</CardContent></Card>
|
|
153
|
+
</CardContent>
|
|
154
|
+
</Card>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## 10. Accessibility
|
|
158
|
+
|
|
159
|
+
- Role: none by default (a plain `<div>`). Add `role="article"` or `role="group"` with an `aria-label` when a card is a self-contained item in a list, as the tests do.
|
|
160
|
+
- Label: CardTitle renders a `<div>`, so it isn't a heading and doesn't name the card. When the title belongs in the page outline, pass `role="heading"` and an `aria-level` that fits (for example `aria-level={3}` under an `h2` section).
|
|
161
|
+
- Keyboard: Card itself isn't focusable. Its Buttons, links and inputs are reached with Tab. A `clickable` card is not reachable by keyboard unless you add `tabIndex={0}` and Enter/Space handling (Rules 7).
|
|
162
|
+
- Focus: Card declares no focus style; a focusable card shows the browser's default ring. Don't add or remove one.
|
|
163
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
164
|
+
|
|
165
|
+
## 11. Behaviour
|
|
166
|
+
|
|
167
|
+
- Responsive: Card fills its parent's width. Lay cards out with a grid or flex wrapper and a `--spacing-lg` gap (page-layout.md), and drop to one column on narrow screens in your own stylesheet.
|
|
168
|
+
- Overflow and truncation: content wraps; nothing is clipped or truncated. Keep titles short.
|
|
169
|
+
- Motion: `clickable` cards animate shadow and lift over 200ms. Don't add your own transitions.
|
|
170
|
+
|
|
171
|
+
## 12. API
|
|
172
|
+
|
|
173
|
+
<!-- api:start -->
|
|
174
|
+
### Card
|
|
175
|
+
|
|
176
|
+
| Prop | Type | Default | Description |
|
|
177
|
+
| --- | --- | --- | --- |
|
|
178
|
+
| `elevation` | `"auto" \| "none" \| "sm" \| "md" \| "lg"` | `"auto"` | Shadow depth. |
|
|
179
|
+
| `clickable` | `boolean` | `false` | Adds a hover shadow, lift and pointer cursor. Adds no role, focus or keyboard handling. |
|
|
180
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Native div attributes: `role`, `aria-*`, `onClick`, `tabIndex`, `onKeyDown`. |
|
|
181
|
+
|
|
182
|
+
### CardHeader, CardTitle, CardDescription, CardContent, CardFooter
|
|
183
|
+
|
|
184
|
+
| Prop | Type | Default | Description |
|
|
185
|
+
| --- | --- | --- | --- |
|
|
186
|
+
| `children` | `ReactNode` | | The part's content. |
|
|
187
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Native div attributes. Each part renders a `<div>`; pass `role="heading"` and `aria-level` to CardTitle for heading semantics. |
|
|
188
|
+
<!-- api:end -->
|
|
189
|
+
|
|
190
|
+
## 13. Examples
|
|
191
|
+
|
|
192
|
+
Three plans, the middle one recommended (eval t06). Each plan stands alone, so they're Cards; only the recommended plan gets the primary Button.
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import {
|
|
196
|
+
Badge,
|
|
197
|
+
Button,
|
|
198
|
+
Card,
|
|
199
|
+
CardContent,
|
|
200
|
+
CardDescription,
|
|
201
|
+
CardFooter,
|
|
202
|
+
CardHeader,
|
|
203
|
+
CardTitle,
|
|
204
|
+
Typography,
|
|
205
|
+
} from "@eluan/core";
|
|
206
|
+
|
|
207
|
+
const plans = [
|
|
208
|
+
{ name: "Starter", price: "$0", description: "For trying things out.", features: ["1 project", "Community support"], recommended: false },
|
|
209
|
+
{ name: "Pro", price: "$24", description: "For small teams shipping every week.", features: ["Unlimited projects", "Email support", "Audit log"], recommended: true },
|
|
210
|
+
{ name: "Business", price: "$79", description: "For teams with security reviews.", features: ["SSO", "Priority support", "99.9% uptime SLA"], recommended: false },
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
export function PricingPlans() {
|
|
214
|
+
return (
|
|
215
|
+
<section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
|
|
216
|
+
<Typography variant="heading" as="h2">Choose a plan</Typography>
|
|
217
|
+
<div
|
|
218
|
+
style={{
|
|
219
|
+
display: "grid",
|
|
220
|
+
gridTemplateColumns: "repeat(3, minmax(0, 1fr))",
|
|
221
|
+
gap: "var(--spacing-lg)",
|
|
222
|
+
alignItems: "stretch",
|
|
223
|
+
}}
|
|
224
|
+
>
|
|
225
|
+
{plans.map((plan) => (
|
|
226
|
+
<Card key={plan.name} role="article" aria-label={`${plan.name} plan`} elevation={plan.recommended ? "md" : "sm"}>
|
|
227
|
+
<CardHeader>
|
|
228
|
+
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: "var(--spacing-sm)" }}>
|
|
229
|
+
<CardTitle role="heading" aria-level={3}>{plan.name}</CardTitle>
|
|
230
|
+
{plan.recommended && <Badge variant="informative">Recommended</Badge>}
|
|
231
|
+
</div>
|
|
232
|
+
<CardDescription>{plan.description}</CardDescription>
|
|
233
|
+
</CardHeader>
|
|
234
|
+
<CardContent>
|
|
235
|
+
<Typography variant="title" as="p">
|
|
236
|
+
{plan.price}
|
|
237
|
+
<Typography variant="caption" tone="muted"> per user / month</Typography>
|
|
238
|
+
</Typography>
|
|
239
|
+
<ul style={{ margin: 0, paddingInlineStart: "var(--spacing-xl)", display: "flex", flexDirection: "column", gap: "var(--spacing-xs)" }}>
|
|
240
|
+
{plan.features.map((feature) => (
|
|
241
|
+
<li key={feature}>
|
|
242
|
+
<Typography variant="body" as="span">{feature}</Typography>
|
|
243
|
+
</li>
|
|
244
|
+
))}
|
|
245
|
+
</ul>
|
|
246
|
+
</CardContent>
|
|
247
|
+
<CardFooter>
|
|
248
|
+
<Button type="button" variant={plan.recommended ? "default" : "outline"} fullWidth>
|
|
249
|
+
Choose {plan.name}
|
|
250
|
+
</Button>
|
|
251
|
+
</CardFooter>
|
|
252
|
+
</Card>
|
|
253
|
+
))}
|
|
254
|
+
</div>
|
|
255
|
+
</section>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## 14. Related components
|
|
261
|
+
|
|
262
|
+
- [Table](./table.md): compare items across the same columns instead of browsing them.
|
|
263
|
+
- [Separator](./separator.md): divide sections inside one card.
|
|
264
|
+
- [Button](./button.md): card actions, one primary per card.
|
|
265
|
+
- [Badge](./badge.md): a status or "Recommended" marker in the header.
|
|
266
|
+
- [Typography](./typography.md): headings and text inside CardContent.
|
|
267
|
+
- [Carousel](./carousel.md): a scrolling row of cards.
|
|
268
|
+
|
|
269
|
+
## 15. Common agent mistakes
|
|
270
|
+
|
|
271
|
+
_Filled from evals._
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Carousel
|
|
3
|
+
use_when: Showing a row of similar slides the user pages through one or a few at a time, such as screenshots, testimonials or featured items.
|
|
4
|
+
instead_of: Card grid when every item should be visible; Tabs for switching views; Stepper for an ordered process.
|
|
5
|
+
source: packages/core/src/components/carousel.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Carousel
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Carousel is a scrolling strip of slides with previous and next buttons, built on Embla. Slides snap into place, can be dragged or swiped, and can show one, two or three per view. Embla options, plugins and its API pass through for looping, alignment and slide counters.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- Product screenshots or images the user flips through.
|
|
17
|
+
- Testimonials, featured articles or templates where only a few need to show at once.
|
|
18
|
+
- A row of cards that doesn't fit the width on small screens.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- Every item should be visible and comparable → use [Card](./card.md) in a grid, or [Table](./table.md).
|
|
23
|
+
- Switching between views of the same content → use [Tabs](./tabs.md) or [SegmentedControl](./segmented-control.md).
|
|
24
|
+
- Steps the user must complete in order → use [Stepper](./stepper.md).
|
|
25
|
+
- One important message → show it directly; a [Banner](./banner.md) for announcements.
|
|
26
|
+
- Paging through a long list of records → use [Pagination](./pagination.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Carousel**: the root region. Holds the Embla instance and handles arrow keys.
|
|
31
|
+
2. **CarouselContent**: the clipping viewport and the track of slides. Slides are spaced `--spacing-md` apart.
|
|
32
|
+
3. **CarouselItem**: one slide. `basis` sets how much of the viewport it takes.
|
|
33
|
+
4. **CarouselPrevious** and **CarouselNext**: round ghost icon [Buttons](./button.md) with arrow icons, positioned outside the viewport's edges (above and below for vertical carousels).
|
|
34
|
+
|
|
35
|
+
## 4. Variants
|
|
36
|
+
|
|
37
|
+
| Orientation | Use for |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `horizontal` (default) | Almost every carousel. Slides move left and right. |
|
|
40
|
+
| `vertical` | A narrow column of stacked items, such as a side rail. Needs `viewportHeight` on CarouselContent. |
|
|
41
|
+
|
|
42
|
+
## 5. Sizes
|
|
43
|
+
|
|
44
|
+
Carousel has no size prop. It fills its parent's width. CarouselItem `basis` sets slides per view:
|
|
45
|
+
|
|
46
|
+
| Basis | Use in |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `full` (default) | One slide at a time: screenshots, hero images. |
|
|
49
|
+
| `half` | Two at a time: testimonials, larger cards. |
|
|
50
|
+
| `third` | Three at a time: product or template cards. |
|
|
51
|
+
|
|
52
|
+
## 6. States
|
|
53
|
+
|
|
54
|
+
| State | Looks like | Notes |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Default | Slides with both controls shown | |
|
|
57
|
+
| At first or last slide | The control for that direction is disabled (50% opacity) | Unless `opts={{ loop: true }}`. If the focused control becomes disabled, focus is lost. |
|
|
58
|
+
| Hover | Controls take the ghost Button hover | |
|
|
59
|
+
| Focus | Controls show the Button focus outline | Never remove or restyle the focus ring. |
|
|
60
|
+
| Dragging | Slides follow the pointer and snap on release | Embla handles this. |
|
|
61
|
+
|
|
62
|
+
## 7. Content guidelines
|
|
63
|
+
|
|
64
|
+
- Keep slides parallel: same component, same parts, similar length.
|
|
65
|
+
- Make each slide make sense on its own; users may never see the others.
|
|
66
|
+
- Put the most important slide first.
|
|
67
|
+
- Label the carousel with what it holds ("Product screenshots") and each slide with its position ("2 of 5").
|
|
68
|
+
|
|
69
|
+
| Do | Don't |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `aria-label="Customer stories"` | No label |
|
|
72
|
+
| `aria-label="2 of 5"` on a slide | `aria-label="Slide"` |
|
|
73
|
+
|
|
74
|
+
## 8. Rules
|
|
75
|
+
|
|
76
|
+
1. Give Carousel an `aria-label`. It renders a `region` that needs a name.
|
|
77
|
+
2. Give each CarouselItem an `aria-label` with its position, such as "2 of 5".
|
|
78
|
+
3. Leave room for the controls: they sit outside the viewport, `--size-xl` plus `--spacing-md` past each edge. Pad the wrapper with at least `--size-2xl` on those sides.
|
|
79
|
+
4. Don't pass `onClick` or `disabled` to CarouselPrevious or CarouselNext; your props replace the scroll handler and the end-of-track state.
|
|
80
|
+
5. Set `viewportHeight` on CarouselContent for vertical carousels, with a size token string such as `"var(--size-4xl)"`.
|
|
81
|
+
6. Don't autoplay. If you add an autoplay plugin, add a visible pause control and stop on hover and focus.
|
|
82
|
+
7. Don't put text inputs inside slides; the carousel captures Arrow Left and Arrow Right from anything inside it.
|
|
83
|
+
8. Never pass `className` or `style`; they're dropped. Size the carousel with a wrapper.
|
|
84
|
+
|
|
85
|
+
## 9. Dos and don'ts
|
|
86
|
+
|
|
87
|
+
**Do:** label the carousel and its slides, and leave room for the controls.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<div style={{ paddingInline: "var(--size-2xl)" }}>
|
|
91
|
+
<Carousel aria-label="Product screenshots">
|
|
92
|
+
<CarouselContent>
|
|
93
|
+
{shots.map((shot, i) => (
|
|
94
|
+
<CarouselItem key={shot.id} aria-label={`${i + 1} of ${shots.length}`}>
|
|
95
|
+
<Image src={shot.src} alt={shot.alt} />
|
|
96
|
+
</CarouselItem>
|
|
97
|
+
))}
|
|
98
|
+
</CarouselContent>
|
|
99
|
+
<CarouselPrevious />
|
|
100
|
+
<CarouselNext />
|
|
101
|
+
</Carousel>
|
|
102
|
+
</div>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Don't:** leave it unnamed in a tight container, or override the controls.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<div style={{ overflow: "hidden" }}>
|
|
109
|
+
<Carousel>
|
|
110
|
+
<CarouselContent>{slides}</CarouselContent>
|
|
111
|
+
<CarouselPrevious onClick={() => track("prev")} />
|
|
112
|
+
<CarouselNext />
|
|
113
|
+
</Carousel>
|
|
114
|
+
</div>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Do:** use a grid when everything should be visible.
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<div style={{ display: "grid", gridTemplateColumns: "repeat(3, minmax(0, 1fr))", gap: "var(--spacing-lg)" }}>
|
|
121
|
+
{plans.map((plan) => (
|
|
122
|
+
<Card key={plan.id}>{/* … */}</Card>
|
|
123
|
+
))}
|
|
124
|
+
</div>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Don't:** hide three pricing plans in a carousel.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<Carousel>
|
|
131
|
+
<CarouselContent>
|
|
132
|
+
{plans.map((plan) => (
|
|
133
|
+
<CarouselItem key={plan.id}><Card>{/* … */}</Card></CarouselItem>
|
|
134
|
+
))}
|
|
135
|
+
</CarouselContent>
|
|
136
|
+
</Carousel>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## 10. Accessibility
|
|
140
|
+
|
|
141
|
+
- Role: Carousel is a `region` with `aria-roledescription="carousel"`; each CarouselItem is a `group` with `aria-roledescription="slide"`.
|
|
142
|
+
- Label: pass `aria-label` to Carousel and to each CarouselItem; neither has a default. The controls are named "Previous slide" and "Next slide" with visually hidden text.
|
|
143
|
+
- Keyboard: Tab reaches the controls and any interactive slide content. While focus is anywhere inside the carousel, Arrow Left and Arrow Right move to the previous and next slide, in vertical carousels too.
|
|
144
|
+
- Focus: stays where it is when slides move. Off-screen slides stay in the Tab order, so links in hidden slides can receive focus.
|
|
145
|
+
- Focus ring: the controls use Button's outline.
|
|
146
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
147
|
+
|
|
148
|
+
## 11. Behaviour
|
|
149
|
+
|
|
150
|
+
- Responsive: fills its parent's width; `basis` is a fraction of that width, so slides shrink with it. Change `basis` at small widths in your own code if three slides get too narrow.
|
|
151
|
+
- Overflow and truncation: the viewport clips off-screen slides. Slide content isn't truncated.
|
|
152
|
+
- Motion: Embla animates snapping and drag. Eluan adds no reduced-motion handling; pass Embla's `duration` option if you need faster scrolling.
|
|
153
|
+
- Looping and alignment: pass Embla options through `opts`, for example `opts={{ loop: true, align: "start" }}`. Orientation always comes from `orientation`, not `opts.axis`.
|
|
154
|
+
- Counters and custom controls: use `setApi` to get the Embla API, then read `api.selectedScrollSnap()` and `api.scrollSnapList()` and listen for `"select"`.
|
|
155
|
+
|
|
156
|
+
## 12. API
|
|
157
|
+
|
|
158
|
+
<!-- api:start -->
|
|
159
|
+
### Carousel
|
|
160
|
+
|
|
161
|
+
| Prop | Type | Default | Description |
|
|
162
|
+
| --- | --- | --- | --- |
|
|
163
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Scroll axis. |
|
|
164
|
+
| `opts` | `CarouselOptions` | | Passed to Embla: `loop`, `align`, `dragFree`, `startIndex`, `duration`. `axis` is overridden by `orientation`. |
|
|
165
|
+
| `plugins` | `CarouselPlugin` | | Passed to Embla. |
|
|
166
|
+
| `setApi` | `(api: CarouselApi) => void` | | Receives the Embla API for counters and custom controls. |
|
|
167
|
+
| `aria-label` | `string` | | Names the carousel region. |
|
|
168
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Native div attributes on the root. |
|
|
169
|
+
|
|
170
|
+
### CarouselContent
|
|
171
|
+
|
|
172
|
+
| Prop | Type | Default | Description |
|
|
173
|
+
| --- | --- | --- | --- |
|
|
174
|
+
| `viewportHeight` | `number \| string` | | Fixed viewport height. Required for vertical carousels; pass a size token string. |
|
|
175
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Applied to the slide track. |
|
|
176
|
+
|
|
177
|
+
### CarouselItem
|
|
178
|
+
|
|
179
|
+
| Prop | Type | Default | Description |
|
|
180
|
+
| --- | --- | --- | --- |
|
|
181
|
+
| `basis` | `"full" \| "half" \| "third"` | `"full"` | Share of the viewport each slide takes. |
|
|
182
|
+
| `aria-label` | `string` | | The slide's position, such as "2 of 5". |
|
|
183
|
+
| `...props` | `HTMLAttributes<HTMLDivElement>` without `className`, `style` | | Native div attributes. |
|
|
184
|
+
|
|
185
|
+
### CarouselPrevious, CarouselNext
|
|
186
|
+
|
|
187
|
+
| Prop | Type | Default | Description |
|
|
188
|
+
| --- | --- | --- | --- |
|
|
189
|
+
| `aria-label` | `string` | | Replaces the built-in "Previous slide" / "Next slide" name, for example when translating. |
|
|
190
|
+
| `...props` | `ButtonHTMLAttributes` without `className`, `style` | | Spread last onto the Button, so `onClick` and `disabled` replace the built-in behaviour. Don't pass them. |
|
|
191
|
+
<!-- api:end -->
|
|
192
|
+
|
|
193
|
+
`CarouselApi` and `CarouselProps` are exported as types.
|
|
194
|
+
|
|
195
|
+
## 13. Examples
|
|
196
|
+
|
|
197
|
+
Customer stories, two per view, with a slide counter.
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import * as React from "react";
|
|
201
|
+
import {
|
|
202
|
+
Card,
|
|
203
|
+
CardContent,
|
|
204
|
+
Carousel,
|
|
205
|
+
CarouselContent,
|
|
206
|
+
CarouselItem,
|
|
207
|
+
CarouselNext,
|
|
208
|
+
CarouselPrevious,
|
|
209
|
+
Typography,
|
|
210
|
+
type CarouselApi,
|
|
211
|
+
} from "@eluan/core";
|
|
212
|
+
|
|
213
|
+
const stories = [
|
|
214
|
+
{ id: "northwind", quote: "We moved our whole dashboard over in a week.", person: "Priya Raman, Northwind" },
|
|
215
|
+
{ id: "lumen", quote: "Dark mode came for free once the theme was set.", person: "Tomás Ortega, Lumen Health" },
|
|
216
|
+
{ id: "harbor", quote: "Designers and engineers finally use the same names.", person: "Grace Kim, Harbor" },
|
|
217
|
+
{ id: "fieldnote", quote: "Our forms passed the accessibility audit first time.", person: "Daniel Mensah, Fieldnote" },
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
export function CustomerStories() {
|
|
221
|
+
const [api, setApi] = React.useState<CarouselApi>();
|
|
222
|
+
const [current, setCurrent] = React.useState(1);
|
|
223
|
+
|
|
224
|
+
React.useEffect(() => {
|
|
225
|
+
if (!api) return;
|
|
226
|
+
const update = () => setCurrent(api.selectedScrollSnap() + 1);
|
|
227
|
+
update();
|
|
228
|
+
api.on("select", update);
|
|
229
|
+
return () => {
|
|
230
|
+
api.off("select", update);
|
|
231
|
+
};
|
|
232
|
+
}, [api]);
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
|
|
236
|
+
<Typography variant="heading" as="h2">What teams say</Typography>
|
|
237
|
+
<div style={{ paddingInline: "var(--size-2xl)" }}>
|
|
238
|
+
<Carousel aria-label="Customer stories" setApi={setApi} opts={{ align: "start" }}>
|
|
239
|
+
<CarouselContent>
|
|
240
|
+
{stories.map((story, i) => (
|
|
241
|
+
<CarouselItem key={story.id} basis="half" aria-label={`${i + 1} of ${stories.length}`}>
|
|
242
|
+
<Card elevation="none">
|
|
243
|
+
<CardContent>
|
|
244
|
+
<figure style={{ margin: 0, paddingTop: "var(--spacing-2xl)", display: "flex", flexDirection: "column", gap: "var(--spacing-sm)" }}>
|
|
245
|
+
<Typography variant="lead" as="blockquote">“{story.quote}”</Typography>
|
|
246
|
+
<Typography variant="caption" tone="muted" as="figcaption">{story.person}</Typography>
|
|
247
|
+
</figure>
|
|
248
|
+
</CardContent>
|
|
249
|
+
</Card>
|
|
250
|
+
</CarouselItem>
|
|
251
|
+
))}
|
|
252
|
+
</CarouselContent>
|
|
253
|
+
<CarouselPrevious />
|
|
254
|
+
<CarouselNext />
|
|
255
|
+
</Carousel>
|
|
256
|
+
</div>
|
|
257
|
+
<Typography variant="caption" tone="muted" align="center" aria-live="polite">
|
|
258
|
+
Story {current} of {stories.length}
|
|
259
|
+
</Typography>
|
|
260
|
+
</section>
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## 14. Related components
|
|
266
|
+
|
|
267
|
+
- [Card](./card.md): the usual slide content, or a grid when everything should show.
|
|
268
|
+
- [Button](./button.md): the previous and next controls.
|
|
269
|
+
- [Media](./media.md): images inside slides.
|
|
270
|
+
- [Tabs](./tabs.md): switching views instead of paging through slides.
|
|
271
|
+
|
|
272
|
+
## 15. Common agent mistakes
|
|
273
|
+
|
|
274
|
+
_Filled from evals._
|