@stackable-labs/sdk-extension-react 1.21.0 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/context.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * React contexts for the extension runtime.
3
- */
4
- import { createContext } from 'react';
5
- /** Context for surface-level data (provided by host per surface) */
6
- export const SurfaceContext = createContext(null);
7
- export const ExtensionContext = createContext(null);
8
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAA;AAOjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAA+B,IAAI,CAAC,CAAA"}
@@ -1,21 +0,0 @@
1
- /**
2
- * createExtension — bootstraps the extension runtime in the iframe sandbox.
3
- * Sets up Remote DOM, RPC listener, and renders the extension's React tree.
4
- */
5
- import React from 'react';
6
- interface CreateExtensionOptions {
7
- extensionId?: string;
8
- }
9
- /**
10
- * Bootstrap an extension. Call this as the entry point of your extension bundle.
11
- *
12
- * @example
13
- * export default createExtension(() => (
14
- * <>
15
- * <Surface id="slot.header"><Header /></Surface>
16
- * <Surface id="slot.content"><Content /></Surface>
17
- * </>
18
- * ));
19
- */
20
- export declare const createExtension: (factory: () => React.ReactElement, options?: CreateExtensionOptions) => void;
21
- export {};
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createRoot } from 'react-dom/client';
3
- import { ExtensionContext } from './context';
4
- import { initRpcListener } from './rpc-client';
5
- /**
6
- * Bootstrap an extension. Call this as the entry point of your extension bundle.
7
- *
8
- * @example
9
- * export default createExtension(() => (
10
- * <>
11
- * <Surface id="slot.header"><Header /></Surface>
12
- * <Surface id="slot.content"><Content /></Surface>
13
- * </>
14
- * ));
15
- */
16
- export const createExtension = (factory, options) => {
17
- // Resolve extensionId: prefer host-injected value, then options, then fallback
18
- const injectedId = window.__STACKABLE_EXTENSION_ID__ ??
19
- new URLSearchParams(window.location.search).get('__extensionId') ??
20
- undefined;
21
- const extensionId = injectedId ?? options?.extensionId ?? 'unknown';
22
- console.debug(`[createExtension] extensionId resolved: "${extensionId}" (injected: ${injectedId ?? 'none'}, options: ${options?.extensionId ?? 'none'})`);
23
- // Initialize RPC listener for capability responses
24
- initRpcListener(extensionId);
25
- const contextValue = {
26
- extensionId,
27
- };
28
- // Mount the extension React tree
29
- const container = document.getElementById('extension-root') ?? document.body;
30
- const root = createRoot(container);
31
- root.render(_jsx(ExtensionContext.Provider, { value: contextValue, children: factory() }));
32
- // Notify host that the extension is ready
33
- window.parent.postMessage({ type: 'extension-ready', extensionId }, '*');
34
- };
35
- //# sourceMappingURL=createExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createExtension.js","sourceRoot":"","sources":["../src/createExtension.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAM9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAiC,EAAE,OAAgC,EAAQ,EAAE;IAC3G,+EAA+E;IAC/E,MAAM,UAAU,GACb,MAA6C,CAAC,0BAAgD;QAC/F,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QAChE,SAAS,CAAA;IACX,MAAM,WAAW,GAAG,UAAU,IAAI,OAAO,EAAE,WAAW,IAAI,SAAS,CAAA;IACnE,OAAO,CAAC,KAAK,CAAC,4CAA4C,WAAW,gBAAgB,UAAU,IAAI,MAAM,cAAc,OAAO,EAAE,WAAW,IAAI,MAAM,GAAG,CAAC,CAAA;IAEzJ,mDAAmD;IACnD,eAAe,CAAC,WAAW,CAAC,CAAA;IAE5B,MAAM,YAAY,GAA0B;QAC1C,WAAW;KACZ,CAAA;IAED,iCAAiC;IACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAA;IAC5E,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IAElC,IAAI,CAAC,MAAM,CACT,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,OAAO,EAAE,GACgB,CAC7B,CAAA;IAED,0CAA0C;IAC1C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,GAAG,CAAC,CAAA;AAC1E,CAAC,CAAA"}
package/dist/hooks.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * React hooks for extension developers.
3
- */
4
- import type { ContextData, ApiRequest, FetchRequestInit, FetchResponse, ToastPayload } from '@stackable-labs/sdk-extension-contracts';
5
- import type { Store } from './store';
6
- /**
7
- * Read the host-provided context for the current surface.
8
- */
9
- export declare const useSurfaceContext: () => Record<string, unknown>;
10
- /**
11
- * Access host-mediated capabilities (data, actions, context).
12
- */
13
- export declare const useCapabilities: () => {
14
- data: {
15
- query: <T = unknown>(payload: ApiRequest) => Promise<T>;
16
- fetch: (url: string, init?: FetchRequestInit) => Promise<FetchResponse>;
17
- };
18
- actions: {
19
- toast: (payload: ToastPayload) => Promise<void>;
20
- invoke: <T = unknown>(action: string, payload?: Record<string, unknown>) => Promise<T>;
21
- };
22
- context: {
23
- read: () => Promise<ContextData>;
24
- };
25
- };
26
- /**
27
- * Subscribe to a shared store with an optional selector.
28
- */
29
- export declare const useStore: <T, S = T>(store: Store<T>, selector?: (state: T) => S) => S;
30
- /**
31
- * Access the extension-level context (extension ID, manifest, etc.)
32
- */
33
- export declare const useExtension: () => import("./context").ExtensionContextValue;
package/dist/hooks.js DELETED
@@ -1,52 +0,0 @@
1
- /**
2
- * React hooks for extension developers.
3
- */
4
- import { useContext, useSyncExternalStore, useCallback } from 'react';
5
- import { ExtensionContext, SurfaceContext } from './context';
6
- import { callCapability } from './rpc-client';
7
- /**
8
- * Read the host-provided context for the current surface.
9
- */
10
- export const useSurfaceContext = () => {
11
- const ctx = useContext(SurfaceContext);
12
- if (!ctx) {
13
- throw new Error('useSurfaceContext must be used inside a <Surface> component');
14
- }
15
- return ctx;
16
- };
17
- /**
18
- * Access host-mediated capabilities (data, actions, context).
19
- */
20
- export const useCapabilities = () => ({
21
- data: {
22
- query: (payload) => callCapability('data.query', payload),
23
- fetch: (url, init) => callCapability('data.fetch', { url, ...init }),
24
- },
25
- actions: {
26
- toast: (payload) => callCapability('actions.toast', payload),
27
- invoke: (action, payload) => callCapability('actions.invoke', { action, payload }),
28
- },
29
- context: {
30
- read: () => callCapability('context.read'),
31
- },
32
- });
33
- /**
34
- * Subscribe to a shared store with an optional selector.
35
- */
36
- export const useStore = (store, selector) => {
37
- const select = selector ?? ((s) => s);
38
- const getSnapshot = useCallback(() => select(store.get()), [store, select]);
39
- const subscribe = useCallback((onStoreChange) => store.subscribe(onStoreChange), [store]);
40
- return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
41
- };
42
- /**
43
- * Access the extension-level context (extension ID, manifest, etc.)
44
- */
45
- export const useExtension = () => {
46
- const ctx = useContext(ExtensionContext);
47
- if (!ctx) {
48
- throw new Error('useExtension must be used inside a createExtension() tree');
49
- }
50
- return ctx;
51
- };
52
- //# sourceMappingURL=hooks.js.map
package/dist/hooks.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,oB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AC,CAAA;IAExD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAE3E,MAAM,SAAS,GAAG,WAAW,CAC3B,CAAC,aAAyB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,EAC7D,CAAC,KAAK,CAAC,CACR,CAAA;IAED,OAAO,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;AAClE,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,GAAG,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAA;IACxC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,YAAY,GACb,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,MAAM,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,12 +0,0 @@
1
- /**
2
- * RPC Client — sends capability requests from sandbox to host via postMessage.
3
- */
4
- import type { CapabilityType } from '@stackable-labs/sdk-extension-contracts';
5
- /**
6
- * Initialize the RPC listener for responses from the host.
7
- */
8
- export declare const initRpcListener: (extensionId: string) => void;
9
- /**
10
- * Send a capability request to the host and await the response.
11
- */
12
- export declare const callCapability: <T = unknown>(capability: CapabilityType, payload?: unknown) => Promise<T>;
@@ -1,56 +0,0 @@
1
- /**
2
- * RPC Client — sends capability requests from sandbox to host via postMessage.
3
- */
4
- let requestCounter = 0;
5
- let registeredExtensionId = 'unknown';
6
- const pendingRequests = new Map();
7
- const generateRequestId = () => `req_${++requestCounter}_${Date.now()}`;
8
- /**
9
- * Initialize the RPC listener for responses from the host.
10
- */
11
- export const initRpcListener = (extensionId) => {
12
- registeredExtensionId = extensionId;
13
- window.addEventListener('message', (event) => {
14
- const msg = event.data;
15
- if (msg?.type === 'capability-response') {
16
- const response = msg;
17
- const pending = pendingRequests.get(response.id);
18
- if (pending) {
19
- pendingRequests.delete(response.id);
20
- if (response.success) {
21
- pending.resolve(response.data);
22
- }
23
- else {
24
- pending.reject(new Error(response.error || 'Capability call failed'));
25
- }
26
- }
27
- }
28
- });
29
- };
30
- /**
31
- * Send a capability request to the host and await the response.
32
- */
33
- export const callCapability = (capability, payload) => (new Promise((resolve, reject) => {
34
- const id = generateRequestId();
35
- pendingRequests.set(id, {
36
- resolve: resolve,
37
- reject,
38
- });
39
- const request = {
40
- type: 'capability-request',
41
- id,
42
- extensionId: registeredExtensionId,
43
- capability,
44
- payload,
45
- };
46
- // Post to parent (host) window
47
- window.parent.postMessage(request, '*');
48
- // Timeout after 30 seconds
49
- setTimeout(() => {
50
- if (pendingRequests.has(id)) {
51
- pendingRequests.delete(id);
52
- reject(new Error(`Capability call '${capability}' timed out`));
53
- }
54
- }, 30000);
55
- }));
56
- //# sourceMappingURL=rpc-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc-client.js","sourceRoot":"","sources":["../src/rpc-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,IAAI,cAAc,GAAG,CAAC,CAAA;AACtB,IAAI,qBAAqB,GAAG,SAAS,CAAA;AACrC,MAAM,eAAe,GAAG,IAAI,GA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AM,OAAO,GAAsB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,EAAE;QACF,WAAW,EAAE,qBAAqB;QAClC,UAAU;QACV,OAAO;KACR,CAAA;IAED,+BAA+B;IAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAEvC,2BAA2B;IAC3B,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC5B,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAC1B,MAAM,CAAC,IAAI,KAAK,CAAC,oBAAoB,UAAU,aAAa,CAAC,CAAC,CAAA;QAChE,CAAC;IACH,CAAC,EAAE,KAAK,CAAC,CAAA;AACX,CAAC,CAAC,CACH,CAAA"}
package/dist/store.d.ts DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Shared Store — cross-surface state coordination.
3
- * All surfaces in the same extension runtime share a store instance.
4
- */
5
- type Listener<T> = (state: T) => void;
6
- export interface Store<T> {
7
- get(): T;
8
- set(partial: Partial<T>): void;
9
- subscribe(listener: Listener<T>): () => void;
10
- }
11
- /**
12
- * Create a shared store for cross-surface coordination.
13
- *
14
- * @example
15
- * const store = createStore({ mode: 'account', selectedId: null });
16
- * store.set({ mode: 'conversations' });
17
- * store.subscribe((state) => console.log(state));
18
- */
19
- export declare const createStore: <T extends object>(initialState: T) => Store<T>;
20
- export {};
package/dist/store.js DELETED
@@ -1,30 +0,0 @@
1
- /**
2
- * Shared Store — cross-surface state coordination.
3
- * All surfaces in the same extension runtime share a store instance.
4
- */
5
- /**
6
- * Create a shared store for cross-surface coordination.
7
- *
8
- * @example
9
- * const store = createStore({ mode: 'account', selectedId: null });
10
- * store.set({ mode: 'conversations' });
11
- * store.subscribe((state) => console.log(state));
12
- */
13
- export const createStore = (initialState) => {
14
- let state = { ...initialState };
15
- const listeners = new Set();
16
- return {
17
- get: () => state,
18
- set: (partial) => {
19
- state = { ...state, ...partial };
20
- listeners.forEach((listener) => listener(state));
21
- },
22
- subscribe: (listener) => {
23
- listeners.add(listener);
24
- return () => {
25
- listeners.delete(listener);
26
- };
27
- },
28
- };
29
- };
30
- //# sourceMappingURL=store.js.map
package/dist/store.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAmB,YAAe,EAAY,EAAE;IACzE,IAAI,KAAK,GAAG,EAAE,GAAG,YAAY,EAAE,CAAA;IAC/B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAe,CAAA;IAExC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK;QAEhB,GAAG,EAAE,CAAC,OAAmB,EAAE,EAAE;YAC3B,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAA;YAChC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QAClD,CAAC;QAED,SAAS,EAAE,CAAC,QAAqB,EAAE,EAAE;YACnC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC5B,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
package/dist/ui.d.ts DELETED
@@ -1,366 +0,0 @@
1
- /**
2
- * UI Component Wrappers for Extensions
3
- *
4
- * These are thin React components that render Remote DOM custom elements.
5
- * The host maps these custom elements to real React components (e.g., shadcn/ui).
6
- *
7
- * Extension developers use these as: <ui.Card>, <ui.Button>, etc.
8
- */
9
- import React from 'react';
10
- import type { AllowedIconName } from '@stackable-labs/sdk-extension-contracts';
11
- type RemoteInputChangeEvent = {
12
- target: {
13
- value: string;
14
- };
15
- };
16
- export declare const Card: (props: {
17
- className?: string;
18
- onClick?: () => void;
19
- children?: React.ReactNode;
20
- }) => import("react/jsx-runtime").JSX.Element;
21
- export declare const CardContent: (props: {
22
- className?: string;
23
- children?: React.ReactNode;
24
- }) => import("react/jsx-runtime").JSX.Element;
25
- export declare const CardHeader: (props: {
26
- className?: string;
27
- children?: React.ReactNode;
28
- }) => import("react/jsx-runtime").JSX.Element;
29
- export declare const Stack: (props: {
30
- gap?: string;
31
- direction?: "row" | "column";
32
- align?: string;
33
- className?: string;
34
- children?: React.ReactNode;
35
- }) => import("react/jsx-runtime").JSX.Element;
36
- export declare const Inline: (props: {
37
- gap?: string;
38
- align?: string;
39
- className?: string;
40
- children?: React.ReactNode;
41
- }) => import("react/jsx-runtime").JSX.Element;
42
- export declare const Text: (props: {
43
- className?: string;
44
- tone?: string;
45
- children?: React.ReactNode;
46
- }) => import("react/jsx-runtime").JSX.Element;
47
- export declare const Heading: (props: {
48
- level?: "1" | "2" | "3" | "4" | "5" | "6";
49
- className?: string;
50
- children?: React.ReactNode;
51
- }) => import("react/jsx-runtime").JSX.Element;
52
- export declare const Badge: (props: {
53
- variant?: string;
54
- tone?: string;
55
- className?: string;
56
- children?: React.ReactNode;
57
- }) => import("react/jsx-runtime").JSX.Element;
58
- export declare const Button: (props: {
59
- variant?: string;
60
- size?: string;
61
- disabled?: boolean;
62
- onClick?: () => void;
63
- type?: string;
64
- className?: string;
65
- title?: string;
66
- children?: React.ReactNode;
67
- }) => import("react/jsx-runtime").JSX.Element;
68
- export declare const Input: (props: {
69
- type?: string;
70
- placeholder?: string;
71
- value?: string;
72
- onChange?: (e: RemoteInputChangeEvent) => void;
73
- disabled?: boolean;
74
- className?: string;
75
- id?: string;
76
- }) => import("react/jsx-runtime").JSX.Element;
77
- export declare const Textarea: (props: {
78
- placeholder?: string;
79
- value?: string;
80
- onChange?: (e: RemoteInputChangeEvent) => void;
81
- disabled?: boolean;
82
- rows?: string;
83
- className?: string;
84
- id?: string;
85
- }) => import("react/jsx-runtime").JSX.Element;
86
- export declare const Select: (props: {
87
- value?: string;
88
- defaultValue?: string;
89
- onChange?: (e: RemoteInputChangeEvent) => void;
90
- placeholder?: string;
91
- disabled?: boolean;
92
- className?: string;
93
- children?: React.ReactNode;
94
- }) => import("react/jsx-runtime").JSX.Element;
95
- export declare const SelectOption: (props: {
96
- value: string;
97
- disabled?: boolean;
98
- className?: string;
99
- children?: React.ReactNode;
100
- }) => import("react/jsx-runtime").JSX.Element;
101
- export declare const Checkbox: (props: {
102
- checked?: boolean;
103
- onChange?: (e: RemoteInputChangeEvent) => void;
104
- disabled?: boolean;
105
- className?: string;
106
- id?: string;
107
- }) => import("react/jsx-runtime").JSX.Element;
108
- export declare const Switch: (props: {
109
- checked?: boolean;
110
- onChange?: (e: RemoteInputChangeEvent) => void;
111
- disabled?: boolean;
112
- size?: string;
113
- className?: string;
114
- id?: string;
115
- }) => import("react/jsx-runtime").JSX.Element;
116
- export declare const Label: (props: {
117
- htmlFor?: string;
118
- className?: string;
119
- children?: React.ReactNode;
120
- }) => import("react/jsx-runtime").JSX.Element;
121
- export declare const RadioGroup: (props: {
122
- value?: string;
123
- defaultValue?: string;
124
- onChange?: (e: RemoteInputChangeEvent) => void;
125
- className?: string;
126
- children?: React.ReactNode;
127
- }) => import("react/jsx-runtime").JSX.Element;
128
- export declare const RadioGroupItem: (props: {
129
- value: string;
130
- disabled?: boolean;
131
- className?: string;
132
- id?: string;
133
- }) => import("react/jsx-runtime").JSX.Element;
134
- export declare const Separator: (props: {
135
- className?: string;
136
- }) => import("react/jsx-runtime").JSX.Element;
137
- export declare const Tabs: (props: {
138
- defaultValue?: string;
139
- className?: string;
140
- children?: React.ReactNode;
141
- }) => import("react/jsx-runtime").JSX.Element;
142
- export declare const TabsList: (props: {
143
- className?: string;
144
- children?: React.ReactNode;
145
- }) => import("react/jsx-runtime").JSX.Element;
146
- export declare const TabsTrigger: (props: {
147
- value: string;
148
- className?: string;
149
- children?: React.ReactNode;
150
- }) => import("react/jsx-runtime").JSX.Element;
151
- export declare const TabsContent: (props: {
152
- value: string;
153
- className?: string;
154
- children?: React.ReactNode;
155
- }) => import("react/jsx-runtime").JSX.Element;
156
- export declare const ScrollArea: (props: {
157
- className?: string;
158
- children?: React.ReactNode;
159
- }) => import("react/jsx-runtime").JSX.Element;
160
- export declare const Skeleton: (props: {
161
- width?: string;
162
- height?: string;
163
- className?: string;
164
- }) => import("react/jsx-runtime").JSX.Element;
165
- export declare const Tooltip: (props: {
166
- content: string;
167
- className?: string;
168
- children?: React.ReactNode;
169
- }) => import("react/jsx-runtime").JSX.Element;
170
- export declare const Progress: (props: {
171
- value?: string;
172
- className?: string;
173
- }) => import("react/jsx-runtime").JSX.Element;
174
- export declare const Alert: (props: {
175
- variant?: string;
176
- title?: string;
177
- className?: string;
178
- children?: React.ReactNode;
179
- }) => import("react/jsx-runtime").JSX.Element;
180
- export declare const Collapsible: (props: {
181
- defaultOpen?: boolean;
182
- className?: string;
183
- children?: React.ReactNode;
184
- }) => import("react/jsx-runtime").JSX.Element;
185
- export declare const CollapsibleTrigger: (props: {
186
- className?: string;
187
- children?: React.ReactNode;
188
- }) => import("react/jsx-runtime").JSX.Element;
189
- export declare const CollapsibleContent: (props: {
190
- className?: string;
191
- children?: React.ReactNode;
192
- }) => import("react/jsx-runtime").JSX.Element;
193
- export declare const Avatar: (props: {
194
- src?: string;
195
- alt?: string;
196
- className?: string;
197
- }) => import("react/jsx-runtime").JSX.Element;
198
- export declare const Icon: (props: {
199
- name: AllowedIconName;
200
- size?: string;
201
- className?: string;
202
- }) => import("react/jsx-runtime").JSX.Element;
203
- export declare const Link: (props: {
204
- href?: string;
205
- target?: string;
206
- rel?: string;
207
- className?: string;
208
- children?: React.ReactNode;
209
- }) => import("react/jsx-runtime").JSX.Element;
210
- export declare const FooterLink: (props: {
211
- href?: string;
212
- children?: React.ReactNode;
213
- }) => import("react/jsx-runtime").JSX.Element;
214
- export declare const Menu: (props: {
215
- title?: string;
216
- className?: string;
217
- children?: React.ReactNode;
218
- }) => import("react/jsx-runtime").JSX.Element;
219
- export declare const MenuItem: (props: {
220
- icon?: AllowedIconName;
221
- label: string;
222
- description?: string;
223
- onClick?: () => void;
224
- className?: string;
225
- }) => import("react/jsx-runtime").JSX.Element;
226
- declare global {
227
- namespace JSX {
228
- interface IntrinsicElements {
229
- 'ui-card': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
230
- 'ui-card-content': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
231
- 'ui-card-header': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
232
- 'ui-button': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
233
- variant?: string;
234
- size?: string;
235
- disabled?: boolean;
236
- type?: string;
237
- title?: string;
238
- }, HTMLElement>;
239
- 'ui-text': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
240
- tone?: string;
241
- }, HTMLElement>;
242
- 'ui-heading': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
243
- level?: string;
244
- }, HTMLElement>;
245
- 'ui-badge': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
246
- variant?: string;
247
- tone?: string;
248
- }, HTMLElement>;
249
- 'ui-input': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
250
- type?: string;
251
- placeholder?: string;
252
- value?: string;
253
- onChange?: (e: RemoteInputChangeEvent) => void;
254
- disabled?: boolean;
255
- id?: string;
256
- };
257
- 'ui-textarea': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
258
- placeholder?: string;
259
- value?: string;
260
- onChange?: (e: RemoteInputChangeEvent) => void;
261
- disabled?: boolean;
262
- rows?: string;
263
- id?: string;
264
- };
265
- 'ui-select': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
266
- value?: string;
267
- defaultValue?: string;
268
- onChange?: (e: RemoteInputChangeEvent) => void;
269
- placeholder?: string;
270
- disabled?: boolean;
271
- };
272
- 'ui-select-option': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
273
- value?: string;
274
- disabled?: boolean;
275
- }, HTMLElement>;
276
- 'ui-checkbox': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
277
- checked?: boolean;
278
- onChange?: (e: RemoteInputChangeEvent) => void;
279
- disabled?: boolean;
280
- id?: string;
281
- };
282
- 'ui-switch': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
283
- checked?: boolean;
284
- onChange?: (e: RemoteInputChangeEvent) => void;
285
- disabled?: boolean;
286
- size?: string;
287
- id?: string;
288
- };
289
- 'ui-label': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
290
- htmlFor?: string;
291
- }, HTMLElement>;
292
- 'ui-radio-group': Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
293
- value?: string;
294
- defaultValue?: string;
295
- onChange?: (e: RemoteInputChangeEvent) => void;
296
- };
297
- 'ui-radio-group-item': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
298
- value?: string;
299
- disabled?: boolean;
300
- id?: string;
301
- }, HTMLElement>;
302
- 'ui-stack': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
303
- gap?: string;
304
- direction?: string;
305
- align?: string;
306
- }, HTMLElement>;
307
- 'ui-inline': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
308
- gap?: string;
309
- align?: string;
310
- }, HTMLElement>;
311
- 'ui-separator': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
312
- 'ui-tabs': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
313
- defaultValue?: string;
314
- }, HTMLElement>;
315
- 'ui-tabs-list': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
316
- 'ui-tabs-trigger': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
317
- value?: string;
318
- }, HTMLElement>;
319
- 'ui-tabs-content': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
320
- value?: string;
321
- }, HTMLElement>;
322
- 'ui-scroll-area': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
323
- 'ui-avatar': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
324
- src?: string;
325
- alt?: string;
326
- }, HTMLElement>;
327
- 'ui-icon': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
328
- name?: string;
329
- size?: string;
330
- }, HTMLElement>;
331
- 'ui-link': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
332
- href?: string;
333
- target?: string;
334
- rel?: string;
335
- }, HTMLElement>;
336
- 'ui-menu-item': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
337
- icon?: string;
338
- label?: string;
339
- description?: string;
340
- }, HTMLElement>;
341
- 'ui-menu': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
342
- title?: string;
343
- }, HTMLElement>;
344
- 'ui-skeleton': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
345
- width?: string;
346
- height?: string;
347
- }, HTMLElement>;
348
- 'ui-tooltip': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
349
- content?: string;
350
- }, HTMLElement>;
351
- 'ui-progress': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
352
- value?: string;
353
- }, HTMLElement>;
354
- 'ui-alert': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
355
- variant?: string;
356
- title?: string;
357
- }, HTMLElement>;
358
- 'ui-collapsible': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
359
- defaultOpen?: boolean;
360
- }, HTMLElement>;
361
- 'ui-collapsible-trigger': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
362
- 'ui-collapsible-content': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
363
- }
364
- }
365
- }
366
- export {};