@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/index294.js
CHANGED
|
@@ -1,263 +1,42 @@
|
|
|
1
1
|
import { nothing, html } from "lit";
|
|
2
|
-
|
|
3
|
-
import { styleMap as o$1 } from "./index241.js";
|
|
4
|
-
function renderFileEntry(entry, onRemove) {
|
|
5
|
-
var _a;
|
|
6
|
-
const isUploading = entry.status === "uploading";
|
|
7
|
-
const isDone = entry.status === "done";
|
|
8
|
-
const isError = entry.status === "error";
|
|
9
|
-
const rowCls = [
|
|
10
|
-
"fu-file",
|
|
11
|
-
isDone ? "is-done" : "",
|
|
12
|
-
isError ? "is-error" : "",
|
|
13
|
-
isUploading ? "is-uploading" : ""
|
|
14
|
-
].filter(Boolean).join(" ");
|
|
15
|
-
const ext = ((_a = entry.file.name.split(".").pop()) == null ? void 0 : _a.toLowerCase()) ?? "";
|
|
16
|
-
const isImg = ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext);
|
|
17
|
-
const fileSize = entry.file.size < 1024 * 1024 ? `${(entry.file.size / 1024).toFixed(0)} KB` : `${(entry.file.size / (1024 * 1024)).toFixed(1)} MB`;
|
|
2
|
+
function codeBlockTemplate(props) {
|
|
18
3
|
return html`
|
|
19
|
-
<div class="
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
></div>
|
|
25
|
-
|
|
26
|
-
<!-- Thumbnail o icono -->
|
|
27
|
-
${isImg && entry.previewUrl ? html`<img class="fu-file-thumb" src="${entry.previewUrl}" alt="${entry.file.name}">` : html`
|
|
28
|
-
<div class="fu-file-icon">
|
|
29
|
-
${isDone ? html`<lib-icon name="check-circle" weight="fill" size="sm"></lib-icon>` : isError ? html`<lib-icon name="warning-circle" weight="fill" size="sm"></lib-icon>` : html`<span class="fu-ext">${ext || "—"}</span>`}
|
|
30
|
-
</div>`}
|
|
31
|
-
|
|
32
|
-
<!-- Meta -->
|
|
33
|
-
<div class="fu-file-meta">
|
|
34
|
-
<span class="fu-file-name">${entry.file.name}</span>
|
|
35
|
-
<span class="fu-file-info">
|
|
36
|
-
<span>${fileSize}</span>
|
|
37
|
-
${isError ? html`
|
|
38
|
-
<span class="fu-file-info-sep"></span>
|
|
39
|
-
<span style="color:var(--color-error)">${entry.errorMessage ?? "Error al subir"}</span>` : nothing}
|
|
40
|
-
${isDone ? html`
|
|
41
|
-
<span class="fu-file-info-sep"></span>
|
|
42
|
-
<span style="color:var(--color-celadon-500)">Completado</span>` : nothing}
|
|
43
|
-
</span>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<!-- Acciones -->
|
|
47
|
-
<div class="fu-file-actions">
|
|
48
|
-
${isUploading ? html`
|
|
49
|
-
<span class="fu-file-pct">${entry.progress}%</span>
|
|
50
|
-
<span class="fu-spinner"></span>` : isDone ? html`<span class="fu-status-done"><lib-icon name="check-circle" weight="fill" size="sm"></lib-icon></span>` : isError ? html`<span class="fu-status-error"><lib-icon name="warning" weight="fill" size="sm"></lib-icon></span>` : nothing}
|
|
51
|
-
|
|
52
|
-
<button
|
|
53
|
-
class="fu-file-remove"
|
|
54
|
-
aria-label="Eliminar ${entry.file.name}"
|
|
55
|
-
@click="${(e) => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
onRemove(entry.id);
|
|
58
|
-
}}"
|
|
59
|
-
>
|
|
60
|
-
<lib-icon name="x" size="xs"></lib-icon>
|
|
61
|
-
</button>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
`;
|
|
65
|
-
}
|
|
66
|
-
function fileUploaderTemplate(props) {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
const {
|
|
69
|
-
zone,
|
|
70
|
-
title,
|
|
71
|
-
/*subtitle*/
|
|
72
|
-
hint,
|
|
73
|
-
multiple,
|
|
74
|
-
accept,
|
|
75
|
-
disabled,
|
|
76
|
-
isDragover,
|
|
77
|
-
entries,
|
|
78
|
-
imagePreviewUrl,
|
|
79
|
-
onDragover,
|
|
80
|
-
onDragleave,
|
|
81
|
-
onDrop,
|
|
82
|
-
onInputChange,
|
|
83
|
-
onRemove,
|
|
84
|
-
onUploadAll,
|
|
85
|
-
onClearAll,
|
|
86
|
-
onResetImage
|
|
87
|
-
} = props;
|
|
88
|
-
const doneCount = entries.filter((e) => e.status === "done").length;
|
|
89
|
-
const uploadingCount = entries.filter((e) => e.status === "uploading").length;
|
|
90
|
-
const allDone = entries.length > 0 && doneCount === entries.length;
|
|
91
|
-
const anyUploading = uploadingCount > 0;
|
|
92
|
-
if (zone === "default") {
|
|
93
|
-
return html`
|
|
94
|
-
<div class="fu-root">
|
|
95
|
-
<!-- Drop zone -->
|
|
96
|
-
<div
|
|
97
|
-
class="fu-zone ${isDragover ? "is-dragover" : ""} ${disabled ? "is-disabled" : ""}"
|
|
98
|
-
@dragover="${(e) => {
|
|
99
|
-
if (!disabled) onDragover(e);
|
|
100
|
-
}}"
|
|
101
|
-
@dragleave="${() => {
|
|
102
|
-
if (!disabled) onDragleave();
|
|
103
|
-
}}"
|
|
104
|
-
@drop="${(e) => {
|
|
105
|
-
if (!disabled) onDrop(e);
|
|
106
|
-
}}"
|
|
107
|
-
>
|
|
108
|
-
<!-- input real cubriendo toda la zona -->
|
|
109
|
-
<input
|
|
110
|
-
type="file"
|
|
111
|
-
?multiple="${multiple}"
|
|
112
|
-
accept="${accept}"
|
|
113
|
-
?disabled="${disabled}"
|
|
114
|
-
@change="${onInputChange}"
|
|
115
|
-
aria-label="${title}"
|
|
116
|
-
>
|
|
117
|
-
|
|
118
|
-
<div class="fu-zone-icon">
|
|
119
|
-
<lib-icon name="cloud-arrow-up" weight="thin" size="xl"></lib-icon>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<div>
|
|
123
|
-
<p class="fu-zone-title">${title}</p>
|
|
124
|
-
<p class="fu-zone-sub" style="margin-top:var(--lib-space-sm)">
|
|
125
|
-
o <span>busca en tu equipo</span>
|
|
126
|
-
</p>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<p class="fu-zone-hint">${hint}</p>
|
|
4
|
+
<div class="code-block">
|
|
5
|
+
<div class="code-block__header">
|
|
6
|
+
<div class="code-block__meta">
|
|
7
|
+
${props.filename ? html`<span class="code-block__filename">${props.filename}</span>` : nothing}
|
|
8
|
+
<span class="code-block__lang">${props.language}</span>
|
|
130
9
|
</div>
|
|
131
10
|
|
|
132
|
-
|
|
133
|
-
${entries.length > 0 ? html`
|
|
134
|
-
<div class="fu-list">
|
|
135
|
-
${o(entries, (entry) => renderFileEntry(entry, onRemove))}
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<!-- Footer summary -->
|
|
139
|
-
<div class="fu-summary">
|
|
140
|
-
<span class="fu-summary-text">
|
|
141
|
-
${allDone ? `${doneCount} archivo${doneCount !== 1 ? "s" : ""} subido${doneCount !== 1 ? "s" : ""}` : anyUploading ? `Subiendo ${uploadingCount} archivo${uploadingCount !== 1 ? "s" : ""}…` : `${entries.length} archivo${entries.length !== 1 ? "s" : ""} seleccionado${entries.length !== 1 ? "s" : ""}`}
|
|
142
|
-
</span>
|
|
143
|
-
<div style="display:flex;gap:var(--lib-space-sm)">
|
|
11
|
+
${props.copyable ? html`
|
|
144
12
|
<button
|
|
145
|
-
class="
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
@click="${onClearAll}"
|
|
149
|
-
>Limpiar</button>
|
|
150
|
-
<button
|
|
151
|
-
class="fu-summary-btn"
|
|
152
|
-
?disabled="${anyUploading || allDone}"
|
|
153
|
-
@click="${onUploadAll}"
|
|
13
|
+
class="code-block__copy ${props.copied ? "code-block__copy--copied" : ""}"
|
|
14
|
+
aria-label="${props.copied ? "Copiado" : "Copiar código"}"
|
|
15
|
+
@click=${props.onCopy}
|
|
154
16
|
>
|
|
155
|
-
${
|
|
17
|
+
${props.copied ? html`
|
|
18
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
19
|
+
<path d="M2 8l4 4 8-8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20
|
+
</svg>
|
|
21
|
+
<span>Copiado</span>
|
|
22
|
+
` : html`
|
|
23
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
24
|
+
<rect x="5" y="5" width="9" height="9" rx="1" stroke="currentColor" stroke-width="1.5"/>
|
|
25
|
+
<path d="M3 11H2a1 1 0 01-1-1V2a1 1 0 011-1h8a1 1 0 011 1v1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
26
|
+
</svg>
|
|
27
|
+
<span>Copiar</span>
|
|
28
|
+
`}
|
|
156
29
|
</button>
|
|
157
|
-
|
|
158
|
-
</div>
|
|
159
|
-
` : nothing}
|
|
30
|
+
` : nothing}
|
|
160
31
|
</div>
|
|
161
|
-
`;
|
|
162
|
-
}
|
|
163
|
-
if (zone === "compact") {
|
|
164
|
-
return html`
|
|
165
|
-
<div class="fu-root">
|
|
166
|
-
<div
|
|
167
|
-
class="fu-zone-sm ${isDragover ? "is-dragover" : ""} ${disabled ? "is-disabled" : ""}"
|
|
168
|
-
@dragover="${(e) => {
|
|
169
|
-
if (!disabled) onDragover(e);
|
|
170
|
-
}}"
|
|
171
|
-
@dragleave="${() => {
|
|
172
|
-
if (!disabled) onDragleave();
|
|
173
|
-
}}"
|
|
174
|
-
@drop="${(e) => {
|
|
175
|
-
if (!disabled) onDrop(e);
|
|
176
|
-
}}"
|
|
177
|
-
>
|
|
178
|
-
<input
|
|
179
|
-
type="file"
|
|
180
|
-
?multiple="${multiple}"
|
|
181
|
-
accept="${accept}"
|
|
182
|
-
?disabled="${disabled}"
|
|
183
|
-
@change="${onInputChange}"
|
|
184
|
-
aria-label="${title}"
|
|
185
|
-
>
|
|
186
|
-
|
|
187
|
-
<span class="fu-zone-sm-icon">
|
|
188
|
-
<lib-icon name="paperclip" size="md"></lib-icon>
|
|
189
|
-
</span>
|
|
190
|
-
|
|
191
|
-
<div class="fu-zone-sm-text">
|
|
192
|
-
<span class="fu-zone-sm-title">${title}</span>
|
|
193
|
-
<span class="fu-zone-sm-sub">${hint}</span>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
32
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
${o(entries, (entry) => renderFileEntry(entry, onRemove))}
|
|
200
|
-
</div>
|
|
201
|
-
` : nothing}
|
|
33
|
+
<div class="code-block__body">
|
|
34
|
+
<pre class="code-block__pre"><code class="code-block__code">${props.code}</code></pre>
|
|
202
35
|
</div>
|
|
203
|
-
`;
|
|
204
|
-
}
|
|
205
|
-
return html`
|
|
206
|
-
<div class="fu-root">
|
|
207
|
-
<div
|
|
208
|
-
class="fu-zone-img ${isDragover ? "is-dragover" : ""} ${imagePreviewUrl ? "has-preview" : ""} ${disabled ? "is-disabled" : ""}"
|
|
209
|
-
@dragover="${(e) => {
|
|
210
|
-
if (!disabled) onDragover(e);
|
|
211
|
-
}}"
|
|
212
|
-
@dragleave="${() => {
|
|
213
|
-
if (!disabled) onDragleave();
|
|
214
|
-
}}"
|
|
215
|
-
@drop="${(e) => {
|
|
216
|
-
if (!disabled) onDrop(e);
|
|
217
|
-
}}"
|
|
218
|
-
>
|
|
219
|
-
<input
|
|
220
|
-
type="file"
|
|
221
|
-
accept="image/*"
|
|
222
|
-
?disabled="${disabled || !!imagePreviewUrl}"
|
|
223
|
-
@change="${onInputChange}"
|
|
224
|
-
aria-label="${title}"
|
|
225
|
-
>
|
|
226
|
-
|
|
227
|
-
<!-- Placeholder (sin imagen) -->
|
|
228
|
-
<div class="fu-zone-img-placeholder">
|
|
229
|
-
<lib-icon name="image" weight="thin" size="xl" style="color:var(--text-muted)"></lib-icon>
|
|
230
|
-
<p class="fu-zone-sub">${title}</p>
|
|
231
|
-
<p class="fu-zone-hint">${hint}</p>
|
|
232
|
-
</div>
|
|
233
|
-
|
|
234
|
-
<!-- Preview (con imagen) -->
|
|
235
|
-
${imagePreviewUrl ? html`<img class="fu-zone-img-preview" src="${imagePreviewUrl}" alt="Preview">` : nothing}
|
|
236
|
-
|
|
237
|
-
<!-- Overlay de reemplazo -->
|
|
238
|
-
${imagePreviewUrl ? html`
|
|
239
|
-
<div class="fu-zone-img-overlay">
|
|
240
|
-
<lib-icon name="camera" size="md" style="color:#fff"></lib-icon>
|
|
241
|
-
<span class="fu-zone-img-overlay-text">Cambiar imagen</span>
|
|
242
|
-
</div>` : nothing}
|
|
243
|
-
</div>
|
|
244
|
-
|
|
245
|
-
<!-- Barra de progreso debajo de la zona imagen -->
|
|
246
|
-
${entries.length > 0 && ((_a = entries[0]) == null ? void 0 : _a.status) === "uploading" ? html`
|
|
247
|
-
<div class="fu-progress-bar">
|
|
248
|
-
<div class="fu-progress-fill" style="width:${((_b = entries[0]) == null ? void 0 : _b.progress) ?? 0}%"></div>
|
|
249
|
-
</div>` : nothing}
|
|
250
|
-
|
|
251
|
-
${imagePreviewUrl ? html`
|
|
252
|
-
<div style="display:flex;justify-content:flex-end;margin-top:var(--lib-space-sm)">
|
|
253
|
-
<button class="fu-file-remove" style="width:auto;padding:0 var(--lib-space-sm);border-radius:0;border:1px solid var(--border-default);font-family:var(--lib-font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase" @click="${onResetImage}">
|
|
254
|
-
Eliminar
|
|
255
|
-
</button>
|
|
256
|
-
</div>` : nothing}
|
|
257
36
|
</div>
|
|
258
37
|
`;
|
|
259
38
|
}
|
|
260
39
|
export {
|
|
261
|
-
|
|
40
|
+
codeBlockTemplate
|
|
262
41
|
};
|
|
263
42
|
//# sourceMappingURL=index294.js.map
|
package/dist/index294.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index294.js","sources":["../src/components/molecules/file-uploader/lib-file-uploader.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport { map } from 'lit/directives/map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport type { FileEntry, FileUploaderTemplateProps } from './lib-file-uploader.types';\n\n/* ================================================================\n FILE ENTRY — una fila en la lista\n ================================================================ */\n\nfunction renderFileEntry(\n entry: FileEntry,\n onRemove: (id: string) => void,\n): TemplateResult {\n const isUploading = entry.status === 'uploading';\n const isDone = entry.status === 'done';\n const isError = entry.status === 'error';\n\n const rowCls = [\n 'fu-file',\n isDone ? 'is-done' : '',\n isError ? 'is-error' : '',\n isUploading ? 'is-uploading' : '',\n ].filter(Boolean).join(' ');\n\n /* Icono o thumbnail para imágenes */\n const ext = entry.file.name.split('.').pop()?.toLowerCase() ?? '';\n const isImg = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'].includes(ext);\n\n const fileSize = entry.file.size < 1024 * 1024\n ? `${(entry.file.size / 1024).toFixed(0)} KB`\n : `${(entry.file.size / (1024 * 1024)).toFixed(1)} MB`;\n\n return html`\n <div class=\"${rowCls}\">\n <!-- Progress background -->\n <div\n class=\"fu-file-prog-bg\"\n style=\"${styleMap({ width: isUploading ? `${entry.progress}%` : isDone ? '100%' : '0%' })}\"\n ></div>\n\n <!-- Thumbnail o icono -->\n ${isImg && entry.previewUrl\n ? html`<img class=\"fu-file-thumb\" src=\"${entry.previewUrl}\" alt=\"${entry.file.name}\">`\n : html`\n <div class=\"fu-file-icon\">\n ${isDone\n ? html`<lib-icon name=\"check-circle\" weight=\"fill\" size=\"sm\"></lib-icon>`\n : isError\n ? html`<lib-icon name=\"warning-circle\" weight=\"fill\" size=\"sm\"></lib-icon>`\n : html`<span class=\"fu-ext\">${ext || '—'}</span>`}\n </div>`}\n\n <!-- Meta -->\n <div class=\"fu-file-meta\">\n <span class=\"fu-file-name\">${entry.file.name}</span>\n <span class=\"fu-file-info\">\n <span>${fileSize}</span>\n ${isError\n ? html`\n <span class=\"fu-file-info-sep\"></span>\n <span style=\"color:var(--color-error)\">${entry.errorMessage ?? 'Error al subir'}</span>`\n : nothing}\n ${isDone\n ? html`\n <span class=\"fu-file-info-sep\"></span>\n <span style=\"color:var(--color-celadon-500)\">Completado</span>`\n : nothing}\n </span>\n </div>\n\n <!-- Acciones -->\n <div class=\"fu-file-actions\">\n ${isUploading\n ? html`\n <span class=\"fu-file-pct\">${entry.progress}%</span>\n <span class=\"fu-spinner\"></span>`\n : isDone\n ? html`<span class=\"fu-status-done\"><lib-icon name=\"check-circle\" weight=\"fill\" size=\"sm\"></lib-icon></span>`\n : isError\n ? html`<span class=\"fu-status-error\"><lib-icon name=\"warning\" weight=\"fill\" size=\"sm\"></lib-icon></span>`\n : nothing}\n\n <button\n class=\"fu-file-remove\"\n aria-label=\"Eliminar ${entry.file.name}\"\n @click=\"${(e: Event): void => { e.stopPropagation(); onRemove(entry.id); }}\"\n >\n <lib-icon name=\"x\" size=\"xs\"></lib-icon>\n </button>\n </div>\n </div>\n `;\n}\n\n/* ================================================================\n TEMPLATE PRINCIPAL\n ================================================================ */\n\nexport function fileUploaderTemplate(props: FileUploaderTemplateProps): TemplateResult {\n const {\n zone, title, /*subtitle*/ hint, multiple, accept, disabled,\n isDragover, entries, imagePreviewUrl,\n onDragover, onDragleave, onDrop, onInputChange, onRemove,\n onUploadAll, onClearAll, onResetImage,\n } = props;\n\n const doneCount = entries.filter(e => e.status === 'done').length;\n const uploadingCount = entries.filter(e => e.status === 'uploading').length;\n const allDone = entries.length > 0 && doneCount === entries.length;\n const anyUploading = uploadingCount > 0;\n\n /* ────────────────────────────────────\n VARIANTE: default (zona grande)\n ──────────────────────────────────── */\n if (zone === 'default') {\n return html`\n <div class=\"fu-root\">\n <!-- Drop zone -->\n <div\n class=\"fu-zone ${isDragover ? 'is-dragover' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <!-- input real cubriendo toda la zona -->\n <input\n type=\"file\"\n ?multiple=\"${multiple}\"\n accept=\"${accept}\"\n ?disabled=\"${disabled}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <div class=\"fu-zone-icon\">\n <lib-icon name=\"cloud-arrow-up\" weight=\"thin\" size=\"xl\"></lib-icon>\n </div>\n\n <div>\n <p class=\"fu-zone-title\">${title}</p>\n <p class=\"fu-zone-sub\" style=\"margin-top:var(--lib-space-sm)\">\n o <span>busca en tu equipo</span>\n </p>\n </div>\n\n <p class=\"fu-zone-hint\">${hint}</p>\n </div>\n\n <!-- Lista de archivos -->\n ${entries.length > 0 ? html`\n <div class=\"fu-list\">\n ${map(entries, (entry: FileEntry) => renderFileEntry(entry, onRemove))}\n </div>\n\n <!-- Footer summary -->\n <div class=\"fu-summary\">\n <span class=\"fu-summary-text\">\n ${allDone\n ? `${doneCount} archivo${doneCount !== 1 ? 's' : ''} subido${doneCount !== 1 ? 's' : ''}`\n : anyUploading\n ? `Subiendo ${uploadingCount} archivo${uploadingCount !== 1 ? 's' : ''}…`\n : `${entries.length} archivo${entries.length !== 1 ? 's' : ''} seleccionado${entries.length !== 1 ? 's' : ''}`}\n </span>\n <div style=\"display:flex;gap:var(--lib-space-sm)\">\n <button\n class=\"fu-summary-btn\"\n style=\"background:transparent;color:var(--text-muted);border:1px solid var(--border-default)\"\n ?disabled=\"${anyUploading}\"\n @click=\"${onClearAll}\"\n >Limpiar</button>\n <button\n class=\"fu-summary-btn\"\n ?disabled=\"${anyUploading || allDone}\"\n @click=\"${onUploadAll}\"\n >\n ${anyUploading ? 'Subiendo…' : 'Subir todo'}\n </button>\n </div>\n </div>\n ` : nothing}\n </div>\n `;\n }\n\n /* ────────────────────────────────────\n VARIANTE: compact (horizontal)\n ──────────────────────────────────── */\n if (zone === 'compact') {\n return html`\n <div class=\"fu-root\">\n <div\n class=\"fu-zone-sm ${isDragover ? 'is-dragover' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <input\n type=\"file\"\n ?multiple=\"${multiple}\"\n accept=\"${accept}\"\n ?disabled=\"${disabled}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <span class=\"fu-zone-sm-icon\">\n <lib-icon name=\"paperclip\" size=\"md\"></lib-icon>\n </span>\n\n <div class=\"fu-zone-sm-text\">\n <span class=\"fu-zone-sm-title\">${title}</span>\n <span class=\"fu-zone-sm-sub\">${hint}</span>\n </div>\n </div>\n\n ${entries.length > 0 ? html`\n <div class=\"fu-list\" style=\"margin-top:1px\">\n ${map(entries, (entry: FileEntry) => renderFileEntry(entry, onRemove))}\n </div>\n ` : nothing}\n </div>\n `;\n }\n\n /* ────────────────────────────────────\n VARIANTE: image (preview inline)\n ──────────────────────────────────── */\n return html`\n <div class=\"fu-root\">\n <div\n class=\"fu-zone-img ${isDragover ? 'is-dragover' : ''} ${imagePreviewUrl ? 'has-preview' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <input\n type=\"file\"\n accept=\"image/*\"\n ?disabled=\"${disabled || !!imagePreviewUrl}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <!-- Placeholder (sin imagen) -->\n <div class=\"fu-zone-img-placeholder\">\n <lib-icon name=\"image\" weight=\"thin\" size=\"xl\" style=\"color:var(--text-muted)\"></lib-icon>\n <p class=\"fu-zone-sub\">${title}</p>\n <p class=\"fu-zone-hint\">${hint}</p>\n </div>\n\n <!-- Preview (con imagen) -->\n ${imagePreviewUrl\n ? html`<img class=\"fu-zone-img-preview\" src=\"${imagePreviewUrl}\" alt=\"Preview\">`\n : nothing}\n\n <!-- Overlay de reemplazo -->\n ${imagePreviewUrl\n ? html`\n <div class=\"fu-zone-img-overlay\">\n <lib-icon name=\"camera\" size=\"md\" style=\"color:#fff\"></lib-icon>\n <span class=\"fu-zone-img-overlay-text\">Cambiar imagen</span>\n </div>`\n : nothing}\n </div>\n\n <!-- Barra de progreso debajo de la zona imagen -->\n ${entries.length > 0 && entries[0]?.status === 'uploading'\n ? html`\n <div class=\"fu-progress-bar\">\n <div class=\"fu-progress-fill\" style=\"width:${entries[0]?.progress ?? 0}%\"></div>\n </div>`\n : nothing}\n\n ${imagePreviewUrl\n ? html`\n <div style=\"display:flex;justify-content:flex-end;margin-top:var(--lib-space-sm)\">\n <button class=\"fu-file-remove\" style=\"width:auto;padding:0 var(--lib-space-sm);border-radius:0;border:1px solid var(--border-default);font-family:var(--lib-font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase\" @click=\"${onResetImage}\">\n Eliminar\n </button>\n </div>`\n : nothing}\n </div>\n `;\n}"],"names":["styleMap","map"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index294.js","sources":["../src/components/atoms/code-block/lib-code-block.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\n\nexport type LibCodeBlockLanguage =\n | 'bash'\n | 'ts'\n | 'js'\n | 'html'\n | 'css'\n | 'json'\n | 'text';\n\nexport interface CodeBlockTemplateProps {\n code: string;\n language: LibCodeBlockLanguage;\n copyable: boolean;\n copied: boolean;\n filename: string;\n onCopy: () => void;\n}\n\nexport function codeBlockTemplate(props: CodeBlockTemplateProps): TemplateResult {\n return html`\n <div class=\"code-block\">\n <div class=\"code-block__header\">\n <div class=\"code-block__meta\">\n ${props.filename\n ? html`<span class=\"code-block__filename\">${props.filename}</span>`\n : nothing}\n <span class=\"code-block__lang\">${props.language}</span>\n </div>\n\n ${props.copyable\n ? html`\n <button\n class=\"code-block__copy ${props.copied ? 'code-block__copy--copied' : ''}\"\n aria-label=\"${props.copied ? 'Copiado' : 'Copiar código'}\"\n @click=${props.onCopy}\n >\n ${props.copied\n ? html`\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2 8l4 4 8-8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n <span>Copiado</span>\n `\n : html`\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"5\" width=\"9\" height=\"9\" rx=\"1\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n <path d=\"M3 11H2a1 1 0 01-1-1V2a1 1 0 011-1h8a1 1 0 011 1v1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n </svg>\n <span>Copiar</span>\n `}\n </button>\n `\n : nothing}\n </div>\n\n <div class=\"code-block__body\">\n <pre class=\"code-block__pre\"><code class=\"code-block__code\">${props.code}</code></pre>\n </div>\n </div>\n `;\n}"],"names":[],"mappings":";AAoBO,SAAS,kBAAkB,OAA+C;AAC/E,SAAO;AAAA;AAAA;AAAA;AAAA,YAIG,MAAM,WACJ,0CAA0C,MAAM,QAAQ,YACxD,OAAO;AAAA,2CACsB,MAAM,QAAQ;AAAA;AAAA;AAAA,UAG/C,MAAM,WACJ;AAAA;AAAA,0CAE8B,MAAM,SAAS,6BAA6B,EAAE;AAAA,8BAC1D,MAAM,SAAS,YAAY,eAAe;AAAA,yBAC/C,MAAM,MAAM;AAAA;AAAA,kBAEnB,MAAM,SACJ;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAMC;AAAA;AAAA,gBAGT,OAAO;AAAA;AAAA;AAAA;AAAA,sEAImD,MAAM,IAAI;AAAA;AAAA;AAAA;AAIhF;"}
|
package/dist/index295.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const codeBlockCss = '@layer tokens,reset,components;@layer reset{:host{display:block}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}}@layer components{.code-block{display:flex;flex-direction:column;border:var(--lib-border-width) solid var(--color-ink-100);border-radius:var(--lib-radius-md);background:var(--color-washi-950);box-shadow:var(--lib-shadow-brutal);overflow:hidden;width:100%}.code-block__header{display:flex;align-items:center;justify-content:space-between;padding:var(--lib-space-xs) var(--lib-space-md);background:var(--color-washi-900);border-bottom:var(--lib-border-width) solid var(--color-ink-40);min-height:36px;gap:var(--lib-space-md)}.code-block__meta{display:flex;align-items:center;gap:var(--lib-space-sm)}.code-block__filename{font-family:var(--lib-font-mono);font-size:var(--text-sm);color:var(--color-washi-200);letter-spacing:var(--tracking-normal)}.code-block__lang{font-family:var(--lib-font-mono);font-size:10px;font-weight:var(--weight-medium);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-washi-500);background:var(--color-washi-800);border:var(--lib-border-width) solid var(--color-washi-700);border-radius:var(--lib-radius-xs);padding:1px var(--lib-space-xs)}.code-block__copy{display:inline-flex;align-items:center;gap:var(--lib-space-xs);font-family:var(--lib-font-mono);font-size:11px;font-weight:var(--weight-medium);letter-spacing:var(--tracking-wide);text-transform:uppercase;color:var(--color-washi-400);background:transparent;border:var(--lib-border-width) solid var(--color-washi-700);border-radius:var(--lib-radius-xs);padding:3px var(--lib-space-sm);cursor:pointer;transition:color var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out);white-space:nowrap;flex-shrink:0}.code-block__copy:hover{color:var(--color-washi-100);border-color:var(--color-washi-400);background:var(--color-washi-800)}.code-block__copy:active{transform:scale(.97)}.code-block__copy--copied{color:var(--color-celadon-300);border-color:var(--color-celadon-600)}.code-block__copy--copied:hover{color:var(--color-celadon-300);border-color:var(--color-celadon-500);background:transparent}.code-block__body{overflow-x:auto;padding:var(--lib-space-md) var(--lib-space-lg)}.code-block__pre{font-family:var(--lib-font-mono);font-size:var(--text-sm);line-height:var(--leading-relaxed);color:var(--color-washi-100);white-space:pre;-moz-tab-size:2;tab-size:2}.code-block__code{font-family:inherit;font-size:inherit;color:inherit}:host([variant="ghost"]) .code-block{background:var(--color-washi-100);box-shadow:none}:host([variant="ghost"]) .code-block__header{background:var(--color-washi-200);border-bottom-color:var(--color-washi-300)}:host([variant="ghost"]) .code-block__lang{background:var(--color-washi-100);border-color:var(--color-washi-300);color:var(--color-washi-600)}:host([variant="ghost"]) .code-block__copy{color:var(--color-washi-600);border-color:var(--color-washi-300)}:host([variant="ghost"]) .code-block__copy:hover{color:var(--color-washi-800);border-color:var(--color-washi-500);background:var(--color-washi-200)}:host([variant="ghost"]) .code-block__pre{color:var(--color-washi-800)}}';
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
codeBlockCss as default
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=index295.js.map
|
package/dist/index296.js
CHANGED
|
@@ -1,75 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { map as o } from "./index301.js";
|
|
3
|
-
function segmentedTemplate(props) {
|
|
4
|
-
const {
|
|
5
|
-
options,
|
|
6
|
-
value,
|
|
7
|
-
variant,
|
|
8
|
-
size,
|
|
9
|
-
full,
|
|
10
|
-
iconOnly,
|
|
11
|
-
disabled,
|
|
12
|
-
glitch,
|
|
13
|
-
thumbStyle,
|
|
14
|
-
onSelect
|
|
15
|
-
} = props;
|
|
16
|
-
const isGhost = variant === "ghost";
|
|
17
|
-
const trackCls = [
|
|
18
|
-
"seg",
|
|
19
|
-
`seg-${variant}`,
|
|
20
|
-
size !== "md" ? `seg-${size}` : "",
|
|
21
|
-
full ? "seg-full" : "",
|
|
22
|
-
iconOnly ? "seg-icon-only" : "",
|
|
23
|
-
glitch ? "seg-glitch" : ""
|
|
24
|
-
].filter(Boolean).join(" ");
|
|
25
|
-
return html`
|
|
26
|
-
<div
|
|
27
|
-
class="${trackCls}"
|
|
28
|
-
role="radiogroup"
|
|
29
|
-
aria-disabled="${disabled}"
|
|
30
|
-
>
|
|
31
|
-
<!-- Thumb — indicador animado de selección -->
|
|
32
|
-
${isGhost ? nothing : html`<div class="seg-thumb" style="${thumbStyle}"></div>`}
|
|
33
|
-
|
|
34
|
-
<!-- Opciones -->
|
|
35
|
-
${o(options, (opt) => {
|
|
36
|
-
const isActive = opt.value === value;
|
|
37
|
-
const isDisabled = opt.disabled ?? false;
|
|
38
|
-
const optCls = [
|
|
39
|
-
"seg-option",
|
|
40
|
-
isActive ? "is-active" : "",
|
|
41
|
-
isDisabled ? "is-disabled" : ""
|
|
42
|
-
].filter(Boolean).join(" ");
|
|
43
|
-
return html`
|
|
44
|
-
<div
|
|
45
|
-
class="${optCls}"
|
|
46
|
-
role="radio"
|
|
47
|
-
aria-checked="${isActive}"
|
|
48
|
-
aria-disabled="${isDisabled}"
|
|
49
|
-
data-label="${opt.label}"
|
|
50
|
-
data-value="${opt.value}"
|
|
51
|
-
@click="${(e) => {
|
|
52
|
-
if (disabled || isDisabled) return;
|
|
53
|
-
onSelect(opt, e);
|
|
54
|
-
}}"
|
|
55
|
-
>
|
|
56
|
-
<!-- Icono Phosphor (slot reutilizando lib-icon) -->
|
|
57
|
-
${opt.icon ? html`<span class="seg-icon">
|
|
58
|
-
<lib-icon name="${opt.icon}" size="xs"></lib-icon>
|
|
59
|
-
</span>` : nothing}
|
|
60
|
-
|
|
61
|
-
<!-- Label — oculto si icon-only -->
|
|
62
|
-
${iconOnly ? nothing : html`<span class="seg-label">${opt.label}</span>`}
|
|
63
|
-
|
|
64
|
-
<!-- Badge numérico opcional -->
|
|
65
|
-
${opt.badge != null ? html`<span class="seg-badge-dot">${opt.badge}</span>` : nothing}
|
|
66
|
-
</div>
|
|
67
|
-
`;
|
|
68
|
-
})}
|
|
69
|
-
</div>
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
1
|
+
const colorScaleStyles = '@layer tokens,reset,components;@layer reset{:host{display:block}*,*:before,*:after{box-sizing:border-box}}@layer components{.scale-wrap{display:flex;flex-direction:column;gap:var(--lib-space-sm, .5rem);width:100%}.scale-track{display:flex;width:100%;height:var(--lib-color-scale-height, 56px);overflow:hidden}.scale-swatch{flex:1;position:relative;display:flex;align-items:flex-end;justify-content:center;padding-bottom:var(--lib-space-xs, .25rem);cursor:default;transition:flex var(--duration-slow, .35s) var(--ease-out, cubic-bezier(0,0,.2,1)),filter var(--duration-base, .2s) var(--ease-out, cubic-bezier(0,0,.2,1))}.scale-track:has(.scale-swatch:hover) .scale-swatch{flex:.7}.scale-track .scale-swatch:hover{flex:1.8;filter:brightness(1.06)}.scale-swatch-label{font-family:var(--lib-font-mono, "DM Mono", monospace);font-size:.6rem;letter-spacing:.1em;line-height:1;opacity:0;transform:translateY(4px);transition:opacity var(--duration-base, .2s) var(--ease-out, cubic-bezier(0,0,.2,1)),transform var(--duration-base, .2s) var(--ease-out, cubic-bezier(0,0,.2,1));pointer-events:none;-webkit-user-select:none;user-select:none}.scale-swatch:hover .scale-swatch-label{opacity:1;transform:translateY(0)}.scale-legends{display:flex;justify-content:space-between;align-items:center}.scale-legend{font-family:var(--lib-font-mono, "DM Mono", monospace);font-size:.6rem;letter-spacing:.12em;text-transform:lowercase;color:var(--text-muted, var(--color-washi-400, #B8A99A));white-space:nowrap}@supports not selector(:has(a)){.scale-swatch:hover{flex:1.8}}@media(prefers-reduced-motion:reduce){.scale-swatch,.scale-swatch-label{transition:none}}}';
|
|
72
2
|
export {
|
|
73
|
-
|
|
3
|
+
colorScaleStyles as default
|
|
74
4
|
};
|
|
75
5
|
//# sourceMappingURL=index296.js.map
|
package/dist/index296.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index296.js","sources":[
|
|
1
|
+
{"version":3,"file":"index296.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index297.js
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
|
-
|
|
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
|
+
}
|
|
2
42
|
export {
|
|
3
|
-
|
|
43
|
+
colorScaleTemplate
|
|
4
44
|
};
|
|
5
45
|
//# sourceMappingURL=index297.js.map
|
package/dist/index297.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index297.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index297.js","sources":["../src/components/atoms/color-scale/lib-color-scale.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { LibColorScale } from './lib-color-scale.component';\nimport type { ColorStep } from './lib-color-scale.types';\n\n/**\n * Determina si el label del paso debe mostrarse en color claro u oscuro\n * según el luminance aproximado del paso (por encima de 500 → oscuro, por debajo → claro).\n */\nfunction labelColor(step: number): string {\n return step <= 400\n ? 'rgba(26,20,14,0.45)' /* sobre claro */\n : 'rgba(250,247,244,0.55)'; /* sobre oscuro */\n}\n\nexport function colorScaleTemplate(ctx: LibColorScale): TemplateResult {\n const steps = ctx.steps ?? [];\n const first = steps[0];\n const last = steps[steps.length - 1];\n\n return html`\n <div class=\"scale-wrap\">\n\n <!-- Swatches -->\n <div class=\"scale-track\">\n ${steps.map((s: ColorStep) => html`\n <div\n class=\"scale-swatch\"\n style=\"background:${s.oklch ?? s.hex};\"\n title=\"${ctx.name}-${s.step} · ${s.hex}\"\n >\n <span class=\"scale-swatch-label\" style=\"color:${labelColor(s.step)};\">\n ${s.step}\n </span>\n </div>\n `)}\n </div>\n\n <!-- Extreme labels -->\n ${ctx.showLabels && first && last ? html`\n <div class=\"scale-legends\">\n <span class=\"scale-legend\">\n ${ctx.name}-${first.step} · ${first.hex}\n </span>\n <span class=\"scale-legend scale-legend--right\">\n ${ctx.name}-${last.step} · ${last.hex}\n </span>\n </div>\n ` : nothing}\n\n </div>\n `;\n}"],"names":[],"mappings":";AAQA,SAAS,WAAW,MAAsB;AACxC,SAAO,QAAQ,MACX,wBACA;AACN;AAEO,SAAS,mBAAmB,KAAoC;AACrE,QAAM,QAAQ,IAAI,SAAS,CAAA;AAC3B,QAAM,QAAQ,MAAM,CAAC;AACrB,QAAM,OAAQ,MAAM,MAAM,SAAS,CAAC;AAEpC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,UAKC,MAAM,IAAI,CAAC,MAAiB;AAAA;AAAA;AAAA,gCAGN,EAAE,SAAS,EAAE,GAAG;AAAA,qBAC3B,IAAI,IAAI,IAAI,EAAE,IAAI,MAAM,EAAE,GAAG;AAAA;AAAA,4DAEU,WAAW,EAAE,IAAI,CAAC;AAAA,gBAC9D,EAAE,IAAI;AAAA;AAAA;AAAA,SAGb,CAAC;AAAA;AAAA;AAAA;AAAA,QAIF,IAAI,cAAc,SAAS,OAAO;AAAA;AAAA;AAAA,cAG5B,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA,cAGrC,IAAI,IAAI,IAAI,KAAK,IAAI,MAAM,KAAK,GAAG;AAAA;AAAA;AAAA,UAGvC,OAAO;AAAA;AAAA;AAAA;AAIjB;"}
|
package/dist/index298.js
CHANGED
|
@@ -1,69 +1,20 @@
|
|
|
1
1
|
import { nothing, html } from "lit";
|
|
2
|
-
function
|
|
3
|
-
const inputType = props.type === "password" && props.showPassword ? "text" : props.type;
|
|
2
|
+
function rendercontentPillar(ctx) {
|
|
4
3
|
return html`
|
|
5
|
-
<div class="
|
|
4
|
+
<div class="pillar" part="pillar">
|
|
6
5
|
|
|
7
|
-
${
|
|
8
|
-
<label
|
|
9
|
-
class="input-label"
|
|
10
|
-
for="${props.uuid}"
|
|
11
|
-
>
|
|
12
|
-
${props.label}
|
|
13
|
-
${props.required ? html`<span class="input-required" aria-hidden="true">*</span>` : nothing}
|
|
14
|
-
</label>
|
|
15
|
-
` : nothing}
|
|
6
|
+
${ctx.kanji ? html`<div class="pillar-kanji" part="kanji" aria-hidden="true">${ctx.kanji}</div>` : nothing}
|
|
16
7
|
|
|
17
|
-
<div class="
|
|
18
|
-
|
|
8
|
+
<div class="pillar-body" part="body">
|
|
9
|
+
${ctx.label ? html`<p class="pillar-label" part="label">${ctx.label}</p>` : nothing}
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
id="${props.uuid}"
|
|
22
|
-
type="${inputType}"
|
|
23
|
-
placeholder="${props.placeholder}"
|
|
24
|
-
?required="${props.required}"
|
|
25
|
-
?disabled="${props.disabled}"
|
|
26
|
-
aria-invalid="${props.error}"
|
|
27
|
-
aria-describedby="${props.error && props.errorMessage ? `${props.uuid}-error` : nothing}"
|
|
28
|
-
.value="${props.value}"
|
|
29
|
-
@input="${props.handleInput}"
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
${props.type === "password" ? html`
|
|
33
|
-
<button
|
|
34
|
-
class="input-password-toggle"
|
|
35
|
-
type="button"
|
|
36
|
-
@click="${props.handleTogglePassword}"
|
|
37
|
-
aria-label="${props.showPassword ? "Ocultar contraseña" : "Mostrar contraseña"}"
|
|
38
|
-
>
|
|
39
|
-
${props.showPassword ? html`
|
|
40
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
41
|
-
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>
|
|
42
|
-
<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>
|
|
43
|
-
<line x1="1" y1="1" x2="23" y2="23"/>
|
|
44
|
-
</svg>
|
|
45
|
-
` : html`
|
|
46
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
47
|
-
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
|
|
48
|
-
<circle cx="12" cy="12" r="3"/>
|
|
49
|
-
</svg>
|
|
50
|
-
`}
|
|
51
|
-
</button>
|
|
52
|
-
` : nothing}
|
|
53
|
-
|
|
54
|
-
<slot name="suffix"></slot>
|
|
11
|
+
${ctx.description ? html`<p class="pillar-desc" part="description">${ctx.description}</p>` : html`<slot></slot>`}
|
|
55
12
|
</div>
|
|
56
13
|
|
|
57
|
-
${props.error && props.errorMessage ? html`
|
|
58
|
-
<span class="input-error-message" id="${props.uuid}-error" role="alert">
|
|
59
|
-
${props.errorMessage}
|
|
60
|
-
</span>
|
|
61
|
-
` : nothing}
|
|
62
|
-
|
|
63
14
|
</div>
|
|
64
15
|
`;
|
|
65
16
|
}
|
|
66
17
|
export {
|
|
67
|
-
|
|
18
|
+
rendercontentPillar
|
|
68
19
|
};
|
|
69
20
|
//# sourceMappingURL=index298.js.map
|