@pickle-ui/react-native 1.0.0-beta.1 → 1.0.0-beta.2

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 (240) hide show
  1. package/README.md +36 -10
  2. package/dist/components/Button.d.ts.map +1 -1
  3. package/dist/components/Button.js +24 -21
  4. package/dist/components/Button.js.map +1 -1
  5. package/dist/components/Flex.d.ts +25 -0
  6. package/dist/components/Flex.d.ts.map +1 -0
  7. package/dist/components/Flex.js +24 -0
  8. package/dist/components/Flex.js.map +1 -0
  9. package/dist/components/Grid.d.ts +36 -0
  10. package/dist/components/Grid.d.ts.map +1 -0
  11. package/dist/components/Grid.js +68 -0
  12. package/dist/components/Grid.js.map +1 -0
  13. package/dist/components/Separator.d.ts +11 -0
  14. package/dist/components/Separator.d.ts.map +1 -0
  15. package/dist/components/Separator.js +12 -0
  16. package/dist/components/Separator.js.map +1 -0
  17. package/dist/components/Spinner.d.ts +14 -0
  18. package/dist/components/Spinner.d.ts.map +1 -0
  19. package/dist/components/Spinner.js +41 -0
  20. package/dist/components/Spinner.js.map +1 -0
  21. package/dist/components/XStack.d.ts +4 -0
  22. package/dist/components/XStack.d.ts.map +1 -0
  23. package/dist/components/XStack.js +6 -0
  24. package/dist/components/XStack.js.map +1 -0
  25. package/dist/components/YStack.d.ts +4 -0
  26. package/dist/components/YStack.d.ts.map +1 -0
  27. package/dist/components/YStack.js +6 -0
  28. package/dist/components/YStack.js.map +1 -0
  29. package/dist/components/_internal/InputFrame.d.ts +13 -0
  30. package/dist/components/_internal/InputFrame.d.ts.map +1 -0
  31. package/dist/components/_internal/InputFrame.js +14 -0
  32. package/dist/components/_internal/InputFrame.js.map +1 -0
  33. package/dist/components/_internal/StoryItem.d.ts +6 -0
  34. package/dist/components/_internal/StoryItem.d.ts.map +1 -0
  35. package/dist/components/_internal/StoryItem.js +9 -0
  36. package/dist/components/_internal/StoryItem.js.map +1 -0
  37. package/dist/components/_internal/layout.d.ts +79 -0
  38. package/dist/components/_internal/layout.d.ts.map +1 -0
  39. package/dist/components/_internal/layout.js +73 -0
  40. package/dist/components/_internal/layout.js.map +1 -0
  41. package/dist/components/_internal/useControllableState.d.ts +7 -0
  42. package/dist/components/_internal/useControllableState.d.ts.map +1 -0
  43. package/dist/components/_internal/useControllableState.js +17 -0
  44. package/dist/components/_internal/useControllableState.js.map +1 -0
  45. package/dist/components/form/Checkbox.d.ts +26 -0
  46. package/dist/components/form/Checkbox.d.ts.map +1 -0
  47. package/dist/components/form/Checkbox.js +41 -0
  48. package/dist/components/form/Checkbox.js.map +1 -0
  49. package/dist/components/form/Form.context.d.ts +34 -0
  50. package/dist/components/form/Form.context.d.ts.map +1 -0
  51. package/dist/components/form/Form.context.js +53 -0
  52. package/dist/components/form/Form.context.js.map +1 -0
  53. package/dist/components/form/Form.d.ts +33 -0
  54. package/dist/components/form/Form.d.ts.map +1 -0
  55. package/dist/components/form/Form.js +36 -0
  56. package/dist/components/form/Form.js.map +1 -0
  57. package/dist/components/form/FormCheckbox.d.ts +7 -0
  58. package/dist/components/form/FormCheckbox.d.ts.map +1 -0
  59. package/dist/components/form/FormCheckbox.js +24 -0
  60. package/dist/components/form/FormCheckbox.js.map +1 -0
  61. package/dist/components/form/FormDescription.d.ts +4 -0
  62. package/dist/components/form/FormDescription.d.ts.map +1 -0
  63. package/dist/components/form/FormDescription.js +7 -0
  64. package/dist/components/form/FormDescription.js.map +1 -0
  65. package/dist/components/form/FormError.d.ts +5 -0
  66. package/dist/components/form/FormError.d.ts.map +1 -0
  67. package/dist/components/form/FormError.js +8 -0
  68. package/dist/components/form/FormError.js.map +1 -0
  69. package/dist/components/form/FormField.d.ts +17 -0
  70. package/dist/components/form/FormField.d.ts.map +1 -0
  71. package/dist/components/form/FormField.js +36 -0
  72. package/dist/components/form/FormField.js.map +1 -0
  73. package/dist/components/form/FormInput.d.ts +10 -0
  74. package/dist/components/form/FormInput.d.ts.map +1 -0
  75. package/dist/components/form/FormInput.js +36 -0
  76. package/dist/components/form/FormInput.js.map +1 -0
  77. package/dist/components/form/FormInputGroup.d.ts +8 -0
  78. package/dist/components/form/FormInputGroup.d.ts.map +1 -0
  79. package/dist/components/form/FormInputGroup.js +18 -0
  80. package/dist/components/form/FormInputGroup.js.map +1 -0
  81. package/dist/components/form/FormLabel.d.ts +4 -0
  82. package/dist/components/form/FormLabel.d.ts.map +1 -0
  83. package/dist/components/form/FormLabel.js +7 -0
  84. package/dist/components/form/FormLabel.js.map +1 -0
  85. package/dist/components/form/FormRadioGroup.d.ts +11 -0
  86. package/dist/components/form/FormRadioGroup.d.ts.map +1 -0
  87. package/dist/components/form/FormRadioGroup.js +24 -0
  88. package/dist/components/form/FormRadioGroup.js.map +1 -0
  89. package/dist/components/form/FormRoot.d.ts +13 -0
  90. package/dist/components/form/FormRoot.d.ts.map +1 -0
  91. package/dist/components/form/FormRoot.js +19 -0
  92. package/dist/components/form/FormRoot.js.map +1 -0
  93. package/dist/components/form/FormTextarea.d.ts +7 -0
  94. package/dist/components/form/FormTextarea.d.ts.map +1 -0
  95. package/dist/components/form/FormTextarea.js +27 -0
  96. package/dist/components/form/FormTextarea.js.map +1 -0
  97. package/dist/components/form/Input.d.ts +17 -0
  98. package/dist/components/form/Input.d.ts.map +1 -0
  99. package/dist/components/form/Input.js +32 -0
  100. package/dist/components/form/Input.js.map +1 -0
  101. package/dist/components/form/InputGroup.context.d.ts +10 -0
  102. package/dist/components/form/InputGroup.context.d.ts.map +1 -0
  103. package/dist/components/form/InputGroup.context.js +8 -0
  104. package/dist/components/form/InputGroup.context.js.map +1 -0
  105. package/dist/components/form/InputGroup.d.ts +31 -0
  106. package/dist/components/form/InputGroup.d.ts.map +1 -0
  107. package/dist/components/form/InputGroup.js +123 -0
  108. package/dist/components/form/InputGroup.js.map +1 -0
  109. package/dist/components/form/RadioGroup.d.ts +29 -0
  110. package/dist/components/form/RadioGroup.d.ts.map +1 -0
  111. package/dist/components/form/RadioGroup.js +42 -0
  112. package/dist/components/form/RadioGroup.js.map +1 -0
  113. package/dist/components/form/Textarea.d.ts +19 -0
  114. package/dist/components/form/Textarea.d.ts.map +1 -0
  115. package/dist/components/form/Textarea.js +26 -0
  116. package/dist/components/form/Textarea.js.map +1 -0
  117. package/dist/entries/checkbox.d.ts +3 -0
  118. package/dist/entries/checkbox.d.ts.map +1 -0
  119. package/dist/entries/checkbox.js +2 -0
  120. package/dist/entries/checkbox.js.map +1 -0
  121. package/dist/entries/flex.d.ts +3 -0
  122. package/dist/entries/flex.d.ts.map +1 -0
  123. package/dist/entries/flex.js +2 -0
  124. package/dist/entries/flex.js.map +1 -0
  125. package/dist/entries/form.d.ts +3 -0
  126. package/dist/entries/form.d.ts.map +1 -0
  127. package/dist/entries/form.js +2 -0
  128. package/dist/entries/form.js.map +1 -0
  129. package/dist/entries/grid.d.ts +3 -0
  130. package/dist/entries/grid.d.ts.map +1 -0
  131. package/dist/entries/grid.js +2 -0
  132. package/dist/entries/grid.js.map +1 -0
  133. package/dist/entries/input-group.d.ts +3 -0
  134. package/dist/entries/input-group.d.ts.map +1 -0
  135. package/dist/entries/input-group.js +2 -0
  136. package/dist/entries/input-group.js.map +1 -0
  137. package/dist/entries/input.d.ts +3 -0
  138. package/dist/entries/input.d.ts.map +1 -0
  139. package/dist/entries/input.js +2 -0
  140. package/dist/entries/input.js.map +1 -0
  141. package/dist/entries/radio-group.d.ts +3 -0
  142. package/dist/entries/radio-group.d.ts.map +1 -0
  143. package/dist/entries/radio-group.js +2 -0
  144. package/dist/entries/radio-group.js.map +1 -0
  145. package/dist/entries/separator.d.ts +3 -0
  146. package/dist/entries/separator.d.ts.map +1 -0
  147. package/dist/entries/separator.js +2 -0
  148. package/dist/entries/separator.js.map +1 -0
  149. package/dist/entries/spinner.d.ts +3 -0
  150. package/dist/entries/spinner.d.ts.map +1 -0
  151. package/dist/entries/spinner.js +2 -0
  152. package/dist/entries/spinner.js.map +1 -0
  153. package/dist/entries/textarea.d.ts +3 -0
  154. package/dist/entries/textarea.d.ts.map +1 -0
  155. package/dist/entries/textarea.js +2 -0
  156. package/dist/entries/textarea.js.map +1 -0
  157. package/dist/entries/x-stack.d.ts +3 -0
  158. package/dist/entries/x-stack.d.ts.map +1 -0
  159. package/dist/entries/x-stack.js +2 -0
  160. package/dist/entries/x-stack.js.map +1 -0
  161. package/dist/entries/y-stack.d.ts +3 -0
  162. package/dist/entries/y-stack.d.ts.map +1 -0
  163. package/dist/entries/y-stack.js +2 -0
  164. package/dist/entries/y-stack.js.map +1 -0
  165. package/dist/index.d.ts +12 -0
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js +12 -0
  168. package/dist/index.js.map +1 -1
  169. package/package.json +6 -2
  170. package/src/components/Button.tsx +24 -21
  171. package/src/components/Flex.stories.tsx +58 -0
  172. package/src/components/Flex.test.tsx +57 -0
  173. package/src/components/Flex.tsx +52 -0
  174. package/src/components/Grid.stories.tsx +55 -0
  175. package/src/components/Grid.test.tsx +140 -0
  176. package/src/components/Grid.tsx +166 -0
  177. package/src/components/Separator.stories.tsx +39 -0
  178. package/src/components/Separator.test.tsx +25 -0
  179. package/src/components/Separator.tsx +30 -0
  180. package/src/components/Spinner.stories.tsx +35 -0
  181. package/src/components/Spinner.test.tsx +30 -0
  182. package/src/components/Spinner.tsx +75 -0
  183. package/src/components/XStack.stories.tsx +46 -0
  184. package/src/components/XStack.test.tsx +13 -0
  185. package/src/components/XStack.tsx +7 -0
  186. package/src/components/YStack.stories.tsx +46 -0
  187. package/src/components/YStack.test.tsx +13 -0
  188. package/src/components/YStack.tsx +7 -0
  189. package/src/components/_internal/InputFrame.tsx +50 -0
  190. package/src/components/_internal/StoryItem.tsx +24 -0
  191. package/src/components/_internal/layout.ts +103 -0
  192. package/src/components/_internal/useControllableState.ts +25 -0
  193. package/src/components/form/Checkbox.stories.tsx +67 -0
  194. package/src/components/form/Checkbox.test.tsx +88 -0
  195. package/src/components/form/Checkbox.tsx +141 -0
  196. package/src/components/form/Form.context.ts +91 -0
  197. package/src/components/form/Form.stories.tsx +152 -0
  198. package/src/components/form/Form.test.tsx +195 -0
  199. package/src/components/form/Form.tsx +51 -0
  200. package/src/components/form/FormCheckbox.tsx +42 -0
  201. package/src/components/form/FormDescription.tsx +14 -0
  202. package/src/components/form/FormError.tsx +17 -0
  203. package/src/components/form/FormField.tsx +82 -0
  204. package/src/components/form/FormInput.tsx +70 -0
  205. package/src/components/form/FormInputGroup.tsx +30 -0
  206. package/src/components/form/FormLabel.tsx +17 -0
  207. package/src/components/form/FormRadioGroup.tsx +48 -0
  208. package/src/components/form/FormRoot.tsx +41 -0
  209. package/src/components/form/FormTextarea.tsx +56 -0
  210. package/src/components/form/Input.stories.tsx +105 -0
  211. package/src/components/form/Input.test.tsx +76 -0
  212. package/src/components/form/Input.tsx +81 -0
  213. package/src/components/form/InputGroup.context.ts +11 -0
  214. package/src/components/form/InputGroup.stories.tsx +129 -0
  215. package/src/components/form/InputGroup.test.tsx +95 -0
  216. package/src/components/form/InputGroup.tsx +266 -0
  217. package/src/components/form/RadioGroup.stories.tsx +62 -0
  218. package/src/components/form/RadioGroup.test.tsx +98 -0
  219. package/src/components/form/RadioGroup.tsx +151 -0
  220. package/src/components/form/Textarea.stories.tsx +61 -0
  221. package/src/components/form/Textarea.test.tsx +35 -0
  222. package/src/components/form/Textarea.tsx +74 -0
  223. package/src/entries/checkbox.ts +2 -0
  224. package/src/entries/flex.ts +2 -0
  225. package/src/entries/form.ts +13 -0
  226. package/src/entries/grid.ts +2 -0
  227. package/src/entries/input-group.ts +8 -0
  228. package/src/entries/input.ts +2 -0
  229. package/src/entries/radio-group.ts +5 -0
  230. package/src/entries/separator.ts +2 -0
  231. package/src/entries/spinner.ts +2 -0
  232. package/src/entries/textarea.ts +2 -0
  233. package/src/entries/x-stack.ts +2 -0
  234. package/src/entries/y-stack.ts +2 -0
  235. package/src/index.ts +12 -0
  236. package/dist/components/_internal/Spinner.d.ts +0 -9
  237. package/dist/components/_internal/Spinner.d.ts.map +0 -1
  238. package/dist/components/_internal/Spinner.js +0 -31
  239. package/dist/components/_internal/Spinner.js.map +0 -1
  240. package/src/components/_internal/Spinner.tsx +0 -49
package/README.md CHANGED
@@ -72,23 +72,49 @@ steps, token overrides and runtime brand colors.
72
72
 
73
73
  Each export is also available from its own subpath.
74
74
 
75
- | Export | Subpath | Notes |
76
- | --------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
- | `Badge` | `@pickle-ui/react-native/badge` | `variant`: `default`, `secondary`, `outline`, `destructive`, `info`, `success`, `warning`, `error` and the statuses `pending`, `submitted`, `inProgress`, `inReview`, `failed`, `expired`; `size`: `sm`, `md`, `lg` |
78
- | `Button` | `@pickle-ui/react-native/button` | `variant`: `default`, `secondary`, `destructive`, `destructive-outline`, `outline`, `ghost`, `link`; `size`: `xs` … `xl`, `icon-xs` … `icon-xl`; `loading` |
79
- | `Card` | `@pickle-ui/react-native/card` | Parts: `Card.Header`, `Card.Title`, `Card.Description`, `Card.Action`, `Card.Content`, `Card.Footer` |
80
- | `Text` | `@pickle-ui/react-native/text` | `variant`: `h1` … `h4`, `lead`, `body`, `small`, `code`; `tone`: `muted`, `primary`, `destructive`; `weight`: `normal`, `bold`; `truncate` |
81
- | `createTheme` | `@pickle-ui/react-native/theme` | Derives a theme from a brand color, the same as on the web; apply it with `ScopedVariables` |
82
- | `cn` | `@pickle-ui/react-native/cn` | Joins class names; later classes win, and `text-h1` … `text-code` count as font sizes |
83
- | `useColorToken` | `@pickle-ui/react-native/use-color-token` | Reads a token as a color string, for props that don't take a `className` |
75
+ | Export | Subpath | Notes |
76
+ | --------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
+ | `Badge` | `@pickle-ui/react-native/badge` | `variant`: `default`, `secondary`, `outline`, `destructive`, `info`, `success`, `warning`, `error` and the statuses `pending`, `submitted`, `inProgress`, `inReview`, `failed`, `expired`; `size`: `sm`, `md`, `lg` |
78
+ | `Button` | `@pickle-ui/react-native/button` | `variant`: `default`, `secondary`, `destructive`, `destructive-outline`, `outline`, `ghost`, `link`; `size`: `xs` … `xl`, `icon-xs` … `icon-xl`; `loading` |
79
+ | `Card` | `@pickle-ui/react-native/card` | Parts: `Card.Header`, `Card.Title`, `Card.Description`, `Card.Action`, `Card.Content`, `Card.Footer` |
80
+ | `Checkbox` | `@pickle-ui/react-native/checkbox` | `checked` / `defaultChecked` / `onCheckedChange`, `indeterminate`, `invalid`, `disabled`, `label`; `size`: `md`, `sm`; `classNames`: `field`, `indicator`, `label` |
81
+ | `Flex` | `@pickle-ui/react-native/flex` | A row by default, like the web; `direction`, `wrap`, `align`, `justify`, `gap`, `gapX`, `gapY` |
82
+ | `Form` | `@pickle-ui/react-native/form` | React Hook Form bindings: `Form.Field` (`label`, `description`, `error`), `Form.Input`, `Form.Textarea`, `Form.InputGroup`, `Form.Checkbox`, `Form.RadioGroup`, `Form.Button`, `Form.Label`, `Form.Description`, `Form.Error` |
83
+ | `Grid` | `@pickle-ui/react-native/grid` | Equal columns built from rows of cells (no CSS grid on native): `columns`, `rows`, `flow`, `gap`, `gapX`, `gapY`, `align`, `justify`, `placeContent`, `placeItems`; items can't stretch to their cell's height, give them `flex-1` |
84
+ | `Input` | `@pickle-ui/react-native/input` | `size`: `sm`, `md`, `lg`, the `Button` heights; `invalid`, `disabled`, `unstyled`; `classNames.input` |
85
+ | `InputGroup` | `@pickle-ui/react-native/input-group` | Parts: `InputGroup.Input`, `InputGroup.Addon` (`align`: `inline-start`, `inline-end`, `block-start`, `block-end`), `InputGroup.Button`, `InputGroup.Text` |
86
+ | `RadioGroup` | `@pickle-ui/react-native/radio-group` | `value` / `defaultValue` / `onValueChange`, `disabled`; parts: `RadioGroup.Item` (`value`, `label`, `invalid`, `disabled`, `size`: `md`, `sm`; `classNames`: `field`, `indicator`, `label`) |
87
+ | `Separator` | `@pickle-ui/react-native/separator` | `orientation`: `horizontal`, `vertical`; `role="separator"`, announced on the web only |
88
+ | `Spinner` | `@pickle-ui/react-native/spinner` | Announced as "Loading": `accessibilityLabel` renames it, `aria-hidden` makes it decorative; size it with `size-*` and color it with `text-*` |
89
+ | `Text` | `@pickle-ui/react-native/text` | `variant`: `h1` … `h4`, `lead`, `body`, `small`, `code`; `tone`: `muted`, `primary`, `destructive`; `weight`: `normal`, `bold`; `truncate` |
90
+ | `Textarea` | `@pickle-ui/react-native/textarea` | Grows with its content from three lines; `size`, `invalid`, `disabled`; `classNames.textarea` |
91
+ | `XStack` | `@pickle-ui/react-native/x-stack` | `Flex` as a row |
92
+ | `YStack` | `@pickle-ui/react-native/y-stack` | `Flex` as a column |
93
+ | `createTheme` | `@pickle-ui/react-native/theme` | Derives a theme from a brand color, the same as on the web; apply it with `ScopedVariables` |
94
+ | `cn` | `@pickle-ui/react-native/cn` | Joins class names; later classes win, and `text-h1` … `text-code` count as font sizes |
95
+ | `useColorToken` | `@pickle-ui/react-native/use-color-token` | Reads a token as a color string, for props that don't take a `className` |
84
96
 
85
97
  Every component takes the props of the React Native element it renders,
86
98
  `className` included, and merges your `className` last.
87
99
 
100
+ Form fields take `invalid` and `disabled` props where the web reads the
101
+ `aria-invalid` and `disabled` attributes, and draw the web's focus ring while
102
+ they have focus. Text styles don't cascade on native, so `Checkbox` and
103
+ `RadioGroup.Item` style the row around the control with `classNames.field`
104
+ and the label text with `classNames.label`; pass `label` rather than a
105
+ separate label element, which couldn't toggle the control.
106
+
107
+ `Form` needs `react-hook-form` (a peer dependency). React Native has no
108
+ `<form>`, so `Form` takes `onSubmit` and runs it through `handleSubmit` when
109
+ `Form.Button` is pressed, or when the return key is pressed in a
110
+ `Form.Input`, like Enter on the web. Give `Form.Button` an `onPress` for
111
+ another action. A `Form.Field` label names its control and focuses it when
112
+ pressed.
113
+
88
114
  `Button` and `Badge` wrap text children in their label and render other
89
115
  children, such as icons, as they are. Icons don't inherit the label's color on
90
116
  native, so pass it to the icon, for example with `useColorToken`. Give an
91
- icon-only button an `icon*` size and an `accessibilityLabel`. Buttons keep the web's dimensions, and a `hitSlop` stretches each size to a
117
+ icon-only button an `icon*` size and an `accessibilityLabel`. Buttons keep the web's dimensions and the text sizes it uses from `sm` up (14px at `md`), and a `hitSlop` stretches each size to a
92
118
  44pt touch target, as the web's `pointer-coarse` hit area does. Headings (`h1` … `h4`)
93
119
  are announced as headers.
94
120
 
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,SAAS,EAAc,MAAM,cAAc,CAAC;AAQlE,QAAA,MAAM,cAAc;;;8EAgCnB,CAAC;AAoFF,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,UAAU,CACX,GACC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,wBAAgB,MAAM,CAAC,EACrB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAe,EACf,IAAW,EACX,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,WAAW,+BAuDb"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,SAAS,EAAc,MAAM,cAAc,CAAC;AAQlE,QAAA,MAAM,cAAc;;;8EAgCnB,CAAC;AAuFF,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,UAAU,CACX,GACC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,wBAAgB,MAAM,CAAC,EACrB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,OAAe,EACf,IAAW,EACX,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,WAAW,+BAuDb"}
@@ -3,9 +3,9 @@ import { cva } from 'class-variance-authority';
3
3
  import { Children, isValidElement } from 'react';
4
4
  import { Pressable, Text, View } from 'react-native';
5
5
  import { cn } from '../lib/cn';
6
- import { Spinner } from './_internal/Spinner';
6
+ import { Spinner } from './Spinner';
7
7
  // Same variants, sizes and dimensions as `Button` in @pickle-ui/react on a
8
- // phone. Like the web's `pointer-coarse` hit area, `hitSlop` stretches every
8
+ // phone, with its text sizes from `sm` up. Like the web's `pointer-coarse` hit area, `hitSlop` stretches every
9
9
  // size to a 44pt touch target. Paddings leave room for the 1pt border.
10
10
  const buttonVariants = cva('flex-row items-center justify-center gap-2 rounded-lg border disabled:opacity-64', {
11
11
  defaultVariants: { size: 'md', variant: 'default' },
@@ -40,17 +40,19 @@ const labelVariants = cva('font-medium', {
40
40
  defaultVariants: { size: 'md', variant: 'default' },
41
41
  variants: {
42
42
  pressed: { false: '', true: '' },
43
+ // The web's sizes from `sm` up, not its larger phone sizes, which only
44
+ // stop iOS Safari zooming into focused fields.
43
45
  size: {
44
- icon: 'text-base',
45
- 'icon-lg': 'text-base',
46
- 'icon-sm': 'text-base',
47
- 'icon-xl': 'text-base',
48
- 'icon-xs': 'text-base',
49
- lg: 'text-base',
50
- md: 'text-base',
51
- sm: 'text-base',
52
- xl: 'text-lg',
53
- xs: 'text-sm',
46
+ icon: 'text-sm',
47
+ 'icon-lg': 'text-sm',
48
+ 'icon-sm': 'text-sm',
49
+ 'icon-xl': 'text-sm',
50
+ 'icon-xs': 'text-sm',
51
+ lg: 'text-sm',
52
+ md: 'text-sm',
53
+ sm: 'text-sm',
54
+ xl: 'text-base',
55
+ xs: 'text-xs',
54
56
  },
55
57
  variant: {
56
58
  default: 'text-primary-foreground',
@@ -63,16 +65,17 @@ const labelVariants = cva('font-medium', {
63
65
  },
64
66
  },
65
67
  });
66
- const spinnerVariants = cva('', {
68
+ // Sized and dimmed like the web button's icons, in the label's color.
69
+ const spinnerVariants = cva('size-4 opacity-80', {
67
70
  variants: {
68
71
  variant: {
69
- default: 'border-primary-foreground',
70
- destructive: 'border-destructive-foreground',
71
- 'destructive-outline': 'border-foreground',
72
- ghost: 'border-foreground',
73
- link: 'border-foreground',
74
- outline: 'border-foreground',
75
- secondary: 'border-secondary-foreground',
72
+ default: 'text-primary-foreground',
73
+ destructive: 'text-destructive-foreground',
74
+ 'destructive-outline': 'text-foreground',
75
+ ghost: 'text-foreground',
76
+ link: 'text-foreground',
77
+ outline: 'text-foreground',
78
+ secondary: 'text-secondary-foreground',
76
79
  },
77
80
  },
78
81
  });
@@ -116,6 +119,6 @@ export function Button({ accessibilityState, children, className, disabled, labe
116
119
  ...accessibilityState,
117
120
  busy: loading,
118
121
  disabled: isDisabled,
119
- }, className: cn(buttonVariants({ size, variant }), className), disabled: isDisabled, hitSlop: size ? HIT_SLOP[size] : undefined, ...props, children: ({ pressed }) => (_jsxs(_Fragment, { children: [isSolid && !isDisabled ? (_jsx(View, { className: highlightVariants({ pressed, size }), pointerEvents: "none" })) : null, Children.map(children, (child) => typeof child === 'string' || typeof child === 'number' ? (_jsx(Text, { className: cn(labelVariants({ pressed, size, variant }), loading && 'opacity-0', labelClassName), children: child })) : isValidElement(child) ? (loading ? (_jsx(View, { className: "opacity-0", children: child })) : (child)) : null), loading ? (_jsx(View, { className: "absolute", children: _jsx(Spinner, { className: spinnerVariants({ variant }) }) })) : null] })) }));
122
+ }, className: cn(buttonVariants({ size, variant }), className), disabled: isDisabled, hitSlop: size ? HIT_SLOP[size] : undefined, ...props, children: ({ pressed }) => (_jsxs(_Fragment, { children: [isSolid && !isDisabled ? (_jsx(View, { className: highlightVariants({ pressed, size }), pointerEvents: "none" })) : null, Children.map(children, (child) => typeof child === 'string' || typeof child === 'number' ? (_jsx(Text, { className: cn(labelVariants({ pressed, size, variant }), loading && 'opacity-0', labelClassName), children: child })) : isValidElement(child) ? (loading ? (_jsx(View, { className: "opacity-0", children: child })) : (child)) : null), loading ? (_jsx(View, { className: "absolute", children: _jsx(Spinner, { "aria-hidden": true, className: spinnerVariants({ variant }) }) })) : null] })) }));
120
123
  }
121
124
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAe,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,2EAA2E;AAC3E,6EAA6E;AAC7E,uEAAuE;AACvE,MAAM,cAAc,GAAG,GAAG,CACxB,kFAAkF,EAClF;IACE,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE;IACnD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,mBAAmB;YAC9B,EAAE,EAAE,eAAe;YACnB,EAAE,EAAE,eAAe;YACnB,EAAE,EAAE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,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAC1B,OAAO,CAAC,CAAC,CAAC,CACR,KAAC,IAAI,IAAC,SAAS,EAAC,WAAW,YAAE,KAAK,GAAQ,CAC3C,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACF,CAAC,CAAC,CAAC,IAAI,CACT,EACA,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,SAAS,EAAC,UAAU,YACxB,KAAC,OAAO,yBAAa,SAAS,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC,GAAI,GAC3D,CACR,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,GACS,CACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { View } from 'react-native';
2
+ import { type LayoutStyleProps } from './_internal/layout';
3
+ declare const directionClasses: {
4
+ readonly column: "flex-col";
5
+ readonly 'column-reverse': "flex-col-reverse";
6
+ readonly row: "flex-row";
7
+ readonly 'row-reverse': "flex-row-reverse";
8
+ };
9
+ declare const wrapClasses: {
10
+ readonly nowrap: "flex-nowrap";
11
+ readonly wrap: "flex-wrap";
12
+ readonly 'wrap-reverse': "flex-wrap-reverse";
13
+ };
14
+ export type FlexProps = LayoutStyleProps & Omit<React.ComponentProps<typeof View>, keyof LayoutStyleProps> & {
15
+ direction?: keyof typeof directionClasses;
16
+ wrap?: keyof typeof wrapClasses;
17
+ };
18
+ /**
19
+ * A `View` laid out with flexbox props, like `Flex` in @pickle-ui/react. It
20
+ * defaults to a row, as on the web, where React Native's `View` stacks its
21
+ * children in a column.
22
+ */
23
+ export declare function Flex({ align, className, direction, gap, gapX, gapY, justify, wrap, ...props }: FlexProps): import("react").JSX.Element;
24
+ export {};
25
+ //# sourceMappingURL=Flex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../src/components/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,QAAA,MAAM,gBAAgB;;;;;CAKZ,CAAC;AAEX,QAAA,MAAM,WAAW;;;;CAIP,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,gBAAgB,GACtC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,gBAAgB,CAAC,GAAG;IAChE,SAAS,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;CACjC,CAAC;AAEJ;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,SAAS,EACT,SAAiB,EACjB,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,SAAS,+BAYX"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { cn } from '../lib/cn';
4
+ import { getLayoutClasses } from './_internal/layout';
5
+ const directionClasses = {
6
+ column: 'flex-col',
7
+ 'column-reverse': 'flex-col-reverse',
8
+ row: 'flex-row',
9
+ 'row-reverse': 'flex-row-reverse',
10
+ };
11
+ const wrapClasses = {
12
+ nowrap: 'flex-nowrap',
13
+ wrap: 'flex-wrap',
14
+ 'wrap-reverse': 'flex-wrap-reverse',
15
+ };
16
+ /**
17
+ * A `View` laid out with flexbox props, like `Flex` in @pickle-ui/react. It
18
+ * defaults to a row, as on the web, where React Native's `View` stacks its
19
+ * children in a column.
20
+ */
21
+ export function Flex({ align, className, direction = 'row', gap, gapX, gapY, justify, wrap, ...props }) {
22
+ return (_jsx(View, { className: cn(getLayoutClasses({ align, gap, gapX, gapY, justify }), directionClasses[direction], wrap === undefined ? undefined : wrapClasses[wrap], className), ...props }));
23
+ }
24
+ //# sourceMappingURL=Flex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../src/components/Flex.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAE7E,MAAM,gBAAgB,GAAG;IACvB,MAAM,EAAE,UAAU;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,GAAG,EAAE,UAAU;IACf,aAAa,EAAE,kBAAkB;CACzB,CAAC;AAEX,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,cAAc,EAAE,mBAAmB;CAC3B,CAAC;AAQX;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,KAAK,EACL,SAAS,EACT,SAAS,GAAG,KAAK,EACjB,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EACrD,gBAAgB,CAAC,SAAS,CAAC,EAC3B,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAClD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { View } from 'react-native';
2
+ import { type LayoutAlign, type LayoutGap, type LayoutJustify } from './_internal/layout';
3
+ type GridFlow = 'column' | 'column-dense' | 'dense' | 'row' | 'row-dense';
4
+ type GridPlaceContent = 'baseline' | 'stretch' | LayoutJustify;
5
+ type GridTrackCount = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
6
+ export type GridProps = React.ComponentProps<typeof View> & {
7
+ /**
8
+ * Places each item down its cell, like CSS `align-items`. `stretch` and
9
+ * `baseline` place it at the top: give the item `flex-1` to fill the cell.
10
+ */
11
+ align?: LayoutAlign;
12
+ columns?: GridTrackCount;
13
+ /**
14
+ * Fills rows first (`row`) or columns first (`column`). Items can't span
15
+ * cells on native, so the `dense` flows place them like `row` and `column`.
16
+ */
17
+ flow?: GridFlow;
18
+ gap?: LayoutGap;
19
+ gapX?: LayoutGap;
20
+ gapY?: LayoutGap;
21
+ /** Distributes the cells along each row, like CSS `justify-content`. */
22
+ justify?: LayoutJustify;
23
+ /** Distributes the rows and the cells, like CSS `place-content`. */
24
+ placeContent?: GridPlaceContent;
25
+ /** Places each item across and down its cell, like CSS `place-items`. */
26
+ placeItems?: LayoutAlign;
27
+ rows?: GridTrackCount;
28
+ };
29
+ /**
30
+ * Lays its children out in equal columns, like `Grid` in @pickle-ui/react.
31
+ * Items fill their cell's width by default and the cells of a row share its
32
+ * height.
33
+ */
34
+ export declare function Grid({ align, children, className, columns, flow, gap, gapX, gapY, justify, placeContent, placeItems, rows, ...props }: GridProps): import("react").JSX.Element;
35
+ export {};
36
+ //# sourceMappingURL=Grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAO5B,KAAK,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,OAAO,GAAG,KAAK,GAAG,WAAW,CAAC;AAC1E,KAAK,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;AAC/D,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAqCvE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAC1D;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,yEAAyE;IACzE,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAY,EACZ,GAAG,EACH,IAAU,EACV,IAAU,EACV,OAAO,EACP,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,SAAS,+BAyDX"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Children, Fragment, isValidElement } from 'react';
3
+ import { View } from 'react-native';
4
+ import { cn } from '../lib/cn';
5
+ import { gapXClasses, gapYClasses, } from './_internal/layout';
6
+ // Cells are columns: `items-*` places an item across the cell's width and
7
+ // `justify-*` down its height. A cell can't stretch an item vertically, so
8
+ // `stretch` and `baseline` place it at the top; give the item `flex-1` to fill
9
+ // its cell's height.
10
+ const horizontalClasses = {
11
+ baseline: 'items-start',
12
+ center: 'items-center',
13
+ end: 'items-end',
14
+ start: 'items-start',
15
+ stretch: 'items-stretch',
16
+ };
17
+ const verticalClasses = {
18
+ baseline: 'justify-start',
19
+ center: 'justify-center',
20
+ end: 'justify-end',
21
+ start: 'justify-start',
22
+ stretch: 'justify-start',
23
+ };
24
+ // Distributes the rows down the grid and the cells along each row, like CSS
25
+ // `align-content` and `justify-content`. Cells share each row's width, so only
26
+ // a grid taller than its rows shows the difference; `stretch` grows the rows
27
+ // into that height instead.
28
+ const contentClasses = {
29
+ around: 'justify-around',
30
+ baseline: 'justify-start',
31
+ between: 'justify-between',
32
+ center: 'justify-center',
33
+ end: 'justify-end',
34
+ evenly: 'justify-evenly',
35
+ start: 'justify-start',
36
+ stretch: 'justify-start',
37
+ };
38
+ /**
39
+ * Lays its children out in equal columns, like `Grid` in @pickle-ui/react.
40
+ * Items fill their cell's width by default and the cells of a row share its
41
+ * height.
42
+ */
43
+ export function Grid({ align, children, className, columns, flow = 'row', gap, gapX = gap, gapY = gap, justify, placeContent, placeItems, rows, ...props }) {
44
+ const items = flattenChildren(children);
45
+ const byColumn = flow === 'column' || flow === 'column-dense';
46
+ const rowCount = byColumn
47
+ ? (rows ?? 1)
48
+ : Math.max(rows ?? 0, Math.ceil(items.length / (columns ?? 1)));
49
+ const columnCount = byColumn
50
+ ? Math.max(columns ?? 1, Math.ceil(items.length / rowCount))
51
+ : (columns ?? 1);
52
+ const vertical = placeItems ?? align;
53
+ const distribution = placeContent ?? justify;
54
+ return (_jsx(View, { className: cn(gapY === undefined ? undefined : gapYClasses[gapY], placeContent === undefined ? undefined : contentClasses[placeContent], className), ...props, children: Array.from({ length: rowCount }, (_, row) => (_jsx(View, { className: cn('flex-row', gapX === undefined ? undefined : gapXClasses[gapX], distribution === undefined
55
+ ? undefined
56
+ : contentClasses[distribution], placeContent === 'stretch' ? 'grow' : undefined), children: Array.from({ length: columnCount }, (_, column) => (_jsx(View, { className: cn('flex-1', placeItems === undefined
57
+ ? undefined
58
+ : horizontalClasses[placeItems], vertical === undefined ? undefined : verticalClasses[vertical]), children: items[byColumn
59
+ ? column * rowCount + row
60
+ : row * columnCount + column] }, column))) }, row))) }));
61
+ }
62
+ /** The grid items, with fragments opened up as on the web. */
63
+ function flattenChildren(children) {
64
+ return Children.toArray(children).flatMap((child) => isValidElement(child) && child.type === Fragment
65
+ ? flattenChildren(child.props.children)
66
+ : [child]);
67
+ }
68
+ //# sourceMappingURL=Grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.js","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,WAAW,GAIZ,MAAM,oBAAoB,CAAC;AAW5B,0EAA0E;AAC1E,2EAA2E;AAC3E,+EAA+E;AAC/E,qBAAqB;AACrB,MAAM,iBAAiB,GAAG;IACxB,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,cAAc;IACtB,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;CAChB,CAAC;AAEX,MAAM,eAAe,GAAG;IACtB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,eAAe;CAChB,CAAC;AAEX,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,4BAA4B;AAC5B,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,e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,CAAC;QACvC,CAAC,CAAC,CAAC,KAAK,CAAC,CACZ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { View } from 'react-native';
2
+ export type SeparatorProps = React.ComponentProps<typeof View> & {
3
+ orientation?: 'horizontal' | 'vertical';
4
+ };
5
+ /**
6
+ * A 1px rule in the border color, like `Separator` in @pickle-ui/react. Its
7
+ * `separator` role reaches screen readers on the web; iOS and Android have no
8
+ * separator trait, so they skip it like any non-focusable view.
9
+ */
10
+ export declare function Separator({ className, orientation, ...props }: SeparatorProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=Separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../src/components/Separator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAC/D,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,cAAc,+BAYhB"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { cn } from '../lib/cn';
4
+ /**
5
+ * A 1px rule in the border color, like `Separator` in @pickle-ui/react. Its
6
+ * `separator` role reaches screen readers on the web; iOS and Android have no
7
+ * separator trait, so they skip it like any non-focusable view.
8
+ */
9
+ export function Separator({ className, orientation = 'horizontal', ...props }) {
10
+ return (_jsx(View, { className: cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-px w-full' : 'w-px self-stretch', className), role: "separator", ...props }));
11
+ }
12
+ //# sourceMappingURL=Separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Separator.js","sourceRoot":"","sources":["../../src/components/Separator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAM/B;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EACO;IACf,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,oBAAoB,EACpB,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,EAClE,SAAS,CACV,EACD,IAAI,EAAC,WAAW,KACZ,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { View } from 'react-native';
2
+ export type SpinnerProps = Omit<React.ComponentProps<typeof View>, 'children'> & {
3
+ /** Hides the spinner from screen readers, when visible text already says what is loading. */
4
+ 'aria-hidden'?: boolean;
5
+ };
6
+ /**
7
+ * The web `Spinner`'s look on native: a three-quarter ring turning once a
8
+ * second, drawn inside a `size-6` box like the web icon. Size it with
9
+ * `size-*` and color it with `text-*`, as on the web. Announced as "Loading"
10
+ * by default; `accessibilityLabel` replaces the name and `aria-hidden` makes
11
+ * it decorative.
12
+ */
13
+ export declare function Spinner({ accessibilityLabel, 'aria-hidden': ariaHidden, className, style, ...props }: SpinnerProps): import("react").JSX.Element;
14
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,EAA8B,IAAI,EAAE,MAAM,cAAc,CAAC;AAKhE,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EACjC,UAAU,CACX,GAAG;IACF,6FAA6F;IAC7F,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EACtB,kBAA8B,EAC9B,aAAa,EAAE,UAAkB,EACjC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,YAAY,+BA+Cd"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { Animated, Easing, Platform, View } from 'react-native';
4
+ import { useResolveClassNames } from 'uniwind';
5
+ import { cn } from '../lib/cn';
6
+ /**
7
+ * The web `Spinner`'s look on native: a three-quarter ring turning once a
8
+ * second, drawn inside a `size-6` box like the web icon. Size it with
9
+ * `size-*` and color it with `text-*`, as on the web. Announced as "Loading"
10
+ * by default; `accessibilityLabel` replaces the name and `aria-hidden` makes
11
+ * it decorative.
12
+ */
13
+ export function Spinner({ accessibilityLabel = 'Loading', 'aria-hidden': ariaHidden = false, className, style, ...props }) {
14
+ const [turn] = useState(() => new Animated.Value(0));
15
+ const box = cn('text-foreground size-6', className);
16
+ // React Native has no `currentColor`: the ring reads the `text-*` color, and
17
+ // its stroke follows the box like the icon's (2px at 24px).
18
+ const { color, width } = useResolveClassNames(box);
19
+ const strokeWidth = typeof width === 'number' ? width / 12 : 2;
20
+ useEffect(() => {
21
+ const loop = Animated.loop(Animated.timing(turn, {
22
+ duration: 1000,
23
+ easing: Easing.linear,
24
+ toValue: 1,
25
+ // react-native-web has no native driver and warns when asked for it.
26
+ useNativeDriver: Platform.OS !== 'web',
27
+ }));
28
+ loop.start();
29
+ return () => loop.stop();
30
+ }, [turn]);
31
+ const rotate = turn.interpolate({
32
+ inputRange: [0, 1],
33
+ outputRange: ['0deg', '360deg'],
34
+ });
35
+ return (_jsx(Animated.View, { accessibilityLabel: ariaHidden ? undefined : accessibilityLabel, accessibilityRole: ariaHidden ? undefined : 'progressbar', accessible: !ariaHidden, "aria-hidden": ariaHidden, className: cn('items-center justify-center', box), style: [style, { transform: [{ rotate }] }], ...props, children: _jsx(View, { className: "size-3/4 rounded-full", style: {
36
+ borderColor: typeof color === 'string' ? color : undefined,
37
+ borderTopColor: 'transparent',
38
+ borderWidth: strokeWidth,
39
+ } }) }));
40
+ }
41
+ //# sourceMappingURL=Spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAU/B;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,kBAAkB,GAAG,SAAS,EAC9B,aAAa,EAAE,UAAU,GAAG,KAAK,EACjC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACK;IACb,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;IACpD,6EAA6E;IAC7E,4DAA4D;IAC5D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CACxB,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;YACpB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,CAAC;YACV,qEAAqE;YACrE,eAAe,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK;SACvC,CAAC,CACH,CAAC;QACF,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAC9B,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;KAChC,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,QAAQ,CAAC,IAAI,IACZ,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,EAC/D,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,EACzD,UAAU,EAAE,CAAC,UAAU,iBACV,UAAU,EACvB,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,GAAG,CAAC,EACjD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,KACvC,KAAK,YAET,KAAC,IAAI,IACH,SAAS,EAAC,uBAAuB,EACjC,KAAK,EAAE;gBACL,WAAW,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;gBAC1D,cAAc,EAAE,aAAa;gBAC7B,WAAW,EAAE,WAAW;aACzB,GACD,GACY,CACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FlexProps } from './Flex';
2
+ export type XStackProps = Omit<FlexProps, 'direction'>;
3
+ export declare function XStack(props: XStackProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=XStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStack.d.ts","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEvD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from './Flex';
3
+ export function XStack(props) {
4
+ return _jsx(Flex, { direction: "row", ...props });
5
+ }
6
+ //# sourceMappingURL=XStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XStack.js","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAI9C,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,KAAC,IAAI,IAAC,SAAS,EAAC,KAAK,KAAK,KAAK,GAAI,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type FlexProps } from './Flex';
2
+ export type YStackProps = Omit<FlexProps, 'direction'>;
3
+ export declare function YStack(props: YStackProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=YStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YStack.d.ts","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEvD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from './Flex';
3
+ export function YStack(props) {
4
+ return _jsx(Flex, { direction: "column", ...props });
5
+ }
6
+ //# sourceMappingURL=YStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YStack.js","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAI9C,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,KAAK,KAAK,GAAI,CAAC;AAChD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { View } from 'react-native';
2
+ export type InputFrameProps = React.ComponentProps<typeof View> & {
3
+ disabled?: boolean;
4
+ focused: boolean;
5
+ invalid?: boolean;
6
+ };
7
+ /**
8
+ * The border, background and focus ring the web's `Input`, `Textarea` and
9
+ * `InputGroup` draw around their field. React Native has no `ring`, so a
10
+ * 3pt outline sits outside the border while the field has focus.
11
+ */
12
+ export declare function InputFrame({ children, className, disabled, focused, invalid, ...props }: InputFrameProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=InputFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputFrame.d.ts","sourceRoot":"","sources":["../../../src/components/_internal/InputFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,+BA2BjB"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { cn } from '../../lib/cn';
4
+ /**
5
+ * The border, background and focus ring the web's `Input`, `Textarea` and
6
+ * `InputGroup` draw around their field. React Native has no `ring`, so a
7
+ * 3pt outline sits outside the border while the field has focus.
8
+ */
9
+ export function InputFrame({ children, className, disabled, focused, invalid, ...props }) {
10
+ return (_jsxs(View, { className: cn('border-input bg-background dark:bg-input/32 w-full flex-row rounded-lg border shadow-xs shadow-black/5', invalid && 'border-destructive/36', focused && (invalid ? 'border-destructive/64' : 'border-ring'), (disabled || focused || invalid) && 'shadow-none', disabled && 'opacity-64', className), ...props, children: [children, focused ? (_jsx(View, { className: cn('absolute -inset-1 rounded-[calc(var(--radius)+3px)] border-[3px]', invalid
11
+ ? 'border-destructive/16 dark:border-destructive/24'
12
+ : 'border-ring/24'), pointerEvents: "none" })) : null] }));
13
+ }
14
+ //# sourceMappingURL=InputFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputFrame.js","sourceRoot":"","sources":["../../../src/components/_internal/InputFrame.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAQlC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EACP,GAAG,KAAK,EACQ;IAChB,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,wGAAwG,EACxG,OAAO,IAAI,uBAAuB,EAClC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC,EAC9D,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,aAAa,EACjD,QAAQ,IAAI,YAAY,EACxB,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACR,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,OAAO;oBACL,CAAC,CAAC,kDAAkD;oBACpD,CAAC,CAAC,gBAAgB,CACrB,EACD,aAAa,EAAC,MAAM,GACpB,CACH,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** A labelled box for the layout stories. */
2
+ export declare function StoryItem({ children, className, }: {
3
+ children: string;
4
+ className?: string;
5
+ }): import("react").JSX.Element;
6
+ //# sourceMappingURL=StoryItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoryItem.d.ts","sourceRoot":"","sources":["../../../src/components/_internal/StoryItem.tsx"],"names":[],"mappings":"AAKA,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAWA"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { View } from 'react-native';
3
+ import { cn } from '../../lib/cn';
4
+ import { Text } from '../Text';
5
+ /** A labelled box for the layout stories. */
6
+ export function StoryItem({ children, className, }) {
7
+ return (_jsx(View, { className: cn('border-border bg-muted items-center justify-center rounded-md border px-4 py-3', className), children: _jsx(Text, { children: children }) }));
8
+ }
9
+ //# sourceMappingURL=StoryItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoryItem.js","sourceRoot":"","sources":["../../../src/components/_internal/StoryItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,6CAA6C;AAC7C,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,GAIV;IACC,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,gFAAgF,EAChF,SAAS,CACV,YAED,KAAC,IAAI,cAAE,QAAQ,GAAQ,GAClB,CACR,CAAC;AACJ,CAAC"}