@jobber/components-native 0.101.5 → 0.101.6
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/docs/ActionItem/ActionItem.md +65 -0
- package/dist/docs/ActionItemGroup/ActionItemGroup.md +33 -0
- package/dist/docs/ActionLabel/ActionLabel.md +43 -0
- package/dist/docs/ActivityIndicator/ActivityIndicator.md +116 -0
- package/dist/docs/Animation/Animation.md +71 -0
- package/dist/docs/AtlantisThemeContext/AtlantisThemeContext.md +256 -0
- package/dist/docs/AutoLink/AutoLink.md +47 -0
- package/dist/docs/Banner/Banner.md +390 -0
- package/dist/docs/Borders/Borders.md +45 -0
- package/dist/docs/BottomSheet/BottomSheet.md +67 -0
- package/dist/docs/Button/Button.md +918 -0
- package/dist/docs/ButtonGroup/ButtonGroup.md +89 -0
- package/dist/docs/Card/Card.md +270 -0
- package/dist/docs/Checkbox/Checkbox.md +69 -0
- package/dist/docs/Chip/Chip.md +371 -0
- package/dist/docs/Colors/Colors.md +217 -0
- package/dist/docs/Content/Content.md +67 -0
- package/dist/docs/ContentOverlay/ContentOverlay.md +64 -0
- package/dist/docs/Disclosure/Disclosure.md +161 -0
- package/dist/docs/Divider/Divider.md +84 -0
- package/dist/docs/Elevations/Elevations.md +76 -0
- package/dist/docs/EmptyState/EmptyState.md +72 -0
- package/dist/docs/Flex/Flex.md +37 -0
- package/dist/docs/Form/Form.md +126 -0
- package/dist/docs/FormField/FormField.md +57 -0
- package/dist/docs/FormatFile/FormatFile.md +56 -0
- package/dist/docs/Glimmer/Glimmer.md +143 -0
- package/dist/docs/Heading/Heading.md +132 -0
- package/dist/docs/Icon/Icon.md +585 -0
- package/dist/docs/IconButton/IconButton.md +25 -0
- package/dist/docs/InputCurrency/InputCurrency.md +61 -0
- package/dist/docs/InputDate/InputDate.md +133 -0
- package/dist/docs/InputEmail/InputEmail.md +69 -0
- package/dist/docs/InputFieldWrapper/InputFieldWrapper.md +70 -0
- package/dist/docs/InputNumber/InputNumber.md +72 -0
- package/dist/docs/InputPassword/InputPassword.md +61 -0
- package/dist/docs/InputPressable/InputPressable.md +64 -0
- package/dist/docs/InputSearch/InputSearch.md +49 -0
- package/dist/docs/InputText/InputText.md +324 -0
- package/dist/docs/InputTime/InputTime.md +54 -0
- package/dist/docs/Opacity/Opacity.md +12 -0
- package/dist/docs/ProgressBar/ProgressBar.md +39 -0
- package/dist/docs/Radii/Radii.md +23 -0
- package/dist/docs/ResponsiveBreakpoint/ResponsiveBreakpoint.md +74 -0
- package/dist/docs/Select/Select.md +213 -0
- package/dist/docs/Spacing/Spacing.md +103 -0
- package/dist/docs/StatusLabel/StatusLabel.md +119 -0
- package/dist/docs/Switch/Switch.md +54 -0
- package/dist/docs/Text/Text.md +368 -0
- package/dist/docs/TextList/TextList.md +29 -0
- package/dist/docs/ThumbnailList/ThumbnailList.md +16 -0
- package/dist/docs/Toast/Toast.md +71 -0
- package/dist/docs/Typography/Typography.md +170 -0
- package/dist/docs/choosing-components/choosing-components.md +76 -0
- package/dist/docs/customizing-components/customizing-components.md +167 -0
- package/dist/docs/disabled-states/disabled-states.md +86 -0
- package/dist/docs/empty-states/empty-states.md +126 -0
- package/dist/docs/errors/errors.md +114 -0
- package/dist/docs/index.md +64 -0
- package/dist/docs/interaction/interaction.md +109 -0
- package/dist/docs/page-layouts/page-layouts.md +323 -0
- package/dist/docs/scaffolding/scaffolding.md +109 -0
- package/dist/docs/settings/settings.md +58 -0
- package/dist/docs/usage-guidelines/usage-guidelines.md +177 -0
- package/dist/package.json +8 -4
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -4
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Atlantis Usage Rules
|
|
2
|
+
|
|
3
|
+
Conventions and rules that apply to all Atlantis component usage. Read this
|
|
4
|
+
before generating any Atlantis code.
|
|
5
|
+
|
|
6
|
+
***
|
|
7
|
+
|
|
8
|
+
## Always use version= for migrated components
|
|
9
|
+
|
|
10
|
+
The following components have a v2 implementation. **Always pass
|
|
11
|
+
`version={2}`**. Never generate v1 usage for these components — v1 is
|
|
12
|
+
deprecated.
|
|
13
|
+
|
|
14
|
+
| Component | Import | v2 prop |
|
|
15
|
+
| ---------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| Autocomplete | `import { Autocomplete } from "@jobber/components/Autocomplete"` | `version={2}` — fully controlled, async support |
|
|
17
|
+
| Checkbox | `import { Checkbox } from "@jobber/components/Checkbox"` | `version={2}` |
|
|
18
|
+
| InputDate | `import { InputDate } from "@jobber/components/InputDate"` | `version={2}` |
|
|
19
|
+
| InputEmail | `import { InputEmail } from "@jobber/components/InputEmail"` | `version={2}` |
|
|
20
|
+
| InputNumber | `import { InputNumber } from "@jobber/components/InputNumber"` | `version={2}` |
|
|
21
|
+
| InputPhoneNumber | `import { InputPhoneNumber } from "@jobber/components/InputPhoneNumber"` | `version={2}` |
|
|
22
|
+
| InputText | `import { InputText } from "@jobber/components/InputText"` | `version={2}` |
|
|
23
|
+
| InputTime | `import { InputTime } from "@jobber/components/InputTime"` | `version={2}` |
|
|
24
|
+
| Modal | `import { Modal } from "@jobber/components/Modal"` | `version={2}` — uses `Modal.Provider` composition |
|
|
25
|
+
| Select | `import { Select } from "@jobber/components/Select"` | `version={2}` — native `<select>`; opt into the customizable Chromium UI with `UNSAFE_experimentalStyles` |
|
|
26
|
+
|
|
27
|
+
## Deprecated components — do not use
|
|
28
|
+
|
|
29
|
+
| Deprecated | Replacement | Notes |
|
|
30
|
+
| --------------------- | ----------------------------------------------------- | -------------------------------------------------- |
|
|
31
|
+
| `MultiSelect` | `Autocomplete` v2 with `multiple` prop, or `Combobox` | Fully deprecated, no longer supported. |
|
|
32
|
+
| `RecurringSelect` | None (will be removed) | Deprecated, will be removed in next major version. |
|
|
33
|
+
| `Chips` (dismissible) | `Autocomplete` v2 with `multiple` prop | Dismissible Chips variant is deprecated. |
|
|
34
|
+
|
|
35
|
+
### Deprecated props on still-supported components
|
|
36
|
+
|
|
37
|
+
| Component | Deprecated prop | Replacement |
|
|
38
|
+
| -------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------- |
|
|
39
|
+
| `Button` | `to` | Use `url` for anchor links. |
|
|
40
|
+
| `Card` | `title` | Use the `header` prop, or compose with `Card.Header` and `Card.Body`. |
|
|
41
|
+
| `Toast` | `action`, `actionLabel` | Both will be removed in the next major version. Trigger follow-up work from outside the toast. |
|
|
42
|
+
| Text inputs (`InputText` v2 etc.) | `onEnter` | Use `onKeyDown` or `onKeyUp` and check the key. |
|
|
43
|
+
| `Select` v2 | `onEnter` | Use `onKeyDown` or `onKeyUp`. |
|
|
44
|
+
| `FormField` (`maxLength` on v1 inputs) | `maxLength` | Flagged in source as flawed; only kept for v1 backwards compatibility. |
|
|
45
|
+
|
|
46
|
+
## Import pattern
|
|
47
|
+
|
|
48
|
+
Always use named imports from subpath exports:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// ✅ Correct
|
|
52
|
+
import { Button } from "@jobber/components/Button";
|
|
53
|
+
import { InputText } from "@jobber/components/InputText";
|
|
54
|
+
|
|
55
|
+
// ❌ Wrong — do not use barrel imports
|
|
56
|
+
import { Button, InputText } from "@jobber/components";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Design tokens
|
|
60
|
+
|
|
61
|
+
Never hardcode colors, spacing, or other visual values. Use CSS Modules with CSS
|
|
62
|
+
custom properties from `@jobber/design`. Tokens are included in:
|
|
63
|
+
`@jobber/design/dist/foundation.css`
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/* ✅ Correct */
|
|
67
|
+
.header {
|
|
68
|
+
color: var(--color-heading);
|
|
69
|
+
padding: var(--space-base);
|
|
70
|
+
border-radius: var(--radius-base);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ❌ Wrong */
|
|
74
|
+
.header {
|
|
75
|
+
color: #1a1a1a;
|
|
76
|
+
padding: 16px;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Form composition
|
|
82
|
+
|
|
83
|
+
v2 inputs are thin wrappers over native HTML inputs. They have no internal form
|
|
84
|
+
state, no built-in validation orchestration, and no React Hook Form dependency —
|
|
85
|
+
they behave like `<input>` elements with Atlantis styling. Compose them inside a
|
|
86
|
+
plain `<form>` and manage state and submission yourself (or with the form
|
|
87
|
+
library of your choice).
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<form onSubmit={handleSubmit}>
|
|
91
|
+
<Content>
|
|
92
|
+
<InputText version={2} name="name" placeholder="Name" />
|
|
93
|
+
<InputEmail version={2} name="email" placeholder="Email" />
|
|
94
|
+
<Button type="submit" label="Save" />
|
|
95
|
+
</Content>
|
|
96
|
+
</form>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Do not wrap v2 inputs in the Atlantis `Form` or `FormField` components — those
|
|
100
|
+
are legacy helpers tied to v1 inputs and React Hook Form. Mixing them with v2
|
|
101
|
+
inputs will not give you v2's controlled API and is not supported.
|
|
102
|
+
|
|
103
|
+
### Validation on v2 inputs
|
|
104
|
+
|
|
105
|
+
v2 inputs do not run validation themselves. To show an error state, drive it
|
|
106
|
+
from your own state and pass `invalid` (boolean) and/or `error` (string message)
|
|
107
|
+
on the input. The same applies to `Autocomplete` v2 — pass `error` / `invalid`
|
|
108
|
+
rather than expecting the component to validate.
|
|
109
|
+
|
|
110
|
+
## Compound components — use the documented composition
|
|
111
|
+
|
|
112
|
+
Many components expose dot-notation subcomponents that must be used together.
|
|
113
|
+
Don't try to recreate their structure with raw markup or arbitrary nesting — the
|
|
114
|
+
parent reads its compound children to wire up state, accessibility, and styling.
|
|
115
|
+
|
|
116
|
+
| Component | Subcomponents | Usage |
|
|
117
|
+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
118
|
+
| `Modal` v2 | `Modal.Provider`, `Modal.Activator`, `Modal.Content`, `Modal.Header`, `Modal.Actions` | Wrap with `Modal.Provider`. `Modal.Header` and `Modal.Actions` must be **direct children** of `Modal.Content` for sticky behavior to work. Use `Modal.Activator` to control focus return when the trigger element unmounts. |
|
|
119
|
+
| `Banner` | `Banner.Provider`, `Banner.Content`, `Banner.Icon`, `Banner.DismissButton`, `Banner.Action` | Either the simple `<Banner type="...">children</Banner>` form, or the Provider form: `Banner.Provider` > `Banner.Content` (+ optional `Banner.Icon` / `Banner.Action` / `Banner.DismissButton`). |
|
|
120
|
+
| `Card` | `Card.Header`, `Card.Body` | `Card` > `Card.Header` + `Card.Body`. The legacy `header` string/element prop still works for simple cases. Use composition for any header that needs richer markup. |
|
|
121
|
+
| `Combobox` | `Combobox.Activator`, `Combobox.Option`, `Combobox.Action` | `Combobox` > optional `Combobox.Activator`, one or more `Combobox.Option`, optional `Combobox.Action`. Omitting `Combobox.Activator` renders the default activator. |
|
|
122
|
+
| `Select` v2 | `Select.Option`, `Select.OptionGroup` | These map directly to native `<option>` and `<optgroup>`. Use `UNSAFE_experimentalStyles` to opt into the customizable Chromium UI for grouped menus. |
|
|
123
|
+
| `DataTable` | `DataTable.Container`, `DataTable.Table`, `DataTable.Header`, `DataTable.HeaderCell`, `DataTable.SortableHeader`, `DataTable.Body`, `DataTable.Row`, `DataTable.Cell`, `DataTable.RowActions`, `DataTable.Actions`, `DataTable.Footer`, `DataTable.Pagination`, `DataTable.PaginationButton` | `DataTable.Footer` is a sibling of `DataTable.Body`, not a child. Place pagination outside the table (not inside the footer). For `layout="fixed"`, pass explicit widths via `style={{ width: "..." }}` on each `HeaderCell`. |
|
|
124
|
+
| `Menu` (web composable) | `Menu.Trigger`, `Menu.Content`, `Menu.Section`, `Menu.Header`, `Menu.HeaderLabel`, `Menu.Item`, `Menu.ItemIcon`, `Menu.ItemLabel`, `Menu.Separator` | `Menu` > `Menu.Trigger` + `Menu.Content` containing `Menu.Item`s (optionally grouped in `Menu.Section`s). Each `Menu.Item` must include `textValue` for type-ahead and screen readers. |
|
|
125
|
+
| `Page` | `Page.Header`, `Page.HeaderContent`, `Page.TitleBar`, `Page.Title`, `Page.Subtitle`, `Page.Intro`, `Page.Actions`, `Page.ActionPrimary`, `Page.ActionSecondary`, `Page.ActionMenu`, `Page.PrimaryButton`, `Page.SecondaryButton`, `Page.Menu`, `Page.Body` | Composable `Page` API: `Page` > `Page.Header` (containing `Page.HeaderContent` with `Page.TitleBar` > `Page.Title` / `Page.Subtitle`, and `Page.Actions` with `Page.ActionPrimary` / `Page.ActionSecondary` / `Page.ActionMenu`) + `Page.Body`. The legacy props-based API (`title`, `subtitle`, `intro`, etc.) still works. |
|
|
126
|
+
| `SideDrawer` | `SideDrawer.Title`, `SideDrawer.Toolbar`, `SideDrawer.Actions`, `SideDrawer.BackButton`, `SideDrawer.Footer` | All children are optional. The `Toolbar` is sticky; the `Footer` is fixed. |
|
|
127
|
+
| `Popover` | `Popover.Provider`, `Popover.Arrow`, `Popover.DismissButton` | Both the simple and Provider forms require `attachTo={ref}` — Popover is anchored to a referenced element, not the DOM tree. |
|
|
128
|
+
| `DataList` | `DataList.Layout`, `DataList.LayoutActions`, `DataList.EmptyState`, `DataList.Filters`, `DataList.Search`, `DataList.ItemActions`, `DataList.ItemAction`, `DataList.BatchActions`, `DataList.BatchAction`, `DataList.StatusBar` | Pass `data` and `headers` as props to `DataList`; declare layouts, filters, and per-row/batch actions as compound children. `DataList.Layout` accepts a `size` breakpoint prop to swap layouts at different viewport widths. |
|
|
129
|
+
| `LightBox` | `LightBox.Provider`, `LightBox.Content`, `LightBox.Background`, `LightBox.Overlay`, `LightBox.Toolbar`, `LightBox.Slides`, `LightBox.Navigation`, `LightBox.Caption`, `LightBox.Thumbnails` | Wrap with `LightBox.Provider`; compose visible chrome (toolbar, navigation, caption, thumbnails) under `LightBox.Content`. |
|
|
130
|
+
| `Tabs` | `Tab` (sibling export, not a dot-notation subcomponent) | `Tabs` > one or more `<Tab label="...">` children. Each `Tab` is rendered as a panel. |
|
|
131
|
+
|
|
132
|
+
## Accessibility — required props
|
|
133
|
+
|
|
134
|
+
* **Icon-only `Button`** (a `Button` with `icon` and no `label`) **must**
|
|
135
|
+
include `ariaLabel`. The `Button` type system enforces this at the type level.
|
|
136
|
+
* **`ButtonDismiss`** requires `ariaLabel` (e.g. `"Close"`, `"Dismiss"`) — it
|
|
137
|
+
has no visible text.
|
|
138
|
+
* **`Menu.Item`** must provide `textValue` so type-ahead and screen readers work
|
|
139
|
+
when the visible content isn't plain text (e.g. when the item contains
|
|
140
|
+
`Menu.ItemIcon` + `Menu.ItemLabel`).
|
|
141
|
+
* **`DataTable.PaginationButton`** requires `ariaLabel`; pass a function that
|
|
142
|
+
returns a translated label per state (e.g. `"Next page"`, `"Previous page"`).
|
|
143
|
+
* **`RadioGroup` options whose `children` aren't text** must provide
|
|
144
|
+
`aria-label` on the option so it has an accessible name.
|
|
145
|
+
* **`Modal` v2 without a `Modal.Header` title** must set either
|
|
146
|
+
`modalLabelledBy` (id of an existing element) or `ariaLabel` on the modal so
|
|
147
|
+
the dialog has an accessible name. A `Modal.Header` title takes precedence
|
|
148
|
+
over `ariaLabel` when both are provided.
|
|
149
|
+
|
|
150
|
+
## UNSAFE\_ props
|
|
151
|
+
|
|
152
|
+
Props prefixed with `UNSAFE_` (`UNSAFE_className`, `UNSAFE_style`,
|
|
153
|
+
`UNSAFE_experimentalStyles`) are escape hatches. Avoid them by default. Reach
|
|
154
|
+
for them only when the component's documented API can't express the need, and
|
|
155
|
+
prefer design tokens inside any custom styles you do write. See
|
|
156
|
+
[Customizing components](../customizing-components/customizing-components.md) for the full guidance.
|
|
157
|
+
|
|
158
|
+
## Component specific guidelines
|
|
159
|
+
|
|
160
|
+
### Cards
|
|
161
|
+
|
|
162
|
+
* When using the Card component, always put a Content component inside of it,
|
|
163
|
+
any content that needs to go inside the card goes inside the Content
|
|
164
|
+
component.
|
|
165
|
+
* If using two cards next to each other horizontally, ensure they have a gap
|
|
166
|
+
between them
|
|
167
|
+
|
|
168
|
+
### Modal
|
|
169
|
+
|
|
170
|
+
* When using a modal as part of an app, always wrap the inner content of the
|
|
171
|
+
modal in the Content component, this is what gives it the padding the form
|
|
172
|
+
needs from the edges of the modal.
|
|
173
|
+
* Content will also provide the gap necessary between fields
|
|
174
|
+
|
|
175
|
+
### Color
|
|
176
|
+
|
|
177
|
+
* Only use surface colours for backgrounds
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.101.
|
|
3
|
+
"version": "0.101.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"types": "dist/types/src/index.d.ts",
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
|
+
"dist/docs/**/*",
|
|
20
21
|
"src",
|
|
21
22
|
"!**/__tests__",
|
|
22
23
|
"!**/__fixtures__",
|
|
@@ -29,7 +30,10 @@
|
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"clean": "rm -rf dist/* tsconfig.tsbuildinfo",
|
|
32
|
-
"build": "pnpm run build:clean && pnpm run compile",
|
|
33
|
+
"build": "pnpm run build:clean && pnpm run compile && pnpm run build:llm-docs:bundle",
|
|
34
|
+
"build:llm-docs:bundle": "pnpm run build:llm-docs:clean && pnpm run build:llm-docs:mobile",
|
|
35
|
+
"build:llm-docs:mobile": "pnpm run --filter @jobber/atlantis-site generate:llm-docs -- --platform mobile --out ../components-native/dist/docs",
|
|
36
|
+
"build:llm-docs:clean": "rm -rf ./dist/docs",
|
|
33
37
|
"bootstrap": "pnpm run build",
|
|
34
38
|
"prepack": "pnpm run build",
|
|
35
39
|
"watch": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
"devDependencies": {
|
|
55
59
|
"@babel/runtime": "^7.29.2",
|
|
56
60
|
"@gorhom/bottom-sheet": "^5.2.8",
|
|
57
|
-
"@jobber/design": "0.
|
|
61
|
+
"@jobber/design": "0.98.0",
|
|
58
62
|
"@jobber/hooks": "2.19.4",
|
|
59
63
|
"@react-native-community/datetimepicker": "^8.4.5",
|
|
60
64
|
"@react-native/babel-preset": "^0.82.1",
|
|
@@ -105,5 +109,5 @@
|
|
|
105
109
|
"react-native-screens": ">=4.18.0",
|
|
106
110
|
"react-native-svg": ">=12.0.0"
|
|
107
111
|
},
|
|
108
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "e2f47074cb070d5d3297cbdee855e920d8b49e95"
|
|
109
113
|
}
|