@tonycodes-ui/mortar 0.19.1 → 0.20.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/CHANGELOG.md +3 -3
- package/catalog.json +119 -119
- package/dist/agent-data.json +1 -1
- package/docs/native.md +20 -12
- package/package.json +1 -1
package/docs/native.md
CHANGED
|
@@ -49,16 +49,23 @@ Button("Cancel", action: cancel).buttonStyle(.mortar(.ghost))
|
|
|
49
49
|
|
|
50
50
|
A brand is a `MortarTheme`: its light and dark `MortarPalette`s, font family names (registered by the app) and density. Every component reads the palette that matches the colour scheme, and scales its text with Dynamic Type.
|
|
51
51
|
|
|
52
|
-
| Component | Web equivalent
|
|
53
|
-
| ---------------------------------------------------------- |
|
|
54
|
-
| `MortarButton`, `.buttonStyle(.mortar(_:size:isLoading:))` | Button
|
|
55
|
-
| `MortarBadge` | Badge
|
|
56
|
-
| `MortarCard` | Card
|
|
57
|
-
| `MortarTextField` | Input
|
|
58
|
-
| `MortarSwitch`, `.toggleStyle(.mortar)` | Switch
|
|
59
|
-
| `MortarAvatar` | Avatar
|
|
60
|
-
| `MortarNotice` | Notice
|
|
61
|
-
| `MortarEmptyState` | EmptyState
|
|
52
|
+
| Component | Web equivalent | Notes |
|
|
53
|
+
| ---------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
54
|
+
| `MortarButton`, `.buttonStyle(.mortar(_:size:isLoading:))` | Button | `primary` (the default, as on the web), `secondary`, `ghost`, `danger`, `accent`; `sm`, `md`, `lg`; loading; SF Symbol, icon-only with the title as its accessible name. Medium is at least 44pt tall. |
|
|
55
|
+
| `MortarBadge` | Badge | Tones `neutral`, `info`, `success`, `warning`, `danger`. |
|
|
56
|
+
| `MortarCard` | Card | Title, description, header actions, footer, `compact` or `none` padding, `muted` tone. |
|
|
57
|
+
| `MortarTextField` | Input | Label, prompt, hint, error, required marker, secure entry. VoiceOver reads the label as its name, then "required", the error and the hint. |
|
|
58
|
+
| `MortarSwitch`, `.toggleStyle(.mortar)` | Switch | The whole row toggles; VoiceOver sees a standard switch. |
|
|
59
|
+
| `MortarAvatar` | Avatar | Image URL with initials while loading or on failure, five sizes, circle or square, online or offline status, decorative. |
|
|
60
|
+
| `MortarNotice` | Notice | Tone, message, actions, dismiss button, VoiceOver announcement. |
|
|
61
|
+
| `MortarEmptyState` | EmptyState | SF Symbol, description, action, dashed, centred or leading. |
|
|
62
|
+
| `MortarCheckbox` | Checkbox | Label, description, error, required marker. The whole row toggles; VoiceOver reads a checkbox. |
|
|
63
|
+
| `MortarRadioGroup` | RadioGroup | Label, hint, error, options with descriptions and disabled options. |
|
|
64
|
+
| `MortarSegmentedControl` | SegmentedControl | A labelled set of segments; scrolls sideways when they don't fit. |
|
|
65
|
+
| `MortarProgressBar` | ProgressBar | Label, value and total, a value label (a percentage by default), a status tone. |
|
|
66
|
+
| `MortarDivider` | Divider | Optional label, soft line, spacing `none`, `sm`, `md` or `lg`. |
|
|
67
|
+
| `MortarStackedList` | StackedList | Rows with an avatar or SF Symbol, description, trailing text and an action; grouped under headings; chevrons. |
|
|
68
|
+
| `MortarAppShell` | AppShell | Top-level destinations: a tab bar on iPhone, a sidebar on iPad and Mac, each destination in its own navigation stack. |
|
|
62
69
|
|
|
63
70
|
On both platforms the switch sits at the end of its row, after the label, as in iOS and Android settings; on the web it comes first.
|
|
64
71
|
|
|
@@ -92,11 +99,12 @@ setContent {
|
|
|
92
99
|
|
|
93
100
|
A brand is a `MortarBrand`: its light and dark `MortarPalette`s, `FontFamily`s and density. `MortarTheme` follows the system's dark theme unless you pass `darkTheme`; components read `Mortar.palette` and `Mortar.brand`. Text sizes are in sp, so they follow the font scale.
|
|
94
101
|
|
|
95
|
-
The components and their parameters match the SwiftUI table above, with Compose names: `MortarButton`, `MortarBadge`, `MortarCard`, `MortarTextField`, `MortarSwitch`, `MortarAvatar`, `MortarNotice` and `
|
|
102
|
+
The components and their parameters match the SwiftUI table above, with Compose names: `MortarButton`, `MortarBadge`, `MortarCard`, `MortarTextField`, `MortarSwitch`, `MortarAvatar`, `MortarNotice`, `MortarEmptyState`, `MortarCheckbox`, `MortarRadioGroup`, `MortarSegmentedControl`, `MortarProgressBar`, `MortarDivider`, `MortarStackedList` and `MortarAppShell`. Differences:
|
|
96
103
|
|
|
97
104
|
- Medium controls and touch targets are 48dp, Material's minimum, instead of 44.
|
|
98
105
|
- `MortarAvatar` takes a `Painter`: load the picture with your image library (Coil, Glide) and pass null while it loads or when it fails, to show the initials.
|
|
99
|
-
- Icons are `ImageVector`s, such as `Icons.Filled.Share`.
|
|
106
|
+
- Icons are `ImageVector`s, such as `Icons.Filled.Share`; a `MortarStackedList` row leads with `MortarListLeading.Avatar` or `MortarListLeading.Icon`.
|
|
107
|
+
- `MortarAppShell` follows Android's window size classes: a bottom navigation bar under 600dp, a navigation rail to 840dp, and a sidebar with the brand name from 840dp.
|
|
100
108
|
- `MortarNotice(announce = true)` is a live region: polite, or assertive for `Danger`.
|
|
101
109
|
|
|
102
110
|
### Snapshot tests
|