@bloxwap/hig 0.6.0 → 0.8.1
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/README.md +2 -2
- package/chart/README.md +13 -2
- package/chart/dist/altimeter-burst.d.ts +4 -0
- package/chart/dist/altimeter-burst.js +43 -0
- package/chart/dist/altimeter-chart.d.ts +52 -0
- package/chart/dist/altimeter-chart.js +275 -0
- package/chart/dist/altimeter-model.d.ts +43 -0
- package/chart/dist/altimeter-model.js +148 -0
- package/chart/dist/altimeter-targets.d.ts +33 -0
- package/chart/dist/altimeter-targets.js +88 -0
- package/chart/dist/bitcoin-price.d.ts +8 -0
- package/chart/dist/bitcoin-price.js +41 -0
- package/chart/dist/champions-league.d.ts +19 -0
- package/chart/dist/champions-league.js +104 -0
- package/chart/dist/index.d.ts +6 -0
- package/chart/dist/index.js +5 -0
- package/chart/dist/outcome-chart.d.ts +37 -0
- package/chart/dist/outcome-chart.js +212 -0
- package/chart/dist/outcome-model.d.ts +43 -0
- package/chart/dist/outcome-model.js +71 -0
- package/chart/dist/plus-grid.d.ts +6 -0
- package/chart/dist/plus-grid.js +29 -0
- package/contracts/README.md +1 -1
- package/contracts/dist/avatar.d.ts +68 -0
- package/contracts/dist/avatar.js +93 -0
- package/contracts/dist/confetti.d.ts +174 -0
- package/contracts/dist/confetti.js +138 -0
- package/contracts/dist/decimal.d.ts +7 -0
- package/contracts/dist/decimal.js +35 -0
- package/contracts/dist/index.d.ts +45 -2
- package/contracts/dist/index.js +145 -4
- package/contracts/dist/invariants.d.ts +17 -0
- package/contracts/dist/invariants.js +24 -0
- package/contracts/dist/messages.d.ts +62 -2
- package/contracts/dist/messages.js +22 -2
- package/contracts/dist/number-flow.d.ts +90 -0
- package/contracts/dist/number-flow.js +150 -0
- package/contracts/dist/qr.d.ts +151 -0
- package/contracts/dist/qr.js +581 -0
- package/contracts/dist/toast.d.ts +168 -0
- package/contracts/dist/toast.js +171 -0
- package/feedback/README.md +1 -1
- package/feedback/dist/contract.js +1 -1
- package/feedback/dist/react.js +2 -4
- package/native/README.md +6 -1
- package/native/dist/account-block.d.ts +62 -7
- package/native/dist/account-block.js +54 -11
- package/native/dist/animated-number-model.d.ts +47 -1
- package/native/dist/animated-number-model.js +248 -21
- package/native/dist/animated-number.d.ts +41 -1
- package/native/dist/animated-number.js +165 -17
- package/native/dist/announce.d.ts +2 -0
- package/native/dist/announce.js +10 -0
- package/native/dist/asset-balance-row.d.ts +19 -1
- package/native/dist/asset-balance-row.js +24 -8
- package/native/dist/assets-block.d.ts +115 -0
- package/native/dist/assets-block.js +87 -0
- package/native/dist/async-result.d.ts +2 -0
- package/native/dist/async-result.js +11 -0
- package/native/dist/avatar-frame.d.ts +29 -0
- package/native/dist/avatar-frame.js +56 -0
- package/native/dist/avatar.d.ts +21 -0
- package/native/dist/avatar.js +31 -0
- package/native/dist/bar-mark.d.ts +16 -2
- package/native/dist/bar-mark.js +23 -7
- package/native/dist/bar-pnl.js +7 -5
- package/native/dist/blocks.d.ts +13 -14
- package/native/dist/blocks.js +10 -6
- package/native/dist/brand.js +2 -1
- package/native/dist/button.d.ts +7 -2
- package/native/dist/button.js +16 -4
- package/native/dist/checkbox.js +2 -1
- package/native/dist/confetti.d.ts +33 -0
- package/native/dist/confetti.js +143 -0
- package/native/dist/confirm-block.d.ts +98 -0
- package/native/dist/confirm-block.js +48 -0
- package/native/dist/data.d.ts +1 -1
- package/native/dist/data.js +8 -4
- package/native/dist/explainer-block.d.ts +91 -0
- package/native/dist/explainer-block.js +34 -0
- package/native/dist/field.d.ts +19 -5
- package/native/dist/field.js +56 -9
- package/native/dist/figure.d.ts +23 -0
- package/native/dist/figure.js +10 -0
- package/native/dist/gesture-sheet-model.d.ts +50 -0
- package/native/dist/gesture-sheet-model.js +105 -0
- package/native/dist/gesture-sheet-next.d.ts +82 -0
- package/native/dist/gesture-sheet-next.js +315 -0
- package/native/dist/gesture-sheet.d.ts +5 -1
- package/native/dist/gesture-sheet.js +13 -6
- package/native/dist/icons.d.ts +9 -6
- package/native/dist/icons.js +25 -24
- package/native/dist/language-block.d.ts +14 -1
- package/native/dist/language-block.js +11 -4
- package/native/dist/list-group.d.ts +44 -8
- package/native/dist/list-group.js +84 -13
- package/native/dist/manage-position-block.d.ts +35 -2
- package/native/dist/manage-position-block.js +41 -11
- package/native/dist/market-row.d.ts +46 -0
- package/native/dist/market-row.js +41 -0
- package/native/dist/navigation.js +5 -3
- package/native/dist/notifications-block.d.ts +30 -2
- package/native/dist/notifications-block.js +16 -8
- package/native/dist/number-format.d.ts +6 -0
- package/native/dist/number-format.js +9 -0
- package/native/dist/pickers.d.ts +32 -2
- package/native/dist/pickers.js +17 -9
- package/native/dist/position-block.d.ts +66 -10
- package/native/dist/position-block.js +45 -11
- package/native/dist/preset-group.d.ts +31 -0
- package/native/dist/preset-group.js +39 -0
- package/native/dist/preset-picker-block.d.ts +107 -0
- package/native/dist/preset-picker-block.js +43 -0
- package/native/dist/profile-block.d.ts +38 -5
- package/native/dist/profile-block.js +31 -6
- package/native/dist/provider.d.ts +14 -5
- package/native/dist/provider.js +32 -6
- package/native/dist/qr-code.d.ts +33 -0
- package/native/dist/qr-code.js +29 -0
- package/native/dist/radio-group.d.ts +23 -5
- package/native/dist/radio-group.js +40 -12
- package/native/dist/recipes.d.ts +6 -0
- package/native/dist/recipes.js +6 -0
- package/native/dist/reward-block.d.ts +55 -13
- package/native/dist/reward-block.js +37 -14
- package/native/dist/screen-header.d.ts +59 -0
- package/native/dist/screen-header.js +37 -0
- package/native/dist/select.js +4 -2
- package/native/dist/selection.d.ts +3 -2
- package/native/dist/selection.js +1 -0
- package/native/dist/setting-header.d.ts +2 -8
- package/native/dist/setting-header.js +2 -11
- package/native/dist/setting-switch.d.ts +15 -2
- package/native/dist/setting-switch.js +11 -4
- package/native/dist/signals-block.d.ts +26 -2
- package/native/dist/signals-block.js +14 -4
- package/native/dist/slider.js +5 -1
- package/native/dist/sound-haptics-block.d.ts +29 -2
- package/native/dist/sound-haptics-block.js +19 -8
- package/native/dist/status.d.ts +47 -14
- package/native/dist/status.js +39 -22
- package/native/dist/sticky-header.d.ts +28 -0
- package/native/dist/sticky-header.js +29 -0
- package/native/dist/surface.d.ts +3 -1
- package/native/dist/surface.js +2 -1
- package/native/dist/swap-amount-card.d.ts +57 -0
- package/native/dist/swap-amount-card.js +31 -0
- package/native/dist/swap-panel-block.d.ts +11 -4
- package/native/dist/swap-panel-block.js +67 -38
- package/native/dist/swap-parts.d.ts +5 -10
- package/native/dist/swap-parts.js +22 -24
- package/native/dist/swap-shared.d.ts +8 -2
- package/native/dist/swap-shared.js +10 -6
- package/native/dist/swap-views.js +6 -4
- package/native/dist/switch-row.d.ts +3 -2
- package/native/dist/switch-row.js +5 -3
- package/native/dist/switch.d.ts +4 -2
- package/native/dist/switch.js +3 -3
- package/native/dist/target-block.d.ts +40 -7
- package/native/dist/target-block.js +31 -11
- package/native/dist/toast.d.ts +47 -0
- package/native/dist/toast.js +386 -0
- package/native/dist/token-action-block.d.ts +26 -9
- package/native/dist/token-action-block.js +21 -8
- package/native/dist/trade-history-detail-block.d.ts +26 -1
- package/native/dist/trade-history-detail-block.js +17 -9
- package/native/dist/trade-history-list-block.d.ts +71 -5
- package/native/dist/trade-history-list-block.js +55 -17
- package/native/dist/wallet-address-core.d.ts +25 -0
- package/native/dist/wallet-address-core.js +34 -0
- package/native/dist/wallet-address.d.ts +6 -10
- package/native/dist/wallet-address.js +16 -20
- package/native-fonts/README.md +1 -1
- package/og-fonts/README.md +1 -1
- package/package.json +131 -2
- package/react/README.md +3 -1
- package/react/dist/animated-number-flow.d.ts +72 -0
- package/react/dist/animated-number-flow.js +316 -0
- package/react/dist/animated-number-model.d.ts +24 -0
- package/react/dist/animated-number-model.js +106 -3
- package/react/dist/animated-number.d.ts +49 -1
- package/react/dist/animated-number.js +146 -11
- package/react/dist/asset-balance-row.d.ts +19 -1
- package/react/dist/asset-balance-row.js +17 -3
- package/react/dist/async-result.d.ts +2 -0
- package/react/dist/async-result.js +11 -0
- package/react/dist/avatar.d.ts +25 -0
- package/react/dist/avatar.js +50 -0
- package/react/dist/bar-mark.d.ts +5 -2
- package/react/dist/bar-mark.js +5 -3
- package/react/dist/blocks/account-block.d.ts +57 -7
- package/react/dist/blocks/account-block.js +51 -11
- package/react/dist/blocks/assets-block.d.ts +106 -0
- package/react/dist/blocks/assets-block.js +135 -0
- package/react/dist/blocks/confirm-block.d.ts +91 -0
- package/react/dist/blocks/confirm-block.js +31 -0
- package/react/dist/blocks/explainer-block.d.ts +80 -0
- package/react/dist/blocks/explainer-block.js +20 -0
- package/react/dist/blocks/install-command.js +3 -1
- package/react/dist/blocks/language-block.d.ts +9 -1
- package/react/dist/blocks/language-block.js +8 -6
- package/react/dist/blocks/manage-position-block.d.ts +30 -2
- package/react/dist/blocks/manage-position-block.js +23 -4
- package/react/dist/blocks/market-row.d.ts +20 -9
- package/react/dist/blocks/market-row.js +17 -4
- package/react/dist/blocks/notifications-block.d.ts +27 -2
- package/react/dist/blocks/notifications-block.js +11 -2
- package/react/dist/blocks/pickers.d.ts +30 -1
- package/react/dist/blocks/pickers.js +32 -10
- package/react/dist/blocks/position-block.d.ts +34 -11
- package/react/dist/blocks/position-block.js +16 -5
- package/react/dist/blocks/preset-picker-block.d.ts +85 -0
- package/react/dist/blocks/preset-picker-block.js +19 -0
- package/react/dist/blocks/profile-block.d.ts +33 -6
- package/react/dist/blocks/profile-block.js +31 -6
- package/react/dist/blocks/reward-block.d.ts +65 -21
- package/react/dist/blocks/reward-block.js +24 -11
- package/react/dist/blocks/screen-header.d.ts +34 -2
- package/react/dist/blocks/screen-header.js +17 -6
- package/react/dist/blocks/setting-switch.d.ts +14 -1
- package/react/dist/blocks/setting-switch.js +11 -4
- package/react/dist/blocks/signals-block.d.ts +23 -2
- package/react/dist/blocks/signals-block.js +6 -5
- package/react/dist/blocks/sound-haptics-block.d.ts +27 -3
- package/react/dist/blocks/sound-haptics-block.js +11 -7
- package/react/dist/blocks/sticky-header.d.ts +19 -0
- package/react/dist/blocks/sticky-header.js +103 -0
- package/react/dist/blocks/swap/amount-card.js +2 -1
- package/react/dist/blocks/swap/settings.js +4 -3
- package/react/dist/blocks/swap/shared.d.ts +29 -23
- package/react/dist/blocks/swap/shared.js +36 -32
- package/react/dist/blocks/swap-panel-block.d.ts +12 -3
- package/react/dist/blocks/swap-panel-block.js +72 -37
- package/react/dist/blocks/target-block.d.ts +35 -7
- package/react/dist/blocks/target-block.js +26 -12
- package/react/dist/blocks/token-action-block.d.ts +21 -8
- package/react/dist/blocks/token-action-block.js +9 -6
- package/react/dist/blocks/trade-history-detail-block.d.ts +23 -1
- package/react/dist/blocks/trade-history-detail-block.js +5 -4
- package/react/dist/blocks/trade-history-list-block.d.ts +31 -5
- package/react/dist/blocks/trade-history-list-block.js +20 -10
- package/react/dist/blocks.d.ts +12 -8
- package/react/dist/blocks.js +6 -2
- package/react/dist/brand.js +2 -1
- package/react/dist/button.d.ts +9 -3
- package/react/dist/button.js +12 -5
- package/react/dist/confetti.d.ts +27 -0
- package/react/dist/confetti.js +240 -0
- package/react/dist/data.js +11 -4
- package/react/dist/field.d.ts +20 -5
- package/react/dist/field.js +30 -8
- package/react/dist/figure.d.ts +23 -0
- package/react/dist/figure.js +12 -0
- package/react/dist/gesture-sheet.d.ts +15 -1
- package/react/dist/gesture-sheet.js +53 -8
- package/react/dist/list-group.d.ts +41 -8
- package/react/dist/list-group.js +49 -13
- package/react/dist/navigation.js +11 -3
- package/react/dist/overlay.d.ts +28 -3
- package/react/dist/overlay.js +29 -3
- package/react/dist/preset-group.d.ts +30 -0
- package/react/dist/preset-group.js +13 -0
- package/react/dist/provider.d.ts +42 -5
- package/react/dist/provider.js +84 -10
- package/react/dist/qr-code.d.ts +32 -0
- package/react/dist/qr-code.js +28 -0
- package/react/dist/select.js +10 -3
- package/react/dist/selection.d.ts +18 -4
- package/react/dist/selection.js +20 -10
- package/react/dist/slider.js +5 -1
- package/react/dist/status.d.ts +14 -10
- package/react/dist/status.js +17 -9
- package/react/dist/styles.css +380 -150
- package/react/dist/surface.d.ts +5 -1
- package/react/dist/surface.js +1 -1
- package/react/dist/toast.d.ts +19 -12
- package/react/dist/toast.js +29 -7
- package/react/dist/wallet-address-core.d.ts +27 -0
- package/react/dist/wallet-address-core.js +29 -0
- package/react/dist/wallet-address.d.ts +6 -12
- package/react/dist/wallet-address.js +5 -16
- package/tokens/README.md +2 -2
- package/tokens/dist/index.d.ts +16 -0
- package/tokens/dist/index.js +16 -0
- package/tokens/dist/manifest.json +8 -0
- package/tokens/dist/tokens.css +6 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export type { Choice, CheckedProps, ChoicesProps } from './selection-types.js';
|
|
2
|
-
export { Switch, SwitchRow, type SwitchRowProps } from './switch.js';
|
|
2
|
+
export { Switch, SwitchRow, type SwitchProps, type SwitchRowProps } from './switch.js';
|
|
3
3
|
export { Checkbox } from './checkbox.js';
|
|
4
4
|
export { RadioGroup } from './radio-group.js';
|
|
5
5
|
export { Select } from './select.js';
|
|
6
6
|
export { Slider } from './slider.js';
|
|
7
|
-
export { SegmentedControl } from './radio-group.js';
|
|
7
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlOption } from './radio-group.js';
|
|
8
8
|
export { Filter, type FilterOption, type FilterProps } from './radio-group.js';
|
|
9
|
+
export { PresetGroup, type PresetGroupProps, type PresetOption } from './preset-group.js';
|
package/native/dist/selection.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function SettingHeader({ title, onBack, action, testID }: {
|
|
4
|
-
title: string;
|
|
5
|
-
onBack?: () => void;
|
|
6
|
-
action?: React.ReactNode;
|
|
7
|
-
testID: string;
|
|
8
|
-
}): React.JSX.Element;
|
|
1
|
+
/** The settings blocks' header, published as `ScreenHeader` from `@bloxwap/hig/native/screen-header`. */
|
|
2
|
+
export { ScreenHeader as SettingHeader } from './screen-header.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useColors, useHIG, useMessages } from './provider.js';
|
|
4
|
-
import { Text } from './surface.js';
|
|
5
|
-
import { IconButton } from './button.js';
|
|
6
|
-
import { ChevronIcon } from './icons.js';
|
|
7
|
-
/** The header of a block that is its own screen: Back on the leading edge, the title centred, an optional control on the trailing edge. */
|
|
8
|
-
export function SettingHeader({ title, onBack, action, testID }) {
|
|
9
|
-
const colors = useColors(), t = useMessages(), { direction } = useHIG();
|
|
10
|
-
return _jsxs(View, { testID: `${testID}-header`, style: { flexDirection: 'row', alignItems: 'center', minHeight: 44 }, children: [_jsx(View, { style: { minWidth: 44, alignItems: 'flex-start' }, children: onBack ? _jsx(IconButton, { intent: 'ghost', label: t.back, suppressFeedback: true, testID: `${testID}-back`, onPress: onBack, children: _jsx(View, { style: { transform: [{ rotate: direction === 'rtl' ? '-90deg' : '90deg' }] }, children: _jsx(ChevronIcon, { color: colors.text }) }) }) : null }), _jsx(Text, { testID: `${testID}-title`, accessibilityRole: 'header', numberOfLines: 1, style: { flex: 1, textAlign: 'center', fontSize: 17, lineHeight: 24, fontWeight: '600', color: colors.text }, children: title }), _jsx(View, { style: { minWidth: 44, alignItems: 'flex-end' }, children: action })] });
|
|
11
|
-
}
|
|
1
|
+
/** The settings blocks' header, published as `ScreenHeader` from `@bloxwap/hig/native/screen-header`. */
|
|
2
|
+
export { ScreenHeader as SettingHeader } from './screen-header.js';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/** A secondary button under a setting, such as Open Settings. `feedback: false` keeps the provider's press feedback off this one button, for a host that plays its own cue for it; by default it plays like any `Button`. */
|
|
3
|
+
export interface SettingAction {
|
|
4
|
+
label: string;
|
|
5
|
+
onSelect: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
feedback?: boolean;
|
|
8
|
+
}
|
|
2
9
|
export interface SettingSwitchProps {
|
|
3
10
|
label: string;
|
|
4
11
|
description?: string;
|
|
@@ -6,10 +13,16 @@ export interface SettingSwitchProps {
|
|
|
6
13
|
onCheckedChange: (checked: boolean) => void;
|
|
7
14
|
disabled?: boolean;
|
|
8
15
|
testID?: string;
|
|
16
|
+
/** Always on and not changeable: the switch shows on at full strength and is read as unavailable. Presses do nothing. */
|
|
17
|
+
locked?: boolean;
|
|
18
|
+
/** Host content after the label, such as a badge. It is drawn only: the switch is read by `label` (and `labelAccessoryLabel`), so put any meaning it carries there or in the description. */
|
|
19
|
+
labelAccessory?: React.ReactNode;
|
|
20
|
+
/** Host words for the `labelAccessory`, read after the label and a pause: `Feed, New`. Same prop on web. */
|
|
21
|
+
labelAccessoryLabel?: string;
|
|
9
22
|
}
|
|
10
23
|
/** One setting as a switch: the label over an optional description on the leading edge, the track on the trailing edge. The whole row is the switch; the label names it and the description is its hint. */
|
|
11
|
-
export declare function SettingSwitch({ label, description, checked, onCheckedChange, disabled, testID }: SettingSwitchProps): React.JSX.Element;
|
|
12
|
-
/** The card a setting sits in. Inside a list the cards share one rounded container, so they drop their own radius. */
|
|
24
|
+
export declare function SettingSwitch({ label, description, checked: requested, onCheckedChange, disabled, locked, labelAccessory, labelAccessoryLabel, testID }: SettingSwitchProps): React.JSX.Element;
|
|
25
|
+
/** The card a setting sits in, as on web: 4 above and below the switch's own 48dp row, and 16 at the foot when content follows the switch (a channel's body, a signal's hint or error), 12 under the switch. Inside a list the cards share one rounded container, so they drop their own radius. */
|
|
13
26
|
export declare function SettingCard({ children, joined, testID }: React.PropsWithChildren<{
|
|
14
27
|
joined?: boolean;
|
|
15
28
|
testID?: string;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { useColors, useFills, useHIG } from './provider.js';
|
|
4
5
|
import { Text } from './surface.js';
|
|
5
6
|
import { SwitchRow } from './switch-row.js';
|
|
6
7
|
/** One setting as a switch: the label over an optional description on the leading edge, the track on the trailing edge. The whole row is the switch; the label names it and the description is its hint. */
|
|
7
|
-
export function SettingSwitch({ label, description, checked, onCheckedChange, disabled, testID }) {
|
|
8
|
+
export function SettingSwitch({ label, description, checked: requested, onCheckedChange, disabled, locked, labelAccessory, labelAccessoryLabel, testID }) {
|
|
8
9
|
const colors = useColors(), fills = useFills(), { direction } = useHIG();
|
|
9
|
-
|
|
10
|
+
const checked = locked ? true : requested;
|
|
11
|
+
const name = _jsx(Text, { style: { fontSize: 16, lineHeight: 24, color: colors.text }, children: label });
|
|
12
|
+
const named = labelAccessoryLabel && labelAccessory != null && labelAccessory !== false ? `${label}, ${labelAccessoryLabel}` : label;
|
|
13
|
+
// As on web: the switch is a 48dp target (SwitchRow's own minimum) with 12 above and below the text, and the track sits on
|
|
14
|
+
// the first line. A row is 56dp in its card, 79dp with a one-line description (24 + 2 + 21 + 12 + 12, plus the card's 4 + 4).
|
|
15
|
+
return _jsx(SwitchRow, { testID: testID, label: named, accessibilityHint: description, checked: checked, disabled: locked ? true : disabled, onCheckedChange: onCheckedChange, style: { opacity: disabled ? 0.5 : 1 }, children: _jsxs(View, { style: { direction, flex: 1, flexDirection: 'row', alignItems: 'flex-start', gap: 12, paddingVertical: 12 }, children: [_jsxs(View, { style: { flex: 1, minWidth: 0, gap: 2 }, children: [labelAccessory != null && labelAccessory !== false ? _jsxs(View, { testID: testID ? `${testID}-label` : undefined, style: { direction, flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap', gap: 8 }, children: [name, labelAccessory] }) : name, description ? _jsx(Text, { style: { fontSize: 14, lineHeight: 21, color: colors.muted }, children: description }) : null] }), _jsx(View, { testID: testID ? `${testID}-track` : undefined, style: { width: 40, height: 24, borderRadius: 12, padding: 3, backgroundColor: checked ? colors.action : fills.raised, alignItems: checked ? 'flex-end' : 'flex-start' }, children: _jsx(View, { style: { width: 18, height: 18, borderRadius: 9, backgroundColor: checked ? colors.onAction : colors.text } }) })] }) });
|
|
10
16
|
}
|
|
11
|
-
/** The card a setting sits in. Inside a list the cards share one rounded container, so they drop their own radius. */
|
|
17
|
+
/** The card a setting sits in, as on web: 4 above and below the switch's own 48dp row, and 16 at the foot when content follows the switch (a channel's body, a signal's hint or error), 12 under the switch. Inside a list the cards share one rounded container, so they drop their own radius. */
|
|
12
18
|
export function SettingCard({ children, joined, testID }) {
|
|
13
19
|
const fills = useFills();
|
|
14
|
-
|
|
20
|
+
const extended = React.Children.toArray(children).length > 1;
|
|
21
|
+
return _jsx(View, { testID: testID, style: { gap: 12, paddingTop: 4, paddingBottom: extended ? 16 : 4, paddingHorizontal: 20, borderRadius: joined ? 0 : 20, backgroundColor: fills.well }, children: children });
|
|
15
22
|
}
|
|
16
23
|
/** The shared header of a settings screen: Back on the leading edge, the title centred, a host control on the trailing edge. */
|
|
17
24
|
export { SettingHeader } from './setting-header.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { View, type ScrollViewProps } from 'react-native';
|
|
2
3
|
/** One signal the viewer can turn on. */
|
|
3
4
|
export interface SignalsItem {
|
|
4
5
|
id: string;
|
|
@@ -7,6 +8,16 @@ export interface SignalsItem {
|
|
|
7
8
|
checked: boolean;
|
|
8
9
|
onCheckedChange: (checked: boolean) => void;
|
|
9
10
|
disabled?: boolean;
|
|
11
|
+
/** Always on and not changeable: shown on at full strength and read as unavailable. */
|
|
12
|
+
locked?: boolean;
|
|
13
|
+
/** Host content after the label, such as a badge. It is drawn only; the switch is read by `label`. */
|
|
14
|
+
labelAccessory?: React.ReactNode;
|
|
15
|
+
/** Host words for the `labelAccessory`, read after the label and a pause: `Feed, New`. */
|
|
16
|
+
labelAccessoryLabel?: string;
|
|
17
|
+
/** A neutral line under the switch, announced when it changes: Needs this device's permission. */
|
|
18
|
+
hint?: string;
|
|
19
|
+
/** A failure under the switch, in the negative role and announced. */
|
|
20
|
+
error?: string;
|
|
10
21
|
}
|
|
11
22
|
/** A family of signals under one heading: Trend, Swing. Every word is host text. */
|
|
12
23
|
export interface SignalsGroup {
|
|
@@ -14,24 +25,37 @@ export interface SignalsGroup {
|
|
|
14
25
|
title: string;
|
|
15
26
|
/** Shows the verified mark after the title. */
|
|
16
27
|
verified?: boolean;
|
|
17
|
-
/** A small pill on the trailing edge of the heading: How it works. The host opens its own explanation. */
|
|
28
|
+
/** A small pill on the trailing edge of the heading: How it works. The host opens its own explanation. `ref` reaches the pill, so the host can move accessibility focus back to it when the explanation closes. */
|
|
18
29
|
help?: {
|
|
19
30
|
label: string;
|
|
20
31
|
onSelect: () => void;
|
|
32
|
+
ref?: React.Ref<View>;
|
|
21
33
|
};
|
|
22
34
|
items: readonly SignalsItem[];
|
|
23
35
|
}
|
|
24
36
|
export interface SignalsBlockProps {
|
|
25
37
|
/** Heading: Signals. */
|
|
26
38
|
title: string;
|
|
39
|
+
/** A muted line under the header that explains the screen. */
|
|
40
|
+
description?: string;
|
|
27
41
|
groups: readonly SignalsGroup[];
|
|
28
42
|
/** Words for the verified mark, read after the group title. */
|
|
29
43
|
verifiedLabel?: string;
|
|
44
|
+
/** Host artwork in place of the built-in verified mark, inside the heading's one accessible element. */
|
|
45
|
+
verifiedMark?: React.ReactNode;
|
|
46
|
+
/** The `verifiedMark` is a control: it stays in the accessibility tree, the heading then sits on the title text and the mark follows as its own element. */
|
|
47
|
+
verifiedMarkInteractive?: boolean;
|
|
30
48
|
/** Shows Back on the leading edge of the header. */
|
|
31
49
|
onBack?: () => void;
|
|
32
50
|
/** A control on the trailing edge of the header, usually an IconButton. */
|
|
33
51
|
headerAction?: React.ReactNode;
|
|
52
|
+
/** Keeps the header pinned while the groups scroll: the block becomes its own scroll view with the header as its sticky first child, transparent at rest and filled once content scrolls under it. Place it in a bounded container. */
|
|
53
|
+
stickyHeader?: boolean;
|
|
54
|
+
/** Fill behind the pinned header once content scrolls under it. Defaults to the background role; in a sheet pass the sheet's fill. */
|
|
55
|
+
stickyHeaderBackground?: string;
|
|
56
|
+
/** The scroll view used with `stickyHeader`, such as a sheet library's own. */
|
|
57
|
+
scrollComponent?: React.ComponentType<ScrollViewProps>;
|
|
34
58
|
testID?: string;
|
|
35
59
|
}
|
|
36
60
|
/** The signals the viewer receives, as a screen, in groups: each group has a heading with an optional verified mark and a small help pill, and its signals as switches with a line of explanation, sharing one rounded container. */
|
|
37
|
-
export declare function SignalsBlock({ title, groups, verifiedLabel, onBack, headerAction, testID }: SignalsBlockProps): React.JSX.Element;
|
|
61
|
+
export declare function SignalsBlock({ title, description, groups, verifiedLabel, verifiedMark, verifiedMarkInteractive, onBack, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, testID }: SignalsBlockProps): React.JSX.Element;
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { StickyHeaderLayout } from './sticky-header.js';
|
|
3
4
|
import { useColors, useHIG } from './provider.js';
|
|
4
5
|
import { Text } from './surface.js';
|
|
5
6
|
import { SwapCapsule } from './swap-parts.js';
|
|
6
7
|
import { SeverityIcon } from './icons.js';
|
|
7
8
|
import { SettingCard, SettingHeader, SettingSwitch } from './setting-switch.js';
|
|
9
|
+
/** The 32dp help pill keeps a 48dp touch target: 8dp beyond each edge, clear of the switches 8dp below the 44dp heading row. */
|
|
10
|
+
const helpSlop = { top: 8, bottom: 8, left: 8, right: 8 };
|
|
8
11
|
/** The signals the viewer receives, as a screen, in groups: each group has a heading with an optional verified mark and a small help pill, and its signals as switches with a line of explanation, sharing one rounded container. */
|
|
9
|
-
export function SignalsBlock({ title, groups, verifiedLabel, onBack, headerAction, testID }) {
|
|
12
|
+
export function SignalsBlock({ title, description, groups, verifiedLabel, verifiedMark, verifiedMarkInteractive, onBack, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, testID }) {
|
|
10
13
|
const colors = useColors(), { direction } = useHIG();
|
|
14
|
+
const note = { fontSize: 14, lineHeight: 21 };
|
|
15
|
+
const split = (group) => !!group.verified && verifiedMark != null && !!verifiedMarkInteractive;
|
|
16
|
+
const heading = (group) => [group.title, group.verified && verifiedLabel ? verifiedLabel : null].filter(Boolean).join(', ');
|
|
11
17
|
const sections = groups.map(group => {
|
|
12
18
|
const id = `signals-${group.id}`;
|
|
13
|
-
return _jsxs(View, { testID: id, style: { gap: 8, marginTop: 16 }, children: [_jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 12, minHeight: 44, paddingStart: 4 }, children: [_jsxs(View, { accessible:
|
|
19
|
+
return _jsxs(View, { testID: id, style: { gap: 8, marginTop: 16 }, children: [_jsxs(View, { style: { direction, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 12, minHeight: 44, paddingStart: 4 }, children: [_jsxs(View, { accessible: !split(group), accessibilityRole: split(group) ? undefined : 'header', accessibilityLabel: split(group) ? undefined : heading(group), testID: `${id}-title`, style: { flexDirection: 'row', alignItems: 'center', gap: 6, flexShrink: 1 }, children: [_jsx(Text, { accessible: split(group), accessibilityRole: split(group) ? 'header' : undefined, accessibilityLabel: split(group) ? heading(group) : undefined, numberOfLines: 1, style: { flexShrink: 1, fontSize: 16, lineHeight: 24, fontWeight: '500', color: colors.muted }, children: group.title }), group.verified ? (verifiedMark != null ? _jsx(View, { testID: `${id}-verified`, children: verifiedMark }) : _jsx(View, { testID: `${id}-verified`, style: { transform: [{ scale: 0.8 }] }, children: _jsx(SeverityIcon, { kind: 'success', color: colors.warning }) })) : null] }), group.help ? _jsx(SwapCapsule, { ref: group.help.ref, testID: `${id}-help`, hitSlop: helpSlop, onPress: group.help.onSelect, children: _jsx(Text, { style: { fontSize: 14, lineHeight: 20, fontWeight: '500', color: colors.muted }, children: group.help.label }) }) : null] }), group.items.length > 0 ? _jsx(View, { testID: `${id}-items`, style: { gap: 2, borderRadius: 20, overflow: 'hidden' }, children: group.items.map(item => _jsxs(SettingCard, { joined: true, testID: `${id}-${item.id}`, children: [_jsx(SettingSwitch, { testID: `${id}-${item.id}-switch`, label: item.label, description: item.description, checked: item.checked, disabled: item.disabled, locked: item.locked, labelAccessory: item.labelAccessory, labelAccessoryLabel: item.labelAccessoryLabel, onCheckedChange: item.onCheckedChange }), item.hint || item.error ? _jsxs(View, { style: { gap: 4 }, children: [item.hint ? _jsx(Text, { testID: `${id}-${item.id}-hint`, accessibilityLiveRegion: 'polite', style: { ...note, color: colors.muted }, children: item.hint }) : null, item.error ? _jsx(Text, { testID: `${id}-${item.id}-error`, accessibilityRole: 'alert', accessibilityLiveRegion: 'polite', style: { ...note, color: colors.negative }, children: item.error }) : null] }) : null] }, item.id)) }) : null] }, group.id);
|
|
14
20
|
});
|
|
15
|
-
|
|
21
|
+
const header = _jsx(SettingHeader, { testID: 'signals', title: title, onBack: onBack, action: headerAction });
|
|
22
|
+
const body = _jsxs(_Fragment, { children: [description ? _jsx(Text, { testID: 'signals-description', style: { ...note, color: colors.muted, marginTop: 16, paddingHorizontal: 4 }, children: description }) : null, sections] });
|
|
23
|
+
if (stickyHeader)
|
|
24
|
+
return _jsx(StickyHeaderLayout, { testID: testID, headerTestID: 'signals-sticky-header', header: header, background: stickyHeaderBackground, scrollComponent: scrollComponent, children: body });
|
|
25
|
+
return _jsxs(View, { testID: testID, style: { padding: 16 }, children: [header, body] });
|
|
16
26
|
}
|
package/native/dist/slider.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { numericRange } from '@bloxwap/hig/contracts';
|
|
2
3
|
import { View, Platform, UIManager, requireNativeComponent } from 'react-native';
|
|
3
4
|
import SliderBackend from '@react-native-community/slider';
|
|
4
5
|
import * as en from '@bloxwap/hig/contracts/messages';
|
|
@@ -9,7 +10,10 @@ import { Text } from './surface.js';
|
|
|
9
10
|
// {actionName:'setProgress',value}; without native linking (Expo Go, web, tests) the wrapper stays a plain View.
|
|
10
11
|
const AndroidAdjustable = Platform.OS === 'android' && UIManager.hasViewManagerConfig?.('HIGAdjustableView') ? requireNativeComponent('HIGAdjustableView') : null;
|
|
11
12
|
export function Slider({ label, value, defaultValue = 0, min = 0, max = 100, step = 1, disabled, onValueChange }) {
|
|
12
|
-
const
|
|
13
|
+
const range = numericRange(min, max, step);
|
|
14
|
+
const [stored, commit] = useControllable(value, defaultValue, onValueChange);
|
|
15
|
+
const current = range.clamp(stored);
|
|
16
|
+
const set = (next) => commit(range.clamp(next));
|
|
13
17
|
const { messages } = useHIG();
|
|
14
18
|
const colors = useColors();
|
|
15
19
|
const fills = useFills();
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ScrollViewProps } from 'react-native';
|
|
3
|
+
import { type SettingAction } from './setting-switch.js';
|
|
4
|
+
export type { SettingAction } from './setting-switch.js';
|
|
5
|
+
import type { Choice } from './selection-types.js';
|
|
2
6
|
/** A volume as a few fixed steps. `value` and `options` are fractions: 0.25 reads 25%. */
|
|
3
7
|
export interface SoundVolume {
|
|
4
8
|
/** Names the steps and is drawn above them: Volume. */
|
|
@@ -18,22 +22,45 @@ export interface SoundSection {
|
|
|
18
22
|
disabled?: boolean;
|
|
19
23
|
/** The device in use, under the switch: iPhone Microphone. */
|
|
20
24
|
source?: string;
|
|
25
|
+
/** A choice between devices, as radios under the source: Automatic, iPhone Microphone, AirPods. Shown while the channel is on. */
|
|
26
|
+
choices?: SoundChoices;
|
|
21
27
|
/** A live input level from 0 to 1, drawn as a meter. `null` draws an empty meter. */
|
|
22
28
|
level?: number | null;
|
|
29
|
+
/** Names the meter for assistive technology, which then reads the level as a percentage. Without it the meter is decorative. */
|
|
30
|
+
levelLabel?: string;
|
|
23
31
|
volume?: SoundVolume;
|
|
32
|
+
/** What the volume does while the channel is off: `hidden` (the default) leaves it out, `disabled` keeps it in place and unavailable. */
|
|
33
|
+
volumeWhenOff?: 'hidden' | 'disabled';
|
|
34
|
+
/** A secondary action at the foot of the card, shown whether the channel is on or off: Open Settings. `feedback: false` keeps the provider's press feedback off it. */
|
|
35
|
+
action?: SettingAction;
|
|
36
|
+
}
|
|
37
|
+
/** A choice of device under the source, such as which microphone to use. `label` names the group and is drawn above it. */
|
|
38
|
+
export interface SoundChoices {
|
|
39
|
+
label: string;
|
|
40
|
+
options: readonly Choice[];
|
|
41
|
+
value: string;
|
|
42
|
+
onValueChange: (value: string) => void;
|
|
24
43
|
}
|
|
25
44
|
export interface SoundHapticsBlockProps {
|
|
26
45
|
/** Heading: Sound & Haptics. */
|
|
27
46
|
title: string;
|
|
28
|
-
/**
|
|
47
|
+
/** A muted line under the header that explains the screen. */
|
|
48
|
+
description?: string;
|
|
49
|
+
/** One card each, in order. A section's source, choices and meter show only while it is on; its volume too unless `volumeWhenOff` is `disabled`. */
|
|
29
50
|
sections: readonly SoundSection[];
|
|
30
51
|
/** Shows Back on the leading edge of the header. */
|
|
31
52
|
onBack?: () => void;
|
|
32
53
|
/** A control on the trailing edge of the header, usually an IconButton. */
|
|
33
54
|
headerAction?: React.ReactNode;
|
|
55
|
+
/** Keeps the header pinned while the cards scroll: the block becomes its own scroll view with the header as its sticky first child, transparent at rest and filled once content scrolls under it. Place it in a bounded container. */
|
|
56
|
+
stickyHeader?: boolean;
|
|
57
|
+
/** Fill behind the pinned header once content scrolls under it. Defaults to the background role; in a sheet pass the sheet's fill. */
|
|
58
|
+
stickyHeaderBackground?: string;
|
|
59
|
+
/** The scroll view used with `stickyHeader`, such as a sheet library's own. */
|
|
60
|
+
scrollComponent?: React.ComponentType<ScrollViewProps>;
|
|
34
61
|
testID?: string;
|
|
35
62
|
}
|
|
36
63
|
/** The share of the meter filled, from 0 to 1. Unknown and out-of-range levels are clamped. */
|
|
37
64
|
export declare const soundLevel: (level: number | null | undefined) => number;
|
|
38
65
|
/** The settings for what the app plays and feels like, as a screen: each channel is a card with a switch, and a channel that is on can show the device it uses, a live input meter and its volume as fixed steps. */
|
|
39
|
-
export declare function SoundHapticsBlock({ title, sections, onBack, headerAction, testID }: SoundHapticsBlockProps): React.JSX.Element;
|
|
66
|
+
export declare function SoundHapticsBlock({ title, description, sections, onBack, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, testID }: SoundHapticsBlockProps): React.JSX.Element;
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { formatNumber } from '
|
|
4
|
-
import { useColors, useFills, useHIG } from './provider.js';
|
|
3
|
+
import { formatNumber } from './number-format.js';
|
|
4
|
+
import { useColors, useFills, useHIG, useNumberLocale } from './provider.js';
|
|
5
5
|
import { Text } from './surface.js';
|
|
6
6
|
import { Button } from './button.js';
|
|
7
7
|
import { SettingCard, SettingHeader, SettingSwitch } from './setting-switch.js';
|
|
8
|
+
import { StickyHeaderLayout } from './sticky-header.js';
|
|
9
|
+
import { RadioGroup } from './radio-group.js';
|
|
8
10
|
const steps = [0.25, 0.5, 0.75, 1], percent = { style: 'percent', maximumFractionDigits: 0 };
|
|
9
11
|
const hidden = { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' };
|
|
10
12
|
/** The share of the meter filled, from 0 to 1. Unknown and out-of-range levels are clamped. */
|
|
11
13
|
export const soundLevel = (level) => level == null || !Number.isFinite(level) ? 0 : Math.min(1, Math.max(0, level));
|
|
12
14
|
/** The settings for what the app plays and feels like, as a screen: each channel is a card with a switch, and a channel that is on can show the device it uses, a live input meter and its volume as fixed steps. */
|
|
13
|
-
export function SoundHapticsBlock({ title, sections, onBack, headerAction, testID }) {
|
|
14
|
-
const colors = useColors(), fills = useFills(), { direction
|
|
15
|
+
export function SoundHapticsBlock({ title, description, sections, onBack, headerAction, stickyHeader, stickyHeaderBackground, scrollComponent, testID }) {
|
|
16
|
+
const colors = useColors(), fills = useFills(), { direction } = useHIG(), locale = useNumberLocale();
|
|
15
17
|
const caption = { fontSize: 14, lineHeight: 21, color: colors.muted };
|
|
16
18
|
const cards = sections.map(section => {
|
|
17
|
-
const { source, level, volume } = section,
|
|
18
|
-
|
|
19
|
+
const { source, choices, level, levelLabel, volume, action } = section, on = section.checked, id = `sound-${section.id}`;
|
|
20
|
+
const showVolume = !!volume && (on || section.volumeWhenOff === 'disabled');
|
|
21
|
+
const open = (on && (!!source || !!choices || level !== undefined)) || showVolume || !!action;
|
|
22
|
+
const share = soundLevel(level);
|
|
23
|
+
const fill = _jsx(View, { testID: `${id}-level`, style: { width: `${share * 100}%`, borderRadius: 2, backgroundColor: colors.action } }), track = { direction, flexDirection: 'row', height: 4, borderRadius: 2, backgroundColor: fills.raised, overflow: 'hidden' };
|
|
24
|
+
return _jsxs(SettingCard, { testID: id, children: [_jsx(SettingSwitch, { testID: `${id}-switch`, label: section.label, description: section.description, checked: section.checked, disabled: section.disabled, onCheckedChange: section.onCheckedChange }), open ? _jsxs(View, { testID: `${id}-body`, style: { gap: 8 }, children: [on && source ? _jsx(Text, { testID: `${id}-source`, style: caption, children: source }) : null, on && choices ? _jsx(View, { testID: `${id}-choices`, children: _jsx(RadioGroup, { label: choices.label, options: choices.options, value: choices.value, disabled: section.disabled, onValueChange: choices.onValueChange }) }) : null, on && level !== undefined ? (levelLabel ? _jsx(View, { testID: `${id}-meter`, accessible: true, accessibilityRole: 'progressbar', accessibilityLabel: levelLabel, accessibilityValue: { min: 0, max: 100, now: Math.round(share * 100), text: formatNumber(share, locale, percent) }, style: track, children: fill })
|
|
25
|
+
: _jsx(View, { ...hidden, testID: `${id}-meter`, style: track, children: fill })) : null, showVolume && volume ? _jsxs(View, { testID: `${id}-volume`, accessibilityRole: 'radiogroup', accessibilityLabel: volume.label, style: { gap: 8 }, children: [_jsx(Text, { ...hidden, style: caption, children: volume.label }), _jsx(View, { style: { direction, flexDirection: 'row', gap: 8 }, children: (volume.options ?? steps).map(option => _jsx(Button, { testID: `${id}-volume-${option}`, intent: option === volume.value ? 'primary' : 'secondary', accessibilityState: { selected: option === volume.value }, disabled: on ? section.disabled : true, onPress: () => volume.onValueChange(option), style: { flex: 1, alignSelf: 'auto', paddingHorizontal: 8 }, children: formatNumber(option, locale, percent) }, option)) })] }) : null, action ? _jsx(View, { style: { marginTop: on && (source || choices || level !== undefined) || showVolume ? 8 : 0 }, children: _jsx(Button, { testID: `${id}-action`, intent: 'secondary', fullWidth: true, disabled: action.disabled, suppressFeedback: action.feedback === false, onPress: action.onSelect, children: action.label }) }) : null] }) : null] }, section.id);
|
|
19
26
|
});
|
|
20
|
-
|
|
27
|
+
const header = _jsx(SettingHeader, { testID: 'sound', title: title, onBack: onBack, action: headerAction });
|
|
28
|
+
const body = _jsxs(_Fragment, { children: [description ? _jsx(Text, { testID: 'sound-description', style: { ...caption, marginTop: 16, paddingHorizontal: 4 }, children: description }) : null, sections.length > 0 ? _jsx(View, { testID: 'sound-sections', style: { gap: 8, marginTop: 16 }, children: cards }) : null] });
|
|
29
|
+
if (stickyHeader)
|
|
30
|
+
return _jsx(StickyHeaderLayout, { testID: testID, headerTestID: 'sound-sticky-header', header: header, background: stickyHeaderBackground, scrollComponent: scrollComponent, children: body });
|
|
31
|
+
return _jsxs(View, { testID: testID, style: { padding: 16 }, children: [header, body] });
|
|
21
32
|
}
|
package/native/dist/status.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AvatarFrameProps } from './avatar-frame.js';
|
|
3
|
+
import { type DimensionValue, type StyleProp, type ViewProps, type ViewStyle, type TextProps } from 'react-native';
|
|
3
4
|
import { type AccentRole } from './roles.js';
|
|
4
5
|
export type { AccentRole } from './roles.js';
|
|
5
6
|
declare const severityRole: {
|
|
@@ -12,14 +13,22 @@ declare const severityRole: {
|
|
|
12
13
|
};
|
|
13
14
|
/** `note` and `tip` are documentation callout severities that reuse the info and positive token roles; `default` is the neutral variant (a faint `text` tint, title in `text`). */
|
|
14
15
|
export type AlertSeverity = keyof typeof severityRole | 'default';
|
|
16
|
+
/** A badge's meaning, as on web: explicit, never inferred from text or a number's sign. */
|
|
17
|
+
export type BadgeTone = 'neutral' | 'positive' | 'negative' | 'warning' | 'info';
|
|
18
|
+
export interface BadgeProps {
|
|
19
|
+
children?: React.ReactNode; /** `positive`, `negative`, `warning` or `info` draws the label in that token role over a 15% wash of it, like web `.hig-badge[data-tone]`; `neutral` (default) keeps the well fill. */
|
|
20
|
+
tone?: BadgeTone; /** A 6dp status dot in the label colour on the leading edge, hidden from assistive technology. */
|
|
21
|
+
dot?: boolean;
|
|
22
|
+
testID?: string;
|
|
23
|
+
}
|
|
15
24
|
/** Neutral chip in the dark well fill (one step lighter inside a Surface, Dialog or sheet). */
|
|
16
|
-
export declare function Badge({ children }:
|
|
17
|
-
/** Severity tints the fill 10% and colours the title from a token role (info/note → info, success/tip → positive, warning, error → negative; default → 6% of `text`), with no stroke or glow; `tone` swaps in another approved token role, never a raw colour. A non-string title renders inside the Heading, so pass strings or inline Text; its visible text is announced. */
|
|
18
|
-
export declare function Alert({ title, children, severity, tone, action, announce }: React.PropsWithChildren<{
|
|
25
|
+
export declare function Badge({ children, tone, dot, testID }: BadgeProps): React.JSX.Element;
|
|
26
|
+
/** Severity tints the fill 10% and colours the title from a token role (info/note → info, success/tip → positive, warning, error → negative; default → 6% of `text`), with no stroke or glow; `tone` swaps in another approved token role, never a raw colour. A non-string title renders inside the Heading, so pass strings or inline Text; its visible text is announced. A string or number child is drawn in a HIG `Text`. `announce` (default true) speaks the title and body when they appear or change; pass `false` for guidance that is present from the start. */
|
|
27
|
+
export declare function Alert({ title, children: body, severity, tone, action, announce }: React.PropsWithChildren<{
|
|
19
28
|
title: React.ReactNode;
|
|
20
29
|
severity?: AlertSeverity;
|
|
21
30
|
tone?: AccentRole;
|
|
22
|
-
action?: React.ReactNode;
|
|
31
|
+
action?: React.ReactNode; /** Speaks the alert when it appears or changes (iOS announcement, Android live region). Defaults to true. */
|
|
23
32
|
announce?: boolean;
|
|
24
33
|
}>): React.JSX.Element;
|
|
25
34
|
export declare const Callout: typeof Alert;
|
|
@@ -41,6 +50,23 @@ export interface ToastProps {
|
|
|
41
50
|
maxHeight?: DimensionValue;
|
|
42
51
|
testID?: string;
|
|
43
52
|
}
|
|
53
|
+
export interface ToastNoticeProps {
|
|
54
|
+
message: string;
|
|
55
|
+
/** A second line under the message, in regular weight. */
|
|
56
|
+
description?: string;
|
|
57
|
+
severity?: Notice['severity'];
|
|
58
|
+
action?: React.ReactNode;
|
|
59
|
+
/** Accessible name of the close control; defaults to HIGProvider `messages.dismissNotice` around the message. */
|
|
60
|
+
dismissName?: string;
|
|
61
|
+
/** Draws the close control and takes its press. Omitted, the notice has none. */
|
|
62
|
+
onDismiss?: () => void;
|
|
63
|
+
/** Sizes the capsule to its content, up to the room it has, instead of filling its parent. `Toaster` draws it this way. Default `false`. */
|
|
64
|
+
hug?: boolean;
|
|
65
|
+
/** Merged over the capsule's fill, radius and shadow. */
|
|
66
|
+
style?: StyleProp<ViewStyle>;
|
|
67
|
+
}
|
|
68
|
+
/** One notice as a single capsule row: severity symbol on the leading edge, message with an optional description under it, optional action, close on the trailing edge. Shared by `Toast` and the transient `Toaster` of `@bloxwap/hig/native/toast`; it announces nothing itself. */
|
|
69
|
+
export declare function ToastNotice({ message, description, severity, action, dismissName, onDismiss, hug, style }: ToastNoticeProps): React.JSX.Element;
|
|
44
70
|
/** Each notice is one capsule row: severity symbol, message, optional action, then a close control. Compact, scrollable notices remain visible until their host removes them. */
|
|
45
71
|
export declare function Toast({ notices, onDismiss, dismissLabel, maxHeight, testID }: ToastProps): React.JSX.Element;
|
|
46
72
|
/** One transient notice: shown for about four seconds, replaced by the next one, dismissible, and cleared on unmount. Render it with `Toast`, which announces it. */
|
|
@@ -49,13 +75,19 @@ export declare function useTransientNotice(duration?: number): {
|
|
|
49
75
|
show: (message: string, severity?: Notice['severity']) => void;
|
|
50
76
|
dismiss: () => void;
|
|
51
77
|
};
|
|
52
|
-
export
|
|
78
|
+
export interface SpinnerProps {
|
|
79
|
+
/** What is loading; defaults to HIGProvider `messages.loading`. */
|
|
53
80
|
label?: string;
|
|
54
|
-
|
|
55
|
-
|
|
81
|
+
/** Draws the indicator alone, for a tight spot such as a row or a button-sized slot: the label is not drawn but stays the element's accessibility label. */
|
|
82
|
+
hideLabel?: boolean;
|
|
83
|
+
testID?: string;
|
|
84
|
+
}
|
|
85
|
+
export declare function Spinner({ label, hideLabel, testID }: SpinnerProps): React.JSX.Element;
|
|
86
|
+
export declare function Progress({ label, value, max, hideValue }: {
|
|
56
87
|
label: string;
|
|
57
88
|
value?: number;
|
|
58
|
-
max?: number;
|
|
89
|
+
max?: number; /** Draws the label without the ` value/max` suffix (or the `…` while indeterminate), for a host that shows the figure itself. The value is still read. */
|
|
90
|
+
hideValue?: boolean;
|
|
59
91
|
}): React.JSX.Element;
|
|
60
92
|
/** Pulses while content is on its way; still with reduced motion. */
|
|
61
93
|
export declare function Skeleton({ label }: {
|
|
@@ -74,11 +106,12 @@ export interface EmptyStateProps extends Omit<ViewProps, 'children'> {
|
|
|
74
106
|
}
|
|
75
107
|
/** A strokeless card, centred: icon, title, optional description, then the action. */
|
|
76
108
|
export declare function EmptyState({ title, description, action, illustration, titleStyle, descriptionStyle, maxFontSizeMultiplier, ...props }: EmptyStateProps): React.JSX.Element;
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
109
|
+
/**
|
|
110
|
+
* A person or account as a 40dp disc: an image, else the first two letters of the name on the well fill (one step lighter inside a Surface, Dialog or sheet).
|
|
111
|
+
* `size`, `square` and `decorative` are as in `@bloxwap/hig/native/avatar`, whose `Avatar` also draws a face generated from a seed; that entry needs `react-native-svg` and this one does not.
|
|
112
|
+
* It renders again only when one of its props changes.
|
|
113
|
+
*/
|
|
114
|
+
export declare function Avatar(props: AvatarFrameProps): React.JSX.Element;
|
|
82
115
|
/** The dot carries the state colour. Online and stale emit a ring that grows and fades in that colour; offline and reduced motion stay still. */
|
|
83
116
|
export declare function StatusIndicator({ label, state }: {
|
|
84
117
|
label: string;
|
package/native/dist/status.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { progressValue } from '@bloxwap/hig/contracts';
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { tokens } from '@bloxwap/hig/tokens';
|
|
4
5
|
import { CloseIcon, EmptyIcon, SeverityIcon } from './icons.js';
|
|
5
6
|
import { notificationDelta } from '@bloxwap/hig/contracts/announcements';
|
|
6
|
-
import {
|
|
7
|
+
import { AvatarFrame, sameFrame } from './avatar-frame.js';
|
|
8
|
+
import { ActivityIndicator, Animated, Easing, View, ScrollView, useWindowDimensions, Platform } from 'react-native';
|
|
7
9
|
import { Text, Heading, Surface, Stack } from './surface.js';
|
|
8
|
-
import { formatNumber } from '
|
|
10
|
+
import { formatNumber } from './number-format.js';
|
|
9
11
|
import { Button } from './button.js';
|
|
10
12
|
import * as en from '@bloxwap/hig/contracts/messages';
|
|
11
13
|
import { useColors, useFills, useHIG } from './provider.js';
|
|
12
14
|
import { blockText, plainText } from './text-content.js';
|
|
13
15
|
import { roleColor } from './roles.js';
|
|
16
|
+
import { speak } from './announce.js';
|
|
14
17
|
const severityRole = { info: 'info', note: 'info', success: 'positive', tip: 'positive', warning: 'warning', error: 'negative' };
|
|
15
|
-
function speak(message, severity) { if (Platform.OS === 'web' || !message)
|
|
16
|
-
return; try {
|
|
17
|
-
if (Platform.OS === 'ios' && typeof AccessibilityInfo.announceForAccessibilityWithOptions === 'function')
|
|
18
|
-
AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: severity !== 'error' });
|
|
19
|
-
else
|
|
20
|
-
AccessibilityInfo.announceForAccessibility(message);
|
|
21
|
-
}
|
|
22
|
-
catch { /* The visible message and navigable text remain available. */ } }
|
|
23
18
|
/** Neutral chip in the dark well fill (one step lighter inside a Surface, Dialog or sheet). */
|
|
24
|
-
export function Badge({ children
|
|
19
|
+
export function Badge({ children, tone = 'neutral', dot, testID }) {
|
|
20
|
+
const fills = useFills();
|
|
21
|
+
const colors = useColors();
|
|
22
|
+
const accent = tone === 'positive' || tone === 'negative' || tone === 'warning' || tone === 'info' ? colors[tone] : undefined;
|
|
23
|
+
/* 15% of the role over whatever is behind, as web color-mix with transparent; a colour that is not #rrggbb blends into the well instead. */
|
|
24
|
+
const fill = accent ? (/^#[0-9a-f]{6}$/i.test(accent) ? `${accent}26` : tint(accent, fills.well, 0.15)) : fills.well;
|
|
25
|
+
const chip = { alignSelf: 'flex-start', maxWidth: '100%', backgroundColor: fill, overflow: 'hidden', borderRadius: 9999, paddingVertical: 4, paddingHorizontal: 10 };
|
|
26
|
+
const label = accent ? { color: accent } : null;
|
|
27
|
+
return dot ? _jsxs(View, { testID: testID, style: [chip, { flexDirection: 'row', alignItems: 'center', gap: 6 }], children: [_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', style: { width: 6, height: 6, borderRadius: 3, backgroundColor: accent ?? colors.text } }), _jsx(Text, { style: [label, { flexShrink: 1 }], children: children })] }) : _jsx(Text, { testID: testID, style: label ? [chip, label] : chip, children: children });
|
|
28
|
+
}
|
|
25
29
|
/** Opaque sRGB blend of `tone` into `base` (both `#rrggbb`): the native counterpart of CSS `color-mix`. */
|
|
26
30
|
const tint = (tone, base, amount) => '#' + [1, 3, 5].map(i => Math.round(parseInt(base.slice(i, i + 2), 16) * (1 - amount) + parseInt(tone.slice(i, i + 2), 16) * amount).toString(16).padStart(2, '0')).join('');
|
|
27
|
-
/** Severity tints the fill 10% and colours the title from a token role (info/note → info, success/tip → positive, warning, error → negative; default → 6% of `text`), with no stroke or glow; `tone` swaps in another approved token role, never a raw colour. A non-string title renders inside the Heading, so pass strings or inline Text; its visible text is announced. */
|
|
28
|
-
export function Alert({ title, children, severity = 'info', tone, action, announce = true }) { const colors = useColors(); const neutral = severity === 'default' && tone === undefined; const accent = neutral ? colors.text : roleColor(tone, severityRole[severity] ?? 'info', colors); const message = [plainText(title), blockText(children)].filter(Boolean).join('. '); const previous = useRef(''); useEffect(() => { const key = severity + message; if (announce && key !== previous.current) {
|
|
31
|
+
/** Severity tints the fill 10% and colours the title from a token role (info/note → info, success/tip → positive, warning, error → negative; default → 6% of `text`), with no stroke or glow; `tone` swaps in another approved token role, never a raw colour. A non-string title renders inside the Heading, so pass strings or inline Text; its visible text is announced. A string or number child is drawn in a HIG `Text`. `announce` (default true) speaks the title and body when they appear or change; pass `false` for guidance that is present from the start. */
|
|
32
|
+
export function Alert({ title, children: body, severity = 'info', tone, action, announce = true }) { const children = React.Children.map(body, child => typeof child === 'string' || typeof child === 'number' ? _jsx(Text, { children: child }) : child); const colors = useColors(); const neutral = severity === 'default' && tone === undefined; const accent = neutral ? colors.text : roleColor(tone, severityRole[severity] ?? 'info', colors); const message = [plainText(title), blockText(children)].filter(Boolean).join('. '); const previous = useRef(''); useEffect(() => { const key = severity + message; if (announce && key !== previous.current) {
|
|
29
33
|
previous.current = key;
|
|
30
34
|
if (Platform.OS === 'ios')
|
|
31
35
|
speak(message, severity);
|
|
@@ -37,10 +41,16 @@ function useLoop(active, duration, easing = Easing.linear) { const value = useRe
|
|
|
37
41
|
value.setValue(0);
|
|
38
42
|
return;
|
|
39
43
|
} const loop = Animated.loop(Animated.timing(value, { toValue: 1, duration, easing, useNativeDriver: Platform.OS !== 'web', isInteraction: false })); loop.start(); return () => loop.stop(); }, [active, duration, easing, value]); return value; }
|
|
40
|
-
/**
|
|
41
|
-
export function
|
|
44
|
+
/** One notice as a single capsule row: severity symbol on the leading edge, message with an optional description under it, optional action, close on the trailing edge. Shared by `Toast` and the transient `Toaster` of `@bloxwap/hig/native/toast`; it announces nothing itself. */
|
|
45
|
+
export function ToastNotice({ message, description, severity = 'info', action, dismissName, onDismiss, hug = false, style }) {
|
|
42
46
|
const { messages, direction } = useHIG();
|
|
43
47
|
const colors = useColors();
|
|
48
|
+
const close = onDismiss ? _jsx(Button, { intent: 'ghost', contentMode: 'custom', suppressFeedback: true, accessibilityLabel: dismissName ?? (messages.dismissNotice ?? en.dismissNotice)(message, messages.dismiss ?? en.dismiss), hitSlop: 8, onPress: onDismiss, style: { minHeight: 32, minWidth: 32, paddingHorizontal: 0, paddingVertical: 0, alignSelf: 'center' }, children: _jsx(CloseIcon, { color: colors.muted }) }) : null;
|
|
49
|
+
return _jsxs(View, { accessibilityLiveRegion: 'none', style: [{ direction, flexDirection: 'row', alignItems: 'center', gap: 10, minHeight: 44, paddingVertical: 6, paddingHorizontal: 12, borderRadius: 22, backgroundColor: colors.nested, boxShadow: '0 4px 16px #0006' }, style], children: [_jsx(SeverityIcon, { kind: severity, color: colors[severityRole[severity]] }), _jsxs(View, { style: hug ? { flexShrink: 1, minWidth: 0 } : { flex: 1, minWidth: 0 }, children: [_jsx(Text, { style: { fontWeight: '600' }, children: message }), description ? _jsx(Text, { children: description }) : null] }), action, close] });
|
|
50
|
+
}
|
|
51
|
+
/** Each notice is one capsule row: severity symbol, message, optional action, then a close control. Compact, scrollable notices remain visible until their host removes them. */
|
|
52
|
+
export function Toast({ notices, onDismiss, dismissLabel, maxHeight, testID }) {
|
|
53
|
+
const { messages } = useHIG();
|
|
44
54
|
const { height } = useWindowDimensions();
|
|
45
55
|
const dismiss = dismissLabel ?? messages.dismiss ?? en.dismiss;
|
|
46
56
|
const unique = [...new Map(notices.map(n => [n.id, n])).values()];
|
|
@@ -65,7 +75,7 @@ export function Toast({ notices, onDismiss, dismissLabel, maxHeight, testID }) {
|
|
|
65
75
|
}, [key]);
|
|
66
76
|
useEffect(() => () => { if (timer.current !== null)
|
|
67
77
|
clearTimeout(timer.current); }, []);
|
|
68
|
-
return _jsxs(View, { testID: testID, style: { maxHeight: maxHeight ?? height * .6, flexShrink: 1 }, children: [_jsx(ScrollView, { style: { flexGrow: 0, flexShrink: 1 }, nestedScrollEnabled: true, keyboardShouldPersistTaps: 'handled', accessibilityLabel: messages.notifications ?? en.notifications, children: _jsx(Stack, { style: { gap: 8 }, children: unique.map(n =>
|
|
78
|
+
return _jsxs(View, { testID: testID, style: { maxHeight: maxHeight ?? height * .6, flexShrink: 1 }, children: [_jsx(ScrollView, { style: { flexGrow: 0, flexShrink: 1 }, nestedScrollEnabled: true, keyboardShouldPersistTaps: 'handled', accessibilityLabel: messages.notifications ?? en.notifications, children: _jsx(Stack, { style: { gap: 8 }, children: unique.map(n => _jsx(ToastNotice, { message: n.message, description: n.description, severity: n.severity, action: n.action, dismissName: (messages.dismissNotice ?? en.dismissNotice)(n.message, dismiss), onDismiss: n.closable !== false && onDismiss ? () => onDismiss(n.id) : undefined }, n.id)) }) }), Platform.OS === 'web' && _jsx(Text, { accessibilityLiveRegion: 'polite', style: { position: 'absolute', width: 1, height: 1, overflow: 'hidden' }, children: announcement })] });
|
|
69
79
|
}
|
|
70
80
|
/** One transient notice: shown for about four seconds, replaced by the next one, dismissible, and cleared on unmount. Render it with `Toast`, which announces it. */
|
|
71
81
|
export function useTransientNotice(duration = 4000) {
|
|
@@ -80,13 +90,14 @@ export function useTransientNotice(duration = 4000) {
|
|
|
80
90
|
return { notice, dismiss: () => { stop(); setNotice(null); }, show: (message, severity = 'success') => { if (!alive.current)
|
|
81
91
|
return; stop(); setNotice({ id: `notice-${++sequence.current}`, message, severity }); timer.current = setTimeout(() => { timer.current = null; setNotice(null); }, duration); } };
|
|
82
92
|
}
|
|
83
|
-
export function Spinner({ label }) { const { messages } = useHIG(); const colors = useColors(); const text = label ?? messages.loading ?? en.loading; return _jsxs(View, { accessible: true, accessibilityLabel: text, children: [_jsx(ActivityIndicator, { color: colors.action }), _jsx(Text, { children: text })] }); }
|
|
84
|
-
export function Progress({ label, value, max = 100 }) {
|
|
93
|
+
export function Spinner({ label, hideLabel, testID }) { const { messages } = useHIG(); const colors = useColors(); const text = label ?? messages.loading ?? en.loading; return _jsxs(View, { testID: testID, accessible: true, accessibilityLabel: text, children: [_jsx(ActivityIndicator, { color: colors.action }), hideLabel ? null : _jsx(Text, { children: text })] }); }
|
|
94
|
+
export function Progress({ label, value, max = 100, hideValue }) {
|
|
95
|
+
({ value, max } = progressValue(value, max));
|
|
85
96
|
const { locale, messages, direction } = useHIG();
|
|
86
97
|
const colors = useColors();
|
|
87
98
|
const fills = useFills();
|
|
88
99
|
const fill = value === undefined ? 35 : Math.min(100, Math.max(0, Number.isFinite(value) && max > 0 ? value / max * 100 : 0));
|
|
89
|
-
return _jsxs(View, { style: { gap: 12, direction }, accessibilityRole: 'progressbar', accessibilityLabel: label, accessibilityValue: { min: 0, max, now: value, text: value === undefined ? messages.inProgress ?? en.inProgress : (messages.progressValue ?? en.progressValue)(formatNumber(value, locale), formatNumber(max, locale)) }, children: [_jsxs(Text, { children: [label, value === undefined ? '…' : ` ${value}/${max}`] }), _jsx(View, { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', style: { height: 6, borderRadius: 9999, overflow: 'hidden', backgroundColor: fills.raised }, children: _jsx(View, { style: { width: `${fill}%`, height: '100%', alignSelf: value === undefined ? 'center' : 'flex-start', borderRadius: 9999, backgroundColor: colors.action } }) })] });
|
|
100
|
+
return _jsxs(View, { style: { gap: 12, direction }, accessibilityRole: 'progressbar', accessibilityLabel: label, accessibilityValue: { min: 0, max, now: value, text: value === undefined ? messages.inProgress ?? en.inProgress : (messages.progressValue ?? en.progressValue)(formatNumber(value, locale), formatNumber(max, locale)) }, children: [_jsxs(Text, { children: [label, hideValue ? null : value === undefined ? '…' : ` ${value}/${max}`] }), _jsx(View, { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', style: { height: 6, borderRadius: 9999, overflow: 'hidden', backgroundColor: fills.raised }, children: _jsx(View, { style: { width: `${fill}%`, height: '100%', alignSelf: value === undefined ? 'center' : 'flex-start', borderRadius: 9999, backgroundColor: colors.action } }) })] });
|
|
90
101
|
}
|
|
91
102
|
/** Pulses while content is on its way; still with reduced motion. */
|
|
92
103
|
export function Skeleton({ label }) { const { messages, reducedMotion } = useHIG(); const fills = useFills(); const pulse = useLoop(!reducedMotion, 1500); return _jsx(Animated.View, { accessible: true, accessibilityLabel: label ?? messages.loadingContent ?? en.loadingContent, style: { minHeight: 48, backgroundColor: fills.raised, borderRadius: 10, opacity: pulse.interpolate({ inputRange: [0, .5, 1], outputRange: [1, .5, 1] }) } }); }
|
|
@@ -96,8 +107,14 @@ export function EmptyState({ title, description, action, illustration, titleStyl
|
|
|
96
107
|
const mark = illustration !== undefined ? illustration : _jsx(EmptyIcon, { color: colors.muted });
|
|
97
108
|
return _jsxs(Surface, { ...props, style: [{ gap: 12, alignItems: 'center' }, props.style], children: [mark != null && _jsx(View, { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants', children: mark }), _jsx(Heading, { style: [{ textAlign: 'center' }, titleStyle], maxFontSizeMultiplier: maxFontSizeMultiplier, children: title }), description ? _jsx(Text, { style: [{ textAlign: 'center', color: colors.muted }, descriptionStyle], maxFontSizeMultiplier: maxFontSizeMultiplier, children: description }) : null, action] });
|
|
98
109
|
}
|
|
99
|
-
/**
|
|
100
|
-
|
|
110
|
+
/** The Avatar frame, kept while its props are the same: a list that renders again renders no frame for the rows that did not change. */
|
|
111
|
+
const StillFrame = React.memo(AvatarFrame, sameFrame);
|
|
112
|
+
/**
|
|
113
|
+
* A person or account as a 40dp disc: an image, else the first two letters of the name on the well fill (one step lighter inside a Surface, Dialog or sheet).
|
|
114
|
+
* `size`, `square` and `decorative` are as in `@bloxwap/hig/native/avatar`, whose `Avatar` also draws a face generated from a seed; that entry needs `react-native-svg` and this one does not.
|
|
115
|
+
* It renders again only when one of its props changes.
|
|
116
|
+
*/
|
|
117
|
+
export function Avatar(props) { return _jsx(StillFrame, { ...props }); }
|
|
101
118
|
const statusRole = { online: 'positive', stale: 'warning', offline: 'muted' };
|
|
102
119
|
const ringEasing = Easing.out(Easing.quad);
|
|
103
120
|
/** The dot carries the state colour. Online and stale emit a ring that grows and fades in that colour; offline and reduced motion stay still. */
|