@ankhorage/surface 4.2.1 → 4.4.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/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/context.js +1 -1
- package/dist/components/tabs/context.js.map +1 -1
- package/dist/context/FontContext.d.ts.map +1 -1
- package/dist/context/FontContext.js +3 -3
- package/dist/context/FontContext.js.map +1 -1
- package/dist/context/TranslationContext.d.ts.map +1 -1
- package/dist/context/TranslationContext.js +3 -4
- package/dist/context/TranslationContext.js.map +1 -1
- package/dist/core/responsive/ResponsiveProvider.d.ts.map +1 -1
- package/dist/core/responsive/ResponsiveProvider.js +3 -3
- package/dist/core/responsive/ResponsiveProvider.js.map +1 -1
- package/dist/examples/DocsExamples.js +1 -1
- package/dist/examples/DocsExamples.js.map +1 -1
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js +46 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js +16 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +28 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js +17 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js.map +1 -0
- package/dist/features/accordion/public.d.ts +6 -0
- package/dist/features/accordion/public.d.ts.map +1 -0
- package/dist/features/accordion/public.js +5 -0
- package/dist/features/accordion/public.js.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts +11 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js +13 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js.map +1 -0
- package/dist/features/bottom-sheet/BottomSheetProvider.js +2 -2
- package/dist/features/bottom-sheet/BottomSheetProvider.js.map +1 -1
- package/dist/features/bottom-sheet/useBottomSheet.js +1 -1
- package/dist/features/bottom-sheet/useBottomSheet.js.map +1 -1
- package/dist/features/popover/adapters/inbound/Popover.d.ts +5 -0
- package/dist/features/popover/adapters/inbound/Popover.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/Popover.js +31 -0
- package/dist/features/popover/adapters/inbound/Popover.js.map +1 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts +17 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.js +34 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.js.map +1 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts +21 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.js +33 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.js.map +1 -0
- package/dist/features/popover/public.d.ts +3 -0
- package/dist/features/popover/public.d.ts.map +1 -0
- package/dist/features/popover/public.js +2 -0
- package/dist/features/popover/public.js.map +1 -0
- package/dist/features/popover/utils/resolvePopoverPosition.d.ts +25 -0
- package/dist/features/popover/utils/resolvePopoverPosition.d.ts.map +1 -0
- package/dist/features/popover/utils/resolvePopoverPosition.js +23 -0
- package/dist/features/popover/utils/resolvePopoverPosition.js.map +1 -0
- package/dist/{components/toast → features/toast/adapters/inbound}/Toast.d.ts +2 -1
- package/dist/features/toast/adapters/inbound/Toast.d.ts.map +1 -0
- package/dist/{components/toast → features/toast/adapters/inbound}/Toast.js +37 -32
- package/dist/features/toast/adapters/inbound/Toast.js.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts +5 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js +29 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js.map +1 -0
- package/dist/features/toast/adapters/inbound/useToast.d.ts +4 -0
- package/dist/features/toast/adapters/inbound/useToast.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/useToast.js +11 -0
- package/dist/features/toast/adapters/inbound/useToast.js.map +1 -0
- package/dist/features/toast/composition/ToastContext.d.ts +4 -0
- package/dist/features/toast/composition/ToastContext.d.ts.map +1 -0
- package/dist/features/toast/composition/ToastContext.js +4 -0
- package/dist/features/toast/composition/ToastContext.js.map +1 -0
- package/dist/features/toast/composition/useToastRuntime.d.ts +11 -0
- package/dist/features/toast/composition/useToastRuntime.d.ts.map +1 -0
- package/dist/features/toast/composition/useToastRuntime.js +50 -0
- package/dist/features/toast/composition/useToastRuntime.js.map +1 -0
- package/dist/features/toast/public.d.ts +5 -0
- package/dist/features/toast/public.d.ts.map +1 -0
- package/dist/features/toast/public.js +4 -0
- package/dist/features/toast/public.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/overlay/OverlayProvider.d.ts +1 -0
- package/dist/internal/overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/internal/overlay/OverlayProvider.js +9 -7
- package/dist/internal/overlay/OverlayProvider.js.map +1 -1
- package/dist/internal/overlay/useOverlayStack.js +1 -1
- package/dist/internal/overlay/useOverlayStack.js.map +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.d.ts +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.js +1 -0
- package/dist/internal/resolvers/resolveOverlayZIndex.js.map +1 -1
- package/dist/layout/AppBar.js +1 -1
- package/dist/layout/AppBar.js.map +1 -1
- package/dist/theme/ThemeContext.d.ts.map +1 -1
- package/dist/theme/ThemeContext.js +4 -5
- package/dist/theme/ThemeContext.js.map +1 -1
- package/dist/types/accordion.d.ts +54 -0
- package/dist/types/accordion.d.ts.map +1 -0
- package/dist/types/accordion.js +2 -0
- package/dist/types/accordion.js.map +1 -0
- package/dist/types/popover.d.ts +21 -0
- package/dist/types/popover.d.ts.map +1 -0
- package/dist/types/popover.js +2 -0
- package/dist/types/popover.js.map +1 -0
- package/dist/{components/toast/types.d.ts → types/toast.d.ts} +11 -3
- package/dist/types/toast.d.ts.map +1 -0
- package/dist/types/toast.js +2 -0
- package/dist/types/toast.js.map +1 -0
- package/package.json +1 -1
- package/src/components/tabs/Tabs.tsx +2 -2
- package/src/components/tabs/context.tsx +1 -1
- package/src/context/FontContext.tsx +3 -3
- package/src/context/TranslationContext.tsx +3 -4
- package/src/core/responsive/ResponsiveProvider.tsx +3 -3
- package/src/examples/DocsExamples.tsx +1 -1
- package/src/features/accordion/adapters/inbound/Accordion.tsx +83 -0
- package/src/features/accordion/adapters/inbound/AccordionContent.tsx +30 -0
- package/src/features/accordion/adapters/inbound/AccordionContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +42 -0
- package/src/features/accordion/adapters/inbound/AccordionItemContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionTrigger.tsx +34 -0
- package/src/features/accordion/public.ts +13 -0
- package/src/features/accordion/utils/resolveAccordionToggle.test.ts +57 -0
- package/src/features/accordion/utils/resolveAccordionToggle.ts +28 -0
- package/src/features/bottom-sheet/BottomSheetProvider.tsx +2 -2
- package/src/features/bottom-sheet/useBottomSheet.ts +1 -1
- package/src/features/popover/adapters/inbound/Popover.tsx +49 -0
- package/src/features/popover/adapters/inbound/PopoverOverlay.tsx +72 -0
- package/src/features/popover/adapters/inbound/usePopoverLayout.ts +51 -0
- package/src/features/popover/public.ts +2 -0
- package/src/features/popover/utils/resolvePopoverPosition.test.ts +31 -0
- package/src/features/popover/utils/resolvePopoverPosition.ts +40 -0
- package/src/{components/toast → features/toast/adapters/inbound}/Toast.tsx +58 -54
- package/src/features/toast/adapters/inbound/ToastProvider.tsx +47 -0
- package/src/features/toast/adapters/inbound/useToast.test.tsx +18 -0
- package/src/features/toast/adapters/inbound/useToast.ts +15 -0
- package/src/features/toast/composition/ToastContext.ts +6 -0
- package/src/features/toast/composition/useToastRuntime.ts +76 -0
- package/src/features/toast/public.ts +10 -0
- package/src/index.test.ts +3 -1
- package/src/index.ts +29 -2
- package/src/internal/overlay/OverlayProvider.tsx +10 -8
- package/src/internal/overlay/useOverlayStack.ts +1 -1
- package/src/internal/resolvers/resolveOverlayZIndex.test.ts +2 -1
- package/src/internal/resolvers/resolveOverlayZIndex.ts +2 -1
- package/src/layout/AppBar.tsx +1 -1
- package/src/theme/ThemeContext.tsx +4 -5
- package/src/types/accordion.ts +69 -0
- package/src/types/popover.ts +25 -0
- package/src/{components/toast/types.ts → types/toast.ts} +12 -2
- package/dist/components/toast/Toast.d.ts.map +0 -1
- package/dist/components/toast/Toast.js.map +0 -1
- package/dist/components/toast/ToastProvider.d.ts +0 -13
- package/dist/components/toast/ToastProvider.d.ts.map +0 -1
- package/dist/components/toast/ToastProvider.js +0 -70
- package/dist/components/toast/ToastProvider.js.map +0 -1
- package/dist/components/toast/index.d.ts +0 -4
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js +0 -3
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toast/types.d.ts.map +0 -1
- package/dist/components/toast/types.js +0 -2
- package/dist/components/toast/types.js.map +0 -1
- package/src/components/toast/ToastProvider.tsx +0 -115
- package/src/components/toast/index.ts +0 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/*** Owns the toast queue, dismissal timers, and imperative controller state. */
|
|
3
|
+
export function useToastRuntime(defaultDuration) {
|
|
4
|
+
const [toasts, setToasts] = React.useState([]);
|
|
5
|
+
const timersRef = React.useRef(new Map());
|
|
6
|
+
const counterRef = React.useRef(0);
|
|
7
|
+
const dismissToast = React.useCallback((id) => {
|
|
8
|
+
const timer = timersRef.current.get(id);
|
|
9
|
+
if (timer) {
|
|
10
|
+
clearTimeout(timer);
|
|
11
|
+
timersRef.current.delete(id);
|
|
12
|
+
}
|
|
13
|
+
setToasts((current) => current.filter((toast) => toast.id !== id));
|
|
14
|
+
}, []);
|
|
15
|
+
const showToast = React.useCallback((options) => {
|
|
16
|
+
const id = options.id ?? `toast-${counterRef.current++}`;
|
|
17
|
+
setToasts((current) => [...current, { ...options, id }]);
|
|
18
|
+
return id;
|
|
19
|
+
}, []);
|
|
20
|
+
useToastTimers({ defaultDuration, dismissToast, timersRef, toasts });
|
|
21
|
+
const controller = React.useMemo(() => ({ dismissToast, showToast }), [dismissToast, showToast]);
|
|
22
|
+
return { controller, toasts };
|
|
23
|
+
}
|
|
24
|
+
/*** Synchronizes toast lifetimes with timer side effects and cleans them up on unmount. */
|
|
25
|
+
function useToastTimers({ defaultDuration, dismissToast, timersRef, toasts }) {
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
const timers = timersRef.current;
|
|
28
|
+
toasts.forEach((toast) => {
|
|
29
|
+
if (timers.has(toast.id))
|
|
30
|
+
return;
|
|
31
|
+
const timer = setTimeout(() => dismissToast(toast.id), toast.duration ?? defaultDuration);
|
|
32
|
+
timers.set(toast.id, timer);
|
|
33
|
+
});
|
|
34
|
+
const activeToastIds = new Set(toasts.map((toast) => toast.id));
|
|
35
|
+
timers.forEach((timer, id) => {
|
|
36
|
+
if (!activeToastIds.has(id)) {
|
|
37
|
+
clearTimeout(timer);
|
|
38
|
+
timers.delete(id);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, [defaultDuration, dismissToast, timersRef, toasts]);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const timers = timersRef.current;
|
|
44
|
+
return () => {
|
|
45
|
+
timers.forEach((timer) => clearTimeout(timer));
|
|
46
|
+
timers.clear();
|
|
47
|
+
};
|
|
48
|
+
}, [timersRef]);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useToastRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToastRuntime.js","sourceRoot":"","sources":["../../../../src/features/toast/composition/useToastRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAAC,eAAuB;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAe,EAAE,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,EAAyC,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEnC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,C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Controller, ToastOptions } from '../../../types/toast';\n\n/*** Owns the toast queue, dismissal timers, and imperative controller state. */\nexport function useToastRuntime(defaultDuration: number) {\n const [toasts, setToasts] = React.useState<ToastEntry[]>([]);\n const timersRef = React.useRef(new Map<string, ReturnType<typeof setTimeout>>());\n const counterRef = React.useRef(0);\n\n const dismissToast = React.useCallback((id: string) => {\n const timer = timersRef.current.get(id);\n if (timer) {\n clearTimeout(timer);\n timersRef.current.delete(id);\n }\n setToasts((current) => current.filter((toast) => toast.id !== id));\n }, []);\n\n const showToast = React.useCallback((options: ToastOptions) => {\n const id = options.id ?? `toast-${counterRef.current++}`;\n setToasts((current) => [...current, { ...options, id }]);\n return id;\n }, []);\n\n useToastTimers({ defaultDuration, dismissToast, timersRef, toasts });\n\n const controller = React.useMemo<ToastController>(\n () => ({ dismissToast, showToast }),\n [dismissToast, showToast],\n );\n\n return { controller, toasts };\n}\n\ninterface ToastEntry extends ToastOptions {\n id: string;\n}\n\ninterface UseToastTimersInput {\n defaultDuration: number;\n dismissToast: (id: string) => void;\n timersRef: React.RefObject<Map<string, ReturnType<typeof setTimeout>>>;\n toasts: readonly ToastEntry[];\n}\n\n/*** Synchronizes toast lifetimes with timer side effects and cleans them up on unmount. */\nfunction useToastTimers({ defaultDuration, dismissToast, timersRef, toasts }: UseToastTimersInput) {\n React.useEffect(() => {\n const timers = timersRef.current;\n\n toasts.forEach((toast) => {\n if (timers.has(toast.id)) return;\n\n const timer = setTimeout(() => dismissToast(toast.id), toast.duration ?? defaultDuration);\n timers.set(toast.id, timer);\n });\n\n const activeToastIds = new Set(toasts.map((toast) => toast.id));\n timers.forEach((timer, id) => {\n if (!activeToastIds.has(id)) {\n clearTimeout(timer);\n timers.delete(id);\n }\n });\n }, [defaultDuration, dismissToast, timersRef, toasts]);\n\n React.useEffect(() => {\n const timers = timersRef.current;\n\n return () => {\n timers.forEach((timer) => clearTimeout(timer));\n timers.clear();\n };\n }, [timersRef]);\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { ToastController, ToastOptions, ToastProps, ToastProviderProps, ToastStatus, } from '../../types/toast';
|
|
2
|
+
export { Toast } from './adapters/inbound/Toast';
|
|
3
|
+
export { ToastProvider } from './adapters/inbound/ToastProvider';
|
|
4
|
+
export { useToast } from './adapters/inbound/useToast';
|
|
5
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/toast/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/toast/public.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export type {\n ToastController,\n ToastOptions,\n ToastProps,\n ToastProviderProps,\n ToastStatus,\n} from '../../types/toast';\nexport { Toast } from './adapters/inbound/Toast';\nexport { ToastProvider } from './adapters/inbound/ToastProvider';\nexport { useToast } from './adapters/inbound/useToast';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './compone
|
|
|
16
16
|
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
17
17
|
export type { TextareaProps } from './components/textarea';
|
|
18
18
|
export { Textarea } from './components/textarea';
|
|
19
|
-
export type { ToastOptions, ToastProps, ToastStatus } from './components/toast';
|
|
20
|
-
export { Toast, ToastProvider, useToast } from './components/toast';
|
|
21
19
|
export type { TooltipProps } from './components/tooltip';
|
|
22
20
|
export { Tooltip } from './components/tooltip';
|
|
23
21
|
export type { FontRuntime } from './context/FontContext';
|
|
@@ -25,6 +23,8 @@ export { FontProvider, useFontContext } from './context/FontContext';
|
|
|
25
23
|
export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
|
|
26
24
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
27
25
|
export * from './core/responsive';
|
|
26
|
+
export type { AccordionContentProps, AccordionItemProps, AccordionMode, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTriggerProps, } from './features/accordion/public';
|
|
27
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './features/accordion/public';
|
|
28
28
|
export type { BadgeProps } from './features/badge/public';
|
|
29
29
|
export { Badge } from './features/badge/public';
|
|
30
30
|
export type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';
|
|
@@ -45,8 +45,12 @@ export type { KeyboardAvoidingViewBehavior, KeyboardAvoidingViewProps, } from '.
|
|
|
45
45
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
46
46
|
export type { BoxProps, ContainerProps, DividerProps, GridProps, StackProps, } from './features/layout/public';
|
|
47
47
|
export { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
48
|
+
export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from './features/popover/public';
|
|
49
|
+
export { Popover } from './features/popover/public';
|
|
48
50
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
49
51
|
export { Surface } from './features/surface/public';
|
|
52
|
+
export type { ToastController, ToastOptions, ToastProps, ToastProviderProps, ToastStatus, } from './features/toast/public';
|
|
53
|
+
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
50
54
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
51
55
|
export { Heading, Text } from './features/typography/public';
|
|
52
56
|
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAA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eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,11 +7,11 @@ export { Modal } from './components/modal';
|
|
|
7
7
|
export { Switch } from './components/switch';
|
|
8
8
|
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
9
9
|
export { Textarea } from './components/textarea';
|
|
10
|
-
export { Toast, ToastProvider, useToast } from './components/toast';
|
|
11
10
|
export { Tooltip } from './components/tooltip';
|
|
12
11
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
13
12
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
14
13
|
export * from './core/responsive';
|
|
14
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './features/accordion/public';
|
|
15
15
|
export { Badge } from './features/badge/public';
|
|
16
16
|
export { Button, IconButton } from './features/button/public';
|
|
17
17
|
export { Card } from './features/card/public';
|
|
@@ -22,7 +22,9 @@ export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
|
|
|
22
22
|
export { Image } from './features/image/public';
|
|
23
23
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
24
24
|
export { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
25
|
+
export { Popover } from './features/popover/public';
|
|
25
26
|
export { Surface } from './features/surface/public';
|
|
27
|
+
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
26
28
|
export { Heading, Text } from './features/typography/public';
|
|
27
29
|
export * from './layout';
|
|
28
30
|
export { ButtonBase } from './primitives/button-base';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEjE,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EAAE,MAAM,0BAA0B,CAAC;AAOtD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { FieldProps } from './components/field';\nexport { Field } from './components/field';\nexport type { HelperTextProps } from './components/helper-text';\nexport { HelperText } from './components/helper-text';\nexport type { LabelProps } from './components/label';\nexport { Label } from './components/label';\nexport type { ListItemProps } from './components/list-item';\nexport { ListItem } from './components/list-item';\nexport type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './components/menu';\nexport { Menu } from './components/menu';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';\nexport { Tab, TabList, TabPanel, Tabs } from './components/tabs';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { TooltipProps } from './components/tooltip';\nexport { Tooltip } from './components/tooltip';\nexport type { FontRuntime } from './context/FontContext';\nexport { FontProvider, useFontContext } from './context/FontContext';\nexport type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';\nexport { TranslationProvider, useTranslationContext } from './context/TranslationContext';\nexport * from './core/responsive';\nexport type {\n AccordionContentProps,\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n AccordionTriggerProps,\n} from './features/accordion/public';\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './features/accordion/public';\nexport type { BadgeProps } from './features/badge/public';\nexport { Badge } from './features/badge/public';\nexport type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';\nexport { Button, IconButton } from './features/button/public';\nexport type { CardProps } from './features/card/public';\nexport { Card } from './features/card/public';\nexport type { CheckboxProps } from './features/form/checkbox/public';\nexport { Checkbox } from './features/form/checkbox/public';\nexport type { RadioProps } from './features/form/radio/public';\nexport { Radio } from './features/form/radio/public';\nexport type { TextInputProps } from './features/form/text-input/public';\nexport { TextInput } from './features/form/text-input/public';\nexport type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from './features/icon/public';\nexport { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/public';\nexport { Image } from './features/image/public';\nexport type {\n KeyboardAvoidingViewBehavior,\n KeyboardAvoidingViewProps,\n} from './features/keyboard-avoiding-view/public';\nexport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nexport type {\n BoxProps,\n ContainerProps,\n DividerProps,\n GridProps,\n StackProps,\n} from './features/layout/public';\nexport { Box, Container, Divider, Grid, Stack } from './features/layout/public';\nexport type {\n PopoverAnchorRenderProps,\n PopoverPlacement,\n PopoverProps,\n} from './features/popover/public';\nexport { Popover } from './features/popover/public';\nexport type { SurfaceProps, SurfaceVariant } from './features/surface/public';\nexport { Surface } from './features/surface/public';\nexport type {\n ToastController,\n ToastOptions,\n ToastProps,\n ToastProviderProps,\n ToastStatus,\n} from './features/toast/public';\nexport { Toast, ToastProvider, useToast } from './features/toast/public';\nexport type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';\nexport { Heading, Text } from './features/typography/public';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\nexport * from './layout';\nexport type { ButtonBaseProps } from './primitives/button-base';\nexport { ButtonBase } from './primitives/button-base';\nexport type {\n SurfaceColor,\n SurfaceEmphasis,\n SurfacePaletteColor,\n SurfaceStatusColor,\n} from './surfaceColor';\nexport {\n SURFACE_COLORS,\n SURFACE_EMPHASES,\n SURFACE_PALETTE_COLORS,\n SURFACE_STATUS_COLORS,\n} from './surfaceColor';\nexport * from './theme';\nexport { isDeepEqual } from './utils/deepEqual';\nexport { deepMerge } from './utils/deepMerge';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayProvider.d.ts","sourceRoot":"","sources":["../../../src/internal/overlay/OverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OverlayProvider.d.ts","sourceRoot":"","sources":["../../../src/internal/overlay/OverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAwD1E"}
|
|
@@ -12,9 +12,7 @@ const styles = StyleSheet.create({
|
|
|
12
12
|
top: 0,
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
return { zIndex };
|
|
17
|
-
}
|
|
15
|
+
/*** Installs the shared overlay stack used by portal-based Surface features. */
|
|
18
16
|
export function OverlayProvider({ children }) {
|
|
19
17
|
const orderRef = React.useRef(0);
|
|
20
18
|
const [overlays, setOverlays] = React.useState([]);
|
|
@@ -40,15 +38,19 @@ export function OverlayProvider({ children }) {
|
|
|
40
38
|
removeOverlay,
|
|
41
39
|
setOverlay,
|
|
42
40
|
}), [overlays, removeOverlay, setOverlay]);
|
|
43
|
-
return (<OverlayStackActionsContext
|
|
44
|
-
<OverlayStackContext
|
|
41
|
+
return (<OverlayStackActionsContext value={actions}>
|
|
42
|
+
<OverlayStackContext value={value}>
|
|
45
43
|
{children}
|
|
46
44
|
<View {...boxNonePointerEvents.props} style={[boxNonePointerEvents.style, styles.fill]}>
|
|
47
45
|
{overlays.map((overlay) => (<View {...boxNonePointerEvents.props} key={overlay.id} style={[boxNonePointerEvents.style, styles.fill, overlayZIndex(overlay.zIndex)]}>
|
|
48
46
|
{overlay.node}
|
|
49
47
|
</View>))}
|
|
50
48
|
</View>
|
|
51
|
-
</OverlayStackContext
|
|
52
|
-
</OverlayStackActionsContext
|
|
49
|
+
</OverlayStackContext>
|
|
50
|
+
</OverlayStackActionsContext>);
|
|
51
|
+
}
|
|
52
|
+
/*** Resolves a per-entry z-index style for the overlay host. */
|
|
53
|
+
function overlayZIndex(zIndex) {
|
|
54
|
+
return { zIndex };
|
|
53
55
|
}
|
|
54
56
|
//# sourceMappingURL=OverlayProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayProvider.js","sourceRoot":"","sources":["../../../src/internal/overlay/OverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAGlB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC9D,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAC;AAEH,
|
|
1
|
+
{"version":3,"file":"OverlayProvider.js","sourceRoot":"","sources":["../../../src/internal/overlay/OverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAGl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AAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAEhF;cAAA,CAAC,OAAO,CAAC,IAAI,CACf;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CACJ;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,mBAAmB,CACvB;IAAA,EAAE,0BAA0B,CAAC,CAC9B,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import React from 'react';\nimport { StyleSheet, View, type ViewStyle } from 'react-native';\n\nimport { resolvePointerEvents } from '../resolvePointerEvents';\nimport {\n createOverlayEntry,\n type OverlayDescriptor,\n type OverlayEntry,\n OverlayStackActionsContext,\n OverlayStackContext,\n sortOverlayEntries,\n} from './useOverlayStack';\n\nconst boxNonePointerEvents = resolvePointerEvents('box-none');\nconst styles = StyleSheet.create({\n fill: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n});\n\n/*** Installs the shared overlay stack used by portal-based Surface features. */\nexport function OverlayProvider({ children }: { children: React.ReactNode }) {\n const orderRef = React.useRef(0);\n const [overlays, setOverlays] = React.useState<OverlayEntry[]>([]);\n\n const setOverlay = React.useCallback((id: string, descriptor: OverlayDescriptor) => {\n setOverlays((current) => {\n const existing = current.find((entry) => entry.id === id);\n const nextEntry = createOverlayEntry(id, existing?.order ?? orderRef.current++, descriptor);\n\n if (!existing) {\n return sortOverlayEntries([...current, nextEntry]);\n }\n\n return sortOverlayEntries(current.map((entry) => (entry.id === id ? nextEntry : entry)));\n });\n }, []);\n\n const removeOverlay = React.useCallback((id: string) => {\n setOverlays((current) => current.filter((entry) => entry.id !== id));\n }, []);\n\n const actions = React.useMemo(\n () => ({\n removeOverlay,\n setOverlay,\n }),\n [removeOverlay, setOverlay],\n );\n\n const value = React.useMemo(\n () => ({\n overlays,\n removeOverlay,\n setOverlay,\n }),\n [overlays, removeOverlay, setOverlay],\n );\n\n return (\n <OverlayStackActionsContext value={actions}>\n <OverlayStackContext value={value}>\n {children}\n <View {...boxNonePointerEvents.props} style={[boxNonePointerEvents.style, styles.fill]}>\n {overlays.map((overlay) => (\n <View\n {...boxNonePointerEvents.props}\n key={overlay.id}\n style={[boxNonePointerEvents.style, styles.fill, overlayZIndex(overlay.zIndex)]}\n >\n {overlay.node}\n </View>\n ))}\n </View>\n </OverlayStackContext>\n </OverlayStackActionsContext>\n );\n}\n\n/*** Resolves a per-entry z-index style for the overlay host. */\nfunction overlayZIndex(zIndex: number): ViewStyle {\n return { zIndex };\n}\n"]}
|
|
@@ -17,7 +17,7 @@ export function sortOverlayEntries(entries) {
|
|
|
17
17
|
export const OverlayStackContext = React.createContext(null);
|
|
18
18
|
export const OverlayStackActionsContext = React.createContext(null);
|
|
19
19
|
export function useOverlayStackActions() {
|
|
20
|
-
return React.
|
|
20
|
+
return React.use(OverlayStackActionsContext);
|
|
21
21
|
}
|
|
22
22
|
export function createOverlayEntry(id, order, descriptor) {
|
|
23
23
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverlayStack.js","sourceRoot":"","sources":["../../../src/internal/overlay/useOverlayStack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAqB,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAwB5F,MAAM,UAAU,kBAAkB,CAAC,OAAuB;IACxD,MAAM,cAAc,GAA0C,EAAE,CAAC;IACjE,MAAM,iBAAiB,GAAG,CAAC,GAAG,OAAO,CAAC;SACnC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;SAC/C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,cAAc,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c,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;QAE7C,OAAO;YACL,GAAG,KAAK;YACR,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC;SACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC5C,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CACrF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC,CAAC;AAEhG,MAAM,UAAU,sBAAsB;IACpC,OAAO,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,EAAU,EACV,KAAa,EACb,UAA6B;IAE7B,OAAO;QACL,EAAE;QACF,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,KAAK;QACL,MAAM,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;KAClD,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { type OverlayLayer, resolveOverlayZIndex } from '../resolvers/resolveOverlayZIndex';\n\nexport interface OverlayEntry {\n id: string;\n layer: OverlayLayer;\n node: React.ReactNode;\n order: number;\n zIndex: number;\n}\n\nexport interface OverlayDescriptor {\n layer: OverlayLayer;\n node: React.ReactNode;\n}\n\nexport interface OverlayStackActions {\n setOverlay: (id: string, overlay: OverlayDescriptor) => void;\n removeOverlay: (id: string) => void;\n}\n\nexport interface OverlayStackRuntime extends OverlayStackActions {\n overlays: OverlayEntry[];\n}\n\nexport function sortOverlayEntries(entries: OverlayEntry[]): OverlayEntry[] {\n const perLayerCounts: Partial<Record<OverlayLayer, number>> = {};\n const normalizedEntries = [...entries]\n .sort((left, right) => left.order - right.order)\n .map((entry) => {\n const stackIndex = perLayerCounts[entry.layer] ?? 0;\n perLayerCounts[entry.layer] = stackIndex + 1;\n\n return {\n ...entry,\n zIndex: resolveOverlayZIndex(entry.layer, stackIndex),\n };\n });\n\n return normalizedEntries.sort((left, right) =>\n left.zIndex === right.zIndex ? left.order - right.order : left.zIndex - right.zIndex,\n );\n}\n\nexport const OverlayStackContext = React.createContext<OverlayStackRuntime | null>(null);\n\nexport const OverlayStackActionsContext = React.createContext<OverlayStackActions | null>(null);\n\nexport function useOverlayStackActions(): OverlayStackActions | null {\n return React.use(OverlayStackActionsContext);\n}\n\nexport function createOverlayEntry(\n id: string,\n order: number,\n descriptor: OverlayDescriptor,\n): OverlayEntry {\n return {\n id,\n layer: descriptor.layer,\n node: descriptor.node,\n order,\n zIndex: resolveOverlayZIndex(descriptor.layer, 0),\n };\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type OverlayLayer = 'modal' | 'drawer' | 'menu' | 'tooltip' | 'toast';
|
|
1
|
+
export type OverlayLayer = 'modal' | 'drawer' | 'menu' | 'popover' | 'tooltip' | 'toast';
|
|
2
2
|
export declare function resolveOverlayZIndex(layer: OverlayLayer, stackIndex?: number): number;
|
|
3
3
|
//# sourceMappingURL=resolveOverlayZIndex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOverlayZIndex.d.ts","sourceRoot":"","sources":["../../../src/internal/resolvers/resolveOverlayZIndex.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveOverlayZIndex.d.ts","sourceRoot":"","sources":["../../../src/internal/resolvers/resolveOverlayZIndex.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAWzF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,SAAI,GAAG,MAAM,CAEhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOverlayZIndex.js","sourceRoot":"","sources":["../../../src/internal/resolvers/resolveOverlayZIndex.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAiC;IACjD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,KAAmB,EAAE,UAAU,GAAG,CAAC;IACtE,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;AAC1C,CAAC","sourcesContent":["export type OverlayLayer = 'modal' | 'drawer' | 'menu' | 'tooltip' | 'toast';\n\nconst BASE_Z_INDEX: Record<OverlayLayer, number> = {\n modal: 1000,\n drawer: 1100,\n menu: 1200,\n tooltip: 1300,\n toast: 1400,\n};\n\nexport function resolveOverlayZIndex(layer: OverlayLayer, stackIndex = 0): number {\n return BASE_Z_INDEX[layer] + stackIndex;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resolveOverlayZIndex.js","sourceRoot":"","sources":["../../../src/internal/resolvers/resolveOverlayZIndex.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAiC;IACjD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,KAAmB,EAAE,UAAU,GAAG,CAAC;IACtE,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;AAC1C,CAAC","sourcesContent":["export type OverlayLayer = 'modal' | 'drawer' | 'menu' | 'popover' | 'tooltip' | 'toast';\n\nconst BASE_Z_INDEX: Record<OverlayLayer, number> = {\n modal: 1000,\n drawer: 1100,\n menu: 1200,\n popover: 1250,\n tooltip: 1300,\n toast: 1400,\n};\n\nexport function resolveOverlayZIndex(layer: OverlayLayer, stackIndex = 0): number {\n return BASE_Z_INDEX[layer] + stackIndex;\n}\n"]}
|
package/dist/layout/AppBar.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Box, Divider } from '../features/layout/public';
|
|
|
5
5
|
import { useTheme } from '../theme/ThemeContext';
|
|
6
6
|
export function AppBar({ leading, trailing, children, safeAreaTop = true, divider = false, contentStyle, bg, style, ...props }) {
|
|
7
7
|
const { theme } = useTheme();
|
|
8
|
-
const insets = React.
|
|
8
|
+
const insets = React.use(SafeAreaInsetsContext);
|
|
9
9
|
const topInset = safeAreaTop ? (insets?.top ?? 0) : 0;
|
|
10
10
|
const safeAreaStyle = topInset === 0 ? undefined : { paddingTop: topInset };
|
|
11
11
|
return (<Box {...props} bg={bg ?? theme.semantics.surface.default} style={style}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.js","sourceRoot":"","sources":["../../src/layout/AppBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,IAAI,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,GAAG,EAAiB,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAWjD,MA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AC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nimport { Box, type BoxProps, Divider } from '../features/layout/public';\nimport { useTheme } from '../theme/ThemeContext';\n\nexport interface AppBarProps extends Omit<BoxProps, 'children'> {\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n children?: React.ReactNode;\n safeAreaTop?: boolean;\n divider?: boolean;\n contentStyle?: StyleProp<ViewStyle>;\n}\n\nexport function AppBar({\n leading,\n trailing,\n children,\n safeAreaTop = true,\n divider = false,\n contentStyle,\n bg,\n style,\n ...props\n}: AppBarProps) {\n const { theme } = useTheme();\n const insets = React.use(SafeAreaInsetsContext);\n const topInset = safeAreaTop ? (insets?.top ?? 0) : 0;\n const safeAreaStyle: ViewStyle | undefined =\n topInset === 0 ? undefined : { paddingTop: topInset };\n\n return (\n <Box {...props} bg={bg ?? theme.semantics.surface.default} style={style}>\n <View style={safeAreaStyle}>\n <View\n style={[\n {\n minHeight: 56,\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: theme.spacing.m,\n },\n contentStyle,\n ]}\n >\n {leading ? (\n <View style={{ marginRight: theme.spacing.s, flexShrink: 0 }}>{leading}</View>\n ) : null}\n <View style={{ flex: 1, minWidth: 0 }}>{children}</View>\n {trailing ? (\n <View style={{ marginLeft: theme.spacing.s, flexShrink: 0 }}>{trailing}</View>\n ) : null}\n </View>\n {divider ? <Divider color={theme.semantics.neutral.divider} thickness={1} /> : null}\n </View>\n </Box>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAIzD,eAAO,MAAM,YAAY;WAChB,YAAY;UACb,OAAO,GAAG,MAAM;oBACN,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI;aAC7C,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI;mBAC1B,OAAO;EAWtB,CAAC;AAEH,eAAO,MAAM,aAAa,GAAI,2CAI3B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,sBAyCA,CAAC;AAEF,eAAO,MAAM,QAAQ;WApEZ,YAAY;UACb,OAAO,GAAG,MAAM;oBACN,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI;aAC7C,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI;mBAC1B,OAAO;CAkEvB,CAAC;AAEF,eAAO,MAAM,cAAc,iBAtEA,OAAO,CAAC,WAAW,CAAC,KAAK,IAyEnD,CAAC;AAEF,eAAO,MAAM,YAAY;;oBA1EP,OAAO,GAAG,MAAM,KAAK,IAAI;CA6E1C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext,
|
|
1
|
+
import React, { createContext, use, useMemo } from 'react';
|
|
2
2
|
import { useFontContext } from '../context/FontContext';
|
|
3
3
|
import { ResponsiveProvider } from '../core/responsive/ResponsiveProvider';
|
|
4
4
|
import { OverlayProvider } from '../internal/overlay/OverlayProvider';
|
|
@@ -21,7 +21,6 @@ export const ThemeProvider = ({ children, initialConfig, initialMode = 'light',
|
|
|
21
21
|
const [config, setConfig] = React.useState(() => initialConfig ? deepMerge(defaultTheme.config, initialConfig) : defaultTheme.config);
|
|
22
22
|
const [mode, setMode] = React.useState(initialMode);
|
|
23
23
|
const { activeFontId } = useFontContext();
|
|
24
|
-
// Keep state in sync with prop for real-time Studio updates
|
|
25
24
|
React.useEffect(() => {
|
|
26
25
|
if (initialConfig) {
|
|
27
26
|
setConfig((prev) => {
|
|
@@ -41,13 +40,13 @@ export const ThemeProvider = ({ children, initialConfig, initialMode = 'light',
|
|
|
41
40
|
_hasProvider: true,
|
|
42
41
|
}), [theme, mode]);
|
|
43
42
|
return (<ResponsiveProvider>
|
|
44
|
-
<ThemeContext
|
|
43
|
+
<ThemeContext value={value}>
|
|
45
44
|
<OverlayProvider>{children}</OverlayProvider>
|
|
46
|
-
</ThemeContext
|
|
45
|
+
</ThemeContext>
|
|
47
46
|
</ResponsiveProvider>);
|
|
48
47
|
};
|
|
49
48
|
export const useTheme = () => {
|
|
50
|
-
return
|
|
49
|
+
return use(ThemeContext);
|
|
51
50
|
};
|
|
52
51
|
export const useThemeConfig = () => {
|
|
53
52
|
const { setThemeConfig } = useTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE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YAAY,CAAC,EAC7C,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,CAC7B,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,IAAI;QACJ,cAAc,EAAE,CAAC,SAA+B,EAAE,EAAE,CAClD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACjD,OAAO;QACP,YAAY,EAAE,IAAI;KACnB,CAAC,EACF,CAAC,KAAK,EAAE,IAAI,CAAC,CACd,CAAC;IAEF,OAAO,CACL,CAAC,kBAAkB,CACjB;MAAA,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CACzB;QAAA,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,eAAe,CAC9C;MAAA,EAAE,YAAY,CAChB;IAAA,EAAE,kBAAkB,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,OAAO,GAAG,CAAC,YAAY,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,EAAE,CAAC;IACtC,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;IACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import React, { createContext, use, useMemo } from 'react';\n\nimport { useFontContext } from '../context/FontContext';\nimport { ResponsiveProvider } from '../core/responsive/ResponsiveProvider';\nimport { OverlayProvider } from '../internal/overlay/OverlayProvider';\nimport { isDeepEqual } from '../utils/deepEqual';\nimport { deepMerge } from '../utils/deepMerge';\nimport { createTheme } from './createTheme';\nimport type { SurfaceTheme, ThemeConfig } from './types';\n\nconst defaultTheme = createTheme();\n\nexport const ThemeContext = createContext<{\n theme: SurfaceTheme;\n mode: 'light' | 'dark';\n setThemeConfig: (config: Partial<ThemeConfig>) => void;\n setMode: (mode: 'light' | 'dark') => void;\n _hasProvider?: boolean;\n}>({\n theme: defaultTheme,\n mode: 'light',\n setThemeConfig: () => {\n /* fallback */\n },\n setMode: () => {\n /* fallback */\n },\n _hasProvider: false,\n});\n\nexport const ThemeProvider = ({\n children,\n initialConfig,\n initialMode = 'light',\n}: {\n children: React.ReactNode;\n initialConfig?: Partial<ThemeConfig>;\n initialMode?: 'light' | 'dark';\n}) => {\n const [config, setConfig] = React.useState<ThemeConfig>(() =>\n initialConfig ? deepMerge(defaultTheme.config, initialConfig) : defaultTheme.config,\n );\n const [mode, setMode] = React.useState<'light' | 'dark'>(initialMode);\n const { activeFontId } = useFontContext();\n\n React.useEffect(() => {\n if (initialConfig) {\n setConfig((prev) => {\n const merged = deepMerge(prev, initialConfig);\n if (isDeepEqual(prev, merged)) return prev;\n return merged;\n });\n }\n }, [initialConfig]);\n\n const theme = useMemo(\n () => createTheme(config, mode, activeFontId),\n [config, mode, activeFontId],\n );\n\n const value = useMemo(\n () => ({\n theme,\n mode,\n setThemeConfig: (newConfig: Partial<ThemeConfig>) =>\n setConfig((prev) => deepMerge(prev, newConfig)),\n setMode,\n _hasProvider: true,\n }),\n [theme, mode],\n );\n\n return (\n <ResponsiveProvider>\n <ThemeContext value={value}>\n <OverlayProvider>{children}</OverlayProvider>\n </ThemeContext>\n </ResponsiveProvider>\n );\n};\n\nexport const useTheme = () => {\n return use(ThemeContext);\n};\n\nexport const useThemeConfig = () => {\n const { setThemeConfig } = useTheme();\n return setThemeConfig;\n};\n\nexport const useThemeMode = () => {\n const { mode, setMode } = useTheme();\n return { mode, setMode };\n};\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
import type { InteractionPolicy, InteractionPolicyProps } from '../interactionPolicy';
|
|
4
|
+
export type AccordionMode = 'single' | 'multiple';
|
|
5
|
+
interface AccordionBaseProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface AccordionSingleProps extends AccordionBaseProps {
|
|
10
|
+
type?: 'single';
|
|
11
|
+
value?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
onValueChange?: (value: string | undefined) => void;
|
|
14
|
+
collapsible?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface AccordionMultipleProps extends AccordionBaseProps {
|
|
17
|
+
type: 'multiple';
|
|
18
|
+
value?: readonly string[];
|
|
19
|
+
defaultValue?: readonly string[];
|
|
20
|
+
onValueChange?: (value: readonly string[]) => void;
|
|
21
|
+
collapsible?: never;
|
|
22
|
+
}
|
|
23
|
+
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
24
|
+
export interface AccordionItemProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {
|
|
25
|
+
value: string;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface AccordionTriggerProps extends Omit<PressableProps, 'accessibilityRole' | 'accessibilityState' | 'children' | 'disabled' | 'onPress'>, InteractionPolicyProps {
|
|
30
|
+
children?: PressableProps['children'];
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface AccordionContentProps extends Omit<ViewProps, 'children'> {
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
forceMount?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface AccordionContextValue {
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
interactionPolicy: InteractionPolicy;
|
|
40
|
+
mode: AccordionMode;
|
|
41
|
+
openValues: readonly string[];
|
|
42
|
+
toggleValue: (value: string) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface AccordionItemContextValue {
|
|
45
|
+
contentId: string;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
interactionPolicy: InteractionPolicy;
|
|
48
|
+
open: boolean;
|
|
49
|
+
toggle: () => void;
|
|
50
|
+
triggerId: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/types/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElD,UAAU,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,sBAAsB;IACtF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS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AAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/types/accordion.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { PressableProps, ViewProps } from 'react-native';\n\nimport type { InteractionPolicy, InteractionPolicyProps } from '../interactionPolicy';\n\nexport type AccordionMode = 'single' | 'multiple';\n\ninterface AccordionBaseProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {\n children?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface AccordionSingleProps extends AccordionBaseProps {\n type?: 'single';\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string | undefined) => void;\n collapsible?: boolean;\n}\n\nexport interface AccordionMultipleProps extends AccordionBaseProps {\n type: 'multiple';\n value?: readonly string[];\n defaultValue?: readonly string[];\n onValueChange?: (value: readonly string[]) => void;\n collapsible?: never;\n}\n\nexport type AccordionProps = AccordionSingleProps | AccordionMultipleProps;\n\nexport interface AccordionItemProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {\n value: string;\n children?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface AccordionTriggerProps\n extends\n Omit<\n PressableProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'disabled' | 'onPress'\n >,\n InteractionPolicyProps {\n children?: PressableProps['children'];\n disabled?: boolean;\n}\n\nexport interface AccordionContentProps extends Omit<ViewProps, 'children'> {\n children?: React.ReactNode;\n forceMount?: boolean;\n}\n\nexport interface AccordionContextValue {\n disabled: boolean;\n interactionPolicy: InteractionPolicy;\n mode: AccordionMode;\n openValues: readonly string[];\n toggleValue: (value: string) => void;\n}\n\nexport interface AccordionItemContextValue {\n contentId: string;\n disabled: boolean;\n interactionPolicy: InteractionPolicy;\n open: boolean;\n toggle: () => void;\n triggerId: string;\n value: string;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { InteractionPolicy } from '../interactionPolicy';
|
|
3
|
+
export type PopoverPlacement = 'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end';
|
|
4
|
+
export interface PopoverAnchorRenderProps {
|
|
5
|
+
close: () => void;
|
|
6
|
+
open: boolean;
|
|
7
|
+
toggle: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface PopoverProps {
|
|
10
|
+
anchor: (controls: PopoverAnchorRenderProps) => React.ReactNode;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
closeOnOutsidePress?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
interactionPolicy?: InteractionPolicy;
|
|
15
|
+
offset?: number;
|
|
16
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
17
|
+
open?: boolean;
|
|
18
|
+
placement?: PopoverPlacement;
|
|
19
|
+
testID?: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/types/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAC1B,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,CAAC,QAAQ,EAAE,wBAAwB,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACrD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/types/popover.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../interactionPolicy';\n\nexport type PopoverPlacement =\n 'bottom-start' | 'bottom' | 'bottom-end' | 'top-start' | 'top' | 'top-end';\n\nexport interface PopoverAnchorRenderProps {\n close: () => void;\n open: boolean;\n toggle: () => void;\n}\n\nexport interface PopoverProps {\n anchor: (controls: PopoverAnchorRenderProps) => React.ReactNode;\n children?: React.ReactNode;\n closeOnOutsidePress?: boolean;\n defaultOpen?: boolean;\n interactionPolicy?: InteractionPolicy;\n offset?: number;\n onOpenChange?: ((open: boolean) => void) | undefined;\n open?: boolean;\n placement?: PopoverPlacement;\n testID?: string;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { InteractionPolicy } from '
|
|
3
|
-
import type { SurfaceStatusColor } from '
|
|
2
|
+
import type { InteractionPolicy } from '../interactionPolicy';
|
|
3
|
+
import type { SurfaceStatusColor } from '../surfaceColor';
|
|
4
4
|
export type ToastStatus = 'default' | SurfaceStatusColor;
|
|
5
5
|
export interface ToastProps {
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -14,4 +14,12 @@ export interface ToastOptions extends Omit<ToastProps, 'onDismiss'> {
|
|
|
14
14
|
duration?: number;
|
|
15
15
|
id?: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
export interface ToastProviderProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
defaultDuration?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ToastController {
|
|
22
|
+
dismissToast: (id: string) => void;
|
|
23
|
+
showToast: (options: ToastOptions) => string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/types/toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/types/toast.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../interactionPolicy';\nimport type { SurfaceStatusColor } from '../surfaceColor';\n\nexport type ToastStatus = 'default' | SurfaceStatusColor;\n\nexport interface ToastProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n status?: ToastStatus;\n onDismiss?: (() => void) | undefined;\n interactionPolicy?: InteractionPolicy;\n testID?: string;\n}\n\nexport interface ToastOptions extends Omit<ToastProps, 'onDismiss'> {\n duration?: number;\n id?: string;\n}\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n defaultDuration?: number;\n}\n\nexport interface ToastController {\n dismissToast: (id: string) => void;\n showToast: (options: ToastOptions) => string;\n}\n"]}
|
package/package.json
CHANGED