@redvars/peacock 3.2.7 → 3.2.9
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.
- package/dist/PeacockComponent-CxJc63xj.js +73 -0
- package/dist/PeacockComponent-CxJc63xj.js.map +1 -0
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/button-2MeDq0Yy.js +898 -0
- package/dist/button-2MeDq0Yy.js.map +1 -0
- package/dist/button-group.js +7 -5
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +7 -0
- package/dist/button.js.map +1 -0
- package/dist/{class-map-BmCohX9p.js → class-map-BvQRv7eW.js} +2 -2
- package/dist/{class-map-BmCohX9p.js.map → class-map-BvQRv7eW.js.map} +1 -1
- package/dist/clock.js +26 -24
- package/dist/clock.js.map +1 -1
- package/dist/code-editor.js +43877 -0
- package/dist/code-editor.js.map +1 -0
- package/dist/code-highlighter.js +9 -7
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +561 -0
- package/dist/custom-elements.json +838 -227
- package/dist/{utils-DGMeCC48.js → dispatch-event-utils-vbdiOSeC.js} +19 -2
- package/dist/dispatch-event-utils-vbdiOSeC.js.map +1 -0
- package/dist/image-DK6VQW7N.js +7042 -0
- package/dist/image-DK6VQW7N.js.map +1 -0
- package/dist/index.js +10 -33
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +7 -5
- package/dist/number-counter.js.map +1 -1
- package/dist/observe-theme-change-NneLARW8.js +51 -0
- package/dist/observe-theme-change-NneLARW8.js.map +1 -0
- package/dist/peacock-loader.js +973 -37
- package/dist/peacock-loader.js.map +1 -1
- package/dist/src/PeacockComponent.d.ts +1 -0
- package/dist/src/code-editor/code-editor.d.ts +45 -0
- package/dist/src/code-editor/index.d.ts +2 -0
- package/dist/src/image/image.d.ts +45 -0
- package/dist/src/image/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/dispatch-event-utils.d.ts +72 -0
- package/dist/src/utils/observe-theme-change.d.ts +3 -0
- package/dist/src/utils.d.ts +1 -72
- package/dist/{state-CV1fRmOT.js → state-B09bP3XH.js} +2 -2
- package/dist/{state-CV1fRmOT.js.map → state-B09bP3XH.js.map} +1 -1
- package/dist/{style-map-CdmclYgz.js → style-map-B8xgVEc9.js} +2 -2
- package/dist/{style-map-CdmclYgz.js.map → style-map-B8xgVEc9.js.map} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-BS8X6Gto.js → unsafe-html-B-dV3Jps.js} +2 -2
- package/dist/{unsafe-html-BS8X6Gto.js.map → unsafe-html-B-dV3Jps.js.map} +1 -1
- package/package.json +5 -3
- package/readme.md +2 -2
- package/scss/styles.scss +57 -1
- package/scss/tokens.css +1 -0
- package/src/PeacockComponent.ts +3 -0
- package/src/accordion/accordion-item/accordion-item.scss +1 -1
- package/src/button/BaseButton.ts +1 -1
- package/src/button/button/button.ts +3 -1
- package/src/button/button-group/button-group.ts +2 -0
- package/src/clock/clock.ts +4 -1
- package/src/code-editor/code-editor.scss +52 -0
- package/src/code-editor/code-editor.ts +215 -0
- package/src/code-editor/demo/index.html +37 -0
- package/src/code-editor/index.ts +3 -0
- package/src/code-highlighter/code-highlighter.ts +2 -0
- package/src/container/container.scss +1 -1
- package/src/date-picker/date-picker.ts +1 -1
- package/src/image/image.scss +49 -0
- package/src/image/image.ts +135 -0
- package/src/image/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/input/input.ts +1 -2
- package/src/menu/menu-item/menu-item.scss +5 -4
- package/src/menu/menu-list/menu-list.scss +1 -0
- package/src/number-counter/number-counter.ts +2 -0
- package/src/number-field/number-field.ts +1 -1
- package/src/peacock-loader.ts +7 -0
- package/src/textarea/textarea.ts +1 -1
- package/src/time-picker/time-picker.ts +1 -1
- package/src/utils/dispatch-event-utils.ts +131 -0
- package/src/utils/observe-theme-change.ts +30 -0
- package/src/utils.ts +5 -131
- package/dist/BaseButton.js +0 -209
- package/dist/BaseButton.js.map +0 -1
- package/dist/BaseInput.js +0 -27
- package/dist/BaseInput.js.map +0 -1
- package/dist/accordion-item.js +0 -191
- package/dist/accordion-item.js.map +0 -1
- package/dist/accordion.js +0 -142
- package/dist/accordion.js.map +0 -1
- package/dist/avatar.js +0 -106
- package/dist/avatar.js.map +0 -1
- package/dist/badge.js +0 -84
- package/dist/badge.js.map +0 -1
- package/dist/base-progress.js +0 -33
- package/dist/base-progress.js.map +0 -1
- package/dist/breadcrumb-item.js +0 -160
- package/dist/breadcrumb-item.js.map +0 -1
- package/dist/breadcrumb.js +0 -84
- package/dist/breadcrumb.js.map +0 -1
- package/dist/checkbox.js +0 -530
- package/dist/checkbox.js.map +0 -1
- package/dist/chip.js +0 -303
- package/dist/chip.js.map +0 -1
- package/dist/container.js +0 -135
- package/dist/container.js.map +0 -1
- package/dist/divider.js +0 -126
- package/dist/divider.js.map +0 -1
- package/dist/elevation.js +0 -79
- package/dist/elevation.js.map +0 -1
- package/dist/empty-state.js +0 -171
- package/dist/empty-state.js.map +0 -1
- package/dist/field.js +0 -416
- package/dist/field.js.map +0 -1
- package/dist/focus-ring.js +0 -107
- package/dist/focus-ring.js.map +0 -1
- package/dist/icon.js +0 -183
- package/dist/icon.js.map +0 -1
- package/dist/link.js +0 -91
- package/dist/link.js.map +0 -1
- package/dist/lit-element-CA46RFZ_.js +0 -28
- package/dist/lit-element-CA46RFZ_.js.map +0 -1
- package/dist/menu-item.js +0 -232
- package/dist/menu-item.js.map +0 -1
- package/dist/menu-list.js +0 -108
- package/dist/menu-list.js.map +0 -1
- package/dist/menu.js +0 -117
- package/dist/menu.js.map +0 -1
- package/dist/property-DNVWDdPC.js +0 -45
- package/dist/property-DNVWDdPC.js.map +0 -1
- package/dist/query-QBcUV-L_.js +0 -15
- package/dist/query-QBcUV-L_.js.map +0 -1
- package/dist/ripple.js +0 -128
- package/dist/ripple.js.map +0 -1
- package/dist/skeleton.js +0 -113
- package/dist/skeleton.js.map +0 -1
- package/dist/spinner.js +0 -93
- package/dist/spinner.js.map +0 -1
- package/dist/spread-axRTFMoH.js +0 -32
- package/dist/spread-axRTFMoH.js.map +0 -1
- package/dist/switch-DqxIiVsB.js +0 -2738
- package/dist/switch-DqxIiVsB.js.map +0 -1
- package/dist/tag.js +0 -323
- package/dist/tag.js.map +0 -1
- package/dist/tooltip.js +0 -1857
- package/dist/tooltip.js.map +0 -1
- package/dist/utils-DGMeCC48.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-2MeDq0Yy.js","sources":["../../src/spread.ts","../../src/button/BaseButton.ts","../../src/button/button/button.ts"],"sourcesContent":["import {\n directive,\n Directive,\n ElementPart,\n PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nclass SpreadDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error('spread() can only be used on elements');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n render(_props: { [key: string]: any } | undefined) {\n return '';\n }\n\n update(part: ElementPart, [props]: [{ [key: string]: any } | undefined]) {\n if (!props) return;\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const key in props) {\n const value = props[key];\n if (value === undefined || value === null) {\n part.element.removeAttribute(key);\n } else {\n part.element.setAttribute(key, value);\n }\n }\n }\n}\n\nexport const spread = directive(SpreadDirective);\n","import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { dispatchActivationClick, isActivationClick } from '../utils/dispatch-event-utils.js';\n\nexport class BaseButton extends LitElement {\n #id = crypto.randomUUID();\n\n @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =\n 'button';\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() 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 | 'light'\n | 'dark' = 'primary';\n\n /**\n * Button size.\n * Possible values are `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property() size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * If true, the user cannot interact with the button. Defaults to `false`.\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n @property() skeleton: boolean = false;\n\n /**\n * If true, the user cannot interact with the button and the button is visually styled as disabled. But the button is still focusable. Defaults to `false`.\n */\n @property({ reflect: true, attribute: 'soft-disabled' })\n softDisabled: boolean = false;\n\n /**\n * If button is disabled, the reason why it is disabled.\n */\n @property({ attribute: 'disabled-reason' })\n disabledReason: string = '';\n\n /**\n * Hyperlink to navigate to on click.\n */\n @property({ reflect: true }) href?: string;\n\n @property({ reflect: true })\n configAria?: { [key: string]: any };\n\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n @property() target: string = '_self';\n\n @property() 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 /**\n * States\n */\n @state()\n isPressed = false;\n\n @query('.button') readonly buttonElement!: HTMLElement | null;\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\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 if (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n this.isPressed = true;\n } else if (event.type === 'mousedown') {\n this.isPressed = true;\n } else {\n this.isPressed = false;\n }\n };\n\n __isLink() {\n return !!this.href;\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 this.focus();\n dispatchActivationClick(this.buttonElement);\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 = 'dark';\n this.variant = 'outlined';\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 __getDisabledReasonID() {\n return this.disabled && this.disabledReason\n ? `disabled-reason-${this.#id}`\n : nothing;\n }\n\n __renderDisabledReason() {\n const disabledReasonID = this.__getDisabledReasonID();\n if (disabledReasonID)\n return html`<div\n id=\"disabled-reason-${this.#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`<base-tooltip for=\"button\">${this.tooltip}</base-tooltip>`;\n }\n return nothing;\n }\n}\n","import { html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport PeacockComponent from 'src/PeacockComponent.js';\nimport styles from './button.scss';\nimport colorStyles from './button-colors.scss';\nimport sizeStyles from './button-sizes.scss';\nimport { observerSlotChangesWithCallback, throttle } from '../../utils.js';\nimport { spread } from '../../spread.js';\nimport { BaseButton } from '../BaseButton.js';\n\n/**\n * @label Button\n * @tag base-button\n * @rawTag button\n *\n * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.\n * @overview\n * <p>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. Button 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 {MouseEvent} click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <base-button>Button</base-button>\n * ```\n * @tags display\n */\n@PeacockComponent\nexport class Button extends BaseButton {\n static override styles = [styles, colorStyles, sizeStyles];\n\n #tabindex?: number = 0;\n\n /**\n * Icon alignment.\n * Possible values are `\"start\"`, `\"end\"`. Defaults to `\"end\"`.\n */\n @property({ attribute: 'icon-align' })\n iconAlign: 'start' | 'end' = 'end';\n\n @state()\n private slotHasContent = false;\n\n override firstUpdated() {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n observerSlotChangesWithCallback(\n this.renderRoot.querySelector('slot'),\n hasContent => {\n this.slotHasContent = hasContent;\n this.requestUpdate();\n },\n );\n\n this.__convertTypeToVariantAndColor();\n }\n\n override render() {\n const isLink = this.__isLink();\n\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.isPressed,\n 'has-content': this.slotHasContent,\n 'show-skeleton': this.skeleton,\n [`icon-align-${this.iconAlign}`]: true,\n };\n\n if (!isLink) {\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n tabindex=${this.#tabindex}\n type=${this.htmlType}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n ?aria-describedby=${this.__getDisabledReasonID()}\n aria-disabled=${`${this.disabled || this.softDisabled}`}\n ?disabled=${this.disabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </button>\n ${this.__renderTooltip()}`;\n }\n return html`<a\n class=${classMap(cssClasses)}\n id=\"button\"\n tabindex=${this.#tabindex}\n href=${this.href}\n target=${this.target}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n role=\"button\"\n ?aria-describedby=${this.__getDisabledReasonID()}\n aria-disabled=${`${this.disabled}`}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </a>\n ${this.__renderTooltip()}`;\n }\n\n renderButtonContent() {\n return html`\n <focus-ring class=\"focus-ring\" .control=${this} element=\"buttonElement\"></focus-ring>\n <base-elevation class=\"elevation\"></base-elevation>\n <div class=\"neo-background\"></div>\n <div class=\"background\"></div>\n <div class=\"outline\"></div>\n <base-ripple class=\"ripple\"></base-ripple>\n <base-skeleton class=\"skeleton\"></base-skeleton>\n\n <div class=\"button-content\">\n <div class=\"slot-container\">\n <slot></slot>\n </div>\n\n <slot name=\"icon\"></slot>\n </div>\n\n ${this.__renderDisabledReason()}\n `;\n }\n}\n"],"names":["Directive","PartType","directive","LitElement","nothing","html","property","state","query","classMap","styles","colorStyles","sizeStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,eAAgB,SAAQA,GAAS,CAAA;AACrC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC;QACf,IAAI,QAAQ,CAAC,IAAI,KAAKC,CAAQ,CAAC,OAAO,EAAE;AACtC,YAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC;QAC1D;IACF;;AAGA,IAAA,MAAM,CAAC,MAA0C,EAAA;AAC/C,QAAA,OAAO,EAAE;IACX;AAEA,IAAA,MAAM,CAAC,IAAiB,EAAE,CAAC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mBAAmB,EAAE;;AAE5B,MAAA,EAAA,IAAI,CAAC,eAAe,EAAE,CAAA,CAAE;IAC9B;IAEA,mBAAmB,GAAA;AACjB,QAAA,OAAOJ,CAAI,CAAA;gDACiC,IAAI,CAAA;;;;;;;;;;;;;;;;QAgB5C,IAAI,CAAC,sBAAsB,EAAE;KAChC;IACH;;;AAvGgB,MAAA,CAAA,MAAM,GAAG,CAACK,UAAM,EAAEC,UAAW,EAAEC,QAAU,CAAnC;AAStB,UAAA,CAAA;AADC,IAAAN,CAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE;AACF,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAG3B,UAAA,CAAA;AADP,IAAAC,CAAK;AACyB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAbpB,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAyGlB;;;;"}
|
package/dist/button-group.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { _ as __decorate, n } from './
|
|
2
|
-
import {
|
|
3
|
-
import { e } from './class-map-BmCohX9p.js';
|
|
1
|
+
import { i, _ as __decorate, n, P as PeacockComponent, a as i$1, b } from './PeacockComponent-CxJc63xj.js';
|
|
2
|
+
import { e } from './class-map-BvQRv7eW.js';
|
|
4
3
|
import './directive-Cuw6h7YA.js';
|
|
5
4
|
|
|
6
5
|
var css_248z = i`* {
|
|
@@ -74,7 +73,7 @@ var css_248z = i`* {
|
|
|
74
73
|
*
|
|
75
74
|
* @tags controls
|
|
76
75
|
*/
|
|
77
|
-
class ButtonGroup extends i$1 {
|
|
76
|
+
let ButtonGroup = class ButtonGroup extends i$1 {
|
|
78
77
|
constructor() {
|
|
79
78
|
super(...arguments);
|
|
80
79
|
/**
|
|
@@ -94,7 +93,7 @@ class ButtonGroup extends i$1 {
|
|
|
94
93
|
</div>
|
|
95
94
|
`;
|
|
96
95
|
}
|
|
97
|
-
}
|
|
96
|
+
};
|
|
98
97
|
// Lit prefers CSS-in-JS for better performance and scoping.
|
|
99
98
|
// If you prefer keeping the SCSS file, you'll need a build tool (like Vite or Webpack)
|
|
100
99
|
// that can import .scss files as lit-css.
|
|
@@ -102,6 +101,9 @@ ButtonGroup.styles = [css_248z];
|
|
|
102
101
|
__decorate([
|
|
103
102
|
n()
|
|
104
103
|
], ButtonGroup.prototype, "size", void 0);
|
|
104
|
+
ButtonGroup = __decorate([
|
|
105
|
+
PeacockComponent
|
|
106
|
+
], ButtonGroup);
|
|
105
107
|
|
|
106
108
|
export { ButtonGroup };
|
|
107
109
|
//# sourceMappingURL=button-group.js.map
|
package/dist/button-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","sources":["../../src/button/button-group/button-group.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './button-group.scss';\n\n/**\n * @label Button Group\n * @tag button-group\n * @rawTag button-group\n *\n * @summary Group a series of buttons together on a single line with the button group, and super-power.\n\n * @example\n * ```html\n * <button-group>\n * <icon-button name=\"home\"></icon-button>\n * <icon-button name=\"alarm\"></icon-button>\n * </button-group>\n * ```\n *\n * @tags controls\n */\nexport class ButtonGroup extends LitElement {\n // Lit prefers CSS-in-JS for better performance and scoping.\n // If you prefer keeping the SCSS file, you'll need a build tool (like Vite or Webpack)\n // that can import .scss files as lit-css.\n static styles = [styles];\n\n /**\n * Button size.\n * Possible values are `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property() size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n render() {\n const cssClasses = {\n 'button-group': true,\n [`size-${this.size}`]: true,\n };\n return html`\n <div class=${classMap(cssClasses)}>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property"],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-group.js","sources":["../../src/button/button-group/button-group.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport PeacockComponent from 'src/PeacockComponent.js';\nimport styles from './button-group.scss';\n\n/**\n * @label Button Group\n * @tag button-group\n * @rawTag button-group\n *\n * @summary Group a series of buttons together on a single line with the button group, and super-power.\n\n * @example\n * ```html\n * <button-group>\n * <icon-button name=\"home\"></icon-button>\n * <icon-button name=\"alarm\"></icon-button>\n * </button-group>\n * ```\n *\n * @tags controls\n */\n@PeacockComponent\nexport class ButtonGroup extends LitElement {\n // Lit prefers CSS-in-JS for better performance and scoping.\n // If you prefer keeping the SCSS file, you'll need a build tool (like Vite or Webpack)\n // that can import .scss files as lit-css.\n static styles = [styles];\n\n /**\n * Button size.\n * Possible values are `\"sm\"`, `\"md\"`, `\"lg\"`. Defaults to `\"md\"`.\n */\n @property() size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n render() {\n const cssClasses = {\n 'button-group': true,\n [`size-${this.size}`]: true,\n };\n return html`\n <div class=${classMap(cssClasses)}>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;;;;;;AAgBG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQA,GAAU,CAAA;AAApC,IAAA,WAAA,GAAA;;AAML;;;AAGG;QACS,IAAA,CAAA,IAAI,GAAqC,IAAI;IAa3D;IAXE,MAAM,GAAA;AACJ,QAAA,MAAM,UAAU,GAAG;AACjB,YAAA,cAAc,EAAE,IAAI;AACpB,YAAA,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI;SAC5B;AACD,QAAA,OAAOC,CAAI,CAAA;mBACIC,CAAQ,CAAC,UAAU,CAAC,CAAA;;;KAGlC;IACH;;AArBA;AACA;AACA;AACO,WAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAMZ,UAAA,CAAA;AAAX,IAAAC,CAAQ;AAAiD,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAV/C,WAAW,GAAA,UAAA,CAAA;IADvB;AACY,CAAA,EAAA,WAAW,CAuBvB;;;;"}
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './PeacockComponent-CxJc63xj.js';
|
|
2
|
+
import './state-B09bP3XH.js';
|
|
3
|
+
import './class-map-BvQRv7eW.js';
|
|
4
|
+
export { B as Button } from './button-2MeDq0Yy.js';
|
|
5
|
+
import './dispatch-event-utils-vbdiOSeC.js';
|
|
6
|
+
import './directive-Cuw6h7YA.js';
|
|
7
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E } from './
|
|
1
|
+
import { E } from './PeacockComponent-CxJc63xj.js';
|
|
2
2
|
import { e as e$1, i, t } from './directive-Cuw6h7YA.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -8,4 +8,4 @@ import { e as e$1, i, t } from './directive-Cuw6h7YA.js';
|
|
|
8
8
|
*/const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
|
|
9
9
|
|
|
10
10
|
export { e };
|
|
11
|
-
//# sourceMappingURL=class-map-
|
|
11
|
+
//# sourceMappingURL=class-map-BvQRv7eW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-map-
|
|
1
|
+
{"version":3,"file":"class-map-BvQRv7eW.js","sources":["../node_modules/lit-html/directives/class-map.js"],"sourcesContent":["import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter(s=>t[s]).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter(t=>\"\"!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n"],"names":["s","t","r"],"mappings":";;;AACA;AACA;AACA;AACA;AACA,GAAQ,MAAC,CAAC,CAACA,GAAC,CAAC,cAAc,CAAC,CAAC,WAAW,CAACC,GAAC,CAAC,CAAC,GAAG,KAAK,CAACA,GAAC,CAAC,CAACA,GAAC,CAAC,IAAI,GAAGC,CAAC,CAAC,SAAS,EAAE,OAAO,GAAG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,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,OAAOA,CAAC,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
package/dist/clock.js
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, n } from './
|
|
2
|
-
import { i, a as i$1, b } from './lit-element-CA46RFZ_.js';
|
|
3
|
-
|
|
4
|
-
var css_248z = i`* {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.screen-reader-only {
|
|
9
|
-
display: none !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.current-time {
|
|
17
|
-
font-family: var(--typography-body-medium-font-family) !important;
|
|
18
|
-
font-size: var(--typography-body-medium-font-size) !important;
|
|
19
|
-
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
20
|
-
line-height: var(--typography-body-medium-line-height) !important;
|
|
21
|
-
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
22
|
-
}`;
|
|
1
|
+
import { i, _ as __decorate, n, P as PeacockComponent, a as i$1, b } from './PeacockComponent-CxJc63xj.js';
|
|
23
2
|
|
|
24
3
|
class ClockController {
|
|
25
4
|
constructor(host, timeout = 1000) {
|
|
@@ -43,6 +22,26 @@ class ClockController {
|
|
|
43
22
|
}
|
|
44
23
|
}
|
|
45
24
|
|
|
25
|
+
var css_248z = i`* {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.screen-reader-only {
|
|
30
|
+
display: none !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.current-time {
|
|
38
|
+
font-family: var(--typography-body-medium-font-family) !important;
|
|
39
|
+
font-size: var(--typography-body-medium-font-size) !important;
|
|
40
|
+
font-weight: var(--typography-body-medium-font-weight) !important;
|
|
41
|
+
line-height: var(--typography-body-medium-line-height) !important;
|
|
42
|
+
letter-spacing: var(--typography-body-medium-letter-spacing) !important;
|
|
43
|
+
}`;
|
|
44
|
+
|
|
46
45
|
/**
|
|
47
46
|
* @label Clock
|
|
48
47
|
* @tag base-clock
|
|
@@ -59,7 +58,7 @@ class ClockController {
|
|
|
59
58
|
* ```
|
|
60
59
|
* @tags display
|
|
61
60
|
*/
|
|
62
|
-
class Clock extends i$1 {
|
|
61
|
+
let Clock = class Clock extends i$1 {
|
|
63
62
|
constructor() {
|
|
64
63
|
super(...arguments);
|
|
65
64
|
this.clockController = new ClockController(this, 100);
|
|
@@ -73,11 +72,14 @@ class Clock extends i$1 {
|
|
|
73
72
|
const currentDate = this.__formatDate(this.clockController.value);
|
|
74
73
|
return b `<div class="current-time">${currentDate}</div>`;
|
|
75
74
|
}
|
|
76
|
-
}
|
|
75
|
+
};
|
|
77
76
|
Clock.styles = [css_248z];
|
|
78
77
|
__decorate([
|
|
79
78
|
n()
|
|
80
79
|
], Clock.prototype, "timezone", void 0);
|
|
80
|
+
Clock = __decorate([
|
|
81
|
+
PeacockComponent
|
|
82
|
+
], Clock);
|
|
81
83
|
|
|
82
84
|
export { Clock };
|
|
83
85
|
//# sourceMappingURL=clock.js.map
|
package/dist/clock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.js","sources":["../../src/clock/ClockController.ts","../../src/clock/clock.ts"],"sourcesContent":["import { ReactiveController, ReactiveControllerHost } from 'lit';\n\nexport class ClockController implements ReactiveController {\n host: ReactiveControllerHost;\n\n value = new Date();\n\n timeout: number;\n\n private _timerID?: any;\n\n constructor(host: ReactiveControllerHost, timeout = 1000) {\n this.host = host;\n this.host.addController(this);\n this.timeout = timeout;\n }\n\n hostConnected() {\n // Start a timer when the host is connected\n this._timerID = setInterval(() => {\n this.value = new Date();\n // Update the host with new value\n this.host.requestUpdate();\n }, this.timeout);\n }\n\n hostDisconnected() {\n // Clear the timer when the host is disconnected\n clearInterval(this._timerID);\n this._timerID = undefined;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport
|
|
1
|
+
{"version":3,"file":"clock.js","sources":["../../src/clock/ClockController.ts","../../src/clock/clock.ts"],"sourcesContent":["import { ReactiveController, ReactiveControllerHost } from 'lit';\n\nexport class ClockController implements ReactiveController {\n host: ReactiveControllerHost;\n\n value = new Date();\n\n timeout: number;\n\n private _timerID?: any;\n\n constructor(host: ReactiveControllerHost, timeout = 1000) {\n this.host = host;\n this.host.addController(this);\n this.timeout = timeout;\n }\n\n hostConnected() {\n // Start a timer when the host is connected\n this._timerID = setInterval(() => {\n this.value = new Date();\n // Update the host with new value\n this.host.requestUpdate();\n }, this.timeout);\n }\n\n hostDisconnected() {\n // Clear the timer when the host is disconnected\n clearInterval(this._timerID);\n this._timerID = undefined;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport PeacockComponent from 'src/PeacockComponent.js';\nimport { ClockController } from './ClockController.js';\n\nimport styles from './clock.scss';\n\n/**\n * @label Clock\n * @tag base-clock\n * @rawTag clock\n *\n * @summary Displays the current time in a given timezone.\n * @overview\n * - Clocks are used to display the current time in a specified timezone.\n * - They can be displayed in various formats, including 12-hour and 24-hour time.\n *\n * @example\n * ```html\n * <base-clock></base-clock>\n * ```\n * @tags display\n */\n@PeacockComponent\nexport class Clock extends LitElement {\n static styles = [styles];\n\n clockController = new ClockController(this, 100);\n\n @property() timezone?: string;\n\n __formatDate(date: Date) {\n return date.toLocaleTimeString('en-US', {\n timeZone: this.timezone,\n });\n }\n\n render() {\n const currentDate = this.__formatDate(this.clockController.value);\n return html`<div class=\"current-time\">${currentDate}</div>`;\n }\n}\n"],"names":["LitElement","html","styles","property"],"mappings":";;MAEa,eAAe,CAAA;AAS1B,IAAA,WAAA,CAAY,IAA4B,EAAE,OAAO,GAAG,IAAI,EAAA;AANxD,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,IAAI,EAAE;AAOhB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;AAC7B,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;IAEA,aAAa,GAAA;;AAEX,QAAA,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,MAAK;AAC/B,YAAA,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,EAAE;;AAEvB,YAAA,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AAC3B,QAAA,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;IAClB;IAEA,gBAAgB,GAAA;;AAEd,QAAA,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC5B,QAAA,IAAI,CAAC,QAAQ,GAAG,SAAS;IAC3B;AACD;;;;;;;;;;;;;;;;;;;;;;ACxBD;;;;;;;;;;;;;;;AAeG;AAEI,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQA,GAAU,CAAA;AAA9B,IAAA,WAAA,GAAA;;QAGL,IAAA,CAAA,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC;IAclD;AAVE,IAAA,YAAY,CAAC,IAAU,EAAA;AACrB,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;YACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACxB,SAAA,CAAC;IACJ;IAE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