Esri / calcite-design-system

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

Add support to panel components' `action-bar` slot for element containing an action-bar #10259

Open nwhittaker opened 2 months ago

nwhittaker commented 2 months ago

Check existing issues

Description

The panel and shell-panel components' action-bar slot currently hides slotted elements that are not a <calcite-action-bar>. However, in apps where it is beneficial to have the action-bar as a reusable component, it may not be possible to slot the action-bar element directly (e.g. Stencil).

The requested functionality is to add support to this slot for a nested action-bar.

Acceptance Criteria

Any Calcite component that supports the action-bar slot should supports both:

Relevant Info

No response

Which Component

The panel and shell-panel components with impact to:

Example Use Case

<calcite-panel>
  <my-shared-action-bar slot="action-bar"></my-shared-action-bar>
</calcite-panel>
@Component()
class MySharedActionBar {
  render() {
    return (
      <Host style="display: contents;">
        <calcite-action-bar>
          <calcite-action-group>
            <calcite-action … />
            …
          </calcite-action-group>
          …
        </calcite-action-bar>
      </Host>
    )
  }
}

Priority impact

impact - p1 - need for current milestone

Calcite package

Esri team

ArcGIS Field Apps

macandcheese commented 2 months ago

Instead of checking for the "correct" element, we should probably render whatever folks put there and rely on documentation / guidelines (along with the prescriptive slot names) for implementation patterns.

https://github.com/Esri/calcite-design-system/blob/34a80acae3594bed93f5fa4425d5b06470f972ca/packages/calcite-components/src/components/shell-panel/shell-panel.tsx#L672