@kanso-labs/react-native-kanso-ui 0.0.0-stage → 0.1.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.
Files changed (145) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +205 -2
  3. package/dist/button/index.d.ts +56 -0
  4. package/dist/button/index.js +169 -0
  5. package/dist/button/index.js.map +1 -0
  6. package/dist/button/palettes.js +47 -0
  7. package/dist/button/palettes.js.map +1 -0
  8. package/dist/chip/index.js +194 -0
  9. package/dist/chip/index.js.map +1 -0
  10. package/dist/chip/styles.js +36 -0
  11. package/dist/chip/styles.js.map +1 -0
  12. package/dist/clipboard/index.js +58 -0
  13. package/dist/clipboard/index.js.map +1 -0
  14. package/dist/components/avatar/index.d.ts +82 -0
  15. package/dist/components/avatar/index.js +62 -0
  16. package/dist/components/avatar/index.js.map +1 -0
  17. package/dist/components/button/index.d.ts +87 -0
  18. package/dist/components/button/index.js +377 -0
  19. package/dist/components/button/index.js.map +1 -0
  20. package/dist/components/card/index.d.ts +78 -0
  21. package/dist/components/card/index.js +315 -0
  22. package/dist/components/card/index.js.map +1 -0
  23. package/dist/components/checkbox/index.d.ts +76 -0
  24. package/dist/components/checkbox/index.js +360 -0
  25. package/dist/components/checkbox/index.js.map +1 -0
  26. package/dist/components/chip/index.d.ts +84 -0
  27. package/dist/components/chip/index.js +257 -0
  28. package/dist/components/chip/index.js.map +1 -0
  29. package/dist/components/chip-group/index.d.ts +143 -0
  30. package/dist/components/chip-group/index.js +669 -0
  31. package/dist/components/chip-group/index.js.map +1 -0
  32. package/dist/components/copy-field/index.d.ts +60 -0
  33. package/dist/components/copy-field/index.js +277 -0
  34. package/dist/components/copy-field/index.js.map +1 -0
  35. package/dist/components/currency/index.d.ts +69 -0
  36. package/dist/components/currency/index.js +162 -0
  37. package/dist/components/currency/index.js.map +1 -0
  38. package/dist/components/form/index.d.ts +84 -0
  39. package/dist/components/form/index.js +95 -0
  40. package/dist/components/form/index.js.map +1 -0
  41. package/dist/components/icon-button/index.d.ts +68 -0
  42. package/dist/components/icon-button/index.js +289 -0
  43. package/dist/components/icon-button/index.js.map +1 -0
  44. package/dist/components/link/index.d.ts +59 -0
  45. package/dist/components/link/index.js +191 -0
  46. package/dist/components/link/index.js.map +1 -0
  47. package/dist/components/number-field/index.d.ts +151 -0
  48. package/dist/components/number-field/index.js +832 -0
  49. package/dist/components/number-field/index.js.map +1 -0
  50. package/dist/components/product-icon/index.d.ts +70 -0
  51. package/dist/components/product-icon/index.js +60 -0
  52. package/dist/components/product-icon/index.js.map +1 -0
  53. package/dist/components/radio-group/index.d.ts +105 -0
  54. package/dist/components/radio-group/index.js +597 -0
  55. package/dist/components/radio-group/index.js.map +1 -0
  56. package/dist/components/search-field/index.d.ts +98 -0
  57. package/dist/components/search-field/index.js +521 -0
  58. package/dist/components/search-field/index.js.map +1 -0
  59. package/dist/components/segmented-button/index.d.ts +113 -0
  60. package/dist/components/segmented-button/index.js +937 -0
  61. package/dist/components/segmented-button/index.js.map +1 -0
  62. package/dist/components/separator/index.d.ts +45 -0
  63. package/dist/components/separator/index.js +109 -0
  64. package/dist/components/separator/index.js.map +1 -0
  65. package/dist/components/stack/index.d.ts +70 -0
  66. package/dist/components/stack/index.js +107 -0
  67. package/dist/components/stack/index.js.map +1 -0
  68. package/dist/components/switch/index.d.ts +76 -0
  69. package/dist/components/switch/index.js +591 -0
  70. package/dist/components/switch/index.js.map +1 -0
  71. package/dist/components/text/index.d.ts +44 -0
  72. package/dist/components/text/index.js +78 -0
  73. package/dist/components/text/index.js.map +1 -0
  74. package/dist/components/text-field/index.d.ts +146 -0
  75. package/dist/components/text-field/index.js +228 -0
  76. package/dist/components/text-field/index.js.map +1 -0
  77. package/dist/control/index.js +117 -0
  78. package/dist/control/index.js.map +1 -0
  79. package/dist/control/styles.js +36 -0
  80. package/dist/control/styles.js.map +1 -0
  81. package/dist/field/index.d.ts +13 -0
  82. package/dist/field/index.js +1007 -0
  83. package/dist/field/index.js.map +1 -0
  84. package/dist/field/styles.js +131 -0
  85. package/dist/field/styles.js.map +1 -0
  86. package/dist/form/index.d.ts +24 -0
  87. package/dist/form/index.js +209 -0
  88. package/dist/form/index.js.map +1 -0
  89. package/dist/glyphs/icon-style.d.ts +25 -0
  90. package/dist/glyphs/icon-style.js +22 -0
  91. package/dist/glyphs/icon-style.js.map +1 -0
  92. package/dist/glyphs/index.js +170 -0
  93. package/dist/glyphs/index.js.map +1 -0
  94. package/dist/glyphs/styles.js +7 -0
  95. package/dist/glyphs/styles.js.map +1 -0
  96. package/dist/hooks/useWindowSizeClass.d.ts +25 -0
  97. package/dist/hooks/useWindowSizeClass.js +39 -0
  98. package/dist/hooks/useWindowSizeClass.js.map +1 -0
  99. package/dist/index.d.ts +31 -0
  100. package/dist/index.js +27 -0
  101. package/dist/mark/image.js +61 -0
  102. package/dist/mark/image.js.map +1 -0
  103. package/dist/mark/index.d.ts +9 -0
  104. package/dist/mark/index.js +234 -0
  105. package/dist/mark/index.js.map +1 -0
  106. package/dist/mark/initials.js +65 -0
  107. package/dist/mark/initials.js.map +1 -0
  108. package/dist/mark/styles.d.ts +1 -0
  109. package/dist/mark/styles.js +73 -0
  110. package/dist/mark/styles.js.map +1 -0
  111. package/dist/number/parser.js +321 -0
  112. package/dist/number/parser.js.map +1 -0
  113. package/dist/number/state.js +235 -0
  114. package/dist/number/state.js.map +1 -0
  115. package/dist/overlay/host.js +111 -0
  116. package/dist/overlay/host.js.map +1 -0
  117. package/dist/press/index.js +350 -0
  118. package/dist/press/index.js.map +1 -0
  119. package/dist/press/styles.js +31 -0
  120. package/dist/press/styles.js.map +1 -0
  121. package/dist/router/index.d.ts +28 -0
  122. package/dist/router/index.js +82 -0
  123. package/dist/router/index.js.map +1 -0
  124. package/dist/theme/color.js +25 -0
  125. package/dist/theme/color.js.map +1 -0
  126. package/dist/theme/resolve.d.ts +6 -0
  127. package/dist/theme/resolve.js +310 -0
  128. package/dist/theme/resolve.js.map +1 -0
  129. package/dist/theme/scope.d.ts +42 -0
  130. package/dist/theme/scope.js +80 -0
  131. package/dist/theme/scope.js.map +1 -0
  132. package/dist/theme/styles.js +39 -0
  133. package/dist/theme/styles.js.map +1 -0
  134. package/dist/theme-scope.d.ts +56 -0
  135. package/dist/theme-scope.js +127 -0
  136. package/dist/theme-scope.js.map +1 -0
  137. package/dist/tokens/defaults.d.ts +407 -0
  138. package/dist/tokens/defaults.js +403 -0
  139. package/dist/tokens/defaults.js.map +1 -0
  140. package/dist/typography/fonts.js +84 -0
  141. package/dist/typography/fonts.js.map +1 -0
  142. package/dist/typography/roles.d.ts +10 -0
  143. package/dist/typography/roles.js +82 -0
  144. package/dist/typography/roles.js.map +1 -0
  145. package/package.json +132 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactElement","ReactNode","Ref","GestureResponderEvent","LayoutChangeEvent","PressableProps","StyleProp","TextStyle","ViewProps","ViewStyle","AnimatedStyle","Key","ToggleGroupState","Children","createContext","Fragment","isValidElement","use","useLayoutEffect","useMemo","useRef","useState","Text","NativeText","Pressable","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","useToggleGroupState","IconStyle","ResolvedTheme","toggleState","CheckGlyph","IconStyleContext","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","GroupContextValue","basis","count","onPlace","key","place","Place","opening","places","ReadonlyMap","selectionMode","SelectionMode","showSelectedIcon","state","LabelledBy","width","x","SegmentedButtonProps","Omit","children","defaultSelectedKeys","Iterable","disallowEmptySelection","isDisabled","onSelectionChange","keys","Set","ref","selectedKeys","style","SegmentedButtonSegmentProps","disableRipple","icon","id","GLYPH_SIZE","RULE_WIDTH","CHECK","GroupContext","IndexContext","styles","create","glyph","alignItems","flexShrink","height","justifyContent","glyphSlot","overflow","indicator","bottom","position","start","top","label","minWidth","measurer","opacity","pointerEvents","ownIndicator","end","spacer","flexDirection","stylesOf","colors","radii","sizing","spacing","clip","borderRadius","pill","first","borderStartWidth","segment","borderColor","outline","borderWidth","minHeight","controlSm","paddingHorizontal","sm","track","alignSelf","maxWidth","reachOf","basisOf","segments","labels","index","props","entries","labelled","hasLabel","get","undefined","content","reservesGlyph","Math","max","md","ruleOf","containerOf","stateLayerOpacity","disabled","marked","onSurface","disabledContainer","secondaryContainer","secondary","contentOf","selected","disabledContent","onSecondaryContainer","onSecondary","cornersOf","radius","last","Pick","borderBottomEndRadius","borderBottomStartRadius","borderTopEndRadius","borderTopStartRadius","iconStyleOf","color","size","Indicator","t0","$","_c","theme","motion","reduceMotion","rest","setRest","shift","shown","drawnAt","drawn","offset","abs","t1","durationMedium1","easingEmphasized","slide","duration","easing","bezier","current","set","from","moves","t2","motionStyle","transform","translateX","t3","t4","t5","Symbol","for","restThen","t6","t7","backgroundColor","t8","t9","measureThen","setLabels","update","event","nativeEvent","layout","Map","placeThen","onLayout","samePlace","known","SegmentedButton","role","single","segmentsOf","setPlaces","at","chosen","held","setHeld","setOpening","t10","length","context","T0","t11","t12","t13","t14","t15","t16","t17","own","find","map","_temp","t18","t19","t20","own_0","each","SegmentedButtonSegment","onBlur","onFocus","onHoverIn","onHoverOut","onPress","onPressIn","onPressOut","ownHitSlop","ownDisabled","group","several","has","reserves","corners","give","reserve","leading","leadingFloor","trailing","room","useSegmentMotion","fades","filled","feedback","handlers","toggleThen","flexGrow","ring","layer","slot","gap","fill","toArray","flatMap","child","type","toggleKey","timing","durationShort2","easingStandard","Segment","_c","NativeText"],"sources":["../../../src/components/segmented-button/index.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react'\nimport type {\n GestureResponderEvent,\n LayoutChangeEvent,\n PressableProps,\n StyleProp,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { Key } from 'react-stately'\nimport type { ToggleGroupState } from 'react-stately/useToggleGroupState'\n\nimport {\n Children,\n createContext,\n Fragment,\n isValidElement,\n use,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Text as NativeText, Pressable, StyleSheet, View } from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { useToggleGroupState } from 'react-stately/useToggleGroupState'\n\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { toggleState } from '../../button'\nimport { CheckGlyph } from '../../glyphs'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The segmented buttons page's outlined segmented button, as kanso-ui's\n// SegmentedButton draws it: two to five segments joined into one outlined\n// track, of which one or several are chosen. A segment is Button's default\n// size and type role, a 40dp container with a label-large label, which is\n// what that page gives too.\n//\n// What a screen reader hears follows the selection mode, as on web. Choosing\n// one is a radio group, so the track is a `radiogroup` and each segment a\n// `radio` reporting whether it is checked. Choosing several is a `toolbar` of\n// buttons, each reporting whether it is selected through `toggleState`, as a\n// toggle Button does. The selection is React Stately's toggle group state, as\n// web's is React Aria's, and in a set that chooses one, the chosen segment\n// stays chosen when pressed again unless `disallowEmptySelection` is `false`.\n//\n// **The segments are one track.** Each carries the page's 1dp outline, and\n// each after the first drops its leading edge, so neighbours share one rule.\n// The outer ends take the page's fully rounded shape and the joins are\n// square. Every segment is the same width, as wide as the widest one asks\n// for: the labels are measured off screen, and each segment is handed the\n// widest one's width, so a track squeezed into less room shares it out\n// equally. The track is as wide as that, and never wider than what\n// holds it.\n//\n// **A chosen segment draws a check** in the page's 18dp icon slot, in place\n// of its `icon`. `showSelectedIcon={false}` turns it off, and the chosen\n// segment then takes the secondary role with its label on it, since the\n// page's own chosen container is too faint to say which is chosen by itself.\n// A segment with an icon and no label keeps its icon when chosen, and takes\n// the secondary role too. Every segment that could draw the slot keeps room\n// for it whether or not it does, split either side of the label while\n// nothing is drawn, so the track never changes width with the choice. That\n// room gives way before the label does: a squeezed segment gives back the\n// room first, then 4dp of its 12dp padding, and only then cuts its label\n// short with an ellipsis. The slot and the room around it ease over\n// `durationShort2` on the standard curve, and the check opens from its\n// centre.\n//\n// **The chosen container moves.** In a set that chooses one it is a view of\n// the track's own, behind the segments, so the labels and the rules are\n// drawn over it, and it slides between segments over `durationMedium1` on the\n// emphasized curve. It is drawn inside the track's outline, so it takes the\n// rounded shape at either end and square corners between. It can only be\n// placed once the segments are laid out, so until the choice first moves, the\n// segment the set opened on draws a container of its own in the same place.\n// Without it, the chosen label would stand on the bare surface in the frames\n// before that layout, which is unreadable where no check marks it, since its\n// colour is then the one meant for the secondary role. In a set that chooses\n// several there is no one segment for it to be at, so each segment fades its\n// own in and out where it is, over `durationShort2`. Both happen at once\n// under reduced motion.\n//\n// The state layer, the ripple and the focus ring are src/press's, in the\n// label's colour, over the chosen container. A segment's target reaches 4dp\n// above and below the 40dp track, to the page's 48dp, and not across, since\n// the segments sit flush.\n//\n// **Disabled is the page's colour at an opacity, translucent**, as a\n// button's is: the label on-surface at `disabledContent`, and the rule and a\n// chosen segment's container on-surface at `disabledContainer`.\n//\n// Two departures from web. The arrow keys do not move between the segments\n// or choose one: each segment is a stop of its own for a hardware keyboard,\n// and activating it there chooses it. And a label cut short has no `title` to\n// show it whole, which a screen reader does not need, since it reads all of\n// it.\n\n/** What the set reads from the segments, and a segment from the set. */\ntype GroupContextValue = {\n /** The basis each segment takes, once every label is measured. */\n readonly basis: number | undefined\n readonly count: number\n /** Records where a segment was laid out, for the chosen container. */\n readonly onPlace: (key: Key, place: Place) => void\n /**\n * The segment a set that chooses one opened on, until the choice first\n * moves, which draws the chosen container itself meanwhile.\n */\n readonly opening: Key | undefined\n readonly places: ReadonlyMap<Key, Place>\n readonly selectionMode: SelectionMode\n readonly showSelectedIcon: boolean\n readonly state: ToggleGroupState\n}\n\n/** A name for the set: its own label, or the id of what labels it. */\ntype LabelledBy =\n | { readonly 'aria-label': string; readonly 'aria-labelledby'?: string }\n | { readonly 'aria-label'?: string; readonly 'aria-labelledby': string }\n\n/** Where a segment was laid out in the track. */\ntype Place = {\n readonly width: number\n readonly x: number\n}\n\ntype SegmentedButtonProps = LabelledBy &\n Omit<ViewProps, 'aria-label' | 'aria-labelledby' | 'children' | 'style'> & {\n /** The segments, each a `SegmentedButton.Segment` with an `id`. */\n readonly children?: ReactNode\n /** The keys chosen at first, when the set keeps its own selection. */\n readonly defaultSelectedKeys?: Iterable<Key>\n /**\n * Whether the chosen segment stays chosen when it is pressed again. On\n * by default while one is chosen, since a radio group always holds a\n * choice; `false` lets a press clear it. Off by default while several\n * may be, where any of them can be turned off.\n * @default true while one is chosen, false while several may be\n */\n readonly disallowEmptySelection?: boolean\n /**\n * Disables every segment.\n * @default false\n */\n readonly isDisabled?: boolean\n /** Called with the chosen keys when the choice changes. */\n readonly onSelectionChange?: (keys: Set<Key>) => void\n readonly ref?: Ref<View>\n /** The chosen keys, when the call site holds the selection. */\n readonly selectedKeys?: Iterable<Key>\n /**\n * Whether one segment is chosen at a time, or several.\n * @default 'single'\n */\n readonly selectionMode?: SelectionMode\n /**\n * Whether a chosen segment draws a check before its label, as the page\n * has it. `false` leaves the segment's own icon in place while chosen,\n * and draws the chosen segment on the stronger secondary container.\n * @default true\n */\n readonly showSelectedIcon?: boolean\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype SegmentedButtonSegmentProps = Omit<\n PressableProps,\n 'children' | 'disabled' | 'id' | 'style'\n> & {\n /** The segment's label. */\n readonly children?: ReactNode\n /**\n * Draws no press ripple. The hover and pressed state layers are unaffected.\n * @default false\n */\n readonly disableRipple?: boolean\n /**\n * An icon before the label, in the page's 18dp slot, which hands it the\n * label's colour and its size through `useIconStyle()`. Replaced by the\n * check while the segment is chosen, unless the set turns that off.\n *\n * Given with no label, the icon is the segment, centred in it and kept\n * while chosen; name the segment with `aria-label` then.\n */\n readonly icon?: ReactNode\n /** The key the selection reports the segment by. */\n readonly id: Key\n /**\n * Disables the segment alone.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<View>\n readonly style?: StyleProp<ViewStyle>\n}\n\ntype SelectionMode = 'multiple' | 'single'\n\n// The page's 18dp icon slot, and the room a segment keeps for it: the slot\n// and the 8dp gap between it and the label. A literal, as on web: the theme\n// has no scale for icon sizes.\nconst GLYPH_SIZE = 18\n\n// The rule every segment draws.\nconst RULE_WIDTH = 1\n\nconst CHECK = <CheckGlyph />\n\nconst GroupContext = createContext<GroupContextValue | null>(null)\n\n// Where in the track a segment sits, which decides its corners and its rule.\nconst IndexContext = createContext(0)\n\nconst styles = StyleSheet.create({\n // A glyph sized rather than filling its slot, so a slot part way through\n // opening clips it instead of squashing it.\n glyph: {\n alignItems: 'center',\n flexShrink: 0,\n height: GLYPH_SIZE,\n justifyContent: 'center',\n width: GLYPH_SIZE,\n },\n // Opens from its centre, so the check wipes out from the middle rather\n // than arriving at full size.\n glyphSlot: {\n alignItems: 'center',\n flexShrink: 0,\n height: GLYPH_SIZE,\n justifyContent: 'center',\n overflow: 'hidden',\n },\n // The chosen container of a set that chooses one: the track's own view,\n // behind the segments, at the start of the track and moved from there to\n // the chosen segment.\n indicator: {\n bottom: 0,\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // A label holds its width while the spacers beside it give theirs back,\n // and is cut short only at the width it is handed.\n label: {\n flexShrink: 0,\n minWidth: 0,\n },\n // The labels measured off screen, at their own widths, for the basis.\n measurer: {\n alignItems: 'flex-start',\n opacity: 0,\n pointerEvents: 'none',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // A segment's own chosen container, inside its rule: in a set that chooses\n // several, and in the segment a set that chooses one opened on.\n ownIndicator: {\n bottom: 0,\n end: 0,\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // Either side of the label, holding the room a glyph needs, given back\n // before the label is cut.\n spacer: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 1,\n justifyContent: 'flex-end',\n },\n})\n\nconst stylesOf = themedStyles(({ colors, radii, sizing, spacing }) =>\n StyleSheet.create({\n // What the chosen container of a set that chooses one is drawn in: the\n // track's own outline, so the container takes an end's rounded shape at\n // either end and square corners between, wherever it is.\n clip: {\n borderRadius: radii.pill,\n bottom: 0,\n end: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // The first segment draws the leading rule the others leave to it.\n first: {\n borderStartWidth: RULE_WIDTH,\n },\n segment: {\n alignItems: 'center',\n borderColor: colors.outline,\n borderStartWidth: 0,\n borderWidth: RULE_WIDTH,\n flexDirection: 'row',\n flexShrink: 1,\n justifyContent: 'center',\n minHeight: sizing.controlSm,\n minWidth: 0,\n paddingHorizontal: spacing.sm,\n },\n // As wide as what is in it and never wider than what holds it, from the\n // start edge.\n track: {\n alignSelf: 'flex-start',\n flexDirection: 'row',\n maxWidth: '100%',\n },\n }),\n)\n\n// The track reaches as far as its segments' targets, since iOS and Android\n// hand a touch to a view only once its parent has taken it.\nconst reachOf = themedStyles(({ sizing }) => hitSlop(sizing.controlSm))\n\n/**\n * The width every segment takes: the widest one's, which is its label, its\n * padding, the room it keeps for a glyph and its rule. Undefined until every\n * label has been measured.\n */\nfunction basisOf(\n segments: readonly ReactElement<SegmentedButtonSegmentProps>[],\n labels: ReadonlyMap<Key, number>,\n showSelectedIcon: boolean,\n { spacing }: ResolvedTheme,\n): number | undefined {\n let basis = 0\n\n for (const [index, { props }] of segments.entries()) {\n const labelled = hasLabel(props.children)\n const label = labels.get(props.id)\n\n if (labelled && label === undefined) {\n return undefined\n }\n\n const content = labelled\n ? (label ?? 0) +\n (reservesGlyph(props, showSelectedIcon) ? GLYPH_SIZE + spacing.sm : 0)\n : props.icon === undefined\n ? 0\n : GLYPH_SIZE\n\n basis = Math.max(\n basis,\n content + spacing.md * 2 + ruleOf(index) + RULE_WIDTH,\n )\n }\n\n return basis\n}\n\n/**\n * The chosen container's colour: the page's secondary container, the\n * stronger secondary where no check marks the choice, and on-surface at the\n * disabled opacity while the segment is disabled.\n */\nfunction containerOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n disabled: boolean,\n marked: boolean,\n): string {\n if (disabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer)\n }\n return marked ? colors.secondaryContainer : colors.secondary\n}\n\n/**\n * The label's colour, which the glyph, the state layer and the ripple take\n * too.\n */\nfunction contentOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n disabled,\n marked,\n selected,\n }: {\n readonly disabled: boolean\n readonly marked: boolean\n readonly selected: boolean\n },\n): string {\n if (disabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n }\n if (!selected) {\n return colors.onSurface\n }\n return marked ? colors.onSecondaryContainer : colors.onSecondary\n}\n\n/** A segment's corners: rounded at the ends of the track, square between. */\nfunction cornersOf(\n radius: number,\n first: boolean,\n last: boolean,\n): Pick<\n ViewStyle,\n | 'borderBottomEndRadius'\n | 'borderBottomStartRadius'\n | 'borderTopEndRadius'\n | 'borderTopStartRadius'\n> {\n return {\n borderBottomEndRadius: last ? radius : 0,\n borderBottomStartRadius: first ? radius : 0,\n borderTopEndRadius: last ? radius : 0,\n borderTopStartRadius: first ? radius : 0,\n }\n}\n\n// Whether a segment has a label, rather than an icon alone. An empty string\n// and a `false` from a condition at the call site are no label either.\nfunction hasLabel(children: ReactNode) {\n return (\n children !== undefined &&\n children !== null &&\n children !== false &&\n children !== ''\n )\n}\n\nfunction iconStyleOf(color: string): IconStyle {\n return { color, size: GLYPH_SIZE }\n}\n\n/**\n * The chosen container of a set that chooses one, which slides to the\n * segment chosen from the one chosen before it, fades in where nothing was\n * chosen, and fades out where nothing now is.\n */\nfunction Indicator({\n color,\n place,\n selected,\n}: {\n readonly color: string\n readonly place: Place | undefined\n readonly selected: Key | undefined\n}) {\n const theme = useTheme()\n const { motion } = theme\n const reduceMotion = useReducedMotion()\n // Where the container rests before it is moved: the start of the track,\n // which is its right end under a right-to-left layout, so that where it\n // rests there depends on how wide it is. It is only read at the width it\n // was measured at, which keeps a resize from drawing it a frame out of\n // place.\n const [rest, setRest] = useState<Place | undefined>(undefined)\n const shift = useSharedValue(0)\n const shown = useSharedValue(0)\n // The key the container was last drawn at, and whether it has been drawn\n // at all, which tells a choice made on a set already drawn from the first\n // one the set opens with.\n const drawnAt = useRef<Key | undefined>(undefined)\n const drawn = useRef(false)\n\n const offset =\n place === undefined ||\n rest === undefined ||\n Math.abs(rest.width - place.width) >= 1\n ? undefined\n : place.x - rest.x\n\n useLayoutEffect(() => {\n const slide = {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasized),\n }\n\n if (selected === undefined) {\n if (drawnAt.current !== undefined) {\n shown.set(reduceMotion ? 0 : withTiming(0, slide))\n }\n drawnAt.current = undefined\n return\n }\n\n if (offset === undefined) {\n return\n }\n\n const from = drawnAt.current\n // A move from another segment slides; a layout that moved under the\n // same choice, or a choice from nothing, is drawn where it lands.\n const moves = from !== undefined && from !== selected && !reduceMotion\n\n shift.set(moves ? withTiming(offset, slide) : offset)\n\n if (from === undefined) {\n shown.set(drawn.current && !reduceMotion ? withTiming(1, slide) : 1)\n }\n\n drawnAt.current = selected\n drawn.current = true\n }, [motion, offset, reduceMotion, selected, shift, shown])\n\n const motionStyle = useAnimatedStyle(() => {\n 'worklet'\n return {\n opacity: shown.get(),\n transform: [{ translateX: shift.get() }],\n }\n })\n\n return (\n <View style={stylesOf(theme).clip}>\n <Animated.View\n onLayout={restThen(setRest)}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.indicator,\n { backgroundColor: color, width: place?.width ?? 0 },\n motionStyle,\n )}\n />\n </View>\n )\n}\n\n/**\n * Records a label's width off screen, for the basis. Built by a call rather\n * than written inline at the prop, which is what react-perf's\n * jsx-no-new-function-as-prop is after; the React Compiler memoises the\n * result on its inputs.\n */\nfunction measureThen(\n setLabels: (\n update: (labels: ReadonlyMap<Key, number>) => ReadonlyMap<Key, number>,\n ) => void,\n key: Key,\n) {\n return (event: LayoutChangeEvent) => {\n const { width } = event.nativeEvent.layout\n\n setLabels((labels) =>\n labels.get(key) === width ? labels : new Map(labels).set(key, width),\n )\n }\n}\n\n/**\n * Records where a segment was laid out, then calls the call site's own\n * `onLayout`.\n */\nfunction placeThen(\n onPlace: (key: Key, place: Place) => void,\n key: Key,\n onLayout: PressableProps['onLayout'],\n) {\n return (event: LayoutChangeEvent) => {\n const { width, x } = event.nativeEvent.layout\n\n onPlace(key, { width, x })\n onLayout?.(event)\n }\n}\n\n// Whether a segment can ever draw a glyph, and so keeps room for one: a set\n// that draws the check, or an icon of its own. A segment that never needs\n// the slot keeps no room for it, which would be dead space in every segment.\nfunction reservesGlyph(\n { children, icon }: SegmentedButtonSegmentProps,\n showSelectedIcon: boolean,\n) {\n return (showSelectedIcon && hasLabel(children)) || icon !== undefined\n}\n\n/** Records where the chosen container rests before it is moved. */\nfunction restThen(setRest: (rest: Place) => void) {\n return (event: LayoutChangeEvent) => {\n const { width, x } = event.nativeEvent.layout\n\n setRest({ width, x })\n }\n}\n\n// The leading rule only the first segment draws.\nfunction ruleOf(index: number) {\n return index === 0 ? RULE_WIDTH : 0\n}\n\nfunction samePlace(known: Place | undefined, place: Place) {\n return (\n known !== undefined && known.width === place.width && known.x === place.x\n )\n}\n\n/**\n * A row of two to five joined segments, of which one, or with\n * `selectionMode=\"multiple\"` several, is chosen. Pass `selectedKeys` with\n * `onSelectionChange` to hold the choice, or `defaultSelectedKeys` to let the\n * set keep its own. Give every segment an `id`, which is the key the choice\n * is reported by.\n *\n * ```tsx\n * <SegmentedButton aria-label=\"Label\" defaultSelectedKeys={['first']}>\n * <SegmentedButton.Segment id=\"first\">First item</SegmentedButton.Segment>\n * <SegmentedButton.Segment id=\"second\">Second item</SegmentedButton.Segment>\n * </SegmentedButton>\n * ```\n *\n * Name the set with `aria-label` or `aria-labelledby`, one of which the\n * props require. Choosing one is announced as a radio group, and choosing\n * several as a toolbar of buttons that each say whether they are selected.\n *\n * `style`, `ref` and `testID` land on the track.\n */\nfunction SegmentedButton({\n children,\n defaultSelectedKeys,\n disallowEmptySelection,\n isDisabled = false,\n onSelectionChange,\n selectedKeys,\n selectionMode = 'single',\n showSelectedIcon = true,\n style,\n ...props\n}: SegmentedButtonProps) {\n const theme = useTheme()\n const role = useTypeRole('labelLarge')\n const single = selectionMode === 'single'\n const state = useToggleGroupState({\n defaultSelectedKeys,\n disallowEmptySelection: disallowEmptySelection ?? single,\n isDisabled,\n onSelectionChange,\n selectedKeys,\n selectionMode,\n })\n const segments = segmentsOf(children)\n const [labels, setLabels] = useState<ReadonlyMap<Key, number>>(new Map())\n const [places, setPlaces] = useState<ReadonlyMap<Key, Place>>(new Map())\n\n // The segment the chosen container is at in a set that chooses one, or\n // was last at, which it fades out at once the choice is cleared.\n const chosen = [...state.selectedKeys].at(0)\n const [held, setHeld] = useState(chosen)\n if (chosen !== undefined && chosen !== held) {\n setHeld(chosen)\n }\n // The segment the set opened on, until the choice first moves, which draws\n // the chosen container itself while the track's waits on the layout.\n const [opening, setOpening] = useState(chosen)\n if (opening !== undefined && opening !== chosen) {\n setOpening(undefined)\n }\n\n const basis = basisOf(segments, labels, showSelectedIcon, theme)\n const context = useMemo(\n () => ({\n basis,\n count: segments.length,\n onPlace: (key: Key, place: Place) => {\n setPlaces((current) =>\n samePlace(current.get(key), place)\n ? current\n : new Map(current).set(key, place),\n )\n },\n opening,\n places,\n selectionMode,\n showSelectedIcon,\n state,\n }),\n [\n basis,\n opening,\n places,\n segments.length,\n selectionMode,\n setPlaces,\n showSelectedIcon,\n state,\n ],\n )\n\n const segment = segments.find(({ props: own }) => own.id === (chosen ?? held))\n\n return (\n <View\n hitSlop={reachOf(theme)}\n role={single ? 'radiogroup' : 'toolbar'}\n {...props}\n style={composeStyles<ViewStyle>(stylesOf(theme).track, style)}\n >\n {single ? (\n <Indicator\n color={containerOf(\n theme,\n isDisabled || segment?.props.isDisabled === true,\n showSelectedIcon && hasLabel(segment?.props.children),\n )}\n place={\n segment === undefined ? undefined : places.get(segment.props.id)\n }\n selected={segment === undefined ? undefined : chosen}\n />\n ) : null}\n <GroupContext value={context}>\n {segments.map((each, at) => (\n <IndexContext key={each.props.id} value={at}>\n {each}\n </IndexContext>\n ))}\n </GroupContext>\n <View aria-hidden style={styles.measurer}>\n {segments.map(({ props: own }) =>\n hasLabel(own.children) ? (\n <NativeText\n key={own.id}\n numberOfLines={1}\n onLayout={measureThen(setLabels, own.id)}\n style={role}\n >\n {own.children}\n </NativeText>\n ) : null,\n )}\n </View>\n </View>\n )\n}\n\n/**\n * One segment. Its `id` is the key the choice reports it by, and its label is\n * what names it. A chosen segment draws a check before its label; one not\n * chosen draws its `icon`, if it has one. Renders nothing outside a\n * `SegmentedButton`.\n *\n * `style`, `ref` and `testID` land on the segment's `Pressable`.\n */\nfunction SegmentedButtonSegment({\n children,\n disableRipple = false,\n hitSlop: ownHitSlop,\n icon,\n id,\n isDisabled: ownDisabled = false,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onPress,\n onPressIn,\n onPressOut,\n style,\n ...props\n}: SegmentedButtonSegmentProps) {\n const theme = useTheme()\n const group = use(GroupContext)\n const index = use(IndexContext)\n const role = useTypeRole('labelLarge')\n\n const state = group?.state\n const several = group?.selectionMode === 'multiple'\n const showSelectedIcon = group?.showSelectedIcon ?? true\n const selected = state?.selectedKeys.has(id) ?? false\n const disabled = ownDisabled || state?.isDisabled === true\n const labelled = hasLabel(children)\n const marked = showSelectedIcon && labelled\n const reserves = reservesGlyph({ children, icon, id }, showSelectedIcon)\n const glyph = selected && marked ? CHECK : (icon ?? null)\n const drawn = glyph !== null\n const first = index === 0\n const last = index === (group?.count ?? 0) - 1\n\n const { radii, spacing } = theme\n const content = contentOf(theme, { disabled, marked, selected })\n const corners = cornersOf(radii.pill, first, last)\n const own = stylesOf(theme)\n\n // The room for a glyph, as the header sets it out: either side of the\n // label while nothing is drawn, all of it before the label once something\n // is, and the glyph alone before an icon with no label.\n const give = spacing.md - spacing.sm\n const reserve = GLYPH_SIZE + spacing.sm\n const leading = reserves\n ? drawn\n ? give + (labelled ? reserve : GLYPH_SIZE)\n : give + reserve / 2\n : give\n const leadingFloor = drawn ? (labelled ? reserve : GLYPH_SIZE) : 0\n const trailing = reserves && !drawn ? give + reserve / 2 : give\n // The most the label takes: what is left of the segment once its rule, its\n // padding and a drawn glyph are taken out.\n const width = group?.places.get(id)?.width\n const room =\n width === undefined\n ? undefined\n : width -\n ruleOf(index) -\n RULE_WIDTH -\n spacing.sm * 2 -\n (drawn && labelled ? reserve : 0)\n\n const motion = useSegmentMotion({\n content,\n drawn,\n fades: several,\n filled: several ? selected : id === group?.opening,\n labelled,\n leading,\n leadingFloor,\n room,\n trailing,\n })\n\n const feedback = usePressFeedback({\n color: content,\n corners,\n disabled,\n disableRipple,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n })\n\n if (group === null) {\n return null\n }\n\n return (\n <Pressable\n role={several ? 'button' : 'radio'}\n {...(several ? toggleState(selected) : { 'aria-checked': selected })}\n {...props}\n {...feedback.handlers}\n disabled={disabled}\n hitSlop={ownHitSlop ?? reachOf(theme)}\n onLayout={placeThen(group.onPlace, id, onLayout)}\n onPress={toggleThen(group.state, id, onPress)}\n style={composeStyles<ViewStyle>(\n own.segment,\n first ? own.first : undefined,\n corners,\n disabled\n ? {\n borderColor: withOpacity(\n theme.colors.onSurface,\n theme.stateLayerOpacity.disabledContainer,\n ),\n }\n : undefined,\n group.basis === undefined\n ? undefined\n : { flexGrow: 0, width: group.basis },\n feedback.ring,\n style,\n )}\n >\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.ownIndicator,\n corners,\n { backgroundColor: containerOf(theme, disabled, marked) },\n motion.fill,\n )}\n />\n {feedback.layer}\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.spacer,\n motion.leading,\n )}\n >\n {reserves ? (\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.glyphSlot,\n motion.slot,\n )}\n >\n <IconStyleContext value={iconStyleOf(content)}>\n <View style={styles.glyph}>{glyph}</View>\n </IconStyleContext>\n </Animated.View>\n ) : null}\n {reserves ? <Animated.View style={motion.gap} /> : null}\n </Animated.View>\n {labelled ? (\n <Animated.Text\n numberOfLines={1}\n style={composeStyles<AnimatedStyle<TextStyle>>(\n role,\n styles.label,\n motion.label,\n )}\n >\n {children}\n </Animated.Text>\n ) : null}\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.spacer,\n motion.trailing,\n )}\n />\n </Pressable>\n )\n}\n\n/**\n * The segments among a set's children, with any fragment between them opened,\n * so a set can take its segments as one fragment.\n */\nfunction segmentsOf(\n children: ReactNode,\n): ReactElement<SegmentedButtonSegmentProps>[] {\n return Children.toArray(children).flatMap((child) => {\n if (!isValidElement<{ readonly children?: ReactNode }>(child)) {\n return []\n }\n if (child.type === Fragment) {\n return segmentsOf(child.props.children)\n }\n return isValidElement<SegmentedButtonSegmentProps>(child) ? [child] : []\n })\n}\n\n/**\n * A press on a segment: the call site's own `onPress`, then the choice, which\n * chooses the segment, or clears it if it was chosen and the set allows that.\n */\nfunction toggleThen(\n state: ToggleGroupState,\n key: Key,\n onPress: PressableProps['onPress'],\n) {\n return (event: GestureResponderEvent) => {\n onPress?.(event)\n state.toggleKey(key)\n }\n}\n\n/**\n * What a segment eases: the room either side of its label and the glyph slot\n * between them over `durationShort2`, the label's colour and the most it\n * takes with them, and its own chosen container where it `fades`, in a set\n * that chooses several. All of it is there at once under reduced motion, and\n * the container is in a set that chooses one, where it only stands in for the\n * track's until the choice first moves.\n */\nfunction useSegmentMotion({\n content,\n drawn,\n fades,\n filled,\n labelled,\n leading,\n leadingFloor,\n room,\n trailing,\n}: {\n readonly content: string\n readonly drawn: boolean\n readonly fades: boolean\n readonly filled: boolean\n readonly labelled: boolean\n readonly leading: number\n readonly leadingFloor: number\n readonly room: number | undefined\n readonly trailing: number\n}) {\n const { motion, spacing } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n const gap = drawn && labelled ? spacing.sm : 0\n const slot = drawn ? GLYPH_SIZE : 0\n const opacity = filled ? 1 : 0\n\n return {\n fill: useAnimatedStyle(() => {\n 'worklet'\n return {\n opacity: reduceMotion || !fades ? opacity : withTiming(opacity, timing),\n }\n }),\n // A view of its own rather than an end margin on the slot: under React\n // Native Web, Reanimated writes an animated style to the element without\n // the step that turns `marginEnd` into a side, so it would never arrive.\n gap: useAnimatedStyle(() => {\n 'worklet'\n return { width: reduceMotion ? gap : withTiming(gap, timing) }\n }),\n label: useAnimatedStyle(() => {\n 'worklet'\n return {\n color: reduceMotion ? content : withTiming(content, timing),\n ...(room === undefined\n ? undefined\n : { maxWidth: reduceMotion ? room : withTiming(room, timing) }),\n }\n }),\n leading: useAnimatedStyle(() => {\n 'worklet'\n return {\n minWidth: reduceMotion\n ? leadingFloor\n : withTiming(leadingFloor, timing),\n width: reduceMotion ? leading : withTiming(leading, timing),\n }\n }),\n slot: useAnimatedStyle(() => {\n 'worklet'\n return { width: reduceMotion ? slot : withTiming(slot, timing) }\n }),\n trailing: useAnimatedStyle(() => {\n 'worklet'\n return { width: reduceMotion ? trailing : withTiming(trailing, timing) }\n }),\n }\n}\n\nSegmentedButton.Segment = SegmentedButtonSegment\n\nexport { SegmentedButton, SegmentedButtonSegment }\nexport type { SegmentedButtonProps, SegmentedButtonSegmentProps }\n"],"mappings":";;;;;;;;;;;;;;;AAyNA,MAAMgF,aAAa;AAGnB,MAAMC,aAAa;AAEnB,MAAMC,QAAQ,oBAAC,YAAD,CAAW,CAAA;AAEzB,MAAMC,eAAerE,cAAwC,IAAI;AAGjE,MAAMsE,eAAetE,cAAc,CAAC;AAEpC,MAAMuE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,OAAAA,KAAAnC,EAAA;CAAA,OAxCMmC;AAwCN;AAGHe,gBAAgBuE,UAAUzC"}
@@ -0,0 +1,45 @@
1
+ import { View, ViewProps } from "react-native";
2
+ import { ComponentRef, Ref } from "react";
3
+ //#region src/components/separator/index.d.ts
4
+ type SeparatorInset = 'both' | 'none' | 'start';
5
+ type SeparatorProps = ViewProps & {
6
+ /**
7
+ * How far the rule is held off the ends it runs between. `start` holds it
8
+ * 16dp off the leading end, which is the page's inset divider; `both` holds
9
+ * it off each end, which is its middle-inset one. The inset follows the
10
+ * writing direction rather than a fixed side.
11
+ * @default 'none'
12
+ */
13
+ readonly inset?: SeparatorInset;
14
+ /**
15
+ * Which way the rule runs. A rule takes its length from its parent: a
16
+ * horizontal one spans a column, and a vertical one a row.
17
+ * @default 'horizontal'
18
+ */
19
+ readonly orientation?: 'horizontal' | 'vertical';
20
+ readonly ref?: Ref<ComponentRef<typeof View>>;
21
+ };
22
+ /**
23
+ * A 1dp rule between items, in the outline-variant colour, carrying the
24
+ * separator role.
25
+ *
26
+ * ```tsx
27
+ * <Stack gap="none">
28
+ * <Text>First item</Text>
29
+ * <Separator inset="start" />
30
+ * <Text>Second item</Text>
31
+ * </Stack>
32
+ * ```
33
+ *
34
+ * `inset` holds the rule off the ends it runs between, `start` off the
35
+ * leading one and `both` off each, which is what a rule between list rows
36
+ * takes so it lines up with their text rather than the container's edge.
37
+ *
38
+ * Web draws the rule again as a border under forced colours, which neither
39
+ * iOS nor Android has. `style`, `ref` and `testID` land on the `View`, and a
40
+ * `style` there applies over the rule's own.
41
+ */
42
+ declare function Separator({ inset, orientation, style, ...props }: SeparatorProps): import("react").JSX.Element;
43
+ //#endregion
44
+ export { Separator, type SeparatorInset, type SeparatorProps };
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,109 @@
1
+ import { useTheme } from "../../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { StyleSheet, View } from "react-native";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/separator/index.tsx
7
+ const styles = StyleSheet.create({
8
+ horizontal: {
9
+ alignSelf: "stretch",
10
+ flexShrink: 0,
11
+ height: 1
12
+ },
13
+ vertical: {
14
+ alignSelf: "stretch",
15
+ flexShrink: 0,
16
+ width: 1
17
+ }
18
+ });
19
+ const fillOf = themedStyles(({ colors }) => StyleSheet.create({ rule: { backgroundColor: colors.outlineVariant } }));
20
+ const insetsOf = themedStyles(({ spacing }) => ({
21
+ horizontal: StyleSheet.create({
22
+ both: {
23
+ marginEnd: spacing.lg,
24
+ marginStart: spacing.lg
25
+ },
26
+ none: {},
27
+ start: { marginStart: spacing.lg }
28
+ }),
29
+ vertical: StyleSheet.create({
30
+ both: {
31
+ marginBottom: spacing.lg,
32
+ marginTop: spacing.lg
33
+ },
34
+ none: {},
35
+ start: { marginTop: spacing.lg }
36
+ })
37
+ }));
38
+ const VERTICAL = { "aria-orientation": "vertical" };
39
+ /**
40
+ * A 1dp rule between items, in the outline-variant colour, carrying the
41
+ * separator role.
42
+ *
43
+ * ```tsx
44
+ * <Stack gap="none">
45
+ * <Text>First item</Text>
46
+ * <Separator inset="start" />
47
+ * <Text>Second item</Text>
48
+ * </Stack>
49
+ * ```
50
+ *
51
+ * `inset` holds the rule off the ends it runs between, `start` off the
52
+ * leading one and `both` off each, which is what a rule between list rows
53
+ * takes so it lines up with their text rather than the container's edge.
54
+ *
55
+ * Web draws the rule again as a border under forced colours, which neither
56
+ * iOS nor Android has. `style`, `ref` and `testID` land on the `View`, and a
57
+ * `style` there applies over the rule's own.
58
+ */
59
+ function Separator(t0) {
60
+ const $ = c(14);
61
+ let props;
62
+ let style;
63
+ let t1;
64
+ let t2;
65
+ if ($[0] !== t0) {
66
+ ({inset: t1, orientation: t2, style, ...props} = t0);
67
+ $[0] = t0;
68
+ $[1] = props;
69
+ $[2] = style;
70
+ $[3] = t1;
71
+ $[4] = t2;
72
+ } else {
73
+ props = $[1];
74
+ style = $[2];
75
+ t1 = $[3];
76
+ t2 = $[4];
77
+ }
78
+ const inset = t1 === void 0 ? "none" : t1;
79
+ const orientation = t2 === void 0 ? "horizontal" : t2;
80
+ const theme = useTheme();
81
+ const t3 = orientation === "vertical" ? VERTICAL : void 0;
82
+ let t4;
83
+ if ($[5] !== inset || $[6] !== orientation || $[7] !== style || $[8] !== theme) {
84
+ t4 = composeStyles(styles[orientation], fillOf(theme).rule, insetsOf(theme)[orientation][inset], style);
85
+ $[5] = inset;
86
+ $[6] = orientation;
87
+ $[7] = style;
88
+ $[8] = theme;
89
+ $[9] = t4;
90
+ } else t4 = $[9];
91
+ let t5;
92
+ if ($[10] !== props || $[11] !== t3 || $[12] !== t4) {
93
+ t5 = /* @__PURE__ */ jsx(View, {
94
+ role: "separator",
95
+ ...t3,
96
+ ...props,
97
+ style: t4
98
+ });
99
+ $[10] = props;
100
+ $[11] = t3;
101
+ $[12] = t4;
102
+ $[13] = t5;
103
+ } else t5 = $[13];
104
+ return t5;
105
+ }
106
+ //#endregion
107
+ export { Separator };
108
+
109
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","ViewProps","ViewStyle","StyleSheet","View","useTheme","composeStyles","themedStyles","styles","create","horizontal","alignSelf","flexShrink","height","vertical","width","fillOf","colors","rule","backgroundColor","outlineVariant","insetsOf","spacing","both","marginEnd","lg","marginStart","none","start","marginBottom","marginTop","VERTICAL","SeparatorInset","SeparatorProps","inset","orientation","ref","Separator","t0","$","_c","props","style","t1","t2","undefined","theme","t3","t4","t5","_c"],"sources":["../../../src/components/separator/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { ViewProps, ViewStyle } from 'react-native'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// A divider is the same colour as a border, so it draws from outlineVariant\n// rather than a role of its own, as on web: the design system treats the two\n// as one decision.\n//\n// Drawn as a filled 1dp view rather than as a border, so the rule is the view\n// itself, which flex `gap` and anything measuring it can see.\n//\n// A rule has no length of its own. `alignSelf: 'stretch'` takes it from the\n// parent's cross axis: a horizontal rule spans a column, which is what a\n// `View` is by default, and a vertical one spans a row. A rule between two\n// rows should match whatever they turn out to be rather than being told a\n// length at the call site, and in a parent running the same way as the rule\n// it has none, which is the documented cost.\n//\n// The divider page gives three forms and this draws all three: full width,\n// inset by 16dp at the leading end, and middle-inset by 16dp at both. The page\n// names them \"inset\" and \"middle-inset\"; the prop says `start` and `both`, as\n// on web, since the two words say which ends move. The inset is a margin on\n// the axis the rule runs along, which shortens a stretched rule rather than\n// pushing it out of its parent. A horizontal rule's is `marginStart`, which\n// React Native puts on the right under right-to-left.\nconst styles = StyleSheet.create({\n horizontal: {\n alignSelf: 'stretch',\n flexShrink: 0,\n height: 1,\n },\n vertical: {\n alignSelf: 'stretch',\n flexShrink: 0,\n width: 1,\n },\n})\n\nconst fillOf = themedStyles(({ colors }) =>\n StyleSheet.create({\n rule: { backgroundColor: colors.outlineVariant },\n }),\n)\n\n// The page's 16dp, on the axis the rule runs along.\nconst insetsOf = themedStyles(({ spacing }) => ({\n horizontal: StyleSheet.create({\n both: { marginEnd: spacing.lg, marginStart: spacing.lg },\n none: {},\n start: { marginStart: spacing.lg },\n }),\n vertical: StyleSheet.create({\n both: { marginBottom: spacing.lg, marginTop: spacing.lg },\n none: {},\n start: { marginTop: spacing.lg },\n }),\n}))\n\n// React Native Web writes `aria-orientation` onto the element, which React\n// Native's types do not name. A horizontal rule needs none, since that is the\n// separator role's own default.\nconst VERTICAL: { readonly 'aria-orientation': 'vertical' } = {\n 'aria-orientation': 'vertical',\n}\n\ntype SeparatorInset = 'both' | 'none' | 'start'\n\ntype SeparatorProps = ViewProps & {\n /**\n * How far the rule is held off the ends it runs between. `start` holds it\n * 16dp off the leading end, which is the page's inset divider; `both` holds\n * it off each end, which is its middle-inset one. The inset follows the\n * writing direction rather than a fixed side.\n * @default 'none'\n */\n readonly inset?: SeparatorInset\n /**\n * Which way the rule runs. A rule takes its length from its parent: a\n * horizontal one spans a column, and a vertical one a row.\n * @default 'horizontal'\n */\n readonly orientation?: 'horizontal' | 'vertical'\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\n/**\n * A 1dp rule between items, in the outline-variant colour, carrying the\n * separator role.\n *\n * ```tsx\n * <Stack gap=\"none\">\n * <Text>First item</Text>\n * <Separator inset=\"start\" />\n * <Text>Second item</Text>\n * </Stack>\n * ```\n *\n * `inset` holds the rule off the ends it runs between, `start` off the\n * leading one and `both` off each, which is what a rule between list rows\n * takes so it lines up with their text rather than the container's edge.\n *\n * Web draws the rule again as a border under forced colours, which neither\n * iOS nor Android has. `style`, `ref` and `testID` land on the `View`, and a\n * `style` there applies over the rule's own.\n */\nfunction Separator({\n inset = 'none',\n orientation = 'horizontal',\n style,\n ...props\n}: SeparatorProps) {\n const theme = useTheme()\n\n return (\n <View\n role=\"separator\"\n {...(orientation === 'vertical' ? VERTICAL : undefined)}\n {...props}\n style={composeStyles<ViewStyle>(\n styles[orientation],\n fillOf(theme).rule,\n insetsOf(theme)[orientation][inset],\n style,\n )}\n />\n )\n}\n\nexport type { SeparatorInset, SeparatorProps }\n\nexport { Separator }\n"],"mappings":";;;;;;AA6BA,MAAMS,SAASL,WAAWM,OAAO;CAC/BC,YAAY;EACVC,WAAW;EACXC,YAAY;EACZC,QAAQ;CACV;CACAC,UAAU;EACRH,WAAW;EACXC,YAAY;EACZG,OAAO;CACT;AACF,CAAC;AAED,MAAMC,SAAST,cAAc,EAAEU,aAC7Bd,WAAWM,OAAO,EAChBS,MAAM,EAAEC,iBAAiBF,OAAOG,eAAe,EACjD,CAAC,CACH;AAGA,MAAMC,WAAWd,cAAc,EAAEe,eAAe;CAC9CZ,YAAYP,WAAWM,OAAO;EAC5Bc,MAAM;GAAEC,WAAWF,QAAQG;GAAIC,aAAaJ,QAAQG;EAAG;EACv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AA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAE,SAAAF,EAAA,QAAAQ,MAAAR,EAAA,QAAAS,IAAA;EATHC,KAAA,oBAAC,MAAD;GACO,MAAA;GAAW,GACXF;GAAiD,GAClDN;GACG,OAAAO;EAKN,CAAA;EACDT,EAAA,MAAAE;EAAAF,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAVFU;AAUE"}
@@ -0,0 +1,70 @@
1
+ import { View, ViewProps } from "react-native";
2
+ import { ComponentRef, Ref } from "react";
3
+ //#region src/components/stack/index.d.ts
4
+ type StackAlign = 'baseline' | 'center' | 'end' | 'start' | 'stretch';
5
+ type StackGap = 'lg' | 'md' | 'none' | 'sm' | 'xl' | 'xs' | 'xxl' | 'xxs' | 'xxxl';
6
+ type StackJustify = 'around' | 'between' | 'center' | 'end' | 'start';
7
+ type StackProps = ViewProps & {
8
+ /**
9
+ * How the children line up across the stack: along the width of a column,
10
+ * along the height of a row. Left unset, they stretch, which is what makes
11
+ * every card in a column the same width.
12
+ *
13
+ * `start` is what a child sized to its content needs in a column, which
14
+ * spans the whole width otherwise.
15
+ */
16
+ readonly align?: StackAlign;
17
+ /**
18
+ * Which way the children run.
19
+ * @default 'column'
20
+ */
21
+ readonly direction?: 'column' | 'row';
22
+ /**
23
+ * The space between children, as a step of the spacing scale. `none` closes
24
+ * it entirely.
25
+ *
26
+ * Worth setting. The default is a middle step, and how much air a group of
27
+ * things wants is the one thing a stack cannot work out for itself.
28
+ * @default 'md'
29
+ */
30
+ readonly gap?: StackGap;
31
+ /**
32
+ * How leftover space is distributed along the stack. Left unset, the
33
+ * children sit at the start and the space collects after them.
34
+ *
35
+ * `between` is the one that puts a headline at one end of a row and its
36
+ * actions at the other.
37
+ */
38
+ readonly justify?: StackJustify;
39
+ readonly ref?: Ref<ComponentRef<typeof View>>;
40
+ /**
41
+ * Lets a row wrap onto further lines rather than overflowing. Has no effect
42
+ * on a column, which has as many lines as it has children.
43
+ * @default false
44
+ */
45
+ readonly wrap?: boolean;
46
+ };
47
+ /**
48
+ * A row or a column of children with one gap between them, taken from the
49
+ * spacing scale.
50
+ *
51
+ * ```tsx
52
+ * <Stack align="center" direction="row" gap="sm">
53
+ * <Text>Label</Text>
54
+ * <Text tone="muted">Supporting line</Text>
55
+ * </Stack>
56
+ * ```
57
+ *
58
+ * Layout only: it paints no surface and wraps no child, so each child is a
59
+ * flex item exactly as it was written. It is the answer to spacing a group of
60
+ * things, which is why no component here carries a margin of its own: the
61
+ * space between two things belongs to whatever holds both of them.
62
+ *
63
+ * Web's `render` has no counterpart, since a native view is a `View` whatever
64
+ * it holds. `style`, `ref` and `testID` land on that `View`, and a `style`
65
+ * there applies over the stack's own.
66
+ */
67
+ declare function Stack({ align, direction, gap, justify, style, wrap, ...props }: StackProps): import("react").JSX.Element;
68
+ //#endregion
69
+ export { Stack, type StackAlign, type StackGap, type StackJustify, type StackProps };
70
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,107 @@
1
+ import { useTheme } from "../../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { StyleSheet, View } from "react-native";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/stack/index.tsx
7
+ const alignments = StyleSheet.create({
8
+ baseline: { alignItems: "baseline" },
9
+ center: { alignItems: "center" },
10
+ end: { alignItems: "flex-end" },
11
+ start: { alignItems: "flex-start" },
12
+ stretch: { alignItems: "stretch" }
13
+ });
14
+ const directions = StyleSheet.create({
15
+ column: { flexDirection: "column" },
16
+ row: { flexDirection: "row" }
17
+ });
18
+ const justifications = StyleSheet.create({
19
+ around: { justifyContent: "space-around" },
20
+ between: { justifyContent: "space-between" },
21
+ center: { justifyContent: "center" },
22
+ end: { justifyContent: "flex-end" },
23
+ start: { justifyContent: "flex-start" }
24
+ });
25
+ const styles = StyleSheet.create({ wrap: { flexWrap: "wrap" } });
26
+ const gapsOf = themedStyles(({ spacing }) => StyleSheet.create({
27
+ lg: { gap: spacing.lg },
28
+ md: { gap: spacing.md },
29
+ none: { gap: 0 },
30
+ sm: { gap: spacing.sm },
31
+ xl: { gap: spacing.xl },
32
+ xs: { gap: spacing.xs },
33
+ xxl: { gap: spacing.xxl },
34
+ xxs: { gap: spacing.xxs },
35
+ xxxl: { gap: spacing.xxxl }
36
+ }));
37
+ /**
38
+ * A row or a column of children with one gap between them, taken from the
39
+ * spacing scale.
40
+ *
41
+ * ```tsx
42
+ * <Stack align="center" direction="row" gap="sm">
43
+ * <Text>Label</Text>
44
+ * <Text tone="muted">Supporting line</Text>
45
+ * </Stack>
46
+ * ```
47
+ *
48
+ * Layout only: it paints no surface and wraps no child, so each child is a
49
+ * flex item exactly as it was written. It is the answer to spacing a group of
50
+ * things, which is why no component here carries a margin of its own: the
51
+ * space between two things belongs to whatever holds both of them.
52
+ *
53
+ * Web's `render` has no counterpart, since a native view is a `View` whatever
54
+ * it holds. `style`, `ref` and `testID` land on that `View`, and a `style`
55
+ * there applies over the stack's own.
56
+ */
57
+ function Stack(t0) {
58
+ const $ = c(12);
59
+ let align;
60
+ let justify;
61
+ let props;
62
+ let style;
63
+ let t1;
64
+ let t2;
65
+ let t3;
66
+ if ($[0] !== t0) {
67
+ ({align, direction: t1, gap: t2, justify, style, wrap: t3, ...props} = t0);
68
+ $[0] = t0;
69
+ $[1] = align;
70
+ $[2] = justify;
71
+ $[3] = props;
72
+ $[4] = style;
73
+ $[5] = t1;
74
+ $[6] = t2;
75
+ $[7] = t3;
76
+ } else {
77
+ align = $[1];
78
+ justify = $[2];
79
+ props = $[3];
80
+ style = $[4];
81
+ t1 = $[5];
82
+ t2 = $[6];
83
+ t3 = $[7];
84
+ }
85
+ const direction = t1 === void 0 ? "column" : t1;
86
+ const gap = t2 === void 0 ? "md" : t2;
87
+ const wrap = t3 === void 0 ? false : t3;
88
+ const gaps = gapsOf(useTheme());
89
+ const T0 = View;
90
+ const t4 = composeStyles(directions[direction], gaps[gap], align === void 0 ? void 0 : alignments[align], justify === void 0 ? void 0 : justifications[justify], wrap ? styles.wrap : void 0, style);
91
+ let t5;
92
+ if ($[8] !== T0 || $[9] !== props || $[10] !== t4) {
93
+ t5 = /* @__PURE__ */ jsx(T0, {
94
+ ...props,
95
+ style: t4
96
+ });
97
+ $[8] = T0;
98
+ $[9] = props;
99
+ $[10] = t4;
100
+ $[11] = t5;
101
+ } else t5 = $[11];
102
+ return t5;
103
+ }
104
+ //#endregion
105
+ export { Stack };
106
+
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","ViewProps","ViewStyle","StyleSheet","View","useTheme","composeStyles","themedStyles","alignments","create","baseline","alignItems","center","end","start","stretch","directions","column","flexDirection","row","justifications","around","justifyContent","between","styles","wrap","flexWrap","gapsOf","spacing","lg","gap","md","none","sm","xl","xs","xxl","xxs","xxxl","StackAlign","StackGap","StackJustify","StackProps","align","direction","justify","ref","Stack","t0","$","_c","props","style","t1","t2","t3","undefined","gaps","T0","t4","t5","_c"],"sources":["../../../src/components/stack/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { ViewProps, ViewStyle } from 'react-native'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// Short names rather than the flex values they map to, as on web, so a call\n// site reads `align=\"start\"` instead of `align=\"flex-start\"`.\n//\n// No Material Design page draws a stack. Its gaps are the spacing tokens, the\n// 4dp grid the layout pages space elements on, and `xl` is their 24dp spacer\n// between panes.\n//\n// `start` and `end` are logical. React Native lays a row out from the start\n// edge of the writing direction, so under right-to-left, whether the app's\n// through `I18nManager` or a `direction` style on a view around it, a row runs\n// from the right and `start` is the right-hand edge. Nothing here reverses a\n// row to get that, which is what keeps it so.\nconst alignments = StyleSheet.create({\n baseline: { alignItems: 'baseline' },\n center: { alignItems: 'center' },\n end: { alignItems: 'flex-end' },\n start: { alignItems: 'flex-start' },\n stretch: { alignItems: 'stretch' },\n})\n\nconst directions = StyleSheet.create({\n column: { flexDirection: 'column' },\n row: { flexDirection: 'row' },\n})\n\nconst justifications = StyleSheet.create({\n around: { justifyContent: 'space-around' },\n between: { justifyContent: 'space-between' },\n center: { justifyContent: 'center' },\n end: { justifyContent: 'flex-end' },\n start: { justifyContent: 'flex-start' },\n})\n\nconst styles = StyleSheet.create({\n wrap: { flexWrap: 'wrap' },\n})\n\n// One key per step of the spacing scale, named as the token group names it,\n// so `gaps[gap]` indexes straight off the prop. `none` is the one key with no\n// token behind it: zero is the absence of a spacing decision rather than a\n// step of the scale.\nconst gapsOf = themedStyles(({ spacing }) =>\n StyleSheet.create({\n lg: { gap: spacing.lg },\n md: { gap: spacing.md },\n none: { gap: 0 },\n sm: { gap: spacing.sm },\n xl: { gap: spacing.xl },\n xs: { gap: spacing.xs },\n xxl: { gap: spacing.xxl },\n xxs: { gap: spacing.xxs },\n xxxl: { gap: spacing.xxxl },\n }),\n)\n\ntype StackAlign = 'baseline' | 'center' | 'end' | 'start' | 'stretch'\n\ntype StackGap =\n | 'lg'\n | 'md'\n | 'none'\n | 'sm'\n | 'xl'\n | 'xs'\n | 'xxl'\n | 'xxs'\n | 'xxxl'\n\ntype StackJustify = 'around' | 'between' | 'center' | 'end' | 'start'\n\ntype StackProps = ViewProps & {\n /**\n * How the children line up across the stack: along the width of a column,\n * along the height of a row. Left unset, they stretch, which is what makes\n * every card in a column the same width.\n *\n * `start` is what a child sized to its content needs in a column, which\n * spans the whole width otherwise.\n */\n readonly align?: StackAlign\n /**\n * Which way the children run.\n * @default 'column'\n */\n readonly direction?: 'column' | 'row'\n /**\n * The space between children, as a step of the spacing scale. `none` closes\n * it entirely.\n *\n * Worth setting. The default is a middle step, and how much air a group of\n * things wants is the one thing a stack cannot work out for itself.\n * @default 'md'\n */\n readonly gap?: StackGap\n /**\n * How leftover space is distributed along the stack. Left unset, the\n * children sit at the start and the space collects after them.\n *\n * `between` is the one that puts a headline at one end of a row and its\n * actions at the other.\n */\n readonly justify?: StackJustify\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Lets a row wrap onto further lines rather than overflowing. Has no effect\n * on a column, which has as many lines as it has children.\n * @default false\n */\n readonly wrap?: boolean\n}\n\n/**\n * A row or a column of children with one gap between them, taken from the\n * spacing scale.\n *\n * ```tsx\n * <Stack align=\"center\" direction=\"row\" gap=\"sm\">\n * <Text>Label</Text>\n * <Text tone=\"muted\">Supporting line</Text>\n * </Stack>\n * ```\n *\n * Layout only: it paints no surface and wraps no child, so each child is a\n * flex item exactly as it was written. It is the answer to spacing a group of\n * things, which is why no component here carries a margin of its own: the\n * space between two things belongs to whatever holds both of them.\n *\n * Web's `render` has no counterpart, since a native view is a `View` whatever\n * it holds. `style`, `ref` and `testID` land on that `View`, and a `style`\n * there applies over the stack's own.\n */\nfunction Stack({\n align,\n direction = 'column',\n gap = 'md',\n justify,\n style,\n wrap = false,\n ...props\n}: StackProps) {\n const gaps = gapsOf(useTheme())\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n directions[direction],\n gaps[gap],\n align === undefined ? undefined : alignments[align],\n justify === undefined ? undefined : justifications[justify],\n wrap ? styles.wrap : undefined,\n style,\n )}\n />\n )\n}\n\nexport type { StackAlign, StackGap, StackJustify, StackProps }\n\nexport { Stack }\n"],"mappings":";;;;;;AAoBA,MAAMS,aAAaL,WAAWM,OAAO;CACnCC,UAAU,EAAEC,YAAY,WAAW;CACnCC,QAAQ,EAAED,YAAY,SAAS;CAC/BE,KAAK,EAAEF,YAAY,WAAW;CAC9BG,OAAO,EAAEH,YAAY,aAAa;CAClCI,SAAS,EAAEJ,YAAY,UAAU;AACnC,CAAC;AAED,MAAMK,aAAab,WAAWM,OAAO;CACnCQ,QAAQ,EAAEC,eAAe,SAAS;CAClCC,KAAK,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AAAL,EAAA,KAAAM;CAAA,OAAA;EAAAZ,QAAAM,EAAA;EAAAJ,UAAAI,EAAA;EAAAE,QAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;CAAA;CANX,MAAAL,YAAAS,OAAAG,KAAAA,IAAA,WAAAH;CACA,MAAAvB,MAAAwB,OAAAE,KAAAA,IAAA,OAAAF;CAGA,MAAA7B,OAAA8B,OAAAC,KAAAA,IAAA,QAAAD;CAGA,MAAAE,OAAa9B,OAAOtB,SAAS,CAAC;CAG3B,MAAAqD,KAAAtD;CAEQ,MAAAuD,KAAArD,cACLU,WAAW4B,YACXa,KAAK3B,MACLa,UAAUa,KAAAA,IAAVA,KAAAA,IAAkChD,WAAWmC,QAC7CE,YAAYW,KAAAA,IAAZA,KAAAA,IAAoCpC,eAAeyB,UACnDpB,OAAOD,OAAMC,OAAb+B,KAAAA,GACAJ,KACF;CAAC,IAAAQ;CAAA,IAAAX,EAAA,OAAAS,MAAAT,EAAA,OAAAE,SAAAF,EAAA,QAAAU,IAAA;EATHC,KAAA,oBAAC,IAAD;GAAK,GACCT;GACG,OAAAQ;EAON,CAAA;EACDV,EAAA,KAAAS;EAAAT,EAAA,KAAAE;EAAAF,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAVFW;AAUE"}
@@ -0,0 +1,76 @@
1
+ import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
2
+ import { ReactNode, Ref } from "react";
3
+ //#region src/components/switch/index.d.ts
4
+ type SwitchProps = Omit<ViewProps, 'children' | 'style'> & {
5
+ /**
6
+ * The label, beside the switch. A switch that a row labels some other way
7
+ * leaves it out and passes `aria-label` instead.
8
+ */
9
+ readonly children?: ReactNode;
10
+ /**
11
+ * Whether the switch starts on, when it keeps its own state.
12
+ * @default false
13
+ */
14
+ readonly defaultSelected?: boolean;
15
+ /**
16
+ * A hint under the label. Replaced by `error` when there is one, so the
17
+ * two never stack.
18
+ */
19
+ readonly description?: string;
20
+ /**
21
+ * The problem with the current value, in words. Its presence is what puts
22
+ * the switch in its error state: the line under the label is the error, in
23
+ * the error colour.
24
+ */
25
+ readonly error?: string;
26
+ /**
27
+ * Draws the check in the handle while the switch is on, the page's "icon on
28
+ * selected switch" form.
29
+ * @default false
30
+ */
31
+ readonly icon?: boolean;
32
+ /**
33
+ * Draws the switch disabled, and takes no presses or drags.
34
+ * @default false
35
+ */
36
+ readonly isDisabled?: boolean;
37
+ /**
38
+ * Shows the state without letting a press or a drag change it.
39
+ * @default false
40
+ */
41
+ readonly isReadOnly?: boolean;
42
+ /**
43
+ * Whether the switch is on, for a call site holding the state itself with
44
+ * `onChange`.
45
+ */
46
+ readonly isSelected?: boolean;
47
+ /** Called with the new state whenever a press or a drag changes it. */
48
+ readonly onChange?: (isSelected: boolean) => void;
49
+ readonly ref?: Ref<View>;
50
+ readonly style?: StyleProp<ViewStyle>;
51
+ };
52
+ /**
53
+ * A switch that turns a setting on or off, with its label and optionally a
54
+ * description or an error under it. Its state is React Stately's, as web's
55
+ * is: pass `isSelected` with `onChange` to control it, or `defaultSelected` to
56
+ * let it keep its own. A switch takes effect as it is flipped, which is what
57
+ * sets it apart from a checkbox in a form.
58
+ *
59
+ * ```tsx
60
+ * <Switch defaultSelected description="Supporting line">
61
+ * Label
62
+ * </Switch>
63
+ * ```
64
+ *
65
+ * A screen reader hears it as a switch named by its label, on or off,
66
+ * followed by the line under it. A press anywhere on the track or the label
67
+ * flips it, and the handle can be dragged across the track, settling on
68
+ * whichever side it is let go. `style`, `ref` and `testID` land on the view
69
+ * holding the row and the line under it, which is the element a layout
70
+ * positions. With a `testID`, the drag is registered with Gesture Handler as
71
+ * `<testID>-drag`, which its `getByGestureTestId` finds in a test.
72
+ */
73
+ declare function Switch({ 'aria-label': ariaLabel, children, defaultSelected, description, error, icon, isDisabled, isReadOnly, isSelected, onChange, style, testID, ...props }: SwitchProps): import("react").JSX.Element;
74
+ //#endregion
75
+ export { Switch, type SwitchProps };
76
+ //# sourceMappingURL=index.d.ts.map