@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,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Accordion
|
|
3
|
+
use_when: Stacking several sections of secondary content the user may skip, each expanded from its own header, such as an FAQ or advanced settings.
|
|
4
|
+
instead_of: Collapsible for a single show/hide region; Tabs for switching between peer views; Card or headings for content everyone needs.
|
|
5
|
+
source: packages/core/src/components/accordion.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Accordion
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Accordion is a vertical stack of sections, each with a header button that shows or hides its content. It wraps Radix Accordion: the root sets whether one or several sections can be open, and each item has a trigger and a content region.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- FAQs and help content on a page.
|
|
17
|
+
- Advanced or rarely changed settings below the main ones.
|
|
18
|
+
- Long secondary detail (release notes, policy sections) that most users skip.
|
|
19
|
+
- Grouped filters in a side panel, where several groups may be open at once (`type="multiple"`).
|
|
20
|
+
|
|
21
|
+
### When not to use
|
|
22
|
+
|
|
23
|
+
- One region to show or hide → use [Collapsible](./collapsible.md).
|
|
24
|
+
- Switching between peer views of the same thing → use [Tabs](./tabs.md).
|
|
25
|
+
- Content every user needs to read or act on → show it with headings ([Typography](./typography.md)) or in a [Card](./card.md).
|
|
26
|
+
- Steps the user completes in order → use [Stepper](./stepper.md).
|
|
27
|
+
- Nested folders or hierarchical data → use [TreeView](./tree-view.md).
|
|
28
|
+
|
|
29
|
+
## 3. Anatomy
|
|
30
|
+
|
|
31
|
+
1. **Accordion**: the root. Sets `type` (single or multiple) and holds the open state.
|
|
32
|
+
2. **AccordionItem**: one section, with a required `value` and a bottom border in `--interactive-border-alt`.
|
|
33
|
+
3. **AccordionTrigger**: the header. Renders a `<button>` inside an `<h3>`, with the label at `--font-size-base`, weight 500, and a chevron at the end that turns over when open.
|
|
34
|
+
4. **AccordionContent**: the region below the trigger, in muted `--font-size-sm` text, padded top and bottom.
|
|
35
|
+
|
|
36
|
+
## 4. Variants
|
|
37
|
+
|
|
38
|
+
Accordion has no visual variants. `type` sets the behaviour:
|
|
39
|
+
|
|
40
|
+
| Type | Use for |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `single` | FAQs and settings, where opening one section closes the other. Add `collapsible` so the open section can be closed again. |
|
|
43
|
+
| `multiple` | Filters or reference sections the user wants to compare side by side. |
|
|
44
|
+
|
|
45
|
+
## 5. Sizes
|
|
46
|
+
|
|
47
|
+
Accordion has no size prop. Text uses `--font-size-base` (trigger) and `--font-size-sm` (content), which follow density.
|
|
48
|
+
|
|
49
|
+
## 6. States
|
|
50
|
+
|
|
51
|
+
| State | Looks like | Notes |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| Closed | Trigger label and chevron pointing down; content hidden | `data-state="closed"` on the trigger. |
|
|
54
|
+
| Open | Chevron turned up; content shown | `data-state="open"`. |
|
|
55
|
+
| Hover | No visible change | The hover rule sets the same colour as rest. |
|
|
56
|
+
| Focus | The browser's default focus ring | AccordionTrigger declares no focus style. Never remove or restyle the focus ring. |
|
|
57
|
+
| Disabled | No visible change | `disabled` on Accordion or an item blocks toggling but isn't styled. Remove a section rather than disabling it. |
|
|
58
|
+
|
|
59
|
+
## 7. Content guidelines
|
|
60
|
+
|
|
61
|
+
- Write trigger labels as the question or topic the section answers: "Can I change plans later?", "Data retention".
|
|
62
|
+
- Keep labels to one line. Use sentence case.
|
|
63
|
+
- Open with the answer in the first sentence of the content.
|
|
64
|
+
- Keep each section self-contained; don't refer to "the section above".
|
|
65
|
+
|
|
66
|
+
| Do | Don't |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| Can I change plans later? | Plans |
|
|
69
|
+
| Data retention | Click to see more |
|
|
70
|
+
| Yes. Switch plans from Billing at any time. | As mentioned above, you can… |
|
|
71
|
+
|
|
72
|
+
## 8. Rules
|
|
73
|
+
|
|
74
|
+
1. Set `type` on every Accordion; it's required. With `type="single"`, add `collapsible` unless one section must always stay open.
|
|
75
|
+
2. Give each AccordionItem a unique, stable `value`.
|
|
76
|
+
3. Pass only text (and inline content) to AccordionTrigger. It already renders the chevron; don't add another icon or a Button inside it.
|
|
77
|
+
4. Don't hide content users need to complete the task inside a closed section.
|
|
78
|
+
5. Don't nest an Accordion inside an AccordionContent.
|
|
79
|
+
6. Don't pass `className` or `style`, even to the Accordion root. The root is Radix's own and doesn't drop them, but every other part does; set width on a wrapper.
|
|
80
|
+
|
|
81
|
+
## 9. Dos and don'ts
|
|
82
|
+
|
|
83
|
+
**Do:** let the user close the open section.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<Accordion type="single" collapsible>
|
|
87
|
+
<AccordionItem value="plans">
|
|
88
|
+
<AccordionTrigger>Can I change plans later?</AccordionTrigger>
|
|
89
|
+
<AccordionContent>Yes. Switch plans from Billing at any time.</AccordionContent>
|
|
90
|
+
</AccordionItem>
|
|
91
|
+
</Accordion>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Don't:** use a single-item Accordion for one show/hide region.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<Accordion type="single">
|
|
98
|
+
<AccordionItem value="more">
|
|
99
|
+
<AccordionTrigger>Show more</AccordionTrigger>
|
|
100
|
+
<AccordionContent>Extra details</AccordionContent>
|
|
101
|
+
</AccordionItem>
|
|
102
|
+
</Accordion>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Do:** keep the trigger to a label.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<AccordionTrigger>Data retention</AccordionTrigger>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Don't:** add icons or controls to the trigger.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
<AccordionTrigger>
|
|
115
|
+
<ChevronDown /> Data retention <Button size="iconSm">Edit</Button>
|
|
116
|
+
</AccordionTrigger>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 10. Accessibility
|
|
120
|
+
|
|
121
|
+
- Role: each AccordionTrigger is a `button` inside an `h3`, with `aria-expanded` and `aria-controls`. AccordionContent is a `region` labelled by its trigger.
|
|
122
|
+
- Heading level: always `h3`. AccordionTrigger doesn't expose the header part, so place the Accordion where an `h3` fits the outline, for example under an `h2` section heading.
|
|
123
|
+
- Label: the trigger's text content. The chevron is `aria-hidden`.
|
|
124
|
+
- Keyboard: Enter and Space toggle the focused section. Tab and Shift+Tab move between triggers and into open content. Arrow Down and Arrow Up move focus between triggers; Home and End jump to the first and last.
|
|
125
|
+
- Focus: stays on the trigger when a section opens or closes. The trigger shows the browser's default ring; don't add your own.
|
|
126
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
127
|
+
|
|
128
|
+
## 11. Behaviour
|
|
129
|
+
|
|
130
|
+
- Responsive: Accordion fills its parent's width. Constrain it with a wrapper.
|
|
131
|
+
- Overflow and truncation: trigger labels and content wrap; nothing truncates.
|
|
132
|
+
- Motion: the chevron turns over 200ms. Content opens and closes without a height animation. Don't add your own.
|
|
133
|
+
- Controlled or not: pass `defaultValue` to open sections on first render, or `value` with `onValueChange` to control them. `value` is a string for `single` and a string array for `multiple`.
|
|
134
|
+
|
|
135
|
+
## 12. API
|
|
136
|
+
|
|
137
|
+
<!-- api:start -->
|
|
138
|
+
### Accordion
|
|
139
|
+
|
|
140
|
+
| Prop | Type | Default | Description |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| `type` | `"single" \| "multiple"` | | Required. One open section at a time, or several. |
|
|
143
|
+
| `collapsible` | `boolean` | `false` | `single` only. Lets the open section close again. |
|
|
144
|
+
| `defaultValue` | `string \| string[]` | | Sections open on first render (uncontrolled). Array for `multiple`. |
|
|
145
|
+
| `value` | `string \| string[]` | | Open sections (controlled). |
|
|
146
|
+
| `onValueChange` | `(value: string \| string[]) => void` | | Called when sections open or close. |
|
|
147
|
+
| `disabled` | `boolean` | `false` | Disables every section. Not styled. |
|
|
148
|
+
| `orientation` | `"vertical" \| "horizontal"` | `"vertical"` | Which arrow keys move between triggers. |
|
|
149
|
+
| `...props` | Radix `Accordion.Root` props | | `dir`, `aria-*`. Don't pass `className` or `style`. |
|
|
150
|
+
|
|
151
|
+
### AccordionItem
|
|
152
|
+
|
|
153
|
+
| Prop | Type | Default | Description |
|
|
154
|
+
| --- | --- | --- | --- |
|
|
155
|
+
| `value` | `string` | | Required. Unique id for the section. |
|
|
156
|
+
| `disabled` | `boolean` | `false` | Blocks toggling this section. Not styled. |
|
|
157
|
+
| `...props` | Radix `Accordion.Item` props without `className`, `style` | | |
|
|
158
|
+
|
|
159
|
+
### AccordionTrigger
|
|
160
|
+
|
|
161
|
+
| Prop | Type | Default | Description |
|
|
162
|
+
| --- | --- | --- | --- |
|
|
163
|
+
| `children` | `ReactNode` | | The section label. The chevron is added for you. |
|
|
164
|
+
| `...props` | Radix `Accordion.Trigger` props without `className`, `style` | | Native button attributes. |
|
|
165
|
+
|
|
166
|
+
### AccordionContent
|
|
167
|
+
|
|
168
|
+
| Prop | Type | Default | Description |
|
|
169
|
+
| --- | --- | --- | --- |
|
|
170
|
+
| `children` | `ReactNode` | | The section body. |
|
|
171
|
+
| `forceMount` | `true` | | Keeps the content in the DOM while closed. |
|
|
172
|
+
| `...props` | Radix `Accordion.Content` props without `className`, `style` | | |
|
|
173
|
+
<!-- api:end -->
|
|
174
|
+
|
|
175
|
+
## 13. Examples
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Typography } from "@eluan/core";
|
|
179
|
+
|
|
180
|
+
const faqs = [
|
|
181
|
+
{ id: "change-plan", question: "Can I change plans later?", answer: "Yes. Switch plans from Billing at any time. We prorate the difference on your next invoice." },
|
|
182
|
+
{ id: "cancel", question: "What happens to my data if I cancel?", answer: "Your projects stay read-only for 30 days, then we delete them. Export them from Settings before you cancel." },
|
|
183
|
+
{ id: "invoices", question: "Where do I find past invoices?", answer: "Go to Billing, then Invoices. Each invoice downloads as a PDF." },
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
export function BillingFaq() {
|
|
187
|
+
return (
|
|
188
|
+
<section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
|
|
189
|
+
<Typography variant="heading" as="h2">Billing questions</Typography>
|
|
190
|
+
<Accordion type="single" collapsible defaultValue="change-plan">
|
|
191
|
+
{faqs.map((faq) => (
|
|
192
|
+
<AccordionItem key={faq.id} value={faq.id}>
|
|
193
|
+
<AccordionTrigger>{faq.question}</AccordionTrigger>
|
|
194
|
+
<AccordionContent>{faq.answer}</AccordionContent>
|
|
195
|
+
</AccordionItem>
|
|
196
|
+
))}
|
|
197
|
+
</Accordion>
|
|
198
|
+
</section>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## 14. Related components
|
|
204
|
+
|
|
205
|
+
- [Collapsible](./collapsible.md): a single show/hide region.
|
|
206
|
+
- [Tabs](./tabs.md): switch between peer views instead of stacking them.
|
|
207
|
+
- [TreeView](./tree-view.md): expandable hierarchical data.
|
|
208
|
+
- [Typography](./typography.md): the `h2` section heading above an Accordion.
|
|
209
|
+
|
|
210
|
+
## 15. Common agent mistakes
|
|
211
|
+
|
|
212
|
+
_Filled from evals._
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ActionPopover
|
|
3
|
+
use_when: A table row, list item or card needs a compact "more actions" menu behind a three-dots button.
|
|
4
|
+
instead_of: DropdownMenu when you need separators, groups, submenus, checkable items or a custom trigger; inline Buttons for one or two actions; Popover for a panel with form content.
|
|
5
|
+
source: packages/core/src/components/action-popover.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# ActionPopover
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
ActionPopover is a ready-made overflow menu: an icon-only ghost Button with a horizontal-dots icon that opens a [DropdownMenu](./dropdown-menu.md) built from an `items` array. Despite the name it isn't a [Popover](./popover.md): it imports nothing from Popover and behaves as a menu, with menu roles and arrow-key navigation.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- Row-level actions in a [Table](./table.md) or list, where a full set of buttons would crowd the row.
|
|
17
|
+
- Overflow actions on a [Card](./card.md).
|
|
18
|
+
- Any place a flat list of three to seven actions needs a compact trigger.
|
|
19
|
+
|
|
20
|
+
### When not to use
|
|
21
|
+
|
|
22
|
+
- Separators, group labels, submenus, checkbox or radio items, shortcuts, or a trigger other than the dots button → use [DropdownMenu](./dropdown-menu.md).
|
|
23
|
+
- One or two actions → show them as [Button](./button.md)s in the row.
|
|
24
|
+
- A panel with fields or rich content → use [Popover](./popover.md).
|
|
25
|
+
- Actions on right-click → use [ContextMenu](./context-menu.md).
|
|
26
|
+
- An application menu bar → use [Menubar](./menubar.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Trigger**: a [Button](./button.md) with `variant="ghost"` and `size="icon"`, showing a horizontal-dots icon at `--size-xxs`. Its accessible name comes from the `aria-label` prop.
|
|
31
|
+
2. **Menu**: a DropdownMenuContent in a portal, with the menu family's surface and spacing.
|
|
32
|
+
3. **Item**: one DropdownMenuItem per entry in `items`: an optional icon in a `--size-xxs` box, then the label. `destructive` items use the destructive tone.
|
|
33
|
+
|
|
34
|
+
## 4. Variants
|
|
35
|
+
|
|
36
|
+
No `variant` prop. Each item can set `destructive: true` to use the destructive tone (`--destructive-fg`).
|
|
37
|
+
|
|
38
|
+
## 5. Sizes
|
|
39
|
+
|
|
40
|
+
No size prop. The trigger is always Button's `icon` size.
|
|
41
|
+
|
|
42
|
+
## 6. States
|
|
43
|
+
|
|
44
|
+
| State | Looks like | Notes |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Default | Ghost icon button | |
|
|
47
|
+
| Hover | Ghost hover background | From Button. |
|
|
48
|
+
| Focus | 1px outline in `--focus-ring`, 1px offset | Never remove or restyle the focus ring. |
|
|
49
|
+
| Open | Menu below the trigger, aligned to its end | Trigger has `aria-expanded="true"`. |
|
|
50
|
+
| Item highlighted | Item background in `--interactive-bg-hover` | On pointer hover or arrow-key focus. |
|
|
51
|
+
| Item disabled | `--interactive-bg-disabled` background, `--interactive-fg-disabled` text | Set `disabled: true`; the item gets `data-disabled`, is skipped by arrow keys and can't be selected. |
|
|
52
|
+
|
|
53
|
+
## 7. Content guidelines
|
|
54
|
+
|
|
55
|
+
- Labels start with a verb and name the action: "Edit", "Duplicate", "Download PDF", "Delete".
|
|
56
|
+
- Keep the same items in the same order in every row.
|
|
57
|
+
- Put destructive items last.
|
|
58
|
+
- Sentence case; one to three words.
|
|
59
|
+
|
|
60
|
+
| Do | Don't |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Delete | Delete this item permanently |
|
|
63
|
+
| Download PDF | PDF |
|
|
64
|
+
| Duplicate | Make a copy of this invoice |
|
|
65
|
+
|
|
66
|
+
## 8. Rules
|
|
67
|
+
|
|
68
|
+
1. Pass an `aria-label` that names the row: "Actions for invoice INV-2041". The default, "Open actions menu", is identical on every row.
|
|
69
|
+
2. Give every item an `onClick`. An item without one only closes the menu.
|
|
70
|
+
3. Confirm destructive items with a [Dialog](./dialog.md) before running them.
|
|
71
|
+
4. When an item opens a Dialog, return focus to the ActionPopover trigger on close: hold a `ref` (it's forwarded to the trigger Button) and focus it in DialogContent's `onCloseAutoFocus`.
|
|
72
|
+
5. Pass Lucide icons with `aria-hidden="true"`. ActionPopover sizes them; don't size them yourself.
|
|
73
|
+
6. Use icons on all items or none.
|
|
74
|
+
7. Don't wrap ActionPopover in your own trigger or Button. It renders its own.
|
|
75
|
+
|
|
76
|
+
## 9. Dos and don'ts
|
|
77
|
+
|
|
78
|
+
**Do:** name the trigger after the row and put the destructive action last.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<ActionPopover
|
|
82
|
+
aria-label="Actions for invoice INV-2041"
|
|
83
|
+
items={[
|
|
84
|
+
{ label: "Edit", onClick: editInvoice },
|
|
85
|
+
{ label: "Download PDF", onClick: downloadInvoice },
|
|
86
|
+
{ label: "Delete", destructive: true, onClick: confirmDelete },
|
|
87
|
+
]}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Don't:** leave the default label on every row, or delete straight from the menu.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<ActionPopover
|
|
95
|
+
items={[
|
|
96
|
+
{ label: "Delete", destructive: true, onClick: deleteInvoice },
|
|
97
|
+
{ label: "Edit", onClick: editInvoice },
|
|
98
|
+
]}
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Do:** switch to DropdownMenu when you need structure.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<DropdownMenu>
|
|
106
|
+
<DropdownMenuTrigger asChild>
|
|
107
|
+
<Button type="button" variant="ghost" size="icon" aria-label="Actions for invoice INV-2041">
|
|
108
|
+
<MoreHorizontal aria-hidden="true" style={{ width: "var(--size-xxs)", height: "var(--size-xxs)" }} />
|
|
109
|
+
</Button>
|
|
110
|
+
</DropdownMenuTrigger>
|
|
111
|
+
<DropdownMenuContent align="end">
|
|
112
|
+
<DropdownMenuItem onSelect={editInvoice}>Edit</DropdownMenuItem>
|
|
113
|
+
<DropdownMenuSeparator />
|
|
114
|
+
<DropdownMenuItem tone="destructive" onSelect={confirmDelete}>Delete</DropdownMenuItem>
|
|
115
|
+
</DropdownMenuContent>
|
|
116
|
+
</DropdownMenu>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Don't:** fake a separator or heading with a disabled item.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<ActionPopover items={[{ label: "Edit" }, { label: "──────", disabled: true }, { label: "Delete" }]} />
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 10. Accessibility
|
|
126
|
+
|
|
127
|
+
- Role: the trigger is a `button` with `aria-haspopup="menu"` and `aria-expanded`. The menu has role `menu` and each entry is a `menuitem`.
|
|
128
|
+
- Label: the trigger's `aria-label` (default "Open actions menu"). Items are named by their `label`.
|
|
129
|
+
- Keyboard: Enter, Space or Arrow Down on the trigger opens the menu. Arrow keys move between items, Home and End jump to the ends, typing a letter jumps to a matching item, Enter or Space activates, Escape closes.
|
|
130
|
+
- Focus: moves into the menu on open and returns to the trigger on close. Disabled items are skipped.
|
|
131
|
+
- Contrast: handled by the theme. Don't override colours.
|
|
132
|
+
|
|
133
|
+
## 11. Behaviour
|
|
134
|
+
|
|
135
|
+
- Placement: below the trigger and aligned to its end by default (`side="bottom"`, `align="end"`), so it opens inward from a row's trailing edge. It flips to stay inside the viewport.
|
|
136
|
+
- Overflow and truncation: the menu is at least 8rem wide and grows to fit its longest label. Keep labels short.
|
|
137
|
+
- Motion: the menu appears without animation; item highlights fade over 150ms. Don't add your own.
|
|
138
|
+
- Portal: the menu mounts in `document.body`. In a scoped theme, pass `portalContainer` to the scoped EluanProvider or wrap the region in `PortalContainerProvider`. See `../foundations/theming.md`.
|
|
139
|
+
|
|
140
|
+
## 12. API
|
|
141
|
+
|
|
142
|
+
<!-- api:start -->
|
|
143
|
+
### ActionPopover
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Default | Description |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| `items` | `ActionPopoverItem[]` | | Required. The menu entries, in order. |
|
|
148
|
+
| `align` | `"start" \| "center" \| "end"` | `"end"` | Alignment of the menu along the trigger. |
|
|
149
|
+
| `side` | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` | Side of the trigger the menu opens on. |
|
|
150
|
+
| `aria-label` | `string` | `"Open actions menu"` | Accessible name of the trigger. |
|
|
151
|
+
| `ref` | `Ref<HTMLButtonElement>` | | Forwarded to the trigger Button. |
|
|
152
|
+
|
|
153
|
+
No other props: there's no `className`, `style`, `disabled` or trigger override.
|
|
154
|
+
|
|
155
|
+
### ActionPopoverItem
|
|
156
|
+
|
|
157
|
+
| Prop | Type | Default | Description |
|
|
158
|
+
| --- | --- | --- | --- |
|
|
159
|
+
| `label` | `string` | | Required. The item text. |
|
|
160
|
+
| `icon` | `ReactNode` | | Leading icon, sized to `--size-xxs`. |
|
|
161
|
+
| `onClick` | `() => void` | | Runs when the item is chosen by pointer or keyboard. |
|
|
162
|
+
| `destructive` | `boolean` | `false` | Uses the destructive tone. |
|
|
163
|
+
| `disabled` | `boolean` | `false` | Can't be selected; skipped by arrow keys. |
|
|
164
|
+
<!-- api:end -->
|
|
165
|
+
|
|
166
|
+
## 13. Examples
|
|
167
|
+
|
|
168
|
+
Row actions for an invoices table, with a confirmation Dialog for Delete that returns focus to the row's trigger.
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
import * as React from "react";
|
|
172
|
+
import {
|
|
173
|
+
ActionPopover,
|
|
174
|
+
Button,
|
|
175
|
+
Dialog,
|
|
176
|
+
DialogClose,
|
|
177
|
+
DialogContent,
|
|
178
|
+
DialogDescription,
|
|
179
|
+
DialogFooter,
|
|
180
|
+
DialogHeader,
|
|
181
|
+
DialogTitle,
|
|
182
|
+
} from "@eluan/core";
|
|
183
|
+
import { Copy, Download, Pencil, Trash2 } from "lucide-react";
|
|
184
|
+
|
|
185
|
+
type Invoice = { id: string; number: string; customer: string };
|
|
186
|
+
|
|
187
|
+
export function InvoiceRowActions({
|
|
188
|
+
invoice,
|
|
189
|
+
onEdit,
|
|
190
|
+
onDuplicate,
|
|
191
|
+
onDownload,
|
|
192
|
+
onDelete,
|
|
193
|
+
}: {
|
|
194
|
+
invoice: Invoice;
|
|
195
|
+
onEdit: (id: string) => void;
|
|
196
|
+
onDuplicate: (id: string) => void;
|
|
197
|
+
onDownload: (id: string) => void;
|
|
198
|
+
onDelete: (id: string) => void;
|
|
199
|
+
}) {
|
|
200
|
+
const triggerRef = React.useRef<HTMLButtonElement>(null);
|
|
201
|
+
const [confirmOpen, setConfirmOpen] = React.useState(false);
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<>
|
|
205
|
+
<ActionPopover
|
|
206
|
+
ref={triggerRef}
|
|
207
|
+
aria-label={`Actions for invoice ${invoice.number}`}
|
|
208
|
+
items={[
|
|
209
|
+
{ label: "Edit", icon: <Pencil aria-hidden="true" />, onClick: () => onEdit(invoice.id) },
|
|
210
|
+
{ label: "Duplicate", icon: <Copy aria-hidden="true" />, onClick: () => onDuplicate(invoice.id) },
|
|
211
|
+
{ label: "Download PDF", icon: <Download aria-hidden="true" />, onClick: () => onDownload(invoice.id) },
|
|
212
|
+
{
|
|
213
|
+
label: "Delete",
|
|
214
|
+
icon: <Trash2 aria-hidden="true" />,
|
|
215
|
+
destructive: true,
|
|
216
|
+
onClick: () => setConfirmOpen(true),
|
|
217
|
+
},
|
|
218
|
+
]}
|
|
219
|
+
/>
|
|
220
|
+
<Dialog open={confirmOpen} onOpenChange={setConfirmOpen}>
|
|
221
|
+
<DialogContent
|
|
222
|
+
onCloseAutoFocus={(event) => {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
triggerRef.current?.focus();
|
|
225
|
+
}}
|
|
226
|
+
>
|
|
227
|
+
<DialogHeader>
|
|
228
|
+
<DialogTitle>Delete invoice {invoice.number}?</DialogTitle>
|
|
229
|
+
<DialogDescription>
|
|
230
|
+
{invoice.customer} will no longer see this invoice in their portal. You can't undo this.
|
|
231
|
+
</DialogDescription>
|
|
232
|
+
</DialogHeader>
|
|
233
|
+
<DialogFooter>
|
|
234
|
+
<DialogClose asChild>
|
|
235
|
+
<Button type="button" variant="outline">
|
|
236
|
+
Cancel
|
|
237
|
+
</Button>
|
|
238
|
+
</DialogClose>
|
|
239
|
+
<Button
|
|
240
|
+
type="button"
|
|
241
|
+
variant="destructive"
|
|
242
|
+
onClick={() => {
|
|
243
|
+
onDelete(invoice.id);
|
|
244
|
+
setConfirmOpen(false);
|
|
245
|
+
}}
|
|
246
|
+
>
|
|
247
|
+
Delete invoice
|
|
248
|
+
</Button>
|
|
249
|
+
</DialogFooter>
|
|
250
|
+
</DialogContent>
|
|
251
|
+
</Dialog>
|
|
252
|
+
</>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## 14. Related components
|
|
258
|
+
|
|
259
|
+
- [DropdownMenu](./dropdown-menu.md): what ActionPopover is built on; use it directly for anything beyond a flat list.
|
|
260
|
+
- [Dialog](./dialog.md): confirm destructive items.
|
|
261
|
+
- [Table](./table.md): the usual home for row actions.
|
|
262
|
+
- [Popover](./popover.md): unrelated despite the name; a floating panel for content.
|
|
263
|
+
|
|
264
|
+
## 15. Common agent mistakes
|
|
265
|
+
|
|
266
|
+
_Filled from evals._
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: AspectRatio
|
|
3
|
+
use_when: Content you own (an embed, map, canvas or placeholder) must keep a fixed width-to-height ratio as its container resizes.
|
|
4
|
+
instead_of: Image or Video ratio presets for images and videos; a hard-coded height on your own element.
|
|
5
|
+
source: packages/core/src/components/aspect-ratio.tsx
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AspectRatio
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
AspectRatio locks its child to a width-to-height ratio. It wraps Radix Aspect Ratio: an outer box takes the full width of its container and sets its height from `ratio`, and an inner box fills it. It has no visual styles of its own: no radius, background or border.
|
|
13
|
+
|
|
14
|
+
## 2. When to use
|
|
15
|
+
|
|
16
|
+
- An embedded iframe (map, video player, slide deck) that must keep its proportions.
|
|
17
|
+
- A chart canvas or illustration box that should scale with its column.
|
|
18
|
+
- A placeholder box for media that hasn't loaded yet, in a ratio Image doesn't offer (4:3, 2:1).
|
|
19
|
+
- Any ratio other than Image's presets (1:1, 16:9, 3:4, 21:9).
|
|
20
|
+
|
|
21
|
+
### When not to use
|
|
22
|
+
|
|
23
|
+
- An image or video in a standard ratio → use [Media](./media.md) (`Image` or `Video` with `ratio`), which adds rounding, a loading state and a fallback.
|
|
24
|
+
- A loading placeholder in a known shape → use [Skeleton](./skeleton.md).
|
|
25
|
+
- A profile picture → use [Avatar](./avatar.md).
|
|
26
|
+
- A slideshow of images → use [Carousel](./carousel.md).
|
|
27
|
+
|
|
28
|
+
## 3. Anatomy
|
|
29
|
+
|
|
30
|
+
1. **Wrapper**: an outer `<div>` (Radix), `position: relative`, full container width, with bottom padding that sets the height from `ratio`.
|
|
31
|
+
2. **Content box**: an inner `<div>` absolutely positioned to fill the wrapper. Your props, `ref` and children go here.
|
|
32
|
+
3. **Child**: the element you supply. Size it to fill the box (`width` and `height` 100%).
|
|
33
|
+
|
|
34
|
+
## 4. Variants
|
|
35
|
+
|
|
36
|
+
AspectRatio has no variants. `ratio` sets the shape; your child sets the look.
|
|
37
|
+
|
|
38
|
+
## 5. Sizes
|
|
39
|
+
|
|
40
|
+
AspectRatio has no size prop. Width comes from its container; height comes from `ratio`. Constrain the width with a wrapper you own.
|
|
41
|
+
|
|
42
|
+
## 6. States
|
|
43
|
+
|
|
44
|
+
| State | Looks like | Notes |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Default | An empty box of the given ratio, filled by your child | No interactive states. |
|
|
47
|
+
|
|
48
|
+
## 7. Content guidelines
|
|
49
|
+
|
|
50
|
+
- Give an embedded iframe a `title` that names what it shows: "Map of the Lisbon office", not "map".
|
|
51
|
+
- Give an `<img>` you place inside meaningful `alt` text, or `alt=""` when it's decorative.
|
|
52
|
+
- Write ratios as fractions (`16 / 9`, `4 / 3`) so the intent reads at a glance, as the stories and docs do.
|
|
53
|
+
|
|
54
|
+
## 8. Rules
|
|
55
|
+
|
|
56
|
+
1. Pass `ratio` as width ÷ height: `16 / 9`, `4 / 3`, `1`. The default is `1` (square).
|
|
57
|
+
2. Make the child fill the box: `width: "100%"`, `height: "100%"`, and `objectFit: "cover"` for an `<img>` or `<video>` you own.
|
|
58
|
+
3. Put radius, border and background on your child or on a wrapper you own, with tokens (`--curves-*`, `--container-*`). AspectRatio drops `className` and `style`.
|
|
59
|
+
4. Constrain width on a parent wrapper. Never set a fixed height around AspectRatio; the ratio sets it.
|
|
60
|
+
5. Don't put an Eluan `Image` or `Video` inside AspectRatio. Their own frame doesn't fill the box; use their `ratio` prop instead.
|
|
61
|
+
|
|
62
|
+
## 9. Dos and don'ts
|
|
63
|
+
|
|
64
|
+
**Do:** fill the box with a child you own and round it with a token.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<div style={{ borderRadius: "var(--curves-lg)", overflow: "hidden" }}>
|
|
68
|
+
<AspectRatio ratio={4 / 3}>
|
|
69
|
+
<img
|
|
70
|
+
src="/floorplans/level-2.png"
|
|
71
|
+
alt="Level 2 floor plan with 24 desks and two meeting rooms"
|
|
72
|
+
style={{ width: "100%", height: "100%", objectFit: "cover" }}
|
|
73
|
+
/>
|
|
74
|
+
</AspectRatio>
|
|
75
|
+
</div>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Don't:** fix a height or pass styles to AspectRatio.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<div style={{ height: 300 }}>
|
|
82
|
+
<AspectRatio ratio={4 / 3} style={{ borderRadius: 12 }}>
|
|
83
|
+
<img src="/floorplans/level-2.png" />
|
|
84
|
+
</AspectRatio>
|
|
85
|
+
</div>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Do:** use Image's ratio preset for a standard image.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Image src="/team/offsite.jpg" alt="The team at the spring offsite" ratio="video" />
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Don't:** wrap an Image in AspectRatio.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<AspectRatio ratio={16 / 9}>
|
|
98
|
+
<Image src="/team/offsite.jpg" alt="The team at the spring offsite" />
|
|
99
|
+
</AspectRatio>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 10. Accessibility
|
|
103
|
+
|
|
104
|
+
- Role: none. Both boxes are plain `<div>`s; the child carries the semantics.
|
|
105
|
+
- Label: from the child: `alt` on an image, `title` on an iframe.
|
|
106
|
+
- Keyboard: none of its own. Focusable content inside (an iframe, a button) keeps its usual behaviour.
|
|
107
|
+
- Focus: AspectRatio adds no focus stop.
|
|
108
|
+
- Contrast: AspectRatio draws nothing; contrast comes from your child and the theme.
|
|
109
|
+
|
|
110
|
+
## 11. Behaviour
|
|
111
|
+
|
|
112
|
+
- Responsive: the box always spans its container's width and recalculates its height as the width changes.
|
|
113
|
+
- Overflow and truncation: the content box fills the wrapper exactly. Content larger than the box overflows unless your child clips it (`objectFit` for media, `overflow: hidden` on your wrapper).
|
|
114
|
+
- Motion: none.
|
|
115
|
+
|
|
116
|
+
## 12. API
|
|
117
|
+
|
|
118
|
+
<!-- api:start -->
|
|
119
|
+
| Prop | Type | Default | Description |
|
|
120
|
+
| --- | --- | --- | --- |
|
|
121
|
+
| `ratio` | `number` | `1` | Width divided by height, for example `16 / 9`. |
|
|
122
|
+
| `asChild` | `boolean` | `false` | Renders the child as the content box instead of an inner `<div>` (Radix Slot). |
|
|
123
|
+
| `children` | `ReactNode` | | The content to lock to the ratio. |
|
|
124
|
+
| `...props` | Radix `AspectRatio.Root` props without `className`, `style` | | Applied to the content box: `id`, `aria-*`, `data-*`. `className` and `style` are omitted and stripped at runtime. |
|
|
125
|
+
<!-- api:end -->
|
|
126
|
+
|
|
127
|
+
## 13. Examples
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { AspectRatio, Typography } from "@eluan/core";
|
|
131
|
+
|
|
132
|
+
export function OfficeLocation() {
|
|
133
|
+
return (
|
|
134
|
+
<section style={{ display: "flex", flexDirection: "column", gap: "var(--spacing-md)" }}>
|
|
135
|
+
<Typography variant="subheading" as="h2">Lisbon office</Typography>
|
|
136
|
+
<div
|
|
137
|
+
style={{
|
|
138
|
+
borderWidth: 1,
|
|
139
|
+
borderStyle: "solid",
|
|
140
|
+
borderColor: "var(--container-border)",
|
|
141
|
+
borderRadius: "var(--curves-lg)",
|
|
142
|
+
overflow: "hidden",
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
<AspectRatio ratio={4 / 3}>
|
|
146
|
+
<iframe
|
|
147
|
+
title="Map of the Lisbon office at Rua Augusta 120"
|
|
148
|
+
src="https://www.openstreetmap.org/export/embed.html?bbox=-9.1405%2C38.7085%2C-9.1355%2C38.7115&layer=mapnik"
|
|
149
|
+
loading="lazy"
|
|
150
|
+
style={{ width: "100%", height: "100%", borderWidth: 0 }}
|
|
151
|
+
/>
|
|
152
|
+
</AspectRatio>
|
|
153
|
+
</div>
|
|
154
|
+
<Typography tone="muted">Rua Augusta 120, 2nd floor. Reception opens at 8:30.</Typography>
|
|
155
|
+
</section>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## 14. Related components
|
|
161
|
+
|
|
162
|
+
- [Media](./media.md): `Image` and `Video` with built-in ratio presets, rounding and loading states.
|
|
163
|
+
- [Skeleton](./skeleton.md): a loading placeholder in the shape of the content.
|
|
164
|
+
- [Card](./card.md): a frame for media plus text.
|
|
165
|
+
- [Carousel](./carousel.md): several slides in a row.
|
|
166
|
+
|
|
167
|
+
## 15. Common agent mistakes
|
|
168
|
+
|
|
169
|
+
_Filled from evals._
|