@redvars/peacock 3.7.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,9 +85,9 @@ var css_248z$2 = i`* {
85
85
  min-height: 2.5rem;
86
86
  height: 100%;
87
87
  width: 100%;
88
- top: auto;
89
- left: 0;
90
- transform: translateY(-25%);
88
+ top: 50%;
89
+ left: 50%;
90
+ transform: translate(-50%, -50%);
91
91
  }
92
92
  .button {
93
93
  /* make the icon slot itself collapsible so removal animates smoothly */
@@ -583,4 +583,4 @@ var css_248z = i`:host([color=primary]:not([toggle])) {
583
583
  }`;
584
584
 
585
585
  export { css_248z$2 as a, css_248z as b, css_248z$1 as c, n };
586
- //# sourceMappingURL=button-colors-Dwnez1tR.js.map
586
+ //# sourceMappingURL=button-colors-D7sJyPy8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-colors-Dwnez1tR.js","sources":["../node_modules/lit-html/directives/when.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n,r,t){return n?r(n):t?.(n)}export{n as when};\n//# sourceMappingURL=when.js.map\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"button-colors-D7sJyPy8.js","sources":["../node_modules/lit-html/directives/when.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n,r,t){return n?r(n):t?.(n)}export{n as when};\n//# sourceMappingURL=when.js.map\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -2,10 +2,10 @@ import { a as i, _ as __decorate, I as IndividualComponent, i as i$1, b } from '
2
2
  import { n } from './property-1psGvXOq.js';
3
3
  import { e } from './class-map-YU7g0o3B.js';
4
4
  import { Button } from './button.js';
5
- import { I as IconButton } from './icon-button-DJ0kZXYr.js';
5
+ import { I as IconButton } from './icon-button-CAzYr_qr.js';
6
6
  import './directive-ZPhl09Yt.js';
7
7
  import './ButtonConstants-D06bY4uy.js';
8
- import './button-colors-Dwnez1tR.js';
8
+ import './button-colors-D7sJyPy8.js';
9
9
  import './NativeHyperlinkMixin-DrYXyfMQ.js';
10
10
  import './observe-slot-change-D8Xg-kSS.js';
11
11
  import './dispatch-event-utils-CuEqjlPT.js';
package/dist/button.js CHANGED
@@ -2,7 +2,7 @@ import { a as i, b, A, _ as __decorate, I as IndividualComponent, i as i$1 } fro
2
2
  import { n as n$1 } from './property-1psGvXOq.js';
3
3
  import { e } from './class-map-YU7g0o3B.js';
4
4
  import { N as NativeButtonMixin, o, D as DISABLED_REASON_ID, s as spread } from './ButtonConstants-D06bY4uy.js';
5
- import { n, c as css_248z$2, a as css_248z$3, b as css_248z$4 } from './button-colors-Dwnez1tR.js';
5
+ import { n, c as css_248z$2, a as css_248z$3, b as css_248z$4 } from './button-colors-D7sJyPy8.js';
6
6
  import { N as NativeHyperlinkMixin, t as throttle, i as isLink } from './NativeHyperlinkMixin-DrYXyfMQ.js';
7
7
  import { o as observerSlotChangesWithCallback } from './observe-slot-change-D8Xg-kSS.js';
8
8
  import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
@@ -3,13 +3,13 @@ import { n } from './property-1psGvXOq.js';
3
3
  import { r } from './state-DwbEjqVk.js';
4
4
  import { e } from './query-QBcUV-L_.js';
5
5
  import './toolbar.js';
6
- import './icon-button-DJ0kZXYr.js';
6
+ import './icon-button-CAzYr_qr.js';
7
7
  import './icon-CueRR7wx.js';
8
8
  import { c as css_248z } from './flow-designer-node-BWrPuxAR.js';
9
9
  import './class-map-YU7g0o3B.js';
10
10
  import './directive-ZPhl09Yt.js';
11
11
  import './ButtonConstants-D06bY4uy.js';
12
- import './button-colors-Dwnez1tR.js';
12
+ import './button-colors-D7sJyPy8.js';
13
13
  import './NativeHyperlinkMixin-DrYXyfMQ.js';
14
14
  import './dispatch-event-utils-CuEqjlPT.js';
15
15
  import './unsafe-html-BsGUjx94.js';
@@ -3,7 +3,7 @@ import { n as n$1 } from './property-1psGvXOq.js';
3
3
  import { e as e$1 } from './query-QBcUV-L_.js';
4
4
  import { e } from './class-map-YU7g0o3B.js';
5
5
  import { N as NativeButtonMixin, D as DISABLED_REASON_ID, o, s as spread } from './ButtonConstants-D06bY4uy.js';
6
- import { n, c as css_248z$1, a as css_248z$2, b as css_248z$3 } from './button-colors-Dwnez1tR.js';
6
+ import { n, c as css_248z$1, a as css_248z$2, b as css_248z$3 } from './button-colors-D7sJyPy8.js';
7
7
  import { N as NativeHyperlinkMixin, t as throttle, i as isLink } from './NativeHyperlinkMixin-DrYXyfMQ.js';
8
8
  import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
9
9
 
@@ -315,4 +315,4 @@ __decorate([
315
315
  ], IconButton.prototype, "buttonElement", void 0);
316
316
 
317
317
  export { IconButton as I };
318
- //# sourceMappingURL=icon-button-DJ0kZXYr.js.map
318
+ //# sourceMappingURL=icon-button-CAzYr_qr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-DJ0kZXYr.js","sources":["../../src/button/icon-button/icon-button.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport buttonLayers from '../button/button-layers.scss';\nimport styles from '../button/button.scss';\nimport colorStyles from '../button/button-colors.scss';\nimport sizeStyles from './icon-button-sizes.scss';\nimport { spread } from '@/__directive/spread.js';\nimport { throttle } from '@/__utils/throttle.js';\nimport { isLink } from '@/__utils/is-link.js';\nimport { observerSlotChangesWithCallback } from '@/__utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__utils/dispatch-event-utils.js';\nimport NativeButtonMixin from '@/__mixins/NativeButtonMixin.js';\nimport NativeHyperlinkMixin from '@/__mixins/NativeHyperlinkMixin.js';\nimport { GroupButtonInterface } from '@/button/GroupButtonInterface.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\n\n/**\n * @label Icon Button\n * @tag wc-icon-button\n * @rawTag icon-button\n *\n * @summary Icon buttons allow users to take actions, and make choices, with a single tap.\n *\n * @overview\n * <p>Icon buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. IconButton labels express what action will occur when the user interacts with it.</p>\n *\n * @cssprop --button-container-shape: Defines the border radius of the button container shape.\n *\n * @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.\n * @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.\n *\n *\n * @cssprop --filled-button-container-color: Color of the filled button container.\n * @cssprop --filled-button-label-text-color: Text color of the filled button label.\n *\n * @cssprop --outlined-button-container-color: Color of the outlined button container.\n * @cssprop --outlined-button-label-text-color: Text color of the outlined button label.\n *\n * @cssprop --text-button-label-text-color: Text color of the text button label.\n *\n * @cssprop --tonal-button-container-color: Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color: Text color of the tonal button label.\n *\n * @cssprop --elevated-button-container-color: Color of the elevated button container.\n * @cssprop --elevated-button-label-text-color: Text color of the elevated button label.\n *\n * @cssprop --neo-button-container-color: Color of the neo button container.\n * @cssprop --neo-button-label-text-color: Text color of the neo button label.\n *\n * @fires {CustomEvent} button:click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <wc-icon-button><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * ```\n * @tags display\n */\nexport class IconButton\n extends NativeButtonMixin(NativeHyperlinkMixin(LitElement))\n implements GroupButtonInterface\n{\n static override styles = [buttonLayers, styles, colorStyles, sizeStyles];\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * Type is preset of color and variant. Type will be only applied.\n *\n */\n @property({ type: String }) type?: 'primary' | 'secondary' | 'tertiary';\n\n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is elevated button\n */\n @property({ reflect: true }) variant:\n | 'elevated'\n | 'filled'\n | 'tonal'\n | 'outlined'\n | 'text'\n | 'neo' = 'filled';\n\n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'surface'\n | 'on-surface' = 'primary';\n\n /**\n * Additional ARIA attributes to pass to the inner button/anchor element.\n */\n @property({ reflect: true })\n configAria?: { [key: string]: any };\n\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n @property({ type: Boolean, reflect: true }) toggle: boolean = false;\n\n @property({ type: Boolean, reflect: true }) selected: boolean = false;\n\n /**\n * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.\n */\n @property() throttleDelay = 200;\n\n @property() tooltip?: string;\n\n @property({ type: Boolean, reflect: true })\n pressed = false;\n\n @query('.button') readonly buttonElement!: HTMLElement | null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n window.addEventListener('mouseup', this.__handlePress);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('mouseup', this.__handlePress);\n this.removeEventListener('click', this.__dispatchClickWithThrottle);\n super.disconnectedCallback();\n }\n\n __handlePress = (event: KeyboardEvent | MouseEvent) => {\n if (this.disabled || this.skeleton || this.softDisabled) return;\n this.pressed =\n (event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n (event.key === 'Enter' || event.key === ' ')) ||\n event.type === 'mousedown';\n };\n\n __dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =\n event => {\n this.__dispatchClick(event);\n };\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n\n if (this.toggle) {\n this.selected = !this.selected;\n }\n\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n __renderDisabledReason(softDisabled: boolean) {\n if (softDisabled)\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n __renderTooltip() {\n if (this.tooltip) {\n return html`<wc-tooltip class=\"tooltip\" for=\"button\">${this.tooltip}</wc-tooltip>`;\n }\n return nothing;\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n override firstUpdated() {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n this.__convertTypeToVariantAndColor();\n }\n\n __convertTypeToVariantAndColor() {\n if (this.type === 'primary') {\n this.color = 'primary';\n this.variant = 'filled';\n } else if (this.type === 'secondary') {\n this.color = 'surface';\n this.variant = 'filled';\n } else if (this.type === 'tertiary') {\n this.color = 'primary';\n this.variant = 'text';\n } else if (this.type === 'danger') {\n this.color = 'danger';\n this.variant = 'filled';\n }\n }\n\n override render() {\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"button\"></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=\"button\"></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n ${this.renderButtonElement()} ${this.__renderTooltip()}\n `;\n }\n\n renderButtonElement() {\n const cssClasses = {\n button: true,\n 'button-element': true,\n [`size-${this.size}`]: true,\n [`variant-${this.variant}`]: true,\n [`color-${this.color}`]: true,\n disabled: this.disabled || this.softDisabled,\n pressed: this.pressed,\n skeleton: this.skeleton,\n };\n\n if (!isLink(this)) {\n cssClasses['native-button'] = true;\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n type=${this.htmlType}\n @click=${this.__dispatchClickWithThrottle}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ?disabled=${this.disabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </button>`;\n }\n cssClasses['native-link'] = true;\n return html`<a\n class=${classMap(cssClasses)}\n id=\"button\"\n href=${this.href}\n target=${this.target}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.__dispatchClick}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n role=\"button\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </a>`;\n }\n\n renderButtonContent() {\n return html`\n <slot class=\"icon-slot\"></slot>\n <div class=\"touch\"></div>\n ${this.__renderDisabledReason(this.softDisabled)}\n `;\n }\n}\n"],"names":["LitElement","html","nothing","when","classMap","ifDefined","buttonLayers","styles","colorStyles","sizeStyles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACG,MAAO,UACX,SAAQ,iBAAiB,CAAC,oBAAoB,CAACA,GAAU,CAAC,CAAC,CAAA;AAD7D,IAAA,WAAA,GAAA;;AAME;;;AAGG;QAC0B,IAAA,CAAA,IAAI,GAAqC,IAAI;AAQ1E;;;;;;;;;AASG;QAC0B,IAAA,CAAA,OAAO,GAMxB,QAAQ;AAEpB;;AAEG;QAC0B,IAAA,CAAA,KAAK,GAMf,SAAS;QAQgB,IAAA,CAAA,QAAQ,GAAY,KAAK;QAEzB,IAAA,CAAA,MAAM,GAAY,KAAK;QAEvB,IAAA,CAAA,QAAQ,GAAY,KAAK;AAErE;;AAEG;QACS,IAAA,CAAA,aAAa,GAAG,GAAG;QAK/B,IAAA,CAAA,OAAO,GAAG,KAAK;AAgBf,QAAA,IAAA,CAAA,aAAa,GAAG,CAAC,KAAiC,KAAI;YACpD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY;gBAAE;AACzD,YAAA,IAAI,CAAC,OAAO;gBACV,CAAC,KAAK,YAAY,aAAa;oBAC7B,KAAK,CAAC,IAAI,KAAK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CAAA;AAAX,IAAAA,GAAQ;AAAoB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAG7B,UAAA,CAAA;IADCA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC1B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAEW,UAAA,CAAA;IAA1BC,GAAK,CAAC,SAAS;AAA8C,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"icon-button-CAzYr_qr.js","sources":["../../src/button/icon-button/icon-button.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport buttonLayers from '../button/button-layers.scss';\nimport styles from '../button/button.scss';\nimport colorStyles from '../button/button-colors.scss';\nimport sizeStyles from './icon-button-sizes.scss';\nimport { spread } from '@/__directive/spread.js';\nimport { throttle } from '@/__utils/throttle.js';\nimport { isLink } from '@/__utils/is-link.js';\nimport { observerSlotChangesWithCallback } from '@/__utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__utils/dispatch-event-utils.js';\nimport NativeButtonMixin from '@/__mixins/NativeButtonMixin.js';\nimport NativeHyperlinkMixin from '@/__mixins/NativeHyperlinkMixin.js';\nimport { GroupButtonInterface } from '@/button/GroupButtonInterface.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\n\n/**\n * @label Icon Button\n * @tag wc-icon-button\n * @rawTag icon-button\n *\n * @summary Icon buttons allow users to take actions, and make choices, with a single tap.\n *\n * @overview\n * <p>Icon buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. IconButton labels express what action will occur when the user interacts with it.</p>\n *\n * @cssprop --button-container-shape: Defines the border radius of the button container shape.\n *\n * @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.\n * @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.\n *\n *\n * @cssprop --filled-button-container-color: Color of the filled button container.\n * @cssprop --filled-button-label-text-color: Text color of the filled button label.\n *\n * @cssprop --outlined-button-container-color: Color of the outlined button container.\n * @cssprop --outlined-button-label-text-color: Text color of the outlined button label.\n *\n * @cssprop --text-button-label-text-color: Text color of the text button label.\n *\n * @cssprop --tonal-button-container-color: Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color: Text color of the tonal button label.\n *\n * @cssprop --elevated-button-container-color: Color of the elevated button container.\n * @cssprop --elevated-button-label-text-color: Text color of the elevated button label.\n *\n * @cssprop --neo-button-container-color: Color of the neo button container.\n * @cssprop --neo-button-label-text-color: Text color of the neo button label.\n *\n * @fires {CustomEvent} button:click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <wc-icon-button><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * ```\n * @tags display\n */\nexport class IconButton\n extends NativeButtonMixin(NativeHyperlinkMixin(LitElement))\n implements GroupButtonInterface\n{\n static override styles = [buttonLayers, styles, colorStyles, sizeStyles];\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * Type is preset of color and variant. Type will be only applied.\n *\n */\n @property({ type: String }) type?: 'primary' | 'secondary' | 'tertiary';\n\n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is elevated button\n */\n @property({ reflect: true }) variant:\n | 'elevated'\n | 'filled'\n | 'tonal'\n | 'outlined'\n | 'text'\n | 'neo' = 'filled';\n\n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'surface'\n | 'on-surface' = 'primary';\n\n /**\n * Additional ARIA attributes to pass to the inner button/anchor element.\n */\n @property({ reflect: true })\n configAria?: { [key: string]: any };\n\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n @property({ type: Boolean, reflect: true }) toggle: boolean = false;\n\n @property({ type: Boolean, reflect: true }) selected: boolean = false;\n\n /**\n * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.\n */\n @property() throttleDelay = 200;\n\n @property() tooltip?: string;\n\n @property({ type: Boolean, reflect: true })\n pressed = false;\n\n @query('.button') readonly buttonElement!: HTMLElement | null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n window.addEventListener('mouseup', this.__handlePress);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('mouseup', this.__handlePress);\n this.removeEventListener('click', this.__dispatchClickWithThrottle);\n super.disconnectedCallback();\n }\n\n __handlePress = (event: KeyboardEvent | MouseEvent) => {\n if (this.disabled || this.skeleton || this.softDisabled) return;\n this.pressed =\n (event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n (event.key === 'Enter' || event.key === ' ')) ||\n event.type === 'mousedown';\n };\n\n __dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =\n event => {\n this.__dispatchClick(event);\n };\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n\n if (this.toggle) {\n this.selected = !this.selected;\n }\n\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n __renderDisabledReason(softDisabled: boolean) {\n if (softDisabled)\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n __renderTooltip() {\n if (this.tooltip) {\n return html`<wc-tooltip class=\"tooltip\" for=\"button\">${this.tooltip}</wc-tooltip>`;\n }\n return nothing;\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n override firstUpdated() {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n this.__convertTypeToVariantAndColor();\n }\n\n __convertTypeToVariantAndColor() {\n if (this.type === 'primary') {\n this.color = 'primary';\n this.variant = 'filled';\n } else if (this.type === 'secondary') {\n this.color = 'surface';\n this.variant = 'filled';\n } else if (this.type === 'tertiary') {\n this.color = 'primary';\n this.variant = 'text';\n } else if (this.type === 'danger') {\n this.color = 'danger';\n this.variant = 'filled';\n }\n }\n\n override render() {\n return html`\n <wc-focus-ring class=\"focus-ring\" for=\"button\"></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=\"button\"></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n ${this.renderButtonElement()} ${this.__renderTooltip()}\n `;\n }\n\n renderButtonElement() {\n const cssClasses = {\n button: true,\n 'button-element': true,\n [`size-${this.size}`]: true,\n [`variant-${this.variant}`]: true,\n [`color-${this.color}`]: true,\n disabled: this.disabled || this.softDisabled,\n pressed: this.pressed,\n skeleton: this.skeleton,\n };\n\n if (!isLink(this)) {\n cssClasses['native-button'] = true;\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n type=${this.htmlType}\n @click=${this.__dispatchClickWithThrottle}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ?disabled=${this.disabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </button>`;\n }\n cssClasses['native-link'] = true;\n return html`<a\n class=${classMap(cssClasses)}\n id=\"button\"\n href=${this.href}\n target=${this.target}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.__dispatchClick}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n role=\"button\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </a>`;\n }\n\n renderButtonContent() {\n return html`\n <slot class=\"icon-slot\"></slot>\n <div class=\"touch\"></div>\n ${this.__renderDisabledReason(this.softDisabled)}\n `;\n }\n}\n"],"names":["LitElement","html","nothing","when","classMap","ifDefined","buttonLayers","styles","colorStyles","sizeStyles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACG,MAAO,UACX,SAAQ,iBAAiB,CAAC,oBAAoB,CAACA,GAAU,CAAC,CAAC,CAAA;AAD7D,IAAA,WAAA,GAAA;;AAME;;;AAGG;QAC0B,IAAA,CAAA,IAAI,GAAqC,IAAI;AAQ1E;;;;;;;;;AASG;QAC0B,IAAA,CAAA,OAAO,GAMxB,QAAQ;AAEpB;;AAEG;QAC0B,IAAA,CAAA,KAAK,G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A;AAE1B,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA0B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAExB,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAK1D,UAAA,CAAA;AAAX,IAAAA,GAAQ;AAAuB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAEpB,UAAA,CAAA;AAAX,IAAAA,GAAQ;AAAoB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAG7B,UAAA,CAAA;IADCA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC1B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAEW,UAAA,CAAA;IAA1BC,GAAK,CAAC,SAAS;AAA8C,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;;;;"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { A as Accordion, a as Avatar, B as Badge, b as Breadcrumb, c as Breadcru
3
3
  export { Clock } from './clock.js';
4
4
  export { Button } from './button.js';
5
5
  export { default as ButtonGroup } from './button-group.js';
6
- export { I as IconButton } from './icon-button-DJ0kZXYr.js';
6
+ export { I as IconButton } from './icon-button-CAzYr_qr.js';
7
7
  export { Fab } from './fab.js';
8
8
  export { SplitButton } from './split-button.js';
9
9
  export { DropdownButton } from './dropdown-button.js';
@@ -52,7 +52,7 @@ import './dispatch-event-utils-CuEqjlPT.js';
52
52
  import './style-map-DVmWOuYy.js';
53
53
  import './BaseInput-14YmcfK7.js';
54
54
  import './is-dark-mode-DOcaw4Yq.js';
55
- import './button-colors-Dwnez1tR.js';
55
+ import './button-colors-D7sJyPy8.js';
56
56
  import './transform-DSwFSqzD.js';
57
57
  import './pie-Dz0IDiPt.js';
58
58
  import './array-D5vjT2Xm.js';
@@ -2,7 +2,7 @@ import { A as Accordion, q as NavigationRailItem, N as NavigationRail, v as Sele
2
2
  import { I as Icon } from './icon-CueRR7wx.js';
3
3
  import { Button } from './button.js';
4
4
  import ButtonGroup from './button-group.js';
5
- import { I as IconButton } from './icon-button-DJ0kZXYr.js';
5
+ import { I as IconButton } from './icon-button-CAzYr_qr.js';
6
6
  import { Fab } from './fab.js';
7
7
  import { SplitButton } from './split-button.js';
8
8
  import { DropdownButton } from './dropdown-button.js';
@@ -32,7 +32,7 @@ import './style-map-DVmWOuYy.js';
32
32
  import './BaseInput-14YmcfK7.js';
33
33
  import './is-dark-mode-DOcaw4Yq.js';
34
34
  import './unsafe-html-BsGUjx94.js';
35
- import './button-colors-Dwnez1tR.js';
35
+ import './button-colors-D7sJyPy8.js';
36
36
 
37
37
  class LoaderUtils {
38
38
  constructor(loaderConfig) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@redvars/peacock",
3
3
  "description": "The foundation for beautiful user interfaces",
4
4
  "license": "Apache-2.0",
5
- "version": "3.7.0",
5
+ "version": "3.8.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -44,9 +44,9 @@ Visit [https://peacock.redvars.com](https://peacock.redvars.com) to view the doc
44
44
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
45
45
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
46
46
 
47
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.7.0/dist/assets/styles.css"></link>
47
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.1/dist/assets/styles.css"></link>
48
48
  <script type='module'
49
- src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.7.0/dist/peacock-loader.js'></script>
49
+ src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.1/dist/peacock-loader.js'></script>
50
50
  </head>
51
51
 
52
52
  <wc-button>Button</wc-button>
@@ -68,9 +68,10 @@
68
68
  min-height: 2.5rem;
69
69
  height: 100%;
70
70
  width: 100%;
71
- top: auto;
72
- left: 0;
73
- transform: translateY(-25%);
71
+
72
+ top: 50%;
73
+ left: 50%;
74
+ transform: translate(-50%, -50%);
74
75
  }
75
76
 
76
77
  /* make the icon slot itself collapsible so removal animates smoothly */
@@ -9,50 +9,43 @@
9
9
  <style>
10
10
  body {
11
11
  background: #fafafa;
12
+ padding: 40px;
13
+ display: flex;
14
+ gap: 24px;
15
+ flex-wrap: wrap;
16
+ align-items: center;
17
+ font-family: 'Noto Sans', sans-serif;
18
+ }
19
+
20
+ .focus-surface {
21
+ position: relative;
22
+ display: inline-flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ padding: 12px 24px;
26
+ border-radius: 8px;
27
+ background: #e0e0e0;
28
+ cursor: pointer;
29
+ border: none;
30
+ font: inherit;
12
31
  }
13
32
  </style>
14
33
  </head>
15
34
  <body>
16
35
 
17
- <style>
18
- .elevated-element {
19
- position: relative;
20
- border-radius: 4px;
21
- padding: var(--spacing-200);
22
- }
23
- </style>
24
-
25
- <div class="elevated-element">
26
- <p-elevation style="--elevation-level: 1"></p-elevation>
27
- Level 1
28
- </div>
29
-
30
- <div class="elevated-element">
31
- <p-elevation style="--elevation-level: 2"></p-elevation>
32
- Level 2
33
- </div>
34
-
35
-
36
- <div class="elevated-element">
37
- <p-elevation style="--elevation-level: 3"></p-elevation>
38
- Level 3
39
- </div>
40
-
41
- <div class="elevated-element">
42
- <p-elevation style="--elevation-level: 4"></p-elevation>
43
- Level 4
44
- </div>
45
-
46
- <div class="elevated-element">
47
- <p-elevation style="--elevation-level: 5"></p-elevation>
48
- Level 5
49
- </div>
50
-
36
+ <button class="focus-surface">
37
+ Outward (default)
38
+ <p-focus-ring></p-focus-ring>
39
+ </button>
51
40
 
41
+ <button class="focus-surface">
42
+ Inward
43
+ <p-focus-ring inward></p-focus-ring>
44
+ </button>
52
45
 
53
46
  <script type='module'>
54
- import { Elevation } from '/dist/index.js';
55
- window.customElements.define('p-elevation', Elevation);
47
+ import { FocusRing } from '/dist/index.js';
48
+ window.customElements.define('p-focus-ring', FocusRing);
56
49
  </script>
57
50
  </body>
58
51
  </html>