@mindees/atlas 0.15.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.
@@ -0,0 +1,15 @@
1
+ import { MindeesNode } from "@mindees/core";
2
+
3
+ //#region src/error-boundary.d.ts
4
+ /** Props for {@link ErrorBoundary}. */
5
+ interface ErrorBoundaryProps {
6
+ /** Rendered when `children` throws. `reset` re-runs `children` (retry). */
7
+ readonly fallback: (error: unknown, reset: () => void) => MindeesNode;
8
+ /** The guarded subtree, as a thunk so it's evaluated (and re-evaluated) inside the boundary. */
9
+ readonly children: () => MindeesNode;
10
+ }
11
+ /** Render `children`; if it throws, render `fallback(error, reset)` instead. Returns a reactive region. */
12
+ declare function ErrorBoundary(props: ErrorBoundaryProps): () => MindeesNode;
13
+ //#endregion
14
+ export { ErrorBoundary, ErrorBoundaryProps };
15
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","names":[],"sources":["../src/error-boundary.ts"],"mappings":";;;;UAuBiB,kBAAA;EAQ0D;EAAA,SANhE,QAAA,GAAW,KAAA,WAAgB,KAAA,iBAAsB,WAAA;;WAEjD,QAAA,QAAgB,WAAW;AAAA;;iBAItB,aAAA,CAAc,KAAA,EAAO,kBAAA,SAA2B,WAAW"}
@@ -0,0 +1,40 @@
1
+ import { signal, untrack } from "@mindees/core";
2
+ //#region src/error-boundary.ts
3
+ /**
4
+ * Atlas `ErrorBoundary` — catch errors thrown while rendering a subtree and show a fallback instead of
5
+ * letting the whole app fail (RN/React's `<ErrorBoundary>`, signals-native). The children are a thunk
6
+ * evaluated inside a **reactive region**: if it throws, the region renders `fallback(error, reset)`;
7
+ * `reset()` re-runs the children (retry after the cause is fixed), and any signal the children read
8
+ * before throwing also re-runs the region automatically when it changes.
9
+ *
10
+ * Scope: this catches **synchronous render-time** errors (a component throwing while building its
11
+ * view). Errors thrown later inside an `effect` run on their own and are not routed here — handle
12
+ * those where the effect lives.
13
+ *
14
+ * @example
15
+ * ErrorBoundary({
16
+ * fallback: (err, reset) => <Button title="Retry" onPress={reset} />,
17
+ * children: () => <RiskyScreen />,
18
+ * })
19
+ *
20
+ * @module
21
+ */
22
+ /** Render `children`; if it throws, render `fallback(error, reset)` instead. Returns a reactive region. */
23
+ function ErrorBoundary(props) {
24
+ const resetKey = signal(0);
25
+ const reset = () => {
26
+ resetKey.set(untrack(resetKey) + 1);
27
+ };
28
+ return () => {
29
+ resetKey();
30
+ try {
31
+ return props.children();
32
+ } catch (error) {
33
+ return props.fallback(error, reset);
34
+ }
35
+ };
36
+ }
37
+ //#endregion
38
+ export { ErrorBoundary };
39
+
40
+ //# sourceMappingURL=error-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.js","names":[],"sources":["../src/error-boundary.ts"],"sourcesContent":["/**\n * Atlas `ErrorBoundary` — catch errors thrown while rendering a subtree and show a fallback instead of\n * letting the whole app fail (RN/React's `<ErrorBoundary>`, signals-native). The children are a thunk\n * evaluated inside a **reactive region**: if it throws, the region renders `fallback(error, reset)`;\n * `reset()` re-runs the children (retry after the cause is fixed), and any signal the children read\n * before throwing also re-runs the region automatically when it changes.\n *\n * Scope: this catches **synchronous render-time** errors (a component throwing while building its\n * view). Errors thrown later inside an `effect` run on their own and are not routed here — handle\n * those where the effect lives.\n *\n * @example\n * ErrorBoundary({\n * fallback: (err, reset) => <Button title=\"Retry\" onPress={reset} />,\n * children: () => <RiskyScreen />,\n * })\n *\n * @module\n */\n\nimport { type MindeesNode, signal, untrack } from '@mindees/core'\n\n/** Props for {@link ErrorBoundary}. */\nexport interface ErrorBoundaryProps {\n /** Rendered when `children` throws. `reset` re-runs `children` (retry). */\n readonly fallback: (error: unknown, reset: () => void) => MindeesNode\n /** The guarded subtree, as a thunk so it's evaluated (and re-evaluated) inside the boundary. */\n readonly children: () => MindeesNode\n}\n\n/** Render `children`; if it throws, render `fallback(error, reset)` instead. Returns a reactive region. */\nexport function ErrorBoundary(props: ErrorBoundaryProps): () => MindeesNode {\n const resetKey = signal(0)\n const reset = (): void => {\n resetKey.set(untrack(resetKey) + 1)\n }\n return () => {\n resetKey() // track: reset() (and tracked children deps) re-run this region, retrying\n try {\n return props.children()\n } catch (error) {\n return props.fallback(error, reset)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,cAAc,OAA8C;CAC1E,MAAM,WAAW,OAAO,CAAC;CACzB,MAAM,cAAoB;EACxB,SAAS,IAAI,QAAQ,QAAQ,IAAI,CAAC;CACpC;CACA,aAAa;EACX,SAAS;EACT,IAAI;GACF,OAAO,MAAM,SAAS;EACxB,SAAS,OAAO;GACd,OAAO,MAAM,SAAS,OAAO,KAAK;EACpC;CACF;AACF"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { StyleInput, StyleObject, StyleValue, flattenStyle } from "./style.js";
3
3
  import { BaseProps, Reactive, resolveStyle, toHostProps } from "./host.js";
4
4
  import { Accordion, AccordionProps, AccordionSection, ActivityIndicator, ActivityIndicatorProps, Avatar, AvatarProps, Badge, BadgeProps, Card, CardProps, Checkbox, CheckboxProps, Chip, ChipProps, Divider, DividerProps, KeyboardAvoidingView, KeyboardAvoidingViewProps, ProgressBar, ProgressBarProps, RadioGroup, RadioGroupProps, RadioOption, SafeAreaView, SafeAreaViewProps, Segment, SegmentedControl, SegmentedControlProps, Skeleton, SkeletonProps, Stepper, StepperProps, Switch, SwitchProps, TabItem, Tabs, TabsProps } from "./components.js";
5
5
  import { ColorScheme, KeyboardState, PlatformEnvironment, SafeAreaInsets, WindowDimensions, getEnvironment, setEnvironment, useColorScheme, useKeyboard, useReducedMotion, useSafeAreaInsets, useWindowDimensions } from "./environment.js";
6
+ import { ErrorBoundary, ErrorBoundaryProps } from "./error-boundary.js";
6
7
  import { Field, FormApi, UseFormOptions, useForm } from "./form.js";
7
8
  import { AttachableGesture, GestureView, GestureViewProps } from "./gesture.js";
8
9
  import { AsyncState, Counter, PersistentSignalOptions, SignalStorage, Toggle, useAsync, useCounter, useDebounce, useInterval, usePersistentSignal, usePrevious, useReducer, useTimeout, useToggle } from "./hooks.js";
@@ -10,13 +11,14 @@ import { Theme, ThemeColors, duration, easing, fontSize, fontWeight, getTheme, l
10
11
  import { animateTo, motion } from "./motion.js";
11
12
  import { FocusScope, FocusScopeProps, Modal, ModalProps, Toast, ToastProps } from "./overlay.js";
12
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";
13
15
  import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@mindees/core";
14
16
 
15
17
  //#region src/index.d.ts
16
18
  /** The npm package name. */
17
19
  declare const name = "@mindees/atlas";
18
20
  /** The package version. All `@mindees/*` packages share one locked version line. */
19
- declare const VERSION = "0.15.0";
21
+ declare const VERSION = "0.17.0";
20
22
  /** Current maturity of this package. See the repository `STATUS.md`. */
21
23
  declare const maturity: Maturity;
22
24
  /**
@@ -26,5 +28,5 @@ declare const maturity: Maturity;
26
28
  */
27
29
  declare const info: PackageInfo;
28
30
  //#endregion
29
- 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, 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 };
30
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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"}
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
@@ -5,17 +5,19 @@ import { resolveStyle, toHostProps } from "./host.js";
5
5
  import { Button, Column, Image, Pressable, Row, ScrollView, Spacer, Stack, Text, TextInput, View, usePressable } from "./primitives.js";
6
6
  import { duration, easing, fontSize, fontWeight, getTheme, lineHeight, palette, radius, space, tokens, useTheme } from "./tokens.js";
7
7
  import { Accordion, ActivityIndicator, Avatar, Badge, Card, Checkbox, Chip, Divider, KeyboardAvoidingView, ProgressBar, RadioGroup, SafeAreaView, SegmentedControl, Skeleton, Stepper, Switch, Tabs } from "./components.js";
8
+ import { ErrorBoundary } from "./error-boundary.js";
8
9
  import { useForm } from "./form.js";
9
10
  import { GestureView } from "./gesture.js";
10
11
  import { useAsync, useCounter, useDebounce, useInterval, usePersistentSignal, usePrevious, useReducer, useTimeout, useToggle } from "./hooks.js";
11
12
  import { animateTo, motion } from "./motion.js";
12
13
  import { FocusScope, Modal, Toast } from "./overlay.js";
14
+ import { Show } from "./show.js";
13
15
  import { NotImplementedError, notImplemented } from "@mindees/core";
14
16
  //#region src/index.ts
15
17
  /** The npm package name. */
16
18
  const name = "@mindees/atlas";
17
19
  /** The package version. All `@mindees/*` packages share one locked version line. */
18
- const VERSION = "0.15.0";
20
+ const VERSION = "0.17.0";
19
21
  /** Current maturity of this package. See the repository `STATUS.md`. */
20
22
  const maturity = "experimental";
21
23
  /**
@@ -29,6 +31,6 @@ const info = Object.freeze({
29
31
  maturity
30
32
  });
31
33
  //#endregion
32
- export { Accordion, ActivityIndicator, Avatar, Badge, Button, Card, Checkbox, Chip, Column, Divider, 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 };
33
35
 
34
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.15.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 { 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 { 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"}
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
@@ -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.15.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.15.0",
43
- "@mindees/router": "0.15.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.15.0"
47
+ "@mindees/renderer": "0.17.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsdown",