@storybook/addon-docs 10.5.0-alpha.1 → 10.5.0-alpha.10

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.
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getControlId
3
- } from "./chunk-S2IHWCOG.js";
3
+ } from "./chunk-QQBDHPVZ.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __toESM
7
- } from "./chunk-SL3VIQZ3.js";
7
+ } from "./chunk-UAWMPV5J.js";
8
8
 
9
9
  // ../../../node_modules/color-name/index.js
10
10
  var require_color_name = __commonJS({
@@ -610,7 +610,7 @@ function partialImpl(func, placeholder, ...partialArgs) {
610
610
  };
611
611
  return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
612
612
  }
613
- var placeholderSymbol = Symbol("partial.placeholder");
613
+ var placeholderSymbol = /* @__PURE__ */ Symbol("partial.placeholder");
614
614
  partial.placeholder = placeholderSymbol;
615
615
 
616
616
  // ../../../node_modules/es-toolkit/dist/function/partialRight.mjs
@@ -624,7 +624,7 @@ function partialRightImpl(func, placeholder, ...partialArgs) {
624
624
  };
625
625
  return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
626
626
  }
627
- var placeholderSymbol2 = Symbol("partialRight.placeholder");
627
+ var placeholderSymbol2 = /* @__PURE__ */ Symbol("partialRight.placeholder");
628
628
  partialRight.placeholder = placeholderSymbol2;
629
629
 
630
630
  // ../../../node_modules/es-toolkit/dist/function/retry.mjs
@@ -1021,6 +1021,7 @@ var Wrapper = styled.div({
1021
1021
  }, ColorControl = ({
1022
1022
  name,
1023
1023
  storyId,
1024
+ controlsId,
1024
1025
  value: initialValue,
1025
1026
  onChange,
1026
1027
  onFocus,
@@ -1028,12 +1029,13 @@ var Wrapper = styled.div({
1028
1029
  presetColors,
1029
1030
  maxPresetColors,
1030
1031
  startOpen = !1,
1031
- argType
1032
+ argType,
1033
+ required
1032
1034
  }) => {
1033
1035
  let debouncedOnChange = useCallback(debounce(onChange, 200), [onChange]), { value, realValue, updateValue, color, colorSpace, cycleColorSpace } = useColorInput(
1034
1036
  initialValue,
1035
1037
  debouncedOnChange
1036
- ), { presets, addPreset } = usePresets(presetColors ?? [], color, colorSpace, maxPresetColors), Picker = ColorPicker[colorSpace], readOnly = !!argType?.table?.readonly, controlId = getControlId(name, storyId);
1038
+ ), { presets, addPreset } = usePresets(presetColors ?? [], color, colorSpace, maxPresetColors), Picker = ColorPicker[colorSpace], readOnly = !!argType?.table?.readonly, controlId = getControlId(name, storyId, controlsId);
1037
1039
  return React.createElement(Wrapper, null, React.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React.createElement(
1038
1040
  Input,
1039
1041
  {
@@ -1042,6 +1044,7 @@ var Wrapper = styled.div({
1042
1044
  onChange: (e2) => updateValue(e2.target.value),
1043
1045
  onFocus: (e2) => e2.target.select(),
1044
1046
  readOnly,
1047
+ "aria-required": required || void 0,
1045
1048
  placeholder: "Choose color..."
1046
1049
  }
1047
1050
  ), React.createElement(
@@ -2,7 +2,7 @@ import {
2
2
  DocsRenderer,
3
3
  defaultComponents
4
4
  } from "./chunk-OATZR77O.js";
5
- import "./chunk-SL3VIQZ3.js";
5
+ import "./chunk-UAWMPV5J.js";
6
6
  export {
7
7
  DocsRenderer,
8
8
  defaultComponents
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./chunk-SL3VIQZ3.js";
3
+ } from "./chunk-UAWMPV5J.js";
4
4
 
5
5
  // src/preview.ts
6
6
  var preview_exports = {};
@@ -16,7 +16,7 @@ var excludeTags = Object.entries(globalThis.TAGS_OPTIONS ?? {}).reduce(
16
16
  ), parameters = {
17
17
  docs: {
18
18
  renderer: async () => {
19
- let { DocsRenderer } = await import("./DocsRenderer-LL677BLK.js");
19
+ let { DocsRenderer } = await import("./DocsRenderer-JROSPFPF.js");
20
20
  return new DocsRenderer();
21
21
  },
22
22
  stories: {
@@ -0,0 +1,13 @@
1
+ // src/blocks/controls/helpers.ts
2
+ var getControlId = (value, storyId, controlsId) => {
3
+ let base = value.replace(/\s+/g, "-"), parts = ["control"];
4
+ return controlsId && parts.push(controlsId), storyId && parts.push(storyId), parts.push(base), parts.join("-");
5
+ }, getControlSetterButtonId = (value, storyId, controlsId) => {
6
+ let base = value.replace(/\s+/g, "-"), parts = ["set"];
7
+ return controlsId && parts.push(controlsId), storyId && parts.push(storyId), parts.push(base), parts.join("-");
8
+ };
9
+
10
+ export {
11
+ getControlId,
12
+ getControlSetterButtonId
13
+ };
@@ -4,7 +4,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __commonJS = (cb, mod) => function() {
7
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ try {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ } catch (e) {
10
+ throw mod = 0, e;
11
+ }
8
12
  };
9
13
  var __export = (target, all) => {
10
14
  for (var name in all)