@astryxdesign/native 0.7.4-canary.720bb10 → 0.7.5-canary.04434e7
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/README.md +116 -4
- package/apple/Sources/AstryxNative/Generated/AstryxBase.swift +1 -1
- package/apple/Sources/AstryxNative/Generated/AstryxNode.swift +69 -0
- package/apple/Sources/AstryxNative/Generated/AstryxWire.swift +67 -0
- package/apple/Sources/AstryxNative/Generated/Badge.swift +89 -0
- package/apple/Sources/AstryxNative/Generated/Button.swift +154 -0
- package/apple/Sources/AstryxNative/Generated/Card.swift +117 -0
- package/apple/Sources/AstryxNative/Generated/Divider.swift +97 -0
- package/apple/Sources/AstryxNative/Generated/HStack.swift +308 -0
- package/apple/Sources/AstryxNative/Generated/Heading.swift +169 -0
- package/apple/Sources/AstryxNative/Generated/ProgressBar.swift +144 -0
- package/apple/Sources/AstryxNative/Generated/Selector.swift +133 -9
- package/apple/Sources/AstryxNative/Generated/Switch.swift +202 -0
- package/apple/Sources/AstryxNative/Generated/Text.swift +172 -0
- package/apple/Sources/AstryxNative/Generated/TextInput.swift +243 -0
- package/apple/Sources/AstryxNative/Generated/VStack.swift +308 -0
- package/apple/Sources/AstryxNative/Logic/AstryxLogicHost.swift +102 -0
- package/apple/Tests/AstryxNativeTests/ControlPropsTests.swift +29 -0
- package/apple/Tests/AstryxNativeTests/LogicHostTests.swift +85 -0
- package/apple/Tests/AstryxNativeTests/WireTests.swift +53 -0
- package/dist/components/Badge.d.ts +10 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +7 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +15 -0
- package/dist/components/Card.d.ts +10 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +7 -0
- package/dist/components/Divider.d.ts +10 -0
- package/dist/components/Divider.d.ts.map +1 -0
- package/dist/components/Divider.js +6 -0
- package/dist/components/HStack.d.ts +10 -0
- package/dist/components/HStack.d.ts.map +1 -0
- package/dist/components/HStack.js +9 -0
- package/dist/components/Heading.d.ts +10 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/Heading.js +14 -0
- package/dist/components/ProgressBar.d.ts +10 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +5 -0
- package/dist/components/Switch.d.ts +10 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +6 -0
- package/dist/components/Text.d.ts +10 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +13 -0
- package/dist/components/TextInput.d.ts +10 -0
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/components/TextInput.js +9 -0
- package/dist/components/VStack.d.ts +10 -0
- package/dist/components/VStack.d.ts.map +1 -0
- package/dist/components/VStack.js +9 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +25 -1
- package/dist/components/stackShared.d.ts +9 -0
- package/dist/components/stackShared.d.ts.map +1 -0
- package/dist/components/stackShared.js +4 -0
- package/dist/contract/fromComponentDoc.d.ts +44 -5
- package/dist/contract/fromComponentDoc.d.ts.map +1 -1
- package/dist/contract/fromComponentDoc.js +47 -4
- package/dist/contract/generateSwift.d.ts.map +1 -1
- package/dist/contract/generateSwift.js +193 -10
- package/dist/contract/generateTypeScript.d.ts.map +1 -1
- package/dist/contract/generateTypeScript.js +69 -9
- package/dist/contract/index.d.ts +7 -3
- package/dist/contract/index.d.ts.map +1 -1
- package/dist/contract/index.js +2 -1
- package/dist/contract/parseDocType.d.ts +5 -2
- package/dist/contract/parseDocType.d.ts.map +1 -1
- package/dist/contract/parseDocType.js +34 -5
- package/dist/contract/rules.d.ts +5 -2
- package/dist/contract/rules.d.ts.map +1 -1
- package/dist/contract/rules.js +8 -4
- package/dist/contract/types.d.ts +11 -0
- package/dist/contract/types.d.ts.map +1 -1
- package/dist/logic/connectBridge.d.ts +29 -0
- package/dist/logic/connectBridge.d.ts.map +1 -0
- package/dist/logic/connectBridge.js +32 -0
- package/dist/logic/createLogicCore.d.ts +44 -0
- package/dist/logic/createLogicCore.d.ts.map +1 -0
- package/dist/logic/createLogicCore.js +40 -0
- package/dist/logic/index.d.ts +12 -0
- package/dist/logic/index.d.ts.map +1 -0
- package/dist/logic/index.js +10 -0
- package/dist/types/android.d.ts +136 -2
- package/dist/types/core.d.ts +150 -0
- package/dist/types/ios.d.ts +136 -2
- package/dist/types/macos.d.ts +136 -2
- package/dist/types/shared.d.ts +136 -2
- package/dist/types/windows.d.ts +136 -2
- package/package.json +10 -4
- package/src/components/Badge.ts +18 -0
- package/src/components/Button.ts +26 -0
- package/src/components/Card.ts +18 -0
- package/src/components/Divider.ts +17 -0
- package/src/components/HStack.ts +20 -0
- package/src/components/Heading.ts +25 -0
- package/src/components/ProgressBar.ts +16 -0
- package/src/components/Switch.ts +17 -0
- package/src/components/Text.ts +24 -0
- package/src/components/TextInput.ts +20 -0
- package/src/components/VStack.ts +20 -0
- package/src/components/index.ts +25 -1
- package/src/components/stackShared.ts +14 -0
- package/src/contract/contracts.test.ts +58 -0
- package/src/contract/fromComponentDoc.test.ts +97 -0
- package/src/contract/fromComponentDoc.ts +106 -9
- package/src/contract/generateSwift.ts +223 -10
- package/src/contract/generateTypeScript.ts +83 -10
- package/src/contract/index.ts +13 -4
- package/src/contract/parseDocType.test.ts +45 -0
- package/src/contract/parseDocType.ts +41 -6
- package/src/contract/rules.ts +11 -4
- package/src/contract/types.ts +6 -0
- package/src/logic/connectBridge.ts +72 -0
- package/src/logic/createLogicCore.ts +97 -0
- package/src/logic/index.ts +19 -0
- package/src/logic/logic.test.ts +160 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file logic/connectBridge.ts
|
|
3
|
+
* @input A logic core and the native host's two calls in
|
|
4
|
+
* @output The two calls the host makes: read the snapshot, dispatch an action
|
|
5
|
+
* @position Carries a logic core across a JavaScript engine boundary as JSON
|
|
6
|
+
* strings, the one form every engine bridge passes cheaply
|
|
7
|
+
*/
|
|
8
|
+
import type { LogicAction, LogicCore, LogicNode } from './createLogicCore.js';
|
|
9
|
+
/** Bumped when the bridge's calls or their JSON change meaning. */
|
|
10
|
+
export declare const BRIDGE_VERSION = 1;
|
|
11
|
+
/** What the native host offers the core. */
|
|
12
|
+
export interface BridgeHost {
|
|
13
|
+
/**
|
|
14
|
+
* The core is running and speaks this bridge version. Called while
|
|
15
|
+
* `connectBridge` runs, before it returns the bridge: read and dispatch
|
|
16
|
+
* through the returned bridge, not from inside this call.
|
|
17
|
+
*/
|
|
18
|
+
connected(bridgeVersion: number): void;
|
|
19
|
+
/** The tree changed; here it is as JSON. */
|
|
20
|
+
changed(snapshotJSON: string): void;
|
|
21
|
+
}
|
|
22
|
+
export interface Bridge {
|
|
23
|
+
getSnapshot(): string;
|
|
24
|
+
/** An action as the host's JSON, such as Swift's `AstryxAction.json`. */
|
|
25
|
+
dispatch(actionJSON: string): void;
|
|
26
|
+
disconnect(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function connectBridge<State, Node extends LogicNode, Action extends LogicAction>(core: LogicCore<State, Node, Action>, host: BridgeHost): Bridge;
|
|
29
|
+
//# sourceMappingURL=connectBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectBridge.d.ts","sourceRoot":"","sources":["../../src/logic/connectBridge.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE5E,mEAAmE;AACnE,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,4CAA4C;IAC5C,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,MAAM;IACrB,WAAW,IAAI,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,UAAU,IAAI,IAAI,CAAC;CACpB;AAeD,wBAAgB,aAAa,CAC3B,KAAK,EACL,IAAI,SAAS,SAAS,EACtB,MAAM,SAAS,WAAW,EAC1B,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAiBhE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
//
|
|
3
|
+
// Follows the bridge of EJ Campbell's astryx-swift spike
|
|
4
|
+
// (github.com/ejc3/astryx-swift, MIT).
|
|
5
|
+
/** Bumped when the bridge's calls or their JSON change meaning. */
|
|
6
|
+
export const BRIDGE_VERSION = 1;
|
|
7
|
+
function isAction(value) {
|
|
8
|
+
if (typeof value !== 'object' || value === null) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const action = value;
|
|
12
|
+
return (typeof action.key === 'string' &&
|
|
13
|
+
typeof action.component === 'string' &&
|
|
14
|
+
typeof action.event === 'string' &&
|
|
15
|
+
Array.isArray(action.args));
|
|
16
|
+
}
|
|
17
|
+
export function connectBridge(core, host) {
|
|
18
|
+
const unsubscribe = core.subscribe(() => host.changed(JSON.stringify(core.getSnapshot())));
|
|
19
|
+
host.connected(BRIDGE_VERSION);
|
|
20
|
+
return {
|
|
21
|
+
getSnapshot: () => JSON.stringify(core.getSnapshot()),
|
|
22
|
+
dispatch(actionJSON) {
|
|
23
|
+
const action = JSON.parse(actionJSON);
|
|
24
|
+
if (!isAction(action)) {
|
|
25
|
+
throw new Error(`Not an Astryx action: ${actionJSON}`);
|
|
26
|
+
}
|
|
27
|
+
// The host sends only actions for callbacks the tree listed in `events`.
|
|
28
|
+
core.dispatch(action);
|
|
29
|
+
},
|
|
30
|
+
disconnect: unsubscribe,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file logic/createLogicCore.ts
|
|
3
|
+
* @input A screen's initial state, a view of the state as a node tree, and a
|
|
4
|
+
* reducer of actions
|
|
5
|
+
* @output A logic core: the current tree, a dispatcher, and change listeners
|
|
6
|
+
* @position Arm C of the native experiment (AST-082 FR12): component logic in
|
|
7
|
+
* TypeScript, run by a JavaScript engine inside a native app, decides every
|
|
8
|
+
* word, value, and state; native views draw the tree and send actions back.
|
|
9
|
+
* Uses ECMAScript built-ins only, so it runs in Hermes, Node, and browsers
|
|
10
|
+
*/
|
|
11
|
+
/** The least a node has: the component it names and its identity in the tree. */
|
|
12
|
+
export interface LogicNode {
|
|
13
|
+
readonly component: string;
|
|
14
|
+
readonly key: string;
|
|
15
|
+
}
|
|
16
|
+
/** The least an action has: the node, its component, the callback, and its arguments. */
|
|
17
|
+
export interface LogicAction {
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly component: string;
|
|
20
|
+
readonly event: string;
|
|
21
|
+
readonly args: readonly unknown[];
|
|
22
|
+
}
|
|
23
|
+
export interface LogicCoreOptions<State, Node extends LogicNode, Action extends LogicAction> {
|
|
24
|
+
readonly initial: State;
|
|
25
|
+
/** The whole screen for a state. Pure: the same state gives the same tree. */
|
|
26
|
+
readonly view: (state: State) => Node;
|
|
27
|
+
/** The next state after an action. Returns the same state when nothing changes. */
|
|
28
|
+
readonly reduce: (state: State, action: Action) => State;
|
|
29
|
+
}
|
|
30
|
+
export interface LogicCore<State, Node extends LogicNode, Action extends LogicAction> {
|
|
31
|
+
getState(): State;
|
|
32
|
+
/** The tree for the current state, built once per change. */
|
|
33
|
+
getSnapshot(): Node;
|
|
34
|
+
dispatch(action: Action): void;
|
|
35
|
+
/** Called after every change; returns the unsubscribe. */
|
|
36
|
+
subscribe(listener: () => void): () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates a logic core. Pass the platform's `AstryxNode` and `AstryxAction`
|
|
40
|
+
* types from `@astryxdesign/native/components` so a tree and an action are
|
|
41
|
+
* checked against that platform's contracts.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createLogicCore<State, Node extends LogicNode, Action extends LogicAction>(options: LogicCoreOptions<State, Node, Action>): LogicCore<State, Node, Action>;
|
|
44
|
+
//# sourceMappingURL=createLogicCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLogicCore.d.ts","sourceRoot":"","sources":["../../src/logic/createLogicCore.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,yFAAyF;AACzF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB,CAC/B,KAAK,EACL,IAAI,SAAS,SAAS,EACtB,MAAM,SAAS,WAAW;IAE1B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC;CAC1D;AAED,MAAM,WAAW,SAAS,CACxB,KAAK,EACL,IAAI,SAAS,SAAS,EACtB,MAAM,SAAS,WAAW;IAE1B,QAAQ,IAAI,KAAK,CAAC;IAClB,6DAA6D;IAC7D,WAAW,IAAI,IAAI,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,0DAA0D;IAC1D,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EACL,IAAI,SAAS,SAAS,EACtB,MAAM,SAAS,WAAW,EAE1B,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7C,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CA4BhC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
//
|
|
3
|
+
// The shape of this runtime (one state, a snapshot per change, a bridge of two
|
|
4
|
+
// calls in and two out) follows EJ Campbell's astryx-swift spike
|
|
5
|
+
// (github.com/ejc3/astryx-swift, MIT), whose core runs in Hermes and drives
|
|
6
|
+
// SwiftUI views.
|
|
7
|
+
/**
|
|
8
|
+
* Creates a logic core. Pass the platform's `AstryxNode` and `AstryxAction`
|
|
9
|
+
* types from `@astryxdesign/native/components` so a tree and an action are
|
|
10
|
+
* checked against that platform's contracts.
|
|
11
|
+
*/
|
|
12
|
+
export function createLogicCore(options) {
|
|
13
|
+
let state = options.initial;
|
|
14
|
+
let snapshot = null;
|
|
15
|
+
const listeners = new Set();
|
|
16
|
+
return {
|
|
17
|
+
getState: () => state,
|
|
18
|
+
getSnapshot() {
|
|
19
|
+
snapshot ??= options.view(state);
|
|
20
|
+
return snapshot;
|
|
21
|
+
},
|
|
22
|
+
dispatch(action) {
|
|
23
|
+
const next = options.reduce(state, action);
|
|
24
|
+
if (Object.is(next, state)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
state = next;
|
|
28
|
+
snapshot = null;
|
|
29
|
+
for (const listener of [...listeners]) {
|
|
30
|
+
listener();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
subscribe(listener) {
|
|
34
|
+
listeners.add(listener);
|
|
35
|
+
return () => {
|
|
36
|
+
listeners.delete(listener);
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file logic/index.ts
|
|
3
|
+
* @input None
|
|
4
|
+
* @output The logic core runtime (`@astryxdesign/native/logic`)
|
|
5
|
+
* @position Arm C entry. Portable: ECMAScript built-ins only, no Node or DOM
|
|
6
|
+
* APIs, no clock and no randomness of its own
|
|
7
|
+
*/
|
|
8
|
+
export { createLogicCore } from './createLogicCore.js';
|
|
9
|
+
export type { LogicAction, LogicCore, LogicCoreOptions, LogicNode, } from './createLogicCore.js';
|
|
10
|
+
export { BRIDGE_VERSION, connectBridge } from './connectBridge.js';
|
|
11
|
+
export type { Bridge, BridgeHost } from './connectBridge.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logic/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
/**
|
|
3
|
+
* @file logic/index.ts
|
|
4
|
+
* @input None
|
|
5
|
+
* @output The logic core runtime (`@astryxdesign/native/logic`)
|
|
6
|
+
* @position Arm C entry. Portable: ECMAScript built-ins only, no Node or DOM
|
|
7
|
+
* APIs, no clock and no randomness of its own
|
|
8
|
+
*/
|
|
9
|
+
export { createLogicCore } from './createLogicCore.js';
|
|
10
|
+
export { BRIDGE_VERSION, connectBridge } from './connectBridge.js';
|
package/dist/types/android.d.ts
CHANGED
|
@@ -1,8 +1,142 @@
|
|
|
1
1
|
// Generated by @astryxdesign/native. Do not edit.
|
|
2
|
-
import type {SelectorCoreProps} from './core.js';
|
|
3
|
-
export type {AstryxSharedBaseProps, SelectorOption, SelectorCoreProps} from './core.js';
|
|
2
|
+
import type {AstryxSharedBaseProps, SelectorOption, BadgeCoreProps, ButtonCoreProps, CardCoreProps, DividerCoreProps, HeadingCoreProps, HStackCoreProps, ProgressBarCoreProps, SelectorCoreProps, SwitchCoreProps, TextCoreProps, TextInputCoreProps, VStackCoreProps} from './core.js';
|
|
3
|
+
export type {AstryxSharedBaseProps, AstryxContentNode, BadgeCoreProps, ButtonCoreProps, CardCoreProps, DividerCoreProps, HeadingCoreProps, HStackCoreProps, ProgressBarCoreProps, SelectorOption, SelectorCoreProps, SwitchCoreProps, TextCoreProps, TextInputCoreProps, VStackCoreProps} from './core.js';
|
|
4
|
+
/** Badge props: core contract plus the android contract. */
|
|
5
|
+
export interface BadgeProps extends BadgeCoreProps {}
|
|
6
|
+
export declare function Badge(props: BadgeProps): unknown;
|
|
7
|
+
/** Button props: core contract plus the android contract. */
|
|
8
|
+
export interface ButtonProps extends ButtonCoreProps {}
|
|
9
|
+
export declare function Button(props: ButtonProps): unknown;
|
|
10
|
+
/** Card props: core contract plus the android contract. */
|
|
11
|
+
export interface CardProps extends CardCoreProps {}
|
|
12
|
+
export declare function Card(props: CardProps): unknown;
|
|
13
|
+
/** Divider props: core contract plus the android contract. */
|
|
14
|
+
export interface DividerProps extends DividerCoreProps {}
|
|
15
|
+
export declare function Divider(props: DividerProps): unknown;
|
|
16
|
+
/** Heading props: core contract plus the android contract. */
|
|
17
|
+
export interface HeadingProps extends HeadingCoreProps {}
|
|
18
|
+
export declare function Heading(props: HeadingProps): unknown;
|
|
19
|
+
/** HStack props: core contract plus the android contract. */
|
|
20
|
+
export interface HStackProps extends HStackCoreProps {}
|
|
21
|
+
export declare function HStack(props: HStackProps): unknown;
|
|
22
|
+
/** ProgressBar props: core contract plus the android contract. */
|
|
23
|
+
export interface ProgressBarProps extends ProgressBarCoreProps {}
|
|
24
|
+
export declare function ProgressBar(props: ProgressBarProps): unknown;
|
|
4
25
|
/** Selector props: core contract plus the android contract. */
|
|
5
26
|
export interface SelectorProps extends SelectorCoreProps {
|
|
6
27
|
menuStyle?: 'dropdown' | 'bottomSheet';
|
|
7
28
|
}
|
|
8
29
|
export declare function Selector(props: SelectorProps): unknown;
|
|
30
|
+
/** Switch props: core contract plus the android contract. */
|
|
31
|
+
export interface SwitchProps extends SwitchCoreProps {}
|
|
32
|
+
export declare function Switch(props: SwitchProps): unknown;
|
|
33
|
+
/** Text props: core contract plus the android contract. */
|
|
34
|
+
export interface TextProps extends TextCoreProps {}
|
|
35
|
+
export declare function Text(props: TextProps): unknown;
|
|
36
|
+
/** TextInput props: core contract plus the android contract. */
|
|
37
|
+
export interface TextInputProps extends TextInputCoreProps {}
|
|
38
|
+
export declare function TextInput(props: TextInputProps): unknown;
|
|
39
|
+
/** VStack props: core contract plus the android contract. */
|
|
40
|
+
export interface VStackProps extends VStackCoreProps {}
|
|
41
|
+
export declare function VStack(props: VStackProps): unknown;
|
|
42
|
+
/** Badge as JSON from a TypeScript core. */
|
|
43
|
+
export interface BadgeNode {
|
|
44
|
+
component: 'Badge';
|
|
45
|
+
key: string;
|
|
46
|
+
base?: AstryxSharedBaseProps;
|
|
47
|
+
props: {variant?: 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'blue' | 'cyan' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow'; label: string;};
|
|
48
|
+
}
|
|
49
|
+
/** Button as JSON from a TypeScript core. */
|
|
50
|
+
export interface ButtonNode {
|
|
51
|
+
component: 'Button';
|
|
52
|
+
key: string;
|
|
53
|
+
base?: AstryxSharedBaseProps;
|
|
54
|
+
props: {label: string; variant?: 'primary' | 'secondary' | 'ghost' | 'destructive'; size?: 'sm' | 'md' | 'lg'; elevation?: 'none' | 'low' | 'med' | 'high'; isLoading?: boolean; isInterruptible?: boolean; isDisabled?: boolean; tooltip?: string; href?: string;};
|
|
55
|
+
/** The callbacks the core listens to. */
|
|
56
|
+
events?: ReadonlyArray<'onClick'>;
|
|
57
|
+
}
|
|
58
|
+
/** Card as JSON from a TypeScript core. */
|
|
59
|
+
export interface CardNode {
|
|
60
|
+
component: 'Card';
|
|
61
|
+
key: string;
|
|
62
|
+
base?: AstryxSharedBaseProps;
|
|
63
|
+
props: {children?: ReadonlyArray<AstryxNode>; padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; variant?: 'default' | 'transparent' | 'muted' | 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow'; elevation?: 'none' | 'low' | 'med' | 'high';};
|
|
64
|
+
}
|
|
65
|
+
/** Divider as JSON from a TypeScript core. */
|
|
66
|
+
export interface DividerNode {
|
|
67
|
+
component: 'Divider';
|
|
68
|
+
key: string;
|
|
69
|
+
base?: AstryxSharedBaseProps;
|
|
70
|
+
props: {orientation?: 'horizontal' | 'vertical'; label?: string; variant?: 'subtle' | 'strong'; isFullBleed?: boolean;};
|
|
71
|
+
}
|
|
72
|
+
/** Heading as JSON from a TypeScript core. */
|
|
73
|
+
export interface HeadingNode {
|
|
74
|
+
component: 'Heading';
|
|
75
|
+
key: string;
|
|
76
|
+
base?: AstryxSharedBaseProps;
|
|
77
|
+
props: {level: 1 | 2 | 3 | 4 | 5 | 6; type?: 'display-1' | 'display-2' | 'display-3'; weight?: 'normal' | 'medium' | 'semibold' | 'bold'; children: string; accessibilityLevel?: 1 | 2 | 3 | 4 | 5 | 6; color?: 'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit'; maxLines?: number; justify?: 'start' | 'center' | 'end'; hasStrikethrough?: boolean;};
|
|
78
|
+
}
|
|
79
|
+
/** HStack as JSON from a TypeScript core. */
|
|
80
|
+
export interface HStackNode {
|
|
81
|
+
component: 'HStack';
|
|
82
|
+
key: string;
|
|
83
|
+
base?: AstryxSharedBaseProps;
|
|
84
|
+
props: {gap?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInline?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInlineStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInlineEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlock?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlockStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlockEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; isScrollable?: boolean; hAlign?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'; vAlign?: 'start' | 'center' | 'end' | 'stretch'; justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'; align?: 'start' | 'center' | 'end' | 'stretch'; wrap?: 'nowrap' | 'wrap' | 'wrap-reverse'; children?: ReadonlyArray<AstryxNode>;};
|
|
85
|
+
}
|
|
86
|
+
/** ProgressBar as JSON from a TypeScript core. */
|
|
87
|
+
export interface ProgressBarNode {
|
|
88
|
+
component: 'ProgressBar';
|
|
89
|
+
key: string;
|
|
90
|
+
base?: AstryxSharedBaseProps;
|
|
91
|
+
props: {label: string; value?: number; max?: number; isLabelHidden?: boolean; hasValueLabel?: boolean; variant?: 'accent' | 'success' | 'warning' | 'error' | 'neutral'; isIndeterminate?: boolean; marks?: ReadonlyArray<{value: number; label: string;}>; isDisabled?: boolean;};
|
|
92
|
+
}
|
|
93
|
+
/** Selector as JSON from a TypeScript core. */
|
|
94
|
+
export interface SelectorNode {
|
|
95
|
+
component: 'Selector';
|
|
96
|
+
key: string;
|
|
97
|
+
base?: AstryxSharedBaseProps;
|
|
98
|
+
props: {label: string; options: ReadonlyArray<SelectorOption>; value?: string; hasClear?: boolean; hasSearch?: boolean; searchPlaceholder?: string; placeholder?: string; size?: 'sm' | 'md' | 'lg'; variant?: 'input' | 'secondary' | 'ghost'; isDisabled?: boolean; isReadOnly?: boolean; disabledMessage?: string; isLabelHidden?: boolean; description?: string; isOptional?: boolean; isRequired?: boolean; status?: {type: 'error' | 'warning' | 'success'; message?: string;}; statusVariant?: 'attached' | 'detached' | 'tooltip'; indicatorPosition?: 'start' | 'end'; isLoading?: boolean; menuStyle?: 'dropdown' | 'bottomSheet';};
|
|
99
|
+
/** The callbacks the core listens to. */
|
|
100
|
+
events?: ReadonlyArray<'onChange'>;
|
|
101
|
+
}
|
|
102
|
+
/** Switch as JSON from a TypeScript core. */
|
|
103
|
+
export interface SwitchNode {
|
|
104
|
+
component: 'Switch';
|
|
105
|
+
key: string;
|
|
106
|
+
base?: AstryxSharedBaseProps;
|
|
107
|
+
props: {label: string; value: boolean; isLoading?: boolean; isLabelHidden?: boolean; description?: string; isDisabled?: boolean; size?: 'sm' | 'md'; disabledMessage?: string; isOptional?: boolean; isRequired?: boolean; status?: {type: 'warning' | 'error' | 'success'; message?: string;}; labelTooltip?: string; labelPosition?: 'start' | 'end'; labelSpacing?: 'hug' | 'spread';};
|
|
108
|
+
/** The callbacks the core listens to. */
|
|
109
|
+
events?: ReadonlyArray<'onChange'>;
|
|
110
|
+
}
|
|
111
|
+
/** Text as JSON from a TypeScript core. */
|
|
112
|
+
export interface TextNode {
|
|
113
|
+
component: 'Text';
|
|
114
|
+
key: string;
|
|
115
|
+
base?: AstryxSharedBaseProps;
|
|
116
|
+
props: {type?: 'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3' | 'inherit'; children: string; size?: '4xs' | '3xs' | '2xs' | 'xsm' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl'; color?: 'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit'; weight?: 'normal' | 'medium' | 'semibold' | 'bold'; maxLines?: number; justify?: 'start' | 'center' | 'end'; hasStrikethrough?: boolean; hasTabularNumbers?: boolean;};
|
|
117
|
+
}
|
|
118
|
+
/** TextInput as JSON from a TypeScript core. */
|
|
119
|
+
export interface TextInputNode {
|
|
120
|
+
component: 'TextInput';
|
|
121
|
+
key: string;
|
|
122
|
+
base?: AstryxSharedBaseProps;
|
|
123
|
+
props: {type?: 'text' | 'password' | 'email'; label: string; value: string; size?: 'sm' | 'md' | 'lg'; isLabelHidden?: boolean; description?: string; isOptional?: boolean; isRequired?: boolean; isDisabled?: boolean; isReadOnly?: boolean; disabledMessage?: string; isLoading?: boolean; placeholder?: string; labelTooltip?: string; status?: {type: 'error' | 'warning' | 'success'; message?: string;}; statusVariant?: 'attached' | 'detached' | 'tooltip'; hasClear?: boolean; hasAutoFocus?: boolean;};
|
|
124
|
+
/** The callbacks the core listens to. */
|
|
125
|
+
events?: ReadonlyArray<'onChange' | 'onEnter'>;
|
|
126
|
+
}
|
|
127
|
+
/** VStack as JSON from a TypeScript core. */
|
|
128
|
+
export interface VStackNode {
|
|
129
|
+
component: 'VStack';
|
|
130
|
+
key: string;
|
|
131
|
+
base?: AstryxSharedBaseProps;
|
|
132
|
+
props: {gap?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInline?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInlineStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingInlineEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlock?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlockStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; paddingBlockEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10; isScrollable?: boolean; hAlign?: 'start' | 'center' | 'end' | 'stretch'; vAlign?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'; justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'; align?: 'start' | 'center' | 'end' | 'stretch'; wrap?: 'nowrap' | 'wrap' | 'wrap-reverse'; children?: ReadonlyArray<AstryxNode>;};
|
|
133
|
+
}
|
|
134
|
+
/** Any Astryx component a TypeScript core can send. */
|
|
135
|
+
export type AstryxNode = BadgeNode | ButtonNode | CardNode | DividerNode | HeadingNode | HStackNode | ProgressBarNode | SelectorNode | SwitchNode | TextNode | TextInputNode | VStackNode;
|
|
136
|
+
/** A callback a native view called, sent back to the core. */
|
|
137
|
+
export type AstryxAction =
|
|
138
|
+
| {key: string; component: 'Button'; event: 'onClick'; args: []}
|
|
139
|
+
| {key: string; component: 'Selector'; event: 'onChange'; args: [string]}
|
|
140
|
+
| {key: string; component: 'Switch'; event: 'onChange'; args: [boolean]}
|
|
141
|
+
| {key: string; component: 'TextInput'; event: 'onChange'; args: [string]}
|
|
142
|
+
| {key: string; component: 'TextInput'; event: 'onEnter'; args: []};
|
package/dist/types/core.d.ts
CHANGED
|
@@ -4,11 +4,90 @@ export interface AstryxSharedBaseProps {
|
|
|
4
4
|
id?: string;
|
|
5
5
|
isHidden?: boolean;
|
|
6
6
|
}
|
|
7
|
+
/** One child Astryx component in a content slot (AST-082 FR4). */
|
|
8
|
+
export interface AstryxContentNode {
|
|
9
|
+
readonly component: string;
|
|
10
|
+
readonly key: string;
|
|
11
|
+
}
|
|
7
12
|
export interface SelectorOption {
|
|
8
13
|
value: string;
|
|
9
14
|
label?: string;
|
|
10
15
|
disabled?: boolean;
|
|
11
16
|
}
|
|
17
|
+
/** Core contract. Base props attach to the root. */
|
|
18
|
+
export interface BadgeCoreProps extends AstryxSharedBaseProps {
|
|
19
|
+
variant?: 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'blue' | 'cyan' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow';
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
/** Core contract. Base props attach to the root. */
|
|
23
|
+
export interface ButtonCoreProps extends AstryxSharedBaseProps {
|
|
24
|
+
label: string;
|
|
25
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'destructive';
|
|
26
|
+
size?: 'sm' | 'md' | 'lg';
|
|
27
|
+
elevation?: 'none' | 'low' | 'med' | 'high';
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
isInterruptible?: boolean;
|
|
30
|
+
isDisabled?: boolean;
|
|
31
|
+
tooltip?: string;
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
href?: string;
|
|
34
|
+
}
|
|
35
|
+
/** Core contract. Base props attach to the container. */
|
|
36
|
+
export interface CardCoreProps extends AstryxSharedBaseProps {
|
|
37
|
+
children?: ReadonlyArray<AstryxContentNode>;
|
|
38
|
+
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
39
|
+
variant?: 'default' | 'transparent' | 'muted' | 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow';
|
|
40
|
+
elevation?: 'none' | 'low' | 'med' | 'high';
|
|
41
|
+
}
|
|
42
|
+
/** Core contract. Base props attach to the root. */
|
|
43
|
+
export interface DividerCoreProps extends AstryxSharedBaseProps {
|
|
44
|
+
orientation?: 'horizontal' | 'vertical';
|
|
45
|
+
label?: string;
|
|
46
|
+
variant?: 'subtle' | 'strong';
|
|
47
|
+
isFullBleed?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Core contract. Base props attach to the root. */
|
|
50
|
+
export interface HeadingCoreProps extends AstryxSharedBaseProps {
|
|
51
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
52
|
+
type?: 'display-1' | 'display-2' | 'display-3';
|
|
53
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
54
|
+
children: string;
|
|
55
|
+
accessibilityLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
56
|
+
color?: 'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit';
|
|
57
|
+
maxLines?: number;
|
|
58
|
+
justify?: 'start' | 'center' | 'end';
|
|
59
|
+
hasStrikethrough?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** Core contract. Base props attach to the container. */
|
|
62
|
+
export interface HStackCoreProps extends AstryxSharedBaseProps {
|
|
63
|
+
gap?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
64
|
+
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
65
|
+
paddingInline?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
66
|
+
paddingInlineStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
67
|
+
paddingInlineEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
68
|
+
paddingBlock?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
69
|
+
paddingBlockStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
70
|
+
paddingBlockEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
71
|
+
isScrollable?: boolean;
|
|
72
|
+
hAlign?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
73
|
+
vAlign?: 'start' | 'center' | 'end' | 'stretch';
|
|
74
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
75
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
76
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
77
|
+
children?: ReadonlyArray<AstryxContentNode>;
|
|
78
|
+
}
|
|
79
|
+
/** Core contract. Base props attach to the root. */
|
|
80
|
+
export interface ProgressBarCoreProps extends AstryxSharedBaseProps {
|
|
81
|
+
label: string;
|
|
82
|
+
value?: number;
|
|
83
|
+
max?: number;
|
|
84
|
+
isLabelHidden?: boolean;
|
|
85
|
+
hasValueLabel?: boolean;
|
|
86
|
+
variant?: 'accent' | 'success' | 'warning' | 'error' | 'neutral';
|
|
87
|
+
isIndeterminate?: boolean;
|
|
88
|
+
marks?: ReadonlyArray<{value: number; label: string;}>;
|
|
89
|
+
isDisabled?: boolean;
|
|
90
|
+
}
|
|
12
91
|
/** Core contract. Base props attach to the trigger. */
|
|
13
92
|
export interface SelectorCoreProps extends AstryxSharedBaseProps {
|
|
14
93
|
label: string;
|
|
@@ -33,3 +112,74 @@ export interface SelectorCoreProps extends AstryxSharedBaseProps {
|
|
|
33
112
|
indicatorPosition?: 'start' | 'end';
|
|
34
113
|
isLoading?: boolean;
|
|
35
114
|
}
|
|
115
|
+
/** Core contract. Base props attach to the root. */
|
|
116
|
+
export interface SwitchCoreProps extends AstryxSharedBaseProps {
|
|
117
|
+
label: string;
|
|
118
|
+
value: boolean;
|
|
119
|
+
onChange?: (arg0: boolean) => void;
|
|
120
|
+
isLoading?: boolean;
|
|
121
|
+
isLabelHidden?: boolean;
|
|
122
|
+
description?: string;
|
|
123
|
+
isDisabled?: boolean;
|
|
124
|
+
size?: 'sm' | 'md';
|
|
125
|
+
disabledMessage?: string;
|
|
126
|
+
isOptional?: boolean;
|
|
127
|
+
isRequired?: boolean;
|
|
128
|
+
status?: {type: 'warning' | 'error' | 'success'; message?: string;};
|
|
129
|
+
labelTooltip?: string;
|
|
130
|
+
labelPosition?: 'start' | 'end';
|
|
131
|
+
labelSpacing?: 'hug' | 'spread';
|
|
132
|
+
}
|
|
133
|
+
/** Core contract. Base props attach to the root. */
|
|
134
|
+
export interface TextCoreProps extends AstryxSharedBaseProps {
|
|
135
|
+
type?: 'body' | 'large' | 'label' | 'supporting' | 'code' | 'display-1' | 'display-2' | 'display-3' | 'inherit';
|
|
136
|
+
children: string;
|
|
137
|
+
size?: '4xs' | '3xs' | '2xs' | 'xsm' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
138
|
+
color?: 'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit';
|
|
139
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
140
|
+
maxLines?: number;
|
|
141
|
+
justify?: 'start' | 'center' | 'end';
|
|
142
|
+
hasStrikethrough?: boolean;
|
|
143
|
+
hasTabularNumbers?: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Core contract. Base props attach to the control. */
|
|
146
|
+
export interface TextInputCoreProps extends AstryxSharedBaseProps {
|
|
147
|
+
type?: 'text' | 'password' | 'email';
|
|
148
|
+
label: string;
|
|
149
|
+
value: string;
|
|
150
|
+
onChange?: (arg0: string) => void;
|
|
151
|
+
size?: 'sm' | 'md' | 'lg';
|
|
152
|
+
isLabelHidden?: boolean;
|
|
153
|
+
description?: string;
|
|
154
|
+
isOptional?: boolean;
|
|
155
|
+
isRequired?: boolean;
|
|
156
|
+
onEnter?: () => void;
|
|
157
|
+
isDisabled?: boolean;
|
|
158
|
+
isReadOnly?: boolean;
|
|
159
|
+
disabledMessage?: string;
|
|
160
|
+
isLoading?: boolean;
|
|
161
|
+
placeholder?: string;
|
|
162
|
+
labelTooltip?: string;
|
|
163
|
+
status?: {type: 'error' | 'warning' | 'success'; message?: string;};
|
|
164
|
+
statusVariant?: 'attached' | 'detached' | 'tooltip';
|
|
165
|
+
hasClear?: boolean;
|
|
166
|
+
hasAutoFocus?: boolean;
|
|
167
|
+
}
|
|
168
|
+
/** Core contract. Base props attach to the container. */
|
|
169
|
+
export interface VStackCoreProps extends AstryxSharedBaseProps {
|
|
170
|
+
gap?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
171
|
+
padding?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
172
|
+
paddingInline?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
173
|
+
paddingInlineStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
174
|
+
paddingInlineEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
175
|
+
paddingBlock?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
176
|
+
paddingBlockStart?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
177
|
+
paddingBlockEnd?: 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
178
|
+
isScrollable?: boolean;
|
|
179
|
+
hAlign?: 'start' | 'center' | 'end' | 'stretch';
|
|
180
|
+
vAlign?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
181
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
182
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
183
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
184
|
+
children?: ReadonlyArray<AstryxContentNode>;
|
|
185
|
+
}
|