@multiplatform.one/forms 7.8.0 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Button/index.cjs +1 -1
- package/dist/cjs/Button/index.native.js +5 -3
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/InputParts/index.cjs +11 -2
- package/dist/cjs/InputParts/index.native.js +11 -2
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/fields/FileUpload/index.cjs +6 -0
- package/dist/cjs/fields/FileUpload/index.native.js +6 -0
- package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
- package/dist/cjs/fields/Icon/drawnSet.cjs +3 -1
- package/dist/cjs/fields/Icon/drawnSet.native.js +3 -1
- package/dist/cjs/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/cjs/fields/RadioGroup/index.cjs +34 -5
- package/dist/cjs/fields/RadioGroup/index.native.js +49 -7
- package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/cjs/fields/ToggleGroup/index.cjs +35 -2
- package/dist/cjs/fields/ToggleGroup/index.native.js +42 -2
- package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/cjs/shared/nativeA11y.cjs +57 -0
- package/dist/cjs/shared/nativeA11y.native.js +61 -0
- package/dist/cjs/shared/nativeA11y.native.js.map +1 -0
- package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +1 -1
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +5 -3
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/UnsavedChangesDialog.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/clientKnownIdentity.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/commitImmediateField.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/useUnsavedChangesGuard.native.js.map +1 -1
- package/dist/esm/ControlGroup/index.native.js.map +1 -1
- package/dist/esm/DescriptionList/index.native.js.map +1 -1
- package/dist/esm/ErrorSummary.native.js.map +1 -1
- package/dist/esm/FieldDisplay/editMode.native.js.map +1 -1
- package/dist/esm/FieldDisplay/formatters.native.js.map +1 -1
- package/dist/esm/FieldDisplay/index.native.js.map +1 -1
- package/dist/esm/FieldGroup.native.js.map +1 -1
- package/dist/esm/FloatingPanel/nestedAction.native.js.map +1 -1
- package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
- package/dist/esm/Form/index.native.js.map +1 -1
- package/dist/esm/Form/validateOn.native.js.map +1 -1
- package/dist/esm/FormGrid.native.js.map +1 -1
- package/dist/esm/FormSection.native.js.map +1 -1
- package/dist/esm/InputParts/index.mjs +11 -2
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +11 -2
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/Label/index.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/Spinner/SpinnerGlyph.native.js.map +1 -1
- package/dist/esm/Spinner/spinnerSize.native.js.map +1 -1
- package/dist/esm/Table/index.native.js.map +1 -1
- package/dist/esm/Wheel/haptic.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/actionLabel.native.js.map +1 -1
- package/dist/esm/fieldDefaults.native.js.map +1 -1
- package/dist/esm/fieldLayout.native.js.map +1 -1
- package/dist/esm/fields/Barcode/BarcodePreview.native.js.map +1 -1
- package/dist/esm/fields/Barcode/code128.native.js.map +1 -1
- package/dist/esm/fields/Barcode/index.native.js.map +1 -1
- package/dist/esm/fields/Barcode/qr.native.js.map +1 -1
- package/dist/esm/fields/Barcode/scannerTypes.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/Checkbox.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxBox.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxCard.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/CheckboxGroup.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/checkboxGroupContext.native.js.map +1 -1
- package/dist/esm/fields/Checkbox/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/index.native.js.map +1 -1
- package/dist/esm/fields/ColorPicker/parts.native.js.map +1 -1
- package/dist/esm/fields/Combobox/authorOptions.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/Calendar.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DateRangePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/MonthPicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/fieldValueSync.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/DatePicker/utils.native.js.map +1 -1
- package/dist/esm/fields/Duration/durationMath.native.js.map +1 -1
- package/dist/esm/fields/Duration/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/filePickerTypes.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/index.mjs +6 -0
- package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
- package/dist/esm/fields/FileUpload/index.native.js +6 -0
- package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
- package/dist/esm/fields/FileUpload/nativePickerLoader.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/expoMapsLoader.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/geoValue.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/geocoder.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/index.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/mapMath.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/mapTypes.native.js.map +1 -1
- package/dist/esm/fields/Geolocation/nativeSearchFocus.native.js.map +1 -1
- package/dist/esm/fields/Icon/drawnSet.mjs +3 -1
- package/dist/esm/fields/Icon/drawnSet.mjs.map +1 -1
- package/dist/esm/fields/Icon/drawnSet.native.js +3 -1
- package/dist/esm/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/esm/fields/Icon/index.native.js.map +1 -1
- package/dist/esm/fields/ImageField/index.native.js.map +1 -1
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/MentionInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/index.native.js.map +1 -1
- package/dist/esm/fields/OTPInput/otpCellCss.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/dialCodes.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/index.native.js.map +1 -1
- package/dist/esm/fields/PhoneInput/phone.native.js.map +1 -1
- package/dist/esm/fields/Progress/index.native.js.map +1 -1
- package/dist/esm/fields/RadioGroup/index.mjs +34 -5
- package/dist/esm/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/esm/fields/RadioGroup/index.native.js +49 -7
- package/dist/esm/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/esm/fields/Rating/index.native.js.map +1 -1
- package/dist/esm/fields/Rating/ratingMath.native.js.map +1 -1
- package/dist/esm/fields/Rating/types.native.js.map +1 -1
- package/dist/esm/fields/SearchInput/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Signature/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/index.native.js.map +1 -1
- package/dist/esm/fields/Slider/jumpMotion.native.js.map +1 -1
- package/dist/esm/fields/Stepper/index.native.js.map +1 -1
- package/dist/esm/fields/Stepper/resolveStepperPlacement.native.js.map +1 -1
- package/dist/esm/fields/Switch/index.native.js.map +1 -1
- package/dist/esm/fields/TextArea/index.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/catalog.native.js.map +1 -1
- package/dist/esm/fields/TimePicker/parts.native.js.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/geometry.native.js.map +1 -1
- package/dist/esm/fields/TimeRangeScrubber/index.native.js.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.mjs +35 -2
- package/dist/esm/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/esm/fields/ToggleGroup/index.native.js +42 -2
- package/dist/esm/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/osDateTimeIosDisplay.native.js.map +1 -1
- package/dist/esm/fields/nativeSelect.native.js.map +1 -1
- package/dist/esm/fields/selectedOrder.native.js.map +1 -1
- package/dist/esm/formSpacing.native.js.map +1 -1
- package/dist/esm/hooks/useFocusManagement.native.js.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/requiredMarking.native.js.map +1 -1
- package/dist/esm/shared/TimeColumn.native.js.map +1 -1
- package/dist/esm/shared/capabilityPreflight.native.js.map +1 -1
- package/dist/esm/shared/colorRamps.native.js.map +1 -1
- package/dist/esm/shared/devWarn.native.js.map +1 -1
- package/dist/esm/shared/floatingList.native.js.map +1 -1
- package/dist/esm/shared/focusManagement.native.js.map +1 -1
- package/dist/esm/shared/groupContext.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/nativeA11y.mjs +31 -0
- package/dist/esm/shared/nativeA11y.mjs.map +1 -0
- package/dist/esm/shared/nativeA11y.native.js +32 -0
- package/dist/esm/shared/nativeA11y.native.js.map +1 -0
- package/dist/esm/shared/pickerTriggerContract.native.js.map +1 -1
- package/dist/esm/shared/pressSlopProps.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/tableCellContext.native.js.map +1 -1
- package/dist/esm/shared/useDragScroll.native.js.map +1 -1
- package/dist/esm/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/esm/shared/useSheetEscapeDismiss.native.js.map +1 -1
- package/dist/esm/shared/useWheelIncrement.native.js.map +1 -1
- package/dist/esm/shared/utils.native.js.map +1 -1
- package/dist/esm/shared/zIndex.native.js.map +1 -1
- package/dist/esm/themedPrimitives.native.js.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/utils/LinkCell.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +1 -1
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +5 -3
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/InputParts/index.mjs +11 -2
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +11 -2
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/fields/FileUpload/index.mjs +6 -0
- package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
- package/dist/jsx/fields/FileUpload/index.native.js +6 -0
- package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
- package/dist/jsx/fields/Icon/drawnSet.mjs +3 -1
- package/dist/jsx/fields/Icon/drawnSet.mjs.map +1 -1
- package/dist/jsx/fields/Icon/drawnSet.native.js +3 -1
- package/dist/jsx/fields/Icon/drawnSet.native.js.map +1 -1
- package/dist/jsx/fields/RadioGroup/index.mjs +34 -5
- package/dist/jsx/fields/RadioGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/RadioGroup/index.native.js +49 -7
- package/dist/jsx/fields/RadioGroup/index.native.js.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.mjs +35 -2
- package/dist/jsx/fields/ToggleGroup/index.mjs.map +1 -1
- package/dist/jsx/fields/ToggleGroup/index.native.js +42 -2
- package/dist/jsx/fields/ToggleGroup/index.native.js.map +1 -1
- package/dist/jsx/shared/nativeA11y.mjs +31 -0
- package/dist/jsx/shared/nativeA11y.mjs.map +1 -0
- package/dist/jsx/shared/nativeA11y.native.js +61 -0
- package/dist/jsx/shared/nativeA11y.native.js.map +1 -0
- package/package.json +9 -8
- package/src/Button/Button.fontWeight.spec.tsx +75 -0
- package/src/Button/index.tsx +5 -3
- package/src/FieldGroup.stories.tsx +3 -7
- package/src/FieldLayout.stories.tsx +34 -12
- package/src/Fieldset.stories.tsx +3 -7
- package/src/FormGrid.stories.tsx +5 -11
- package/src/InputParts/InputButton.spec.tsx +16 -0
- package/src/InputParts/index.tsx +19 -2
- package/src/fieldFamilyStories.radius.spec.tsx +118 -0
- package/src/fields/Barcode/Barcode.spec.tsx +2 -0
- package/src/fields/FileUpload/FileUpload.spec.tsx +29 -0
- package/src/fields/FileUpload/index.tsx +6 -0
- package/src/fields/Icon/drawnSet.tsx +7 -2
- package/src/fields/RadioGroup/RadioGroup.native.spec.tsx +67 -0
- package/src/fields/RadioGroup/index.tsx +82 -8
- package/src/fields/ToggleGroup/ToggleGroup.native.spec.tsx +73 -0
- package/src/fields/ToggleGroup/ToggleGroup.spec.tsx +49 -0
- package/src/fields/ToggleGroup/index.tsx +76 -1
- package/src/shared/nativeA11y.spec.ts +64 -0
- package/src/shared/nativeA11y.ts +80 -0
- package/types/Button/index.d.ts.map +1 -1
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/fields/FileUpload/index.d.ts.map +1 -1
- package/types/fields/Icon/drawnSet.d.ts.map +1 -1
- package/types/fields/RadioGroup/index.d.ts +28 -1
- package/types/fields/RadioGroup/index.d.ts.map +1 -1
- package/types/fields/ToggleGroup/index.d.ts +30 -1
- package/types/fields/ToggleGroup/index.d.ts.map +1 -1
- package/types/shared/nativeA11y.d.ts +61 -0
- package/types/shared/nativeA11y.d.ts.map +1 -0
|
@@ -19,6 +19,7 @@ import { Skeleton } from "../../Skeleton";
|
|
|
19
19
|
import { Field, FieldLayout } from "../../fieldLayout";
|
|
20
20
|
import { formButtonColors, formCommonColors, formInputColors } from "../../shared/colorRamps";
|
|
21
21
|
import { warnBareDisabled } from "../../shared/devWarn";
|
|
22
|
+
import { choiceItemA11y, composeA11yName } from "../../shared/nativeA11y";
|
|
22
23
|
import {
|
|
23
24
|
getElevationWrapperProps,
|
|
24
25
|
getFieldError,
|
|
@@ -79,8 +80,18 @@ function ToggleItemWithElevation({
|
|
|
79
80
|
groupedRadius: Record<string, unknown>;
|
|
80
81
|
} & Record<string, any>) {
|
|
81
82
|
if (elevationWrapperProps.elevation) {
|
|
83
|
+
// The segment carries flexBasis 0 to share the run. A column wrapper would
|
|
84
|
+
// read that as its HEIGHT and resolve the whole frame to the two 1px
|
|
85
|
+
// borders (MPO-133), so the wrapper lays out along the row in BOTH
|
|
86
|
+
// orientations and inherits the segment's place in the run.
|
|
82
87
|
return (
|
|
83
|
-
<View
|
|
88
|
+
<View
|
|
89
|
+
{...elevationWrapperProps}
|
|
90
|
+
{...groupedRadius}
|
|
91
|
+
flexDirection="row"
|
|
92
|
+
flexGrow={1}
|
|
93
|
+
flexShrink={0}
|
|
94
|
+
>
|
|
84
95
|
<ToggleItemFrame {...props} {...groupedRadius} />
|
|
85
96
|
</View>
|
|
86
97
|
);
|
|
@@ -99,6 +110,15 @@ export interface ToggleGroupOption {
|
|
|
99
110
|
* item-level `disabled` without it DEV-warns `bare-disabled`.
|
|
100
111
|
*/
|
|
101
112
|
disabledReason?: string;
|
|
113
|
+
/**
|
|
114
|
+
* MPO-283 — accessible name for THIS segment, overriding `label`. Use it
|
|
115
|
+
* when the segment carries meaning the label text does not: an icon-only
|
|
116
|
+
* segment, or a segment whose state is encoded in fill/weight/position.
|
|
117
|
+
* Native reads it as `accessibilityLabel`, web as `aria-label`.
|
|
118
|
+
*/
|
|
119
|
+
accessibilityLabel?: string;
|
|
120
|
+
/** Extra spoken context for this segment (native `accessibilityHint`). */
|
|
121
|
+
accessibilityHint?: string;
|
|
102
122
|
}
|
|
103
123
|
|
|
104
124
|
export interface ToggleGroupProps {
|
|
@@ -138,6 +158,26 @@ export interface ToggleGroupProps {
|
|
|
138
158
|
skeleton?: boolean;
|
|
139
159
|
/** When true, uses compact sizing */
|
|
140
160
|
compact?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* MPO-283 — accessible name for the whole group.
|
|
163
|
+
*
|
|
164
|
+
* tamagui does not map `aria-label` onto React Native's
|
|
165
|
+
* `accessibilityLabel`, so on native the web attribute is inert; this prop
|
|
166
|
+
* is the native channel and `aria-label` is accepted as an alias for it.
|
|
167
|
+
*
|
|
168
|
+
* iOS only speaks elements, never non-element containers, so a name set
|
|
169
|
+
* here is PREFIXED onto each segment's accessible name ("Severity, warning")
|
|
170
|
+
* rather than sitting on the frame where nothing would read it. Segments
|
|
171
|
+
* stay individually selectable — the group is never collapsed into one
|
|
172
|
+
* element, which would hide which segment is chosen.
|
|
173
|
+
*/
|
|
174
|
+
accessibilityLabel?: string;
|
|
175
|
+
/** Alias for `accessibilityLabel`; also emitted as the web attribute. */
|
|
176
|
+
"aria-label"?: string;
|
|
177
|
+
/** Web-only name reference. Native has no id-based equivalent. */
|
|
178
|
+
"aria-labelledby"?: string;
|
|
179
|
+
/** Extra spoken context for the group (native `accessibilityHint`). */
|
|
180
|
+
accessibilityHint?: string;
|
|
141
181
|
}
|
|
142
182
|
|
|
143
183
|
export function ToggleGroup({
|
|
@@ -165,6 +205,10 @@ export function ToggleGroup({
|
|
|
165
205
|
children,
|
|
166
206
|
skeleton,
|
|
167
207
|
compact,
|
|
208
|
+
accessibilityLabel,
|
|
209
|
+
accessibilityHint,
|
|
210
|
+
"aria-label": ariaLabel,
|
|
211
|
+
"aria-labelledby": ariaLabelledBy,
|
|
168
212
|
}: ToggleGroupProps) {
|
|
169
213
|
// Canonical `onChange` and the alias `onValueChange` both fire from the
|
|
170
214
|
// single emit site below (same reconciliation as Switch).
|
|
@@ -172,6 +216,10 @@ export function ToggleGroup({
|
|
|
172
216
|
onChange?.(val);
|
|
173
217
|
onValueChange?.(val);
|
|
174
218
|
};
|
|
219
|
+
// MPO-283: one name, two channels. tamagui drops `aria-label` on native, so
|
|
220
|
+
// the prop and the attribute are reconciled here and each platform is handed
|
|
221
|
+
// the spelling it actually reads.
|
|
222
|
+
const groupA11yName = accessibilityLabel ?? ariaLabel;
|
|
175
223
|
const { resolvedForm, knobProps, control, text, elevation, disabledState, id } = useFormField({
|
|
176
224
|
form: formProp,
|
|
177
225
|
id: idProp,
|
|
@@ -406,6 +454,25 @@ export function ToggleGroup({
|
|
|
406
454
|
}
|
|
407
455
|
: undefined)}
|
|
408
456
|
{...(kbFocusValue === option.value ? keyboardFocusRingProps : undefined)}
|
|
457
|
+
// MPO-283. On iOS a styled View is not an accessibility element, so
|
|
458
|
+
// without this block the whole segmented control is absent from the
|
|
459
|
+
// tree: correct on screen, invisible to anything reading elements.
|
|
460
|
+
// The SEGMENTS carry the semantics, never the frame — an
|
|
461
|
+
// `accessible` frame would collapse them into one element and lose
|
|
462
|
+
// which one is chosen, which is the only thing worth announcing.
|
|
463
|
+
{...(!isWeb
|
|
464
|
+
? choiceItemA11y({
|
|
465
|
+
kind: type === "multiple" ? "checkbox" : "radio",
|
|
466
|
+
name: composeA11yName(groupA11yName, option.accessibilityLabel ?? option.label),
|
|
467
|
+
selected,
|
|
468
|
+
disabled: itemDisabled,
|
|
469
|
+
hint: option.accessibilityHint ?? accessibilityHint,
|
|
470
|
+
})
|
|
471
|
+
: {
|
|
472
|
+
...(option.accessibilityLabel
|
|
473
|
+
? { "aria-label": option.accessibilityLabel }
|
|
474
|
+
: undefined),
|
|
475
|
+
})}
|
|
409
476
|
>
|
|
410
477
|
{option.icon}
|
|
411
478
|
<SizableText
|
|
@@ -508,6 +575,14 @@ export function ToggleGroup({
|
|
|
508
575
|
"aria-required": required || undefined,
|
|
509
576
|
"aria-invalid": hasError || undefined,
|
|
510
577
|
"aria-readonly": readOnly || undefined,
|
|
578
|
+
// MPO-283: web reads the attribute, Android reads the RN prop off the
|
|
579
|
+
// container. iOS reads neither, which is why the name is also prefixed
|
|
580
|
+
// onto every segment above.
|
|
581
|
+
...(groupA11yName ? { "aria-label": groupA11yName } : undefined),
|
|
582
|
+
...(ariaLabelledBy ? { "aria-labelledby": ariaLabelledBy } : undefined),
|
|
583
|
+
...(!isWeb && groupA11yName
|
|
584
|
+
? { accessibilityLabel: groupA11yName, accessibilityRole: "radiogroup" as const }
|
|
585
|
+
: undefined),
|
|
511
586
|
};
|
|
512
587
|
|
|
513
588
|
return (
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { choiceItemA11y, composeA11yName } from "./nativeA11y";
|
|
3
|
+
|
|
4
|
+
describe("composeA11yName", () => {
|
|
5
|
+
it("returns the option's own name when the group has none", () => {
|
|
6
|
+
expect(composeA11yName(undefined, "warning")).toBe("warning");
|
|
7
|
+
expect(composeA11yName(" ", "warning")).toBe("warning");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("puts the group name in front, because iOS never reads a container", () => {
|
|
11
|
+
expect(composeA11yName("Severity", "warning")).toBe("Severity, warning");
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("choiceItemA11y", () => {
|
|
16
|
+
it("carries role, name and both state spellings", () => {
|
|
17
|
+
expect(
|
|
18
|
+
choiceItemA11y({ kind: "radio", name: "DEBITS", selected: true, disabled: false }),
|
|
19
|
+
).toEqual({
|
|
20
|
+
accessible: true,
|
|
21
|
+
role: "button",
|
|
22
|
+
accessibilityRole: "button",
|
|
23
|
+
accessibilityLabel: "DEBITS",
|
|
24
|
+
accessibilityState: { disabled: false, selected: true, checked: true },
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Measured on iOS 26.2 / RN 0.83: a radio or checkbox accessibilityRole
|
|
29
|
+
// takes the element OUT of the tree. `button` is what keeps it in, for both
|
|
30
|
+
// kinds, and `role` must be overridden too because RN prefers it.
|
|
31
|
+
it("pins the platform role to button whatever the control means", () => {
|
|
32
|
+
const checkbox = choiceItemA11y({
|
|
33
|
+
kind: "checkbox",
|
|
34
|
+
name: "error",
|
|
35
|
+
selected: false,
|
|
36
|
+
disabled: true,
|
|
37
|
+
});
|
|
38
|
+
expect(checkbox.role).toBe("button");
|
|
39
|
+
expect(checkbox.accessibilityRole).toBe("button");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("omits the hint rather than emitting undefined", () => {
|
|
43
|
+
const props = choiceItemA11y({
|
|
44
|
+
kind: "checkbox",
|
|
45
|
+
name: "error",
|
|
46
|
+
selected: false,
|
|
47
|
+
disabled: true,
|
|
48
|
+
});
|
|
49
|
+
expect("accessibilityHint" in props).toBe(false);
|
|
50
|
+
expect(props.accessibilityState).toEqual({ disabled: true, selected: false, checked: false });
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("keeps a hint when one is given", () => {
|
|
54
|
+
expect(
|
|
55
|
+
choiceItemA11y({
|
|
56
|
+
kind: "radio",
|
|
57
|
+
name: "derived",
|
|
58
|
+
selected: false,
|
|
59
|
+
disabled: false,
|
|
60
|
+
hint: "recomputed from other emitters",
|
|
61
|
+
}).accessibilityHint,
|
|
62
|
+
).toBe("recomputed from other emitters");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPO-283 — the accessibility props a choice control needs on React Native.
|
|
3
|
+
*
|
|
4
|
+
* Two things make this necessary rather than decorative. A styled View is not
|
|
5
|
+
* an accessibility element on iOS, so a control that never sets `accessible`
|
|
6
|
+
* is absent from the tree however correctly it draws. And tamagui does not map
|
|
7
|
+
* `aria-*` onto React Native's accessibility props, so every web attribute a
|
|
8
|
+
* component already carries — `aria-label`, `aria-checked`, `role` — is inert
|
|
9
|
+
* on a device.
|
|
10
|
+
*
|
|
11
|
+
* Measured on a Release iphonesimulator build against 7.7.6: RadioGroup's
|
|
12
|
+
* options came back as bare `StaticText`, ToggleGroup contributed nothing at
|
|
13
|
+
* all.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* What the control MEANS: one-of-N, or one of several independent choices.
|
|
18
|
+
* It is not what gets sent to the platform — see `nativeChoiceRole`.
|
|
19
|
+
*/
|
|
20
|
+
export type ChoiceKind = "radio" | "checkbox";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* MEASURED, not chosen. `accessibilityRole: "radio"` (and `"checkbox"`) takes
|
|
24
|
+
* the element OUT of the iOS accessibility tree entirely on RN 0.83 / iOS 26.2
|
|
25
|
+
* — worse than the defect, because at least the sibling label used to be
|
|
26
|
+
* there. `"button"` puts it in, and the selected/checked state rides on
|
|
27
|
+
* `accessibilityState` where a reader actually finds it.
|
|
28
|
+
*
|
|
29
|
+
* tamagui's own RadioGroup.Item already sets `role: "radio"` on native, and RN
|
|
30
|
+
* gives `role` precedence over `accessibilityRole`, so overriding BOTH is what
|
|
31
|
+
* makes the difference. Setting only `accessibilityRole` leaves the element
|
|
32
|
+
* hidden.
|
|
33
|
+
*/
|
|
34
|
+
const nativeChoiceRole = "button" as const;
|
|
35
|
+
|
|
36
|
+
export interface ChoiceA11yProps {
|
|
37
|
+
accessible: true;
|
|
38
|
+
role: typeof nativeChoiceRole;
|
|
39
|
+
accessibilityRole: typeof nativeChoiceRole;
|
|
40
|
+
accessibilityLabel: string;
|
|
41
|
+
accessibilityState: { disabled: boolean; selected: boolean; checked: boolean };
|
|
42
|
+
accessibilityHint?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* iOS speaks elements and never non-element containers, so a group's accessible
|
|
47
|
+
* name cannot sit on the frame — it rides in front of each option's own name.
|
|
48
|
+
* Making the frame `accessible` instead would collapse the options into one
|
|
49
|
+
* element and lose which one is chosen, which is the only thing worth saying.
|
|
50
|
+
*/
|
|
51
|
+
export function composeA11yName(groupName: string | undefined, ownName: string): string {
|
|
52
|
+
const group = groupName?.trim();
|
|
53
|
+
return group ? `${group}, ${ownName}` : ownName;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function choiceItemA11y({
|
|
57
|
+
name,
|
|
58
|
+
selected,
|
|
59
|
+
disabled,
|
|
60
|
+
hint,
|
|
61
|
+
}: {
|
|
62
|
+
/** Kept for the caller's clarity; the platform role is pinned above. */
|
|
63
|
+
kind?: ChoiceKind;
|
|
64
|
+
name: string;
|
|
65
|
+
selected: boolean;
|
|
66
|
+
disabled: boolean;
|
|
67
|
+
hint?: string;
|
|
68
|
+
}): ChoiceA11yProps {
|
|
69
|
+
return {
|
|
70
|
+
accessible: true,
|
|
71
|
+
role: nativeChoiceRole,
|
|
72
|
+
accessibilityRole: nativeChoiceRole,
|
|
73
|
+
accessibilityLabel: name,
|
|
74
|
+
// `selected` is what a reader announces for a segment, `checked` what it
|
|
75
|
+
// announces for a radio; the iOS tree surfaces them as `selected: true`
|
|
76
|
+
// and `value: "checked"`. Both are set so one shape serves both controls.
|
|
77
|
+
accessibilityState: { disabled, selected, checked: selected },
|
|
78
|
+
...(hint ? { accessibilityHint: hint } : undefined),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAYL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEhB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,KAAK,WAAW,IAAI,kBAAkB,EAUvC,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,cAAc,CAAC;AAMpE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE1C,eAAO,MAAM,iBAAiB,EAAE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jG,cAAc,SAAS,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,SAAS,EAC9E,KAAK,SAAS,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,EAC3E,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,CAAC,2CAg9BnF;AAED;;;;GAIG;AACH,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawnSet.d.ts","sourceRoot":"","sources":["../../../src/fields/Icon/drawnSet.tsx"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,sJAiBnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI9D,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAErE;AA8ID,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,EAAE,CAI/E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,SAAS,CAO9E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,KAAK,EAAE,MAAM,GACZ,aAAa,EAAE,CAIjB;
|
|
1
|
+
{"version":3,"file":"drawnSet.d.ts","sourceRoot":"","sources":["../../../src/fields/Icon/drawnSet.tsx"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,sJAiBnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI9D,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAErE;AA8ID,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,EAAE,CAI/E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,SAAS,CAO9E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,KAAK,EAAE,MAAM,GACZ,aAAa,EAAE,CAIjB;AA+BD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAS,EACT,KAAK,GACN,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CA0FA"}
|
|
@@ -8,6 +8,14 @@ export interface RadioGroupOption {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
/** Muted secondary line under the label; rendered in `card` mode. */
|
|
10
10
|
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* MPO-283 — accessible name for THIS option, overriding `label`. Use it
|
|
13
|
+
* when the option carries meaning the label text does not: a glyph, or a
|
|
14
|
+
* state encoded in fill/weight/position rather than words.
|
|
15
|
+
*/
|
|
16
|
+
accessibilityLabel?: string;
|
|
17
|
+
/** Extra spoken context for this option (native `accessibilityHint`). */
|
|
18
|
+
accessibilityHint?: string;
|
|
11
19
|
}
|
|
12
20
|
export interface RadioGroupProps {
|
|
13
21
|
name?: string;
|
|
@@ -52,8 +60,27 @@ export interface RadioGroupProps {
|
|
|
52
60
|
* primitives (same anatomy as `CheckboxGroup card`).
|
|
53
61
|
*/
|
|
54
62
|
card?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* MPO-283 — accessible name for the whole group.
|
|
65
|
+
*
|
|
66
|
+
* tamagui does not map `aria-label` onto React Native's
|
|
67
|
+
* `accessibilityLabel`, so the web attribute is inert on native; this prop
|
|
68
|
+
* is the native channel and `aria-label` is accepted as an alias.
|
|
69
|
+
*
|
|
70
|
+
* iOS speaks elements, never non-element containers, so a name set here is
|
|
71
|
+
* PREFIXED onto each option's accessible name ("Phase, CREDITS") instead of
|
|
72
|
+
* sitting on the frame where nothing reads it. Options stay individually
|
|
73
|
+
* reachable and keep their own checked state.
|
|
74
|
+
*/
|
|
75
|
+
accessibilityLabel?: string;
|
|
76
|
+
/** Alias for `accessibilityLabel`; also emitted as the web attribute. */
|
|
77
|
+
"aria-label"?: string;
|
|
78
|
+
/** Web-only name reference. Native has no id-based equivalent. */
|
|
79
|
+
"aria-labelledby"?: string;
|
|
80
|
+
/** Extra spoken context for the group (native `accessibilityHint`). */
|
|
81
|
+
accessibilityHint?: string;
|
|
55
82
|
}
|
|
56
|
-
export declare function RadioGroup({ name, form: formProp, validators, label, labelProps, helperText, error, required, disabled, readOnly, size, id: idProp, value, defaultValue, onChange, onValueChange, onBlur, options, orientation, radioGroupProps, children, skeleton, compact, card, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare function RadioGroup({ name, form: formProp, validators, label, labelProps, helperText, error, required, disabled, readOnly, size, id: idProp, value, defaultValue, onChange, onValueChange, onBlur, options, orientation, radioGroupProps, children, skeleton, compact, card, accessibilityLabel, accessibilityHint, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
57
84
|
export declare namespace RadioGroup {
|
|
58
85
|
var Item: import("tamagui").TamaguiComponent<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
59
86
|
disabled?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/RadioGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OA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ACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,EAAE,EAAE,MAAM,EACV,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAO,EACP,WAAwB,EACxB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GAClC,EAAE,eAAe,2CA2WjB;yBAxYe,UAAU"}
|
|
@@ -12,6 +12,15 @@ export interface ToggleGroupOption {
|
|
|
12
12
|
* item-level `disabled` without it DEV-warns `bare-disabled`.
|
|
13
13
|
*/
|
|
14
14
|
disabledReason?: string;
|
|
15
|
+
/**
|
|
16
|
+
* MPO-283 — accessible name for THIS segment, overriding `label`. Use it
|
|
17
|
+
* when the segment carries meaning the label text does not: an icon-only
|
|
18
|
+
* segment, or a segment whose state is encoded in fill/weight/position.
|
|
19
|
+
* Native reads it as `accessibilityLabel`, web as `aria-label`.
|
|
20
|
+
*/
|
|
21
|
+
accessibilityLabel?: string;
|
|
22
|
+
/** Extra spoken context for this segment (native `accessibilityHint`). */
|
|
23
|
+
accessibilityHint?: string;
|
|
15
24
|
}
|
|
16
25
|
export interface ToggleGroupProps {
|
|
17
26
|
name?: string;
|
|
@@ -50,8 +59,28 @@ export interface ToggleGroupProps {
|
|
|
50
59
|
skeleton?: boolean;
|
|
51
60
|
/** When true, uses compact sizing */
|
|
52
61
|
compact?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* MPO-283 — accessible name for the whole group.
|
|
64
|
+
*
|
|
65
|
+
* tamagui does not map `aria-label` onto React Native's
|
|
66
|
+
* `accessibilityLabel`, so on native the web attribute is inert; this prop
|
|
67
|
+
* is the native channel and `aria-label` is accepted as an alias for it.
|
|
68
|
+
*
|
|
69
|
+
* iOS only speaks elements, never non-element containers, so a name set
|
|
70
|
+
* here is PREFIXED onto each segment's accessible name ("Severity, warning")
|
|
71
|
+
* rather than sitting on the frame where nothing would read it. Segments
|
|
72
|
+
* stay individually selectable — the group is never collapsed into one
|
|
73
|
+
* element, which would hide which segment is chosen.
|
|
74
|
+
*/
|
|
75
|
+
accessibilityLabel?: string;
|
|
76
|
+
/** Alias for `accessibilityLabel`; also emitted as the web attribute. */
|
|
77
|
+
"aria-label"?: string;
|
|
78
|
+
/** Web-only name reference. Native has no id-based equivalent. */
|
|
79
|
+
"aria-labelledby"?: string;
|
|
80
|
+
/** Extra spoken context for the group (native `accessibilityHint`). */
|
|
81
|
+
accessibilityHint?: string;
|
|
53
82
|
}
|
|
54
|
-
export declare function ToggleGroup({ name, form: formProp, validators, label, labelProps, helperText, error, required, disabled, disabledReason, readOnly, size, id: idProp, type, value, defaultValue, onChange, onValueChange, onBlur, options, orientation, children, skeleton, compact, }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare function ToggleGroup({ name, form: formProp, validators, label, labelProps, helperText, error, required, disabled, disabledReason, readOnly, size, id: idProp, type, value, defaultValue, onChange, onValueChange, onBlur, options, orientation, children, skeleton, compact, accessibilityLabel, accessibilityHint, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
55
84
|
export declare namespace ToggleGroup {
|
|
56
85
|
var Item: import("tamagui").TamaguiComponent<Omit<import("@tamagui/web").GetFinalProps<import("tamagui").StackNonStyleProps, import("@tamagui/web").StackStyleBase & {
|
|
57
86
|
readonly activeStyle?: Partial<import("@tamagui/web").InferStyleProps<import("tamagui").TamaguiComponent<import("tamagui").ViewProps, import("tamagui").TamaguiElement, import("tamagui").StackNonStyleProps, import("@tamagui/web").StackStyleBase, {}, {}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/ToggleGroup/index.tsx"],"names":[],"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AE,MAAM,EACV,IAAe,EACf,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAO,EACP,WAA0B,EAC1B,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GAClC,EAAE,gBAAgB,2CAmdlB;yBAhfe,WAAW"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MPO-283 — the accessibility props a choice control needs on React Native.
|
|
3
|
+
*
|
|
4
|
+
* Two things make this necessary rather than decorative. A styled View is not
|
|
5
|
+
* an accessibility element on iOS, so a control that never sets `accessible`
|
|
6
|
+
* is absent from the tree however correctly it draws. And tamagui does not map
|
|
7
|
+
* `aria-*` onto React Native's accessibility props, so every web attribute a
|
|
8
|
+
* component already carries — `aria-label`, `aria-checked`, `role` — is inert
|
|
9
|
+
* on a device.
|
|
10
|
+
*
|
|
11
|
+
* Measured on a Release iphonesimulator build against 7.7.6: RadioGroup's
|
|
12
|
+
* options came back as bare `StaticText`, ToggleGroup contributed nothing at
|
|
13
|
+
* all.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* What the control MEANS: one-of-N, or one of several independent choices.
|
|
17
|
+
* It is not what gets sent to the platform — see `nativeChoiceRole`.
|
|
18
|
+
*/
|
|
19
|
+
export type ChoiceKind = "radio" | "checkbox";
|
|
20
|
+
/**
|
|
21
|
+
* MEASURED, not chosen. `accessibilityRole: "radio"` (and `"checkbox"`) takes
|
|
22
|
+
* the element OUT of the iOS accessibility tree entirely on RN 0.83 / iOS 26.2
|
|
23
|
+
* — worse than the defect, because at least the sibling label used to be
|
|
24
|
+
* there. `"button"` puts it in, and the selected/checked state rides on
|
|
25
|
+
* `accessibilityState` where a reader actually finds it.
|
|
26
|
+
*
|
|
27
|
+
* tamagui's own RadioGroup.Item already sets `role: "radio"` on native, and RN
|
|
28
|
+
* gives `role` precedence over `accessibilityRole`, so overriding BOTH is what
|
|
29
|
+
* makes the difference. Setting only `accessibilityRole` leaves the element
|
|
30
|
+
* hidden.
|
|
31
|
+
*/
|
|
32
|
+
declare const nativeChoiceRole: "button";
|
|
33
|
+
export interface ChoiceA11yProps {
|
|
34
|
+
accessible: true;
|
|
35
|
+
role: typeof nativeChoiceRole;
|
|
36
|
+
accessibilityRole: typeof nativeChoiceRole;
|
|
37
|
+
accessibilityLabel: string;
|
|
38
|
+
accessibilityState: {
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
selected: boolean;
|
|
41
|
+
checked: boolean;
|
|
42
|
+
};
|
|
43
|
+
accessibilityHint?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* iOS speaks elements and never non-element containers, so a group's accessible
|
|
47
|
+
* name cannot sit on the frame — it rides in front of each option's own name.
|
|
48
|
+
* Making the frame `accessible` instead would collapse the options into one
|
|
49
|
+
* element and lose which one is chosen, which is the only thing worth saying.
|
|
50
|
+
*/
|
|
51
|
+
export declare function composeA11yName(groupName: string | undefined, ownName: string): string;
|
|
52
|
+
export declare function choiceItemA11y({ name, selected, disabled, hint, }: {
|
|
53
|
+
/** Kept for the caller's clarity; the platform role is pinned above. */
|
|
54
|
+
kind?: ChoiceKind;
|
|
55
|
+
name: string;
|
|
56
|
+
selected: boolean;
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
hint?: string;
|
|
59
|
+
}): ChoiceA11yProps;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=nativeA11y.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeA11y.d.ts","sourceRoot":"","sources":["../../src/shared/nativeA11y.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,gBAAgB,EAAG,QAAiB,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,IAAI,CAAC;IACjB,IAAI,EAAE,OAAO,gBAAgB,CAAC;IAC9B,iBAAiB,EAAE,OAAO,gBAAgB,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtF;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,IAAI,GACL,EAAE;IACD,wEAAwE;IACxE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,eAAe,CAYlB"}
|