Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

New Component: KeyboardKey / KeyboardKeyGroup #7937

Open macandcheese opened 1 year ago

macandcheese commented 1 year ago

Description

It would be nice to have a stylized way of displaying a key ("shift)", or combination of keys ("shift" + "enter" + "foo"), to replicate and expand on the <kbd> element while providing a consistent way to display and group multiple keys together, if desired with a label set on the group.

User Stories

Screenshot 2023-10-04 at 9 22 50 AM Screenshot 2023-10-04 at 9 21 57 AM

Acceptance Criteria

A new component/s - KeyCode / KeyChar / + Group is added to support the consistent display of keys across the platform. It could have some built in icons for known keyboard strings, and also support a property for string.

To make it "do more than the native element" - there is built in iconography, display helpers, a group-level label, and potentially tooltips. Having a group that adds a consistent "+" would ensure consistency in implementation across the platform.

Screenshot 2024-02-29 at 9 08 49 AM

Relevant Info

Shopify: https://polaris.shopify.com/components/images-and-icons/keyboard-key

NordHealth (planned):

Screenshot 2023-10-04 at 9 44 10 AM

Native: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd

Helpful Details

Proposed API: KeyboardKeyGroup:

KeyboardKey:

cc @ashishgodbole

Priority impact

p4 - not time sensitive

Esri team

ArcGIS Online

ashishgodbole commented 1 year ago

Hi, a link to the design explorations, and potential new components (or existing component updates) can be found at this link: Figma link

geospatialem commented 4 months ago

Adding design for any considerations prior to proceeding.