@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/index28.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { css, LitElement
|
|
2
|
-
import { property, customElement } from "lit/decorators.js";
|
|
3
|
-
import {
|
|
1
|
+
import { unsafeCSS, css, LitElement } from "lit";
|
|
2
|
+
import { property, query, customElement } from "lit/decorators.js";
|
|
3
|
+
import { counterTemplate } from "./index312.js";
|
|
4
|
+
import counterCss from "./index313.js";
|
|
5
|
+
import sharedTokens from "./index196.js";
|
|
4
6
|
var __defProp = Object.defineProperty;
|
|
5
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -11,38 +13,259 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
13
|
if (kind && result) __defProp(target, key, result);
|
|
12
14
|
return result;
|
|
13
15
|
};
|
|
14
|
-
let
|
|
16
|
+
let LibCounter = class extends LitElement {
|
|
15
17
|
constructor() {
|
|
16
18
|
super(...arguments);
|
|
19
|
+
this.value = 0;
|
|
20
|
+
this.prefix = "";
|
|
21
|
+
this.suffix = "";
|
|
22
|
+
this.thousands = ".";
|
|
23
|
+
this.decimals = null;
|
|
17
24
|
this.size = "md";
|
|
18
|
-
this.
|
|
25
|
+
this.tone = "default";
|
|
26
|
+
this.label = "";
|
|
27
|
+
this.delta = "";
|
|
28
|
+
this.deltaDir = "up";
|
|
29
|
+
this.playOnVisible = false;
|
|
30
|
+
this._builtDigitCount = -1;
|
|
31
|
+
this._builtThousands = "";
|
|
32
|
+
this._hasAnimated = false;
|
|
33
|
+
this._firstUpdate = true;
|
|
34
|
+
}
|
|
35
|
+
/* ── Lifecycle ──────────────────────────────────────────── */
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
if (this.playOnVisible) {
|
|
39
|
+
this._observer = new IntersectionObserver(
|
|
40
|
+
(entries) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (((_a = entries[0]) == null ? void 0 : _a.isIntersecting) && !this._hasAnimated) {
|
|
43
|
+
this._hasAnimated = true;
|
|
44
|
+
this._animateTo(
|
|
45
|
+
this.value,
|
|
46
|
+
/* fromZero */
|
|
47
|
+
true
|
|
48
|
+
);
|
|
49
|
+
(_b = this._observer) == null ? void 0 : _b.disconnect();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{ threshold: 0.2 }
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
var _a;
|
|
58
|
+
super.disconnectedCallback();
|
|
59
|
+
(_a = this._observer) == null ? void 0 : _a.disconnect();
|
|
19
60
|
}
|
|
20
61
|
render() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
62
|
+
return counterTemplate({
|
|
63
|
+
size: this.size,
|
|
64
|
+
tone: this.tone,
|
|
65
|
+
label: this.label,
|
|
66
|
+
delta: this.delta,
|
|
67
|
+
deltaDir: this.deltaDir
|
|
68
|
+
});
|
|
24
69
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
70
|
+
updated(changed) {
|
|
71
|
+
var _a;
|
|
72
|
+
super.updated(changed);
|
|
73
|
+
const structureChanged = changed.has("value") || changed.has("prefix") || changed.has("suffix") || changed.has("thousands") || changed.has("decimals");
|
|
74
|
+
if (!structureChanged && !this._firstUpdate) return;
|
|
75
|
+
const needRebuild = this._needsRebuild();
|
|
76
|
+
if (needRebuild) {
|
|
77
|
+
this._buildRow();
|
|
78
|
+
}
|
|
79
|
+
if (this._firstUpdate) {
|
|
80
|
+
this._firstUpdate = false;
|
|
81
|
+
if (this.playOnVisible) {
|
|
82
|
+
this._setRowInstant(0);
|
|
83
|
+
(_a = this._observer) == null ? void 0 : _a.observe(this);
|
|
84
|
+
} else {
|
|
85
|
+
this._setRowInstant(this.value);
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (changed.has("value")) {
|
|
90
|
+
this._animateTo(
|
|
91
|
+
this.value,
|
|
92
|
+
/* fromZero */
|
|
93
|
+
false
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/* ── Motor de digit-flip ────────────────────────────────── */
|
|
98
|
+
_needsRebuild() {
|
|
99
|
+
const digitCount = Math.abs(Math.floor(this.value)).toString().length;
|
|
100
|
+
if (digitCount !== this._builtDigitCount) return true;
|
|
101
|
+
if (this.thousands !== this._builtThousands) return true;
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
_buildRow() {
|
|
105
|
+
const row = this._rowEl;
|
|
106
|
+
if (!row) return;
|
|
107
|
+
row.innerHTML = "";
|
|
108
|
+
const absVal = Math.abs(Math.floor(this.value));
|
|
109
|
+
const str = absVal.toString();
|
|
110
|
+
this._builtDigitCount = str.length;
|
|
111
|
+
this._builtThousands = this.thousands;
|
|
112
|
+
if (this.prefix) {
|
|
113
|
+
const p = document.createElement("span");
|
|
114
|
+
p.className = "cnt-prefix";
|
|
115
|
+
p.textContent = this.prefix;
|
|
116
|
+
row.appendChild(p);
|
|
31
117
|
}
|
|
32
|
-
|
|
33
|
-
|
|
118
|
+
const chars = this._buildCharArray(str, this.thousands);
|
|
119
|
+
chars.forEach((c) => {
|
|
120
|
+
if (c.type === "sep") {
|
|
121
|
+
const sep = document.createElement("span");
|
|
122
|
+
sep.className = "cnt-sep";
|
|
123
|
+
sep.textContent = c.char;
|
|
124
|
+
row.appendChild(sep);
|
|
125
|
+
} else {
|
|
126
|
+
row.appendChild(this._makeDigitSlot(parseInt(c.char, 10)));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
if (this.decimals !== null) {
|
|
130
|
+
const dot = document.createElement("span");
|
|
131
|
+
dot.className = "cnt-sep";
|
|
132
|
+
dot.textContent = ",";
|
|
133
|
+
row.appendChild(dot);
|
|
134
|
+
const decStr = this.decimals.toString().padStart(2, "0");
|
|
135
|
+
for (const ch of decStr) {
|
|
136
|
+
row.appendChild(this._makeDigitSlot(parseInt(ch, 10)));
|
|
137
|
+
}
|
|
34
138
|
}
|
|
35
|
-
|
|
139
|
+
if (this.suffix) {
|
|
140
|
+
const s = document.createElement("span");
|
|
141
|
+
s.className = "cnt-suffix";
|
|
142
|
+
s.textContent = this.suffix;
|
|
143
|
+
row.appendChild(s);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
_buildCharArray(str, thousands) {
|
|
147
|
+
const result = [];
|
|
148
|
+
for (let i = 0; i < str.length; i++) {
|
|
149
|
+
const posFromRight = str.length - 1 - i;
|
|
150
|
+
if (i > 0 && posFromRight % 3 === 2 && thousands) {
|
|
151
|
+
result.push({ type: "sep", char: thousands });
|
|
152
|
+
}
|
|
153
|
+
result.push({ type: "digit", char: str[i] ?? "0" });
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
_makeDigitSlot(digit) {
|
|
158
|
+
const slot = document.createElement("span");
|
|
159
|
+
slot.className = "cnt-digit";
|
|
160
|
+
const inner = document.createElement("span");
|
|
161
|
+
inner.className = "cnt-digit-inner";
|
|
162
|
+
for (let i = 0; i <= 9; i++) {
|
|
163
|
+
const span = document.createElement("span");
|
|
164
|
+
span.textContent = String(i);
|
|
165
|
+
inner.appendChild(span);
|
|
166
|
+
}
|
|
167
|
+
inner.style.transition = "none";
|
|
168
|
+
inner.style.transform = `translateY(-${digit}em)`;
|
|
169
|
+
slot.appendChild(inner);
|
|
170
|
+
return slot;
|
|
171
|
+
}
|
|
172
|
+
_setRowInstant(value) {
|
|
173
|
+
var _a;
|
|
174
|
+
const slots = (_a = this._rowEl) == null ? void 0 : _a.querySelectorAll(".cnt-digit");
|
|
175
|
+
if (!slots) return;
|
|
176
|
+
const digits = this._extractTargetDigits(value);
|
|
177
|
+
slots.forEach((slot, i) => {
|
|
178
|
+
const inner = slot.querySelector(".cnt-digit-inner");
|
|
179
|
+
if (!inner) return;
|
|
180
|
+
inner.style.transition = "none";
|
|
181
|
+
inner.style.transform = `translateY(-${digits[i] ?? 0}em)`;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
_animateTo(value, fromZero) {
|
|
185
|
+
var _a;
|
|
186
|
+
const slots = (_a = this._rowEl) == null ? void 0 : _a.querySelectorAll(".cnt-digit");
|
|
187
|
+
if (!slots || !slots.length) return;
|
|
188
|
+
const targetDigits = this._extractTargetDigits(value);
|
|
189
|
+
const total = slots.length;
|
|
190
|
+
slots.forEach((slot, i) => {
|
|
191
|
+
const inner = slot.querySelector(".cnt-digit-inner");
|
|
192
|
+
if (!inner) return;
|
|
193
|
+
const target = targetDigits[i] ?? 0;
|
|
194
|
+
const fromRight = total - 1 - i;
|
|
195
|
+
const delay = fromRight * 40;
|
|
196
|
+
if (fromZero) {
|
|
197
|
+
inner.style.transition = "none";
|
|
198
|
+
inner.style.transform = "translateY(0)";
|
|
199
|
+
}
|
|
200
|
+
void inner.offsetHeight;
|
|
201
|
+
inner.style.transition = `transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${delay}ms`;
|
|
202
|
+
inner.style.transform = `translateY(-${target}em)`;
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
_extractTargetDigits(value) {
|
|
206
|
+
const absVal = Math.abs(Math.floor(value));
|
|
207
|
+
let str = absVal.toString();
|
|
208
|
+
if (this.decimals !== null) {
|
|
209
|
+
const decStr = this.decimals.toString().padStart(2, "0");
|
|
210
|
+
str = str + decStr;
|
|
211
|
+
}
|
|
212
|
+
return str.split("").map((c) => parseInt(c, 10));
|
|
213
|
+
}
|
|
214
|
+
/* ── Public API ─────────────────────────────────────────── */
|
|
215
|
+
/** Anima el contador a un nuevo valor manualmente. */
|
|
216
|
+
animateTo(value) {
|
|
217
|
+
this.value = value;
|
|
218
|
+
}
|
|
219
|
+
/** Reinicia la animación desde cero al valor actual. */
|
|
220
|
+
replay() {
|
|
221
|
+
this._hasAnimated = false;
|
|
222
|
+
this._animateTo(this.value, true);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
LibCounter.styles = [
|
|
226
|
+
css`${unsafeCSS(sharedTokens)}`,
|
|
227
|
+
css`${unsafeCSS(counterCss)}`
|
|
228
|
+
];
|
|
229
|
+
__decorateClass([
|
|
230
|
+
property({ type: Number, reflect: true })
|
|
231
|
+
], LibCounter.prototype, "value", 2);
|
|
232
|
+
__decorateClass([
|
|
233
|
+
property({ type: String, attribute: "prefix", reflect: true })
|
|
234
|
+
], LibCounter.prototype, "prefix", 2);
|
|
235
|
+
__decorateClass([
|
|
236
|
+
property({ type: String, attribute: "suffix", reflect: true })
|
|
237
|
+
], LibCounter.prototype, "suffix", 2);
|
|
238
|
+
__decorateClass([
|
|
239
|
+
property({ type: String, attribute: "thousands", reflect: true })
|
|
240
|
+
], LibCounter.prototype, "thousands", 2);
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ type: Number, attribute: "decimals", reflect: true })
|
|
243
|
+
], LibCounter.prototype, "decimals", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
property({ type: String, reflect: true })
|
|
246
|
+
], LibCounter.prototype, "size", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
property({ type: String, reflect: true })
|
|
249
|
+
], LibCounter.prototype, "tone", 2);
|
|
36
250
|
__decorateClass([
|
|
37
251
|
property({ type: String })
|
|
38
|
-
],
|
|
252
|
+
], LibCounter.prototype, "label", 2);
|
|
253
|
+
__decorateClass([
|
|
254
|
+
property({ type: String })
|
|
255
|
+
], LibCounter.prototype, "delta", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
property({ type: String, attribute: "delta-dir", reflect: true })
|
|
258
|
+
], LibCounter.prototype, "deltaDir", 2);
|
|
259
|
+
__decorateClass([
|
|
260
|
+
property({ type: Boolean, attribute: "play-on-visible", reflect: true })
|
|
261
|
+
], LibCounter.prototype, "playOnVisible", 2);
|
|
39
262
|
__decorateClass([
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
customElement("lib-
|
|
44
|
-
],
|
|
263
|
+
query(".cnt-row")
|
|
264
|
+
], LibCounter.prototype, "_rowEl", 2);
|
|
265
|
+
LibCounter = __decorateClass([
|
|
266
|
+
customElement("lib-counter")
|
|
267
|
+
], LibCounter);
|
|
45
268
|
export {
|
|
46
|
-
|
|
269
|
+
LibCounter
|
|
47
270
|
};
|
|
48
271
|
//# sourceMappingURL=index28.js.map
|
package/dist/index28.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index28.js","sources":["../src/components/atoms/spacer/lib-spacer.component.ts"],"sourcesContent":["// lib-spacer.component.ts\nimport { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\n@customElement('lib-spacer')\nexport class LibSpacer extends LitElement {\n @property({ type: String }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md';\n @property({ type: Boolean, reflect: true }) horizontal = false;\n\n static override styles = css`\n :host {\n display: block;\n flex-shrink: 0;\n flex-grow: 0;\n }\n :host([horizontal]) {\n display: inline-block;\n }\n `;\n\n protected override render():TemplateResult {\n // MAPEADO EXACTO A TUS TOKENS DE tokens.css\n const spaceValue = `var(--lib-space-${this.size}, 16px)`;\n \n const styles = this.horizontal \n ? { width: spaceValue, height: '100%' } \n : { height: spaceValue, width: '100%' };\n\n return html`<div style=${styleMap(styles)}></div>`;\n }\n}"],"names":["styleMap"],"mappings":";;;;;;;;;;;;;AAMO,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA;AACuB,SAAA,OAAyC;AACzB,SAAA,aAAa;AAAA,EAAA;AAAA,EAatC,SAAwB;AAEzC,UAAM,aAAa,mBAAmB,KAAK,IAAI;AAE/C,UAAM,SAAS,KAAK,aAChB,EAAE,OAAO,YAAY,QAAQ,OAAA,IAC7B,EAAE,QAAQ,YAAY,OAAO,OAAA;AAEjC,WAAO,kBAAkBA,EAAS,MAAM,CAAC;AAAA,EAC3C;AACF;AAzBa,UAIK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAHG,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GADf,UACiB,WAAA,QAAA,CAAA;AACgB,gBAAA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAF/B,UAEiC,WAAA,cAAA,CAAA;AAFjC,YAAN,gBAAA;AAAA,EADN,cAAc,YAAY;AAAA,GACd,SAAA;"}
|
|
1
|
+
{"version":3,"file":"index28.js","sources":["../src/components/atoms/lib-counter/lib-counter.component.ts"],"sourcesContent":["import { LitElement, css, unsafeCSS, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { counterTemplate } from './lib-counter.html';\nimport type { LibCounterSize, LibCounterTone, LibCounterDeltaDir } from './lib-counter.html';\nimport counterCss from './lib-counter.css?inline';\nimport sharedTokens from '../../../styles/shared/tokens.css?inline';\n\nexport type { LibCounterSize, LibCounterTone, LibCounterDeltaDir };\n\n/**\n * @element lib-counter\n *\n * Contador animado con digit-flip: cada dígito es una columna\n * de 0 a 9 que se desplaza con translateY. Los dígitos de mayor\n * peso animan antes que los de menor — efecto odómetro.\n *\n * @example — básico\n * <lib-counter value=\"24819\" label=\"Usuarios activos\" play-on-visible></lib-counter>\n *\n * @example — moneda con delta\n * <lib-counter value=\"18540\" prefix=\"€\" size=\"lg\" tone=\"kaki\"\n * label=\"Ingresos\" delta=\"+14,7%\" delta-dir=\"up\" play-on-visible>\n * </lib-counter>\n *\n * @example — porcentaje sin separador de miles\n * <lib-counter value=\"87\" suffix=\"%\" thousands=\"\" size=\"md\" play-on-visible></lib-counter>\n *\n * @example — con decimales\n * <lib-counter value=\"4\" decimals=\"73\" play-on-visible></lib-counter>\n * → renderiza 4,73\n */\n@customElement('lib-counter')\nexport class LibCounter extends LitElement {\n static override styles = [\n css`${unsafeCSS(sharedTokens)}`,\n css`${unsafeCSS(counterCss)}`,\n ];\n\n /* ── Props visuales ─────────────────────────────────────── */\n\n /** Valor numérico a mostrar. */\n @property({ type: Number, reflect: true })\n value = 0;\n\n /** Carácter prefijo (€, $, …). */\n @property({ type: String, attribute: 'prefix', reflect: true })\n override prefix = '';\n\n /** Carácter sufijo (%, k, …). */\n @property({ type: String, attribute: 'suffix', reflect: true })\n suffix = '';\n\n /** Separador de miles. Default: punto. Vacío = sin separador. */\n @property({ type: String, attribute: 'thousands', reflect: true })\n thousands = '.';\n\n /**\n * Dígitos decimales a mostrar después de coma.\n * Ejemplo: decimals=\"73\" → \",73\"\n */\n @property({ type: Number, attribute: 'decimals', reflect: true })\n decimals: number | null = null;\n\n /** Tamaño del contador. */\n @property({ type: String, reflect: true })\n size: LibCounterSize = 'md';\n\n /** Tono de color. */\n @property({ type: String, reflect: true })\n tone: LibCounterTone = 'default';\n\n /** Etiqueta inferior en font-mono uppercase. */\n @property({ type: String })\n label = '';\n\n /** Texto del indicador de variación (e.g. \"+14,7%\"). */\n @property({ type: String })\n delta = '';\n\n /** Dirección del delta — controla color e icono. */\n @property({ type: String, attribute: 'delta-dir', reflect: true })\n deltaDir: LibCounterDeltaDir = 'up';\n\n /**\n * Si está presente, el contador arranca desde 0 y anima\n * hasta `value` cuando entra en el viewport (IntersectionObserver).\n * Nombre: play-on-visible (evita colisión con HTMLElement.animate).\n */\n @property({ type: Boolean, attribute: 'play-on-visible', reflect: true })\n playOnVisible = false;\n\n /* ── Internos ───────────────────────────────────────────── */\n\n // FIX: declare evita el error de overload en decoradores strict\n @query('.cnt-row')\n declare private _rowEl: HTMLElement;\n\n private _builtDigitCount = -1;\n private _builtThousands = '';\n\n private _observer: IntersectionObserver | undefined;\n private _hasAnimated = false;\n private _firstUpdate = true;\n\n /* ── Lifecycle ──────────────────────────────────────────── */\n override connectedCallback(): void {\n super.connectedCallback();\n if (this.playOnVisible) {\n this._observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting && !this._hasAnimated) {\n this._hasAnimated = true;\n this._animateTo(this.value, /* fromZero */ true);\n this._observer?.disconnect();\n }\n },\n { threshold: 0.2 }\n );\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._observer?.disconnect();\n }\n\n override render(): TemplateResult {\n return counterTemplate({\n size: this.size,\n tone: this.tone,\n label: this.label,\n delta: this.delta,\n deltaDir: this.deltaDir,\n });\n }\n\n override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n const structureChanged =\n changed.has('value') ||\n changed.has('prefix') ||\n changed.has('suffix') ||\n changed.has('thousands') ||\n changed.has('decimals');\n\n if (!structureChanged && !this._firstUpdate) return;\n\n const needRebuild = this._needsRebuild();\n if (needRebuild) {\n this._buildRow();\n }\n\n if (this._firstUpdate) {\n this._firstUpdate = false;\n\n if (this.playOnVisible) {\n // Construir en 0 y esperar viewport\n this._setRowInstant(0);\n // FIX: cast a Element para satisfacer IntersectionObserver.observe()\n this._observer?.observe(this as unknown as Element);\n } else {\n this._setRowInstant(this.value);\n }\n return;\n }\n\n if (changed.has('value')) {\n this._animateTo(this.value, /* fromZero */ false);\n }\n }\n\n /* ── Motor de digit-flip ────────────────────────────────── */\n\n private _needsRebuild(): boolean {\n const digitCount = Math.abs(Math.floor(this.value)).toString().length;\n if (digitCount !== this._builtDigitCount) return true;\n if (this.thousands !== this._builtThousands) return true;\n return false;\n }\n\n private _buildRow(): void {\n const row = this._rowEl;\n if (!row) return;\n row.innerHTML = '';\n\n const absVal = Math.abs(Math.floor(this.value));\n const str = absVal.toString();\n this._builtDigitCount = str.length;\n this._builtThousands = this.thousands;\n\n if (this.prefix) {\n const p = document.createElement('span');\n p.className = 'cnt-prefix';\n p.textContent = this.prefix;\n row.appendChild(p);\n }\n\n const chars = this._buildCharArray(str, this.thousands);\n chars.forEach((c) => {\n if (c.type === 'sep') {\n const sep = document.createElement('span');\n sep.className = 'cnt-sep';\n sep.textContent = c.char;\n row.appendChild(sep);\n } else {\n row.appendChild(this._makeDigitSlot(parseInt(c.char, 10)));\n }\n });\n\n if (this.decimals !== null) {\n const dot = document.createElement('span');\n dot.className = 'cnt-sep';\n dot.textContent = ',';\n row.appendChild(dot);\n\n const decStr = this.decimals.toString().padStart(2, '0');\n for (const ch of decStr) {\n row.appendChild(this._makeDigitSlot(parseInt(ch, 10)));\n }\n }\n\n if (this.suffix) {\n const s = document.createElement('span');\n s.className = 'cnt-suffix';\n s.textContent = this.suffix;\n row.appendChild(s);\n }\n }\n\n private _buildCharArray(\n str: string,\n thousands: string\n ): Array<{ type: 'digit' | 'sep'; char: string }> {\n const result: Array<{ type: 'digit' | 'sep'; char: string }> = [];\n for (let i = 0; i < str.length; i++) {\n const posFromRight = str.length - 1 - i;\n if (i > 0 && posFromRight % 3 === 2 && thousands) {\n result.push({ type: 'sep', char: thousands });\n }\n // FIX: str[i] es string | undefined en TS estricto — asegurar con ?? '0'\n result.push({ type: 'digit', char: str[i] ?? '0' });\n }\n return result;\n }\n\n private _makeDigitSlot(digit: number): HTMLElement {\n const slot = document.createElement('span');\n slot.className = 'cnt-digit';\n\n const inner = document.createElement('span');\n inner.className = 'cnt-digit-inner';\n\n for (let i = 0; i <= 9; i++) {\n const span = document.createElement('span');\n span.textContent = String(i);\n inner.appendChild(span);\n }\n\n inner.style.transition = 'none';\n inner.style.transform = `translateY(-${digit}em)`;\n slot.appendChild(inner);\n return slot;\n }\n\n private _setRowInstant(value: number): void {\n const slots = this._rowEl?.querySelectorAll<HTMLElement>('.cnt-digit');\n if (!slots) return;\n const digits = this._extractTargetDigits(value);\n slots.forEach((slot, i) => {\n const inner = slot.querySelector<HTMLElement>('.cnt-digit-inner');\n if (!inner) return;\n inner.style.transition = 'none';\n inner.style.transform = `translateY(-${digits[i] ?? 0}em)`;\n });\n }\n\n private _animateTo(value: number, fromZero: boolean): void {\n const slots = this._rowEl?.querySelectorAll<HTMLElement>('.cnt-digit');\n if (!slots || !slots.length) return;\n\n const targetDigits = this._extractTargetDigits(value);\n const total = slots.length;\n\n slots.forEach((slot, i) => {\n const inner = slot.querySelector<HTMLElement>('.cnt-digit-inner');\n if (!inner) return;\n\n const target = targetDigits[i] ?? 0;\n const fromRight = total - 1 - i;\n const delay = fromRight * 40;\n\n if (fromZero) {\n inner.style.transition = 'none';\n inner.style.transform = 'translateY(0)';\n }\n\n void inner.offsetHeight; // forzar reflow\n\n inner.style.transition = `transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${delay}ms`;\n inner.style.transform = `translateY(-${target}em)`;\n });\n }\n\n private _extractTargetDigits(value: number): number[] {\n const absVal = Math.abs(Math.floor(value));\n let str = absVal.toString();\n\n if (this.decimals !== null) {\n const decStr = this.decimals.toString().padStart(2, '0');\n str = str + decStr;\n }\n\n return str.split('').map((c) => parseInt(c, 10));\n }\n\n /* ── Public API ─────────────────────────────────────────── */\n\n /** Anima el contador a un nuevo valor manualmente. */\n public animateTo(value: number): void {\n this.value = value;\n }\n\n /** Reinicia la animación desde cero al valor actual. */\n public replay(): void {\n this._hasAnimated = false;\n this._animateTo(this.value, true);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lib-counter': LibCounter;\n }\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgCO,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUL,SAAA,QAAQ;AAIR,SAAS,SAAS;AAIlB,SAAA,SAAS;AAIT,SAAA,YAAY;AAOZ,SAAA,WAA0B;AAI1B,SAAA,OAAuB;AAIvB,SAAA,OAAuB;AAIvB,SAAA,QAAQ;AAIR,SAAA,QAAQ;AAIR,SAAA,WAA+B;AAQ/B,SAAA,gBAAgB;AAQhB,SAAQ,mBAAmB;AAC3B,SAAQ,kBAAmB;AAG3B,SAAQ,eAAe;AACvB,SAAQ,eAAe;AAAA,EAAA;AAAA;AAAA,EAGd,oBAA0B;AACjC,UAAM,kBAAA;AACN,QAAI,KAAK,eAAe;AACtB,WAAK,YAAY,IAAI;AAAA,QACnB,CAAC,YAAY;;AACX,gBAAI,aAAQ,CAAC,MAAT,mBAAY,mBAAkB,CAAC,KAAK,cAAc;AACpD,iBAAK,eAAe;AACpB,iBAAK;AAAA,cAAW,KAAK;AAAA;AAAA,cAAsB;AAAA,YAAA;AAC3C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WAkBX,WAAA,UAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,aAAa,SAAS,MAAM;AAAA,GArBtD,WAsBX,WAAA,aAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,SAAS,MAAM;AAAA,GA5BrD,WA6BX,WAAA,YAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GAhC9B,WAiCX,WAAA,QAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GApC9B,WAqCX,WAAA,QAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAxCf,WAyCX,WAAA,SAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA5Cf,WA6CX,WAAA,SAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,aAAa,SAAS,MAAM;AAAA,GAhDtD,WAiDX,WAAA,YAAA,CAAA;AAQA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,mBAAmB,SAAS,MAAM;AAAA,GAxD7D,WAyDX,WAAA,iBAAA,CAAA;AAMgB,gBAAA;AAAA,EADf,MAAM,UAAU;AAAA,GA9DN,WA+DK,WAAA,UAAA,CAAA;AA/DL,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
|
package/dist/index280.js
CHANGED
|
@@ -1,45 +1,5 @@
|
|
|
1
|
-
import { nothing, html } from "lit";
|
|
2
|
-
function labelColor(step) {
|
|
3
|
-
return step <= 400 ? "rgba(26,20,14,0.45)" : "rgba(250,247,244,0.55)";
|
|
4
|
-
}
|
|
5
|
-
function colorScaleTemplate(ctx) {
|
|
6
|
-
const steps = ctx.steps ?? [];
|
|
7
|
-
const first = steps[0];
|
|
8
|
-
const last = steps[steps.length - 1];
|
|
9
|
-
return html`
|
|
10
|
-
<div class="scale-wrap">
|
|
11
|
-
|
|
12
|
-
<!-- Swatches -->
|
|
13
|
-
<div class="scale-track">
|
|
14
|
-
${steps.map((s) => html`
|
|
15
|
-
<div
|
|
16
|
-
class="scale-swatch"
|
|
17
|
-
style="background:${s.oklch ?? s.hex};"
|
|
18
|
-
title="${ctx.name}-${s.step} · ${s.hex}"
|
|
19
|
-
>
|
|
20
|
-
<span class="scale-swatch-label" style="color:${labelColor(s.step)};">
|
|
21
|
-
${s.step}
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
|
24
|
-
`)}
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<!-- Extreme labels -->
|
|
28
|
-
${ctx.showLabels && first && last ? html`
|
|
29
|
-
<div class="scale-legends">
|
|
30
|
-
<span class="scale-legend">
|
|
31
|
-
${ctx.name}-${first.step} · ${first.hex}
|
|
32
|
-
</span>
|
|
33
|
-
<span class="scale-legend scale-legend--right">
|
|
34
|
-
${ctx.name}-${last.step} · ${last.hex}
|
|
35
|
-
</span>
|
|
36
|
-
</div>
|
|
37
|
-
` : nothing}
|
|
38
|
-
|
|
39
|
-
</div>
|
|
40
|
-
`;
|
|
41
|
-
}
|
|
1
|
+
const burgerCss = '@layer tokens,reset,components;@layer reset{:host{display:inline-flex;align-items:center}*,*:before,*:after{box-sizing:border-box}button{font:inherit;background:none;border:none;padding:0;margin:0;cursor:pointer}}@layer components{.burger{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:none;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent;outline:none}.burger:focus-visible{box-shadow:0 0 0 2px var(--color-washi-50),0 0 0 4px var(--color-washi-600)}.burger-lines{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.burger-line{display:block;border-radius:var(--lib-radius-sm);background:currentcolor;transform-origin:center;will-change:transform,opacity,width}.burger-wrap{display:inline-flex;align-items:center;gap:var(--lib-space-sm);cursor:pointer}.burger-label{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-widest);text-transform:uppercase;color:var(--text-muted);transition:color var(--duration-base),opacity var(--duration-base);-webkit-user-select:none;user-select:none}.burger-wrap:hover .burger-label{color:var(--text-primary)}:host([size="sm"]) .burger-lines{width:18px;height:12px}:host([size="sm"]) .burger-line{height:1px}:host([size="sm"]) .burger-line:nth-child(1){margin-bottom:5px}:host([size="sm"]) .burger-line:nth-child(2){margin-bottom:5px}:host([size="lg"]) .burger-lines{width:36px;height:24px}:host([size="lg"]) .burger-line{height:2px}:host([size="lg"]) .burger-line:nth-child(1){margin-bottom:10px}:host([size="lg"]) .burger-line:nth-child(2){margin-bottom:10px}:host([variant="ink"]) .burger{width:44px;height:44px;color:var(--text-primary);transition:color var(--duration-base)}:host([variant="ink"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="ink"]) .burger:active{transform:scale(.94)}:host([variant="ink"]) .burger-lines{width:28px;height:18px}:host([variant="ink"]) .burger-line{height:1.5px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce)}:host([variant="ink"]) .burger-line:nth-child(1){width:20px;margin-bottom:7px}:host([variant="ink"]) .burger-line:nth-child(2){width:28px;margin-bottom:7px}:host([variant="ink"]) .burger-line:nth-child(3){width:14px}:host([variant="ink"][open]) .burger-line:nth-child(1){transform:translateY(8.5px) rotate(45deg);width:26px;transition-delay:0ms,0ms,80ms}:host([variant="ink"][open]) .burger-line:nth-child(2){opacity:0;transform:scaleX(0);transition-delay:0ms}:host([variant="ink"][open]) .burger-line:nth-child(3){transform:translateY(-8.5px) rotate(-45deg);width:26px;transition-delay:0ms,0ms,80ms}:host([variant="kanji"]) .burger{width:48px;height:48px;color:var(--text-primary);position:relative;transition:color var(--duration-base)}:host([variant="kanji"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="kanji"]) .burger:active{transform:scale(.93)}:host([variant="kanji"]) .burger:after{content:"三";position:absolute;bottom:0;left:50%;transform:translate(-50%);font-family:var(--lib-font-mono);font-size:8px;letter-spacing:0;color:var(--text-muted);transition:opacity var(--duration-base)}:host([variant="kanji"][open]) .burger:after{content:"×"}:host([variant="kanji"]) .burger-lines{width:26px;height:16px;margin-bottom:6px}:host([variant="kanji"]) .burger-line{height:1px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce)}:host([variant="kanji"]) .burger-line:nth-child(1){width:26px;margin-bottom:7px}:host([variant="kanji"]) .burger-line:nth-child(2){width:18px;margin-bottom:7px}:host([variant="kanji"]) .burger-line:nth-child(3){width:26px}:host([variant="kanji"][open]) .burger-line:nth-child(1){transform:translateY(7.5px) rotate(45deg);width:24px}:host([variant="kanji"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="kanji"][open]) .burger-line:nth-child(3){transform:translateY(-7.5px) rotate(-45deg);width:24px}:host([variant="washi"]) .burger{width:48px;height:48px;color:var(--text-primary);transition:color var(--duration-base)}:host([variant="washi"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="washi"]) .burger:active{transform:scale(.93)}:host([variant="washi"]) .burger-lines{width:28px;height:18px}:host([variant="washi"]) .burger-line{width:28px;height:1px;transition:transform var(--duration-slow) var(--ease-bounce),width var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out)}:host([variant="washi"]) .burger-line:nth-child(1){margin-bottom:8px}:host([variant="washi"]) .burger-line:nth-child(2){margin-bottom:8px}:host([variant="washi"][open]) .burger-line:nth-child(1){transform:translateY(9px) rotate(45deg);transition-delay:60ms,0ms,0ms}:host([variant="washi"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="washi"][open]) .burger-line:nth-child(3){transform:translateY(-9px) rotate(-45deg);transition-delay:60ms,0ms,0ms}:host([variant="framed"]) .burger{width:44px;height:44px;color:var(--text-primary);border:1px solid var(--border-default);transition:border-color var(--duration-base),color var(--duration-base),transform var(--duration-slow) var(--ease-bounce)}:host([variant="framed"]) .burger:hover{border-color:var(--border-strong);color:var(--color-kaki-500)}:host([variant="framed"][open]) .burger{transform:rotate(45deg);border-color:var(--color-kaki-500);color:var(--color-kaki-500)}:host([variant="framed"]) .burger-lines{width:20px;height:13px;transition:transform var(--duration-slow) var(--ease-bounce)}:host([variant="framed"][open]) .burger-lines{transform:rotate(-45deg)}:host([variant="framed"]) .burger-line{width:20px;height:1.5px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-base) var(--ease-out)}:host([variant="framed"]) .burger-line:nth-child(1){margin-bottom:5px}:host([variant="framed"]) .burger-line:nth-child(2){margin-bottom:5px}:host([variant="framed"][open]) .burger-line:nth-child(1){transform:translateY(6.75px) rotate(90deg);width:14px}:host([variant="framed"][open]) .burger-line:nth-child(2){opacity:0}:host([variant="framed"][open]) .burger-line:nth-child(3){transform:translateY(-6.75px);width:14px}:host([variant="kintsugi"]) .burger{width:48px;height:48px;color:#faf7f480;position:relative;overflow:hidden;transition:color var(--duration-base)}:host([variant="kintsugi"]) .burger:hover{color:#faf7f4cc}:host([variant="kintsugi"]) .burger:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(circle at center,rgb(217,114,52,.18) 0%,transparent 70%);opacity:0;transition:opacity var(--duration-slow)}:host([variant="kintsugi"][open]) .burger:before{opacity:1}:host([variant="kintsugi"][open]) .burger{color:var(--color-kaki-400)}:host([variant="kintsugi"]) .burger-lines{width:24px;height:16px}:host([variant="kintsugi"]) .burger-line{height:1px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce),background var(--duration-base)}:host([variant="kintsugi"]) .burger-line:nth-child(1){width:24px;margin-bottom:7px}:host([variant="kintsugi"]) .burger-line:nth-child(2){width:16px;margin-bottom:7px}:host([variant="kintsugi"]) .burger-line:nth-child(3){width:24px}:host([variant="kintsugi"][open]) .burger-line:nth-child(1){transform:translateY(7.5px) rotate(45deg);width:22px}:host([variant="kintsugi"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="kintsugi"][open]) .burger-line:nth-child(3){transform:translateY(-7.5px) rotate(-45deg);width:22px}:host([variant="glitch"]) .burger{width:52px;height:52px;color:var(--text-primary);position:relative;transition:color var(--duration-base)}:host([variant="glitch"]) .burger:hover{color:var(--color-kaki-500)}.burger-ghost{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;display:flex;align-items:center;justify-content:center;z-index:0}.burger-ghost svg{position:absolute;opacity:0}:host([variant="glitch"]) .burger:hover .ghost-a{opacity:1;animation:burger-glitch-a .32s steps(1) infinite}:host([variant="glitch"]) .burger:hover .ghost-b{opacity:1;animation:burger-glitch-b .32s steps(1) infinite;animation-delay:50ms}@keyframes burger-glitch-a{0%{clip-path:inset(0 0 70% 0);transform:translate(-3px)}25%{clip-path:inset(40% 0 40% 0);transform:translate(2px)}50%{clip-path:inset(70% 0 0 0);transform:translate(-2px)}75%{clip-path:inset(20% 0 60% 0);transform:translate(3px)}to{clip-path:inset(55% 0 20% 0);transform:translate(-3px)}}@keyframes burger-glitch-b{0%{clip-path:inset(60% 0 0 0);transform:translate(3px)}25%{clip-path:inset(0 0 60% 0);transform:translate(-2px)}50%{clip-path:inset(30% 0 50% 0);transform:translate(3px)}75%{clip-path:inset(70% 0 10% 0);transform:translate(-3px)}to{clip-path:inset(10% 0 70% 0);transform:translate(2px)}}:host([variant="glitch"]) .burger-lines{width:28px;height:18px;position:relative;z-index:1}:host([variant="glitch"]) .burger-line{width:28px;height:1.5px;position:relative;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out)}:host([variant="glitch"]) .burger-line:nth-child(1){margin-bottom:7px}:host([variant="glitch"]) .burger-line:nth-child(2){margin-bottom:7px}:host([variant="glitch"][open]) .burger-line:nth-child(1){transform:translateY(8.5px) rotate(45deg)}:host([variant="glitch"][open]) .burger-line:nth-child(2){opacity:0}:host([variant="glitch"][open]) .burger-line:nth-child(3){transform:translateY(-8.5px) rotate(-45deg)}:host([variant="glitch"]) .burger.is-scrambling .burger-line{animation:burger-scramble 80ms steps(1) 4}@keyframes burger-scramble{0%{transform:translate(-2px,1px);opacity:.7}25%{transform:translate(3px,-1px);opacity:.5}50%{transform:translate(-1px,2px);opacity:.8}75%{transform:translate(2px,-2px);opacity:.6}to{transform:translate(0);opacity:1}}}';
|
|
42
2
|
export {
|
|
43
|
-
|
|
3
|
+
burgerCss as default
|
|
44
4
|
};
|
|
45
5
|
//# sourceMappingURL=index280.js.map
|
package/dist/index280.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index280.js","sources":[
|
|
1
|
+
{"version":3,"file":"index280.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index281.js
CHANGED
|
@@ -1,103 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { classMap as e } from "./index352.js";
|
|
3
|
-
function renderSep(separator) {
|
|
4
|
-
if (separator === "chevron") {
|
|
5
|
-
return html`
|
|
6
|
-
<span class="bc-sep" aria-hidden="true">
|
|
7
|
-
<lib-icon name="caret-right" size="xs"></lib-icon>
|
|
8
|
-
</span>
|
|
9
|
-
`;
|
|
10
|
-
}
|
|
11
|
-
return html`<span class="bc-sep" aria-hidden="true"></span>`;
|
|
12
|
-
}
|
|
13
|
-
function renderIcon(icon) {
|
|
14
|
-
if (!icon) return nothing;
|
|
15
|
-
return html`<span class="bc-icon"><lib-icon name="${icon}" size="xs"></lib-icon></span>`;
|
|
16
|
-
}
|
|
17
|
-
function renderLink(item, index, separator, onNavigate) {
|
|
18
|
-
return html`
|
|
19
|
-
<li class="bc-item">
|
|
20
|
-
<a
|
|
21
|
-
class="bc-link"
|
|
22
|
-
href="${item.href ?? "#"}"
|
|
23
|
-
@click="${(e2) => {
|
|
24
|
-
e2.preventDefault();
|
|
25
|
-
onNavigate(item, index);
|
|
26
|
-
}}"
|
|
27
|
-
>
|
|
28
|
-
${renderIcon(item.icon)}
|
|
29
|
-
${item.label ? html`${item.label}` : nothing}
|
|
30
|
-
</a>
|
|
31
|
-
${renderSep(separator)}
|
|
32
|
-
</li>
|
|
33
|
-
`;
|
|
34
|
-
}
|
|
35
|
-
function renderCurrent(item) {
|
|
36
|
-
return html`
|
|
37
|
-
<li class="bc-item">
|
|
38
|
-
<span class="bc-current" aria-current="page">
|
|
39
|
-
${renderIcon(item.icon)}
|
|
40
|
-
${item.label ? html`${item.label}` : nothing}
|
|
41
|
-
</span>
|
|
42
|
-
</li>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
function renderEllipsis(separator, onExpand) {
|
|
46
|
-
return html`
|
|
47
|
-
<li class="bc-item">
|
|
48
|
-
<button
|
|
49
|
-
class="bc-ellipsis"
|
|
50
|
-
aria-label="Mostrar ruta completa"
|
|
51
|
-
@click="${onExpand}"
|
|
52
|
-
>…</button>
|
|
53
|
-
${renderSep(separator)}
|
|
54
|
-
</li>
|
|
55
|
-
`;
|
|
56
|
-
}
|
|
57
|
-
function renderItems(p) {
|
|
58
|
-
const { items, separator, maxVisible, expanded, onExpand, onNavigate } = p;
|
|
59
|
-
const shouldCollapse = maxVisible > 0 && items.length > maxVisible && !expanded;
|
|
60
|
-
if (shouldCollapse) {
|
|
61
|
-
const first = items[0];
|
|
62
|
-
const last = items[items.length - 1];
|
|
63
|
-
if (!first || !last) return [];
|
|
64
|
-
return [
|
|
65
|
-
renderLink(first, 0, separator, onNavigate),
|
|
66
|
-
renderEllipsis(separator, onExpand),
|
|
67
|
-
last.href ? renderLink(last, items.length - 1, separator, onNavigate) : renderCurrent(last)
|
|
68
|
-
];
|
|
69
|
-
}
|
|
70
|
-
return items.map((item, i) => {
|
|
71
|
-
const isLast = i === items.length - 1;
|
|
72
|
-
if (isLast || !item.href) return renderCurrent(item);
|
|
73
|
-
return renderLink(item, i, separator, onNavigate);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
function breadcrumbTemplate(p) {
|
|
77
|
-
const bcClasses = {
|
|
78
|
-
"bc": true,
|
|
79
|
-
"bc-slash": p.separator === "slash",
|
|
80
|
-
"bc-chevron": p.separator === "chevron",
|
|
81
|
-
"bc-dot": p.separator === "dot",
|
|
82
|
-
"bc-line": p.separator === "line",
|
|
83
|
-
"bc-sm": p.size === "sm",
|
|
84
|
-
"bc-lg": p.size === "lg",
|
|
85
|
-
"bc-filled": p.surface === "filled",
|
|
86
|
-
"bc-pill": p.surface === "pill",
|
|
87
|
-
"bc-kaki": p.accent === "kaki",
|
|
88
|
-
"bc-celadon": p.accent === "celadon",
|
|
89
|
-
"bc-bold": p.accent === "bold",
|
|
90
|
-
"bc-dark": p.dark
|
|
91
|
-
};
|
|
92
|
-
return html`
|
|
93
|
-
<nav class="${e(bcClasses)}" aria-label="breadcrumb">
|
|
94
|
-
<ol class="bc-list">
|
|
95
|
-
${renderItems(p)}
|
|
96
|
-
</ol>
|
|
97
|
-
</nav>
|
|
98
|
-
`;
|
|
99
|
-
}
|
|
1
|
+
const buttonCss = '@layer tokens,reset,components;@layer reset{:host{display:inline-block;vertical-align:middle}*,*:before,*:after{box-sizing:border-box}}@layer components{.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--lib-space-sm);font-family:var(--lib-font-mono);font-size:var(--text-xs);font-weight:var(--weight-medium);letter-spacing:var(--tracking-wider);text-transform:uppercase;white-space:nowrap;line-height:1;padding:var(--lib-space-sm) var(--lib-space-md);width:100%;border:var(--lib-border-width) solid transparent;border-radius:var(--radius-none);background:transparent;cursor:pointer;outline:none;text-decoration:none;position:relative;overflow:hidden;transition:background var(--duration-base) var(--ease-default),color var(--duration-base) var(--ease-default),border-color var(--duration-base) var(--ease-default),box-shadow var(--duration-base) var(--ease-default),transform var(--duration-fast) var(--ease-default)}.btn ::slotted(*){position:relative;z-index:1}.btn:active:not(:disabled){transform:translateY(1px)}:host([size="sm"]) .btn{padding:var(--lib-space-xs) var(--lib-space-sm);font-size:10px}:host([size="lg"]) .btn{padding:var(--lib-space-md) var(--lib-space-lg);font-size:var(--text-sm);letter-spacing:var(--tracking-widest)}:host([disabled]) .btn{opacity:.38;cursor:not-allowed;pointer-events:none}:host([variant="primary"]) .btn{background:var(--color-washi-900);color:var(--color-washi-50)}:host([variant="primary"]) .btn:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-kaki-400);transform:scaleX(0);transform-origin:left;transition:transform var(--duration-slow) var(--ease-out);z-index:0}:host([variant="primary"]) .btn:hover{box-shadow:var(--shadow-md)}:host([variant="primary"]) .btn:hover:after{transform:scaleX(1)}:host([variant="secondary"]) .btn{background:transparent;color:var(--text-primary);border-color:var(--border-strong)}:host([variant="secondary"]) .btn:hover{background:var(--color-washi-900);color:var(--color-washi-50);border-color:var(--color-washi-900)}:host([variant="ghost"]) .btn{background:transparent;color:var(--text-secondary)}:host([variant="ghost"]) .btn:hover{color:var(--text-primary);background:var(--color-ink-10)}:host([variant="accent"]) .btn{background:var(--color-kaki-400);color:var(--color-white)}:host([variant="accent"]) .btn:hover{background:var(--color-kaki-500);box-shadow:var(--shadow-md)}:host([variant="danger"]) .btn{background:transparent;color:var(--color-error);border-color:var(--color-error)}:host([variant="danger"]) .btn:hover{background:var(--color-error);color:var(--color-white)}:host([glass]) .btn{border-radius:var(--radius-md);-webkit-backdrop-filter:var(--lib-glass-filter);backdrop-filter:var(--lib-glass-filter);background:var(--lib-glass-bg);border:var(--lib-glass-border);box-shadow:var(--lib-glass-shadow);color:var(--lib-glass-text);text-shadow:var(--lib-glass-text-shadow)}:host([glass]) .btn:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;background:var(--lib-glass-shine);pointer-events:none;z-index:0}:host([glass]) .btn:hover{box-shadow:var(--lib-glass-shadow-hover);transform:translateY(-1px)}:host([glass][variant="primary"]) .btn{background:var(--lib-glass-bg-water);border-color:#ffffff40}:host([glass][variant="accent"]) .btn{background:var(--lib-glass-bg-kaki);border-color:#6d4d3e59}:host([glass][variant="primary"]) .btn:after{display:none}:host([variant="kintsugi"]) .btn{background:var(--color-washi-950);color:var(--color-washi-50);border-color:transparent}:host([variant="kintsugi"]) .btn:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;padding:1px;background:var(--lib-kintsugi-border);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;z-index:0}@media(hover:hover){:host([variant="kintsugi"]) .btn:hover{background:var(--color-washi-900)}}:host([variant="brutal"]) .btn{background:var(--color-washi-50);color:var(--color-ink-100);border:2px solid var(--color-ink-100);box-shadow:var(--lib-shadow-brutal);border-radius:0;transition:transform var(--duration-fast) var(--ease-default),box-shadow var(--duration-fast) var(--ease-default)}@media(hover:hover){:host([variant="brutal"]) .btn:hover{transform:translate(4px,4px);box-shadow:none}}:host([variant="brutal"]) .btn:active{transform:translate(4px,4px);box-shadow:none}.spotlight-layer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--lib-spotlight-gradient-white);transition:var(--lib-spotlight-transition);pointer-events:none;z-index:0}:host([variant="brutal"]) .spotlight-layer,:host([variant="secondary"]) .spotlight-layer,:host([variant="ghost"]) .spotlight-layer{background:var(--lib-spotlight-gradient)}}';
|
|
100
2
|
export {
|
|
101
|
-
|
|
3
|
+
buttonCss as default
|
|
102
4
|
};
|
|
103
5
|
//# sourceMappingURL=index281.js.map
|
package/dist/index281.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index281.js","sources":[
|
|
1
|
+
{"version":3,"file":"index281.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index282.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { nothing, html } from "lit";
|
|
2
|
+
function buttonTemplate(props) {
|
|
3
|
+
return html`
|
|
4
|
+
<button
|
|
5
|
+
id="${props.buttonId}"
|
|
6
|
+
type="${props.type}"
|
|
7
|
+
?disabled="${props.disabled}"
|
|
8
|
+
aria-label="${props.ariaLabel ?? nothing}"
|
|
9
|
+
style="${props.customPadding ? `padding: ${props.customPadding}` : nothing}"
|
|
10
|
+
@click="${props.handleClick}"
|
|
11
|
+
class="btn"
|
|
12
|
+
>
|
|
13
|
+
${props.spotlight ? html`<span class="spotlight-layer" aria-hidden="true"></span>` : nothing}
|
|
14
|
+
<slot name="prefix"></slot>
|
|
15
|
+
<slot></slot>
|
|
16
|
+
<slot name="suffix"></slot>
|
|
17
|
+
</button>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
2
20
|
export {
|
|
3
|
-
|
|
21
|
+
buttonTemplate
|
|
4
22
|
};
|
|
5
23
|
//# sourceMappingURL=index282.js.map
|
package/dist/index282.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index282.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index282.js","sources":["../src/components/atoms/button/lib-button.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { LibSize } from '../../../types';\nimport type { LibButtonVariant } from './lib-button.types';\n\nexport interface ButtonTemplateProps {\n buttonId: string;\n type: 'button' | 'submit' | 'reset';\n disabled: boolean;\n ariaLabel?: string | undefined;\n handleClick: (event: Event) => void;\n variant: LibButtonVariant;\n size: LibSize;\n glass: boolean;\n spotlight: boolean;\n customPadding?: string | undefined;\n}\n \n/**\n * Plantilla base para el componente lib-button.\n * Renderiza un único <button> estilizado vía :host() selectors.\n */\nexport function buttonTemplate(props: ButtonTemplateProps): TemplateResult {\n return html`\n <button\n id=\"${props.buttonId}\"\n type=\"${props.type}\"\n ?disabled=\"${props.disabled}\"\n aria-label=\"${props.ariaLabel ?? nothing}\"\n style=\"${props.customPadding ? `padding: ${props.customPadding}` : nothing}\"\n @click=\"${props.handleClick}\"\n class=\"btn\"\n >\n ${props.spotlight ? html`<span class=\"spotlight-layer\" aria-hidden=\"true\"></span>` : nothing}\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </button>\n `;\n}"],"names":[],"mappings":";AAqBO,SAAS,eAAe,OAA4C;AACzE,SAAO;AAAA;AAAA,YAEG,MAAM,QAAQ;AAAA,cACZ,MAAM,IAAI;AAAA,mBACL,MAAM,QAAQ;AAAA,oBACb,MAAM,aAAa,OAAO;AAAA,eAC/B,MAAM,gBAAgB,YAAY,MAAM,aAAa,KAAK,OAAO;AAAA,gBAChE,MAAM,WAAW;AAAA;AAAA;AAAA,QAGzB,MAAM,YAAY,iEAAiE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMlG;"}
|