@jztack/ui-native 0.0.0-stage → 0.1.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/README.md +128 -2
- package/dist/Alert.d.ts +20 -0
- package/dist/Alert.js +14 -0
- package/dist/AppBar.d.ts +21 -0
- package/dist/AppBar.js +16 -0
- package/dist/Avatar.d.ts +21 -0
- package/dist/Avatar.js +23 -0
- package/dist/Badge.d.ts +15 -0
- package/dist/Badge.js +27 -0
- package/dist/BottomTabBar.d.ts +26 -0
- package/dist/BottomTabBar.js +39 -0
- package/dist/Button.d.ts +21 -0
- package/dist/Button.js +63 -0
- package/dist/Card.d.ts +37 -0
- package/dist/Card.js +41 -0
- package/dist/Checkbox.d.ts +11 -0
- package/dist/Checkbox.js +11 -0
- package/dist/ConfirmActionModal.d.ts +27 -0
- package/dist/ConfirmActionModal.js +43 -0
- package/dist/DeleteButton.d.ts +20 -0
- package/dist/DeleteButton.js +41 -0
- package/dist/Dialog.d.ts +10 -0
- package/dist/Dialog.js +10 -0
- package/dist/DropdownMenu.d.ts +25 -0
- package/dist/DropdownMenu.js +57 -0
- package/dist/EmptyState.d.ts +13 -0
- package/dist/EmptyState.js +10 -0
- package/dist/ErrorBoundary.d.ts +33 -0
- package/dist/ErrorBoundary.js +37 -0
- package/dist/Field.d.ts +24 -0
- package/dist/Field.js +20 -0
- package/dist/FormFields.d.ts +37 -0
- package/dist/FormFields.js +24 -0
- package/dist/FormPanel.d.ts +20 -0
- package/dist/FormPanel.js +14 -0
- package/dist/Input.d.ts +30 -0
- package/dist/Input.js +52 -0
- package/dist/OptionList.d.ts +25 -0
- package/dist/OptionList.js +15 -0
- package/dist/PageHeader.d.ts +13 -0
- package/dist/PageHeader.js +10 -0
- package/dist/Primitives.d.ts +636 -0
- package/dist/Primitives.js +5 -0
- package/dist/Progress.d.ts +8 -0
- package/dist/Progress.js +42 -0
- package/dist/RadioGroup.d.ts +15 -0
- package/dist/RadioGroup.js +11 -0
- package/dist/ScrollOverflowContainer.d.ts +14 -0
- package/dist/ScrollOverflowContainer.js +83 -0
- package/dist/SegmentedControl.d.ts +19 -0
- package/dist/SegmentedControl.js +15 -0
- package/dist/Select.d.ts +9 -0
- package/dist/Select.js +27 -0
- package/dist/Select.web.d.ts +10 -0
- package/dist/Select.web.js +41 -0
- package/dist/SelectTypes.d.ts +17 -0
- package/dist/SelectTypes.js +1 -0
- package/dist/Separator.d.ts +6 -0
- package/dist/Separator.js +9 -0
- package/dist/Sheet.d.ts +31 -0
- package/dist/Sheet.js +43 -0
- package/dist/Skeleton.d.ts +11 -0
- package/dist/Skeleton.js +30 -0
- package/dist/StartupScreen.d.ts +9 -0
- package/dist/StartupScreen.js +9 -0
- package/dist/StateViews.d.ts +13 -0
- package/dist/StateViews.js +14 -0
- package/dist/Switch.d.ts +13 -0
- package/dist/Switch.js +42 -0
- package/dist/Table.d.ts +22 -0
- package/dist/Table.js +17 -0
- package/dist/TextField.d.ts +22 -0
- package/dist/TextField.js +116 -0
- package/dist/Toast.d.ts +34 -0
- package/dist/Toast.js +92 -0
- package/dist/ToastHost.d.ts +6 -0
- package/dist/ToastHost.js +4 -0
- package/dist/ToastHost.web.d.ts +7 -0
- package/dist/ToastHost.web.js +11 -0
- package/dist/Toggle.d.ts +16 -0
- package/dist/Toggle.js +7 -0
- package/dist/ToggleGroup.d.ts +27 -0
- package/dist/ToggleGroup.js +27 -0
- package/dist/haptics.d.ts +45 -0
- package/dist/haptics.js +96 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +46 -0
- package/dist/shadows.d.ts +28 -0
- package/dist/shadows.js +19 -0
- package/dist/theme.d.ts +23 -0
- package/dist/theme.js +19 -0
- package/dist/useDismissOnEscape.d.ts +7 -0
- package/dist/useDismissOnEscape.js +10 -0
- package/dist/useDismissOnEscape.web.d.ts +2 -0
- package/dist/useDismissOnEscape.web.js +14 -0
- package/dist/useResponsive.d.ts +28 -0
- package/dist/useResponsive.js +23 -0
- package/dist/useTextFieldCurrency.d.ts +9 -0
- package/dist/useTextFieldCurrency.js +45 -0
- package/package.json +52 -3
package/dist/Table.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@shopify/restyle';
|
|
3
|
+
import { FlatList, ScrollView } from 'react-native';
|
|
4
|
+
import { Box, Text } from './Primitives';
|
|
5
|
+
import { getShadowStyle } from './shadows';
|
|
6
|
+
/**
|
|
7
|
+
* Table (DESIGN §2.1 #20, adapted-major): the twin keeps TWJS's data-driven
|
|
8
|
+
* API — the web Table is a DOM compound and neither side adopts the other's
|
|
9
|
+
* shape. Platform counterparts under one name, recorded divergence.
|
|
10
|
+
*/
|
|
11
|
+
export function Table({ data, columns, keyExtractor, minWidth }) {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const resolvedMinWidth = minWidth ?? theme.layout.minTableWidth;
|
|
14
|
+
const renderHeader = () => (_jsx(Box, { flexDirection: "row", borderBottomWidth: 1, borderBottomColor: "border", paddingBottom: "m", marginBottom: "s", children: columns.map((col) => (_jsx(Box, { width: col.width, flex: col.flex || (col.width ? undefined : 1), px: "s", justifyContent: "center", children: _jsx(Text, { variant: "bodySecondary", fontWeight: "700", color: "foreground-secondary", style: { letterSpacing: 0.5, textTransform: 'uppercase', fontSize: 11 }, children: col.header }) }, col.key))) }));
|
|
15
|
+
const renderRow = ({ item }) => (_jsx(Box, { flexDirection: "row", borderBottomWidth: 1, borderBottomColor: "border", py: "m", alignItems: "center", children: columns.map((col) => (_jsx(Box, { width: col.width, flex: col.flex || (col.width ? undefined : 1), px: "s", children: col.render ? (col.render(item)) : col.renderCell ? (col.renderCell(item)) : (_jsx(Text, { variant: "body", children: String(item[col.key] ?? '') })) }, col.key))) }));
|
|
16
|
+
return (_jsx(ScrollView, { horizontal: true, bounces: false, contentContainerStyle: { flexGrow: 1, minWidth: '100%' }, children: _jsxs(Box, { flex: 1, minWidth: resolvedMinWidth, bg: "card", borderRadius: "md", p: "m", elevation: 1, style: getShadowStyle('table'), children: [renderHeader(), _jsx(FlatList, { data: data, keyExtractor: keyExtractor, renderItem: renderRow, scrollEnabled: false })] }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type TextInputProps } from 'react-native';
|
|
3
|
+
import { type BaseValuation } from './useTextFieldCurrency';
|
|
4
|
+
export { type BaseValuation, type ExchangeRateResolver, registerExchangeRateResolver, } from './useTextFieldCurrency';
|
|
5
|
+
export interface TextFieldProps extends TextInputProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Below-floor price warning state (native-only extra, DESIGN §3). */
|
|
10
|
+
isBelowFloor?: boolean;
|
|
11
|
+
/** Base-currency valuation converted to a display-currency readout
|
|
12
|
+
* (native-only extra: the currency mechanism, DESIGN §3). */
|
|
13
|
+
baseValuation?: BaseValuation;
|
|
14
|
+
rightElement?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* TextField (DESIGN §2.2): Field + Input in one, keeping TWJS's richer
|
|
18
|
+
* behaviour — numeric keyboard inference, the below-floor warning state,
|
|
19
|
+
* and the currency-conversion readout — re-based to canonical tokens,
|
|
20
|
+
* 48px height, and 16px control text.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TextField(props: TextFieldProps): React.ReactElement;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@shopify/restyle';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Platform, TextInput, } from 'react-native';
|
|
5
|
+
import { Box, Text } from './Primitives';
|
|
6
|
+
import { useCurrencyConversion } from './useTextFieldCurrency';
|
|
7
|
+
export { registerExchangeRateResolver, } from './useTextFieldCurrency';
|
|
8
|
+
const NUMERIC_PATTERN = /price|kyat|factor|rate|cost|qty|quantity/i;
|
|
9
|
+
const NUMERIC_KEYBOARDS = new Set(['numeric', 'decimal-pad', 'number-pad']);
|
|
10
|
+
function resolveInputMeta(p) {
|
|
11
|
+
const isNumeric = NUMERIC_KEYBOARDS.has(p.keyboardType ?? '') ||
|
|
12
|
+
[p.name, p.label, p.placeholder].some((v) => NUMERIC_PATTERN.test(v ?? ''));
|
|
13
|
+
const rawName = p.label || p.placeholder || 'text-input';
|
|
14
|
+
return {
|
|
15
|
+
isNumeric,
|
|
16
|
+
resolvedKeyboardType: isNumeric ? p.keyboardType || 'decimal-pad' : p.keyboardType,
|
|
17
|
+
resolvedName: p.name || rawName.replace(/\s+/g, '-').toLowerCase(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getInputStateStyle({ colors, spacing }, { error, isBelowFloor }, isFocused) {
|
|
21
|
+
const { none, hairline, xxs } = spacing;
|
|
22
|
+
const borderColor = error
|
|
23
|
+
? colors['danger-foreground']
|
|
24
|
+
: isBelowFloor
|
|
25
|
+
? colors.danger
|
|
26
|
+
: isFocused
|
|
27
|
+
? colors.primary
|
|
28
|
+
: colors.border;
|
|
29
|
+
if (Platform.OS === 'web') {
|
|
30
|
+
return {
|
|
31
|
+
borderColor,
|
|
32
|
+
boxShadow: isFocused ? `${none}px ${hairline}px ${xxs}px ${colors.primary}1A` : 'none',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
borderColor,
|
|
37
|
+
shadowColor: isFocused ? colors.primary : 'transparent',
|
|
38
|
+
shadowOffset: { width: none, height: hairline },
|
|
39
|
+
shadowOpacity: isFocused ? 0.1 : 0,
|
|
40
|
+
shadowRadius: xxs,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function computeInputStyle(theme, props, isFocused, isNumeric) {
|
|
44
|
+
const { colors, spacing, borderRadii } = theme;
|
|
45
|
+
const inputStyle = {
|
|
46
|
+
width: '100%',
|
|
47
|
+
minHeight: 48,
|
|
48
|
+
backgroundColor: colors.card,
|
|
49
|
+
borderRadius: borderRadii.md,
|
|
50
|
+
paddingHorizontal: spacing.m,
|
|
51
|
+
paddingRight: props.rightElement ? spacing.xl : spacing.m,
|
|
52
|
+
paddingVertical: spacing.sm,
|
|
53
|
+
// 16px on the control (DESIGN R8 — no iOS focus zoom); the line-height
|
|
54
|
+
// follows the active (language-adjusted) theme so tall Burmese glyphs
|
|
55
|
+
// in the value/placeholder are not clipped by a Latin-sized line box.
|
|
56
|
+
fontSize: 16,
|
|
57
|
+
lineHeight: theme.textVariants.body?.lineHeight,
|
|
58
|
+
borderWidth: spacing.hairline,
|
|
59
|
+
color: colors.foreground,
|
|
60
|
+
outlineWidth: spacing.none,
|
|
61
|
+
// Numeric alignment without the hard-coded monospace family TWJS used:
|
|
62
|
+
// tokens defines no RN font family (DESIGN §3).
|
|
63
|
+
fontVariant: isNumeric ? ['tabular-nums'] : undefined,
|
|
64
|
+
...getInputStateStyle(theme, props, isFocused),
|
|
65
|
+
};
|
|
66
|
+
return [inputStyle, props.style];
|
|
67
|
+
}
|
|
68
|
+
function useInputFocus({ onFocus, onBlur }) {
|
|
69
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
70
|
+
return {
|
|
71
|
+
isFocused,
|
|
72
|
+
focusHandlers: {
|
|
73
|
+
onFocus: (e) => {
|
|
74
|
+
setIsFocused(true);
|
|
75
|
+
onFocus?.(e);
|
|
76
|
+
},
|
|
77
|
+
onBlur: (e) => {
|
|
78
|
+
setIsFocused(false);
|
|
79
|
+
onBlur?.(e);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function useTextFieldInput(props, theme) {
|
|
85
|
+
const { label, error, name, isBelowFloor, baseValuation, rightElement, ...rest } = props;
|
|
86
|
+
const { isFocused, focusHandlers } = useInputFocus(rest);
|
|
87
|
+
const convertedValue = useCurrencyConversion(baseValuation);
|
|
88
|
+
const isConverted = convertedValue !== null;
|
|
89
|
+
const meta = resolveInputMeta({ ...rest, name, label });
|
|
90
|
+
return {
|
|
91
|
+
id: meta.resolvedName,
|
|
92
|
+
name: meta.resolvedName,
|
|
93
|
+
nativeID: meta.resolvedName,
|
|
94
|
+
placeholderTextColor: theme.colors['foreground-secondary'],
|
|
95
|
+
keyboardType: meta.resolvedKeyboardType,
|
|
96
|
+
...rest,
|
|
97
|
+
...focusHandlers,
|
|
98
|
+
autoCapitalize: rest.autoCapitalize ?? 'none',
|
|
99
|
+
autoCorrect: rest.autoCorrect ?? false,
|
|
100
|
+
style: computeInputStyle(theme, { error, isBelowFloor, rightElement, style: rest.style }, isFocused, meta.isNumeric || isConverted),
|
|
101
|
+
value: convertedValue ?? rest.value,
|
|
102
|
+
editable: isConverted ? false : rest.editable,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* TextField (DESIGN §2.2): Field + Input in one, keeping TWJS's richer
|
|
107
|
+
* behaviour — numeric keyboard inference, the below-floor warning state,
|
|
108
|
+
* and the currency-conversion readout — re-based to canonical tokens,
|
|
109
|
+
* 48px height, and 16px control text.
|
|
110
|
+
*/
|
|
111
|
+
export function TextField(props) {
|
|
112
|
+
const { label, error, rightElement } = props;
|
|
113
|
+
const theme = useTheme();
|
|
114
|
+
const inputProps = useTextFieldInput(props, theme);
|
|
115
|
+
return (_jsxs(Box, { my: "s", children: [label ? (_jsx(Text, { variant: "bodySecondary", fontWeight: "600", mb: "xs", color: "foreground", children: label })) : null, _jsxs(Box, { position: "relative", justifyContent: "center", width: "100%", children: [_jsx(TextInput, { ...inputProps }), rightElement ? (_jsx(Box, { position: "absolute", right: "sm", top: "none", bottom: "none", justifyContent: "center", alignItems: "center", zIndex: 1, children: rightElement })) : null] }), error ? (_jsx(Text, { accessibilityRole: "alert", accessibilityLiveRegion: "assertive", variant: "error", mt: "xs", children: error })) : null] }));
|
|
116
|
+
}
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ToastTone = 'success' | 'warning' | 'error' | 'info';
|
|
3
|
+
/** TWJS's long-standing name for the same union (minus `info`). */
|
|
4
|
+
export type ToastType = ToastTone;
|
|
5
|
+
export interface ToastOptions {
|
|
6
|
+
/** Requires `onAction` to display an action button. */
|
|
7
|
+
actionLabel?: string;
|
|
8
|
+
/** Taking the action cancels auto-dismiss. */
|
|
9
|
+
onAction?: () => void;
|
|
10
|
+
/** Auto-dismiss delay in milliseconds. Default 4000 (TWJS's value;
|
|
11
|
+
* web sonner's is 3000 — open question Q3). */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Fired only on auto-dismiss without the action being taken. */
|
|
14
|
+
onTimeout?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface ToastMessage extends ToastOptions {
|
|
17
|
+
id: string;
|
|
18
|
+
message: string;
|
|
19
|
+
type: ToastTone;
|
|
20
|
+
}
|
|
21
|
+
export interface ToastContextType {
|
|
22
|
+
showToast: (message: string, tone?: ToastTone, options?: ToastOptions) => void;
|
|
23
|
+
}
|
|
24
|
+
/** Moved from mobile-web's app config into the package (DESIGN §6.1). */
|
|
25
|
+
export declare const MAX_VISIBLE_TOASTS = 3;
|
|
26
|
+
export declare const TOAST_OVERLAY_LAYER = 2147483647;
|
|
27
|
+
export interface ToastProviderProps {
|
|
28
|
+
/** Clears fixed bottom chrome — same prop name as web's Toaster. */
|
|
29
|
+
bottomOffset?: number;
|
|
30
|
+
maxVisible?: number;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function ToastProvider({ bottomOffset, maxVisible, children, }: ToastProviderProps): React.JSX.Element;
|
|
34
|
+
export declare function useToast(): ToastContextType;
|
package/dist/Toast.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@shopify/restyle';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Platform, useWindowDimensions } from 'react-native';
|
|
5
|
+
import { Button } from './Button';
|
|
6
|
+
import { Box, Text } from './Primitives';
|
|
7
|
+
import { ToastHost } from './ToastHost';
|
|
8
|
+
/** Moved from mobile-web's app config into the package (DESIGN §6.1). */
|
|
9
|
+
export const MAX_VISIBLE_TOASTS = 3;
|
|
10
|
+
export const TOAST_OVERLAY_LAYER = 2_147_483_647;
|
|
11
|
+
const DEFAULT_TOAST_DURATION_MS = 4000;
|
|
12
|
+
const ToastContext = React.createContext(undefined);
|
|
13
|
+
function useToastTimers() {
|
|
14
|
+
const timersRef = React.useRef(new Map());
|
|
15
|
+
const clearTimer = React.useCallback((id) => {
|
|
16
|
+
const timer = timersRef.current.get(id);
|
|
17
|
+
if (timer !== undefined)
|
|
18
|
+
clearTimeout(timer);
|
|
19
|
+
timersRef.current.delete(id);
|
|
20
|
+
}, []);
|
|
21
|
+
const schedule = React.useCallback((toast, removeToast) => {
|
|
22
|
+
clearTimer(toast.id);
|
|
23
|
+
timersRef.current.set(toast.id, setTimeout(() => {
|
|
24
|
+
timersRef.current.delete(toast.id);
|
|
25
|
+
removeToast(toast.id);
|
|
26
|
+
toast.onTimeout?.();
|
|
27
|
+
}, toast.duration ?? DEFAULT_TOAST_DURATION_MS));
|
|
28
|
+
}, [clearTimer]);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
const timers = timersRef.current;
|
|
31
|
+
return () => {
|
|
32
|
+
timers.forEach((timer) => {
|
|
33
|
+
clearTimeout(timer);
|
|
34
|
+
});
|
|
35
|
+
timers.clear();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return { clearTimer, schedule };
|
|
39
|
+
}
|
|
40
|
+
function enqueueToast(active, incoming, maxVisible) {
|
|
41
|
+
const duplicate = active.find((toast) => toast.message === incoming.message && toast.type === incoming.type);
|
|
42
|
+
const toast = { ...incoming, id: duplicate?.id ?? incoming.id };
|
|
43
|
+
const next = duplicate
|
|
44
|
+
? active.map((entry) => (entry.id === toast.id ? toast : entry))
|
|
45
|
+
: [...active, toast];
|
|
46
|
+
const evicted = next.length > maxVisible ? next.shift() : undefined;
|
|
47
|
+
return { next, toast, evicted };
|
|
48
|
+
}
|
|
49
|
+
function useToastQueue(maxVisible) {
|
|
50
|
+
const [toasts, setToasts] = React.useState([]);
|
|
51
|
+
// Queue updates must be visible before React batches the next render.
|
|
52
|
+
const activeRef = React.useRef([]);
|
|
53
|
+
const nextIdRef = React.useRef(0);
|
|
54
|
+
const { clearTimer, schedule } = useToastTimers();
|
|
55
|
+
const removeToast = React.useCallback((id) => {
|
|
56
|
+
clearTimer(id);
|
|
57
|
+
activeRef.current = activeRef.current.filter((toast) => toast.id !== id);
|
|
58
|
+
setToasts(activeRef.current);
|
|
59
|
+
}, [clearTimer]);
|
|
60
|
+
const showToast = React.useCallback((message, type = 'success', options = {}) => {
|
|
61
|
+
const queued = enqueueToast(activeRef.current, { ...options, id: String(nextIdRef.current++), message, type }, maxVisible);
|
|
62
|
+
if (queued.evicted)
|
|
63
|
+
clearTimer(queued.evicted.id);
|
|
64
|
+
activeRef.current = queued.next;
|
|
65
|
+
setToasts(queued.next);
|
|
66
|
+
schedule(queued.toast, removeToast);
|
|
67
|
+
}, [clearTimer, removeToast, schedule, maxVisible]);
|
|
68
|
+
return { toasts, showToast, removeToast };
|
|
69
|
+
}
|
|
70
|
+
function ToastItem({ toast, removeToast, }) {
|
|
71
|
+
// The `error` tone maps onto the contract's danger triple.
|
|
72
|
+
const slot = toast.type === 'error' ? 'danger' : toast.type;
|
|
73
|
+
const bg = `${slot}-bg`;
|
|
74
|
+
const fg = `${slot}-foreground`;
|
|
75
|
+
return (_jsxs(Box, { mb: "s", borderRadius: "lg", bg: bg, flexDirection: "row", alignItems: "center", children: [_jsx(Box, { flex: 1, children: _jsx(Button, { variant: "ghost", accessibilityLiveRegion: "polite", onPress: () => removeToast(toast.id), children: _jsx(Text, { variant: "body", testID: "toast-message", flexShrink: 1, color: fg, children: toast.message }) }) }), toast.actionLabel && toast.onAction ? (_jsx(Button, { size: "sm", variant: "ghost", onPress: () => {
|
|
76
|
+
removeToast(toast.id);
|
|
77
|
+
toast.onAction?.();
|
|
78
|
+
}, children: toast.actionLabel })) : null] }));
|
|
79
|
+
}
|
|
80
|
+
export function ToastProvider({ bottomOffset, maxVisible = MAX_VISIBLE_TOASTS, children, }) {
|
|
81
|
+
const { toasts, showToast, removeToast } = useToastQueue(maxVisible);
|
|
82
|
+
const { width } = useWindowDimensions();
|
|
83
|
+
const theme = useTheme();
|
|
84
|
+
return (_jsxs(ToastContext.Provider, { value: { showToast }, children: [children, _jsx(ToastHost, { visible: toasts.length > 0, children: _jsx(Box, { position: "absolute", bottom: bottomOffset ??
|
|
85
|
+
(width >= theme.breakpoints.tablet ? theme.spacing.l : theme.spacing.xl * 2), right: Platform.OS === 'web' ? theme.spacing.l : theme.spacing.m, left: Platform.OS === 'web' ? undefined : theme.spacing.m, minWidth: theme.spacing.xl * 7, maxWidth: theme.spacing.xl * 10, zIndex: TOAST_OVERLAY_LAYER, children: toasts.map((toast) => (_jsx(ToastItem, { toast: toast, removeToast: removeToast }, toast.id))) }) })] }));
|
|
86
|
+
}
|
|
87
|
+
export function useToast() {
|
|
88
|
+
const context = React.useContext(ToastContext);
|
|
89
|
+
if (!context)
|
|
90
|
+
throw new Error('useToast must be used within a ToastProvider');
|
|
91
|
+
return context;
|
|
92
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Web resolution: toasts portal to document.body (mobile-web's split,
|
|
3
|
+
* kept inside the package per DESIGN §7.2). */
|
|
4
|
+
export declare function ToastHost({ visible, children }: {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
/** Web resolution: toasts portal to document.body (mobile-web's split,
|
|
4
|
+
* kept inside the package per DESIGN §7.2). */
|
|
5
|
+
export function ToastHost({ visible, children }) {
|
|
6
|
+
if (!visible)
|
|
7
|
+
return null;
|
|
8
|
+
if (typeof document === 'undefined')
|
|
9
|
+
return _jsx(_Fragment, { children: children });
|
|
10
|
+
return createPortal(children, document.body);
|
|
11
|
+
}
|
package/dist/Toggle.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
export type ToggleVariant = 'default' | 'outline';
|
|
3
|
+
export type ToggleSize = 'default' | 'sm';
|
|
4
|
+
export interface ToggleProps {
|
|
5
|
+
pressed: boolean;
|
|
6
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
7
|
+
variant?: ToggleVariant;
|
|
8
|
+
/** `sm` is the dense-only escape hatch, re-based like Button. */
|
|
9
|
+
size?: ToggleSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
children: string;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
testID?: string;
|
|
14
|
+
}
|
|
15
|
+
/** `pressed` / `onPressedChange` (Radix names) over Pressable (DESIGN §2.1 #22). */
|
|
16
|
+
export declare function Toggle({ pressed, onPressedChange, variant, size, disabled, children, style, testID, }: ToggleProps): import("react").JSX.Element;
|
package/dist/Toggle.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable } from 'react-native';
|
|
3
|
+
import { Box, Text } from './Primitives';
|
|
4
|
+
/** `pressed` / `onPressedChange` (Radix names) over Pressable (DESIGN §2.1 #22). */
|
|
5
|
+
export function Toggle({ pressed, onPressedChange, variant = 'default', size = 'default', disabled, children, style, testID, }) {
|
|
6
|
+
return (_jsx(Pressable, { onPress: () => onPressedChange?.(!pressed), disabled: disabled, accessibilityRole: "button", accessibilityState: { selected: pressed, disabled: !!disabled }, testID: testID, style: style, children: _jsx(Box, { minHeight: size === 'sm' ? 36 : 48, px: "m", flexDirection: "row", alignItems: "center", justifyContent: "center", borderRadius: "lg", borderWidth: variant === 'outline' ? 1 : 0, borderColor: "border", bg: pressed ? 'muted' : 'transparent', opacity: disabled ? 0.5 : 1, children: _jsx(Text, { variant: size === 'sm' ? 'bodySecondary' : 'button', color: pressed ? 'foreground' : 'foreground-secondary', children: children }) }) }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ToggleGroupOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
interface ToggleGroupBaseProps {
|
|
6
|
+
options: ToggleGroupOption[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
testID?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ToggleGroupSingleProps extends ToggleGroupBaseProps {
|
|
11
|
+
type: 'single';
|
|
12
|
+
value: string | null;
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface ToggleGroupMultipleProps extends ToggleGroupBaseProps {
|
|
16
|
+
type: 'multiple';
|
|
17
|
+
value: string[];
|
|
18
|
+
onValueChange?: (value: string[]) => void;
|
|
19
|
+
}
|
|
20
|
+
export type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
|
|
21
|
+
/**
|
|
22
|
+
* Options-array ToggleGroup (DESIGN §2.1 #23). TWJS's ChipGroup is absorbed
|
|
23
|
+
* here: single-select pill chips are `type="single"` with this API, and the
|
|
24
|
+
* ChipGroup name is retired (DESIGN §3).
|
|
25
|
+
*/
|
|
26
|
+
export declare function ToggleGroup(props: ToggleGroupProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable } from 'react-native';
|
|
3
|
+
import { Box, Text } from './Primitives';
|
|
4
|
+
/**
|
|
5
|
+
* Options-array ToggleGroup (DESIGN §2.1 #23). TWJS's ChipGroup is absorbed
|
|
6
|
+
* here: single-select pill chips are `type="single"` with this API, and the
|
|
7
|
+
* ChipGroup name is retired (DESIGN §3).
|
|
8
|
+
*/
|
|
9
|
+
export function ToggleGroup(props) {
|
|
10
|
+
const { options, disabled, testID } = props;
|
|
11
|
+
const selectedValues = props.type === 'single' ? (props.value ? [props.value] : []) : props.value;
|
|
12
|
+
const handlePress = (value) => {
|
|
13
|
+
if (props.type === 'single') {
|
|
14
|
+
props.onValueChange?.(value);
|
|
15
|
+
}
|
|
16
|
+
else if (props.onValueChange) {
|
|
17
|
+
const next = props.value.includes(value)
|
|
18
|
+
? props.value.filter((v) => v !== value)
|
|
19
|
+
: [...props.value, value];
|
|
20
|
+
props.onValueChange(next);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(Box, { flexDirection: "row", flexWrap: "wrap", testID: testID, children: options.map((option) => {
|
|
24
|
+
const isSelected = selectedValues.includes(option.value);
|
|
25
|
+
return (_jsx(Pressable, { onPress: () => handlePress(option.value), disabled: disabled, accessibilityRole: "button", accessibilityState: { selected: isSelected, disabled: !!disabled }, testID: testID ? `${testID}-${option.value}` : undefined, children: _jsx(Box, { px: "m", py: "xs", mr: "s", mb: "s", minHeight: 40, justifyContent: "center", borderRadius: "full", borderWidth: 1, borderColor: isSelected ? 'primary' : 'border', bg: isSelected ? 'primary' : 'card', opacity: disabled ? 0.5 : 1, children: _jsx(Text, { variant: "bodySecondary", fontWeight: "600", color: isSelected ? 'primary-foreground' : 'foreground', children: option.label }) }) }, option.value));
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Haptics engine — the native counterpart of @jztack/ui's engine, behind
|
|
3
|
+
* the identical configuration surface (DESIGN.md §7.1): same pattern union,
|
|
4
|
+
* same default duration table, same `configureHaptics` / `triggerHaptic`
|
|
5
|
+
* semantics. Default state is DISABLED: nothing vibrates until an app calls
|
|
6
|
+
* `configureHaptics({ enabled: true | (() => boolean) })`.
|
|
7
|
+
*
|
|
8
|
+
* ENGINE: `expo-haptics` (peer dependency — adopted by Justin's decision,
|
|
9
|
+
* Dec 4, 2026; see docs/decisions.md and DESIGN.md §7.1/Q2). Patterns map
|
|
10
|
+
* by NAME to its semantic calls:
|
|
11
|
+
*
|
|
12
|
+
* selection → selectionAsync()
|
|
13
|
+
* light → impactAsync(ImpactFeedbackStyle.Light)
|
|
14
|
+
* medium → impactAsync(ImpactFeedbackStyle.Medium)
|
|
15
|
+
* heavy → impactAsync(ImpactFeedbackStyle.Heavy)
|
|
16
|
+
* success → notificationAsync(NotificationFeedbackType.Success)
|
|
17
|
+
* warning → notificationAsync(NotificationFeedbackType.Warning)
|
|
18
|
+
* error → notificationAsync(NotificationFeedbackType.Error)
|
|
19
|
+
*
|
|
20
|
+
* The shared duration table below remains the web engine's expression of
|
|
21
|
+
* each pattern — and the fallback expression here: a pattern an app
|
|
22
|
+
* overrode via `patterns` with a raw duration/sequence cannot be expressed
|
|
23
|
+
* in expo-haptics' semantic API, so overridden patterns are honored
|
|
24
|
+
* through RN `Vibration` with the resolved value (see triggerHaptic).
|
|
25
|
+
* That is the engine's only Vibration path.
|
|
26
|
+
*/
|
|
27
|
+
export type HapticPattern = 'selection' | 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';
|
|
28
|
+
export declare const DEFAULT_HAPTIC_PATTERNS: Record<HapticPattern, number | number[]>;
|
|
29
|
+
export declare const DEFAULT_BUTTON_PATTERN: HapticPattern;
|
|
30
|
+
/** Button variant → pattern, mirroring @jztack/ui's table. */
|
|
31
|
+
export declare const BUTTON_VARIANT_PATTERNS: Record<string, HapticPattern>;
|
|
32
|
+
export declare const HAPTIC_THROTTLE_MS = 40;
|
|
33
|
+
export interface HapticsOptions {
|
|
34
|
+
/** `true`, `false`, or a function the engine consults on every trigger —
|
|
35
|
+
* apps pass their own preference store getter here. */
|
|
36
|
+
enabled: boolean | (() => boolean);
|
|
37
|
+
/** Per-pattern overrides, merged over DEFAULT_HAPTIC_PATTERNS. */
|
|
38
|
+
patterns?: Partial<Record<HapticPattern, number | number[]>>;
|
|
39
|
+
}
|
|
40
|
+
export declare function configureHaptics(options: HapticsOptions): void;
|
|
41
|
+
export declare function isHapticsEnabled(): boolean;
|
|
42
|
+
export declare function resolveHapticPattern(pattern?: HapticPattern): number | number[];
|
|
43
|
+
export declare function triggerHaptic(pattern?: HapticPattern): boolean;
|
|
44
|
+
/** Test-only: reset the throttle clock and configuration between specs. */
|
|
45
|
+
export declare function resetHapticsForTesting(): void;
|
package/dist/haptics.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as Haptics from 'expo-haptics';
|
|
2
|
+
import { Vibration } from 'react-native';
|
|
3
|
+
export const DEFAULT_HAPTIC_PATTERNS = {
|
|
4
|
+
selection: 8,
|
|
5
|
+
light: 10,
|
|
6
|
+
medium: 20,
|
|
7
|
+
heavy: 35,
|
|
8
|
+
success: [12, 40, 12],
|
|
9
|
+
warning: [20, 50, 20],
|
|
10
|
+
error: [30, 50, 30],
|
|
11
|
+
};
|
|
12
|
+
export const DEFAULT_BUTTON_PATTERN = 'light';
|
|
13
|
+
/** Button variant → pattern, mirroring @jztack/ui's table. */
|
|
14
|
+
export const BUTTON_VARIANT_PATTERNS = {
|
|
15
|
+
default: 'light',
|
|
16
|
+
destructive: 'heavy',
|
|
17
|
+
outline: 'light',
|
|
18
|
+
secondary: 'light',
|
|
19
|
+
ghost: 'selection',
|
|
20
|
+
link: 'selection',
|
|
21
|
+
tab: 'selection',
|
|
22
|
+
toggle: 'selection',
|
|
23
|
+
};
|
|
24
|
+
export const HAPTIC_THROTTLE_MS = 40;
|
|
25
|
+
let configuredEnabled = false;
|
|
26
|
+
let configuredPatterns = {};
|
|
27
|
+
let lastHapticTimestamp = 0;
|
|
28
|
+
export function configureHaptics(options) {
|
|
29
|
+
configuredEnabled = options.enabled;
|
|
30
|
+
configuredPatterns = options.patterns ?? {};
|
|
31
|
+
}
|
|
32
|
+
export function isHapticsEnabled() {
|
|
33
|
+
return typeof configuredEnabled === 'function' ? configuredEnabled() : configuredEnabled;
|
|
34
|
+
}
|
|
35
|
+
export function resolveHapticPattern(pattern = DEFAULT_BUTTON_PATTERN) {
|
|
36
|
+
const value = configuredPatterns[pattern] ?? DEFAULT_HAPTIC_PATTERNS[pattern];
|
|
37
|
+
return Array.isArray(value) ? [...value] : value;
|
|
38
|
+
}
|
|
39
|
+
/** Pattern → expo-haptics call, by name (see the module comment's table). */
|
|
40
|
+
function fireExpoHaptic(pattern) {
|
|
41
|
+
switch (pattern) {
|
|
42
|
+
case 'selection':
|
|
43
|
+
return Haptics.selectionAsync();
|
|
44
|
+
case 'light':
|
|
45
|
+
return Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
46
|
+
case 'medium':
|
|
47
|
+
return Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
|
48
|
+
case 'heavy':
|
|
49
|
+
return Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
|
|
50
|
+
case 'success':
|
|
51
|
+
return Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
|
52
|
+
case 'warning':
|
|
53
|
+
return Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning);
|
|
54
|
+
case 'error':
|
|
55
|
+
return Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function triggerHaptic(pattern = DEFAULT_BUTTON_PATTERN) {
|
|
59
|
+
if (!isHapticsEnabled()) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const now = Date.now();
|
|
63
|
+
if (now - lastHapticTimestamp < HAPTIC_THROTTLE_MS) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
lastHapticTimestamp = now;
|
|
67
|
+
// Overridden patterns carry a raw duration/sequence the semantic
|
|
68
|
+
// expo-haptics API cannot express — honor them through Vibration with
|
|
69
|
+
// the resolved value, exactly as the shared override semantics promise.
|
|
70
|
+
if (configuredPatterns[pattern] !== undefined) {
|
|
71
|
+
try {
|
|
72
|
+
Vibration.vibrate(resolveHapticPattern(pattern));
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
// expo-haptics is async while triggerHaptic is sync (the shared API):
|
|
81
|
+
// dispatch, then swallow any rejection — an unavailable backend (no
|
|
82
|
+
// haptics hardware, a platform without support) must never throw or
|
|
83
|
+
// reject into app code.
|
|
84
|
+
void Promise.resolve(fireExpoHaptic(pattern)).catch(() => undefined);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Test-only: reset the throttle clock and configuration between specs. */
|
|
92
|
+
export function resetHapticsForTesting() {
|
|
93
|
+
lastHapticTimestamp = 0;
|
|
94
|
+
configuredEnabled = false;
|
|
95
|
+
configuredPatterns = {};
|
|
96
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { Alert, type AlertProps, type AlertTone } from './Alert';
|
|
2
|
+
export { APP_BAR_LAYER, AppBar, type AppBarProps, MENU_BACKDROP_LAYER } from './AppBar';
|
|
3
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps } from './Avatar';
|
|
4
|
+
export { Badge, type BadgeAppearance, type BadgeProps, type BadgeTone } from './Badge';
|
|
5
|
+
export { BottomTabBar, type BottomTabBarProps, type ShellTabItem } from './BottomTabBar';
|
|
6
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './Button';
|
|
7
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, type CardSize, CardTitle, type CardVariant, } from './Card';
|
|
8
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
9
|
+
export { ConfirmActionModal, type ConfirmActionModalProps } from './ConfirmActionModal';
|
|
10
|
+
export { DeleteButton, type DeleteButtonProps } from './DeleteButton';
|
|
11
|
+
export { Dialog, type DialogProps } from './Dialog';
|
|
12
|
+
export { DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, } from './DropdownMenu';
|
|
13
|
+
export { EmptyState, type EmptyStateProps } from './EmptyState';
|
|
14
|
+
export { ErrorBoundary, type ErrorBoundaryProps } from './ErrorBoundary';
|
|
15
|
+
export { Field, type FieldProps, FormError, type FormErrorProps } from './Field';
|
|
16
|
+
export { CheckboxField, type CheckboxFieldProps, InputField, type InputFieldProps, SelectField, type SelectFieldProps, TextAreaField, type TextAreaFieldProps, } from './FormFields';
|
|
17
|
+
export { FormActions, type FormActionsProps, FormPanel, type FormPanelProps } from './FormPanel';
|
|
18
|
+
export { BUTTON_VARIANT_PATTERNS, configureHaptics, DEFAULT_HAPTIC_PATTERNS, type HapticPattern, type HapticsOptions, isHapticsEnabled, resolveHapticPattern, triggerHaptic, } from './haptics';
|
|
19
|
+
export { Input, type InputProps, Label, type LabelProps, Textarea, type TextareaProps, } from './Input';
|
|
20
|
+
export { PageHeader, type PageHeaderProps, SectionHeading } from './PageHeader';
|
|
21
|
+
export { Box, Text, ThemedTextInput } from './Primitives';
|
|
22
|
+
export { Progress, type ProgressProps } from './Progress';
|
|
23
|
+
export { RadioGroup, type RadioGroupProps, type RadioOption } from './RadioGroup';
|
|
24
|
+
export { getGradientFadeStyle, ScrollOverflowContainer, type ScrollOverflowContainerProps, } from './ScrollOverflowContainer';
|
|
25
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentOption, } from './SegmentedControl';
|
|
26
|
+
export { Select, type SelectOption, type SelectProps } from './Select';
|
|
27
|
+
export { Separator, type SeparatorProps } from './Separator';
|
|
28
|
+
export { Sheet, type SheetProps } from './Sheet';
|
|
29
|
+
export { Skeleton, SkeletonCard, type SkeletonProps, type SkeletonRadius, SkeletonRow, } from './Skeleton';
|
|
30
|
+
export { StartupScreen, type StartupScreenProps } from './StartupScreen';
|
|
31
|
+
export { ErrorState, type ErrorStateProps, LoadingRows } from './StateViews';
|
|
32
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
33
|
+
export { getShadowStyle, type ShadowLevel, type ShadowSpec, shadows, } from './shadows';
|
|
34
|
+
export { type ColumnDef, Table, type TableProps } from './Table';
|
|
35
|
+
export { type BaseValuation, type ExchangeRateResolver, registerExchangeRateResolver, TextField, type TextFieldProps, } from './TextField';
|
|
36
|
+
export { MAX_VISIBLE_TOASTS, TOAST_OVERLAY_LAYER, type ToastContextType, type ToastMessage, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, type ToastType, useToast, } from './Toast';
|
|
37
|
+
export { Toggle, type ToggleProps, type ToggleSize, type ToggleVariant } from './Toggle';
|
|
38
|
+
export { ToggleGroup, type ToggleGroupMultipleProps, type ToggleGroupOption, type ToggleGroupProps, type ToggleGroupSingleProps, } from './ToggleGroup';
|
|
39
|
+
export { darkTheme, getThemeForLocale, type Theme, theme } from './theme';
|
|
40
|
+
export { APP_MAX_WIDTH, BREAKPOINTS, type ResponsiveInfo, useResponsive, } from './useResponsive';
|
|
41
|
+
export { useCurrencyConversion } from './useTextFieldCurrency';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// @jztack/ui-native — the TWJS twin of @jztack/ui.
|
|
2
|
+
// Same component names, variants, and prop specs wherever the platform
|
|
3
|
+
// allows (DESIGN.md), implemented on @shopify/restyle, consuming
|
|
4
|
+
// @jztack/tokens' restyle emitter. Internal substrates (OptionList,
|
|
5
|
+
// ToastHost, SheetBase) are deliberately not exported.
|
|
6
|
+
export { Alert } from './Alert';
|
|
7
|
+
export { APP_BAR_LAYER, AppBar, MENU_BACKDROP_LAYER } from './AppBar';
|
|
8
|
+
export { Avatar, AvatarGroup } from './Avatar';
|
|
9
|
+
export { Badge } from './Badge';
|
|
10
|
+
export { BottomTabBar } from './BottomTabBar';
|
|
11
|
+
export { Button } from './Button';
|
|
12
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from './Card';
|
|
13
|
+
export { Checkbox } from './Checkbox';
|
|
14
|
+
export { ConfirmActionModal } from './ConfirmActionModal';
|
|
15
|
+
export { DeleteButton } from './DeleteButton';
|
|
16
|
+
export { Dialog } from './Dialog';
|
|
17
|
+
export { DropdownMenu, } from './DropdownMenu';
|
|
18
|
+
export { EmptyState } from './EmptyState';
|
|
19
|
+
export { ErrorBoundary } from './ErrorBoundary';
|
|
20
|
+
export { Field, FormError } from './Field';
|
|
21
|
+
export { CheckboxField, InputField, SelectField, TextAreaField, } from './FormFields';
|
|
22
|
+
export { FormActions, FormPanel } from './FormPanel';
|
|
23
|
+
export { BUTTON_VARIANT_PATTERNS, configureHaptics, DEFAULT_HAPTIC_PATTERNS, isHapticsEnabled, resolveHapticPattern, triggerHaptic, } from './haptics';
|
|
24
|
+
export { Input, Label, Textarea, } from './Input';
|
|
25
|
+
export { PageHeader, SectionHeading } from './PageHeader';
|
|
26
|
+
export { Box, Text, ThemedTextInput } from './Primitives';
|
|
27
|
+
export { Progress } from './Progress';
|
|
28
|
+
export { RadioGroup } from './RadioGroup';
|
|
29
|
+
export { getGradientFadeStyle, ScrollOverflowContainer, } from './ScrollOverflowContainer';
|
|
30
|
+
export { SegmentedControl, } from './SegmentedControl';
|
|
31
|
+
export { Select } from './Select';
|
|
32
|
+
export { Separator } from './Separator';
|
|
33
|
+
export { Sheet } from './Sheet';
|
|
34
|
+
export { Skeleton, SkeletonCard, SkeletonRow, } from './Skeleton';
|
|
35
|
+
export { StartupScreen } from './StartupScreen';
|
|
36
|
+
export { ErrorState, LoadingRows } from './StateViews';
|
|
37
|
+
export { Switch } from './Switch';
|
|
38
|
+
export { getShadowStyle, shadows, } from './shadows';
|
|
39
|
+
export { Table } from './Table';
|
|
40
|
+
export { registerExchangeRateResolver, TextField, } from './TextField';
|
|
41
|
+
export { MAX_VISIBLE_TOASTS, TOAST_OVERLAY_LAYER, ToastProvider, useToast, } from './Toast';
|
|
42
|
+
export { Toggle } from './Toggle';
|
|
43
|
+
export { ToggleGroup, } from './ToggleGroup';
|
|
44
|
+
export { darkTheme, getThemeForLocale, theme } from './theme';
|
|
45
|
+
export { APP_MAX_WIDTH, BREAKPOINTS, useResponsive, } from './useResponsive';
|
|
46
|
+
export { useCurrencyConversion } from './useTextFieldCurrency';
|