@mindees/atlas 0.11.0 → 0.12.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/components.d.ts +30 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +83 -1
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/overlay.d.ts +23 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +43 -3
- package/dist/overlay.js.map +1 -1
- package/package.json +4 -4
package/dist/components.d.ts
CHANGED
|
@@ -162,6 +162,35 @@ interface AccordionProps extends Omit<BaseProps, 'style'> {
|
|
|
162
162
|
}
|
|
163
163
|
/** Collapsible sections (RN ships none built-in). Each header is `aria-expanded`; panels mount lazily. */
|
|
164
164
|
declare const Accordion: Component<AccordionProps>;
|
|
165
|
+
/** Props for {@link Stepper}. */
|
|
166
|
+
interface StepperProps extends Omit<BaseProps, 'style'> {
|
|
167
|
+
/** Controlled numeric value (static or reactive). */
|
|
168
|
+
readonly value: Reactive<number>;
|
|
169
|
+
readonly min?: number;
|
|
170
|
+
readonly max?: number;
|
|
171
|
+
/** Increment/decrement amount (default 1). */
|
|
172
|
+
readonly step?: number;
|
|
173
|
+
readonly onValueChange?: (value: number) => void;
|
|
174
|
+
readonly disabled?: boolean;
|
|
175
|
+
readonly style?: Reactive<StyleInput>;
|
|
176
|
+
}
|
|
177
|
+
/** A −/+ number stepper (RN ships none built-in). Flex-only, so it renders on web + native alike. */
|
|
178
|
+
declare const Stepper: Component<StepperProps>;
|
|
179
|
+
/** One segment: a value + a label. */
|
|
180
|
+
interface Segment {
|
|
181
|
+
readonly value: string;
|
|
182
|
+
readonly label: MindeesNode;
|
|
183
|
+
}
|
|
184
|
+
/** Props for {@link SegmentedControl}. */
|
|
185
|
+
interface SegmentedControlProps extends Omit<BaseProps, 'style'> {
|
|
186
|
+
readonly value: Reactive<string>;
|
|
187
|
+
readonly segments: readonly Segment[];
|
|
188
|
+
readonly onValueChange?: (value: string) => void;
|
|
189
|
+
readonly disabled?: boolean;
|
|
190
|
+
readonly style?: Reactive<StyleInput>;
|
|
191
|
+
}
|
|
192
|
+
/** A compact connected single-select (iOS-style segmented control). Flex-only → web + native. */
|
|
193
|
+
declare const SegmentedControl: Component<SegmentedControlProps>;
|
|
165
194
|
//#endregion
|
|
166
|
-
export { 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, Skeleton, SkeletonProps, Switch, SwitchProps, TabItem, Tabs, TabsProps };
|
|
195
|
+
export { 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 };
|
|
167
196
|
//# sourceMappingURL=components.d.ts.map
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","names":[],"sources":["../src/components.ts"],"mappings":";;;;;;UAqDiB,SAAA,SAAkB,SAAS;EAAA,SACjC,QAAA,GAAW,WAAA;EAQT;EAAA,SANF,OAAA;;WAEA,OAAA;EAI2B;EAAA,SAF3B,MAAA;AAAA;AAAA,cAEE,IAAA,EAAM,SAAS,CAAC,SAAA;;UA4BZ,YAAA,SAAqB,SAAS;EAAA,SACp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,IAAA;EAAA,SACA,aAAA,IAAiB,KAAA;EAAA,SACjB,QAAA;EAAA,SACA,KAAA,GAAQ,QAAA,CAAS,UAAA;AAAA;;cAIf,OAAA,EAAS,SAAS,CAAC,YAAA;AA1ZoB;AAAA,UA+dnC,OAAA;EAAA,SACN,KAAA;EAAA,SACA,KAAA,EAAO,WAAW;AAAA;;UAIZ,qBAAA,SAA8B,IAAA,CAAK,SAAA;EAAA,SACzC,KAAA,EAAO,QAAA;EAAA,SACP,QAAA,WAAmB,OAAA;EAAA,SACnB,aAAA,IAAiB,KAAA;EAAA,SACjB,QAAA;EAAA,SACA,KAAA,GAAQ,QAAA,CAAS,UAAA;AAAA;;cAIf,gBAAA,EAAkB,SAAS,CAAC,qBAAA"}
|
package/dist/components.js
CHANGED
|
@@ -505,7 +505,89 @@ const Accordion = (props) => {
|
|
|
505
505
|
}, style)
|
|
506
506
|
}, ...rows);
|
|
507
507
|
};
|
|
508
|
+
/** A −/+ number stepper (RN ships none built-in). Flex-only, so it renders on web + native alike. */
|
|
509
|
+
const Stepper = (props) => {
|
|
510
|
+
const theme = useTheme();
|
|
511
|
+
const { value, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY, step = 1, onValueChange, disabled, style, ...rest } = props;
|
|
512
|
+
const current = toAccessor(value, 0);
|
|
513
|
+
const clamp = (v) => Math.min(max, Math.max(min, v));
|
|
514
|
+
const button = (label, delta, enabled) => createElement(Pressable, {
|
|
515
|
+
role: "button",
|
|
516
|
+
state: () => ({ disabled: disabled === true || !enabled() }),
|
|
517
|
+
...disabled ? {} : { onPress: () => enabled() && onValueChange?.(clamp(current() + delta)) },
|
|
518
|
+
style: () => ({
|
|
519
|
+
width: 36,
|
|
520
|
+
height: 36,
|
|
521
|
+
alignItems: "center",
|
|
522
|
+
justifyContent: "center",
|
|
523
|
+
borderWidth: 1,
|
|
524
|
+
borderColor: theme().color.border,
|
|
525
|
+
borderRadius: radius.md
|
|
526
|
+
})
|
|
527
|
+
}, createElement(Text, { style: () => ({
|
|
528
|
+
fontSize: 20,
|
|
529
|
+
color: enabled() && disabled !== true ? theme().color.text : theme().color.textMuted
|
|
530
|
+
}) }, label));
|
|
531
|
+
return createElement(View, {
|
|
532
|
+
...toHostProps({
|
|
533
|
+
...rest,
|
|
534
|
+
style
|
|
535
|
+
}),
|
|
536
|
+
role: rest.role ?? "group",
|
|
537
|
+
style: mergeStyle({
|
|
538
|
+
display: "flex",
|
|
539
|
+
flexDirection: "row",
|
|
540
|
+
alignItems: "center",
|
|
541
|
+
gap: space.sm
|
|
542
|
+
}, style)
|
|
543
|
+
}, button("−", -step, () => current() > min), createElement(Text, { style: () => ({
|
|
544
|
+
minWidth: 32,
|
|
545
|
+
textAlign: "center",
|
|
546
|
+
color: theme().color.text
|
|
547
|
+
}) }, () => String(current())), button("+", step, () => current() < max));
|
|
548
|
+
};
|
|
549
|
+
/** A compact connected single-select (iOS-style segmented control). Flex-only → web + native. */
|
|
550
|
+
const SegmentedControl = (props) => {
|
|
551
|
+
const theme = useTheme();
|
|
552
|
+
const { value, segments, onValueChange, disabled, style, ...rest } = props;
|
|
553
|
+
const selected = toAccessor(value, segments[0]?.value ?? "");
|
|
554
|
+
return createElement(View, {
|
|
555
|
+
...toHostProps({
|
|
556
|
+
...rest,
|
|
557
|
+
style
|
|
558
|
+
}),
|
|
559
|
+
role: rest.role ?? "radiogroup",
|
|
560
|
+
style: mergeStyle(() => ({
|
|
561
|
+
display: "flex",
|
|
562
|
+
flexDirection: "row",
|
|
563
|
+
borderWidth: 1,
|
|
564
|
+
borderColor: theme().color.border,
|
|
565
|
+
borderRadius: radius.md,
|
|
566
|
+
overflow: "hidden"
|
|
567
|
+
}), style)
|
|
568
|
+
}, ...segments.map((seg) => {
|
|
569
|
+
const active = () => selected() === seg.value;
|
|
570
|
+
return createElement(Pressable, {
|
|
571
|
+
role: "radio",
|
|
572
|
+
state: () => ({
|
|
573
|
+
selected: active(),
|
|
574
|
+
disabled
|
|
575
|
+
}),
|
|
576
|
+
...disabled ? {} : { onPress: () => onValueChange?.(seg.value) },
|
|
577
|
+
style: () => ({
|
|
578
|
+
paddingTop: space.xs,
|
|
579
|
+
paddingBottom: space.xs,
|
|
580
|
+
paddingLeft: space.md,
|
|
581
|
+
paddingRight: space.md,
|
|
582
|
+
backgroundColor: active() ? theme().color.primary : "transparent"
|
|
583
|
+
})
|
|
584
|
+
}, typeof seg.label === "string" ? createElement(Text, { style: () => ({
|
|
585
|
+
color: active() ? theme().color.onTone : theme().color.text,
|
|
586
|
+
...active() ? { fontWeight: fontWeight.semibold } : {}
|
|
587
|
+
}) }, seg.label) : seg.label);
|
|
588
|
+
}));
|
|
589
|
+
};
|
|
508
590
|
//#endregion
|
|
509
|
-
export { Accordion, ActivityIndicator, Avatar, Badge, Card, Checkbox, Chip, Divider, KeyboardAvoidingView, ProgressBar, RadioGroup, SafeAreaView, Skeleton, Switch, Tabs };
|
|
591
|
+
export { Accordion, ActivityIndicator, Avatar, Badge, Card, Checkbox, Chip, Divider, KeyboardAvoidingView, ProgressBar, RadioGroup, SafeAreaView, SegmentedControl, Skeleton, Stepper, Switch, Tabs };
|
|
510
592
|
|
|
511
593
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","names":["radiusScale","radius"],"sources":["../src/components.ts"],"sourcesContent":["/**\n * Atlas components — higher-level building blocks composed purely from the primitives\n * (View/Text/Pressable/Image) + the device hooks. No new host concepts, so every one\n * renders on web *and* native today, and stays fine-grained: reactive bits are accessor\n * styles, so only the changed node re-runs (no component re-render).\n *\n * Colors come from the design tokens via {@link useTheme}, so components re-theme\n * automatically light↔dark (handbook §23/§31). Spacing/radius/type use the token scales.\n *\n * @module\n */\n\nimport {\n type Accessor,\n type Component,\n createElement,\n type MindeesNode,\n signal,\n untrack,\n} from '@mindees/core'\nimport { useKeyboard, useSafeAreaInsets } from './environment'\nimport { type BaseProps, type Reactive, toHostProps } from './host'\nimport { Image, Pressable, Text, View } from './primitives'\nimport { flattenStyle, type StyleInput } from './style'\nimport { fontWeight, radius as radiusScale, space, type Theme, useTheme } from './tokens'\n\n/** Merge a base style with a caller's (possibly reactive) style, staying reactive if either is. */\nfunction mergeStyle(\n base: StyleInput | Accessor<StyleInput>,\n style: Reactive<StyleInput> | undefined,\n): Reactive<StyleInput> {\n const baseFn = typeof base === 'function' ? (base as Accessor<StyleInput>) : null\n const styleFn = typeof style === 'function' ? (style as Accessor<StyleInput>) : null\n if (baseFn || styleFn) {\n // In each branch the non-fn side isn't a function, so the StyleInput cast is sound.\n const baseVal = base as StyleInput\n const styleVal = style as StyleInput\n return () => flattenStyle([baseFn ? baseFn() : baseVal, styleFn ? styleFn() : styleVal])\n }\n return flattenStyle([base as StyleInput, style as StyleInput])\n}\n\n/** Normalize a `Reactive<T>` to an accessor. */\nfunction toAccessor<T>(value: Reactive<T>, fallback: T): Accessor<T> {\n if (typeof value === 'function') return value as Accessor<T>\n return () => (value === undefined ? fallback : value)\n}\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\n/** A surface that groups one coherent unit of content. */\nexport interface CardProps extends BaseProps {\n readonly children?: MindeesNode\n /** Visual emphasis. `elevated` (default) lifts off the bg; `filled` is a soft tint; `outlined` is a hairline. */\n readonly variant?: 'elevated' | 'filled' | 'outlined'\n /** Internal padding (handbook default 16). */\n readonly padding?: number | string\n /** Corner radius (handbook 12–16 for app cards). */\n readonly radius?: number\n}\nexport const Card: Component<CardProps> = (props) => {\n const theme = useTheme()\n const {\n variant = 'elevated',\n padding = space.md,\n radius = radiusScale.lg,\n style,\n children,\n ...rest\n } = props\n const base: Accessor<StyleInput> = () => {\n const c = theme().color\n const surface: StyleInput =\n variant === 'outlined'\n ? { borderWidth: 1, borderColor: c.border }\n : variant === 'filled'\n ? { backgroundColor: c.surfaceVariant }\n : { backgroundColor: c.surface, borderWidth: 1, borderColor: c.border }\n return { padding, borderRadius: radius, ...surface }\n }\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// Divider\n// ---------------------------------------------------------------------------\n\n/** A thin rule separating content. */\nexport interface DividerProps extends BaseProps {\n readonly orientation?: 'horizontal' | 'vertical'\n readonly thickness?: number\n /** Override color (defaults to the theme border). */\n readonly color?: string\n}\nexport const Divider: Component<DividerProps> = (props) => {\n const theme = useTheme()\n const { orientation = 'horizontal', thickness = 1, color, style, ...rest } = props\n const base: Accessor<StyleInput> = () => {\n const bg = color ?? theme().color.border\n return orientation === 'horizontal'\n ? { height: thickness, alignSelf: 'stretch', backgroundColor: bg }\n : { width: thickness, alignSelf: 'stretch', backgroundColor: bg }\n }\n return createElement(View, {\n ...rest,\n role: rest.role ?? 'separator',\n style: mergeStyle(base, style),\n })\n}\n\n// ---------------------------------------------------------------------------\n// Badge\n// ---------------------------------------------------------------------------\n\nexport type BadgeTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n\n/** Resolve a tone to its {bg, fg} in the active theme. */\nfunction toneColors(tone: BadgeTone, theme: Theme): { bg: string; fg: string } {\n const c = theme.color\n if (tone === 'neutral') return { bg: c.surfaceVariant, fg: c.text }\n return { bg: c[tone], fg: c.onTone }\n}\n\n/** A compact status/count pill. */\nexport interface BadgeProps extends BaseProps {\n readonly children?: MindeesNode\n readonly tone?: BadgeTone\n}\nexport const Badge: Component<BadgeProps> = (props) => {\n const theme = useTheme()\n const { tone = 'neutral', style, children, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n paddingTop: space['3xs'],\n paddingBottom: space['3xs'],\n paddingLeft: space.xs,\n paddingRight: space.xs,\n borderRadius: radiusScale.full,\n backgroundColor: toneColors(tone, theme()).bg,\n })\n const textStyle: Accessor<StyleInput> = () => ({\n fontSize: 12,\n fontWeight: fontWeight.semibold,\n color: toneColors(tone, theme()).fg,\n })\n return createElement(\n View,\n { ...rest, role: rest.role ?? 'status', style: mergeStyle(base, style) },\n createElement(Text, { style: textStyle }, children),\n )\n}\n\n// ---------------------------------------------------------------------------\n// Avatar\n// ---------------------------------------------------------------------------\n\n/** Up-to-two-letter initials from a name. */\nfunction initialsOf(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n if (parts.length === 0) return '?'\n const first = parts[0]?.[0] ?? ''\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase()\n}\n\n/** A circular user image, falling back to initials. */\nexport interface AvatarProps extends BaseProps {\n readonly src?: string\n readonly name?: string\n /** Diameter in px (default 40). */\n readonly size?: number\n}\nexport const Avatar: Component<AvatarProps> = (props) => {\n const theme = useTheme()\n const { src, name, size = 40, style, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n width: size,\n height: size,\n borderRadius: size / 2,\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme().color.surfaceVariant,\n })\n const content = src\n ? createElement(Image, {\n src,\n label: name ?? '',\n ...(name ? {} : { decorative: true }),\n style: { width: size, height: size },\n })\n : createElement(\n Text,\n {\n style: () => ({\n fontSize: Math.round(size * 0.4),\n fontWeight: fontWeight.semibold,\n color: theme().color.text,\n }),\n },\n name ? initialsOf(name) : '?',\n )\n return createElement(\n View,\n { ...rest, label: rest.label ?? name, style: mergeStyle(base, style) },\n content,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Chip\n// ---------------------------------------------------------------------------\n\n/** A compact, optionally-selectable token (filter/choice/input). */\nexport interface ChipProps extends Omit<BaseProps, 'style'> {\n readonly label: string\n readonly selected?: Reactive<boolean>\n readonly disabled?: boolean\n readonly onPress?: () => void\n readonly leading?: MindeesNode\n readonly trailing?: MindeesNode\n readonly style?: Reactive<StyleInput>\n}\nexport const Chip: Component<ChipProps> = (props) => {\n const theme = useTheme()\n const { label, selected = false, disabled, onPress, leading, trailing, style, ...rest } = props\n const isSelected = toAccessor(selected, false)\n const base: Accessor<StyleInput> = () => {\n const c = theme().color\n const on = isSelected()\n return {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2xs'],\n minHeight: 32,\n paddingTop: space['2xs'],\n paddingBottom: space['2xs'],\n paddingLeft: space.sm,\n paddingRight: space.sm,\n borderRadius: radiusScale.full,\n borderWidth: 1,\n borderColor: on ? c.primary : c.border,\n backgroundColor: on ? c.primary : 'transparent',\n opacity: disabled ? 0.5 : 1,\n }\n }\n const text = createElement(\n Text,\n {\n style: () => ({\n fontSize: 14,\n fontWeight: fontWeight.medium,\n color: isSelected() ? theme().color.onPrimary : theme().color.text,\n }),\n },\n label,\n )\n const inner: MindeesNode = [leading, text, trailing].filter((n) => n != null) as MindeesNode\n return createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'button',\n // Reactive `aria-pressed` so a toggle chip announces its selected state as it changes.\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n pressed: isSelected(),\n }),\n ...(onPress ? { onPress } : {}),\n ...(disabled ? { disabled: true } : {}),\n style: mergeStyle(base, style),\n },\n inner,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Switch\n// ---------------------------------------------------------------------------\n\n/** A binary on/off toggle (composed track + knob; flips instantly on press). */\nexport interface SwitchProps extends Omit<BaseProps, 'style'> {\n /** Controlled state (static or reactive). */\n readonly value: Reactive<boolean>\n readonly onValueChange?: (value: boolean) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\nexport const Switch: Component<SwitchProps> = (props) => {\n const theme = useTheme()\n const { value, onValueChange, disabled, style, ...rest } = props\n const isOn = toAccessor(value, false)\n const track: Accessor<StyleInput> = () => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: isOn() ? 'flex-end' : 'flex-start',\n width: 52,\n height: 32,\n borderRadius: radiusScale.full,\n padding: 3,\n backgroundColor: isOn() ? theme().color.primary : theme().color.textMuted,\n opacity: disabled ? 0.5 : 1,\n })\n const knob = createElement(View, {\n style: () => ({\n width: 26,\n height: 26,\n borderRadius: 13,\n backgroundColor: theme().color.onPrimary,\n }),\n })\n const handlePress = onValueChange && !disabled ? () => onValueChange(!isOn()) : undefined\n return createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'switch',\n // Reactive state → `aria-checked` tracks the toggle (a static object would bake it once).\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n checked: isOn(),\n }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: mergeStyle(track, style),\n },\n knob,\n )\n}\n\n// ---------------------------------------------------------------------------\n// SafeAreaView\n// ---------------------------------------------------------------------------\n\n/** A container that pads itself by the live safe-area insets (notch, home indicator, …). */\nexport interface SafeAreaViewProps extends BaseProps {\n readonly children?: MindeesNode\n /** Which edges to inset (default: all four). */\n readonly edges?: ReadonlyArray<'top' | 'right' | 'bottom' | 'left'>\n}\nexport const SafeAreaView: Component<SafeAreaViewProps> = (props) => {\n const insets = useSafeAreaInsets()\n const { edges, style, children, ...rest } = props\n const wants = (edge: 'top' | 'right' | 'bottom' | 'left'): boolean =>\n !edges || edges.includes(edge)\n const base: Accessor<StyleInput> = () => {\n const i = insets()\n return {\n paddingTop: wants('top') ? i.top : 0,\n paddingRight: wants('right') ? i.right : 0,\n paddingBottom: wants('bottom') ? i.bottom : 0,\n paddingLeft: wants('left') ? i.left : 0,\n }\n }\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// KeyboardAvoidingView\n// ---------------------------------------------------------------------------\n\n/** A container that pads its bottom by the live keyboard height so content stays visible. */\nexport interface KeyboardAvoidingViewProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const KeyboardAvoidingView: Component<KeyboardAvoidingViewProps> = (props) => {\n const keyboard = useKeyboard()\n const { style, children, ...rest } = props\n const base: Accessor<StyleInput> = () => ({ paddingBottom: keyboard().height })\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// ProgressBar (determinate)\n// ---------------------------------------------------------------------------\n\n/** A determinate progress bar (track + reactive fill). */\nexport interface ProgressBarProps extends BaseProps {\n /** Progress 0..1 (static or reactive). Values outside the range are clamped. */\n readonly value?: Reactive<number>\n readonly trackColor?: string\n readonly color?: string\n readonly height?: number\n}\nexport const ProgressBar: Component<ProgressBarProps> = (props) => {\n const theme = useTheme()\n const { value = 0, trackColor, color, height = 6, style, ...rest } = props\n const progress = toAccessor(value, 0)\n const track: Accessor<StyleInput> = () => ({\n width: '100%',\n height,\n borderRadius: height / 2,\n overflow: 'hidden',\n backgroundColor: trackColor ?? theme().color.surfaceVariant,\n })\n const fill: Accessor<StyleInput> = () => ({\n height,\n borderRadius: height / 2,\n backgroundColor: color ?? theme().color.primary,\n width: `${Math.max(0, Math.min(1, progress())) * 100}%`,\n })\n return createElement(\n View,\n {\n ...rest,\n role: rest.role ?? 'progressbar',\n // A progressbar with no value is inaccessible — emit a reactive aria-valuenow (0..1 range).\n valueMin: 0,\n valueMax: 1,\n valueNow: () => Math.max(0, Math.min(1, progress())),\n style: mergeStyle(track, style),\n },\n createElement(View, { style: fill }),\n )\n}\n\n// ---------------------------------------------------------------------------\n// ActivityIndicator\n// ---------------------------------------------------------------------------\n\n/**\n * A spinning loading indicator. Emits the `activityindicator` host tag, which each backend\n * renders natively: web → a CSS keyframe spinner (size from `width`/`height`, arc from `color`),\n * Android → an indeterminate `ProgressBar`. Size/color flow through ordinary style keys.\n */\nexport interface ActivityIndicatorProps extends BaseProps {\n /** Diameter in px (default 24). */\n readonly size?: number\n /** Spinner color (defaults to the theme primary). */\n readonly color?: string\n /** When false, renders nothing (so callers can gate it without a conditional). */\n readonly animating?: boolean\n}\nexport const ActivityIndicator: Component<ActivityIndicatorProps> = (props) => {\n const theme = useTheme()\n const { size = 24, color, animating = true, style, ...rest } = props\n if (animating === false) return null\n const base: Accessor<StyleInput> = () => ({\n width: size,\n height: size,\n color: color ?? theme().color.primary,\n })\n const host = toHostProps({ ...rest, style: mergeStyle(base, style) })\n if (!host.role) host.role = 'status'\n host['aria-busy'] = 'true'\n return createElement('activityindicator', host)\n}\n\n// ---------------------------------------------------------------------------\n// Checkbox\n// ---------------------------------------------------------------------------\n\n/** Props for {@link Checkbox}. (`label` is omitted from a11y to repurpose it as the visible label.) */\nexport interface CheckboxProps extends Omit<BaseProps, 'style' | 'label'> {\n /** Controlled checked state (static or reactive). */\n readonly value: Reactive<boolean>\n readonly onValueChange?: (value: boolean) => void\n readonly disabled?: boolean\n /** Optional visible label rendered beside the box (a string becomes a `Text`). */\n readonly label?: MindeesNode\n readonly style?: Reactive<StyleInput>\n}\n\n/** An accessible checkbox (RN ships none built-in). Toggles `value`; `aria-checked` tracks it. */\nexport const Checkbox: Component<CheckboxProps> = (props) => {\n const theme = useTheme()\n const { value, onValueChange, disabled, label, style, ...rest } = props\n const isOn = toAccessor(value, false)\n const box: Accessor<StyleInput> = () => ({\n width: 22,\n height: 22,\n borderRadius: radiusScale.sm,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n borderColor: isOn() ? theme().color.primary : theme().color.textMuted,\n backgroundColor: isOn() ? theme().color.primary : 'transparent',\n opacity: disabled ? 0.5 : 1,\n })\n const check = createElement(\n Text,\n {\n style: () => ({ color: theme().color.onPrimary, fontSize: 14, fontWeight: fontWeight.bold }),\n },\n () => (isOn() ? '✓' : ''),\n )\n const handlePress = onValueChange && !disabled ? () => onValueChange(!isOn()) : undefined\n const boxEl = createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'checkbox',\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n checked: isOn(),\n }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: mergeStyle(box, style),\n },\n check,\n )\n if (label === undefined) return boxEl\n return createElement(\n View,\n { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: space.sm } },\n boxEl,\n typeof label === 'string' ? createElement(Text, {}, label) : label,\n )\n}\n\n// ---------------------------------------------------------------------------\n// RadioGroup\n// ---------------------------------------------------------------------------\n\n/** One option in a {@link RadioGroup}. */\nexport interface RadioOption {\n readonly value: string\n readonly label: MindeesNode\n}\n\n/** Props for {@link RadioGroup}. */\nexport interface RadioGroupProps extends Omit<BaseProps, 'style'> {\n /** Controlled selected value (static or reactive). */\n readonly value: Reactive<string>\n readonly options: readonly RadioOption[]\n readonly onValueChange?: (value: string) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\n\n/** A single-select radio group (RN ships none built-in). Each row is `role=\"radio\"`. */\nexport const RadioGroup: Component<RadioGroupProps> = (props) => {\n const theme = useTheme()\n const { value, options, onValueChange, disabled, style, ...rest } = props\n const selected = toAccessor(value, '')\n const rows = options.map((option) => {\n const checked = (): boolean => selected() === option.value\n const dot = createElement(View, {\n style: () => ({\n width: 12,\n height: 12,\n borderRadius: radiusScale.full,\n backgroundColor: checked() ? theme().color.primary : 'transparent',\n }),\n })\n const ring = createElement(\n View,\n {\n style: () => ({\n width: 22,\n height: 22,\n borderRadius: radiusScale.full,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n borderColor: checked() ? theme().color.primary : theme().color.textMuted,\n }),\n },\n dot,\n )\n const handlePress = onValueChange && !disabled ? () => onValueChange(option.value) : undefined\n return createElement(\n Pressable,\n {\n role: 'radio',\n state: () => ({ checked: checked() }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: space.sm },\n },\n ring,\n typeof option.label === 'string' ? createElement(Text, {}, option.label) : option.label,\n )\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n role: rest.role ?? 'radiogroup',\n style: mergeStyle({ display: 'flex', flexDirection: 'column', gap: space.sm }, style),\n },\n ...rows,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton\n// ---------------------------------------------------------------------------\n\n/** Props for {@link Skeleton}. */\nexport interface SkeletonProps extends Omit<BaseProps, 'style'> {\n readonly width?: number | string\n readonly height?: number | string\n readonly radius?: number\n readonly style?: Reactive<StyleInput>\n}\n\n/** A muted loading placeholder block (RN ships none built-in). */\nexport const Skeleton: Component<SkeletonProps> = (props) => {\n const theme = useTheme()\n const { width = '100%', height = 16, radius = radiusScale.sm, style, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n width,\n height,\n borderRadius: radius,\n backgroundColor: theme().color.surfaceVariant,\n })\n const host = toHostProps({ ...rest, style: mergeStyle(base, style) })\n if (!host.role) host.role = 'status'\n host['aria-busy'] = 'true'\n return createElement('view', host)\n}\n\n// ---------------------------------------------------------------------------\n// Tabs\n// ---------------------------------------------------------------------------\n\n/** One tab: a value, a header label, and its panel content. */\nexport interface TabItem {\n readonly value: string\n readonly label: MindeesNode\n readonly content: MindeesNode\n}\n\n/** Props for {@link Tabs}. */\nexport interface TabsProps extends Omit<BaseProps, 'style'> {\n /** Controlled selected tab value (static or reactive). */\n readonly value: Reactive<string>\n readonly tabs: readonly TabItem[]\n readonly onValueChange?: (value: string) => void\n readonly style?: Reactive<StyleInput>\n}\n\n/** An accessible tab strip + panel (RN ships none built-in). Only the active panel region re-renders. */\nexport const Tabs: Component<TabsProps> = (props) => {\n const theme = useTheme()\n const { value, tabs, onValueChange, style, ...rest } = props\n const selected = toAccessor(value, tabs[0]?.value ?? '')\n const tabBar = createElement(\n View,\n {\n role: 'tablist',\n style: () => ({\n display: 'flex',\n flexDirection: 'row',\n gap: space.xs,\n borderBottomWidth: 1,\n borderColor: theme().color.border,\n }),\n },\n ...tabs.map((t) => {\n const active = (): boolean => selected() === t.value\n return createElement(\n Pressable,\n {\n role: 'tab',\n state: () => ({ selected: active() }),\n ...(onValueChange ? { onPress: () => onValueChange(t.value) } : {}),\n style: () => ({\n paddingTop: space.xs,\n paddingBottom: space.xs,\n paddingLeft: space.sm,\n paddingRight: space.sm,\n borderBottomWidth: 2,\n borderColor: active() ? theme().color.primary : 'transparent',\n }),\n },\n typeof t.label === 'string'\n ? createElement(\n Text,\n {\n style: () => ({\n color: active() ? theme().color.primary : theme().color.text,\n ...(active() ? { fontWeight: fontWeight.semibold } : {}),\n }),\n },\n t.label,\n )\n : t.label,\n )\n }),\n )\n // The active panel is a reactive region: switching tabs re-runs ONLY this region.\n const panel = createElement(View, { role: 'tabpanel', style: { padding: space.md } }, () => {\n const active = tabs.find((t) => t.value === selected())\n return active ? active.content : null\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n style: mergeStyle({ display: 'flex', flexDirection: 'column' }, style),\n },\n tabBar,\n panel,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Accordion\n// ---------------------------------------------------------------------------\n\n/** One collapsible accordion section. */\nexport interface AccordionSection {\n readonly id: string\n readonly header: MindeesNode\n readonly content: MindeesNode\n}\n\n/** Props for {@link Accordion}. */\nexport interface AccordionProps extends Omit<BaseProps, 'style'> {\n readonly sections: readonly AccordionSection[]\n /** Allow more than one section open at once (default: single-open). */\n readonly multiple?: boolean\n /** Section ids open on first render. */\n readonly defaultOpen?: readonly string[]\n readonly style?: Reactive<StyleInput>\n}\n\n/** Collapsible sections (RN ships none built-in). Each header is `aria-expanded`; panels mount lazily. */\nexport const Accordion: Component<AccordionProps> = (props) => {\n const theme = useTheme()\n const { sections, multiple, defaultOpen = [], style, ...rest } = props\n const open = signal<ReadonlySet<string>>(new Set(defaultOpen))\n const isOpen = (id: string): boolean => open().has(id)\n const toggle = (id: string): void => {\n const next = new Set(untrack(open))\n if (next.has(id)) next.delete(id)\n else {\n if (!multiple) next.clear()\n next.add(id)\n }\n open.set(next)\n }\n const rows = sections.map((section) => {\n const header = createElement(\n Pressable,\n {\n role: 'button',\n state: () => ({ expanded: isOpen(section.id) }),\n onPress: () => toggle(section.id),\n style: () => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingTop: space.sm,\n paddingBottom: space.sm,\n borderBottomWidth: 1,\n borderColor: theme().color.border,\n }),\n },\n typeof section.header === 'string' ? createElement(Text, {}, section.header) : section.header,\n createElement(Text, { style: () => ({ color: theme().color.textMuted }) }, () =>\n isOpen(section.id) ? '▾' : '▸',\n ),\n )\n // The panel region re-runs only when THIS section toggles.\n const panel = createElement(View, { style: { padding: space.sm } }, () =>\n isOpen(section.id) ? section.content : null,\n )\n return createElement(View, {}, header, panel)\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n style: mergeStyle({ display: 'flex', flexDirection: 'column' }, style),\n },\n ...rows,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,SAAS,WACP,MACA,OACsB;CACtB,MAAM,SAAS,OAAO,SAAS,aAAc,OAAgC;CAC7E,MAAM,UAAU,OAAO,UAAU,aAAc,QAAiC;CAChF,IAAI,UAAU,SAAS;EAErB,MAAM,UAAU;EAChB,MAAM,WAAW;EACjB,aAAa,aAAa,CAAC,SAAS,OAAO,IAAI,SAAS,UAAU,QAAQ,IAAI,QAAQ,CAAC;CACzF;CACA,OAAO,aAAa,CAAC,MAAoB,KAAmB,CAAC;AAC/D;;AAGA,SAAS,WAAc,OAAoB,UAA0B;CACnE,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,aAAc,UAAU,KAAA,IAAY,WAAW;AACjD;AAgBA,MAAa,QAA8B,UAAU;CACnD,MAAM,QAAQ,SAAS;CACvB,MAAM,EACJ,UAAU,YACV,UAAU,MAAM,IAChB,QAAA,WAASA,OAAY,IACrB,OACA,UACA,GAAG,SACD;CACJ,MAAM,aAAmC;EACvC,MAAM,IAAI,MAAM,EAAE;EAOlB,OAAO;GAAE;GAAS,cAAcC;GAAQ,GALtC,YAAY,aACR;IAAE,aAAa;IAAG,aAAa,EAAE;GAAO,IACxC,YAAY,WACV,EAAE,iBAAi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Q,EAAE,IAAI,QAAQ,UAAU,IAEE,CAAC;CAC9C,CAAC;CACD,OAAO,cACL,MACA;EACE,GAAG,YAAY;GAAE,GAAG;GAAM;EAAM,CAAC;EACjC,OAAO,WAAW;GAAE,SAAS;GAAQ,eAAe;EAAS,GAAG,KAAK;CACvE,GACA,GAAG,IACL;AACF"}
|
|
1
|
+
{"version":3,"file":"components.js","names":["radiusScale","radius"],"sources":["../src/components.ts"],"sourcesContent":["/**\n * Atlas components — higher-level building blocks composed purely from the primitives\n * (View/Text/Pressable/Image) + the device hooks. No new host concepts, so every one\n * renders on web *and* native today, and stays fine-grained: reactive bits are accessor\n * styles, so only the changed node re-runs (no component re-render).\n *\n * Colors come from the design tokens via {@link useTheme}, so components re-theme\n * automatically light↔dark (handbook §23/§31). Spacing/radius/type use the token scales.\n *\n * @module\n */\n\nimport {\n type Accessor,\n type Component,\n createElement,\n type MindeesNode,\n signal,\n untrack,\n} from '@mindees/core'\nimport { useKeyboard, useSafeAreaInsets } from './environment'\nimport { type BaseProps, type Reactive, toHostProps } from './host'\nimport { Image, Pressable, Text, View } from './primitives'\nimport { flattenStyle, type StyleInput } from './style'\nimport { fontWeight, radius as radiusScale, space, type Theme, useTheme } from './tokens'\n\n/** Merge a base style with a caller's (possibly reactive) style, staying reactive if either is. */\nfunction mergeStyle(\n base: StyleInput | Accessor<StyleInput>,\n style: Reactive<StyleInput> | undefined,\n): Reactive<StyleInput> {\n const baseFn = typeof base === 'function' ? (base as Accessor<StyleInput>) : null\n const styleFn = typeof style === 'function' ? (style as Accessor<StyleInput>) : null\n if (baseFn || styleFn) {\n // In each branch the non-fn side isn't a function, so the StyleInput cast is sound.\n const baseVal = base as StyleInput\n const styleVal = style as StyleInput\n return () => flattenStyle([baseFn ? baseFn() : baseVal, styleFn ? styleFn() : styleVal])\n }\n return flattenStyle([base as StyleInput, style as StyleInput])\n}\n\n/** Normalize a `Reactive<T>` to an accessor. */\nfunction toAccessor<T>(value: Reactive<T>, fallback: T): Accessor<T> {\n if (typeof value === 'function') return value as Accessor<T>\n return () => (value === undefined ? fallback : value)\n}\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\n\n/** A surface that groups one coherent unit of content. */\nexport interface CardProps extends BaseProps {\n readonly children?: MindeesNode\n /** Visual emphasis. `elevated` (default) lifts off the bg; `filled` is a soft tint; `outlined` is a hairline. */\n readonly variant?: 'elevated' | 'filled' | 'outlined'\n /** Internal padding (handbook default 16). */\n readonly padding?: number | string\n /** Corner radius (handbook 12–16 for app cards). */\n readonly radius?: number\n}\nexport const Card: Component<CardProps> = (props) => {\n const theme = useTheme()\n const {\n variant = 'elevated',\n padding = space.md,\n radius = radiusScale.lg,\n style,\n children,\n ...rest\n } = props\n const base: Accessor<StyleInput> = () => {\n const c = theme().color\n const surface: StyleInput =\n variant === 'outlined'\n ? { borderWidth: 1, borderColor: c.border }\n : variant === 'filled'\n ? { backgroundColor: c.surfaceVariant }\n : { backgroundColor: c.surface, borderWidth: 1, borderColor: c.border }\n return { padding, borderRadius: radius, ...surface }\n }\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// Divider\n// ---------------------------------------------------------------------------\n\n/** A thin rule separating content. */\nexport interface DividerProps extends BaseProps {\n readonly orientation?: 'horizontal' | 'vertical'\n readonly thickness?: number\n /** Override color (defaults to the theme border). */\n readonly color?: string\n}\nexport const Divider: Component<DividerProps> = (props) => {\n const theme = useTheme()\n const { orientation = 'horizontal', thickness = 1, color, style, ...rest } = props\n const base: Accessor<StyleInput> = () => {\n const bg = color ?? theme().color.border\n return orientation === 'horizontal'\n ? { height: thickness, alignSelf: 'stretch', backgroundColor: bg }\n : { width: thickness, alignSelf: 'stretch', backgroundColor: bg }\n }\n return createElement(View, {\n ...rest,\n role: rest.role ?? 'separator',\n style: mergeStyle(base, style),\n })\n}\n\n// ---------------------------------------------------------------------------\n// Badge\n// ---------------------------------------------------------------------------\n\nexport type BadgeTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n\n/** Resolve a tone to its {bg, fg} in the active theme. */\nfunction toneColors(tone: BadgeTone, theme: Theme): { bg: string; fg: string } {\n const c = theme.color\n if (tone === 'neutral') return { bg: c.surfaceVariant, fg: c.text }\n return { bg: c[tone], fg: c.onTone }\n}\n\n/** A compact status/count pill. */\nexport interface BadgeProps extends BaseProps {\n readonly children?: MindeesNode\n readonly tone?: BadgeTone\n}\nexport const Badge: Component<BadgeProps> = (props) => {\n const theme = useTheme()\n const { tone = 'neutral', style, children, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n paddingTop: space['3xs'],\n paddingBottom: space['3xs'],\n paddingLeft: space.xs,\n paddingRight: space.xs,\n borderRadius: radiusScale.full,\n backgroundColor: toneColors(tone, theme()).bg,\n })\n const textStyle: Accessor<StyleInput> = () => ({\n fontSize: 12,\n fontWeight: fontWeight.semibold,\n color: toneColors(tone, theme()).fg,\n })\n return createElement(\n View,\n { ...rest, role: rest.role ?? 'status', style: mergeStyle(base, style) },\n createElement(Text, { style: textStyle }, children),\n )\n}\n\n// ---------------------------------------------------------------------------\n// Avatar\n// ---------------------------------------------------------------------------\n\n/** Up-to-two-letter initials from a name. */\nfunction initialsOf(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n if (parts.length === 0) return '?'\n const first = parts[0]?.[0] ?? ''\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase()\n}\n\n/** A circular user image, falling back to initials. */\nexport interface AvatarProps extends BaseProps {\n readonly src?: string\n readonly name?: string\n /** Diameter in px (default 40). */\n readonly size?: number\n}\nexport const Avatar: Component<AvatarProps> = (props) => {\n const theme = useTheme()\n const { src, name, size = 40, style, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n width: size,\n height: size,\n borderRadius: size / 2,\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme().color.surfaceVariant,\n })\n const content = src\n ? createElement(Image, {\n src,\n label: name ?? '',\n ...(name ? {} : { decorative: true }),\n style: { width: size, height: size },\n })\n : createElement(\n Text,\n {\n style: () => ({\n fontSize: Math.round(size * 0.4),\n fontWeight: fontWeight.semibold,\n color: theme().color.text,\n }),\n },\n name ? initialsOf(name) : '?',\n )\n return createElement(\n View,\n { ...rest, label: rest.label ?? name, style: mergeStyle(base, style) },\n content,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Chip\n// ---------------------------------------------------------------------------\n\n/** A compact, optionally-selectable token (filter/choice/input). */\nexport interface ChipProps extends Omit<BaseProps, 'style'> {\n readonly label: string\n readonly selected?: Reactive<boolean>\n readonly disabled?: boolean\n readonly onPress?: () => void\n readonly leading?: MindeesNode\n readonly trailing?: MindeesNode\n readonly style?: Reactive<StyleInput>\n}\nexport const Chip: Component<ChipProps> = (props) => {\n const theme = useTheme()\n const { label, selected = false, disabled, onPress, leading, trailing, style, ...rest } = props\n const isSelected = toAccessor(selected, false)\n const base: Accessor<StyleInput> = () => {\n const c = theme().color\n const on = isSelected()\n return {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: space['2xs'],\n minHeight: 32,\n paddingTop: space['2xs'],\n paddingBottom: space['2xs'],\n paddingLeft: space.sm,\n paddingRight: space.sm,\n borderRadius: radiusScale.full,\n borderWidth: 1,\n borderColor: on ? c.primary : c.border,\n backgroundColor: on ? c.primary : 'transparent',\n opacity: disabled ? 0.5 : 1,\n }\n }\n const text = createElement(\n Text,\n {\n style: () => ({\n fontSize: 14,\n fontWeight: fontWeight.medium,\n color: isSelected() ? theme().color.onPrimary : theme().color.text,\n }),\n },\n label,\n )\n const inner: MindeesNode = [leading, text, trailing].filter((n) => n != null) as MindeesNode\n return createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'button',\n // Reactive `aria-pressed` so a toggle chip announces its selected state as it changes.\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n pressed: isSelected(),\n }),\n ...(onPress ? { onPress } : {}),\n ...(disabled ? { disabled: true } : {}),\n style: mergeStyle(base, style),\n },\n inner,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Switch\n// ---------------------------------------------------------------------------\n\n/** A binary on/off toggle (composed track + knob; flips instantly on press). */\nexport interface SwitchProps extends Omit<BaseProps, 'style'> {\n /** Controlled state (static or reactive). */\n readonly value: Reactive<boolean>\n readonly onValueChange?: (value: boolean) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\nexport const Switch: Component<SwitchProps> = (props) => {\n const theme = useTheme()\n const { value, onValueChange, disabled, style, ...rest } = props\n const isOn = toAccessor(value, false)\n const track: Accessor<StyleInput> = () => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: isOn() ? 'flex-end' : 'flex-start',\n width: 52,\n height: 32,\n borderRadius: radiusScale.full,\n padding: 3,\n backgroundColor: isOn() ? theme().color.primary : theme().color.textMuted,\n opacity: disabled ? 0.5 : 1,\n })\n const knob = createElement(View, {\n style: () => ({\n width: 26,\n height: 26,\n borderRadius: 13,\n backgroundColor: theme().color.onPrimary,\n }),\n })\n const handlePress = onValueChange && !disabled ? () => onValueChange(!isOn()) : undefined\n return createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'switch',\n // Reactive state → `aria-checked` tracks the toggle (a static object would bake it once).\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n checked: isOn(),\n }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: mergeStyle(track, style),\n },\n knob,\n )\n}\n\n// ---------------------------------------------------------------------------\n// SafeAreaView\n// ---------------------------------------------------------------------------\n\n/** A container that pads itself by the live safe-area insets (notch, home indicator, …). */\nexport interface SafeAreaViewProps extends BaseProps {\n readonly children?: MindeesNode\n /** Which edges to inset (default: all four). */\n readonly edges?: ReadonlyArray<'top' | 'right' | 'bottom' | 'left'>\n}\nexport const SafeAreaView: Component<SafeAreaViewProps> = (props) => {\n const insets = useSafeAreaInsets()\n const { edges, style, children, ...rest } = props\n const wants = (edge: 'top' | 'right' | 'bottom' | 'left'): boolean =>\n !edges || edges.includes(edge)\n const base: Accessor<StyleInput> = () => {\n const i = insets()\n return {\n paddingTop: wants('top') ? i.top : 0,\n paddingRight: wants('right') ? i.right : 0,\n paddingBottom: wants('bottom') ? i.bottom : 0,\n paddingLeft: wants('left') ? i.left : 0,\n }\n }\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// KeyboardAvoidingView\n// ---------------------------------------------------------------------------\n\n/** A container that pads its bottom by the live keyboard height so content stays visible. */\nexport interface KeyboardAvoidingViewProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const KeyboardAvoidingView: Component<KeyboardAvoidingViewProps> = (props) => {\n const keyboard = useKeyboard()\n const { style, children, ...rest } = props\n const base: Accessor<StyleInput> = () => ({ paddingBottom: keyboard().height })\n return createElement(View, { ...rest, style: mergeStyle(base, style) }, children)\n}\n\n// ---------------------------------------------------------------------------\n// ProgressBar (determinate)\n// ---------------------------------------------------------------------------\n\n/** A determinate progress bar (track + reactive fill). */\nexport interface ProgressBarProps extends BaseProps {\n /** Progress 0..1 (static or reactive). Values outside the range are clamped. */\n readonly value?: Reactive<number>\n readonly trackColor?: string\n readonly color?: string\n readonly height?: number\n}\nexport const ProgressBar: Component<ProgressBarProps> = (props) => {\n const theme = useTheme()\n const { value = 0, trackColor, color, height = 6, style, ...rest } = props\n const progress = toAccessor(value, 0)\n const track: Accessor<StyleInput> = () => ({\n width: '100%',\n height,\n borderRadius: height / 2,\n overflow: 'hidden',\n backgroundColor: trackColor ?? theme().color.surfaceVariant,\n })\n const fill: Accessor<StyleInput> = () => ({\n height,\n borderRadius: height / 2,\n backgroundColor: color ?? theme().color.primary,\n width: `${Math.max(0, Math.min(1, progress())) * 100}%`,\n })\n return createElement(\n View,\n {\n ...rest,\n role: rest.role ?? 'progressbar',\n // A progressbar with no value is inaccessible — emit a reactive aria-valuenow (0..1 range).\n valueMin: 0,\n valueMax: 1,\n valueNow: () => Math.max(0, Math.min(1, progress())),\n style: mergeStyle(track, style),\n },\n createElement(View, { style: fill }),\n )\n}\n\n// ---------------------------------------------------------------------------\n// ActivityIndicator\n// ---------------------------------------------------------------------------\n\n/**\n * A spinning loading indicator. Emits the `activityindicator` host tag, which each backend\n * renders natively: web → a CSS keyframe spinner (size from `width`/`height`, arc from `color`),\n * Android → an indeterminate `ProgressBar`. Size/color flow through ordinary style keys.\n */\nexport interface ActivityIndicatorProps extends BaseProps {\n /** Diameter in px (default 24). */\n readonly size?: number\n /** Spinner color (defaults to the theme primary). */\n readonly color?: string\n /** When false, renders nothing (so callers can gate it without a conditional). */\n readonly animating?: boolean\n}\nexport const ActivityIndicator: Component<ActivityIndicatorProps> = (props) => {\n const theme = useTheme()\n const { size = 24, color, animating = true, style, ...rest } = props\n if (animating === false) return null\n const base: Accessor<StyleInput> = () => ({\n width: size,\n height: size,\n color: color ?? theme().color.primary,\n })\n const host = toHostProps({ ...rest, style: mergeStyle(base, style) })\n if (!host.role) host.role = 'status'\n host['aria-busy'] = 'true'\n return createElement('activityindicator', host)\n}\n\n// ---------------------------------------------------------------------------\n// Checkbox\n// ---------------------------------------------------------------------------\n\n/** Props for {@link Checkbox}. (`label` is omitted from a11y to repurpose it as the visible label.) */\nexport interface CheckboxProps extends Omit<BaseProps, 'style' | 'label'> {\n /** Controlled checked state (static or reactive). */\n readonly value: Reactive<boolean>\n readonly onValueChange?: (value: boolean) => void\n readonly disabled?: boolean\n /** Optional visible label rendered beside the box (a string becomes a `Text`). */\n readonly label?: MindeesNode\n readonly style?: Reactive<StyleInput>\n}\n\n/** An accessible checkbox (RN ships none built-in). Toggles `value`; `aria-checked` tracks it. */\nexport const Checkbox: Component<CheckboxProps> = (props) => {\n const theme = useTheme()\n const { value, onValueChange, disabled, label, style, ...rest } = props\n const isOn = toAccessor(value, false)\n const box: Accessor<StyleInput> = () => ({\n width: 22,\n height: 22,\n borderRadius: radiusScale.sm,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n borderColor: isOn() ? theme().color.primary : theme().color.textMuted,\n backgroundColor: isOn() ? theme().color.primary : 'transparent',\n opacity: disabled ? 0.5 : 1,\n })\n const check = createElement(\n Text,\n {\n style: () => ({ color: theme().color.onPrimary, fontSize: 14, fontWeight: fontWeight.bold }),\n },\n () => (isOn() ? '✓' : ''),\n )\n const handlePress = onValueChange && !disabled ? () => onValueChange(!isOn()) : undefined\n const boxEl = createElement(\n Pressable,\n {\n ...rest,\n role: rest.role ?? 'checkbox',\n state: () => ({\n ...(typeof rest.state === 'function' ? rest.state() : (rest.state ?? {})),\n checked: isOn(),\n }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: mergeStyle(box, style),\n },\n check,\n )\n if (label === undefined) return boxEl\n return createElement(\n View,\n { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: space.sm } },\n boxEl,\n typeof label === 'string' ? createElement(Text, {}, label) : label,\n )\n}\n\n// ---------------------------------------------------------------------------\n// RadioGroup\n// ---------------------------------------------------------------------------\n\n/** One option in a {@link RadioGroup}. */\nexport interface RadioOption {\n readonly value: string\n readonly label: MindeesNode\n}\n\n/** Props for {@link RadioGroup}. */\nexport interface RadioGroupProps extends Omit<BaseProps, 'style'> {\n /** Controlled selected value (static or reactive). */\n readonly value: Reactive<string>\n readonly options: readonly RadioOption[]\n readonly onValueChange?: (value: string) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\n\n/** A single-select radio group (RN ships none built-in). Each row is `role=\"radio\"`. */\nexport const RadioGroup: Component<RadioGroupProps> = (props) => {\n const theme = useTheme()\n const { value, options, onValueChange, disabled, style, ...rest } = props\n const selected = toAccessor(value, '')\n const rows = options.map((option) => {\n const checked = (): boolean => selected() === option.value\n const dot = createElement(View, {\n style: () => ({\n width: 12,\n height: 12,\n borderRadius: radiusScale.full,\n backgroundColor: checked() ? theme().color.primary : 'transparent',\n }),\n })\n const ring = createElement(\n View,\n {\n style: () => ({\n width: 22,\n height: 22,\n borderRadius: radiusScale.full,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n borderColor: checked() ? theme().color.primary : theme().color.textMuted,\n }),\n },\n dot,\n )\n const handlePress = onValueChange && !disabled ? () => onValueChange(option.value) : undefined\n return createElement(\n Pressable,\n {\n role: 'radio',\n state: () => ({ checked: checked() }),\n ...(disabled ? { disabled: true } : {}),\n ...(handlePress ? { onPress: handlePress } : {}),\n style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: space.sm },\n },\n ring,\n typeof option.label === 'string' ? createElement(Text, {}, option.label) : option.label,\n )\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n role: rest.role ?? 'radiogroup',\n style: mergeStyle({ display: 'flex', flexDirection: 'column', gap: space.sm }, style),\n },\n ...rows,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton\n// ---------------------------------------------------------------------------\n\n/** Props for {@link Skeleton}. */\nexport interface SkeletonProps extends Omit<BaseProps, 'style'> {\n readonly width?: number | string\n readonly height?: number | string\n readonly radius?: number\n readonly style?: Reactive<StyleInput>\n}\n\n/** A muted loading placeholder block (RN ships none built-in). */\nexport const Skeleton: Component<SkeletonProps> = (props) => {\n const theme = useTheme()\n const { width = '100%', height = 16, radius = radiusScale.sm, style, ...rest } = props\n const base: Accessor<StyleInput> = () => ({\n width,\n height,\n borderRadius: radius,\n backgroundColor: theme().color.surfaceVariant,\n })\n const host = toHostProps({ ...rest, style: mergeStyle(base, style) })\n if (!host.role) host.role = 'status'\n host['aria-busy'] = 'true'\n return createElement('view', host)\n}\n\n// ---------------------------------------------------------------------------\n// Tabs\n// ---------------------------------------------------------------------------\n\n/** One tab: a value, a header label, and its panel content. */\nexport interface TabItem {\n readonly value: string\n readonly label: MindeesNode\n readonly content: MindeesNode\n}\n\n/** Props for {@link Tabs}. */\nexport interface TabsProps extends Omit<BaseProps, 'style'> {\n /** Controlled selected tab value (static or reactive). */\n readonly value: Reactive<string>\n readonly tabs: readonly TabItem[]\n readonly onValueChange?: (value: string) => void\n readonly style?: Reactive<StyleInput>\n}\n\n/** An accessible tab strip + panel (RN ships none built-in). Only the active panel region re-renders. */\nexport const Tabs: Component<TabsProps> = (props) => {\n const theme = useTheme()\n const { value, tabs, onValueChange, style, ...rest } = props\n const selected = toAccessor(value, tabs[0]?.value ?? '')\n const tabBar = createElement(\n View,\n {\n role: 'tablist',\n style: () => ({\n display: 'flex',\n flexDirection: 'row',\n gap: space.xs,\n borderBottomWidth: 1,\n borderColor: theme().color.border,\n }),\n },\n ...tabs.map((t) => {\n const active = (): boolean => selected() === t.value\n return createElement(\n Pressable,\n {\n role: 'tab',\n state: () => ({ selected: active() }),\n ...(onValueChange ? { onPress: () => onValueChange(t.value) } : {}),\n style: () => ({\n paddingTop: space.xs,\n paddingBottom: space.xs,\n paddingLeft: space.sm,\n paddingRight: space.sm,\n borderBottomWidth: 2,\n borderColor: active() ? theme().color.primary : 'transparent',\n }),\n },\n typeof t.label === 'string'\n ? createElement(\n Text,\n {\n style: () => ({\n color: active() ? theme().color.primary : theme().color.text,\n ...(active() ? { fontWeight: fontWeight.semibold } : {}),\n }),\n },\n t.label,\n )\n : t.label,\n )\n }),\n )\n // The active panel is a reactive region: switching tabs re-runs ONLY this region.\n const panel = createElement(View, { role: 'tabpanel', style: { padding: space.md } }, () => {\n const active = tabs.find((t) => t.value === selected())\n return active ? active.content : null\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n style: mergeStyle({ display: 'flex', flexDirection: 'column' }, style),\n },\n tabBar,\n panel,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Accordion\n// ---------------------------------------------------------------------------\n\n/** One collapsible accordion section. */\nexport interface AccordionSection {\n readonly id: string\n readonly header: MindeesNode\n readonly content: MindeesNode\n}\n\n/** Props for {@link Accordion}. */\nexport interface AccordionProps extends Omit<BaseProps, 'style'> {\n readonly sections: readonly AccordionSection[]\n /** Allow more than one section open at once (default: single-open). */\n readonly multiple?: boolean\n /** Section ids open on first render. */\n readonly defaultOpen?: readonly string[]\n readonly style?: Reactive<StyleInput>\n}\n\n/** Collapsible sections (RN ships none built-in). Each header is `aria-expanded`; panels mount lazily. */\nexport const Accordion: Component<AccordionProps> = (props) => {\n const theme = useTheme()\n const { sections, multiple, defaultOpen = [], style, ...rest } = props\n const open = signal<ReadonlySet<string>>(new Set(defaultOpen))\n const isOpen = (id: string): boolean => open().has(id)\n const toggle = (id: string): void => {\n const next = new Set(untrack(open))\n if (next.has(id)) next.delete(id)\n else {\n if (!multiple) next.clear()\n next.add(id)\n }\n open.set(next)\n }\n const rows = sections.map((section) => {\n const header = createElement(\n Pressable,\n {\n role: 'button',\n state: () => ({ expanded: isOpen(section.id) }),\n onPress: () => toggle(section.id),\n style: () => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingTop: space.sm,\n paddingBottom: space.sm,\n borderBottomWidth: 1,\n borderColor: theme().color.border,\n }),\n },\n typeof section.header === 'string' ? createElement(Text, {}, section.header) : section.header,\n createElement(Text, { style: () => ({ color: theme().color.textMuted }) }, () =>\n isOpen(section.id) ? '▾' : '▸',\n ),\n )\n // The panel region re-runs only when THIS section toggles.\n const panel = createElement(View, { style: { padding: space.sm } }, () =>\n isOpen(section.id) ? section.content : null,\n )\n return createElement(View, {}, header, panel)\n })\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n style: mergeStyle({ display: 'flex', flexDirection: 'column' }, style),\n },\n ...rows,\n )\n}\n\n// ---------------------------------------------------------------------------\n// Stepper\n// ---------------------------------------------------------------------------\n\n/** Props for {@link Stepper}. */\nexport interface StepperProps extends Omit<BaseProps, 'style'> {\n /** Controlled numeric value (static or reactive). */\n readonly value: Reactive<number>\n readonly min?: number\n readonly max?: number\n /** Increment/decrement amount (default 1). */\n readonly step?: number\n readonly onValueChange?: (value: number) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\n\n/** A −/+ number stepper (RN ships none built-in). Flex-only, so it renders on web + native alike. */\nexport const Stepper: Component<StepperProps> = (props) => {\n const theme = useTheme()\n const {\n value,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n step = 1,\n onValueChange,\n disabled,\n style,\n ...rest\n } = props\n const current = toAccessor(value, 0)\n const clamp = (v: number): number => Math.min(max, Math.max(min, v))\n const button = (label: string, delta: number, enabled: () => boolean) =>\n createElement(\n Pressable,\n {\n role: 'button',\n state: () => ({ disabled: disabled === true || !enabled() }),\n ...(disabled\n ? {}\n : { onPress: () => enabled() && onValueChange?.(clamp(current() + delta)) }),\n style: () => ({\n width: 36,\n height: 36,\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 1,\n borderColor: theme().color.border,\n borderRadius: radiusScale.md,\n }),\n },\n createElement(\n Text,\n {\n style: () => ({\n fontSize: 20,\n color: enabled() && disabled !== true ? theme().color.text : theme().color.textMuted,\n }),\n },\n label,\n ),\n )\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n role: rest.role ?? 'group',\n style: mergeStyle(\n { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: space.sm },\n style,\n ),\n },\n button('−', -step, () => current() > min), // minus\n createElement(\n Text,\n { style: () => ({ minWidth: 32, textAlign: 'center', color: theme().color.text }) },\n () => String(current()),\n ),\n button('+', step, () => current() < max),\n )\n}\n\n// ---------------------------------------------------------------------------\n// SegmentedControl\n// ---------------------------------------------------------------------------\n\n/** One segment: a value + a label. */\nexport interface Segment {\n readonly value: string\n readonly label: MindeesNode\n}\n\n/** Props for {@link SegmentedControl}. */\nexport interface SegmentedControlProps extends Omit<BaseProps, 'style'> {\n readonly value: Reactive<string>\n readonly segments: readonly Segment[]\n readonly onValueChange?: (value: string) => void\n readonly disabled?: boolean\n readonly style?: Reactive<StyleInput>\n}\n\n/** A compact connected single-select (iOS-style segmented control). Flex-only → web + native. */\nexport const SegmentedControl: Component<SegmentedControlProps> = (props) => {\n const theme = useTheme()\n const { value, segments, onValueChange, disabled, style, ...rest } = props\n const selected = toAccessor(value, segments[0]?.value ?? '')\n return createElement(\n View,\n {\n ...toHostProps({ ...rest, style }),\n role: rest.role ?? 'radiogroup',\n style: mergeStyle(\n () => ({\n display: 'flex',\n flexDirection: 'row',\n borderWidth: 1,\n borderColor: theme().color.border,\n borderRadius: radiusScale.md,\n overflow: 'hidden',\n }),\n style,\n ),\n },\n ...segments.map((seg) => {\n const active = (): boolean => selected() === seg.value\n return createElement(\n Pressable,\n {\n role: 'radio',\n state: () => ({ selected: active(), disabled }),\n ...(disabled ? {} : { onPress: () => onValueChange?.(seg.value) }),\n style: () => ({\n paddingTop: space.xs,\n paddingBottom: space.xs,\n paddingLeft: space.md,\n paddingRight: space.md,\n backgroundColor: active() ? theme().color.primary : 'transparent',\n }),\n },\n typeof seg.label === 'string'\n ? createElement(\n Text,\n {\n style: () => ({\n color: active() ? theme().color.onTone : theme().color.text,\n ...(active() ? { fontWeight: fontWeight.semibold } : {}),\n }),\n },\n seg.label,\n )\n : seg.label,\n )\n }),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,SAAS,WACP,MACA,OACsB;CACtB,MAAM,SAAS,OAAO,SAAS,aAAc,OAAgC;CAC7E,MAAM,UAAU,OAAO,UAAU,aAAc,QAAiC;CAChF,IAAI,UAAU,SAAS;EAErB,MAAM,UAAU;EAChB,MAAM,WAAW;EACjB,aAAa,aAAa,CAAC,SAAS,OAAO,IAAI,SAAS,UAAU,QAAQ,IAAI,QAAQ,CAAC;CACzF;CACA,OAAO,aAAa,CAAC,MAAoB,KAAmB,CAAC;AAC/D;;AAGA,SAAS,WAAc,OAAoB,UAA0B;CACnE,IAAI,OAAO,UAA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AAM,EAAE,MAAM,UAAU;GACtD;EACF,GACA,OAAO,IAAI,UAAU,WACjB,cACE,MACA,EACE,cAAc;GACZ,OAAO,OAAO,IAAI,MAAM,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM;GACvD,GAAI,OAAO,IAAI,EAAE,YAAY,WAAW,SAAS,IAAI,CAAC;EACxD,GACF,GACA,IAAI,KACN,IACA,IAAI,KACV;CACF,CAAC,CACH;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { A11yProps, A11yState, Role, toA11yProps } from "./a11y.js";
|
|
2
2
|
import { StyleInput, StyleObject, StyleValue, flattenStyle } from "./style.js";
|
|
3
3
|
import { BaseProps, Reactive, resolveStyle, toHostProps } from "./host.js";
|
|
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, Skeleton, SkeletonProps, Switch, SwitchProps, TabItem, Tabs, TabsProps } from "./components.js";
|
|
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, useSafeAreaInsets, useWindowDimensions } from "./environment.js";
|
|
6
6
|
import { Field, FormApi, UseFormOptions, useForm } from "./form.js";
|
|
7
7
|
import { AttachableGesture, GestureView, GestureViewProps } from "./gesture.js";
|
|
8
8
|
import { AsyncState, Counter, Toggle, useAsync, useCounter, usePrevious, useReducer, useToggle } from "./hooks.js";
|
|
9
9
|
import { Theme, ThemeColors, duration, easing, fontSize, fontWeight, getTheme, lineHeight, palette, radius, space, tokens, useTheme } from "./tokens.js";
|
|
10
10
|
import { animateTo, motion } from "./motion.js";
|
|
11
|
-
import { FocusScope, FocusScopeProps, Modal, ModalProps } from "./overlay.js";
|
|
11
|
+
import { FocusScope, FocusScopeProps, Modal, ModalProps, Toast, ToastProps } from "./overlay.js";
|
|
12
12
|
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";
|
|
13
13
|
import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@mindees/core";
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@min
|
|
|
16
16
|
/** The npm package name. */
|
|
17
17
|
declare const name = "@mindees/atlas";
|
|
18
18
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
19
|
-
declare const VERSION = "0.
|
|
19
|
+
declare const VERSION = "0.12.0";
|
|
20
20
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
21
21
|
declare const maturity: Maturity;
|
|
22
22
|
/**
|
|
@@ -26,5 +26,5 @@ declare const maturity: Maturity;
|
|
|
26
26
|
*/
|
|
27
27
|
declare const info: PackageInfo;
|
|
28
28
|
//#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 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, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Stack, type StackProps, type StyleInput, type StyleObject, type StyleValue, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextInput, type TextInputProps, type TextProps, type Theme, type ThemeColors, 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, useForm, useKeyboard, usePressable, usePrevious, useReducer, useSafeAreaInsets, useTheme, useToggle, useWindowDimensions };
|
|
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 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, 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, useForm, useKeyboard, usePressable, usePrevious, useReducer, useSafeAreaInsets, useTheme, useToggle, useWindowDimensions };
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,18 @@ import { flattenStyle } from "./style.js";
|
|
|
4
4
|
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
|
-
import { Accordion, ActivityIndicator, Avatar, Badge, Card, Checkbox, Chip, Divider, KeyboardAvoidingView, ProgressBar, RadioGroup, SafeAreaView, Skeleton, Switch, Tabs } from "./components.js";
|
|
7
|
+
import { Accordion, ActivityIndicator, Avatar, Badge, Card, Checkbox, Chip, Divider, KeyboardAvoidingView, ProgressBar, RadioGroup, SafeAreaView, SegmentedControl, Skeleton, Stepper, Switch, Tabs } from "./components.js";
|
|
8
8
|
import { useForm } from "./form.js";
|
|
9
9
|
import { GestureView } from "./gesture.js";
|
|
10
10
|
import { useAsync, useCounter, usePrevious, useReducer, useToggle } from "./hooks.js";
|
|
11
11
|
import { animateTo, motion } from "./motion.js";
|
|
12
|
-
import { FocusScope, Modal } from "./overlay.js";
|
|
12
|
+
import { FocusScope, Modal, Toast } from "./overlay.js";
|
|
13
13
|
import { NotImplementedError, notImplemented } from "@mindees/core";
|
|
14
14
|
//#region src/index.ts
|
|
15
15
|
/** The npm package name. */
|
|
16
16
|
const name = "@mindees/atlas";
|
|
17
17
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
18
|
-
const VERSION = "0.
|
|
18
|
+
const VERSION = "0.12.0";
|
|
19
19
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
20
20
|
const maturity = "experimental";
|
|
21
21
|
/**
|
|
@@ -29,6 +29,6 @@ const info = Object.freeze({
|
|
|
29
29
|
maturity
|
|
30
30
|
});
|
|
31
31
|
//#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, Skeleton, Spacer, Stack, Switch, Tabs, Text, TextInput, 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, useForm, useKeyboard, usePressable, usePrevious, useReducer, useSafeAreaInsets, useTheme, useToggle, useWindowDimensions };
|
|
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, useForm, useKeyboard, usePressable, usePrevious, useReducer, useSafeAreaInsets, useTheme, useToggle, useWindowDimensions };
|
|
33
33
|
|
|
34
34
|
//# 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.12.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 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 Toggle,\n useAsync,\n useCounter,\n usePrevious,\n useReducer,\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"}
|
package/dist/overlay.d.ts
CHANGED
|
@@ -38,6 +38,28 @@ interface ModalProps extends A11yProps {
|
|
|
38
38
|
}
|
|
39
39
|
/** A portal-backed modal dialog: a dismissable scrim + a focus-scoped dialog above the tree. */
|
|
40
40
|
declare const Modal: Component<ModalProps>;
|
|
41
|
+
/** Props for {@link Toast}. */
|
|
42
|
+
interface ToastProps {
|
|
43
|
+
/** Whether the toast is shown (static or reactive). */
|
|
44
|
+
readonly visible: Reactive<boolean>;
|
|
45
|
+
/** Convenience message (string or node); or pass `children`. */
|
|
46
|
+
readonly message?: MindeesNode;
|
|
47
|
+
readonly children?: MindeesNode;
|
|
48
|
+
/** Auto-dismiss after this many ms (calls `onDismiss`). `0`/omitted → stays until hidden. */
|
|
49
|
+
readonly duration?: number;
|
|
50
|
+
readonly onDismiss?: () => void;
|
|
51
|
+
/** Anchor edge (default `bottom`). */
|
|
52
|
+
readonly position?: 'top' | 'bottom';
|
|
53
|
+
/** a11y role (default `status`; use `alert` for errors). */
|
|
54
|
+
readonly role?: Role;
|
|
55
|
+
/** Explicit overlay host target (else the backend's overlay layer). */
|
|
56
|
+
readonly mount?: unknown;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A portal-backed transient notification (Snackbar). Controlled by `visible`; optionally auto-dismisses
|
|
60
|
+
* after `duration` ms. Anchored bottom (or top) via the overlay layer — RN ships none built-in.
|
|
61
|
+
*/
|
|
62
|
+
declare const Toast: Component<ToastProps>;
|
|
41
63
|
//#endregion
|
|
42
|
-
export { FocusScope, FocusScopeProps, Modal, ModalProps };
|
|
64
|
+
export { FocusScope, FocusScopeProps, Modal, ModalProps, Toast, ToastProps };
|
|
43
65
|
//# sourceMappingURL=overlay.d.ts.map
|
package/dist/overlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","names":[],"sources":["../src/overlay.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","names":[],"sources":["../src/overlay.ts"],"mappings":";;;;;;;UAqCiB,eAAA;EAAA,SACN,QAAA,GAAW,WAAA;EAYX;EAAA,SAVA,SAAA;EAUiB;EAAA,SARjB,YAAA;EAQ2B;EAAA,SAN3B,QAAA;EAoDV;EAAA,SAlDU,IAAA,GAAO,IAAA;EAQO;EAAA,SANd,KAAA;EAmDM;EAAA,SAjDN,KAAA,GAAQ,QAAA,CAAS,UAAA;AAAA;;cAIf,UAAA,EAAY,SAAS,CAAC,eAAA;;UA6ClB,UAAA,SAAmB,SAAA;EAAA;EAAA,SAEzB,OAAA,EAAS,QAAA;EAFyB;EAAA,SAIlC,cAAA;EAAA,SACA,QAAA,GAAW,WAAA;EAHF;EAAA,SAKT,eAAA;EAFA;EAAA,SAIA,QAAA,GAAW,QAAA,CAAS,UAAA;EAFpB;EAAA,SAIA,KAAA;AAAA;;cAIE,KAAA,EAAO,SAAS,CAAC,UAAA;;UA0Db,UAAA;EA1DJ;EAAA,SA4DF,OAAA,EAAS,QAAA;;WAET,OAAA,GAAU,WAAA;EAAA,SACV,QAAA,GAAW,WAAA;EALL;EAAA,SAON,QAAA;EAAA,SACA,SAAA;EANS;EAAA,SAQT,QAAA;EALW;EAAA,SAOX,IAAA,GAAO,IAAA;EAAI;EAAA,SAEX,KAAA;AAAA;;;;;cAOE,KAAA,EAAO,SAAS,CAAC,UAAA"}
|
package/dist/overlay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { flattenStyle } from "./style.js";
|
|
2
|
-
import { Pressable, View } from "./primitives.js";
|
|
3
|
-
import { createElement, onCleanup, portal } from "@mindees/core";
|
|
2
|
+
import { Pressable, Text, View } from "./primitives.js";
|
|
3
|
+
import { createElement, effect, onCleanup, portal } from "@mindees/core";
|
|
4
4
|
//#region src/overlay.ts
|
|
5
5
|
/**
|
|
6
6
|
* Atlas overlays — `Modal` + `FocusScope`, built on core's `portal`.
|
|
@@ -82,7 +82,47 @@ const Modal = (props) => {
|
|
|
82
82
|
}, props.children)), props.mount !== void 0 ? { mount: props.mount } : void 0);
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* A portal-backed transient notification (Snackbar). Controlled by `visible`; optionally auto-dismisses
|
|
87
|
+
* after `duration` ms. Anchored bottom (or top) via the overlay layer — RN ships none built-in.
|
|
88
|
+
*/
|
|
89
|
+
const Toast = (props) => {
|
|
90
|
+
const isVisible = toAccessor(props.visible, false);
|
|
91
|
+
effect(() => {
|
|
92
|
+
if (!isVisible()) return;
|
|
93
|
+
const ms = props.duration;
|
|
94
|
+
if (ms && ms > 0 && typeof setTimeout === "function" && props.onDismiss) {
|
|
95
|
+
const id = setTimeout(() => props.onDismiss?.(), ms);
|
|
96
|
+
onCleanup(() => clearTimeout(id));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return () => {
|
|
100
|
+
if (!isVisible()) return null;
|
|
101
|
+
const atTop = props.position === "top";
|
|
102
|
+
return portal(createElement(View, { style: () => ({
|
|
103
|
+
position: "fixed",
|
|
104
|
+
left: 0,
|
|
105
|
+
right: 0,
|
|
106
|
+
[atTop ? "top" : "bottom"]: 0,
|
|
107
|
+
display: "flex",
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
padding: 16
|
|
111
|
+
}) }, createElement(View, {
|
|
112
|
+
role: props.role ?? "status",
|
|
113
|
+
style: () => ({
|
|
114
|
+
backgroundColor: "#1f2430",
|
|
115
|
+
borderRadius: 12,
|
|
116
|
+
paddingTop: 12,
|
|
117
|
+
paddingBottom: 12,
|
|
118
|
+
paddingLeft: 16,
|
|
119
|
+
paddingRight: 16,
|
|
120
|
+
maxWidth: 480
|
|
121
|
+
})
|
|
122
|
+
}, typeof props.message === "string" ? createElement(Text, { style: () => ({ color: "#ffffff" }) }, props.message) : props.children ?? props.message)), props.mount !== void 0 ? { mount: props.mount } : void 0);
|
|
123
|
+
};
|
|
124
|
+
};
|
|
85
125
|
//#endregion
|
|
86
|
-
export { FocusScope, Modal };
|
|
126
|
+
export { FocusScope, Modal, Toast };
|
|
87
127
|
|
|
88
128
|
//# sourceMappingURL=overlay.js.map
|
package/dist/overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","names":["doc"],"sources":["../src/overlay.ts"],"sourcesContent":["/**\n * Atlas overlays — `Modal` + `FocusScope`, built on core's `portal`.\n *\n * `Modal` gates a portal by a reactive `visible`: on open it relocates a scrim + a focus-scoped\n * dialog to the renderer's overlay layer (above the tree); on close the gating region re-runs,\n * firing the portal's cleanup (unmount) and the FocusScope's focus-restore. `FocusScope` captures\n * the previously-focused element, auto-focuses its container, and restores focus on unmount —\n * DOM-feature-detected, so it no-ops on native/headless (the dialog markup + a11y still serialize).\n *\n * v1 scope: web is fully interactive (scrim dismiss, Escape, focus capture/restore). Native is\n * declarative — `role=\"dialog\"` + `aria-modal` are carried to the host; a true focus trap +\n * tab-cycling and back-button handling are a host follow-up (see the portal-modal ADR). Tab\n * cycling within the scope is also deferred (needs a descendant query).\n *\n * @module\n */\n\nimport { type Component, createElement, type MindeesNode, onCleanup, portal } from '@mindees/core'\nimport type { A11yProps, Role } from './a11y'\nimport type { Reactive } from './host'\nimport { Pressable, View } from './primitives'\nimport { flattenStyle, type StyleInput } from './style'\n\nfunction toAccessor<T>(value: Reactive<T>, fallback: T): () => T {\n return typeof value === 'function'\n ? (value as () => T)\n : () => (value === undefined ? fallback : value)\n}\n\n/** Props for {@link FocusScope}. */\nexport interface FocusScopeProps {\n readonly children?: MindeesNode\n /** Focus the scope container on mount (default true). */\n readonly autoFocus?: boolean\n /** Restore focus to the previously-focused element on unmount (default true). */\n readonly restoreFocus?: boolean\n /** Called when Escape is pressed inside the scope. */\n readonly onEscape?: () => void\n /** Dialog role (default `'dialog'`). */\n readonly role?: Role\n /** Accessible name (`aria-label`). */\n readonly label?: string\n /** Extra style on the scope container. */\n readonly style?: Reactive<StyleInput>\n}\n\n/** A focus-scoped, `aria-modal` container. Captures + restores focus on web; declarative elsewhere. */\nexport const FocusScope: Component<FocusScopeProps> = (props) => {\n let restore: (() => void) | null = null\n const captureAndFocus = (host: unknown): void => {\n if (typeof document === 'undefined') return // native/headless: declarative only\n const node = host as { focus?: () => void } | null\n const doc = document as unknown as { activeElement?: { focus?: () => void } | null }\n const previous = doc.activeElement ?? null\n if (props.restoreFocus !== false && previous && typeof previous.focus === 'function') {\n restore = () => previous.focus?.()\n }\n if (props.autoFocus !== false && node && typeof node.focus === 'function') {\n // Defer: `ref` fires before the portal subtree is connected to the document, so a synchronous\n // focus() would no-op. By the microtask the subtree is mounted; skip if it closed first.\n queueMicrotask(() => {\n if ((node as { isConnected?: boolean }).isConnected) node.focus?.()\n })\n }\n }\n onCleanup(() => restore?.())\n\n const callerStyle = props.style\n const style: Reactive<StyleInput> = () =>\n flattenStyle([\n { position: 'relative' },\n typeof callerStyle === 'function' ? callerStyle() : (callerStyle ?? {}),\n ])\n\n const hostProps: Record<string, unknown> = {\n role: props.role ?? 'dialog',\n 'aria-modal': 'true',\n tabindex: -1,\n ref: captureAndFocus,\n style,\n }\n if (props.label !== undefined) hostProps['aria-label'] = props.label\n if (props.onEscape !== undefined) {\n hostProps.onKeyDown = (e: unknown) => {\n if ((e as { key?: string }).key === 'Escape') props.onEscape?.()\n }\n }\n // A RAW host `view` (not the curated View primitive) so ref/tabindex/onKeyDown/aria-modal pass through.\n return createElement('view', hostProps, props.children)\n}\n\n/** Props for {@link Modal}. */\nexport interface ModalProps extends A11yProps {\n /** Whether the modal is open (static or reactive). */\n readonly visible: Reactive<boolean>\n /** Requested close (scrim press or Escape). */\n readonly onRequestClose?: () => void\n readonly children?: MindeesNode\n /** Close when the scrim is pressed (default true). */\n readonly closeOnBackdrop?: boolean\n /** Extra style merged into the scrim. */\n readonly backdrop?: Reactive<StyleInput>\n /** Explicit overlay host target (else the backend's overlay layer). */\n readonly mount?: unknown\n}\n\n/** A portal-backed modal dialog: a dismissable scrim + a focus-scoped dialog above the tree. */\nexport const Modal: Component<ModalProps> = (props) => {\n const isVisible = toAccessor(props.visible, false)\n return () => {\n if (!isVisible()) return null\n\n const scrimStyle = (): StyleInput =>\n flattenStyle([\n {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n },\n typeof props.backdrop === 'function' ? props.backdrop() : (props.backdrop ?? {}),\n ])\n const scrim = createElement(Pressable, {\n style: scrimStyle,\n label: 'Close',\n ...(props.closeOnBackdrop !== false && props.onRequestClose\n ? { onPress: props.onRequestClose }\n : {}),\n })\n\n const dialog = createElement(\n FocusScope,\n {\n role: props.role ?? 'dialog',\n ...(props.onRequestClose ? { onEscape: props.onRequestClose } : {}),\n ...(props.label !== undefined ? { label: props.label } : {}),\n },\n props.children,\n )\n\n // A full-screen flex-center container holds the scrim (behind) + the dialog (on top, centered).\n const container = createElement(\n View,\n {\n style: () => ({\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }),\n },\n scrim,\n dial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AAiB;EACnB,GACA,OAAO,MAAM,aAAa,aAAa,MAAM,SAAS,IAAK,MAAM,YAAY,CAAC,CAChF,CAAC;EAqCH,OAAO,OAjBW,cAChB,MACA,EACE,cAAc;GACZ,UAAU;GACV,KAAK;GACL,OAAO;GACP,QAAQ;GACR,MAAM;GACN,SAAS;GACT,YAAY;GACZ,gBAAgB;EAClB,GACF,GAhCY,cAAc,WAAW;GACrC,OAAO;GACP,OAAO;GACP,GAAI,MAAM,oBAAoB,SAAS,MAAM,iBACzC,EAAE,SAAS,MAAM,eAAe,IAChC,CAAC;EACP,CA2BM,GAzBS,cACb,YACA;GACE,MAAM,MAAM,QAAQ;GACpB,GAAI,MAAM,iBAAiB,EAAE,UAAU,MAAM,eAAe,IAAI,CAAC;GACjE,GAAI,MAAM,UAAU,KAAA,IAAY,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC;EAC5D,GACA,MAAM,QAmBD,CAEe,GAAG,MAAM,UAAU,KAAA,IAAY,EAAE,OAAO,MAAM,MAAM,IAAI,KAAA,CAAS;CACzF;AACF"}
|
|
1
|
+
{"version":3,"file":"overlay.js","names":["doc"],"sources":["../src/overlay.ts"],"sourcesContent":["/**\n * Atlas overlays — `Modal` + `FocusScope`, built on core's `portal`.\n *\n * `Modal` gates a portal by a reactive `visible`: on open it relocates a scrim + a focus-scoped\n * dialog to the renderer's overlay layer (above the tree); on close the gating region re-runs,\n * firing the portal's cleanup (unmount) and the FocusScope's focus-restore. `FocusScope` captures\n * the previously-focused element, auto-focuses its container, and restores focus on unmount —\n * DOM-feature-detected, so it no-ops on native/headless (the dialog markup + a11y still serialize).\n *\n * v1 scope: web is fully interactive (scrim dismiss, Escape, focus capture/restore). Native is\n * declarative — `role=\"dialog\"` + `aria-modal` are carried to the host; a true focus trap +\n * tab-cycling and back-button handling are a host follow-up (see the portal-modal ADR). Tab\n * cycling within the scope is also deferred (needs a descendant query).\n *\n * @module\n */\n\nimport {\n type Component,\n createElement,\n effect,\n type MindeesNode,\n onCleanup,\n portal,\n} from '@mindees/core'\nimport type { A11yProps, Role } from './a11y'\nimport type { Reactive } from './host'\nimport { Pressable, Text, View } from './primitives'\nimport { flattenStyle, type StyleInput } from './style'\n\nfunction toAccessor<T>(value: Reactive<T>, fallback: T): () => T {\n return typeof value === 'function'\n ? (value as () => T)\n : () => (value === undefined ? fallback : value)\n}\n\n/** Props for {@link FocusScope}. */\nexport interface FocusScopeProps {\n readonly children?: MindeesNode\n /** Focus the scope container on mount (default true). */\n readonly autoFocus?: boolean\n /** Restore focus to the previously-focused element on unmount (default true). */\n readonly restoreFocus?: boolean\n /** Called when Escape is pressed inside the scope. */\n readonly onEscape?: () => void\n /** Dialog role (default `'dialog'`). */\n readonly role?: Role\n /** Accessible name (`aria-label`). */\n readonly label?: string\n /** Extra style on the scope container. */\n readonly style?: Reactive<StyleInput>\n}\n\n/** A focus-scoped, `aria-modal` container. Captures + restores focus on web; declarative elsewhere. */\nexport const FocusScope: Component<FocusScopeProps> = (props) => {\n let restore: (() => void) | null = null\n const captureAndFocus = (host: unknown): void => {\n if (typeof document === 'undefined') return // native/headless: declarative only\n const node = host as { focus?: () => void } | null\n const doc = document as unknown as { activeElement?: { focus?: () => void } | null }\n const previous = doc.activeElement ?? null\n if (props.restoreFocus !== false && previous && typeof previous.focus === 'function') {\n restore = () => previous.focus?.()\n }\n if (props.autoFocus !== false && node && typeof node.focus === 'function') {\n // Defer: `ref` fires before the portal subtree is connected to the document, so a synchronous\n // focus() would no-op. By the microtask the subtree is mounted; skip if it closed first.\n queueMicrotask(() => {\n if ((node as { isConnected?: boolean }).isConnected) node.focus?.()\n })\n }\n }\n onCleanup(() => restore?.())\n\n const callerStyle = props.style\n const style: Reactive<StyleInput> = () =>\n flattenStyle([\n { position: 'relative' },\n typeof callerStyle === 'function' ? callerStyle() : (callerStyle ?? {}),\n ])\n\n const hostProps: Record<string, unknown> = {\n role: props.role ?? 'dialog',\n 'aria-modal': 'true',\n tabindex: -1,\n ref: captureAndFocus,\n style,\n }\n if (props.label !== undefined) hostProps['aria-label'] = props.label\n if (props.onEscape !== undefined) {\n hostProps.onKeyDown = (e: unknown) => {\n if ((e as { key?: string }).key === 'Escape') props.onEscape?.()\n }\n }\n // A RAW host `view` (not the curated View primitive) so ref/tabindex/onKeyDown/aria-modal pass through.\n return createElement('view', hostProps, props.children)\n}\n\n/** Props for {@link Modal}. */\nexport interface ModalProps extends A11yProps {\n /** Whether the modal is open (static or reactive). */\n readonly visible: Reactive<boolean>\n /** Requested close (scrim press or Escape). */\n readonly onRequestClose?: () => void\n readonly children?: MindeesNode\n /** Close when the scrim is pressed (default true). */\n readonly closeOnBackdrop?: boolean\n /** Extra style merged into the scrim. */\n readonly backdrop?: Reactive<StyleInput>\n /** Explicit overlay host target (else the backend's overlay layer). */\n readonly mount?: unknown\n}\n\n/** A portal-backed modal dialog: a dismissable scrim + a focus-scoped dialog above the tree. */\nexport const Modal: Component<ModalProps> = (props) => {\n const isVisible = toAccessor(props.visible, false)\n return () => {\n if (!isVisible()) return null\n\n const scrimStyle = (): StyleInput =>\n flattenStyle([\n {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n backgroundColor: 'rgba(0,0,0,0.5)',\n },\n typeof props.backdrop === 'function' ? props.backdrop() : (props.backdrop ?? {}),\n ])\n const scrim = createElement(Pressable, {\n style: scrimStyle,\n label: 'Close',\n ...(props.closeOnBackdrop !== false && props.onRequestClose\n ? { onPress: props.onRequestClose }\n : {}),\n })\n\n const dialog = createElement(\n FocusScope,\n {\n role: props.role ?? 'dialog',\n ...(props.onRequestClose ? { onEscape: props.onRequestClose } : {}),\n ...(props.label !== undefined ? { label: props.label } : {}),\n },\n props.children,\n )\n\n // A full-screen flex-center container holds the scrim (behind) + the dialog (on top, centered).\n const container = createElement(\n View,\n {\n style: () => ({\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }),\n },\n scrim,\n dialog,\n )\n return portal(container, props.mount !== undefined ? { mount: props.mount } : undefined)\n }\n}\n\n/** Props for {@link Toast}. */\nexport interface ToastProps {\n /** Whether the toast is shown (static or reactive). */\n readonly visible: Reactive<boolean>\n /** Convenience message (string or node); or pass `children`. */\n readonly message?: MindeesNode\n readonly children?: MindeesNode\n /** Auto-dismiss after this many ms (calls `onDismiss`). `0`/omitted → stays until hidden. */\n readonly duration?: number\n readonly onDismiss?: () => void\n /** Anchor edge (default `bottom`). */\n readonly position?: 'top' | 'bottom'\n /** a11y role (default `status`; use `alert` for errors). */\n readonly role?: Role\n /** Explicit overlay host target (else the backend's overlay layer). */\n readonly mount?: unknown\n}\n\n/**\n * A portal-backed transient notification (Snackbar). Controlled by `visible`; optionally auto-dismisses\n * after `duration` ms. Anchored bottom (or top) via the overlay layer — RN ships none built-in.\n */\nexport const Toast: Component<ToastProps> = (props) => {\n const isVisible = toAccessor(props.visible, false)\n\n // Auto-dismiss: (re)arm a timer whenever the toast is shown; clear it on hide/unmount/re-run.\n effect(() => {\n if (!isVisible()) return\n const ms = props.duration\n if (ms && ms > 0 && typeof setTimeout === 'function' && props.onDismiss) {\n const id = setTimeout(() => props.onDismiss?.(), ms)\n onCleanup(() => clearTimeout(id))\n }\n })\n\n return () => {\n if (!isVisible()) return null\n const atTop = props.position === 'top'\n const bubble = createElement(\n View,\n {\n role: props.role ?? 'status',\n style: () => ({\n backgroundColor: '#1f2430',\n borderRadius: 12,\n paddingTop: 12,\n paddingBottom: 12,\n paddingLeft: 16,\n paddingRight: 16,\n maxWidth: 480,\n }),\n },\n typeof props.message === 'string'\n ? createElement(Text, { style: () => ({ color: '#ffffff' }) }, props.message)\n : (props.children ?? props.message),\n )\n const container = createElement(\n View,\n {\n style: () => ({\n position: 'fixed',\n left: 0,\n right: 0,\n [atTop ? 'top' : 'bottom']: 0,\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'center',\n padding: 16,\n }),\n },\n bubble,\n )\n return portal(container, props.mount !== undefined ?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AiB;IACjB,cAAc;IACd,YAAY;IACZ,eAAe;IACf,aAAa;IACb,cAAc;IACd,UAAU;GACZ;EACF,GACA,OAAO,MAAM,YAAY,WACrB,cAAc,MAAM,EAAE,cAAc,EAAE,OAAO,UAAU,GAAG,GAAG,MAAM,OAAO,IACzE,MAAM,YAAY,MAAM,OAgBxB,CAEe,GAAG,MAAM,UAAU,KAAA,IAAY,EAAE,OAAO,MAAM,MAAM,IAAI,KAAA,CAAS;CACzF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindees/atlas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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/
|
|
43
|
-
"@mindees/
|
|
42
|
+
"@mindees/core": "0.12.0",
|
|
43
|
+
"@mindees/router": "0.12.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"happy-dom": "20.9.0",
|
|
47
|
-
"@mindees/renderer": "0.
|
|
47
|
+
"@mindees/renderer": "0.12.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsdown",
|