reke-ui 0.5.2 → 0.5.4
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/custom-elements.json +764 -3
- package/dist/components/reke-bar-chart/reke-bar-chart.d.ts +99 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.d.ts.map +1 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.js +319 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.d.ts +2 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.d.ts.map +1 -0
- package/dist/components/reke-bar-chart/reke-bar-chart.styles.js +36 -0
- package/dist/components/reke-dialog/reke-dialog.d.ts +19 -0
- package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.js +40 -15
- package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.styles.js +110 -0
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts +52 -1
- package/dist/components/reke-pie-chart/reke-pie-chart.d.ts.map +1 -1
- package/dist/components/reke-pie-chart/reke-pie-chart.js +181 -42
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.d.ts.map +1 -1
- package/dist/components/reke-pie-chart/reke-pie-chart.styles.js +47 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -20
- package/dist/node_modules/echarts/lib/chart/bar/BarSeries.js +50 -0
- package/dist/node_modules/echarts/lib/chart/bar/BarView.js +431 -0
- package/dist/node_modules/echarts/lib/chart/bar/BaseBarSeries.js +65 -0
- package/dist/node_modules/echarts/lib/chart/bar/install.js +22 -0
- package/dist/node_modules/echarts/lib/chart/helper/Symbol.js +142 -0
- package/dist/node_modules/echarts/lib/chart/helper/SymbolDraw.js +99 -0
- package/dist/node_modules/echarts/lib/chart/helper/axisSnippets.js +19 -0
- package/dist/node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js +50 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesData.js +55 -0
- package/dist/node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js +3 -3
- package/dist/node_modules/echarts/lib/chart/helper/labelHelper.js +24 -0
- package/dist/node_modules/echarts/lib/chart/line/LineSeries.js +60 -0
- package/dist/node_modules/echarts/lib/chart/line/LineView.js +471 -0
- package/dist/node_modules/echarts/lib/chart/line/helper.js +34 -0
- package/dist/node_modules/echarts/lib/chart/line/install.js +16 -0
- package/dist/node_modules/echarts/lib/chart/line/lineAnimationDiff.js +59 -0
- package/dist/node_modules/echarts/lib/chart/line/poly.js +135 -0
- package/dist/node_modules/echarts/lib/chart/pie/PieSeries.js +32 -32
- package/dist/node_modules/echarts/lib/chart/pie/PieView.js +69 -69
- package/dist/node_modules/echarts/lib/chart/pie/labelLayout.js +25 -25
- package/dist/node_modules/echarts/lib/chart/pie/pieLayout.js +16 -16
- package/dist/node_modules/echarts/lib/component/axis/AxisBuilder.js +153 -153
- package/dist/node_modules/echarts/lib/component/axis/AxisView.js +13 -13
- package/dist/node_modules/echarts/lib/component/axis/CartesianAxisView.js +106 -0
- package/dist/node_modules/echarts/lib/component/axis/axisSplitHelper.js +50 -0
- package/dist/node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js +20 -20
- package/dist/node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js +30 -30
- package/dist/node_modules/echarts/lib/component/axisPointer/viewHelper.js +13 -13
- package/dist/node_modules/echarts/lib/component/dataZoom/AxisProxy.js +114 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/DataZoomModel.js +189 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/DataZoomView.js +15 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js +21 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/InsideZoomView.js +67 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js +75 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/SliderZoomView.js +465 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/dataZoomAction.js +17 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js +55 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/helper.js +88 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installCommon.js +14 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js +10 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js +9 -0
- package/dist/node_modules/echarts/lib/component/dataZoom/roams.js +132 -0
- package/dist/node_modules/echarts/lib/component/grid/install.js +9 -0
- package/dist/node_modules/echarts/lib/component/grid/installSimple.js +32 -0
- package/dist/node_modules/echarts/lib/component/helper/RoamController.js +172 -0
- package/dist/node_modules/echarts/lib/component/helper/cursorHelper.js +17 -0
- package/dist/node_modules/echarts/lib/component/helper/interactionMutex.js +15 -0
- package/dist/node_modules/echarts/lib/component/helper/sliderMove.js +29 -0
- package/dist/node_modules/echarts/lib/component/legend/LegendModel.js +31 -31
- package/dist/node_modules/echarts/lib/component/legend/LegendView.js +61 -61
- package/dist/node_modules/echarts/lib/component/legend/ScrollableLegendView.js +29 -29
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipRichContent.js +4 -4
- package/dist/node_modules/echarts/lib/component/tooltip/TooltipView.js +105 -105
- package/dist/node_modules/echarts/lib/coord/Axis.js +92 -0
- package/dist/node_modules/echarts/lib/coord/CoordinateSystem.js +6 -0
- package/dist/node_modules/echarts/lib/coord/axisAlignTicks.js +76 -0
- package/dist/node_modules/echarts/lib/coord/axisCommonTypes.js +9 -0
- package/dist/node_modules/echarts/lib/coord/axisDefault.js +124 -0
- package/dist/node_modules/echarts/lib/coord/axisHelper.js +123 -14
- package/dist/node_modules/echarts/lib/coord/axisModelCommonMixin.js +9 -0
- package/dist/node_modules/echarts/lib/coord/axisModelCreator.js +39 -0
- package/dist/node_modules/echarts/lib/coord/axisNiceTicks.js +64 -0
- package/dist/node_modules/echarts/lib/coord/axisStatistics.js +101 -22
- package/dist/node_modules/echarts/lib/coord/axisStatisticsMetricsImpl.js +43 -0
- package/dist/node_modules/echarts/lib/coord/axisTickLabelBuilder.js +151 -5
- package/dist/node_modules/echarts/lib/coord/cartesian/Axis2D.js +24 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/AxisModel.js +18 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Cartesian.js +23 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Cartesian2D.js +69 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/Grid.js +314 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/GridModel.js +40 -0
- package/dist/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js +43 -12
- package/dist/node_modules/echarts/lib/coord/scaleRawExtentInfo.js +175 -0
- package/dist/node_modules/echarts/lib/core/CoordinateSystem.js +39 -16
- package/dist/node_modules/echarts/lib/core/echarts.js +421 -421
- package/dist/node_modules/echarts/lib/data/OrdinalMeta.js +30 -0
- package/dist/node_modules/echarts/lib/data/SeriesData.js +18 -18
- package/dist/node_modules/echarts/lib/data/helper/createDimensions.js +6 -6
- package/dist/node_modules/echarts/lib/data/helper/dataStackHelper.js +59 -0
- package/dist/node_modules/echarts/lib/data/helper/dataValueHelper.js +13 -13
- package/dist/node_modules/echarts/lib/data/helper/dimensionHelper.js +7 -4
- package/dist/node_modules/echarts/lib/data/helper/sourceHelper.js +40 -8
- package/dist/node_modules/echarts/lib/data/helper/sourceManager.js +3 -3
- package/dist/node_modules/echarts/lib/data/helper/transform.js +8 -8
- package/dist/node_modules/echarts/lib/extension.js +10 -10
- package/dist/node_modules/echarts/lib/label/labelGuideHelper.js +10 -10
- package/dist/node_modules/echarts/lib/label/labelStyle.js +34 -25
- package/dist/node_modules/echarts/lib/label/sectorLabel.js +83 -0
- package/dist/node_modules/echarts/lib/layout/barCommon.js +19 -0
- package/dist/node_modules/echarts/lib/layout/barGrid.js +165 -0
- package/dist/node_modules/echarts/lib/layout/points.js +37 -0
- package/dist/node_modules/echarts/lib/loading/default.js +6 -6
- package/dist/node_modules/echarts/lib/model/Component.js +39 -39
- package/dist/node_modules/echarts/lib/model/Global.js +122 -122
- package/dist/node_modules/echarts/lib/model/Series.js +78 -78
- package/dist/node_modules/echarts/lib/model/referHelper.js +58 -0
- package/dist/node_modules/echarts/lib/processor/dataSample.js +43 -0
- package/dist/node_modules/echarts/lib/scale/Interval.js +68 -0
- package/dist/node_modules/echarts/lib/scale/Log.js +100 -0
- package/dist/node_modules/echarts/lib/scale/Ordinal.js +92 -0
- package/dist/node_modules/echarts/lib/scale/Scale.js +13 -0
- package/dist/node_modules/echarts/lib/scale/Time.js +242 -0
- package/dist/node_modules/echarts/lib/scale/break.js +10 -2
- package/dist/node_modules/echarts/lib/scale/helper.js +61 -3
- package/dist/node_modules/echarts/lib/scale/minorTicks.js +22 -0
- package/dist/node_modules/echarts/lib/scale/scaleMapper.js +89 -7
- package/dist/node_modules/echarts/lib/util/clazz.js +35 -35
- package/dist/node_modules/echarts/lib/util/component.js +16 -16
- package/dist/node_modules/echarts/lib/util/cycleCache.js +4 -1
- package/dist/node_modules/echarts/lib/util/decal.js +11 -11
- package/dist/node_modules/echarts/lib/util/format.js +1 -1
- package/dist/node_modules/echarts/lib/util/graphic.js +170 -170
- package/dist/node_modules/echarts/lib/util/layout.js +23 -23
- package/dist/node_modules/echarts/lib/util/model.js +128 -68
- package/dist/node_modules/echarts/lib/util/number.js +55 -37
- package/dist/node_modules/echarts/lib/util/shape/sausage.js +25 -0
- package/dist/node_modules/echarts/lib/util/states.js +96 -82
- package/dist/node_modules/echarts/lib/util/styleCompat.js +10 -0
- package/dist/node_modules/echarts/lib/util/symbol.js +24 -21
- package/dist/node_modules/echarts/lib/util/time.js +154 -18
- package/dist/node_modules/echarts/lib/util/vendor.js +26 -0
- package/dist/node_modules/echarts/lib/view/Chart.js +19 -19
- package/dist/node_modules/echarts/lib/view/Component.js +7 -7
- package/dist/node_modules/echarts/lib/visual/style.js +5 -5
- package/dist/node_modules/zrender/lib/Element.js +35 -35
- package/dist/node_modules/zrender/lib/canvas/graphic.js +36 -36
- package/dist/node_modules/zrender/lib/core/PathProxy.js +25 -25
- package/dist/node_modules/zrender/lib/core/event.js +4 -1
- package/dist/node_modules/zrender/lib/core/util.js +69 -64
- package/dist/node_modules/zrender/lib/graphic/TSpan.js +7 -7
- package/dist/node_modules/zrender/lib/graphic/Text.js +37 -37
- package/dist/node_modules/zrender/lib/graphic/helper/parseText.js +59 -59
- package/dist/node_modules/zrender/lib/tool/color.js +60 -41
- package/dist/react.d.ts +10 -0
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +85 -73
- package/dist/shared/tailwind.js +1 -1
- package/dist/tokens/reke-tokens.css +1 -0
- package/package.json +5 -1
|
@@ -6,6 +6,52 @@ var n = [e, t`
|
|
|
6
6
|
display: block;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/* === Motion ===
|
|
10
|
+
Enter and exit are separate animations rather than a transition: the
|
|
11
|
+
panel is only in the DOM while open or closing, so there is no resting
|
|
12
|
+
state to transition from. The is-closing class comes from the
|
|
13
|
+
component, which keeps the panel mounted until the exit ends. */
|
|
14
|
+
|
|
15
|
+
@keyframes reke-backdrop-in {
|
|
16
|
+
from { opacity: 0; }
|
|
17
|
+
to { opacity: 1; }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes reke-backdrop-out {
|
|
21
|
+
from { opacity: 1; }
|
|
22
|
+
to { opacity: 0; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes reke-dialog-in {
|
|
26
|
+
from { opacity: 0; transform: translateY(8px) scale(0.98); }
|
|
27
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes reke-dialog-out {
|
|
31
|
+
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
32
|
+
to { opacity: 0; transform: translateY(8px) scale(0.98); }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@keyframes reke-drawer-in-right {
|
|
36
|
+
from { transform: translateX(100%); }
|
|
37
|
+
to { transform: translateX(0); }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes reke-drawer-out-right {
|
|
41
|
+
from { transform: translateX(0); }
|
|
42
|
+
to { transform: translateX(100%); }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes reke-drawer-in-left {
|
|
46
|
+
from { transform: translateX(-100%); }
|
|
47
|
+
to { transform: translateX(0); }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes reke-drawer-out-left {
|
|
51
|
+
from { transform: translateX(0); }
|
|
52
|
+
to { transform: translateX(-100%); }
|
|
53
|
+
}
|
|
54
|
+
|
|
9
55
|
/* === Backdrop === */
|
|
10
56
|
|
|
11
57
|
.backdrop {
|
|
@@ -17,6 +63,11 @@ var n = [e, t`
|
|
|
17
63
|
align-items: center;
|
|
18
64
|
justify-content: center;
|
|
19
65
|
z-index: 1000;
|
|
66
|
+
animation: reke-backdrop-in 200ms ease-out both;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.backdrop.is-closing {
|
|
70
|
+
animation: reke-backdrop-out 180ms ease-in both;
|
|
20
71
|
}
|
|
21
72
|
|
|
22
73
|
.backdrop--drawer {
|
|
@@ -48,6 +99,11 @@ var n = [e, t`
|
|
|
48
99
|
ui-monospace,
|
|
49
100
|
monospace
|
|
50
101
|
);
|
|
102
|
+
animation: reke-dialog-in 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dialog.is-closing {
|
|
106
|
+
animation: reke-dialog-out 160ms ease-in both;
|
|
51
107
|
}
|
|
52
108
|
|
|
53
109
|
/* === Drawer === */
|
|
@@ -70,10 +126,33 @@ var n = [e, t`
|
|
|
70
126
|
|
|
71
127
|
.drawer--right {
|
|
72
128
|
border-left: 1px solid var(--reke-color-border, #252525);
|
|
129
|
+
animation: reke-drawer-in-right 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.drawer--right.is-closing {
|
|
133
|
+
animation: reke-drawer-out-right 200ms ease-in both;
|
|
73
134
|
}
|
|
74
135
|
|
|
75
136
|
.drawer--left {
|
|
76
137
|
border-right: 1px solid var(--reke-color-border, #252525);
|
|
138
|
+
animation: reke-drawer-in-left 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.drawer--left.is-closing {
|
|
142
|
+
animation: reke-drawer-out-left 200ms ease-in both;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/*
|
|
146
|
+
* At rest the panel must carry NO transform. animation-fill-mode both keeps
|
|
147
|
+
* the last keyframe applied, and a transformed element becomes the
|
|
148
|
+
* containing block for its position-fixed descendants, so every floating
|
|
149
|
+
* layer inside the dialog is silently relocated: combobox dropdowns and
|
|
150
|
+
* menus compute viewport coordinates that then resolve against the panel.
|
|
151
|
+
*/
|
|
152
|
+
.dialog.is-settled,
|
|
153
|
+
.drawer.is-settled {
|
|
154
|
+
animation: none;
|
|
155
|
+
transform: none;
|
|
77
156
|
}
|
|
78
157
|
|
|
79
158
|
/* === Shared parts === */
|
|
@@ -127,6 +206,37 @@ var n = [e, t`
|
|
|
127
206
|
gap: 8px;
|
|
128
207
|
flex-shrink: 0;
|
|
129
208
|
}
|
|
209
|
+
|
|
210
|
+
/* === Small screens ===
|
|
211
|
+
A 400px drawer on a phone leaves a dead strip of backdrop beside it and
|
|
212
|
+
squeezes the content. Below 480px both variants go full-bleed. */
|
|
213
|
+
|
|
214
|
+
@media (max-width: 480px) {
|
|
215
|
+
.drawer {
|
|
216
|
+
width: 100%;
|
|
217
|
+
max-width: 100%;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dialog {
|
|
221
|
+
min-width: 0;
|
|
222
|
+
width: calc(100% - 32px);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* The component also skips the closing state under this preference, so the
|
|
227
|
+
panel unmounts at once instead of sitting still for the exit duration. */
|
|
228
|
+
@media (prefers-reduced-motion: reduce) {
|
|
229
|
+
.backdrop,
|
|
230
|
+
.backdrop.is-closing,
|
|
231
|
+
.dialog,
|
|
232
|
+
.dialog.is-closing,
|
|
233
|
+
.drawer--right,
|
|
234
|
+
.drawer--right.is-closing,
|
|
235
|
+
.drawer--left,
|
|
236
|
+
.drawer--left.is-closing {
|
|
237
|
+
animation: none;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
130
240
|
`];
|
|
131
241
|
//#endregion
|
|
132
242
|
export { n as styles };
|
|
@@ -15,11 +15,26 @@ export interface PieChartSelectDetail {
|
|
|
15
15
|
* @tag reke-pie-chart
|
|
16
16
|
* @summary A circular (pie / donut) chart rendered with ECharts, isolated in Shadow DOM.
|
|
17
17
|
*
|
|
18
|
+
* Canvas cannot resolve `var()`, so every token below is read off the host's
|
|
19
|
+
* computed style and re-read whenever `data-reke-theme` or the OS color scheme
|
|
20
|
+
* changes on the document.
|
|
21
|
+
*
|
|
18
22
|
* @csspart chart - The chart canvas container.
|
|
23
|
+
* @csspart center - The donut center overlay (total, or the hovered slice).
|
|
19
24
|
*
|
|
20
25
|
* @fires reke-pie-chart-select - Fired when a slice is clicked. `detail: { name, value, percent }`.
|
|
21
26
|
*
|
|
22
|
-
* @cssprop [--reke-
|
|
27
|
+
* @cssprop [--reke-chart-1=#22C55E] - Slice colors 1–6 (`--reke-chart-1` … `--reke-chart-6`).
|
|
28
|
+
* @cssprop [--reke-pie-chart-height=240px] - Chart height when `size` is not set.
|
|
29
|
+
* @cssprop [--reke-color-primary=#22C55E] - Loading spinner color.
|
|
30
|
+
* @cssprop [--reke-color-bg=#0A0A0B] - Loading mask tint.
|
|
31
|
+
* @cssprop [--reke-color-surface=#1A1A1A] - Tooltip background.
|
|
32
|
+
* @cssprop [--reke-color-border=#252525] - Tooltip border.
|
|
33
|
+
* @cssprop [--reke-color-text=#E5E5E5] - Center value, labels and tooltip text.
|
|
34
|
+
* @cssprop [--reke-color-text-label=#8A8A8A] - Legend and center caption text.
|
|
35
|
+
* @cssprop [--reke-color-text-disabled=#3B3B3B] - Legend items toggled off.
|
|
36
|
+
* @cssprop [--reke-color-border-hover=#3A3A3A] - Pie label connector lines.
|
|
37
|
+
* @cssprop [--reke-font-mono=JetBrains Mono] - Chart font family.
|
|
23
38
|
*/
|
|
24
39
|
export declare class RekePieChart extends RekeElement {
|
|
25
40
|
static styles: import("lit").CSSResult[];
|
|
@@ -37,18 +52,54 @@ export declare class RekePieChart extends RekeElement {
|
|
|
37
52
|
loading: boolean;
|
|
38
53
|
/** Explicit color palette. Overrides the `--reke-chart-*` tokens when set. */
|
|
39
54
|
palette?: string[];
|
|
55
|
+
/** Caption under the total in the donut center. */
|
|
56
|
+
centerLabel: string;
|
|
57
|
+
/** Hide the donut center overlay (total / hovered slice). */
|
|
58
|
+
hideCenter: boolean;
|
|
59
|
+
/** Entry/update animation length in ms. `0` disables animation. */
|
|
60
|
+
animationDuration: number;
|
|
40
61
|
private chart?;
|
|
41
62
|
private observer?;
|
|
63
|
+
private visibility?;
|
|
64
|
+
private themeObserver?;
|
|
65
|
+
private colorScheme?;
|
|
66
|
+
/** Slice under the pointer; the donut center shows it instead of the total. */
|
|
67
|
+
private hovered?;
|
|
68
|
+
/** Slices toggled off from the legend, excluded from the center total. */
|
|
69
|
+
private hiddenNames;
|
|
70
|
+
/**
|
|
71
|
+
* The entry animation is held back until the chart is actually on screen.
|
|
72
|
+
* ECharts animates the moment `setOption` runs, so a chart mounted below the
|
|
73
|
+
* fold plays its reveal into a canvas nobody is looking at and is already
|
|
74
|
+
* static by the time it is scrolled to.
|
|
75
|
+
*/
|
|
76
|
+
private revealed;
|
|
42
77
|
/** Read a CSS custom property off the host's computed style (canvas can't read var()). */
|
|
43
78
|
private readToken;
|
|
79
|
+
/** Honours the OS "reduce motion" setting: 0ms means ECharts paints statically. */
|
|
80
|
+
private motionDuration;
|
|
44
81
|
private resolvePalette;
|
|
45
82
|
firstUpdated(): void;
|
|
83
|
+
/** Repaints with freshly read tokens when the theme switches. */
|
|
84
|
+
private watchTheme;
|
|
85
|
+
/** Static repaint: a theme switch should not replay the entry animation. */
|
|
86
|
+
private repaint;
|
|
87
|
+
private inViewport;
|
|
88
|
+
/**
|
|
89
|
+
* Reveals on first intersection and then stops observing: the animation is an
|
|
90
|
+
* entrance, not something to replay on every scroll past.
|
|
91
|
+
*/
|
|
92
|
+
private watchVisibility;
|
|
93
|
+
private reveal;
|
|
46
94
|
updated(changed: PropertyValues): void;
|
|
47
95
|
private applyLoading;
|
|
48
96
|
disconnectedCallback(): void;
|
|
49
97
|
private get total();
|
|
98
|
+
private get showCenter();
|
|
99
|
+
private get visibleTotal();
|
|
50
100
|
private get chartAriaLabel();
|
|
51
101
|
private buildOption;
|
|
102
|
+
private renderCenter;
|
|
52
103
|
render(): import("lit-html").TemplateResult<1>;
|
|
53
104
|
}
|
|
54
105
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-pie-chart.d.ts","sourceRoot":"","sources":["../../../src/components/reke-pie-chart/reke-pie-chart.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"reke-pie-chart.d.ts","sourceRoot":"","sources":["../../../src/components/reke-pie-chart/reke-pie-chart.ts"],"names":[],"mappings":"AAUA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAO3D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAA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CAAC,eAAe;IAiBvB,OAAO,CAAC,MAAM;IAQL,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAkB/C,OAAO,CAAC,YAAY;IAaX,oBAAoB,IAAI,IAAI;IAarC,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,cAAc,GAGzB;IAED,OAAO,CAAC,WAAW;IAsFnB,OAAO,CAAC,YAAY;IAiBX,MAAM;CAchB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -1,86 +1,206 @@
|
|
|
1
1
|
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
2
|
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { install as o } from "../../node_modules/echarts/lib/component/
|
|
8
|
-
import { install as s } from "../../node_modules/echarts/lib/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { encodeHTML as n } from "../../node_modules/zrender/lib/core/dom.js";
|
|
4
|
+
import { install as r } from "../../node_modules/echarts/lib/chart/pie/install.js";
|
|
5
|
+
import { init as i } from "../../node_modules/echarts/lib/core/echarts.js";
|
|
6
|
+
import { use as a } from "../../node_modules/echarts/lib/extension.js";
|
|
7
|
+
import { install as o } from "../../node_modules/echarts/lib/component/tooltip/install.js";
|
|
8
|
+
import { install as s } from "../../node_modules/echarts/lib/component/legend/install.js";
|
|
9
|
+
import { install as c } from "../../node_modules/echarts/lib/renderer/installCanvasRenderer.js";
|
|
10
|
+
import { styles as l } from "./reke-pie-chart.styles.js";
|
|
11
|
+
import { html as u, nothing as d } from "lit";
|
|
12
|
+
import { customElement as f, property as p, state as m } from "lit/decorators.js";
|
|
12
13
|
//#region src/components/reke-pie-chart/reke-pie-chart.ts
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
a,
|
|
14
|
+
a([
|
|
15
|
+
r,
|
|
16
16
|
o,
|
|
17
|
-
s
|
|
17
|
+
s,
|
|
18
|
+
c
|
|
18
19
|
]);
|
|
19
|
-
var
|
|
20
|
+
var h = [
|
|
20
21
|
"#22C55E",
|
|
21
22
|
"#3B82F6",
|
|
22
23
|
"#F59E0B",
|
|
23
24
|
"#EF4444",
|
|
24
25
|
"#A855F7",
|
|
25
26
|
"#14B8A6"
|
|
26
|
-
],
|
|
27
|
+
], g = new Intl.NumberFormat(void 0, {
|
|
28
|
+
notation: "compact",
|
|
29
|
+
maximumFractionDigits: 1
|
|
30
|
+
});
|
|
31
|
+
function _(e, t) {
|
|
32
|
+
let n = e.trim().replace("#", ""), r = n.length === 3 ? [...n].map((e) => e + e).join("") : n;
|
|
33
|
+
if (!/^[0-9a-f]{6}$/i.test(r)) return `rgba(0, 0, 0, ${t})`;
|
|
34
|
+
let [i, a, o] = [
|
|
35
|
+
0,
|
|
36
|
+
2,
|
|
37
|
+
4
|
|
38
|
+
].map((e) => Number.parseInt(r.slice(e, e + 2), 16));
|
|
39
|
+
return `rgba(${i}, ${a}, ${o}, ${t})`;
|
|
40
|
+
}
|
|
41
|
+
var v = class extends e {
|
|
27
42
|
constructor(...e) {
|
|
28
|
-
super(...e), this.data = [], this.variant = "donut", this.label = "Pie chart", this.showLegend = !1, this.loading = !1
|
|
43
|
+
super(...e), this.data = [], this.variant = "donut", this.label = "Pie chart", this.showLegend = !1, this.loading = !1, this.centerLabel = "Total", this.hideCenter = !1, this.animationDuration = 700, this.hiddenNames = /* @__PURE__ */ new Set(), this.revealed = !1, this.repaint = () => {
|
|
44
|
+
this.chart?.setOption(this.buildOption(!1), !0), this.applyLoading();
|
|
45
|
+
};
|
|
29
46
|
}
|
|
30
47
|
static {
|
|
31
|
-
this.styles =
|
|
48
|
+
this.styles = l;
|
|
32
49
|
}
|
|
33
50
|
readToken(e, t) {
|
|
34
51
|
return getComputedStyle(this).getPropertyValue(e).trim() || t;
|
|
35
52
|
}
|
|
53
|
+
motionDuration() {
|
|
54
|
+
return typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : Math.max(0, this.animationDuration);
|
|
55
|
+
}
|
|
36
56
|
resolvePalette() {
|
|
37
|
-
return this.palette?.length ? this.palette :
|
|
57
|
+
return this.palette?.length ? this.palette : h.map((e, t) => this.readToken(`--reke-chart-${t + 1}`, e));
|
|
38
58
|
}
|
|
39
59
|
firstUpdated() {
|
|
40
60
|
let e = this.renderRoot.querySelector(".chart");
|
|
41
|
-
this.chart =
|
|
61
|
+
this.chart = i(e), this.inViewport() ? (this.revealed = !0, this.chart.setOption(this.buildOption(!0))) : (this.chart.setOption(this.buildOption(!1)), this.watchVisibility()), this.applyLoading(), this.chart.on("mouseover", (e) => {
|
|
62
|
+
e.componentType === "series" && (this.hovered = {
|
|
63
|
+
name: String(e.name),
|
|
64
|
+
value: Number(e.value),
|
|
65
|
+
percent: Number(e.percent ?? 0)
|
|
66
|
+
});
|
|
67
|
+
}), this.chart.on("mouseout", () => {
|
|
68
|
+
this.hovered = void 0;
|
|
69
|
+
});
|
|
70
|
+
let t = (e) => {
|
|
71
|
+
let { selected: t } = e;
|
|
72
|
+
this.hiddenNames = new Set(Object.keys(t).filter((e) => !t[e]));
|
|
73
|
+
};
|
|
74
|
+
for (let e of [
|
|
75
|
+
"legendselectchanged",
|
|
76
|
+
"legendselected",
|
|
77
|
+
"legendunselected",
|
|
78
|
+
"legendselectall",
|
|
79
|
+
"legendinverseselect"
|
|
80
|
+
]) this.chart.on(e, t);
|
|
81
|
+
this.chart.on("click", (e) => {
|
|
42
82
|
this.emit("reke-pie-chart-select", {
|
|
43
83
|
name: String(e.name),
|
|
44
84
|
value: Number(e.value),
|
|
45
85
|
percent: Number(e.percent ?? 0)
|
|
46
86
|
});
|
|
47
|
-
}), this.observer = new ResizeObserver(() => this.chart?.resize()), this.observer.observe(e);
|
|
87
|
+
}), this.observer = new ResizeObserver(() => this.chart?.resize()), this.observer.observe(e), this.watchTheme();
|
|
88
|
+
}
|
|
89
|
+
watchTheme() {
|
|
90
|
+
this.themeObserver = new MutationObserver(() => this.repaint()), this.themeObserver.observe(document.documentElement, {
|
|
91
|
+
attributes: !0,
|
|
92
|
+
attributeFilter: ["data-reke-theme"]
|
|
93
|
+
}), typeof matchMedia == "function" && (this.colorScheme = matchMedia("(prefers-color-scheme: light)"), this.colorScheme.addEventListener("change", this.repaint));
|
|
94
|
+
}
|
|
95
|
+
inViewport() {
|
|
96
|
+
let e = this.getBoundingClientRect(), t = window.innerHeight || document.documentElement.clientHeight;
|
|
97
|
+
return e.top < t && e.bottom > 0;
|
|
98
|
+
}
|
|
99
|
+
watchVisibility() {
|
|
100
|
+
if (typeof IntersectionObserver > "u") {
|
|
101
|
+
this.reveal();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.visibility = new IntersectionObserver((e) => {
|
|
105
|
+
e.some((e) => e.isIntersecting) && this.reveal();
|
|
106
|
+
}, { threshold: .2 }), this.visibility.observe(this);
|
|
107
|
+
}
|
|
108
|
+
reveal() {
|
|
109
|
+
this.revealed || (this.revealed = !0, this.visibility?.disconnect(), this.visibility = void 0, this.chart?.setOption(this.buildOption(!0), !0));
|
|
48
110
|
}
|
|
49
111
|
updated(e) {
|
|
50
|
-
this.chart && ((e.has("data") || e.has("variant") || e.has("showLegend") || e.has("palette")) && this.chart.setOption(this.buildOption(), !0), e.has("loading") && this.applyLoading());
|
|
112
|
+
this.chart && ((e.has("data") || e.has("variant") || e.has("showLegend") || e.has("palette") || e.has("animationDuration")) && (e.has("data") && (this.hiddenNames = /* @__PURE__ */ new Set()), this.chart.setOption(this.buildOption(this.revealed), !0)), e.has("loading") && this.applyLoading());
|
|
51
113
|
}
|
|
52
114
|
applyLoading() {
|
|
53
115
|
this.loading ? this.chart?.showLoading("default", {
|
|
54
116
|
text: "",
|
|
55
117
|
color: this.readToken("--reke-color-primary", "#22C55E"),
|
|
56
|
-
maskColor: "
|
|
118
|
+
maskColor: _(this.readToken("--reke-color-bg", "#0A0A0B"), .6)
|
|
57
119
|
}) : this.chart?.hideLoading();
|
|
58
120
|
}
|
|
59
121
|
disconnectedCallback() {
|
|
60
|
-
super.disconnectedCallback(), this.observer?.disconnect(), this.chart?.dispose(), this.chart = void 0;
|
|
122
|
+
this.visibility?.disconnect(), this.visibility = void 0, this.themeObserver?.disconnect(), this.themeObserver = void 0, this.colorScheme?.removeEventListener("change", this.repaint), this.colorScheme = void 0, super.disconnectedCallback(), this.observer?.disconnect(), this.chart?.dispose(), this.chart = void 0;
|
|
61
123
|
}
|
|
62
124
|
get total() {
|
|
63
125
|
return this.data.reduce((e, t) => e + t.value, 0) || 1;
|
|
64
126
|
}
|
|
127
|
+
get showCenter() {
|
|
128
|
+
return this.variant === "donut" && !this.hideCenter;
|
|
129
|
+
}
|
|
130
|
+
get visibleTotal() {
|
|
131
|
+
return this.data.reduce((e, t) => this.hiddenNames.has(t.name) ? e : e + t.value, 0);
|
|
132
|
+
}
|
|
65
133
|
get chartAriaLabel() {
|
|
66
134
|
let e = this.data.map((e) => `${e.name} ${Math.round(e.value / this.total * 100)}%`);
|
|
67
135
|
return `${this.label}. ${e.join(", ")}`;
|
|
68
136
|
}
|
|
69
|
-
buildOption() {
|
|
137
|
+
buildOption(e) {
|
|
138
|
+
let t = e ? this.motionDuration() : 0, r = this.variant === "donut", i = this.readToken("--reke-font-mono", "'JetBrains Mono', ui-monospace, monospace"), a = this.readToken("--reke-color-text", "#E5E5E5"), o = this.readToken("--reke-color-surface", "#1A1A1A");
|
|
70
139
|
return {
|
|
71
140
|
color: this.resolvePalette(),
|
|
141
|
+
animation: t > 0,
|
|
142
|
+
animationDuration: t,
|
|
143
|
+
animationEasing: "cubicOut",
|
|
72
144
|
aria: { enabled: !0 },
|
|
145
|
+
textStyle: { fontFamily: i },
|
|
73
146
|
tooltip: {
|
|
147
|
+
show: !this.showCenter,
|
|
74
148
|
trigger: "item",
|
|
75
|
-
|
|
149
|
+
backgroundColor: o,
|
|
150
|
+
borderColor: this.readToken("--reke-color-border", "#252525"),
|
|
151
|
+
borderWidth: .5,
|
|
152
|
+
padding: [8, 12],
|
|
153
|
+
textStyle: {
|
|
154
|
+
color: a,
|
|
155
|
+
fontFamily: i,
|
|
156
|
+
fontSize: 12
|
|
157
|
+
},
|
|
158
|
+
extraCssText: `background: linear-gradient(180deg, #FFFFFF10 0%, #FFFFFF05 100%), ${o}; backdrop-filter: blur(40px); box-shadow: 0 12px 60px -2px #00000040; border-radius: 4px;`,
|
|
159
|
+
formatter: (e) => {
|
|
160
|
+
let t = e, r = n(t.name);
|
|
161
|
+
return `<span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${t.color};margin-right:8px;"></span>${r}<span style="margin-left:12px;font-weight:600;">${t.percent}%</span>`;
|
|
162
|
+
}
|
|
76
163
|
},
|
|
77
|
-
legend: this.showLegend ? {
|
|
164
|
+
legend: this.showLegend ? {
|
|
165
|
+
bottom: 0,
|
|
166
|
+
icon: "circle",
|
|
167
|
+
itemWidth: 8,
|
|
168
|
+
itemHeight: 8,
|
|
169
|
+
itemGap: 16,
|
|
170
|
+
textStyle: {
|
|
171
|
+
color: this.readToken("--reke-color-text-label", "#8A8A8A"),
|
|
172
|
+
fontFamily: i,
|
|
173
|
+
fontSize: 12
|
|
174
|
+
},
|
|
175
|
+
inactiveColor: this.readToken("--reke-color-text-disabled", "#3B3B3B")
|
|
176
|
+
} : void 0,
|
|
78
177
|
series: [{
|
|
79
178
|
type: "pie",
|
|
80
|
-
radius:
|
|
179
|
+
radius: r ? ["58%", "78%"] : "75%",
|
|
81
180
|
center: ["50%", this.showLegend ? "45%" : "50%"],
|
|
82
181
|
avoidLabelOverlap: !0,
|
|
83
|
-
|
|
182
|
+
padAngle: r ? 2 : 1,
|
|
183
|
+
itemStyle: { borderRadius: r ? 6 : 4 },
|
|
184
|
+
label: {
|
|
185
|
+
show: !r,
|
|
186
|
+
color: a,
|
|
187
|
+
fontFamily: i,
|
|
188
|
+
fontSize: 12
|
|
189
|
+
},
|
|
190
|
+
labelLine: { lineStyle: { color: this.readToken("--reke-color-border-hover", "#3A3A3A") } },
|
|
191
|
+
emphasis: {
|
|
192
|
+
scale: !0,
|
|
193
|
+
scaleSize: 6,
|
|
194
|
+
focus: "self",
|
|
195
|
+
itemStyle: {
|
|
196
|
+
shadowBlur: 20,
|
|
197
|
+
shadowColor: "rgba(0, 0, 0, 0.35)"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
blur: { itemStyle: { opacity: .35 } },
|
|
201
|
+
animationType: "expansion",
|
|
202
|
+
animationTypeUpdate: "transition",
|
|
203
|
+
animationDelay: (e) => Math.min(e, 12) * 45,
|
|
84
204
|
data: this.data.map((e) => ({
|
|
85
205
|
name: e.name,
|
|
86
206
|
value: e.value,
|
|
@@ -89,29 +209,48 @@ var f = [
|
|
|
89
209
|
}]
|
|
90
210
|
};
|
|
91
211
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
212
|
+
renderCenter() {
|
|
213
|
+
if (!this.showCenter) return d;
|
|
214
|
+
let e = this.hovered;
|
|
215
|
+
return u`
|
|
95
216
|
<div
|
|
96
|
-
part="
|
|
97
|
-
class="
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
217
|
+
part="center"
|
|
218
|
+
class="center ${this.showLegend ? "center--legend" : ""}"
|
|
219
|
+
aria-hidden="true"
|
|
220
|
+
>
|
|
221
|
+
<span class="center-value"
|
|
222
|
+
>${e ? `${e.percent}%` : g.format(this.visibleTotal)}</span
|
|
223
|
+
>
|
|
224
|
+
<span class="center-caption">${e ? e.name : this.centerLabel}</span>
|
|
225
|
+
</div>
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
render() {
|
|
229
|
+
return u`
|
|
230
|
+
<div class="frame" style=${this.size ? `width:${this.size}px;height:${this.size}px;` : ""}>
|
|
231
|
+
<div part="chart" class="chart" role="img" aria-label=${this.chartAriaLabel}></div>
|
|
232
|
+
${this.renderCenter()}
|
|
233
|
+
</div>
|
|
102
234
|
<ul class="sr-only">
|
|
103
|
-
${this.data.map((e) =>
|
|
235
|
+
${this.data.map((e) => u`<li>${e.name}: ${Math.round(e.value / this.total * 100)}%</li>`)}
|
|
104
236
|
</ul>
|
|
105
237
|
`;
|
|
106
238
|
}
|
|
107
239
|
};
|
|
108
|
-
t([
|
|
240
|
+
t([p({ attribute: !1 })], v.prototype, "data", void 0), t([p({ reflect: !0 })], v.prototype, "variant", void 0), t([p()], v.prototype, "label", void 0), t([p({ type: Number })], v.prototype, "size", void 0), t([p({
|
|
109
241
|
type: Boolean,
|
|
110
242
|
attribute: "show-legend",
|
|
111
243
|
reflect: !0
|
|
112
|
-
})],
|
|
244
|
+
})], v.prototype, "showLegend", void 0), t([p({
|
|
245
|
+
type: Boolean,
|
|
246
|
+
reflect: !0
|
|
247
|
+
})], v.prototype, "loading", void 0), t([p({ attribute: !1 })], v.prototype, "palette", void 0), t([p({ attribute: "center-label" })], v.prototype, "centerLabel", void 0), t([p({
|
|
113
248
|
type: Boolean,
|
|
249
|
+
attribute: "hide-center",
|
|
114
250
|
reflect: !0
|
|
115
|
-
})],
|
|
251
|
+
})], v.prototype, "hideCenter", void 0), t([p({
|
|
252
|
+
type: Number,
|
|
253
|
+
attribute: "animation-duration"
|
|
254
|
+
})], v.prototype, "animationDuration", void 0), t([m()], v.prototype, "hovered", void 0), t([m()], v.prototype, "hiddenNames", void 0), v = t([f("reke-pie-chart")], v);
|
|
116
255
|
//#endregion
|
|
117
|
-
export {
|
|
256
|
+
export { v as RekePieChart };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-pie-chart.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-pie-chart/reke-pie-chart.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-pie-chart.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-pie-chart/reke-pie-chart.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAwElB,CAAC"}
|
|
@@ -7,8 +7,55 @@ var n = [e, t`
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.frame {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: var(--reke-pie-chart-height, 240px);
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
.chart {
|
|
11
17
|
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Sits over the donut hole; positioned to match the series center in buildOption(). */
|
|
23
|
+
.center {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 50%;
|
|
26
|
+
left: 50%;
|
|
27
|
+
transform: translate(-50%, -50%);
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 2px;
|
|
32
|
+
max-width: 44%;
|
|
33
|
+
text-align: center;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.center--legend {
|
|
39
|
+
top: 45%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.center-value {
|
|
43
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
44
|
+
font-size: var(--reke-font-size-lg, 18px);
|
|
45
|
+
font-weight: var(--reke-font-weight-semibold, 600);
|
|
46
|
+
line-height: 1.1;
|
|
47
|
+
font-variant-numeric: tabular-nums;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.center-caption {
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
color: var(--reke-color-text-label, #8A8A8A);
|
|
56
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
57
|
+
letter-spacing: 0.04em;
|
|
58
|
+
text-transform: uppercase;
|
|
12
59
|
}
|
|
13
60
|
|
|
14
61
|
/* Visually hidden but readable by screen readers — canvas is opaque to AT. */
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export type { AlertVariant } from './components/reke-alert/reke-alert.js';
|
|
|
2
2
|
export { RekeAlert } from './components/reke-alert/reke-alert.js';
|
|
3
3
|
export type { BadgeShape, BadgeSize, BadgeVariant } from './components/reke-badge/reke-badge.js';
|
|
4
4
|
export { RekeBadge } from './components/reke-badge/reke-badge.js';
|
|
5
|
+
export type { BarChartSelectDetail, BarChartSeries, } from './components/reke-bar-chart/reke-bar-chart.js';
|
|
6
|
+
export { RekeBarChart } from './components/reke-bar-chart/reke-bar-chart.js';
|
|
5
7
|
export type { ButtonSize, ButtonVariant } from './components/reke-button/reke-button.js';
|
|
6
8
|
export { RekeButton } from './components/reke-button/reke-button.js';
|
|
7
9
|
export type { CardAccent, CardPadding, CardVariant } from './components/reke-card/reke-card.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CA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