@repobuddy/storybook 2.0.1 → 2.1.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.
Files changed (103) hide show
  1. package/esm/index.d.ts +574 -13
  2. package/esm/index.js +491 -12
  3. package/esm/manager/index.d.ts +38 -1
  4. package/esm/manager/index.js +32 -1
  5. package/esm/storybook-addon-tag-badges/index.d.ts +95 -2
  6. package/esm/storybook-addon-tag-badges/index.js +207 -1
  7. package/esm/storybook-dark-mode/index.d.ts +110 -3
  8. package/esm/storybook-dark-mode/index.js +342 -3
  9. package/package.json +4 -12
  10. package/cjs/components/show_html.d.ts +0 -16
  11. package/cjs/components/show_html.js +0 -29
  12. package/cjs/decorators/show_doc_source.d.ts +0 -6
  13. package/cjs/decorators/show_doc_source.js +0 -38
  14. package/cjs/index.d.ts +0 -13
  15. package/cjs/index.js +0 -137
  16. package/cjs/manager/brand_title.d.ts +0 -35
  17. package/cjs/manager/brand_title.js +0 -12
  18. package/cjs/manager/index.d.ts +0 -1
  19. package/cjs/manager/index.js +0 -16
  20. package/cjs/parameters/define_actions_param.d.ts +0 -24
  21. package/cjs/parameters/define_actions_param.js +0 -11
  22. package/cjs/parameters/define_backgrounds_param.d.ts +0 -45
  23. package/cjs/parameters/define_backgrounds_param.js +0 -10
  24. package/cjs/parameters/define_docs_param.d.ts +0 -217
  25. package/cjs/parameters/define_docs_param.js +0 -11
  26. package/cjs/parameters/define_layout_param.d.ts +0 -20
  27. package/cjs/parameters/define_layout_param.js +0 -10
  28. package/cjs/parameters/define_parameters.d.ts +0 -39
  29. package/cjs/parameters/define_parameters.js +0 -9
  30. package/cjs/parameters/define_test_param.d.ts +0 -34
  31. package/cjs/parameters/define_test_param.js +0 -11
  32. package/cjs/parameters/define_viewport_param.d.ts +0 -78
  33. package/cjs/parameters/define_viewport_param.js +0 -11
  34. package/cjs/parameters/story_sort.d.ts +0 -27
  35. package/cjs/parameters/story_sort.js +0 -1
  36. package/cjs/storybook-addon-tag-badges/index.d.ts +0 -2
  37. package/cjs/storybook-addon-tag-badges/index.js +0 -16
  38. package/cjs/storybook-addon-tag-badges/tag_badges.d.ts +0 -41
  39. package/cjs/storybook-addon-tag-badges/tag_badges.js +0 -179
  40. package/cjs/storybook-addon-tag-badges/types.d.ts +0 -9
  41. package/cjs/storybook-addon-tag-badges/types.js +0 -1
  42. package/cjs/storybook-dark-mode/dark_mode_docs_container.d.ts +0 -26
  43. package/cjs/storybook-dark-mode/dark_mode_docs_container.js +0 -23
  44. package/cjs/storybook-dark-mode/define_dark_mode.d.ts +0 -54
  45. package/cjs/storybook-dark-mode/define_dark_mode.js +0 -11
  46. package/cjs/storybook-dark-mode/index.d.ts +0 -3
  47. package/cjs/storybook-dark-mode/index.js +0 -38
  48. package/cjs/storybook-dark-mode/with_dark_mode.d.ts +0 -22
  49. package/cjs/storybook-dark-mode/with_dark_mode.js +0 -54
  50. package/cjs/testing/decorators/when_running_in_test.d.ts +0 -5
  51. package/cjs/testing/decorators/when_running_in_test.js +0 -12
  52. package/cjs/testing/decorators/when_running_in_text.ctx.d.ts +0 -3
  53. package/cjs/testing/decorators/when_running_in_text.ctx.js +0 -10
  54. package/cjs/types.d.ts +0 -41
  55. package/cjs/types.js +0 -1
  56. package/cjs/variants/index.d.ts +0 -1
  57. package/cjs/variants/index.js +0 -8
  58. package/cjs/variants/package.json +0 -3
  59. package/cjs/variants/preset.d.ts +0 -11
  60. package/cjs/variants/preset.js +0 -3
  61. package/esm/components/show_html.d.ts +0 -16
  62. package/esm/components/show_html.js +0 -19
  63. package/esm/decorators/show_doc_source.d.ts +0 -6
  64. package/esm/decorators/show_doc_source.js +0 -28
  65. package/esm/manager/brand_title.d.ts +0 -35
  66. package/esm/manager/brand_title.js +0 -6
  67. package/esm/parameters/define_actions_param.d.ts +0 -24
  68. package/esm/parameters/define_actions_param.js +0 -3
  69. package/esm/parameters/define_backgrounds_param.d.ts +0 -45
  70. package/esm/parameters/define_backgrounds_param.js +0 -3
  71. package/esm/parameters/define_docs_param.d.ts +0 -217
  72. package/esm/parameters/define_docs_param.js +0 -3
  73. package/esm/parameters/define_layout_param.d.ts +0 -20
  74. package/esm/parameters/define_layout_param.js +0 -3
  75. package/esm/parameters/define_parameters.d.ts +0 -39
  76. package/esm/parameters/define_parameters.js +0 -3
  77. package/esm/parameters/define_test_param.d.ts +0 -34
  78. package/esm/parameters/define_test_param.js +0 -3
  79. package/esm/parameters/define_viewport_param.d.ts +0 -78
  80. package/esm/parameters/define_viewport_param.js +0 -3
  81. package/esm/parameters/story_sort.d.ts +0 -27
  82. package/esm/parameters/story_sort.js +0 -0
  83. package/esm/storybook-addon-tag-badges/tag_badges.d.ts +0 -41
  84. package/esm/storybook-addon-tag-badges/tag_badges.js +0 -189
  85. package/esm/storybook-addon-tag-badges/types.d.ts +0 -9
  86. package/esm/storybook-addon-tag-badges/types.js +0 -0
  87. package/esm/storybook-dark-mode/dark_mode_docs_container.d.ts +0 -26
  88. package/esm/storybook-dark-mode/dark_mode_docs_container.js +0 -21
  89. package/esm/storybook-dark-mode/define_dark_mode.d.ts +0 -54
  90. package/esm/storybook-dark-mode/define_dark_mode.js +0 -3
  91. package/esm/storybook-dark-mode/with_dark_mode.d.ts +0 -22
  92. package/esm/storybook-dark-mode/with_dark_mode.js +0 -46
  93. package/esm/testing/decorators/when_running_in_test.d.ts +0 -5
  94. package/esm/testing/decorators/when_running_in_test.js +0 -6
  95. package/esm/testing/decorators/when_running_in_text.ctx.d.ts +0 -3
  96. package/esm/testing/decorators/when_running_in_text.ctx.js +0 -4
  97. package/esm/types.d.ts +0 -41
  98. package/esm/types.js +0 -0
  99. package/esm/variants/index.d.ts +0 -1
  100. package/esm/variants/index.js +0 -2
  101. package/esm/variants/package.json +0 -3
  102. package/esm/variants/preset.d.ts +0 -11
  103. package/esm/variants/preset.js +0 -1
@@ -1 +1,207 @@
1
- export * from "./tag_badges.js";
1
+ import { defaultConfig } from "storybook-addon-tag-badges/manager-helpers";
2
+
3
+ //#region src/storybook-addon-tag-badges/tag_badges.ts
4
+ const [, , , , , , versionBadge] = defaultConfig;
5
+ /**
6
+ * Configuration for story tag badges that appear in the Storybook sidebar.
7
+ * Each badge is associated with a specific tag and displays an emoji with a tooltip.
8
+ *
9
+ * The badges help visually identify stories with certain characteristics:
10
+ * - ✏️ Editor - Stories with live editor
11
+ * - 🆕 New - Recently added stories
12
+ * - 🅱️ Beta - Stories for features in beta
13
+ * - 🪦 Deprecated - Stories for deprecated features
14
+ * - ⚠️ Outdated - Stories that need updating
15
+ * - 🚨 Danger - Stories demonstrating dangerous patterns
16
+ * - 📋 Todo - Stories marked as todo/incomplete
17
+ * - 📝 Code Only - Stories without visual examples
18
+ * - 📸 Snapshot - Stories with snapshot tests
19
+ * - 🧪 Unit - Stories with unit tests
20
+ * - 🔗 Integration - Stories with integration tests
21
+ *
22
+ * Also includes the default version badge from `storybook-addon-tag-badges`.
23
+ */
24
+ const editorBadge = {
25
+ tags: "editor",
26
+ badge: {
27
+ text: "✏️",
28
+ style: {
29
+ backgroundColor: "transparent",
30
+ borderColor: "transparent"
31
+ },
32
+ tooltip: "Editor"
33
+ },
34
+ display: { sidebar: {
35
+ type: "story",
36
+ skipInherited: false
37
+ } }
38
+ };
39
+ const newBadge = {
40
+ tags: "new",
41
+ badge: {
42
+ text: "🆕",
43
+ style: {
44
+ backgroundColor: "transparent",
45
+ borderColor: "transparent"
46
+ },
47
+ tooltip: "New"
48
+ }
49
+ };
50
+ const betaBadge = {
51
+ tags: "beta",
52
+ badge: {
53
+ text: "🅱️",
54
+ style: {
55
+ backgroundColor: "transparent",
56
+ borderColor: "transparent"
57
+ },
58
+ tooltip: "Beta"
59
+ }
60
+ };
61
+ const propsBadge = {
62
+ tags: "props",
63
+ badge: {
64
+ text: "🔧",
65
+ style: {
66
+ backgroundColor: "transparent",
67
+ borderColor: "transparent"
68
+ },
69
+ tooltip: "Props"
70
+ }
71
+ };
72
+ const deprecatedBadge = {
73
+ tags: "deprecated",
74
+ badge: {
75
+ text: "🪦",
76
+ style: {
77
+ backgroundColor: "transparent",
78
+ borderColor: "transparent"
79
+ },
80
+ tooltip: "Deprecated"
81
+ }
82
+ };
83
+ const outdatedBadge = {
84
+ tags: "outdated",
85
+ badge: {
86
+ text: "⚠️",
87
+ style: {
88
+ backgroundColor: "transparent",
89
+ borderColor: "transparent"
90
+ },
91
+ tooltip: "Outdated"
92
+ }
93
+ };
94
+ const dangerBadge = {
95
+ tags: "danger",
96
+ badge: {
97
+ text: "🚨",
98
+ style: {
99
+ backgroundColor: "transparent",
100
+ borderColor: "transparent"
101
+ },
102
+ tooltip: "Dangerous"
103
+ }
104
+ };
105
+ const todoBadge = {
106
+ tags: "todo",
107
+ badge: {
108
+ text: "📋",
109
+ style: {
110
+ backgroundColor: "transparent",
111
+ borderColor: "transparent"
112
+ },
113
+ tooltip: "Todo"
114
+ }
115
+ };
116
+ const codeOnlyBadge = {
117
+ tags: "code-only",
118
+ badge: {
119
+ text: "📝",
120
+ style: {
121
+ backgroundColor: "transparent",
122
+ borderColor: "transparent"
123
+ },
124
+ tooltip: "Code Only"
125
+ }
126
+ };
127
+ const snapshotBadge = {
128
+ tags: "snapshot",
129
+ badge: {
130
+ text: "📸",
131
+ style: {
132
+ backgroundColor: "transparent",
133
+ borderColor: "transparent"
134
+ },
135
+ tooltip: "Snapshot Test"
136
+ },
137
+ display: {
138
+ sidebar: false,
139
+ toolbar: ["story"]
140
+ }
141
+ };
142
+ const unitBadge = {
143
+ tags: "unit",
144
+ badge: {
145
+ text: "🧪",
146
+ style: {
147
+ backgroundColor: "transparent",
148
+ borderColor: "transparent"
149
+ },
150
+ tooltip: "Unit Test"
151
+ },
152
+ display: { sidebar: false }
153
+ };
154
+ const integrationBadge = {
155
+ tags: "integration",
156
+ badge: {
157
+ text: "🔗",
158
+ style: {
159
+ backgroundColor: "transparent",
160
+ borderColor: "transparent"
161
+ },
162
+ tooltip: "Integration Test"
163
+ },
164
+ display: { sidebar: false }
165
+ };
166
+ const keyboardBadge = {
167
+ tags: "keyboard",
168
+ badge: {
169
+ text: "⌨️",
170
+ style: {
171
+ backgroundColor: "transparent",
172
+ borderColor: "transparent"
173
+ },
174
+ tooltip: "Keyboard Interaction"
175
+ }
176
+ };
177
+ const internalBadge = {
178
+ tags: "internal",
179
+ badge: {
180
+ text: "🔒",
181
+ style: {
182
+ backgroundColor: "transparent",
183
+ borderColor: "transparent"
184
+ },
185
+ tooltip: "Internal"
186
+ }
187
+ };
188
+ const tagBadges = [
189
+ editorBadge,
190
+ unitBadge,
191
+ integrationBadge,
192
+ keyboardBadge,
193
+ newBadge,
194
+ betaBadge,
195
+ deprecatedBadge,
196
+ outdatedBadge,
197
+ dangerBadge,
198
+ propsBadge,
199
+ todoBadge,
200
+ codeOnlyBadge,
201
+ internalBadge,
202
+ snapshotBadge,
203
+ versionBadge
204
+ ];
205
+
206
+ //#endregion
207
+ export { betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, propsBadge, snapshotBadge, tagBadges, todoBadge, unitBadge };
@@ -1,3 +1,110 @@
1
- export * from './dark_mode_docs_container.js';
2
- export * from './define_dark_mode.js';
3
- export * from './with_dark_mode.js';
1
+ import { DocsContextProps } from "@storybook/addon-docs/blocks";
2
+ import { PropsWithChildren } from "react";
3
+ import { ThemeVars } from "storybook/theming";
4
+ import { CSSProperties } from "@just-web/css";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+ import { DecoratorFunction } from "storybook/internal/types";
7
+
8
+ //#region src/storybook-dark-mode/dark_mode_docs_container.d.ts
9
+
10
+ /**
11
+ * Creates a `DocsContainer` for `storybook` that works with `@storybook-community/storybook-dark-mode`.
12
+ *
13
+ * @see https://github.com/hipstersmoothie/storybook-dark-mode/issues/282
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // .storybook/preview.tsx
18
+ * const preview: Preview = {
19
+ * parameters: {
20
+ * docs: {
21
+ * container: createDarkModeDocsContainer()
22
+ * }
23
+ * }
24
+ * }
25
+ * ```
26
+ */
27
+ declare function createDarkModeDocsContainer(customThemes?: {
28
+ light?: ThemeVars | undefined;
29
+ dark?: ThemeVars | undefined;
30
+ } | undefined): (props: PropsWithChildren<{
31
+ context: DocsContextProps;
32
+ }>) => react_jsx_runtime0.JSX.Element;
33
+ //#endregion
34
+ //#region src/storybook-dark-mode/define_dark_mode.d.ts
35
+ /**
36
+ * Configuration parameters for `@storybook-community/storybook-dark-mode`.
37
+ */
38
+ interface DarkModeParam {
39
+ /** The current theme ('dark' or 'light') */
40
+ current?: 'dark' | 'light' | undefined;
41
+ /**
42
+ * CSS class(es) to apply in dark mode.
43
+ */
44
+ darkClass?: string | string[] | undefined;
45
+ /**
46
+ * CSS style(s) to apply in dark mode.
47
+ *
48
+ * This only works when using `withStoryRoot`.
49
+ */
50
+ darkStyle?: CSSProperties | undefined;
51
+ /** CSS class(es) to apply in light mode */
52
+ lightClass?: string | string[] | undefined;
53
+ /**
54
+ * CSS style(s) to apply in light mode.
55
+ *
56
+ * This only works when using `withStoryRoot`.
57
+ */
58
+ lightStyle?: CSSProperties | undefined;
59
+ /** Dark theme variables */
60
+ dark?: ThemeVars;
61
+ /** Light theme variables */
62
+ light?: ThemeVars;
63
+ /** Element to apply theme classes to ('html' or 'body') */
64
+ classTarget?: 'html' | 'body' | undefined;
65
+ /** Whether to apply theme styles to preview iframe */
66
+ stylePreview?: boolean | undefined;
67
+ }
68
+ /**
69
+ * Defines `@storybook-community/storybook-dark-mode` parameters for Storybook stories.
70
+ *
71
+ * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode
72
+ * @returns An object containing the dark mode parameter configuration
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * // ./storybook/preview.tsx
77
+ *
78
+ * export const preview = {
79
+ * parameters: {
80
+ * ...defineDarkModeParam({ darkClass: 'dark' })
81
+ * }
82
+ * }
83
+ */
84
+ declare function defineDarkModeParam(darkMode: DarkModeParam): {
85
+ darkMode: DarkModeParam;
86
+ };
87
+ //#endregion
88
+ //#region src/storybook-dark-mode/with_dark_mode.d.ts
89
+ /**
90
+ * Applies additional dark mode behavior.
91
+ *
92
+ * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode
93
+ * @returns A decorator function that applies additional dark mode behavior.
94
+ */
95
+ declare function withDarkMode(options?: {
96
+ /**
97
+ * CSS class(es) to apply to the body element.
98
+ *
99
+ * Useful when using Tailwind CSS and `classTarget: 'html'`
100
+ */
101
+ bodyClass?: string | string[] | undefined;
102
+ /**
103
+ * CSS style(s) to apply to the body element.
104
+ *
105
+ * Useful when using Tailwind CSS and `classTarget: 'html'`
106
+ */
107
+ bodyStyle?: CSSProperties | undefined;
108
+ } | undefined): DecoratorFunction<any, any>;
109
+ //#endregion
110
+ export { DarkModeParam, createDarkModeDocsContainer, defineDarkModeParam, withDarkMode };
@@ -1,3 +1,342 @@
1
- export * from "./dark_mode_docs_container.js";
2
- export * from "./define_dark_mode.js";
3
- export * from "./with_dark_mode.js";
1
+ import { DARK_MODE_EVENT_NAME, useDarkMode } from "@storybook-community/storybook-dark-mode";
2
+ import { DocsContainer } from "@storybook/addon-docs/blocks";
3
+ import { useEffect, useState } from "react";
4
+ import { themes } from "storybook/theming";
5
+ import { toDOMStyle } from "@just-web/css";
6
+
7
+ //#region rolldown:runtime
8
+ var __create = Object.create;
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12
+ var __getProtoOf = Object.getPrototypeOf;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __commonJS = (cb, mod) => function() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) {
22
+ __defProp(to, key, {
23
+ get: ((k) => from[k]).bind(null, key),
24
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
+ });
26
+ }
27
+ }
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
32
+ value: mod,
33
+ enumerable: true
34
+ }) : target, mod));
35
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
36
+ if (typeof require !== "undefined") return require.apply(this, arguments);
37
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
38
+ });
39
+
40
+ //#endregion
41
+ //#region ../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js
42
+ /**
43
+ * @license React
44
+ * react-jsx-runtime.development.js
45
+ *
46
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */
51
+ var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js": ((exports) => {
52
+ (function() {
53
+ function getComponentNameFromType(type) {
54
+ if (null == type) return null;
55
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
56
+ if ("string" === typeof type) return type;
57
+ switch (type) {
58
+ case REACT_FRAGMENT_TYPE: return "Fragment";
59
+ case REACT_PROFILER_TYPE: return "Profiler";
60
+ case REACT_STRICT_MODE_TYPE: return "StrictMode";
61
+ case REACT_SUSPENSE_TYPE: return "Suspense";
62
+ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
63
+ case REACT_ACTIVITY_TYPE: return "Activity";
64
+ }
65
+ if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
66
+ case REACT_PORTAL_TYPE: return "Portal";
67
+ case REACT_CONTEXT_TYPE: return type.displayName || "Context";
68
+ case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
69
+ case REACT_FORWARD_REF_TYPE:
70
+ var innerType = type.render;
71
+ type = type.displayName;
72
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
73
+ return type;
74
+ case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
75
+ case REACT_LAZY_TYPE:
76
+ innerType = type._payload;
77
+ type = type._init;
78
+ try {
79
+ return getComponentNameFromType(type(innerType));
80
+ } catch (x) {}
81
+ }
82
+ return null;
83
+ }
84
+ function testStringCoercion(value) {
85
+ return "" + value;
86
+ }
87
+ function checkKeyStringCoercion(value) {
88
+ try {
89
+ testStringCoercion(value);
90
+ var JSCompiler_inline_result = !1;
91
+ } catch (e) {
92
+ JSCompiler_inline_result = !0;
93
+ }
94
+ if (JSCompiler_inline_result) {
95
+ JSCompiler_inline_result = console;
96
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
97
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
98
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
99
+ return testStringCoercion(value);
100
+ }
101
+ }
102
+ function getTaskName(type) {
103
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
104
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
105
+ try {
106
+ var name = getComponentNameFromType(type);
107
+ return name ? "<" + name + ">" : "<...>";
108
+ } catch (x) {
109
+ return "<...>";
110
+ }
111
+ }
112
+ function getOwner() {
113
+ var dispatcher = ReactSharedInternals.A;
114
+ return null === dispatcher ? null : dispatcher.getOwner();
115
+ }
116
+ function UnknownOwner() {
117
+ return Error("react-stack-top-frame");
118
+ }
119
+ function hasValidKey(config) {
120
+ if (hasOwnProperty.call(config, "key")) {
121
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
122
+ if (getter && getter.isReactWarning) return !1;
123
+ }
124
+ return void 0 !== config.key;
125
+ }
126
+ function defineKeyPropWarningGetter(props, displayName) {
127
+ function warnAboutAccessingKey() {
128
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
129
+ }
130
+ warnAboutAccessingKey.isReactWarning = !0;
131
+ Object.defineProperty(props, "key", {
132
+ get: warnAboutAccessingKey,
133
+ configurable: !0
134
+ });
135
+ }
136
+ function elementRefGetterWithDeprecationWarning() {
137
+ var componentName = getComponentNameFromType(this.type);
138
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
139
+ componentName = this.props.ref;
140
+ return void 0 !== componentName ? componentName : null;
141
+ }
142
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
143
+ var refProp = props.ref;
144
+ type = {
145
+ $$typeof: REACT_ELEMENT_TYPE,
146
+ type,
147
+ key,
148
+ props,
149
+ _owner: owner
150
+ };
151
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
152
+ enumerable: !1,
153
+ get: elementRefGetterWithDeprecationWarning
154
+ }) : Object.defineProperty(type, "ref", {
155
+ enumerable: !1,
156
+ value: null
157
+ });
158
+ type._store = {};
159
+ Object.defineProperty(type._store, "validated", {
160
+ configurable: !1,
161
+ enumerable: !1,
162
+ writable: !0,
163
+ value: 0
164
+ });
165
+ Object.defineProperty(type, "_debugInfo", {
166
+ configurable: !1,
167
+ enumerable: !1,
168
+ writable: !0,
169
+ value: null
170
+ });
171
+ Object.defineProperty(type, "_debugStack", {
172
+ configurable: !1,
173
+ enumerable: !1,
174
+ writable: !0,
175
+ value: debugStack
176
+ });
177
+ Object.defineProperty(type, "_debugTask", {
178
+ configurable: !1,
179
+ enumerable: !1,
180
+ writable: !0,
181
+ value: debugTask
182
+ });
183
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
184
+ return type;
185
+ }
186
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
187
+ var children = config.children;
188
+ if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
189
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
190
+ Object.freeze && Object.freeze(children);
191
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
192
+ else validateChildKeys(children);
193
+ if (hasOwnProperty.call(config, "key")) {
194
+ children = getComponentNameFromType(type);
195
+ var keys = Object.keys(config).filter(function(k) {
196
+ return "key" !== k;
197
+ });
198
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
199
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
200
+ }
201
+ children = null;
202
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
203
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
204
+ if ("key" in config) {
205
+ maybeKey = {};
206
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
207
+ } else maybeKey = config;
208
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
209
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
210
+ }
211
+ function validateChildKeys(node) {
212
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
213
+ }
214
+ function isValidElement(object) {
215
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
216
+ }
217
+ var React = __require("react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
218
+ return null;
219
+ };
220
+ React = { react_stack_bottom_frame: function(callStackForError) {
221
+ return callStackForError();
222
+ } };
223
+ var specialPropKeyWarningShown;
224
+ var didWarnAboutElementRef = {};
225
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
226
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
227
+ var didWarnAboutKeySpread = {};
228
+ exports.Fragment = REACT_FRAGMENT_TYPE;
229
+ exports.jsx = function(type, config, maybeKey) {
230
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
231
+ return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
232
+ };
233
+ exports.jsxs = function(type, config, maybeKey) {
234
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
235
+ return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
236
+ };
237
+ })();
238
+ }) });
239
+
240
+ //#endregion
241
+ //#region ../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js
242
+ var require_jsx_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js": ((exports, module) => {
243
+ module.exports = require_react_jsx_runtime_development();
244
+ }) });
245
+
246
+ //#endregion
247
+ //#region src/storybook-dark-mode/dark_mode_docs_container.tsx
248
+ var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
249
+ /**
250
+ * Creates a `DocsContainer` for `storybook` that works with `@storybook-community/storybook-dark-mode`.
251
+ *
252
+ * @see https://github.com/hipstersmoothie/storybook-dark-mode/issues/282
253
+ *
254
+ * @example
255
+ * ```ts
256
+ * // .storybook/preview.tsx
257
+ * const preview: Preview = {
258
+ * parameters: {
259
+ * docs: {
260
+ * container: createDarkModeDocsContainer()
261
+ * }
262
+ * }
263
+ * }
264
+ * ```
265
+ */
266
+ function createDarkModeDocsContainer(customThemes) {
267
+ return function DarkModeDocsContainer(props) {
268
+ const [isDark, setDark] = useState(true);
269
+ useEffect(() => {
270
+ props.context.channel.on(DARK_MODE_EVENT_NAME, setDark);
271
+ return () => props.context.channel.removeListener(DARK_MODE_EVENT_NAME, setDark);
272
+ }, [props.context.channel]);
273
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DocsContainer, {
274
+ ...props,
275
+ theme: isDark ? customThemes?.dark ?? themes.dark : customThemes?.light ?? themes.light,
276
+ children: props.children
277
+ });
278
+ };
279
+ }
280
+
281
+ //#endregion
282
+ //#region src/storybook-dark-mode/define_dark_mode.ts
283
+ /**
284
+ * Defines `@storybook-community/storybook-dark-mode` parameters for Storybook stories.
285
+ *
286
+ * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode
287
+ * @returns An object containing the dark mode parameter configuration
288
+ *
289
+ * @example
290
+ * ```ts
291
+ * // ./storybook/preview.tsx
292
+ *
293
+ * export const preview = {
294
+ * parameters: {
295
+ * ...defineDarkModeParam({ darkClass: 'dark' })
296
+ * }
297
+ * }
298
+ */
299
+ function defineDarkModeParam(darkMode) {
300
+ return { darkMode };
301
+ }
302
+
303
+ //#endregion
304
+ //#region src/storybook-dark-mode/with_dark_mode.tsx
305
+ /**
306
+ * Applies additional dark mode behavior.
307
+ *
308
+ * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode
309
+ * @returns A decorator function that applies additional dark mode behavior.
310
+ */
311
+ function withDarkMode(options) {
312
+ return function darkModeDecorator(Story, { parameters }) {
313
+ const darkMode = parameters.darkMode;
314
+ if (!darkMode) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Story, {});
315
+ const dark = useDarkMode();
316
+ const target = darkMode.classTarget === "html" ? document.documentElement : document.body;
317
+ if (dark) {
318
+ removeStyle(target, darkMode.lightStyle);
319
+ addStyle(target, darkMode.darkStyle);
320
+ } else {
321
+ removeStyle(target, darkMode.darkStyle);
322
+ addStyle(target, darkMode.lightStyle);
323
+ }
324
+ if (options?.bodyClass) addClass(document.body, options.bodyClass);
325
+ if (options?.bodyStyle) addStyle(document.body, options.bodyStyle);
326
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Story, {});
327
+ };
328
+ }
329
+ function addClass(target, className) {
330
+ if (!className) return;
331
+ if (typeof className === "string") target.classList.add(...className.split(" "));
332
+ else if (Array.isArray(className)) target.classList.add(...className);
333
+ }
334
+ function addStyle(target, style) {
335
+ if (style) for (const [key, value] of Object.entries(toDOMStyle(style))) target.style.setProperty(key, value);
336
+ }
337
+ function removeStyle(target, style) {
338
+ if (style) for (const key of Object.keys(toDOMStyle(style))) target.style.removeProperty(key);
339
+ }
340
+
341
+ //#endregion
342
+ export { createDarkModeDocsContainer, defineDarkModeParam, withDarkMode };