@kanso-labs/react-native-kanso-ui 0.9.0 → 0.11.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 (217) 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/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1358 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/chip/index.d.ts +4 -1
  42. package/dist/components/chip/index.js +229 -161
  43. package/dist/components/chip/index.js.map +1 -1
  44. package/dist/components/color-area/index.d.ts +85 -0
  45. package/dist/components/color-area/index.js +630 -0
  46. package/dist/components/color-area/index.js.map +1 -0
  47. package/dist/components/color-field/index.d.ts +144 -0
  48. package/dist/components/color-field/index.js +516 -0
  49. package/dist/components/color-field/index.js.map +1 -0
  50. package/dist/components/color-picker/index.d.ts +74 -0
  51. package/dist/components/color-picker/index.js +317 -0
  52. package/dist/components/color-picker/index.js.map +1 -0
  53. package/dist/components/color-slider/index.d.ts +82 -0
  54. package/dist/components/color-slider/index.js +456 -0
  55. package/dist/components/color-slider/index.js.map +1 -0
  56. package/dist/components/color-swatch/index.d.ts +46 -0
  57. package/dist/components/color-swatch/index.js +127 -0
  58. package/dist/components/color-swatch/index.js.map +1 -0
  59. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  60. package/dist/components/color-swatch-picker/index.js +287 -0
  61. package/dist/components/color-swatch-picker/index.js.map +1 -0
  62. package/dist/components/color-wheel/index.d.ts +71 -0
  63. package/dist/components/color-wheel/index.js +407 -0
  64. package/dist/components/color-wheel/index.js.map +1 -0
  65. package/dist/components/combo-box/index.d.ts +193 -0
  66. package/dist/components/combo-box/index.js +616 -0
  67. package/dist/components/combo-box/index.js.map +1 -0
  68. package/dist/components/date-field/index.d.ts +120 -0
  69. package/dist/components/date-field/index.js +111 -0
  70. package/dist/components/date-field/index.js.map +1 -0
  71. package/dist/components/date-picker/index.d.ts +130 -0
  72. package/dist/components/date-picker/index.js +310 -0
  73. package/dist/components/date-picker/index.js.map +1 -0
  74. package/dist/components/date-range-picker/index.d.ts +139 -0
  75. package/dist/components/date-range-picker/index.js +421 -0
  76. package/dist/components/date-range-picker/index.js.map +1 -0
  77. package/dist/components/dialog/index.d.ts +5 -5
  78. package/dist/components/dialog/index.js +5 -5
  79. package/dist/components/dialog/index.js.map +1 -1
  80. package/dist/components/disclosure/index.d.ts +94 -0
  81. package/dist/components/disclosure/index.js +365 -0
  82. package/dist/components/disclosure/index.js.map +1 -0
  83. package/dist/components/disclosure-group/index.d.ts +61 -0
  84. package/dist/components/disclosure-group/index.js +100 -0
  85. package/dist/components/disclosure-group/index.js.map +1 -0
  86. package/dist/components/drop-zone/index.d.ts +113 -0
  87. package/dist/components/drop-zone/index.js +304 -0
  88. package/dist/components/drop-zone/index.js.map +1 -0
  89. package/dist/components/fab/index.d.ts +1 -1
  90. package/dist/components/fab/index.js +91 -76
  91. package/dist/components/fab/index.js.map +1 -1
  92. package/dist/components/form/index.d.ts +3 -2
  93. package/dist/components/form/index.js.map +1 -1
  94. package/dist/components/icon-button/index.d.ts +4 -2
  95. package/dist/components/icon-button/index.js +204 -171
  96. package/dist/components/icon-button/index.js.map +1 -1
  97. package/dist/components/list/index.d.ts +15 -158
  98. package/dist/components/list/index.js +21 -1047
  99. package/dist/components/list/index.js.map +1 -1
  100. package/dist/components/list-box/index.d.ts +73 -0
  101. package/dist/components/list-box/index.js +82 -0
  102. package/dist/components/list-box/index.js.map +1 -0
  103. package/dist/components/loading-indicator/index.d.ts +32 -0
  104. package/dist/components/loading-indicator/index.js +174 -0
  105. package/dist/components/loading-indicator/index.js.map +1 -0
  106. package/dist/components/menu/index.d.ts +3 -3
  107. package/dist/components/menu/index.js +3 -3
  108. package/dist/components/menu/index.js.map +1 -1
  109. package/dist/components/navigation-tree/index.d.ts +117 -0
  110. package/dist/components/navigation-tree/index.js +135 -0
  111. package/dist/components/navigation-tree/index.js.map +1 -0
  112. package/dist/components/number-field/index.js +132 -143
  113. package/dist/components/number-field/index.js.map +1 -1
  114. package/dist/components/popover/index.d.ts +2 -2
  115. package/dist/components/popover/index.js +2 -2
  116. package/dist/components/popover/index.js.map +1 -1
  117. package/dist/components/range-calendar/index.d.ts +69 -0
  118. package/dist/components/range-calendar/index.js +144 -0
  119. package/dist/components/range-calendar/index.js.map +1 -0
  120. package/dist/components/search-view/index.d.ts +79 -0
  121. package/dist/components/search-view/index.js +571 -0
  122. package/dist/components/search-view/index.js.map +1 -0
  123. package/dist/components/select/index.d.ts +152 -0
  124. package/dist/components/select/index.js +419 -0
  125. package/dist/components/select/index.js.map +1 -0
  126. package/dist/components/sheet/index.d.ts +16 -7
  127. package/dist/components/sheet/index.js +157 -152
  128. package/dist/components/sheet/index.js.map +1 -1
  129. package/dist/components/slider/index.d.ts +111 -0
  130. package/dist/components/slider/index.js +673 -0
  131. package/dist/components/slider/index.js.map +1 -0
  132. package/dist/components/split-button/index.d.ts +77 -0
  133. package/dist/components/split-button/index.js +354 -0
  134. package/dist/components/split-button/index.js.map +1 -0
  135. package/dist/components/table/index.d.ts +391 -0
  136. package/dist/components/table/index.js +1708 -0
  137. package/dist/components/table/index.js.map +1 -0
  138. package/dist/components/tabs/index.d.ts +196 -0
  139. package/dist/components/tabs/index.js +1137 -0
  140. package/dist/components/tabs/index.js.map +1 -0
  141. package/dist/components/time-field/index.d.ts +43 -0
  142. package/dist/components/time-field/index.js +107 -0
  143. package/dist/components/time-field/index.js.map +1 -0
  144. package/dist/components/time-picker/index.d.ts +65 -0
  145. package/dist/components/time-picker/index.js +1168 -0
  146. package/dist/components/time-picker/index.js.map +1 -0
  147. package/dist/components/token-field/index.d.ts +105 -0
  148. package/dist/components/token-field/index.js +574 -0
  149. package/dist/components/token-field/index.js.map +1 -0
  150. package/dist/components/tooltip/index.d.ts +102 -0
  151. package/dist/components/tooltip/index.js +223 -0
  152. package/dist/components/tooltip/index.js.map +1 -0
  153. package/dist/components/tree/index.d.ts +112 -0
  154. package/dist/components/tree/index.js +157 -0
  155. package/dist/components/tree/index.js.map +1 -0
  156. package/dist/disclosure/chevron.js +75 -0
  157. package/dist/disclosure/chevron.js.map +1 -0
  158. package/dist/disclosure/index.js +7 -0
  159. package/dist/disclosure/index.js.map +1 -0
  160. package/dist/drop/index.d.ts +54 -0
  161. package/dist/drop/index.js +161 -0
  162. package/dist/drop/index.js.map +1 -0
  163. package/dist/field/chevron.js +74 -0
  164. package/dist/field/chevron.js.map +1 -0
  165. package/dist/field/index.d.ts +2 -1
  166. package/dist/field/index.js +359 -154
  167. package/dist/field/index.js.map +1 -1
  168. package/dist/field/styles.js +18 -1
  169. package/dist/field/styles.js.map +1 -1
  170. package/dist/files/index.d.ts +18 -0
  171. package/dist/files/index.js +107 -0
  172. package/dist/files/index.js.map +1 -0
  173. package/dist/form/index.d.ts +5 -2
  174. package/dist/form/index.js +64 -85
  175. package/dist/form/index.js.map +1 -1
  176. package/dist/glyphs/index.js +128 -1
  177. package/dist/glyphs/index.js.map +1 -1
  178. package/dist/i18n/index.js +36 -1
  179. package/dist/i18n/index.js.map +1 -1
  180. package/dist/i18n/messages.js +1734 -34
  181. package/dist/i18n/messages.js.map +1 -1
  182. package/dist/index.d.ts +37 -3
  183. package/dist/index.js +36 -3
  184. package/dist/indicator/paths.js +23 -1
  185. package/dist/indicator/paths.js.map +1 -1
  186. package/dist/modal/index.js +92 -77
  187. package/dist/modal/index.js.map +1 -1
  188. package/dist/number/keyboard.js +16 -0
  189. package/dist/number/keyboard.js.map +1 -0
  190. package/dist/overlay/anchored.js +68 -38
  191. package/dist/overlay/anchored.js.map +1 -1
  192. package/dist/overlay/keyboard.js +57 -0
  193. package/dist/overlay/keyboard.js.map +1 -0
  194. package/dist/overlay/panel.js +173 -19
  195. package/dist/overlay/panel.js.map +1 -1
  196. package/dist/overlay/placement.js +13 -1
  197. package/dist/overlay/placement.js.map +1 -1
  198. package/dist/picker/index.js +322 -0
  199. package/dist/picker/index.js.map +1 -0
  200. package/dist/press/index.d.ts +2 -0
  201. package/dist/press/index.js +102 -100
  202. package/dist/press/index.js.map +1 -1
  203. package/dist/row/index.js +77 -69
  204. package/dist/row/index.js.map +1 -1
  205. package/dist/row/styles.js +13 -2
  206. package/dist/row/styles.js.map +1 -1
  207. package/dist/segments/field.js +277 -0
  208. package/dist/segments/field.js.map +1 -0
  209. package/dist/segments/index.js +574 -0
  210. package/dist/segments/index.js.map +1 -0
  211. package/dist/segments/styles.js +24 -0
  212. package/dist/segments/styles.js.map +1 -0
  213. package/dist/slider/index.js +145 -0
  214. package/dist/slider/index.js.map +1 -0
  215. package/dist/swatch/index.js +56 -0
  216. package/dist/swatch/index.js.map +1 -0
  217. package/package.json +11 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","View","ViewStyle","AnimatedStyle","useState","AnimatedPressable","toggleState","useButtonAction","ChipGlyph","ChipLabel","measureThen","paintOf","targetOf","useEasedColors","shadowsOf","stylesOf","TARGET_SIZE","usePressFeedback","useTheme","composeStyles","ChipActionProps","ChipBaseProps","defaultSelected","isSelected","onChange","variant","Omit","children","elevated","icon","isDisabled","ref","style","ChipFilterProps","ChipProps","ChipVariant","Chip","t0","$","_c","hitSlop","onBlur","onFocus","onHoverIn","onHoverOut","onLayout","onPress","onPressIn","onPressOut","props","t1","t2","t3","undefined","theme","width","setWidth","isToggle","t4","href","type","action","t5","t6","selected","assist","disabled","paint","eased","t7","radii","sm","borderRadius","t8","layer","color","corners","feedback","t9","t10","handlers","t11","t12","t13","t14","container","hovered","ring","pill","t15","glyph","t16","label","t17","_c"],"sources":["../../../src/components/chip/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { useState } from 'react'\n\nimport { AnimatedPressable, toggleState, useButtonAction } from '../../button'\nimport {\n ChipGlyph,\n ChipLabel,\n measureThen,\n paintOf,\n targetOf,\n useEasedColors,\n} from '../../chip'\nimport { shadowsOf, stylesOf } from '../../chip/styles'\nimport { TARGET_SIZE, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// Three of the chips page's four chips, as kanso-ui's Chip draws them. The\n// pill is src/chip's, shared with ChipGroup's chip as on web, which sets out\n// its measurements, colours, motion and target. `variant` picks the chip:\n//\n// - **A filter chip**, the default, is a toggle that reports its state as a\n// toggle Button does, and takes the secondary container pair and the check\n// once selected.\n// - **An assist or suggestion chip** is an action, so nothing is reported as\n// selected and nothing ever is. The two differ in the label alone: on\n// surface on an assist chip, on surface variant on a suggestion chip as on\n// a filter one.\n\n/** An assist or suggestion chip: an action, drawn as a plain button. */\ntype ChipActionProps = ChipBaseProps & {\n readonly defaultSelected?: never\n readonly isSelected?: never\n readonly onChange?: never\n /**\n * `assist` for an action the chip's context suggests, and `suggestion`\n * for one the product generates. Either is an action rather than a\n * selection, so neither is ever selected.\n */\n readonly variant: 'assist' | 'suggestion'\n}\n\ntype ChipBaseProps = Omit<PressableProps, 'children' | 'disabled' | 'style'> & {\n /**\n * The chip's label. Required: the page draws no chip without one, and a\n * chip with none is an empty button to a screen reader.\n */\n readonly children: ReactNode\n /**\n * Raises the chip off the page on a container of its own, at the page's\n * elevation 1, in place of the outline. A selected filter chip keeps the\n * secondary container.\n * @default false\n */\n readonly elevated?: boolean\n /**\n * An icon before the label, in the page's 18dp slot and the primary role,\n * which the slot hands it through `useIconStyle()`. A filter chip's check\n * takes its place while the chip is selected, so the chip keeps its width.\n */\n readonly icon?: ReactNode\n /**\n * Draws the chip disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\n/** A filter chip: a two-state button, the default. */\ntype ChipFilterProps = ChipBaseProps & {\n /**\n * Whether the chip starts selected, when it keeps its own state.\n * @default false\n */\n readonly defaultSelected?: boolean\n /**\n * Whether the chip is selected, when the call site holds the state. Pass\n * it with `onChange`.\n */\n readonly isSelected?: boolean\n /** Called with the new state when the chip is pressed, after `onPress`. */\n readonly onChange?: (isSelected: boolean) => void\n /**\n * A filter chip, a two-state button.\n * @default 'filter'\n */\n readonly variant?: 'filter'\n}\n\ntype ChipProps = ChipActionProps | ChipFilterProps\n\n/** Which of the chips page's chips a Chip is. */\ntype ChipVariant = 'assist' | 'filter' | 'suggestion'\n\n/**\n * A chip. By default a filter chip, which is a two-state button reporting\n * its state as a toggle Button does: pass `isSelected` with `onChange` to\n * control it, or `defaultSelected` to let it keep its own state.\n *\n * ```tsx\n * <Chip defaultSelected>Label</Chip>\n * ```\n *\n * `variant=\"assist\"` and `variant=\"suggestion\"` draw the page's two action\n * chips instead: plain buttons, pressed with `onPress`, never selected.\n *\n * A column stretches a chip across it, as it does any view; a row of chips is\n * a row that wraps. `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction Chip({\n children,\n defaultSelected,\n elevated = false,\n hitSlop,\n icon,\n isDisabled = false,\n isSelected,\n onBlur,\n onChange,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onPress,\n onPressIn,\n onPressOut,\n style,\n variant = 'filter',\n ...props\n}: ChipProps) {\n const theme = useTheme()\n // Until the chip is measured it takes no reach across, rather than one\n // sized for a chip of no width.\n const [width, setWidth] = useState(TARGET_SIZE)\n\n const isToggle = variant === 'filter'\n const action = useButtonAction({\n defaultSelected,\n href: undefined,\n isSelected,\n isToggle,\n onChange,\n onPress,\n type: undefined,\n })\n const paint = paintOf(theme, {\n assist: variant === 'assist',\n disabled: isDisabled,\n elevated,\n selected: action.selected,\n })\n const eased = useEasedColors(paint)\n\n const feedback = usePressFeedback({\n color: paint.layer,\n corners: { borderRadius: theme.radii.sm },\n disabled: isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n })\n\n return (\n <AnimatedPressable\n role=\"button\"\n {...(isToggle ? toggleState(action.selected) : undefined)}\n {...props}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop ?? targetOf(width, theme)}\n onLayout={measureThen(setWidth, onLayout)}\n onPress={action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n stylesOf(theme).pill,\n eased.container,\n elevated && !isDisabled\n ? shadowsOf(theme)[feedback.hovered ? 'elevation2' : 'elevation1']\n : undefined,\n feedback.ring,\n style,\n )}\n >\n {feedback.layer}\n <ChipGlyph color={paint.glyph} icon={icon} selected={action.selected} />\n <ChipLabel color={eased.label}>{children}</ChipLabel>\n </AnimatedPressable>\n )\n}\n\nexport { Chip }\nexport type { ChipActionProps, ChipFilterProps, ChipProps, ChipVariant }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,SAAAwC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAZ;CAAA,IAAAL;CAAA,IAAAkB;CAAA,IAAAX;CAAA,IAAAN;CAAA,IAAAkB;CAAA,IAAAjB;CAAA,IAAAkB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAjB;CAAA,IAAAkB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAd,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAV,UAAAL,iBAAAM,UAAAsB,IAAAV,SAAAX,MAAAC,YAAAqB,IAAA5B,YAAAkB,QAAAjB,UAAAkB,SAAAC,WAAAC,YAAAC,UAAAC,SAAAC,WAAAC,YAAAhB,OAAAP,SAAA2B,IAAA,GAAAH,SAAAZ;EAoBFC,EAAA,KAAAD;EAAAC,EAAA,KAAAX;EAAAW,EAAA,KAAAhB;EAAAgB,EAAA,KAAAE;EAAAF,EAAA,KAAAT;EAAAS,EAAA,KAAAf;EAAAe,EAAA,KAAAG;EAAAH,EAAA,KAAAd;EAAAc,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAN;EAAAM,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAA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AAH;EAAApC,EAAA,MAAAR;EAAAQ,EAAA,MAAAW;EAAAX,EAAA,MAAA2C;EAAA3C,EAAA,MAAA4C;EAAA5C,EAAA,MAAA8C;EAAA9C,EAAA,MAAAmD;EAAAnD,EAAA,MAAAqD;EAAArD,EAAA,MAAAwC;EAAAxC,EAAA,MAAAuD;CAAA,OAAAA,MAAAvD,EAAA;CAAA,OAtBpBuD;AAsBoB"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","View","ViewStyle","AnimatedStyle","useState","AnimatedPressable","toggleState","useButtonAction","useSlotTrigger","ChipGlyph","ChipLabel","measureThen","paintOf","targetOf","useEasedColors","shadowsOf","stylesOf","TARGET_SIZE","usePressFeedback","useTheme","composeStyles","ChipActionProps","ChipBaseProps","defaultSelected","isSelected","onChange","variant","Omit","children","elevated","icon","isDisabled","ref","style","ChipFilterProps","ChipProps","ChipVariant","Chip","t0","$","_c","accessibilityHint","delayLongPress","hitSlop","onBlur","onFocus","onHoverIn","onHoverOut","onLayout","onLongPress","onPress","onPressIn","onPressOut","props","t1","t2","t3","undefined","theme","width","setWidth","isToggle","t4","href","slot","type","action","t5","t6","hoverIn","hoverOut","longPress","pressIn","pressOut","triggerProps","t7","t8","selected","assist","disabled","paint","eased","t9","radii","sm","borderRadius","t10","layer","color","corners","feedback","t11","t12","handlers","t13","t14","t15","t16","container","hovered","ring","pill","t17","glyph","t18","label","t19","_c"],"sources":["../../../src/components/chip/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { useState } from 'react'\n\nimport {\n AnimatedPressable,\n toggleState,\n useButtonAction,\n useSlotTrigger,\n} from '../../button'\nimport {\n ChipGlyph,\n ChipLabel,\n measureThen,\n paintOf,\n targetOf,\n useEasedColors,\n} from '../../chip'\nimport { shadowsOf, stylesOf } from '../../chip/styles'\nimport { TARGET_SIZE, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// Three of the chips page's four chips, as kanso-ui's Chip draws them. The\n// pill is src/chip's, shared with ChipGroup's chip as on web, which sets out\n// its measurements, colours, motion and target. `variant` picks the chip:\n//\n// - **A filter chip**, the default, is a toggle that reports its state as a\n// toggle Button does, and takes the secondary container pair and the check\n// once selected.\n// - **An assist or suggestion chip** is an action, so nothing is reported as\n// selected and nothing ever is. The two differ in the label alone: on\n// surface on an assist chip, on surface variant on a suggestion chip as on\n// a filter one.\n//\n// **A chip placed directly inside an overlay is its trigger**, as a Button\n// is, and as any React Aria pressable is on web: it fills the default slot\n// src/button's slots.ts sets out, so a press inside `Menu`, `Popover`,\n// `Dialog` or `Sheet` opens it, a menu's `trigger=\"longPress\"` opens from a\n// held press, the chip says whether what it opens is open, and an anchored\n// overlay is placed against it. A filter chip there still changes its state\n// with each press, as web's toggle does.\n\n/** An assist or suggestion chip: an action, drawn as a plain button. */\ntype ChipActionProps = ChipBaseProps & {\n readonly defaultSelected?: never\n readonly isSelected?: never\n readonly onChange?: never\n /**\n * `assist` for an action the chip's context suggests, and `suggestion`\n * for one the product generates. Either is an action rather than a\n * selection, so neither is ever selected.\n */\n readonly variant: 'assist' | 'suggestion'\n}\n\ntype ChipBaseProps = Omit<PressableProps, 'children' | 'disabled' | 'style'> & {\n /**\n * The chip's label. Required: the page draws no chip without one, and a\n * chip with none is an empty button to a screen reader.\n */\n readonly children: ReactNode\n /**\n * Raises the chip off the page on a container of its own, at the page's\n * elevation 1, in place of the outline. A selected filter chip keeps the\n * secondary container.\n * @default false\n */\n readonly elevated?: boolean\n /**\n * An icon before the label, in the page's 18dp slot and the primary role,\n * which the slot hands it through `useIconStyle()`. A filter chip's check\n * takes its place while the chip is selected, so the chip keeps its width.\n */\n readonly icon?: ReactNode\n /**\n * Draws the chip disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\n/** A filter chip: a two-state button, the default. */\ntype ChipFilterProps = ChipBaseProps & {\n /**\n * Whether the chip starts selected, when it keeps its own state.\n * @default false\n */\n readonly defaultSelected?: boolean\n /**\n * Whether the chip is selected, when the call site holds the state. Pass\n * it with `onChange`.\n */\n readonly isSelected?: boolean\n /** Called with the new state when the chip is pressed, after `onPress`. */\n readonly onChange?: (isSelected: boolean) => void\n /**\n * A filter chip, a two-state button.\n * @default 'filter'\n */\n readonly variant?: 'filter'\n}\n\ntype ChipProps = ChipActionProps | ChipFilterProps\n\n/** Which of the chips page's chips a Chip is. */\ntype ChipVariant = 'assist' | 'filter' | 'suggestion'\n\n/**\n * A chip. By default a filter chip, which is a two-state button reporting\n * its state as a toggle Button does: pass `isSelected` with `onChange` to\n * control it, or `defaultSelected` to let it keep its own state.\n *\n * ```tsx\n * <Chip defaultSelected>Label</Chip>\n * ```\n *\n * `variant=\"assist\"` and `variant=\"suggestion\"` draw the page's two action\n * chips instead: plain buttons, pressed with `onPress`, never selected.\n *\n * A chip placed directly inside `Menu`, `Popover`, `Dialog` or `Sheet` is its\n * trigger, as a `Button` is, and a press on it opens what it is placed in.\n *\n * A column stretches a chip across it, as it does any view; a row of chips is\n * a row that wraps. `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction Chip({\n accessibilityHint,\n children,\n defaultSelected,\n delayLongPress,\n elevated = false,\n hitSlop,\n icon,\n isDisabled = false,\n isSelected,\n onBlur,\n onChange,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n ref,\n style,\n variant = 'filter',\n ...props\n}: ChipProps) {\n const theme = useTheme()\n // Until the chip is measured it takes no reach across, rather than one\n // sized for a chip of no width.\n const [width, setWidth] = useState(TARGET_SIZE)\n\n const isToggle = variant === 'filter'\n const action = useButtonAction({\n defaultSelected,\n href: undefined,\n isSelected,\n isToggle,\n onChange,\n onPress,\n slot: 'default',\n type: undefined,\n })\n const {\n onHoverIn: hoverIn,\n onHoverOut: hoverOut,\n onLongPress: longPress,\n onPressIn: pressIn,\n onPressOut: pressOut,\n ...triggerProps\n } = useSlotTrigger({\n accessibilityHint,\n delayLongPress,\n href: undefined,\n onHoverIn,\n onHoverOut,\n onLongPress,\n onPressIn,\n onPressOut,\n ref,\n slot: undefined,\n })\n const paint = paintOf(theme, {\n assist: variant === 'assist',\n disabled: isDisabled,\n elevated,\n selected: action.selected,\n })\n const eased = useEasedColors(paint)\n\n const feedback = usePressFeedback({\n color: paint.layer,\n corners: { borderRadius: theme.radii.sm },\n disabled: isDisabled,\n onBlur,\n onFocus,\n onHoverIn: hoverIn,\n onHoverOut: hoverOut,\n onPressIn: pressIn,\n onPressOut: pressOut,\n })\n\n return (\n <AnimatedPressable\n role=\"button\"\n {...(isToggle ? toggleState(action.selected) : undefined)}\n {...props}\n {...triggerProps}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop ?? targetOf(width, theme)}\n onLayout={measureThen(setWidth, onLayout)}\n onLongPress={longPress}\n onPress={action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n stylesOf(theme).pill,\n eased.container,\n elevated && !isDisabled\n ? shadowsOf(theme)[feedback.hovered ? 'elevation2' : 'elevation1']\n : undefined,\n feedback.ring,\n style,\n )}\n >\n {feedback.layer}\n <ChipGlyph color={paint.glyph} icon={icon} selected={action.selected} />\n <ChipLabel color={eased.label}>{children}</ChipLabel>\n </AnimatedPressable>\n )\n}\n\nexport { Chip }\nexport type { ChipActionProps, ChipFilterProps, ChipProps, ChipVariant }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkIA,SAAAyC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAb;CAAA,IAAAL;CAAA,IAAAmB;CAAA,IAAAC;CAAA,IAAAb;CAAA,IAAAN;CAAA,IA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wD;EAAAxD,EAAA,MAAA0D;EAAA1D,EAAA,MAAA+D;EAAA/D,EAAA,MAAAiE;EAAAjE,EAAA,OAAAmC;EAAAnC,EAAA,OAAAmE;CAAA,OAAAA,MAAAnE,EAAA;CAAA,OAxBpBmE;AAwBoB"}
@@ -0,0 +1,85 @@
1
+ import { StyleProp, View, ViewStyle } from "react-native";
2
+ import { ComponentRef, Ref } from "react";
3
+ import { Color, ColorChannel, ColorSpace } from "react-stately";
4
+ //#region src/components/color-area/index.d.ts
5
+ type ColorAreaProps = {
6
+ /**
7
+ * What the plane is for, which a screen reader hears before each channel's
8
+ * name.
9
+ */
10
+ readonly 'aria-label'?: string;
11
+ /**
12
+ * The space the channels are read in, when the value is given in another:
13
+ * a hex or `rgb()` value has no saturation until it is read as `hsl` or
14
+ * `hsb`.
15
+ */
16
+ readonly colorSpace?: ColorSpace;
17
+ /**
18
+ * The colour the plane starts at, when it keeps its own: a CSS colour
19
+ * string, or a `Color` from `parseColor`. White when neither this nor
20
+ * `value` is given.
21
+ */
22
+ readonly defaultValue?: Color | string;
23
+ /**
24
+ * Draws the plane disabled, and takes no presses, drags or screen reader
25
+ * actions.
26
+ * @default false
27
+ */
28
+ readonly isDisabled?: boolean;
29
+ /** Called with the colour as either channel moves. */
30
+ readonly onChange?: (value: Color) => void;
31
+ /** Called with the colour once a drag, a press or an action has ended. */
32
+ readonly onChangeEnd?: (value: Color) => void;
33
+ readonly ref?: Ref<ComponentRef<typeof View>>;
34
+ /** Lands on the square, and sets its width; its height follows. */
35
+ readonly style?: StyleProp<ViewStyle>;
36
+ readonly testID?: string;
37
+ /** The colour, for a call site holding it itself with `onChange`. */
38
+ readonly value?: Color | string;
39
+ /**
40
+ * The channel along the horizontal axis. The first of the space's
41
+ * channels the vertical one is not, when left out.
42
+ */
43
+ readonly xChannel?: ColorChannel;
44
+ /**
45
+ * The channel up the vertical axis. The first of the space's channels the
46
+ * horizontal one is not, when left out.
47
+ */
48
+ readonly yChannel?: ColorChannel;
49
+ };
50
+ /**
51
+ * Two channels of a colour as a plane, with a handle where they meet. Its
52
+ * state is React Stately's, as web's is: pass `value` with `onChange` to
53
+ * control it, or `defaultValue`, as a CSS colour string or a `Color` from
54
+ * `parseColor`, which this package re-exports.
55
+ *
56
+ * ```tsx
57
+ * <ColorArea
58
+ * defaultValue="hsl(200, 100%, 50%)"
59
+ * xChannel="saturation"
60
+ * yChannel="lightness"
61
+ * />
62
+ * ```
63
+ *
64
+ * **`xChannel` and `yChannel` have to name channels the value's own space
65
+ * has.** A hex or `rgb()` value is read as RGB, which has no saturation, so
66
+ * naming one against it throws rather than converting. Pass `colorSpace` to
67
+ * convert it, or give the value in the space you mean to work in.
68
+ *
69
+ * **`alpha` is a channel here only in RGB.** Asked for it in HSL, the plane
70
+ * quietly draws saturation and lightness instead, as React Aria's does.
71
+ *
72
+ * A press on the plane moves the handle there, and a drag carries it. A
73
+ * screen reader adjusts each channel apart, through two halves of the
74
+ * handle, each named by its channel. `style`, `ref` and `testID` land on the
75
+ * square, whose width `style` sets. With a `testID`, the drag and the press
76
+ * are registered with Gesture Handler as `<testID>-pan` and `<testID>-tap`,
77
+ * which its `getByGestureTestId` finds in a test.
78
+ *
79
+ * Inside a `ColorPicker` it takes the picker's colour where it is given no
80
+ * `value`, and reports a change to the picker before its own `onChange`.
81
+ */
82
+ declare function ColorArea({ 'aria-label': ariaLabel, colorSpace, defaultValue, isDisabled, onChange, onChangeEnd, ref, style, testID, value, xChannel, yChannel }: ColorAreaProps): import("react").JSX.Element;
83
+ //#endregion
84
+ export { ColorArea, type ColorAreaProps };
85
+ //# sourceMappingURL=index.d.ts.map