@ponchia/ui 0.6.5 → 0.6.7

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 (108) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/README.md +43 -23
  3. package/behaviors/carousel.d.ts.map +1 -1
  4. package/behaviors/carousel.js +3 -0
  5. package/behaviors/dialog.d.ts.map +1 -1
  6. package/behaviors/dialog.js +14 -8
  7. package/behaviors/forms.d.ts.map +1 -1
  8. package/behaviors/forms.js +11 -5
  9. package/behaviors/index.d.ts +2 -0
  10. package/behaviors/index.d.ts.map +1 -1
  11. package/behaviors/index.js +2 -0
  12. package/behaviors/internal.d.ts +2 -1
  13. package/behaviors/internal.d.ts.map +1 -1
  14. package/behaviors/internal.js +23 -3
  15. package/behaviors/legend.d.ts.map +1 -1
  16. package/behaviors/legend.js +41 -9
  17. package/behaviors/splitter.d.ts +26 -0
  18. package/behaviors/splitter.d.ts.map +1 -0
  19. package/behaviors/splitter.js +200 -0
  20. package/behaviors/table.js +3 -3
  21. package/behaviors/theme.js +2 -2
  22. package/classes/classes.json +230 -4
  23. package/classes/index.d.ts +49 -1
  24. package/classes/index.js +56 -1
  25. package/classes/vscode.css-custom-data.json +1 -1
  26. package/css/analytical.css +3 -1
  27. package/css/app.css +4 -4
  28. package/css/clamp.css +92 -0
  29. package/css/figure.css +102 -0
  30. package/css/highlights.css +50 -0
  31. package/css/interval.css +90 -0
  32. package/css/primitives.css +2 -3
  33. package/css/report-kit.css +38 -0
  34. package/css/report.css +51 -4
  35. package/css/sidenote.css +12 -2
  36. package/css/site.css +2 -1
  37. package/css/sources.css +5 -0
  38. package/css/state.css +120 -1
  39. package/css/table.css +4 -0
  40. package/css/tokens.css +9 -9
  41. package/css/workbench.css +101 -8
  42. package/dist/bronto.css +1 -1
  43. package/dist/css/analytical.css +1 -1
  44. package/dist/css/app.css +1 -1
  45. package/dist/css/clamp.css +1 -0
  46. package/dist/css/figure.css +1 -0
  47. package/dist/css/highlights.css +1 -0
  48. package/dist/css/interval.css +1 -0
  49. package/dist/css/primitives.css +1 -1
  50. package/dist/css/report-kit.css +1 -0
  51. package/dist/css/report.css +1 -1
  52. package/dist/css/sidenote.css +1 -1
  53. package/dist/css/site.css +1 -1
  54. package/dist/css/sources.css +1 -1
  55. package/dist/css/state.css +1 -1
  56. package/dist/css/table.css +1 -1
  57. package/dist/css/tokens.css +1 -1
  58. package/dist/css/workbench.css +1 -1
  59. package/docs/adr/0002-scope-and-2026-baseline.md +1 -1
  60. package/docs/architecture.md +67 -43
  61. package/docs/clamp.md +49 -0
  62. package/docs/contrast.md +34 -24
  63. package/docs/d2.md +37 -0
  64. package/docs/figure.md +71 -0
  65. package/docs/frontier-primitives.md +48 -23
  66. package/docs/highlights.md +52 -0
  67. package/docs/interop/tailwind.md +148 -0
  68. package/docs/interval.md +55 -0
  69. package/docs/legends.md +3 -2
  70. package/docs/mermaid.md +6 -0
  71. package/docs/migrations/0.2-to-0.3.md +80 -0
  72. package/docs/migrations/0.3-to-0.4.md +48 -0
  73. package/docs/migrations/0.4-to-0.5.md +96 -0
  74. package/docs/migrations/0.5-to-0.6.md +82 -0
  75. package/docs/package-contract.md +40 -2
  76. package/docs/reference.md +79 -6
  77. package/docs/reporting.md +132 -56
  78. package/docs/sidenote.md +7 -1
  79. package/docs/sources.md +1 -1
  80. package/docs/stability.md +5 -3
  81. package/docs/state.md +67 -10
  82. package/docs/theming.md +10 -2
  83. package/docs/usage.md +31 -11
  84. package/docs/workbench.md +59 -18
  85. package/llms.txt +82 -14
  86. package/package.json +68 -6
  87. package/qwik/index.d.ts +1 -0
  88. package/qwik/index.d.ts.map +1 -1
  89. package/qwik/index.js +26 -21
  90. package/react/index.d.ts +1 -0
  91. package/react/index.d.ts.map +1 -1
  92. package/react/index.js +4 -1
  93. package/schemas/report-claims.v1.schema.json +137 -0
  94. package/solid/index.d.ts +2 -0
  95. package/solid/index.d.ts.map +1 -1
  96. package/solid/index.js +3 -0
  97. package/svelte/index.d.ts +88 -0
  98. package/svelte/index.d.ts.map +1 -0
  99. package/svelte/index.js +166 -0
  100. package/tailwind.css +87 -0
  101. package/tokens/figma.variables.json +2241 -0
  102. package/tokens/index.js +1 -1
  103. package/tokens/index.json +2 -2
  104. package/tokens/resolved.json +3 -3
  105. package/tokens/tokens.dtcg.json +1 -1
  106. package/vue/index.d.ts +79 -0
  107. package/vue/index.d.ts.map +1 -0
  108. package/vue/index.js +197 -0
package/tokens/index.js CHANGED
@@ -150,7 +150,7 @@ export const cssVars = {
150
150
  '--text-dim': '#a0a0a0',
151
151
  '--accent': '#ff3b41',
152
152
  '--accent-ramp-end': '#000000',
153
- '--accent-strong': 'color-mix(in srgb, var(--accent) 84%, #fff)',
153
+ '--accent-strong': 'color-mix(in srgb, var(--accent) 80%, #fff)',
154
154
  '--accent-text': 'var(--accent-strong)',
155
155
  // Read-only export: the resolved on-accent ink for FOREIGN renderers
156
156
  // (D2/Mermaid/Vega labels on an accent fill — see tokens/*.json). In-DOM
package/tokens/index.json CHANGED
@@ -123,7 +123,7 @@
123
123
  "--text-dim": "#a0a0a0",
124
124
  "--accent": "#ff3b41",
125
125
  "--accent-ramp-end": "#000000",
126
- "--accent-strong": "color-mix(in srgb, var(--accent) 84%, #fff)",
126
+ "--accent-strong": "color-mix(in srgb, var(--accent) 80%, #fff)",
127
127
  "--accent-text": "var(--accent-strong)",
128
128
  "--on-accent": "var(--button-text)",
129
129
  "--accent-soft": "color-mix(in srgb, var(--accent) 14%, transparent)",
@@ -269,7 +269,7 @@
269
269
  "text-dim": "#a0a0a0",
270
270
  "accent": "#ff3b41",
271
271
  "accent-ramp-end": "#000000",
272
- "accent-strong": "color-mix(in srgb, var(--accent) 84%, #fff)",
272
+ "accent-strong": "color-mix(in srgb, var(--accent) 80%, #fff)",
273
273
  "accent-text": "var(--accent-strong)",
274
274
  "on-accent": "var(--button-text)",
275
275
  "accent-soft": "color-mix(in srgb, var(--accent) 14%, transparent)",
@@ -70,7 +70,7 @@
70
70
  "--accent-3": "#330506",
71
71
  "--accent-4": "#80191c",
72
72
  "--accent-5": "#ff3b41",
73
- "--accent-6": "#ff5a5f",
73
+ "--accent-6": "#ff6267",
74
74
  "--surface-1": "#121212",
75
75
  "--surface-2": "#181818",
76
76
  "--surface-3": "#1c1c1c",
@@ -109,8 +109,8 @@
109
109
  "--text-dim": "#a0a0a0",
110
110
  "--accent": "#ff3b41",
111
111
  "--accent-ramp-end": "#000000",
112
- "--accent-strong": "#ff5a5f",
113
- "--accent-text": "#ff5a5f",
112
+ "--accent-strong": "#ff6267",
113
+ "--accent-text": "#ff6267",
114
114
  "--on-accent": "#000000",
115
115
  "--accent-soft": "rgba(255, 59, 65, 0.14)",
116
116
  "--success": "#4ec27e",
@@ -712,7 +712,7 @@
712
712
  "$type": "color",
713
713
  "$value": null,
714
714
  "$extensions": {
715
- "com.ponchia.css": "color-mix(in srgb, var(--accent) 84%, #fff)"
715
+ "com.ponchia.css": "color-mix(in srgb, var(--accent) 80%, #fff)"
716
716
  }
717
717
  },
718
718
  "text": {
package/vue/index.d.ts ADDED
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Create a Vue directive object from any Bronto delegated behavior initializer.
3
+ *
4
+ * @param {(opts?: DelegateOpts) => Cleanup | void} init
5
+ * @returns {BrontoDirective}
6
+ */
7
+ export function createBrontoDirective(init: (opts?: DelegateOpts) => Cleanup | void): BrontoDirective;
8
+ /** @type {BrontoDirective} */
9
+ export const vThemeToggle: BrontoDirective;
10
+ export const vDismissible: BrontoDirective;
11
+ export const vDisabledGuard: BrontoDirective;
12
+ export const vDisclosure: BrontoDirective;
13
+ export const vMenu: BrontoDirective;
14
+ export const vFormValidation: BrontoDirective;
15
+ export const vCombobox: BrontoDirective;
16
+ export const vPopover: BrontoDirective;
17
+ export const vTableSort: BrontoDirective;
18
+ export const vTabs: BrontoDirective;
19
+ export const vDialog: BrontoDirective;
20
+ export const vModal: BrontoDirective;
21
+ export const vCarousel: BrontoDirective;
22
+ export const vDotGlyph: BrontoDirective;
23
+ export const vLegend: BrontoDirective;
24
+ export const vConnectors: BrontoDirective;
25
+ export const vSpotlight: BrontoDirective;
26
+ export const vCrosshair: BrontoDirective;
27
+ export const vCommand: BrontoDirective;
28
+ export const vSources: BrontoDirective;
29
+ export const vSplitter: BrontoDirective;
30
+ export const directives: Readonly<{
31
+ themeToggle: BrontoDirective;
32
+ dismissible: BrontoDirective;
33
+ disabledGuard: BrontoDirective;
34
+ disclosure: BrontoDirective;
35
+ menu: BrontoDirective;
36
+ formValidation: BrontoDirective;
37
+ combobox: BrontoDirective;
38
+ popover: BrontoDirective;
39
+ tableSort: BrontoDirective;
40
+ tabs: BrontoDirective;
41
+ dialog: BrontoDirective;
42
+ modal: BrontoDirective;
43
+ carousel: BrontoDirective;
44
+ dotGlyph: BrontoDirective;
45
+ legend: BrontoDirective;
46
+ connectors: BrontoDirective;
47
+ spotlight: BrontoDirective;
48
+ crosshair: BrontoDirective;
49
+ command: BrontoDirective;
50
+ sources: BrontoDirective;
51
+ splitter: BrontoDirective;
52
+ }>;
53
+ export const brontoVue: Readonly<{
54
+ install(app: any): void;
55
+ }>;
56
+ export default brontoVue;
57
+ export function useToast(): (message: string, opts?: ToastOpts) => Cleanup;
58
+ export type Cleanup = import("../behaviors/index.js").Cleanup;
59
+ export type DelegateOpts = import("../behaviors/index.js").DelegateOpts;
60
+ export type ThemeStorageOpts = import("../behaviors/index.js").ThemeStorageOpts;
61
+ export type ToastOpts = import("../behaviors/index.js").ToastOpts;
62
+ export type BrontoDirectiveRoot = Document | Element | null | undefined;
63
+ export type BrontoDirectiveOpts = Omit<DelegateOpts, "root"> & {
64
+ root?: BrontoDirectiveRoot;
65
+ };
66
+ export type BrontoDirectiveBinding = {
67
+ value?: BrontoDirectiveOpts | null | undefined;
68
+ oldValue?: BrontoDirectiveOpts | null | undefined;
69
+ };
70
+ export type BrontoDirective = {
71
+ mounted: (el: Element, binding?: BrontoDirectiveBinding) => void;
72
+ updated: (el: Element, binding?: BrontoDirectiveBinding) => void;
73
+ beforeUnmount: (el: Element) => void;
74
+ };
75
+ import { applyStoredTheme } from '../behaviors/index.js';
76
+ import { toast } from '../behaviors/index.js';
77
+ export { applyStoredTheme, toast };
78
+ export { cls, ui, cx } from "../classes/index.js";
79
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAoFA;;;;;GAKG;AACH,4CAHW,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,GAAG,IAAI,GACrC,eAAe,CAgB3B;AAED,8BAA8B;AAC9B,2BADW,eAAe,CACyC;AACnE,2CAAmE;AACnE,6CAAuE;AACvE,0CAAiE;AACjE,oCAAqD;AACrD,8CAAyE;AACzE,wCAA6D;AAC7D,uCAA2D;AAC3D,yCAA+D;AAC/D,oCAAqD;AACrD,sCAAyD;AACzD,qCAAuD;AACvD,wCAA6D;AAC7D,wCAA6D;AAC7D,sCAAyD;AACzD,0CAAiE;AACjE,yCAA+D;AAC/D,yCAA+D;AAC/D,uCAA2D;AAC3D,uCAA2D;AAC3D,wCAA6D;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AA4BH;;GAQG;;AAMI,4BADM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,KAAK,OAAO,CACxB;sBAnLtB,OAAO,uBAAuB,EAAE,OAAO;2BACvC,OAAO,uBAAuB,EAAE,YAAY;+BAC5C,OAAO,uBAAuB,EAAE,gBAAgB;wBAChD,OAAO,uBAAuB,EAAE,SAAS;kCAEzC,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS;kCAErC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,mBAAmB,CAAA;CAAE;qCAE3D;IAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE;8BAErG;IAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAAC,aAAa,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE;iCA0BlL,uBAAuB;sBAAvB,uBAAuB"}
package/vue/index.js ADDED
@@ -0,0 +1,197 @@
1
+ /**
2
+ * @ponchia/ui/vue — thin Vue directives over @ponchia/ui/behaviors.
3
+ *
4
+ * The CSS is the framework; these are optional lifecycle adapters that run the
5
+ * vanilla behavior initializers from Vue directive hooks. They are plain
6
+ * directive objects, so this module has no runtime dependency on Vue.
7
+ *
8
+ * import { brontoVue } from '@ponchia/ui/vue';
9
+ * app.use(brontoVue);
10
+ *
11
+ * <main v-bronto-theme-toggle>
12
+ * <button data-bronto-theme-toggle>Toggle theme</button>
13
+ * </main>
14
+ *
15
+ * @typedef {import('../behaviors/index.js').Cleanup} Cleanup
16
+ * @typedef {import('../behaviors/index.js').DelegateOpts} DelegateOpts
17
+ * @typedef {import('../behaviors/index.js').ThemeStorageOpts} ThemeStorageOpts
18
+ * @typedef {import('../behaviors/index.js').ToastOpts} ToastOpts
19
+ *
20
+ * @typedef {Document | Element | null | undefined} BrontoDirectiveRoot
21
+ *
22
+ * @typedef {Omit<DelegateOpts, 'root'> & { root?: BrontoDirectiveRoot }} BrontoDirectiveOpts
23
+ *
24
+ * @typedef {{ value?: BrontoDirectiveOpts | null | undefined, oldValue?: BrontoDirectiveOpts | null | undefined }} BrontoDirectiveBinding
25
+ *
26
+ * @typedef {{ mounted: (el: Element, binding?: BrontoDirectiveBinding) => void, updated: (el: Element, binding?: BrontoDirectiveBinding) => void, beforeUnmount: (el: Element) => void }} BrontoDirective
27
+ */
28
+ import {
29
+ applyStoredTheme,
30
+ initThemeToggle,
31
+ dismissible as initDismissible,
32
+ initDisabledGuard,
33
+ initDisclosure,
34
+ initMenu,
35
+ initFormValidation,
36
+ initCombobox,
37
+ initPopover,
38
+ initTableSort,
39
+ initTabs,
40
+ initDialog,
41
+ initModal,
42
+ initCarousel,
43
+ initDotGlyph,
44
+ initLegend,
45
+ initConnectors,
46
+ initSpotlight,
47
+ initCrosshair,
48
+ initCommand,
49
+ initSources,
50
+ initSplitter,
51
+ toast,
52
+ } from '../behaviors/index.js';
53
+
54
+ const cleanups = new WeakMap();
55
+
56
+ function cleanupMap(el) {
57
+ let map = cleanups.get(el);
58
+ if (!map) {
59
+ map = new Map();
60
+ cleanups.set(el, map);
61
+ }
62
+ return map;
63
+ }
64
+
65
+ function stop(el, key) {
66
+ const map = cleanups.get(el);
67
+ const cleanup = map?.get(key);
68
+ if (typeof cleanup === 'function') cleanup();
69
+ map?.delete(key);
70
+ if (map?.size === 0) cleanups.delete(el);
71
+ }
72
+
73
+ function resolveOpts(el, opts) {
74
+ if (!opts || typeof opts !== 'object') return { root: el };
75
+ if (!('root' in opts)) return { ...opts, root: el };
76
+ return { ...opts, root: opts.root || null };
77
+ }
78
+
79
+ function start(el, key, init, opts) {
80
+ stop(el, key);
81
+ const cleanup = init(resolveOpts(el, opts));
82
+ if (typeof cleanup === 'function') cleanupMap(el).set(key, cleanup);
83
+ }
84
+
85
+ /**
86
+ * Create a Vue directive object from any Bronto delegated behavior initializer.
87
+ *
88
+ * @param {(opts?: DelegateOpts) => Cleanup | void} init
89
+ * @returns {BrontoDirective}
90
+ */
91
+ export function createBrontoDirective(init) {
92
+ const key = Symbol('bronto-vue-directive');
93
+ return {
94
+ mounted(el, binding) {
95
+ start(el, key, init, binding?.value);
96
+ },
97
+ updated(el, binding) {
98
+ if (binding?.value === binding?.oldValue) return;
99
+ start(el, key, init, binding?.value);
100
+ },
101
+ beforeUnmount(el) {
102
+ stop(el, key);
103
+ },
104
+ };
105
+ }
106
+
107
+ /** @type {BrontoDirective} */
108
+ export const vThemeToggle = createBrontoDirective(initThemeToggle);
109
+ export const vDismissible = createBrontoDirective(initDismissible);
110
+ export const vDisabledGuard = createBrontoDirective(initDisabledGuard);
111
+ export const vDisclosure = createBrontoDirective(initDisclosure);
112
+ export const vMenu = createBrontoDirective(initMenu);
113
+ export const vFormValidation = createBrontoDirective(initFormValidation);
114
+ export const vCombobox = createBrontoDirective(initCombobox);
115
+ export const vPopover = createBrontoDirective(initPopover);
116
+ export const vTableSort = createBrontoDirective(initTableSort);
117
+ export const vTabs = createBrontoDirective(initTabs);
118
+ export const vDialog = createBrontoDirective(initDialog);
119
+ export const vModal = createBrontoDirective(initModal);
120
+ export const vCarousel = createBrontoDirective(initCarousel);
121
+ export const vDotGlyph = createBrontoDirective(initDotGlyph);
122
+ export const vLegend = createBrontoDirective(initLegend);
123
+ export const vConnectors = createBrontoDirective(initConnectors);
124
+ export const vSpotlight = createBrontoDirective(initSpotlight);
125
+ export const vCrosshair = createBrontoDirective(initCrosshair);
126
+ export const vCommand = createBrontoDirective(initCommand);
127
+ export const vSources = createBrontoDirective(initSources);
128
+ export const vSplitter = createBrontoDirective(initSplitter);
129
+
130
+ export const directives = Object.freeze({
131
+ themeToggle: vThemeToggle,
132
+ dismissible: vDismissible,
133
+ disabledGuard: vDisabledGuard,
134
+ disclosure: vDisclosure,
135
+ menu: vMenu,
136
+ formValidation: vFormValidation,
137
+ combobox: vCombobox,
138
+ popover: vPopover,
139
+ tableSort: vTableSort,
140
+ tabs: vTabs,
141
+ dialog: vDialog,
142
+ modal: vModal,
143
+ carousel: vCarousel,
144
+ dotGlyph: vDotGlyph,
145
+ legend: vLegend,
146
+ connectors: vConnectors,
147
+ spotlight: vSpotlight,
148
+ crosshair: vCrosshair,
149
+ command: vCommand,
150
+ sources: vSources,
151
+ splitter: vSplitter,
152
+ });
153
+
154
+ const directiveNames = {
155
+ themeToggle: 'bronto-theme-toggle',
156
+ dismissible: 'bronto-dismissible',
157
+ disabledGuard: 'bronto-disabled-guard',
158
+ disclosure: 'bronto-disclosure',
159
+ menu: 'bronto-menu',
160
+ formValidation: 'bronto-form-validation',
161
+ combobox: 'bronto-combobox',
162
+ popover: 'bronto-popover',
163
+ tableSort: 'bronto-table-sort',
164
+ tabs: 'bronto-tabs',
165
+ dialog: 'bronto-dialog',
166
+ modal: 'bronto-modal',
167
+ carousel: 'bronto-carousel',
168
+ dotGlyph: 'bronto-dot-glyph',
169
+ legend: 'bronto-legend',
170
+ connectors: 'bronto-connectors',
171
+ spotlight: 'bronto-spotlight',
172
+ crosshair: 'bronto-crosshair',
173
+ command: 'bronto-command',
174
+ sources: 'bronto-sources',
175
+ splitter: 'bronto-splitter',
176
+ };
177
+
178
+ const camelizeDirectiveName = (name) => name.replace(/-([a-z])/g, (_m, ch) => ch.toUpperCase());
179
+
180
+ export const brontoVue = Object.freeze({
181
+ install(app) {
182
+ for (const [key, directive] of Object.entries(directives)) {
183
+ const name = directiveNames[key];
184
+ app.directive(name, directive);
185
+ app.directive(camelizeDirectiveName(name), directive);
186
+ }
187
+ },
188
+ });
189
+
190
+ export default brontoVue;
191
+
192
+ /** The `toast()` imperative (no lifecycle of its own).
193
+ * @returns {(message: string, opts?: ToastOpts) => Cleanup} */
194
+ export const useToast = () => toast;
195
+
196
+ export { applyStoredTheme, toast };
197
+ export { cls, ui, cx } from '../classes/index.js';