Socket
Socket
Sign inDemoInstall

@spectrum-web-components/button

Package Overview
Dependencies
Maintainers
7
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/button - npm Package Compare versions

Comparing version 0.39.4 to 0.40.0

16

package.json
{
"name": "@spectrum-web-components/button",
"version": "0.39.4",
"version": "0.40.0",
"publishConfig": {

@@ -85,8 +85,8 @@ "access": "public"

"dependencies": {
"@spectrum-web-components/base": "^0.39.4",
"@spectrum-web-components/clear-button": "^0.39.4",
"@spectrum-web-components/close-button": "^0.39.4",
"@spectrum-web-components/icon": "^0.39.4",
"@spectrum-web-components/icons-ui": "^0.39.4",
"@spectrum-web-components/shared": "^0.39.4"
"@spectrum-web-components/base": "^0.40.0",
"@spectrum-web-components/clear-button": "^0.40.0",
"@spectrum-web-components/close-button": "^0.40.0",
"@spectrum-web-components/icon": "^0.40.0",
"@spectrum-web-components/icons-ui": "^0.40.0",
"@spectrum-web-components/shared": "^0.40.0"
},

@@ -102,3 +102,3 @@ "devDependencies": {

],
"gitHead": "f745c90e8e9ea85ff10be025e058b14cc925ec9f"
"gitHead": "24d5569a839da94892ecfd125428779587ffb1f5"
}

@@ -95,3 +95,3 @@ ## Description

</sp-button>
<sp-button variant="primary" label="Icon only">
<sp-button variant="primary" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -118,3 +118,3 @@ </sp-button>

</sp-button>
<sp-button variant="accent" label="Icon only">
<sp-button variant="accent" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -136,3 +136,3 @@ </sp-button>

</sp-button>
<sp-button variant="primary" label="Icon only">
<sp-button variant="primary" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -154,3 +154,3 @@ </sp-button>

</sp-button>
<sp-button variant="secondary" label="Icon only">
<sp-button variant="secondary" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -172,3 +172,3 @@ </sp-button>

</sp-button>
<sp-button variant="negative" label="Icon only">
<sp-button variant="negative" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -190,3 +190,3 @@ </sp-button>

</sp-button>
<sp-button static="black" label="Icon only">
<sp-button static="black" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -208,3 +208,3 @@ </sp-button>

</sp-button>
<sp-button static="white" label="Icon only">
<sp-button static="white" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -265,3 +265,3 @@ </sp-button>

</sp-button>
<sp-button treatment="outline" static="black" label="Icon only">
<sp-button treatment="outline" static="black" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -285,3 +285,3 @@ </sp-button>

</sp-button>
<sp-button treatment="outline" static="white" label="Icon only">
<sp-button treatment="outline" static="white" label="Icon only" icon-only>
<sp-icon-help slot="icon"></sp-icon-help>

@@ -288,0 +288,0 @@ </sp-button>

@@ -60,6 +60,6 @@ "use strict";

--mod-button-edge-to-text,var(--spectrum-button-edge-to-text)
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host .spectrum-Button--iconOnly{border-radius:50%;min-inline-size:unset;padding:calc(var(
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host([icon-only]){border-radius:50%;min-inline-size:unset;padding:calc(var(
--mod-button-edge-to-visual-only,
var(--spectrum-button-edge-to-visual-only)
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host .spectrum-Button--iconOnly ::slotted([slot=icon]){margin-inline-start:0}:host .spectrum-Button--iconOnly:after{border-radius:50%}#label{align-self:start;line-height:var(
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host([icon-only]) ::slotted([slot=icon]){margin-inline-start:0}:host([icon-only]):after{border-radius:50%}#label{align-self:start;line-height:var(
--mod-button-line-height,var(--spectrum-button-line-height)

@@ -66,0 +66,0 @@ );padding-block-end:calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));padding-block-start:calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));white-space:nowrap}:host(.focus-visible):after,:host([focused]):after{box-shadow:0 0 0 var(

@@ -58,6 +58,6 @@ "use strict";import{css as t}from"@spectrum-web-components/base";const o=t`

--mod-button-edge-to-text,var(--spectrum-button-edge-to-text)
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host .spectrum-Button--iconOnly{border-radius:50%;min-inline-size:unset;padding:calc(var(
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host([icon-only]){border-radius:50%;min-inline-size:unset;padding:calc(var(
--mod-button-edge-to-visual-only,
var(--spectrum-button-edge-to-visual-only)
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host .spectrum-Button--iconOnly ::slotted([slot=icon]){margin-inline-start:0}:host .spectrum-Button--iconOnly:after{border-radius:50%}#label{align-self:start;line-height:var(
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host([icon-only]) ::slotted([slot=icon]){margin-inline-start:0}:host([icon-only]):after{border-radius:50%}#label{align-self:start;line-height:var(
--mod-button-line-height,var(--spectrum-button-line-height)

@@ -64,0 +64,0 @@ );padding-block-end:calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));padding-block-start:calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));white-space:nowrap}:host(.focus-visible):after,:host([focused]):after{box-shadow:0 0 0 var(

@@ -60,6 +60,6 @@ "use strict";

--mod-button-edge-to-text,var(--spectrum-button-edge-to-text)
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host .spectrum-Button--iconOnly{border-radius:50%;min-inline-size:unset;padding:calc(var(
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host([icon-only]){border-radius:50%;min-inline-size:unset;padding:calc(var(
--mod-button-edge-to-visual-only,
var(--spectrum-button-edge-to-visual-only)
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host .spectrum-Button--iconOnly ::slotted([slot=icon]){margin-inline-start:0}:host .spectrum-Button--iconOnly:after{border-radius:50%}#label{align-self:start;line-height:var(
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host([icon-only]) ::slotted([slot=icon]){margin-inline-start:0}:host([icon-only]):after{border-radius:50%}#label{align-self:start;line-height:var(
--mod-button-line-height,var(--spectrum-button-line-height)

@@ -66,0 +66,0 @@ );padding-block-end:calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));padding-block-start:calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));white-space:nowrap}:host(.focus-visible):after,:host([focused]):after{box-shadow:0 0 0 var(

@@ -58,6 +58,6 @@ "use strict";import{css as t}from"@spectrum-web-components/base";const o=t`

--mod-button-edge-to-text,var(--spectrum-button-edge-to-text)
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host .spectrum-Button--iconOnly{border-radius:50%;min-inline-size:unset;padding:calc(var(
);position:relative}:host(:hover),:host([active]){box-shadow:none}::slotted([slot=icon]){color:inherit;margin-inline-start:calc(var(--mod-button-edge-to-visual, var(--spectrum-button-edge-to-visual)) - var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text)))}:host:after{border-radius:calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)))}:host([icon-only]){border-radius:50%;min-inline-size:unset;padding:calc(var(
--mod-button-edge-to-visual-only,
var(--spectrum-button-edge-to-visual-only)
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host .spectrum-Button--iconOnly ::slotted([slot=icon]){margin-inline-start:0}:host .spectrum-Button--iconOnly:after{border-radius:50%}#label{align-self:start;line-height:var(
) - var(--mod-button-border-width, var(--spectrum-button-border-width)))}:host([icon-only]) ::slotted([slot=icon]){margin-inline-start:0}:host([icon-only]):after{border-radius:50%}#label{align-self:start;line-height:var(
--mod-button-line-height,var(--spectrum-button-line-height)

@@ -64,0 +64,0 @@ );padding-block-end:calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));padding-block-start:calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));white-space:nowrap}:host(.focus-visible):after,:host([focused]):after{box-shadow:0 0 0 var(

@@ -47,2 +47,6 @@ // @ts-check

converter.pseudoToAttribute('active', 'active'),
converter.classToAttribute(
'spectrum-Button--iconOnly',
'icon-only'
),
// Default to `size='m'` without needing the attribute

@@ -49,0 +53,0 @@ converter.classToHost('spectrum-Button--sizeM'),

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -9,3 +9,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -29,2 +30,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -31,0 +33,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -9,3 +9,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -29,2 +30,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -31,0 +33,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -8,3 +8,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -27,2 +28,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -29,0 +31,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -9,3 +9,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -29,2 +30,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -31,0 +33,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -9,3 +9,4 @@ "use strict";

renderMinWidthButton,
renderWithIcon
renderWithIcon,
renderWithIconOnly
} from "./index.js";

@@ -29,2 +30,3 @@ import "@spectrum-web-components/icons-workflow/icons/sp-icon-help.js";

export const withIcon = (props) => renderWithIcon(props);
export const withIconOnly = (props) => renderWithIconOnly(props);
export const iconSizeOverridden = () => renderIconSizeOverridden(variant, treatment);

@@ -31,0 +33,0 @@ export const minWidthButton = (props) => renderMinWidthButton(props);

@@ -89,2 +89,3 @@ "use strict";

?warning=${properties.warning}
?icon-only=${properties.iconOnly}
>

@@ -119,2 +120,17 @@ ${properties.content || "Click Me"}

}
export function renderIconButtonSet(properties) {
const disabled = Object.assign({}, properties, {
iconOnly: true,
disabled: true
});
const iconOnly = Object.assign({}, properties, {
iconOnly: true,
content: html`
<sp-icon-help slot="icon"></sp-icon-help>
`
});
return html`
${renderButton(iconOnly)} ${renderButton(disabled)}
`;
}
export const bellIcon = html`

@@ -153,2 +169,12 @@ <svg slot="icon" viewBox="0 0 36 36" focusable="false" aria-hidden="true">

};
export const renderWithIconOnly = (props) => {
return html`
${renderIconButtonSet({
...props,
content: html`
<sp-icon-help slot="icon"></sp-icon-help>
`
})}
`;
};
export const renderIconSizeOverridden = (variant, treatment) => {

@@ -155,0 +181,0 @@ return html`

@@ -64,3 +64,3 @@ "use strict";

html`
<sp-button label="Button">
<sp-button label="Button" icon-only>
<svg slot="icon"></svg>

@@ -67,0 +67,0 @@ </sp-button>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc