@storybook/react-native-ui-lite 10.2.2-alpha.2 → 10.2.2-alpha.3

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 CHANGED
@@ -384,7 +384,7 @@ var GroupNode = import_react2.default.memo(function GroupNode2({
384
384
  const color = (0, import_react2.useMemo)(() => {
385
385
  return theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet;
386
386
  }, [theme.base, theme.color.primary, theme.color.ultraviolet]);
387
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(BranchNode, { isExpandable, ...props, children: [
387
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(BranchNode, { isExpandable, accessibilityRole: "button", ...props, children: [
388
388
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Wrapper, { children: [
389
389
  isExpandable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CollapseIcon, { isExpanded }),
390
390
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GroupIcon, { width: 14, height: 14, color })
@@ -398,7 +398,7 @@ var ComponentNode = import_react2.default.memo(
398
398
  const color = (0, import_react2.useMemo)(() => {
399
399
  return theme.color.secondary;
400
400
  }, [theme.color.secondary]);
401
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(BranchNode, { isExpandable, ...props, children: [
401
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(BranchNode, { isExpandable, accessibilityRole: "button", ...props, children: [
402
402
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Wrapper, { children: [
403
403
  isExpandable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CollapseIcon, { isExpanded }),
404
404
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ComponentIcon, { width: 12, height: 12, color })
@@ -413,7 +413,7 @@ var StoryNode = import_react2.default.memo(
413
413
  const color = (0, import_react2.useMemo)(() => {
414
414
  return props.selected ? theme.color.lightest : theme.color.seafoam;
415
415
  }, [props.selected, theme.color.lightest, theme.color.seafoam]);
416
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(LeafNode, { ...props, ref, children: [
416
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(LeafNode, { ...props, ref, accessibilityRole: "button", children: [
417
417
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StoryIcon, { width: 14, height: 14, color }) }, `story-${props.id}-${color}`),
418
418
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LeafNodeText, { selected: props.selected, numberOfLines: 1, children })
419
419
  ] });
@@ -483,7 +483,7 @@ var Node = import_react4.default.memo(function Node2({
483
483
  }) {
484
484
  const id = (0, import_react_native_ui_common.createId)(item.id, refId);
485
485
  if (item.type === "story") {
486
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LeafNodeStyleWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
486
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LeafNodeStyleWrapper, { accessible: false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
487
487
  StoryNode,
488
488
  {
489
489
  selected: isSelected,
@@ -508,6 +508,7 @@ var Node = import_react4.default.memo(function Node2({
508
508
  event.preventDefault();
509
509
  setExpanded({ ids: [item.id], value: !isExpanded });
510
510
  },
511
+ accessibilityRole: "button",
511
512
  "aria-expanded": isExpanded,
512
513
  children: [
513
514
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollapseIcon, { isExpanded }),
@@ -917,17 +918,26 @@ var Explorer = import_react6.default.memo(function Explorer2({
917
918
  setSelection
918
919
  }) {
919
920
  const containerRef = (0, import_react6.useRef)(null);
920
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native3.View, { ref: containerRef, style: containerStyle, children: dataset.entries.map(([refId, ref]) => /* @__PURE__ */ (0, import_react7.createElement)(
921
- Ref,
921
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
922
+ import_react_native3.View,
922
923
  {
923
- ...ref,
924
- key: refId,
925
- isLoading,
926
- isBrowsing,
927
- selectedStoryId: selected?.refId === ref.id ? selected.storyId : null,
928
- setSelection
924
+ ref: containerRef,
925
+ style: containerStyle,
926
+ id: "storybook-explorer-tree",
927
+ testID: "storybook-explorer-tree",
928
+ children: dataset.entries.map(([refId, ref]) => /* @__PURE__ */ (0, import_react7.createElement)(
929
+ Ref,
930
+ {
931
+ ...ref,
932
+ key: refId,
933
+ isLoading,
934
+ isBrowsing,
935
+ selectedStoryId: selected?.refId === ref.id ? selected.storyId : null,
936
+ setSelection
937
+ }
938
+ ))
929
939
  }
930
- )) });
940
+ );
931
941
  });
932
942
 
933
943
  // src/Sidebar.tsx
@@ -1119,6 +1129,8 @@ var Search = import_react9.default.memo(function Search2({ children, dataset, se
1119
1129
  isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1120
1130
  ClearIcon,
1121
1131
  {
1132
+ accessibilityRole: "button",
1133
+ accessibilityLabel: "Clear search",
1122
1134
  onPress: () => {
1123
1135
  setInputValue("");
1124
1136
  inputRef.current.clear();
@@ -1268,16 +1280,25 @@ var Result = import_react10.default.memo(function Result2({
1268
1280
  );
1269
1281
  const nameHighlights = matches?.[0];
1270
1282
  const pathString = item.path?.join(" ") ?? "";
1271
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ResultRow, { ...props, onPress: press, children: [
1272
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(IconWrapper, { children: [
1273
- item.type === "component" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComponentIcon, { width: 14, height: 14, color: theme.color.secondary }),
1274
- item.type === "story" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StoryIcon, { width: 14, height: 14, color: theme.color.seafoam })
1275
- ] }),
1276
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ResultRowContent, { testID: "search-result-item--label", children: [
1277
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Highlight, { text: item.name, ranges: nameHighlights, children: item.name }) }),
1278
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Path, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PathText, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Highlight, { text: pathString, ranges: matches?.[1], children: item.path?.join(" / ") }) }) })
1279
- ] })
1280
- ] });
1283
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1284
+ ResultRow,
1285
+ {
1286
+ ...props,
1287
+ onPress: press,
1288
+ accessibilityRole: "button",
1289
+ accessibilityLabel: `${item.name}, ${item.path?.join(" / ") ?? ""}`,
1290
+ children: [
1291
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(IconWrapper, { children: [
1292
+ item.type === "component" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComponentIcon, { width: 14, height: 14, color: theme.color.secondary }),
1293
+ item.type === "story" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StoryIcon, { width: 14, height: 14, color: theme.color.seafoam })
1294
+ ] }),
1295
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ResultRowContent, { testID: "search-result-item--label", children: [
1296
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Title, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Highlight, { text: item.name, ranges: nameHighlights, children: item.name }) }),
1297
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Path, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PathText, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Highlight, { text: pathString, ranges: matches?.[1], children: item.path?.join(" / ") }) }) })
1298
+ ] })
1299
+ ]
1300
+ }
1301
+ );
1281
1302
  });
1282
1303
  var Text = import_react_native_theming6.styled.Text(({ theme }) => ({
1283
1304
  color: theme.color.defaultText
@@ -1340,7 +1361,13 @@ var SearchResults = import_react10.default.memo(function SearchResults2({
1340
1361
  case "header":
1341
1362
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(RecentlyOpenedTitle, { children: [
1342
1363
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { children: "Recently opened" }),
1343
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native_ui_common4.IconButton, { onPress: listItem.clearLastViewed })
1364
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1365
+ import_react_native_ui_common4.IconButton,
1366
+ {
1367
+ onPress: listItem.clearLastViewed,
1368
+ accessibilityLabel: "Clear recently opened"
1369
+ }
1370
+ )
1344
1371
  ] });
1345
1372
  case "noResults":
1346
1373
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(NoResults, { children: [
@@ -1422,8 +1449,24 @@ var Swap = import_react11.default.memo(function Swap2({
1422
1449
  const aStyle = (0, import_react11.useMemo)(() => condition ? flexStyle4 : noneStyle, [condition]);
1423
1450
  const bStyle = (0, import_react11.useMemo)(() => condition ? noneStyle : flexStyle4, [condition]);
1424
1451
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1425
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native6.View, { style: aStyle, children: a }),
1426
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native6.View, { style: bStyle, children: b })
1452
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1453
+ import_react_native6.View,
1454
+ {
1455
+ style: aStyle,
1456
+ accessibilityElementsHidden: !condition,
1457
+ importantForAccessibility: condition ? "auto" : "no-hide-descendants",
1458
+ children: a
1459
+ }
1460
+ ),
1461
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1462
+ import_react_native6.View,
1463
+ {
1464
+ style: bStyle,
1465
+ accessibilityElementsHidden: condition,
1466
+ importantForAccessibility: condition ? "no-hide-descendants" : "auto",
1467
+ children: b
1468
+ }
1469
+ )
1427
1470
  ] });
1428
1471
  });
1429
1472
  var useCombination = (index, indexError, previewInitialized, status, refs) => {
@@ -1630,6 +1673,9 @@ var MobileAddonsPanel = (0, import_react13.forwardRef)(
1630
1673
  height: panelHeight,
1631
1674
  transform: [{ translateY: positionBottomAnimation }]
1632
1675
  },
1676
+ pointerEvents: isOpen ? "auto" : "none",
1677
+ accessibilityElementsHidden: !isOpen,
1678
+ importantForAccessibility: isOpen ? "auto" : "no-hide-descendants",
1633
1679
  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1634
1680
  import_react_native8.View,
1635
1681
  {
@@ -1739,7 +1785,8 @@ var AddonsTabs = ({ onClose, storyId }) => {
1739
1785
  style: closeIconStyle,
1740
1786
  hitSlop,
1741
1787
  Icon: CloseIcon,
1742
- onPress: () => onClose?.()
1788
+ onPress: () => onClose?.(),
1789
+ accessibilityLabel: "Close addons panel"
1743
1790
  }
1744
1791
  )
1745
1792
  ] }),
@@ -1755,7 +1802,16 @@ var AddonsTabs = ({ onClose, storyId }) => {
1755
1802
  ] });
1756
1803
  };
1757
1804
  var Tab = ({ active, onPress, text }) => {
1758
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active, onPress, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabText, { active, children: text }) });
1805
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1806
+ TabButton,
1807
+ {
1808
+ active,
1809
+ onPress,
1810
+ accessibilityRole: "tab",
1811
+ accessibilityState: { selected: active },
1812
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabText, { active, children: text })
1813
+ }
1814
+ );
1759
1815
  };
1760
1816
  var TabButton = import_react_native_theming8.styled.TouchableOpacity(({ theme, active }) => ({
1761
1817
  borderBottomWidth: active ? 2 : 0,
@@ -1840,139 +1896,154 @@ var useAnimatedModalHeight = () => {
1840
1896
  return animatedHeight;
1841
1897
  };
1842
1898
  var MobileMenuDrawer = (0, import_react14.memo)(
1843
- (0, import_react14.forwardRef)(({ children }, ref) => {
1844
- const [isVisible, setIsVisible] = (0, import_react14.useState)(false);
1845
- const { scrollCallback } = useSelectedNode();
1846
- const theme = (0, import_react_native_theming9.useTheme)();
1847
- const { height } = (0, import_react_native9.useWindowDimensions)();
1848
- const animatedHeight = useAnimatedModalHeight();
1849
- const slideAnim = useAnimatedValue(height);
1850
- const dragY = useAnimatedValue(0);
1851
- const openDrawer = (0, import_react14.useCallback)(() => {
1852
- dragY.setValue(0);
1853
- slideAnim.setValue(height);
1854
- setIsVisible(true);
1855
- import_react_native9.Animated.timing(slideAnim, {
1856
- toValue: 0,
1857
- duration: 300,
1858
- easing: import_react_native9.Easing.out(import_react_native9.Easing.quad),
1859
- useNativeDriver: true
1860
- }).start(({ finished }) => {
1861
- if (finished) {
1862
- scrollCallback({ animated: false, id: void 0 });
1863
- }
1864
- });
1865
- }, [dragY, height, scrollCallback, slideAnim]);
1866
- const closeDrawer = (0, import_react14.useCallback)(() => {
1867
- import_react_native9.Keyboard.dismiss();
1868
- import_react_native9.Animated.timing(slideAnim, {
1869
- toValue: height,
1870
- duration: 300,
1871
- easing: import_react_native9.Easing.in(import_react_native9.Easing.quad),
1872
- useNativeDriver: true
1873
- }).start(({ finished }) => {
1874
- if (finished) {
1875
- setIsVisible(false);
1876
- }
1877
- });
1878
- }, [height, slideAnim]);
1879
- const panResponder = (0, import_react14.useMemo)(
1880
- () => import_react_native9.PanResponder.create({
1881
- onStartShouldSetPanResponder: () => true,
1882
- onMoveShouldSetPanResponder: (_, gestureState) => {
1883
- return gestureState.dy > 0;
1884
- },
1885
- onPanResponderMove: (_, gestureState) => {
1886
- if (gestureState.dy > 0) {
1887
- dragY.setValue(gestureState.dy);
1899
+ (0, import_react14.forwardRef)(
1900
+ ({ children, onVisibilityChange }, ref) => {
1901
+ const [isVisible, setIsVisible] = (0, import_react14.useState)(false);
1902
+ const { scrollCallback } = useSelectedNode();
1903
+ const theme = (0, import_react_native_theming9.useTheme)();
1904
+ const { height } = (0, import_react_native9.useWindowDimensions)();
1905
+ const animatedHeight = useAnimatedModalHeight();
1906
+ const slideAnim = useAnimatedValue(height);
1907
+ const dragY = useAnimatedValue(0);
1908
+ const openDrawer = (0, import_react14.useCallback)(() => {
1909
+ dragY.setValue(0);
1910
+ slideAnim.setValue(height);
1911
+ setIsVisible(true);
1912
+ onVisibilityChange?.(true);
1913
+ import_react_native9.Animated.timing(slideAnim, {
1914
+ toValue: 0,
1915
+ duration: 300,
1916
+ easing: import_react_native9.Easing.out(import_react_native9.Easing.quad),
1917
+ useNativeDriver: true
1918
+ }).start(({ finished }) => {
1919
+ if (finished) {
1920
+ scrollCallback({ animated: false, id: void 0 });
1888
1921
  }
1889
- },
1890
- onPanResponderRelease: (_, gestureState) => {
1891
- if (gestureState.dy > 50) {
1892
- closeDrawer();
1922
+ });
1923
+ }, [dragY, height, onVisibilityChange, scrollCallback, slideAnim]);
1924
+ const closeDrawer = (0, import_react14.useCallback)(() => {
1925
+ import_react_native9.Keyboard.dismiss();
1926
+ onVisibilityChange?.(false);
1927
+ import_react_native9.Animated.timing(slideAnim, {
1928
+ toValue: height,
1929
+ duration: 300,
1930
+ easing: import_react_native9.Easing.in(import_react_native9.Easing.quad),
1931
+ useNativeDriver: true
1932
+ }).start(({ finished }) => {
1933
+ if (finished) {
1934
+ setIsVisible(false);
1935
+ }
1936
+ });
1937
+ }, [height, onVisibilityChange, slideAnim]);
1938
+ const panResponder = (0, import_react14.useMemo)(
1939
+ () => import_react_native9.PanResponder.create({
1940
+ onStartShouldSetPanResponder: () => true,
1941
+ onMoveShouldSetPanResponder: (_, gestureState) => {
1942
+ return gestureState.dy > 0;
1943
+ },
1944
+ onPanResponderMove: (_, gestureState) => {
1945
+ if (gestureState.dy > 0) {
1946
+ dragY.setValue(gestureState.dy);
1947
+ }
1948
+ },
1949
+ onPanResponderRelease: (_, gestureState) => {
1950
+ if (gestureState.dy > 50) {
1951
+ closeDrawer();
1952
+ } else {
1953
+ import_react_native9.Animated.timing(dragY, {
1954
+ toValue: 0,
1955
+ duration: 300,
1956
+ easing: import_react_native9.Easing.out(import_react_native9.Easing.quad),
1957
+ useNativeDriver: true
1958
+ }).start();
1959
+ }
1960
+ }
1961
+ }),
1962
+ [closeDrawer, dragY]
1963
+ );
1964
+ (0, import_react14.useImperativeHandle)(ref, () => ({
1965
+ setMobileMenuOpen: (open) => {
1966
+ if (open) {
1967
+ openDrawer();
1893
1968
  } else {
1894
- import_react_native9.Animated.timing(dragY, {
1895
- toValue: 0,
1896
- duration: 300,
1897
- easing: import_react_native9.Easing.out(import_react_native9.Easing.quad),
1898
- useNativeDriver: true
1899
- }).start();
1969
+ closeDrawer();
1900
1970
  }
1901
1971
  }
1902
- }),
1903
- [closeDrawer, dragY]
1904
- );
1905
- (0, import_react14.useImperativeHandle)(ref, () => ({
1906
- setMobileMenuOpen: (open) => {
1907
- if (open) {
1908
- openDrawer();
1909
- } else {
1910
- closeDrawer();
1972
+ }));
1973
+ const handleStyle = (0, import_react14.useMemo)(
1974
+ () => ({
1975
+ width: 40,
1976
+ height: 5,
1977
+ backgroundColor: theme.color.mediumdark,
1978
+ borderRadius: 2.5,
1979
+ alignSelf: "center"
1980
+ }),
1981
+ [theme.color.mediumdark]
1982
+ );
1983
+ const drawerContainerStyle = (0, import_react14.useMemo)(
1984
+ () => ({
1985
+ flex: 1,
1986
+ borderTopColor: theme.appBorderColor,
1987
+ borderTopWidth: 1,
1988
+ borderStyle: "solid",
1989
+ backgroundColor: theme.background.content,
1990
+ elevation: 8,
1991
+ boxShadow: `0 16px 32px 0 ${theme.color.border}`
1992
+ }),
1993
+ [theme.appBorderColor, theme.background.content, theme.color.border]
1994
+ );
1995
+ const dragHandleWrapperStyle = (0, import_react14.useMemo)(
1996
+ () => ({
1997
+ alignItems: "center",
1998
+ justifyContent: "center",
1999
+ paddingBottom: 16,
2000
+ paddingTop: 10,
2001
+ backgroundColor: theme.background.content
2002
+ }),
2003
+ [theme.background.content]
2004
+ );
2005
+ const childrenWrapperStyle = (0, import_react14.useMemo)(
2006
+ () => ({
2007
+ flex: 1,
2008
+ backgroundColor: theme.background.content
2009
+ }),
2010
+ [theme.background.content]
2011
+ );
2012
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_portal.Portal, { hostName: "storybook-lite-ui-root", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2013
+ import_react_native9.Animated.View,
2014
+ {
2015
+ style: [portalContainerStyle, { transform: [{ translateY: slideAnim }] }],
2016
+ pointerEvents: isVisible ? "auto" : "none",
2017
+ accessibilityElementsHidden: !isVisible,
2018
+ importantForAccessibility: isVisible ? "auto" : "no-hide-descendants",
2019
+ accessibilityViewIsModal: isVisible,
2020
+ children: [
2021
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: flexStyle5, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2022
+ import_react_native9.Pressable,
2023
+ {
2024
+ style: flexStyle5,
2025
+ onPress: closeDrawer,
2026
+ accessibilityRole: "button",
2027
+ accessibilityLabel: "Close story list"
2028
+ }
2029
+ ) }),
2030
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2031
+ import_react_native9.Animated.View,
2032
+ {
2033
+ style: {
2034
+ height: animatedHeight
2035
+ },
2036
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native9.Animated.View, { style: [drawerContainerStyle, { transform: [{ translateY: dragY }] }], children: [
2037
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { ...panResponder.panHandlers, style: dragHandleWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: handleStyle }) }),
2038
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: childrenWrapperStyle, children })
2039
+ ] })
2040
+ }
2041
+ )
2042
+ ]
1911
2043
  }
1912
- }
1913
- }));
1914
- const handleStyle = (0, import_react14.useMemo)(
1915
- () => ({
1916
- width: 40,
1917
- height: 5,
1918
- backgroundColor: theme.color.mediumdark,
1919
- borderRadius: 2.5,
1920
- alignSelf: "center"
1921
- }),
1922
- [theme.color.mediumdark]
1923
- );
1924
- const drawerContainerStyle = (0, import_react14.useMemo)(
1925
- () => ({
1926
- flex: 1,
1927
- borderTopColor: theme.appBorderColor,
1928
- borderTopWidth: 1,
1929
- borderStyle: "solid",
1930
- backgroundColor: theme.background.content,
1931
- elevation: 8,
1932
- boxShadow: `0 16px 32px 0 ${theme.color.border}`
1933
- }),
1934
- [theme.appBorderColor, theme.background.content, theme.color.border]
1935
- );
1936
- const dragHandleWrapperStyle = (0, import_react14.useMemo)(
1937
- () => ({
1938
- alignItems: "center",
1939
- justifyContent: "center",
1940
- paddingBottom: 16,
1941
- paddingTop: 10,
1942
- backgroundColor: theme.background.content
1943
- }),
1944
- [theme.background.content]
1945
- );
1946
- const childrenWrapperStyle = (0, import_react14.useMemo)(
1947
- () => ({
1948
- flex: 1,
1949
- backgroundColor: theme.background.content
1950
- }),
1951
- [theme.background.content]
1952
- );
1953
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_portal.Portal, { hostName: "storybook-lite-ui-root", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1954
- import_react_native9.Animated.View,
1955
- {
1956
- style: [portalContainerStyle, { transform: [{ translateY: slideAnim }] }],
1957
- pointerEvents: isVisible ? "auto" : "none",
1958
- children: [
1959
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: flexStyle5, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.Pressable, { style: flexStyle5, onPress: closeDrawer }) }),
1960
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1961
- import_react_native9.Animated.View,
1962
- {
1963
- style: {
1964
- height: animatedHeight
1965
- },
1966
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native9.Animated.View, { style: [drawerContainerStyle, { transform: [{ translateY: dragY }] }], children: [
1967
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { ...panResponder.panHandlers, style: dragHandleWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: handleStyle }) }),
1968
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.View, { style: childrenWrapperStyle, children })
1969
- ] })
1970
- }
1971
- )
1972
- ]
1973
- }
1974
- ) });
1975
- })
2044
+ ) });
2045
+ }
2046
+ )
1976
2047
  );
1977
2048
 
1978
2049
  // src/ResizeHandle.tsx
@@ -2086,6 +2157,8 @@ var BrandLogo = ({ theme }) => {
2086
2157
  onPress: () => {
2087
2158
  if (theme.brand.url) import_react_native11.Linking.openURL(theme.brand.url);
2088
2159
  },
2160
+ accessibilityRole: "link",
2161
+ accessibilityLabel: theme.brand.title ?? "Brand logo",
2089
2162
  children: image
2090
2163
  }
2091
2164
  );
@@ -2110,6 +2183,8 @@ var BrandTitle = ({ theme }) => {
2110
2183
  onPress: () => {
2111
2184
  if (theme.brand.url) import_react_native11.Linking.openURL(theme.brand.url);
2112
2185
  },
2186
+ accessibilityRole: "link",
2187
+ accessibilityLabel: theme.brand.title,
2113
2188
  children: title
2114
2189
  }
2115
2190
  );
@@ -2258,118 +2333,147 @@ var Layout = ({
2258
2333
  );
2259
2334
  const mobileMenuDrawerRef = (0, import_react17.useRef)(null);
2260
2335
  const addonPanelRef = (0, import_react17.useRef)(null);
2336
+ const [isDrawerOpen, setIsDrawerOpen] = (0, import_react17.useState)(false);
2261
2337
  const setSelection = (0, import_react17.useCallback)(({ storyId: newStoryId }) => {
2262
2338
  const channel = import_manager_api2.addons.getChannel();
2263
2339
  channel.emit(import_core_events.SET_CURRENT_STORY, { storyId: newStoryId });
2264
2340
  }, []);
2265
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: containerStyle2, children: [
2266
- isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2267
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: desktopSidebarStyle, pointerEvents: isResizing ? "none" : "auto", children: desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2268
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: desktopLogoContainer, children: [
2269
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StorybookLogo, { theme }),
2270
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.IconButton, { onPress: () => setDesktopSidebarOpen(false), Icon: MenuIcon })
2341
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2342
+ import_react_native12.View,
2343
+ {
2344
+ style: containerStyle2,
2345
+ accessibilityElementsHidden: isDrawerOpen,
2346
+ importantForAccessibility: isDrawerOpen ? "no-hide-descendants" : "auto",
2347
+ children: [
2348
+ isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2349
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: desktopSidebarStyle, pointerEvents: isResizing ? "none" : "auto", children: desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2350
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: desktopLogoContainer, children: [
2351
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StorybookLogo, { theme }),
2352
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2353
+ import_react_native_ui_common7.IconButton,
2354
+ {
2355
+ onPress: () => setDesktopSidebarOpen(false),
2356
+ Icon: MenuIcon,
2357
+ accessibilityLabel: "Close sidebar"
2358
+ }
2359
+ )
2360
+ ] }),
2361
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: flexStyle6, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2362
+ Sidebar,
2363
+ {
2364
+ previewInitialized: true,
2365
+ indexError: void 0,
2366
+ refs: placeholderObject,
2367
+ setSelection,
2368
+ status: placeholderObject,
2369
+ index: storyHash,
2370
+ storyId: story?.id,
2371
+ refId: DEFAULT_REF_ID
2372
+ }
2373
+ ) })
2374
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2375
+ import_react_native_ui_common7.IconButton,
2376
+ {
2377
+ onPress: () => setDesktopSidebarOpen(true),
2378
+ Icon: MenuIcon,
2379
+ accessibilityLabel: "Open sidebar"
2380
+ }
2381
+ ) }),
2382
+ desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2383
+ ResizeHandle,
2384
+ {
2385
+ direction: "horizontal",
2386
+ onResize: handleSidebarResize,
2387
+ onResizeStart,
2388
+ onResizeEnd
2389
+ }
2390
+ ) : null
2391
+ ] }) : null,
2392
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: mobileContentStyle, children: [
2393
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: contentContainerStyle, pointerEvents: isResizing ? "none" : "auto", children }),
2394
+ story?.parameters?.hideFullScreenButton || isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2395
+ import_react_native12.TouchableOpacity,
2396
+ {
2397
+ style: fullScreenButtonStyle,
2398
+ hitSlop: { top: 10, bottom: 10, left: 10, right: 10 },
2399
+ onPress: () => setUiHidden((prev) => !prev),
2400
+ accessibilityRole: "button",
2401
+ accessibilityLabel: uiHidden ? "Exit fullscreen" : "Enter fullscreen",
2402
+ children: uiHidden ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseFullscreenIcon, { color: theme.color.mediumdark }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FullscreenIcon, { color: theme.color.mediumdark })
2403
+ }
2404
+ ),
2405
+ isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2406
+ desktopAddonsPanelOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2407
+ ResizeHandle,
2408
+ {
2409
+ direction: "vertical",
2410
+ onResize: handleAddonsPanelResize,
2411
+ onResizeStart,
2412
+ onResizeEnd
2413
+ }
2414
+ ) : null,
2415
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: desktopAddonsPanelStyle, pointerEvents: isResizing ? "none" : "auto", children: desktopAddonsPanelOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AddonsTabs, { storyId: story?.id, onClose: () => setDesktopAddonsPanelOpen(false) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2416
+ import_react_native_ui_common7.IconButton,
2417
+ {
2418
+ style: iconFloatRightStyle,
2419
+ onPress: () => setDesktopAddonsPanelOpen(true),
2420
+ Icon: BottomBarToggleIcon,
2421
+ accessibilityLabel: "Open addons panel"
2422
+ }
2423
+ ) })
2424
+ ] }) : null
2271
2425
  ] }),
2272
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: flexStyle6, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2273
- Sidebar,
2274
- {
2275
- previewInitialized: true,
2276
- indexError: void 0,
2277
- refs: placeholderObject,
2278
- setSelection,
2279
- status: placeholderObject,
2280
- index: storyHash,
2281
- storyId: story?.id,
2282
- refId: DEFAULT_REF_ID
2283
- }
2284
- ) })
2285
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_ui_common7.IconButton, { onPress: () => setDesktopSidebarOpen(true), Icon: MenuIcon }) }),
2286
- desktopSidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2287
- ResizeHandle,
2288
- {
2289
- direction: "horizontal",
2290
- onResize: handleSidebarResize,
2291
- onResizeStart,
2292
- onResizeEnd
2293
- }
2294
- ) : null
2295
- ] }) : null,
2296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: mobileContentStyle, children: [
2297
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: contentContainerStyle, pointerEvents: isResizing ? "none" : "auto", children }),
2298
- story?.parameters?.hideFullScreenButton || isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2299
- import_react_native12.TouchableOpacity,
2300
- {
2301
- style: fullScreenButtonStyle,
2302
- hitSlop: { top: 10, bottom: 10, left: 10, right: 10 },
2303
- onPress: () => setUiHidden((prev) => !prev),
2304
- children: uiHidden ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseFullscreenIcon, { color: theme.color.mediumdark }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FullscreenIcon, { color: theme.color.mediumdark })
2305
- }
2306
- ),
2307
- isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2308
- desktopAddonsPanelOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2309
- ResizeHandle,
2310
- {
2311
- direction: "vertical",
2312
- onResize: handleAddonsPanelResize,
2313
- onResizeStart,
2314
- onResizeEnd
2315
- }
2316
- ) : null,
2317
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: desktopAddonsPanelStyle, pointerEvents: isResizing ? "none" : "auto", children: desktopAddonsPanelOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AddonsTabs, { storyId: story?.id, onClose: () => setDesktopAddonsPanelOpen(false) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2318
- import_react_native_ui_common7.IconButton,
2319
- {
2320
- style: iconFloatRightStyle,
2321
- onPress: () => setDesktopAddonsPanelOpen(true),
2322
- Icon: BottomBarToggleIcon
2323
- }
2324
- ) })
2325
- ] }) : null
2326
- ] }),
2327
- !uiHidden && !isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container2, { style: navContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Nav, { children: [
2328
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2329
- Button2,
2330
- {
2331
- testID: "mobile-menu-button",
2332
- style: navButtonStyle,
2333
- hitSlop: navButtonHitSlop,
2334
- onPress: () => mobileMenuDrawerRef.current?.setMobileMenuOpen(true),
2335
- children: [
2336
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuIcon, { color: theme.color.mediumdark }),
2337
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.Text, { style: navButtonTextStyle, numberOfLines: 1, children: [
2338
- story?.title,
2339
- "/",
2340
- story?.name
2341
- ] })
2342
- ]
2343
- }
2344
- ),
2345
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2346
- import_react_native_ui_common7.IconButton,
2347
- {
2348
- testID: "mobile-addons-button",
2349
- hitSlop: addonButtonHitSlop,
2350
- onPress: () => addonPanelRef.current.setAddonsPanelOpen(true),
2351
- Icon: BottomBarToggleIcon
2352
- }
2353
- )
2354
- ] }) }) : null,
2355
- isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(MobileMenuDrawer, { ref: mobileMenuDrawerRef, children: [
2356
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: mobileMenuDrawerContentStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StorybookLogo, { theme }) }),
2357
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2358
- Sidebar,
2359
- {
2360
- previewInitialized: true,
2361
- indexError: void 0,
2362
- refs: placeholderObject,
2363
- setSelection,
2364
- status: placeholderObject,
2365
- index: storyHash,
2366
- storyId: story?.id,
2367
- refId: DEFAULT_REF_ID
2368
- }
2369
- )
2370
- ] }),
2371
- isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MobileAddonsPanel, { ref: addonPanelRef, storyId: story?.id })
2372
- ] });
2426
+ !uiHidden && !isDesktop ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container2, { style: navContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Nav, { children: [
2427
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2428
+ Button2,
2429
+ {
2430
+ testID: "mobile-menu-button",
2431
+ style: navButtonStyle,
2432
+ hitSlop: navButtonHitSlop,
2433
+ onPress: () => mobileMenuDrawerRef.current?.setMobileMenuOpen(true),
2434
+ accessibilityRole: "button",
2435
+ accessibilityLabel: "Open story list",
2436
+ children: [
2437
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuIcon, { color: theme.color.mediumdark }),
2438
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.Text, { style: navButtonTextStyle, numberOfLines: 1, children: [
2439
+ story?.title,
2440
+ "/",
2441
+ story?.name
2442
+ ] })
2443
+ ]
2444
+ }
2445
+ ),
2446
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2447
+ import_react_native_ui_common7.IconButton,
2448
+ {
2449
+ testID: "mobile-addons-button",
2450
+ hitSlop: addonButtonHitSlop,
2451
+ onPress: () => addonPanelRef.current.setAddonsPanelOpen(true),
2452
+ Icon: BottomBarToggleIcon,
2453
+ accessibilityLabel: "Open addons panel"
2454
+ }
2455
+ )
2456
+ ] }) }) : null,
2457
+ isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(MobileMenuDrawer, { ref: mobileMenuDrawerRef, onVisibilityChange: setIsDrawerOpen, children: [
2458
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: mobileMenuDrawerContentStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StorybookLogo, { theme }) }),
2459
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2460
+ Sidebar,
2461
+ {
2462
+ previewInitialized: true,
2463
+ indexError: void 0,
2464
+ refs: placeholderObject,
2465
+ setSelection,
2466
+ status: placeholderObject,
2467
+ index: storyHash,
2468
+ storyId: story?.id,
2469
+ refId: DEFAULT_REF_ID
2470
+ }
2471
+ )
2472
+ ] }),
2473
+ isDesktop ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MobileAddonsPanel, { ref: addonPanelRef, storyId: story?.id })
2474
+ ]
2475
+ }
2476
+ );
2373
2477
  };
2374
2478
  var Nav = import_react_native_theming11.styled.View({
2375
2479
  display: "flex",