@mindees/atlas 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/show.d.ts +19 -0
- package/dist/show.d.ts.map +1 -0
- package/dist/show.js +14 -0
- package/dist/show.js.map +1 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -11,13 +11,14 @@ import { Theme, ThemeColors, duration, easing, fontSize, fontWeight, getTheme, l
|
|
|
11
11
|
import { animateTo, motion } from "./motion.js";
|
|
12
12
|
import { FocusScope, FocusScopeProps, Modal, ModalProps, Toast, ToastProps } from "./overlay.js";
|
|
13
13
|
import { Button, ButtonProps, Column, Image, ImageProps, InteractionState, Pressable, PressableProps, Row, ScrollView, ScrollViewProps, Spacer, SpacerProps, Stack, StackProps, Text, TextInput, TextInputProps, TextProps, View, ViewProps, usePressable } from "./primitives.js";
|
|
14
|
+
import { Show, ShowProps } from "./show.js";
|
|
14
15
|
import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@mindees/core";
|
|
15
16
|
|
|
16
17
|
//#region src/index.d.ts
|
|
17
18
|
/** The npm package name. */
|
|
18
19
|
declare const name = "@mindees/atlas";
|
|
19
20
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
20
|
-
declare const VERSION = "0.
|
|
21
|
+
declare const VERSION = "0.17.0";
|
|
21
22
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
22
23
|
declare const maturity: Maturity;
|
|
23
24
|
/**
|
|
@@ -27,5 +28,5 @@ declare const maturity: Maturity;
|
|
|
27
28
|
*/
|
|
28
29
|
declare const info: PackageInfo;
|
|
29
30
|
//#endregion
|
|
30
|
-
export { type A11yProps, type A11yState, Accordion, type AccordionProps, type AccordionSection, ActivityIndicator, type ActivityIndicatorProps, type AsyncState, type AttachableGesture, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, type ColorScheme, Column, type Counter, Divider, type DividerProps, ErrorBoundary, type ErrorBoundaryProps, type Field, FocusScope, type FocusScopeProps, type FormApi, GestureView, type GestureViewProps, Image, type ImageProps, type InteractionState, KeyboardAvoidingView, type KeyboardAvoidingViewProps, type KeyboardState, type Maturity, Modal, type ModalProps, NotImplementedError, type PackageInfo, type PersistentSignalOptions, type PlatformEnvironment, Pressable, type PressableProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, type Reactive, type Role, Row, type SafeAreaInsets, SafeAreaView, type SafeAreaViewProps, ScrollView, type ScrollViewProps, type Segment, SegmentedControl, type SegmentedControlProps, type SignalStorage, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Stack, type StackProps, Stepper, type StepperProps, type StyleInput, type StyleObject, type StyleValue, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextInput, type TextInputProps, type TextProps, type Theme, type ThemeColors, Toast, type ToastProps, type Toggle, type UseFormOptions, VERSION, View, type ViewProps, type WindowDimensions, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
31
|
+
export { type A11yProps, type A11yState, Accordion, type AccordionProps, type AccordionSection, ActivityIndicator, type ActivityIndicatorProps, type AsyncState, type AttachableGesture, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, type ColorScheme, Column, type Counter, Divider, type DividerProps, ErrorBoundary, type ErrorBoundaryProps, type Field, FocusScope, type FocusScopeProps, type FormApi, GestureView, type GestureViewProps, Image, type ImageProps, type InteractionState, KeyboardAvoidingView, type KeyboardAvoidingViewProps, type KeyboardState, type Maturity, Modal, type ModalProps, NotImplementedError, type PackageInfo, type PersistentSignalOptions, type PlatformEnvironment, Pressable, type PressableProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, type Reactive, type Role, Row, type SafeAreaInsets, SafeAreaView, type SafeAreaViewProps, ScrollView, type ScrollViewProps, type Segment, SegmentedControl, type SegmentedControlProps, Show, type ShowProps, type SignalStorage, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Stack, type StackProps, Stepper, type StepperProps, type StyleInput, type StyleObject, type StyleValue, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextInput, type TextInputProps, type TextProps, type Theme, type ThemeColors, Toast, type ToastProps, type Toggle, type UseFormOptions, VERSION, View, type ViewProps, type WindowDimensions, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;cAea,IAAA;;cAGA,OAAA;;cAGA,QAAA,EAAU,QAAyB;;;;AAN/B;AAGjB;cAUa,IAAA,EAAM,WAAiE"}
|
package/dist/index.js
CHANGED
|
@@ -11,12 +11,13 @@ import { GestureView } from "./gesture.js";
|
|
|
11
11
|
import { useAsync, useCounter, useDebounce, useInterval, usePersistentSignal, usePrevious, useReducer, useTimeout, useToggle } from "./hooks.js";
|
|
12
12
|
import { animateTo, motion } from "./motion.js";
|
|
13
13
|
import { FocusScope, Modal, Toast } from "./overlay.js";
|
|
14
|
+
import { Show } from "./show.js";
|
|
14
15
|
import { NotImplementedError, notImplemented } from "@mindees/core";
|
|
15
16
|
//#region src/index.ts
|
|
16
17
|
/** The npm package name. */
|
|
17
18
|
const name = "@mindees/atlas";
|
|
18
19
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
19
|
-
const VERSION = "0.
|
|
20
|
+
const VERSION = "0.17.0";
|
|
20
21
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
21
22
|
const maturity = "experimental";
|
|
22
23
|
/**
|
|
@@ -30,6 +31,6 @@ const info = Object.freeze({
|
|
|
30
31
|
maturity
|
|
31
32
|
});
|
|
32
33
|
//#endregion
|
|
33
|
-
export { Accordion, ActivityIndicator, Avatar, Badge, Button, Card, Checkbox, Chip, Column, Divider, ErrorBoundary, FocusScope, GestureView, Image, KeyboardAvoidingView, Modal, NotImplementedError, Pressable, ProgressBar, RadioGroup, Row, SafeAreaView, ScrollView, SegmentedControl, Skeleton, Spacer, Stack, Stepper, Switch, Tabs, Text, TextInput, Toast, VERSION, View, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
34
|
+
export { Accordion, ActivityIndicator, Avatar, Badge, Button, Card, Checkbox, Chip, Column, Divider, ErrorBoundary, FocusScope, GestureView, Image, KeyboardAvoidingView, Modal, NotImplementedError, Pressable, ProgressBar, RadioGroup, Row, SafeAreaView, ScrollView, SegmentedControl, Show, Skeleton, Spacer, Stack, Stepper, Switch, Tabs, Text, TextInput, Toast, VERSION, View, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
34
35
|
|
|
35
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/atlas` (Atlas) — accessible, signals-native UI primitives. Function components\n * over `@mindees/core`'s `createElement` that return renderer-agnostic `MindeesNode` trees:\n * web rendering is real via the Helix DOM backend; native is a labeled 🔬 research track (the\n * same serializable tree, interpreted by a native host later). A curated cross-platform\n * `StyleObject`, typed accessibility, and a structural theme (on the `@mindees/atlas/theme`\n * subpath). The virtualized recycling `List` is on the `@mindees/atlas/list` subpath.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/atlas'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/atlas` (Atlas) — accessible, signals-native UI primitives. Function components\n * over `@mindees/core`'s `createElement` that return renderer-agnostic `MindeesNode` trees:\n * web rendering is real via the Helix DOM backend; native is a labeled 🔬 research track (the\n * same serializable tree, interpreted by a native host later). A curated cross-platform\n * `StyleObject`, typed accessibility, and a structural theme (on the `@mindees/atlas/theme`\n * subpath). The virtualized recycling `List` is on the `@mindees/atlas/list` subpath.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/atlas'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.17.0'\n\n/** Current maturity of this package. See the repository `STATUS.md`. */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n\nexport { type A11yProps, type A11yState, type Role, toA11yProps } from './a11y'\nexport {\n Accordion,\n type AccordionProps,\n type AccordionSection,\n ActivityIndicator,\n type ActivityIndicatorProps,\n Avatar,\n type AvatarProps,\n Badge,\n type BadgeProps,\n Card,\n type CardProps,\n Checkbox,\n type CheckboxProps,\n Chip,\n type ChipProps,\n Divider,\n type DividerProps,\n KeyboardAvoidingView,\n type KeyboardAvoidingViewProps,\n ProgressBar,\n type ProgressBarProps,\n RadioGroup,\n type RadioGroupProps,\n type RadioOption,\n SafeAreaView,\n type SafeAreaViewProps,\n type Segment,\n SegmentedControl,\n type SegmentedControlProps,\n Skeleton,\n type SkeletonProps,\n Stepper,\n type StepperProps,\n Switch,\n type SwitchProps,\n type TabItem,\n Tabs,\n type TabsProps,\n} from './components'\nexport {\n type ColorScheme,\n getEnvironment,\n type KeyboardState,\n type PlatformEnvironment,\n type SafeAreaInsets,\n setEnvironment,\n useColorScheme,\n useKeyboard,\n useReducedMotion,\n useSafeAreaInsets,\n useWindowDimensions,\n type WindowDimensions,\n} from './environment'\nexport { ErrorBoundary, type ErrorBoundaryProps } from './error-boundary'\nexport { type Field, type FormApi, type UseFormOptions, useForm } from './form'\nexport { type AttachableGesture, GestureView, type GestureViewProps } from './gesture'\nexport {\n type AsyncState,\n type Counter,\n type PersistentSignalOptions,\n type SignalStorage,\n type Toggle,\n useAsync,\n useCounter,\n useDebounce,\n useInterval,\n usePersistentSignal,\n usePrevious,\n useReducer,\n useTimeout,\n useToggle,\n} from './hooks'\nexport { type BaseProps, type Reactive, resolveStyle, toHostProps } from './host'\nexport { animateTo, motion } from './motion'\nexport {\n FocusScope,\n type FocusScopeProps,\n Modal,\n type ModalProps,\n Toast,\n type ToastProps,\n} from './overlay'\nexport {\n Button,\n type ButtonProps,\n Column,\n Image,\n type ImageProps,\n type InteractionState,\n Pressable,\n type PressableProps,\n Row,\n ScrollView,\n type ScrollViewProps,\n Spacer,\n type SpacerProps,\n Stack,\n type StackProps,\n Text,\n TextInput,\n type TextInputProps,\n type TextProps,\n usePressable,\n View,\n type ViewProps,\n} from './primitives'\nexport { Show, type ShowProps } from './show'\nexport { flattenStyle, type StyleInput, type StyleObject, type StyleValue } from './style'\nexport {\n duration,\n easing,\n fontSize,\n fontWeight,\n getTheme,\n lineHeight,\n palette,\n radius,\n space,\n type Theme,\n type ThemeColors,\n tokens,\n useTheme,\n} from './tokens'\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;AAGvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
|
package/dist/show.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MindeesNode } from "@mindees/core";
|
|
2
|
+
|
|
3
|
+
//#region src/show.d.ts
|
|
4
|
+
/** A falsy condition value that hides the children. */
|
|
5
|
+
type Falsy = false | null | undefined | 0 | '';
|
|
6
|
+
/** Props for {@link Show}. */
|
|
7
|
+
interface ShowProps<T> {
|
|
8
|
+
/** The condition: a value or an accessor. Children render when it's truthy. */
|
|
9
|
+
readonly when: T | (() => T);
|
|
10
|
+
/** Rendered when `when` is falsy. */
|
|
11
|
+
readonly fallback?: () => MindeesNode;
|
|
12
|
+
/** Rendered when `when` is truthy; a function receives the narrowed truthy value. */
|
|
13
|
+
readonly children: MindeesNode | ((value: Exclude<T, Falsy>) => MindeesNode);
|
|
14
|
+
}
|
|
15
|
+
/** Render `children` when `when` is truthy, else `fallback`. Returns a reactive region. */
|
|
16
|
+
declare function Show<T>(props: ShowProps<T>): () => MindeesNode;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Show, ShowProps };
|
|
19
|
+
//# sourceMappingURL=show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","names":[],"sources":["../src/show.ts"],"mappings":";;;;KAkBK,KAAA;;UAGY,SAAA;EAM4D;EAAA,SAJlE,IAAA,EAAM,CAAA,UAAW,CAAA;EAFD;EAAA,SAIhB,QAAA,SAAiB,WAAA;EAFX;EAAA,SAIN,QAAA,EAAU,WAAA,KAAgB,KAAA,EAAO,OAAA,CAAQ,CAAA,EAAG,KAAA,MAAW,WAAA;AAAA;;iBAIlD,IAAA,IAAQ,KAAA,EAAO,SAAA,CAAU,CAAA,UAAW,WAAA"}
|
package/dist/show.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/show.ts
|
|
2
|
+
/** Render `children` when `when` is truthy, else `fallback`. Returns a reactive region. */
|
|
3
|
+
function Show(props) {
|
|
4
|
+
const cond = typeof props.when === "function" ? props.when : () => props.when;
|
|
5
|
+
return () => {
|
|
6
|
+
const value = cond();
|
|
7
|
+
if (value) return typeof props.children === "function" ? props.children(value) : props.children;
|
|
8
|
+
return props.fallback ? props.fallback() : null;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Show };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=show.js.map
|
package/dist/show.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.js","names":[],"sources":["../src/show.ts"],"sourcesContent":["/**\n * Atlas `Show` — the ergonomic conditional. Renders `children` when `when` is truthy, else `fallback`.\n * `when` is a value or accessor; when it's an accessor the result is a **reactive region** that swaps\n * content as the condition flips. `children` may be a function that receives the **narrowed** truthy\n * value (so you don't re-check for null inside).\n *\n * You can always write `() => cond() ? a() : b()` by hand — `Show` is the readable, fallback-aware,\n * narrowing version of exactly that (Solid/Vue ship the same battery).\n *\n * @example\n * Show({ when: () => user(), fallback: () => <Spinner/>, children: (u) => <Text>{() => u.name}</Text> })\n *\n * @module\n */\n\nimport type { MindeesNode } from '@mindees/core'\n\n/** A falsy condition value that hides the children. */\ntype Falsy = false | null | undefined | 0 | ''\n\n/** Props for {@link Show}. */\nexport interface ShowProps<T> {\n /** The condition: a value or an accessor. Children render when it's truthy. */\n readonly when: T | (() => T)\n /** Rendered when `when` is falsy. */\n readonly fallback?: () => MindeesNode\n /** Rendered when `when` is truthy; a function receives the narrowed truthy value. */\n readonly children: MindeesNode | ((value: Exclude<T, Falsy>) => MindeesNode)\n}\n\n/** Render `children` when `when` is truthy, else `fallback`. Returns a reactive region. */\nexport function Show<T>(props: ShowProps<T>): () => MindeesNode {\n const cond = typeof props.when === 'function' ? (props.when as () => T) : () => props.when\n return () => {\n const value = cond()\n if (value) {\n return typeof props.children === 'function'\n ? (props.children as (value: Exclude<T, Falsy>) => MindeesNode)(value as Exclude<T, Falsy>)\n : props.children\n }\n return props.fallback ? props.fallback() : null\n }\n}\n"],"mappings":";;AA+BA,SAAgB,KAAQ,OAAwC;CAC9D,MAAM,OAAO,OAAO,MAAM,SAAS,aAAc,MAAM,aAAyB,MAAM;CACtF,aAAa;EACX,MAAM,QAAQ,KAAK;EACnB,IAAI,OACF,OAAO,OAAO,MAAM,aAAa,aAC5B,MAAM,SAAuD,KAA0B,IACxF,MAAM;EAEZ,OAAO,MAAM,WAAW,MAAM,SAAS,IAAI;CAC7C;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindees/atlas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "MindeesNative Atlas - accessible, signals-native UI primitives + a virtualized recycling list. Renderer-agnostic (web real, native research track).",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"directory": "packages/atlas"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@mindees/core": "0.
|
|
43
|
-
"@mindees/router": "0.
|
|
42
|
+
"@mindees/core": "0.17.0",
|
|
43
|
+
"@mindees/router": "0.17.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"happy-dom": "20.9.0",
|
|
47
|
-
"@mindees/renderer": "0.
|
|
47
|
+
"@mindees/renderer": "0.17.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsdown",
|