@kanso-labs/react-native-kanso-ui 0.8.0 → 0.10.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 (253) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/badge/index.js +9 -70
  5. package/dist/badge/index.js.map +1 -1
  6. package/dist/button/group.d.ts +5 -0
  7. package/dist/button/group.js +115 -0
  8. package/dist/button/group.js.map +1 -0
  9. package/dist/button/index.d.ts +4 -1
  10. package/dist/button/index.js +45 -23
  11. package/dist/button/index.js.map +1 -1
  12. package/dist/button/palettes.d.ts +2 -0
  13. package/dist/button/slots.js +2 -1
  14. package/dist/button/slots.js.map +1 -1
  15. package/dist/calendar/index.js +351 -182
  16. package/dist/calendar/index.js.map +1 -1
  17. package/dist/calendar/styles.js +33 -2
  18. package/dist/calendar/styles.js.map +1 -1
  19. package/dist/carousel/arrangement.d.ts +5 -0
  20. package/dist/carousel/arrangement.js +123 -0
  21. package/dist/carousel/arrangement.js.map +1 -0
  22. package/dist/chequer/index.js +95 -0
  23. package/dist/chequer/index.js.map +1 -0
  24. package/dist/collection/index.d.ts +157 -0
  25. package/dist/collection/index.js +1331 -0
  26. package/dist/collection/index.js.map +1 -0
  27. package/dist/color-thumb/index.js +56 -0
  28. package/dist/color-thumb/index.js.map +1 -0
  29. package/dist/components/badge/index.d.ts +48 -0
  30. package/dist/components/badge/index.js +122 -0
  31. package/dist/components/badge/index.js.map +1 -0
  32. package/dist/{badge → components/badge}/styles.js +10 -6
  33. package/dist/components/badge/styles.js.map +1 -0
  34. package/dist/components/breadcrumbs/index.d.ts +66 -0
  35. package/dist/components/breadcrumbs/index.js +285 -0
  36. package/dist/components/breadcrumbs/index.js.map +1 -0
  37. package/dist/components/button/index.d.ts +4 -2
  38. package/dist/components/button/index.js +227 -188
  39. package/dist/components/button/index.js.map +1 -1
  40. package/dist/components/button-group/index.d.ts +87 -0
  41. package/dist/components/button-group/index.js +275 -0
  42. package/dist/components/button-group/index.js.map +1 -0
  43. package/dist/components/calendar/index.d.ts +11 -3
  44. package/dist/components/calendar/index.js +60 -45
  45. package/dist/components/calendar/index.js.map +1 -1
  46. package/dist/components/carousel/index.d.ts +72 -0
  47. package/dist/components/carousel/index.js +496 -0
  48. package/dist/components/carousel/index.js.map +1 -0
  49. package/dist/components/checkbox/index.d.ts +7 -1
  50. package/dist/components/checkbox/index.js +183 -138
  51. package/dist/components/checkbox/index.js.map +1 -1
  52. package/dist/components/checkbox-group/index.d.ts +92 -0
  53. package/dist/components/checkbox-group/index.js +306 -0
  54. package/dist/components/checkbox-group/index.js.map +1 -0
  55. package/dist/components/code/index.d.ts +25 -0
  56. package/dist/components/code/index.js +87 -0
  57. package/dist/components/code/index.js.map +1 -0
  58. package/dist/components/color-area/index.d.ts +85 -0
  59. package/dist/components/color-area/index.js +630 -0
  60. package/dist/components/color-area/index.js.map +1 -0
  61. package/dist/components/color-field/index.d.ts +144 -0
  62. package/dist/components/color-field/index.js +516 -0
  63. package/dist/components/color-field/index.js.map +1 -0
  64. package/dist/components/color-picker/index.d.ts +74 -0
  65. package/dist/components/color-picker/index.js +317 -0
  66. package/dist/components/color-picker/index.js.map +1 -0
  67. package/dist/components/color-slider/index.d.ts +82 -0
  68. package/dist/components/color-slider/index.js +456 -0
  69. package/dist/components/color-slider/index.js.map +1 -0
  70. package/dist/components/color-swatch/index.d.ts +46 -0
  71. package/dist/components/color-swatch/index.js +127 -0
  72. package/dist/components/color-swatch/index.js.map +1 -0
  73. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  74. package/dist/components/color-swatch-picker/index.js +287 -0
  75. package/dist/components/color-swatch-picker/index.js.map +1 -0
  76. package/dist/components/color-wheel/index.d.ts +71 -0
  77. package/dist/components/color-wheel/index.js +407 -0
  78. package/dist/components/color-wheel/index.js.map +1 -0
  79. package/dist/components/combo-box/index.d.ts +193 -0
  80. package/dist/components/combo-box/index.js +616 -0
  81. package/dist/components/combo-box/index.js.map +1 -0
  82. package/dist/components/container/index.d.ts +47 -0
  83. package/dist/components/container/index.js +85 -0
  84. package/dist/components/container/index.js.map +1 -0
  85. package/dist/components/date-field/index.d.ts +120 -0
  86. package/dist/components/date-field/index.js +111 -0
  87. package/dist/components/date-field/index.js.map +1 -0
  88. package/dist/components/date-picker/index.d.ts +130 -0
  89. package/dist/components/date-picker/index.js +310 -0
  90. package/dist/components/date-picker/index.js.map +1 -0
  91. package/dist/components/date-range-picker/index.d.ts +139 -0
  92. package/dist/components/date-range-picker/index.js +421 -0
  93. package/dist/components/date-range-picker/index.js.map +1 -0
  94. package/dist/components/disclosure/index.d.ts +94 -0
  95. package/dist/components/disclosure/index.js +365 -0
  96. package/dist/components/disclosure/index.js.map +1 -0
  97. package/dist/components/disclosure-group/index.d.ts +61 -0
  98. package/dist/components/disclosure-group/index.js +100 -0
  99. package/dist/components/disclosure-group/index.js.map +1 -0
  100. package/dist/components/drop-zone/index.d.ts +113 -0
  101. package/dist/components/drop-zone/index.js +304 -0
  102. package/dist/components/drop-zone/index.js.map +1 -0
  103. package/dist/components/fab/index.d.ts +80 -0
  104. package/dist/components/fab/index.js +246 -0
  105. package/dist/components/fab/index.js.map +1 -0
  106. package/dist/components/fab-menu/index.d.ts +120 -0
  107. package/dist/components/fab-menu/index.js +640 -0
  108. package/dist/components/fab-menu/index.js.map +1 -0
  109. package/dist/components/feed/index.d.ts +57 -0
  110. package/dist/components/feed/index.js +167 -0
  111. package/dist/components/feed/index.js.map +1 -0
  112. package/dist/components/form/index.d.ts +3 -2
  113. package/dist/components/form/index.js.map +1 -1
  114. package/dist/components/icon-button/index.d.ts +4 -2
  115. package/dist/components/icon-button/index.js +204 -171
  116. package/dist/components/icon-button/index.js.map +1 -1
  117. package/dist/components/keycap/index.d.ts +27 -0
  118. package/dist/components/keycap/index.js +136 -0
  119. package/dist/components/keycap/index.js.map +1 -0
  120. package/dist/components/list/index.d.ts +15 -158
  121. package/dist/components/list/index.js +21 -1047
  122. package/dist/components/list/index.js.map +1 -1
  123. package/dist/components/list-box/index.d.ts +73 -0
  124. package/dist/components/list-box/index.js +82 -0
  125. package/dist/components/list-box/index.js.map +1 -0
  126. package/dist/components/loading-indicator/index.d.ts +32 -0
  127. package/dist/components/loading-indicator/index.js +174 -0
  128. package/dist/components/loading-indicator/index.js.map +1 -0
  129. package/dist/components/menu/index.js +1 -1
  130. package/dist/components/navigation-tree/index.d.ts +117 -0
  131. package/dist/components/navigation-tree/index.js +135 -0
  132. package/dist/components/navigation-tree/index.js.map +1 -0
  133. package/dist/components/number-field/index.js +132 -143
  134. package/dist/components/number-field/index.js.map +1 -1
  135. package/dist/components/range-calendar/index.d.ts +69 -0
  136. package/dist/components/range-calendar/index.js +144 -0
  137. package/dist/components/range-calendar/index.js.map +1 -0
  138. package/dist/components/search-view/index.d.ts +78 -0
  139. package/dist/components/search-view/index.js +570 -0
  140. package/dist/components/search-view/index.js.map +1 -0
  141. package/dist/components/select/index.d.ts +152 -0
  142. package/dist/components/select/index.js +419 -0
  143. package/dist/components/select/index.js.map +1 -0
  144. package/dist/components/separator/index.d.ts +3 -2
  145. package/dist/components/separator/index.js +29 -26
  146. package/dist/components/separator/index.js.map +1 -1
  147. package/dist/components/slider/index.d.ts +111 -0
  148. package/dist/components/slider/index.js +673 -0
  149. package/dist/components/slider/index.js.map +1 -0
  150. package/dist/components/split-button/index.d.ts +77 -0
  151. package/dist/components/split-button/index.js +354 -0
  152. package/dist/components/split-button/index.js.map +1 -0
  153. package/dist/components/supporting-pane/index.d.ts +44 -0
  154. package/dist/components/supporting-pane/index.js +109 -0
  155. package/dist/components/supporting-pane/index.js.map +1 -0
  156. package/dist/components/tabs/index.d.ts +196 -0
  157. package/dist/components/tabs/index.js +1137 -0
  158. package/dist/components/tabs/index.js.map +1 -0
  159. package/dist/components/text/index.d.ts +1 -1
  160. package/dist/components/text/index.js +49 -21
  161. package/dist/components/text/index.js.map +1 -1
  162. package/dist/components/text-area/index.d.ts +145 -0
  163. package/dist/components/text-area/index.js +231 -0
  164. package/dist/components/text-area/index.js.map +1 -0
  165. package/dist/components/time-field/index.d.ts +43 -0
  166. package/dist/components/time-field/index.js +107 -0
  167. package/dist/components/time-field/index.js.map +1 -0
  168. package/dist/components/time-picker/index.d.ts +65 -0
  169. package/dist/components/time-picker/index.js +1168 -0
  170. package/dist/components/time-picker/index.js.map +1 -0
  171. package/dist/components/toolbar/index.d.ts +53 -0
  172. package/dist/components/toolbar/index.js +185 -0
  173. package/dist/components/toolbar/index.js.map +1 -0
  174. package/dist/components/tooltip/index.d.ts +101 -0
  175. package/dist/components/tooltip/index.js +223 -0
  176. package/dist/components/tooltip/index.js.map +1 -0
  177. package/dist/components/tree/index.d.ts +112 -0
  178. package/dist/components/tree/index.js +157 -0
  179. package/dist/components/tree/index.js.map +1 -0
  180. package/dist/control/group.js +23 -0
  181. package/dist/control/group.js.map +1 -0
  182. package/dist/disclosure/chevron.js +75 -0
  183. package/dist/disclosure/chevron.js.map +1 -0
  184. package/dist/disclosure/index.js +7 -0
  185. package/dist/disclosure/index.js.map +1 -0
  186. package/dist/drop/index.d.ts +54 -0
  187. package/dist/drop/index.js +161 -0
  188. package/dist/drop/index.js.map +1 -0
  189. package/dist/fab/index.d.ts +19 -0
  190. package/dist/fab/index.js +147 -0
  191. package/dist/fab/index.js.map +1 -0
  192. package/dist/field/chevron.js +74 -0
  193. package/dist/field/chevron.js.map +1 -0
  194. package/dist/field/index.d.ts +2 -1
  195. package/dist/field/index.js +350 -153
  196. package/dist/field/index.js.map +1 -1
  197. package/dist/field/styles.js +27 -0
  198. package/dist/field/styles.js.map +1 -1
  199. package/dist/files/index.d.ts +18 -0
  200. package/dist/files/index.js +107 -0
  201. package/dist/files/index.js.map +1 -0
  202. package/dist/form/index.d.ts +6 -4
  203. package/dist/form/index.js +64 -85
  204. package/dist/form/index.js.map +1 -1
  205. package/dist/glyphs/index.js +92 -1
  206. package/dist/glyphs/index.js.map +1 -1
  207. package/dist/i18n/index.js +20 -1
  208. package/dist/i18n/index.js.map +1 -1
  209. package/dist/i18n/messages.js +1394 -34
  210. package/dist/i18n/messages.js.map +1 -1
  211. package/dist/index.d.ts +51 -6
  212. package/dist/index.js +47 -4
  213. package/dist/indicator/paths.js +23 -1
  214. package/dist/indicator/paths.js.map +1 -1
  215. package/dist/modal/index.js +96 -68
  216. package/dist/modal/index.js.map +1 -1
  217. package/dist/navigation/index.js +8 -5
  218. package/dist/navigation/index.js.map +1 -1
  219. package/dist/number/keyboard.js +16 -0
  220. package/dist/number/keyboard.js.map +1 -0
  221. package/dist/overlay/anchored.js +68 -38
  222. package/dist/overlay/anchored.js.map +1 -1
  223. package/dist/overlay/keyboard.js +57 -0
  224. package/dist/overlay/keyboard.js.map +1 -0
  225. package/dist/overlay/panel.js +173 -19
  226. package/dist/overlay/panel.js.map +1 -1
  227. package/dist/overlay/placement.js +16 -2
  228. package/dist/overlay/placement.js.map +1 -1
  229. package/dist/picker/index.js +322 -0
  230. package/dist/picker/index.js.map +1 -0
  231. package/dist/press/index.d.ts +2 -0
  232. package/dist/press/index.js +102 -100
  233. package/dist/press/index.js.map +1 -1
  234. package/dist/row/index.js +77 -69
  235. package/dist/row/index.js.map +1 -1
  236. package/dist/row/styles.js +13 -2
  237. package/dist/row/styles.js.map +1 -1
  238. package/dist/segments/field.js +277 -0
  239. package/dist/segments/field.js.map +1 -0
  240. package/dist/segments/index.js +574 -0
  241. package/dist/segments/index.js.map +1 -0
  242. package/dist/segments/styles.js +24 -0
  243. package/dist/segments/styles.js.map +1 -0
  244. package/dist/separator/index.js +7 -0
  245. package/dist/separator/index.js.map +1 -0
  246. package/dist/slider/index.js +145 -0
  247. package/dist/slider/index.js.map +1 -0
  248. package/dist/swatch/index.js +56 -0
  249. package/dist/swatch/index.js.map +1 -0
  250. package/dist/typography/size.js +14 -0
  251. package/dist/typography/size.js.map +1 -0
  252. package/package.json +11 -2
  253. package/dist/badge/styles.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","AccessibilityActionEvent","LayoutChangeEvent","StyleProp","ViewStyle","Color","ColorChannel","ColorSpace","ColorAreaState","useId","useState","I18nManager","StyleSheet","View","Gesture","GestureDetector","GestureHandlerRootView","Svg","Defs","LinearGradient","Mask","Rect","Stop","parseColor","useColorAreaState","ColorThumb","HIDDEN","useLocaleOf","ADJUSTABLE","percentOf","usePickedColor","useTheme","composeStyles","themedStyles","ColorAreaProps","colorSpace","defaultValue","isDisabled","onChange","value","onChangeEnd","ref","style","testID","xChannel","yChannel","Fade","color","offset","opacity","Layer","axis","rising","stops","SLOP","TARGET","HUES","BLACK","WHITE","styles","create","half","flexGrow","root","aspectRatio","boxSizing","width","seat","alignItems","flexDirection","height","justifyContent","marginStart","marginTop","position","thumb","pointerEvents","absoluteFill","stylesOf","radii","stateLayerOpacity","disabled","disabledContent","plane","borderRadius","sm","overflow","adjustOf","state","event","actionName","nativeEvent","up","setDragging","incrementX","xChannelStep","decrementX","incrementY","yChannelStep","decrementY","ColorArea","t0","$","_c","ariaLabel","t1","undefined","own","locale","picked","t2","t3","Symbol","for","size","setSize","t4","gesture","usePlaneGesture","x","y","getThumbPosition","channels","T0","t5","T1","T2","T3","t7","sizeTo","t9","t10","layersOf","t11","t12","T4","t13","start","top","t14","t15","t16","getDisplayColor","t17","isDragging","t18","t19","t8","t20","t21","t6","t22","cssOf","toFormat","withChannelValue","toString","fadeOf","Half","channel","label","getChannelName","name","getChannelRange","maxValue","minValue","getChannelValue","formatChannelValue","getColorName","zChannel","space","getColorSpace","zValue","corner","xEnd","yEnd","rowOf","base","layers","getColorChannels","push","stopsOf","Plane","id","reversed","isRTL","some","_temp","layer_0","index","layer","map","_temp2","layer_1","index_0","stop","end","set","layout","hue","length","setFrom","across","setColorFromPoint","pan","Pan","minDistance","enabled","runOnJS","onStart","onUpdate","onFinalize","tap","Tap","maxDistance","onEnd","success","Race","withTestId","_c"],"sources":["../../../src/components/color-area/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type {\n AccessibilityActionEvent,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native'\nimport type { Color, ColorChannel, ColorSpace } from 'react-stately'\nimport type { ColorAreaState } from 'react-stately/useColorAreaState'\n\nimport { useId, useState } from 'react'\nimport { I18nManager, StyleSheet, View } from 'react-native'\nimport {\n Gesture,\n GestureDetector,\n GestureHandlerRootView,\n} from 'react-native-gesture-handler'\nimport Svg, { Defs, LinearGradient, Mask, Rect, Stop } from 'react-native-svg'\nimport { parseColor } from 'react-stately'\nimport { useColorAreaState } from 'react-stately/useColorAreaState'\n\nimport { ColorThumb } from '../../color-thumb'\nimport { HIDDEN } from '../../glyphs/hidden'\nimport { useLocaleOf } from '../../i18n/provider'\nimport { ADJUSTABLE, percentOf } from '../../slider'\nimport { usePickedColor } from '../../swatch'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// kanso-ui's ColorArea: two channels of a colour as a plane, one along each\n// axis, with ColorSlider's ringed handle where they meet. No Material Design\n// page draws one, so what is here is web's own, each choice for web's reason.\n//\n// **It is square, and takes the width it is given.** A plane has no natural\n// size, and one that was not square would give its two channels unequal\n// travel, so the same drag would move one further than the other. `style`\n// sets its width, and its height follows.\n//\n// **Its corner is the small one, and it carries no chequer.** The plane is\n// opaque across the whole of it, so nothing behind it is ever seen, which is\n// why web took its chequer out.\n//\n// **The plane is React Aria's, layer for layer**, from its\n// useColorAreaGradient, in react-native-svg rather than CSS:\n//\n// - In HSL and HSB it is a gradient along each axis laid one over the other,\n// over a solid hue when hue is the channel neither axis carries. A CSS\n// gradient into `transparent` fades the colour itself out, and an SVG one\n// fades towards whatever colour the transparent stop names, so each fade\n// here keeps its colour and drops its opacity, and lightness's black,\n// transparent and white is two fades meeting at the middle.\n// - In RGB React Aria screens one gradient per channel over a solid third,\n// which blends as no SVG paint does. The plane those layers make is the\n// colour with each axis's channel running from its least to its most, which\n// moves along each axis alone, so it is drawn as the row along its bottom\n// with the row along its top over it, faded in from the bottom.\n//\n// **A channel missing from the value's space throws, and alpha is a channel\n// here only in RGB, as on web.** A hex or `rgb()` value is read as RGB, which\n// has no saturation, so `xChannel=\"saturation\"` against one throws rather\n// than converting; `colorSpace` converts it. Asked for alpha in HSL or HSB,\n// React Aria draws the two channels alpha is not instead and says nothing,\n// and so does this. In RGB the handle moves alpha, and the plane still does\n// not thin, since React Aria's layers are opaque.\n//\n// **A screen reader adjusts each channel apart.** React Aria gives the plane\n// a hidden range input per channel, and an element here adjusts in one\n// direction only, so the handle holds two adjustable halves, the start one\n// for the horizontal channel and the end one for the vertical, each named by\n// its channel, after `aria-label` when there is one. Each says its channel's\n// value and the colour's name, \"100%, light vibrant cyan blue\", in the\n// provider's locale. A press on the plane moves the handle there and a drag\n// carries it, setting both channels together, and `onChangeEnd` comes once\n// as it lets go. Disabled, the plane and the handle fade and take nothing.\n//\n// Under a right-to-left layout the horizontal channel runs from the right,\n// as presses are read.\n\ntype ColorAreaProps = {\n /**\n * What the plane is for, which a screen reader hears before each channel's\n * name.\n */\n readonly 'aria-label'?: string\n /**\n * The space the channels are read in, when the value is given in another:\n * a hex or `rgb()` value has no saturation until it is read as `hsl` or\n * `hsb`.\n */\n readonly colorSpace?: ColorSpace\n /**\n * The colour the plane starts at, when it keeps its own: a CSS colour\n * string, or a `Color` from `parseColor`. White when neither this nor\n * `value` is given.\n */\n readonly defaultValue?: Color | string\n /**\n * Draws the plane disabled, and takes no presses, drags or screen reader\n * actions.\n * @default false\n */\n readonly isDisabled?: boolean\n /** Called with the colour as either channel moves. */\n readonly onChange?: (value: Color) => void\n /** Called with the colour once a drag, a press or an action has ended. */\n readonly onChangeEnd?: (value: Color) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n /** Lands on the square, and sets its width; its height follows. */\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /** The colour, for a call site holding it itself with `onChange`. */\n readonly value?: Color | string\n /**\n * The channel along the horizontal axis. The first of the space's\n * channels the vertical one is not, when left out.\n */\n readonly xChannel?: ColorChannel\n /**\n * The channel up the vertical axis. The first of the space's channels the\n * horizontal one is not, when left out.\n */\n readonly yChannel?: ColorChannel\n}\n\ntype Fade = {\n readonly color: string\n readonly offset: number\n readonly opacity: number\n}\n\n// A layer of the plane, bottom first: a fill, or a gradient along one axis,\n// which a rising one shows only as far up the plane as it has faded in.\ntype Layer =\n | {\n readonly axis: 'x' | 'y'\n readonly rising?: boolean\n readonly stops: readonly Fade[]\n }\n | { readonly color: string }\n\n// How far a press moves before it is a drag rather than a tap: Gesture\n// Handler's own default distance for a pan, as Slider's.\nconst SLOP = 10\n\n// The frame a screen reader outlines the handle in, the sliders page's 48dp\n// target, centred on the handle.\nconst TARGET = 48\n\n// The hues React Aria runs a hue axis through.\nconst HUES = [0, 60, 120, 180, 240, 300, 360]\n\nconst BLACK = 'rgb(0, 0, 0)'\nconst WHITE = 'rgb(255, 255, 255)'\n\nconst styles = StyleSheet.create({\n // One adjustable half of the handle's frame.\n half: {\n flexGrow: 1,\n },\n root: {\n aspectRatio: 1,\n boxSizing: 'border-box',\n width: '100%',\n },\n // Where the handle sits: the frame centred on the value, with the handle\n // centred in it and the two halves side by side across it.\n seat: {\n alignItems: 'center',\n flexDirection: 'row',\n height: TARGET,\n justifyContent: 'center',\n marginStart: -TARGET / 2,\n marginTop: -TARGET / 2,\n position: 'absolute',\n width: TARGET,\n },\n // The handle, over both halves and taking none of their presses.\n thumb: {\n alignItems: 'center',\n justifyContent: 'center',\n pointerEvents: 'none',\n ...StyleSheet.absoluteFill,\n },\n})\n\nconst stylesOf = themedStyles(({ radii, stateLayerOpacity }) =>\n StyleSheet.create({\n disabled: {\n opacity: stateLayerOpacity.disabledContent,\n },\n // The plane, clipped to the corner while the handle is free to sit over\n // its edge.\n plane: {\n borderRadius: radii.sm,\n overflow: 'hidden',\n ...StyleSheet.absoluteFill,\n },\n }),\n)\n\n// Runs the step a screen reader asks a channel for, as a move that starts\n// and ends at once, so `onChangeEnd` comes once as it does for a key on web.\nfunction adjustOf(state: ColorAreaState, axis: 'x' | 'y', isDisabled: boolean) {\n return (event: AccessibilityActionEvent) => {\n const { actionName } = event.nativeEvent\n if (\n isDisabled ||\n (actionName !== 'increment' && actionName !== 'decrement')\n ) {\n return\n }\n const up = actionName === 'increment'\n state.setDragging(true)\n if (axis === 'x') {\n if (up) {\n state.incrementX(state.xChannelStep)\n } else {\n state.decrementX(state.xChannelStep)\n }\n } else if (up) {\n state.incrementY(state.yChannelStep)\n } else {\n state.decrementY(state.yChannelStep)\n }\n state.setDragging(false)\n }\n}\n\n/**\n * Two channels of a colour as a plane, with a handle where they meet. Its\n * state is React Stately's, as web's is: pass `value` with `onChange` to\n * control it, or `defaultValue`, as a CSS colour string or a `Color` from\n * `parseColor`, which this package re-exports.\n *\n * ```tsx\n * <ColorArea\n * defaultValue=\"hsl(200, 100%, 50%)\"\n * xChannel=\"saturation\"\n * yChannel=\"lightness\"\n * />\n * ```\n *\n * **`xChannel` and `yChannel` have to name channels the value's own space\n * has.** A hex or `rgb()` value is read as RGB, which has no saturation, so\n * naming one against it throws rather than converting. Pass `colorSpace` to\n * convert it, or give the value in the space you mean to work in.\n *\n * **`alpha` is a channel here only in RGB.** Asked for it in HSL, the plane\n * quietly draws saturation and lightness instead, as React Aria's does.\n *\n * A press on the plane moves the handle there, and a drag carries it. A\n * screen reader adjusts each channel apart, through two halves of the\n * handle, each named by its channel. `style`, `ref` and `testID` land on the\n * square, whose width `style` sets. With a `testID`, the drag and the press\n * are registered with Gesture Handler as `<testID>-pan` and `<testID>-tap`,\n * which its `getByGestureTestId` finds in a test.\n *\n * Inside a `ColorPicker` it takes the picker's colour where it is given no\n * `value`, and reports a change to the picker before its own `onChange`.\n */\nfunction ColorArea({\n 'aria-label': ariaLabel,\n colorSpace,\n defaultValue,\n isDisabled = false,\n onChange,\n onChangeEnd,\n ref,\n style,\n testID,\n value,\n xChannel,\n yChannel,\n}: ColorAreaProps) {\n const own = stylesOf(useTheme())\n const locale = useLocaleOf(undefined)\n const picked = usePickedColor(value, onChange)\n const state = useColorAreaState({\n colorSpace,\n defaultValue,\n isDisabled,\n onChange: picked.onChange,\n onChangeEnd,\n value: picked.value,\n xChannel,\n yChannel,\n })\n const [size, setSize] = useState({ height: 0, width: 0 })\n const gesture = usePlaneGesture({ isDisabled, size, state, testID })\n const { x, y } = state.getThumbPosition()\n const { channels } = state\n\n return (\n <View\n ref={ref}\n style={composeStyles<ViewStyle>(\n styles.root,\n isDisabled ? own.disabled : undefined,\n style,\n )}\n testID={testID}\n >\n <GestureHandlerRootView style={StyleSheet.absoluteFill}>\n <GestureDetector gesture={gesture}>\n <View onLayout={sizeTo(setSize)} style={StyleSheet.absoluteFill}>\n <View style={own.plane}>\n <Plane layers={layersOf(state)} />\n </View>\n <View\n style={composeStyles<ViewStyle>(styles.seat, {\n start: percentOf(x),\n top: percentOf(y),\n })}\n >\n <Half\n axis=\"x\"\n channel={channels.xChannel}\n isDisabled={isDisabled}\n label={ariaLabel}\n locale={locale}\n state={state}\n />\n <Half\n axis=\"y\"\n channel={channels.yChannel}\n isDisabled={isDisabled}\n label={ariaLabel}\n locale={locale}\n state={state}\n />\n <View style={styles.thumb}>\n <ColorThumb\n color={state.getDisplayColor()}\n dragging={state.isDragging}\n />\n </View>\n </View>\n </View>\n </GestureDetector>\n </GestureHandlerRootView>\n </View>\n )\n}\n\n// A colour drawn as a stop: opaque, since a stop's opacity is its own.\nfunction cssOf(color: Color) {\n return color.toFormat('rgb').withChannelValue('alpha', 1).toString('css')\n}\n\n// A colour fading out along an axis, keeping its colour as it goes.\nfunction fadeOf(color: string): Fade[] {\n return [\n { color, offset: 0, opacity: 1 },\n { color, offset: 1, opacity: 0 },\n ]\n}\n\n// One channel's half of the handle's frame, which a screen reader adjusts.\nfunction Half({\n axis,\n channel,\n isDisabled,\n label,\n locale,\n state,\n}: {\n readonly axis: 'x' | 'y'\n readonly channel: ColorChannel\n readonly isDisabled: boolean\n readonly label: string | undefined\n readonly locale: string\n readonly state: ColorAreaState\n}) {\n const color = state.value\n const name = color.getChannelName(channel, locale)\n const { maxValue, minValue } = color.getChannelRange(channel)\n\n return (\n <View\n accessibilityActions={ADJUSTABLE}\n accessible\n aria-disabled={isDisabled}\n aria-label={label === undefined ? name : `${label}, ${name}`}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={color.getChannelValue(channel)}\n aria-valuetext={`${color.formatChannelValue(channel, locale)}, ${state\n .getDisplayColor()\n .getColorName(locale)}`}\n onAccessibilityAction={adjustOf(state, axis, isDisabled)}\n role=\"slider\"\n style={styles.half}\n />\n )\n}\n\n// React Aria's layers for the plane, from its useColorAreaGradient, bottom\n// first rather than CSS's top first.\nfunction layersOf(state: ColorAreaState): Layer[] {\n const { xChannel, yChannel, zChannel } = state.channels\n const space = state.value.getColorSpace()\n const zValue = state.value.getChannelValue(zChannel)\n\n if (space === 'rgb') {\n // The colour with the third channel's value and each axis's channel at\n // either end, and opaque, as the screened layers come out.\n const corner = (\n xEnd: 'maxValue' | 'minValue',\n yEnd: 'maxValue' | 'minValue',\n ) =>\n cssOf(\n parseColor(BLACK)\n .withChannelValue(zChannel, zValue)\n .withChannelValue(\n xChannel,\n state.value.getChannelRange(xChannel)[xEnd],\n )\n .withChannelValue(\n yChannel,\n state.value.getChannelRange(yChannel)[yEnd],\n ),\n )\n return [\n {\n axis: 'x',\n stops: rowOf(\n corner('minValue', 'minValue'),\n corner('maxValue', 'minValue'),\n ),\n },\n {\n axis: 'x',\n rising: true,\n stops: rowOf(\n corner('minValue', 'maxValue'),\n corner('maxValue', 'maxValue'),\n ),\n },\n ]\n }\n\n const base = parseColor(\n space === 'hsl' ? 'hsl(0, 100%, 50%)' : 'hsb(0, 100%, 100%)',\n ).withChannelValue(zChannel, zValue)\n const layers: Layer[] = zChannel === 'hue' ? [{ color: cssOf(base) }] : []\n for (const channel of state.value.getColorChannels()) {\n if (channel !== zChannel) {\n layers.push({\n axis: channel === xChannel ? 'x' : 'y',\n stops: stopsOf(channel, base),\n })\n }\n }\n return layers\n}\n\n// The plane's layers, painted bottom first, each filling the square.\nfunction Plane({ layers }: { readonly layers: readonly Layer[] }) {\n // A gradient is found by its id, which has to be unique in the page under\n // React Native Web, as the chequer's pattern is.\n const id = `plane${useId()}`\n const reversed = I18nManager.isRTL\n\n return (\n <Svg {...HIDDEN} height=\"100%\" style={StyleSheet.absoluteFill} width=\"100%\">\n <Defs>\n {layers.some((layer) => 'rising' in layer && layer.rising) ? (\n <>\n {/* How far up the plane a rising layer shows: none of it along the\n bottom and all of it along the top, as a mask's luminance. */}\n <LinearGradient id={`${id}-rise`} x1={0} x2={0} y1={1} y2={0}>\n <Stop offset={0} stopColor={BLACK} />\n <Stop offset={1} stopColor={WHITE} />\n </LinearGradient>\n <Mask id={`${id}-mask`}>\n <Rect fill={`url(#${id}-rise)`} height=\"100%\" width=\"100%\" />\n </Mask>\n </>\n ) : null}\n {layers.map((layer, index) =>\n 'stops' in layer ? (\n <LinearGradient\n id={`${id}-${index}`}\n // oxlint-disable-next-line react/no-array-index-key -- a layer's place is its identity\n key={index}\n x1={layer.axis === 'x' && reversed ? 1 : 0}\n x2={layer.axis === 'y' || reversed ? 0 : 1}\n y1={layer.axis === 'y' ? 1 : 0}\n y2={0}\n >\n {layer.stops.map((stop) => (\n <Stop\n key={`${stop.offset}${stop.color}`}\n offset={stop.offset}\n stopColor={stop.color}\n stopOpacity={stop.opacity}\n />\n ))}\n </LinearGradient>\n ) : null,\n )}\n </Defs>\n {layers.map((layer, index) => (\n <Rect\n fill={'stops' in layer ? `url(#${id}-${index})` : layer.color}\n height=\"100%\"\n // oxlint-disable-next-line react/no-array-index-key -- as above\n key={index}\n mask={\n 'rising' in layer && layer.rising ? `url(#${id}-mask)` : undefined\n }\n width=\"100%\"\n />\n ))}\n </Svg>\n )\n}\n\nfunction rowOf(start: string, end: string): Fade[] {\n return [\n { color: start, offset: 0, opacity: 1 },\n { color: end, offset: 1, opacity: 1 },\n ]\n}\n\n// Keeps the plane's size as it is laid out.\nfunction sizeTo(set: (size: { height: number; width: number }) => void) {\n return ({ nativeEvent }: LayoutChangeEvent) => {\n set({ height: nativeEvent.layout.height, width: nativeEvent.layout.width })\n }\n}\n\n// A channel's gradient in HSL or HSB, as React Aria writes each.\nfunction stopsOf(channel: ColorChannel, base: Color): Fade[] {\n if (channel === 'hue') {\n return HUES.map((hue, index) => ({\n color: cssOf(base.withChannelValue('hue', hue)),\n offset: index / (HUES.length - 1),\n opacity: 1,\n }))\n }\n if (channel === 'saturation') {\n return fadeOf(cssOf(base.withChannelValue('saturation', 0)))\n }\n if (channel === 'lightness') {\n // Black, transparent and white: two fades meeting at the middle.\n return [\n { color: BLACK, offset: 0, opacity: 1 },\n { color: BLACK, offset: 0.5, opacity: 0 },\n { color: WHITE, offset: 0.5, opacity: 0 },\n { color: WHITE, offset: 1, opacity: 1 },\n ]\n }\n // Brightness, the one channel left in HSB.\n return fadeOf(BLACK)\n}\n\n/**\n * The plane's pan and tap. Each reads a press's place as a fraction of the\n * way across the plane, from the start, and down it, and sets both channels\n * there. The pan holds the plane as dragged until it lets go, which is what\n * lifts the handle and what `onChangeEnd` waits for; the tap moves it and\n * lets it go at once.\n *\n * Both run on the JavaScript thread, since every move sets React state.\n */\nfunction usePlaneGesture({\n isDisabled,\n size,\n state,\n testID,\n}: {\n readonly isDisabled: boolean\n readonly size: { readonly height: number; readonly width: number }\n readonly state: ColorAreaState\n readonly testID: string | undefined\n}) {\n // Sets both channels from a press, once the plane has a size to read it\n // against. A press past an edge reads past it, which React Stately clamps.\n function setFrom(x: number, y: number) {\n if (size.width <= 0 || size.height <= 0) {\n return\n }\n const across = x / size.width\n state.setColorFromPoint(\n I18nManager.isRTL ? 1 - across : across,\n y / size.height,\n )\n }\n\n // Gesture Handler 3 deprecates these builders for hooks that version 2 does\n // not have, and the peer range admits both, so the builders stay while it\n // 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 .minDistance(SLOP)\n .enabled(!isDisabled)\n .runOnJS(true)\n .onStart(({ x, y }) => {\n state.setDragging(true)\n setFrom(x, y)\n })\n .onUpdate(({ x, y }) => {\n setFrom(x, y)\n })\n // A pan the tap beat never started, and letting go of a plane nothing\n // holds ends nothing, so this needs no guard.\n .onFinalize(() => {\n state.setDragging(false)\n })\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n const tap = Gesture.Tap()\n .maxDistance(SLOP)\n .enabled(!isDisabled)\n .runOnJS(true)\n .onEnd(({ x, y }, success) => {\n if (success) {\n state.setDragging(true)\n setFrom(x, y)\n state.setDragging(false)\n }\n })\n\n // oxlint-disable-next-line react/capitalized-calls, typescript/no-deprecated -- as above\n return Gesture.Race(\n testID === undefined ? pan : pan.withTestId(`${testID}-pan`),\n testID === undefined ? tap : tap.withTestId(`${testID}-tap`),\n )\n}\n\nexport { ColorArea }\nexport type { ColorAreaProps }\n"],"mappings":";;;;;;;;;;;;;;;;AA8IA,MAAMuD,OAAO;AAIb,MAAMC,SAAS;AAGf,MAAMC,OAAO;CAAC;CAAG;CAAI;CAAK;CAAK;CAAK;CAAK;AAAG;AAE5C,MAAMC,QAAQ;AACd,MAAMC,QAAQ;AAEd,MAAMC,SAAS/C,WAAWgD,OAAO;CAE/BC,MAAM,EACJC,UAAU,EACZ;CACAC,MAAM;EACJC,aAAa;EACbC,WAAW;EACXC,OAAO;CACT;CAGAC,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,QAAQf;EACRgB,gBAAgB;EAChBC,aAAa;EACbC,WAAW;EACXC,UAAU;EACVR,OAAOX;CACT;CAEAoB,OAAO;EACLP,YAAY;EACZG,gBAAgB;EAChBK,eAAe;EACf,GAAGhE,WAAWiE;CAChB;AACF,CAAC;AAED,MAAMC,WAAW7C,cAAc,EAAE8C,OAAOC,wBACtCpE,WAAWgD,OAAO;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AI;GACtB2G,QAAQjF,GAAGC,CAAC;GACZhC,MAAMK,YAAY,KAAK;EACzB;CACF,CAAC;CAGH,OAAO/E,QAAQ0M,KACb7K,WAAW+D,KAAAA,IAAYiG,MAAMA,IAAIc,WAAW,GAAG9K,OAAM,KAAM,GAC3DA,WAAW+D,KAAAA,IAAYyG,MAAMA,IAAIM,WAAW,GAAG9K,OAAM,KAAM,CAC7D;AACF"}
@@ -0,0 +1,144 @@
1
+ import { ValidationResult } from "../../form/index.js";
2
+ import { FieldVariant } from "../../field/index.js";
3
+ import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
4
+ import { ComponentRef, ReactNode, Ref } from "react";
5
+ import { Color, ColorChannel, ColorSpace } from "react-stately";
6
+ //#region src/components/color-field/index.d.ts
7
+ type ColorFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'autoCapitalize' | 'autoComplete' | 'autoCorrect' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'inputMode' | 'keyboardType' | 'maxLength' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholder' | 'placeholderTextColor' | 'readOnly' | 'selectionColor' | 'spellCheck' | 'style' | 'underlineColorAndroid' | 'value'> & {
8
+ /**
9
+ * The one channel the field holds, as a number in that channel's format,
10
+ * in place of the whole colour as hex.
11
+ */
12
+ readonly channel?: ColorChannel;
13
+ /**
14
+ * The space `channel` is read in, the value converted into it first, as on
15
+ * `ColorSlider`. Left out, `channel` is one of the value's own space.
16
+ */
17
+ readonly colorSpace?: ColorSpace;
18
+ /**
19
+ * The colour the field opens with, when it keeps its own: a CSS colour
20
+ * string, or a `Color` from `parseColor`, which this package re-exports.
21
+ * `null` opens it empty.
22
+ */
23
+ readonly defaultValue?: Color | null | string;
24
+ /**
25
+ * A hint shown under the field. Replaced by `error` when there is one, so
26
+ * the two never stack.
27
+ */
28
+ readonly description?: string;
29
+ /**
30
+ * The problem with the current value, in words. Its presence is what puts
31
+ * the field in its error state: the message, the error colours, and the
32
+ * invalid state a screen reader reads all follow from it. The line under
33
+ * the field arrives with the message, so the field grows when this does,
34
+ * unless it is inside a `Form`, which keeps the line drawn. It wins over
35
+ * what `validate` and the form say, and holds a `native` form back.
36
+ */
37
+ readonly error?: string;
38
+ /**
39
+ * Whether the label sits in the empty box and floats to the top once the
40
+ * field is focused or holds a value, as the text fields page draws it.
41
+ * `false` keeps it small at the top in every state.
42
+ * @default true
43
+ */
44
+ readonly floatingLabel?: boolean;
45
+ /**
46
+ * A ref to the field's own `TextInput`, which is what a call site moves
47
+ * focus to, after a server's error, say. `ref` is the field as a whole.
48
+ */
49
+ readonly inputRef?: Ref<ComponentRef<typeof TextInput>>;
50
+ /**
51
+ * Draws the field disabled: it takes no focus and no input.
52
+ * @default false
53
+ */
54
+ readonly isDisabled?: boolean;
55
+ /**
56
+ * Shows the value and takes focus, but takes no input.
57
+ * @default false
58
+ */
59
+ readonly isReadOnly?: boolean;
60
+ /**
61
+ * Marks the label with an asterisk, as the text fields page marks a field
62
+ * that must be filled.
63
+ * @default false
64
+ */
65
+ readonly isRequired?: boolean;
66
+ /**
67
+ * What the field is for, and the name a screen reader reads for it.
68
+ * Required, since a field with no label is a box nobody can name.
69
+ */
70
+ readonly label: string;
71
+ /**
72
+ * An icon at the start of the box, before the label and the value, in the
73
+ * page's 24dp slot. A `ColorSwatch` there shows the value.
74
+ */
75
+ readonly leadingIcon?: ReactNode;
76
+ /**
77
+ * The name the value is submitted under by the `Form` around the field,
78
+ * and the key its `validationErrors` reach the field by. The form submits
79
+ * what web's does: the hex the field shows, or the channel's number written
80
+ * out, such as `0.6`, and `''` for an empty field.
81
+ */
82
+ readonly name?: string;
83
+ /**
84
+ * Called with the colour once it is read from what was typed: for a
85
+ * channel, the value with that channel changed. `null` is an empty field.
86
+ */
87
+ readonly onChange?: (value: Color | null) => void;
88
+ readonly ref?: Ref<ComponentRef<typeof View>>;
89
+ /** Positions and sizes the field as a whole. */
90
+ readonly style?: StyleProp<ViewStyle>;
91
+ /**
92
+ * An icon at the end of the box, after the value, in the page's 24dp slot:
93
+ * the muted role, and the error role while the field has an error.
94
+ */
95
+ readonly trailingIcon?: ReactNode;
96
+ /**
97
+ * Checks the colour, `null` for an empty field, and returns its problem in
98
+ * words, or several, where there is one, and `true`, `null` or `undefined`
99
+ * where there is none. Under the default `aria` validation the error shows
100
+ * as the value changes; inside a `native` form it shows once a submission
101
+ * is tried, or once the field loses focus after an edit, and holds the form
102
+ * back.
103
+ */
104
+ readonly validate?: (value: Color | null) => ValidationResult;
105
+ /**
106
+ * The colour, when the call site keeps it: a CSS colour string or a
107
+ * `Color`. `null` is an empty field.
108
+ */
109
+ readonly value?: Color | null | string;
110
+ /**
111
+ * The filled box, or the outlined one: no fill, an outline that thickens
112
+ * and takes the primary role while focused, and the label cutting it once
113
+ * it floats, the text fields page's two fields.
114
+ * @default 'filled'
115
+ */
116
+ readonly variant?: FieldVariant;
117
+ };
118
+ /**
119
+ * A colour typed into a field, the text fields page's filled or outlined
120
+ * field. Pass `value` with `onChange` to control it, or `defaultValue` to
121
+ * let it keep its own, as a CSS colour string or a `Color` from
122
+ * `parseColor`, which this package re-exports; `onChange` is handed the
123
+ * `Color`, `null` for an empty field.
124
+ *
125
+ * ```tsx
126
+ * <ColorField defaultValue="#6750A4" label="Label" />
127
+ * ```
128
+ *
129
+ * Without `channel` the field holds the whole colour as hex and reads what
130
+ * is typed once it loses focus; with one it holds that channel alone as a
131
+ * number. `colorSpace` decides which space a channel belongs to, the same as
132
+ * on `ColorSlider`.
133
+ *
134
+ * React Native's own `TextInput` props, the return key among them, reach the
135
+ * control; `style` and `ref` are the field as a whole, and `inputRef` the
136
+ * control.
137
+ *
138
+ * Inside a `ColorPicker` it takes the picker's colour where it is given no
139
+ * `value`, and reports a change to the picker before its own `onChange`.
140
+ */
141
+ declare function ColorField({ channel, onChange, value, ...props }: ColorFieldProps): import("react").JSX.Element;
142
+ //#endregion
143
+ export { ColorField, type ColorFieldProps };
144
+ //# sourceMappingURL=index.d.ts.map