@ankhorage/surface 3.4.5 → 4.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 +1 -6
- package/dist/components/radio/Radio.d.ts +3 -0
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +8 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/isRadioTextContent.d.ts +6 -0
- package/dist/components/radio/isRadioTextContent.d.ts.map +1 -0
- package/dist/components/radio/isRadioTextContent.js +7 -0
- package/dist/components/radio/isRadioTextContent.js.map +1 -0
- package/dist/examples/DocsExamples.d.ts.map +1 -1
- package/dist/examples/DocsExamples.js +0 -6
- package/dist/examples/DocsExamples.js.map +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/radio/Radio.test.ts +20 -0
- package/src/components/radio/Radio.tsx +9 -3
- package/src/components/radio/isRadioTextContent.ts +8 -0
- package/src/examples/DocsExamples.tsx +0 -6
- package/src/index.test.ts +24 -13
- package/src/index.ts +0 -22
- package/dist/components/action-sheet/ActionSheet.d.ts +0 -4
- package/dist/components/action-sheet/ActionSheet.d.ts.map +0 -1
- package/dist/components/action-sheet/ActionSheet.js +0 -77
- package/dist/components/action-sheet/ActionSheet.js.map +0 -1
- package/dist/components/action-sheet/ActionSheetItem.d.ts +0 -4
- package/dist/components/action-sheet/ActionSheetItem.d.ts.map +0 -1
- package/dist/components/action-sheet/ActionSheetItem.js +0 -27
- package/dist/components/action-sheet/ActionSheetItem.js.map +0 -1
- package/dist/components/action-sheet/index.d.ts +0 -4
- package/dist/components/action-sheet/index.d.ts.map +0 -1
- package/dist/components/action-sheet/index.js +0 -3
- package/dist/components/action-sheet/index.js.map +0 -1
- package/dist/components/action-sheet/types.d.ts +0 -27
- package/dist/components/action-sheet/types.d.ts.map +0 -1
- package/dist/components/action-sheet/types.js +0 -2
- package/dist/components/action-sheet/types.js.map +0 -1
- package/dist/components/drawer/Drawer.d.ts +0 -4
- package/dist/components/drawer/Drawer.d.ts.map +0 -1
- package/dist/components/drawer/Drawer.js +0 -62
- package/dist/components/drawer/Drawer.js.map +0 -1
- package/dist/components/drawer/index.d.ts +0 -3
- package/dist/components/drawer/index.d.ts.map +0 -1
- package/dist/components/drawer/index.js +0 -2
- package/dist/components/drawer/index.js.map +0 -1
- package/dist/components/drawer/types.d.ts +0 -12
- package/dist/components/drawer/types.d.ts.map +0 -1
- package/dist/components/drawer/types.js +0 -2
- package/dist/components/drawer/types.js.map +0 -1
- package/dist/components/navigation/DrawerNavigation.d.ts +0 -4
- package/dist/components/navigation/DrawerNavigation.d.ts.map +0 -1
- package/dist/components/navigation/DrawerNavigation.js +0 -13
- package/dist/components/navigation/DrawerNavigation.js.map +0 -1
- package/dist/components/navigation/DrawerNavigationItem.d.ts +0 -4
- package/dist/components/navigation/DrawerNavigationItem.d.ts.map +0 -1
- package/dist/components/navigation/DrawerNavigationItem.js +0 -9
- package/dist/components/navigation/DrawerNavigationItem.js.map +0 -1
- package/dist/components/navigation/NavigationItem.d.ts +0 -4
- package/dist/components/navigation/NavigationItem.d.ts.map +0 -1
- package/dist/components/navigation/NavigationItem.js +0 -41
- package/dist/components/navigation/NavigationItem.js.map +0 -1
- package/dist/components/navigation/NavigationList.d.ts +0 -4
- package/dist/components/navigation/NavigationList.d.ts.map +0 -1
- package/dist/components/navigation/NavigationList.js +0 -9
- package/dist/components/navigation/NavigationList.js.map +0 -1
- package/dist/components/navigation/TabBar.d.ts +0 -4
- package/dist/components/navigation/TabBar.d.ts.map +0 -1
- package/dist/components/navigation/TabBar.js +0 -15
- package/dist/components/navigation/TabBar.js.map +0 -1
- package/dist/components/navigation/TabBarItem.d.ts +0 -4
- package/dist/components/navigation/TabBarItem.d.ts.map +0 -1
- package/dist/components/navigation/TabBarItem.js +0 -44
- package/dist/components/navigation/TabBarItem.js.map +0 -1
- package/dist/components/navigation/helpers.d.ts +0 -15
- package/dist/components/navigation/helpers.d.ts.map +0 -1
- package/dist/components/navigation/helpers.js +0 -48
- package/dist/components/navigation/helpers.js.map +0 -1
- package/dist/components/navigation/index.d.ts +0 -8
- package/dist/components/navigation/index.d.ts.map +0 -1
- package/dist/components/navigation/index.js +0 -7
- package/dist/components/navigation/index.js.map +0 -1
- package/dist/components/navigation/types.d.ts +0 -58
- package/dist/components/navigation/types.d.ts.map +0 -1
- package/dist/components/navigation/types.js +0 -2
- package/dist/components/navigation/types.js.map +0 -1
- package/src/components/action-sheet/ActionSheet.tsx +0 -130
- package/src/components/action-sheet/ActionSheetItem.tsx +0 -59
- package/src/components/action-sheet/index.ts +0 -3
- package/src/components/action-sheet/types.ts +0 -29
- package/src/components/drawer/Drawer.tsx +0 -100
- package/src/components/drawer/index.ts +0 -2
- package/src/components/drawer/types.ts +0 -13
- package/src/components/navigation/DrawerNavigation.tsx +0 -32
- package/src/components/navigation/DrawerNavigationItem.tsx +0 -23
- package/src/components/navigation/NavigationItem.tsx +0 -79
- package/src/components/navigation/NavigationList.tsx +0 -31
- package/src/components/navigation/TabBar.tsx +0 -31
- package/src/components/navigation/TabBarItem.tsx +0 -79
- package/src/components/navigation/helpers.test.ts +0 -74
- package/src/components/navigation/helpers.ts +0 -81
- package/src/components/navigation/index.ts +0 -16
- package/src/components/navigation/policy.test.ts +0 -140
- package/src/components/navigation/types.ts +0 -66
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/surface
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- ae190ea: Remove obsolete ActionSheet, Drawer, and navigation-chrome APIs now owned by canonical composition and @ankhorage/navigator.
|
|
8
|
+
|
|
9
|
+
## 3.4.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 191daf8: Render structured Radio children directly instead of nesting non-text React nodes inside native Text while preserving primitive label typography and radio semantics.
|
|
14
|
+
|
|
3
15
|
## 3.4.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/surface
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.
|
|
9
9
|
|
|
@@ -15,14 +15,12 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
15
15
|
- [Architecture overview](././paradox/diagrams/architecture-overview.mmd)
|
|
16
16
|
- [Module relationships](././paradox/diagrams/module-relationships.mmd)
|
|
17
17
|
- [Export graph](././paradox/diagrams/export-graph.mmd)
|
|
18
|
-
- [ActionSheet sequence](././paradox/diagrams/sequences/action-sheet.mmd)
|
|
19
18
|
- [AppBar sequence](././paradox/diagrams/sequences/app-bar.mmd)
|
|
20
19
|
- [Badge sequence](././paradox/diagrams/sequences/badge.mmd)
|
|
21
20
|
- [Button sequence](././paradox/diagrams/sequences/button.mmd)
|
|
22
21
|
- [Card sequence](././paradox/diagrams/sequences/card.mmd)
|
|
23
22
|
- [Checkbox sequence](././paradox/diagrams/sequences/checkbox.mmd)
|
|
24
23
|
- [Container sequence](././paradox/diagrams/sequences/container.mmd)
|
|
25
|
-
- [Drawer sequence](././paradox/diagrams/sequences/drawer.mmd)
|
|
26
24
|
- [Field sequence](././paradox/diagrams/sequences/field.mmd)
|
|
27
25
|
- [FontProvider sequence](././paradox/diagrams/sequences/font-provider.mmd)
|
|
28
26
|
- [Grid sequence](././paradox/diagrams/sequences/grid.mmd)
|
|
@@ -32,7 +30,6 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
32
30
|
- [ListItem sequence](././paradox/diagrams/sequences/list-item.mmd)
|
|
33
31
|
- [Menu sequence](././paradox/diagrams/sequences/menu.mmd)
|
|
34
32
|
- [Modal sequence](././paradox/diagrams/sequences/modal.mmd)
|
|
35
|
-
- [NavigationItem sequence](././paradox/diagrams/sequences/navigation-item.mmd)
|
|
36
33
|
- [Radio sequence](././paradox/diagrams/sequences/radio.mmd)
|
|
37
34
|
- [resolveResponsive sequence](././paradox/diagrams/sequences/resolve-responsive.mmd)
|
|
38
35
|
- [ResponsiveProvider sequence](././paradox/diagrams/sequences/responsive-provider.mmd)
|
|
@@ -40,8 +37,6 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
40
37
|
- [Stack sequence](././paradox/diagrams/sequences/stack.mmd)
|
|
41
38
|
- [Surface sequence](././paradox/diagrams/sequences/surface.mmd)
|
|
42
39
|
- [Switch sequence](././paradox/diagrams/sequences/switch.mmd)
|
|
43
|
-
- [TabBar sequence](././paradox/diagrams/sequences/tab-bar.mmd)
|
|
44
|
-
- [TabBarItem sequence](././paradox/diagrams/sequences/tab-bar-item.mmd)
|
|
45
40
|
- [TabList sequence](././paradox/diagrams/sequences/tab-list.mmd)
|
|
46
41
|
- [TabPanel sequence](././paradox/diagrams/sequences/tab-panel.mmd)
|
|
47
42
|
- [Tabs sequence](././paradox/diagrams/sequences/tabs.mmd)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RadioProps } from './types';
|
|
3
|
+
/***
|
|
4
|
+
* Renders one radio control with either text or structured label content.
|
|
5
|
+
*/
|
|
3
6
|
export declare function Radio({ children, checked, defaultChecked, onCheckedChange, color, size, disabled, invalid, readOnly, accessibilityLabel, testID, ...props }: RadioProps): React.JSX.Element;
|
|
4
7
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,OAAO,EACP,cAAsB,EACtB,eAAe,EACf,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,UAAU,qBA2FZ"}
|
|
@@ -5,6 +5,10 @@ import { Box } from '../../layout';
|
|
|
5
5
|
import { ButtonBase } from '../../primitives/button-base';
|
|
6
6
|
import { Text } from '../../primitives/text';
|
|
7
7
|
import { useTheme } from '../../theme/ThemeContext';
|
|
8
|
+
import { isRadioTextContent } from './isRadioTextContent';
|
|
9
|
+
/***
|
|
10
|
+
* Renders one radio control with either text or structured label content.
|
|
11
|
+
*/
|
|
8
12
|
export function Radio({ children, checked, defaultChecked = false, onCheckedChange, color = 'primary', size = 'm', disabled = false, invalid = false, readOnly = false, accessibilityLabel, testID, ...props }) {
|
|
9
13
|
const { theme } = useTheme();
|
|
10
14
|
const [isChecked, setChecked] = useControllableState({
|
|
@@ -19,6 +23,7 @@ export function Radio({ children, checked, defaultChecked = false, onCheckedChan
|
|
|
19
23
|
kind: 'radio',
|
|
20
24
|
readOnly,
|
|
21
25
|
});
|
|
26
|
+
const hasContent = children !== undefined && children !== null && children !== false;
|
|
22
27
|
return (<ButtonBase {...props} accessibilityLabel={accessibilityLabel} accessibilityRole="radio" accessibilityState={{ checked: isChecked }} disabled={disabled} onPress={nextChecked === null
|
|
23
28
|
? undefined
|
|
24
29
|
: () => {
|
|
@@ -39,6 +44,7 @@ export function Radio({ children, checked, defaultChecked = false, onCheckedChan
|
|
|
39
44
|
color,
|
|
40
45
|
});
|
|
41
46
|
const labelEmphasis = colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';
|
|
47
|
+
const isTextContent = isRadioTextContent(children);
|
|
42
48
|
return (<Box style={{
|
|
43
49
|
alignItems: 'center',
|
|
44
50
|
flexDirection: 'row',
|
|
@@ -59,8 +65,8 @@ export function Radio({ children, checked, defaultChecked = false, onCheckedChan
|
|
|
59
65
|
width: indicatorSize.radioDot,
|
|
60
66
|
}}/>) : null}
|
|
61
67
|
</Box>
|
|
62
|
-
{
|
|
63
|
-
<Text emphasis={labelEmphasis}>{children}</Text>
|
|
68
|
+
{hasContent ? (<Box flex={1} ml="s">
|
|
69
|
+
{isTextContent ? <Text emphasis={labelEmphasis}>{children}</Text> : children}
|
|
64
70
|
</Box>) : null}
|
|
65
71
|
</Box>);
|
|
66
72
|
}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,q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K;iBAC3B,CAAC,CAEF;cAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,CAAC,GAAG,CACF,MAAM,CAAC,MAAM,CACb,KAAK,CAAC,CAAC;wBACL,eAAe,EAAE,MAAM,CAAC,cAAc;wBACtC,MAAM,EAAE,aAAa,CAAC,QAAQ;wBAC9B,KAAK,EAAE,aAAa,CAAC,QAAQ;qBAC9B,CAAC,EACF,CACH,CAAC,CAAC,CAAC,IAAI,CACV;YAAA,EAAE,GAAG,CACL;YAAA,CAAC,UAAU,CAAC,CAAC,CAAC,CACZ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAClB;gBAAA,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAC9E;cAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport {\n resolveFieldState,\n resolveIndicatorSize,\n resolveSelectionControlColors,\n resolveSelectionControlNextChecked,\n} from '../../internal/resolvers';\nimport { useControllableState } from '../../internal/useControllableState';\nimport { Box } from '../../layout';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport { isRadioTextContent } from './isRadioTextContent';\nimport type { RadioProps } from './types';\n\n/***\n * Renders one radio control with either text or structured label content.\n */\nexport function Radio({\n children,\n checked,\n defaultChecked = false,\n onCheckedChange,\n color = 'primary',\n size = 'm',\n disabled = false,\n invalid = false,\n readOnly = false,\n accessibilityLabel,\n testID,\n ...props\n}: RadioProps) {\n const { theme } = useTheme();\n const [isChecked, setChecked] = useControllableState<boolean>({\n value: checked,\n defaultValue: defaultChecked,\n onChange: onCheckedChange,\n });\n const indicatorSize = resolveIndicatorSize(size);\n const nextChecked = resolveSelectionControlNextChecked({\n checked: isChecked,\n disabled,\n kind: 'radio',\n readOnly,\n });\n const hasContent = children !== undefined && children !== null && children !== false;\n\n return (\n <ButtonBase\n {...props}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked: isChecked }}\n disabled={disabled}\n onPress={\n nextChecked === null\n ? undefined\n : () => {\n setChecked(nextChecked);\n }\n }\n testID={testID}\n >\n {(interactionState) => {\n const fieldState = resolveFieldState({\n disabled,\n focused: interactionState.focused,\n invalid,\n readOnly,\n });\n const colors = resolveSelectionControlColors(theme, {\n checked: isChecked,\n fieldState,\n hovered: interactionState.hovered,\n pressed: interactionState.pressed,\n color,\n });\n const labelEmphasis =\n colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';\n const isTextContent = isRadioTextContent(children);\n\n return (\n <Box\n style={{\n alignItems: 'center',\n flexDirection: 'row',\n opacity: colors.opacity,\n }}\n >\n <Box\n radius=\"full\"\n style={{\n alignItems: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: 1.5,\n height: indicatorSize.radio,\n justifyContent: 'center',\n width: indicatorSize.radio,\n }}\n >\n {isChecked ? (\n <Box\n radius=\"full\"\n style={{\n backgroundColor: colors.indicatorColor,\n height: indicatorSize.radioDot,\n width: indicatorSize.radioDot,\n }}\n />\n ) : null}\n </Box>\n {hasContent ? (\n <Box flex={1} ml=\"s\">\n {isTextContent ? <Text emphasis={labelEmphasis}>{children}</Text> : children}\n </Box>\n ) : null}\n </Box>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/***
|
|
3
|
+
* Reports whether Radio content should use the built-in text-label presentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isRadioTextContent(children: React.ReactNode): children is string | number;
|
|
6
|
+
//# sourceMappingURL=isRadioTextContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRadioTextContent.d.ts","sourceRoot":"","sources":["../../../src/components/radio/isRadioTextContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,QAAQ,IAAI,MAAM,GAAG,MAAM,CAEzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRadioTextContent.js","sourceRoot":"","sources":["../../../src/components/radio/isRadioTextContent.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAyB;IAC1D,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC;AACtE,CAAC","sourcesContent":["import type React from 'react';\n\n/***\n * Reports whether Radio content should use the built-in text-label presentation.\n */\nexport function isRadioTextContent(children: React.ReactNode): children is string | number {\n return typeof children === 'string' || typeof children === 'number';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsExamples.d.ts","sourceRoot":"","sources":["../../src/examples/DocsExamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DocsExamples.d.ts","sourceRoot":"","sources":["../../src/examples/DocsExamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,wBAAgB,WAAW,sBAY1B;AAeD,wBAAgB,eAAe,sBAa9B;AAED,wBAAgB,cAAc,sBAoB7B;AAED,wBAAgB,iBAAiB,sBAgChC"}
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { Button } from '../components/button';
|
|
3
3
|
import { Card } from '../components/card';
|
|
4
4
|
import { Checkbox } from '../components/checkbox';
|
|
5
|
-
import { Drawer } from '../components/drawer';
|
|
6
5
|
import { Field } from '../components/field';
|
|
7
6
|
import { HelperText } from '../components/helper-text';
|
|
8
7
|
import { Menu } from '../components/menu';
|
|
@@ -51,11 +50,9 @@ export function FeedbackExample() {
|
|
|
51
50
|
}
|
|
52
51
|
export function OverlayExample() {
|
|
53
52
|
const [modalVisible, setModalVisible] = React.useState(false);
|
|
54
|
-
const [drawerVisible, setDrawerVisible] = React.useState(false);
|
|
55
53
|
return (<ThemeProvider initialConfig={docsThemeConfig}>
|
|
56
54
|
<Stack gap="m" p="l">
|
|
57
55
|
<Button onPress={() => setModalVisible(true)}>Open modal</Button>
|
|
58
|
-
<Button onPress={() => setDrawerVisible(true)}>Open drawer</Button>
|
|
59
56
|
<Modal onDismiss={() => setModalVisible(false)} visible={modalVisible}>
|
|
60
57
|
<Card>
|
|
61
58
|
<Stack gap="s">
|
|
@@ -66,9 +63,6 @@ export function OverlayExample() {
|
|
|
66
63
|
</Stack>
|
|
67
64
|
</Card>
|
|
68
65
|
</Modal>
|
|
69
|
-
<Drawer onDismiss={() => setDrawerVisible(false)} visible={drawerVisible}>
|
|
70
|
-
<Text>Drawer content</Text>
|
|
71
|
-
</Drawer>
|
|
72
66
|
</Stack>
|
|
73
67
|
</ThemeProvider>);
|
|
74
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsExamples.js","sourceRoot":"","sources":["../../src/examples/DocsExamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DocsExamples.js","sourceRoot":"","sources":["../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AG,CACnC;UAAA,EAAE,OAAO,CACT;UAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CACvB;YAAA,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAC9B;UAAA,EAAE,QAAQ,CACV;UAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CACvB;YAAA,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAC9B;UAAA,EAAE,QAAQ,CACZ;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,IAAI,CACH,OAAO,CAAC,CAAC;YACP,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;YAC7B,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;SACpD,CAAC,CACF,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,EAElC;QAAA,CAAC,GAAG,CACF;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,kCAAkC,EAAE,IAAI,CAChE;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { Button } from '../components/button';\nimport { Card } from '../components/card';\nimport { Checkbox } from '../components/checkbox';\nimport { Field } from '../components/field';\nimport { HelperText } from '../components/helper-text';\nimport { Menu } from '../components/menu';\nimport { Modal } from '../components/modal';\nimport { Tab, TabList, TabPanel, Tabs } from '../components/tabs';\nimport { TextInput } from '../components/text-input';\nimport { ToastProvider, useToast } from '../components/toast';\nimport { Tooltip } from '../components/tooltip';\nimport { Box, Stack } from '../layout';\nimport { Text } from '../primitives/text';\nimport { ThemeProvider } from '../theme';\nimport type { ThemeConfig } from '../theme/types';\n\nconst docsThemeConfig: ThemeConfig = {\n id: 'docs',\n name: 'Docs',\n light: { primaryColor: '#2563EB', harmony: 'analogous' },\n dark: { primaryColor: '#60A5FA', harmony: 'analogous' },\n};\n\nexport function FormExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Field helperText=\"Use your work email.\" label=\"Email\" required>\n <TextInput placeholder=\"you@example.com\" />\n </Field>\n <Checkbox checked>Accept terms</Checkbox>\n <HelperText emphasis=\"muted\">Looks good.</HelperText>\n </Stack>\n </ThemeProvider>\n );\n}\n\nfunction ToastButton() {\n const { showToast } = useToast();\n return (\n <Button\n onPress={() =>\n showToast({ description: 'Your changes were saved.', status: 'success', title: 'Saved' })\n }\n >\n Show toast\n </Button>\n );\n}\n\nexport function FeedbackExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <ToastProvider>\n <Stack gap=\"m\" p=\"l\">\n <Tooltip content=\"Helpful contextual information\">\n <Text>Hover for tooltip</Text>\n </Tooltip>\n <ToastButton />\n </Stack>\n </ToastProvider>\n </ThemeProvider>\n );\n}\n\nexport function OverlayExample() {\n const [modalVisible, setModalVisible] = React.useState(false);\n\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Button onPress={() => setModalVisible(true)}>Open modal</Button>\n <Modal onDismiss={() => setModalVisible(false)} visible={modalVisible}>\n <Card>\n <Stack gap=\"s\">\n <Text variant=\"label\" weight=\"semiBold\">\n Modal title\n </Text>\n <Text>Modal content</Text>\n </Stack>\n </Card>\n </Modal>\n </Stack>\n </ThemeProvider>\n );\n}\n\nexport function NavigationExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Tabs defaultValue=\"account\">\n <TabList>\n <Tab value=\"account\">Account</Tab>\n <Tab disabled value=\"security\">\n Security\n </Tab>\n <Tab value=\"billing\">Billing</Tab>\n </TabList>\n <TabPanel value=\"account\">\n <Text>Account settings</Text>\n </TabPanel>\n <TabPanel value=\"billing\">\n <Text>Billing settings</Text>\n </TabPanel>\n </Tabs>\n <Menu\n actions={[\n { id: 'edit', title: 'Edit' },\n { disabled: true, id: 'archive', title: 'Archive' },\n ]}\n trigger={<Text>Open menu</Text>}\n />\n <Box>\n <Text color=\"success\">Theme overrides can stay semantic.</Text>\n </Box>\n </Stack>\n </ThemeProvider>\n );\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export type { ActionSheetItemProps, ActionSheetProps } from './components/action-sheet';
|
|
2
|
-
export { ActionSheet, ActionSheetItem } from './components/action-sheet';
|
|
3
1
|
export type { BadgeProps } from './components/badge';
|
|
4
2
|
export { Badge } from './components/badge';
|
|
5
3
|
export type { ButtonIconSpec, ButtonProps } from './components/button';
|
|
@@ -8,8 +6,6 @@ export type { CardProps } from './components/card';
|
|
|
8
6
|
export { Card } from './components/card';
|
|
9
7
|
export type { CheckboxProps } from './components/checkbox';
|
|
10
8
|
export { Checkbox } from './components/checkbox';
|
|
11
|
-
export type { DrawerProps } from './components/drawer';
|
|
12
|
-
export { Drawer } from './components/drawer';
|
|
13
9
|
export type { FieldProps } from './components/field';
|
|
14
10
|
export { Field } from './components/field';
|
|
15
11
|
export type { HelperTextProps } from './components/helper-text';
|
|
@@ -24,8 +20,6 @@ export type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './compon
|
|
|
24
20
|
export { Menu } from './components/menu';
|
|
25
21
|
export type { ModalProps } from './components/modal';
|
|
26
22
|
export { Modal } from './components/modal';
|
|
27
|
-
export type { DrawerNavigationItemProps, DrawerNavigationProps, NavigationItemIcon, NavigationItemProps, NavigationItemSpec, NavigationListProps, TabBarItemProps, TabBarProps, } from './components/navigation';
|
|
28
|
-
export { DrawerNavigation, DrawerNavigationItem, NavigationItem, NavigationList, TabBar, TabBarItem, } from './components/navigation';
|
|
29
23
|
export type { RadioProps } from './components/radio';
|
|
30
24
|
export { Radio } from './components/radio';
|
|
31
25
|
export type { SwitchProps } from './components/switch';
|
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,
|
|
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,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,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,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAA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Ac,mBAAmB,CAAC;AAClC,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,YAAY,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACnE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,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
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export { ActionSheet, ActionSheetItem } from './components/action-sheet';
|
|
2
1
|
export { Badge } from './components/badge';
|
|
3
2
|
export { Button } from './components/button';
|
|
4
3
|
export { Card } from './components/card';
|
|
5
4
|
export { Checkbox } from './components/checkbox';
|
|
6
|
-
export { Drawer } from './components/drawer';
|
|
7
5
|
export { Field } from './components/field';
|
|
8
6
|
export { HelperText } from './components/helper-text';
|
|
9
7
|
export { IconButton } from './components/icon-button';
|
|
@@ -11,7 +9,6 @@ export { Label } from './components/label';
|
|
|
11
9
|
export { ListItem } from './components/list-item';
|
|
12
10
|
export { Menu } from './components/menu';
|
|
13
11
|
export { Modal } from './components/modal';
|
|
14
|
-
export { DrawerNavigation, DrawerNavigationItem, NavigationItem, NavigationList, TabBar, TabBarItem, } from './components/navigation';
|
|
15
12
|
export { Radio } from './components/radio';
|
|
16
13
|
export { Switch } from './components/switch';
|
|
17
14
|
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,cAAc,mBAAmB,CAAC;AAElC,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS/C,OAAO,EAAE,IAAI,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,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 { BadgeProps } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { ButtonIconSpec, ButtonProps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { CheckboxProps } from './components/checkbox';\nexport { Checkbox } from './components/checkbox';\nexport 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 { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { LabelProps } from './components/label';\nexport { Label } from './components/label';\nexport type { ListItemProps } from './components/list-item';\nexport { ListItem } from './components/list-item';\nexport type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './components/menu';\nexport { Menu } from './components/menu';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { RadioProps } from './components/radio';\nexport { Radio } from './components/radio';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';\nexport { Tab, TabList, TabPanel, Tabs } from './components/tabs';\nexport type { TextInputProps } from './components/text-input';\nexport { TextInput } from './components/text-input';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToastOptions, ToastProps, ToastStatus } from './components/toast';\nexport { Toast, ToastProvider, useToast } from './components/toast';\nexport type { TooltipProps } from './components/tooltip';\nexport { Tooltip } from './components/tooltip';\nexport type { FontRuntime } from './context/FontContext';\nexport { FontProvider, useFontContext } from './context/FontContext';\nexport type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';\nexport { TranslationProvider, useTranslationContext } from './context/TranslationContext';\nexport * from './core/responsive';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\nexport * from './layout';\nexport type { ButtonBaseProps } from './primitives/button-base';\nexport { ButtonBase } from './primitives/button-base';\nexport type { HeadingLevel, HeadingProps } from './primitives/heading';\nexport { Heading } from './primitives/heading';\nexport type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from './primitives/icon';\nexport { Icon, SUPPORTED_ICON_PROVIDERS } from './primitives/icon';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './primitives/image';\nexport { Image } from './primitives/image';\nexport type { TextProps } from './primitives/text';\nexport { Text } from './primitives/text';\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"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/surface",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"description": "Stable UI foundation for React Native and React Native Web.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/surface#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"version-packages": "ankhorage-changeset version"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@ankhorage/devtools": "^1.
|
|
89
|
+
"@ankhorage/devtools": "^1.14.0",
|
|
90
90
|
"@ankhorage/paradox": "^0.1.24",
|
|
91
91
|
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
92
92
|
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { isRadioTextContent } from './isRadioTextContent';
|
|
5
|
+
|
|
6
|
+
test('classifies only primitive labels for the built-in text presentation', () => {
|
|
7
|
+
expect(isRadioTextContent('Option')).toBe(true);
|
|
8
|
+
expect(isRadioTextContent(7)).toBe(true);
|
|
9
|
+
expect(isRadioTextContent(React.createElement('span', null, 'Structured'))).toBe(false);
|
|
10
|
+
expect(isRadioTextContent(null)).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Radio preserves one radio interaction boundary and renders structured content directly', async () => {
|
|
14
|
+
const source = await Bun.file('src/components/radio/Radio.tsx').text();
|
|
15
|
+
|
|
16
|
+
expect(source).toContain('accessibilityRole="radio"');
|
|
17
|
+
expect(source).toContain('accessibilityState={{ checked: isChecked }}');
|
|
18
|
+
expect(source).toContain('const isTextContent = isRadioTextContent(children);');
|
|
19
|
+
expect(source).toMatch(/isTextContent \? <Text[^>]*>\{children\}<\/Text> : children/);
|
|
20
|
+
});
|
|
@@ -11,8 +11,12 @@ import { Box } from '../../layout';
|
|
|
11
11
|
import { ButtonBase } from '../../primitives/button-base';
|
|
12
12
|
import { Text } from '../../primitives/text';
|
|
13
13
|
import { useTheme } from '../../theme/ThemeContext';
|
|
14
|
+
import { isRadioTextContent } from './isRadioTextContent';
|
|
14
15
|
import type { RadioProps } from './types';
|
|
15
16
|
|
|
17
|
+
/***
|
|
18
|
+
* Renders one radio control with either text or structured label content.
|
|
19
|
+
*/
|
|
16
20
|
export function Radio({
|
|
17
21
|
children,
|
|
18
22
|
checked,
|
|
@@ -40,6 +44,7 @@ export function Radio({
|
|
|
40
44
|
kind: 'radio',
|
|
41
45
|
readOnly,
|
|
42
46
|
});
|
|
47
|
+
const hasContent = children !== undefined && children !== null && children !== false;
|
|
43
48
|
|
|
44
49
|
return (
|
|
45
50
|
<ButtonBase
|
|
@@ -73,6 +78,7 @@ export function Radio({
|
|
|
73
78
|
});
|
|
74
79
|
const labelEmphasis =
|
|
75
80
|
colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';
|
|
81
|
+
const isTextContent = isRadioTextContent(children);
|
|
76
82
|
|
|
77
83
|
return (
|
|
78
84
|
<Box
|
|
@@ -105,9 +111,9 @@ export function Radio({
|
|
|
105
111
|
/>
|
|
106
112
|
) : null}
|
|
107
113
|
</Box>
|
|
108
|
-
{
|
|
109
|
-
<Box ml="s">
|
|
110
|
-
<Text emphasis={labelEmphasis}>{children}</Text>
|
|
114
|
+
{hasContent ? (
|
|
115
|
+
<Box flex={1} ml="s">
|
|
116
|
+
{isTextContent ? <Text emphasis={labelEmphasis}>{children}</Text> : children}
|
|
111
117
|
</Box>
|
|
112
118
|
) : null}
|
|
113
119
|
</Box>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
/***
|
|
4
|
+
* Reports whether Radio content should use the built-in text-label presentation.
|
|
5
|
+
*/
|
|
6
|
+
export function isRadioTextContent(children: React.ReactNode): children is string | number {
|
|
7
|
+
return typeof children === 'string' || typeof children === 'number';
|
|
8
|
+
}
|
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { Button } from '../components/button';
|
|
4
4
|
import { Card } from '../components/card';
|
|
5
5
|
import { Checkbox } from '../components/checkbox';
|
|
6
|
-
import { Drawer } from '../components/drawer';
|
|
7
6
|
import { Field } from '../components/field';
|
|
8
7
|
import { HelperText } from '../components/helper-text';
|
|
9
8
|
import { Menu } from '../components/menu';
|
|
@@ -68,13 +67,11 @@ export function FeedbackExample() {
|
|
|
68
67
|
|
|
69
68
|
export function OverlayExample() {
|
|
70
69
|
const [modalVisible, setModalVisible] = React.useState(false);
|
|
71
|
-
const [drawerVisible, setDrawerVisible] = React.useState(false);
|
|
72
70
|
|
|
73
71
|
return (
|
|
74
72
|
<ThemeProvider initialConfig={docsThemeConfig}>
|
|
75
73
|
<Stack gap="m" p="l">
|
|
76
74
|
<Button onPress={() => setModalVisible(true)}>Open modal</Button>
|
|
77
|
-
<Button onPress={() => setDrawerVisible(true)}>Open drawer</Button>
|
|
78
75
|
<Modal onDismiss={() => setModalVisible(false)} visible={modalVisible}>
|
|
79
76
|
<Card>
|
|
80
77
|
<Stack gap="s">
|
|
@@ -85,9 +82,6 @@ export function OverlayExample() {
|
|
|
85
82
|
</Stack>
|
|
86
83
|
</Card>
|
|
87
84
|
</Modal>
|
|
88
|
-
<Drawer onDismiss={() => setDrawerVisible(false)} visible={drawerVisible}>
|
|
89
|
-
<Text>Drawer content</Text>
|
|
90
|
-
</Drawer>
|
|
91
85
|
</Stack>
|
|
92
86
|
</ThemeProvider>
|
|
93
87
|
);
|
package/src/index.test.ts
CHANGED
|
@@ -20,7 +20,6 @@ const expectedRootExports = [
|
|
|
20
20
|
"export { Button } from './components/button';",
|
|
21
21
|
"export { Card } from './components/card';",
|
|
22
22
|
"export { Checkbox } from './components/checkbox';",
|
|
23
|
-
"export { Drawer } from './components/drawer';",
|
|
24
23
|
"export { Field } from './components/field';",
|
|
25
24
|
"export { HelperText } from './components/helper-text';",
|
|
26
25
|
"export { IconButton } from './components/icon-button';",
|
|
@@ -28,7 +27,6 @@ const expectedRootExports = [
|
|
|
28
27
|
"export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';",
|
|
29
28
|
"export { Label } from './components/label';",
|
|
30
29
|
"export { ListItem } from './components/list-item';",
|
|
31
|
-
"export {\n DrawerNavigation,\n DrawerNavigationItem,\n NavigationItem,\n NavigationList,\n TabBar,\n TabBarItem,\n} from './components/navigation';",
|
|
32
30
|
"export { Menu } from './components/menu';",
|
|
33
31
|
"export { Modal } from './components/modal';",
|
|
34
32
|
"export { Radio } from './components/radio';",
|
|
@@ -45,13 +43,24 @@ const expectedRootExports = [
|
|
|
45
43
|
"export * from './theme';",
|
|
46
44
|
] as const;
|
|
47
45
|
|
|
48
|
-
describe('public
|
|
49
|
-
it('keeps the intended package surface
|
|
46
|
+
describe('public root barrel contract', () => {
|
|
47
|
+
it('keeps the intended package surface', () => {
|
|
50
48
|
expectedRootExports.forEach((line) => {
|
|
51
49
|
expect(indexSource).toContain(line);
|
|
52
50
|
});
|
|
53
51
|
});
|
|
54
52
|
|
|
53
|
+
it('does not retain obsolete action-sheet, drawer, or navigation chrome', () => {
|
|
54
|
+
expect(indexSource).not.toContain('ActionSheet');
|
|
55
|
+
expect(indexSource).not.toContain("'./components/action-sheet'");
|
|
56
|
+
expect(indexSource).not.toContain("'./components/drawer'");
|
|
57
|
+
expect(indexSource).not.toContain("'./components/navigation'");
|
|
58
|
+
expect(indexSource).not.toContain('DrawerNavigation');
|
|
59
|
+
expect(indexSource).not.toContain('NavigationItem');
|
|
60
|
+
expect(indexSource).not.toContain('NavigationList');
|
|
61
|
+
expect(indexSource).not.toContain('TabBar');
|
|
62
|
+
});
|
|
63
|
+
|
|
55
64
|
it('keeps internal infrastructure off the public barrel', () => {
|
|
56
65
|
expect(indexSource).not.toContain("'./internal/");
|
|
57
66
|
expect(indexSource).not.toContain('resolveSelectionControlNextChecked');
|
|
@@ -60,6 +69,17 @@ describe('public package contract', () => {
|
|
|
60
69
|
expect(indexSource).not.toContain('useFocusManager');
|
|
61
70
|
});
|
|
62
71
|
|
|
72
|
+
it('exports the resolved semantic and diagnostic contracts', () => {
|
|
73
|
+
const theme = createTheme();
|
|
74
|
+
const selection: SelectionSemantics = theme.semantics.selection;
|
|
75
|
+
const diagnostics: SurfaceColorDiagnostics = theme.colorDiagnostics;
|
|
76
|
+
|
|
77
|
+
expect(selection.background).toBeDefined();
|
|
78
|
+
expect(diagnostics.generated.swatches).toBe(theme.swatches);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('public package metadata contract', () => {
|
|
63
83
|
it('keeps package metadata aligned with the single-entry public surface', () => {
|
|
64
84
|
expect(packageJson.files).toEqual(['dist', 'src', 'README.md', 'CHANGELOG.md', 'LICENSE']);
|
|
65
85
|
expect(packageJson.exports).toEqual({
|
|
@@ -88,13 +108,4 @@ describe('public package contract', () => {
|
|
|
88
108
|
expect(packageJson.peerDependencies['react-native-svg']).toBe('15.15.4');
|
|
89
109
|
expect(packageJson.devDependencies['react-native-svg']).toBe('15.15.4');
|
|
90
110
|
});
|
|
91
|
-
|
|
92
|
-
it('exports the resolved semantic and diagnostic contracts from the public root', () => {
|
|
93
|
-
const theme = createTheme();
|
|
94
|
-
const selection: SelectionSemantics = theme.semantics.selection;
|
|
95
|
-
const diagnostics: SurfaceColorDiagnostics = theme.colorDiagnostics;
|
|
96
|
-
|
|
97
|
-
expect(selection.background).toBeDefined();
|
|
98
|
-
expect(diagnostics.generated.swatches).toBe(theme.swatches);
|
|
99
|
-
});
|
|
100
111
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export type { ActionSheetItemProps, ActionSheetProps } from './components/action-sheet';
|
|
2
|
-
export { ActionSheet, ActionSheetItem } from './components/action-sheet';
|
|
3
1
|
export type { BadgeProps } from './components/badge';
|
|
4
2
|
export { Badge } from './components/badge';
|
|
5
3
|
export type { ButtonIconSpec, ButtonProps } from './components/button';
|
|
@@ -8,8 +6,6 @@ export type { CardProps } from './components/card';
|
|
|
8
6
|
export { Card } from './components/card';
|
|
9
7
|
export type { CheckboxProps } from './components/checkbox';
|
|
10
8
|
export { Checkbox } from './components/checkbox';
|
|
11
|
-
export type { DrawerProps } from './components/drawer';
|
|
12
|
-
export { Drawer } from './components/drawer';
|
|
13
9
|
export type { FieldProps } from './components/field';
|
|
14
10
|
export { Field } from './components/field';
|
|
15
11
|
export type { HelperTextProps } from './components/helper-text';
|
|
@@ -24,24 +20,6 @@ export type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './compon
|
|
|
24
20
|
export { Menu } from './components/menu';
|
|
25
21
|
export type { ModalProps } from './components/modal';
|
|
26
22
|
export { Modal } from './components/modal';
|
|
27
|
-
export type {
|
|
28
|
-
DrawerNavigationItemProps,
|
|
29
|
-
DrawerNavigationProps,
|
|
30
|
-
NavigationItemIcon,
|
|
31
|
-
NavigationItemProps,
|
|
32
|
-
NavigationItemSpec,
|
|
33
|
-
NavigationListProps,
|
|
34
|
-
TabBarItemProps,
|
|
35
|
-
TabBarProps,
|
|
36
|
-
} from './components/navigation';
|
|
37
|
-
export {
|
|
38
|
-
DrawerNavigation,
|
|
39
|
-
DrawerNavigationItem,
|
|
40
|
-
NavigationItem,
|
|
41
|
-
NavigationList,
|
|
42
|
-
TabBar,
|
|
43
|
-
TabBarItem,
|
|
44
|
-
} from './components/navigation';
|
|
45
23
|
export type { RadioProps } from './components/radio';
|
|
46
24
|
export { Radio } from './components/radio';
|
|
47
25
|
export type { SwitchProps } from './components/switch';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ActionSheetProps } from './types';
|
|
3
|
-
export declare function ActionSheet({ visible, onDismiss, title, description, children, cancelLabel, closeOnBackdrop, interactionPolicy, testID, }: ActionSheetProps): React.JSX.Element | null;
|
|
4
|
-
//# sourceMappingURL=ActionSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAsB,EACtB,eAAsB,EACtB,iBAA6B,EAC7B,MAAM,GACP,EAAE,gBAAgB,4BAwGlB"}
|