@iyulab/u-widgets 0.9.2 → 0.11.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/u-widgets",
3
- "version": "0.9.2",
3
+ "version": "0.11.0",
4
4
  "description": "Declarative, data-driven widget system for visualization and input",
5
5
  "type": "module",
6
6
  "module": "./dist/u-widgets.js",
@@ -24,13 +24,22 @@
24
24
  "types": "./dist/u-widgets-tools.d.ts",
25
25
  "import": "./dist/u-widgets-tools.js"
26
26
  },
27
+ "./math": {
28
+ "types": "./dist/u-widgets-math.d.ts",
29
+ "import": "./dist/u-widgets-math.js"
30
+ },
31
+ "./react": {
32
+ "types": "./dist/u-widgets-react.d.ts",
33
+ "import": "./dist/u-widgets-react.js"
34
+ },
27
35
  "./themes/shadcn.css": "./dist/themes/shadcn.css"
28
36
  },
29
37
  "sideEffects": [
30
38
  "./src/elements/*.ts",
31
39
  "./dist/u-widgets.js",
32
40
  "./dist/u-widgets-charts.js",
33
- "./dist/u-widgets-forms.js"
41
+ "./dist/u-widgets-forms.js",
42
+ "./dist/u-widgets-math.js"
34
43
  ],
35
44
  "files": [
36
45
  "dist",
@@ -73,7 +82,10 @@
73
82
  },
74
83
  "peerDependencies": {
75
84
  "@formdown/core": "^0.4.0",
76
- "echarts": "^5.5.0 || ^6.0.0"
85
+ "@lit/react": "^1.0.0 || ^2.0.0",
86
+ "echarts": "^5.5.0 || ^6.0.0",
87
+ "katex": "^0.16.0",
88
+ "react": "^18.0.0 || ^19.0.0"
77
89
  },
78
90
  "peerDependenciesMeta": {
79
91
  "echarts": {
@@ -81,15 +93,28 @@
81
93
  },
82
94
  "@formdown/core": {
83
95
  "optional": true
96
+ },
97
+ "katex": {
98
+ "optional": true
99
+ },
100
+ "@lit/react": {
101
+ "optional": true
102
+ },
103
+ "react": {
104
+ "optional": true
84
105
  }
85
106
  },
86
107
  "devDependencies": {
108
+ "@lit/react": "^1.0.8",
87
109
  "@open-wc/testing": "^4.0.0",
88
110
  "@playwright/test": "^1.58.2",
111
+ "@types/react": "^19.2.14",
89
112
  "echarts": "^6.0.0",
90
113
  "eslint": "^9.0.0",
91
114
  "globals": "^15.0.0",
92
115
  "happy-dom": "^15.0.0",
116
+ "katex": "^0.16.38",
117
+ "react": "^19.2.4",
93
118
  "typescript": "~5.7.0",
94
119
  "typescript-eslint": "^8.0.0",
95
120
  "vite": "^6.0.0",
@@ -19,7 +19,7 @@
19
19
  "form", "confirm",
20
20
  "markdown", "image", "callout",
21
21
  "kv", "code", "citation", "status", "steps",
22
- "rating", "video", "gallery",
22
+ "rating", "video", "gallery", "math",
23
23
  "actions", "divider", "header"
24
24
  ],
25
25
  "description": "Widget type identifier"
@@ -1,213 +0,0 @@
1
- import { g as o } from "./formdown-BWJ6QGJs.js";
2
- import { css as g } from "lit";
3
- function b(e) {
4
- const t = { ...e };
5
- if (t.mapping && "fields" in t.mapping && !t.fields) {
6
- const { fields: r, ...i } = t.mapping;
7
- t.fields = r, t.mapping = Object.keys(i).length > 0 ? i : void 0;
8
- }
9
- if (t.formdown && !t.fields)
10
- try {
11
- const i = o()(t.formdown, t.data);
12
- t.fields = i.fields, i.actions.length > 0 && !t.actions && (t.actions = i.actions);
13
- } catch (r) {
14
- console.warn("[u-widget:normalize] Failed to parse formdown:", r.message);
15
- }
16
- return t;
17
- }
18
- function x(e) {
19
- const { y: t, ...r } = e;
20
- return {
21
- ...r,
22
- y: t == null ? void 0 : typeof t == "string" ? [t] : t
23
- };
24
- }
25
- const a = ["B", "KB", "MB", "GB", "TB"], d = /* @__PURE__ */ new Set([
26
- "KRW",
27
- "JPY",
28
- "VND",
29
- "IDR",
30
- "BIF",
31
- "CLP",
32
- "GNF",
33
- "ISK",
34
- "KMF",
35
- "MGA",
36
- "PYG",
37
- "RWF",
38
- "UGX",
39
- "UYI",
40
- "VUV",
41
- "XAF",
42
- "XOF",
43
- "XPF"
44
- ]);
45
- function N(e, t, r) {
46
- if (e == null) return "";
47
- const [i, n] = t?.split(":") ?? [];
48
- switch (i) {
49
- case "number":
50
- return u(e, r);
51
- case "currency":
52
- return m(e, n, r);
53
- case "percent":
54
- return f(e, r);
55
- case "date":
56
- return c(e, r);
57
- case "datetime":
58
- return p(e, r);
59
- case "bytes":
60
- return w(e);
61
- default:
62
- return String(e);
63
- }
64
- }
65
- function u(e, t) {
66
- const r = Number(e);
67
- return isNaN(r) ? String(e) : new Intl.NumberFormat(t).format(r);
68
- }
69
- function m(e, t, r) {
70
- const i = Number(e);
71
- if (isNaN(i)) return String(e);
72
- const n = t || "USD";
73
- try {
74
- const s = d.has(n.toUpperCase());
75
- return new Intl.NumberFormat(r, {
76
- style: "currency",
77
- currency: n,
78
- ...s && {
79
- minimumFractionDigits: 0,
80
- maximumFractionDigits: 0
81
- }
82
- }).format(i);
83
- } catch {
84
- return new Intl.NumberFormat(r, {
85
- style: "currency",
86
- currency: "USD"
87
- }).format(i);
88
- }
89
- }
90
- function f(e, t) {
91
- const r = Number(e);
92
- if (isNaN(r)) return String(e);
93
- if (t)
94
- try {
95
- return new Intl.NumberFormat(t, {
96
- style: "percent",
97
- maximumFractionDigits: 2
98
- }).format(r / 100);
99
- } catch {
100
- }
101
- return r + "%";
102
- }
103
- function c(e, t) {
104
- if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}/.test(e)) {
105
- if (t)
106
- try {
107
- const r = new Date(e);
108
- if (!isNaN(r.getTime()))
109
- return new Intl.DateTimeFormat(t, {
110
- year: "numeric",
111
- month: "2-digit",
112
- day: "2-digit"
113
- }).format(r);
114
- } catch {
115
- }
116
- return e.slice(0, 10);
117
- }
118
- return String(e);
119
- }
120
- function p(e, t) {
121
- if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}/.test(e)) {
122
- if (t)
123
- try {
124
- const r = new Date(e);
125
- if (!isNaN(r.getTime()))
126
- return new Intl.DateTimeFormat(t, {
127
- year: "numeric",
128
- month: "2-digit",
129
- day: "2-digit",
130
- hour: "2-digit",
131
- minute: "2-digit"
132
- }).format(r);
133
- } catch {
134
- }
135
- return e.slice(0, 16).replace("T", " ");
136
- }
137
- return String(e);
138
- }
139
- function w(e) {
140
- const t = Number(e);
141
- if (isNaN(t)) return String(e);
142
- const r = t < 0 ? "-" : "";
143
- let i = Math.abs(t), n = 0;
144
- for (; i >= 1024 && n < a.length - 1; )
145
- i /= 1024, n++;
146
- return r + (n === 0 ? i : i.toFixed(1)) + " " + a[n];
147
- }
148
- const F = g`
149
- :host {
150
- /* ── Colors (Light defaults) ── */
151
- --u-widget-bg: #fff;
152
- --u-widget-surface: #f1f5f9;
153
- --u-widget-text: #1a1a2e;
154
- --u-widget-text-secondary: #64748b;
155
- --u-widget-border: #e2e8f0;
156
- --u-widget-primary: #4f46e5;
157
- --u-widget-positive: #16a34a;
158
- --u-widget-negative: #dc2626;
159
- --u-widget-warning: #d97706;
160
-
161
- /* ── Spacing ── */
162
- --u-widget-gap: 16px;
163
- --u-widget-radius: 6px;
164
-
165
- /* ── Typography ── */
166
- --u-widget-font-family: system-ui, -apple-system, sans-serif;
167
- --u-widget-font-size: 0.875rem;
168
-
169
- /* ── Chart ── */
170
- --u-widget-chart-height: 300px;
171
-
172
- /* ── Shadow ── */
173
- --u-widget-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
174
- --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
175
- }
176
-
177
- @media (prefers-color-scheme: dark) {
178
- :host(:not([theme="light"])) {
179
- --u-widget-bg: #1e1e2e;
180
- --u-widget-surface: #2a2a3e;
181
- --u-widget-text: #e2e8f0;
182
- --u-widget-text-secondary: #94a3b8;
183
- --u-widget-border: #374151;
184
- --u-widget-primary: #818cf8;
185
- --u-widget-positive: #4ade80;
186
- --u-widget-negative: #f87171;
187
- --u-widget-warning: #fbbf24;
188
- --u-widget-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
189
- --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
190
- }
191
- }
192
-
193
- :host([theme="dark"]) {
194
- --u-widget-bg: #1e1e2e;
195
- --u-widget-surface: #2a2a3e;
196
- --u-widget-text: #e2e8f0;
197
- --u-widget-text-secondary: #94a3b8;
198
- --u-widget-border: #374151;
199
- --u-widget-primary: #818cf8;
200
- --u-widget-positive: #4ade80;
201
- --u-widget-negative: #f87171;
202
- --u-widget-warning: #fbbf24;
203
- --u-widget-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
204
- --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
205
- }
206
- `;
207
- export {
208
- x as a,
209
- N as f,
210
- b as n,
211
- F as t
212
- };
213
- //# sourceMappingURL=tokens-SjA7YdRs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens-SjA7YdRs.js","sources":["../src/core/normalize.ts","../src/core/format.ts","../src/styles/tokens.ts"],"sourcesContent":["import type { UWidgetSpec, NormalizedMapping, UWidgetMapping } from './types.js';\nimport { getFormdownParser } from './formdown.js';\n\n/**\n * Normalize a spec for internal processing.\n *\n * Transformations applied:\n * 1. Deprecated `mapping.fields` → top-level `fields`\n * 2. `formdown` string → parsed `fields` + `actions`\n *\n * Returns a shallow copy; the original spec is not mutated.\n *\n * @param spec - The widget spec to normalize.\n * @returns A normalized copy of the spec.\n */\nexport function normalize(spec: UWidgetSpec): UWidgetSpec {\n const result = { ...spec };\n\n // Normalize deprecated mapping.fields → top-level fields\n if (result.mapping && 'fields' in result.mapping && !result.fields) {\n const { fields, ...restMapping } = result.mapping as UWidgetMapping & {\n fields?: UWidgetSpec['fields'];\n };\n result.fields = fields;\n result.mapping = Object.keys(restMapping).length > 0 ? restMapping : undefined;\n }\n\n // Normalize formdown → fields + actions\n if (result.formdown && !result.fields) {\n try {\n const parser = getFormdownParser();\n const parsed = parser(result.formdown, result.data as Record<string, unknown> | undefined);\n result.fields = parsed.fields;\n if (parsed.actions.length > 0 && !result.actions) {\n result.actions = parsed.actions;\n }\n } catch (e) {\n console.warn('[u-widget:normalize] Failed to parse formdown:', (e as Error).message);\n }\n }\n\n return result;\n}\n\n/**\n * Normalize `mapping.y` to always be `string[]`.\n *\n * Converts `y: \"field\"` → `y: [\"field\"]` and passes arrays through unchanged.\n *\n * @param mapping - The original mapping from a widget spec.\n * @returns A new mapping object with `y` guaranteed to be `string[]` or `undefined`.\n */\nexport function normalizeMapping(mapping: UWidgetMapping): NormalizedMapping {\n const { y, ...rest } = mapping;\n return {\n ...rest,\n y: y == null ? undefined : typeof y === 'string' ? [y] : y,\n };\n}\n","type FormatType = 'number' | 'currency' | 'percent' | 'date' | 'datetime' | 'bytes';\n\nconst BYTE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'];\n\n// ISO 4217 zero-decimal currencies — no fractional digits by standard\nconst ZERO_DECIMAL_CURRENCIES = new Set([\n 'KRW', 'JPY', 'VND', 'IDR', 'BIF', 'CLP', 'GNF', 'ISK',\n 'KMF', 'MGA', 'PYG', 'RWF', 'UGX', 'UYI', 'VUV', 'XAF', 'XOF', 'XPF',\n]);\n\n/**\n * Format a value according to a format hint string.\n *\n * Supported formats: `\"number\"`, `\"currency\"`, `\"currency:EUR\"`, `\"percent\"`,\n * `\"date\"`, `\"datetime\"`, `\"bytes\"`. Returns `String(value)` for unknown formats.\n *\n * @param value - The value to format (coerced to number where needed).\n * @param format - Format hint, optionally with a parameter after `:` (e.g., `\"currency:USD\"`).\n * @param locale - BCP 47 locale tag for number/currency formatting. Falls back to browser default.\n * @returns Formatted string, or empty string if value is null/undefined.\n *\n * @example\n * ```ts\n * formatValue(1234.5, 'number') // \"1,234.5\"\n * formatValue(1234.5, 'currency:EUR') // \"€1,234.50\"\n * formatValue(73, 'percent') // \"73%\"\n * formatValue(1536000, 'bytes') // \"1.5 MB\"\n * ```\n */\nexport function formatValue(value: unknown, format?: string, locale?: string): string {\n if (value == null) return '';\n\n // Parse format string: 'currency:USD' → type='currency', param='USD'\n const [type, param] = format?.split(':') ?? [];\n\n switch (type as FormatType) {\n case 'number':\n return formatNumber(value, locale);\n case 'currency':\n return formatCurrency(value, param, locale);\n case 'percent':\n return formatPercent(value, locale);\n case 'date':\n return formatDate(value, locale);\n case 'datetime':\n return formatDatetime(value, locale);\n case 'bytes':\n return formatBytes(value);\n default:\n return String(value);\n }\n}\n\nfunction formatNumber(value: unknown, locale?: string): string {\n const num = Number(value);\n if (isNaN(num)) return String(value);\n return new Intl.NumberFormat(locale).format(num);\n}\n\nfunction formatCurrency(value: unknown, currencyCode?: string, locale?: string): string {\n const num = Number(value);\n if (isNaN(num)) return String(value);\n const currency = currencyCode || 'USD';\n try {\n const isZeroDecimal = ZERO_DECIMAL_CURRENCIES.has(currency.toUpperCase());\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n ...(isZeroDecimal && {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }),\n }).format(num);\n } catch {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: 'USD',\n }).format(num);\n }\n}\n\nfunction formatPercent(value: unknown, locale?: string): string {\n const num = Number(value);\n if (isNaN(num)) return String(value);\n if (locale) {\n try {\n return new Intl.NumberFormat(locale, {\n style: 'percent',\n maximumFractionDigits: 2,\n }).format(num / 100);\n } catch {\n // Invalid locale fallback\n }\n }\n return num + '%';\n}\n\nfunction formatDate(value: unknown, locale?: string): string {\n if (typeof value === 'string' && /^\\d{4}-\\d{2}-\\d{2}/.test(value)) {\n if (locale) {\n try {\n const d = new Date(value);\n if (!isNaN(d.getTime())) {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n }).format(d);\n }\n } catch {\n // Invalid locale fallback\n }\n }\n return value.slice(0, 10);\n }\n return String(value);\n}\n\nfunction formatDatetime(value: unknown, locale?: string): string {\n if (typeof value === 'string' && /^\\d{4}-\\d{2}-\\d{2}/.test(value)) {\n if (locale) {\n try {\n const d = new Date(value);\n if (!isNaN(d.getTime())) {\n return new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n }).format(d);\n }\n } catch {\n // Invalid locale fallback\n }\n }\n return value.slice(0, 16).replace('T', ' ');\n }\n return String(value);\n}\n\nfunction formatBytes(value: unknown): string {\n const raw = Number(value);\n if (isNaN(raw)) return String(value);\n\n const sign = raw < 0 ? '-' : '';\n let num = Math.abs(raw);\n\n let i = 0;\n while (num >= 1024 && i < BYTE_UNITS.length - 1) {\n num /= 1024;\n i++;\n }\n return sign + (i === 0 ? num : num.toFixed(1)) + ' ' + BYTE_UNITS[i];\n}\n","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 * 1. Light mode: `:host` sets explicit color defaults for all tokens.\n * 2. Dark mode via `prefers-color-scheme: dark` (automatic, unless `theme=\"light\"`)\n * 3. Dark mode via `theme=\"dark\"` attribute (manual override)\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 * The `theme=\"dark\"` attribute is still useful for component-specific overrides\n * (e.g., code syntax highlight colors).\n */\nexport const themeStyles = css`\n :host {\n /* ── Colors (Light defaults) ── */\n --u-widget-bg: #fff;\n --u-widget-surface: #f1f5f9;\n --u-widget-text: #1a1a2e;\n --u-widget-text-secondary: #64748b;\n --u-widget-border: #e2e8f0;\n --u-widget-primary: #4f46e5;\n --u-widget-positive: #16a34a;\n --u-widget-negative: #dc2626;\n --u-widget-warning: #d97706;\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: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);\n --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([theme=\"light\"])) {\n --u-widget-bg: #1e1e2e;\n --u-widget-surface: #2a2a3e;\n --u-widget-text: #e2e8f0;\n --u-widget-text-secondary: #94a3b8;\n --u-widget-border: #374151;\n --u-widget-primary: #818cf8;\n --u-widget-positive: #4ade80;\n --u-widget-negative: #f87171;\n --u-widget-warning: #fbbf24;\n --u-widget-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);\n --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);\n }\n }\n\n :host([theme=\"dark\"]) {\n --u-widget-bg: #1e1e2e;\n --u-widget-surface: #2a2a3e;\n --u-widget-text: #e2e8f0;\n --u-widget-text-secondary: #94a3b8;\n --u-widget-border: #374151;\n --u-widget-primary: #818cf8;\n --u-widget-positive: #4ade80;\n --u-widget-negative: #f87171;\n --u-widget-warning: #fbbf24;\n --u-widget-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);\n --u-widget-shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);\n }\n`;\n"],"names":["normalize","spec","result","fields","restMapping","parsed","getFormdownParser","e","normalizeMapping","mapping","y","rest","BYTE_UNITS","ZERO_DECIMAL_CURRENCIES","formatValue","value","format","locale","type","param","formatNumber","formatCurrency","formatPercent","formatDate","formatDatetime","formatBytes","num","currencyCode","currency","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