@shibui-ui/ui 1.24.1 → 1.25.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.
- package/dist/components/atoms/index.d.ts +45 -16
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/molecules/index.d.ts +20 -1
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +17 -1
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/index.d.ts +3 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -80
- package/dist/index.js.map +1 -1
- package/dist/index10.js +82 -18
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +84 -69
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +40 -26
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +16 -39
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +29 -44
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +16 -117
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +48 -40
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +41 -25
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +76 -49
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +19 -39
- package/dist/index19.js.map +1 -1
- package/dist/index194.js +94 -24
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +2 -2
- package/dist/index197.js +2 -24
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +74 -2
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +64 -35
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +21 -41
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -2
- package/dist/index201.js +54 -13
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -2
- package/dist/index203.js +2 -2
- package/dist/index204.js +143 -157
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +43 -24
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +51 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +33 -2
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +2 -91
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +90 -26
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +6 -2
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +2 -41
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +260 -2
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +16 -5
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -2
- package/dist/index215.js +2 -35
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +59 -42
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +32 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +2 -85
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +2 -2
- package/dist/index22.js +41 -48
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +73 -65
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +81 -2
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +2 -10
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +133 -2
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +2 -26
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +2 -2
- package/dist/index226.js +66 -12
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +97 -2
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -2
- package/dist/index229.js +62 -24
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +50 -94
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +2 -2
- package/dist/index231.js +2 -2
- package/dist/index232.js +12 -2
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -16
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index235.js +11 -9
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -2
- package/dist/index237.js +76 -34
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +2 -2
- package/dist/index239.js +2 -27
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +37 -34
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +39 -2
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -34
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +235 -12
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +82 -2
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -9
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +94 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -5
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +268 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +2 -36
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +21 -2
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +51 -32
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +2 -31
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +9 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -19
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +15 -2
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -2
- package/dist/index255.js +135 -69
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +2 -11
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -2
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +2 -78
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +9 -2
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +31 -236
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +2 -32
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +2 -2
- package/dist/index262.js +92 -9
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +59 -2
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +2 -16
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +41 -2
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -16
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +34 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +8 -54
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -2
- package/dist/index27.js +27 -58
- package/dist/index27.js.map +1 -1
- package/dist/index270.js +42 -7
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +2 -2
- package/dist/index272.js +2 -34
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +16 -2
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +9 -2
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +6 -13
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +2 -2
- package/dist/index277.js +8 -15
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +2 -2
- package/dist/index279.js +55 -2
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +247 -24
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +2 -42
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +2 -100
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +20 -2
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +2 -97
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +33 -2
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +6 -27
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +2 -2
- package/dist/index287.js +9 -44
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +2 -2
- package/dist/index289.js +2 -33
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +249 -39
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +36 -2
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +2 -57
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +24 -2
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +2 -2
- package/dist/index294.js +26 -247
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +2 -2
- package/dist/index296.js +2 -72
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +42 -2
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +7 -56
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +2 -133
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +32 -19
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +30 -2
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +2 -12
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +34 -2
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +2 -162
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +26 -42
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +2 -81
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -2
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +2 -71
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +2 -2
- package/dist/index309.js +19 -2
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +96 -11
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +2 -81
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +2 -2
- package/dist/index312.js +42 -2
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +2 -74
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +25 -67
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +2 -2
- package/dist/index316.js +9 -17
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +2 -2
- package/dist/index318.js +84 -32
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +2 -2
- package/dist/index32.js +40 -48
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +68 -77
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +2 -2
- package/dist/index322.js +12 -148
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +1 -1
- package/dist/index324.js +28 -6
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +2 -2
- package/dist/index326.js +78 -87
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +2 -2
- package/dist/index328.js +78 -2
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +2 -237
- package/dist/index329.js.map +1 -1
- package/dist/index33.js +20 -56
- package/dist/index33.js.map +1 -1
- package/dist/index330.js +11 -6
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +2 -2
- package/dist/index332.js +18 -59
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +2 -2
- package/dist/index334.js +12 -5
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +2 -2
- package/dist/index336.js +2 -15
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +88 -2
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +24 -2
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +2 -92
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +59 -35
- package/dist/index34.js.map +1 -1
- package/dist/index340.js +42 -14
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +2 -2
- package/dist/index342.js +22 -80
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +2 -2
- package/dist/index344.js +2 -18
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +16 -2
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +2 -268
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +176 -2
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +2 -2
- package/dist/index349.js +35 -39
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +101 -28
- package/dist/index35.js.map +1 -1
- package/dist/index350.js +3 -3
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +2 -2
- package/dist/index352.js +19 -26
- package/dist/index352.js.map +1 -1
- package/dist/index357.js +26 -19
- package/dist/index357.js.map +1 -1
- package/dist/index36.js +115 -33
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +41 -115
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +34 -246
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +30 -137
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +26 -84
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +26 -400
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +28 -77
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +23 -26
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +36 -33
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +62 -16
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +138 -21
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +129 -22
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +41 -19
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -82
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +56 -279
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +21 -34
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +280 -33
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +74 -94
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +66 -41
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +333 -62
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +96 -256
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +38 -130
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +251 -50
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +144 -115
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +93 -183
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +33 -339
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.js +102 -66
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +73 -179
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +117 -97
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +113 -263
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +258 -251
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +177 -79
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +261 -140
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +183 -100
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +28 -89
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +20 -161
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +394 -32
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +190 -53
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +204 -112
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +2 -2
- package/dist/index73.js +89 -28
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +126 -63
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +122 -111
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +67 -64
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +112 -88
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +87 -16
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +151 -79
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +25 -127
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +104 -186
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +59 -20
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +17 -129
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +88 -217
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +64 -112
- package/dist/index84.js.map +1 -1
- package/dist/index9.js +30 -45
- package/dist/index9.js.map +1 -1
- package/dist/src/components/atoms/index.d.ts +45 -16
- package/dist/src/components/atoms/index.d.ts.map +1 -1
- package/dist/src/components/molecules/index.d.ts +20 -1
- package/dist/src/components/molecules/index.d.ts.map +1 -1
- package/dist/src/components/organisms/index.d.ts +17 -1
- package/dist/src/components/organisms/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -82
- package/dist/src/index.d.ts.map +1 -1
- package/dist/tokens.css +353 -7
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index4.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { unsafeCSS, css, LitElement } from "lit";
|
|
2
|
-
import { property,
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import copyButtonCss from "./index195.js";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { accordionItemTemplate } from "./index265.js";
|
|
4
|
+
import accordionItemCss from "./index266.js";
|
|
6
5
|
import sharedTokens from "./index196.js";
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
8
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -14,101 +13,44 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14
13
|
if (kind && result) __defProp(target, key, result);
|
|
15
14
|
return result;
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
let LibCopyButton = class extends LitElement {
|
|
16
|
+
let LibAccordionItem = class extends LitElement {
|
|
19
17
|
constructor() {
|
|
20
18
|
super(...arguments);
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.variant = "ghost";
|
|
24
|
-
this.size = "md";
|
|
25
|
-
this.iconOnly = false;
|
|
26
|
-
this.label = "Copiar";
|
|
27
|
-
this.successLabel = "Copiado";
|
|
28
|
-
this.tooltip = false;
|
|
29
|
-
this.disabled = false;
|
|
30
|
-
this._copied = false;
|
|
19
|
+
this.label = "";
|
|
20
|
+
this.open = false;
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
async _handleClick() {
|
|
43
|
-
if (!this.value || this.disabled || this._copied) return;
|
|
44
|
-
try {
|
|
45
|
-
await navigator.clipboard.writeText(this.value);
|
|
46
|
-
this._copied = true;
|
|
47
|
-
this.dispatchEvent(
|
|
48
|
-
new CustomEvent("lib-copy", {
|
|
49
|
-
detail: { value: this.value },
|
|
50
|
-
bubbles: true,
|
|
51
|
-
composed: true
|
|
52
|
-
})
|
|
53
|
-
);
|
|
54
|
-
if (this._resetTimer) clearTimeout(this._resetTimer);
|
|
55
|
-
this._resetTimer = setTimeout(() => {
|
|
56
|
-
this._copied = false;
|
|
57
|
-
}, COPIED_DURATION);
|
|
58
|
-
} catch (err) {
|
|
59
|
-
console.error("[lib-copy-button] Error al copiar:", err);
|
|
60
|
-
}
|
|
22
|
+
_handleToggle() {
|
|
23
|
+
this.open = !this.open;
|
|
24
|
+
this.dispatchEvent(
|
|
25
|
+
new CustomEvent("accordion-toggle", {
|
|
26
|
+
bubbles: true,
|
|
27
|
+
composed: true,
|
|
28
|
+
detail: { open: this.open }
|
|
29
|
+
})
|
|
30
|
+
);
|
|
61
31
|
}
|
|
62
32
|
render() {
|
|
63
|
-
return
|
|
64
|
-
value: this.value,
|
|
65
|
-
variant: this.variant,
|
|
66
|
-
size: this.size,
|
|
67
|
-
iconOnly: this.iconOnly,
|
|
33
|
+
return accordionItemTemplate({
|
|
68
34
|
label: this.label,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
copied: this._copied,
|
|
72
|
-
disabled: this.disabled,
|
|
73
|
-
onClick: this._handleClick.bind(this)
|
|
35
|
+
open: this.open,
|
|
36
|
+
onToggle: this._handleToggle.bind(this)
|
|
74
37
|
});
|
|
75
38
|
}
|
|
76
39
|
};
|
|
77
|
-
|
|
40
|
+
LibAccordionItem.styles = [
|
|
78
41
|
css`${unsafeCSS(sharedTokens)}`,
|
|
79
|
-
css`${unsafeCSS(
|
|
42
|
+
css`${unsafeCSS(accordionItemCss)}`
|
|
80
43
|
];
|
|
81
44
|
__decorateClass([
|
|
82
45
|
property({ type: String })
|
|
83
|
-
],
|
|
84
|
-
__decorateClass([
|
|
85
|
-
property({ type: String, reflect: true })
|
|
86
|
-
], LibCopyButton.prototype, "variant", 2);
|
|
87
|
-
__decorateClass([
|
|
88
|
-
property({ type: String, reflect: true })
|
|
89
|
-
], LibCopyButton.prototype, "size", 2);
|
|
90
|
-
__decorateClass([
|
|
91
|
-
property({ type: Boolean, reflect: true, attribute: "icon-only" })
|
|
92
|
-
], LibCopyButton.prototype, "iconOnly", 2);
|
|
93
|
-
__decorateClass([
|
|
94
|
-
property({ type: String })
|
|
95
|
-
], LibCopyButton.prototype, "label", 2);
|
|
96
|
-
__decorateClass([
|
|
97
|
-
property({ type: String, attribute: "success-label" })
|
|
98
|
-
], LibCopyButton.prototype, "successLabel", 2);
|
|
46
|
+
], LibAccordionItem.prototype, "label", 2);
|
|
99
47
|
__decorateClass([
|
|
100
48
|
property({ type: Boolean, reflect: true })
|
|
101
|
-
],
|
|
102
|
-
__decorateClass([
|
|
103
|
-
|
|
104
|
-
],
|
|
105
|
-
__decorateClass([
|
|
106
|
-
state()
|
|
107
|
-
], LibCopyButton.prototype, "_copied", 2);
|
|
108
|
-
LibCopyButton = __decorateClass([
|
|
109
|
-
customElement("lib-copy-button")
|
|
110
|
-
], LibCopyButton);
|
|
49
|
+
], LibAccordionItem.prototype, "open", 2);
|
|
50
|
+
LibAccordionItem = __decorateClass([
|
|
51
|
+
customElement("lib-accordion-item")
|
|
52
|
+
], LibAccordionItem);
|
|
111
53
|
export {
|
|
112
|
-
|
|
54
|
+
LibAccordionItem
|
|
113
55
|
};
|
|
114
56
|
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../src/components/atoms/
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../src/components/atoms/accordion-item/lib-accordion-item.component.ts"],"sourcesContent":["import { LitElement, css, unsafeCSS, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { accordionItemTemplate } from './lib-accordion-item.component.html';\nimport accordionItemCss from './lib-accordion-item.css?inline';\nimport sharedTokens from '../../../styles/shared/tokens.css?inline';\n\n/**\n * @element lib-accordion-item\n *\n * Item colapsable individual. Puede usarse standalone o dentro de lib-accordion.\n * El padre lib-accordion orquesta el comportamiento mutually-exclusive y\n * aplica variantes (flush, separated, accent) via CSS custom properties.\n *\n * @slot - Contenido colapsable\n *\n * @fires accordion-toggle - Emitido al hacer clic en el trigger.\n * detail: { open: boolean }\n *\n * @example\n * <lib-accordion-item label=\"Pregunta\" open>\n * Respuesta detallada aqui.\n * </lib-accordion-item>\n */\n@customElement('lib-accordion-item')\nexport class LibAccordionItem extends LitElement {\n static override styles = [\n css`${unsafeCSS(sharedTokens)}`,\n css`${unsafeCSS(accordionItemCss)}`,\n ];\n\n /** Texto del trigger (cabecera del item) */\n @property({ type: String })\n label = '';\n\n /** Estado abierto/cerrado */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n private _handleToggle(): void {\n this.open = !this.open;\n\n this.dispatchEvent(\n new CustomEvent<{ open: boolean }>('accordion-toggle', {\n bubbles: true,\n composed: true,\n detail: { open: this.open },\n })\n );\n }\n\n override render(): TemplateResult {\n return accordionItemTemplate({\n label: this.label,\n open: this.open,\n onToggle: this._handleToggle.bind(this),\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lib-accordion-item': LibAccordionItem;\n }\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwBO,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA;AAQL,SAAA,QAAQ;AAIR,SAAA,OAAO;AAAA,EAAA;AAAA,EAEC,gBAAsB;AAC5B,SAAK,OAAO,CAAC,KAAK;AAElB,SAAK;AAAA,MACH,IAAI,YAA+B,oBAAoB;AAAA,QACrD,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ,EAAE,MAAM,KAAK,KAAA;AAAA,MAAK,CAC3B;AAAA,IAAA;AAAA,EAEL;AAAA,EAES,SAAyB;AAChC,WAAO,sBAAsB;AAAA,MAC3B,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK;AAAA,MACX,UAAU,KAAK,cAAc,KAAK,IAAI;AAAA,IAAA,CACvC;AAAA,EACH;AACF;AAjCa,iBACK,SAAS;AAAA,EACvB,MAAM,UAAU,YAAY,CAAC;AAAA,EAC7B,MAAM,UAAU,gBAAgB,CAAC;AACnC;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAPf,iBAQX,WAAA,SAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAX/B,iBAYX,WAAA,QAAA,CAAA;AAZW,mBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,gBAAA;"}
|
package/dist/index40.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property,
|
|
3
|
-
import
|
|
4
|
-
import sharedTokens from "./index196.js";
|
|
5
|
-
import { backgroundTemplate } from "./index266.js";
|
|
6
|
-
import { BG_CANVAS_VARIANTS } from "./index267.js";
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as o } from "./index267.js";
|
|
7
4
|
var __defProp = Object.defineProperty;
|
|
8
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
6
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -14,409 +11,38 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14
11
|
if (kind && result) __defProp(target, key, result);
|
|
15
12
|
return result;
|
|
16
13
|
};
|
|
17
|
-
let
|
|
14
|
+
let LibSpacer = class extends LitElement {
|
|
18
15
|
constructor() {
|
|
19
16
|
super(...arguments);
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this._raf = 0;
|
|
23
|
-
this._ro = null;
|
|
17
|
+
this.size = "md";
|
|
18
|
+
this.horizontal = false;
|
|
24
19
|
}
|
|
25
|
-
/* ── Ciclo de vida ── */
|
|
26
|
-
disconnectedCallback() {
|
|
27
|
-
super.disconnectedCallback();
|
|
28
|
-
this._stopCanvas();
|
|
29
|
-
}
|
|
30
|
-
updated(changed) {
|
|
31
|
-
if (changed.has("variant")) {
|
|
32
|
-
this._stopCanvas();
|
|
33
|
-
if (BG_CANVAS_VARIANTS.has(this.variant)) {
|
|
34
|
-
requestAnimationFrame(() => this._startCanvas());
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/* ── Canvas lifecycle ── */
|
|
39
|
-
_stopCanvas() {
|
|
40
|
-
if (this._raf) {
|
|
41
|
-
cancelAnimationFrame(this._raf);
|
|
42
|
-
this._raf = 0;
|
|
43
|
-
}
|
|
44
|
-
if (this._ro) {
|
|
45
|
-
this._ro.disconnect();
|
|
46
|
-
this._ro = null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
_startCanvas() {
|
|
50
|
-
const canvas = this._canvas;
|
|
51
|
-
if (!canvas) return;
|
|
52
|
-
switch (this.variant) {
|
|
53
|
-
case "particles":
|
|
54
|
-
this._initParticles(canvas);
|
|
55
|
-
break;
|
|
56
|
-
case "rain":
|
|
57
|
-
this._initRain(canvas);
|
|
58
|
-
break;
|
|
59
|
-
case "wave-mesh":
|
|
60
|
-
this._initWaveMesh(canvas);
|
|
61
|
-
break;
|
|
62
|
-
case "constellation":
|
|
63
|
-
this._initConstellation(canvas);
|
|
64
|
-
break;
|
|
65
|
-
case "fireflies":
|
|
66
|
-
this._initFireflies(canvas);
|
|
67
|
-
break;
|
|
68
|
-
case "ink-wash":
|
|
69
|
-
this._initInkWash(canvas);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/* ── Canvas: Particle Field ── */
|
|
74
|
-
_initParticles(canvas) {
|
|
75
|
-
const ctx = canvas.getContext("2d");
|
|
76
|
-
const host = this.renderRoot.host;
|
|
77
|
-
let W = 0, H = 0;
|
|
78
|
-
const COUNT = 55;
|
|
79
|
-
const COLORS = ["rgba(217,114,52,", "rgba(78,148,130,", "rgba(250,247,244,"];
|
|
80
|
-
let pts = [];
|
|
81
|
-
const resize = () => {
|
|
82
|
-
W = canvas.width = host.clientWidth;
|
|
83
|
-
H = canvas.height = host.clientHeight;
|
|
84
|
-
pts = Array.from({ length: COUNT }, () => ({
|
|
85
|
-
x: Math.random() * W,
|
|
86
|
-
y: Math.random() * H,
|
|
87
|
-
r: Math.random() * 1.5 + 0.3,
|
|
88
|
-
vx: (Math.random() - 0.5) * 0.25,
|
|
89
|
-
vy: (Math.random() - 0.5) * 0.25,
|
|
90
|
-
a: Math.random() * 0.4 + 0.15,
|
|
91
|
-
// ✅ Fix: COLORS es string[] → el acceso ya no devuelve undefined
|
|
92
|
-
c: COLORS[Math.floor(Math.random() * COLORS.length)] ?? "rgba(250,247,244,"
|
|
93
|
-
}));
|
|
94
|
-
};
|
|
95
|
-
const draw = () => {
|
|
96
|
-
ctx.clearRect(0, 0, W, H);
|
|
97
|
-
for (let i = 0; i < pts.length; i++) {
|
|
98
|
-
for (let j = i + 1; j < pts.length; j++) {
|
|
99
|
-
const pi = pts[i];
|
|
100
|
-
const pj = pts[j];
|
|
101
|
-
const dx = pi.x - pj.x;
|
|
102
|
-
const dy = pi.y - pj.y;
|
|
103
|
-
const d = Math.sqrt(dx * dx + dy * dy);
|
|
104
|
-
if (d < 90) {
|
|
105
|
-
ctx.beginPath();
|
|
106
|
-
ctx.moveTo(pi.x, pi.y);
|
|
107
|
-
ctx.lineTo(pj.x, pj.y);
|
|
108
|
-
ctx.strokeStyle = `rgba(250,247,244,${0.04 * (1 - d / 90)})`;
|
|
109
|
-
ctx.lineWidth = 0.5;
|
|
110
|
-
ctx.stroke();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
pts.forEach((p) => {
|
|
115
|
-
ctx.beginPath();
|
|
116
|
-
ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
|
|
117
|
-
ctx.fillStyle = `${p.c}${p.a})`;
|
|
118
|
-
ctx.fill();
|
|
119
|
-
p.x += p.vx;
|
|
120
|
-
p.y += p.vy;
|
|
121
|
-
if (p.x < 0 || p.x > W) p.vx *= -1;
|
|
122
|
-
if (p.y < 0 || p.y > H) p.vy *= -1;
|
|
123
|
-
});
|
|
124
|
-
this._raf = requestAnimationFrame(draw);
|
|
125
|
-
};
|
|
126
|
-
this._ro = new ResizeObserver(resize);
|
|
127
|
-
this._ro.observe(host);
|
|
128
|
-
resize();
|
|
129
|
-
draw();
|
|
130
|
-
}
|
|
131
|
-
_initFireflies(canvas) {
|
|
132
|
-
const ctx = canvas.getContext("2d");
|
|
133
|
-
const host = this.renderRoot.host;
|
|
134
|
-
let W = 0, H = 0;
|
|
135
|
-
const COUNT = 32;
|
|
136
|
-
const COLORS = [
|
|
137
|
-
"rgba(250,247,244,",
|
|
138
|
-
"rgba(250,247,244,",
|
|
139
|
-
"rgba(217,114,52,",
|
|
140
|
-
"rgba(78,148,130,"
|
|
141
|
-
];
|
|
142
|
-
let flies = [];
|
|
143
|
-
const resize = () => {
|
|
144
|
-
W = canvas.width = host.clientWidth;
|
|
145
|
-
H = canvas.height = host.clientHeight;
|
|
146
|
-
flies = Array.from({ length: COUNT }, () => ({
|
|
147
|
-
x: Math.random() * W,
|
|
148
|
-
y: Math.random() * H,
|
|
149
|
-
r: Math.random() * 2 + 0.8,
|
|
150
|
-
a: Math.random(),
|
|
151
|
-
da: (Math.random() * 8e-3 + 3e-3) * (Math.random() > 0.5 ? 1 : -1),
|
|
152
|
-
dx: (Math.random() - 0.5) * 0.18,
|
|
153
|
-
dy: -(Math.random() * 0.25 + 0.08),
|
|
154
|
-
phase: Math.random() * Math.PI * 2,
|
|
155
|
-
col: COLORS[Math.floor(Math.random() * COLORS.length)] ?? "rgba(250,247,244,"
|
|
156
|
-
}));
|
|
157
|
-
};
|
|
158
|
-
const draw = () => {
|
|
159
|
-
ctx.fillStyle = "rgba(8,6,4,0.14)";
|
|
160
|
-
ctx.fillRect(0, 0, W, H);
|
|
161
|
-
flies.forEach((f) => {
|
|
162
|
-
f.phase += 0.018;
|
|
163
|
-
f.a += f.da;
|
|
164
|
-
if (f.a > 1 || f.a < 0) {
|
|
165
|
-
f.da *= -1;
|
|
166
|
-
f.a = Math.max(0, Math.min(1, f.a));
|
|
167
|
-
}
|
|
168
|
-
f.x += f.dx + Math.sin(f.phase) * 0.28;
|
|
169
|
-
f.y += f.dy;
|
|
170
|
-
if (f.y < -10) {
|
|
171
|
-
f.y = H + 10;
|
|
172
|
-
f.x = Math.random() * W;
|
|
173
|
-
}
|
|
174
|
-
if (f.x < -10) f.x = W + 10;
|
|
175
|
-
if (f.x > W + 10) f.x = -10;
|
|
176
|
-
const grd = ctx.createRadialGradient(f.x, f.y, 0, f.x, f.y, f.r * 5);
|
|
177
|
-
grd.addColorStop(0, `${f.col}${f.a * 0.85})`);
|
|
178
|
-
grd.addColorStop(1, `${f.col}0)`);
|
|
179
|
-
ctx.beginPath();
|
|
180
|
-
ctx.arc(f.x, f.y, f.r * 5, 0, Math.PI * 2);
|
|
181
|
-
ctx.fillStyle = grd;
|
|
182
|
-
ctx.fill();
|
|
183
|
-
ctx.beginPath();
|
|
184
|
-
ctx.arc(f.x, f.y, f.r, 0, Math.PI * 2);
|
|
185
|
-
ctx.fillStyle = `${f.col}${f.a})`;
|
|
186
|
-
ctx.fill();
|
|
187
|
-
});
|
|
188
|
-
this._raf = requestAnimationFrame(draw);
|
|
189
|
-
};
|
|
190
|
-
this._ro = new ResizeObserver(resize);
|
|
191
|
-
this._ro.observe(host);
|
|
192
|
-
resize();
|
|
193
|
-
draw();
|
|
194
|
-
}
|
|
195
|
-
_initInkWash(canvas) {
|
|
196
|
-
const ctx = canvas.getContext("2d");
|
|
197
|
-
const host = this.renderRoot.host;
|
|
198
|
-
let W = 0, H = 0, t = 0;
|
|
199
|
-
let blobs = [];
|
|
200
|
-
const resize = () => {
|
|
201
|
-
W = canvas.width = host.clientWidth;
|
|
202
|
-
H = canvas.height = host.clientHeight;
|
|
203
|
-
const base = Math.min(W, H);
|
|
204
|
-
blobs = [
|
|
205
|
-
{ cx: 0.28, cy: 0.42, r: base * 0.24, speed: 1, offset: 0, color: "rgba(175,150,120,0.07)" },
|
|
206
|
-
{ cx: 0.68, cy: 0.58, r: base * 0.2, speed: 1.3, offset: 1.2, color: "rgba(155,135,108,0.06)" },
|
|
207
|
-
{ cx: 0.5, cy: 0.28, r: base * 0.17, speed: 0.7, offset: 2.5, color: "rgba(184,90,30,0.04)" },
|
|
208
|
-
{ cx: 0.18, cy: 0.72, r: base * 0.15, speed: 1.1, offset: 3.8, color: "rgba(78,148,130,0.04)" },
|
|
209
|
-
{ cx: 0.82, cy: 0.32, r: base * 0.13, speed: 0.85, offset: 5, color: "rgba(175,150,120,0.05)" }
|
|
210
|
-
];
|
|
211
|
-
};
|
|
212
|
-
const drawBlob = (b) => {
|
|
213
|
-
const pts = 44;
|
|
214
|
-
const phase = t * b.speed + b.offset;
|
|
215
|
-
ctx.beginPath();
|
|
216
|
-
for (let i = 0; i <= pts; i++) {
|
|
217
|
-
const angle = i / pts * Math.PI * 2;
|
|
218
|
-
const noise = Math.sin(angle * 3 + phase) * b.r * 0.14 + Math.cos(angle * 2 - phase * 0.8) * b.r * 0.09 + Math.sin(angle * 5 + phase * 1.4) * b.r * 0.05;
|
|
219
|
-
const x = b.cx * W + (b.r + noise) * Math.cos(angle);
|
|
220
|
-
const y = b.cy * H + (b.r + noise) * Math.sin(angle);
|
|
221
|
-
i === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
|
|
222
|
-
}
|
|
223
|
-
ctx.closePath();
|
|
224
|
-
ctx.fillStyle = b.color;
|
|
225
|
-
ctx.fill();
|
|
226
|
-
};
|
|
227
|
-
const draw = () => {
|
|
228
|
-
ctx.clearRect(0, 0, W, H);
|
|
229
|
-
ctx.fillStyle = "#FAF7F4";
|
|
230
|
-
ctx.fillRect(0, 0, W, H);
|
|
231
|
-
blobs.forEach(drawBlob);
|
|
232
|
-
t += 28e-4;
|
|
233
|
-
this._raf = requestAnimationFrame(draw);
|
|
234
|
-
};
|
|
235
|
-
this._ro = new ResizeObserver(resize);
|
|
236
|
-
this._ro.observe(host);
|
|
237
|
-
resize();
|
|
238
|
-
draw();
|
|
239
|
-
}
|
|
240
|
-
/* ── Canvas: Rain Lines ── */
|
|
241
|
-
_initRain(canvas) {
|
|
242
|
-
const ctx = canvas.getContext("2d");
|
|
243
|
-
const host = this.renderRoot.host;
|
|
244
|
-
let W = 0, H = 0;
|
|
245
|
-
const COUNT = 40;
|
|
246
|
-
let drops = [];
|
|
247
|
-
const resize = () => {
|
|
248
|
-
W = canvas.width = host.clientWidth;
|
|
249
|
-
H = canvas.height = host.clientHeight;
|
|
250
|
-
drops = Array.from({ length: COUNT }, () => ({
|
|
251
|
-
x: Math.random() * W,
|
|
252
|
-
y: Math.random() * H - H,
|
|
253
|
-
len: Math.random() * 22 + 8,
|
|
254
|
-
v: Math.random() * 1.8 + 0.8,
|
|
255
|
-
a: Math.random() * 0.2 + 0.04,
|
|
256
|
-
col: Math.random() > 0.85 ? "rgba(217,114,52," : "rgba(250,247,244,"
|
|
257
|
-
}));
|
|
258
|
-
};
|
|
259
|
-
const draw = () => {
|
|
260
|
-
ctx.fillStyle = "rgba(14,10,7,0.18)";
|
|
261
|
-
ctx.fillRect(0, 0, W, H);
|
|
262
|
-
drops.forEach((d) => {
|
|
263
|
-
ctx.beginPath();
|
|
264
|
-
ctx.moveTo(d.x, d.y);
|
|
265
|
-
ctx.lineTo(d.x - d.len * 0.1, d.y + d.len);
|
|
266
|
-
const g = ctx.createLinearGradient(d.x, d.y, d.x, d.y + d.len);
|
|
267
|
-
g.addColorStop(0, `${d.col}0)`);
|
|
268
|
-
g.addColorStop(0.5, `${d.col}${d.a})`);
|
|
269
|
-
g.addColorStop(1, `${d.col}0)`);
|
|
270
|
-
ctx.strokeStyle = g;
|
|
271
|
-
ctx.lineWidth = 0.8;
|
|
272
|
-
ctx.stroke();
|
|
273
|
-
d.y += d.v;
|
|
274
|
-
if (d.y > H + d.len) {
|
|
275
|
-
d.y = -d.len;
|
|
276
|
-
d.x = Math.random() * W;
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
this._raf = requestAnimationFrame(draw);
|
|
280
|
-
};
|
|
281
|
-
this._ro = new ResizeObserver(resize);
|
|
282
|
-
this._ro.observe(host);
|
|
283
|
-
resize();
|
|
284
|
-
draw();
|
|
285
|
-
}
|
|
286
|
-
/* ── Canvas: Wave Mesh ── */
|
|
287
|
-
_initWaveMesh(canvas) {
|
|
288
|
-
const ctx = canvas.getContext("2d");
|
|
289
|
-
const host = this.renderRoot.host;
|
|
290
|
-
let W = 0, H = 0, t = 0;
|
|
291
|
-
const COLS = 16, ROWS = 10;
|
|
292
|
-
const resize = () => {
|
|
293
|
-
W = canvas.width = host.clientWidth;
|
|
294
|
-
H = canvas.height = host.clientHeight;
|
|
295
|
-
};
|
|
296
|
-
const draw = () => {
|
|
297
|
-
ctx.clearRect(0, 0, W, H);
|
|
298
|
-
ctx.fillStyle = "#FAF7F4";
|
|
299
|
-
ctx.fillRect(0, 0, W, H);
|
|
300
|
-
const cw = W / (COLS - 1);
|
|
301
|
-
const ch = H / (ROWS - 1);
|
|
302
|
-
for (let r = 0; r < ROWS; r++) {
|
|
303
|
-
ctx.beginPath();
|
|
304
|
-
for (let c = 0; c < COLS; c++) {
|
|
305
|
-
const wave = Math.sin((c / COLS + t) * Math.PI * 2) * 12 + Math.cos((r / ROWS + t * 0.7) * Math.PI * 2) * 8;
|
|
306
|
-
const x = c * cw;
|
|
307
|
-
const y = r * ch + wave;
|
|
308
|
-
c === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
|
|
309
|
-
}
|
|
310
|
-
ctx.strokeStyle = `rgba(160,140,118,${0.08 + Math.sin(r / ROWS * Math.PI) * 0.06})`;
|
|
311
|
-
ctx.lineWidth = 0.8;
|
|
312
|
-
ctx.stroke();
|
|
313
|
-
}
|
|
314
|
-
for (let c = 0; c < COLS; c++) {
|
|
315
|
-
ctx.beginPath();
|
|
316
|
-
for (let r = 0; r < ROWS; r++) {
|
|
317
|
-
const wave = Math.sin((c / COLS + t) * Math.PI * 2) * 12 + Math.cos((r / ROWS + t * 0.7) * Math.PI * 2) * 8;
|
|
318
|
-
const x = c * cw;
|
|
319
|
-
const y = r * ch + wave;
|
|
320
|
-
r === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
|
|
321
|
-
}
|
|
322
|
-
ctx.strokeStyle = `rgba(160,140,118,${0.06 + Math.sin(c / COLS * Math.PI) * 0.04})`;
|
|
323
|
-
ctx.lineWidth = 0.8;
|
|
324
|
-
ctx.stroke();
|
|
325
|
-
}
|
|
326
|
-
t += 3e-3;
|
|
327
|
-
this._raf = requestAnimationFrame(draw);
|
|
328
|
-
};
|
|
329
|
-
this._ro = new ResizeObserver(resize);
|
|
330
|
-
this._ro.observe(host);
|
|
331
|
-
resize();
|
|
332
|
-
draw();
|
|
333
|
-
}
|
|
334
|
-
/* ── Canvas: Constellation ── */
|
|
335
|
-
_initConstellation(canvas) {
|
|
336
|
-
const ctx = canvas.getContext("2d");
|
|
337
|
-
const host = this.renderRoot.host;
|
|
338
|
-
let W = 0, H = 0;
|
|
339
|
-
const COUNT = 70;
|
|
340
|
-
let stars = [];
|
|
341
|
-
const resize = () => {
|
|
342
|
-
W = canvas.width = host.clientWidth;
|
|
343
|
-
H = canvas.height = host.clientHeight;
|
|
344
|
-
stars = Array.from({ length: COUNT }, () => ({
|
|
345
|
-
x: Math.random() * W,
|
|
346
|
-
y: Math.random() * H,
|
|
347
|
-
r: Math.random() * 1.2 + 0.2,
|
|
348
|
-
a: Math.random() * 0.5 + 0.1,
|
|
349
|
-
pa: Math.random() * Math.PI * 2,
|
|
350
|
-
ps: Math.random() * 8e-3 + 2e-3,
|
|
351
|
-
col: Math.random() > 0.9 ? [217, 114, 52] : Math.random() > 0.85 ? [78, 148, 130] : [250, 247, 244]
|
|
352
|
-
}));
|
|
353
|
-
};
|
|
354
|
-
const draw = () => {
|
|
355
|
-
ctx.fillStyle = "rgba(10,8,6,0.22)";
|
|
356
|
-
ctx.fillRect(0, 0, W, H);
|
|
357
|
-
for (let i = 0; i < stars.length; i++) {
|
|
358
|
-
for (let j = i + 1; j < stars.length; j++) {
|
|
359
|
-
const si = stars[i];
|
|
360
|
-
const sj = stars[j];
|
|
361
|
-
const dx = si.x - sj.x;
|
|
362
|
-
const dy = si.y - sj.y;
|
|
363
|
-
const d = Math.sqrt(dx * dx + dy * dy);
|
|
364
|
-
if (d < 110) {
|
|
365
|
-
ctx.beginPath();
|
|
366
|
-
ctx.moveTo(si.x, si.y);
|
|
367
|
-
ctx.lineTo(sj.x, sj.y);
|
|
368
|
-
ctx.strokeStyle = `rgba(250,247,244,${(1 - d / 110) * 0.07})`;
|
|
369
|
-
ctx.lineWidth = 0.6;
|
|
370
|
-
ctx.stroke();
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
stars.forEach((s) => {
|
|
375
|
-
s.pa += s.ps;
|
|
376
|
-
const pulse = Math.sin(s.pa) * 0.3 + 0.7;
|
|
377
|
-
ctx.beginPath();
|
|
378
|
-
ctx.arc(s.x, s.y, s.r * pulse, 0, Math.PI * 2);
|
|
379
|
-
ctx.fillStyle = `rgba(${s.col.join(",")},${s.a * pulse})`;
|
|
380
|
-
ctx.fill();
|
|
381
|
-
if (s.a > 0.4) {
|
|
382
|
-
ctx.beginPath();
|
|
383
|
-
ctx.arc(s.x, s.y, s.r * 3 * pulse, 0, Math.PI * 2);
|
|
384
|
-
ctx.fillStyle = `rgba(${s.col.join(",")},${s.a * 0.06 * pulse})`;
|
|
385
|
-
ctx.fill();
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
this._raf = requestAnimationFrame(draw);
|
|
389
|
-
};
|
|
390
|
-
this._ro = new ResizeObserver(resize);
|
|
391
|
-
this._ro.observe(host);
|
|
392
|
-
resize();
|
|
393
|
-
draw();
|
|
394
|
-
}
|
|
395
|
-
/* ── Render ── */
|
|
396
20
|
render() {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
});
|
|
21
|
+
const spaceValue = `var(--lib-space-${this.size}, 16px)`;
|
|
22
|
+
const styles = this.horizontal ? { width: spaceValue, height: "100%" } : { height: spaceValue, width: "100%" };
|
|
23
|
+
return html`<div style=${o(styles)}></div>`;
|
|
401
24
|
}
|
|
402
25
|
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
26
|
+
LibSpacer.styles = css`
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
flex-grow: 0;
|
|
31
|
+
}
|
|
32
|
+
:host([horizontal]) {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
407
36
|
__decorateClass([
|
|
408
|
-
property({ type: String
|
|
409
|
-
],
|
|
37
|
+
property({ type: String })
|
|
38
|
+
], LibSpacer.prototype, "size", 2);
|
|
410
39
|
__decorateClass([
|
|
411
40
|
property({ type: Boolean, reflect: true })
|
|
412
|
-
],
|
|
413
|
-
__decorateClass([
|
|
414
|
-
|
|
415
|
-
],
|
|
416
|
-
LibBackground = __decorateClass([
|
|
417
|
-
customElement("lib-background")
|
|
418
|
-
], LibBackground);
|
|
41
|
+
], LibSpacer.prototype, "horizontal", 2);
|
|
42
|
+
LibSpacer = __decorateClass([
|
|
43
|
+
customElement("lib-spacer")
|
|
44
|
+
], LibSpacer);
|
|
419
45
|
export {
|
|
420
|
-
|
|
46
|
+
LibSpacer
|
|
421
47
|
};
|
|
422
48
|
//# sourceMappingURL=index40.js.map
|