@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.
- package/dist/index.d.ts +92 -47
- package/dist/native/components/Background/Background/Background.props.d.ts +0 -1
- package/dist/native/components/Background/Background/Background.view.js +6 -2
- package/dist/native/components/Background/Background/Background.view.js.map +1 -1
- package/dist/native/components/Badge/Badge/Badge.props.d.ts +4 -2
- package/dist/native/components/Badge/Badge/Badge.view.js +16 -1
- package/dist/native/components/Badge/Badge/Badge.view.js.map +1 -1
- package/dist/native/components/Button/Button/Button.style.js +9 -8
- package/dist/native/components/Button/Button/Button.style.js.map +1 -1
- package/dist/native/components/Button/Button/Button.view.js +22 -8
- package/dist/native/components/Button/Button/Button.view.js.map +1 -1
- package/dist/native/components/ChatInput/ChatInput/ChatInput.state.js +12 -0
- package/dist/native/components/ChatInput/ChatInput/ChatInput.state.js.map +1 -1
- package/dist/native/components/ChatInput/ChatInput/ChatInput.view.js +24 -4
- package/dist/native/components/ChatInput/ChatInput/ChatInput.view.js.map +1 -1
- package/dist/native/components/ChatInput/ChatInput.js +3 -0
- package/dist/native/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/native/components/ChatInput/EditableInput.d.ts +1 -0
- package/dist/native/components/ChatInput/EditableInput.js +10 -0
- package/dist/native/components/ChatInput/EditableInput.js.map +1 -1
- package/dist/native/components/ChatInput/EditableInput.native.d.ts +1 -0
- package/dist/native/components/ChatInput/EditableInput.native.js.map +1 -1
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.state.js +15 -4
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.state.js.map +1 -1
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.js +1 -1
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.js.map +1 -1
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.native.js +1 -1
- package/dist/native/components/ColorPicker/ColorPicker/ColorPicker.view.native.js.map +1 -1
- package/dist/native/components/Command/Command/Command.state.js +1 -1
- package/dist/native/components/Command/Command/Command.state.js.map +1 -1
- package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.state.js +1 -2
- package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.state.js.map +1 -1
- package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.view.js +12 -1
- package/dist/native/components/ContextMenu/ContextMenu/ContextMenu.view.js.map +1 -1
- package/dist/native/components/DragAndDrop/DragAndDrop/DragAndDrop.state.js +1 -1
- package/dist/native/components/DragAndDrop/DragAndDrop/DragAndDrop.state.js.map +1 -1
- package/dist/native/components/DropZone/DropZone/DropZone.props.d.ts +0 -1
- package/dist/native/components/DropdownMenu/DropdownMenu/DropdownMenu.state.js +1 -2
- package/dist/native/components/DropdownMenu/DropdownMenu/DropdownMenu.state.js.map +1 -1
- package/dist/native/components/EditComponent/EditComponent.js +3 -1
- package/dist/native/components/EditComponent/EditComponent.js.map +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.state.js +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.state.js.map +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.js +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.js.map +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.native.js +1 -1
- package/dist/native/components/EmojiPicker/EmojiPicker/EmojiPicker.view.native.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +0 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js +35 -15
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js.map +1 -1
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.state.js +18 -7
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.state.js.map +1 -1
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.js +49 -13
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.js.map +1 -1
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.native.js +18 -1
- package/dist/native/components/Form/ColorInput/ColorInput/ColorInput.view.native.js.map +1 -1
- package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.d.ts +7 -0
- package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.js +113 -0
- package/dist/native/components/Form/ColorInput/ColorInput/colorFormat.js.map +1 -0
- package/dist/native/components/Form/ComboBox/ComboBox/ComboBox.view.js +26 -6
- package/dist/native/components/Form/ComboBox/ComboBox/ComboBox.view.js.map +1 -1
- package/dist/native/components/Form/ComboBox/ComboBox.js +3 -2
- package/dist/native/components/Form/ComboBox/ComboBox.js.map +1 -1
- package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.props.d.ts +4 -1
- package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.view.js +61 -12
- package/dist/native/components/Form/CountryPicker/CountryPicker/CountryPicker.view.js.map +1 -1
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.props.d.ts +0 -5
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.d.ts +2 -1
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js +16 -2
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js.map +1 -1
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.view.js +19 -4
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.view.js.map +1 -1
- package/dist/native/components/Form/DatePicker/DatePicker.js +1 -1
- package/dist/native/components/Form/DatePicker/DatePicker.js.map +1 -1
- package/dist/native/components/Form/Label/Label/Label.view.js +10 -2
- package/dist/native/components/Form/Label/Label/Label.view.js.map +1 -1
- package/dist/native/components/Form/Label/Label/Label.view.native.js +8 -2
- package/dist/native/components/Form/Label/Label/Label.view.native.js.map +1 -1
- package/dist/native/components/Form/Radio/Radio/Radio.view.js +33 -14
- package/dist/native/components/Form/Radio/Radio/Radio.view.js.map +1 -1
- package/dist/native/components/Form/Radio/RadioGroup/RadioGroup.view.js +7 -3
- package/dist/native/components/Form/Radio/RadioGroup/RadioGroup.view.js.map +1 -1
- package/dist/native/components/Form/Select/Select/Select.props.d.ts +0 -2
- package/dist/native/components/Form/Select/Select/Select.state.d.ts +1 -1
- package/dist/native/components/Form/Select/Select/Select.state.js +6 -1
- package/dist/native/components/Form/Select/Select/Select.state.js.map +1 -1
- package/dist/native/components/Form/Select/Select/Select.view.js +71 -18
- package/dist/native/components/Form/Select/Select/Select.view.js.map +1 -1
- package/dist/native/components/Form/Selector/Selector/Selector.props.d.ts +0 -7
- package/dist/native/components/Form/Selector/Selector/Selector.state.d.ts +1 -3
- package/dist/native/components/Form/Selector/Selector/Selector.state.js +5 -4
- package/dist/native/components/Form/Selector/Selector/Selector.state.js.map +1 -1
- package/dist/native/components/Form/Selector/Selector/Selector.view.js +27 -8
- package/dist/native/components/Form/Selector/Selector/Selector.view.js.map +1 -1
- package/dist/native/components/Form/Switch/Switch/Switch.props.d.ts +0 -1
- package/dist/native/components/Form/Switch/Switch/Switch.view.js +38 -4
- package/dist/native/components/Form/Switch/Switch/Switch.view.js.map +1 -1
- package/dist/native/components/Form/TagInput/TagInput/TagInput.props.d.ts +0 -5
- package/dist/native/components/Form/TagInput/TagInput/TagInput.view.js +1 -1
- package/dist/native/components/Form/TagInput/TagInput/TagInput.view.js.map +1 -1
- package/dist/native/components/Form/TagInput/TagInput.js +4 -1
- package/dist/native/components/Form/TagInput/TagInput.js.map +1 -1
- package/dist/native/components/Form/TextArea/TextArea/TextArea.props.d.ts +0 -1
- package/dist/native/components/Form/TextArea/TextArea/TextArea.view.js +10 -4
- package/dist/native/components/Form/TextArea/TextArea/TextArea.view.js.map +1 -1
- package/dist/native/components/Form/TextField/TextField/TextField.view.js +9 -3
- package/dist/native/components/Form/TextField/TextField/TextField.view.js.map +1 -1
- package/dist/native/components/IconPicker/IconPicker/IconPicker.state.js +1 -1
- package/dist/native/components/IconPicker/IconPicker/IconPicker.state.js.map +1 -1
- package/dist/native/components/Menubar/Menubar/Menubar.state.js +1 -1
- package/dist/native/components/Menubar/Menubar/Menubar.state.js.map +1 -1
- package/dist/native/components/Message/Message/Message.props.d.ts +0 -3
- package/dist/native/components/Modal/Modal/Modal.props.d.ts +1 -4
- package/dist/native/components/Modal/Modal/Modal.view.js +2 -2
- package/dist/native/components/Modal/Modal/Modal.view.js.map +1 -1
- package/dist/native/components/Modal/Modal/Modal.view.native.js +2 -2
- package/dist/native/components/Modal/Modal/Modal.view.native.js.map +1 -1
- package/dist/native/components/OTPInput/OTPInput/OTPInput.props.d.ts +0 -1
- package/dist/native/components/OTPInput/OTPInput/OTPInput.state.js +4 -44
- package/dist/native/components/OTPInput/OTPInput/OTPInput.state.js.map +1 -1
- package/dist/native/components/OTPInput/OTPInput/OTPInput.view.js +12 -4
- package/dist/native/components/OTPInput/OTPInput/OTPInput.view.js.map +1 -1
- package/dist/native/components/OTPInput/OTPInput.js +0 -22
- package/dist/native/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/native/components/Resizable/Resizable/Resizable.state.js +1 -1
- package/dist/native/components/Resizable/Resizable/Resizable.state.js.map +1 -1
- package/dist/native/components/Slider/Slider/Slider.state.js +1 -1
- package/dist/native/components/Slider/Slider/Slider.state.js.map +1 -1
- package/dist/native/components/StatusIndicator/StatusIndicator/StatusIndicator.props.d.ts +0 -4
- package/dist/native/components/Tabs/Tabs/Tabs.props.d.ts +12 -0
- package/dist/native/components/Tabs/Tabs/Tabs.view.js +15 -3
- package/dist/native/components/Tabs/Tabs/Tabs.view.js.map +1 -1
- package/dist/native/components/Tabs/Tabs.js +2 -2
- package/dist/native/components/Tabs/Tabs.js.map +1 -1
- package/dist/native/components/Title/Title/Title.state.js +45 -0
- package/dist/native/components/Title/Title/Title.state.js.map +1 -1
- package/dist/native/components/Tooltip/Tooltip/Tooltip.state.js +1 -1
- package/dist/native/components/Tooltip/Tooltip/Tooltip.state.js.map +1 -1
- package/dist/native/components/Uploader/Uploader/Uploader.props.d.ts +0 -2
- package/dist/native/components/Uploader/Uploader/Uploader.state.js +4 -0
- package/dist/native/components/Uploader/Uploader/Uploader.state.js.map +1 -1
- package/dist/native/components/index.d.ts +3 -0
- package/dist/native/components/index.js +3 -0
- package/dist/native/components/index.js.map +1 -1
- package/dist/native/design-system/DesignSystemProvider.js +3 -1
- package/dist/native/design-system/DesignSystemProvider.js.map +1 -1
- package/dist/native/design-system/configs/airbnb.json +1 -3
- package/dist/native/design-system/configs/apple.json +1 -3
- package/dist/native/design-system/configs/coinbase.json +1 -3
- package/dist/native/design-system/configs/default.json +1 -3
- package/dist/native/design-system/configs/figma.json +1 -3
- package/dist/native/design-system/configs/linear.json +1 -3
- package/dist/native/design-system/configs/nike.json +1 -3
- package/dist/native/design-system/configs/notion.json +1 -3
- package/dist/native/design-system/configs/revolut.json +1 -3
- package/dist/native/design-system/configs/shopify.json +1 -3
- package/dist/native/design-system/configs/spacex.json +8 -2
- package/dist/native/design-system/configs/spotify.json +1 -3
- package/dist/native/design-system/configs/stripe.json +1 -3
- package/dist/native/design-system/configs/tesla.json +1 -3
- package/dist/native/design-system/configs/uber.json +1 -3
- package/dist/native/design-system/configs/vercel.json +1 -3
- package/dist/native/design-system/types.d.ts +24 -8
- package/dist/native/design-system/utils.js +38 -1
- package/dist/native/design-system/utils.js.map +1 -1
- package/dist/native/utils/colors.d.ts +31 -0
- package/dist/native/utils/colors.js +322 -0
- package/dist/native/utils/colors.js.map +1 -0
- package/dist/web.cjs.js +11 -11
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +8086 -7546
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +11 -11
- package/dist/web.umd.js.map +1 -1
- package/docs/conventions.md +44 -0
- package/docs/typography.md +59 -0
- package/package.json +3 -3
package/docs/conventions.md
CHANGED
|
@@ -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.
|
|
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": "^
|
|
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.
|
|
203
|
+
"app-studio": ">=0.9.0",
|
|
204
204
|
"formik": ">=2",
|
|
205
205
|
"lucide-react": "*",
|
|
206
206
|
"lucide-react-native": "*",
|