@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/index318.js
CHANGED
|
@@ -1,42 +1,94 @@
|
|
|
1
1
|
import { nothing, html } from "lit";
|
|
2
|
-
|
|
2
|
+
const SEGMENT_TONE_CLASS = {
|
|
3
|
+
default: "seg-default",
|
|
4
|
+
kaki: "seg-kaki",
|
|
5
|
+
celadon: "seg-celadon",
|
|
6
|
+
error: "seg-error",
|
|
7
|
+
muted: "seg-muted"
|
|
8
|
+
};
|
|
9
|
+
const SEGMENT_TONE_VAR = {
|
|
10
|
+
default: "var(--color-washi-900)",
|
|
11
|
+
kaki: "var(--color-kaki-500)",
|
|
12
|
+
celadon: "var(--color-celadon-500)",
|
|
13
|
+
error: "var(--color-error)",
|
|
14
|
+
muted: "var(--color-washi-300)"
|
|
15
|
+
};
|
|
16
|
+
function segmentColor(seg) {
|
|
17
|
+
if (seg.color) return seg.color;
|
|
18
|
+
const tone = seg.tone ?? "default";
|
|
19
|
+
return SEGMENT_TONE_VAR[tone];
|
|
20
|
+
}
|
|
21
|
+
function segmentClass(seg) {
|
|
22
|
+
if (seg.color) return "";
|
|
23
|
+
return SEGMENT_TONE_CLASS[seg.tone ?? "default"];
|
|
24
|
+
}
|
|
25
|
+
function multiBarTpl(props) {
|
|
26
|
+
const hasLegend = props.segments.some((s) => s.label);
|
|
3
27
|
return html`
|
|
4
|
-
<div class="
|
|
5
|
-
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@click=${props.onCopy}
|
|
16
|
-
>
|
|
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
|
-
`}
|
|
29
|
-
</button>
|
|
30
|
-
` : nothing}
|
|
31
|
-
</div>
|
|
28
|
+
<div class="pb-multi">
|
|
29
|
+
${props.segments.map((seg) => html`
|
|
30
|
+
<div
|
|
31
|
+
class="pb-segment ${segmentClass(seg)}"
|
|
32
|
+
style="
|
|
33
|
+
width: ${seg.percent}%;
|
|
34
|
+
${seg.color ? `background: ${seg.color};` : ""}
|
|
35
|
+
"
|
|
36
|
+
></div>
|
|
37
|
+
`)}
|
|
38
|
+
</div>
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
${hasLegend ? html`
|
|
41
|
+
<div class="pb-legend">
|
|
42
|
+
${props.segments.filter((s) => s.label).map((seg) => html`
|
|
43
|
+
<div class="pb-legend-item">
|
|
44
|
+
<div
|
|
45
|
+
class="pb-legend-dot"
|
|
46
|
+
style="background: ${segmentColor(seg)};"
|
|
47
|
+
></div>
|
|
48
|
+
<span class="pb-legend-text">${seg.label}</span>
|
|
49
|
+
</div>
|
|
50
|
+
`)}
|
|
51
|
+
</div>` : nothing}
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
function singleBarTpl(props) {
|
|
55
|
+
const showInnerValue = props.size === "xl" && props.showValue && !props.indeterminate;
|
|
56
|
+
return html`
|
|
57
|
+
<div
|
|
58
|
+
class="pb"
|
|
59
|
+
role="progressbar"
|
|
60
|
+
aria-valuemin="0"
|
|
61
|
+
aria-valuemax="${props.max}"
|
|
62
|
+
aria-valuenow="${props.indeterminate ? nothing : props.rawValue}"
|
|
63
|
+
aria-label="${props.ariaLabel || nothing}"
|
|
64
|
+
>
|
|
65
|
+
<div class="pb-fill" style="width: ${props.indeterminate ? 100 : props.percent}%">
|
|
66
|
+
${showInnerValue ? html`<span class="pb-inner-value">${Math.round(props.percent)}%</span>` : nothing}
|
|
35
67
|
</div>
|
|
36
68
|
</div>
|
|
37
69
|
`;
|
|
38
70
|
}
|
|
71
|
+
function progressTemplate(props) {
|
|
72
|
+
const isMulti = props.segments.length > 0;
|
|
73
|
+
const hasMeta = !!(props.label || props.valueLabel);
|
|
74
|
+
const showPercent = !isMulti && props.showValue && !props.indeterminate && props.size !== "xl";
|
|
75
|
+
const displayValue = props.valueLabel ? props.valueLabel : showPercent ? `${Math.round(props.percent)}%` : nothing;
|
|
76
|
+
const barTpl = isMulti ? multiBarTpl(props) : singleBarTpl(props);
|
|
77
|
+
if (hasMeta) {
|
|
78
|
+
return html`
|
|
79
|
+
<div class="pb-wrap">
|
|
80
|
+
<div class="pb-header">
|
|
81
|
+
<span class="pb-label">${props.label}</span>
|
|
82
|
+
${displayValue !== nothing ? html`<span class="pb-value">${displayValue}</span>` : nothing}
|
|
83
|
+
</div>
|
|
84
|
+
${barTpl}
|
|
85
|
+
${props.sub ? html`<span class="pb-sub">${props.sub}</span>` : nothing}
|
|
86
|
+
</div>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
return html`${barTpl}`;
|
|
90
|
+
}
|
|
39
91
|
export {
|
|
40
|
-
|
|
92
|
+
progressTemplate
|
|
41
93
|
};
|
|
42
94
|
//# sourceMappingURL=index318.js.map
|
package/dist/index318.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index318.js","sources":["../src/components/atoms/
|
|
1
|
+
{"version":3,"file":"index318.js","sources":["../src/components/atoms/progress/lib-progress.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { ProgressTemplateProps, ProgressSegment, ProgressSegmentTone } from './lib-progress.types';\n\n/* ── Tone → CSS class for segments ── */\nconst SEGMENT_TONE_CLASS: Record<ProgressSegmentTone, string> = {\n default: 'seg-default',\n kaki: 'seg-kaki',\n celadon: 'seg-celadon',\n error: 'seg-error',\n muted: 'seg-muted',\n};\n\n/* ── Tone → CSS variable for legend dot ── */\nconst SEGMENT_TONE_VAR: Record<ProgressSegmentTone, string> = {\n default: 'var(--color-washi-900)',\n kaki: 'var(--color-kaki-500)',\n celadon: 'var(--color-celadon-500)',\n error: 'var(--color-error)',\n muted: 'var(--color-washi-300)',\n};\n\nfunction segmentColor(seg: ProgressSegment): string {\n if (seg.color) return seg.color;\n const tone = seg.tone ?? 'default';\n return SEGMENT_TONE_VAR[tone];\n}\n\nfunction segmentClass(seg: ProgressSegment): string {\n if (seg.color) return '';\n return SEGMENT_TONE_CLASS[seg.tone ?? 'default'];\n}\n\n/* ── Multi-segment bar ── */\nfunction multiBarTpl(props: ProgressTemplateProps): TemplateResult {\n const hasLegend = props.segments.some(s => s.label);\n\n return html`\n <div class=\"pb-multi\">\n ${props.segments.map(seg => html`\n <div\n class=\"pb-segment ${segmentClass(seg)}\"\n style=\"\n width: ${seg.percent}%;\n ${seg.color ? `background: ${seg.color};` : ''}\n \"\n ></div>\n `)}\n </div>\n\n ${hasLegend ? html`\n <div class=\"pb-legend\">\n ${props.segments.filter(s => s.label).map(seg => html`\n <div class=\"pb-legend-item\">\n <div\n class=\"pb-legend-dot\"\n style=\"background: ${segmentColor(seg)};\"\n ></div>\n <span class=\"pb-legend-text\">${seg.label}</span>\n </div>\n `)}\n </div>` : nothing}\n `;\n}\n\n/* ── Single bar ── */\nfunction singleBarTpl(props: ProgressTemplateProps): TemplateResult {\n const showInnerValue = props.size === 'xl' && props.showValue && !props.indeterminate;\n\n return html`\n <div\n class=\"pb\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"${props.max}\"\n aria-valuenow=\"${props.indeterminate ? nothing : props.rawValue}\"\n aria-label=\"${props.ariaLabel || nothing}\"\n >\n <div class=\"pb-fill\" style=\"width: ${props.indeterminate ? 100 : props.percent}%\">\n ${showInnerValue\n ? html`<span class=\"pb-inner-value\">${Math.round(props.percent)}%</span>`\n : nothing}\n </div>\n </div>\n `;\n}\n\n/**\n * Template para lib-progress.\n * Renderiza la barra con o sin meta (label/value/sub).\n * Si segments.length > 0 → modo multi-segmento.\n */\nexport function progressTemplate(props: ProgressTemplateProps): TemplateResult {\n const isMulti = props.segments.length > 0;\n const hasMeta = !!(props.label || props.valueLabel);\n const showPercent = !isMulti && props.showValue && !props.indeterminate && props.size !== 'xl';\n\n const displayValue = props.valueLabel\n ? props.valueLabel\n : showPercent\n ? `${Math.round(props.percent)}%`\n : nothing;\n\n const barTpl = isMulti ? multiBarTpl(props) : singleBarTpl(props);\n\n /* With meta wrapper */\n if (hasMeta) {\n return html`\n <div class=\"pb-wrap\">\n <div class=\"pb-header\">\n <span class=\"pb-label\">${props.label}</span>\n ${displayValue !== nothing\n ? html`<span class=\"pb-value\">${displayValue}</span>`\n : nothing}\n </div>\n ${barTpl}\n ${props.sub ? html`<span class=\"pb-sub\">${props.sub}</span>` : nothing}\n </div>\n `;\n }\n\n /* Plain bar */\n return html`${barTpl}`;\n}"],"names":[],"mappings":";AAIA,MAAM,qBAA0D;AAAA,EAC9D,SAAS;AAAA,EACT,MAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AACX;AAGA,MAAM,mBAAwD;AAAA,EAC5D,SAAS;AAAA,EACT,MAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAS;AAAA,EACT,OAAS;AACX;AAEA,SAAS,aAAa,KAA8B;AAClD,MAAI,IAAI,MAAO,QAAO,IAAI;AAC1B,QAAM,OAAO,IAAI,QAAQ;AACzB,SAAO,iBAAiB,IAAI;AAC9B;AAEA,SAAS,aAAa,KAA8B;AAClD,MAAI,IAAI,MAAO,QAAO;AACtB,SAAO,mBAAmB,IAAI,QAAQ,SAAS;AACjD;AAGA,SAAS,YAAY,OAA8C;AACjE,QAAM,YAAY,MAAM,SAAS,KAAK,CAAA,MAAK,EAAE,KAAK;AAElD,SAAO;AAAA;AAAA,QAED,MAAM,SAAS,IAAI,CAAA,QAAO;AAAA;AAAA,8BAEJ,aAAa,GAAG,CAAC;AAAA;AAAA,qBAE1B,IAAI,OAAO;AAAA,cAClB,IAAI,QAAQ,eAAe,IAAI,KAAK,MAAM,EAAE;AAAA;AAAA;AAAA,OAGnD,CAAC;AAAA;AAAA;AAAA,MAGF,YAAY;AAAA;AAAA,UAER,MAAM,SAAS,OAAO,CAAA,MAAK,EAAE,KAAK,EAAE,IAAI,CAAA,QAAO;AAAA;AAAA;AAAA;AAAA,mCAItB,aAAa,GAAG,CAAC;AAAA;AAAA,2CAET,IAAI,KAAK;AAAA;AAAA,SAE3C,CAAC;AAAA,gBACM,OAAO;AAAA;AAEvB;AAGA,SAAS,aAAa,OAA8C;AAClE,QAAM,iBAAiB,MAAM,SAAS,QAAQ,MAAM,aAAa,CAAC,MAAM;AAExE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKc,MAAM,GAAG;AAAA,uBACT,MAAM,gBAAgB,UAAU,MAAM,QAAQ;AAAA,oBACjD,MAAM,aAAa,OAAO;AAAA;AAAA,2CAEH,MAAM,gBAAgB,MAAM,MAAM,OAAO;AAAA,UAC1E,iBACE,oCAAoC,KAAK,MAAM,MAAM,OAAO,CAAC,aAC7D,OAAO;AAAA;AAAA;AAAA;AAInB;AAOO,SAAS,iBAAiB,OAA8C;AAC7E,QAAM,UAAc,MAAM,SAAS,SAAS;AAC5C,QAAM,UAAc,CAAC,EAAE,MAAM,SAAS,MAAM;AAC5C,QAAM,cAAc,CAAC,WAAW,MAAM,aAAa,CAAC,MAAM,iBAAiB,MAAM,SAAS;AAE1F,QAAM,eAAe,MAAM,aACvB,MAAM,aACN,cACE,GAAG,KAAK,MAAM,MAAM,OAAO,CAAC,MAC5B;AAEN,QAAM,SAAS,UAAU,YAAY,KAAK,IAAI,aAAa,KAAK;AAGhE,MAAI,SAAS;AACX,WAAO;AAAA;AAAA;AAAA,mCAGwB,MAAM,KAAK;AAAA,YAClC,iBAAiB,UACf,8BAA8B,YAAY,YAC1C,OAAO;AAAA;AAAA,UAEX,MAAM;AAAA,UACN,MAAM,MAAM,4BAA4B,MAAM,GAAG,YAAY,OAAO;AAAA;AAAA;AAAA,EAG5E;AAGA,SAAO,OAAO,MAAM;AACtB;"}
|
package/dist/index319.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const progressCss = '@layer tokens,reset,components;@layer reset{:host{display:block;width:100%}*,*:before,*:after{box-sizing:border-box}}@layer components{.pb-wrap{display:flex;flex-direction:column;gap:var(--lib-space-xs);width:100%}.pb-header{display:flex;align-items:baseline;justify-content:space-between;gap:var(--lib-space-sm)}.pb-label{font-family:var(--lib-font-body);font-size:var(--text-sm);color:var(--text-primary);line-height:var(--leading-snug)}.pb-value{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wide);color:var(--text-muted);flex-shrink:0}.pb-sub{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wider);color:var(--text-muted);text-transform:uppercase}:host([tone="error"]) .pb-label{color:var(--color-error)}:host([tone="error"]) .pb-value{color:var(--color-error)}:host([tone="error"]) .pb-sub{color:var(--color-error)}:host([tone="celadon"]) .pb-value{color:var(--color-celadon-600)}.pb{width:100%;background:var(--color-washi-200);border-radius:var(--radius-full);overflow:hidden;position:relative}:host([size="xs"]) .pb{height:2px}:host([size="sm"]) .pb{height:4px}:host([size="md"]) .pb,.pb{height:8px}:host([size="lg"]) .pb{height:12px}:host([size="xl"]) .pb{height:20px}:host([tone="kaki"]) .pb{background:var(--color-kaki-100)}:host([tone="celadon"]) .pb{background:var(--color-celadon-100)}:host([tone="error"]) .pb{background:var(--color-error-light, #F5DDD9)}:host([square]) .pb,:host([square]) .pb-fill{border-radius:var(--radius-sm)}.pb-fill{height:100%;border-radius:var(--radius-full);background:var(--color-washi-900);transition:width .6s var(--ease-default);position:relative;overflow:hidden}:host([square]) .pb-fill{border-radius:var(--radius-sm)}:host([tone="kaki"]) .pb-fill{background:var(--color-kaki-500)}:host([tone="celadon"]) .pb-fill{background:var(--color-celadon-500)}:host([tone="error"]) .pb-fill{background:var(--color-error)}:host([striped]) .pb-fill{background-image:repeating-linear-gradient(-45deg,transparent,transparent 6px,rgb(255,255,255,.18) 6px,rgb(255,255,255,.18) 12px)}.pb-inner-value{display:flex;align-items:center;height:100%;padding-left:var(--lib-space-sm);font-family:var(--lib-font-mono);font-size:9px;letter-spacing:var(--tracking-wider);color:#ffffffb3;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none}@keyframes pb-slide{0%{left:-40%;width:40%}50%{left:30%;width:60%}to{left:110%;width:40%}}:host([indeterminate]) .pb-fill{width:100%!important;background:transparent}:host([indeterminate]) .pb-fill:after{content:"";position:absolute;top:0;bottom:0;width:40%;background:var(--color-washi-900);border-radius:var(--radius-full);animation:pb-slide 1.6s cubic-bezier(.4,0,.6,1) infinite}:host([indeterminate][tone="kaki"]) .pb-fill:after{background:var(--color-kaki-500)}:host([indeterminate][tone="celadon"]) .pb-fill:after{background:var(--color-celadon-500)}:host([indeterminate][tone="error"]) .pb-fill:after{background:var(--color-error)}:host([indeterminate][square]) .pb-fill:after{border-radius:var(--radius-sm)}.pb-multi{display:flex;width:100%;border-radius:var(--radius-full);overflow:hidden;gap:2px;background:transparent}:host([size="xs"]) .pb-multi{height:2px}:host([size="sm"]) .pb-multi{height:4px}:host([size="md"]) .pb-multi,.pb-multi{height:8px}:host([size="lg"]) .pb-multi{height:12px}:host([size="xl"]) .pb-multi{height:20px}:host([square]) .pb-multi{border-radius:var(--radius-sm)}.pb-segment{height:100%;transition:width .6s var(--ease-default);flex-shrink:0}.pb-segment:first-child{border-radius:var(--radius-full) 0 0 var(--radius-full)}.pb-segment:last-child{border-radius:0 var(--radius-full) var(--radius-full) 0}.pb-segment:only-child{border-radius:var(--radius-full)}:host([square]) .pb-segment:first-child{border-radius:var(--radius-sm) 0 0 var(--radius-sm)}:host([square]) .pb-segment:last-child{border-radius:0 var(--radius-sm) var(--radius-sm) 0}:host([square]) .pb-segment:only-child{border-radius:var(--radius-sm)}.seg-default{background:var(--color-washi-900)}.seg-kaki{background:var(--color-kaki-500)}.seg-celadon{background:var(--color-celadon-500)}.seg-error{background:var(--color-error)}.seg-muted{background:var(--color-washi-300);flex:1}.pb-legend{display:flex;gap:var(--lib-space-md);flex-wrap:wrap;margin-top:var(--lib-space-sm)}.pb-legend-item{display:flex;align-items:center;gap:var(--lib-space-xs)}.pb-legend-dot{width:8px;height:8px;border-radius:var(--radius-full);flex-shrink:0}.pb-legend-text{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--text-muted)}@media(prefers-reduced-motion:reduce){.pb-fill,.pb-segment{transition:none}:host([indeterminate]) .pb-fill:after{animation:none}}}';
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
progressCss as default
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=index319.js.map
|
package/dist/index32.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unsafeCSS, css, LitElement } from "lit";
|
|
2
2
|
import { property, customElement } from "lit/decorators.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { progressCircleTemplate } from "./index320.js";
|
|
4
|
+
import progressCss from "./index321.js";
|
|
5
5
|
import sharedTokens from "./index196.js";
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -13,76 +13,68 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
13
|
if (kind && result) __defProp(target, key, result);
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
|
-
let
|
|
16
|
+
let LibProgressCircle = class extends LitElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.indeterminate = false;
|
|
22
|
-
this.label = "";
|
|
23
|
-
this.sublabel = "";
|
|
24
|
-
this.value = "";
|
|
19
|
+
this.value = 0;
|
|
20
|
+
this.max = 100;
|
|
25
21
|
this.size = "md";
|
|
22
|
+
this.strokeWidth = null;
|
|
26
23
|
this.variant = "default";
|
|
27
|
-
}
|
|
28
|
-
_handleChange(e) {
|
|
29
|
-
const input = e.target;
|
|
30
|
-
this.checked = input.checked;
|
|
31
24
|
this.indeterminate = false;
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
bubbles: true,
|
|
36
|
-
composed: true
|
|
37
|
-
})
|
|
38
|
-
);
|
|
25
|
+
this.bare = false;
|
|
26
|
+
this.sub = "";
|
|
27
|
+
this.icon = null;
|
|
39
28
|
}
|
|
40
29
|
render() {
|
|
41
|
-
return
|
|
42
|
-
checked: this.checked,
|
|
43
|
-
disabled: this.disabled,
|
|
44
|
-
indeterminate: this.indeterminate,
|
|
45
|
-
label: this.label,
|
|
46
|
-
sublabel: this.sublabel,
|
|
30
|
+
return progressCircleTemplate({
|
|
47
31
|
value: this.value,
|
|
32
|
+
max: this.max,
|
|
48
33
|
size: this.size,
|
|
34
|
+
strokeWidth: this.strokeWidth,
|
|
49
35
|
variant: this.variant,
|
|
50
|
-
|
|
36
|
+
indeterminate: this.indeterminate,
|
|
37
|
+
bare: this.bare,
|
|
38
|
+
sub: this.sub,
|
|
39
|
+
icon: this.icon
|
|
51
40
|
});
|
|
52
41
|
}
|
|
53
42
|
};
|
|
54
|
-
|
|
43
|
+
LibProgressCircle.styles = [
|
|
55
44
|
css`${unsafeCSS(sharedTokens)}`,
|
|
56
|
-
css`${unsafeCSS(
|
|
45
|
+
css`${unsafeCSS(progressCss)}`
|
|
57
46
|
];
|
|
58
47
|
__decorateClass([
|
|
59
|
-
property({ type:
|
|
60
|
-
],
|
|
48
|
+
property({ type: Number })
|
|
49
|
+
], LibProgressCircle.prototype, "value", 2);
|
|
61
50
|
__decorateClass([
|
|
62
|
-
property({ type:
|
|
63
|
-
],
|
|
51
|
+
property({ type: Number })
|
|
52
|
+
], LibProgressCircle.prototype, "max", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
property({ type: String, reflect: true })
|
|
55
|
+
], LibProgressCircle.prototype, "size", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ type: Number, attribute: "stroke-width" })
|
|
58
|
+
], LibProgressCircle.prototype, "strokeWidth", 2);
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property({ type: String, reflect: true })
|
|
61
|
+
], LibProgressCircle.prototype, "variant", 2);
|
|
64
62
|
__decorateClass([
|
|
65
63
|
property({ type: Boolean, reflect: true })
|
|
66
|
-
],
|
|
64
|
+
], LibProgressCircle.prototype, "indeterminate", 2);
|
|
67
65
|
__decorateClass([
|
|
68
|
-
property({ type:
|
|
69
|
-
],
|
|
66
|
+
property({ type: Boolean, reflect: true })
|
|
67
|
+
], LibProgressCircle.prototype, "bare", 2);
|
|
70
68
|
__decorateClass([
|
|
71
69
|
property({ type: String })
|
|
72
|
-
],
|
|
70
|
+
], LibProgressCircle.prototype, "sub", 2);
|
|
73
71
|
__decorateClass([
|
|
74
72
|
property({ type: String })
|
|
75
|
-
],
|
|
76
|
-
__decorateClass([
|
|
77
|
-
|
|
78
|
-
],
|
|
79
|
-
__decorateClass([
|
|
80
|
-
property({ type: String, reflect: true })
|
|
81
|
-
], LibCheckbox.prototype, "variant", 2);
|
|
82
|
-
LibCheckbox = __decorateClass([
|
|
83
|
-
customElement("lib-checkbox")
|
|
84
|
-
], LibCheckbox);
|
|
73
|
+
], LibProgressCircle.prototype, "icon", 2);
|
|
74
|
+
LibProgressCircle = __decorateClass([
|
|
75
|
+
customElement("lib-progress-circle")
|
|
76
|
+
], LibProgressCircle);
|
|
85
77
|
export {
|
|
86
|
-
|
|
78
|
+
LibProgressCircle
|
|
87
79
|
};
|
|
88
80
|
//# sourceMappingURL=index32.js.map
|
package/dist/index32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index32.js","sources":["../src/components/atoms/
|
|
1
|
+
{"version":3,"file":"index32.js","sources":["../src/components/atoms/progress-circle/lib-progress-circle.component.ts"],"sourcesContent":["import { LitElement, css, unsafeCSS, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type { LibProgressCircleSize, LibProgressCircleVariant } from './lib-progress-circle.component.html';\nimport { progressCircleTemplate } from './lib-progress-circle.component.html';\nimport progressCss from './lib-progress-circle.css?inline';\nimport sharedTokens from '../../../styles/shared/tokens.css?inline';\n\n/**\n * @element lib-progress-circle\n *\n * Indicador de progreso circular basado en SVG stroke-dashoffset.\n * Cinco tamaños semánticos, cuatro colores, variante indeterminate.\n *\n * @example — uso básico\n * <lib-progress-circle value=\"72\"></lib-progress-circle>\n *\n * @example — kaki con subtítulo\n * <lib-progress-circle value=\"61\" variant=\"kaki\" sub=\"61 GB\"></lib-progress-circle>\n *\n * @example — celadon completado con icono\n * <lib-progress-circle value=\"100\" variant=\"celadon\" icon=\"check\" size=\"lg\"></lib-progress-circle>\n *\n * @example — indeterminate\n * <lib-progress-circle indeterminate variant=\"kaki\"></lib-progress-circle>\n *\n * @example — sin label (bare)\n * <lib-progress-circle value=\"38\" size=\"xs\" bare></lib-progress-circle>\n */\n@customElement('lib-progress-circle')\nexport class LibProgressCircle extends LitElement {\n static override styles = [\n css`${unsafeCSS(sharedTokens)}`,\n css`${unsafeCSS(progressCss)}`,\n ];\n\n /** Valor actual */\n @property({ type: Number })\n value = 0;\n\n /** Valor máximo */\n @property({ type: Number })\n max = 100;\n\n /**\n * Tamaño semántico del círculo.\n * Mapea a dimensiones fijas con strokeWidth proporcional:\n * - xs : 40px · stroke 3 (sin label)\n * - sm : 64px · stroke 4\n * - md : 96px · stroke 6 (default)\n * - lg : 128px · stroke 7\n * - xl : 176px · stroke 6\n */\n @property({ type: String, reflect: true })\n size: LibProgressCircleSize = 'md';\n\n /**\n * Sobreescribe el strokeWidth por defecto del tamaño.\n * null → usa el valor canónico del tamaño seleccionado.\n */\n @property({ type: Number, attribute: 'stroke-width' })\n strokeWidth: number | null = null;\n\n /**\n * Paleta de color del arco.\n * El track toma automáticamente el tono -100 de cada variante.\n * - default : washi-900 (tinta)\n * - kaki : persimmon orgánico\n * - celadon : jade sereno\n * - error : estado crítico\n */\n @property({ type: String, reflect: true })\n variant: LibProgressCircleVariant = 'default';\n\n /**\n * Modo de carga de duración desconocida.\n * El arco es un segmento corto que rota continuamente.\n * Ignora `value`, `bare`, `sub` e `icon`.\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /** Oculta el label central (solo muestra el arco) */\n @property({ type: Boolean, reflect: true })\n bare = false;\n\n /** Subtítulo bajo el valor numérico. Oculto en xs. */\n @property({ type: String })\n sub = '';\n\n /**\n * Icono SVG en el centro en lugar del texto numérico.\n * - 'check' : polyline checkmark en color de la variante\n * - null : muestra el valor (default)\n */\n @property({ type: String })\n icon: 'check' | null = null;\n\n override render(): TemplateResult {\n return progressCircleTemplate({\n value: this.value,\n max: this.max,\n size: this.size,\n strokeWidth: this.strokeWidth,\n variant: this.variant,\n indeterminate: this.indeterminate,\n bare: this.bare,\n sub: this.sub,\n icon: this.icon,\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lib-progress-circle': LibProgressCircle;\n }\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;AA6BO,IAAM,oBAAN,cAAgC,WAAW;AAAA,EAA3C,cAAA;AAAA,UAAA,GAAA,SAAA;AAQL,SAAA,QAAQ;AAIR,SAAA,MAAM;AAYN,SAAA,OAA8B;AAO9B,SAAA,cAA6B;AAW7B,SAAA,UAAoC;AAQpC,SAAA,gBAAgB;AAIhB,SAAA,OAAO;AAIP,SAAA,MAAM;AAQN,SAAA,OAAuB;AAAA,EAAA;AAAA,EAEd,SAAyB;AAChC,WAAO,uBAAuB;AAAA,MAC5B,OAAe,KAAK;AAAA,MACpB,KAAe,KAAK;AAAA,MACpB,MAAe,KAAK;AAAA,MACpB,aAAe,KAAK;AAAA,MACpB,SAAe,KAAK;AAAA,MACpB,eAAe,KAAK;AAAA,MACpB,MAAe,KAAK;AAAA,MACpB,KAAe,KAAK;AAAA,MACpB,MAAe,KAAK;AAAA,IAAA,CACrB;AAAA,EACH;AACF;AAjFa,kBACK,SAAS;AAAA,EACvB,MAAM,UAAU,YAAY,CAAC;AAAA,EAC7B,MAAM,UAAU,WAAW,CAAC;AAC9B;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAPf,kBAQX,WAAA,SAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAXf,kBAYX,WAAA,OAAA,CAAA;AAYA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GAvB9B,kBAwBX,WAAA,QAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,GA9B1C,kBA+BX,WAAA,eAAA,CAAA;AAWA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM;AAAA,GAzC9B,kBA0CX,WAAA,WAAA,CAAA;AAQA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAjD/B,kBAkDX,WAAA,iBAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GArD/B,kBAsDX,WAAA,QAAA,CAAA;AAIA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAzDf,kBA0DX,WAAA,OAAA,CAAA;AAQA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjEf,kBAkEX,WAAA,QAAA,CAAA;AAlEW,oBAAN,gBAAA;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB,iBAAA;"}
|
package/dist/index320.js
CHANGED
|
@@ -1,85 +1,76 @@
|
|
|
1
|
-
import { html } from "lit";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const warningSvg = html`
|
|
17
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
18
|
-
stroke="var(--color-warning)" stroke-width="1.5"
|
|
19
|
-
stroke-linecap="round" stroke-linejoin="round">
|
|
20
|
-
<circle cx="8" cy="8" r="6"/>
|
|
21
|
-
<path d="M8 5v3M8 10v.5"/>
|
|
22
|
-
</svg>
|
|
23
|
-
`;
|
|
24
|
-
function dialogTemplate(props) {
|
|
25
|
-
const {
|
|
26
|
-
eyebrow,
|
|
27
|
-
dlgTitle,
|
|
28
|
-
variant,
|
|
29
|
-
size,
|
|
30
|
-
layout,
|
|
31
|
-
footerMeta,
|
|
32
|
-
onClose
|
|
33
|
-
} = props;
|
|
34
|
-
const layoutCls = layout === "drawer-right" ? "dlg-drawer-right" : layout === "drawer-bottom" ? "dlg-drawer-bottom" : "";
|
|
35
|
-
const alertCls = layout === "alert" ? "dlg-alert" : "";
|
|
36
|
-
const sizeCls = `dlg-${size}`;
|
|
37
|
-
const dlgCls = `dlg ${sizeCls} ${layoutCls} ${alertCls}`.trim();
|
|
38
|
-
const hasIcon = variant === "danger" || variant === "warning";
|
|
39
|
-
const headerIcon = hasIcon ? html`<div class="dlg-header-icon">
|
|
40
|
-
${variant === "danger" ? dangerSvg : warningSvg}
|
|
41
|
-
</div>` : null;
|
|
1
|
+
import { nothing, svg, html } from "lit";
|
|
2
|
+
const SIZE_MAP = {
|
|
3
|
+
xs: { px: 40, stroke: 3 },
|
|
4
|
+
sm: { px: 64, stroke: 4 },
|
|
5
|
+
md: { px: 96, stroke: 6 },
|
|
6
|
+
lg: { px: 128, stroke: 7 },
|
|
7
|
+
xl: { px: 176, stroke: 6 }
|
|
8
|
+
};
|
|
9
|
+
function progressCircleTemplate(props) {
|
|
10
|
+
const { px, stroke: defaultStroke } = SIZE_MAP[props.size];
|
|
11
|
+
const sw = props.strokeWidth ?? defaultStroke;
|
|
12
|
+
const r = (px - sw) / 2;
|
|
13
|
+
const circ = 2 * Math.PI * r;
|
|
14
|
+
const offset = props.indeterminate ? 0 : circ * (1 - Math.min(props.value, props.max) / props.max);
|
|
15
|
+
const pct = Math.round(props.value / props.max * 100);
|
|
42
16
|
return html`
|
|
43
|
-
<
|
|
44
|
-
class="
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}}"
|
|
17
|
+
<div
|
|
18
|
+
class="pc"
|
|
19
|
+
style="width:${px}px; height:${px}px;"
|
|
20
|
+
role="progressbar"
|
|
21
|
+
aria-valuenow=${props.indeterminate ? nothing : props.value}
|
|
22
|
+
aria-valuemin="0"
|
|
23
|
+
aria-valuemax=${props.max}
|
|
24
|
+
aria-label=${props.indeterminate ? "Cargando…" : `${pct}%`}
|
|
52
25
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
26
|
+
${svg`
|
|
27
|
+
<svg
|
|
28
|
+
width="${px}"
|
|
29
|
+
height="${px}"
|
|
30
|
+
viewBox="0 0 ${px} ${px}"
|
|
31
|
+
class="pc__svg ${props.indeterminate ? "pc__svg--spin" : ""}"
|
|
32
|
+
>
|
|
33
|
+
<circle
|
|
34
|
+
class="pc__track"
|
|
35
|
+
cx="${px / 2}"
|
|
36
|
+
cy="${px / 2}"
|
|
37
|
+
r="${r}"
|
|
38
|
+
stroke-width="${sw}"
|
|
39
|
+
/>
|
|
40
|
+
<circle
|
|
41
|
+
class="pc__arc ${props.indeterminate ? "pc__arc--indet" : ""}"
|
|
42
|
+
cx="${px / 2}"
|
|
43
|
+
cy="${px / 2}"
|
|
44
|
+
r="${r}"
|
|
45
|
+
stroke-width="${sw}"
|
|
46
|
+
stroke-dasharray="${props.indeterminate ? `${circ * 0.3} ${circ}` : circ}"
|
|
47
|
+
stroke-dashoffset="${props.indeterminate ? 0 : offset}"
|
|
48
|
+
stroke-linecap="round"
|
|
49
|
+
/>
|
|
50
|
+
</svg>
|
|
51
|
+
`}
|
|
68
52
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
${!props.bare && !props.indeterminate ? html`
|
|
54
|
+
<div class="pc__label">
|
|
55
|
+
${props.icon === "check" ? html`
|
|
56
|
+
<svg class="pc__check" width="28" height="28" viewBox="0 0 28 28" fill="none" aria-hidden="true">
|
|
57
|
+
<polyline
|
|
58
|
+
points="6,14 11,20 22,9"
|
|
59
|
+
stroke-width="2"
|
|
60
|
+
stroke-linecap="round"
|
|
61
|
+
stroke-linejoin="round"
|
|
62
|
+
/>
|
|
63
|
+
</svg>
|
|
64
|
+
` : html`
|
|
65
|
+
<span class="pc__value">${pct}%</span>
|
|
66
|
+
${props.sub ? html`<span class="pc__sub">${props.sub}</span>` : nothing}
|
|
67
|
+
`}
|
|
68
|
+
</div>
|
|
69
|
+
` : nothing}
|
|
70
|
+
</div>
|
|
80
71
|
`;
|
|
81
72
|
}
|
|
82
73
|
export {
|
|
83
|
-
|
|
74
|
+
progressCircleTemplate
|
|
84
75
|
};
|
|
85
76
|
//# sourceMappingURL=index320.js.map
|
package/dist/index320.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index320.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index320.js","sources":["../src/components/atoms/progress-circle/lib-progress-circle.component.html.ts"],"sourcesContent":["import { html, svg, nothing, TemplateResult } from 'lit';\n\nexport type LibProgressCircleSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type LibProgressCircleVariant = 'default' | 'kaki' | 'celadon' | 'error';\n\n/** Dimensiones canónicas por tamaño */\nconst SIZE_MAP: Record<LibProgressCircleSize, { px: number; stroke: number }> = {\n xs: { px: 40, stroke: 3 },\n sm: { px: 64, stroke: 4 },\n md: { px: 96, stroke: 6 },\n lg: { px: 128, stroke: 7 },\n xl: { px: 176, stroke: 6 },\n};\n\nexport interface ProgressCircleTemplateProps {\n value: number;\n max: number;\n size: LibProgressCircleSize;\n /** Sobreescribe el strokeWidth por defecto del tamaño */\n strokeWidth: number | null;\n variant: LibProgressCircleVariant;\n indeterminate: boolean;\n /** Oculta el label central */\n bare: boolean;\n /** Subtítulo bajo el valor numérico */\n sub: string;\n /** Icono SVG en el centro en lugar del texto */\n icon: 'check' | null;\n}\n\n/**\n * Renderiza el SVG circular y el label central.\n *\n * Fórmula del arco:\n * r = (size - strokeWidth) / 2\n * circumference = 2π × r\n * offset = circumference × (1 − value/max)\n *\n * El SVG se rota -90° en CSS para que el arco empiece arriba.\n */\nexport function progressCircleTemplate(props: ProgressCircleTemplateProps): TemplateResult {\n const { px, stroke: defaultStroke } = SIZE_MAP[props.size];\n const sw = props.strokeWidth ?? defaultStroke;\n\n const r = (px - sw) / 2;\n const circ = 2 * Math.PI * r;\n\n // Indeterminate: arco corto fijo; determinado: offset calculado\n const offset = props.indeterminate\n ? 0 // stroke-dasharray en CSS controla la longitud del segmento\n : circ * (1 - Math.min(props.value, props.max) / props.max);\n\n const pct = Math.round((props.value / props.max) * 100);\n\n return html`\n <div\n class=\"pc\"\n style=\"width:${px}px; height:${px}px;\"\n role=\"progressbar\"\n aria-valuenow=${props.indeterminate ? nothing : props.value}\n aria-valuemin=\"0\"\n aria-valuemax=${props.max}\n aria-label=${props.indeterminate ? 'Cargando…' : `${pct}%`}\n >\n ${svg`\n <svg\n width=\"${px}\"\n height=\"${px}\"\n viewBox=\"0 0 ${px} ${px}\"\n class=\"pc__svg ${props.indeterminate ? 'pc__svg--spin' : ''}\"\n >\n <circle\n class=\"pc__track\"\n cx=\"${px / 2}\"\n cy=\"${px / 2}\"\n r=\"${r}\"\n stroke-width=\"${sw}\"\n />\n <circle\n class=\"pc__arc ${props.indeterminate ? 'pc__arc--indet' : ''}\"\n cx=\"${px / 2}\"\n cy=\"${px / 2}\"\n r=\"${r}\"\n stroke-width=\"${sw}\"\n stroke-dasharray=\"${props.indeterminate ? `${circ * 0.3} ${circ}` : circ}\"\n stroke-dashoffset=\"${props.indeterminate ? 0 : offset}\"\n stroke-linecap=\"round\"\n />\n </svg>\n `}\n\n ${!props.bare && !props.indeterminate ? html`\n <div class=\"pc__label\">\n ${props.icon === 'check' ? html`\n <svg class=\"pc__check\" width=\"28\" height=\"28\" viewBox=\"0 0 28 28\" fill=\"none\" aria-hidden=\"true\">\n <polyline\n points=\"6,14 11,20 22,9\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n ` : html`\n <span class=\"pc__value\">${pct}%</span>\n ${props.sub ? html`<span class=\"pc__sub\">${props.sub}</span>` : nothing}\n `}\n </div>\n ` : nothing}\n </div>\n `;\n}"],"names":[],"mappings":";AAMA,MAAM,WAA0E;AAAA,EAC9E,IAAI,EAAE,IAAI,IAAK,QAAQ,EAAA;AAAA,EACvB,IAAI,EAAE,IAAI,IAAK,QAAQ,EAAA;AAAA,EACvB,IAAI,EAAE,IAAI,IAAK,QAAQ,EAAA;AAAA,EACvB,IAAI,EAAE,IAAI,KAAK,QAAQ,EAAA;AAAA,EACvB,IAAI,EAAE,IAAI,KAAK,QAAQ,EAAA;AACzB;AA4BO,SAAS,uBAAuB,OAAoD;AACzF,QAAM,EAAE,IAAI,QAAQ,kBAAkB,SAAS,MAAM,IAAI;AACzD,QAAM,KAAK,MAAM,eAAe;AAEhC,QAAM,KAAQ,KAAK,MAAM;AACzB,QAAM,OAAO,IAAI,KAAK,KAAK;AAG3B,QAAM,SAAS,MAAM,gBACjB,IACA,QAAQ,IAAI,KAAK,IAAI,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM;AAEzD,QAAM,MAAM,KAAK,MAAO,MAAM,QAAQ,MAAM,MAAO,GAAG;AAEtD,SAAO;AAAA;AAAA;AAAA,qBAGY,EAAE,cAAc,EAAE;AAAA;AAAA,sBAEjB,MAAM,gBAAgB,UAAU,MAAM,KAAK;AAAA;AAAA,sBAE3C,MAAM,GAAG;AAAA,mBACZ,MAAM,gBAAgB,cAAc,GAAG,GAAG,GAAG;AAAA;AAAA,QAExD;AAAA;AAAA,mBAEW,EAAE;AAAA,oBACD,EAAE;AAAA,yBACG,EAAE,IAAI,EAAE;AAAA,2BACN,MAAM,gBAAgB,kBAAkB,EAAE;AAAA;AAAA;AAAA;AAAA,kBAInD,KAAK,CAAC;AAAA,kBACN,KAAK,CAAC;AAAA,iBACP,CAAC;AAAA,4BACU,EAAE;AAAA;AAAA;AAAA,6BAGD,MAAM,gBAAgB,mBAAmB,EAAE;AAAA,kBACtD,KAAK,CAAC;AAAA,kBACN,KAAK,CAAC;AAAA,iBACP,CAAC;AAAA,4BACU,EAAE;AAAA,gCACE,MAAM,gBAAgB,GAAG,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI;AAAA,iCACnD,MAAM,gBAAgB,IAAI,MAAM;AAAA;AAAA;AAAA;AAAA,OAI1D;AAAA;AAAA,QAEC,CAAC,MAAM,QAAQ,CAAC,MAAM,gBAAgB;AAAA;AAAA,YAElC,MAAM,SAAS,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cASvB;AAAA,sCACwB,GAAG;AAAA,cAC3B,MAAM,MAAM,6BAA6B,MAAM,GAAG,YAAY,OAAO;AAAA,WACxE;AAAA;AAAA,UAED,OAAO;AAAA;AAAA;AAGjB;"}
|
package/dist/index321.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const progressCss = '@layer tokens,reset,components;@layer reset{:host{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;flex-shrink:0}*,*:before,*:after{box-sizing:border-box}}@layer components{.pc{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.pc__svg{display:block;transform:rotate(-90deg);transform-origin:center;overflow:visible}.pc__track,.pc__arc{fill:none;stroke-linecap:round}.pc__track{stroke:var(--color-washi-200)}.pc__arc{stroke:var(--color-washi-900);transition:stroke-dashoffset .7s cubic-bezier(0,0,.2,1),stroke .3s}:host([variant="kaki"]) .pc__arc{stroke:var(--color-kaki-500)}:host([variant="kaki"]) .pc__track{stroke:var(--color-kaki-100)}:host([variant="celadon"]) .pc__arc{stroke:var(--color-celadon-500)}:host([variant="celadon"]) .pc__track{stroke:var(--color-celadon-100)}:host([variant="error"]) .pc__arc{stroke:var(--color-error)}:host([variant="error"]) .pc__track{stroke:#f5ddd9}.pc__label{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;pointer-events:none}.pc__value{font-family:var(--lib-font-mono);font-weight:var(--weight-regular);letter-spacing:var(--tracking-wide);color:var(--text-primary);line-height:1}.pc__sub{font-family:var(--lib-font-mono);letter-spacing:var(--tracking-widest);text-transform:uppercase;color:var(--text-muted);line-height:1}:host([size="xs"]) .pc__label{display:none}:host([size="sm"]) .pc__value{font-size:var(--text-xs)}:host([size="sm"]) .pc__sub{font-size:8px}:host([size="md"]) .pc__value{font-size:var(--text-md)}:host([size="md"]) .pc__sub{font-size:9px}:host([size="lg"]) .pc__value{font-size:var(--text-xl)}:host([size="lg"]) .pc__sub{font-size:var(--text-xs)}:host([size="xl"]) .pc__value{font-size:2rem}:host([size="xl"]) .pc__sub{font-size:var(--text-xs)}:host([variant="kaki"]) .pc__value{color:var(--color-kaki-600)}:host([variant="celadon"]) .pc__value{color:var(--color-celadon-600)}:host([variant="error"]) .pc__value{color:var(--color-error)}.pc__check polyline{stroke:var(--color-celadon-500)}:host([variant="kaki"]) .pc__check polyline{stroke:var(--color-kaki-500)}@keyframes pc-spin{to{transform:rotate(270deg)}}.pc__svg--spin{animation:pc-spin 1.2s linear infinite;transform-origin:center}.pc__arc--indet{transition:none}@media(prefers-reduced-motion:reduce){.pc__arc{transition:none}.pc__svg--spin{animation:none}}}';
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
progressCss as default
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=index321.js.map
|