@kanso-labs/react-native-kanso-ui 0.5.0 → 0.7.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/README.md +4 -1
- package/dist/badge/index.js +74 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/badge/styles.js +51 -0
- package/dist/badge/styles.js.map +1 -0
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/pending.js +1 -1
- package/dist/button/slots.d.ts +2 -2
- package/dist/calendar/index.js +1182 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/styles.js +120 -0
- package/dist/calendar/styles.js.map +1 -0
- package/dist/chip/index.js +2 -2
- package/dist/components/app-bar/index.d.ts +111 -0
- package/dist/components/app-bar/index.js +341 -0
- package/dist/components/app-bar/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.d.ts +51 -0
- package/dist/components/calendar/index.js +82 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +3 -3
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip-group/index.d.ts +1 -1
- package/dist/components/chip-group/index.js +4 -4
- package/dist/components/copy-field/index.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/currency/index.d.ts +1 -1
- package/dist/components/currency/index.js +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +2 -2
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.js +2 -2
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/index.js +3 -3
- package/dist/components/list/index.d.ts +1 -1
- package/dist/components/list/index.js +5 -5
- package/dist/components/list-detail/index.d.ts +56 -0
- package/dist/components/list-detail/index.js +169 -0
- package/dist/components/list-detail/index.js.map +1 -0
- package/dist/components/list-item/index.d.ts +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/index.js +7 -7
- package/dist/components/meter/index.d.ts +1 -1
- package/dist/components/meter/index.js +1 -1
- package/dist/components/navigation-bar/index.d.ts +164 -0
- package/dist/components/navigation-bar/index.js +470 -0
- package/dist/components/navigation-bar/index.js.map +1 -0
- package/dist/components/navigation-rail/index.d.ts +68 -0
- package/dist/components/navigation-rail/index.js +294 -0
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/number-field/index.js +5 -5
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +3 -3
- package/dist/components/product-icon/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.js +3 -3
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/search-field/index.d.ts +1 -1
- package/dist/components/search-field/index.js +5 -5
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +5 -5
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/sheet/index.js +3 -3
- package/dist/components/snackbar/index.d.ts +1 -1
- package/dist/components/snackbar/index.js +4 -4
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +4 -4
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-field/index.js +1 -1
- package/dist/control/checkbox-box.js +2 -2
- package/dist/control/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +4 -4
- package/dist/form/index.d.ts +1 -1
- package/dist/glyphs/index.js +21 -3
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useAppBarScroll.d.ts +56 -0
- package/dist/hooks/useAppBarScroll.js +87 -0
- package/dist/hooks/useAppBarScroll.js.map +1 -0
- package/dist/i18n/messages.js +374 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +10 -4
- package/dist/indicator/index.d.ts +2 -2
- package/dist/indicator/index.js +3 -3
- package/dist/indicator/motion.js +1 -1
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js +2 -2
- package/dist/modal/index.d.ts +1 -1
- package/dist/modal/index.js +2 -2
- package/dist/navigation/index.d.ts +36 -0
- package/dist/navigation/index.js +454 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/styles.js +83 -0
- package/dist/navigation/styles.js.map +1 -0
- package/dist/overlay/anchored.d.ts +2 -2
- package/dist/overlay/anchored.js +1 -1
- package/dist/overlay/host.d.ts +2 -2
- package/dist/overlay/host.js +1 -1
- package/dist/overlay/panel.js +2 -2
- package/dist/press/index.js +75 -69
- package/dist/press/index.js.map +1 -1
- package/dist/router/index.js +1 -1
- package/dist/row/index.js +1 -1
- package/dist/theme/scope.js +1 -1
- package/dist/theme-scope.d.ts +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/typography/fonts.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","LayoutChangeEvent","StyleProp","ViewProps","ViewStyle","Edge","use","useMemo","useState","StyleSheet","View","SafeAreaView","NavigationItemProps","useWindowSizeClass","iconColorOf","labelColorOf","NavigationContext","NavigationDestination","NavigationItem","useTheme","composeStyles","themedStyles","NavigationBarItemProps","NavigationBarProps","Omit","children","ref","selectedRoute","style","NavigationTabBarProps","TabNavigatorProps","descriptors","Readonly","Partial","Record","options","TabOptions","insets","state","index","routes","TabRoute","TabActions","emit","event","TabEvent","go","route","TabEmitter","canPreventDefault","target","type","emitter","navigateToTab","routeKey","navigation","navigate","name","params","tabBarAccessibilityLabel","tabBarBadge","tabBarButtonTestID","tabBarIcon","props","color","focused","size","tabBarLabel","position","title","key","MEASURING_ROOM","ICON_SIZE","NO_OPTIONS","DIGITS","EDGES","styles","create","measurer","height","overflow","pointerEvents","start","top","width","room","alignItems","vertical","stylesOf","colors","spacing","bar","backgroundColor","surfaceContainer","horizontal","gap","sm","measured","flexDirection","row","justifyContent","minHeight","actionsOf","undefined","badgeOf","badge","test","Number","longPressThen","actions","NavigationBar","t0","$","_c","theme","own","sizeClass","setRoom","needed","setNeeded","wide","t1","const","t2","form","measuring","context","t3","T0","t4","t5","T1","T2","t7","Symbol","for","widthThen","t8","t9","t10","t11","t6","t12","t13","NavigationBarItem","NavigationTabBar","_insets","map","pressThen","prevented","defaultPrevented","TabDestination","onLongPress","onPress","setWidth","nativeEvent","layout","Item","_c"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n LayoutChangeEvent,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { Edge } from 'react-native-safe-area-context'\n\nimport { use, useMemo, useState } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { SafeAreaView } from 'react-native-safe-area-context'\n\nimport type { NavigationItemProps } from '../../navigation'\n\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport {\n iconColorOf,\n labelColorOf,\n NavigationContext,\n NavigationDestination,\n NavigationItem,\n} from '../../navigation'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// kanso-ui's NavigationBar, the navigation bar page's flexible bar: three to\n// five destinations across the bottom of a compact window, on the surface\n// container, 64dp tall. In a compact window each destination is vertical and\n// the destinations share the bar's width equally; from the medium window\n// size class each is the page's horizontal pill, as wide as what it holds,\n// and the group sits centred with the spare width at the bar's ends, 8dp\n// between two pills. The destinations are src/navigation's, which holds the\n// two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own, as on web. The\n// page puts each pill in an item of a fixed width it does not give, and with\n// no space at all the pills met edge to edge.\n//\n// **A bar too narrow for its horizontal form keeps the vertical one.** A\n// horizontal destination is as wide as its icon, its label and 16dp either\n// side, so five of them need far more than the 600dp the medium class starts\n// at, and drawn anyway every label would be cut short the moment the window\n// crossed into it. So from that class the bar draws its destinations a\n// second time, off screen in the horizontal form at their own widths, and\n// draws that form only while the bar is at least as wide as they are. Web\n// measures the labels it cuts short instead, which native has no way to ask.\n// The horizontal form is drawn until the first measurement arrives, so a bar\n// that fits never draws the other form for a frame.\n//\n// The bar paints its surface to the screen's bottom edge, under the home\n// indicator, and keeps its destinations inside the safe area: a\n// `SafeAreaView` pads it by the home indicator and a landscape notch\n// wherever the bar meets them, and by nothing where it does not.\n//\n// The bar is a `tablist` and each destination a `tab`, which is how both\n// platforms' own tab bars are announced. Web's is a landmark of links with\n// the current one marked as the page, which native has no counterpart for.\n// A destination still goes to its `href` through the app's router, see\n// `RouterProvider`. `NavigationTabBar` draws the bar for React Navigation's\n// bottom tabs and Expo Router's tabs instead.\n\ntype NavigationBarItemProps = NavigationItemProps\n\ntype NavigationBarProps = Omit<ViewProps, 'children' | 'style'> & {\n /** The destinations, each a `NavigationBar.Item`. */\n readonly children?: ReactNode\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match is the selected tab, and draws the\n * active indicator.\n */\n readonly selectedRoute?: string | undefined\n readonly style?: StyleProp<ViewStyle>\n}\n\n/** The routes a tab navigator hands its tab bar, as both navigators do. */\ntype NavigationTabBarProps = Omit<\n NavigationBarProps,\n 'children' | 'selectedRoute'\n> &\n TabNavigatorProps & {\n /** Each route's options, by the route's key. */\n readonly descriptors: Readonly<\n Partial<Record<string, { readonly options: TabOptions }>>\n >\n /**\n * The insets the navigator measured, which the bar measures for itself\n * instead.\n */\n readonly insets?: unknown\n /** The navigator's routes, and which of them is focused. */\n readonly state: {\n readonly index: number\n readonly routes: readonly TabRoute[]\n }\n }\n\n/** What a tab bar's press tells the navigator, and how it moves to a tab. */\ntype TabActions = {\n readonly emit: (event: TabEvent) => unknown\n readonly go: (route: TabRoute) => void\n}\n\n/**\n * What hears a tab bar's events: React Navigation's `navigation` and Expo\n * Router's `emitter` alike.\n */\ntype TabEmitter = {\n emit(event: TabEvent): unknown\n}\n\n/** The events a tab bar reports, as both navigators name them. */\ntype TabEvent =\n | {\n readonly canPreventDefault: true\n readonly target: string\n readonly type: 'tabPress'\n }\n | { readonly target: string; readonly type: 'tabLongPress' }\n\n/**\n * How a tab bar moves to a tab: through React Navigation's `navigation`, or\n * through Expo Router's `navigateToTab`.\n */\ntype TabNavigatorProps =\n | {\n readonly emitter: TabEmitter\n readonly navigateToTab: (routeKey: string) => void\n readonly navigation?: never\n }\n | {\n readonly emitter?: never\n readonly navigateToTab?: never\n readonly navigation: TabEmitter & {\n navigate(name: string, params?: object): void\n }\n }\n\n/**\n * A tab's options the bar reads, as React Navigation's bottom tabs and Expo\n * Router's tabs both hand them to a tab bar. Options they take that are not\n * listed here are left to them.\n */\ntype TabOptions = {\n /** The tab's name for a screen reader, where it differs from its label. */\n readonly tabBarAccessibilityLabel?: string | undefined\n /**\n * The badge on the tab's icon. A number, or a string of digits, is the\n * large badge's count; any other string is the small dot, since a badge\n * draws a count and nothing else.\n */\n readonly tabBarBadge?: number | string | undefined\n readonly tabBarButtonTestID?: string | undefined\n /** The tab's icon, drawn at the size and in the colour it is handed. */\n readonly tabBarIcon?:\n | ((props: {\n readonly color: string\n readonly focused: boolean\n readonly size: number\n }) => ReactNode)\n | undefined\n /** The tab's label, in place of its title. */\n readonly tabBarLabel?:\n | ((props: {\n readonly children: string\n readonly color: string\n readonly focused: boolean\n readonly position: 'below-icon' | 'beside-icon'\n }) => ReactNode)\n | string\n | undefined\n readonly title?: string | undefined\n}\n\ntype TabRoute = {\n readonly key: string\n readonly name: string\n readonly params?: object | undefined\n}\n\n// Where the destinations are drawn off screen to be measured. Wider than any\n// bar, so each one is measured at its own width rather than squeezed.\nconst MEASURING_ROOM = 10_000\n\n// The size a tab's icon is drawn at, the page's.\nconst ICON_SIZE = 24\n\n// A route its navigator handed no options for.\nconst NO_OPTIONS: TabOptions = {}\n\n// A string of digits, which a badge draws as a count.\nconst DIGITS = /^\\d+$/u\n\n// The bar's sides as well as its bottom, so a landscape notch is cleared too.\n// The top is the screen's.\nconst EDGES: readonly Edge[] = ['bottom', 'left', 'right']\n\nconst styles = StyleSheet.create({\n // Holds the destinations measured off screen. It has no size and clips what\n // it holds, so they are laid out and never drawn, and take no touches.\n measurer: {\n height: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n start: 0,\n top: 0,\n width: 0,\n },\n // The room the destinations are measured in, with the row of them at its\n // start, at the row's own width.\n room: {\n alignItems: 'flex-start',\n width: MEASURING_ROOM,\n },\n // The vertical form: each destination its share of the bar's height.\n vertical: {\n alignItems: 'stretch',\n },\n})\n\nconst stylesOf = themedStyles(({ colors, spacing }) =>\n StyleSheet.create({\n bar: {\n backgroundColor: colors.surfaceContainer,\n },\n // The horizontal form: the pills centred, 8dp apart.\n horizontal: {\n alignItems: 'center',\n gap: spacing.sm,\n },\n // The destinations, measured in the horizontal form.\n measured: {\n flexDirection: 'row',\n gap: spacing.sm,\n },\n // The page's 64dp, a minimum rather than a height, so a larger text size\n // the device asks for grows the bar rather than cutting the labels off.\n row: {\n flexDirection: 'row',\n justifyContent: 'center',\n minHeight: 64,\n },\n }),\n)\n\n/**\n * What the bar tells the navigator and how it moves, from whichever of the\n * two navigators drew it.\n */\nfunction actionsOf(\n emitter: TabEmitter | undefined,\n navigateToTab: ((routeKey: string) => void) | undefined,\n navigation: TabNavigatorProps['navigation'],\n): TabActions {\n if (navigation !== undefined) {\n return {\n emit: (event) => navigation.emit(event),\n go: (route) => {\n navigation.navigate(route.name, route.params)\n },\n }\n }\n return {\n emit: (event) => emitter?.emit(event),\n go: (route) => {\n navigateToTab?.(route.key)\n },\n }\n}\n\n/**\n * The badge a tab's `tabBarBadge` draws: the count of a number or a string of\n * digits, and the small dot for any other string.\n */\nfunction badgeOf(\n badge: number | string | undefined,\n): boolean | number | undefined {\n if (typeof badge === 'number') {\n return badge\n }\n if (badge === undefined || badge === '') {\n return undefined\n }\n return DIGITS.test(badge) ? Number(badge) : true\n}\n\n/**\n * Reports a long press on a tab. Built by a call rather than written inline\n * at the prop, for the reason `widthThen` gives.\n */\nfunction longPressThen(actions: TabActions, route: TabRoute) {\n return () => {\n actions.emit({ target: route.key, type: 'tabLongPress' })\n }\n}\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination goes to its `href` through the app's\n * router, see `RouterProvider`.\n *\n * ```tsx\n * <NavigationBar selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * Draw it below the screen's content, at the bottom of the window: it paints\n * its surface to the bottom edge and keeps its destinations clear of the home\n * indicator itself. From the medium window size class each destination puts\n * its label beside its icon, where the bar is wide enough for every label.\n *\n * `style`, `ref` and `testID` land on the bar's own view, which is announced\n * as a tab list.\n */\nfunction NavigationBar({\n children,\n selectedRoute,\n style,\n ...props\n}: NavigationBarProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const sizeClass = useWindowSizeClass()\n // The width the destinations have, and the width the horizontal form\n // takes, while each is known.\n const [room, setRoom] = useState<number | undefined>(undefined)\n const [needed, setNeeded] = useState<number | undefined>(undefined)\n\n const wide = sizeClass !== 'compact'\n const horizontal =\n wide && (room === undefined || needed === undefined || needed <= room)\n const context = useMemo(\n () => ({\n form: horizontal ? ('horizontal' as const) : ('vertical' as const),\n measuring: false,\n selectedRoute,\n }),\n [horizontal, selectedRoute],\n )\n const measuring = useMemo(\n () => ({ form: 'horizontal' as const, measuring: true, selectedRoute }),\n [selectedRoute],\n )\n\n return (\n <View\n role=\"tablist\"\n {...props}\n style={composeStyles<ViewStyle>(own.bar, style)}\n >\n <SafeAreaView edges={EDGES}>\n <View\n onLayout={widthThen(setRoom)}\n style={composeStyles<ViewStyle>(\n own.row,\n horizontal ? own.horizontal : styles.vertical,\n )}\n >\n <NavigationContext value={context}>{children}</NavigationContext>\n </View>\n </SafeAreaView>\n {wide ? (\n <View aria-hidden style={styles.measurer}>\n <View style={styles.room}>\n <View onLayout={widthThen(setNeeded)} style={own.measured}>\n <NavigationContext value={measuring}>\n {children}\n </NavigationContext>\n </View>\n </View>\n </View>\n ) : null}\n </View>\n )\n}\n\n/**\n * One destination of a navigation bar: an icon, a label and, while it is the\n * current one, the active indicator behind the icon. Pressing it calls\n * `onPress`, then goes to its `href`. Renders nothing of its own outside a\n * `NavigationBar`, whose `selectedRoute` says whether it is selected.\n *\n * `style`, `ref` and `testID` land on the destination's `Pressable`.\n */\nfunction NavigationBarItem(props: NavigationBarItemProps) {\n return <NavigationItem {...props} />\n}\n\n/**\n * A navigation bar drawing a tab navigator's routes, for the `tabBar` prop of\n * React Navigation's bottom tabs and of Expo Router's `Tabs` alike.\n *\n * ```tsx\n * <Tabs tabBar={(props) => <NavigationTabBar {...props} />}>\n * <Tabs.Screen name=\"index\" options={{ tabBarIcon: () => <FirstIcon />, title: 'First item' }} />\n * </Tabs>\n * ```\n *\n * Each route is a destination, labelled by its `tabBarLabel` or its title,\n * with the icon `tabBarIcon` draws and the badge `tabBarBadge` asks for, and\n * the focused route is the selected one. Pressing a destination reports\n * `tabPress` to the navigator and moves to its route unless a listener\n * prevents it, and a long press reports `tabLongPress`, as the navigators'\n * own tab bars do.\n *\n * `style`, `ref` and `testID` land on the bar's own view, as on a\n * `NavigationBar`.\n */\nfunction NavigationTabBar({\n descriptors,\n emitter,\n insets: _insets,\n navigateToTab,\n navigation,\n state,\n ...props\n}: NavigationTabBarProps) {\n const actions = actionsOf(emitter, navigateToTab, navigation)\n const focused = state.routes[state.index]?.key\n\n return (\n <NavigationBar {...props}>\n {state.routes.map((route) => (\n <TabDestination\n focused={route.key === focused}\n key={route.key}\n onLongPress={longPressThen(actions, route)}\n onPress={pressThen(actions, route, route.key === focused)}\n options={descriptors[route.key]?.options ?? NO_OPTIONS}\n route={route}\n />\n ))}\n </NavigationBar>\n )\n}\n\n/**\n * Moves to a tab once the navigator has heard the press, unless a listener\n * prevented it or the tab is already focused. Built by a call rather than\n * written inline at the prop, for the reason `widthThen` gives.\n */\nfunction pressThen(actions: TabActions, route: TabRoute, focused: boolean) {\n return () => {\n const event = actions.emit({\n canPreventDefault: true,\n target: route.key,\n type: 'tabPress',\n })\n\n if (!focused && !prevented(event)) {\n actions.go(route)\n }\n }\n}\n\n// Whether a listener prevented an event, as the navigator reports it.\nfunction prevented(event: unknown) {\n return (\n typeof event === 'object' &&\n event !== null &&\n 'defaultPrevented' in event &&\n event.defaultPrevented === true\n )\n}\n\n/**\n * One route's destination. Its colours are the destination's own for the\n * form the bar draws, which is why it reads them inside the bar rather than\n * the bar computing them for it.\n */\nfunction TabDestination({\n focused,\n onLongPress,\n onPress,\n options,\n route,\n}: {\n readonly focused: boolean\n readonly onLongPress: () => void\n readonly onPress: () => void\n readonly options: TabOptions\n readonly route: TabRoute\n}) {\n const theme = useTheme()\n const { form } = use(NavigationContext)\n const { tabBarLabel } = options\n const title =\n typeof tabBarLabel === 'string'\n ? tabBarLabel\n : (options.title ?? route.name)\n\n return (\n <NavigationDestination\n aria-label={options.tabBarAccessibilityLabel ?? title}\n badge={badgeOf(options.tabBarBadge)}\n icon={options.tabBarIcon?.({\n color: iconColorOf(theme, false, focused),\n focused,\n size: ICON_SIZE,\n })}\n onLongPress={onLongPress}\n onPress={onPress}\n selected={focused}\n testID={options.tabBarButtonTestID}\n >\n {typeof tabBarLabel === 'function'\n ? tabBarLabel({\n children: title,\n color: labelColorOf(theme, form, false, focused),\n focused,\n position: form === 'horizontal' ? 'beside-icon' : 'below-icon',\n })\n : title}\n </NavigationDestination>\n )\n}\n\n/**\n * Records a view's width, as React Native lays it out. Built by a call\n * rather than written inline at the prop, which is what react-perf's\n * jsx-no-new-function-as-prop is after; the React Compiler memoises the\n * result on its inputs.\n */\nfunction widthThen(setWidth: (width: number) => void) {\n return (event: LayoutChangeEvent) => {\n setWidth(event.nativeEvent.layout.width)\n }\n}\n\nNavigationBar.Item = NavigationBarItem\n\nexport type {\n NavigationBarItemProps,\n NavigationBarProps,\n NavigationTabBarProps,\n}\n\nexport { NavigationBar, NavigationBarItem, NavigationTabBar }\n"],"mappings":";;;;;;;;;;AAwLA,MAAMyE,iBAAiB;AAGvB,MAAMC,YAAY;AAGlB,MAAMC,aAAyB,CAAC;AAGhC,MAAMC,SAAS;AAIf,MAAMC,QAAyB;CAAC;CAAU;CAAQ;AAAO;AAEzD,MAAMC,SAASnE,WAAWoE,OAAO;CAG/BC,UAAU;EACRC,QAAQ;EACRC,UAAU;EACVC,eAAe;EACfb,UAAU;EACVc,OAAO;EACPC,KAAK;EACLC,OAAO;CACT;CAGAC,MAAM;EACJC,YAAY;EACZF,OAAOb;CACT;CAEAgB,UAAU,EACRD,YAAY,UACd;AACF,CAAC;AAED,MAAME,WAAWnE,cAAc,EAAEoE,QAAQC,cACvCjF,WAAWoE,OAAO;CAChBc,KAAK,EACHC,iBAAiBH,OAAOI,iBAC1B;CAEAC,YAAY;EACVR,YAAY;EACZS,KAAKL,QAAQM;CACf;CAEAC,UAAU;EACRC,eAAe;EACfH,KAAKL,QAAQM;CACf;CAGAG,KAAK;EACHD,eAAe;EACfE,gBAAgB;EAChBC,WAAW;CACb;AACF,CAAC,CACH;;;;;AAMA,SAASC,UACPlD,SACAC,eACAE,YACY;CACZ,IAAIA,eAAegD,KAA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lB,EAAA;CAAA,OArBxBkB;AAqBwB;;;;;;;AAU5B,SAASM,UAAUkB,UAAmC;CACpD,QAAQ9G,UAA6B;EACnC8G,SAAS9G,MAAM+G,YAAYC,OAAOxE,KAAK;CACzC;AACF;AAEA0B,cAAc+C,OAAOb"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NavigationItemProps } from "../../navigation/index.js";
|
|
2
|
+
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
4
|
+
//#region src/components/navigation-rail/index.d.ts
|
|
5
|
+
type NavigationRailItemProps = NavigationItemProps;
|
|
6
|
+
type NavigationRailProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
7
|
+
/** The destinations: `NavigationRail.Item`s. */
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* What the rail draws above its destinations: a menu button that expands
|
|
11
|
+
* it, or a floating action button.
|
|
12
|
+
*/
|
|
13
|
+
readonly header?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the rail is in its expanded form, each destination a pill with
|
|
16
|
+
* its label beside the icon, rather than collapsed with the label under it.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
readonly isExpanded?: boolean;
|
|
20
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
21
|
+
/**
|
|
22
|
+
* The route of the current destination, matched against each
|
|
23
|
+
* destination's `href`. The match is selected and draws the active
|
|
24
|
+
* indicator.
|
|
25
|
+
*/
|
|
26
|
+
readonly selectedRoute?: string;
|
|
27
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The column of top-level destinations a medium or wider window keeps at its
|
|
31
|
+
* leading edge, collapsed or, with `isExpanded`, expanded. Each destination
|
|
32
|
+
* goes to its `href` through the app's router, see `RouterProvider`.
|
|
33
|
+
*
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <NavigationRail selectedRoute="/first">
|
|
36
|
+
* <NavigationRail.Item href="/first" icon={<FirstIcon />}>
|
|
37
|
+
* First item
|
|
38
|
+
* </NavigationRail.Item>
|
|
39
|
+
* <NavigationRail.Item href="/second" icon={<SecondIcon />}>
|
|
40
|
+
* Second item
|
|
41
|
+
* </NavigationRail.Item>
|
|
42
|
+
* </NavigationRail>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* Draw it at the leading edge of a row holding the screen's content, which
|
|
46
|
+
* gives it its height: it paints its surface to the screen's edges and keeps
|
|
47
|
+
* its destinations clear of the status bar, the home indicator and a notch
|
|
48
|
+
* itself.
|
|
49
|
+
*
|
|
50
|
+
* `aria-label` names the destinations' tab list. `style`, `ref` and `testID`
|
|
51
|
+
* land on the rail's own view, its surface.
|
|
52
|
+
*/
|
|
53
|
+
declare function NavigationRail({ 'aria-label': ariaLabel, children, header, isExpanded, selectedRoute, style, ...props }: NavigationRailProps): import("react").JSX.Element;
|
|
54
|
+
declare namespace NavigationRail {
|
|
55
|
+
var Item: typeof NavigationRailItem;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* One destination of a navigation rail: an icon, a label and, while it is
|
|
59
|
+
* the current one, the active indicator. Pressing it calls `onPress`, then
|
|
60
|
+
* goes to its `href`. Renders nothing of its own outside a `NavigationRail`,
|
|
61
|
+
* whose `selectedRoute` says whether it is selected.
|
|
62
|
+
*
|
|
63
|
+
* `style`, `ref` and `testID` land on the destination's `Pressable`.
|
|
64
|
+
*/
|
|
65
|
+
declare function NavigationRailItem(props: NavigationRailItemProps): import("react").JSX.Element;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailProps };
|
|
68
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { useTheme } from "../../theme/scope.js";
|
|
2
|
+
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
+
import { NavigationContext, NavigationItem } from "../../navigation/index.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { I18nManager, ScrollView, StyleSheet, View } from "react-native";
|
|
6
|
+
import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
|
|
7
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/navigation-rail/index.tsx
|
|
11
|
+
const COLLAPSED_WIDTH = 96;
|
|
12
|
+
const EXPANDED_MIN_WIDTH = 220;
|
|
13
|
+
const EXPANDED_MAX_WIDTH = 360;
|
|
14
|
+
const TOP_PADDING = 44;
|
|
15
|
+
const EXPANDED_PADDING = 20;
|
|
16
|
+
const RING_REACH = 4;
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
content: { flexShrink: 0 },
|
|
19
|
+
destinations: {
|
|
20
|
+
alignSelf: "stretch",
|
|
21
|
+
flexBasis: "auto",
|
|
22
|
+
flexGrow: 1,
|
|
23
|
+
flexShrink: 1,
|
|
24
|
+
margin: -4
|
|
25
|
+
},
|
|
26
|
+
inset: {
|
|
27
|
+
flexGrow: 1,
|
|
28
|
+
flexShrink: 1
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const stylesOf = themedStyles(({ colors, spacing }) => StyleSheet.create({
|
|
32
|
+
collapsed: {
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
flexGrow: 1,
|
|
35
|
+
flexShrink: 1,
|
|
36
|
+
paddingBottom: spacing.xl,
|
|
37
|
+
paddingTop: TOP_PADDING,
|
|
38
|
+
width: COLLAPSED_WIDTH
|
|
39
|
+
},
|
|
40
|
+
collapsedList: {
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
gap: spacing.xs,
|
|
43
|
+
padding: RING_REACH
|
|
44
|
+
},
|
|
45
|
+
expanded: {
|
|
46
|
+
flexGrow: 1,
|
|
47
|
+
flexShrink: 1,
|
|
48
|
+
maxWidth: EXPANDED_MAX_WIDTH,
|
|
49
|
+
minWidth: EXPANDED_MIN_WIDTH,
|
|
50
|
+
paddingBottom: spacing.xl,
|
|
51
|
+
paddingHorizontal: EXPANDED_PADDING,
|
|
52
|
+
paddingTop: TOP_PADDING
|
|
53
|
+
},
|
|
54
|
+
expandedList: {
|
|
55
|
+
alignItems: "flex-start",
|
|
56
|
+
padding: RING_REACH
|
|
57
|
+
},
|
|
58
|
+
header: {
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
marginBottom: spacing.xxxl - spacing.xs
|
|
61
|
+
},
|
|
62
|
+
headerExpanded: {
|
|
63
|
+
alignItems: "flex-start",
|
|
64
|
+
alignSelf: "stretch",
|
|
65
|
+
marginBottom: spacing.xxxl,
|
|
66
|
+
paddingStart: spacing.sm
|
|
67
|
+
},
|
|
68
|
+
rail: {
|
|
69
|
+
backgroundColor: colors.surface,
|
|
70
|
+
flexDirection: "row",
|
|
71
|
+
flexShrink: 0,
|
|
72
|
+
overflow: "hidden"
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
function edgesOf() {
|
|
76
|
+
return [
|
|
77
|
+
"bottom",
|
|
78
|
+
I18nManager.isRTL ? "right" : "left",
|
|
79
|
+
"top"
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The column of top-level destinations a medium or wider window keeps at its
|
|
84
|
+
* leading edge, collapsed or, with `isExpanded`, expanded. Each destination
|
|
85
|
+
* goes to its `href` through the app's router, see `RouterProvider`.
|
|
86
|
+
*
|
|
87
|
+
* ```tsx
|
|
88
|
+
* <NavigationRail selectedRoute="/first">
|
|
89
|
+
* <NavigationRail.Item href="/first" icon={<FirstIcon />}>
|
|
90
|
+
* First item
|
|
91
|
+
* </NavigationRail.Item>
|
|
92
|
+
* <NavigationRail.Item href="/second" icon={<SecondIcon />}>
|
|
93
|
+
* Second item
|
|
94
|
+
* </NavigationRail.Item>
|
|
95
|
+
* </NavigationRail>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* Draw it at the leading edge of a row holding the screen's content, which
|
|
99
|
+
* gives it its height: it paints its surface to the screen's edges and keeps
|
|
100
|
+
* its destinations clear of the status bar, the home indicator and a notch
|
|
101
|
+
* itself.
|
|
102
|
+
*
|
|
103
|
+
* `aria-label` names the destinations' tab list. `style`, `ref` and `testID`
|
|
104
|
+
* land on the rail's own view, its surface.
|
|
105
|
+
*/
|
|
106
|
+
function NavigationRail(t0) {
|
|
107
|
+
const $ = c(43);
|
|
108
|
+
let ariaLabel;
|
|
109
|
+
let children;
|
|
110
|
+
let header;
|
|
111
|
+
let props;
|
|
112
|
+
let selectedRoute;
|
|
113
|
+
let style;
|
|
114
|
+
let t1;
|
|
115
|
+
if ($[0] !== t0) {
|
|
116
|
+
({"aria-label": ariaLabel, children, header, isExpanded: t1, selectedRoute, style, ...props} = t0);
|
|
117
|
+
$[0] = t0;
|
|
118
|
+
$[1] = ariaLabel;
|
|
119
|
+
$[2] = children;
|
|
120
|
+
$[3] = header;
|
|
121
|
+
$[4] = props;
|
|
122
|
+
$[5] = selectedRoute;
|
|
123
|
+
$[6] = style;
|
|
124
|
+
$[7] = t1;
|
|
125
|
+
} else {
|
|
126
|
+
ariaLabel = $[1];
|
|
127
|
+
children = $[2];
|
|
128
|
+
header = $[3];
|
|
129
|
+
props = $[4];
|
|
130
|
+
selectedRoute = $[5];
|
|
131
|
+
style = $[6];
|
|
132
|
+
t1 = $[7];
|
|
133
|
+
}
|
|
134
|
+
const isExpanded = t1 === void 0 ? false : t1;
|
|
135
|
+
const theme = useTheme();
|
|
136
|
+
const own = stylesOf(theme);
|
|
137
|
+
const reduceMotion = useReducedMotion();
|
|
138
|
+
const width = useSharedValue(void 0);
|
|
139
|
+
const t2 = isExpanded ? "expanded" : "collapsed";
|
|
140
|
+
let t3;
|
|
141
|
+
if ($[8] !== selectedRoute || $[9] !== t2) {
|
|
142
|
+
t3 = {
|
|
143
|
+
form: t2,
|
|
144
|
+
measuring: false,
|
|
145
|
+
selectedRoute
|
|
146
|
+
};
|
|
147
|
+
$[8] = selectedRoute;
|
|
148
|
+
$[9] = t2;
|
|
149
|
+
$[10] = t3;
|
|
150
|
+
} else t3 = $[10];
|
|
151
|
+
const context = t3;
|
|
152
|
+
const widthStyle = useAnimatedStyle(() => {
|
|
153
|
+
"worklet";
|
|
154
|
+
const current = width.get();
|
|
155
|
+
return current === void 0 ? {} : { width: current };
|
|
156
|
+
});
|
|
157
|
+
const t4 = Animated;
|
|
158
|
+
const t5 = composeStyles(own.rail, widthStyle, style);
|
|
159
|
+
const T0 = View;
|
|
160
|
+
let t6;
|
|
161
|
+
if ($[11] !== reduceMotion || $[12] !== theme || $[13] !== width) {
|
|
162
|
+
t6 = widthThen(width, reduceMotion, timingOf(theme));
|
|
163
|
+
$[11] = reduceMotion;
|
|
164
|
+
$[12] = theme;
|
|
165
|
+
$[13] = width;
|
|
166
|
+
$[14] = t6;
|
|
167
|
+
} else t6 = $[14];
|
|
168
|
+
const t7 = styles;
|
|
169
|
+
const T1 = SafeAreaView;
|
|
170
|
+
let t8;
|
|
171
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
172
|
+
t8 = edgesOf();
|
|
173
|
+
$[15] = t8;
|
|
174
|
+
} else t8 = $[15];
|
|
175
|
+
const t9 = styles;
|
|
176
|
+
const T2 = View;
|
|
177
|
+
const t10 = isExpanded ? own.expanded : own.collapsed;
|
|
178
|
+
const t11 = header === void 0 ? null : /* @__PURE__ */ jsx(View, {
|
|
179
|
+
style: composeStyles(own.header, isExpanded ? own.headerExpanded : void 0),
|
|
180
|
+
children: header
|
|
181
|
+
});
|
|
182
|
+
const t12 = isExpanded ? own.expandedList : own.collapsedList;
|
|
183
|
+
let t13;
|
|
184
|
+
if ($[16] !== children || $[17] !== context) {
|
|
185
|
+
t13 = /* @__PURE__ */ jsx(NavigationContext, {
|
|
186
|
+
value: context,
|
|
187
|
+
children
|
|
188
|
+
});
|
|
189
|
+
$[16] = children;
|
|
190
|
+
$[17] = context;
|
|
191
|
+
$[18] = t13;
|
|
192
|
+
} else t13 = $[18];
|
|
193
|
+
let t14;
|
|
194
|
+
if ($[19] !== ariaLabel || $[20] !== t12 || $[21] !== t13) {
|
|
195
|
+
t14 = /* @__PURE__ */ jsx(ScrollView, {
|
|
196
|
+
"aria-label": ariaLabel,
|
|
197
|
+
contentContainerStyle: t12,
|
|
198
|
+
role: "tablist",
|
|
199
|
+
style: styles.destinations,
|
|
200
|
+
children: t13
|
|
201
|
+
});
|
|
202
|
+
$[19] = ariaLabel;
|
|
203
|
+
$[20] = t12;
|
|
204
|
+
$[21] = t13;
|
|
205
|
+
$[22] = t14;
|
|
206
|
+
} else t14 = $[22];
|
|
207
|
+
let t15;
|
|
208
|
+
if ($[23] !== T2 || $[24] !== t10 || $[25] !== t11 || $[26] !== t14) {
|
|
209
|
+
t15 = /* @__PURE__ */ jsxs(T2, {
|
|
210
|
+
style: t10,
|
|
211
|
+
children: [t11, t14]
|
|
212
|
+
});
|
|
213
|
+
$[23] = T2;
|
|
214
|
+
$[24] = t10;
|
|
215
|
+
$[25] = t11;
|
|
216
|
+
$[26] = t14;
|
|
217
|
+
$[27] = t15;
|
|
218
|
+
} else t15 = $[27];
|
|
219
|
+
let t16;
|
|
220
|
+
if ($[28] !== T1 || $[29] !== t15 || $[30] !== t8 || $[31] !== t9.inset) {
|
|
221
|
+
t16 = /* @__PURE__ */ jsx(T1, {
|
|
222
|
+
edges: t8,
|
|
223
|
+
style: t9.inset,
|
|
224
|
+
children: t15
|
|
225
|
+
});
|
|
226
|
+
$[28] = T1;
|
|
227
|
+
$[29] = t15;
|
|
228
|
+
$[30] = t8;
|
|
229
|
+
$[31] = t9.inset;
|
|
230
|
+
$[32] = t16;
|
|
231
|
+
} else t16 = $[32];
|
|
232
|
+
let t17;
|
|
233
|
+
if ($[33] !== T0 || $[34] !== t16 || $[35] !== t6 || $[36] !== t7.content) {
|
|
234
|
+
t17 = /* @__PURE__ */ jsx(T0, {
|
|
235
|
+
onLayout: t6,
|
|
236
|
+
style: t7.content,
|
|
237
|
+
children: t16
|
|
238
|
+
});
|
|
239
|
+
$[33] = T0;
|
|
240
|
+
$[34] = t16;
|
|
241
|
+
$[35] = t6;
|
|
242
|
+
$[36] = t7.content;
|
|
243
|
+
$[37] = t17;
|
|
244
|
+
} else t17 = $[37];
|
|
245
|
+
let t18;
|
|
246
|
+
if ($[38] !== props || $[39] !== t17 || $[40] !== t4.View || $[41] !== t5) {
|
|
247
|
+
t18 = /* @__PURE__ */ jsx(t4.View, {
|
|
248
|
+
...props,
|
|
249
|
+
style: t5,
|
|
250
|
+
children: t17
|
|
251
|
+
});
|
|
252
|
+
$[38] = props;
|
|
253
|
+
$[39] = t17;
|
|
254
|
+
$[40] = t4.View;
|
|
255
|
+
$[41] = t5;
|
|
256
|
+
$[42] = t18;
|
|
257
|
+
} else t18 = $[42];
|
|
258
|
+
return t18;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* One destination of a navigation rail: an icon, a label and, while it is
|
|
262
|
+
* the current one, the active indicator. Pressing it calls `onPress`, then
|
|
263
|
+
* goes to its `href`. Renders nothing of its own outside a `NavigationRail`,
|
|
264
|
+
* whose `selectedRoute` says whether it is selected.
|
|
265
|
+
*
|
|
266
|
+
* `style`, `ref` and `testID` land on the destination's `Pressable`.
|
|
267
|
+
*/
|
|
268
|
+
function NavigationRailItem(props) {
|
|
269
|
+
const $ = c(2);
|
|
270
|
+
let t0;
|
|
271
|
+
if ($[0] !== props) {
|
|
272
|
+
t0 = /* @__PURE__ */ jsx(NavigationItem, { ...props });
|
|
273
|
+
$[0] = props;
|
|
274
|
+
$[1] = t0;
|
|
275
|
+
} else t0 = $[1];
|
|
276
|
+
return t0;
|
|
277
|
+
}
|
|
278
|
+
function timingOf({ motion }) {
|
|
279
|
+
return {
|
|
280
|
+
duration: motion.durationLong2,
|
|
281
|
+
easing: Easing.bezier(...motion.easingEmphasized)
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function widthThen(width, reduceMotion, timing) {
|
|
285
|
+
return (event) => {
|
|
286
|
+
const next = event.nativeEvent.layout.width;
|
|
287
|
+
width.set(width.get() === void 0 || reduceMotion ? next : withTiming(next, timing));
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
NavigationRail.Item = NavigationRailItem;
|
|
291
|
+
//#endregion
|
|
292
|
+
export { NavigationRail, NavigationRailItem };
|
|
293
|
+
|
|
294
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","LayoutChangeEvent","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","Edge","useMemo","I18nManager","ScrollView","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaView","NavigationItemProps","ResolvedTheme","NavigationContext","NavigationItem","useTheme","composeStyles","themedStyles","NavigationRailItemProps","NavigationRailProps","Omit","children","header","isExpanded","ref","selectedRoute","style","Timing","duration","easing","ReturnType","bezier","COLLAPSED_WIDTH","EXPANDED_MIN_WIDTH","EXPANDED_MAX_WIDTH","TOP_PADDING","EXPANDED_PADDING","RING_REACH","styles","create","content","flexShrink","destinations","alignSelf","flexBasis","flexGrow","margin","inset","stylesOf","colors","spacing","collapsed","alignItems","paddingBottom","xl","paddingTop","width","collapsedList","gap","xs","padding","expanded","maxWidth","minWidth","paddingHorizontal","expandedList","marginBottom","xxxl","headerExpanded","paddingStart","sm","rail","backgroundColor","surface","flexDirection","overflow","edgesOf","isRTL","NavigationRail","t0","$","_c","ariaLabel","props","t1","undefined","theme","own","reduceMotion","t2","const","t3","form","measuring","context","widthStyle","current","get","t4","t5","T0","t6","widthThen","timingOf","T1","t8","Symbol","for","T2","t10","t11","t12","t13","t14","t15","t16","t9","t17","t7","t18","NavigationRailItem","motion","durationLong2","easingEmphasized","timing","event","next","nativeEvent","layout","set","Item","_c"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n LayoutChangeEvent,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\nimport type { Edge } from 'react-native-safe-area-context'\n\nimport { useMemo } from 'react'\nimport { I18nManager, ScrollView, StyleSheet, View } from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaView } from 'react-native-safe-area-context'\n\nimport type { NavigationItemProps } from '../../navigation'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { NavigationContext, NavigationItem } from '../../navigation'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// kanso-ui's NavigationRail, the navigation rail page's rail, in both its\n// forms: collapsed, a 96dp column of vertical destinations down the leading\n// edge, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. Both are on the surface role, with their\n// contents 44dp from the top: the first destination, or a header when the\n// rail has one, such as a menu button that expands it, with the first\n// destination 40dp under it. The destinations are src/navigation's, shared\n// with NavigationBar, which holds their values.\n//\n// **The rail widens and narrows** when `isExpanded` changes: its surface\n// moves from one form's width to the other's over `durationLong2` on the\n// emphasized curve, as the active indicator moves, while the destinations\n// take their new form at once and the surface reveals or covers them. Web\n// changes width at once. Under reduced motion it does here too. The width it\n// moves to is the one the new form lays out at, measured, so an expanded\n// rail is as wide as its longest label asks within the page's bounds.\n//\n// The rail paints its surface under the status bar, the home indicator and a\n// landscape notch on its leading side, and keeps its header and destinations\n// inside the safe area: a `SafeAreaView` pads it by the top, the bottom and\n// the leading inset, the left one or under right-to-left the right, wherever\n// the rail meets them. Its trailing side faces the screen's content, so it\n// takes no inset there.\n//\n// The destinations scroll in a block of their own under the header, so a\n// rail shorter than they are scrolls them rather than squashing each below\n// its height, and the header stays where it is. The block is a `tablist` and\n// each destination a `tab`, which is how both platforms announce a set of\n// top-level destinations; the header is outside it, since what it holds is\n// not one of them. Web's rail is a landmark of links, which native has no\n// counterpart for. A destination still goes to its `href` through the app's\n// router, see `RouterProvider`.\n\ntype NavigationRailItemProps = NavigationItemProps\n\ntype NavigationRailProps = Omit<ViewProps, 'children' | 'style'> & {\n /** The destinations: `NavigationRail.Item`s. */\n readonly children?: ReactNode\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n readonly header?: ReactNode\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n readonly isExpanded?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match is selected and draws the active\n * indicator.\n */\n readonly selectedRoute?: string\n readonly style?: StyleProp<ViewStyle>\n}\n\ntype Timing = {\n readonly duration: number\n readonly easing: ReturnType<typeof Easing.bezier>\n}\n\n// The collapsed rail's width, and the expanded rail's bounds.\nconst COLLAPSED_WIDTH = 96\nconst EXPANDED_MIN_WIDTH = 220\nconst EXPANDED_MAX_WIDTH = 360\n\n// The page's 44dp above the contents, header or not, and the 20dp either\n// side of the expanded rail's pills, which fall between two steps of the\n// spacing scale and so are written out.\nconst TOP_PADDING = 44\nconst EXPANDED_PADDING = 20\n\n// How far a destination's focus ring reaches past it: the 2dp offset and the\n// 2dp ring. A scroll view clips what overflows it, so the block the\n// destinations scroll in is padded by this much and pulled back out by as\n// much, which leaves every destination where it was and every ring whole.\nconst RING_REACH = 4\n\nconst styles = StyleSheet.create({\n // The form being drawn, as wide as it lays out, whatever the surface\n // around it is moving through.\n content: {\n flexShrink: 0,\n },\n // The destinations' block, which takes the height the header leaves and\n // scrolls what does not fit in it.\n destinations: {\n alignSelf: 'stretch',\n flexBasis: 'auto',\n flexGrow: 1,\n flexShrink: 1,\n margin: -RING_REACH,\n },\n // The safe area and the form inside it take the rail's height and no more,\n // shrinking below what their destinations ask, since a view keeps its\n // content's height by default and the block would then never scroll.\n inset: {\n flexGrow: 1,\n flexShrink: 1,\n },\n})\n\nconst stylesOf = themedStyles(({ colors, spacing }) =>\n StyleSheet.create({\n // The collapsed rail, its destinations centred in it.\n collapsed: {\n alignItems: 'center',\n flexGrow: 1,\n flexShrink: 1,\n paddingBottom: spacing.xl,\n paddingTop: TOP_PADDING,\n width: COLLAPSED_WIDTH,\n },\n // The collapsed rail's destinations, 4dp apart.\n collapsedList: {\n alignItems: 'center',\n gap: spacing.xs,\n padding: RING_REACH,\n },\n // The expanded rail: as wide as its pills ask, within the page's bounds,\n // 20dp either side of them.\n expanded: {\n flexGrow: 1,\n flexShrink: 1,\n maxWidth: EXPANDED_MAX_WIDTH,\n minWidth: EXPANDED_MIN_WIDTH,\n paddingBottom: spacing.xl,\n paddingHorizontal: EXPANDED_PADDING,\n paddingTop: TOP_PADDING,\n },\n // The expanded rail's pills, at its leading edge with no gap between.\n expandedList: {\n alignItems: 'flex-start',\n padding: RING_REACH,\n },\n // What the rail draws above its destinations, the page's 40dp clear of\n // the first: the collapsed rail's 4dp gap, and the rest of its own here.\n header: {\n alignItems: 'center',\n marginBottom: spacing.xxxl - spacing.xs,\n },\n // The expanded rail has no gap between destinations, so its header keeps\n // the whole 40dp. It starts at the leading edge where the pills do, 8dp\n // in from there: a 40dp icon button centres its 24dp icon, and 8dp puts\n // that icon over the pills' icons, 16dp into each pill.\n headerExpanded: {\n alignItems: 'flex-start',\n alignSelf: 'stretch',\n marginBottom: spacing.xxxl,\n paddingStart: spacing.sm,\n },\n // The rail's surface. It keeps its width whatever sits beside it, and\n // holds the form being drawn at its leading edge, clipping it while the\n // surface is narrower.\n rail: {\n backgroundColor: colors.surface,\n flexDirection: 'row',\n flexShrink: 0,\n overflow: 'hidden',\n },\n }),\n)\n\n// The edges the rail meets: the top, the bottom and its leading side, which\n// is the right one under right-to-left.\nfunction edgesOf(): readonly Edge[] {\n return ['bottom', I18nManager.isRTL ? 'right' : 'left', 'top']\n}\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * goes to its `href` through the app's router, see `RouterProvider`.\n *\n * ```tsx\n * <NavigationRail selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * Draw it at the leading edge of a row holding the screen's content, which\n * gives it its height: it paints its surface to the screen's edges and keeps\n * its destinations clear of the status bar, the home indicator and a notch\n * itself.\n *\n * `aria-label` names the destinations' tab list. `style`, `ref` and `testID`\n * land on the rail's own view, its surface.\n */\nfunction NavigationRail({\n 'aria-label': ariaLabel,\n children,\n header,\n isExpanded = false,\n selectedRoute,\n style,\n ...props\n}: NavigationRailProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n // The surface's width, unset until the form being drawn is first measured,\n // which leaves the surface as wide as that form.\n const width = useSharedValue<number | undefined>(undefined)\n const context = useMemo(\n () => ({\n form: isExpanded ? ('expanded' as const) : ('collapsed' as const),\n measuring: false,\n selectedRoute,\n }),\n [isExpanded, selectedRoute],\n )\n const widthStyle = useAnimatedStyle(() => {\n 'worklet'\n const current = width.get()\n\n return current === undefined ? {} : { width: current }\n })\n\n return (\n <Animated.View\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n own.rail,\n widthStyle,\n style,\n )}\n >\n <View\n onLayout={widthThen(width, reduceMotion, timingOf(theme))}\n style={styles.content}\n >\n <SafeAreaView edges={edgesOf()} style={styles.inset}>\n <View style={isExpanded ? own.expanded : own.collapsed}>\n {header === undefined ? null : (\n <View\n style={composeStyles<ViewStyle>(\n own.header,\n isExpanded ? own.headerExpanded : undefined,\n )}\n >\n {header}\n </View>\n )}\n <ScrollView\n aria-label={ariaLabel}\n contentContainerStyle={\n isExpanded ? own.expandedList : own.collapsedList\n }\n role=\"tablist\"\n style={styles.destinations}\n >\n <NavigationContext value={context}>{children}</NavigationContext>\n </ScrollView>\n </View>\n </SafeAreaView>\n </View>\n </Animated.View>\n )\n}\n\n/**\n * One destination of a navigation rail: an icon, a label and, while it is\n * the current one, the active indicator. Pressing it calls `onPress`, then\n * goes to its `href`. Renders nothing of its own outside a `NavigationRail`,\n * whose `selectedRoute` says whether it is selected.\n *\n * `style`, `ref` and `testID` land on the destination's `Pressable`.\n */\nfunction NavigationRailItem(props: NavigationRailItemProps) {\n return <NavigationItem {...props} />\n}\n\n// The rail's change of width, on the active indicator's duration and curve.\nfunction timingOf({ motion }: ResolvedTheme): Timing {\n return {\n duration: motion.durationLong2,\n easing: Easing.bezier(...motion.easingEmphasized),\n }\n}\n\n// Moves the surface to the width the form being drawn lays out at: at once\n// the first time, and under reduced motion, and over the rail's timing\n// after that. Built by a call rather than written inline at the prop, which\n// is what react-perf's jsx-no-new-function-as-prop is after.\nfunction widthThen(\n width: SharedValue<number | undefined>,\n reduceMotion: boolean,\n timing: Timing,\n) {\n return (event: LayoutChangeEvent) => {\n const next = event.nativeEvent.layout.width\n\n width.set(\n width.get() === undefined || reduceMotion\n ? next\n : withTiming(next, timing),\n )\n }\n}\n\nNavigationRail.Item = NavigationRailItem\n\nexport type { NavigationRailItemProps, NavigationRailProps }\n\nexport { NavigationRail, NavigationRailItem }\n"],"mappings":";;;;;;;;;;AA6FA,MAAM2C,kBAAkB;AACxB,MAAMC,qBAAqB;AAC3B,MAAMC,qBAAqB;AAK3B,MAAMC,cAAc;AACpB,MAAMC,mBAAmB;AAMzB,MAAMC,aAAa;AAEnB,MAAMC,SAASpC,WAAWqC,OAAO;CAG/BC,SAAS,EACPC,YAAY,EACd;CAGAC,cAAc;EACZC,WAAW;EACXC,WAAW;EACXC,UAAU;EACVJ,YAAY;EACZK,QAA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EAAA,MAAAuC;CAAA,OAAAA,MAAAvC,EAAA;CAAA,OArChBuC;AAqCgB;;;;;;;;;AAYpB,SAAAC,mBAAArC,OAAA;CAAA,MAAAH,IAAAC,EAAA,CAAA;CAAA,IAAAF;CAAA,IAAAC,EAAA,OAAAG,OAAA;EACSJ,KAAA,oBAAC,gBAAD,EAAe,GAAKI,MAAK,CAAA;EAAIH,EAAA,KAAAG;EAAAH,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAItC,SAASwB,SAAS,EAAEkB,UAAiC;CACnD,OAAO;EACL7F,UAAU6F,OAAOC;EACjB7F,QAAQxB,OAAO0B,OAAO,GAAG0F,OAAOE,gBAAgB;CAClD;AACF;AAMA,SAASrB,UACP9C,OACAgC,cACAoC,QACA;CACA,QAAQC,UAA6B;EACnC,MAAMC,OAAOD,MAAME,YAAYC,OAAOxE;EAEtCA,MAAMyE,IACJzE,MAAMyC,IAAI,MAAMZ,KAAAA,KAAaG,eACzBsC,OACArH,WAAWqH,MAAMF,MAAM,CAC7B;CACF;AACF;AAEA9C,eAAeoD,OAAOV"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ValidationResult } from "../../form/index.js";
|
|
2
2
|
import { FieldVariant } from "../../field/index.js";
|
|
3
|
-
import { ComponentRef, Ref } from "react";
|
|
4
3
|
import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
|
|
4
|
+
import { ComponentRef, Ref } from "react";
|
|
5
5
|
//#region src/components/number-field/index.d.ts
|
|
6
6
|
type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'autoComplete' | 'autoCorrect' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'inputMode' | 'keyboardType' | 'maxLength' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholder' | 'placeholderTextColor' | 'readOnly' | 'selectionColor' | 'spellCheck' | 'style' | 'underlineColorAndroid' | 'value'> & {
|
|
7
7
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { localeOf } from "../../number/locale.js";
|
|
2
1
|
import { IconStyleContext } from "../../glyphs/icon-style.js";
|
|
3
|
-
import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
|
|
4
2
|
import { useTheme } from "../../theme/scope.js";
|
|
5
3
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
6
|
-
import { useFieldValidation } from "../../form/index.js";
|
|
7
|
-
import { withOpacity } from "../../theme/color.js";
|
|
8
4
|
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
5
|
+
import { withOpacity } from "../../theme/color.js";
|
|
6
|
+
import { localeOf } from "../../number/locale.js";
|
|
7
|
+
import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
|
|
8
|
+
import { useFieldValidation } from "../../form/index.js";
|
|
9
9
|
import { IconButton } from "../icon-button/index.js";
|
|
10
10
|
import { FieldBox, FieldInput, FieldMessage, describedBy, useFieldFocus } from "../../field/index.js";
|
|
11
11
|
import { useNumberFieldState } from "../../number/state.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
13
|
+
import { AccessibilityInfo, Platform, Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
13
14
|
import { useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { AccessibilityInfo, Platform, Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
16
16
|
import { NumberFormatter } from "@internationalized/number";
|
|
17
17
|
//#region src/components/number-field/index.tsx
|
|
18
18
|
const STEPPER_WIDTH = 32;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OverlayAlign, OverlaySide } from "../../overlay/placement.js";
|
|
2
2
|
import "../../overlay/index.js";
|
|
3
|
-
import { ReactNode, Ref, RefObject } from "react";
|
|
4
3
|
import { HostInstance, StyleProp, TextProps, ViewProps, ViewStyle } from "react-native";
|
|
4
|
+
import { ReactNode, Ref, RefObject } from "react";
|
|
5
5
|
//#region src/components/popover/index.d.ts
|
|
6
6
|
/** Where the panel sits along the side it opens on. */
|
|
7
7
|
type PopoverAlign = OverlayAlign;
|
|
@@ -3,15 +3,15 @@ import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
|
3
3
|
import { useTypeRole } from "../../typography/roles.js";
|
|
4
4
|
import { refsOf } from "../../ref/index.js";
|
|
5
5
|
import { ButtonSlotContext } from "../../button/slots.js";
|
|
6
|
+
import { DismissLayer, PANEL_ORIGINS, useBackToClose, useFocusOnPlaced, usePanelMotion, useReturnFocus } from "../../overlay/panel.js";
|
|
6
7
|
import { Overlay } from "../../overlay/host.js";
|
|
7
8
|
import { useAnchoredPlacement } from "../../overlay/anchored.js";
|
|
8
9
|
import { ModalWindow, panelRoleOf } from "../../modal/index.js";
|
|
9
|
-
import { DismissLayer, PANEL_ORIGINS, useBackToClose, useFocusOnPlaced, usePanelMotion, useReturnFocus } from "../../overlay/panel.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
|
-
import { createContext, use, useEffect, useId, useRef, useState } from "react";
|
|
12
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
11
|
import { ScrollView, StyleSheet, Text } from "react-native";
|
|
14
12
|
import Animated from "react-native-reanimated";
|
|
13
|
+
import { createContext, use, useEffect, useId, useRef, useState } from "react";
|
|
14
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { useOverlayTriggerState } from "react-stately/useOverlayTriggerState";
|
|
16
16
|
//#region src/components/popover/index.tsx
|
|
17
17
|
const DEFAULT_HOVER_DELAY = 600;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarkImageProps } from "../../mark/index.js";
|
|
2
|
-
import { ComponentRef, Ref } from "react";
|
|
3
2
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, Ref } from "react";
|
|
4
4
|
//#region src/components/product-icon/index.d.ts
|
|
5
5
|
type ProductIconProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IndicatorTone } from "../../indicator/index.js";
|
|
2
|
-
import { ComponentRef, Ref } from "react";
|
|
3
2
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, Ref } from "react";
|
|
4
4
|
//#region src/components/progress-indicator/index.d.ts
|
|
5
5
|
type ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
6
6
|
/**
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { HIDDEN } from "../../glyphs/hidden.js";
|
|
2
1
|
import { parseLength } from "../../theme/resolve.js";
|
|
3
2
|
import { useTheme } from "../../theme/scope.js";
|
|
4
3
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
4
|
+
import { HIDDEN } from "../../glyphs/hidden.js";
|
|
5
5
|
import { DETERMINATE_EASING, stylesOf as stylesOf$1 } from "../../indicator/styles.js";
|
|
6
6
|
import { IndicatorLabels, IndicatorLine, activeLength, fillOf, readingOf, useEased, useIndicatorColors, useMeasuredWidth } from "../../indicator/index.js";
|
|
7
7
|
import { keyframeAt, useLoop } from "../../indicator/motion.js";
|
|
8
8
|
import { TURN, WAVE_HEIGHT, WAVE_ORIGIN, arcPath, wavePath, wavyArcPath } from "../../indicator/paths.js";
|
|
9
9
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { I18nManager, StyleSheet, View } from "react-native";
|
|
12
|
-
import Svg, { Path } from "react-native-svg";
|
|
13
11
|
import Animated, { useAnimatedProps, useAnimatedStyle, useDerivedValue, useReducedMotion } from "react-native-reanimated";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import Svg, { Path } from "react-native-svg";
|
|
14
14
|
//#region src/components/progress-indicator/index.tsx
|
|
15
15
|
const CIRCULAR_SIZE = 40;
|
|
16
16
|
const RADIUS = 18;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentRef, ReactNode, Ref } from "react";
|
|
2
1
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/radio-group/index.d.ts
|
|
4
4
|
/** Which way a `RadioGroup` lays out its buttons. */
|
|
5
5
|
type RadioGroupOrientation = 'horizontal' | 'vertical';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useTheme } from "../../theme/scope.js";
|
|
2
2
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
+
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
3
4
|
import { useTypeRole } from "../../typography/roles.js";
|
|
4
5
|
import { withOpacity } from "../../theme/color.js";
|
|
5
|
-
import { hitSlop, usePressFeedback } from "../../press/index.js";
|
|
6
6
|
import { controlStylesOf } from "../../control/styles.js";
|
|
7
7
|
import { ControlLabel, ControlMessage, describedBy, messageOf } from "../../control/index.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
|
-
import { createContext, use, useId } from "react";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
9
|
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
12
10
|
import Animated, { Easing, useAnimatedStyle, useReducedMotion, withTiming } from "react-native-reanimated";
|
|
11
|
+
import { createContext, use, useId } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useRadioGroupState } from "react-stately/useRadioGroupState";
|
|
14
14
|
//#region src/components/radio-group/index.tsx
|
|
15
15
|
const RING_SIZE = 20;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationResult } from "../../form/index.js";
|
|
2
|
-
import { ComponentRef, Ref } from "react";
|
|
3
2
|
import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
|
|
3
|
+
import { ComponentRef, Ref } from "react";
|
|
4
4
|
//#region src/components/search-field/index.d.ts
|
|
5
5
|
type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholderTextColor' | 'readOnly' | 'returnKeyType' | 'role' | 'selectionColor' | 'style' | 'underlineColorAndroid' | 'value'> & {
|
|
6
6
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { AutocompleteContext } from "../../autocomplete/index.js";
|
|
2
1
|
import { IconStyleContext } from "../../glyphs/icon-style.js";
|
|
3
|
-
import { CloseGlyph, SearchGlyph } from "../../glyphs/index.js";
|
|
4
2
|
import { useTheme } from "../../theme/scope.js";
|
|
5
3
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
6
|
-
import { useFieldValidation } from "../../form/index.js";
|
|
7
|
-
import { withOpacity } from "../../theme/color.js";
|
|
8
4
|
import { usePressFeedback } from "../../press/index.js";
|
|
5
|
+
import { withOpacity } from "../../theme/color.js";
|
|
6
|
+
import { AutocompleteContext } from "../../autocomplete/index.js";
|
|
7
|
+
import { CloseGlyph, SearchGlyph } from "../../glyphs/index.js";
|
|
8
|
+
import { useFieldValidation } from "../../form/index.js";
|
|
9
9
|
import { IconButton } from "../icon-button/index.js";
|
|
10
10
|
import { FieldInput, FieldMessage, FieldStates, FieldStroke, describedBy, useFieldFocus, useStrokeMotion } from "../../field/index.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
|
+
import { Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
12
13
|
import { use, useId, useImperativeHandle, useRef, useState } from "react";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
15
15
|
//#region src/components/search-field/index.tsx
|
|
16
16
|
const ICON_SIZE = 24;
|
|
17
17
|
const MAX_WIDTH = 720;
|