Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(side sheet): side sheet component #532

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

conor-darcy
Copy link
Collaborator

@conor-darcy conor-darcy commented Jul 15, 2024

Copy link

Comment on lines 7 to 9
<gux-side-sheet-heading-beta slot="heading" level="3">
Side sheet title
</gux-side-sheet-heading-beta>
Copy link
Collaborator

@gavin-everett-genesys gavin-everett-genesys Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this component needs the beta tag since its just styling the heading ? Also I am sort of confused by this component. I cannot find anywhere in the designs where it specifies the use of heading tags.

Could you not just have a component that has a default slot and the user can slot whatever they like eg a heading tag and you style whatever element is passed with the same styling like,

::slotted(*) {
  padding: 0;
  margin: 0;
  font-family: var(--gse-ui-dynamicSideSheet-heading-fontFamily);
  font-size: var(--gse-ui-dynamicSideSheet-heading-fontSize);
  font-weight: var(--gse-ui-dynamicSideSheet-heading-fontWeight);
  line-height: var(--gse-ui-dynamicSideSheet-heading-lineHeight);
  color: var(--gse-ui-dynamicSideSheet-headerColor);
}

so regardless of what the consumer slots it will always get the same styling so the api might look like,
<gux-side-sheet-heading slot="heading"><h1>This is a heading</h1> </gux-side-sheet-heading>

There may be an issue if a user was to slot just a text node as ::slotted(*) cannot target that but you could just create a light.scss file and do it there like,

gux-side-sheet-beta {

gux-side-sheet-heading {
   ... same styles as from the component

}
}

I may have missed something from the design so let me know.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gavin-everett-genesys
"I cannot find anywhere in the designs where it specifies the use of heading tags."
UX just specifies a heading but we should allow for different heading levels so people can create the correct document outline for accessibility, so we shouldn't hardcode a heading level like in the modal.

"default slot and the user can slot whatever they like eg a heading tag"
Yes, that would be ideal & I was originally slotting in h1, h2, h3...tags but there are global styles on the h* tags that are taking precedence. I'd like to avoid light dom styles here if at all possible.

"issue if a user was to slot just a text node "
There will have to be some tag present if even just to be able to apply the slot attribute so I don't think you can just insert a text node without some sort of wrapper.

Ping me if you have a better idea & we can tinker with it.

<h1>Side Sheet</h1>
</div>

<gux-side-sheet-beta size="medium">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should include examples of small and large also.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gavin-everett-genesys yes, 100%, just looking for API feedback at the moment.

Copy link
Collaborator

@daragh-king-genesys daragh-king-genesys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API wise my biggest question is how much control we want of this component. At the moment it is mainly just a presentational component and most of the layout stuff is left up to the app using the component.
I think we will need to see an implementation of the modal version too before we nail down an api.

<gux-side-sheet-beta size="medium">
<gux-icon slot="icon" icon-name="fa/diamond-regular" size="medium"></gux-icon>
<gux-side-sheet-heading-beta slot="heading" level="3">
Side sheet title
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should 'gux-side-sheet-heading-beta' have the icon slot not gux-side-sheet-beta?

</div>

<gux-side-sheet-beta size="medium">
<gux-icon slot="icon" icon-name="fa/diamond-regular" size="medium"></gux-icon>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the icon size to be configurable or set by the component?

display: flex;
padding: 0 !important;
background-color: rgb(0 0 0 / 5%) !important;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if this was not in the example file and was part of the core style. I understand that might require bigger changes to the examples app than we want to have in this PR.

}

gux-side-sheet-beta {
flex: 0 0 auto;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is every app going to have to do this or is this specific to the example app?

@@ -0,0 +1,19 @@
:host {
display: flex;
gap: 30px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be over writable in the light dom so you might want to move it into the shadow dom if you don't want devs to be able t change it.

@@ -0,0 +1,58 @@
:host {
display: block;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected this to be absolutely positioned.

We will need to be clear what we are expecting to developers to do with regard to positioning and layout of the component and what we want to have full control over.

@@ -0,0 +1,39 @@
import { Component, Element, h, Prop } from '@stencil/core';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a sub folder

<slot name="icon" />
</div>
<slot name="heading" />
<gux-dismiss-button />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gux-dismiss-button does not have any functionality by default you will have to add a click handler and dismiss functionality

size: GuxSideSheetSize = 'small';

componentWillLoad(): void {
trackComponent(this.root);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually track stuff like the size as a varient.

private root: HTMLElement;

@Prop()
size: GuxSideSheetSize = 'small';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just the non modal version I think the sizing is wrong, there should only be small and medium

<slot name="icon" />
</div>
<slot name="heading" />
<gux-dismiss-button />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the gux-dismiss-button is currently positioned correctly. I think it should be positioned absolute with a top and right of 12px

<gux-dismiss-button />
</header>
<div class="gux-side-sheet-content">
<slot name="content" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not really outlined in the design so probably a UX question but there is an area above the content slot for side-sheet description of some sort. Wondering if there is a need for a description slot.

var(--gse-ui-dynamicSideSheet-header-paddingRight)
var(--gse-ui-dynamicSideSheet-header-gap)
var(--gse-ui-dynamicSideSheet-header-paddingLeft);
border-bottom: 1px solid var(--gse-ui-modalSideSheet-dividerColor);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Token needed here.

& > footer {
flex: 0 0 auto;
padding: var(--gse-ui-dynamicSideSheet-footer-padding);
border-top: 1px solid var(--gse-ui-modalSideSheet-dividerColor);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Token needed here

render(): JSX.Element {
return (
<this.HeadingTag>
<slot />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a named slot here.

@samlimby-genesys
Copy link
Collaborator

Hi @conor-darcy whats the status of this component in terms of merging into the gux main library?

@conor-darcy
Copy link
Collaborator Author

@samlimby-genesys just waiting for the current tokens work to be completed first as I need the tokens included there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants