@dloizides/ui-feedback 1.16.1 → 1.16.2
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/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useMemo, useContext, useCallback, useState, useEffect, useSyncExternalStore, Component, useRef } from 'react';
|
|
1
|
+
import { createContext, useMemo, useContext, useCallback, useId, useState, useEffect, useSyncExternalStore, Component, useRef } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { StyleSheet, Platform, TouchableOpacity, Text, View, ActivityIndicator, Modal, useWindowDimensions, Animated, Pressable } from 'react-native';
|
|
4
4
|
import { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';
|
|
@@ -62,6 +62,7 @@ var FEEDBACK_TEST_IDS = {
|
|
|
62
62
|
errorBoundary: "error-boundary",
|
|
63
63
|
progressBar: "progress-bar"
|
|
64
64
|
};
|
|
65
|
+
var MIN_TOUCH_TARGET = 44;
|
|
65
66
|
var WELL_SIZE = 56;
|
|
66
67
|
var WELL_MARGIN_BOTTOM = 16;
|
|
67
68
|
var WELL_TINT_OPACITY = 0.12;
|
|
@@ -464,6 +465,7 @@ var styles6 = StyleSheet.create({
|
|
|
464
465
|
paddingHorizontal: 20,
|
|
465
466
|
borderRadius: 6,
|
|
466
467
|
minWidth: 80,
|
|
468
|
+
minHeight: MIN_TOUCH_TARGET,
|
|
467
469
|
alignItems: "center",
|
|
468
470
|
justifyContent: "center"
|
|
469
471
|
},
|
|
@@ -492,6 +494,8 @@ var ConfirmDialog = ({
|
|
|
492
494
|
destructive = false
|
|
493
495
|
}) => {
|
|
494
496
|
const { theme, t } = useFeedbackUi();
|
|
497
|
+
const titleId = useId();
|
|
498
|
+
const innerDialogRole = Platform.OS === "web" ? void 0 : "dialog";
|
|
495
499
|
const colorStyles = useMemo(
|
|
496
500
|
() => ({
|
|
497
501
|
dialog: { backgroundColor: theme.colors.surfaceElevated },
|
|
@@ -515,6 +519,7 @@ var ConfirmDialog = ({
|
|
|
515
519
|
Modal,
|
|
516
520
|
{
|
|
517
521
|
transparent: true,
|
|
522
|
+
"aria-labelledby": titleId,
|
|
518
523
|
animationType: "fade",
|
|
519
524
|
visible,
|
|
520
525
|
onRequestClose: onCancel,
|
|
@@ -522,11 +527,11 @@ var ConfirmDialog = ({
|
|
|
522
527
|
View,
|
|
523
528
|
{
|
|
524
529
|
accessibilityViewIsModal: true,
|
|
525
|
-
"aria-label": title,
|
|
526
|
-
role:
|
|
530
|
+
"aria-label": innerDialogRole === void 0 ? void 0 : title,
|
|
531
|
+
role: innerDialogRole,
|
|
527
532
|
style: [styles6.dialog, colorStyles.dialog],
|
|
528
533
|
children: [
|
|
529
|
-
/* @__PURE__ */ jsx(Text, { style: [styles6.title, colorStyles.title], children: title }),
|
|
534
|
+
/* @__PURE__ */ jsx(Text, { nativeID: titleId, style: [styles6.title, colorStyles.title], children: title }),
|
|
530
535
|
/* @__PURE__ */ jsx(Text, { style: [styles6.message, colorStyles.message], children: message }),
|
|
531
536
|
/* @__PURE__ */ jsxs(View, { style: styles6.buttonRow, children: [
|
|
532
537
|
/* @__PURE__ */ jsx(
|