orbital-ds 0.41.0 → 0.48.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.
Files changed (321) hide show
  1. package/AGENTS.md +54 -12
  2. package/CHANGELOG.md +458 -0
  3. package/README.md +2 -2
  4. package/components.manifest.json +6630 -3569
  5. package/dist/hooks/use-esc-close-stack.js +38 -0
  6. package/dist/hooks/use-simulated-progress.js +30 -0
  7. package/dist/lib/brand-allowlist.js +703 -0
  8. package/dist/lib/brand-runtime.js +85 -0
  9. package/dist/lib/echarts-presets.js +152 -1
  10. package/dist/lib/echarts-setup.js +2 -0
  11. package/dist/lib/format.js +177 -0
  12. package/dist/lib/i18n.js +35 -2
  13. package/dist/lib/locales/de.js +536 -0
  14. package/dist/lib/locales/fr.js +536 -0
  15. package/dist/lib/locales/he.js +536 -0
  16. package/dist/lib/locales/it.js +536 -0
  17. package/dist/ui/auth-form.js +13 -6
  18. package/dist/ui/ayuda.js +4 -1
  19. package/dist/ui/breadcrumb.js +1 -1
  20. package/dist/ui/calendar.js +3 -0
  21. package/dist/ui/carousel.js +10 -5
  22. package/dist/ui/context-menu.js +3 -3
  23. package/dist/ui/cta-banner.js +63 -0
  24. package/dist/ui/date-time.js +55 -0
  25. package/dist/ui/description-list.js +86 -0
  26. package/dist/ui/detail-panel.js +2 -2
  27. package/dist/ui/dropdown-menu.js +1 -1
  28. package/dist/ui/faq.js +25 -0
  29. package/dist/ui/feature-grid.js +40 -0
  30. package/dist/ui/hero.js +145 -0
  31. package/dist/ui/landing-section.js +59 -0
  32. package/dist/ui/mfa-challenge.js +1 -1
  33. package/dist/ui/next-step-card.js +92 -0
  34. package/dist/ui/page-header.js +20 -11
  35. package/dist/ui/pagination.js +2 -2
  36. package/dist/ui/pricing-table.js +86 -0
  37. package/dist/ui/quantity.js +27 -0
  38. package/dist/ui/sheet.js +6 -2
  39. package/dist/ui/sidebar.js +7 -3
  40. package/dist/ui/tag-input.js +169 -0
  41. package/dist/ui/testimonial.js +61 -0
  42. package/dist/ui/textarea.js +7 -1
  43. package/dist/ui/usage-meter.js +116 -0
  44. package/dist/ui/week-strip.js +2 -2
  45. package/docs/adr/0001-rtl-clases-logicas.md +14 -1
  46. package/docs/designer/flujo.md +1 -1
  47. package/docs/designer/patrones.md +45 -1
  48. package/manifest/actions.json +364 -0
  49. package/manifest/agents.json +399 -0
  50. package/manifest/ai.json +128 -0
  51. package/manifest/auth.json +1547 -0
  52. package/manifest/chat.json +612 -0
  53. package/manifest/content.json +2793 -0
  54. package/manifest/data.json +2802 -0
  55. package/manifest/feedback.json +1005 -0
  56. package/manifest/forms.json +1954 -0
  57. package/manifest/motion.json +196 -0
  58. package/manifest/navigation.json +1792 -0
  59. package/manifest/overlays.json +934 -0
  60. package/package.json +240 -238
  61. package/scripts/cli.mjs +124 -8
  62. package/scripts/doctor.mjs +153 -2
  63. package/scripts/eslint-plugin.mjs +125 -0
  64. package/scripts/i18n.mjs +1 -1
  65. package/scripts/manifest.mjs +179 -7
  66. package/scripts/upgrade.mjs +126 -0
  67. package/skill/SKILL.md +8 -3
  68. package/dist/hooks/use-ds-messages.d.ts +0 -537
  69. package/dist/hooks/use-ds-motion.d.ts +0 -17
  70. package/dist/hooks/use-in-view.d.ts +0 -9
  71. package/dist/hooks/use-mobile.d.ts +0 -3
  72. package/dist/lib/a2ui-catalog.d.ts +0 -42
  73. package/dist/lib/a2ui.d.ts +0 -289
  74. package/dist/lib/ai-events.d.ts +0 -15
  75. package/dist/lib/auth-better-auth.d.ts +0 -29
  76. package/dist/lib/auth-flow.d.ts +0 -85
  77. package/dist/lib/auth-providers.d.ts +0 -194
  78. package/dist/lib/auth.d.ts +0 -68
  79. package/dist/lib/echarts-presets.d.ts +0 -227
  80. package/dist/lib/echarts-server.d.ts +0 -15
  81. package/dist/lib/echarts-setup.d.ts +0 -8
  82. package/dist/lib/echarts-theme.d.ts +0 -36
  83. package/dist/lib/header-control.d.ts +0 -4
  84. package/dist/lib/i18n.d.ts +0 -545
  85. package/dist/lib/image-upload.d.ts +0 -41
  86. package/dist/lib/motion.d.ts +0 -74
  87. package/dist/lib/presets.d.ts +0 -8
  88. package/dist/lib/template-syntax.d.ts +0 -22
  89. package/dist/lib/utils.d.ts +0 -5
  90. package/dist/motion.css +0 -146
  91. package/dist/styles.css +0 -1737
  92. package/dist/themes/chocolate.css +0 -259
  93. package/dist/themes/chocolate.fonts.css +0 -2
  94. package/dist/themes/chocolate.guide.md +0 -30
  95. package/dist/themes/chocolate.meta.json +0 -61
  96. package/dist/themes/chocolate.scoped.css +0 -259
  97. package/dist/themes/chocolate.tokens.json +0 -49
  98. package/dist/themes/fractalia.css +0 -556
  99. package/dist/themes/fractalia.fonts.css +0 -3
  100. package/dist/themes/fractalia.guide.md +0 -86
  101. package/dist/themes/fractalia.meta.json +0 -112
  102. package/dist/themes/fractalia.scoped.css +0 -556
  103. package/dist/themes/fractalia.tokens.json +0 -39
  104. package/dist/themes/friendly.css +0 -375
  105. package/dist/themes/friendly.fonts.css +0 -2
  106. package/dist/themes/friendly.guide.md +0 -38
  107. package/dist/themes/friendly.meta.json +0 -82
  108. package/dist/themes/friendly.scoped.css +0 -375
  109. package/dist/themes/friendly.tokens.json +0 -45
  110. package/dist/themes/lagoon.css +0 -362
  111. package/dist/themes/lagoon.fonts.css +0 -2
  112. package/dist/themes/lagoon.guide.md +0 -47
  113. package/dist/themes/lagoon.meta.json +0 -85
  114. package/dist/themes/lagoon.scoped.css +0 -362
  115. package/dist/themes/lagoon.tokens.json +0 -49
  116. package/dist/themes/liquid.css +0 -510
  117. package/dist/themes/liquid.fonts.css +0 -7
  118. package/dist/themes/liquid.guide.md +0 -82
  119. package/dist/themes/liquid.meta.json +0 -134
  120. package/dist/themes/liquid.scoped.css +0 -510
  121. package/dist/themes/liquid.tokens.json +0 -47
  122. package/dist/themes/matcha.css +0 -259
  123. package/dist/themes/matcha.fonts.css +0 -2
  124. package/dist/themes/matcha.guide.md +0 -30
  125. package/dist/themes/matcha.meta.json +0 -61
  126. package/dist/themes/matcha.scoped.css +0 -259
  127. package/dist/themes/matcha.tokens.json +0 -49
  128. package/dist/themes/qratia.css +0 -264
  129. package/dist/themes/qratia.fonts.css +0 -2
  130. package/dist/themes/qratia.guide.md +0 -34
  131. package/dist/themes/qratia.meta.json +0 -49
  132. package/dist/themes/qratia.scoped.css +0 -264
  133. package/dist/themes/qratia.tokens.json +0 -49
  134. package/dist/themes/stone.css +0 -263
  135. package/dist/themes/stone.fonts.css +0 -2
  136. package/dist/themes/stone.guide.md +0 -30
  137. package/dist/themes/stone.meta.json +0 -47
  138. package/dist/themes/stone.scoped.css +0 -263
  139. package/dist/themes/stone.tokens.json +0 -49
  140. package/dist/themes/tactile.css +0 -596
  141. package/dist/themes/tactile.fonts.css +0 -3
  142. package/dist/themes/tactile.guide.md +0 -82
  143. package/dist/themes/tactile.meta.json +0 -182
  144. package/dist/themes/tactile.scoped.css +0 -596
  145. package/dist/themes/tactile.tokens.json +0 -42
  146. package/dist/themes/twitter.css +0 -364
  147. package/dist/themes/twitter.fonts.css +0 -6
  148. package/dist/themes/twitter.guide.md +0 -35
  149. package/dist/themes/twitter.meta.json +0 -90
  150. package/dist/themes/twitter.scoped.css +0 -364
  151. package/dist/themes/twitter.tokens.json +0 -45
  152. package/dist/themes/y2k.css +0 -259
  153. package/dist/themes/y2k.fonts.css +0 -2
  154. package/dist/themes/y2k.guide.md +0 -30
  155. package/dist/themes/y2k.meta.json +0 -59
  156. package/dist/themes/y2k.scoped.css +0 -259
  157. package/dist/themes/y2k.tokens.json +0 -49
  158. package/dist/themes/zyro.css +0 -442
  159. package/dist/themes/zyro.fonts.css +0 -2
  160. package/dist/themes/zyro.guide.md +0 -33
  161. package/dist/themes/zyro.meta.json +0 -74
  162. package/dist/themes/zyro.scoped.css +0 -442
  163. package/dist/themes/zyro.tokens.json +0 -46
  164. package/dist/ui/a2ui-renderer.d.ts +0 -33
  165. package/dist/ui/accordion.d.ts +0 -9
  166. package/dist/ui/agent-events.d.ts +0 -32
  167. package/dist/ui/ai-tag.d.ts +0 -8
  168. package/dist/ui/alert-dialog.d.ts +0 -23
  169. package/dist/ui/alert.d.ts +0 -13
  170. package/dist/ui/animated-number.d.ts +0 -9
  171. package/dist/ui/app-bar.d.ts +0 -10
  172. package/dist/ui/aspect-ratio.d.ts +0 -7
  173. package/dist/ui/attachment.d.ts +0 -26
  174. package/dist/ui/auth-backdrop.d.ts +0 -20
  175. package/dist/ui/auth-form.d.ts +0 -113
  176. package/dist/ui/auth-layout.d.ts +0 -72
  177. package/dist/ui/auth-parts.d.ts +0 -43
  178. package/dist/ui/auth-status.d.ts +0 -23
  179. package/dist/ui/avatar.d.ts +0 -16
  180. package/dist/ui/ayuda.d.ts +0 -22
  181. package/dist/ui/badge.d.ts +0 -15
  182. package/dist/ui/banner.d.ts +0 -14
  183. package/dist/ui/bottom-nav.d.ts +0 -15
  184. package/dist/ui/breadcrumb.d.ts +0 -12
  185. package/dist/ui/bubble.d.ts +0 -19
  186. package/dist/ui/button-group.d.ts +0 -15
  187. package/dist/ui/button.d.ts +0 -14
  188. package/dist/ui/calendar.d.ts +0 -15
  189. package/dist/ui/card-stack.d.ts +0 -9
  190. package/dist/ui/card.d.ts +0 -28
  191. package/dist/ui/carousel.d.ts +0 -33
  192. package/dist/ui/chain-of-thought.d.ts +0 -19
  193. package/dist/ui/chart-card.d.ts +0 -28
  194. package/dist/ui/chart.d.ts +0 -46
  195. package/dist/ui/chart.js +0 -254
  196. package/dist/ui/chat-composer.d.ts +0 -39
  197. package/dist/ui/checkbox.d.ts +0 -6
  198. package/dist/ui/choice-card.d.ts +0 -16
  199. package/dist/ui/code-block.d.ts +0 -14
  200. package/dist/ui/collapsible.d.ts +0 -8
  201. package/dist/ui/combobox.d.ts +0 -26
  202. package/dist/ui/command-palette.d.ts +0 -36
  203. package/dist/ui/command.d.ts +0 -22
  204. package/dist/ui/confirm-action.d.ts +0 -18
  205. package/dist/ui/confirm-dialog.d.ts +0 -21
  206. package/dist/ui/connected-accounts.d.ts +0 -25
  207. package/dist/ui/content-card.d.ts +0 -52
  208. package/dist/ui/context-menu.d.ts +0 -31
  209. package/dist/ui/conversation-list.d.ts +0 -24
  210. package/dist/ui/copy-button.d.ts +0 -14
  211. package/dist/ui/data-table.d.ts +0 -198
  212. package/dist/ui/date-picker.d.ts +0 -65
  213. package/dist/ui/detail-panel.d.ts +0 -16
  214. package/dist/ui/dialog.d.ts +0 -19
  215. package/dist/ui/direction.d.ts +0 -1
  216. package/dist/ui/dock.d.ts +0 -13
  217. package/dist/ui/drawer.d.ts +0 -18
  218. package/dist/ui/dropdown-menu.d.ts +0 -31
  219. package/dist/ui/dropzone.d.ts +0 -44
  220. package/dist/ui/echart.d.ts +0 -31
  221. package/dist/ui/empty-state.d.ts +0 -26
  222. package/dist/ui/empty.d.ts +0 -15
  223. package/dist/ui/entity-list.d.ts +0 -25
  224. package/dist/ui/error-page.d.ts +0 -28
  225. package/dist/ui/error-state.d.ts +0 -16
  226. package/dist/ui/eyebrow.d.ts +0 -7
  227. package/dist/ui/field.d.ts +0 -28
  228. package/dist/ui/file-upload.d.ts +0 -42
  229. package/dist/ui/filter-bar.d.ts +0 -38
  230. package/dist/ui/form-layout.d.ts +0 -19
  231. package/dist/ui/gauge.d.ts +0 -40
  232. package/dist/ui/generated-image.d.ts +0 -14
  233. package/dist/ui/generated-table.d.ts +0 -11
  234. package/dist/ui/heatmap-grid.d.ts +0 -39
  235. package/dist/ui/hover-card.d.ts +0 -8
  236. package/dist/ui/i18n-provider.d.ts +0 -11
  237. package/dist/ui/icon-tile.d.ts +0 -11
  238. package/dist/ui/input-group.d.ts +0 -22
  239. package/dist/ui/input-otp.d.ts +0 -13
  240. package/dist/ui/input.d.ts +0 -5
  241. package/dist/ui/instruction-editor.d.ts +0 -64
  242. package/dist/ui/item.d.ts +0 -26
  243. package/dist/ui/kbd.d.ts +0 -6
  244. package/dist/ui/label.d.ts +0 -5
  245. package/dist/ui/legend.d.ts +0 -32
  246. package/dist/ui/level-meter.d.ts +0 -16
  247. package/dist/ui/load-more.d.ts +0 -19
  248. package/dist/ui/loading-state.d.ts +0 -14
  249. package/dist/ui/locale-switcher.d.ts +0 -19
  250. package/dist/ui/markdown.d.ts +0 -14
  251. package/dist/ui/marker.d.ts +0 -13
  252. package/dist/ui/media-card.d.ts +0 -13
  253. package/dist/ui/menubar.d.ts +0 -31
  254. package/dist/ui/message-actions.d.ts +0 -12
  255. package/dist/ui/message-scroller.d.ts +0 -16
  256. package/dist/ui/message.d.ts +0 -12
  257. package/dist/ui/mfa-challenge.d.ts +0 -33
  258. package/dist/ui/mfa-setup.d.ts +0 -29
  259. package/dist/ui/mosaic.d.ts +0 -15
  260. package/dist/ui/motion-provider.d.ts +0 -11
  261. package/dist/ui/native-select.d.ts +0 -10
  262. package/dist/ui/navigation-menu.d.ts +0 -15
  263. package/dist/ui/notice-review.d.ts +0 -32
  264. package/dist/ui/notifications.d.ts +0 -81
  265. package/dist/ui/oauth-consent.d.ts +0 -54
  266. package/dist/ui/page-header.d.ts +0 -22
  267. package/dist/ui/page-loader.d.ts +0 -23
  268. package/dist/ui/page-shell.d.ts +0 -8
  269. package/dist/ui/pagination.d.ts +0 -22
  270. package/dist/ui/panel.d.ts +0 -12
  271. package/dist/ui/passkey-list.d.ts +0 -17
  272. package/dist/ui/password-input.d.ts +0 -5
  273. package/dist/ui/password-strength.d.ts +0 -14
  274. package/dist/ui/popover.d.ts +0 -12
  275. package/dist/ui/progress.d.ts +0 -9
  276. package/dist/ui/proportion-bar.d.ts +0 -27
  277. package/dist/ui/questionnaire.d.ts +0 -24
  278. package/dist/ui/radio-group.d.ts +0 -8
  279. package/dist/ui/reasoning.d.ts +0 -10
  280. package/dist/ui/resizable.d.ts +0 -10
  281. package/dist/ui/reveal.d.ts +0 -11
  282. package/dist/ui/scroll-area.d.ts +0 -7
  283. package/dist/ui/search-box.d.ts +0 -32
  284. package/dist/ui/select.d.ts +0 -19
  285. package/dist/ui/separator.d.ts +0 -6
  286. package/dist/ui/session-list.d.ts +0 -19
  287. package/dist/ui/session-timeout.d.ts +0 -13
  288. package/dist/ui/sheet.d.ts +0 -16
  289. package/dist/ui/shield.d.ts +0 -21
  290. package/dist/ui/show-more.d.ts +0 -12
  291. package/dist/ui/sidebar.d.ts +0 -90
  292. package/dist/ui/sign-out-dialog.d.ts +0 -17
  293. package/dist/ui/skeleton.d.ts +0 -10
  294. package/dist/ui/slider.d.ts +0 -23
  295. package/dist/ui/sonner.d.ts +0 -6
  296. package/dist/ui/sparkline.d.ts +0 -26
  297. package/dist/ui/spinner.d.ts +0 -5
  298. package/dist/ui/stat-group.d.ts +0 -8
  299. package/dist/ui/stat.d.ts +0 -90
  300. package/dist/ui/status-badge.d.ts +0 -39
  301. package/dist/ui/status-hero.d.ts +0 -12
  302. package/dist/ui/step-dots.d.ts +0 -10
  303. package/dist/ui/step-flow.d.ts +0 -48
  304. package/dist/ui/step-ring.d.ts +0 -12
  305. package/dist/ui/stepper.d.ts +0 -20
  306. package/dist/ui/suggestions.d.ts +0 -8
  307. package/dist/ui/switch.d.ts +0 -8
  308. package/dist/ui/table.d.ts +0 -12
  309. package/dist/ui/tabs.d.ts +0 -14
  310. package/dist/ui/task-loader.d.ts +0 -14
  311. package/dist/ui/task-progress.d.ts +0 -18
  312. package/dist/ui/textarea.d.ts +0 -11
  313. package/dist/ui/theme-toggle.d.ts +0 -14
  314. package/dist/ui/timeline.d.ts +0 -29
  315. package/dist/ui/toast.d.ts +0 -19
  316. package/dist/ui/toggle-group.d.ts +0 -14
  317. package/dist/ui/toggle.d.ts +0 -12
  318. package/dist/ui/tool-call.d.ts +0 -15
  319. package/dist/ui/tooltip.d.ts +0 -9
  320. package/dist/ui/week-strip.d.ts +0 -12
  321. package/dist/ui/workflow-run.d.ts +0 -23
@@ -0,0 +1,85 @@
1
+ import { contrastRatio, parseColor } from "../../scripts/brand-core.mjs";
2
+ import { BRAND_PUBLIC_TOKENS } from "./brand-allowlist.js";
3
+ const BRAND_CONTRAST_PAIRS = [
4
+ ["foreground", "background", 4.5],
5
+ ["card-foreground", "card", 4.5],
6
+ ["popover-foreground", "popover", 4.5],
7
+ ["primary-foreground", "primary", 4.5],
8
+ ["secondary-foreground", "secondary", 4.5],
9
+ ["accent-foreground", "accent", 4.5],
10
+ ["sidebar-foreground", "sidebar", 4.5],
11
+ ["sidebar-primary-foreground", "sidebar-primary", 4.5],
12
+ ["link", "background", 4.5],
13
+ ["link-hover", "background", 4.5],
14
+ ["ring", "background", 3]
15
+ ];
16
+ const UNSAFE = /[;{}<>\\]|\/\*|\*\/|@|!|url\s*\(|expression\s*\(|javascript:|[\u0000-\u001f\u007f]/i;
17
+ function normalizeName(raw) {
18
+ return raw.trim().replace(/^--/, "");
19
+ }
20
+ function isSkins(input) {
21
+ const keys = Object.keys(input);
22
+ return keys.length > 0 && keys.every((k) => k === "light" || k === "dark") && keys.every((k) => typeof input[k] === "object");
23
+ }
24
+ function validateBrandTokens(input, options = {}) {
25
+ const { base = {}, maxValueLength = 256 } = options;
26
+ const skins = input == null ? {} : isSkins(input) ? input : { light: input };
27
+ const result = { ok: true, light: {}, dark: {}, errors: [], warnings: [] };
28
+ for (const skin of ["light", "dark"]) {
29
+ const raw = skins[skin] ?? {};
30
+ const clean = {};
31
+ for (const [key, value] of Object.entries(raw)) {
32
+ const token = normalizeName(key);
33
+ const v = typeof value === "string" ? value.trim() : "";
34
+ if (!BRAND_PUBLIC_TOKENS.has(token)) {
35
+ result.errors.push({ skin, token, code: "unknown-token", message: `--${token} is not a public orbital-ds token` });
36
+ continue;
37
+ }
38
+ if (v === "") {
39
+ result.errors.push({ skin, token, code: "empty-value", message: `--${token} has an empty value` });
40
+ continue;
41
+ }
42
+ if (v.length > maxValueLength || UNSAFE.test(v)) {
43
+ result.errors.push({ skin, token, code: "unsafe-value", message: `--${token} has a value that is not a single safe CSS value` });
44
+ continue;
45
+ }
46
+ clean[token] = v;
47
+ }
48
+ const themeBase = base[skin] ?? {};
49
+ const lookup = (name) => clean[name] ?? themeBase[name] ?? themeBase[`--${name}`];
50
+ for (const [fg, bg, min] of BRAND_CONTRAST_PAIRS) {
51
+ if (!(fg in clean) && !(bg in clean)) continue;
52
+ const fgValue = lookup(fg);
53
+ const bgValue = lookup(bg);
54
+ if (fgValue == null || bgValue == null) continue;
55
+ const a = parseColor(fgValue);
56
+ const b = parseColor(bgValue);
57
+ if (a == null || b == null) {
58
+ result.warnings.push({ skin, token: fg, code: "contrast-unchecked", message: `--${fg} on --${bg} could not be measured (use resolved colors)` });
59
+ continue;
60
+ }
61
+ const ratio = Math.round(contrastRatio(a, b) * 100) / 100;
62
+ if (ratio < min) {
63
+ result.errors.push({ skin, token: fg, code: "contrast", ratio, min, message: `--${fg} on --${bg} is ${ratio}:1 (WCAG AA needs ${min}:1)` });
64
+ }
65
+ }
66
+ const prefixed = {};
67
+ for (const [k, v] of Object.entries(clean)) prefixed[`--${k}`] = v;
68
+ result[skin] = prefixed;
69
+ }
70
+ result.ok = result.errors.length === 0;
71
+ return result;
72
+ }
73
+ function brandTokensToCss(brand, { selector = ":root:root", darkSelector = ":root.dark, :root .dark" } = {}) {
74
+ if (!brand.ok) throw new Error(`orbital-ds: refusing to render a brand with ${brand.errors.length} error(s); check validateBrandTokens().errors`);
75
+ const block = (sel, tokens) => {
76
+ const body = Object.entries(tokens).filter(([k, v]) => BRAND_PUBLIC_TOKENS.has(k.replace(/^--/, "")) && !UNSAFE.test(v)).map(([k, v]) => `${k}:${v};`).join("");
77
+ return body ? `${sel}{${body}}` : "";
78
+ };
79
+ return [block(selector, brand.light), block(darkSelector, brand.dark)].filter(Boolean).join("\n");
80
+ }
81
+ export {
82
+ BRAND_CONTRAST_PAIRS,
83
+ brandTokensToCss,
84
+ validateBrandTokens
85
+ };
@@ -427,14 +427,164 @@ function boxplotOption(input) {
427
427
  input.extend
428
428
  );
429
429
  }
430
+ function waterfallOption(input) {
431
+ const categories = [];
432
+ const base = [];
433
+ const inc = [];
434
+ const dec = [];
435
+ const total = [];
436
+ let running = 0;
437
+ const push = (name, b, i, d, t) => {
438
+ categories.push(name);
439
+ base.push(b);
440
+ inc.push(i);
441
+ dec.push(d);
442
+ total.push(t);
443
+ };
444
+ if (input.start) {
445
+ running = input.start.value;
446
+ push(input.start.name, "-", "-", "-", running);
447
+ }
448
+ for (const s of input.steps) {
449
+ if (s.value >= 0) {
450
+ push(s.name, running, s.value, "-", "-");
451
+ running += s.value;
452
+ } else {
453
+ running += s.value;
454
+ push(s.name, running, "-", -s.value, "-");
455
+ }
456
+ }
457
+ if (input.end !== false) push(input.end ?? input.totalLabel, "-", "-", "-", running);
458
+ const fmt = input.valueFormatter;
459
+ const label = (sign) => input.showLabels ? {
460
+ label: {
461
+ show: true,
462
+ position: "top",
463
+ formatter: (p) => typeof p.value === "number" ? `${sign}${fmt ? fmt(p.value) : p.value}` : ""
464
+ }
465
+ } : {};
466
+ const bar = (name, data, sign) => ({ type: "bar", name, stack: "waterfall", data, emphasis: { focus: "series" }, ...label(sign) });
467
+ return finish(
468
+ {
469
+ tooltip: tooltip("item", fmt),
470
+ legend: { ...legend(input.legend, 3), data: [input.increaseLabel, input.decreaseLabel, input.totalLabel] },
471
+ xAxis: { type: "category", data: categories },
472
+ yAxis: valueAxis(fmt),
473
+ series: [
474
+ // Base invisible que eleva cada tramo hasta el acumulado anterior.
475
+ { type: "bar", name: "base", stack: "waterfall", data: base, silent: true, itemStyle: { color: "transparent", borderColor: "transparent" }, emphasis: { disabled: true }, tooltip: { show: false } },
476
+ bar(input.increaseLabel, inc, "+"),
477
+ bar(input.decreaseLabel, dec, "\u2212"),
478
+ bar(input.totalLabel, total, "")
479
+ ]
480
+ },
481
+ input.extend
482
+ );
483
+ }
484
+ function cohortOption(input) {
485
+ return heatmapOption({
486
+ xCategories: input.periods,
487
+ yCategories: input.cohorts,
488
+ values: input.values,
489
+ min: input.min ?? 0,
490
+ max: input.max ?? 100,
491
+ showLabels: input.showLabels ?? true,
492
+ showScale: input.showScale ?? false,
493
+ valueFormatter: input.valueFormatter,
494
+ extend: input.extend
495
+ });
496
+ }
497
+ function calendarOption(input) {
498
+ const locale = input.locale ?? "en";
499
+ const day = new Intl.DateTimeFormat(locale, { weekday: "narrow", timeZone: "UTC" });
500
+ const month = new Intl.DateTimeFormat(locale, { month: "short", timeZone: "UTC" });
501
+ const days = Array.from({ length: 7 }, (_, i) => day.format(Date.UTC(2023, 0, 1 + i)));
502
+ const months = Array.from({ length: 12 }, (_, i) => month.format(Date.UTC(2023, i, 1)));
503
+ const nums = input.data.map(([, v]) => v).filter((v) => v != null);
504
+ const showScale = input.showScale ?? true;
505
+ const fmt = input.valueFormatter;
506
+ return finish(
507
+ {
508
+ tooltip: tooltip("item", void 0, {
509
+ formatter: (p) => {
510
+ const [date, v] = p.value;
511
+ return `${escapeHtml(date)}: ${escapeHtml(typeof v === "number" ? fmt ? fmt(v) : v : "\u2013")}`;
512
+ }
513
+ }),
514
+ visualMap: {
515
+ show: showScale,
516
+ min: input.min ?? 0,
517
+ max: input.max ?? (nums.length ? Math.max(...nums) : 1),
518
+ calculable: false,
519
+ orient: "horizontal",
520
+ left: "center",
521
+ bottom: 0,
522
+ ...fmt ? { formatter: (v) => fmt(v) } : {}
523
+ },
524
+ calendar: {
525
+ range: input.range,
526
+ top: 24,
527
+ left: 32,
528
+ right: 8,
529
+ bottom: showScale ? 48 : 8,
530
+ cellSize: ["auto", "auto"],
531
+ splitLine: { show: false },
532
+ yearLabel: { show: false },
533
+ dayLabel: { firstDay: input.firstDay ?? 1, nameMap: days },
534
+ monthLabel: { nameMap: months }
535
+ },
536
+ series: [{ type: "heatmap", coordinateSystem: "calendar", data: input.data.map(([d, v]) => [d, v ?? "-"]) }]
537
+ },
538
+ input.extend
539
+ );
540
+ }
541
+ function graphOption(input) {
542
+ const cats = input.categories ?? [];
543
+ const values = input.nodes.map((n) => n.value).filter((v) => v != null);
544
+ const maxV = values.length ? Math.max(...values) : 0;
545
+ const size = (v) => v == null || !maxV ? 16 : 10 + 24 * Math.sqrt(v / maxV);
546
+ return finish(
547
+ {
548
+ tooltip: tooltip("item", input.valueFormatter),
549
+ legend: { ...legend(input.legend, cats.length), data: cats },
550
+ series: [
551
+ {
552
+ type: "graph",
553
+ layout: input.layout ?? "force",
554
+ roam: true,
555
+ draggable: (input.layout ?? "force") === "force",
556
+ label: { show: input.showLabels ?? true, position: "right" },
557
+ ...input.directed ? { edgeSymbol: ["none", "arrow"], edgeSymbolSize: 8 } : {},
558
+ data: input.nodes.map((n) => ({
559
+ id: n.id,
560
+ name: n.name ?? n.id,
561
+ value: n.value,
562
+ symbolSize: size(n.value),
563
+ ...n.category && cats.includes(n.category) ? { category: cats.indexOf(n.category) } : {}
564
+ })),
565
+ links: input.links,
566
+ categories: cats.map((name) => ({ name })),
567
+ force: { repulsion: 160, edgeLength: [48, 120] },
568
+ circular: { rotateLabel: true },
569
+ lineStyle: { curveness: input.layout === "circular" ? 0.2 : 0 },
570
+ emphasis: { focus: "adjacency" }
571
+ }
572
+ ]
573
+ },
574
+ input.extend
575
+ );
576
+ }
430
577
  export {
431
578
  barOption,
432
579
  boxplotOption,
580
+ calendarOption,
433
581
  candlestickOption,
582
+ cohortOption,
434
583
  comboOption,
435
584
  escapeHtml,
436
585
  funnelOption,
437
586
  gaugeOption,
587
+ graphOption,
438
588
  heatmapOption,
439
589
  lineOption,
440
590
  pieOption,
@@ -444,5 +594,6 @@ export {
444
594
  sankeyOption,
445
595
  scatterOption,
446
596
  sunburstOption,
447
- treemapOption
597
+ treemapOption,
598
+ waterfallOption
448
599
  };
@@ -21,6 +21,7 @@ import {
21
21
  } from "echarts/charts";
22
22
  import {
23
23
  AriaComponent,
24
+ CalendarComponent,
24
25
  DatasetComponent,
25
26
  DataZoomComponent,
26
27
  GraphicComponent,
@@ -64,6 +65,7 @@ function dsEcharts() {
64
65
  SankeyChart,
65
66
  ScatterChart,
66
67
  AriaComponent,
68
+ CalendarComponent,
67
69
  DatasetComponent,
68
70
  DataZoomComponent,
69
71
  GraphicComponent,
@@ -0,0 +1,177 @@
1
+ const BYTE_UNITS = {
2
+ By: 1,
3
+ kBy: 1e3,
4
+ MBy: 1e6,
5
+ GBy: 1e9,
6
+ TBy: 1e12,
7
+ PBy: 1e15,
8
+ KiBy: 1024,
9
+ MiBy: 1024 ** 2,
10
+ GiBy: 1024 ** 3,
11
+ TiBy: 1024 ** 4,
12
+ PiBy: 1024 ** 5
13
+ };
14
+ const BIT_RATE_UNITS = {
15
+ "bit/s": 1,
16
+ "kbit/s": 1e3,
17
+ "Mbit/s": 1e6,
18
+ "Gbit/s": 1e9,
19
+ "By/s": 8,
20
+ "kBy/s": 8e3,
21
+ "MBy/s": 8e6
22
+ };
23
+ const SI_BYTE_STEPS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
24
+ const BINARY_BYTE_STEPS = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
25
+ const BIT_RATE_STEPS = ["bit-per-second", "kilobit-per-second", "megabit-per-second", "gigabit-per-second"];
26
+ const INTL_UNITS = {
27
+ "%": "percent",
28
+ ms: "millisecond",
29
+ s: "second",
30
+ min: "minute",
31
+ h: "hour",
32
+ d: "day",
33
+ wk: "week",
34
+ mo: "month",
35
+ a: "year",
36
+ m: "meter",
37
+ km: "kilometer",
38
+ cm: "centimeter",
39
+ g: "gram",
40
+ kg: "kilogram",
41
+ L: "liter",
42
+ l: "liter",
43
+ Cel: "celsius",
44
+ "[degF]": "fahrenheit"
45
+ };
46
+ function isFiniteNumber(v) {
47
+ return typeof v === "number" && Number.isFinite(v);
48
+ }
49
+ function isByteUnit(unit) {
50
+ return !!unit && unit in BYTE_UNITS;
51
+ }
52
+ function toBytes(value, unit) {
53
+ const f = BYTE_UNITS[unit];
54
+ return f === void 0 ? null : value * f;
55
+ }
56
+ function scaled(value, base, steps) {
57
+ let n = value;
58
+ let i = 0;
59
+ while (Math.abs(n) >= base && i < steps.length - 1) {
60
+ n /= base;
61
+ i++;
62
+ }
63
+ return { n, step: steps[i] };
64
+ }
65
+ function digitsFor(n, max, fallback) {
66
+ if (max !== void 0) return max;
67
+ return Number.isInteger(n) ? 0 : fallback;
68
+ }
69
+ function formatQuantity(value, unit, options = {}) {
70
+ if (!isFiniteNumber(value)) return null;
71
+ const { locale, system = "si", unitDisplay = "short", maximumFractionDigits, compact } = options;
72
+ if (unit && unit in BYTE_UNITS) {
73
+ const bytes = value * BYTE_UNITS[unit];
74
+ if (system === "binary") {
75
+ const { n: n2, step: step2 } = scaled(bytes, 1024, BINARY_BYTE_STEPS);
76
+ const num = new Intl.NumberFormat(locale, { maximumFractionDigits: digitsFor(n2, maximumFractionDigits, 1) }).format(n2);
77
+ return `${num}\xA0${step2}`;
78
+ }
79
+ const { n, step } = scaled(bytes, 1e3, SI_BYTE_STEPS);
80
+ return new Intl.NumberFormat(locale, {
81
+ style: "unit",
82
+ unit: step,
83
+ unitDisplay,
84
+ maximumFractionDigits: digitsFor(n, maximumFractionDigits, 1)
85
+ }).format(n);
86
+ }
87
+ if (unit && unit in BIT_RATE_UNITS) {
88
+ const { n, step } = scaled(value * BIT_RATE_UNITS[unit], 1e3, BIT_RATE_STEPS);
89
+ return new Intl.NumberFormat(locale, {
90
+ style: "unit",
91
+ unit: step,
92
+ unitDisplay,
93
+ maximumFractionDigits: digitsFor(n, maximumFractionDigits, 1)
94
+ }).format(n);
95
+ }
96
+ const intlUnit = unit ? INTL_UNITS[unit] : void 0;
97
+ if (intlUnit) {
98
+ return new Intl.NumberFormat(locale, {
99
+ style: "unit",
100
+ unit: intlUnit,
101
+ unitDisplay,
102
+ maximumFractionDigits: digitsFor(value, maximumFractionDigits, 2)
103
+ }).format(value);
104
+ }
105
+ const plain = new Intl.NumberFormat(locale, {
106
+ maximumFractionDigits: digitsFor(value, maximumFractionDigits, 2),
107
+ ...compact ? { notation: "compact" } : {}
108
+ }).format(value);
109
+ if (!unit || unit === "1" || /^\{.*\}$/.test(unit)) return plain;
110
+ return `${plain}\xA0${unit}`;
111
+ }
112
+ function formatRatio(ratio, options = {}) {
113
+ if (!isFiniteNumber(ratio)) return null;
114
+ return new Intl.NumberFormat(options.locale, {
115
+ style: "percent",
116
+ maximumFractionDigits: options.maximumFractionDigits ?? 0
117
+ }).format(ratio);
118
+ }
119
+ function toDate(input) {
120
+ if (input === null || input === void 0 || input === "") return null;
121
+ const d = input instanceof Date ? input : new Date(input);
122
+ return Number.isNaN(d.getTime()) ? null : d;
123
+ }
124
+ const DATE_STYLES = {
125
+ date: { dateStyle: "medium" },
126
+ datetime: { dateStyle: "medium", timeStyle: "short" },
127
+ time: { timeStyle: "short" },
128
+ long: { dateStyle: "long" },
129
+ short: { dateStyle: "short" }
130
+ };
131
+ function formatDate(input, options = {}) {
132
+ const d = toDate(input);
133
+ if (!d) return null;
134
+ const fmt = options.format ?? DATE_STYLES[options.style ?? "date"];
135
+ return new Intl.DateTimeFormat(options.locale, { ...fmt, ...options.timeZone ? { timeZone: options.timeZone } : {} }).format(d);
136
+ }
137
+ const RELATIVE_STEPS = [
138
+ ["second", 60],
139
+ ["minute", 60],
140
+ ["hour", 24],
141
+ ["day", 7],
142
+ ["week", 4.345],
143
+ ["month", 12],
144
+ ["year", Number.POSITIVE_INFINITY]
145
+ ];
146
+ function formatRelativeTime(input, options = {}) {
147
+ const d = toDate(input);
148
+ if (!d) return null;
149
+ const now = toDate(options.now) ?? /* @__PURE__ */ new Date();
150
+ let delta = (d.getTime() - now.getTime()) / 1e3;
151
+ const rtf = new Intl.RelativeTimeFormat(options.locale, { numeric: options.numeric ?? "auto", style: options.style ?? "long" });
152
+ for (const [unit, size] of RELATIVE_STEPS) {
153
+ if (Math.abs(delta) < size) return rtf.format(Math.round(delta), unit);
154
+ delta /= size;
155
+ }
156
+ return rtf.format(Math.round(delta), "year");
157
+ }
158
+ function relativeTimeRefreshMs(input, now = /* @__PURE__ */ new Date()) {
159
+ const d = toDate(input);
160
+ const n = toDate(now);
161
+ if (!d || !n) return 0;
162
+ const s = Math.abs(d.getTime() - n.getTime()) / 1e3;
163
+ if (s < 60) return 1e4;
164
+ if (s < 3600) return 6e4;
165
+ if (s < 86400) return 36e5;
166
+ return 0;
167
+ }
168
+ export {
169
+ formatDate,
170
+ formatQuantity,
171
+ formatRatio,
172
+ formatRelativeTime,
173
+ isByteUnit,
174
+ relativeTimeRefreshMs,
175
+ toBytes,
176
+ toDate
177
+ };
package/dist/lib/i18n.js CHANGED
@@ -1,4 +1,8 @@
1
- const DS_LOCALES = ["en", "es", "pt-BR"];
1
+ import { fr } from "./locales/fr.js";
2
+ import { it } from "./locales/it.js";
3
+ import { de } from "./locales/de.js";
4
+ import { he } from "./locales/he.js";
5
+ const DS_LOCALES = ["en", "es", "pt-BR", "fr", "it", "de", "he"];
2
6
  const DS_DEFAULT_LOCALE = "en";
3
7
  const en = {
4
8
  close: "Close",
@@ -154,6 +158,9 @@ const en = {
154
158
  voiceError: "Could not use the microphone",
155
159
  voiceRetry: "Try again",
156
160
  composerRemoveFile: "Remove {name}",
161
+ tagRemove: "Remove {name}",
162
+ tagAdd: "Add a tag",
163
+ planNotIncluded: "Not included",
157
164
  composerCounter: "{count} of {max}",
158
165
  composerDrop: "Drop files to attach",
159
166
  composerUploading: "Uploading\u2026",
@@ -233,6 +240,10 @@ const en = {
233
240
  filterAll: "All",
234
241
  filterClear: "Clear filters",
235
242
  statNoData: "No data",
243
+ usageOf: "{value} of {limit}",
244
+ usageUnlimited: "{value} \xB7 unlimited",
245
+ usageRemaining: "{amount} left",
246
+ usageOver: "{amount} over the limit",
236
247
  heatmapLow: "Low",
237
248
  heatmapHigh: "High",
238
249
  dataTableFilter: "Filter",
@@ -315,6 +326,7 @@ const en = {
315
326
  copy: "Copy to clipboard",
316
327
  copied: "Copied",
317
328
  copyValue: "Copy {value}",
329
+ helpAbout: "What is: {term}",
318
330
  aiGenerated: "AI-generated",
319
331
  bottomNav: "Main navigation",
320
332
  dockLabel: "Main navigation",
@@ -681,6 +693,9 @@ const es = {
681
693
  voiceError: "No se pudo usar el micr\xF3fono",
682
694
  voiceRetry: "Reintentar",
683
695
  composerRemoveFile: "Quitar {name}",
696
+ tagRemove: "Quitar {name}",
697
+ tagAdd: "A\xF1adir etiqueta",
698
+ planNotIncluded: "No incluido",
684
699
  composerCounter: "{count} de {max}",
685
700
  composerDrop: "Suelta los archivos para adjuntarlos",
686
701
  composerUploading: "Subiendo\u2026",
@@ -760,6 +775,10 @@ const es = {
760
775
  filterAll: "Todos",
761
776
  filterClear: "Quitar filtros",
762
777
  statNoData: "Sin dato",
778
+ usageOf: "{value} de {limit}",
779
+ usageUnlimited: "{value} \xB7 ilimitado",
780
+ usageRemaining: "Quedan {amount}",
781
+ usageOver: "{amount} por encima del l\xEDmite",
763
782
  heatmapLow: "Bajo",
764
783
  heatmapHigh: "Alto",
765
784
  dataTableFilter: "Filtrar",
@@ -842,6 +861,7 @@ const es = {
842
861
  copy: "Copiar al portapapeles",
843
862
  copied: "Copiado",
844
863
  copyValue: "Copiar {value}",
864
+ helpAbout: "Qu\xE9 es: {term}",
845
865
  aiGenerated: "Generado con IA",
846
866
  bottomNav: "Navegaci\xF3n principal",
847
867
  dockLabel: "Navegaci\xF3n principal",
@@ -1208,6 +1228,9 @@ const ptBR = {
1208
1228
  voiceError: "N\xE3o foi poss\xEDvel usar o microfone",
1209
1229
  voiceRetry: "Tentar de novo",
1210
1230
  composerRemoveFile: "Remover {name}",
1231
+ tagRemove: "Remover {name}",
1232
+ tagAdd: "Adicionar etiqueta",
1233
+ planNotIncluded: "N\xE3o inclu\xEDdo",
1211
1234
  composerCounter: "{count} de {max}",
1212
1235
  composerDrop: "Solte os arquivos para anexar",
1213
1236
  composerUploading: "Enviando\u2026",
@@ -1287,6 +1310,10 @@ const ptBR = {
1287
1310
  filterAll: "Todos",
1288
1311
  filterClear: "Limpar filtros",
1289
1312
  statNoData: "Sem dado",
1313
+ usageOf: "{value} de {limit}",
1314
+ usageUnlimited: "{value} \xB7 ilimitado",
1315
+ usageRemaining: "Restam {amount}",
1316
+ usageOver: "{amount} acima do limite",
1290
1317
  heatmapLow: "Baixo",
1291
1318
  heatmapHigh: "Alto",
1292
1319
  dataTableFilter: "Filtrar",
@@ -1369,6 +1396,7 @@ const ptBR = {
1369
1396
  copy: "Copiar para a \xE1rea de transfer\xEAncia",
1370
1397
  copied: "Copiado",
1371
1398
  copyValue: "Copiar {value}",
1399
+ helpAbout: "O que \xE9: {term}",
1372
1400
  aiGenerated: "Gerado por IA",
1373
1401
  bottomNav: "Navega\xE7\xE3o principal",
1374
1402
  dockLabel: "Navega\xE7\xE3o principal",
@@ -1581,7 +1609,7 @@ const ptBR = {
1581
1609
  authErrorNetwork: "Sem conex\xE3o. Verifique sua conex\xE3o e tente novamente.",
1582
1610
  authErrorUnknown: "Algo deu errado. Tente novamente."
1583
1611
  };
1584
- const dsCatalogs = { en, es, "pt-BR": ptBR };
1612
+ const dsCatalogs = { en, es, "pt-BR": ptBR, fr, it, de, he };
1585
1613
  function resolveDsLocale(tag) {
1586
1614
  if (!tag) return DS_DEFAULT_LOCALE;
1587
1615
  const base = tag.split("-")[0];
@@ -1598,6 +1626,10 @@ function dsDirection(tag) {
1598
1626
  const base = (tag ?? "").toLowerCase().split("-")[0];
1599
1627
  return DS_RTL_LANGS.includes(base) ? "rtl" : "ltr";
1600
1628
  }
1629
+ function dsPhysicalSide(side, dir) {
1630
+ if (side === "left" || side === "right") return side;
1631
+ return side === "start" === (dir === "ltr") ? "left" : "right";
1632
+ }
1601
1633
  export {
1602
1634
  DS_DEFAULT_LOCALE,
1603
1635
  DS_LOCALES,
@@ -1606,5 +1638,6 @@ export {
1606
1638
  dsDirection,
1607
1639
  dsFormat,
1608
1640
  dsMessagesFor,
1641
+ dsPhysicalSide,
1609
1642
  resolveDsLocale
1610
1643
  };