@redvars/peacock 3.2.8 → 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-DMrFEGDh.js → PeacockComponent-CxJc63xj.js} +6 -13
- 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-BtpAXuLN.js → button-2MeDq0Yy.js} +11 -293
- package/dist/button-2MeDq0Yy.js.map +1 -0
- package/dist/button-group.js +3 -2
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +6 -4
- package/dist/button.js.map +1 -1
- package/dist/{class-map-CbncA34D.js → class-map-BvQRv7eW.js} +3 -2
- package/dist/class-map-BvQRv7eW.js.map +1 -0
- package/dist/clock.js +85 -0
- package/dist/clock.js.map +1 -0
- package/dist/code-editor.js +43877 -0
- package/dist/code-editor.js.map +1 -0
- package/dist/code-highlighter.js +5 -4
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +561 -0
- package/dist/custom-elements.json +777 -194
- package/dist/directive-Cuw6h7YA.js +9 -0
- package/dist/directive-Cuw6h7YA.js.map +1 -0
- package/dist/dispatch-event-utils-vbdiOSeC.js +290 -0
- package/dist/dispatch-event-utils-vbdiOSeC.js.map +1 -0
- package/dist/{breadcrumb-item-DkhwoMAH.js → image-DK6VQW7N.js} +255 -92
- package/dist/image-DK6VQW7N.js.map +1 -0
- package/dist/index.js +12 -87
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +3 -2
- 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 +22 -11
- package/dist/peacock-loader.js.map +1 -1
- 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-CEVpI7Vv.js → state-B09bP3XH.js} +2 -2
- package/dist/{state-CEVpI7Vv.js.map → state-B09bP3XH.js.map} +1 -1
- package/dist/{style-map-mOmZwsJT.js → style-map-B8xgVEc9.js} +3 -2
- package/dist/style-map-B8xgVEc9.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-Ca00SXpn.js → unsafe-html-B-dV3Jps.js} +3 -2
- package/dist/unsafe-html-B-dV3Jps.js.map +1 -0
- package/package.json +5 -3
- package/scss/styles.scss +57 -1
- package/scss/tokens.css +1 -0
- package/src/accordion/accordion-item/accordion-item.scss +1 -1
- package/src/button/BaseButton.ts +1 -1
- 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/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-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/PeacockComponent-DMrFEGDh.js.map +0 -1
- package/dist/breadcrumb-item-DkhwoMAH.js.map +0 -1
- package/dist/button-BtpAXuLN.js.map +0 -1
- package/dist/class-map-CbncA34D.js.map +0 -1
- package/dist/style-map-mOmZwsJT.js.map +0 -1
- package/dist/unsafe-html-Ca00SXpn.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
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,GAAGD,GAAC,CAAC,IAAI,EAAEA,GAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,oGAAoG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAA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AC,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
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { i, _ as __decorate, n, P as PeacockComponent, a as i$1, b } from './PeacockComponent-CxJc63xj.js';
|
|
2
|
+
|
|
3
|
+
class ClockController {
|
|
4
|
+
constructor(host, timeout = 1000) {
|
|
5
|
+
this.value = new Date();
|
|
6
|
+
this.host = host;
|
|
7
|
+
this.host.addController(this);
|
|
8
|
+
this.timeout = timeout;
|
|
9
|
+
}
|
|
10
|
+
hostConnected() {
|
|
11
|
+
// Start a timer when the host is connected
|
|
12
|
+
this._timerID = setInterval(() => {
|
|
13
|
+
this.value = new Date();
|
|
14
|
+
// Update the host with new value
|
|
15
|
+
this.host.requestUpdate();
|
|
16
|
+
}, this.timeout);
|
|
17
|
+
}
|
|
18
|
+
hostDisconnected() {
|
|
19
|
+
// Clear the timer when the host is disconnected
|
|
20
|
+
clearInterval(this._timerID);
|
|
21
|
+
this._timerID = undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
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
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @label Clock
|
|
47
|
+
* @tag base-clock
|
|
48
|
+
* @rawTag clock
|
|
49
|
+
*
|
|
50
|
+
* @summary Displays the current time in a given timezone.
|
|
51
|
+
* @overview
|
|
52
|
+
* - Clocks are used to display the current time in a specified timezone.
|
|
53
|
+
* - They can be displayed in various formats, including 12-hour and 24-hour time.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```html
|
|
57
|
+
* <base-clock></base-clock>
|
|
58
|
+
* ```
|
|
59
|
+
* @tags display
|
|
60
|
+
*/
|
|
61
|
+
let Clock = class Clock extends i$1 {
|
|
62
|
+
constructor() {
|
|
63
|
+
super(...arguments);
|
|
64
|
+
this.clockController = new ClockController(this, 100);
|
|
65
|
+
}
|
|
66
|
+
__formatDate(date) {
|
|
67
|
+
return date.toLocaleTimeString('en-US', {
|
|
68
|
+
timeZone: this.timezone,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
const currentDate = this.__formatDate(this.clockController.value);
|
|
73
|
+
return b `<div class="current-time">${currentDate}</div>`;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
Clock.styles = [css_248z];
|
|
77
|
+
__decorate([
|
|
78
|
+
n()
|
|
79
|
+
], Clock.prototype, "timezone", void 0);
|
|
80
|
+
Clock = __decorate([
|
|
81
|
+
PeacockComponent
|
|
82
|
+
], Clock);
|
|
83
|
+
|
|
84
|
+
export { Clock };
|
|
85
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +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 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,YA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