diff --git a/src/design-system/components/button/Button.stories.ts b/src/design-system/components/button/Button.stories.ts index 8a14fbcd2..64793d3e6 100644 --- a/src/design-system/components/button/Button.stories.ts +++ b/src/design-system/components/button/Button.stories.ts @@ -26,6 +26,7 @@ const meta = { rightIcon: 'None', disabled: false, loading: false, + iconOnly: false, }, argTypes: { variant: { @@ -39,16 +40,23 @@ const meta = { text: { control: 'text' }, disabled: { control: 'boolean' }, loading: { control: 'boolean' }, + iconOnly: { control: 'boolean' }, }, } as const -const render = defineStoryRender(({ text, title, variant, icon, leftIcon, rightIcon, disabled, loading }) => { +const render = defineStoryRender(({ text, title, variant, icon, leftIcon, rightIcon, disabled, loading, iconOnly }) => { const resolvedIcon = ICON_OPTIONS.resolve(icon) const resolvedLeftIcon = ICON_OPTIONS.resolve(leftIcon) const resolvedRightIcon = ICON_OPTIONS.resolve(rightIcon) return html` - + ${resolvedLeftIcon ? unsafeHTML(``) : nothing} ${resolvedIcon ? unsafeHTML(``) : nothing} ${text} @@ -88,11 +96,22 @@ export const Outline = { } export const Ghost = { + render, + args: { + text: 'Help', + variant: 'ghost', + icon: 'Help', + title: 'Open help', + }, +} + +export const IconOnly = { render, args: { text: '', variant: 'ghost', icon: 'Help', + iconOnly: true, title: 'Open help', }, } diff --git a/src/design-system/components/button/Button.styles.css b/src/design-system/components/button/Button.styles.css index a8dd0912a..95942c12d 100644 --- a/src/design-system/components/button/Button.styles.css +++ b/src/design-system/components/button/Button.styles.css @@ -53,15 +53,21 @@ } } -:host(:has([slot="icon"])) button { - padding: 4px; +:host([icon-only]) button { + inline-size: var(--solid-ui-clickable-area); + block-size: var(--solid-ui-clickable-area); + padding: 0; ::slotted([slot="icon"]) { - width: var(--solid-ui-font-size-2xl); - height: var(--solid-ui-font-size-2xl); + width: 22px; + height: 22px; } } +:host([icon-only]) slot:not([name]) { + display: none; +} + :host([variant='secondary']) button { --text-color: var(--solid-ui-color-gray-800); --border-color: var(--solid-ui-color-slate-400); diff --git a/src/design-system/components/button/Button.ts b/src/design-system/components/button/Button.ts index 421e40ff0..f7016cf3d 100644 --- a/src/design-system/components/button/Button.ts +++ b/src/design-system/components/button/Button.ts @@ -25,6 +25,9 @@ export default class Button extends WebComponent { @property({ type: Boolean }) accessor loading = false + @property({ type: Boolean, reflect: true, attribute: 'icon-only' }) + accessor iconOnly = false + render () { const disabled = this.disabled ?? this.loading diff --git a/src/design-system/components/dialog-header/DialogHeader.styles.css b/src/design-system/components/dialog-header/DialogHeader.styles.css index 92a941409..299dbeed2 100644 --- a/src/design-system/components/dialog-header/DialogHeader.styles.css +++ b/src/design-system/components/dialog-header/DialogHeader.styles.css @@ -4,7 +4,7 @@ display: flex; justify-content: space-between; align-items: center; - padding: 15px; + padding: 12px 15px; gap: 15px; background: var(--solid-ui-color-slate-50); border-bottom: 1px solid var(--solid-ui-color-slate-200); diff --git a/src/design-system/components/dialog/Dialog.styles.css b/src/design-system/components/dialog/Dialog.styles.css index 37f5d2cdb..4e59f07b9 100644 --- a/src/design-system/components/dialog/Dialog.styles.css +++ b/src/design-system/components/dialog/Dialog.styles.css @@ -8,6 +8,13 @@ dialog { solid-ui-dialog-header solid-ui-button { color: var(--solid-ui-color-gray-600); + + icon-lucide-x { + width: 22px; + height: 22px; + justify-content: center; + align-items: center; + } } } diff --git a/src/design-system/components/dialog/Dialog.ts b/src/design-system/components/dialog/Dialog.ts index 55403b23f..b9985efe5 100644 --- a/src/design-system/components/dialog/Dialog.ts +++ b/src/design-system/components/dialog/Dialog.ts @@ -46,7 +46,7 @@ export default class Dialog extends WebComponent {

${this.title}

- + Close