diff --git a/resources/views/docs/mobile/4/digging-deeper/accessibility.md b/resources/views/docs/mobile/4/digging-deeper/accessibility.md index 101fca66..1c4e698f 100644 --- a/resources/views/docs/mobile/4/digging-deeper/accessibility.md +++ b/resources/views/docs/mobile/4/digging-deeper/accessibility.md @@ -20,7 +20,7 @@ Every element accepts two attributes: - `a11y-hint` - Supplementary usage guidance, announced after the label (e.g. "Double-tap to open settings"). @verbatim -```blade +```blade static ``` @@ -48,7 +48,7 @@ isn't descriptive enough on its own. mystery to screen reader users. @verbatim -```blade +```blade static {{-- Bad: VoiceOver has nothing meaningful to announce --}} @@ -63,7 +63,7 @@ Standalone `` elements are **decorative by default** — they are unless you give them an `a11y-label`. If an icon conveys meaning on its own (or is tappable), label it: @verbatim -```blade +```blade static ``` @endverbatim @@ -72,7 +72,7 @@ Images take an `alt` attribute, mirroring the web. With `alt`, the image is anno is treated as decorative and skipped: @verbatim -```blade +```blade static ``` @endverbatim @@ -82,7 +82,7 @@ is treated as decorative and skipped: The tappable trailing icon button on a [list item](../edge-components/list) takes its own label via `trailing-a11y-label`: @verbatim -```blade +```blade static ``` @endverbatim @@ -52,7 +52,7 @@ useful for text inputs where syncing on every character is wasteful: | `native:model.debounce.300ms` | After the user stops changing it for the given delay. | @verbatim -```blade +```blade static {{-- Sync only when the user leaves the field --}} @@ -87,7 +87,7 @@ properties, derive the rest with computed methods, and let the UI re-render itse something other than a public property — set the value and change handler directly: @verbatim -```blade +```blade static ``` @endverbatim diff --git a/resources/views/docs/mobile/4/digging-deeper/gestures.md b/resources/views/docs/mobile/4/digging-deeper/gestures.md index 266ad503..6bf8fc3c 100644 --- a/resources/views/docs/mobile/4/digging-deeper/gestures.md +++ b/resources/views/docs/mobile/4/digging-deeper/gestures.md @@ -17,10 +17,10 @@ If you've used Reanimated in React Native, this is the same idea. Create one in PHP with `SharedValue::make($initial)`, bind it to a gesture, and read it from any animatable prop: @verbatim -```blade +```blade static @php $drag = \Native\Mobile\Edge\SharedValue::make(); @endphp - + interpolate([0, 200], [1, 0]); // 0→1, 200→0, fully faded past 200 ``` -Animatable props that accept a shared value: `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`. - -## Reacting when the gesture ends - -Per-frame values stay on the native side, but you often need PHP to make a decision when the user lets go — commit -or snap back. The [``](../edge-components/gesture-area) fires `@drag-end` with the final -value: +Formulas are chainable — each call returns a new derived value, so you can stack them: ```php -public function onRelease(float $value): void -{ - if ($value > 150) { - $this->dismiss(); // dragged far enough — commit - } - // otherwise the view springs back to its resting position -} +$drag->clamp(0, 200)->multiply(0.5)->add(20); ``` -Call `->value()` on a shared value inside such a handler to read its PHP-side snapshot (with any formula applied) -if you need the derived number rather than the raw translation. +Animatable props that accept a shared value: `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`. + +Everything above runs natively on the UI thread — as the finger moves, the bound props update at the display's +refresh rate with no PHP involved. If you need the PHP-side number (for example, the current snapshot with its +formula applied), call `->value()` on the shared value. ## Property animations @@ -77,7 +68,7 @@ change in `animate-duration` (milliseconds) and the element eases from its old v render. The animatable props are `translate-x`, `translate-y`, `scale`, `rotate`, and `opacity`: @verbatim -```blade +```blade static {{-- A panel slides up from below when $shown flips to true --}} @@ -122,7 +113,7 @@ back on release: - `press-translate-y` — nudge down while pressed (e.g. `3`) @verbatim -```blade +```blade static Press me diff --git a/resources/views/docs/mobile/4/digging-deeper/lifecycle-hooks.md b/resources/views/docs/mobile/4/digging-deeper/lifecycle-hooks.md index b5c2807b..981cdfa3 100644 --- a/resources/views/docs/mobile/4/digging-deeper/lifecycle-hooks.md +++ b/resources/views/docs/mobile/4/digging-deeper/lifecycle-hooks.md @@ -103,7 +103,7 @@ Livewire's updated hooks. The hook name is `updated` + the studly-cased property value. @verbatim -```blade +```blade static ``` @endverbatim diff --git a/resources/views/docs/mobile/4/digging-deeper/reactivity.md b/resources/views/docs/mobile/4/digging-deeper/reactivity.md index a1e1a690..fa5faa09 100644 --- a/resources/views/docs/mobile/4/digging-deeper/reactivity.md +++ b/resources/views/docs/mobile/4/digging-deeper/reactivity.md @@ -32,7 +32,7 @@ class CartScreen extends NativeComponent Access it as `$this->total` (no parentheses) in PHP, or `@{{ $this->total }}` in the view: @verbatim -```blade +```blade static Total: {{ $this->total }} ``` @endverbatim @@ -82,7 +82,7 @@ You can also drive a re-render from the view with `native:poll` — useful for a without wiring a method: @verbatim -```blade +```blade static {{ now()->format('g:i:s A') }} ``` @endverbatim diff --git a/resources/views/docs/mobile/4/digging-deeper/theming.md b/resources/views/docs/mobile/4/digging-deeper/theming.md index 50da3b63..88450495 100644 --- a/resources/views/docs/mobile/4/digging-deeper/theming.md +++ b/resources/views/docs/mobile/4/digging-deeper/theming.md @@ -42,12 +42,42 @@ on that surface. Pairing them this way is what keeps contrast correct across lig Plus non-color tokens: `radius-sm|md|lg|full`, `font-sm|md|lg|xl`, and `font-family` (`System` resolves to San Francisco on iOS / Roboto on Android; set a family name to load a custom font). +Disabled controls draw from the `surface-variant` (fill) and `on-surface-variant` (label) pair on both +platforms — tune disabled contrast by adjusting those two tokens, not per-component. + +## Color values + +Anywhere you author a color — a theme token, an element color prop (`headline-color`, badge colors, swipe-action +tints), or an arbitrary-value class (`bg-[#…]`) — the same formats are accepted: + +| Format | Examples | +| --- | --- | +| Hex | `#B91C1C`, `#F00` | +| Hex with alpha — CSS `#RRGGBBAA` order | `#8B5CF680` | +| Tailwind palette name | `red-300`, `orange-800` | +| Named | `white`, `black`, `transparent` | +| Opacity modifier on any of the above | `red-300/20`, `#8B5CF6/50` | + +```php +'light' => [ + 'primary' => 'violet-600', // Tailwind palette name + 'secondary' => 'fuchsia-500/70', // opacity modifier → tonal fill + 'surface' => '#F8FAFC', // plain hex + 'accent' => '#00AAA680', // hex with alpha (#RRGGBBAA) +], +``` + +Alpha hex is always authored in CSS `#RRGGBBAA` order — the framework converts to what each platform expects. +Components render color tokens **solid**; when you want a translucent or tonal fill, put the opacity on the token +(`'secondary' => 'fuchsia-500/70'`) rather than expecting the renderer to soften it. Dark-mode auto-derivation +preserves the alpha byte. + ## Using tokens in a screen Reference any token from Blade with the `theme-{token}` class suffix, on background, text, and border utilities: @verbatim -```blade +```blade static Balance Updated just now diff --git a/resources/views/docs/mobile/4/edge-components/activity-indicator.md b/resources/views/docs/mobile/4/edge-components/activity-indicator.md index 9051ae7c..da264840 100644 --- a/resources/views/docs/mobile/4/edge-components/activity-indicator.md +++ b/resources/views/docs/mobile/4/edge-components/activity-indicator.md @@ -22,6 +22,7 @@ All [shared layout and style attributes](layout) are supported, plus: - `size` - `"sm"`, `"md"` (default), or `"lg"` (optional, string). Legacy ints `1`=large, `2`=small are also accepted - `color` - Spinner color as hex string (optional). Leave unset to use `theme.primary` - `a11y-label` - Accessibility label (optional) +- `a11y-hint` - Accessibility hint (optional)