@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.
- package/CHANGELOG.md +170 -0
- package/README.md +43 -23
- package/behaviors/carousel.d.ts.map +1 -1
- package/behaviors/carousel.js +3 -0
- package/behaviors/dialog.d.ts.map +1 -1
- package/behaviors/dialog.js +14 -8
- package/behaviors/forms.d.ts.map +1 -1
- package/behaviors/forms.js +11 -5
- package/behaviors/index.d.ts +2 -0
- package/behaviors/index.d.ts.map +1 -1
- package/behaviors/index.js +2 -0
- package/behaviors/internal.d.ts +2 -1
- package/behaviors/internal.d.ts.map +1 -1
- package/behaviors/internal.js +23 -3
- package/behaviors/legend.d.ts.map +1 -1
- package/behaviors/legend.js +41 -9
- package/behaviors/splitter.d.ts +26 -0
- package/behaviors/splitter.d.ts.map +1 -0
- package/behaviors/splitter.js +200 -0
- package/behaviors/table.js +3 -3
- package/behaviors/theme.js +2 -2
- package/classes/classes.json +230 -4
- package/classes/index.d.ts +49 -1
- package/classes/index.js +56 -1
- package/classes/vscode.css-custom-data.json +1 -1
- package/css/analytical.css +3 -1
- package/css/app.css +4 -4
- package/css/clamp.css +92 -0
- package/css/figure.css +102 -0
- package/css/highlights.css +50 -0
- package/css/interval.css +90 -0
- package/css/primitives.css +2 -3
- package/css/report-kit.css +38 -0
- package/css/report.css +51 -4
- package/css/sidenote.css +12 -2
- package/css/site.css +2 -1
- package/css/sources.css +5 -0
- package/css/state.css +120 -1
- package/css/table.css +4 -0
- package/css/tokens.css +9 -9
- package/css/workbench.css +101 -8
- package/dist/bronto.css +1 -1
- package/dist/css/analytical.css +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/clamp.css +1 -0
- package/dist/css/figure.css +1 -0
- package/dist/css/highlights.css +1 -0
- package/dist/css/interval.css +1 -0
- package/dist/css/primitives.css +1 -1
- package/dist/css/report-kit.css +1 -0
- package/dist/css/report.css +1 -1
- package/dist/css/sidenote.css +1 -1
- package/dist/css/site.css +1 -1
- package/dist/css/sources.css +1 -1
- package/dist/css/state.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/dist/css/workbench.css +1 -1
- package/docs/adr/0002-scope-and-2026-baseline.md +1 -1
- package/docs/architecture.md +67 -43
- package/docs/clamp.md +49 -0
- package/docs/contrast.md +34 -24
- package/docs/d2.md +37 -0
- package/docs/figure.md +71 -0
- package/docs/frontier-primitives.md +48 -23
- package/docs/highlights.md +52 -0
- package/docs/interop/tailwind.md +148 -0
- package/docs/interval.md +55 -0
- package/docs/legends.md +3 -2
- package/docs/mermaid.md +6 -0
- package/docs/migrations/0.2-to-0.3.md +80 -0
- package/docs/migrations/0.3-to-0.4.md +48 -0
- package/docs/migrations/0.4-to-0.5.md +96 -0
- package/docs/migrations/0.5-to-0.6.md +82 -0
- package/docs/package-contract.md +40 -2
- package/docs/reference.md +79 -6
- package/docs/reporting.md +132 -56
- package/docs/sidenote.md +7 -1
- package/docs/sources.md +1 -1
- package/docs/stability.md +5 -3
- package/docs/state.md +67 -10
- package/docs/theming.md +10 -2
- package/docs/usage.md +31 -11
- package/docs/workbench.md +59 -18
- package/llms.txt +82 -14
- package/package.json +68 -6
- package/qwik/index.d.ts +1 -0
- package/qwik/index.d.ts.map +1 -1
- package/qwik/index.js +26 -21
- package/react/index.d.ts +1 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +4 -1
- package/schemas/report-claims.v1.schema.json +137 -0
- package/solid/index.d.ts +2 -0
- package/solid/index.d.ts.map +1 -1
- package/solid/index.js +3 -0
- package/svelte/index.d.ts +88 -0
- package/svelte/index.d.ts.map +1 -0
- package/svelte/index.js +166 -0
- package/tailwind.css +87 -0
- package/tokens/figma.variables.json +2241 -0
- package/tokens/index.js +1 -1
- package/tokens/index.json +2 -2
- package/tokens/resolved.json +3 -3
- package/tokens/tokens.dtcg.json +1 -1
- package/vue/index.d.ts +79 -0
- package/vue/index.d.ts.map +1 -0
- package/vue/index.js +197 -0
package/qwik/index.js
CHANGED
|
@@ -74,6 +74,7 @@ import {
|
|
|
74
74
|
initCrosshair,
|
|
75
75
|
initCommand,
|
|
76
76
|
initSources,
|
|
77
|
+
initSplitter,
|
|
77
78
|
toast,
|
|
78
79
|
} from '../behaviors/index.js';
|
|
79
80
|
|
|
@@ -119,90 +120,94 @@ function start(init, opts, ctx) {
|
|
|
119
120
|
* @param {BrontoBindingOptsResolver} [opts]
|
|
120
121
|
* @returns {void} */
|
|
121
122
|
export function useBrontoBehavior(init, opts) {
|
|
122
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
123
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
123
124
|
useVisibleTask$((ctx) => start(init, opts, ctx));
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
/** @param {BrontoBindingOptsResolver<ThemeStorageOpts & DelegateOpts>} [opts] @returns {void} */
|
|
127
128
|
export const useThemeToggle = (opts) =>
|
|
128
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
129
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
129
130
|
useVisibleTask$((ctx) => start(initThemeToggle, opts, ctx));
|
|
130
131
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
131
132
|
export const useDismissible = (opts) =>
|
|
132
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
133
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
133
134
|
useVisibleTask$((ctx) => start(dismissible, opts, ctx));
|
|
134
135
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
135
136
|
export const useDisabledGuard = (opts) =>
|
|
136
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
137
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
137
138
|
useVisibleTask$((ctx) => start(initDisabledGuard, opts, ctx));
|
|
138
139
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
139
140
|
export const useDisclosure = (opts) =>
|
|
140
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
141
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
141
142
|
useVisibleTask$((ctx) => start(initDisclosure, opts, ctx));
|
|
142
143
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
143
144
|
export const useMenu = (opts) =>
|
|
144
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
145
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
145
146
|
useVisibleTask$((ctx) => start(initMenu, opts, ctx));
|
|
146
147
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
147
148
|
export const useFormValidation = (opts) =>
|
|
148
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
149
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
149
150
|
useVisibleTask$((ctx) => start(initFormValidation, opts, ctx));
|
|
150
151
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
151
152
|
export const useCombobox = (opts) =>
|
|
152
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
153
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
153
154
|
useVisibleTask$((ctx) => start(initCombobox, opts, ctx));
|
|
154
155
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
155
156
|
export const usePopover = (opts) =>
|
|
156
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
157
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
157
158
|
useVisibleTask$((ctx) => start(initPopover, opts, ctx));
|
|
158
159
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
159
160
|
export const useTableSort = (opts) =>
|
|
160
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
161
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
161
162
|
useVisibleTask$((ctx) => start(initTableSort, opts, ctx));
|
|
162
163
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
163
164
|
export const useTabs = (opts) =>
|
|
164
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
165
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
165
166
|
useVisibleTask$((ctx) => start(initTabs, opts, ctx));
|
|
166
167
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
167
168
|
export const useDialog = (opts) =>
|
|
168
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
169
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
169
170
|
useVisibleTask$((ctx) => start(initDialog, opts, ctx));
|
|
170
171
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
171
172
|
export const useModal = (opts) =>
|
|
172
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
173
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
173
174
|
useVisibleTask$((ctx) => start(initModal, opts, ctx));
|
|
174
175
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
175
176
|
export const useCarousel = (opts) =>
|
|
176
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
177
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
177
178
|
useVisibleTask$((ctx) => start(initCarousel, opts, ctx));
|
|
178
179
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
179
180
|
export const useDotGlyph = (opts) =>
|
|
180
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
181
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
181
182
|
useVisibleTask$((ctx) => start(initDotGlyph, opts, ctx));
|
|
182
183
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
183
184
|
export const useLegend = (opts) =>
|
|
184
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
185
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
185
186
|
useVisibleTask$((ctx) => start(initLegend, opts, ctx));
|
|
186
187
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
187
188
|
export const useConnectors = (opts) =>
|
|
188
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
189
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
189
190
|
useVisibleTask$((ctx) => start(initConnectors, opts, ctx));
|
|
190
191
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
191
192
|
export const useSpotlight = (opts) =>
|
|
192
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
193
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
193
194
|
useVisibleTask$((ctx) => start(initSpotlight, opts, ctx));
|
|
194
195
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
195
196
|
export const useCrosshair = (opts) =>
|
|
196
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
197
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
197
198
|
useVisibleTask$((ctx) => start(initCrosshair, opts, ctx));
|
|
198
199
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
199
200
|
export const useCommand = (opts) =>
|
|
200
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
201
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
201
202
|
useVisibleTask$((ctx) => start(initCommand, opts, ctx));
|
|
202
203
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
203
204
|
export const useSources = (opts) =>
|
|
204
|
-
// eslint-disable-next-line qwik/no-use-visible-task -- delegated DOM glue + cleanup
|
|
205
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
205
206
|
useVisibleTask$((ctx) => start(initSources, opts, ctx));
|
|
207
|
+
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
208
|
+
export const useSplitter = (opts) =>
|
|
209
|
+
// eslint-disable-next-line qwik/no-use-visible-task -- intentional delegated DOM glue + cleanup
|
|
210
|
+
useVisibleTask$((ctx) => start(initSplitter, opts, ctx));
|
|
206
211
|
|
|
207
212
|
/** The `toast()` imperative (no lifecycle of its own).
|
|
208
213
|
* @returns {(message: string, opts?: ToastOpts) => Cleanup} */
|
package/react/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export function useSpotlight(opts?: BrontoBindingOptsResolver): void;
|
|
|
25
25
|
export function useCrosshair(opts?: BrontoBindingOptsResolver): void;
|
|
26
26
|
export function useCommand(opts?: BrontoBindingOptsResolver): void;
|
|
27
27
|
export function useSources(opts?: BrontoBindingOptsResolver): void;
|
|
28
|
+
export function useSplitter(opts?: BrontoBindingOptsResolver): void;
|
|
28
29
|
export function useToast(): (message: string, opts?: ToastOpts) => Cleanup;
|
|
29
30
|
export { applyStoredTheme };
|
|
30
31
|
export type Cleanup = import("../behaviors/index.js").Cleanup;
|
package/react/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAgGA;;;;;sBAKsB;AACtB,wCAHY,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,GAAG,IAAI,SACvC,yBAAyB,GACvB,IAAI,CAGjB;AAGM,sCADK,yBAAyB,CAAC,gBAAgB,GAAG,YAAY,CAAC,GAAmB,IAAI,CACb;AAEzE,sCADK,yBAAyB,GAAmB,IAAI,CACgB;AAErE,wCADK,yBAAyB,GAAmB,IAAI,CACwB;AAE7E,qCADK,yBAAyB,GAAmB,IAAI,CACkB;AAEvE,+BADK,yBAAyB,GAAmB,IAAI,CACM;AAE3D,yCADK,yBAAyB,GAAmB,IAAI,CAC0B;AAE/E,mCADK,yBAAyB,GAAmB,IAAI,CACc;AAEnE,kCADK,yBAAyB,GAAmB,IAAI,CACY;AAEjE,oCADK,yBAAyB,GAAmB,IAAI,CACgB;AAErE,+BADK,yBAAyB,GAAmB,IAAI,CACM;AAE3D,iCADK,yBAAyB,GAAmB,IAAI,CACU;AAE/D,gCADK,yBAAyB,GAAmB,IAAI,CACQ;AAE7D,mCADK,yBAAyB,GAAmB,IAAI,CACc;AAEnE,mCADK,yBAAyB,GAAmB,IAAI,CACc;AAEnE,iCADK,yBAAyB,GAAmB,IAAI,CACU;AAE/D,qCADK,yBAAyB,GAAmB,IAAI,CACkB;AAEvE,oCADK,yBAAyB,GAAmB,IAAI,CACgB;AAErE,oCADK,yBAAyB,GAAmB,IAAI,CACgB;AAErE,kCADK,yBAAyB,GAAmB,IAAI,CACY;AAEjE,kCADK,yBAAyB,GAAmB,IAAI,CACY;AAEjE,mCADK,yBAAyB,GAAmB,IAAI,CACc;AAInE,4BADO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,KAAK,OAAO,CACzB;;sBAjItB,OAAO,uBAAuB,EAAE,OAAO;2BACvC,OAAO,uBAAuB,EAAE,YAAY;+BAC5C,OAAO,uBAAuB,EAAE,gBAAgB;wBAChD,OAAO,uBAAuB,EAAE,SAAS;gCAEzC,QAAQ,GACd,OAAO,GACP;IAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GAClD,CAAC,MAAM,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,GAC7C,IAAI,GACJ,SAAS;8BAIa,CAAC,SAAhB,YAAa,sDACd,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,iBAAiB,CAAA;CAAE;sCAI9B,CAAC,SAAhB,YAAa,sDACd,iBAAiB,CAAC,CAAC,CAAC,GAC1B,CAAC,MAAM,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,GAC/C,IAAI,GACJ,SAAS;iCA2BT,uBAAuB"}
|
package/react/index.js
CHANGED
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
initCrosshair,
|
|
69
69
|
initCommand,
|
|
70
70
|
initSources,
|
|
71
|
+
initSplitter,
|
|
71
72
|
toast,
|
|
72
73
|
} from '../behaviors/index.js';
|
|
73
74
|
|
|
@@ -100,7 +101,7 @@ function resolveOpts(opts) {
|
|
|
100
101
|
* @param {BrontoBindingOptsResolver} [opts]
|
|
101
102
|
* @returns {void} */
|
|
102
103
|
export function useBrontoBehavior(init, opts) {
|
|
103
|
-
useEffect(() => init(resolveOpts(opts)), []); // eslint-disable-line react-hooks/exhaustive-deps -- delegated once on mount
|
|
104
|
+
useEffect(() => init(resolveOpts(opts)), []); // eslint-disable-line react-hooks/exhaustive-deps -- intentional delegated once on mount
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
/** @param {BrontoBindingOptsResolver<ThemeStorageOpts & DelegateOpts>} [opts] @returns {void} */
|
|
@@ -143,6 +144,8 @@ export const useCrosshair = (opts) => useBrontoBehavior(initCrosshair, opts);
|
|
|
143
144
|
export const useCommand = (opts) => useBrontoBehavior(initCommand, opts);
|
|
144
145
|
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
145
146
|
export const useSources = (opts) => useBrontoBehavior(initSources, opts);
|
|
147
|
+
/** @param {BrontoBindingOptsResolver} [opts] @returns {void} */
|
|
148
|
+
export const useSplitter = (opts) => useBrontoBehavior(initSplitter, opts);
|
|
146
149
|
|
|
147
150
|
/** The `toast()` imperative (no lifecycle of its own).
|
|
148
151
|
* @returns {(message: string, opts?: ToastOpts) => Cleanup} */
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@ponchia/ui/schemas/report-claims.v1.schema.json",
|
|
4
|
+
"title": "@ponchia/ui report claim/source sidecar v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "report", "claims", "sources"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"$ref": "#/$defs/uri"
|
|
11
|
+
},
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"const": "bronto-report-claims.v1"
|
|
14
|
+
},
|
|
15
|
+
"report": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["title", "type"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"id": { "$ref": "#/$defs/id" },
|
|
21
|
+
"title": { "type": "string", "minLength": 1 },
|
|
22
|
+
"type": {
|
|
23
|
+
"enum": ["executive", "decision", "research", "primer", "incident", "audit", "status"]
|
|
24
|
+
},
|
|
25
|
+
"generatedAt": { "$ref": "#/$defs/dateTime" },
|
|
26
|
+
"url": { "$ref": "#/$defs/uri" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"claims": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"items": { "$ref": "#/$defs/claim" }
|
|
33
|
+
},
|
|
34
|
+
"sources": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"minItems": 1,
|
|
37
|
+
"items": { "$ref": "#/$defs/source" }
|
|
38
|
+
},
|
|
39
|
+
"relations": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": { "$ref": "#/$defs/relation" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"$defs": {
|
|
45
|
+
"id": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
|
|
48
|
+
},
|
|
49
|
+
"dateTime": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "date-time"
|
|
52
|
+
},
|
|
53
|
+
"uri": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"format": "uri"
|
|
56
|
+
},
|
|
57
|
+
"hash": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"pattern": "^(sha256|sha384|sha512):[A-Fa-f0-9]+$"
|
|
60
|
+
},
|
|
61
|
+
"claimStatus": {
|
|
62
|
+
"enum": ["supported", "partial", "disputed", "unsupported", "unknown"]
|
|
63
|
+
},
|
|
64
|
+
"risk": {
|
|
65
|
+
"enum": ["low", "medium", "high", "critical"]
|
|
66
|
+
},
|
|
67
|
+
"sourceState": {
|
|
68
|
+
"enum": ["verified", "reviewed", "generated", "unverified", "stale", "conflict"]
|
|
69
|
+
},
|
|
70
|
+
"relationKind": {
|
|
71
|
+
"enum": ["supports", "limits", "contradicts", "informs"]
|
|
72
|
+
},
|
|
73
|
+
"claim": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"required": ["id", "status", "statement"],
|
|
77
|
+
"properties": {
|
|
78
|
+
"id": { "$ref": "#/$defs/id" },
|
|
79
|
+
"status": { "$ref": "#/$defs/claimStatus" },
|
|
80
|
+
"risk": { "$ref": "#/$defs/risk" },
|
|
81
|
+
"statement": { "type": "string", "minLength": 1 },
|
|
82
|
+
"scope": { "type": "string" },
|
|
83
|
+
"sourceIds": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": { "$ref": "#/$defs/id" },
|
|
86
|
+
"uniqueItems": true
|
|
87
|
+
},
|
|
88
|
+
"htmlId": { "$ref": "#/$defs/id" },
|
|
89
|
+
"caveat": { "type": "string" },
|
|
90
|
+
"reviewedAt": { "$ref": "#/$defs/dateTime" }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"source": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": ["id", "state", "title", "origin"],
|
|
97
|
+
"properties": {
|
|
98
|
+
"id": { "$ref": "#/$defs/id" },
|
|
99
|
+
"state": { "$ref": "#/$defs/sourceState" },
|
|
100
|
+
"title": { "type": "string", "minLength": 1 },
|
|
101
|
+
"origin": { "type": "string", "minLength": 1 },
|
|
102
|
+
"url": { "$ref": "#/$defs/uri" },
|
|
103
|
+
"artifactPath": { "type": "string" },
|
|
104
|
+
"contentHash": { "$ref": "#/$defs/hash" },
|
|
105
|
+
"retrievedAt": { "$ref": "#/$defs/dateTime" },
|
|
106
|
+
"method": { "type": "string" },
|
|
107
|
+
"caveat": { "type": "string" },
|
|
108
|
+
"supports": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"items": { "$ref": "#/$defs/id" },
|
|
111
|
+
"uniqueItems": true
|
|
112
|
+
},
|
|
113
|
+
"limits": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": { "$ref": "#/$defs/id" },
|
|
116
|
+
"uniqueItems": true
|
|
117
|
+
},
|
|
118
|
+
"contradicts": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": { "$ref": "#/$defs/id" },
|
|
121
|
+
"uniqueItems": true
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"relation": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": ["claimId", "sourceId", "kind"],
|
|
129
|
+
"properties": {
|
|
130
|
+
"claimId": { "$ref": "#/$defs/id" },
|
|
131
|
+
"sourceId": { "$ref": "#/$defs/id" },
|
|
132
|
+
"kind": { "$ref": "#/$defs/relationKind" },
|
|
133
|
+
"note": { "type": "string" }
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
package/solid/index.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export const useCrosshair: (opts?: BrontoBindingOptsResolver) => void;
|
|
|
45
45
|
export const useCommand: (opts?: BrontoBindingOptsResolver) => void;
|
|
46
46
|
/** @type {(opts?: BrontoBindingOptsResolver) => void} */
|
|
47
47
|
export const useSources: (opts?: BrontoBindingOptsResolver) => void;
|
|
48
|
+
/** @type {(opts?: BrontoBindingOptsResolver) => void} */
|
|
49
|
+
export const useSplitter: (opts?: BrontoBindingOptsResolver) => void;
|
|
48
50
|
/** The `toast()` imperative (no lifecycle of its own).
|
|
49
51
|
* @type {() => (message: string, opts?: ToastOpts) => Cleanup} */
|
|
50
52
|
export const useToast: () => (message: string, opts?: ToastOpts) => Cleanup;
|
package/solid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAkGA;;;;;GAKG;AACH,wCAJW,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,GAAG,IAAI,SACvC,yBAAyB,GACvB,IAAI,CAOhB;AAED,0FAA0F;AAC1F,6BADW,CAAC,IAAI,CAAC,EAAE,yBAAyB,CAAC,gBAAg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ter,
|
|
73
74
|
toast,
|
|
74
75
|
} from '../behaviors/index.js';
|
|
75
76
|
|
|
@@ -148,6 +149,8 @@ export const useCrosshair = (opts) => useBrontoBehavior(initCrosshair, opts);
|
|
|
148
149
|
export const useCommand = (opts) => useBrontoBehavior(initCommand, opts);
|
|
149
150
|
/** @type {(opts?: BrontoBindingOptsResolver) => void} */
|
|
150
151
|
export const useSources = (opts) => useBrontoBehavior(initSources, opts);
|
|
152
|
+
/** @type {(opts?: BrontoBindingOptsResolver) => void} */
|
|
153
|
+
export const useSplitter = (opts) => useBrontoBehavior(initSplitter, opts);
|
|
151
154
|
|
|
152
155
|
/** The `toast()` imperative (no lifecycle of its own).
|
|
153
156
|
* @type {() => (message: string, opts?: ToastOpts) => Cleanup} */
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a Svelte action from any Bronto delegated behavior initializer.
|
|
3
|
+
*
|
|
4
|
+
* @param {(opts?: DelegateOpts) => Cleanup | void} init
|
|
5
|
+
* @returns {(node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn}
|
|
6
|
+
*/
|
|
7
|
+
export function createBrontoAction(init: (opts?: DelegateOpts) => Cleanup | void): (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
8
|
+
/**
|
|
9
|
+
* Generic escape hatch for custom behavior initializers.
|
|
10
|
+
*
|
|
11
|
+
* @param {Element} node
|
|
12
|
+
* @param {BrontoBehaviorParams | null | undefined} params
|
|
13
|
+
* @returns {SvelteActionReturn}
|
|
14
|
+
*/
|
|
15
|
+
export function brontoBehavior(node: Element, params: BrontoBehaviorParams | null | undefined): SvelteActionReturn;
|
|
16
|
+
/**
|
|
17
|
+
* Generic escape hatch for custom behavior initializers.
|
|
18
|
+
*
|
|
19
|
+
* @param {Element} node
|
|
20
|
+
* @param {BrontoBehaviorParams | null | undefined} params
|
|
21
|
+
* @returns {SvelteActionReturn}
|
|
22
|
+
*/
|
|
23
|
+
export function useBrontoBehavior(node: Element, params: BrontoBehaviorParams | null | undefined): SvelteActionReturn;
|
|
24
|
+
/** @type {(node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn} */
|
|
25
|
+
export const themeToggle: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
26
|
+
export const dismissible: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
27
|
+
export const disabledGuard: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
28
|
+
export const disclosure: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
29
|
+
export const menu: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
30
|
+
export const formValidation: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
31
|
+
export const combobox: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
32
|
+
export const popover: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
33
|
+
export const tableSort: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
34
|
+
export const tabs: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
35
|
+
export const dialog: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
36
|
+
export const modal: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
37
|
+
export const carousel: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
38
|
+
export const dotGlyph: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
39
|
+
export const legend: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
40
|
+
export const connectors: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
41
|
+
export const spotlight: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
42
|
+
export const crosshair: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
43
|
+
export const command: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
44
|
+
export const sources: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
45
|
+
export const splitter: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
46
|
+
export const useThemeToggle: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
47
|
+
export const useDismissible: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
48
|
+
export const useDisabledGuard: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
49
|
+
export const useDisclosure: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
50
|
+
export const useMenu: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
51
|
+
export const useFormValidation: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
52
|
+
export const useCombobox: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
53
|
+
export const usePopover: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
54
|
+
export const useTableSort: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
55
|
+
export const useTabs: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
56
|
+
export const useDialog: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
57
|
+
export const useModal: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
58
|
+
export const useCarousel: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
59
|
+
export const useDotGlyph: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
60
|
+
export const useLegend: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
61
|
+
export const useConnectors: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
62
|
+
export const useSpotlight: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
63
|
+
export const useCrosshair: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
64
|
+
export const useCommand: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
65
|
+
export const useSources: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
66
|
+
export const useSplitter: (node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn;
|
|
67
|
+
export function useToast(): (message: string, opts?: ToastOpts) => Cleanup;
|
|
68
|
+
export type Cleanup = import("../behaviors/index.js").Cleanup;
|
|
69
|
+
export type DelegateOpts = import("../behaviors/index.js").DelegateOpts;
|
|
70
|
+
export type ThemeStorageOpts = import("../behaviors/index.js").ThemeStorageOpts;
|
|
71
|
+
export type ToastOpts = import("../behaviors/index.js").ToastOpts;
|
|
72
|
+
export type BrontoActionRoot = Document | Element | null | undefined;
|
|
73
|
+
export type BrontoActionOpts = Omit<DelegateOpts, "root"> & {
|
|
74
|
+
root?: BrontoActionRoot;
|
|
75
|
+
};
|
|
76
|
+
export type BrontoBehaviorParams = {
|
|
77
|
+
init: (opts?: DelegateOpts) => Cleanup | void;
|
|
78
|
+
opts?: BrontoActionOpts | null | undefined;
|
|
79
|
+
};
|
|
80
|
+
export type SvelteActionReturn = {
|
|
81
|
+
update?: (next?: unknown) => void;
|
|
82
|
+
destroy: () => void;
|
|
83
|
+
};
|
|
84
|
+
import { applyStoredTheme } from '../behaviors/index.js';
|
|
85
|
+
import { toast } from '../behaviors/index.js';
|
|
86
|
+
export { applyStoredTheme, toast };
|
|
87
|
+
export { cls, ui, cx } from "../classes/index.js";
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
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O,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAAK,kBAAkB,CAgFxD;AACtC,gCAjFoB,OAAO,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAAK,kBAAkB,CAiF5D;AAClC,gCAlFoB,OAAO,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAAK,kBAAkB,CAkF5D;AAClC,iCAnFoB,OAAO,SAAS,gBAAgB,GAAG,IAAI,GAAG,SAAS,KAAK,kBAAkB,CAmF1D;AAI7B,4BADM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,KAAK,OAAO,CACxB;sBAlJtB,OAAO,uBAAuB,EAAE,OAAO;2BACvC,OAAO,uBAAuB,EAAE,YAAY;+BAC5C,OAAO,uBAAuB,EAAE,gBAAgB;wBAChD,OAAO,uBAAuB,EAAE,SAAS;+BAEzC,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS;+BAErC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE;mCAExD;IAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE;iCAE7F;IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE;iCA0BhE,uBAAuB;sBAAvB,uBAAuB"}
|
package/svelte/index.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ponchia/ui/svelte — thin Svelte actions over @ponchia/ui/behaviors.
|
|
3
|
+
*
|
|
4
|
+
* The CSS is the framework; these are optional lifecycle adapters that run the
|
|
5
|
+
* SSR-safe vanilla behavior initializers when a Svelte action mounts and clean
|
|
6
|
+
* them up when the action updates or is destroyed. They do not define markup,
|
|
7
|
+
* own state, or depend on Svelte at runtime.
|
|
8
|
+
*
|
|
9
|
+
* <script>
|
|
10
|
+
* import { themeToggle } from '@ponchia/ui/svelte';
|
|
11
|
+
* </script>
|
|
12
|
+
*
|
|
13
|
+
* <main use:themeToggle>
|
|
14
|
+
* <button data-bronto-theme-toggle>Toggle theme</button>
|
|
15
|
+
* </main>
|
|
16
|
+
*
|
|
17
|
+
* @typedef {import('../behaviors/index.js').Cleanup} Cleanup
|
|
18
|
+
* @typedef {import('../behaviors/index.js').DelegateOpts} DelegateOpts
|
|
19
|
+
* @typedef {import('../behaviors/index.js').ThemeStorageOpts} ThemeStorageOpts
|
|
20
|
+
* @typedef {import('../behaviors/index.js').ToastOpts} ToastOpts
|
|
21
|
+
*
|
|
22
|
+
* @typedef {Document | Element | null | undefined} BrontoActionRoot
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Omit<DelegateOpts, 'root'> & { root?: BrontoActionRoot }} BrontoActionOpts
|
|
25
|
+
*
|
|
26
|
+
* @typedef {{ init: (opts?: DelegateOpts) => Cleanup | void, opts?: BrontoActionOpts | null | undefined }} BrontoBehaviorParams
|
|
27
|
+
*
|
|
28
|
+
* @typedef {{ update?: (next?: unknown) => void, destroy: () => void }} SvelteActionReturn
|
|
29
|
+
*/
|
|
30
|
+
import {
|
|
31
|
+
applyStoredTheme,
|
|
32
|
+
initThemeToggle,
|
|
33
|
+
dismissible as initDismissible,
|
|
34
|
+
initDisabledGuard,
|
|
35
|
+
initDisclosure,
|
|
36
|
+
initMenu,
|
|
37
|
+
initFormValidation,
|
|
38
|
+
initCombobox,
|
|
39
|
+
initPopover,
|
|
40
|
+
initTableSort,
|
|
41
|
+
initTabs,
|
|
42
|
+
initDialog,
|
|
43
|
+
initModal,
|
|
44
|
+
initCarousel,
|
|
45
|
+
initDotGlyph,
|
|
46
|
+
initLegend,
|
|
47
|
+
initConnectors,
|
|
48
|
+
initSpotlight,
|
|
49
|
+
initCrosshair,
|
|
50
|
+
initCommand,
|
|
51
|
+
initSources,
|
|
52
|
+
initSplitter,
|
|
53
|
+
toast,
|
|
54
|
+
} from '../behaviors/index.js';
|
|
55
|
+
|
|
56
|
+
function stop(cleanup) {
|
|
57
|
+
if (typeof cleanup === 'function') cleanup();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function resolveOpts(node, opts) {
|
|
61
|
+
if (!opts || typeof opts !== 'object') return { root: node };
|
|
62
|
+
if (!('root' in opts)) return { ...opts, root: node };
|
|
63
|
+
return { ...opts, root: opts.root || null };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function run(node, init, opts) {
|
|
67
|
+
if (typeof init !== 'function') return () => {};
|
|
68
|
+
const cleanup = init(resolveOpts(node, opts));
|
|
69
|
+
return typeof cleanup === 'function' ? cleanup : () => {};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Create a Svelte action from any Bronto delegated behavior initializer.
|
|
74
|
+
*
|
|
75
|
+
* @param {(opts?: DelegateOpts) => Cleanup | void} init
|
|
76
|
+
* @returns {(node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn}
|
|
77
|
+
*/
|
|
78
|
+
export function createBrontoAction(init) {
|
|
79
|
+
return (node, opts) => {
|
|
80
|
+
let cleanup = run(node, init, opts);
|
|
81
|
+
return {
|
|
82
|
+
update(next) {
|
|
83
|
+
stop(cleanup);
|
|
84
|
+
cleanup = run(node, init, next);
|
|
85
|
+
},
|
|
86
|
+
destroy() {
|
|
87
|
+
stop(cleanup);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Generic escape hatch for custom behavior initializers.
|
|
95
|
+
*
|
|
96
|
+
* @param {Element} node
|
|
97
|
+
* @param {BrontoBehaviorParams | null | undefined} params
|
|
98
|
+
* @returns {SvelteActionReturn}
|
|
99
|
+
*/
|
|
100
|
+
export function brontoBehavior(node, params) {
|
|
101
|
+
let cleanup = run(node, params?.init, params?.opts);
|
|
102
|
+
return {
|
|
103
|
+
update(next) {
|
|
104
|
+
stop(cleanup);
|
|
105
|
+
cleanup = run(node, next?.init, next?.opts);
|
|
106
|
+
},
|
|
107
|
+
destroy() {
|
|
108
|
+
stop(cleanup);
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const useBrontoBehavior = brontoBehavior;
|
|
114
|
+
|
|
115
|
+
/** @type {(node: Element, opts?: BrontoActionOpts | null | undefined) => SvelteActionReturn} */
|
|
116
|
+
export const themeToggle = createBrontoAction(initThemeToggle);
|
|
117
|
+
export const dismissible = createBrontoAction(initDismissible);
|
|
118
|
+
export const disabledGuard = createBrontoAction(initDisabledGuard);
|
|
119
|
+
export const disclosure = createBrontoAction(initDisclosure);
|
|
120
|
+
export const menu = createBrontoAction(initMenu);
|
|
121
|
+
export const formValidation = createBrontoAction(initFormValidation);
|
|
122
|
+
export const combobox = createBrontoAction(initCombobox);
|
|
123
|
+
export const popover = createBrontoAction(initPopover);
|
|
124
|
+
export const tableSort = createBrontoAction(initTableSort);
|
|
125
|
+
export const tabs = createBrontoAction(initTabs);
|
|
126
|
+
export const dialog = createBrontoAction(initDialog);
|
|
127
|
+
export const modal = createBrontoAction(initModal);
|
|
128
|
+
export const carousel = createBrontoAction(initCarousel);
|
|
129
|
+
export const dotGlyph = createBrontoAction(initDotGlyph);
|
|
130
|
+
export const legend = createBrontoAction(initLegend);
|
|
131
|
+
export const connectors = createBrontoAction(initConnectors);
|
|
132
|
+
export const spotlight = createBrontoAction(initSpotlight);
|
|
133
|
+
export const crosshair = createBrontoAction(initCrosshair);
|
|
134
|
+
export const command = createBrontoAction(initCommand);
|
|
135
|
+
export const sources = createBrontoAction(initSources);
|
|
136
|
+
export const splitter = createBrontoAction(initSplitter);
|
|
137
|
+
|
|
138
|
+
// Hook-style aliases keep this action surface parallel with React/Solid/Qwik.
|
|
139
|
+
export const useThemeToggle = themeToggle;
|
|
140
|
+
export const useDismissible = dismissible;
|
|
141
|
+
export const useDisabledGuard = disabledGuard;
|
|
142
|
+
export const useDisclosure = disclosure;
|
|
143
|
+
export const useMenu = menu;
|
|
144
|
+
export const useFormValidation = formValidation;
|
|
145
|
+
export const useCombobox = combobox;
|
|
146
|
+
export const usePopover = popover;
|
|
147
|
+
export const useTableSort = tableSort;
|
|
148
|
+
export const useTabs = tabs;
|
|
149
|
+
export const useDialog = dialog;
|
|
150
|
+
export const useModal = modal;
|
|
151
|
+
export const useCarousel = carousel;
|
|
152
|
+
export const useDotGlyph = dotGlyph;
|
|
153
|
+
export const useLegend = legend;
|
|
154
|
+
export const useConnectors = connectors;
|
|
155
|
+
export const useSpotlight = spotlight;
|
|
156
|
+
export const useCrosshair = crosshair;
|
|
157
|
+
export const useCommand = command;
|
|
158
|
+
export const useSources = sources;
|
|
159
|
+
export const useSplitter = splitter;
|
|
160
|
+
|
|
161
|
+
/** The `toast()` imperative (no lifecycle of its own).
|
|
162
|
+
* @returns {(message: string, opts?: ToastOpts) => Cleanup} */
|
|
163
|
+
export const useToast = () => toast;
|
|
164
|
+
|
|
165
|
+
export { applyStoredTheme, toast };
|
|
166
|
+
export { cls, ui, cx } from '../classes/index.js';
|