@ankhorage/surface 5.0.0 → 6.0.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 +2 -3
- package/dist/components/field/Field.d.ts +1 -0
- package/dist/components/field/Field.d.ts.map +1 -1
- package/dist/components/field/Field.js +5 -4
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/list-item/ListItem.d.ts +1 -0
- package/dist/components/list-item/ListItem.d.ts.map +1 -1
- package/dist/components/list-item/ListItem.js +13 -12
- package/dist/components/list-item/ListItem.js.map +1 -1
- package/dist/components/switch/Switch.d.ts +1 -0
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +10 -13
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/{layout → core/responsive}/Show.d.ts +2 -1
- package/dist/core/responsive/Show.d.ts.map +1 -0
- package/dist/{layout → core/responsive}/Show.js +3 -1
- package/dist/core/responsive/Show.js.map +1 -0
- package/dist/core/responsive/index.d.ts +1 -0
- package/dist/core/responsive/index.d.ts.map +1 -1
- package/dist/core/responsive/index.js +1 -0
- package/dist/core/responsive/index.js.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts +5 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.js +40 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -0
- package/dist/features/app-bar/public.d.ts +3 -0
- package/dist/features/app-bar/public.d.ts.map +1 -0
- package/dist/features/app-bar/public.js +2 -0
- package/dist/features/app-bar/public.js.map +1 -0
- package/dist/features/badge/adapters/inbound/Badge.js +3 -3
- package/dist/features/badge/adapters/inbound/Badge.js.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +8 -8
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/button/adapters/inbound/IconButton.js +3 -3
- package/dist/features/button/adapters/inbound/IconButton.js.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js +7 -7
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.js +8 -8
- package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -1
- package/dist/features/layout/adapters/inbound/Divider.js +2 -2
- package/dist/features/layout/adapters/inbound/Divider.js.map +1 -1
- package/dist/features/layout/adapters/inbound/Grid.d.ts.map +1 -1
- package/dist/features/layout/adapters/inbound/Grid.js +7 -9
- package/dist/features/layout/adapters/inbound/Grid.js.map +1 -1
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/ScrollView.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/ScrollView.js +69 -0
- package/dist/features/layout/adapters/inbound/ScrollView.js.map +1 -0
- package/dist/features/layout/adapters/inbound/View.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/View.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/View.js +17 -0
- package/dist/features/layout/adapters/inbound/View.js.map +1 -0
- package/dist/features/layout/public.d.ts +3 -4
- package/dist/features/layout/public.d.ts.map +1 -1
- package/dist/features/layout/public.js +2 -3
- package/dist/features/layout/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.map +1 -1
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +11 -12
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -1
- package/dist/features/surface/adapters/inbound/Surface.d.ts +1 -1
- package/dist/features/surface/adapters/inbound/Surface.d.ts.map +1 -1
- package/dist/features/surface/adapters/inbound/Surface.js +3 -3
- package/dist/features/surface/adapters/inbound/Surface.js.map +1 -1
- 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 +40 -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/toast/adapters/inbound/Toast.js +5 -5
- package/dist/features/toast/adapters/inbound/Toast.js.map +1 -1
- package/dist/features/toast/adapters/inbound/ToastProvider.js +3 -3
- package/dist/features/toast/adapters/inbound/ToastProvider.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/primitives/button-base/ButtonBase.d.ts +1 -0
- package/dist/primitives/button-base/ButtonBase.d.ts.map +1 -1
- package/dist/primitives/button-base/ButtonBase.js +6 -5
- package/dist/primitives/button-base/ButtonBase.js.map +1 -1
- package/dist/primitives/button-base/types.d.ts +2 -2
- package/dist/primitives/button-base/types.d.ts.map +1 -1
- package/dist/primitives/button-base/types.js.map +1 -1
- package/dist/types/app-bar.d.ts +12 -0
- package/dist/types/app-bar.d.ts.map +1 -0
- package/dist/types/app-bar.js +2 -0
- package/dist/types/app-bar.js.map +1 -0
- package/dist/types/layout.d.ts +15 -17
- package/dist/types/layout.d.ts.map +1 -1
- package/dist/types/layout.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/surface.d.ts +2 -2
- package/dist/types/surface.d.ts.map +1 -1
- package/dist/types/surface.js.map +1 -1
- 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/utils/resolveViewStyles.d.ts +7 -0
- package/dist/utils/resolveViewStyles.d.ts.map +1 -0
- package/dist/utils/{resolveBoxStyles.js → resolveViewStyles.js} +11 -4
- package/dist/utils/resolveViewStyles.js.map +1 -0
- package/package.json +1 -1
- package/src/components/field/Field.tsx +5 -4
- package/src/components/list-item/ListItem.tsx +17 -13
- package/src/components/switch/Switch.tsx +10 -15
- package/src/{layout → core/responsive}/Show.tsx +4 -1
- package/src/core/responsive/index.ts +1 -0
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +69 -0
- package/src/features/app-bar/public.ts +2 -0
- package/src/features/badge/adapters/inbound/Badge.tsx +3 -3
- package/src/features/button/adapters/inbound/Button.tsx +8 -8
- package/src/features/button/adapters/inbound/IconButton.tsx +3 -3
- package/src/features/form/checkbox/adapters/inbound/Checkbox.tsx +7 -7
- package/src/features/form/radio/adapters/inbound/Radio.tsx +8 -8
- package/src/features/layout/adapters/inbound/Divider.tsx +2 -2
- package/src/features/layout/adapters/inbound/Grid.tsx +12 -14
- package/src/features/layout/adapters/inbound/ScrollView.tsx +102 -0
- package/src/features/layout/adapters/inbound/{Box.tsx → View.tsx} +9 -9
- package/src/features/layout/public.ts +3 -10
- package/src/features/modal/adapters/inbound/Modal.tsx +77 -0
- package/src/features/modal/public.ts +2 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +11 -14
- package/src/features/surface/adapters/inbound/Surface.tsx +3 -3
- package/src/features/tabs/adapters/inbound/Tab.tsx +67 -0
- package/src/features/tabs/adapters/inbound/TabList.tsx +47 -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/toast/adapters/inbound/Toast.tsx +5 -5
- package/src/features/toast/adapters/inbound/ToastProvider.tsx +3 -3
- package/src/index.test.ts +14 -38
- package/src/index.ts +8 -13
- package/src/primitives/button-base/ButtonBase.tsx +6 -8
- package/src/primitives/button-base/types.ts +2 -2
- package/src/types/app-bar.ts +13 -0
- package/src/types/layout.ts +25 -20
- package/src/{components/modal/types.ts → types/modal.ts} +1 -1
- package/src/types/surface.ts +2 -2
- package/src/types/tabs.ts +51 -0
- package/src/utils/resolveViewStyles.test.ts +71 -0
- package/src/utils/{resolveBoxStyles.ts → resolveViewStyles.ts} +16 -9
- package/src/webAcceptance.test.tsx +8 -9
- 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/features/layout/adapters/inbound/Box.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Box.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Box.js +0 -17
- package/dist/features/layout/adapters/inbound/Box.js.map +0 -1
- package/dist/features/layout/adapters/inbound/Container.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Container.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Container.js +0 -28
- package/dist/features/layout/adapters/inbound/Container.js.map +0 -1
- package/dist/features/layout/adapters/inbound/Stack.d.ts +0 -5
- package/dist/features/layout/adapters/inbound/Stack.d.ts.map +0 -1
- package/dist/features/layout/adapters/inbound/Stack.js +0 -27
- package/dist/features/layout/adapters/inbound/Stack.js.map +0 -1
- package/dist/layout/AppBar.d.ts +0 -13
- package/dist/layout/AppBar.d.ts.map +0 -1
- package/dist/layout/AppBar.js +0 -30
- package/dist/layout/AppBar.js.map +0 -1
- package/dist/layout/Center.d.ts +0 -7
- package/dist/layout/Center.d.ts.map +0 -1
- package/dist/layout/Center.js +0 -12
- package/dist/layout/Center.js.map +0 -1
- package/dist/layout/Inline.d.ts +0 -5
- package/dist/layout/Inline.d.ts.map +0 -1
- package/dist/layout/Inline.js +0 -6
- package/dist/layout/Inline.js.map +0 -1
- package/dist/layout/ScrollArea.d.ts +0 -9
- package/dist/layout/ScrollArea.d.ts.map +0 -1
- package/dist/layout/ScrollArea.js +0 -52
- package/dist/layout/ScrollArea.js.map +0 -1
- package/dist/layout/Show.d.ts.map +0 -1
- package/dist/layout/Show.js.map +0 -1
- package/dist/layout/Spacer.d.ts +0 -9
- package/dist/layout/Spacer.d.ts.map +0 -1
- package/dist/layout/Spacer.js +0 -12
- package/dist/layout/Spacer.js.map +0 -1
- package/dist/layout/Template.d.ts +0 -18
- package/dist/layout/Template.d.ts.map +0 -1
- package/dist/layout/Template.js +0 -36
- package/dist/layout/Template.js.map +0 -1
- package/dist/layout/index.d.ts +0 -15
- package/dist/layout/index.d.ts.map +0 -1
- package/dist/layout/index.js +0 -8
- package/dist/layout/index.js.map +0 -1
- package/dist/utils/resolveBoxStyles.d.ts +0 -7
- package/dist/utils/resolveBoxStyles.d.ts.map +0 -1
- package/dist/utils/resolveBoxStyles.js.map +0 -1
- 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/features/layout/adapters/inbound/Container.tsx +0 -43
- package/src/features/layout/adapters/inbound/Stack.test.ts +0 -13
- package/src/features/layout/adapters/inbound/Stack.tsx +0 -44
- package/src/layout/AppBar.tsx +0 -60
- package/src/layout/Center.tsx +0 -22
- package/src/layout/Inline.tsx +0 -9
- package/src/layout/ScrollArea.tsx +0 -116
- package/src/layout/Spacer.tsx +0 -22
- package/src/layout/Template.tsx +0 -86
- package/src/layout/index.ts +0 -14
- package/src/utils/resolveBoxStyles.test.ts +0 -54
|
@@ -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"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleSheet } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
4
|
-
import {
|
|
4
|
+
import { View } from '../../../layout/public';
|
|
5
5
|
import { Surface } from '../../../surface/public';
|
|
6
6
|
import { Text } from '../../../typography/public';
|
|
7
7
|
/*** Renders one transient toast notification. */
|
|
@@ -12,17 +12,17 @@ export function Toast({ title, description, status = 'default', onDismiss, inter
|
|
|
12
12
|
const passive = interactionPolicy === 'passive';
|
|
13
13
|
const statusStyle = React.useMemo(() => ({ borderLeftColor: statusColor }), [statusColor]);
|
|
14
14
|
return (<Surface p="m" style={[styles.root, statusStyle]} testID={testID} variant="raised">
|
|
15
|
-
<
|
|
16
|
-
<
|
|
15
|
+
<View align="center" direction="row" justify="space-between">
|
|
16
|
+
<View flex={1}>
|
|
17
17
|
{title ? (<Text variant="label" weight="medium">
|
|
18
18
|
{title}
|
|
19
19
|
</Text>) : null}
|
|
20
20
|
{description ? <Text emphasis="muted">{description}</Text> : null}
|
|
21
|
-
</
|
|
21
|
+
</View>
|
|
22
22
|
{onDismiss ? (<Pressable accessibilityLabel="Dismiss notification" accessibilityRole="button" onPress={passive ? undefined : onDismiss} testID={testID ? `${testID}-dismiss` : undefined}>
|
|
23
23
|
<Text color={statusTextColor}>×</Text>
|
|
24
24
|
</Pressable>) : null}
|
|
25
|
-
</
|
|
25
|
+
</View>
|
|
26
26
|
</Surface>);
|
|
27
27
|
}
|
|
28
28
|
/*** Resolves the border color representing a toast status. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../../../src/features/toast/adapters/inbound/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../../../src/features/toast/adapters/inbound/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAGr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,SAAS,2BAA2B,CAAC,MAA4B;IAC/D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,eAAe,EAAE,CAAC;QAClB,QAAQ,EAAE,GAAG;QACb,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QACrC,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,EAAE;KACjB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, type ViewStyle } from 'react-native';\n\nimport type { SurfaceColor } from '../../../../surfaceColor';\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../../../theme/types';\nimport type { ToastProps } from '../../../../types/toast';\nimport { View } from '../../../layout/public';\nimport { Surface } from '../../../surface/public';\nimport { Text } from '../../../typography/public';\n\n/*** Renders one transient toast notification. */\nexport function Toast({\n title,\n description,\n status = 'default',\n onDismiss,\n interactionPolicy = 'enabled',\n testID,\n}: ToastProps) {\n const { theme } = useTheme();\n const statusColor = resolveToastStatusColor(theme, status);\n const statusTextColor = resolveToastStatusTextColor(status);\n const passive = interactionPolicy === 'passive';\n const statusStyle = React.useMemo<ViewStyle>(\n () => ({ borderLeftColor: statusColor }),\n [statusColor],\n );\n\n return (\n <Surface p=\"m\" style={[styles.root, statusStyle]} testID={testID} variant=\"raised\">\n <View align=\"center\" direction=\"row\" justify=\"space-between\">\n <View flex={1}>\n {title ? (\n <Text variant=\"label\" weight=\"medium\">\n {title}\n </Text>\n ) : null}\n {description ? <Text emphasis=\"muted\">{description}</Text> : null}\n </View>\n {onDismiss ? (\n <Pressable\n accessibilityLabel=\"Dismiss notification\"\n accessibilityRole=\"button\"\n onPress={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-dismiss` : undefined}\n >\n <Text color={statusTextColor}>×</Text>\n </Pressable>\n ) : null}\n </View>\n </Surface>\n );\n}\n\n/*** Resolves the border color representing a toast status. */\nfunction resolveToastStatusColor(theme: SurfaceTheme, status: ToastProps['status']) {\n switch (status) {\n case 'success':\n return theme.semantics.success.base;\n case 'warning':\n return theme.semantics.warning.base;\n case 'error':\n return theme.semantics.error.base;\n case 'info':\n return theme.semantics.info.base;\n default:\n return theme.semantics.action.primary.base;\n }\n}\n\n/*** Resolves the semantic text color representing a toast status. */\nfunction resolveToastStatusTextColor(status: ToastProps['status']): SurfaceColor {\n switch (status) {\n case 'success':\n return 'success';\n case 'warning':\n return 'warning';\n case 'error':\n return 'error';\n case 'info':\n return 'info';\n default:\n return 'primary';\n }\n}\n\nconst styles = StyleSheet.create({\n root: {\n borderLeftWidth: 3,\n minWidth: 280,\n shadowOffset: { height: 6, width: 0 },\n shadowOpacity: 0.14,\n shadowRadius: 12,\n },\n});\n"]}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import { Portal } from '../../../../internal/overlay/Portal';
|
|
4
4
|
import { resolveOverlayAnimation } from '../../../../internal/resolvers';
|
|
5
|
-
import {
|
|
5
|
+
import { View } from '../../../layout/public';
|
|
6
6
|
import { ToastContext } from '../../composition/ToastContext';
|
|
7
7
|
import { useToastRuntime } from '../../composition/useToastRuntime';
|
|
8
8
|
import { Toast } from './Toast';
|
|
@@ -14,9 +14,9 @@ export function ToastProvider({ children, defaultDuration = 4000 }) {
|
|
|
14
14
|
return (<ToastContext value={controller}>
|
|
15
15
|
{children}
|
|
16
16
|
<Portal layer="toast" visible={toasts.length > 0}>
|
|
17
|
-
<
|
|
17
|
+
<View gap="s" pointerEvents="box-none" style={[styles.container, animationStyle]}>
|
|
18
18
|
{toasts.map((toast) => (<Toast description={toast.description} key={toast.id} onDismiss={() => controller.dismissToast(toast.id)} status={toast.status} testID={toast.testID} title={toast.title}/>))}
|
|
19
|
-
</
|
|
19
|
+
</View>
|
|
20
20
|
</Portal>
|
|
21
21
|
</ToastContext>);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.js","sourceRoot":"","sources":["../../../../../src/features/toast/adapters/inbound/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ToastProvider.js","sourceRoot":"","sources":["../../../../../src/features/toast/adapters/inbound/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,EAAsB;IACpF,MAAM,SAAS,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,EAAE,UAAU,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EAAE;KACZ;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nimport { Portal } from '../../../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../../../internal/resolvers';\nimport type { ToastProviderProps } from '../../../../types/toast';\nimport { View } from '../../../layout/public';\nimport { ToastContext } from '../../composition/ToastContext';\nimport { useToastRuntime } from '../../composition/useToastRuntime';\nimport { Toast } from './Toast';\n\n/*** Provides the toast runtime context and renders its shared portal host. */\nexport function ToastProvider({ children, defaultDuration = 4000 }: ToastProviderProps) {\n const animation = resolveOverlayAnimation('toast');\n const { controller, toasts } = useToastRuntime(defaultDuration);\n const animationStyle = React.useMemo<ViewStyle>(\n () => ({ paddingTop: 16 + animation.offset }),\n [animation.offset],\n );\n\n return (\n <ToastContext value={controller}>\n {children}\n <Portal layer=\"toast\" visible={toasts.length > 0}>\n <View gap=\"s\" pointerEvents=\"box-none\" style={[styles.container, animationStyle]}>\n {toasts.map((toast) => (\n <Toast\n description={toast.description}\n key={toast.id}\n onDismiss={() => controller.dismissToast(toast.id)}\n status={toast.status}\n testID={toast.testID}\n title={toast.title}\n />\n ))}\n </View>\n </Portal>\n </ToastContext>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'flex-end',\n padding: 16,\n },\n});\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,8 @@ 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 { ModalProps } from './components/modal';
|
|
10
|
-
export { Modal } from './components/modal';
|
|
11
9
|
export type { SwitchProps } from './components/switch';
|
|
12
10
|
export { Switch } from './components/switch';
|
|
13
|
-
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';
|
|
14
|
-
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
15
11
|
export type { TextareaProps } from './components/textarea';
|
|
16
12
|
export { Textarea } from './components/textarea';
|
|
17
13
|
export type { FontRuntime } from './context/FontContext';
|
|
@@ -21,6 +17,8 @@ export { TranslationProvider, useTranslationContext } from './context/Translatio
|
|
|
21
17
|
export * from './core/responsive';
|
|
22
18
|
export type { AccordionContentProps, AccordionItemProps, AccordionMode, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTriggerProps, } from './features/accordion/public';
|
|
23
19
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './features/accordion/public';
|
|
20
|
+
export type { AppBarProps } from './features/app-bar/public';
|
|
21
|
+
export { AppBar } from './features/app-bar/public';
|
|
24
22
|
export type { BadgeProps } from './features/badge/public';
|
|
25
23
|
export { Badge } from './features/badge/public';
|
|
26
24
|
export type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';
|
|
@@ -39,14 +37,18 @@ export type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/
|
|
|
39
37
|
export { Image } from './features/image/public';
|
|
40
38
|
export type { KeyboardAvoidingViewBehavior, KeyboardAvoidingViewProps, } from './features/keyboard-avoiding-view/public';
|
|
41
39
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
42
|
-
export type {
|
|
43
|
-
export {
|
|
40
|
+
export type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';
|
|
41
|
+
export { Divider, Grid, ScrollView, View } from './features/layout/public';
|
|
42
|
+
export type { ModalProps } from './features/modal/public';
|
|
43
|
+
export { Modal } from './features/modal/public';
|
|
44
44
|
export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from './features/popover/public';
|
|
45
45
|
export { Popover } from './features/popover/public';
|
|
46
46
|
export type { PopoverMenuAction, PopoverMenuActionIntent, PopoverMenuProps, } from './features/popover-menu/public';
|
|
47
47
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
48
48
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
49
49
|
export { Surface } from './features/surface/public';
|
|
50
|
+
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';
|
|
51
|
+
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
50
52
|
export type { ToastController, ToastOptions, ToastProps, ToastProviderProps, ToastStatus, } from './features/toast/public';
|
|
51
53
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
52
54
|
export type { TooltipProps } from './features/tooltip/public';
|
|
@@ -54,7 +56,6 @@ export { Tooltip } from './features/tooltip/public';
|
|
|
54
56
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
55
57
|
export { Heading, Text } from './features/typography/public';
|
|
56
58
|
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
57
|
-
export * from './layout';
|
|
58
59
|
export type { ButtonBaseProps } from './primitives/button-base';
|
|
59
60
|
export { ButtonBase } from './primitives/button-base';
|
|
60
61
|
export type { SurfaceColor, SurfaceEmphasis, SurfacePaletteColor, SurfaceStatusColor, } from './surfaceColor';
|
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","source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AAO,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,14 +2,13 @@ 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 { Modal } from './components/modal';
|
|
6
5
|
export { Switch } from './components/switch';
|
|
7
|
-
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
8
6
|
export { Textarea } from './components/textarea';
|
|
9
7
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
10
8
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
11
9
|
export * from './core/responsive';
|
|
12
10
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './features/accordion/public';
|
|
11
|
+
export { AppBar } from './features/app-bar/public';
|
|
13
12
|
export { Badge } from './features/badge/public';
|
|
14
13
|
export { Button, IconButton } from './features/button/public';
|
|
15
14
|
export { Card } from './features/card/public';
|
|
@@ -19,14 +18,15 @@ export { TextInput } from './features/form/text-input/public';
|
|
|
19
18
|
export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
|
|
20
19
|
export { Image } from './features/image/public';
|
|
21
20
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
22
|
-
export {
|
|
21
|
+
export { Divider, Grid, ScrollView, View } from './features/layout/public';
|
|
22
|
+
export { Modal } from './features/modal/public';
|
|
23
23
|
export { Popover } from './features/popover/public';
|
|
24
24
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
25
25
|
export { Surface } from './features/surface/public';
|
|
26
|
+
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
26
27
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
27
28
|
export { Tooltip } from './features/tooltip/public';
|
|
28
29
|
export { Heading, Text } from './features/typography/public';
|
|
29
|
-
export * from './layout';
|
|
30
30
|
export { ButtonBase } from './primitives/button-base';
|
|
31
31
|
export { SURFACE_COLORS, SURFACE_EMPHASES, SURFACE_PALETTE_COLORS, SURFACE_STATUS_COLORS, } from './surfaceColor';
|
|
32
32
|
export * from './theme';
|
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,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,m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O,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAG7D,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 { AppBarProps } from './features/app-bar/public';\nexport { AppBar } from './features/app-bar/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 { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';\nexport { Divider, Grid, ScrollView, View } 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 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,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonBaseProps } from './types';
|
|
3
|
+
/*** Renders the low-level token-aware Pressable boundary shared by Surface controls. */
|
|
3
4
|
export declare function ButtonBase({ children, disabled, interactionPolicy, onPress, onLongPress, accessibilityLabel, accessibilityRole, accessibilityState, style, testID, ...props }: ButtonBaseProps): React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=ButtonBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiB/C,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAgB,EAChB,iBAA6B,EAC7B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAA4B,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,eAAe,qBAuCjB"}
|
|
@@ -3,7 +3,8 @@ import { Platform, Pressable } from 'react-native';
|
|
|
3
3
|
import { useResponsiveRuntime } from '../../core/responsive';
|
|
4
4
|
import { resolveFocusRingStyles, resolveInteractiveState, } from '../../internal/resolvers';
|
|
5
5
|
import { useTheme } from '../../theme/ThemeContext';
|
|
6
|
-
import {
|
|
6
|
+
import { resolveViewStyles } from '../../utils/resolveViewStyles';
|
|
7
|
+
/*** Resolves one Pressable state into the canonical Surface interaction state. */
|
|
7
8
|
function getInteractionState(pressableState, hovered, focused, disabled) {
|
|
8
9
|
return resolveInteractiveState({
|
|
9
10
|
pressed: pressableState.pressed,
|
|
@@ -12,22 +13,22 @@ function getInteractionState(pressableState, hovered, focused, disabled) {
|
|
|
12
13
|
disabled,
|
|
13
14
|
});
|
|
14
15
|
}
|
|
16
|
+
/*** Renders the low-level token-aware Pressable boundary shared by Surface controls. */
|
|
15
17
|
export function ButtonBase({ children, disabled = false, interactionPolicy = 'enabled', onPress, onLongPress, accessibilityLabel, accessibilityRole = 'button', accessibilityState, style, testID, ...props }) {
|
|
16
18
|
const { theme } = useTheme();
|
|
17
19
|
const { breakpoint } = useResponsiveRuntime();
|
|
18
20
|
const [hovered, setHovered] = React.useState(false);
|
|
19
21
|
const [focused, setFocused] = React.useState(false);
|
|
20
22
|
const isWeb = Platform.OS === 'web';
|
|
21
|
-
const
|
|
23
|
+
const resolvedViewStyles = resolveViewStyles(theme, breakpoint, props);
|
|
22
24
|
const passive = interactionPolicy === 'passive';
|
|
23
25
|
return (<Pressable accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={{ ...accessibilityState, disabled }} disabled={disabled} onBlur={() => setFocused(false)} onFocus={() => {
|
|
24
|
-
if (isWeb)
|
|
26
|
+
if (isWeb)
|
|
25
27
|
setFocused(true);
|
|
26
|
-
}
|
|
27
28
|
}} onHoverIn={isWeb ? () => setHovered(true) : undefined} onHoverOut={isWeb ? () => setHovered(false) : undefined} onLongPress={passive ? undefined : onLongPress} onPress={passive ? undefined : onPress} style={(pressableState) => {
|
|
28
29
|
const state = getInteractionState(pressableState, hovered, focused, disabled);
|
|
29
30
|
return [
|
|
30
|
-
|
|
31
|
+
resolvedViewStyles,
|
|
31
32
|
resolveFocusRingStyles(theme.semantics.border.focus, state.focused, isWeb),
|
|
32
33
|
style,
|
|
33
34
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAmC,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAmC,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,kFAAkF;AAClF,SAAS,mBAAmB,CAC1B,cAA0C,EAC1C,OAAgB,EAChB,OAAgB,EAChB,QAAiB;IAEjB,OAAO,uBAAuB,CAAC;QAC7B,OAAO,EAAE,cAAc,CAAC,OAAO;QAC/B,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,Q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C,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CACxD,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAC/C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CACvC,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE;YACxB,MAAM,KAAK,GAAG,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC9E,OAAO;gBACL,kBAAkB;gBAClB,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;gBAC1E,KAAK;aACN,CAAC;QACJ,CAAC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,CAAC,cAAc,EAAE,EAAE;YAClB,MAAM,KAAK,GAAG,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC9E,OAAO,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,CAAC,CACH;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, Pressable, type PressableStateCallbackType } from 'react-native';\n\nimport { useResponsiveRuntime } from '../../core/responsive';\nimport {\n type InteractionState,\n resolveFocusRingStyles,\n resolveInteractiveState,\n} from '../../internal/resolvers';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { resolveViewStyles } from '../../utils/resolveViewStyles';\nimport type { ButtonBaseProps } from './types';\n\n/*** Resolves one Pressable state into the canonical Surface interaction state. */\nfunction getInteractionState(\n pressableState: PressableStateCallbackType,\n hovered: boolean,\n focused: boolean,\n disabled: boolean,\n): InteractionState {\n return resolveInteractiveState({\n pressed: pressableState.pressed,\n hovered,\n focused,\n disabled,\n });\n}\n\n/*** Renders the low-level token-aware Pressable boundary shared by Surface controls. */\nexport function ButtonBase({\n children,\n disabled = false,\n interactionPolicy = 'enabled',\n onPress,\n onLongPress,\n accessibilityLabel,\n accessibilityRole = 'button',\n accessibilityState,\n style,\n testID,\n ...props\n}: ButtonBaseProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const [hovered, setHovered] = React.useState(false);\n const [focused, setFocused] = React.useState(false);\n const isWeb = Platform.OS === 'web';\n const resolvedViewStyles = resolveViewStyles(theme, breakpoint, props);\n const passive = interactionPolicy === 'passive';\n\n return (\n <Pressable\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n accessibilityState={{ ...accessibilityState, disabled }}\n disabled={disabled}\n onBlur={() => setFocused(false)}\n onFocus={() => {\n if (isWeb) setFocused(true);\n }}\n onHoverIn={isWeb ? () => setHovered(true) : undefined}\n onHoverOut={isWeb ? () => setHovered(false) : undefined}\n onLongPress={passive ? undefined : onLongPress}\n onPress={passive ? undefined : onPress}\n style={(pressableState) => {\n const state = getInteractionState(pressableState, hovered, focused, disabled);\n return [\n resolvedViewStyles,\n resolveFocusRingStyles(theme.semantics.border.focus, state.focused, isWeb),\n style,\n ];\n }}\n testID={testID}\n >\n {(pressableState) => {\n const state = getInteractionState(pressableState, hovered, focused, disabled);\n return typeof children === 'function' ? children(state) : children;\n }}\n </Pressable>\n );\n}\n"]}
|
|
@@ -2,8 +2,8 @@ import type React from 'react';
|
|
|
2
2
|
import type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import type { InteractionPolicyProps } from '../../interactionPolicy';
|
|
4
4
|
import type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';
|
|
5
|
-
import type {
|
|
6
|
-
export interface ButtonBaseProps extends Omit<
|
|
5
|
+
import type { ViewProps } from '../../types/layout';
|
|
6
|
+
export interface ButtonBaseProps extends Omit<ViewProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {
|
|
7
7
|
children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,sBAAsB;IAC7E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';\n\nimport type { InteractionPolicyProps } from '../../interactionPolicy';\nimport type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';\nimport type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';\n\nimport type { InteractionPolicyProps } from '../../interactionPolicy';\nimport type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';\nimport type { ViewProps } from '../../types/layout';\n\nexport interface ButtonBaseProps\n extends Omit<ViewProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {\n children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);\n disabled?: boolean;\n onPress?: ((event: GestureResponderEvent) => void) | undefined;\n onLongPress?: ((event: GestureResponderEvent) => void) | undefined;\n accessibilityLabel?: string;\n accessibilityRole?: AccessibilityRole;\n accessibilityState?: AccessibilityState;\n testID?: string;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { ViewProps } from './layout';
|
|
4
|
+
export interface AppBarProps extends Omit<ViewProps, 'children'> {
|
|
5
|
+
leading?: React.ReactNode;
|
|
6
|
+
trailing?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
safeAreaTop?: boolean;
|
|
9
|
+
divider?: boolean;
|
|
10
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=app-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-bar.d.ts","sourceRoot":"","sources":["../../src/types/app-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9D,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-bar.js","sourceRoot":"","sources":["../../src/types/app-bar.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { ViewProps } from './layout';\n\nexport interface AppBarProps extends Omit<ViewProps, '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"]}
|
package/dist/types/layout.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { StyleProp, ViewProps as ReactNativeViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import type { ScrollViewProps as ReactNativeScrollViewProps, StyleProp, ViewProps as ReactNativeViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
import type { Responsive } from '../core/responsive';
|
|
4
4
|
import type { SurfaceTheme } from '../theme/types';
|
|
5
5
|
type SpaceToken = keyof SurfaceTheme['spacing'];
|
|
@@ -8,7 +8,7 @@ type ColorToken = keyof SurfaceTheme['colors'];
|
|
|
8
8
|
type RadiusValue = number | RadiusToken;
|
|
9
9
|
export type SpaceValue = number | SpaceToken;
|
|
10
10
|
export type ColorValue = string | ColorToken;
|
|
11
|
-
export interface
|
|
11
|
+
export interface ViewStyleProps {
|
|
12
12
|
p?: Responsive<SpaceValue>;
|
|
13
13
|
px?: Responsive<SpaceValue>;
|
|
14
14
|
py?: Responsive<SpaceValue>;
|
|
@@ -23,6 +23,9 @@ export interface BoxStyleProps {
|
|
|
23
23
|
mb?: Responsive<SpaceValue>;
|
|
24
24
|
ml?: Responsive<SpaceValue>;
|
|
25
25
|
mr?: Responsive<SpaceValue>;
|
|
26
|
+
gap?: Responsive<SpaceValue>;
|
|
27
|
+
rowGap?: Responsive<SpaceValue>;
|
|
28
|
+
columnGap?: Responsive<SpaceValue>;
|
|
26
29
|
bg?: Responsive<ColorValue>;
|
|
27
30
|
radius?: Responsive<RadiusValue>;
|
|
28
31
|
borderWidth?: Responsive<number>;
|
|
@@ -37,6 +40,10 @@ export interface BoxStyleProps {
|
|
|
37
40
|
flexGrow?: Responsive<number>;
|
|
38
41
|
flexShrink?: Responsive<number>;
|
|
39
42
|
flexBasis?: Responsive<number | string>;
|
|
43
|
+
direction?: Responsive<'row' | 'column'>;
|
|
44
|
+
align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;
|
|
45
|
+
justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;
|
|
46
|
+
wrap?: Responsive<'nowrap' | 'wrap'>;
|
|
40
47
|
alignSelf?: Responsive<ViewStyle['alignSelf']>;
|
|
41
48
|
position?: Responsive<ViewStyle['position']>;
|
|
42
49
|
top?: Responsive<number>;
|
|
@@ -48,7 +55,7 @@ export interface BoxStyleProps {
|
|
|
48
55
|
opacity?: Responsive<number>;
|
|
49
56
|
style?: StyleProp<ViewStyle>;
|
|
50
57
|
}
|
|
51
|
-
export interface
|
|
58
|
+
export interface ViewProps extends ViewStyleProps {
|
|
52
59
|
accessibilityLabel?: ReactNativeViewProps['accessibilityLabel'];
|
|
53
60
|
accessibilityRole?: ReactNativeViewProps['accessibilityRole'];
|
|
54
61
|
accessibilityState?: ReactNativeViewProps['accessibilityState'];
|
|
@@ -57,31 +64,22 @@ export interface BoxProps extends BoxStyleProps {
|
|
|
57
64
|
pointerEvents?: ReactNativeViewProps['pointerEvents'];
|
|
58
65
|
testID?: string;
|
|
59
66
|
}
|
|
60
|
-
export interface
|
|
61
|
-
children?: React.ReactNode;
|
|
62
|
-
maxWidth?: Responsive<number>;
|
|
63
|
-
px?: Responsive<number | keyof SurfaceTheme['spacing']>;
|
|
64
|
-
}
|
|
65
|
-
export interface DividerProps extends Omit<BoxProps, 'bg' | 'height' | 'width'> {
|
|
67
|
+
export interface DividerProps extends Omit<ViewProps, 'bg' | 'height' | 'width'> {
|
|
66
68
|
orientation?: 'horizontal' | 'vertical';
|
|
67
69
|
color?: ColorValue;
|
|
68
70
|
thickness?: number;
|
|
69
71
|
}
|
|
70
|
-
export interface GridProps extends Omit<
|
|
72
|
+
export interface GridProps extends Omit<ViewProps, 'children'> {
|
|
71
73
|
children?: React.ReactNode;
|
|
72
|
-
cols
|
|
74
|
+
cols?: Responsive<number>;
|
|
73
75
|
gap?: Responsive<SpaceValue>;
|
|
74
76
|
rowGap?: Responsive<SpaceValue>;
|
|
75
77
|
colGap?: Responsive<SpaceValue>;
|
|
76
78
|
minItemWidth?: Responsive<number>;
|
|
77
79
|
}
|
|
78
|
-
export interface
|
|
80
|
+
export interface ScrollViewProps extends ViewStyleProps, Omit<ReactNativeScrollViewProps, 'children' | 'contentContainerStyle' | 'style'> {
|
|
79
81
|
children?: React.ReactNode;
|
|
80
|
-
|
|
81
|
-
gap?: Responsive<SpaceValue>;
|
|
82
|
-
align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;
|
|
83
|
-
justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;
|
|
84
|
-
wrap?: Responsive<'nowrap' | 'wrap'>;
|
|
82
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
85
83
|
}
|
|
86
84
|
export {};
|
|
87
85
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,eAAe,IAAI,0BAA0B,EAC7C,SAAS,EACT,SAAS,IAAI,oBAAoB,EACjC,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,KAAK,UAAU,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;AAChD,KAAK,WAAW,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;AAC/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AE,UAAU,CAAC;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,GAAG,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,eACf,SACE,cAAc,EACd,IAAI,CAAC,0BAA0B,EAAE,UAAU,GAAG,uBAAuB,GAAG,OAAO,CAAC;IAClF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9C"}
|
package/dist/types/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { StyleProp
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type {\n ScrollViewProps as ReactNativeScrollViewProps,\n StyleProp,\n ViewProps as ReactNativeViewProps,\n ViewStyle,\n} from 'react-native';\n\nimport type { Responsive } from '../core/responsive';\nimport type { SurfaceTheme } from '../theme/types';\n\ntype SpaceToken = keyof SurfaceTheme['spacing'];\ntype RadiusToken = keyof SurfaceTheme['radii'];\ntype ColorToken = keyof SurfaceTheme['colors'];\ntype RadiusValue = number | RadiusToken;\n\nexport type SpaceValue = number | SpaceToken;\nexport type ColorValue = string | ColorToken;\n\nexport interface ViewStyleProps {\n p?: Responsive<SpaceValue>;\n px?: Responsive<SpaceValue>;\n py?: Responsive<SpaceValue>;\n pt?: Responsive<SpaceValue>;\n pb?: Responsive<SpaceValue>;\n pl?: Responsive<SpaceValue>;\n pr?: Responsive<SpaceValue>;\n m?: Responsive<SpaceValue>;\n mx?: Responsive<SpaceValue>;\n my?: Responsive<SpaceValue>;\n mt?: Responsive<SpaceValue>;\n mb?: Responsive<SpaceValue>;\n ml?: Responsive<SpaceValue>;\n mr?: Responsive<SpaceValue>;\n gap?: Responsive<SpaceValue>;\n rowGap?: Responsive<SpaceValue>;\n columnGap?: Responsive<SpaceValue>;\n bg?: Responsive<ColorValue>;\n radius?: Responsive<RadiusValue>;\n borderWidth?: Responsive<number>;\n borderColor?: Responsive<ColorValue>;\n width?: Responsive<number | string>;\n height?: Responsive<number | string>;\n minWidth?: Responsive<number | string>;\n maxWidth?: Responsive<number | string>;\n minHeight?: Responsive<number | string>;\n maxHeight?: Responsive<number | string>;\n flex?: Responsive<number>;\n flexGrow?: Responsive<number>;\n flexShrink?: Responsive<number>;\n flexBasis?: Responsive<number | string>;\n direction?: Responsive<'row' | 'column'>;\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n justify?: Responsive<\n 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'\n >;\n wrap?: Responsive<'nowrap' | 'wrap'>;\n alignSelf?: Responsive<ViewStyle['alignSelf']>;\n position?: Responsive<ViewStyle['position']>;\n top?: Responsive<number>;\n bottom?: Responsive<number>;\n left?: Responsive<number>;\n right?: Responsive<number>;\n overflow?: Responsive<ViewStyle['overflow']>;\n zIndex?: Responsive<number>;\n opacity?: Responsive<number>;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface ViewProps extends ViewStyleProps {\n accessibilityLabel?: ReactNativeViewProps['accessibilityLabel'];\n accessibilityRole?: ReactNativeViewProps['accessibilityRole'];\n accessibilityState?: ReactNativeViewProps['accessibilityState'];\n accessible?: ReactNativeViewProps['accessible'];\n children?: React.ReactNode;\n pointerEvents?: ReactNativeViewProps['pointerEvents'];\n testID?: string;\n}\n\nexport interface DividerProps extends Omit<ViewProps, 'bg' | 'height' | 'width'> {\n orientation?: 'horizontal' | 'vertical';\n color?: ColorValue;\n thickness?: number;\n}\n\nexport interface GridProps extends Omit<ViewProps, 'children'> {\n children?: React.ReactNode;\n cols?: Responsive<number>;\n gap?: Responsive<SpaceValue>;\n rowGap?: Responsive<SpaceValue>;\n colGap?: Responsive<SpaceValue>;\n minItemWidth?: Responsive<number>;\n}\n\nexport interface ScrollViewProps\n extends\n ViewStyleProps,\n Omit<ReactNativeScrollViewProps, 'children' | 'contentContainerStyle' | 'style'> {\n children?: React.ReactNode;\n contentContainerStyle?: StyleProp<ViewStyle>;\n}\n"]}
|