@iyulab/u-widgets 0.11.0 → 0.11.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/tokens-CoFJ5AA5.js +48 -0
- package/dist/tokens-CoFJ5AA5.js.map +1 -0
- package/dist/u-widgets-charts.js +1 -1
- package/dist/u-widgets-math.js +1 -1
- package/dist/u-widgets-react.d.ts +2 -2
- package/dist/u-widgets.d.ts +3 -3
- package/dist/u-widgets.js +7 -14
- package/dist/u-widgets.js.map +1 -1
- package/package.json +1 -1
- package/dist/tokens-byMop3gk.js +0 -64
- package/dist/tokens-byMop3gk.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { css as e } from "lit";
|
|
2
|
+
const a = e`
|
|
3
|
+
:host {
|
|
4
|
+
color-scheme: light dark;
|
|
5
|
+
|
|
6
|
+
/* ── Colors ── */
|
|
7
|
+
--u-widget-bg: light-dark(#fff, #1e1e2e);
|
|
8
|
+
--u-widget-surface: light-dark(#f1f5f9, #2a2a3e);
|
|
9
|
+
--u-widget-text: light-dark(#1a1a2e, #e2e8f0);
|
|
10
|
+
--u-widget-text-secondary: light-dark(#64748b, #94a3b8);
|
|
11
|
+
--u-widget-border: light-dark(#e2e8f0, #374151);
|
|
12
|
+
--u-widget-primary: light-dark(#4f46e5, #818cf8);
|
|
13
|
+
--u-widget-positive: light-dark(#16a34a, #4ade80);
|
|
14
|
+
--u-widget-negative: light-dark(#dc2626, #f87171);
|
|
15
|
+
--u-widget-warning: light-dark(#d97706, #fbbf24);
|
|
16
|
+
|
|
17
|
+
/* ── Spacing ── */
|
|
18
|
+
--u-widget-gap: 16px;
|
|
19
|
+
--u-widget-radius: 6px;
|
|
20
|
+
|
|
21
|
+
/* ── Typography ── */
|
|
22
|
+
--u-widget-font-family: system-ui, -apple-system, sans-serif;
|
|
23
|
+
--u-widget-font-size: 0.875rem;
|
|
24
|
+
|
|
25
|
+
/* ── Chart ── */
|
|
26
|
+
--u-widget-chart-height: 300px;
|
|
27
|
+
|
|
28
|
+
/* ── Shadow ── */
|
|
29
|
+
--u-widget-shadow:
|
|
30
|
+
0 1px 3px light-dark(rgba(0,0,0,0.08), rgba(0,0,0,0.3)),
|
|
31
|
+
0 1px 2px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.2));
|
|
32
|
+
--u-widget-shadow-hover:
|
|
33
|
+
0 4px 12px light-dark(rgba(0,0,0,0.10), rgba(0,0,0,0.4)),
|
|
34
|
+
0 2px 4px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.2));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([theme="dark"]) {
|
|
38
|
+
color-scheme: dark;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([theme="light"]) {
|
|
42
|
+
color-scheme: light;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
export {
|
|
46
|
+
a as t
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=tokens-CoFJ5AA5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-CoFJ5AA5.js","sources":["../src/styles/tokens.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * Shared CSS custom property tokens for all u-widget elements.\n *\n * **Token categories:**\n * - Colors: bg, surface, text, text-secondary, border, primary, positive, negative, warning\n * - Spacing: gap, radius\n * - Typography: font-family, font-size\n * - Chart: chart-height, chart-color-1..10\n *\n * **Theme modes:**\n * Uses CSS `color-scheme` + `light-dark()` for automatic dark/light adaptation.\n * 1. Auto mode: `:host` declares `color-scheme: light dark` — inherits from parent\n * or falls back to `prefers-color-scheme`.\n * 2. Manual override: `theme=\"dark\"` or `theme=\"light\"` forces `color-scheme`.\n *\n * Host applications can override any `--u-widget-*` variable by styling the\n * element directly (e.g., `u-widget { --u-widget-text: blue; }`).\n */\nexport const themeStyles = css`\n :host {\n color-scheme: light dark;\n\n /* ── Colors ── */\n --u-widget-bg: light-dark(#fff, #1e1e2e);\n --u-widget-surface: light-dark(#f1f5f9, #2a2a3e);\n --u-widget-text: light-dark(#1a1a2e, #e2e8f0);\n --u-widget-text-secondary: light-dark(#64748b, #94a3b8);\n --u-widget-border: light-dark(#e2e8f0, #374151);\n --u-widget-primary: light-dark(#4f46e5, #818cf8);\n --u-widget-positive: light-dark(#16a34a, #4ade80);\n --u-widget-negative: light-dark(#dc2626, #f87171);\n --u-widget-warning: light-dark(#d97706, #fbbf24);\n\n /* ── Spacing ── */\n --u-widget-gap: 16px;\n --u-widget-radius: 6px;\n\n /* ── Typography ── */\n --u-widget-font-family: system-ui, -apple-system, sans-serif;\n --u-widget-font-size: 0.875rem;\n\n /* ── Chart ── */\n --u-widget-chart-height: 300px;\n\n /* ── Shadow ── */\n --u-widget-shadow:\n 0 1px 3px light-dark(rgba(0,0,0,0.08), rgba(0,0,0,0.3)),\n 0 1px 2px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.2));\n --u-widget-shadow-hover:\n 0 4px 12px light-dark(rgba(0,0,0,0.10), rgba(0,0,0,0.4)),\n 0 2px 4px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.2));\n }\n\n :host([theme=\"dark\"]) {\n color-scheme: dark;\n }\n\n :host([theme=\"light\"]) {\n color-scheme: light;\n }\n`;\n"],"names":["themeStyles","css"],"mappings":";AAoBO,MAAMA,IAAcC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/dist/u-widgets-charts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as E, LitElement as P, nothing as T, html as R } from "lit";
|
|
2
2
|
import { property as $, customElement as B } from "lit/decorators.js";
|
|
3
3
|
import { a as W, f as q } from "./format-DiXp3HTj.js";
|
|
4
|
-
import { t as G } from "./tokens-
|
|
4
|
+
import { t as G } from "./tokens-CoFJ5AA5.js";
|
|
5
5
|
import * as O from "echarts/core";
|
|
6
6
|
import { BarChart as H, LineChart as U, PieChart as Y, ScatterChart as J, RadarChart as Q, HeatmapChart as X, BoxplotChart as Z, FunnelChart as K, TreemapChart as ee } from "echarts/charts";
|
|
7
7
|
import { GridComponent as te, TooltipComponent as re, LegendComponent as ie, RadarComponent as se, MarkLineComponent as ne, VisualMapComponent as oe } from "echarts/components";
|
package/dist/u-widgets-math.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css as m, LitElement as u, nothing as p, html as c } from "lit";
|
|
2
2
|
import { property as d, customElement as h } from "lit/decorators.js";
|
|
3
|
-
import { t as f } from "./tokens-
|
|
3
|
+
import { t as f } from "./tokens-CoFJ5AA5.js";
|
|
4
4
|
import g from "katex";
|
|
5
5
|
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, l = (o, t, a, r) => {
|
|
6
6
|
for (var e = r > 1 ? void 0 : r ? y(t, a) : t, s = o.length - 1, n; s >= 0; s--)
|
|
@@ -16,12 +16,12 @@ onWidgetEvent: EventName<CustomEvent>;
|
|
|
16
16
|
* <u-widget> — Entry point router element.
|
|
17
17
|
* Reads spec.widget and delegates to the appropriate sub-component.
|
|
18
18
|
*
|
|
19
|
-
* Supports theme attribute: theme="dark" | theme="light" | (auto via
|
|
19
|
+
* Supports theme attribute: theme="dark" | theme="light" | (auto via color-scheme inheritance)
|
|
20
20
|
*/
|
|
21
21
|
declare class UWidget_2 extends LitElement {
|
|
22
22
|
static styles: CSSResult[];
|
|
23
23
|
spec: UWidgetSpec | null;
|
|
24
|
-
/** Theme override: "dark" | "light" | null (auto via
|
|
24
|
+
/** Theme override: "dark" | "light" | null (auto via color-scheme inheritance). */
|
|
25
25
|
theme: string | null;
|
|
26
26
|
/** Locale tag (e.g. 'ko', 'en-US'). Propagated to sub-components via spec.options.locale. */
|
|
27
27
|
locale: string | null;
|
package/dist/u-widgets.d.ts
CHANGED
|
@@ -202,12 +202,12 @@ export declare function suggestWidget(input: string): string | undefined;
|
|
|
202
202
|
* <u-widget> — Entry point router element.
|
|
203
203
|
* Reads spec.widget and delegates to the appropriate sub-component.
|
|
204
204
|
*
|
|
205
|
-
* Supports theme attribute: theme="dark" | theme="light" | (auto via
|
|
205
|
+
* Supports theme attribute: theme="dark" | theme="light" | (auto via color-scheme inheritance)
|
|
206
206
|
*/
|
|
207
207
|
export declare class UWidget extends LitElement {
|
|
208
208
|
static styles: CSSResult[];
|
|
209
209
|
spec: UWidgetSpec | null;
|
|
210
|
-
/** Theme override: "dark" | "light" | null (auto via
|
|
210
|
+
/** Theme override: "dark" | "light" | null (auto via color-scheme inheritance). */
|
|
211
211
|
theme: string | null;
|
|
212
212
|
/** Locale tag (e.g. 'ko', 'en-US'). Propagated to sub-components via spec.options.locale. */
|
|
213
213
|
locale: string | null;
|
|
@@ -285,7 +285,7 @@ export declare interface UWidgetColumnDefinition {
|
|
|
285
285
|
export declare interface UWidgetElementProps {
|
|
286
286
|
/** Widget spec — object (via property binding) or JSON string (via attribute). */
|
|
287
287
|
spec?: UWidgetSpec | string;
|
|
288
|
-
/** Theme override. Omit for
|
|
288
|
+
/** Theme override. Omit for color-scheme auto-detection. */
|
|
289
289
|
theme?: 'light' | 'dark';
|
|
290
290
|
/** BCP 47 locale tag, e.g. 'ko-KR'. */
|
|
291
291
|
locale?: string;
|
package/dist/u-widgets.js
CHANGED
|
@@ -4,7 +4,7 @@ import { i as be } from "./infer-CNOiD2dS.js";
|
|
|
4
4
|
import { f as he, n as we } from "./format-DiXp3HTj.js";
|
|
5
5
|
import { css as b, LitElement as w, nothing as l, html as o } from "lit";
|
|
6
6
|
import { property as h, customElement as y, state as S } from "lit/decorators.js";
|
|
7
|
-
import { t as x } from "./tokens-
|
|
7
|
+
import { t as x } from "./tokens-CoFJ5AA5.js";
|
|
8
8
|
const ye = /* @__PURE__ */ new Set([
|
|
9
9
|
"text",
|
|
10
10
|
"email",
|
|
@@ -2534,9 +2534,8 @@ D.styles = [x, b`
|
|
|
2534
2534
|
|
|
2535
2535
|
.code-body {
|
|
2536
2536
|
overflow: auto;
|
|
2537
|
-
background: var(--u-widget-bg
|
|
2537
|
+
background: var(--u-widget-bg);
|
|
2538
2538
|
}
|
|
2539
|
-
:host([theme="dark"]) .code-body { background: #1e1e2e; }
|
|
2540
2539
|
|
|
2541
2540
|
pre {
|
|
2542
2541
|
margin: 0;
|
|
@@ -2562,22 +2561,16 @@ D.styles = [x, b`
|
|
|
2562
2561
|
}
|
|
2563
2562
|
|
|
2564
2563
|
.line-hl {
|
|
2565
|
-
background: rgba(79, 70, 229, 0.08);
|
|
2564
|
+
background: light-dark(rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0.15));
|
|
2566
2565
|
margin: 0 -12px;
|
|
2567
2566
|
padding: 0 12px;
|
|
2568
2567
|
}
|
|
2569
|
-
:host([theme="dark"]) .line-hl { background: rgba(79, 70, 229, 0.15); }
|
|
2570
2568
|
|
|
2571
2569
|
/* Syntax token colors */
|
|
2572
|
-
.hl-k { color: #8b5cf6; } /* keyword — purple */
|
|
2573
|
-
.hl-s { color: #059669; } /* string — green */
|
|
2574
|
-
.hl-c { color: #94a3b8; font-style: italic; } /* comment — gray */
|
|
2575
|
-
.hl-n { color: #d97706; } /* number — amber */
|
|
2576
|
-
|
|
2577
|
-
:host([theme="dark"]) .hl-k { color: #a78bfa; }
|
|
2578
|
-
:host([theme="dark"]) .hl-s { color: #34d399; }
|
|
2579
|
-
:host([theme="dark"]) .hl-c { color: #64748b; }
|
|
2580
|
-
:host([theme="dark"]) .hl-n { color: #fbbf24; }
|
|
2570
|
+
.hl-k { color: light-dark(#8b5cf6, #a78bfa); } /* keyword — purple */
|
|
2571
|
+
.hl-s { color: light-dark(#059669, #34d399); } /* string — green */
|
|
2572
|
+
.hl-c { color: light-dark(#94a3b8, #64748b); font-style: italic; } /* comment — gray */
|
|
2573
|
+
.hl-n { color: light-dark(#d97706, #fbbf24); } /* number — amber */
|
|
2581
2574
|
|
|
2582
2575
|
@container uw-code (max-width: 20rem) {
|
|
2583
2576
|
pre { font-size: 0.75rem; padding: 8px; }
|