@ankhorage/surface 4.4.1 → 5.0.1
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 +2 -2
- package/dist/features/bottom-sheet/BottomSheetProvider.js +8 -6
- package/dist/features/bottom-sheet/BottomSheetProvider.js.map +1 -1
- package/dist/features/bottom-sheet/public.d.ts +2 -1
- package/dist/features/bottom-sheet/public.d.ts.map +1 -1
- package/dist/features/bottom-sheet/public.js +1 -0
- package/dist/features/bottom-sheet/public.js.map +1 -1
- package/dist/{components/modal → features/modal/adapters/inbound}/Modal.d.ts +2 -1
- package/dist/features/modal/adapters/inbound/Modal.d.ts.map +1 -0
- package/dist/features/modal/adapters/inbound/Modal.js +51 -0
- package/dist/features/modal/adapters/inbound/Modal.js.map +1 -0
- package/dist/features/modal/public.d.ts +3 -0
- package/dist/features/modal/public.d.ts.map +1 -0
- package/dist/features/modal/public.js +2 -0
- package/dist/features/modal/public.js.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts +5 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +85 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -0
- package/dist/features/popover-menu/composition/usePopoverMenuController.d.ts +19 -0
- package/dist/features/popover-menu/composition/usePopoverMenuController.d.ts.map +1 -0
- package/dist/features/popover-menu/composition/usePopoverMenuController.js +35 -0
- package/dist/features/popover-menu/composition/usePopoverMenuController.js.map +1 -0
- package/dist/features/popover-menu/public.d.ts +3 -0
- package/dist/features/popover-menu/public.d.ts.map +1 -0
- package/dist/features/popover-menu/public.js +2 -0
- package/dist/features/popover-menu/public.js.map +1 -0
- package/dist/features/popover-menu/utils/resolveNextMenuIndex.d.ts +5 -0
- package/dist/features/popover-menu/utils/resolveNextMenuIndex.d.ts.map +1 -0
- package/dist/features/popover-menu/utils/resolveNextMenuIndex.js +18 -0
- package/dist/features/popover-menu/utils/resolveNextMenuIndex.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tab.d.ts +5 -0
- package/dist/features/tabs/adapters/inbound/Tab.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tab.js +33 -0
- package/dist/features/tabs/adapters/inbound/Tab.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabList.d.ts +5 -0
- package/dist/features/tabs/adapters/inbound/TabList.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabList.js +42 -0
- package/dist/features/tabs/adapters/inbound/TabList.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.d.ts +5 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.js +14 -0
- package/dist/features/tabs/adapters/inbound/TabPanel.js.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tabs.d.ts +5 -0
- package/dist/features/tabs/adapters/inbound/Tabs.d.ts.map +1 -0
- package/dist/features/tabs/adapters/inbound/Tabs.js +12 -0
- package/dist/features/tabs/adapters/inbound/Tabs.js.map +1 -0
- package/dist/features/tabs/composition/TabsContext.d.ts +4 -0
- package/dist/features/tabs/composition/TabsContext.d.ts.map +1 -0
- package/dist/features/tabs/composition/TabsContext.js +3 -0
- package/dist/features/tabs/composition/TabsContext.js.map +1 -0
- package/dist/features/tabs/composition/useTabRegistration.d.ts +7 -0
- package/dist/features/tabs/composition/useTabRegistration.d.ts.map +1 -0
- package/dist/features/tabs/composition/useTabRegistration.js +20 -0
- package/dist/features/tabs/composition/useTabRegistration.js.map +1 -0
- package/dist/features/tabs/composition/useTabsContext.d.ts +4 -0
- package/dist/features/tabs/composition/useTabsContext.d.ts.map +1 -0
- package/dist/{components/tabs/context.js → features/tabs/composition/useTabsContext.js} +4 -4
- package/dist/features/tabs/composition/useTabsContext.js.map +1 -0
- package/dist/features/tabs/composition/useTabsController.d.ts +4 -0
- package/dist/features/tabs/composition/useTabsController.d.ts.map +1 -0
- package/dist/features/tabs/composition/useTabsController.js +43 -0
- package/dist/features/tabs/composition/useTabsController.js.map +1 -0
- package/dist/features/tabs/public.d.ts +6 -0
- package/dist/features/tabs/public.d.ts.map +1 -0
- package/dist/features/tabs/public.js +5 -0
- package/dist/features/tabs/public.js.map +1 -0
- package/dist/features/tabs/utils/resolveNextTabValue.d.ts +4 -0
- package/dist/features/tabs/utils/resolveNextTabValue.d.ts.map +1 -0
- package/dist/{components/tabs/navigation.js → features/tabs/utils/resolveNextTabValue.js} +10 -13
- package/dist/features/tabs/utils/resolveNextTabValue.js.map +1 -0
- package/dist/features/tabs/utils/resolveTabElementId.d.ts +3 -0
- package/dist/features/tabs/utils/resolveTabElementId.d.ts.map +1 -0
- package/dist/features/tabs/utils/resolveTabElementId.js +10 -0
- package/dist/features/tabs/utils/resolveTabElementId.js.map +1 -0
- package/dist/features/tooltip/adapters/inbound/Tooltip.d.ts +5 -0
- package/dist/features/tooltip/adapters/inbound/Tooltip.d.ts.map +1 -0
- package/dist/features/tooltip/adapters/inbound/Tooltip.js +25 -0
- package/dist/features/tooltip/adapters/inbound/Tooltip.js.map +1 -0
- package/dist/features/tooltip/composition/useTooltipVisibility.d.ts +9 -0
- package/dist/features/tooltip/composition/useTooltipVisibility.d.ts.map +1 -0
- package/dist/features/tooltip/composition/useTooltipVisibility.js +25 -0
- package/dist/features/tooltip/composition/useTooltipVisibility.js.map +1 -0
- package/dist/features/tooltip/public.d.ts +3 -0
- package/dist/features/tooltip/public.d.ts.map +1 -0
- package/dist/features/tooltip/public.js +2 -0
- package/dist/features/tooltip/public.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/types/bottomSheet.d.ts +3 -0
- package/dist/types/bottomSheet.d.ts.map +1 -1
- package/dist/types/bottomSheet.js.map +1 -1
- package/dist/{components/modal/types.d.ts → types/modal.d.ts} +2 -2
- package/dist/types/modal.d.ts.map +1 -0
- package/dist/types/modal.js +2 -0
- package/dist/types/modal.js.map +1 -0
- package/dist/types/popoverMenu.d.ts +24 -0
- package/dist/types/popoverMenu.d.ts.map +1 -0
- package/dist/types/popoverMenu.js +2 -0
- package/dist/types/popoverMenu.js.map +1 -0
- package/dist/types/tabs.d.ts +43 -0
- package/dist/types/tabs.d.ts.map +1 -0
- package/dist/types/tabs.js +2 -0
- package/dist/types/tabs.js.map +1 -0
- package/dist/{components/tooltip/types.d.ts → types/tooltip.d.ts} +2 -2
- package/dist/types/tooltip.d.ts.map +1 -0
- package/dist/types/tooltip.js +2 -0
- package/dist/types/tooltip.js.map +1 -0
- package/package.json +1 -1
- package/src/features/bottom-sheet/BottomSheetProvider.tsx +13 -8
- package/src/features/bottom-sheet/public.test.ts +23 -0
- package/src/features/bottom-sheet/public.ts +12 -1
- package/src/features/modal/adapters/inbound/Modal.tsx +74 -0
- package/src/features/modal/public.ts +2 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +201 -0
- package/src/features/popover-menu/composition/usePopoverMenuController.ts +55 -0
- package/src/features/popover-menu/public.test.ts +13 -0
- package/src/features/popover-menu/public.ts +6 -0
- package/src/{components/menu/navigation.test.ts → features/popover-menu/utils/resolveNextMenuIndex.test.ts} +4 -4
- package/src/features/popover-menu/utils/resolveNextMenuIndex.ts +21 -0
- package/src/features/tabs/adapters/inbound/Tab.tsx +67 -0
- package/src/features/tabs/adapters/inbound/TabList.tsx +50 -0
- package/src/{components/tabs → features/tabs/adapters/inbound}/TabPanel.tsx +6 -10
- package/src/features/tabs/adapters/inbound/Tabs.tsx +17 -0
- package/src/features/tabs/composition/TabsContext.tsx +5 -0
- package/src/features/tabs/composition/useTabRegistration.ts +27 -0
- package/src/features/tabs/composition/useTabsContext.ts +13 -0
- package/src/features/tabs/composition/useTabsController.ts +55 -0
- package/src/features/tabs/public.ts +5 -0
- package/src/{components/tabs/navigation.test.ts → features/tabs/utils/resolveNextTabValue.test.ts} +2 -2
- package/src/features/tabs/utils/resolveNextTabValue.ts +24 -0
- package/src/features/tabs/utils/resolveTabElementId.test.ts +19 -0
- package/src/features/tabs/utils/resolveTabElementId.ts +14 -0
- package/src/features/tooltip/adapters/inbound/Tooltip.tsx +56 -0
- package/src/features/tooltip/composition/useTooltipVisibility.ts +29 -0
- package/src/features/tooltip/public.test.ts +11 -0
- package/src/features/tooltip/public.ts +2 -0
- package/src/index.test.ts +12 -5
- package/src/index.ts +12 -8
- package/src/types/bottomSheet.ts +4 -0
- package/src/{components/modal/types.ts → types/modal.ts} +1 -1
- package/src/types/popoverMenu.ts +27 -0
- package/src/types/tabs.ts +51 -0
- package/src/{components/tooltip/types.ts → types/tooltip.ts} +1 -1
- package/dist/components/menu/Menu.d.ts +0 -4
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/Menu.js +0 -152
- package/dist/components/menu/Menu.js.map +0 -1
- package/dist/components/menu/index.d.ts +0 -3
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js +0 -2
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/menu/navigation.d.ts +0 -4
- package/dist/components/menu/navigation.d.ts.map +0 -1
- package/dist/components/menu/navigation.js +0 -25
- package/dist/components/menu/navigation.js.map +0 -1
- package/dist/components/menu/types.d.ts +0 -23
- package/dist/components/menu/types.d.ts.map +0 -1
- package/dist/components/menu/types.js +0 -2
- package/dist/components/menu/types.js.map +0 -1
- package/dist/components/modal/Modal.d.ts.map +0 -1
- package/dist/components/modal/Modal.js +0 -59
- package/dist/components/modal/Modal.js.map +0 -1
- package/dist/components/modal/index.d.ts +0 -3
- package/dist/components/modal/index.d.ts.map +0 -1
- package/dist/components/modal/index.js +0 -2
- package/dist/components/modal/index.js.map +0 -1
- package/dist/components/modal/types.d.ts.map +0 -1
- package/dist/components/modal/types.js +0 -2
- package/dist/components/modal/types.js.map +0 -1
- package/dist/components/tabs/Tab.d.ts +0 -4
- package/dist/components/tabs/Tab.d.ts.map +0 -1
- package/dist/components/tabs/Tab.js +0 -48
- package/dist/components/tabs/Tab.js.map +0 -1
- package/dist/components/tabs/TabList.d.ts +0 -4
- package/dist/components/tabs/TabList.d.ts.map +0 -1
- package/dist/components/tabs/TabList.js +0 -37
- package/dist/components/tabs/TabList.js.map +0 -1
- package/dist/components/tabs/TabPanel.d.ts +0 -4
- package/dist/components/tabs/TabPanel.d.ts.map +0 -1
- package/dist/components/tabs/TabPanel.js +0 -16
- package/dist/components/tabs/TabPanel.js.map +0 -1
- package/dist/components/tabs/Tabs.d.ts +0 -4
- package/dist/components/tabs/Tabs.d.ts.map +0 -1
- package/dist/components/tabs/Tabs.js +0 -54
- package/dist/components/tabs/Tabs.js.map +0 -1
- package/dist/components/tabs/a11y.d.ts +0 -3
- package/dist/components/tabs/a11y.d.ts.map +0 -1
- package/dist/components/tabs/a11y.js +0 -13
- package/dist/components/tabs/a11y.js.map +0 -1
- package/dist/components/tabs/context.d.ts +0 -20
- package/dist/components/tabs/context.d.ts.map +0 -1
- package/dist/components/tabs/context.js.map +0 -1
- package/dist/components/tabs/index.d.ts +0 -6
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js +0 -5
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/tabs/navigation.d.ts +0 -3
- package/dist/components/tabs/navigation.d.ts.map +0 -1
- package/dist/components/tabs/navigation.js.map +0 -1
- package/dist/components/tabs/types.d.ts +0 -26
- package/dist/components/tabs/types.d.ts.map +0 -1
- package/dist/components/tabs/types.js +0 -2
- package/dist/components/tabs/types.js.map +0 -1
- package/dist/components/tooltip/Tooltip.d.ts +0 -4
- package/dist/components/tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/tooltip/Tooltip.js +0 -75
- package/dist/components/tooltip/Tooltip.js.map +0 -1
- package/dist/components/tooltip/index.d.ts +0 -3
- package/dist/components/tooltip/index.d.ts.map +0 -1
- package/dist/components/tooltip/index.js +0 -2
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/tooltip/types.d.ts.map +0 -1
- package/dist/components/tooltip/types.js +0 -2
- package/dist/components/tooltip/types.js.map +0 -1
- package/src/components/menu/Menu.tsx +0 -228
- package/src/components/menu/index.ts +0 -2
- package/src/components/menu/navigation.ts +0 -34
- package/src/components/menu/types.ts +0 -26
- package/src/components/modal/Modal.tsx +0 -96
- package/src/components/modal/index.ts +0 -2
- package/src/components/tabs/Tab.tsx +0 -89
- package/src/components/tabs/TabList.tsx +0 -51
- package/src/components/tabs/Tabs.tsx +0 -67
- package/src/components/tabs/a11y.test.ts +0 -15
- package/src/components/tabs/a11y.ts +0 -15
- package/src/components/tabs/context.tsx +0 -31
- package/src/components/tabs/index.ts +0 -5
- package/src/components/tabs/navigation.ts +0 -32
- package/src/components/tabs/types.ts +0 -30
- package/src/components/tooltip/Tooltip.tsx +0 -117
- package/src/components/tooltip/index.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAE7E,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,cAAc,GAAsB;IACxC,WAAW;IACX,YAAY;IACZ,SAAS;IACT,WAAW;IACX,MAAM;IACN,KAAK;CACN,CAAC;AAEF,2EAA2E;AAC3E,MAAM,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAgB;IACxD,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,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yleSheet } from 'react-native';\n\nimport { useFocusManager } from '../../../../internal/focus/useFocusManager';\nimport type { TabListProps, TabNavigationKey } from '../../../../types/tabs';\nimport { Box } from '../../../layout/public';\nimport { useTabsContext } from '../../composition/useTabsContext';\nimport { resolveNextTabValue } from '../../utils/resolveNextTabValue';\n\nconst navigationKeys: readonly string[] = [\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n];\n\n/*** Renders the accessible tab list and owns keyboard focus navigation. */\nexport function TabList({ children, testID }: TabListProps) {\n const { bindKeydown } = useFocusManager();\n const { focusedValue, setActiveValue, tabs } = useTabsContext();\n\n React.useEffect(() => {\n if (!focusedValue) return undefined;\n\n return bindKeydown((event) => {\n if (!isTabNavigationKey(event.key)) return;\n const nextValue = resolveNextTabValue(tabs, focusedValue, event.key);\n if (!nextValue) return;\n\n event.preventDefault();\n tabs.find((tab) => tab.value === nextValue)?.focus();\n setActiveValue(nextValue);\n });\n }, [bindKeydown, focusedValue, setActiveValue, tabs]);\n\n return (\n <Box accessibilityRole=\"tablist\" style={styles.list} testID={testID}>\n {children}\n </Box>\n );\n}\n\n/*** Narrows keyboard event keys to the tab navigation key contract. */\nfunction isTabNavigationKey(key: string | undefined): key is TabNavigationKey {\n return key !== undefined && navigationKeys.includes(key);\n}\n\nconst styles = StyleSheet.create({ list: { flexDirection: 'row' } });\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TabPanelProps } from '../../../../types/tabs';
|
|
3
|
+
/*** Renders the content panel associated with the active tab value. */
|
|
4
|
+
export declare function TabPanel({ value, children, testID }: TabPanelProps): React.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=TabPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK5D,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,aAAa,4BAelE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { useTabsContext } from '../../composition/useTabsContext';
|
|
4
|
+
const TAB_PANEL_ROLE = 'tabpanel';
|
|
5
|
+
/*** Renders the content panel associated with the active tab value. */
|
|
6
|
+
export function TabPanel({ value, children, testID }) {
|
|
7
|
+
const { activeValue, getPanelId, getTabId } = useTabsContext();
|
|
8
|
+
if (activeValue !== value)
|
|
9
|
+
return null;
|
|
10
|
+
return (<View accessibilityLabelledBy={getTabId(value)} accessibilityRole={TAB_PANEL_ROLE} nativeID={getPanelId(value)} testID={testID}>
|
|
11
|
+
{children}
|
|
12
|
+
</View>);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=TabPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabPanel.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,cAAc,GAAG,UAAoE,CAAC;AAE5F,uEAAuE;AACvE,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAiB;IACjE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/D,IAAI,WAAW,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,CAAC,IAAI,CACH,uBAAuB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CACzC,iBAAiB,CAAC,CAAC,cAAc,CAAC,CAClC,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAC5B,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport type { TabPanelProps } from '../../../../types/tabs';\nimport { useTabsContext } from '../../composition/useTabsContext';\n\nconst TAB_PANEL_ROLE = 'tabpanel' as React.ComponentProps<typeof View>['accessibilityRole'];\n\n/*** Renders the content panel associated with the active tab value. */\nexport function TabPanel({ value, children, testID }: TabPanelProps) {\n const { activeValue, getPanelId, getTabId } = useTabsContext();\n\n if (activeValue !== value) return null;\n\n return (\n <View\n accessibilityLabelledBy={getTabId(value)}\n accessibilityRole={TAB_PANEL_ROLE}\n nativeID={getPanelId(value)}\n testID={testID}\n >\n {children}\n </View>\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TabsProps } from '../../../../types/tabs';
|
|
3
|
+
/*** Provides accessible tab selection state to TabList, Tab, and TabPanel children. */
|
|
4
|
+
export declare function Tabs({ children, ...props }: TabsProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKxD,uFAAuF;AACvF,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,qBAQrD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '../../../layout/public';
|
|
3
|
+
import { TabsContext } from '../../composition/TabsContext';
|
|
4
|
+
import { useTabsController } from '../../composition/useTabsController';
|
|
5
|
+
/*** Provides accessible tab selection state to TabList, Tab, and TabPanel children. */
|
|
6
|
+
export function Tabs({ children, ...props }) {
|
|
7
|
+
const contextValue = useTabsController(props);
|
|
8
|
+
return (<TabsContext value={contextValue}>
|
|
9
|
+
<Box testID={props.testID}>{children}</Box>
|
|
10
|
+
</TabsContext>);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,uFAAuF;AACvF,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACpD,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAC/B;MAAA,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAC5C;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabsProps } from '../../../../types/tabs';\nimport { Box } from '../../../layout/public';\nimport { TabsContext } from '../../composition/TabsContext';\nimport { useTabsController } from '../../composition/useTabsController';\n\n/*** Provides accessible tab selection state to TabList, Tab, and TabPanel children. */\nexport function Tabs({ children, ...props }: TabsProps) {\n const contextValue = useTabsController(props);\n\n return (\n <TabsContext value={contextValue}>\n <Box testID={props.testID}>{children}</Box>\n </TabsContext>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsContext.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/TabsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,wCAAqD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsContext.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/TabsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabsContextValue } from '../../../types/tabs';\n\nexport const TabsContext = React.createContext<TabsContextValue | null>(null);\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/*** Registers one focusable tab with the owning Tabs context. */
|
|
3
|
+
export declare function useTabRegistration({ disabled, value }: {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
value: string;
|
|
6
|
+
}): React.RefObject<import("react-native").View | null>;
|
|
7
|
+
//# sourceMappingURL=useTabRegistration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabRegistration.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,uDAoB3F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTabsContext } from './useTabsContext';
|
|
3
|
+
/*** Registers one focusable tab with the owning Tabs context. */
|
|
4
|
+
export function useTabRegistration({ disabled, value }) {
|
|
5
|
+
const { registerTab, unregisterTab } = useTabsContext();
|
|
6
|
+
const pressableRef = React.useRef(null);
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
registerTab({
|
|
9
|
+
disabled,
|
|
10
|
+
focus: () => {
|
|
11
|
+
const focusable = pressableRef.current;
|
|
12
|
+
focusable?.focus?.();
|
|
13
|
+
},
|
|
14
|
+
value,
|
|
15
|
+
});
|
|
16
|
+
return () => unregisterTab(value);
|
|
17
|
+
}, [disabled, registerTab, unregisterTab, value]);
|
|
18
|
+
return pressableRef;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=useTabRegistration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabRegistration.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAwC;IAC1F,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAA4C,IAAI,CAAC,CAAC;IAEnF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,WAAW,CAAC;YACV,QAAQ;YACR,KAAK,EAAE,GAAG,EAAE;gBACV,MAAM,SAAS,GAAG,YAAY,CAAC,OAEvB,CAAC;gBACT,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YACvB,CAAC;YACD,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAElD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import React from 'react';\nimport type { Pressable } from 'react-native';\n\nimport { useTabsContext } from './useTabsContext';\n\n/*** Registers one focusable tab with the owning Tabs context. */\nexport function useTabRegistration({ disabled, value }: { disabled: boolean; value: string }) {\n const { registerTab, unregisterTab } = useTabsContext();\n const pressableRef = React.useRef<React.ElementRef<typeof Pressable> | null>(null);\n\n React.useEffect(() => {\n registerTab({\n disabled,\n focus: () => {\n const focusable = pressableRef.current as unknown as {\n focus?: (() => void) | undefined;\n } | null;\n focusable?.focus?.();\n },\n value,\n });\n\n return () => unregisterTab(value);\n }, [disabled, registerTab, unregisterTab, value]);\n\n return pressableRef;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabsContext.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,gDAAgD;AAChD,wBAAgB,cAAc,IAAI,gBAAgB,CAMjD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { TabsContext } from './TabsContext';
|
|
3
|
+
/*** Returns the active Tabs feature context. */
|
|
3
4
|
export function useTabsContext() {
|
|
4
5
|
const value = React.use(TabsContext);
|
|
5
|
-
if (!value)
|
|
6
|
+
if (!value)
|
|
6
7
|
throw new Error('Tabs components must be used within <Tabs>.');
|
|
7
|
-
}
|
|
8
8
|
return value;
|
|
9
9
|
}
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=useTabsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabsContext.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,gDAAgD;AAChD,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAE3E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabsContextValue } from '../../../types/tabs';\nimport { TabsContext } from './TabsContext';\n\n/*** Returns the active Tabs feature context. */\nexport function useTabsContext(): TabsContextValue {\n const value = React.use(TabsContext);\n\n if (!value) throw new Error('Tabs components must be used within <Tabs>.');\n\n return value;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TabsContextValue, TabsProps } from '../../../types/tabs';
|
|
2
|
+
/*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */
|
|
3
|
+
export declare function useTabsController({ defaultValue, onValueChange, testID, value, }: Pick<TabsProps, 'defaultValue' | 'onValueChange' | 'testID' | 'value'>): TabsContextValue;
|
|
4
|
+
//# sourceMappingURL=useTabsController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabsController.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGxF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,GACN,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,gBAAgB,CA0C3F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useControllableState } from '../../../internal/useControllableState';
|
|
3
|
+
import { resolveTabElementId } from '../utils/resolveTabElementId';
|
|
4
|
+
/*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */
|
|
5
|
+
export function useTabsController({ defaultValue, onValueChange, testID, value, }) {
|
|
6
|
+
const [activeValue, setActiveValue] = useControllableState({
|
|
7
|
+
defaultValue,
|
|
8
|
+
onChange: (nextValue) => {
|
|
9
|
+
if (nextValue !== undefined)
|
|
10
|
+
onValueChange?.(nextValue);
|
|
11
|
+
},
|
|
12
|
+
value,
|
|
13
|
+
});
|
|
14
|
+
const [focusedValue, setFocusedValue] = React.useState(undefined);
|
|
15
|
+
const [tabs, setTabs] = React.useState([]);
|
|
16
|
+
const registerTab = React.useCallback((tab) => {
|
|
17
|
+
setTabs((current) => current.some((entry) => entry.value === tab.value)
|
|
18
|
+
? current.map((entry) => (entry.value === tab.value ? tab : entry))
|
|
19
|
+
: [...current, tab]);
|
|
20
|
+
}, []);
|
|
21
|
+
const unregisterTab = React.useCallback((valueToRemove) => {
|
|
22
|
+
setTabs((current) => current.filter((entry) => entry.value !== valueToRemove));
|
|
23
|
+
}, []);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (activeValue !== undefined)
|
|
26
|
+
return;
|
|
27
|
+
const firstEnabledTab = tabs.find((entry) => !entry.disabled);
|
|
28
|
+
if (firstEnabledTab)
|
|
29
|
+
setActiveValue(firstEnabledTab.value);
|
|
30
|
+
}, [activeValue, setActiveValue, tabs]);
|
|
31
|
+
return React.useMemo(() => ({
|
|
32
|
+
activeValue,
|
|
33
|
+
focusedValue,
|
|
34
|
+
getPanelId: (tabValue) => resolveTabElementId('panel', testID, tabValue),
|
|
35
|
+
getTabId: (tabValue) => resolveTabElementId('tab', testID, tabValue),
|
|
36
|
+
registerTab,
|
|
37
|
+
setActiveValue: (nextValue) => setActiveValue(nextValue),
|
|
38
|
+
setFocusedValue,
|
|
39
|
+
tabs,
|
|
40
|
+
unregisterTab,
|
|
41
|
+
}), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useTabsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabsController.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,GACkE;IACvE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,oBAAoB,CAAqB;QAC7E,YAAY;QACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;YACtB,IAAI,SAAS,KAAK,SAAS;gBAAE,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,KAAK;KACN,CAAC,CAAC;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA6B,EAAE,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAoB,EAAE,EAAE;QAC7D,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAClB,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CA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QACX,cAAc,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;QAChE,eAAe;QACf,IAAI;QACJ,aAAa;KACd,CAAC,EACF,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CACtF,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { useControllableState } from '../../../internal/useControllableState';\nimport type { TabRegistration, TabsContextValue, TabsProps } from '../../../types/tabs';\nimport { resolveTabElementId } from '../utils/resolveTabElementId';\n\n/*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */\nexport function useTabsController({\n defaultValue,\n onValueChange,\n testID,\n value,\n}: Pick<TabsProps, 'defaultValue' | 'onValueChange' | 'testID' | 'value'>): TabsContextValue {\n const [activeValue, setActiveValue] = useControllableState<string | undefined>({\n defaultValue,\n onChange: (nextValue) => {\n if (nextValue !== undefined) onValueChange?.(nextValue);\n },\n value,\n });\n const [focusedValue, setFocusedValue] = React.useState<string | undefined>(undefined);\n const [tabs, setTabs] = React.useState<readonly TabRegistration[]>([]);\n\n const registerTab = React.useCallback((tab: TabRegistration) => {\n setTabs((current) =>\n current.some((entry) => entry.value === tab.value)\n ? current.map((entry) => (entry.value === tab.value ? tab : entry))\n : [...current, tab],\n );\n }, []);\n const unregisterTab = React.useCallback((valueToRemove: string) => {\n setTabs((current) => current.filter((entry) => entry.value !== valueToRemove));\n }, []);\n\n React.useEffect(() => {\n if (activeValue !== undefined) return;\n const firstEnabledTab = tabs.find((entry) => !entry.disabled);\n if (firstEnabledTab) setActiveValue(firstEnabledTab.value);\n }, [activeValue, setActiveValue, tabs]);\n\n return React.useMemo(\n () => ({\n activeValue,\n focusedValue,\n getPanelId: (tabValue: string) => resolveTabElementId('panel', testID, tabValue),\n getTabId: (tabValue: string) => resolveTabElementId('tab', testID, tabValue),\n registerTab,\n setActiveValue: (nextValue: string) => setActiveValue(nextValue),\n setFocusedValue,\n tabs,\n unregisterTab,\n }),\n [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab],\n );\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from '../../types/tabs';
|
|
2
|
+
export { Tab } from './adapters/inbound/Tab';
|
|
3
|
+
export { TabList } from './adapters/inbound/TabList';
|
|
4
|
+
export { TabPanel } from './adapters/inbound/TabPanel';
|
|
5
|
+
export { Tabs } from './adapters/inbound/Tabs';
|
|
6
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export type { TabListProps, TabPanelProps, TabProps, TabsProps } from '../../types/tabs';\nexport { Tab } from './adapters/inbound/Tab';\nexport { TabList } from './adapters/inbound/TabList';\nexport { TabPanel } from './adapters/inbound/TabPanel';\nexport { Tabs } from './adapters/inbound/Tabs';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TabNavigationKey, TabRegistration } from '../../../types/tabs';
|
|
2
|
+
/*** Resolves the next enabled tab for keyboard focus navigation. */
|
|
3
|
+
export declare function resolveNextTabValue(tabs: readonly TabRegistration[], currentValue: string | undefined, key: TabNavigationKey): string | undefined;
|
|
4
|
+
//# sourceMappingURL=resolveNextTabValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveNextTabValue.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/utils/resolveNextTabValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7E,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,eAAe,EAAE,EAChC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,GAAG,EAAE,gBAAgB,GACpB,MAAM,GAAG,SAAS,CAgBpB"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
+
/*** Resolves the next enabled tab for keyboard focus navigation. */
|
|
1
2
|
export function resolveNextTabValue(tabs, currentValue, key) {
|
|
2
3
|
const enabledTabs = tabs.filter((tab) => !tab.disabled);
|
|
3
|
-
if (enabledTabs.length === 0)
|
|
4
|
+
if (enabledTabs.length === 0)
|
|
4
5
|
return undefined;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (key === 'End') {
|
|
10
|
-
return enabledTabs[enabledTabs.length - 1]?.value;
|
|
11
|
-
}
|
|
6
|
+
if (key === 'Home')
|
|
7
|
+
return enabledTabs.at(0)?.value;
|
|
8
|
+
if (key === 'End')
|
|
9
|
+
return enabledTabs.at(-1)?.value;
|
|
12
10
|
const currentIndex = enabledTabs.findIndex((tab) => tab.value === currentValue);
|
|
13
|
-
if (currentIndex === -1)
|
|
14
|
-
return enabledTabs
|
|
15
|
-
}
|
|
11
|
+
if (currentIndex === -1)
|
|
12
|
+
return enabledTabs.at(0)?.value;
|
|
16
13
|
const nextIndex = key === 'ArrowLeft' || key === 'ArrowUp'
|
|
17
14
|
? (currentIndex - 1 + enabledTabs.length) % enabledTabs.length
|
|
18
15
|
: (currentIndex + 1) % enabledTabs.length;
|
|
19
|
-
return enabledTabs
|
|
16
|
+
return enabledTabs.at(nextIndex)?.value;
|
|
20
17
|
}
|
|
21
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=resolveNextTabValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveNextTabValue.js","sourceRoot":"","sources":["../../../../src/features/tabs/utils/resolveNextTabValue.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,MAAM,UAAU,mBAAmB,CACjC,IAAgC,EAChC,YAAgC,EAChC,GAAqB;IAErB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE/C,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;IACpD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;IAEpD,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;IAChF,IAAI,YAAY,KAAK,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;IAEzD,MAAM,SAAS,GACb,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,SAAS;QACtC,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM;QAC9D,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC;IAE9C,OAAO,WAAW,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC;AAC1C,CAAC","sourcesContent":["import type { TabNavigationKey, TabRegistration } from '../../../types/tabs';\n\n/*** Resolves the next enabled tab for keyboard focus navigation. */\nexport function resolveNextTabValue(\n tabs: readonly TabRegistration[],\n currentValue: string | undefined,\n key: TabNavigationKey,\n): string | undefined {\n const enabledTabs = tabs.filter((tab) => !tab.disabled);\n if (enabledTabs.length === 0) return undefined;\n\n if (key === 'Home') return enabledTabs.at(0)?.value;\n if (key === 'End') return enabledTabs.at(-1)?.value;\n\n const currentIndex = enabledTabs.findIndex((tab) => tab.value === currentValue);\n if (currentIndex === -1) return enabledTabs.at(0)?.value;\n\n const nextIndex =\n key === 'ArrowLeft' || key === 'ArrowUp'\n ? (currentIndex - 1 + enabledTabs.length) % enabledTabs.length\n : (currentIndex + 1) % enabledTabs.length;\n\n return enabledTabs.at(nextIndex)?.value;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTabElementId.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/utils/resolveTabElementId.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,KAAK,GAAG,OAAO,EACrB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,MAAM,CAGR"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*** Creates a stable tab or tab-panel id from a Tabs test id and tab value. */
|
|
2
|
+
export function resolveTabElementId(kind, testID, value) {
|
|
3
|
+
const base = testID ? `${testID}-tabs` : 'tabs';
|
|
4
|
+
return `${base}-${kind}-${sanitizeTabValue(value)}`;
|
|
5
|
+
}
|
|
6
|
+
/*** Normalizes a tab value for use inside an accessibility id. */
|
|
7
|
+
function sanitizeTabValue(value) {
|
|
8
|
+
return value.trim().replace(/[^a-zA-Z0-9_-]+/g, '-');
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=resolveTabElementId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTabElementId.js","sourceRoot":"","sources":["../../../../src/features/tabs/utils/resolveTabElementId.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CACjC,IAAqB,EACrB,MAA0B,EAC1B,KAAa;IAEb,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,GAAG,IAAI,IAAI,IAAI,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,kEAAkE;AAClE,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC","sourcesContent":["/*** Creates a stable tab or tab-panel id from a Tabs test id and tab value. */\nexport function resolveTabElementId(\n kind: 'tab' | 'panel',\n testID: string | undefined,\n value: string,\n): string {\n const base = testID ? `${testID}-tabs` : 'tabs';\n return `${base}-${kind}-${sanitizeTabValue(value)}`;\n}\n\n/*** Normalizes a tab value for use inside an accessibility id. */\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/[^a-zA-Z0-9_-]+/g, '-');\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TooltipProps } from '../../../../types/tooltip';
|
|
3
|
+
/*** Presents delayed hover/focus help through the shared Popover foundation. */
|
|
4
|
+
export declare function Tooltip({ children, content, delay, interactionPolicy, placement, testID, }: TooltipProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/features/tooltip/adapters/inbound/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM9D,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,KAAW,EACX,iBAA6B,EAC7B,SAAiB,EACjB,MAAM,GACP,EAAE,YAAY,qBAqCd"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Pressable, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
4
|
+
import { Popover } from '../../../popover/public';
|
|
5
|
+
import { Surface } from '../../../surface/public';
|
|
6
|
+
import { Text } from '../../../typography/public';
|
|
7
|
+
import { useTooltipVisibility } from '../../composition/useTooltipVisibility';
|
|
8
|
+
/*** Presents delayed hover/focus help through the shared Popover foundation. */
|
|
9
|
+
export function Tooltip({ children, content, delay = 150, interactionPolicy = 'enabled', placement = 'top', testID, }) {
|
|
10
|
+
const { theme } = useTheme();
|
|
11
|
+
const passive = interactionPolicy === 'passive';
|
|
12
|
+
const { hide, setVisible, show, visible } = useTooltipVisibility(delay, passive);
|
|
13
|
+
return (<Popover closeOnOutsidePress={false} interactionPolicy={interactionPolicy} onOpenChange={setVisible} open={visible} placement={placement} testID={testID} anchor={() => (<Pressable onBlur={passive ? undefined : hide} onFocus={passive ? undefined : show} onHoverIn={Platform.OS === 'web' && !passive ? show : undefined} onHoverOut={Platform.OS === 'web' && !passive ? hide : undefined}>
|
|
14
|
+
{children}
|
|
15
|
+
</Pressable>)}>
|
|
16
|
+
<View pointerEvents="none">
|
|
17
|
+
<Surface p="s" style={{ backgroundColor: theme.semantics.surface.inverse }} variant="raised">
|
|
18
|
+
<Text emphasis="inverse" variant="caption">
|
|
19
|
+
{content}
|
|
20
|
+
</Text>
|
|
21
|
+
</Surface>
|
|
22
|
+
</View>
|
|
23
|
+
</Popover>);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../../../src/features/tooltip/adapters/inbound/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,gFAAgF;AAChF,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,GAAG,EACX,iBAAiB,GAAG,SAAS,EAC7B,SAAS,GAAG,KAAK,EACjB,MAAM,GACO;IACb,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,iBAAiB,KAAK,SAAS,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAEjF,OAAO,CACL,CAAC,OAAO,CACN,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,YAAY,CAAC,CAAC,UAAU,CAAC,CACzB,IAAI,CAAC,CAAC,OAAO,CAAC,CACd,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CACZ,CAAC,SAAS,CACR,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CACpC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAChE,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjE;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,SAAS,CAAC,CACb,CAAC,CAEF;MAAA,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CACxB;QAAA,CAAC,OAAO,CACN,CAAC,CAAC,GAAG,CACL,KAAK,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAC5D,OAAO,CAAC,QAAQ,CAEhB;UAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CACxC;YAAA,CAAC,OAAO,CACV;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,OAAO,CACX;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,OAAO,CAAC,CACX,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, Pressable, View } from 'react-native';\n\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { TooltipProps } from '../../../../types/tooltip';\nimport { Popover } from '../../../popover/public';\nimport { Surface } from '../../../surface/public';\nimport { Text } from '../../../typography/public';\nimport { useTooltipVisibility } from '../../composition/useTooltipVisibility';\n\n/*** Presents delayed hover/focus help through the shared Popover foundation. */\nexport function Tooltip({\n children,\n content,\n delay = 150,\n interactionPolicy = 'enabled',\n placement = 'top',\n testID,\n}: TooltipProps) {\n const { theme } = useTheme();\n const passive = interactionPolicy === 'passive';\n const { hide, setVisible, show, visible } = useTooltipVisibility(delay, passive);\n\n return (\n <Popover\n closeOnOutsidePress={false}\n interactionPolicy={interactionPolicy}\n onOpenChange={setVisible}\n open={visible}\n placement={placement}\n testID={testID}\n anchor={() => (\n <Pressable\n onBlur={passive ? undefined : hide}\n onFocus={passive ? undefined : show}\n onHoverIn={Platform.OS === 'web' && !passive ? show : undefined}\n onHoverOut={Platform.OS === 'web' && !passive ? hide : undefined}\n >\n {children}\n </Pressable>\n )}\n >\n <View pointerEvents=\"none\">\n <Surface\n p=\"s\"\n style={{ backgroundColor: theme.semantics.surface.inverse }}\n variant=\"raised\"\n >\n <Text emphasis=\"inverse\" variant=\"caption\">\n {content}\n </Text>\n </Surface>\n </View>\n </Popover>\n );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/*** Manages delayed tooltip visibility and timer cleanup. */
|
|
3
|
+
export declare function useTooltipVisibility(delay: number, passive: boolean): {
|
|
4
|
+
readonly hide: () => void;
|
|
5
|
+
readonly setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
+
readonly show: () => void;
|
|
7
|
+
readonly visible: boolean;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useTooltipVisibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTooltipVisibility.d.ts","sourceRoot":"","sources":["../../../../src/features/tooltip/composition/useTooltipVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;;;EAyBnE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/*** Manages delayed tooltip visibility and timer cleanup. */
|
|
3
|
+
export function useTooltipVisibility(delay, passive) {
|
|
4
|
+
const timeoutRef = React.useRef(null);
|
|
5
|
+
const [visible, setVisible] = React.useState(false);
|
|
6
|
+
const clearTimer = React.useCallback(() => {
|
|
7
|
+
if (timeoutRef.current) {
|
|
8
|
+
clearTimeout(timeoutRef.current);
|
|
9
|
+
timeoutRef.current = null;
|
|
10
|
+
}
|
|
11
|
+
}, []);
|
|
12
|
+
const show = React.useCallback(() => {
|
|
13
|
+
if (passive)
|
|
14
|
+
return;
|
|
15
|
+
clearTimer();
|
|
16
|
+
timeoutRef.current = setTimeout(() => setVisible(true), delay);
|
|
17
|
+
}, [clearTimer, delay, passive]);
|
|
18
|
+
const hide = React.useCallback(() => {
|
|
19
|
+
clearTimer();
|
|
20
|
+
setVisible(false);
|
|
21
|
+
}, [clearTimer]);
|
|
22
|
+
React.useEffect(() => clearTimer, [clearTimer]);
|
|
23
|
+
return { hide, setVisible, show, visible };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=useTooltipVisibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTooltipVisibility.js","sourceRoot":"","sources":["../../../../src/features/tooltip/composition/useTooltipVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,6DAA6D;AAC7D,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,OAAgB;IAClE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAuC,IAAI,CAAC,CAAC;IAC5E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,OAAO;YAAE,OAAO;QACpB,UAAU,EAAE,CAAC;QACb,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,UAAU,EAAE,CAAC;QACb,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEhD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAW,CAAC;AACtD,CAAC","sourcesContent":["import React from 'react';\n\n/*** Manages delayed tooltip visibility and timer cleanup. */\nexport function useTooltipVisibility(delay: number, passive: boolean) {\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const [visible, setVisible] = React.useState(false);\n\n const clearTimer = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n }, []);\n\n const show = React.useCallback(() => {\n if (passive) return;\n clearTimer();\n timeoutRef.current = setTimeout(() => setVisible(true), delay);\n }, [clearTimer, delay, passive]);\n\n const hide = React.useCallback(() => {\n clearTimer();\n setVisible(false);\n }, [clearTimer]);\n\n React.useEffect(() => clearTimer, [clearTimer]);\n\n return { hide, setVisible, show, visible } as const;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/tooltip/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/tooltip/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type { TooltipProps } from '../../types/tooltip';\nexport { Tooltip } from './adapters/inbound/Tooltip';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,18 +6,10 @@ export type { LabelProps } from './components/label';
|
|
|
6
6
|
export { Label } from './components/label';
|
|
7
7
|
export type { ListItemProps } from './components/list-item';
|
|
8
8
|
export { ListItem } from './components/list-item';
|
|
9
|
-
export type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './components/menu';
|
|
10
|
-
export { Menu } from './components/menu';
|
|
11
|
-
export type { ModalProps } from './components/modal';
|
|
12
|
-
export { Modal } from './components/modal';
|
|
13
9
|
export type { SwitchProps } from './components/switch';
|
|
14
10
|
export { Switch } from './components/switch';
|
|
15
|
-
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';
|
|
16
|
-
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
17
11
|
export type { TextareaProps } from './components/textarea';
|
|
18
12
|
export { Textarea } from './components/textarea';
|
|
19
|
-
export type { TooltipProps } from './components/tooltip';
|
|
20
|
-
export { Tooltip } from './components/tooltip';
|
|
21
13
|
export type { FontRuntime } from './context/FontContext';
|
|
22
14
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
23
15
|
export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
|
|
@@ -45,12 +37,20 @@ export type { KeyboardAvoidingViewBehavior, KeyboardAvoidingViewProps, } from '.
|
|
|
45
37
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
46
38
|
export type { BoxProps, ContainerProps, DividerProps, GridProps, StackProps, } from './features/layout/public';
|
|
47
39
|
export { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
40
|
+
export type { ModalProps } from './features/modal/public';
|
|
41
|
+
export { Modal } from './features/modal/public';
|
|
48
42
|
export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from './features/popover/public';
|
|
49
43
|
export { Popover } from './features/popover/public';
|
|
44
|
+
export type { PopoverMenuAction, PopoverMenuActionIntent, PopoverMenuProps, } from './features/popover-menu/public';
|
|
45
|
+
export { PopoverMenu } from './features/popover-menu/public';
|
|
50
46
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
51
47
|
export { Surface } from './features/surface/public';
|
|
48
|
+
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';
|
|
49
|
+
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
52
50
|
export type { ToastController, ToastOptions, ToastProps, ToastProviderProps, ToastStatus, } from './features/toast/public';
|
|
53
51
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
52
|
+
export type { TooltipProps } from './features/tooltip/public';
|
|
53
|
+
export { Tooltip } from './features/tooltip/public';
|
|
54
54
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
55
55
|
export { Heading, Text } from './features/typography/public';
|
|
56
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,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,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,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
|
@@ -2,12 +2,8 @@ export { Field } from './components/field';
|
|
|
2
2
|
export { HelperText } from './components/helper-text';
|
|
3
3
|
export { Label } from './components/label';
|
|
4
4
|
export { ListItem } from './components/list-item';
|
|
5
|
-
export { Menu } from './components/menu';
|
|
6
|
-
export { Modal } from './components/modal';
|
|
7
5
|
export { Switch } from './components/switch';
|
|
8
|
-
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
9
6
|
export { Textarea } from './components/textarea';
|
|
10
|
-
export { Tooltip } from './components/tooltip';
|
|
11
7
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
12
8
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
13
9
|
export * from './core/responsive';
|
|
@@ -22,9 +18,13 @@ export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
|
|
|
22
18
|
export { Image } from './features/image/public';
|
|
23
19
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
24
20
|
export { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
21
|
+
export { Modal } from './features/modal/public';
|
|
25
22
|
export { Popover } from './features/popover/public';
|
|
23
|
+
export { PopoverMenu } from './features/popover-menu/public';
|
|
26
24
|
export { Surface } from './features/surface/public';
|
|
25
|
+
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
27
26
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
27
|
+
export { Tooltip } from './features/tooltip/public';
|
|
28
28
|
export { Heading, Text } from './features/typography/public';
|
|
29
29
|
export * from './layout';
|
|
30
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,
|
|
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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO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MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAE7D,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,UAAU,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 { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\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 { ModalProps } from './features/modal/public';\nexport { Modal } from './features/modal/public';\nexport type {\n PopoverAnchorRenderProps,\n PopoverPlacement,\n PopoverProps,\n} from './features/popover/public';\nexport { Popover } from './features/popover/public';\nexport type {\n PopoverMenuAction,\n PopoverMenuActionIntent,\n PopoverMenuProps,\n} from './features/popover-menu/public';\nexport { PopoverMenu } from './features/popover-menu/public';\nexport type { SurfaceProps, SurfaceVariant } from './features/surface/public';\nexport { Surface } from './features/surface/public';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';\nexport { Tab, TabList, TabPanel, Tabs } from './features/tabs/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 { TooltipProps } from './features/tooltip/public';\nexport { Tooltip } from './features/tooltip/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,9 +1,12 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
export type BottomSheetContentMode = 'view' | 'direct';
|
|
2
3
|
export interface BottomSheetPresentOptions {
|
|
3
4
|
content: React.ReactNode;
|
|
5
|
+
contentMode?: BottomSheetContentMode;
|
|
4
6
|
snapPoints?: readonly (number | string)[];
|
|
5
7
|
initialIndex?: number;
|
|
6
8
|
enableDynamicSizing?: boolean;
|
|
9
|
+
maxDynamicContentSize?: number;
|
|
7
10
|
enablePanDownToClose?: boolean;
|
|
8
11
|
dismissOnBackdropPress?: boolean;
|
|
9
12
|
keyboardBehavior?: 'extend' | 'fillParent' | 'interactive';
|