@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,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { InteractionPolicy } from '
|
|
2
|
+
import type { InteractionPolicy } from '../interactionPolicy';
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
visible: boolean;
|
|
5
5
|
onDismiss?: (() => void) | undefined;
|
|
@@ -8,4 +8,4 @@ export interface ModalProps {
|
|
|
8
8
|
interactionPolicy?: InteractionPolicy;
|
|
9
9
|
testID?: string;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/types/modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../src/types/modal.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../interactionPolicy';\n\nexport interface ModalProps {\n visible: boolean;\n onDismiss?: (() => void) | undefined;\n children?: React.ReactNode;\n closeOnBackdrop?: boolean;\n interactionPolicy?: InteractionPolicy;\n testID?: string;\n}\n"]}
|
package/dist/types/surface.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ViewProps } from './layout';
|
|
2
2
|
export type SurfaceVariant = 'default' | 'subtle' | 'raised' | 'outline';
|
|
3
|
-
export interface SurfaceProps extends Omit<
|
|
3
|
+
export interface SurfaceProps extends Omit<ViewProps, 'bg' | 'borderColor' | 'borderWidth'> {
|
|
4
4
|
variant?: SurfaceVariant;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,aAAa,GAAG,aAAa,CAAC;IACzF,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"surface.js","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from './layout';\n\nexport type SurfaceVariant = 'default' | 'subtle' | 'raised' | 'outline';\n\nexport interface SurfaceProps extends Omit<ViewProps, 'bg' | 'borderColor' | 'borderWidth'> {\n variant?: SurfaceVariant;\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { InteractionPolicy } from '../interactionPolicy';
|
|
3
|
+
export interface TabsProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
8
|
+
testID?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TabListProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TabProps {
|
|
15
|
+
value: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
interactionPolicy?: InteractionPolicy;
|
|
19
|
+
testID?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TabPanelProps {
|
|
22
|
+
value: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
testID?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface TabRegistration {
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
focus: () => void;
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TabsContextValue {
|
|
32
|
+
activeValue: string | undefined;
|
|
33
|
+
focusedValue: string | undefined;
|
|
34
|
+
getPanelId: (value: string) => string;
|
|
35
|
+
getTabId: (value: string) => string;
|
|
36
|
+
registerTab: (tab: TabRegistration) => void;
|
|
37
|
+
setActiveValue: (value: string) => void;
|
|
38
|
+
setFocusedValue: (value: string | undefined) => void;
|
|
39
|
+
tabs: readonly TabRegistration[];
|
|
40
|
+
unregisterTab: (value: string) => void;
|
|
41
|
+
}
|
|
42
|
+
export type TabNavigationKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Home' | 'End';
|
|
43
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,gBAAgB,GAC1B,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/types/tabs.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../interactionPolicy';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: ((value: string) => void) | undefined;\n testID?: string;\n}\n\nexport interface TabListProps {\n children?: React.ReactNode;\n testID?: string;\n}\n\nexport interface TabProps {\n value: string;\n children?: React.ReactNode;\n disabled?: boolean;\n interactionPolicy?: InteractionPolicy;\n testID?: string;\n}\n\nexport interface TabPanelProps {\n value: string;\n children?: React.ReactNode;\n testID?: string;\n}\n\nexport interface TabRegistration {\n disabled: boolean;\n focus: () => void;\n value: string;\n}\n\nexport interface TabsContextValue {\n activeValue: string | undefined;\n focusedValue: string | undefined;\n getPanelId: (value: string) => string;\n getTabId: (value: string) => string;\n registerTab: (tab: TabRegistration) => void;\n setActiveValue: (value: string) => void;\n setFocusedValue: (value: string | undefined) => void;\n tabs: readonly TabRegistration[];\n unregisterTab: (value: string) => void;\n}\n\nexport type TabNavigationKey =\n 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Home' | 'End';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { Breakpoint } from '../core/responsive/types';
|
|
3
|
+
import type { SurfaceTheme } from '../theme/types';
|
|
4
|
+
import type { ViewStyleProps } from '../types/layout';
|
|
5
|
+
/*** Resolves responsive Surface View style props into one React Native view style. */
|
|
6
|
+
export declare function resolveViewStyles(theme: SurfaceTheme, breakpoint: Breakpoint, props: ViewStyleProps): ViewStyle;
|
|
7
|
+
//# sourceMappingURL=resolveViewStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveViewStyles.d.ts","sourceRoot":"","sources":["../../src/utils/resolveViewStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGlE,sFAAsF;AACtF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,cAAc,GACpB,SAAS,CAQX"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveResponsive } from '../core/responsive/resolve';
|
|
2
2
|
import { resolveToken } from '../theme/resolveToken';
|
|
3
3
|
import { resolveSpacing } from './resolveSpacing';
|
|
4
|
-
/*** Resolves responsive
|
|
5
|
-
export function
|
|
4
|
+
/*** Resolves responsive Surface View style props into one React Native view style. */
|
|
5
|
+
export function resolveViewStyles(theme, breakpoint, props) {
|
|
6
6
|
return {
|
|
7
7
|
elevation: 0,
|
|
8
8
|
...resolveSpacingStyles(theme, breakpoint, props),
|
|
@@ -11,7 +11,7 @@ export function resolveBoxStyles(theme, breakpoint, props) {
|
|
|
11
11
|
...resolveLayoutStyles(breakpoint, props),
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
/*** Resolves padding and
|
|
14
|
+
/*** Resolves padding, margin, and gap styles from responsive spacing props. */
|
|
15
15
|
function resolveSpacingStyles(theme, breakpoint, props) {
|
|
16
16
|
return {
|
|
17
17
|
padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),
|
|
@@ -28,6 +28,9 @@ function resolveSpacingStyles(theme, breakpoint, props) {
|
|
|
28
28
|
marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),
|
|
29
29
|
marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),
|
|
30
30
|
marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),
|
|
31
|
+
gap: resolveSpacing(theme, resolveResponsive(props.gap, breakpoint)),
|
|
32
|
+
rowGap: resolveSpacing(theme, resolveResponsive(props.rowGap, breakpoint)),
|
|
33
|
+
columnGap: resolveSpacing(theme, resolveResponsive(props.columnGap, breakpoint)),
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
/*** Resolves background, radius, and border styles. */
|
|
@@ -57,6 +60,10 @@ function resolveLayoutStyles(breakpoint, props) {
|
|
|
57
60
|
flexGrow: resolveResponsive(props.flexGrow, breakpoint),
|
|
58
61
|
flexShrink: resolveResponsive(props.flexShrink, breakpoint),
|
|
59
62
|
flexBasis: resolveResponsive(props.flexBasis, breakpoint),
|
|
63
|
+
flexDirection: resolveResponsive(props.direction, breakpoint),
|
|
64
|
+
alignItems: resolveResponsive(props.align, breakpoint),
|
|
65
|
+
justifyContent: resolveResponsive(props.justify, breakpoint),
|
|
66
|
+
flexWrap: resolveResponsive(props.wrap, breakpoint),
|
|
60
67
|
alignSelf: resolveResponsive(props.alignSelf, breakpoint),
|
|
61
68
|
position: resolveResponsive(props.position, breakpoint),
|
|
62
69
|
top: resolveResponsive(props.top, breakpoint),
|
|
@@ -80,4 +87,4 @@ function resolveColor(theme, value) {
|
|
|
80
87
|
function resolveDimension(theme, value) {
|
|
81
88
|
return resolveToken(theme.spacing, value);
|
|
82
89
|
}
|
|
83
|
-
//# sourceMappingURL=
|
|
90
|
+
//# sourceMappingURL=resolveViewStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveViewStyles.js","sourceRoot":"","sources":["../../src/utils/resolveViewStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import type { ViewStyle } from 'react-native';\n\nimport { resolveResponsive } from '../core/responsive/resolve';\nimport type { Breakpoint } from '../core/responsive/types';\nimport { resolveToken } from '../theme/resolveToken';\nimport type { SurfaceTheme } from '../theme/types';\nimport type { ColorValue, ViewStyleProps } from '../types/layout';\nimport { resolveSpacing } from './resolveSpacing';\n\n/*** Resolves responsive Surface View style props into one React Native view style. */\nexport function resolveViewStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n elevation: 0,\n ...resolveSpacingStyles(theme, breakpoint, props),\n ...resolveVisualStyles(theme, breakpoint, props),\n ...resolveDimensionStyles(theme, breakpoint, props),\n ...resolveLayoutStyles(breakpoint, props),\n };\n}\n\n/*** Resolves padding, margin, and gap styles from responsive spacing props. */\nfunction resolveSpacingStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),\n paddingHorizontal: resolveSpacing(theme, resolveResponsive(props.px, breakpoint)),\n paddingVertical: resolveSpacing(theme, resolveResponsive(props.py, breakpoint)),\n paddingTop: resolveSpacing(theme, resolveResponsive(props.pt, breakpoint)),\n paddingBottom: resolveSpacing(theme, resolveResponsive(props.pb, breakpoint)),\n paddingLeft: resolveSpacing(theme, resolveResponsive(props.pl, breakpoint)),\n paddingRight: resolveSpacing(theme, resolveResponsive(props.pr, breakpoint)),\n margin: resolveSpacing(theme, resolveResponsive(props.m, breakpoint)),\n marginHorizontal: resolveSpacing(theme, resolveResponsive(props.mx, breakpoint)),\n marginVertical: resolveSpacing(theme, resolveResponsive(props.my, breakpoint)),\n marginTop: resolveSpacing(theme, resolveResponsive(props.mt, breakpoint)),\n marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),\n marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),\n marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),\n gap: resolveSpacing(theme, resolveResponsive(props.gap, breakpoint)),\n rowGap: resolveSpacing(theme, resolveResponsive(props.rowGap, breakpoint)),\n columnGap: resolveSpacing(theme, resolveResponsive(props.columnGap, breakpoint)),\n };\n}\n\n/*** Resolves background, radius, and border styles. */\nfunction resolveVisualStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n backgroundColor: resolveColor(theme, resolveResponsive(props.bg, breakpoint)),\n borderRadius: resolveRadius(theme, resolveResponsive(props.radius, breakpoint)),\n borderWidth: resolveResponsive(props.borderWidth, breakpoint),\n borderColor: resolveColor(theme, resolveResponsive(props.borderColor, breakpoint)),\n };\n}\n\n/*** Resolves responsive dimension props through spacing tokens. */\nfunction resolveDimensionStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: ViewStyleProps,\n): ViewStyle {\n return {\n width: resolveDimension(\n theme,\n resolveResponsive(props.width, breakpoint),\n ) as ViewStyle['width'],\n height: resolveDimension(\n theme,\n resolveResponsive(props.height, breakpoint),\n ) as ViewStyle['height'],\n minWidth: resolveDimension(\n theme,\n resolveResponsive(props.minWidth, breakpoint),\n ) as ViewStyle['minWidth'],\n maxWidth: resolveDimension(\n theme,\n resolveResponsive(props.maxWidth, breakpoint),\n ) as ViewStyle['maxWidth'],\n minHeight: resolveDimension(\n theme,\n resolveResponsive(props.minHeight, breakpoint),\n ) as ViewStyle['minHeight'],\n maxHeight: resolveDimension(\n theme,\n resolveResponsive(props.maxHeight, breakpoint),\n ) as ViewStyle['maxHeight'],\n };\n}\n\n/*** Resolves responsive flex, positioning, and visibility styles. */\nfunction resolveLayoutStyles(breakpoint: Breakpoint, props: ViewStyleProps): ViewStyle {\n return {\n flex: resolveResponsive(props.flex, breakpoint),\n flexGrow: resolveResponsive(props.flexGrow, breakpoint),\n flexShrink: resolveResponsive(props.flexShrink, breakpoint),\n flexBasis: resolveResponsive(props.flexBasis, breakpoint) as ViewStyle['flexBasis'],\n flexDirection: resolveResponsive(props.direction, breakpoint),\n alignItems: resolveResponsive(props.align, breakpoint),\n justifyContent: resolveResponsive(props.justify, breakpoint),\n flexWrap: resolveResponsive(props.wrap, breakpoint),\n alignSelf: resolveResponsive(props.alignSelf, breakpoint),\n position: resolveResponsive(props.position, breakpoint),\n top: resolveResponsive(props.top, breakpoint),\n bottom: resolveResponsive(props.bottom, breakpoint),\n left: resolveResponsive(props.left, breakpoint),\n right: resolveResponsive(props.right, breakpoint),\n overflow: resolveResponsive(props.overflow, breakpoint),\n zIndex: resolveResponsive(props.zIndex, breakpoint),\n opacity: resolveResponsive(props.opacity, breakpoint),\n };\n}\n\n/*** Resolves a Surface radius token or raw number. */\nfunction resolveRadius(\n theme: SurfaceTheme,\n value: number | keyof SurfaceTheme['radii'] | undefined,\n): number | undefined {\n return resolveToken(theme.radii, value);\n}\n\n/*** Resolves a Surface color token while preserving arbitrary color strings. */\nfunction resolveColor(theme: SurfaceTheme, value: ColorValue | undefined): string | undefined {\n return resolveToken(theme.colors, value);\n}\n\n/*** Resolves spacing-token dimensions while preserving raw dimension strings. */\nfunction resolveDimension(\n theme: SurfaceTheme,\n value: number | string | undefined,\n): number | string | undefined {\n return resolveToken(theme.spacing, value);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { View } from '../../features/layout/public';
|
|
4
4
|
import { resolveFieldPresentation, resolveFieldState } from '../../internal/resolvers';
|
|
5
5
|
import { HelperText } from '../helper-text';
|
|
6
6
|
import { Label } from '../label';
|
|
7
7
|
import type { FieldProps } from './types';
|
|
8
8
|
|
|
9
|
+
/*** Composes a label, control, and helper or error message into one field. */
|
|
9
10
|
export function Field({
|
|
10
11
|
children,
|
|
11
12
|
label,
|
|
@@ -26,7 +27,7 @@ export function Field({
|
|
|
26
27
|
const presentation = resolveFieldPresentation(fieldState);
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<
|
|
30
|
+
<View gap="xs" testID={testID}>
|
|
30
31
|
{label ? (
|
|
31
32
|
<Label
|
|
32
33
|
color={presentation.labelColor}
|
|
@@ -36,7 +37,7 @@ export function Field({
|
|
|
36
37
|
{label}
|
|
37
38
|
</Label>
|
|
38
39
|
) : null}
|
|
39
|
-
<
|
|
40
|
+
<View>{children}</View>
|
|
40
41
|
{hasErrorText ? (
|
|
41
42
|
<HelperText color={presentation.helperColor} emphasis={presentation.helperEmphasis}>
|
|
42
43
|
{errorText}
|
|
@@ -46,6 +47,6 @@ export function Field({
|
|
|
46
47
|
{helperText}
|
|
47
48
|
</HelperText>
|
|
48
49
|
) : null}
|
|
49
|
-
</
|
|
50
|
+
</View>
|
|
50
51
|
);
|
|
51
52
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { View as ReactNativeView } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { View } from '../../features/layout/public';
|
|
5
5
|
import { Text } from '../../features/typography/public';
|
|
6
6
|
import { ButtonBase } from '../../primitives/button-base';
|
|
7
7
|
import { useTheme } from '../../theme/ThemeContext';
|
|
8
8
|
import type { ListItemProps } from './types';
|
|
9
9
|
|
|
10
|
+
/*** Renders the content row shared by static and interactive ListItem variants. */
|
|
10
11
|
function ListItemContent({
|
|
11
12
|
title,
|
|
12
13
|
description,
|
|
@@ -17,7 +18,7 @@ function ListItemContent({
|
|
|
17
18
|
const { theme } = useTheme();
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
+
<View
|
|
21
22
|
px="m"
|
|
22
23
|
py="m"
|
|
23
24
|
testID={testID}
|
|
@@ -26,8 +27,10 @@ function ListItemContent({
|
|
|
26
27
|
alignItems: 'center',
|
|
27
28
|
}}
|
|
28
29
|
>
|
|
29
|
-
{leading ?
|
|
30
|
-
|
|
30
|
+
{leading ? (
|
|
31
|
+
<ReactNativeView style={{ marginRight: theme.spacing.m }}>{leading}</ReactNativeView>
|
|
32
|
+
) : null}
|
|
33
|
+
<View flex={1}>
|
|
31
34
|
{title ? (
|
|
32
35
|
<Text numberOfLines={1} variant="body" weight="medium">
|
|
33
36
|
{title}
|
|
@@ -38,23 +41,24 @@ function ListItemContent({
|
|
|
38
41
|
{description}
|
|
39
42
|
</Text>
|
|
40
43
|
) : null}
|
|
41
|
-
</
|
|
42
|
-
{trailing ?
|
|
43
|
-
|
|
44
|
+
</View>
|
|
45
|
+
{trailing ? (
|
|
46
|
+
<ReactNativeView style={{ marginLeft: theme.spacing.m }}>{trailing}</ReactNativeView>
|
|
47
|
+
) : null}
|
|
48
|
+
</View>
|
|
44
49
|
);
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
/*** Renders a static or pressable list item. */
|
|
47
53
|
export function ListItem({ onPress, disabled = false, testID, ...content }: ListItemProps) {
|
|
48
54
|
const { theme } = useTheme();
|
|
49
55
|
|
|
50
|
-
if (!onPress) {
|
|
51
|
-
return <ListItemContent {...content} testID={testID} />;
|
|
52
|
-
}
|
|
56
|
+
if (!onPress) return <ListItemContent {...content} testID={testID} />;
|
|
53
57
|
|
|
54
58
|
return (
|
|
55
59
|
<ButtonBase accessibilityRole="button" disabled={disabled} onPress={onPress} testID={testID}>
|
|
56
60
|
{(state) => (
|
|
57
|
-
<
|
|
61
|
+
<View
|
|
58
62
|
style={{
|
|
59
63
|
backgroundColor: state.pressed
|
|
60
64
|
? theme.semantics.neutral.surfaceActive
|
|
@@ -65,7 +69,7 @@ export function ListItem({ onPress, disabled = false, testID, ...content }: List
|
|
|
65
69
|
}}
|
|
66
70
|
>
|
|
67
71
|
<ListItemContent {...content} />
|
|
68
|
-
</
|
|
72
|
+
</View>
|
|
69
73
|
)}
|
|
70
74
|
</ButtonBase>
|
|
71
75
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { View } from '../../features/layout/public';
|
|
4
4
|
import { Text } from '../../features/typography/public';
|
|
5
5
|
import {
|
|
6
6
|
resolveFieldState,
|
|
@@ -13,6 +13,7 @@ import { ButtonBase } from '../../primitives/button-base';
|
|
|
13
13
|
import { useTheme } from '../../theme/ThemeContext';
|
|
14
14
|
import type { SwitchProps } from './types';
|
|
15
15
|
|
|
16
|
+
/*** Renders a controlled or uncontrolled accessible switch. */
|
|
16
17
|
export function Switch({
|
|
17
18
|
children,
|
|
18
19
|
checked,
|
|
@@ -48,13 +49,7 @@ export function Switch({
|
|
|
48
49
|
accessibilityRole="switch"
|
|
49
50
|
accessibilityState={{ checked: isChecked }}
|
|
50
51
|
disabled={disabled}
|
|
51
|
-
onPress={
|
|
52
|
-
nextChecked === null
|
|
53
|
-
? undefined
|
|
54
|
-
: () => {
|
|
55
|
-
setChecked(nextChecked);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
52
|
+
onPress={nextChecked === null ? undefined : () => setChecked(nextChecked)}
|
|
58
53
|
testID={testID}
|
|
59
54
|
>
|
|
60
55
|
{(interactionState) => {
|
|
@@ -75,14 +70,14 @@ export function Switch({
|
|
|
75
70
|
colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';
|
|
76
71
|
|
|
77
72
|
return (
|
|
78
|
-
<
|
|
73
|
+
<View
|
|
79
74
|
style={{
|
|
80
75
|
alignItems: 'center',
|
|
81
76
|
flexDirection: 'row',
|
|
82
77
|
opacity: colors.opacity,
|
|
83
78
|
}}
|
|
84
79
|
>
|
|
85
|
-
<
|
|
80
|
+
<View
|
|
86
81
|
radius="full"
|
|
87
82
|
style={{
|
|
88
83
|
backgroundColor: colors.trackColor,
|
|
@@ -95,7 +90,7 @@ export function Switch({
|
|
|
95
90
|
height: indicatorSize.switchHeight,
|
|
96
91
|
}}
|
|
97
92
|
>
|
|
98
|
-
<
|
|
93
|
+
<View
|
|
99
94
|
radius="full"
|
|
100
95
|
style={{
|
|
101
96
|
alignSelf: isChecked ? 'flex-end' : 'flex-start',
|
|
@@ -104,13 +99,13 @@ export function Switch({
|
|
|
104
99
|
width: indicatorSize.switchThumb,
|
|
105
100
|
}}
|
|
106
101
|
/>
|
|
107
|
-
</
|
|
102
|
+
</View>
|
|
108
103
|
{children ? (
|
|
109
|
-
<
|
|
104
|
+
<View ml="s">
|
|
110
105
|
<Text emphasis={labelEmphasis}>{children}</Text>
|
|
111
|
-
</
|
|
106
|
+
</View>
|
|
112
107
|
) : null}
|
|
113
|
-
</
|
|
108
|
+
</View>
|
|
114
109
|
);
|
|
115
110
|
}}
|
|
116
111
|
</ButtonBase>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { resolveResponsive
|
|
3
|
+
import { resolveResponsive } from './resolve';
|
|
4
|
+
import { useResponsiveRuntime } from './ResponsiveProvider';
|
|
5
|
+
import type { Responsive } from './types';
|
|
4
6
|
|
|
5
7
|
export interface ShowProps {
|
|
6
8
|
when: Responsive<boolean>;
|
|
@@ -8,6 +10,7 @@ export interface ShowProps {
|
|
|
8
10
|
fallback?: React.ReactNode;
|
|
9
11
|
}
|
|
10
12
|
|
|
13
|
+
/*** Conditionally renders one responsive subtree or its fallback. */
|
|
11
14
|
export function Show({ when, children, fallback = null }: ShowProps) {
|
|
12
15
|
const { breakpoint } = useResponsiveRuntime();
|
|
13
16
|
const visible = resolveResponsive(when, breakpoint) ?? false;
|
|
@@ -2,5 +2,6 @@ export { BREAKPOINT_ORDER, BREAKPOINTS } from './breakpoints';
|
|
|
2
2
|
export { getBreakpointFromWidth } from './getBreakpointFromWidth';
|
|
3
3
|
export { resolveResponsive } from './resolve';
|
|
4
4
|
export { ResponsiveProvider, useResponsiveRuntime } from './ResponsiveProvider';
|
|
5
|
+
export { Show, type ShowProps } from './Show';
|
|
5
6
|
export type { Breakpoint, Responsive, ResponsiveRuntime } from './types';
|
|
6
7
|
export { useBreakpoint } from './useBreakpoint';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View as ReactNativeView, type ViewStyle } from 'react-native';
|
|
3
|
+
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
6
|
+
import type { AppBarProps } from '../../../../types/app-bar';
|
|
7
|
+
import { Divider, View } from '../../../layout/public';
|
|
8
|
+
|
|
9
|
+
/*** Renders application chrome with optional safe-area padding and leading/trailing slots. */
|
|
10
|
+
export function AppBar({
|
|
11
|
+
leading,
|
|
12
|
+
trailing,
|
|
13
|
+
children,
|
|
14
|
+
safeAreaTop = true,
|
|
15
|
+
divider = false,
|
|
16
|
+
contentStyle,
|
|
17
|
+
bg,
|
|
18
|
+
style,
|
|
19
|
+
...props
|
|
20
|
+
}: AppBarProps) {
|
|
21
|
+
const { theme } = useTheme();
|
|
22
|
+
const insets = React.use(SafeAreaInsetsContext);
|
|
23
|
+
const topInset = safeAreaTop ? (insets?.top ?? 0) : 0;
|
|
24
|
+
const safeAreaStyle: ViewStyle | undefined =
|
|
25
|
+
topInset === 0 ? undefined : { paddingTop: topInset };
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View {...props} bg={bg ?? theme.semantics.surface.default} style={style}>
|
|
29
|
+
<ReactNativeView style={safeAreaStyle}>
|
|
30
|
+
<ReactNativeView
|
|
31
|
+
style={[styles.content, resolveHorizontalPadding(theme.spacing.m), contentStyle]}
|
|
32
|
+
>
|
|
33
|
+
{leading ? (
|
|
34
|
+
<ReactNativeView
|
|
35
|
+
style={[styles.accessory, resolveAccessoryMargin(theme.spacing.s, 'leading')]}
|
|
36
|
+
>
|
|
37
|
+
{leading}
|
|
38
|
+
</ReactNativeView>
|
|
39
|
+
) : null}
|
|
40
|
+
<ReactNativeView style={styles.center}>{children}</ReactNativeView>
|
|
41
|
+
{trailing ? (
|
|
42
|
+
<ReactNativeView
|
|
43
|
+
style={[styles.accessory, resolveAccessoryMargin(theme.spacing.s, 'trailing')]}
|
|
44
|
+
>
|
|
45
|
+
{trailing}
|
|
46
|
+
</ReactNativeView>
|
|
47
|
+
) : null}
|
|
48
|
+
</ReactNativeView>
|
|
49
|
+
{divider ? <Divider color={theme.semantics.neutral.divider} thickness={1} /> : null}
|
|
50
|
+
</ReactNativeView>
|
|
51
|
+
</View>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*** Resolves dynamic horizontal padding for the AppBar content row. */
|
|
56
|
+
function resolveHorizontalPadding(paddingHorizontal: number): ViewStyle {
|
|
57
|
+
return { paddingHorizontal };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*** Resolves directional spacing for one AppBar accessory. */
|
|
61
|
+
function resolveAccessoryMargin(spacing: number, position: 'leading' | 'trailing'): ViewStyle {
|
|
62
|
+
return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
accessory: { flexShrink: 0 },
|
|
67
|
+
center: { flex: 1, minWidth: 0 },
|
|
68
|
+
content: { alignItems: 'center', flexDirection: 'row', minHeight: 56 },
|
|
69
|
+
});
|
|
@@ -4,7 +4,7 @@ import type { ViewStyle } from 'react-native';
|
|
|
4
4
|
import { resolveButtonColors, resolveControlSize } from '../../../../internal/resolvers';
|
|
5
5
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
6
6
|
import type { BadgeProps } from '../../../../types/badge';
|
|
7
|
-
import {
|
|
7
|
+
import { View } from '../../../layout/public';
|
|
8
8
|
import { Text } from '../../../typography/public';
|
|
9
9
|
|
|
10
10
|
/*** Renders compact semantic status or metadata content. */
|
|
@@ -24,7 +24,7 @@ export function Badge({
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
27
|
+
<View
|
|
28
28
|
px={Math.max(theme.spacing.xs, controlSize.paddingHorizontal - 4)}
|
|
29
29
|
py={Math.max(4, controlSize.paddingVertical - 2)}
|
|
30
30
|
radius={controlSize.borderRadius}
|
|
@@ -39,7 +39,7 @@ export function Badge({
|
|
|
39
39
|
>
|
|
40
40
|
{content}
|
|
41
41
|
</Text>
|
|
42
|
-
</
|
|
42
|
+
</View>
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActivityIndicator, View, type ViewStyle } from 'react-native';
|
|
2
|
+
import { ActivityIndicator, View as ReactNativeView, type ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
type InteractionState,
|
|
@@ -12,7 +12,7 @@ import { useTheme } from '../../../../theme/ThemeContext';
|
|
|
12
12
|
import type { SurfaceTheme } from '../../../../theme/types';
|
|
13
13
|
import type { ButtonProps } from '../../../../types/button';
|
|
14
14
|
import { Icon } from '../../../icon/public';
|
|
15
|
-
import {
|
|
15
|
+
import { View } from '../../../layout/public';
|
|
16
16
|
import { Text } from '../../../typography/public';
|
|
17
17
|
|
|
18
18
|
/*** Renders the primary Surface action control with semantic visual states. */
|
|
@@ -80,7 +80,7 @@ function ButtonContent({
|
|
|
80
80
|
const iconSize = resolveIconSize(theme, size);
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
|
-
<
|
|
83
|
+
<View
|
|
84
84
|
px={controlSize.paddingHorizontal}
|
|
85
85
|
py={controlSize.paddingVertical}
|
|
86
86
|
radius={controlSize.borderRadius}
|
|
@@ -91,9 +91,9 @@ function ButtonContent({
|
|
|
91
91
|
) : (
|
|
92
92
|
<>
|
|
93
93
|
{leadingIcon ? (
|
|
94
|
-
<
|
|
94
|
+
<ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'leading')}>
|
|
95
95
|
<Icon {...leadingIcon} color={colors.contentColor} size={iconSize} />
|
|
96
|
-
</
|
|
96
|
+
</ReactNativeView>
|
|
97
97
|
) : null}
|
|
98
98
|
<Text
|
|
99
99
|
color={muted ? undefined : color}
|
|
@@ -104,13 +104,13 @@ function ButtonContent({
|
|
|
104
104
|
{children}
|
|
105
105
|
</Text>
|
|
106
106
|
{trailingIcon ? (
|
|
107
|
-
<
|
|
107
|
+
<ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'trailing')}>
|
|
108
108
|
<Icon {...trailingIcon} color={colors.contentColor} size={iconSize} />
|
|
109
|
-
</
|
|
109
|
+
</ReactNativeView>
|
|
110
110
|
) : null}
|
|
111
111
|
</>
|
|
112
112
|
)}
|
|
113
|
-
</
|
|
113
|
+
</View>
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -10,7 +10,7 @@ import { ButtonBase } from '../../../../primitives/button-base';
|
|
|
10
10
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
11
11
|
import type { IconButtonProps } from '../../../../types/button';
|
|
12
12
|
import { Icon } from '../../../icon/public';
|
|
13
|
-
import {
|
|
13
|
+
import { View } from '../../../layout/public';
|
|
14
14
|
|
|
15
15
|
/*** Renders a compact accessible icon-only action control. */
|
|
16
16
|
export function IconButton({
|
|
@@ -38,12 +38,12 @@ export function IconButton({
|
|
|
38
38
|
{(state) => {
|
|
39
39
|
const colors = resolveButtonColors(theme, { color, state, variant });
|
|
40
40
|
return (
|
|
41
|
-
<
|
|
41
|
+
<View
|
|
42
42
|
radius={controlSize.borderRadius}
|
|
43
43
|
style={resolveIconButtonStyle(controlSize, colors, variant)}
|
|
44
44
|
>
|
|
45
45
|
<Icon {...icon} color={colors.contentColor} size={resolveIconSize(theme, size)} />
|
|
46
|
-
</
|
|
46
|
+
</View>
|
|
47
47
|
);
|
|
48
48
|
}}
|
|
49
49
|
</ButtonBase>
|
|
@@ -14,7 +14,7 @@ import type { ButtonBaseProps } from '../../../../../primitives/button-base/type
|
|
|
14
14
|
import { useTheme } from '../../../../../theme/ThemeContext';
|
|
15
15
|
import type { SurfaceTheme } from '../../../../../theme/types';
|
|
16
16
|
import type { CheckboxProps } from '../../../../../types/checkbox';
|
|
17
|
-
import {
|
|
17
|
+
import { View } from '../../../../layout/public';
|
|
18
18
|
import { Text } from '../../../../typography/public';
|
|
19
19
|
|
|
20
20
|
/*** Renders a controlled or uncontrolled accessible checkbox. */
|
|
@@ -128,8 +128,8 @@ function renderCheckboxContent(input: CheckboxContentInput) {
|
|
|
128
128
|
const indicatorColor = fieldState.invalid ? 'error' : input.color;
|
|
129
129
|
|
|
130
130
|
return (
|
|
131
|
-
<
|
|
132
|
-
<
|
|
131
|
+
<View style={resolveSelectionRowStyle(colors.opacity)}>
|
|
132
|
+
<View
|
|
133
133
|
radius="s"
|
|
134
134
|
style={resolveCheckboxIndicatorStyle(
|
|
135
135
|
colors.backgroundColor,
|
|
@@ -147,13 +147,13 @@ function renderCheckboxContent(input: CheckboxContentInput) {
|
|
|
147
147
|
✓
|
|
148
148
|
</Text>
|
|
149
149
|
) : null}
|
|
150
|
-
</
|
|
150
|
+
</View>
|
|
151
151
|
{input.children ? (
|
|
152
|
-
<
|
|
152
|
+
<View ml="s">
|
|
153
153
|
<Text emphasis={labelEmphasis}>{input.children}</Text>
|
|
154
|
-
</
|
|
154
|
+
</View>
|
|
155
155
|
) : null}
|
|
156
|
-
</
|
|
156
|
+
</View>
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
159
|
|