@app-studio/components 0.10.29 → 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 (179) hide show
  1. package/dist/index.d.ts +92 -47
  2. package/dist/native/components/Background/Background/Background.props.d.ts +0 -1
  3. package/dist/native/components/Background/Background/Background.view.js +6 -2
  4. package/dist/native/components/Background/Background/Background.view.js.map +1 -1
  5. package/dist/native/components/Badge/Badge/Badge.props.d.ts +4 -2
  6. package/dist/native/components/Badge/Badge/Badge.view.js +16 -1
  7. package/dist/native/components/Badge/Badge/Badge.view.js.map +1 -1
  8. package/dist/native/components/Button/Button/Button.style.js +9 -8
  9. package/dist/native/components/Button/Button/Button.style.js.map +1 -1
  10. package/dist/native/components/Button/Button/Button.view.js +22 -8
  11. package/dist/native/components/Button/Button/Button.view.js.map +1 -1
  12. package/dist/native/components/ChatInput/ChatInput/ChatInput.state.js +12 -0
  13. package/dist/native/components/ChatInput/ChatInput/ChatInput.state.js.map +1 -1
  14. package/dist/native/components/ChatInput/ChatInput/ChatInput.view.js +24 -4
  15. package/dist/native/components/ChatInput/ChatInput/ChatInput.view.js.map +1 -1
  16. package/dist/native/components/ChatInput/ChatInput.js +3 -0
  17. package/dist/native/components/ChatInput/ChatInput.js.map +1 -1
  18. package/dist/native/components/ChatInput/EditableInput.d.ts +1 -0
  19. package/dist/native/components/ChatInput/EditableInput.js +10 -0
  20. package/dist/native/components/ChatInput/EditableInput.js.map +1 -1
  21. package/dist/native/components/ChatInput/EditableInput.native.d.ts +1 -0
  22. package/dist/native/components/ChatInput/EditableInput.native.js.map +1 -1
  23. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.state.js +15 -4
  24. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.state.js.map +1 -1
  25. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.js +1 -1
  26. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.js.map +1 -1
  27. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.native.js +1 -1
  28. package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.native.js.map +1 -1
  29. package/dist/native/components/Command/Command/Command.state.js +1 -1
  30. package/dist/native/components/Command/Command/Command.state.js.map +1 -1
  31. package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.state.js +1 -2
  32. package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.state.js.map +1 -1
  33. package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.view.js +12 -1
  34. package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.view.js.map +1 -1
  35. package/dist/native/components/DragAndDrop/DragAndDrop/DragAndDrop.state.js +1 -1
  36. package/dist/native/components/DragAndDrop/DragAndDrop/DragAndDrop.state.js.map +1 -1
  37. package/dist/native/components/DropZone/DropZone/DropZone.props.d.ts +0 -1
  38. package/dist/native/components/DropdownMenu/DropdownMenu/DropdownMenu.state.js +1 -2
  39. package/dist/native/components/DropdownMenu/DropdownMenu/DropdownMenu.state.js.map +1 -1
  40. package/dist/native/components/EditComponent/EditComponent.js +3 -1
  41. package/dist/native/components/EditComponent/EditComponent.js.map +1 -1
  42. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.state.js +1 -1
  43. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.state.js.map +1 -1
  44. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.js +1 -1
  45. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.js.map +1 -1
  46. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.native.js +1 -1
  47. package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.native.js.map +1 -1
  48. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +0 -1
  49. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js +35 -15
  50. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js.map +1 -1
  51. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js +1 -1
  52. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js.map +1 -1
  53. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.state.js +18 -7
  54. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.state.js.map +1 -1
  55. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.js +49 -13
  56. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.js.map +1 -1
  57. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.native.js +18 -1
  58. package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.native.js.map +1 -1
  59. package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.d.ts +7 -0
  60. package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.js +113 -0
  61. package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.js.map +1 -0
  62. package/dist/native/components/Form/ComboBox/ComboBox/ComboBox.view.js +26 -6
  63. package/dist/native/components/Form/ComboBox/ComboBox/ComboBox.view.js.map +1 -1
  64. package/dist/native/components/Form/ComboBox/ComboBox.js +3 -2
  65. package/dist/native/components/Form/ComboBox/ComboBox.js.map +1 -1
  66. package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.props.d.ts +4 -1
  67. package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.view.js +61 -12
  68. package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.view.js.map +1 -1
  69. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.props.d.ts +0 -5
  70. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.d.ts +2 -1
  71. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js +16 -2
  72. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js.map +1 -1
  73. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.view.js +19 -4
  74. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.view.js.map +1 -1
  75. package/dist/native/components/Form/DatePicker/DatePicker.js +1 -1
  76. package/dist/native/components/Form/DatePicker/DatePicker.js.map +1 -1
  77. package/dist/native/components/Form/Label/Label/Label.view.js +10 -2
  78. package/dist/native/components/Form/Label/Label/Label.view.js.map +1 -1
  79. package/dist/native/components/Form/Label/Label/Label.view.native.js +8 -2
  80. package/dist/native/components/Form/Label/Label/Label.view.native.js.map +1 -1
  81. package/dist/native/components/Form/Radio/Radio/Radio.view.js +33 -14
  82. package/dist/native/components/Form/Radio/Radio/Radio.view.js.map +1 -1
  83. package/dist/native/components/Form/Radio/RadioGroup/RadioGroup.view.js +7 -3
  84. package/dist/native/components/Form/Radio/RadioGroup/RadioGroup.view.js.map +1 -1
  85. package/dist/native/components/Form/Select/Select/Select.props.d.ts +0 -2
  86. package/dist/native/components/Form/Select/Select/Select.state.d.ts +1 -1
  87. package/dist/native/components/Form/Select/Select/Select.state.js +6 -1
  88. package/dist/native/components/Form/Select/Select/Select.state.js.map +1 -1
  89. package/dist/native/components/Form/Select/Select/Select.view.js +71 -18
  90. package/dist/native/components/Form/Select/Select/Select.view.js.map +1 -1
  91. package/dist/native/components/Form/Selector/Selector/Selector.props.d.ts +0 -7
  92. package/dist/native/components/Form/Selector/Selector/Selector.state.d.ts +1 -3
  93. package/dist/native/components/Form/Selector/Selector/Selector.state.js +5 -4
  94. package/dist/native/components/Form/Selector/Selector/Selector.state.js.map +1 -1
  95. package/dist/native/components/Form/Selector/Selector/Selector.view.js +27 -8
  96. package/dist/native/components/Form/Selector/Selector/Selector.view.js.map +1 -1
  97. package/dist/native/components/Form/Switch/Switch/Switch.props.d.ts +0 -1
  98. package/dist/native/components/Form/Switch/Switch/Switch.view.js +38 -4
  99. package/dist/native/components/Form/Switch/Switch/Switch.view.js.map +1 -1
  100. package/dist/native/components/Form/TagInput/TagInput/TagInput.props.d.ts +0 -5
  101. package/dist/native/components/Form/TagInput/TagInput/TagInput.view.js +1 -1
  102. package/dist/native/components/Form/TagInput/TagInput/TagInput.view.js.map +1 -1
  103. package/dist/native/components/Form/TagInput/TagInput.js +4 -1
  104. package/dist/native/components/Form/TagInput/TagInput.js.map +1 -1
  105. package/dist/native/components/Form/TextArea/TextArea/TextArea.props.d.ts +0 -1
  106. package/dist/native/components/Form/TextArea/TextArea/TextArea.view.js +10 -4
  107. package/dist/native/components/Form/TextArea/TextArea/TextArea.view.js.map +1 -1
  108. package/dist/native/components/Form/TextField/TextField/TextField.view.js +9 -3
  109. package/dist/native/components/Form/TextField/TextField/TextField.view.js.map +1 -1
  110. package/dist/native/components/IconPicker/IconPicker/IconPicker.state.js +1 -1
  111. package/dist/native/components/IconPicker/IconPicker/IconPicker.state.js.map +1 -1
  112. package/dist/native/components/Menubar/Menubar/Menubar.state.js +1 -1
  113. package/dist/native/components/Menubar/Menubar/Menubar.state.js.map +1 -1
  114. package/dist/native/components/Message/Message/Message.props.d.ts +0 -3
  115. package/dist/native/components/Modal/Modal/Modal.props.d.ts +1 -4
  116. package/dist/native/components/Modal/Modal/Modal.view.js +2 -2
  117. package/dist/native/components/Modal/Modal/Modal.view.js.map +1 -1
  118. package/dist/native/components/Modal/Modal/Modal.view.native.js +2 -2
  119. package/dist/native/components/Modal/Modal/Modal.view.native.js.map +1 -1
  120. package/dist/native/components/OTPInput/OTPInput/OTPInput.props.d.ts +0 -1
  121. package/dist/native/components/OTPInput/OTPInput/OTPInput.state.js +4 -44
  122. package/dist/native/components/OTPInput/OTPInput/OTPInput.state.js.map +1 -1
  123. package/dist/native/components/OTPInput/OTPInput/OTPInput.view.js +12 -4
  124. package/dist/native/components/OTPInput/OTPInput/OTPInput.view.js.map +1 -1
  125. package/dist/native/components/OTPInput/OTPInput.js +0 -22
  126. package/dist/native/components/OTPInput/OTPInput.js.map +1 -1
  127. package/dist/native/components/Resizable/Resizable/Resizable.state.js +1 -1
  128. package/dist/native/components/Resizable/Resizable/Resizable.state.js.map +1 -1
  129. package/dist/native/components/Slider/Slider/Slider.state.js +1 -1
  130. package/dist/native/components/Slider/Slider/Slider.state.js.map +1 -1
  131. package/dist/native/components/StatusIndicator/StatusIndicator/StatusIndicator.props.d.ts +0 -4
  132. package/dist/native/components/Tabs/Tabs/Tabs.props.d.ts +12 -0
  133. package/dist/native/components/Tabs/Tabs/Tabs.view.js +15 -3
  134. package/dist/native/components/Tabs/Tabs/Tabs.view.js.map +1 -1
  135. package/dist/native/components/Tabs/Tabs.js +2 -2
  136. package/dist/native/components/Tabs/Tabs.js.map +1 -1
  137. package/dist/native/components/Title/Title/Title.state.js +45 -0
  138. package/dist/native/components/Title/Title/Title.state.js.map +1 -1
  139. package/dist/native/components/Tooltip/Tooltip/Tooltip.state.js +1 -1
  140. package/dist/native/components/Tooltip/Tooltip/Tooltip.state.js.map +1 -1
  141. package/dist/native/components/Uploader/Uploader/Uploader.props.d.ts +0 -2
  142. package/dist/native/components/Uploader/Uploader/Uploader.state.js +4 -0
  143. package/dist/native/components/Uploader/Uploader/Uploader.state.js.map +1 -1
  144. package/dist/native/components/index.d.ts +3 -0
  145. package/dist/native/components/index.js +3 -0
  146. package/dist/native/components/index.js.map +1 -1
  147. package/dist/native/design-system/DesignSystemProvider.js +3 -1
  148. package/dist/native/design-system/DesignSystemProvider.js.map +1 -1
  149. package/dist/native/design-system/configs/airbnb.json +1 -3
  150. package/dist/native/design-system/configs/apple.json +1 -3
  151. package/dist/native/design-system/configs/coinbase.json +1 -3
  152. package/dist/native/design-system/configs/default.json +1 -3
  153. package/dist/native/design-system/configs/figma.json +1 -3
  154. package/dist/native/design-system/configs/linear.json +1 -3
  155. package/dist/native/design-system/configs/nike.json +1 -3
  156. package/dist/native/design-system/configs/notion.json +1 -3
  157. package/dist/native/design-system/configs/revolut.json +1 -3
  158. package/dist/native/design-system/configs/shopify.json +1 -3
  159. package/dist/native/design-system/configs/spacex.json +8 -2
  160. package/dist/native/design-system/configs/spotify.json +1 -3
  161. package/dist/native/design-system/configs/stripe.json +1 -3
  162. package/dist/native/design-system/configs/tesla.json +1 -3
  163. package/dist/native/design-system/configs/uber.json +1 -3
  164. package/dist/native/design-system/configs/vercel.json +1 -3
  165. package/dist/native/design-system/types.d.ts +24 -8
  166. package/dist/native/design-system/utils.js +38 -1
  167. package/dist/native/design-system/utils.js.map +1 -1
  168. package/dist/native/utils/colors.d.ts +31 -0
  169. package/dist/native/utils/colors.js +322 -0
  170. package/dist/native/utils/colors.js.map +1 -0
  171. package/dist/web.cjs.js +11 -11
  172. package/dist/web.cjs.js.map +1 -1
  173. package/dist/web.esm.js +8086 -7546
  174. package/dist/web.esm.js.map +1 -1
  175. package/dist/web.umd.js +11 -11
  176. package/dist/web.umd.js.map +1 -1
  177. package/docs/conventions.md +44 -0
  178. package/docs/typography.md +59 -0
  179. package/package.json +3 -3
@@ -260,6 +260,14 @@ const ButtonView: React.FC<ButtonProps> = ({ children, isDisabled, ...props }) =
260
260
 
261
261
  ## Styling Conventions
262
262
 
263
+ ### Typography Scales
264
+
265
+ Three scales ship with the library — the control scale (`FontSizes`,
266
+ 10–20px, for dense UI), the heading scale (`HeadingSizes`, `h6`–`h1`), and
267
+ the display scale (`TitleSizes`, hero surfaces only). See
268
+ [typography.md](./typography.md) for which one to reach for; do not use
269
+ `Title` inside application chrome.
270
+
263
271
  ### App-Studio Layout Components
264
272
 
265
273
  Use the layout components from `app-studio` for consistent layout:
@@ -386,6 +394,26 @@ Card.Content = CardContent;
386
394
  Card.Footer = CardFooter;
387
395
  ```
388
396
 
397
+ ### Interactive Controls
398
+
399
+ The real form control must be the element the user sees and clicks — never a
400
+ decorative `<div>` layered over a hidden input.
401
+
402
+ - Never collapse the native input to `width: 0; height: 0`. An element with no
403
+ box receives no clicks: assistive technology, keyboard users, and automated
404
+ drivers all find the control by role/name, then fail to interact with it.
405
+ - If the control's look is drawn by styled elements (track, knob, swatch…),
406
+ render the native input as a transparent overlay covering the visible
407
+ control: `position: absolute`, full width/height of the visual, `opacity: 0`.
408
+ Click, tap, focus and `getByRole(...)` then all land on the same element.
409
+ - Give the input the semantics of the widget it represents (`role="switch"`
410
+ and `aria-checked` for a toggle) and always associate the visible label
411
+ (`htmlFor`/`id`, or wrap the input in the `<label>`).
412
+ - Controls must accept a controlled `value`/`isChecked` prop; a component that
413
+ can only display its internal state is decoration, not a control.
414
+
415
+ `Switch` and `Select` follow this contract; use them as references.
416
+
389
417
  ## Documentation Conventions
390
418
 
391
419
  ### JSDoc Comments
@@ -507,6 +535,22 @@ describe('Button', () => {
507
535
  });
508
536
  ```
509
537
 
538
+ ### Styling Props Compile to Atomic Classes — Never Assert on `style`
539
+
540
+ `app-studio` compiles styling props into atomic class names, not inline
541
+ styles: `<Text fontSize={13}>` renders as `class="fse-13px"` with an empty
542
+ `style` attribute. Practical consequences for tests:
543
+
544
+ - Reading `element.style.*` (or `toHaveStyle` on a styling prop) on an App
545
+ Studio component silently misses — the value lives in a generated
546
+ stylesheet, keyed by class.
547
+ - Assert behavior and semantics instead: roles, accessible names, attributes,
548
+ and user interactions.
549
+ - When a visual fact must be checked and behavior can't capture it, assert on
550
+ the presence (or absence) of the atomic class token, e.g.
551
+ `expect(input.className).not.toMatch(/wh-0px/)` — and treat this as a last
552
+ resort, since token names are an implementation detail.
553
+
510
554
  ## Git Conventions
511
555
 
512
556
  ### Branch Naming
@@ -0,0 +1,59 @@
1
+ # Typography Scales — Which One to Reach For
2
+
3
+ The library ships three typography scales with different intended ranges.
4
+ Reaching for the wrong one is the most common cause of "why is this control
5
+ 28px tall" bugs: the display scales start where the control scale ends.
6
+
7
+ ## Control scale — `FontSizes` (`src/utils/typography.ts`)
8
+
9
+ For **dense UI**: form controls, table cells, badges, helper text, anything
10
+ inside a field shell. This is the scale `size="xs…xl"` maps to on form
11
+ components (TextField, Select, Checkbox, …).
12
+
13
+ | size | px | typical use |
14
+ | ---- | -- | ----------- |
15
+ | `xs` | 10 | badges, overlines, micro-labels |
16
+ | `sm` | 12 | helper text, table meta, chips |
17
+ | `md` | 14 | default control text, body in dense layouts |
18
+ | `lg` | 16 | prominent controls, body text |
19
+ | `xl` | 20 | section leads, large controls |
20
+
21
+ ## Heading scale — `HeadingSizes` (`Label` / `Text` `heading="h1…h6"`)
22
+
23
+ For **document structure**: page and section headings inside content. `h6`
24
+ (20px) down to `h4` (34px) are the ones that coexist with controls; `h1–h3`
25
+ (48–96px) are hero-sized.
26
+
27
+ | heading | px | typical use |
28
+ | ------- | -- | ----------- |
29
+ | `h6` | 20 | card titles, dense section headers |
30
+ | `h5` | 24 | section headers |
31
+ | `h4` | 34 | page titles |
32
+ | `h3` | 48 | large page titles |
33
+ | `h2` | 60 | hero secondary |
34
+ | `h1` | 96 | hero |
35
+
36
+ ## Display scale — `TitleSizes` (`Title` `size="xs…xl"`)
37
+
38
+ For **marketing/hero surfaces only** — `Title` is not a heading for app
39
+ screens. Its `xs` (24px) already overlaps `h5`, and `md` (48px) upward is
40
+ hero territory. Inside application chrome, use `Text heading="h4…h6"` or the
41
+ control scale instead.
42
+
43
+ | size | px |
44
+ | ---- | -- |
45
+ | `xs` | 24 |
46
+ | `sm` | 32 |
47
+ | `md` | 48 |
48
+ | `lg` | 96 |
49
+ | `xl` | 110 |
50
+
51
+ ## Rule of thumb
52
+
53
+ - Inside a field, row, or menu → control scale (`size`).
54
+ - Titling a card, panel, or page → `heading="h4…h6"`.
55
+ - Above the fold on a landing page → `Title`.
56
+
57
+ There is no `T*`/`C*` token scale in this library; if your product's design
58
+ tokens use that naming, they map onto the tables above (a "T2 ≈ 28px desktop"
59
+ sits between `h4` and `h5` — app screens should round it down to `h5`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-studio/components",
3
- "version": "0.10.29",
3
+ "version": "0.11.0",
4
4
  "main": "dist/web.cjs.js",
5
5
  "module": "dist/web.esm.js",
6
6
  "react-native": "dist/native/components/index.js",
@@ -134,7 +134,7 @@
134
134
  "@mdxeditor/editor": "^3.21.0",
135
135
  "@size-limit/preset-small-lib": "^10.0.2",
136
136
  "@testing-library/dom": "^10.4.0",
137
- "@testing-library/jest-dom": "^5.17.0",
137
+ "@testing-library/jest-dom": "^6.9.1",
138
138
  "@testing-library/react": "^16.1.0",
139
139
  "@testing-library/user-event": "^14.5.2",
140
140
  "@types/compression": "^1.8.1",
@@ -200,7 +200,7 @@
200
200
  "zustand": "^4.3.8"
201
201
  },
202
202
  "peerDependencies": {
203
- "app-studio": ">=0.8.0",
203
+ "app-studio": ">=0.9.0",
204
204
  "formik": ">=2",
205
205
  "lucide-react": "*",
206
206
  "lucide-react-native": "*",