storybook 10.2.0-beta.2 → 10.2.0-beta.4

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.
Files changed (68) hide show
  1. package/assets/server/base-preview-head.html +66 -44
  2. package/dist/_browser-chunks/{chunk-QOXZ7W26.js → chunk-2N4WE3KZ.js} +4 -6
  3. package/dist/_node-chunks/{builder-manager-N2LWOX5D.js → builder-manager-QV5RDRX3.js} +12 -12
  4. package/dist/_node-chunks/{camelcase-5FSYVCZS.js → camelcase-BMCEZEHU.js} +7 -7
  5. package/dist/_node-chunks/{chunk-HODKH6S2.js → chunk-2MIIBCWO.js} +6 -6
  6. package/dist/_node-chunks/chunk-3G6JTYYU.js +18 -0
  7. package/dist/_node-chunks/{chunk-P2XLDRN4.js → chunk-3WAOMPEV.js} +20 -20
  8. package/dist/_node-chunks/{chunk-ZYMMEEUR.js → chunk-5BZY2EBX.js} +6 -6
  9. package/dist/_node-chunks/{chunk-J6PIL7K6.js → chunk-7C3OCMOV.js} +7 -7
  10. package/dist/_node-chunks/chunk-7CC7KOAY.js +61 -0
  11. package/dist/_node-chunks/{chunk-EABA3I6M.js → chunk-A635UKUK.js} +36 -15
  12. package/dist/_node-chunks/{chunk-6BGWV535.js → chunk-B6PRKQBU.js} +43 -25
  13. package/dist/_node-chunks/{chunk-CQFU5LUX.js → chunk-C2PW44X2.js} +20 -11
  14. package/dist/_node-chunks/{chunk-OJV6TVDO.js → chunk-DX2OTMAX.js} +7 -7
  15. package/dist/_node-chunks/{chunk-5J2THD7E.js → chunk-HNJNGHJI.js} +7 -7
  16. package/dist/_node-chunks/{chunk-GHY5BYFV.js → chunk-HSLEWKPT.js} +7 -7
  17. package/dist/_node-chunks/{chunk-HBFPHSFB.js → chunk-JGB6IJ7A.js} +6 -6
  18. package/dist/_node-chunks/{chunk-WXDEINTE.js → chunk-JZDQQ34S.js} +10 -10
  19. package/dist/_node-chunks/{chunk-XEBN3C26.js → chunk-LDPGDFBN.js} +8 -8
  20. package/dist/_node-chunks/{chunk-4VD35T6X.js → chunk-LQF2YX4Z.js} +6 -6
  21. package/dist/_node-chunks/{chunk-M4QILBFD.js → chunk-LY42XGJX.js} +7 -7
  22. package/dist/_node-chunks/{chunk-5PCZPYCJ.js → chunk-M3NUJKHF.js} +9 -9
  23. package/dist/_node-chunks/{chunk-ZQQYNNTB.js → chunk-NM76NNBF.js} +9 -9
  24. package/dist/_node-chunks/{chunk-SBB2XM7N.js → chunk-PFCD6HBP.js} +7 -7
  25. package/dist/_node-chunks/{chunk-FWIMIUHV.js → chunk-QLZIG3XC.js} +7 -7
  26. package/dist/_node-chunks/chunk-TJGUM3J6.js +23 -0
  27. package/dist/_node-chunks/{chunk-2LRLWFCA.js → chunk-TOAOZCOV.js} +16 -16
  28. package/dist/_node-chunks/{chunk-7UVJF2ZL.js → chunk-UJMJ7W5H.js} +7 -7
  29. package/dist/_node-chunks/{chunk-BTTNDYQ6.js → chunk-V2LVNLAT.js} +6 -6
  30. package/dist/_node-chunks/{chunk-PGC5F6XL.js → chunk-WC6YF7PX.js} +6 -6
  31. package/dist/_node-chunks/{chunk-2LLPTUG2.js → chunk-XOGYJBNU.js} +6 -6
  32. package/dist/_node-chunks/{chunk-M62QO44I.js → chunk-Z4WARWVA.js} +6 -6
  33. package/dist/_node-chunks/{globby-SSZCWWA6.js → globby-OVGPC72V.js} +9 -9
  34. package/dist/_node-chunks/{lib-L2HJYQNA.js → lib-GNBN4EH6.js} +7 -7
  35. package/dist/_node-chunks/{mdx-N42X6CFJ-H4SZRJXB.js → mdx-N42X6CFJ-I3J2JFL4.js} +8 -8
  36. package/dist/_node-chunks/{p-limit-EA5PER7Y.js → p-limit-2LNUZG3W.js} +7 -7
  37. package/dist/babel/index.js +10 -10
  38. package/dist/bin/core.js +12 -12
  39. package/dist/bin/dispatcher.js +11 -11
  40. package/dist/bin/loader.js +9 -9
  41. package/dist/cli/index.js +18 -18
  42. package/dist/common/index.js +19 -19
  43. package/dist/components/index.d.ts +2 -0
  44. package/dist/components/index.js +49 -16
  45. package/dist/core-server/index.js +35 -35
  46. package/dist/core-server/presets/common-manager.js +15 -21
  47. package/dist/core-server/presets/common-override-preset.js +9 -9
  48. package/dist/core-server/presets/common-preset.js +25 -25
  49. package/dist/csf/index.d.ts +333 -8
  50. package/dist/csf/index.js +1 -1
  51. package/dist/csf-tools/index.js +9 -9
  52. package/dist/manager/globals-runtime.js +58 -25
  53. package/dist/manager/runtime.js +167 -148
  54. package/dist/manager-api/index.d.ts +13 -13
  55. package/dist/manager-api/index.js +1 -1
  56. package/dist/mocking-utils/index.js +8 -8
  57. package/dist/node-logger/index.js +9 -9
  58. package/dist/preview/runtime.js +4 -6
  59. package/dist/preview-api/index.d.ts +69 -68
  60. package/dist/preview-api/index.js +1 -1
  61. package/dist/server-errors.js +11 -11
  62. package/dist/telemetry/index.d.ts +5 -0
  63. package/dist/telemetry/index.js +23 -23
  64. package/dist/types/index.d.ts +2 -3
  65. package/package.json +1 -1
  66. package/dist/_node-chunks/chunk-2WBHN5ZN.js +0 -23
  67. package/dist/_node-chunks/chunk-ADG4FYMH.js +0 -61
  68. package/dist/_node-chunks/chunk-J4YBZOS2.js +0 -18
@@ -1600,18 +1600,21 @@ var components_default = __STORYBOOK_COMPONENTS__, { A, AbstractToolbar, ActionB
1600
1600
  var defaultItemValues = {
1601
1601
  type: "item",
1602
1602
  value: ""
1603
- }, normalizeArgType = (key, argType) => ({
1604
- ...argType,
1605
- name: argType.name || key,
1606
- description: argType.description || key,
1607
- toolbar: {
1608
- ...argType.toolbar,
1609
- items: argType.toolbar.items.map((_item) => {
1610
- let item = typeof _item == "string" ? { value: _item, title: _item } : _item;
1611
- return item.type === "reset" && argType.toolbar.icon && (item.icon = argType.toolbar.icon, item.hideIcon = !0, item.value = void 0), { ...defaultItemValues, ...item };
1612
- })
1613
- }
1614
- });
1603
+ }, normalizeArgType = (key, argType) => {
1604
+ let toolbar = argType.toolbar;
1605
+ return toolbar ? {
1606
+ ...argType,
1607
+ name: argType.name || key,
1608
+ description: argType.description || key,
1609
+ toolbar: {
1610
+ ...argType.toolbar,
1611
+ items: toolbar.items.map((_item) => {
1612
+ let item = typeof _item == "string" ? { value: _item, title: _item } : _item;
1613
+ return item.type === "reset" && toolbar.icon && (item.icon = toolbar.icon, item.hideIcon = !0, item.value = void 0), { ...defaultItemValues, ...item };
1614
+ })
1615
+ }
1616
+ } : null;
1617
+ };
1615
1618
 
1616
1619
  // src/toolbar/components/ToolbarMenuSelect.tsx
1617
1620
  init_react();
@@ -1865,28 +1868,25 @@ var NEW_ICON_MAP = icons_exports, Svg = styled.svg`
1865
1868
  vscode: "VSCodeIcon"
1866
1869
  };
1867
1870
 
1868
- // src/toolbar/hoc/withKeyboardCycle.tsx
1869
- init_react();
1870
-
1871
- // src/toolbar/utils/create-cycle-value-array.ts
1872
- var disallowedCycleableItemTypes = ["reset"], createCycleValueArray = (items) => items.filter((item) => !disallowedCycleableItemTypes.includes(item.type)).map((item) => item.value);
1871
+ // src/toolbar/utils/get-selected.ts
1872
+ var getSelectedItem = ({ currentValue, items }) => items.find((item) => item.value === currentValue && item.type !== "reset");
1873
1873
 
1874
1874
  // src/toolbar/constants.ts
1875
1875
  var TOOLBAR_ID = "toolbar";
1876
1876
 
1877
1877
  // src/toolbar/utils/register-shortcuts.ts
1878
1878
  var registerShortcuts = async (api, id, shortcuts) => {
1879
- shortcuts && shortcuts.next && await api.setAddonShortcut(TOOLBAR_ID, {
1879
+ shortcuts.next && await api.setAddonShortcut(TOOLBAR_ID, {
1880
1880
  label: shortcuts.next.label,
1881
1881
  defaultShortcut: shortcuts.next.keys,
1882
1882
  actionName: `${id}:next`,
1883
1883
  action: shortcuts.next.action
1884
- }), shortcuts && shortcuts.previous && await api.setAddonShortcut(TOOLBAR_ID, {
1884
+ }), shortcuts.previous && await api.setAddonShortcut(TOOLBAR_ID, {
1885
1885
  label: shortcuts.previous.label,
1886
1886
  defaultShortcut: shortcuts.previous.keys,
1887
1887
  actionName: `${id}:previous`,
1888
1888
  action: shortcuts.previous.action
1889
- }), shortcuts && shortcuts.reset && await api.setAddonShortcut(TOOLBAR_ID, {
1889
+ }), shortcuts.reset && await api.setAddonShortcut(TOOLBAR_ID, {
1890
1890
  label: shortcuts.reset.label,
1891
1891
  defaultShortcut: shortcuts.reset.keys,
1892
1892
  actionName: `${id}:reset`,
@@ -1894,42 +1894,6 @@ var registerShortcuts = async (api, id, shortcuts) => {
1894
1894
  });
1895
1895
  };
1896
1896
 
1897
- // src/toolbar/hoc/withKeyboardCycle.tsx
1898
- var withKeyboardCycle = (Component2) => (props) => {
1899
- let {
1900
- id,
1901
- toolbar: { items, shortcuts }
1902
- } = props, api = useStorybookApi(), [globals, updateGlobals] = useGlobals(), cycleValues = useRef([]), currentValue = globals[id], reset = useCallback(() => {
1903
- updateGlobals({ [id]: "" });
1904
- }, [updateGlobals]), setNext = useCallback(() => {
1905
- let values = cycleValues.current, currentIndex = values.indexOf(currentValue), newCurrentIndex = currentIndex === values.length - 1 ? 0 : currentIndex + 1, newCurrent = cycleValues.current[newCurrentIndex];
1906
- updateGlobals({ [id]: newCurrent });
1907
- }, [cycleValues, currentValue, updateGlobals]), setPrevious = useCallback(() => {
1908
- let values = cycleValues.current, indexOf = values.indexOf(currentValue), currentIndex = indexOf > -1 ? indexOf : 0, newCurrentIndex = currentIndex === 0 ? values.length - 1 : currentIndex - 1, newCurrent = cycleValues.current[newCurrentIndex];
1909
- updateGlobals({ [id]: newCurrent });
1910
- }, [cycleValues, currentValue, updateGlobals]);
1911
- return useEffect(() => {
1912
- shortcuts && registerShortcuts(api, id, {
1913
- next: { ...shortcuts.next, action: setNext },
1914
- previous: { ...shortcuts.previous, action: setPrevious },
1915
- reset: { ...shortcuts.reset, action: reset }
1916
- });
1917
- }, [api, id, shortcuts, setNext, setPrevious, reset]), useEffect(() => {
1918
- cycleValues.current = createCycleValueArray(items);
1919
- }, []), react_default.createElement(Component2, { cycleValues: cycleValues.current, ...props });
1920
- };
1921
-
1922
- // src/toolbar/utils/get-selected.ts
1923
- var getSelectedItem = ({ currentValue, items }) => currentValue != null && items.find((item) => item.value === currentValue && item.type !== "reset"), getSelectedIcon = ({ currentValue, items }) => {
1924
- let selectedItem = getSelectedItem({ currentValue, items });
1925
- if (selectedItem)
1926
- return selectedItem.icon;
1927
- }, getSelectedTitle = ({ currentValue, items }) => {
1928
- let selectedItem = getSelectedItem({ currentValue, items });
1929
- if (selectedItem)
1930
- return selectedItem.title;
1931
- };
1932
-
1933
1897
  // src/toolbar/components/ToolbarMenuSelect.tsx
1934
1898
  var ToolbarMenuItemContainer = styled("div")({
1935
1899
  width: "100%",
@@ -1938,16 +1902,16 @@ var ToolbarMenuItemContainer = styled("div")({
1938
1902
  gap: 8
1939
1903
  }), ToolbarMenuItemMiddle = styled("div")({
1940
1904
  flex: 1
1941
- }), ToolbarMenuSelect = withKeyboardCycle(
1942
- ({
1943
- id,
1944
- name,
1945
- description,
1946
- toolbar: { icon: _icon, items, title: _title, preventDynamicIcon, dynamicTitle }
1947
- }) => {
1948
- let [globals, updateGlobals, storyGlobals] = useGlobals(), currentValue = globals[id], isOverridden = id in storyGlobals, icon = _icon, title2 = _title;
1949
- preventDynamicIcon || (icon = getSelectedIcon({ currentValue, items }) || icon), dynamicTitle && (title2 = getSelectedTitle({ currentValue, items }) || title2), !title2 && !icon && console.warn(`Toolbar '${name}' has no title or icon`);
1950
- let resetItem = items.find((item) => item.type === "reset"), resetLabel = resetItem?.title, options2 = items.filter((item) => item.type === "item").map((item) => {
1905
+ }), ToolbarMenuSelect = ({
1906
+ id,
1907
+ name,
1908
+ description,
1909
+ toolbar: { icon: _icon, items, title: _title, preventDynamicIcon, dynamicTitle, shortcuts }
1910
+ }) => {
1911
+ let api = useStorybookApi(), [globals, updateGlobals, storyGlobals] = useGlobals(), currentValue = globals[id], isOverridden = id in storyGlobals, icon = _icon, title2 = _title;
1912
+ preventDynamicIcon || (icon = getSelectedItem({ currentValue, items })?.icon || icon), dynamicTitle && (title2 = getSelectedItem({ currentValue, items })?.title || title2), !title2 && !icon && console.warn(`Toolbar '${name}' has no title or icon`);
1913
+ let resetItem = items.find((item) => item.type === "reset"), resetLabel = resetItem?.title, options2 = react_default.useMemo(
1914
+ () => items.filter((item) => item.type === "item").map((item) => {
1951
1915
  let itemTitle = item.title ?? item.value ?? "Untitled", iconComponent = !item.hideIcon && item.icon ? react_default.createElement(Icons, { icon: item.icon, __suppressDeprecationWarning: !0 }) : void 0;
1952
1916
  return item.right ? {
1953
1917
  title: itemTitle,
@@ -1958,31 +1922,60 @@ var ToolbarMenuItemContainer = styled("div")({
1958
1922
  value: item.value,
1959
1923
  icon: iconComponent
1960
1924
  };
1961
- }), ariaLabel = description || title2 || name || id;
1962
- return react_default.createElement(
1963
- Select,
1964
- {
1965
- defaultOptions: [currentValue],
1966
- options: options2,
1967
- disabled: isOverridden,
1968
- ariaLabel,
1969
- tooltip: ariaLabel,
1970
- resetLabel,
1971
- onReset: resetItem ? () => updateGlobals({ [id]: resetItem?.value }) : void 0,
1972
- onSelect: (selected) => updateGlobals({ [id]: selected }),
1973
- icon: icon && react_default.createElement(Icons, { icon, __suppressDeprecationWarning: !0 })
1974
- },
1975
- title2
1976
- );
1977
- }
1978
- );
1925
+ }),
1926
+ [items]
1927
+ );
1928
+ react_default.useEffect(() => {
1929
+ if (shortcuts) {
1930
+ let length = options2.length;
1931
+ registerShortcuts(api, id, {
1932
+ next: {
1933
+ ...shortcuts.next,
1934
+ action: () => {
1935
+ let idx = options2.findIndex((i2) => i2.value === globals[id]), nextIdx = idx < 0 ? 0 : (idx + 1) % length;
1936
+ updateGlobals({ [id]: options2[nextIdx].value });
1937
+ }
1938
+ },
1939
+ previous: {
1940
+ ...shortcuts.previous,
1941
+ action: () => {
1942
+ let idx = options2.findIndex((i2) => i2.value === globals[id]), previousIdx = idx < 0 ? length - 1 : (idx + length - 1) % length;
1943
+ updateGlobals({ [id]: options2[previousIdx].value });
1944
+ }
1945
+ },
1946
+ reset: {
1947
+ ...shortcuts.reset,
1948
+ action: () => {
1949
+ updateGlobals({ [id]: void 0 });
1950
+ }
1951
+ }
1952
+ });
1953
+ }
1954
+ }, [api, id, shortcuts, globals, options2, updateGlobals]);
1955
+ let ariaLabel = description || title2 || name || id;
1956
+ return react_default.createElement(
1957
+ Select,
1958
+ {
1959
+ defaultOptions: [currentValue],
1960
+ options: options2,
1961
+ disabled: isOverridden,
1962
+ ariaLabel,
1963
+ tooltip: ariaLabel,
1964
+ resetLabel,
1965
+ onReset: resetItem ? () => updateGlobals({ [id]: resetItem?.value }) : void 0,
1966
+ onSelect: (selected) => updateGlobals({ [id]: selected }),
1967
+ icon: icon && react_default.createElement(Icons, { icon, __suppressDeprecationWarning: !0 })
1968
+ },
1969
+ title2
1970
+ );
1971
+ };
1979
1972
 
1980
1973
  // src/toolbar/components/ToolbarManager.tsx
1981
1974
  var ToolbarManager = () => {
1982
- let globalTypes = useGlobalTypes(), globalIds = Object.keys(globalTypes).filter((id) => !!globalTypes[id].toolbar);
1983
- return globalIds.length ? react_default.createElement(react_default.Fragment, null, react_default.createElement(Separator, null), globalIds.map((id) => {
1975
+ let globalTypes = useGlobalTypes();
1976
+ return Object.keys(globalTypes).some((id) => !!globalTypes[id].toolbar) ? react_default.createElement(react_default.Fragment, null, react_default.createElement(Separator, null), Object.keys(globalTypes).map((id) => {
1984
1977
  let normalizedArgType = normalizeArgType(id, globalTypes[id]);
1985
- return react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType });
1978
+ return normalizedArgType && react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType });
1986
1979
  })) : null;
1987
1980
  };
1988
1981
 
@@ -4537,13 +4530,13 @@ var MINIMUM_CONTENT_WIDTH_PX = 100, layoutStateIsEqual = (state, other) => state
4537
4530
  return useLandmarkIndicator(), react_default.createElement(
4538
4531
  LayoutContainer,
4539
4532
  {
4540
- navSize,
4541
- rightPanelWidth,
4542
- bottomPanelHeight,
4543
4533
  panelPosition: managerLayoutState.panelPosition,
4544
- isDragging,
4545
- viewMode: managerLayoutState.viewMode,
4546
- showPanel
4534
+ showPanel,
4535
+ style: {
4536
+ "--nav-width": `${navSize}px`,
4537
+ "--right-panel-width": `${rightPanelWidth}px`,
4538
+ "--bottom-panel-height": `${bottomPanelHeight}px`
4539
+ }
4547
4540
  },
4548
4541
  showPages && react_default.createElement(PagesContainer, null, slots.slotPages),
4549
4542
  react_default.createElement(react_default.Fragment, null, isDesktop && react_default.createElement(SidebarContainer, null, react_default.createElement(Drag, { ref: sidebarResizerRef }), slots.slotSidebar), isMobile2 && react_default.createElement(
@@ -4557,32 +4550,31 @@ var MINIMUM_CONTENT_WIDTH_PX = 100, layoutStateIsEqual = (state, other) => state
4557
4550
  Drag,
4558
4551
  {
4559
4552
  orientation: panelPosition === "bottom" ? "horizontal" : "vertical",
4553
+ overlapping: panelPosition === "bottom" ? !!bottomPanelHeight : !!rightPanelWidth,
4560
4554
  position: panelPosition === "bottom" ? "left" : "right",
4561
4555
  ref: panelResizerRef
4562
4556
  }
4563
4557
  ), slots.slotPanel), isMobile2 && react_default.createElement(Notifications, null))
4564
4558
  );
4565
- }, LayoutContainer = styled.div(
4566
- ({ navSize, rightPanelWidth, bottomPanelHeight, viewMode, panelPosition, showPanel }) => ({
4567
- width: "100%",
4568
- height: ["100vh", "100dvh"],
4569
- // This array is a special Emotion syntax to set a fallback if 100dvh is not supported
4570
- overflow: "hidden",
4571
- display: "flex",
4572
- flexDirection: "column",
4573
- colorScheme: "light dark",
4574
- [MEDIA_DESKTOP_BREAKPOINT]: {
4575
- display: "grid",
4576
- gap: 0,
4577
- gridTemplateColumns: `minmax(0, ${navSize}px) minmax(${MINIMUM_CONTENT_WIDTH_PX}px, 1fr) minmax(0, ${rightPanelWidth}px)`,
4578
- gridTemplateRows: `1fr minmax(0, ${bottomPanelHeight}px)`,
4579
- gridTemplateAreas: showPanel ? panelPosition === "right" ? `"sidebar content panel"
4559
+ }, LayoutContainer = styled.div(({ panelPosition, showPanel }) => ({
4560
+ width: "100%",
4561
+ height: ["100vh", "100dvh"],
4562
+ overflow: "hidden",
4563
+ display: "flex",
4564
+ flexDirection: "column",
4565
+ colorScheme: "light dark",
4566
+ [MEDIA_DESKTOP_BREAKPOINT]: {
4567
+ display: "grid",
4568
+ gap: 0,
4569
+ // This uses CSS variables to prevent Emotion from generating a new CSS className for every possible value
4570
+ gridTemplateColumns: `minmax(0, var(--nav-width)) minmax(${MINIMUM_CONTENT_WIDTH_PX}px, 1fr) minmax(0, var(--right-panel-width))`,
4571
+ gridTemplateRows: "1fr minmax(0, var(--bottom-panel-height))",
4572
+ gridTemplateAreas: showPanel ? panelPosition === "right" ? `"sidebar content panel"
4580
4573
  "sidebar content panel"` : `"sidebar content content"
4581
4574
  "sidebar panel panel"` : `"sidebar content content"
4582
4575
  "sidebar content content"`
4583
- }
4584
- })
4585
- ), SidebarContainer = styled.div(({ theme }) => ({
4576
+ }
4577
+ })), SidebarContainer = styled.div(({ theme }) => ({
4586
4578
  backgroundColor: theme.appBg,
4587
4579
  gridArea: "sidebar",
4588
4580
  position: "relative",
@@ -4613,7 +4605,10 @@ var MINIMUM_CONTENT_WIDTH_PX = 100, layoutStateIsEqual = (state, other) => state
4613
4605
  position: "relative",
4614
4606
  backgroundColor: theme.appContentBg,
4615
4607
  borderTop: position === "bottom" ? `1px solid ${theme.appBorderColor}` : void 0,
4616
- borderLeft: position === "right" ? `1px solid ${theme.appBorderColor}` : void 0
4608
+ borderLeft: position === "right" ? `1px solid ${theme.appBorderColor}` : void 0,
4609
+ "& > aside": {
4610
+ overflow: "hidden"
4611
+ }
4617
4612
  })
4618
4613
  ), Drag = styled.div(
4619
4614
  ({ theme }) => ({
@@ -4630,12 +4625,12 @@ var MINIMUM_CONTENT_WIDTH_PX = 100, layoutStateIsEqual = (state, other) => state
4630
4625
  opacity: 1
4631
4626
  }
4632
4627
  }),
4633
- ({ orientation = "vertical", position = "left" }) => orientation === "vertical" ? {
4634
- width: position === "left" ? 10 : 13,
4628
+ ({ orientation = "vertical", overlapping = !0, position = "left" }) => orientation === "vertical" ? {
4629
+ width: overlapping ? position === "left" ? 10 : 13 : 7,
4635
4630
  height: "100%",
4636
4631
  top: 0,
4637
- right: position === "left" ? "-7px" : void 0,
4638
- left: position === "right" ? "-7px" : void 0,
4632
+ right: position === "left" ? -7 : void 0,
4633
+ left: position === "right" ? -7 : void 0,
4639
4634
  "&:after": {
4640
4635
  width: 1,
4641
4636
  height: "100%",
@@ -4646,8 +4641,8 @@ var MINIMUM_CONTENT_WIDTH_PX = 100, layoutStateIsEqual = (state, other) => state
4646
4641
  }
4647
4642
  } : {
4648
4643
  width: "100%",
4649
- height: "13px",
4650
- top: "-7px",
4644
+ height: overlapping ? 13 : 7,
4645
+ top: -7,
4651
4646
  left: 0,
4652
4647
  "&:after": {
4653
4648
  width: "100%",
@@ -5134,6 +5129,10 @@ var Wrapper = styled.div(
5134
5129
  outline: "none"
5135
5130
  }
5136
5131
  },
5132
+ "input + div": {
5133
+ paddingInline: 0,
5134
+ fontSize: "inherit"
5135
+ },
5137
5136
  "&:has(input:focus-visible)": {
5138
5137
  outline: `2px solid ${theme.color.secondary}`,
5139
5138
  outlineOffset: -2
@@ -5149,8 +5148,8 @@ var Wrapper = styled.div(
5149
5148
  setValue,
5150
5149
  minValue = -1 / 0,
5151
5150
  maxValue = 1 / 0,
5152
- unit,
5153
- baseUnit,
5151
+ unit: fixedUnit,
5152
+ baseUnit = fixedUnit,
5154
5153
  className,
5155
5154
  style,
5156
5155
  ...props
@@ -5161,14 +5160,14 @@ var Wrapper = styled.div(
5161
5160
  useImperativeHandle(forwardedRef, () => inputRef.current);
5162
5161
  let parseValue = useCallback(
5163
5162
  (value2) => {
5164
- let [, inputValue2, inputUnit = unit || baseUnit || ""] = value2.match(/(-?\d+(?:\.\d+)?)(\%|[a-z]{0,4})?$/) || [];
5165
- return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit: inputUnit };
5163
+ let [, inputValue2, unit = fixedUnit || baseUnit || ""] = value2.match(/(-?\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [];
5164
+ return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit };
5166
5165
  },
5167
- [minValue, maxValue, unit, baseUnit]
5166
+ [minValue, maxValue, fixedUnit, baseUnit]
5168
5167
  ), updateValue = useCallback(
5169
5168
  (value2) => {
5170
- let { number, unit: unit2 } = parseValue(value2);
5171
- Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${unit2 === baseUnit ? "" : unit2}`), setValue(`${number}${unit2}`));
5169
+ let { number, unit } = parseValue(value2);
5170
+ Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${unit === baseUnit ? "" : unit}`), setValue(`${number}${unit}`));
5172
5171
  },
5173
5172
  [parseValue, setValue, baseUnit]
5174
5173
  ), onChange = useCallback(
@@ -5190,8 +5189,8 @@ var Wrapper = styled.div(
5190
5189
  if (e2.key !== "ArrowUp" && e2.key !== "ArrowDown")
5191
5190
  return;
5192
5191
  e2.preventDefault();
5193
- let { number, unit: unit2 } = parseValue(inputValue);
5194
- Number.isNaN(number) || (updateValue(`${e2.key === "ArrowUp" ? number + 1 : number - 1}${unit2}`), setInputSelection());
5192
+ let { number, unit } = parseValue(inputValue);
5193
+ Number.isNaN(number) || (updateValue(`${e2.key === "ArrowUp" ? number + 1 : number - 1}${unit}`), setInputSelection());
5195
5194
  }, input = inputRef.current;
5196
5195
  if (input)
5197
5196
  return input.addEventListener("keydown", handleKeyDown), () => input.removeEventListener("keydown", handleKeyDown);
@@ -5202,6 +5201,7 @@ var Wrapper = styled.div(
5202
5201
  id,
5203
5202
  ref: inputRef,
5204
5203
  value: inputValue,
5204
+ suffix: fixedUnit || inputValue && baseUnit,
5205
5205
  onChange,
5206
5206
  onFocus: setInputSelection,
5207
5207
  onBlur: updateInputValue
@@ -5376,27 +5376,46 @@ var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({
5376
5376
  src,
5377
5377
  scale
5378
5378
  }) => {
5379
- let { width, height, isCustom, isDefault, lastSelectedOption, resize, rotate, select } = useViewport(), [dragging, setDragging] = useState("none"), targetRef = useRef(null), dragRefX = useRef(null), dragRefY = useRef(null), dragRefXY = useRef(null), dragSide = useRef("none"), dragStart = useRef();
5379
+ let { width, height, isCustom, isDefault, lastSelectedOption, resize, rotate, select } = useViewport(), [dragging, setDragging] = useState("none"), targetRef = useRef(null), dragRefX = useRef(null), dragRefY = useRef(null), dragRefXY = useRef(null), dragSide = useRef("none"), dragStart = useRef(), dragScrollTarget = useRef(null);
5380
5380
  useEffect(() => {
5381
- let scrollRight = targetRef.current?.querySelector('[data-edge="right"]'), scrollBottom = targetRef.current?.querySelector('[data-edge="bottom"]'), scrollBoth = targetRef.current?.querySelector('[data-edge="both"]'), onDrag = (e2) => {
5382
- (dragSide.current === "both" || dragSide.current === "right") && (targetRef.current.style.width = `${dragStart.current[0] + e2.clientX}px`, dragRefX.current.dataset.value = `${dragStart.current[0] + e2.clientX}`), (dragSide.current === "both" || dragSide.current === "bottom") && (targetRef.current.style.height = `${dragStart.current[1] + e2.clientY}px`, dragRefY.current.dataset.value = `${dragStart.current[1] + e2.clientY}`), dragSide.current === "both" && scrollBoth?.scrollIntoView({ block: "center", inline: "center" }), dragSide.current === "right" && scrollRight?.scrollIntoView({ block: "center", inline: "center" }), dragSide.current === "bottom" && scrollBottom?.scrollIntoView({ block: "center", inline: "center" });
5381
+ let onDrag = (e2) => {
5382
+ if (!(!targetRef.current || !dragStart.current)) {
5383
+ if (dragRefX.current && (dragSide.current === "both" || dragSide.current === "right")) {
5384
+ let newWidth = Math.max(VIEWPORT_MIN_WIDTH, dragStart.current[0] + e2.clientX);
5385
+ targetRef.current.style.width = `${newWidth}px`, dragRefX.current.dataset.value = `${Math.round(newWidth / scale)}`;
5386
+ }
5387
+ if (dragRefY.current && (dragSide.current === "both" || dragSide.current === "bottom")) {
5388
+ let newHeight = Math.max(VIEWPORT_MIN_HEIGHT, dragStart.current[1] + e2.clientY);
5389
+ targetRef.current.style.height = `${newHeight}px`, dragRefY.current.dataset.value = `${Math.round(newHeight / scale)}`;
5390
+ }
5391
+ dragScrollTarget.current && dragScrollTarget.current.scrollIntoView({ block: "center", inline: "center" });
5392
+ }
5383
5393
  }, onEnd = () => {
5384
- window.removeEventListener("mouseup", onEnd), window.removeEventListener("mousemove", onDrag), setDragging("none");
5385
- let { clientWidth, clientHeight } = targetRef.current, scale2 = Number(targetRef.current.dataset.scale) || 1;
5386
- resize(`${Math.round(clientWidth / scale2)}px`, `${Math.round(clientHeight / scale2)}px`), dragStart.current = void 0;
5394
+ if (window.removeEventListener("mouseup", onEnd), window.removeEventListener("mousemove", onDrag), setDragging("none"), dragStart.current = void 0, targetRef.current) {
5395
+ let { clientWidth, clientHeight, dataset } = targetRef.current, scale2 = Number(dataset.scale) || 1;
5396
+ resize(`${Math.round(clientWidth / scale2)}px`, `${Math.round(clientHeight / scale2)}px`);
5397
+ }
5387
5398
  }, onStart = (e2) => {
5388
5399
  e2.preventDefault(), window.addEventListener("mouseup", onEnd), window.addEventListener("mousemove", onDrag), dragSide.current = e2.currentTarget.dataset.side, dragStart.current = [
5389
5400
  (targetRef.current?.clientWidth ?? 0) - e2.clientX,
5390
5401
  (targetRef.current?.clientHeight ?? 0) - e2.clientY
5391
- ], setDragging(dragSide.current);
5402
+ ], dragScrollTarget.current = targetRef.current?.querySelector(
5403
+ `[data-edge="${dragSide.current}"]`
5404
+ ), setDragging(dragSide.current);
5392
5405
  }, handles = [dragRefX.current, dragRefY.current, dragRefXY.current];
5393
5406
  return handles.forEach((el) => el?.addEventListener("mousedown", onStart)), () => handles.forEach((el) => el?.removeEventListener("mousedown", onStart));
5394
- }, [resize]);
5395
- let frameStyles = useMemo(() => {
5396
- let { number: nx, unit: ux = "px" } = parseNumber(width) ?? { number: 0, unit: "px" }, { number: ny, unit: uy = "px" } = parseNumber(height) ?? { number: 0, unit: "px" };
5407
+ }, [resize, scale]);
5408
+ let dimensions = useMemo(() => {
5409
+ let { number: nx, unit: ux = "px" } = parseNumber(width) ?? { number: 0, unit: "px" }, { number: ny, unit: uy = "px" } = parseNumber(height) ?? { number: 0, unit: "px" }, frameWidth = Math.max(VIEWPORT_MIN_WIDTH, nx * scale), frameHeight = Math.max(VIEWPORT_MIN_HEIGHT, ny * scale);
5397
5410
  return {
5398
- width: `${nx * scale}${ux}`,
5399
- height: `${ny * scale}${uy}`
5411
+ frame: {
5412
+ width: `${frameWidth}${ux}`,
5413
+ height: `${frameHeight}${uy}`
5414
+ },
5415
+ display: {
5416
+ width: `${nx}${ux === "px" ? "" : ux}`,
5417
+ height: `${ny}${uy === "px" ? "" : uy}`
5418
+ }
5400
5419
  };
5401
5420
  }, [width, height, scale]);
5402
5421
  return react_default.createElement(ViewportWrapper, { key: id, active, isDefault }, !isDefault && react_default.createElement(ViewportControls, null, react_default.createElement(ViewportDimensions, null, react_default.createElement(
@@ -5447,7 +5466,7 @@ var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({
5447
5466
  isDefault,
5448
5467
  "data-dragging": dragging,
5449
5468
  "data-scale": scale,
5450
- style: isDefault ? { height: "100%", width: "100%" } : frameStyles,
5469
+ style: isDefault ? { height: "100%", width: "100%" } : dimensions.frame,
5451
5470
  ref: targetRef
5452
5471
  },
5453
5472
  react_default.createElement(
@@ -5469,7 +5488,7 @@ var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({
5469
5488
  ref: dragRefX,
5470
5489
  isDefault,
5471
5490
  "data-side": "right",
5472
- "data-value": width.replace("px", "")
5491
+ "data-value": dimensions.display.width
5473
5492
  }
5474
5493
  ),
5475
5494
  react_default.createElement(
@@ -5478,7 +5497,7 @@ var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({
5478
5497
  ref: dragRefY,
5479
5498
  isDefault,
5480
5499
  "data-side": "bottom",
5481
- "data-value": height.replace("px", "")
5500
+ "data-value": dimensions.display.height
5482
5501
  }
5483
5502
  ),
5484
5503
  react_default.createElement(DragHandle, { ref: dragRefXY, isDefault, "data-side": "both" })
@@ -11540,7 +11559,7 @@ var TourGuide = ({
11540
11559
  TourGuide.render = (props) => {
11541
11560
  let container = document.getElementById("storybook-tour");
11542
11561
  container || (container = document.createElement("div"), container.id = "storybook-tour", document.body.appendChild(container)), root = root ?? createRoot(container), root.render(
11543
- react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement(
11562
+ props ? react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement(
11544
11563
  TourGuide,
11545
11564
  {
11546
11565
  ...props,
@@ -11551,7 +11570,7 @@ TourGuide.render = (props) => {
11551
11570
  props.onDismiss?.(), root?.render(null), root = null;
11552
11571
  }
11553
11572
  }
11554
- ))
11573
+ )) : null
11555
11574
  );
11556
11575
  };
11557
11576
 
@@ -11918,9 +11937,9 @@ export default {
11918
11937
  after: ["installVitest"],
11919
11938
  label: "Test your components",
11920
11939
  criteria: "Component tests are run from the test widget in the sidebar",
11921
- subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange(
11922
- (state) => state["storybook/test"] === "test-provider-state:succeeded" && done()
11923
- ),
11940
+ subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange((state) => {
11941
+ state["storybook/test"] === "test-provider-state:running" && (TourGuide.render(null), done());
11942
+ }),
11924
11943
  action: {
11925
11944
  label: "Start",
11926
11945
  onClick: ({ api }) => {
@@ -18104,7 +18123,7 @@ var { document: document6 } = scope, DEFAULT_MAX_SEARCH_RESULTS = 50, options =
18104
18123
  query: input,
18105
18124
  results,
18106
18125
  isNavVisible: !isOpen && document6.activeElement !== inputRef.current,
18107
- isNavReachable: input.length === 0,
18126
+ isNavReachable: !isOpen || input.length === 0,
18108
18127
  isSearchResultRendered: isOpen,
18109
18128
  closeMenu,
18110
18129
  getMenuProps,
@@ -952,7 +952,7 @@ declare function useGlobals(): [
952
952
  storyGlobals: Globals,
953
953
  userGlobals: Globals
954
954
  ];
955
- declare function useGlobalTypes(): ArgTypes;
955
+ declare function useGlobalTypes(): GlobalTypes;
956
956
  declare function useArgTypes(): ArgTypes;
957
957
 
958
958
  declare const typesX: typeof Addon_TypesEnum;
@@ -3267,11 +3267,11 @@ declare const userSettingSchema: ZodObject<{
3267
3267
  mutedAt?: number | undefined;
3268
3268
  }>>;
3269
3269
  }, "strip", ZodTypeAny, {
3270
- autodocs?: {
3270
+ controls?: {
3271
3271
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3272
3272
  mutedAt?: number | undefined;
3273
3273
  } | undefined;
3274
- controls?: {
3274
+ autodocs?: {
3275
3275
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3276
3276
  mutedAt?: number | undefined;
3277
3277
  } | undefined;
@@ -3356,11 +3356,11 @@ declare const userSettingSchema: ZodObject<{
3356
3356
  mutedAt?: number | undefined;
3357
3357
  } | undefined;
3358
3358
  }, {
3359
- autodocs?: {
3359
+ controls?: {
3360
3360
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3361
3361
  mutedAt?: number | undefined;
3362
3362
  } | undefined;
3363
- controls?: {
3363
+ autodocs?: {
3364
3364
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3365
3365
  mutedAt?: number | undefined;
3366
3366
  } | undefined;
@@ -3454,11 +3454,11 @@ declare const userSettingSchema: ZodObject<{
3454
3454
  }>>;
3455
3455
  }, "strip", ZodTypeAny, {
3456
3456
  items?: {
3457
- autodocs?: {
3457
+ controls?: {
3458
3458
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3459
3459
  mutedAt?: number | undefined;
3460
3460
  } | undefined;
3461
- controls?: {
3461
+ autodocs?: {
3462
3462
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3463
3463
  mutedAt?: number | undefined;
3464
3464
  } | undefined;
@@ -3548,11 +3548,11 @@ declare const userSettingSchema: ZodObject<{
3548
3548
  } | undefined;
3549
3549
  }, {
3550
3550
  items?: {
3551
- autodocs?: {
3551
+ controls?: {
3552
3552
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3553
3553
  mutedAt?: number | undefined;
3554
3554
  } | undefined;
3555
- controls?: {
3555
+ autodocs?: {
3556
3556
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3557
3557
  mutedAt?: number | undefined;
3558
3558
  } | undefined;
@@ -3649,11 +3649,11 @@ declare const userSettingSchema: ZodObject<{
3649
3649
  userSince?: number | undefined;
3650
3650
  checklist?: {
3651
3651
  items?: {
3652
- autodocs?: {
3652
+ controls?: {
3653
3653
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3654
3654
  mutedAt?: number | undefined;
3655
3655
  } | undefined;
3656
- controls?: {
3656
+ autodocs?: {
3657
3657
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3658
3658
  mutedAt?: number | undefined;
3659
3659
  } | undefined;
@@ -3750,11 +3750,11 @@ declare const userSettingSchema: ZodObject<{
3750
3750
  userSince?: number | undefined;
3751
3751
  checklist?: {
3752
3752
  items?: {
3753
- autodocs?: {
3753
+ controls?: {
3754
3754
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3755
3755
  mutedAt?: number | undefined;
3756
3756
  } | undefined;
3757
- controls?: {
3757
+ autodocs?: {
3758
3758
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3759
3759
  mutedAt?: number | undefined;
3760
3760
  } | undefined;
@@ -2396,7 +2396,7 @@ import { global as global8 } from "@storybook/global";
2396
2396
  import semver from "semver";
2397
2397
 
2398
2398
  // src/manager-api/version.ts
2399
- var version = "10.2.0-beta.2";
2399
+ var version = "10.2.0-beta.4";
2400
2400
 
2401
2401
  // src/manager-api/modules/versions.ts
2402
2402
  var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_dxneh53ovgi from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_dxneh53ovgi from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_dxneh53ovgi from "node:module";
1
+ import CJS_COMPAT_NODE_URL_96u9uvlttj6 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_96u9uvlttj6 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_96u9uvlttj6 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_dxneh53ovgi.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_dxneh53ovgi.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_dxneh53ovgi.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_96u9uvlttj6.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_96u9uvlttj6.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_96u9uvlttj6.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -16,8 +16,8 @@ import {
16
16
  join,
17
17
  normalize,
18
18
  resolve
19
- } from "../_node-chunks/chunk-HODKH6S2.js";
20
- import "../_node-chunks/chunk-ZYMMEEUR.js";
19
+ } from "../_node-chunks/chunk-2MIIBCWO.js";
20
+ import "../_node-chunks/chunk-5BZY2EBX.js";
21
21
 
22
22
  // ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
23
23
  var comma = 44, semicolon = 59, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);