@dloizides/auth-web 1.13.0 → 1.14.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/index.mjs CHANGED
@@ -8,15 +8,18 @@ export { BffAuthClient, createFetchHttpClient } from '@dloizides/auth-client';
8
8
  // src/components/AuthScreen.tsx
9
9
  var FULL_WIDTH = "100%";
10
10
  var CARD_BORDER_WIDTH = 1;
11
+ var CARD_TOP_OFFSET = 64;
11
12
  function useAuthScreenStyles(theme) {
12
13
  return useMemo(() => {
13
14
  const { colors, radii, spacing, typography } = theme;
14
15
  return StyleSheet.create({
15
16
  screen: {
16
17
  flex: 1,
17
- justifyContent: "center",
18
+ // Deliberately NOT `justifyContent: 'center'` — see CARD_TOP_OFFSET.
19
+ justifyContent: "flex-start",
18
20
  alignItems: "center",
19
21
  padding: spacing.md,
22
+ paddingTop: CARD_TOP_OFFSET,
20
23
  backgroundColor: colors.background
21
24
  },
22
25
  card: {
@@ -74,7 +77,8 @@ var defaultAuthTheme = {
74
77
  typography: {
75
78
  title: 28,
76
79
  subtitle: 16,
77
- label: 14,
80
+ // 13, not 14 — the shared contract's `field` voice. See AuthThemeTypography.label.
81
+ label: 13,
78
82
  body: 16,
79
83
  caption: 12
80
84
  }
@@ -390,15 +394,21 @@ function withTestIdPrefix(baseId, prefix) {
390
394
  var FULL_WIDTH2 = "100%";
391
395
  var CARD_MAX_WIDTH = 420;
392
396
  var BUTTON_VERTICAL_PADDING = 14;
397
+ var SCREEN_TOP_OFFSET = 64;
393
398
  function useAuthStyles(theme) {
394
399
  return useMemo(() => {
395
400
  const { colors, radii, spacing, typography } = theme;
396
401
  return StyleSheet.create({
397
402
  screen: {
398
403
  flex: 1,
399
- justifyContent: "center",
404
+ // Top-anchored, NOT centred — a centred card re-centres as it grows and
405
+ // drags the inputs up under the cursor. Same reasoning (and the same
406
+ // measurement) as `useAuthScreenStyles`' CARD_TOP_OFFSET; kept in step so
407
+ // a standalone `<LoginForm>` and an `<AuthScreen>`-composed one agree.
408
+ justifyContent: "flex-start",
400
409
  alignItems: "center",
401
410
  padding: spacing.md,
411
+ paddingTop: SCREEN_TOP_OFFSET,
402
412
  backgroundColor: colors.background
403
413
  },
404
414
  card: {
@@ -2012,14 +2022,15 @@ function DevicePinLengthPicker({
2012
2022
  const theme = useAuthTheme(themeProp);
2013
2023
  const dynamic = usePickerStyles(theme);
2014
2024
  const baseId = withTestIdPrefix(AuthTestIds.devicePinEnrollLength, testIdPrefix);
2015
- return /* @__PURE__ */ jsx(View, { style: styles2.row, children: DEVICE_PIN_ALLOWED_DIGITS.map((option) => {
2025
+ return /* @__PURE__ */ jsx(View, { accessibilityRole: "radiogroup", role: "radiogroup", style: styles2.row, children: DEVICE_PIN_ALLOWED_DIGITS.map((option) => {
2016
2026
  const active = option === selected;
2017
2027
  return /* @__PURE__ */ jsx(
2018
2028
  Pressable,
2019
2029
  {
2030
+ "aria-checked": active,
2020
2031
  accessibilityHint: interpolate(optionHint, { count: option }),
2021
2032
  accessibilityLabel: String(option),
2022
- accessibilityRole: "button",
2033
+ accessibilityRole: "radio",
2023
2034
  accessibilityState: { selected: active },
2024
2035
  disabled,
2025
2036
  style: [styles2.pill, dynamic.pill, active ? dynamic.active : null],
@@ -3163,6 +3174,7 @@ function PreferredMethodSettingsCard({
3163
3174
  return /* @__PURE__ */ jsx(
3164
3175
  TouchableOpacity,
3165
3176
  {
3177
+ "aria-checked": isSelected,
3166
3178
  accessibilityHint: labels.description,
3167
3179
  accessibilityLabel: option.label,
3168
3180
  accessibilityRole: "radio",
@@ -3449,6 +3461,7 @@ function DemoCredentialsHint({
3449
3461
  /* @__PURE__ */ jsx(
3450
3462
  TouchableOpacity,
3451
3463
  {
3464
+ "aria-expanded": expanded,
3452
3465
  accessibilityHint: labels.toggleHint,
3453
3466
  accessibilityLabel: labels.toggle,
3454
3467
  accessibilityRole: "button",