@kanso-labs/react-native-kanso-ui 0.3.0 → 0.4.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/dist/button/slots.d.ts +1 -0
- package/dist/button/slots.js.map +1 -1
- package/dist/components/dialog/index.d.ts +2 -1
- package/dist/components/dialog/index.js +104 -242
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +137 -0
- package/dist/components/sheet/index.js +1090 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/i18n/messages.js +136 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/modal/index.d.ts +16 -0
- package/dist/modal/index.js +284 -0
- package/dist/modal/index.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","LayoutChangeEvent","ScrollViewProps","StyleProp","TextProps","TextStyle","ViewProps","ViewStyle","GestureType","AnimatedStyle","SharedValue","EdgeInsets","createContext","use","useCallback","useEffect","useId","useMemo","useState","I18nManager","Text","NativeText","Pressable","ScrollView","StyleSheet","useWindowDimensions","View","Gesture","GestureDetector","GestureHandlerRootView","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaInsetsContext","ButtonSlots","ModalOpenProps","ModalTrigger","ResolvedTheme","ButtonSlotContext","useWindowSizeClass","messagesFor","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","refsOf","useModalState","useModalTrigger","usePressFeedback","useTheme","composeStyles","themedStyles","useTypeRole","SIDE_WIDTH","TOP_MARGIN","PARTIAL","DRAG_SLOP","FLING","BAR_WIDTH","BAR_HEIGHT","BAR_SPACE","BAR_SIDE","stylesOf","colors","radii","shadows","spacing","create","bar","backgroundColor","onSurfaceVariant","borderRadius","pill","height","width","body","gap","lg","paddingHorizontal","xl","paddingVertical","bodyText","color","container","surfaceContainerLow","boxShadow","elevation1","overflow","containerBottom","borderTopLeftRadius","borderTopRightRadius","containerSide","borderBottomStartRadius","borderTopStartRadius","flex","footer","alignItems","borderTopColor","outlineVariant","borderTopWidth","flexDirection","flexShrink","flexWrap","sm","justifyContent","minHeight","paddingBottom","paddingTop","handle","alignSelf","header","borderBottomColor","borderBottomWidth","md","rootBottom","bottom","left","position","right","rootSide","end","maxWidth","top","title","minWidth","SheetLayout","expanded","pan","setTitle","node","titleId","toggle","SheetLayoutContext","SheetTriggerContext","SheetBodyProps","ref","SheetContentProps","Omit","SheetOpenProps","children","isDismissable","isKeyboardDismissDisabled","style","SheetHandleProps","defaultOpen","isOpen","onOpenChange","SheetPartProps","SheetProps","SheetTitleProps","SheetWindowProps","close","setPresent","present","slots","Stops","partial","settles","bottomBoundsOf","insets","maxHeight","Math","max","settleOf","at","velocity","find","stop","findLast","reduce","nearest","abs","Sheet","t0","$","_c","t1","context","t2","t3","SheetBody","contentContainerStyle","onContentSizeChange","onLayout","props","scrollEnabled","undefined","layout","useLayout","styles","text","content","setContent","room","setRoom","measureContent","event","nativeEvent","measureRoom","scrolls","overflows","t4","Native","enabled","blocksExternalGesture","native","T0","T1","t5","t6","t7","t8","t9","SheetContent","outer","state","SheetFooter","SheetHandle","label","theme","corners","feedback","dragHandle","handlers","ring","layer","SheetHeader","SheetTitle","role","SheetWindow","testID","full","setFull","setExpanded","stopsOf","stops","twoHeights","rest","motion","useSheetMotion","length","offset","useSheetDrag","Symbol","for","_temp","measure","labelledBy","t10","t11","scrim","t12","T2","t13","t14","t15","t16","sideInsetsOf","panel","t17","t18","t19","t20","t21","t22","was","paddingStart","lower","part","Error","reduceMotion","origin","lowest","follow","translation","set","min","get","settle","target","higher","duration","durationMedium1","easing","bezier","easingEmphasizedDecelerate","success","velocityY","Pan","activeOffsetY","runOnJS","onStart","translationY","onUpdate","translationY_0","onEnd","withTestId","shown","direction","isRTL","durationShort2","durationShort3","easingEmphasizedAccelerate","easingStandard","fade","enter","exit","gone","timer","setTimeout","clearTimeout","transform","translateY","progress","opacity","translateX","Body","Content","Footer","Handle","Header","Title","_c","NativeText"],"sources":["../../../src/components/sheet/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n ScrollViewProps,\n StyleProp,\n TextProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { GestureType } from 'react-native-gesture-handler'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\n\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react'\nimport {\n I18nManager,\n Text as NativeText,\n Pressable,\n ScrollView,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport {\n Gesture,\n GestureDetector,\n GestureHandlerRootView,\n} from 'react-native-gesture-handler'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ButtonSlots } from '../../button/slots'\nimport type { ModalOpenProps, ModalTrigger } from '../../modal'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { ButtonSlotContext } from '../../button/slots'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { messagesFor } from '../../i18n'\nimport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n refsOf,\n useModalState,\n useModalTrigger,\n} from '../../modal'\nimport { usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The bottom sheets and side sheets spec pages' modal sheets, as kanso-ui's\n// Sheet draws them: one component, which is a bottom sheet in a compact\n// window, below 600dp, and a side sheet from the medium window up. Both sit on\n// surface container low at the first elevation level, over the scrim. The\n// bottom sheet spans the window, with the 28dp corner on its top two corners,\n// and stops 72dp short of the window's top, the page's top margin, so a long\n// body scrolls. The side sheet is 400dp wide and as tall as the window, along\n// the end edge, with the 16dp corner on its two start corners, and turns over\n// with the layout under right-to-left.\n//\n// **The bottom sheet drags**, which web's does not: the spec page draws a\n// sheet that is dragged between heights and swiped down to go, and web\n// records leaving it out as a departure that native need not repeat. A sheet\n// taller than half the window opens at half its height, as Android's modal\n// bottom sheet does, and is dragged up to the whole of it and back; one no\n// taller opens whole. Let go, it settles on the nearest of those heights, or\n// one height on in the direction of a fling, and below the lowest it goes,\n// unless `isDismissable` is false, which holds it at the lowest. The drag is\n// Gesture Handler's pan, through the builder API both its 2.x and its 3\n// export. While the sheet is at half height its body does not scroll, so a\n// drag on it raises the sheet; once whole, a body with more than it can show\n// scrolls, and the sheet is dragged by the handle, header and actions. At\n// half height the actions are below the fold, where the drag brings them.\n//\n// **The handle is a control where the sheet has two heights**, as Android's\n// drag handle is: a press moves the sheet to the other one, and it says which\n// it is at as expanded or collapsed. It takes the press feedback every control\n// does, over a 48dp target, and is named \"Drag handle\" in the device's locale\n// unless `aria-label` says otherwise. A sheet with one height has nothing for\n// it to do, and draws it as web does, as a mark the screen reader skips. The\n// side sheet draws no handle.\n//\n// **It is drawn in a React Native `Modal`**, through src/modal, as `Dialog`\n// is, so it keeps the `ThemeScope` around it, hosts its own overlays, and\n// takes its scrim, its back gesture and its focus handling from there. The\n// sheet's own panel is a Gesture Handler root, which Android needs for a\n// gesture inside a `Modal`'s window.\n//\n// **It animates out as well as in**, from the motion tokens: it arrives from\n// its edge over the medium duration on the emphasised decelerating curve and\n// leaves over the short one on the accelerating curve, while the scrim fades\n// on the standard one. Web only animates in, since React Aria keeps a closing\n// surface mounted only while a CSS animation runs. The side sheet fades as it\n// travels, as web's does; the bottom sheet does not, since its position is\n// also the drag's. Under reduced motion the sheet appears and leaves at once,\n// and the scrim still fades.\n//\n// **Its content sits inside the safe area** while its fill runs on under it:\n// the bottom sheet's above the home indicator and inside the side insets of a\n// phone held sideways, and the side sheet's under the status bar and over the\n// home indicator, inside the inset on its own edge.\n\n// The side sheet's width, web's and the side sheets page's.\nconst SIDE_WIDTH = 400\n\n// The bottom sheet's top margin once whole, the page's 72dp.\nconst TOP_MARGIN = 72\n\n// How much of the window a sheet with two heights shows at the lower one.\nconst PARTIAL = 0.5\n\n// How far a press travels before it is a drag, so a tap on the sheet's\n// content stays a tap.\nconst DRAG_SLOP = 8\n\n// A release faster than this, in dp a second, is a fling, which moves the\n// sheet one height on rather than to the nearest. Android's bottom sheet\n// takes the same speed as the one that hides it.\nconst FLING = 500\n\n// The handle's bar and the room above and below it, web's 32 by 4 with 22dp\n// either side, which with 8dp at its ends makes the 48dp target.\nconst BAR_WIDTH = 32\nconst BAR_HEIGHT = 4\nconst BAR_SPACE = 22\nconst BAR_SIDE = 8\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The handle's bar, on on-surface variant.\n bar: {\n backgroundColor: colors.onSurfaceVariant,\n borderRadius: radii.pill,\n height: BAR_HEIGHT,\n width: BAR_WIDTH,\n },\n // The body's padding, web's: 24dp at the sides, 16dp at either end\n // and between whatever it holds.\n body: {\n gap: spacing.lg,\n paddingHorizontal: spacing.xl,\n paddingVertical: spacing.lg,\n },\n // The text a body is handed as a string, in body medium on on-surface\n // variant, as the stories on web set theirs.\n bodyText: {\n color: colors.onSurfaceVariant,\n },\n // Both sheets' container, whose corners clip the body's scroll.\n container: {\n backgroundColor: colors.surfaceContainerLow,\n boxShadow: shadows.elevation1,\n overflow: 'hidden',\n },\n // The bottom sheet's container: the window's width, rounded on top.\n containerBottom: {\n borderTopLeftRadius: radii.xl,\n borderTopRightRadius: radii.xl,\n width: '100%',\n },\n // The side sheet's container, as tall as the window and rounded on the\n // corners that face the screen it covers.\n containerSide: {\n borderBottomStartRadius: radii.lg,\n borderTopStartRadius: radii.lg,\n flex: 1,\n },\n // The actions, web's: leading, wrapping onto another row when they do\n // not fit on one, over a divider, in a bar 72dp tall at least.\n footer: {\n alignItems: 'center',\n borderTopColor: colors.outlineVariant,\n borderTopWidth: 1,\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n gap: spacing.sm,\n justifyContent: 'flex-start',\n minHeight: 72,\n paddingBottom: spacing.xl,\n paddingHorizontal: spacing.xl,\n paddingTop: spacing.lg,\n },\n // The handle's 48dp target, centred along the sheet's top edge.\n handle: {\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: radii.pill,\n flexShrink: 0,\n paddingHorizontal: BAR_SIDE,\n paddingVertical: BAR_SPACE,\n },\n // The headline and whatever shares its row, a close button for one,\n // over a divider.\n header: {\n alignItems: 'center',\n borderBottomColor: colors.outlineVariant,\n borderBottomWidth: 1,\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.md,\n justifyContent: 'space-between',\n paddingHorizontal: spacing.xl,\n paddingVertical: spacing.sm,\n },\n // Where each sheet sits in the window. The panel is a Gesture Handler\n // root of its own, the size of the sheet, so a press beside it reaches\n // the scrim.\n rootBottom: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n },\n rootSide: {\n bottom: 0,\n end: 0,\n maxWidth: '100%',\n position: 'absolute',\n top: 0,\n width: SIDE_WIDTH,\n },\n // The headline gives way to whatever shares its row.\n title: {\n color: colors.onSurfaceVariant,\n flexShrink: 1,\n minWidth: 0,\n },\n }),\n)\n\n// What the content's parts read: which sheet is drawn, whether it is at its\n// whole height, the drag a scrolling body holds off, and the headline.\ntype SheetLayout = {\n readonly bottom: boolean\n readonly expanded: boolean\n // Gesture Handler 3 deprecates its gesture builder, and this type, for hooks\n // that version 2 does not have, and the peer range admits both, so the sheet\n // keeps the builder while it does.\n // oxlint-disable-next-line typescript/no-deprecated -- see above\n readonly pan: GestureType\n readonly setTitle: (node: HostInstance | null) => void\n readonly titleId: string\n /** What a press on the handle does, where the sheet has two heights. */\n readonly toggle: (() => void) | undefined\n}\n\nconst SheetLayoutContext = createContext<null | SheetLayout>(null)\nconst SheetTriggerContext = createContext<ModalTrigger | null>(null)\n\ntype SheetBodyProps = ScrollViewProps & {\n readonly ref?: Ref<ComponentRef<typeof ScrollView>>\n}\n\ntype SheetContentProps = Omit<ViewProps, 'children' | 'style'> &\n SheetOpenProps & {\n readonly children?: ReactNode\n /**\n * Whether a press on the scrim, outside the sheet, and a swipe down past\n * its lowest height close it. Android's back gesture is\n * `isKeyboardDismissDisabled`'s, and this says nothing about it.\n * @default true\n */\n readonly isDismissable?: boolean\n /**\n * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on\n * web, from closing the sheet.\n * @default false\n */\n readonly isKeyboardDismissDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype SheetHandleProps = Omit<ViewProps, 'children'> & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype SheetOpenProps = ModalOpenProps & {\n /** Whether the sheet starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the sheet is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the sheet opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\ntype SheetPartProps = ViewProps & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype SheetProps = SheetOpenProps & {\n /** The button that opens the sheet, and `Sheet.Content`. */\n readonly children?: ReactNode\n}\n\ntype SheetTitleProps = Omit<TextProps, 'role'> & {\n readonly ref?: Ref<HostInstance>\n}\n\n// What the window draws once the sheet is open, and what it needs from the\n// part that keeps the open state.\ntype SheetWindowProps = Omit<\n SheetContentProps,\n 'defaultOpen' | 'isOpen' | 'onOpenChange'\n> & {\n readonly close: () => void\n readonly isDismissable: boolean\n readonly isKeyboardDismissDisabled: boolean\n readonly isOpen: boolean\n readonly setPresent: (present: boolean) => void\n readonly slots: ButtonSlots\n}\n\n// The heights a bottom sheet rests at, as how far its panel is moved down:\n// whole, at half the window where it is taller than that, and gone.\ntype Stops = {\n /** The lower height, where the sheet has two. */\n readonly partial: null | number\n /** Every height a release can settle on, highest first. */\n readonly settles: readonly number[]\n}\n\n// The bottom sheet's room and padding: no taller than the window less the top\n// margin, or less the status bar where that is the taller, and its content\n// above the home indicator and inside the side insets.\nfunction bottomBoundsOf(insets: EdgeInsets, height: number): ViewStyle {\n return {\n ...insetsOf(insets),\n maxHeight: height - Math.max(TOP_MARGIN, insets.top),\n paddingTop: 0,\n }\n}\n\n/**\n * Where a bottom sheet let go comes to rest: one height on in the direction of\n * a fling, and the nearest height otherwise. Heights are how far the panel is\n * moved down, highest first, and the highest is always the whole sheet, 0.\n */\nfunction settleOf(at: number, velocity: number, settles: readonly number[]) {\n if (velocity > FLING) {\n return settles.find((stop) => stop > at) ?? settles.at(-1) ?? 0\n }\n\n if (velocity < -FLING) {\n return settles.findLast((stop) => stop < at) ?? 0\n }\n\n return settles.reduce(\n (nearest, stop) =>\n Math.abs(stop - at) < Math.abs(nearest - at) ? stop : nearest,\n 0,\n )\n}\n\n/**\n * A modal sheet along an edge of the screen, the bottom sheets and side sheets\n * spec pages' modal sheets, paired by window size as kanso-ui's are: a bottom\n * sheet in a compact window, dragged between heights and swiped down to go,\n * and a side sheet along the end edge from the medium window up. Pass\n * `isOpen` with `onOpenChange` to hold the open state, or `defaultOpen` to let\n * it keep its own.\n *\n * ```tsx\n * <Sheet>\n * <Button>Open</Button>\n * <Sheet.Content>\n * <Sheet.Handle />\n * <Sheet.Header>\n * <Sheet.Title>Headline</Sheet.Title>\n * </Sheet.Header>\n * <Sheet.Body>Supporting text</Sheet.Body>\n * <Sheet.Footer>\n * <Button slot=\"close\">Done</Button>\n * </Sheet.Footer>\n * </Sheet.Content>\n * </Sheet>\n * ```\n *\n * Composed rather than configured by props, as web's is. A `Button` or\n * `IconButton` inside `Sheet` and outside its content opens it, and one given\n * `slot=\"close\"` anywhere inside the content closes it. A sheet nothing on the\n * screen opens leaves `Sheet` out and passes `isOpen` and `onOpenChange` to\n * `Sheet.Content` instead.\n */\nfunction Sheet({ children, defaultOpen, isOpen, onOpenChange }: SheetProps) {\n const { context, slots } = useModalTrigger({\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n return (\n <SheetTriggerContext value={context}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SheetTriggerContext>\n )\n}\n\n/**\n * What the sheet shows, as a body that scrolls when its content runs past the\n * room it has. A string is drawn in body medium on on-surface variant;\n * anything else draws itself. `style`, `ref` and `testID` land on the\n * `ScrollView`.\n *\n * A body its content runs past takes focus, as web's is a tab stop, so a\n * keyboard can scroll it when nothing inside it takes focus; a call site's\n * own `focusable` still wins. A bottom sheet's body scrolls only once the\n * sheet is at its whole height, and holds the sheet's drag off while it does.\n */\nfunction SheetBody({\n children,\n contentContainerStyle,\n onContentSizeChange,\n onLayout,\n scrollEnabled = true,\n ...props\n}: SheetBodyProps) {\n const layout = useLayout('Sheet.Body')\n const styles = stylesOf(useTheme())\n const text = useTypeRole('bodyMedium')\n const [content, setContent] = useState(0)\n const [room, setRoom] = useState(0)\n const measureContent = useCallback(\n (width: number, height: number) => {\n setContent(height)\n onContentSizeChange?.(width, height)\n },\n [onContentSizeChange],\n )\n const measureRoom = useCallback(\n (event: LayoutChangeEvent) => {\n setRoom(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n const scrolls = scrollEnabled && layout.expanded\n const overflows = content > room\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- a builder named after its gesture, not a component; see SheetLayout\n const native = Gesture.Native()\n .enabled(scrolls && overflows)\n .blocksExternalGesture(layout.pan)\n\n return (\n <GestureDetector gesture={native}>\n <ScrollView\n focusable={scrolls && overflows}\n onContentSizeChange={measureContent}\n onLayout={measureRoom}\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n styles.body,\n contentContainerStyle,\n )}\n scrollEnabled={scrolls}\n >\n {typeof children === 'string' ? (\n <NativeText style={composeStyles<TextStyle>(text, styles.bodyText)}>\n {children}\n </NativeText>\n ) : (\n children\n )}\n </ScrollView>\n </GestureDetector>\n )\n}\n\n/**\n * The sheet itself, and the scrim behind it. Everything the sheet shows goes\n * in here; the button that opens it stays outside it.\n *\n * Inside `Sheet`, the open state is the trigger's. On its own it is this\n * part's: `isOpen` with `onOpenChange` holds it, and a `slot=\"close\"` button,\n * the scrim, the swipe and the back gesture all report through\n * `onOpenChange`. `style`, `ref` and `testID` land on the container, and\n * `testID` names the drag `<testID>-drag` for Gesture Handler's test helpers.\n */\nfunction SheetContent({\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen,\n onOpenChange,\n ...props\n}: SheetContentProps) {\n const outer = use(SheetTriggerContext)\n const { close, present, setPresent, slots, state } = useModalState(outer, {\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n if (!present) {\n return null\n }\n\n return (\n <SheetWindow\n {...props}\n close={close}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={state.isOpen}\n setPresent={setPresent}\n slots={slots}\n />\n )\n}\n\n/**\n * The sheet's actions, leading and wrapping onto another row when they do not\n * fit on one, over a divider. On a bottom sheet at half height they are below\n * the fold until the sheet is raised. `style`, `ref` and `testID` land on its\n * view.\n */\nfunction SheetFooter({ style, ...props }: SheetPartProps) {\n useLayout('Sheet.Footer')\n const styles = stylesOf(useTheme())\n\n return (\n <View {...props} style={composeStyles<ViewStyle>(styles.footer, style)} />\n )\n}\n\n/**\n * The bottom sheet's drag handle, a 32 by 4dp bar centred along its top edge.\n * Where the sheet has two heights it is a button moving it to the other one,\n * named \"Drag handle\" in the device's locale unless `aria-label` says\n * otherwise; elsewhere it is a mark a screen reader skips. A side sheet draws\n * none. `style`, `ref` and `testID` land on its view.\n */\nfunction SheetHandle({\n 'aria-label': label,\n style,\n ...props\n}: SheetHandleProps) {\n const layout = useLayout('Sheet.Handle')\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, radii } = theme\n const feedback = usePressFeedback({\n color: colors.onSurfaceVariant,\n corners: { borderRadius: radii.pill },\n })\n const { toggle } = layout\n\n if (!layout.bottom) {\n return null\n }\n\n if (toggle === undefined) {\n return (\n <View\n aria-hidden\n {...props}\n style={composeStyles<ViewStyle>(styles.handle, style)}\n >\n <View style={styles.bar} />\n </View>\n )\n }\n\n return (\n <Pressable\n aria-expanded={layout.expanded}\n aria-label={label ?? messagesFor().dragHandle}\n role=\"button\"\n {...props}\n {...feedback.handlers}\n onPress={toggle}\n style={composeStyles<ViewStyle>(styles.handle, feedback.ring, style)}\n >\n {feedback.layer}\n <View style={styles.bar} />\n </Pressable>\n )\n}\n\n/**\n * The sheet's header: its `Sheet.Title`, and anything beside it, such as a\n * close button, over a divider. `style`, `ref` and `testID` land on its view.\n */\nfunction SheetHeader({ style, ...props }: SheetPartProps) {\n useLayout('Sheet.Header')\n const styles = stylesOf(useTheme())\n\n return (\n <View {...props} style={composeStyles<ViewStyle>(styles.header, style)} />\n )\n}\n\n/**\n * Names the sheet: the container is labelled by it, and a screen reader is\n * sent to it once the sheet shows. In title large on on-surface variant.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction SheetTitle({ ref, style, ...props }: SheetTitleProps) {\n const layout = useLayout('Sheet.Title')\n const styles = stylesOf(useTheme())\n const role = useTypeRole('titleLarge')\n\n return (\n <NativeText\n {...props}\n nativeID={layout.titleId}\n ref={refsOf(layout.setTitle, ref)}\n role=\"heading\"\n style={composeStyles<TextStyle>(role, styles.title, style)}\n />\n )\n}\n\n/**\n * The open sheet, mounted from the moment it opens until its exit has run, so\n * each opening starts from its edge and at its first height.\n */\nfunction SheetWindow({\n children,\n close,\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n onLayout,\n setPresent,\n slots,\n style,\n testID,\n ...props\n}: SheetWindowProps) {\n const styles = stylesOf(useTheme())\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const { height } = useWindowDimensions()\n const bottom = useWindowSizeClass() === 'compact'\n const titleId = useId()\n const [title, setTitle] = useState<HostInstance | null>(null)\n // The panel's height as laid out, before any drag moves it, and whether a\n // sheet with two heights is at the higher one.\n const [full, setFull] = useState<null | number>(null)\n const [expanded, setExpanded] = useState(false)\n const stops = stopsOf(bottom, full, height, isDismissable)\n const twoHeights = stops.partial !== null\n const rest = stops.partial !== null && !expanded ? stops.partial : 0\n const motion = useSheetMotion({ bottom, full, isOpen, rest, setPresent })\n const pan = useSheetDrag({\n close,\n enabled: bottom && isOpen && stops.settles.length > 1,\n expanded,\n full,\n isDismissable,\n offset: motion.offset,\n rest,\n setExpanded,\n stops,\n testID,\n })\n const toggle = useCallback(() => {\n setExpanded((was) => !was)\n }, [])\n const layout = useMemo<SheetLayout>(\n () => ({\n bottom,\n expanded: !twoHeights || expanded,\n pan,\n setTitle,\n titleId,\n toggle: twoHeights ? toggle : undefined,\n }),\n [bottom, expanded, pan, titleId, toggle, twoHeights],\n )\n const measure = useCallback(\n (event: LayoutChangeEvent) => {\n setFull(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n const labelledBy = title === null ? undefined : titleId\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n labelledBy={labelledBy}\n onClose={close}\n onScrimPress={isDismissable && isOpen ? close : undefined}\n scrim={motion.scrim}\n title={title}\n >\n <GestureHandlerRootView\n style={bottom ? styles.rootBottom : styles.rootSide}\n >\n <GestureDetector gesture={pan}>\n <Animated.View\n {...panelRoleOf('dialog', labelledBy)}\n onAccessibilityEscape={\n isKeyboardDismissDisabled ? undefined : close\n }\n {...props}\n onLayout={measure}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.container,\n bottom ? styles.containerBottom : styles.containerSide,\n bottom ? bottomBoundsOf(insets, height) : sideInsetsOf(insets),\n motion.panel,\n style,\n )}\n testID={testID}\n >\n <SheetLayoutContext value={layout}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SheetLayoutContext>\n </Animated.View>\n </GestureDetector>\n </GestureHandlerRootView>\n </ModalWindow>\n )\n}\n\n// The side sheet's padding: its content under the status bar, over the home\n// indicator and inside the inset on its own edge. Its start edge faces the\n// screen it covers, which has none.\nfunction sideInsetsOf(insets: EdgeInsets): ViewStyle {\n return { ...insetsOf(insets), paddingStart: 0 }\n}\n\nfunction stopsOf(\n bottom: boolean,\n full: null | number,\n height: number,\n isDismissable: boolean,\n): Stops {\n if (!bottom || full === null) {\n return { partial: null, settles: [0] }\n }\n\n const lower = full - height * PARTIAL\n const partial = lower > 0 ? lower : null\n\n return {\n partial,\n settles: [\n 0,\n ...(partial === null ? [] : [partial]),\n ...(isDismissable ? [full] : []),\n ],\n }\n}\n\nfunction useLayout(part: string) {\n const layout = use(SheetLayoutContext)\n\n if (layout === null) {\n throw new Error(`${part} is drawn inside Sheet.Content.`)\n }\n\n return layout\n}\n\n/**\n * The bottom sheet's drag. The panel follows the finger, no higher than its\n * whole height and no lower than gone, or than its lowest height when it may\n * not be dismissed, and once let go it settles where `settleOf` says: below\n * the lowest height it closes, and at another height it moves the sheet there.\n */\nfunction useSheetDrag({\n close,\n enabled,\n expanded,\n full,\n isDismissable,\n offset,\n rest,\n setExpanded,\n stops,\n testID,\n}: {\n readonly close: () => void\n readonly enabled: boolean\n readonly expanded: boolean\n readonly full: null | number\n readonly isDismissable: boolean\n readonly offset: SharedValue<number>\n readonly rest: number\n readonly setExpanded: (expanded: boolean) => void\n readonly stops: Stops\n readonly testID: string | undefined\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n // Where the panel stood when the drag was recognised. Gesture Handler\n // measures its translation from there, past the slop.\n const origin = useSharedValue(0)\n const lowest = stops.settles.at(-1) ?? 0\n\n function follow(translation: number) {\n offset.set(Math.min(lowest, Math.max(0, origin.get() + translation)))\n }\n\n function settle(target: number) {\n if (isDismissable && target === full) {\n close()\n return\n }\n\n const higher = target === 0\n if (stops.partial !== null && higher !== expanded) {\n setExpanded(higher)\n return\n }\n\n offset.set(\n reduceMotion\n ? target\n : withTiming(target, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }),\n )\n }\n\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- a builder named after its gesture, not a component; see SheetLayout\n const pan = Gesture.Pan()\n .activeOffsetY([-DRAG_SLOP, DRAG_SLOP])\n .enabled(enabled)\n .runOnJS(true)\n .onStart(({ translationY }) => {\n origin.set(offset.get())\n follow(translationY)\n })\n .onUpdate(({ translationY }) => {\n follow(translationY)\n })\n .onEnd(({ velocityY }, success) => {\n settle(success ? settleOf(offset.get(), velocityY, stops.settles) : rest)\n })\n\n return testID === undefined ? pan : pan.withTestId(`${testID}-drag`)\n}\n\n/**\n * The scrim's and the panel's motion, and the timer that unmounts the sheet\n * once its exit has run. The bottom sheet's position is how far its panel is\n * moved down, which the drag sets too; it starts below the window and rises\n * to its height once that is measured. The side sheet's is how far it has\n * come in from its edge, which is the end edge, and so the left one under\n * right-to-left.\n */\nfunction useSheetMotion({\n bottom,\n full,\n isOpen,\n rest,\n setPresent,\n}: {\n readonly bottom: boolean\n readonly full: null | number\n readonly isOpen: boolean\n readonly rest: number\n readonly setPresent: (present: boolean) => void\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const { height } = useWindowDimensions()\n const offset = useSharedValue(height)\n const shown = useSharedValue(0)\n const scrim = useSharedValue(0)\n // A translation is not mirrored under a right-to-left layout, though the\n // side sheet's edge is, so it travels the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n\n useEffect(() => {\n const fade = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n const enter = {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }\n const exit = {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingEmphasizedAccelerate),\n }\n\n if (isOpen) {\n scrim.set(withTiming(1, fade))\n if (!bottom) {\n shown.set(reduceMotion ? 1 : withTiming(1, enter))\n return undefined\n }\n if (full === null) {\n return undefined\n }\n // It rises from its own height below where it rests, not from the\n // bottom of the window, so it shows from the first frame.\n if (offset.get() > full) {\n offset.set(full)\n }\n offset.set(reduceMotion ? rest : withTiming(rest, enter))\n return undefined\n }\n\n scrim.set(withTiming(0, fade))\n if (bottom) {\n const gone = full ?? height\n offset.set(reduceMotion ? gone : withTiming(gone, exit))\n } else {\n shown.set(reduceMotion ? 0 : withTiming(0, exit))\n }\n const timer = setTimeout(\n () => {\n setPresent(false)\n },\n reduceMotion\n ? motion.durationShort2\n : Math.max(motion.durationShort2, motion.durationShort3),\n )\n\n return () => {\n clearTimeout(timer)\n }\n }, [\n bottom,\n full,\n height,\n isOpen,\n motion,\n offset,\n reduceMotion,\n rest,\n scrim,\n setPresent,\n shown,\n ])\n\n return {\n offset,\n panel: useAnimatedStyle(() => {\n 'worklet'\n if (bottom) {\n return { transform: [{ translateY: offset.get() }] }\n }\n\n const progress = shown.get()\n return {\n opacity: progress,\n transform: [{ translateX: (1 - progress) * SIDE_WIDTH * direction }],\n }\n }),\n scrim: useAnimatedStyle(() => {\n 'worklet'\n return { opacity: scrim.get() }\n }),\n }\n}\n\nSheet.Body = SheetBody\nSheet.Content = SheetContent\nSheet.Footer = SheetFooter\nSheet.Handle = SheetHandle\nSheet.Header = SheetHeader\nSheet.Title = SheetTitle\n\nexport {\n Sheet,\n SheetBody,\n SheetContent,\n SheetFooter,\n SheetHandle,\n SheetHeader,\n SheetTitle,\n}\nexport type {\n SheetBodyProps,\n SheetContentProps,\n SheetHandleProps,\n SheetPartProps,\n SheetProps,\n SheetTitleProps,\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyHA,MAAM2D,aAAa;AAGnB,MAAMC,aAAa;AAGnB,MAAMC,UAAU;AAIhB,MAAMC,YAAY;AAKlB,MAAMC,QAAQ;AAId,MAAMC,YAAY;AACl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EAAA,OAEf,EAAA6R,SAAWhE,MAAK2B,IAAK,EAAE;CAAC,CAChC;CAAC,IAAArE;CAAA,IAAAlC,EAAA,QAAAmE,UAAAnE,EAAA,QAAAK,MAAAL,EAAA,QAAA2B,IAAA;EAjBGO,KAAA;GAAAiC;GAAAiB,OAEE/E;GAWLuE,OACKjD;EAIT;EAAC3B,EAAA,MAAAmE;EAAAnE,EAAA,MAAAK;EAAAL,EAAA,MAAA2B;EAAA3B,EAAA,MAAAkC;CAAA,OAAAA,KAAAlC,EAAA;CAAA,OAlBMkC;AAkBN;AAGHpC,MAAMgJ,OAAOxI;AACbR,MAAMiJ,UAAUxG;AAChBzC,MAAMkJ,SAAStG;AACf5C,MAAMmJ,SAAStG;AACf7C,MAAMoJ,SAAS9F;AACftD,MAAMqJ,QAAQ9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","ToggleState","useId","useState","I18nManager","Platform","Pressable","StyleSheet","View","Gesture","GestureDetector","GestureHandlerRootView","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","useToggleState","ResolvedTheme","ControlLabel","ControlMessage","describedBy","LAYER_SIZE","messageOf","controlStylesOf","CheckGlyph","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","Paint","fill","glyph","handle","rule","SwitchProps","Omit","children","defaultSelected","description","error","icon","isDisabled","isReadOnly","isSelected","onChange","ref","style","TRACK_WIDTH","TRACK_HEIGHT","TRACK_RULE","HANDLE_OFF","HANDLE_ON","HANDLE_PRESSED","ICON_SIZE","TRAVEL","DRAG_SLOP","styles","create","control","flexShrink","height","width","drag","alignItems","flexGrow","justifyContent","layer","position","start","top","seat","track","borderWidth","stylesOf","radii","spacing","borderRadius","circle","messages","marginStart","sm","pill","flipOf","state","took","get","set","toggle","paintOf","colors","stateLayerOpacity","active","on","disabledContent","onSurface","surfaceContainerHighest","disabledContainer","surface","primary","onPrimaryContainer","primaryContainer","onPrimary","onSurfaceVariant","outline","Switch","t0","$","_c","ariaLabel","props","t1","t2","t3","testID","undefined","theme","own","t4","messageId","interactive","t5","enabled","useHandleDrag","t6","t7","t8","t9","onPressIn","color","corners","disabled","disc","feedback","dragging","hovered","pressed","ring","t10","paint","size","t11","offset","motion","useSwitchMotion","T0","T1","t12","t13","t14","handlers","t15","Symbol","for","t16","pressOf","t17","t18","row","T2","T3","t20","gesture","T4","t22","t23","t24","t25","t26","t27","t28","t29","t30","t31","t32","t33","t21","t34","t35","t19","t36","t37","t38","t39","setDragging","began","follow","x","along","isRTL","Math","min","max","pan","Pan","activeOffsetX","runOnJS","onBegin","x_0","onStart","x_1","OS","onUpdate","x_2","onEnd","_event","success","stopped","setSelected","onFinalize","withTestId","reduceMotion","timing","duration","durationShort2","easing","bezier","easingStandard","direction","rest","backgroundColor","borderColor","dragged","transform","translateX","handleMotion","_c"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { StyleProp, ViewProps, ViewStyle } from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\nimport type { ToggleState } from 'react-stately/useToggleState'\n\nimport { useId, useState } from 'react'\nimport {\n I18nManager,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport {\n Gesture,\n GestureDetector,\n GestureHandlerRootView,\n} from 'react-native-gesture-handler'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { useToggleState } from 'react-stately/useToggleState'\n\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport {\n ControlLabel,\n ControlMessage,\n describedBy,\n LAYER_SIZE,\n messageOf,\n} from '../../control'\nimport { controlStylesOf } from '../../control/styles'\nimport { CheckGlyph } from '../../glyphs'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The switch page, as kanso-ui's Switch draws it: a 52 by 32dp track with a\n// 2dp outline and a full corner, a handle that is 16dp off, 24dp on and 28dp\n// while pressed, a 16dp icon in the handle when asked for, a 40dp state layer\n// around the handle and a 48dp target. Off, the track is surface container\n// highest inside an outline rule and the handle is outline, turning on surface\n// variant while hovered, pressed or focused; on, the track is primary and the\n// handle on primary, turning primary container in the same states, with the\n// icon in on primary container. Disabled, the track and its rule are on\n// surface at the disabled container opacity and the handle on surface at the\n// disabled content opacity, or surface when on. The state layer is on surface\n// off and primary on, at each state's opacity, and does not swap once pressed\n// as a checkbox's does.\n//\n// The handle travels between the two ends of the track and grows between its\n// three sizes over the motion tokens' short duration on the standard curve,\n// as web's transition does, and at once for a reader who asks the device for\n// reduced motion. The track's colours ease alongside. The state layer and the\n// ripple sit on a 40dp disc centred on the handle, so they travel with it.\n//\n// The handle follows a drag, as the page's pressed switch does: the switch\n// flips when it is let go past the middle of the track and springs back when\n// it is not. The drag is Gesture Handler's, over the whole track rather than\n// only the handle, as a drag on iOS's own switch is. A press that moves less\n// than half the travel is still a tap, which the row's `Pressable` takes and\n// which flips the switch on its own. Once a drag takes over, Gesture Handler\n// ends that press without a tap on iOS and Android, so letting go settles the\n// switch once, from where the handle is. React Native Web has nothing to end\n// the press with, and the click a pointer's release sends would flip it a\n// second time, so there the switch ignores the tap a drag took over.\n//\n// Under a right-to-left layout the handle starts from the right, and a drag\n// toward the left turns the switch on.\n//\n// Gesture Handler recognises a drag only under its root view, so the track\n// carries one of its own, as its guide asks of a library. An app that wraps\n// itself in one already makes this one a plain view.\n//\n// The row, the label and the line under it are src/control's, which Checkbox\n// and Radio draw through as well. The whole row is the `Pressable`, so a press\n// on the label flips the switch, as a press on web's label does. The line\n// under it starts where the label does, past the track.\n\ntype Paint = {\n readonly fill: string\n readonly glyph: string\n readonly handle: string\n readonly rule: string\n}\n\ntype SwitchProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * The label, beside the switch. A switch that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n */\n readonly children?: ReactNode\n /**\n * Whether the switch starts on, when it keeps its own state.\n * @default false\n */\n readonly defaultSelected?: boolean\n /**\n * A hint under the label. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the switch in its error state: the line under the label is the error, in\n * the error colour.\n */\n readonly error?: string\n /**\n * Draws the check in the handle while the switch is on, the page's \"icon on\n * selected switch\" form.\n * @default false\n */\n readonly icon?: boolean\n /**\n * Draws the switch disabled, and takes no presses or drags.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Shows the state without letting a press or a drag change it.\n * @default false\n */\n readonly isReadOnly?: boolean\n /**\n * Whether the switch is on, for a call site holding the state itself with\n * `onChange`.\n */\n readonly isSelected?: boolean\n /** Called with the new state whenever a press or a drag changes it. */\n readonly onChange?: (isSelected: boolean) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\n// The track's size and its rule, from the page.\nconst TRACK_WIDTH = 52\nconst TRACK_HEIGHT = 32\nconst TRACK_RULE = 2\n\n// The handle's three sizes and the icon's, from the page.\nconst HANDLE_OFF = 16\nconst HANDLE_ON = 24\nconst HANDLE_PRESSED = 28\nconst ICON_SIZE = 16\n\n// How far the handle's seat, the pressed handle's 28dp, travels: the track's\n// 48dp inside its rule, less the seat. Off, the seat's centre is 16dp from the\n// track's start, and on, 16dp from its end, which is where the page's handles\n// sit.\nconst TRAVEL = TRACK_WIDTH - 2 * TRACK_RULE - HANDLE_PRESSED\n\n// How far a press moves before it is a drag: half the travel, the platforms'\n// own touch slop, as web's is for a finger. A finger drifts several dp on an\n// ordinary tap, and a tap inside this flips the switch. A drag past it is past\n// the middle too, so it turns the switch over unless it comes back.\nconst DRAG_SLOP = TRAVEL / 2\n\nconst styles = StyleSheet.create({\n // The 52 by 40 the switch takes in the row, the height of the state layer\n // around the handle, with the track centred in it. Gesture Handler's root\n // view, sized to the track rather than to the screen it fills by default.\n control: {\n flexShrink: 0,\n height: LAYER_SIZE,\n width: TRACK_WIDTH,\n },\n // What the drag is recognised over: the whole of the control.\n drag: {\n alignItems: 'center',\n flexGrow: 1,\n justifyContent: 'center',\n },\n handle: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n // The 40dp state layer, centred on the handle and so on its seat.\n layer: {\n height: LAYER_SIZE,\n position: 'absolute',\n start: (HANDLE_PRESSED - LAYER_SIZE) / 2,\n top: (HANDLE_PRESSED - LAYER_SIZE) / 2,\n width: LAYER_SIZE,\n },\n // The handle's seat, the pressed handle's size, at the start of the track\n // inside its rule. It travels by a translation, so the layout never moves.\n seat: {\n alignItems: 'center',\n height: HANDLE_PRESSED,\n justifyContent: 'center',\n position: 'absolute',\n start: 0,\n top: 0,\n width: HANDLE_PRESSED,\n },\n track: {\n borderWidth: TRACK_RULE,\n height: TRACK_HEIGHT,\n width: TRACK_WIDTH,\n },\n})\n\nconst stylesOf = themedStyles(({ radii, spacing }) =>\n StyleSheet.create({\n handle: {\n borderRadius: radii.circle,\n },\n // Past the track rather than the 40dp layer a checkbox draws, so the line\n // starts where the label's text does.\n messages: {\n marginStart: TRACK_WIDTH + spacing.sm,\n },\n track: {\n borderRadius: radii.pill,\n },\n }),\n)\n\n// A press's flip, unless a drag took the press over. Built by a call rather\n// than declared in the component, which is what react-perf's\n// jsx-no-new-function-as-prop is after.\nfunction flipOf(state: ToggleState, took: SharedValue<boolean>) {\n return () => {\n if (took.get()) {\n took.set(false)\n return\n }\n state.toggle()\n }\n}\n\n/**\n * What the switch is painted in: the track's fill and rule, the handle and\n * the icon. Where the page draws no rule it is the fill made clear rather than\n * plain transparent black, so the rule eases through its own colour rather\n * than through grey.\n */\nfunction paintOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n active,\n isDisabled,\n on,\n }: {\n readonly active: boolean\n readonly isDisabled: boolean\n readonly on: boolean\n },\n): Paint {\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n if (isDisabled) {\n const fill = withOpacity(\n on ? colors.onSurface : colors.surfaceContainerHighest,\n stateLayerOpacity.disabledContainer,\n )\n\n return {\n fill,\n glyph: disabledContent,\n handle: on ? colors.surface : disabledContent,\n rule: on\n ? withOpacity(fill, 0)\n : withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer),\n }\n }\n\n if (on) {\n return {\n fill: colors.primary,\n glyph: colors.onPrimaryContainer,\n handle: active ? colors.primaryContainer : colors.onPrimary,\n rule: colors.primary,\n }\n }\n\n return {\n fill: colors.surfaceContainerHighest,\n glyph: colors.onPrimaryContainer,\n handle: active ? colors.onSurfaceVariant : colors.outline,\n rule: colors.outline,\n }\n}\n\n/**\n * A switch that turns a setting on or off, with its label and optionally a\n * description or an error under it. Its state is React Stately's, as web's\n * is: pass `isSelected` with `onChange` to control it, or `defaultSelected` to\n * let it keep its own. A switch takes effect as it is flipped, which is what\n * sets it apart from a checkbox in a form.\n *\n * ```tsx\n * <Switch defaultSelected description=\"Supporting line\">\n * Label\n * </Switch>\n * ```\n *\n * A screen reader hears it as a switch named by its label, on or off,\n * followed by the line under it. A press anywhere on the track or the label\n * flips it, and the handle can be dragged across the track, settling on\n * whichever side it is let go. `style`, `ref` and `testID` land on the view\n * holding the row and the line under it, which is the element a layout\n * positions. With a `testID`, the drag is registered with Gesture Handler as\n * `<testID>-drag`, which its `getByGestureTestId` finds in a test.\n */\nfunction Switch({\n 'aria-label': ariaLabel,\n children,\n defaultSelected,\n description,\n error,\n icon = false,\n isDisabled = false,\n isReadOnly = false,\n isSelected,\n onChange,\n style,\n testID,\n ...props\n}: SwitchProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const state = useToggleState({\n defaultSelected,\n isReadOnly,\n isSelected,\n onChange,\n })\n const messageId = useId()\n\n const { colors, radii } = theme\n const on = state.isSelected\n const interactive = !isDisabled && !isReadOnly\n const drag = useHandleDrag({ enabled: interactive, on, state, testID })\n\n const feedback = usePressFeedback({\n color: on ? colors.primary : colors.onSurface,\n corners: { borderRadius: radii.circle },\n disabled: !interactive,\n disc: LAYER_SIZE,\n onPressIn: drag.onPressIn,\n })\n const active =\n interactive &&\n (drag.dragging ||\n feedback.hovered ||\n feedback.pressed ||\n feedback.ring !== undefined)\n const paint = paintOf(theme, { active, isDisabled, on })\n const size =\n drag.dragging || feedback.pressed\n ? HANDLE_PRESSED\n : on\n ? HANDLE_ON\n : HANDLE_OFF\n const motion = useSwitchMotion(paint, { offset: drag.offset, on, size })\n\n return (\n <View {...props} style={style} testID={testID}>\n <Pressable\n aria-checked={on}\n aria-label={ariaLabel}\n role=\"switch\"\n {...describedBy(messageId, messageOf(description, error))}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop(LAYER_SIZE, TRACK_WIDTH)}\n onPress={drag.pressOf(state)}\n style={controlStylesOf(theme).row}\n >\n <GestureHandlerRootView style={styles.control}>\n <GestureDetector gesture={drag.gesture}>\n <View style={styles.drag}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.track,\n own.track,\n motion.track,\n feedback.ring,\n )}\n >\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.seat,\n motion.seat,\n )}\n >\n <View style={styles.layer}>{feedback.layer}</View>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.handle,\n own.handle,\n motion.handle,\n )}\n >\n {icon && on ? (\n <CheckGlyph color={paint.glyph} size={ICON_SIZE} />\n ) : null}\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n </GestureDetector>\n </GestureHandlerRootView>\n <ControlLabel isDisabled={isDisabled}>{children}</ControlLabel>\n </Pressable>\n <ControlMessage\n description={description}\n error={error}\n id={messageId}\n style={own.messages}\n />\n </View>\n )\n}\n\n/**\n * The handle following a drag across the track, and settling from where it\n * is let go: on past the middle, off before it. `offset` is where the drag\n * has put the handle's seat while one is under way, measured from the start\n * of the track, and nothing otherwise, when the seat rests at the end the\n * switch is on.\n *\n * The drag is recognised once it has moved `DRAG_SLOP` across the track, and\n * on the JavaScript thread, since settling sets React state and a drag moves\n * one shared value.\n */\nfunction useHandleDrag({\n enabled,\n on,\n state,\n testID,\n}: {\n readonly enabled: boolean\n readonly on: boolean\n readonly state: ToggleState\n readonly testID: string | undefined\n}) {\n const [dragging, setDragging] = useState(false)\n const offset = useSharedValue<null | number>(null)\n // Whether a drag has taken over the press in flight, whose click React\n // Native Web would otherwise turn into a second flip. Cleared by the next\n // press rather than by that click, which a touch dragged far enough never\n // sends. A shared value rather than a ref: the gesture's callbacks are\n // built while rendering, and the React Compiler lets no ref reach them.\n const took = useSharedValue(false)\n\n // Where the press began across the track. Gesture Handler measures its\n // translation from where the drag was recognised, past the slop, so the\n // distance is taken from here instead, as web's is from the press.\n const began = useSharedValue(0)\n\n // Puts the seat where the drag has carried it, from the end it started at,\n // and no further than either end.\n function follow(x: number) {\n const along = I18nManager.isRTL ? began.get() - x : x - began.get()\n offset.set(Math.min(TRAVEL, Math.max(0, (on ? TRAVEL : 0) + along)))\n }\n\n // oxlint-disable-next-line react/capitalized-calls -- a builder Gesture Handler names after the gesture, not a component\n const pan = Gesture.Pan()\n .activeOffsetX([-DRAG_SLOP, DRAG_SLOP])\n .enabled(enabled)\n .runOnJS(true)\n .onBegin(({ x }) => {\n began.set(x)\n })\n .onStart(({ x }) => {\n took.set(Platform.OS === 'web')\n setDragging(true)\n follow(x)\n })\n .onUpdate(({ x }) => {\n follow(x)\n })\n .onEnd((_event, success) => {\n const stopped = offset.get()\n if (success && stopped !== null && stopped > TRAVEL / 2 !== on) {\n state.setSelected(!on)\n }\n })\n .onFinalize(() => {\n offset.set(null)\n setDragging(false)\n })\n\n return {\n dragging,\n gesture: testID === undefined ? pan : pan.withTestId(`${testID}-drag`),\n offset,\n onPressIn: () => {\n took.set(false)\n },\n pressOf: (toggle: ToggleState) => flipOf(toggle, took),\n }\n}\n\n// The track's colours, the seat's travel and the handle's size and colour,\n// eased to as the state changes. While a drag is under way the seat follows it\n// at once, and once it ends the seat eases from wherever it was let go.\nfunction useSwitchMotion(\n { fill, handle, rule }: Paint,\n {\n offset,\n on,\n size,\n }: {\n readonly offset: SharedValue<null | number>\n readonly on: boolean\n readonly size: number\n },\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n // A translation is not mirrored under a right-to-left layout, though the\n // seat's start is, so the seat travels the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const rest = (on ? TRAVEL : 0) * direction\n\n const track = useAnimatedStyle(() => {\n 'worklet'\n return {\n backgroundColor: reduceMotion ? fill : withTiming(fill, timing),\n borderColor: reduceMotion ? rule : withTiming(rule, timing),\n }\n })\n const seat = useAnimatedStyle(() => {\n 'worklet'\n const dragged = offset.get()\n return {\n transform: [\n {\n translateX:\n dragged !== null\n ? dragged * direction\n : reduceMotion\n ? rest\n : withTiming(rest, timing),\n },\n ],\n }\n })\n const handleMotion = useAnimatedStyle(() => {\n 'worklet'\n return {\n backgroundColor: reduceMotion ? handle : withTiming(handle, timing),\n height: reduceMotion ? size : withTiming(size, timing),\n width: reduceMotion ? size : withTiming(size, timing),\n }\n })\n\n return { handle: handleMotion, seat, track }\n}\n\nexport { Switch }\nexport type { SwitchProps }\n"],"mappings":";;;;;;;;;;;;;;;AA8IA,MAAM0D,cAAc;AACpB,MAAMC,eAAe;AACrB,MAAMC,aAAa;AAGnB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AACvB,MAAMC,YAAY;AAMlB,MAAMC,SAASP;AAMf,MAAMQ,YAAYD,SAAS;AAE3B,MAAME,SAASrD,WAAWsD,OAAO;CAI/BC,SAAS;EACPC,YAAY;EACZC,QAAAA;EACAC,OAAOd;CACT;CAEAe,MAAM;EACJC,YAAY;EACZ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,MAAMP,MAAM,EACjC,CAAC,EAEL;CAAC,CACF;CACD,MAAAa,eAAqBtN,uBAAiB;EAAA;EAAA,OAE7B;GAAAiN,iBACYT,eAAAlL,SAAwBnB,WAAWmB,QAAQmL,MAAM;GAACvJ,QAC3DsJ,eAAAvE,OAAsB9H,WAAW8H,MAAMwE,MAAM;GAACtJ,OAC/CqJ,eAAAvE,OAAsB9H,WAAW8H,MAAMwE,MAAM;EACtD;CAAC,CACF;CAAC,IAAApG;CAAA,IAAAL,EAAA,OAAAsH,gBAAAtH,EAAA,OAAApC,QAAAoC,EAAA,OAAAnC,OAAA;EAEKwC,KAAA;GAAA/E,QAAUgM;GAAY1J;GAAAC;EAAc;EAACmC,EAAA,KAAAsH;EAAAtH,EAAA,KAAApC;EAAAoC,EAAA,KAAAnC;EAAAmC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAArCK;AAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","ToggleState","useId","useState","I18nManager","Platform","Pressable","StyleSheet","View","Gesture","GestureDetector","GestureHandlerRootView","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","useToggleState","ResolvedTheme","ControlLabel","ControlMessage","describedBy","LAYER_SIZE","messageOf","controlStylesOf","CheckGlyph","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","Paint","fill","glyph","handle","rule","SwitchProps","Omit","children","defaultSelected","description","error","icon","isDisabled","isReadOnly","isSelected","onChange","ref","style","TRACK_WIDTH","TRACK_HEIGHT","TRACK_RULE","HANDLE_OFF","HANDLE_ON","HANDLE_PRESSED","ICON_SIZE","TRAVEL","DRAG_SLOP","styles","create","control","flexShrink","height","width","drag","alignItems","flexGrow","justifyContent","layer","position","start","top","seat","track","borderWidth","stylesOf","radii","spacing","borderRadius","circle","messages","marginStart","sm","pill","flipOf","state","took","get","set","toggle","paintOf","colors","stateLayerOpacity","active","on","disabledContent","onSurface","surfaceContainerHighest","disabledContainer","surface","primary","onPrimaryContainer","primaryContainer","onPrimary","onSurfaceVariant","outline","Switch","t0","$","_c","ariaLabel","props","t1","t2","t3","testID","undefined","theme","own","t4","messageId","interactive","t5","enabled","useHandleDrag","t6","t7","t8","t9","onPressIn","color","corners","disabled","disc","feedback","dragging","hovered","pressed","ring","t10","paint","size","t11","offset","motion","useSwitchMotion","T0","T1","t12","t13","t14","handlers","t15","Symbol","for","t16","pressOf","t17","t18","row","T2","T3","t20","gesture","T4","t22","t23","t24","t25","t26","t27","t28","t29","t30","t31","t32","t33","t21","t34","t35","t19","t36","t37","t38","t39","setDragging","began","follow","x","along","isRTL","Math","min","max","pan","Pan","activeOffsetX","runOnJS","onBegin","x_0","onStart","x_1","OS","onUpdate","x_2","onEnd","_event","success","stopped","setSelected","onFinalize","withTestId","reduceMotion","timing","duration","durationShort2","easing","bezier","easingStandard","direction","rest","backgroundColor","borderColor","dragged","transform","translateX","handleMotion","_c"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { StyleProp, ViewProps, ViewStyle } from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\nimport type { ToggleState } from 'react-stately/useToggleState'\n\nimport { useId, useState } from 'react'\nimport {\n I18nManager,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport {\n Gesture,\n GestureDetector,\n GestureHandlerRootView,\n} from 'react-native-gesture-handler'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { useToggleState } from 'react-stately/useToggleState'\n\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport {\n ControlLabel,\n ControlMessage,\n describedBy,\n LAYER_SIZE,\n messageOf,\n} from '../../control'\nimport { controlStylesOf } from '../../control/styles'\nimport { CheckGlyph } from '../../glyphs'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The switch page, as kanso-ui's Switch draws it: a 52 by 32dp track with a\n// 2dp outline and a full corner, a handle that is 16dp off, 24dp on and 28dp\n// while pressed, a 16dp icon in the handle when asked for, a 40dp state layer\n// around the handle and a 48dp target. Off, the track is surface container\n// highest inside an outline rule and the handle is outline, turning on surface\n// variant while hovered, pressed or focused; on, the track is primary and the\n// handle on primary, turning primary container in the same states, with the\n// icon in on primary container. Disabled, the track and its rule are on\n// surface at the disabled container opacity and the handle on surface at the\n// disabled content opacity, or surface when on. The state layer is on surface\n// off and primary on, at each state's opacity, and does not swap once pressed\n// as a checkbox's does.\n//\n// The handle travels between the two ends of the track and grows between its\n// three sizes over the motion tokens' short duration on the standard curve,\n// as web's transition does, and at once for a reader who asks the device for\n// reduced motion. The track's colours ease alongside. The state layer and the\n// ripple sit on a 40dp disc centred on the handle, so they travel with it.\n//\n// The handle follows a drag, as the page's pressed switch does: the switch\n// flips when it is let go past the middle of the track and springs back when\n// it is not. The drag is Gesture Handler's, over the whole track rather than\n// only the handle, as a drag on iOS's own switch is. A press that moves less\n// than half the travel is still a tap, which the row's `Pressable` takes and\n// which flips the switch on its own. Once a drag takes over, Gesture Handler\n// ends that press without a tap on iOS and Android, so letting go settles the\n// switch once, from where the handle is. React Native Web has nothing to end\n// the press with, and the click a pointer's release sends would flip it a\n// second time, so there the switch ignores the tap a drag took over.\n//\n// Under a right-to-left layout the handle starts from the right, and a drag\n// toward the left turns the switch on.\n//\n// Gesture Handler recognises a drag only under its root view, so the track\n// carries one of its own, as its guide asks of a library. An app that wraps\n// itself in one already makes this one a plain view.\n//\n// The row, the label and the line under it are src/control's, which Checkbox\n// and Radio draw through as well. The whole row is the `Pressable`, so a press\n// on the label flips the switch, as a press on web's label does. The line\n// under it starts where the label does, past the track.\n\ntype Paint = {\n readonly fill: string\n readonly glyph: string\n readonly handle: string\n readonly rule: string\n}\n\ntype SwitchProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * The label, beside the switch. A switch that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n */\n readonly children?: ReactNode\n /**\n * Whether the switch starts on, when it keeps its own state.\n * @default false\n */\n readonly defaultSelected?: boolean\n /**\n * A hint under the label. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the switch in its error state: the line under the label is the error, in\n * the error colour.\n */\n readonly error?: string\n /**\n * Draws the check in the handle while the switch is on, the page's \"icon on\n * selected switch\" form.\n * @default false\n */\n readonly icon?: boolean\n /**\n * Draws the switch disabled, and takes no presses or drags.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Shows the state without letting a press or a drag change it.\n * @default false\n */\n readonly isReadOnly?: boolean\n /**\n * Whether the switch is on, for a call site holding the state itself with\n * `onChange`.\n */\n readonly isSelected?: boolean\n /** Called with the new state whenever a press or a drag changes it. */\n readonly onChange?: (isSelected: boolean) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\n// The track's size and its rule, from the page.\nconst TRACK_WIDTH = 52\nconst TRACK_HEIGHT = 32\nconst TRACK_RULE = 2\n\n// The handle's three sizes and the icon's, from the page.\nconst HANDLE_OFF = 16\nconst HANDLE_ON = 24\nconst HANDLE_PRESSED = 28\nconst ICON_SIZE = 16\n\n// How far the handle's seat, the pressed handle's 28dp, travels: the track's\n// 48dp inside its rule, less the seat. Off, the seat's centre is 16dp from the\n// track's start, and on, 16dp from its end, which is where the page's handles\n// sit.\nconst TRAVEL = TRACK_WIDTH - 2 * TRACK_RULE - HANDLE_PRESSED\n\n// How far a press moves before it is a drag: half the travel, the platforms'\n// own touch slop, as web's is for a finger. A finger drifts several dp on an\n// ordinary tap, and a tap inside this flips the switch. A drag past it is past\n// the middle too, so it turns the switch over unless it comes back.\nconst DRAG_SLOP = TRAVEL / 2\n\nconst styles = StyleSheet.create({\n // The 52 by 40 the switch takes in the row, the height of the state layer\n // around the handle, with the track centred in it. Gesture Handler's root\n // view, sized to the track rather than to the screen it fills by default.\n control: {\n flexShrink: 0,\n height: LAYER_SIZE,\n width: TRACK_WIDTH,\n },\n // What the drag is recognised over: the whole of the control.\n drag: {\n alignItems: 'center',\n flexGrow: 1,\n justifyContent: 'center',\n },\n handle: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n // The 40dp state layer, centred on the handle and so on its seat.\n layer: {\n height: LAYER_SIZE,\n position: 'absolute',\n start: (HANDLE_PRESSED - LAYER_SIZE) / 2,\n top: (HANDLE_PRESSED - LAYER_SIZE) / 2,\n width: LAYER_SIZE,\n },\n // The handle's seat, the pressed handle's size, at the start of the track\n // inside its rule. It travels by a translation, so the layout never moves.\n seat: {\n alignItems: 'center',\n height: HANDLE_PRESSED,\n justifyContent: 'center',\n position: 'absolute',\n start: 0,\n top: 0,\n width: HANDLE_PRESSED,\n },\n track: {\n borderWidth: TRACK_RULE,\n height: TRACK_HEIGHT,\n width: TRACK_WIDTH,\n },\n})\n\nconst stylesOf = themedStyles(({ radii, spacing }) =>\n StyleSheet.create({\n handle: {\n borderRadius: radii.circle,\n },\n // Past the track rather than the 40dp layer a checkbox draws, so the line\n // starts where the label's text does.\n messages: {\n marginStart: TRACK_WIDTH + spacing.sm,\n },\n track: {\n borderRadius: radii.pill,\n },\n }),\n)\n\n// A press's flip, unless a drag took the press over. Built by a call rather\n// than declared in the component, which is what react-perf's\n// jsx-no-new-function-as-prop is after.\nfunction flipOf(state: ToggleState, took: SharedValue<boolean>) {\n return () => {\n if (took.get()) {\n took.set(false)\n return\n }\n state.toggle()\n }\n}\n\n/**\n * What the switch is painted in: the track's fill and rule, the handle and\n * the icon. Where the page draws no rule it is the fill made clear rather than\n * plain transparent black, so the rule eases through its own colour rather\n * than through grey.\n */\nfunction paintOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n active,\n isDisabled,\n on,\n }: {\n readonly active: boolean\n readonly isDisabled: boolean\n readonly on: boolean\n },\n): Paint {\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n if (isDisabled) {\n const fill = withOpacity(\n on ? colors.onSurface : colors.surfaceContainerHighest,\n stateLayerOpacity.disabledContainer,\n )\n\n return {\n fill,\n glyph: disabledContent,\n handle: on ? colors.surface : disabledContent,\n rule: on\n ? withOpacity(fill, 0)\n : withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer),\n }\n }\n\n if (on) {\n return {\n fill: colors.primary,\n glyph: colors.onPrimaryContainer,\n handle: active ? colors.primaryContainer : colors.onPrimary,\n rule: colors.primary,\n }\n }\n\n return {\n fill: colors.surfaceContainerHighest,\n glyph: colors.onPrimaryContainer,\n handle: active ? colors.onSurfaceVariant : colors.outline,\n rule: colors.outline,\n }\n}\n\n/**\n * A switch that turns a setting on or off, with its label and optionally a\n * description or an error under it. Its state is React Stately's, as web's\n * is: pass `isSelected` with `onChange` to control it, or `defaultSelected` to\n * let it keep its own. A switch takes effect as it is flipped, which is what\n * sets it apart from a checkbox in a form.\n *\n * ```tsx\n * <Switch defaultSelected description=\"Supporting line\">\n * Label\n * </Switch>\n * ```\n *\n * A screen reader hears it as a switch named by its label, on or off,\n * followed by the line under it. A press anywhere on the track or the label\n * flips it, and the handle can be dragged across the track, settling on\n * whichever side it is let go. `style`, `ref` and `testID` land on the view\n * holding the row and the line under it, which is the element a layout\n * positions. With a `testID`, the drag is registered with Gesture Handler as\n * `<testID>-drag`, which its `getByGestureTestId` finds in a test.\n */\nfunction Switch({\n 'aria-label': ariaLabel,\n children,\n defaultSelected,\n description,\n error,\n icon = false,\n isDisabled = false,\n isReadOnly = false,\n isSelected,\n onChange,\n style,\n testID,\n ...props\n}: SwitchProps) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const state = useToggleState({\n defaultSelected,\n isReadOnly,\n isSelected,\n onChange,\n })\n const messageId = useId()\n\n const { colors, radii } = theme\n const on = state.isSelected\n const interactive = !isDisabled && !isReadOnly\n const drag = useHandleDrag({ enabled: interactive, on, state, testID })\n\n const feedback = usePressFeedback({\n color: on ? colors.primary : colors.onSurface,\n corners: { borderRadius: radii.circle },\n disabled: !interactive,\n disc: LAYER_SIZE,\n onPressIn: drag.onPressIn,\n })\n const active =\n interactive &&\n (drag.dragging ||\n feedback.hovered ||\n feedback.pressed ||\n feedback.ring !== undefined)\n const paint = paintOf(theme, { active, isDisabled, on })\n const size =\n drag.dragging || feedback.pressed\n ? HANDLE_PRESSED\n : on\n ? HANDLE_ON\n : HANDLE_OFF\n const motion = useSwitchMotion(paint, { offset: drag.offset, on, size })\n\n return (\n <View {...props} style={style} testID={testID}>\n <Pressable\n aria-checked={on}\n aria-label={ariaLabel}\n role=\"switch\"\n {...describedBy(messageId, messageOf(description, error))}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop(LAYER_SIZE, TRACK_WIDTH)}\n onPress={drag.pressOf(state)}\n style={controlStylesOf(theme).row}\n >\n <GestureHandlerRootView style={styles.control}>\n <GestureDetector gesture={drag.gesture}>\n <View style={styles.drag}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.track,\n own.track,\n motion.track,\n feedback.ring,\n )}\n >\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.seat,\n motion.seat,\n )}\n >\n <View style={styles.layer}>{feedback.layer}</View>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.handle,\n own.handle,\n motion.handle,\n )}\n >\n {icon && on ? (\n <CheckGlyph color={paint.glyph} size={ICON_SIZE} />\n ) : null}\n </Animated.View>\n </Animated.View>\n </Animated.View>\n </View>\n </GestureDetector>\n </GestureHandlerRootView>\n <ControlLabel isDisabled={isDisabled}>{children}</ControlLabel>\n </Pressable>\n <ControlMessage\n description={description}\n error={error}\n id={messageId}\n style={own.messages}\n />\n </View>\n )\n}\n\n/**\n * The handle following a drag across the track, and settling from where it\n * is let go: on past the middle, off before it. `offset` is where the drag\n * has put the handle's seat while one is under way, measured from the start\n * of the track, and nothing otherwise, when the seat rests at the end the\n * switch is on.\n *\n * The drag is recognised once it has moved `DRAG_SLOP` across the track, and\n * on the JavaScript thread, since settling sets React state and a drag moves\n * one shared value.\n */\nfunction useHandleDrag({\n enabled,\n on,\n state,\n testID,\n}: {\n readonly enabled: boolean\n readonly on: boolean\n readonly state: ToggleState\n readonly testID: string | undefined\n}) {\n const [dragging, setDragging] = useState(false)\n const offset = useSharedValue<null | number>(null)\n // Whether a drag has taken over the press in flight, whose click React\n // Native Web would otherwise turn into a second flip. Cleared by the next\n // press rather than by that click, which a touch dragged far enough never\n // sends. A shared value rather than a ref: the gesture's callbacks are\n // built while rendering, and the React Compiler lets no ref reach them.\n const took = useSharedValue(false)\n\n // Where the press began across the track. Gesture Handler measures its\n // translation from where the drag was recognised, past the slop, so the\n // distance is taken from here instead, as web's is from the press.\n const began = useSharedValue(0)\n\n // Puts the seat where the drag has carried it, from the end it started at,\n // and no further than either end.\n function follow(x: number) {\n const along = I18nManager.isRTL ? began.get() - x : x - began.get()\n offset.set(Math.min(TRAVEL, Math.max(0, (on ? TRAVEL : 0) + along)))\n }\n\n // Gesture Handler 3 deprecates this builder for hooks that version 2 does not\n // have, and the peer range admits both, so the builder stays while it does.\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- a builder named after its gesture, not a component; see above\n const pan = Gesture.Pan()\n .activeOffsetX([-DRAG_SLOP, DRAG_SLOP])\n .enabled(enabled)\n .runOnJS(true)\n .onBegin(({ x }) => {\n began.set(x)\n })\n .onStart(({ x }) => {\n took.set(Platform.OS === 'web')\n setDragging(true)\n follow(x)\n })\n .onUpdate(({ x }) => {\n follow(x)\n })\n .onEnd((_event, success) => {\n const stopped = offset.get()\n if (success && stopped !== null && stopped > TRAVEL / 2 !== on) {\n state.setSelected(!on)\n }\n })\n .onFinalize(() => {\n offset.set(null)\n setDragging(false)\n })\n\n return {\n dragging,\n gesture: testID === undefined ? pan : pan.withTestId(`${testID}-drag`),\n offset,\n onPressIn: () => {\n took.set(false)\n },\n pressOf: (toggle: ToggleState) => flipOf(toggle, took),\n }\n}\n\n// The track's colours, the seat's travel and the handle's size and colour,\n// eased to as the state changes. While a drag is under way the seat follows it\n// at once, and once it ends the seat eases from wherever it was let go.\nfunction useSwitchMotion(\n { fill, handle, rule }: Paint,\n {\n offset,\n on,\n size,\n }: {\n readonly offset: SharedValue<null | number>\n readonly on: boolean\n readonly size: number\n },\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n // A translation is not mirrored under a right-to-left layout, though the\n // seat's start is, so the seat travels the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const rest = (on ? TRAVEL : 0) * direction\n\n const track = useAnimatedStyle(() => {\n 'worklet'\n return {\n backgroundColor: reduceMotion ? fill : withTiming(fill, timing),\n borderColor: reduceMotion ? rule : withTiming(rule, timing),\n }\n })\n const seat = useAnimatedStyle(() => {\n 'worklet'\n const dragged = offset.get()\n return {\n transform: [\n {\n translateX:\n dragged !== null\n ? dragged * direction\n : reduceMotion\n ? rest\n : withTiming(rest, timing),\n },\n ],\n }\n })\n const handleMotion = useAnimatedStyle(() => {\n 'worklet'\n return {\n backgroundColor: reduceMotion ? handle : withTiming(handle, timing),\n height: reduceMotion ? size : withTiming(size, timing),\n width: reduceMotion ? size : withTiming(size, timing),\n }\n })\n\n return { handle: handleMotion, seat, track }\n}\n\nexport { Switch }\nexport type { SwitchProps }\n"],"mappings":";;;;;;;;;;;;;;;AA8IA,MAAM0D,cAAc;AACpB,MAAMC,eAAe;AACrB,MAAMC,aAAa;AAGnB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AACvB,MAAMC,YAAY;AAMlB,MAAMC,SAASP;AAMf,MAAMQ,YAAYD,SAAS;AAE3B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|
3
|
+
"ar-AE": {
|
|
4
|
+
dragHandle: "مقبض السحب",
|
|
5
|
+
loading: "جارٍ التحميل"
|
|
6
|
+
},
|
|
7
|
+
"bg-BG": {
|
|
8
|
+
dragHandle: "Манипулатор за плъзгане",
|
|
9
|
+
loading: "Зареждане"
|
|
10
|
+
},
|
|
11
|
+
"cs-CZ": {
|
|
12
|
+
dragHandle: "Úchyt pro přetažení",
|
|
13
|
+
loading: "Načítání"
|
|
14
|
+
},
|
|
15
|
+
"da-DK": {
|
|
16
|
+
dragHandle: "Trækhåndtag",
|
|
17
|
+
loading: "Indlæser"
|
|
18
|
+
},
|
|
19
|
+
"de-DE": {
|
|
20
|
+
dragHandle: "Ziehpunkt",
|
|
21
|
+
loading: "Wird geladen"
|
|
22
|
+
},
|
|
23
|
+
"el-GR": {
|
|
24
|
+
dragHandle: "Λαβή μεταφοράς",
|
|
25
|
+
loading: "Φόρτωση"
|
|
26
|
+
},
|
|
27
|
+
"en-US": {
|
|
28
|
+
dragHandle: "Drag handle",
|
|
29
|
+
loading: "Loading"
|
|
30
|
+
},
|
|
31
|
+
"es-ES": {
|
|
32
|
+
dragHandle: "Control de arrastre",
|
|
33
|
+
loading: "Cargando"
|
|
34
|
+
},
|
|
35
|
+
"et-EE": {
|
|
36
|
+
dragHandle: "Lohistamispide",
|
|
37
|
+
loading: "Laadimine"
|
|
38
|
+
},
|
|
39
|
+
"fi-FI": {
|
|
40
|
+
dragHandle: "Vetokahva",
|
|
41
|
+
loading: "Ladataan"
|
|
42
|
+
},
|
|
43
|
+
"fr-FR": {
|
|
44
|
+
dragHandle: "Poignée de déplacement",
|
|
45
|
+
loading: "Chargement"
|
|
46
|
+
},
|
|
47
|
+
"he-IL": {
|
|
48
|
+
dragHandle: "ידית גרירה",
|
|
49
|
+
loading: "טוען"
|
|
50
|
+
},
|
|
51
|
+
"hr-HR": {
|
|
52
|
+
dragHandle: "Ručica za povlačenje",
|
|
53
|
+
loading: "Učitavanje"
|
|
54
|
+
},
|
|
55
|
+
"hu-HU": {
|
|
56
|
+
dragHandle: "Húzófogantyú",
|
|
57
|
+
loading: "Betöltés"
|
|
58
|
+
},
|
|
59
|
+
"it-IT": {
|
|
60
|
+
dragHandle: "Punto di trascinamento",
|
|
61
|
+
loading: "Caricamento"
|
|
62
|
+
},
|
|
63
|
+
"ja-JP": {
|
|
64
|
+
dragHandle: "ドラッグハンドル",
|
|
65
|
+
loading: "読み込み中"
|
|
66
|
+
},
|
|
67
|
+
"ko-KR": {
|
|
68
|
+
dragHandle: "드래그 핸들",
|
|
69
|
+
loading: "로드 중"
|
|
70
|
+
},
|
|
71
|
+
"lt-LT": {
|
|
72
|
+
dragHandle: "Vilkimo rankenėlė",
|
|
73
|
+
loading: "Įkeliama"
|
|
74
|
+
},
|
|
75
|
+
"lv-LV": {
|
|
76
|
+
dragHandle: "Vilkšanas turis",
|
|
77
|
+
loading: "Notiek ielāde"
|
|
78
|
+
},
|
|
79
|
+
"nb-NO": {
|
|
80
|
+
dragHandle: "Drahåndtak",
|
|
81
|
+
loading: "Laster inn"
|
|
82
|
+
},
|
|
83
|
+
"nl-NL": {
|
|
84
|
+
dragHandle: "Sleepgreep",
|
|
85
|
+
loading: "Laden"
|
|
86
|
+
},
|
|
87
|
+
"pl-PL": {
|
|
88
|
+
dragHandle: "Uchwyt do przeciągania",
|
|
89
|
+
loading: "Ładowanie"
|
|
90
|
+
},
|
|
91
|
+
"pt-BR": {
|
|
92
|
+
dragHandle: "Alça de arrastar",
|
|
93
|
+
loading: "Carregando"
|
|
94
|
+
},
|
|
95
|
+
"pt-PT": {
|
|
96
|
+
dragHandle: "Pega para arrastar",
|
|
97
|
+
loading: "A carregar"
|
|
98
|
+
},
|
|
99
|
+
"ro-RO": {
|
|
100
|
+
dragHandle: "Mâner de tragere",
|
|
101
|
+
loading: "Se încarcă"
|
|
102
|
+
},
|
|
103
|
+
"ru-RU": {
|
|
104
|
+
dragHandle: "Маркер перемещения",
|
|
105
|
+
loading: "Загрузка"
|
|
106
|
+
},
|
|
107
|
+
"sk-SK": {
|
|
108
|
+
dragHandle: "Úchyt na presúvanie",
|
|
109
|
+
loading: "Načítava sa"
|
|
110
|
+
},
|
|
111
|
+
"sl-SI": {
|
|
112
|
+
dragHandle: "Ročica za vlečenje",
|
|
113
|
+
loading: "Nalaganje"
|
|
114
|
+
},
|
|
115
|
+
"sr-SP": {
|
|
116
|
+
dragHandle: "Ručica za prevlačenje",
|
|
117
|
+
loading: "Učitavanje"
|
|
118
|
+
},
|
|
119
|
+
"sv-SE": {
|
|
120
|
+
dragHandle: "Draghandtag",
|
|
121
|
+
loading: "Läser in"
|
|
122
|
+
},
|
|
123
|
+
"tr-TR": {
|
|
124
|
+
dragHandle: "Sürükleme tutamacı",
|
|
125
|
+
loading: "Yükleniyor"
|
|
126
|
+
},
|
|
127
|
+
"uk-UA": {
|
|
128
|
+
dragHandle: "Маркер переміщення",
|
|
129
|
+
loading: "Завантаження"
|
|
130
|
+
},
|
|
131
|
+
"zh-CN": {
|
|
132
|
+
dragHandle: "拖动手柄",
|
|
133
|
+
loading: "正在加载"
|
|
134
|
+
},
|
|
135
|
+
"zh-TW": {
|
|
136
|
+
dragHandle: "拖曳控點",
|
|
137
|
+
loading: "正在載入"
|
|
138
|
+
}
|
|
37
139
|
};
|
|
38
140
|
//#endregion
|
|
39
141
|
export { MESSAGES };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","names":["LibraryMessages","loading","MESSAGES","Readonly","Record"],"sources":["../../src/i18n/messages.ts"],"sourcesContent":["// The words the library writes itself: the pending ring's name
|
|
1
|
+
{"version":3,"file":"messages.js","names":["LibraryMessages","dragHandle","loading","MESSAGES","Readonly","Record"],"sources":["../../src/i18n/messages.ts"],"sourcesContent":["// The words the library writes itself: the pending ring's name and a bottom\n// sheet's drag handle. Each one stands behind a prop that names it otherwise,\n// `pendingLabel` for the ring and `aria-label` for the handle.\n//\n// Copied from kanso-ui's src/i18n/messages.ts, one entry per locale React\n// Aria ships, and kept in step with it by hand: the web library publishes no\n// copy of its table, and a word that differs between the two would name the\n// same ring two ways. The handle's name is this table's alone, since web's\n// sheet draws its handle as decoration and names nothing. The translations\n// were drafted for that table rather than taken from a translation service,\n// and each one wants a native speaker's eye before it is trusted; a call site\n// can always pass its own words through the prop.\n\ntype LibraryMessages = {\n /** What a bottom sheet's handle is called, where it is a control. */\n readonly dragHandle: string\n /** What a pending button's ring is called. */\n readonly loading: string\n}\n\nconst MESSAGES: Readonly<Record<string, LibraryMessages>> = {\n 'ar-AE': { dragHandle: 'مقبض السحب', loading: 'جارٍ التحميل' },\n 'bg-BG': { dragHandle: 'Манипулатор за плъзгане', loading: 'Зареждане' },\n 'cs-CZ': { dragHandle: 'Úchyt pro přetažení', loading: 'Načítání' },\n 'da-DK': { dragHandle: 'Trækhåndtag', loading: 'Indlæser' },\n 'de-DE': { dragHandle: 'Ziehpunkt', loading: 'Wird geladen' },\n 'el-GR': { dragHandle: 'Λαβή μεταφοράς', loading: 'Φόρτωση' },\n 'en-US': { dragHandle: 'Drag handle', loading: 'Loading' },\n 'es-ES': { dragHandle: 'Control de arrastre', loading: 'Cargando' },\n 'et-EE': { dragHandle: 'Lohistamispide', loading: 'Laadimine' },\n 'fi-FI': { dragHandle: 'Vetokahva', loading: 'Ladataan' },\n 'fr-FR': { dragHandle: 'Poignée de déplacement', loading: 'Chargement' },\n 'he-IL': { dragHandle: 'ידית גרירה', loading: 'טוען' },\n 'hr-HR': { dragHandle: 'Ručica za povlačenje', loading: 'Učitavanje' },\n 'hu-HU': { dragHandle: 'Húzófogantyú', loading: 'Betöltés' },\n 'it-IT': { dragHandle: 'Punto di trascinamento', loading: 'Caricamento' },\n 'ja-JP': { dragHandle: 'ドラッグハンドル', loading: '読み込み中' },\n 'ko-KR': { dragHandle: '드래그 핸들', loading: '로드 중' },\n 'lt-LT': { dragHandle: 'Vilkimo rankenėlė', loading: 'Įkeliama' },\n 'lv-LV': { dragHandle: 'Vilkšanas turis', loading: 'Notiek ielāde' },\n 'nb-NO': { dragHandle: 'Drahåndtak', loading: 'Laster inn' },\n 'nl-NL': { dragHandle: 'Sleepgreep', loading: 'Laden' },\n 'pl-PL': { dragHandle: 'Uchwyt do przeciągania', loading: 'Ładowanie' },\n 'pt-BR': { dragHandle: 'Alça de arrastar', loading: 'Carregando' },\n 'pt-PT': { dragHandle: 'Pega para arrastar', loading: 'A carregar' },\n 'ro-RO': { dragHandle: 'Mâner de tragere', loading: 'Se încarcă' },\n 'ru-RU': { dragHandle: 'Маркер перемещения', loading: 'Загрузка' },\n 'sk-SK': { dragHandle: 'Úchyt na presúvanie', loading: 'Načítava sa' },\n 'sl-SI': { dragHandle: 'Ročica za vlečenje', loading: 'Nalaganje' },\n 'sr-SP': { dragHandle: 'Ručica za prevlačenje', loading: 'Učitavanje' },\n 'sv-SE': { dragHandle: 'Draghandtag', loading: 'Läser in' },\n 'tr-TR': { dragHandle: 'Sürükleme tutamacı', loading: 'Yükleniyor' },\n 'uk-UA': { dragHandle: 'Маркер переміщення', loading: 'Завантаження' },\n 'zh-CN': { dragHandle: '拖动手柄', loading: '正在加载' },\n 'zh-TW': { dragHandle: '拖曳控點', loading: '正在載入' },\n}\n\nexport { MESSAGES }\nexport type { LibraryMessages }\n"],"mappings":";AAoBA,MAAMG,WAAsD;CAC1D,SAAS;EAAEF,YAAY;EAAcC,SAAS;CAAe;CAC7D,SAAS;EAAED,YAAY;EAA2BC,SAAS;CAAY;CACvE,SAAS;EAAED,YAAY;EAAuBC,SAAS;CAAW;CAClE,SAAS;EAAED,YAAY;EAAeC,SAAS;CAAW;CAC1D,SAAS;EAAED,YAAY;EAAaC,SAAS;CAAe;CAC5D,SAAS;EAAED,YAAY;EAAkBC,SAAS;CAAU;CAC5D,SAAS;EAAED,YAAY;EAAeC,SAAS;CAAU;CACzD,SAAS;EAAED,YAAY;EAAuBC,SAAS;CAAW;CAClE,SAAS;EAAED,YAAY;EAAkBC,SAAS;CAAY;CAC9D,SAAS;EAAED,YAAY;EAAaC,SAAS;CAAW;CACxD,SAAS;EAAED,YAAY;EAA0BC,SAAS;CAAa;CACvE,SAAS;EAAED,YAAY;EAAcC,SAAS;CAAO;CACrD,SAAS;EAAED,YAAY;EAAwBC,SAAS;CAAa;CACrE,SAAS;EAAED,YAAY;EAAgBC,SAAS;CAAW;CAC3D,SAAS;EAAED,YAAY;EAA0BC,SAAS;CAAc;CACxE,SAAS;EAAED,YAAY;EAAYC,SAAS;CAAQ;CACpD,SAAS;EAAED,YAAY;EAAUC,SAAS;CAAO;CACjD,SAAS;EAAED,YAAY;EAAqBC,SAAS;CAAW;CAChE,SAAS;EAAED,YAAY;EAAmBC,SAAS;CAAgB;CACnE,SAAS;EAAED,YAAY;EAAcC,SAAS;CAAa;CAC3D,SAAS;EAAED,YAAY;EAAcC,SAAS;CAAQ;CACtD,SAAS;EAAED,YAAY;EAA0BC,SAAS;CAAY;CACtE,SAAS;EAAED,YAAY;EAAoBC,SAAS;CAAa;CACjE,SAAS;EAAED,YAAY;EAAsBC,SAAS;CAAa;CACnE,SAAS;EAAED,YAAY;EAAoBC,SAAS;CAAa;CACjE,SAAS;EAAED,YAAY;EAAsBC,SAAS;CAAW;CACjE,SAAS;EAAED,YAAY;EAAuBC,SAAS;CAAc;CACrE,SAAS;EAAED,YAAY;EAAsBC,SAAS;CAAY;CAClE,SAAS;EAAED,YAAY;EAAyBC,SAAS;CAAa;CACtE,SAAS;EAAED,YAAY;EAAeC,SAAS;CAAW;CAC1D,SAAS;EAAED,YAAY;EAAsBC,SAAS;CAAa;CACnE,SAAS;EAAED,YAAY;EAAsBC,SAAS;CAAe;CACrE,SAAS;EAAED,YAAY;EAAQC,SAAS;CAAO;CAC/C,SAAS;EAAED,YAAY;EAAQC,SAAS;CAAO;AACjD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { Radio, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioProps }
|
|
|
19
19
|
import { SearchField, SearchFieldProps } from "./components/search-field/index.js";
|
|
20
20
|
import { SegmentedButton, SegmentedButtonProps, SegmentedButtonSegment, SegmentedButtonSegmentProps } from "./components/segmented-button/index.js";
|
|
21
21
|
import { Separator, SeparatorInset, SeparatorProps } from "./components/separator/index.js";
|
|
22
|
+
import { Sheet, SheetBody, SheetBodyProps, SheetContent, SheetContentProps, SheetFooter, SheetHandle, SheetHandleProps, SheetHeader, SheetPartProps, SheetProps, SheetTitle, SheetTitleProps } from "./components/sheet/index.js";
|
|
22
23
|
import { Snackbar, SnackbarAction, SnackbarOptions, SnackbarProps, SnackbarQueue } from "./components/snackbar/index.js";
|
|
23
24
|
import { Stack, StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
|
|
24
25
|
import { Switch, SwitchProps } from "./components/switch/index.js";
|
|
@@ -32,4 +33,4 @@ import { RouterProvider, RouterProviderProps } from "./router/index.js";
|
|
|
32
33
|
import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
|
|
33
34
|
import { ResolvedTheme, useTheme } from "./theme/scope.js";
|
|
34
35
|
import { Key, Selection } from "react-stately";
|
|
35
|
-
export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
|
|
36
|
+
export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, type SheetBodyProps, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, type SheetHandleProps, SheetHeader, type SheetPartProps, type SheetProps, SheetTitle, type SheetTitleProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
|
package/dist/index.js
CHANGED
|
@@ -23,9 +23,10 @@ import { Radio, RadioGroup } from "./components/radio-group/index.js";
|
|
|
23
23
|
import { SearchField } from "./components/search-field/index.js";
|
|
24
24
|
import { SegmentedButton, SegmentedButtonSegment } from "./components/segmented-button/index.js";
|
|
25
25
|
import { Separator } from "./components/separator/index.js";
|
|
26
|
+
import { Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle } from "./components/sheet/index.js";
|
|
26
27
|
import { Snackbar } from "./components/snackbar/index.js";
|
|
27
28
|
import { Stack } from "./components/stack/index.js";
|
|
28
29
|
import { Switch } from "./components/switch/index.js";
|
|
29
30
|
import { TextField } from "./components/text-field/index.js";
|
|
30
31
|
import { ThemeScope } from "./theme-scope.js";
|
|
31
|
-
export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
|
|
32
|
+
export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../button/slots.js";
|
|
2
|
+
import { HostInstance, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { ReactNode, Ref } from "react";
|
|
4
|
+
import "react-native-reanimated";
|
|
5
|
+
import "react-native-safe-area-context";
|
|
6
|
+
import "react-stately/useOverlayTriggerState";
|
|
7
|
+
//#region src/modal/index.d.ts
|
|
8
|
+
/** Whether a modal surface is open, and who holds that state. */
|
|
9
|
+
type ModalOpenProps = {
|
|
10
|
+
readonly defaultOpen?: boolean;
|
|
11
|
+
readonly isOpen?: boolean;
|
|
12
|
+
readonly onOpenChange?: (isOpen: boolean) => void;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export type { ModalOpenProps };
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|