@repobuddy/storybook 2.26.0 โ 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +11 -4
- package/esm/index.js +2 -22
- package/esm/manager/index.js +1 -2
- package/esm/storybook-addon-tag-badges/index.d.ts +11 -5
- package/esm/storybook-addon-tag-badges/index.js +72 -27
- package/esm/storybook-dark-mode/index.d.ts +2 -2
- package/esm/storybook-dark-mode/index.js +1 -5
- package/package.json +6 -6
- package/readme.md +2 -0
- package/src/storybook-addon-tag-badges/tag_badges.ts +68 -30
- package/styles.css +1 -1
package/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { UserConfig } from "htmlfy";
|
|
3
|
-
import * as react from "react";
|
|
3
|
+
import * as _$react from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
import { AnyFunction, CreateTuple, IsStringLiteral, Properties, Tail } from "type-plus";
|
|
7
7
|
import { ClassNameProps, StyleProps } from "@just-web/css";
|
|
8
8
|
import { Args, DecoratorFunction, Renderer } from "storybook/internal/csf";
|
|
@@ -39,7 +39,7 @@ declare function ShowHtml({
|
|
|
39
39
|
selector,
|
|
40
40
|
config,
|
|
41
41
|
...props
|
|
42
|
-
}: ShowHtmlProps): react_jsx_runtime0.JSX.Element;
|
|
42
|
+
}: ShowHtmlProps): _$react_jsx_runtime0.JSX.Element;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/components/story_card.d.ts
|
|
45
45
|
/**
|
|
@@ -99,7 +99,14 @@ type StoryCardThemeState = Pick<StoryCardProps, 'status' | 'appearance'> & {
|
|
|
99
99
|
* @param props - StoryCard component props
|
|
100
100
|
* @returns A section element containing the card content
|
|
101
101
|
*/
|
|
102
|
-
declare const StoryCard: react.
|
|
102
|
+
declare const StoryCard: _$react.MemoExoticComponent<({
|
|
103
|
+
status,
|
|
104
|
+
appearance,
|
|
105
|
+
className,
|
|
106
|
+
children,
|
|
107
|
+
title,
|
|
108
|
+
...rest
|
|
109
|
+
}: StoryCardProps) => _$react_jsx_runtime0.JSX.Element>;
|
|
103
110
|
//#endregion
|
|
104
111
|
//#region src/decorators/show_source.d.ts
|
|
105
112
|
/**
|
package/esm/index.js
CHANGED
|
@@ -8,9 +8,7 @@ import { twJoin, twMerge } from "tailwind-merge";
|
|
|
8
8
|
import { SyntaxHighlighter } from "storybook/internal/components";
|
|
9
9
|
import { addons } from "storybook/preview-api";
|
|
10
10
|
import { ThemeProvider, convert, themes } from "storybook/theming";
|
|
11
|
-
|
|
12
|
-
export * from "@repobuddy/test"
|
|
13
|
-
|
|
11
|
+
export * from "@repobuddy/test";
|
|
14
12
|
//#region src/components/show_html.tsx
|
|
15
13
|
/**
|
|
16
14
|
* A component that displays the HTML of a subject element.
|
|
@@ -36,7 +34,6 @@ function ShowHtml({ selector = "[data-testid=\"subject\"]", config, ...props })
|
|
|
36
34
|
children: html
|
|
37
35
|
});
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
//#endregion
|
|
41
38
|
//#region src/components/story_card.tsx
|
|
42
39
|
function resolveAppearance(appearance, status) {
|
|
@@ -79,7 +76,6 @@ const StoryCard = memo(function StoryCard({ status, appearance, className, child
|
|
|
79
76
|
}), children]
|
|
80
77
|
});
|
|
81
78
|
});
|
|
82
|
-
|
|
83
79
|
//#endregion
|
|
84
80
|
//#region src/utils/generate_key.ts
|
|
85
81
|
/**
|
|
@@ -92,11 +88,9 @@ function generateKey(prefix) {
|
|
|
92
88
|
const randomId = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
93
89
|
return prefix ? `${prefix}-${randomId}` : randomId;
|
|
94
90
|
}
|
|
95
|
-
|
|
96
91
|
//#endregion
|
|
97
92
|
//#region src/contexts/_story_card_registry_context.tsx
|
|
98
93
|
const StoryCardRegistryContext = createContext(null);
|
|
99
|
-
|
|
100
94
|
//#endregion
|
|
101
95
|
//#region src/contexts/_story_card_scope.tsx
|
|
102
96
|
/**
|
|
@@ -182,7 +176,6 @@ const StoryCardCollector = memo(function StoryCardCollector({ Story, title, stat
|
|
|
182
176
|
}, [context, entry]);
|
|
183
177
|
return /* @__PURE__ */ jsx(Story, {});
|
|
184
178
|
}, entryPropsEqual);
|
|
185
|
-
|
|
186
179
|
//#endregion
|
|
187
180
|
//#region src/decorators/show_source.tsx
|
|
188
181
|
const channel = addons.getChannel();
|
|
@@ -257,7 +250,6 @@ function showSource({ className, placement, showOriginalSource, source, ...optio
|
|
|
257
250
|
});
|
|
258
251
|
};
|
|
259
252
|
}
|
|
260
|
-
|
|
261
253
|
//#endregion
|
|
262
254
|
//#region src/decorators/show_doc_source.tsx
|
|
263
255
|
/**
|
|
@@ -274,7 +266,6 @@ function showDocSource(options) {
|
|
|
274
266
|
...options
|
|
275
267
|
});
|
|
276
268
|
}
|
|
277
|
-
|
|
278
269
|
//#endregion
|
|
279
270
|
//#region src/decorators/with_story_card.tsx
|
|
280
271
|
/**
|
|
@@ -379,7 +370,6 @@ function withStoryCard({ title, status, appearance, content: contentProp, classN
|
|
|
379
370
|
});
|
|
380
371
|
};
|
|
381
372
|
}
|
|
382
|
-
|
|
383
373
|
//#endregion
|
|
384
374
|
//#region src/parameters/define_actions_param.ts
|
|
385
375
|
/**
|
|
@@ -393,7 +383,6 @@ function withStoryCard({ title, status, appearance, content: contentProp, classN
|
|
|
393
383
|
function defineActionsParam(actions) {
|
|
394
384
|
return { actions };
|
|
395
385
|
}
|
|
396
|
-
|
|
397
386
|
//#endregion
|
|
398
387
|
//#region src/parameters/define_backgrounds_param.ts
|
|
399
388
|
/**
|
|
@@ -403,7 +392,6 @@ function defineActionsParam(actions) {
|
|
|
403
392
|
* @returns An object containing the backgrounds parameter configuration
|
|
404
393
|
*/
|
|
405
394
|
const defineBackgroundsParam = (backgrounds) => ({ backgrounds });
|
|
406
|
-
|
|
407
395
|
//#endregion
|
|
408
396
|
//#region src/parameters/define_docs_param.ts
|
|
409
397
|
/**
|
|
@@ -436,7 +424,6 @@ const defineBackgroundsParam = (backgrounds) => ({ backgrounds });
|
|
|
436
424
|
function defineDocsParam(docs) {
|
|
437
425
|
return { docs };
|
|
438
426
|
}
|
|
439
|
-
|
|
440
427
|
//#endregion
|
|
441
428
|
//#region src/parameters/define_layout_param.ts
|
|
442
429
|
/**
|
|
@@ -454,7 +441,6 @@ function defineDocsParam(docs) {
|
|
|
454
441
|
* ```
|
|
455
442
|
*/
|
|
456
443
|
const defineLayoutParam = (layout) => ({ layout });
|
|
457
|
-
|
|
458
444
|
//#endregion
|
|
459
445
|
//#region src/parameters/define_parameters.ts
|
|
460
446
|
/**
|
|
@@ -489,7 +475,6 @@ const defineLayoutParam = (layout) => ({ layout });
|
|
|
489
475
|
function defineParameters(param, ...rest) {
|
|
490
476
|
return rest.reduce((acc, param) => Object.assign(acc, param), param);
|
|
491
477
|
}
|
|
492
|
-
|
|
493
478
|
//#endregion
|
|
494
479
|
//#region src/parameters/define_story_card_param.ts
|
|
495
480
|
/**
|
|
@@ -537,7 +522,6 @@ function defineParameters(param, ...rest) {
|
|
|
537
522
|
function defineStoryCardParam(storyCard) {
|
|
538
523
|
return { storyCard };
|
|
539
524
|
}
|
|
540
|
-
|
|
541
525
|
//#endregion
|
|
542
526
|
//#region src/parameters/define_test_param.ts
|
|
543
527
|
/**
|
|
@@ -559,7 +543,6 @@ function defineStoryCardParam(storyCard) {
|
|
|
559
543
|
function defineTestParam(test) {
|
|
560
544
|
return { test };
|
|
561
545
|
}
|
|
562
|
-
|
|
563
546
|
//#endregion
|
|
564
547
|
//#region src/parameters/define_viewport_param.ts
|
|
565
548
|
/**
|
|
@@ -592,11 +575,9 @@ function defineTestParam(test) {
|
|
|
592
575
|
function defineViewportParam(viewport) {
|
|
593
576
|
return { viewport };
|
|
594
577
|
}
|
|
595
|
-
|
|
596
578
|
//#endregion
|
|
597
579
|
//#region src/testing/decorators/when_running_in_text.ctx.ts
|
|
598
580
|
const ctx = { isRunningInTest };
|
|
599
|
-
|
|
600
581
|
//#endregion
|
|
601
582
|
//#region src/testing/decorators/when_running_in_test.tsx
|
|
602
583
|
/**
|
|
@@ -607,6 +588,5 @@ function whenRunningInTest(decoratorOrHandler) {
|
|
|
607
588
|
return ctx.isRunningInTest() ? decoratorOrHandler(Story, context) ?? /* @__PURE__ */ jsx(Story, {}) : /* @__PURE__ */ jsx(Story, {});
|
|
608
589
|
};
|
|
609
590
|
}
|
|
610
|
-
|
|
611
591
|
//#endregion
|
|
612
|
-
export { ShowHtml, StoryCard, defineActionsParam, defineBackgroundsParam, defineDocsParam, defineLayoutParam, defineParameters, defineStoryCardParam, defineTestParam, defineViewportParam, showDocSource, showSource, whenRunningInTest, withStoryCard };
|
|
592
|
+
export { ShowHtml, StoryCard, defineActionsParam, defineBackgroundsParam, defineDocsParam, defineLayoutParam, defineParameters, defineStoryCardParam, defineTestParam, defineViewportParam, showDocSource, showSource, whenRunningInTest, withStoryCard };
|
package/esm/manager/index.js
CHANGED
|
@@ -8,7 +8,7 @@ type TagBadgeParameter = TagBadgeParameters[0];
|
|
|
8
8
|
/**
|
|
9
9
|
* Type representing the names of predefined tags used in Storybook stories.
|
|
10
10
|
*/
|
|
11
|
-
type TagNames = '!test' | 'editor' | 'source' | 'type' | '!type' | 'func' | '!func' | 'var' | '!var' | 'new' | 'a11y' | 'alpha' | 'beta' | 'rc' | 'props' | 'deprecated' | 'outdated' | 'danger' | 'todo' | 'code-only' | 'spec' | 'snapshot' | '!snapshot' | 'unit' | 'integration' | 'keyboard' | 'internal' | 'usecase' | 'use-case' | 'playground' | 'example' | 'perf' | 'version:next' | 'remove' | 'remove:next' | 'autodocs';
|
|
11
|
+
type TagNames = '!test' | 'editor' | 'source' | 'type' | '!type' | 'class' | '!class' | 'func' | '!func' | 'var' | '!var' | 'new' | 'a11y' | 'alpha' | 'beta' | 'bug' | 'rc' | 'props' | 'deprecated' | 'outdated' | 'danger' | 'todo' | 'code-only' | 'spec' | 'snapshot' | '!snapshot' | 'unit' | 'integration' | 'keyboard' | 'internal' | 'usecase' | 'use-case' | 'playground' | 'example' | 'perf' | 'version:next' | 'remove' | 'remove:next' | 'autodocs';
|
|
12
12
|
/** Badge (โ๏ธ) for stories with a live editor. Shown in sidebar on story and inherited. */
|
|
13
13
|
declare const editorBadge: TagBadgeParameter;
|
|
14
14
|
/** Badge (๐) for recently added stories. */
|
|
@@ -29,6 +29,8 @@ declare const removeBadge: TagBadgeParameter;
|
|
|
29
29
|
declare const outdatedBadge: TagBadgeParameter;
|
|
30
30
|
/** Badge (๐จ) for stories demonstrating dangerous or cautionary patterns. */
|
|
31
31
|
declare const dangerBadge: TagBadgeParameter;
|
|
32
|
+
/** Badge (๐) for stories that document or reproduce a known bug. */
|
|
33
|
+
declare const bugBadge: TagBadgeParameter;
|
|
32
34
|
/** Badge (๐) for stories that serve as the specification of the component or code. */
|
|
33
35
|
declare const specBadge: TagBadgeParameter;
|
|
34
36
|
/** Badge (๐) for stories marked as todo or incomplete. */
|
|
@@ -37,6 +39,8 @@ declare const todoBadge: TagBadgeParameter;
|
|
|
37
39
|
declare const codeOnlyBadge: TagBadgeParameter;
|
|
38
40
|
/** Badge (<T>) for stories that showcase or document TypeScript types. Hidden in MDX. */
|
|
39
41
|
declare const typeBadge: TagBadgeParameter;
|
|
42
|
+
/** Badge (๐ท) for stories that showcase or document classes. Hidden in MDX. */
|
|
43
|
+
declare const classBadge: TagBadgeParameter;
|
|
40
44
|
/** Badge (ฦ(x)) for stories that showcase or document functions. Hidden in MDX. */
|
|
41
45
|
declare const functionBadge: TagBadgeParameter;
|
|
42
46
|
/** Badge (var) for stories that describe values and variables. */
|
|
@@ -67,8 +71,8 @@ declare const perfBadge: TagBadgeParameter;
|
|
|
67
71
|
* Configuration for story tag badges that appear in the Storybook sidebar.
|
|
68
72
|
* Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
|
|
69
73
|
*
|
|
70
|
-
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Use Case โ
|
|
71
|
-
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Function โ Var โ Props โ Todo โ Unit โ
|
|
74
|
+
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Bug โ Use Case โ
|
|
75
|
+
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Class โ Function โ Var โ Props โ Todo โ Unit โ
|
|
72
76
|
* Integration โ Editor โ Code Only โ Version โ Internal โ Snapshot.
|
|
73
77
|
*
|
|
74
78
|
* - ๐ New - Recently added stories
|
|
@@ -79,6 +83,7 @@ declare const perfBadge: TagBadgeParameter;
|
|
|
79
83
|
* - โ ๏ธ Remove - (`remove` or `remove:next` = next release; `remove:<version>` = specific version) The feature or component will be removed in the specified version
|
|
80
84
|
* - โ ๏ธ Outdated - Stories that need updating
|
|
81
85
|
* - ๐จ Danger - Stories demonstrating dangerous patterns
|
|
86
|
+
* - ๐ Bug - Stories that document or reproduce a known bug
|
|
82
87
|
* - ๐ฏ Use Case - Stories that demonstrate a specific use case or scenario
|
|
83
88
|
* - ๐ Spec - Stories that serve as the specification of the component or code
|
|
84
89
|
* - โถ๏ธ Playground - High-quality interactive stories for users to explore and interact with the component
|
|
@@ -87,10 +92,11 @@ declare const perfBadge: TagBadgeParameter;
|
|
|
87
92
|
* - โฟ A11y - Stories that demonstrate or test accessibility
|
|
88
93
|
* - โจ๏ธ Keyboard - Stories that demonstrate or test keyboard interaction
|
|
89
94
|
* - `</>` Source - Source-code-focused stories
|
|
95
|
+
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
90
96
|
* - `<T>` Type - Stories that showcase or document TypeScript types
|
|
97
|
+
* - ๐ท Class - Stories that showcase or document classes
|
|
91
98
|
* - `ฦ(x)` Function - Stories that showcase or document functions
|
|
92
99
|
* - `var` Variables - Stories that describe values and variables
|
|
93
|
-
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
94
100
|
* - ๐ Todo - Stories marked as todo/incomplete
|
|
95
101
|
* - ๐งช Unit - Stories with unit tests
|
|
96
102
|
* - ๐ Integration - Stories with integration tests
|
|
@@ -174,4 +180,4 @@ type StoryObj<TMetaOrCmpOrArgs = Args> = ExtendStoryObj<TMetaOrCmpOrArgs, StoryO
|
|
|
174
180
|
tag: TagNames;
|
|
175
181
|
}>;
|
|
176
182
|
//#endregion
|
|
177
|
-
export { Meta, StoryObj, TagNames, a11yBadge, alphaBadge, betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, exampleBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, perfBadge, playgroundBadge, propsBadge, rcBadge, removeBadge, snapshotBadge, sourceBadge, specBadge, tagBadges, todoBadge, typeBadge, unitBadge, useCaseBadge, varBadge };
|
|
183
|
+
export { Meta, StoryObj, TagNames, a11yBadge, alphaBadge, betaBadge, bugBadge, classBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, exampleBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, perfBadge, playgroundBadge, propsBadge, rcBadge, removeBadge, snapshotBadge, sourceBadge, specBadge, tagBadges, todoBadge, typeBadge, unitBadge, useCaseBadge, varBadge };
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import { defaultConfig } from "storybook-addon-tag-badges/manager-helpers";
|
|
3
|
-
|
|
4
3
|
//#region src/storybook-addon-tag-badges/tag_badges.ts
|
|
5
4
|
const [, , , , , , versionBadge] = defaultConfig;
|
|
5
|
+
const componentDisplay = {
|
|
6
|
+
mdx: true,
|
|
7
|
+
sidebar: [{
|
|
8
|
+
type: "component",
|
|
9
|
+
skipInherited: false
|
|
10
|
+
}, {
|
|
11
|
+
type: "story",
|
|
12
|
+
skipInherited: false
|
|
13
|
+
}]
|
|
14
|
+
};
|
|
6
15
|
/** Badge (โ๏ธ) for stories with a live editor. Shown in sidebar on story and inherited. */
|
|
7
16
|
const editorBadge = {
|
|
8
17
|
tags: "editor",
|
|
@@ -144,6 +153,22 @@ const dangerBadge = {
|
|
|
144
153
|
tooltip: "Dangerous"
|
|
145
154
|
}
|
|
146
155
|
};
|
|
156
|
+
/** Badge (๐) for stories that document or reproduce a known bug. */
|
|
157
|
+
const bugBadge = {
|
|
158
|
+
tags: "bug",
|
|
159
|
+
badge: {
|
|
160
|
+
text: "๐",
|
|
161
|
+
style: {
|
|
162
|
+
backgroundColor: "transparent",
|
|
163
|
+
borderColor: "transparent"
|
|
164
|
+
},
|
|
165
|
+
tooltip: "Known bug"
|
|
166
|
+
},
|
|
167
|
+
display: { sidebar: {
|
|
168
|
+
type: "story",
|
|
169
|
+
skipInherited: false
|
|
170
|
+
} }
|
|
171
|
+
};
|
|
147
172
|
/** Badge (๐) for stories that serve as the specification of the component or code. */
|
|
148
173
|
const specBadge = {
|
|
149
174
|
tags: "spec",
|
|
@@ -196,7 +221,20 @@ const typeBadge = {
|
|
|
196
221
|
},
|
|
197
222
|
tooltip: "TypeScript Types"
|
|
198
223
|
},
|
|
199
|
-
display:
|
|
224
|
+
display: componentDisplay
|
|
225
|
+
};
|
|
226
|
+
/** Badge (๐ท) for stories that showcase or document classes. Hidden in MDX. */
|
|
227
|
+
const classBadge = {
|
|
228
|
+
tags: "class",
|
|
229
|
+
badge: {
|
|
230
|
+
text: "๐ท",
|
|
231
|
+
style: {
|
|
232
|
+
backgroundColor: "transparent",
|
|
233
|
+
borderColor: "transparent"
|
|
234
|
+
},
|
|
235
|
+
tooltip: "Class"
|
|
236
|
+
},
|
|
237
|
+
display: componentDisplay
|
|
200
238
|
};
|
|
201
239
|
/** Badge (ฦ(x)) for stories that showcase or document functions. Hidden in MDX. */
|
|
202
240
|
const functionBadge = {
|
|
@@ -209,7 +247,7 @@ const functionBadge = {
|
|
|
209
247
|
},
|
|
210
248
|
tooltip: "Function"
|
|
211
249
|
},
|
|
212
|
-
display:
|
|
250
|
+
display: componentDisplay
|
|
213
251
|
};
|
|
214
252
|
/** Badge (var) for stories that describe values and variables. */
|
|
215
253
|
const varBadge = {
|
|
@@ -222,7 +260,7 @@ const varBadge = {
|
|
|
222
260
|
},
|
|
223
261
|
tooltip: "Variables"
|
|
224
262
|
},
|
|
225
|
-
display:
|
|
263
|
+
display: componentDisplay
|
|
226
264
|
};
|
|
227
265
|
/** Badge (`</>`) for source-code-focused stories. Hidden in MDX. */
|
|
228
266
|
const sourceBadge = {
|
|
@@ -240,7 +278,8 @@ const sourceBadge = {
|
|
|
240
278
|
sidebar: {
|
|
241
279
|
type: "story",
|
|
242
280
|
skipInherited: false
|
|
243
|
-
}
|
|
281
|
+
},
|
|
282
|
+
toolbar: ["story"]
|
|
244
283
|
}
|
|
245
284
|
};
|
|
246
285
|
/** Badge (๐ธ) for stories with snapshot tests. Shown in toolbar only, not in sidebar. */
|
|
@@ -399,8 +438,8 @@ const perfBadge = {
|
|
|
399
438
|
* Configuration for story tag badges that appear in the Storybook sidebar.
|
|
400
439
|
* Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
|
|
401
440
|
*
|
|
402
|
-
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Use Case โ
|
|
403
|
-
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Function โ Var โ Props โ Todo โ Unit โ
|
|
441
|
+
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Bug โ Use Case โ
|
|
442
|
+
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Class โ Function โ Var โ Props โ Todo โ Unit โ
|
|
404
443
|
* Integration โ Editor โ Code Only โ Version โ Internal โ Snapshot.
|
|
405
444
|
*
|
|
406
445
|
* - ๐ New - Recently added stories
|
|
@@ -411,6 +450,7 @@ const perfBadge = {
|
|
|
411
450
|
* - โ ๏ธ Remove - (`remove` or `remove:next` = next release; `remove:<version>` = specific version) The feature or component will be removed in the specified version
|
|
412
451
|
* - โ ๏ธ Outdated - Stories that need updating
|
|
413
452
|
* - ๐จ Danger - Stories demonstrating dangerous patterns
|
|
453
|
+
* - ๐ Bug - Stories that document or reproduce a known bug
|
|
414
454
|
* - ๐ฏ Use Case - Stories that demonstrate a specific use case or scenario
|
|
415
455
|
* - ๐ Spec - Stories that serve as the specification of the component or code
|
|
416
456
|
* - โถ๏ธ Playground - High-quality interactive stories for users to explore and interact with the component
|
|
@@ -419,10 +459,11 @@ const perfBadge = {
|
|
|
419
459
|
* - โฟ A11y - Stories that demonstrate or test accessibility
|
|
420
460
|
* - โจ๏ธ Keyboard - Stories that demonstrate or test keyboard interaction
|
|
421
461
|
* - `</>` Source - Source-code-focused stories
|
|
462
|
+
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
422
463
|
* - `<T>` Type - Stories that showcase or document TypeScript types
|
|
464
|
+
* - ๐ท Class - Stories that showcase or document classes
|
|
423
465
|
* - `ฦ(x)` Function - Stories that showcase or document functions
|
|
424
466
|
* - `var` Variables - Stories that describe values and variables
|
|
425
|
-
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
426
467
|
* - ๐ Todo - Stories marked as todo/incomplete
|
|
427
468
|
* - ๐งช Unit - Stories with unit tests
|
|
428
469
|
* - ๐ Integration - Stories with integration tests
|
|
@@ -434,35 +475,39 @@ const perfBadge = {
|
|
|
434
475
|
* - ๐ธ Snapshot - Stories with snapshot tests
|
|
435
476
|
*/
|
|
436
477
|
const tagBadges = [
|
|
478
|
+
[bugBadge, todoBadge],
|
|
437
479
|
newBadge,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
480
|
+
[
|
|
481
|
+
alphaBadge,
|
|
482
|
+
betaBadge,
|
|
483
|
+
rcBadge
|
|
484
|
+
],
|
|
485
|
+
[
|
|
486
|
+
deprecatedBadge,
|
|
487
|
+
removeBadge,
|
|
488
|
+
outdatedBadge,
|
|
489
|
+
dangerBadge
|
|
490
|
+
],
|
|
445
491
|
useCaseBadge,
|
|
446
492
|
specBadge,
|
|
447
493
|
playgroundBadge,
|
|
448
494
|
exampleBadge,
|
|
449
495
|
perfBadge,
|
|
450
|
-
a11yBadge,
|
|
451
|
-
keyboardBadge,
|
|
452
496
|
sourceBadge,
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
497
|
+
[a11yBadge, keyboardBadge],
|
|
498
|
+
[
|
|
499
|
+
propsBadge,
|
|
500
|
+
typeBadge,
|
|
501
|
+
classBadge,
|
|
502
|
+
functionBadge,
|
|
503
|
+
varBadge
|
|
504
|
+
],
|
|
458
505
|
unitBadge,
|
|
459
506
|
integrationBadge,
|
|
460
507
|
editorBadge,
|
|
461
508
|
codeOnlyBadge,
|
|
462
509
|
versionBadge,
|
|
463
|
-
internalBadge,
|
|
464
|
-
|
|
465
|
-
];
|
|
466
|
-
|
|
510
|
+
[internalBadge, snapshotBadge]
|
|
511
|
+
].flat();
|
|
467
512
|
//#endregion
|
|
468
|
-
export { a11yBadge, alphaBadge, betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, exampleBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, perfBadge, playgroundBadge, propsBadge, rcBadge, removeBadge, snapshotBadge, sourceBadge, specBadge, tagBadges, todoBadge, typeBadge, unitBadge, useCaseBadge, varBadge };
|
|
513
|
+
export { a11yBadge, alphaBadge, betaBadge, bugBadge, classBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, exampleBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, perfBadge, playgroundBadge, propsBadge, rcBadge, removeBadge, snapshotBadge, sourceBadge, specBadge, tagBadges, todoBadge, typeBadge, unitBadge, useCaseBadge, varBadge };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DocsContextProps } from "@storybook/addon-docs/blocks";
|
|
3
3
|
import { PropsWithChildren } from "react";
|
|
4
4
|
import { ThemeVars } from "storybook/theming";
|
|
5
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
import { CSSProperties } from "@just-web/css";
|
|
7
7
|
import { DecoratorFunction } from "storybook/internal/types";
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ declare function createDarkModeDocsContainer(customThemes?: {
|
|
|
29
29
|
dark?: ThemeVars | undefined;
|
|
30
30
|
} | undefined): (props: PropsWithChildren<{
|
|
31
31
|
context: DocsContextProps;
|
|
32
|
-
}>) => react_jsx_runtime0.JSX.Element;
|
|
32
|
+
}>) => _$react_jsx_runtime0.JSX.Element;
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/storybook-dark-mode/define_dark_mode.d.ts
|
|
35
35
|
/**
|
|
@@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
|
|
|
5
5
|
import { themes } from "storybook/theming";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { toDOMStyle } from "@just-web/css";
|
|
8
|
-
|
|
9
8
|
//#region src/storybook-dark-mode/dark_mode_docs_container.tsx
|
|
10
9
|
/**
|
|
11
10
|
* Creates a `DocsContainer` for `storybook` that works with `@storybook-community/storybook-dark-mode`.
|
|
@@ -38,7 +37,6 @@ function createDarkModeDocsContainer(customThemes) {
|
|
|
38
37
|
});
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
//#endregion
|
|
43
41
|
//#region src/storybook-dark-mode/define_dark_mode.ts
|
|
44
42
|
/**
|
|
@@ -60,7 +58,6 @@ function createDarkModeDocsContainer(customThemes) {
|
|
|
60
58
|
function defineDarkModeParam(darkMode) {
|
|
61
59
|
return { darkMode };
|
|
62
60
|
}
|
|
63
|
-
|
|
64
61
|
//#endregion
|
|
65
62
|
//#region src/storybook-dark-mode/with_dark_mode.tsx
|
|
66
63
|
/**
|
|
@@ -98,6 +95,5 @@ function addStyle(target, style) {
|
|
|
98
95
|
function removeStyle(target, style) {
|
|
99
96
|
if (style) for (const key of Object.keys(toDOMStyle(style))) target.style.removeProperty(key);
|
|
100
97
|
}
|
|
101
|
-
|
|
102
98
|
//#endregion
|
|
103
|
-
export { createDarkModeDocsContainer, defineDarkModeParam, withDarkMode };
|
|
99
|
+
export { createDarkModeDocsContainer, defineDarkModeParam, withDarkMode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobuddy/storybook",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"description": "Storybook repo buddy",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"@repobuddy/vitest": "^2.1.1",
|
|
88
88
|
"@storybook-community/storybook-dark-mode": "^7.1.0",
|
|
89
89
|
"@storybook/addon-docs": "^10.2.8",
|
|
90
|
-
"@storybook/addon-vitest": "^10.
|
|
91
|
-
"@storybook/react-vite": "^10.
|
|
90
|
+
"@storybook/addon-vitest": "^10.3.3",
|
|
91
|
+
"@storybook/react-vite": "^10.3.3",
|
|
92
92
|
"@tailwindcss/cli": "^4.1.17",
|
|
93
93
|
"@tailwindcss/vite": "^4.1.17",
|
|
94
94
|
"@vitest/browser": "^4.0.16",
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"react": "^19.2.0",
|
|
100
100
|
"react-dom": "^19.2.0",
|
|
101
101
|
"rimraf": "^6.1.0",
|
|
102
|
-
"storybook": "^10.
|
|
102
|
+
"storybook": "^10.3.3",
|
|
103
103
|
"storybook-addon-code-editor": "^6.1.3",
|
|
104
104
|
"storybook-addon-tag-badges": "^3.0.6",
|
|
105
105
|
"storybook-addon-vis": "^3.1.2",
|
|
106
|
-
"tsdown": "^0.
|
|
107
|
-
"vite": "^
|
|
106
|
+
"tsdown": "^0.21.4",
|
|
107
|
+
"vite": "^8.0.0",
|
|
108
108
|
"vitest": "^4.0.16"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
package/readme.md
CHANGED
|
@@ -88,6 +88,7 @@ we provide a different set of badges that uses emojis (order: first match wins):
|
|
|
88
88
|
| โ ๏ธ | `remove`<br/>`remove:next` (same)<br/>`remove:<version>` | Will be removed in the next or specified version |
|
|
89
89
|
| โ ๏ธ | `outdated` | Stories that need updating |
|
|
90
90
|
| ๐จ | `danger` | Dangerous or cautionary patterns |
|
|
91
|
+
| ๐ | `bug` | Known bug (documents or reproduces the issue) |
|
|
91
92
|
| ๐ฏ | `use-case` | Specific use case or scenario |
|
|
92
93
|
| ๐ | `spec` | Specification of the component or code |
|
|
93
94
|
| โถ๏ธ | `playground` | High-quality interactive stories for users to explore and interact with the component |
|
|
@@ -97,6 +98,7 @@ we provide a different set of badges that uses emojis (order: first match wins):
|
|
|
97
98
|
| โจ๏ธ | `keyboard` | Keyboard interaction |
|
|
98
99
|
| `</>` | `source` | Source-code-focused stories |
|
|
99
100
|
| `<T>` | `type` | TypeScript types (shown in MDX) |
|
|
101
|
+
| ๐ท | `class` | Classes (shown in MDX) |
|
|
100
102
|
| `ฦ(x)` | `func` | Functions (shown in MDX) |
|
|
101
103
|
| `var` | `var` | Variables (shown in MDX) |
|
|
102
104
|
| ๐ง | `props` | Props or configuration |
|
|
@@ -4,6 +4,20 @@ const [, , , , , , versionBadge] = defaultConfig
|
|
|
4
4
|
|
|
5
5
|
type TagBadgeParameter = TagBadgeParameters[0]
|
|
6
6
|
|
|
7
|
+
const componentDisplay: TagBadgeParameter['display'] = {
|
|
8
|
+
mdx: true,
|
|
9
|
+
sidebar: [
|
|
10
|
+
{
|
|
11
|
+
type: 'component',
|
|
12
|
+
skipInherited: false
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: 'story',
|
|
16
|
+
skipInherited: false
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
/**
|
|
8
22
|
* Type representing the names of predefined tags used in Storybook stories.
|
|
9
23
|
*/
|
|
@@ -13,6 +27,8 @@ export type TagNames =
|
|
|
13
27
|
| 'source'
|
|
14
28
|
| 'type'
|
|
15
29
|
| '!type'
|
|
30
|
+
| 'class'
|
|
31
|
+
| '!class'
|
|
16
32
|
| 'func'
|
|
17
33
|
| '!func'
|
|
18
34
|
| 'var'
|
|
@@ -21,6 +37,7 @@ export type TagNames =
|
|
|
21
37
|
| 'a11y'
|
|
22
38
|
| 'alpha'
|
|
23
39
|
| 'beta'
|
|
40
|
+
| 'bug'
|
|
24
41
|
| 'rc'
|
|
25
42
|
| 'props'
|
|
26
43
|
| 'deprecated'
|
|
@@ -201,6 +218,25 @@ export const dangerBadge: TagBadgeParameter = {
|
|
|
201
218
|
}
|
|
202
219
|
}
|
|
203
220
|
|
|
221
|
+
/** Badge (๐) for stories that document or reproduce a known bug. */
|
|
222
|
+
export const bugBadge: TagBadgeParameter = {
|
|
223
|
+
tags: 'bug',
|
|
224
|
+
badge: {
|
|
225
|
+
text: '๐',
|
|
226
|
+
style: {
|
|
227
|
+
backgroundColor: 'transparent',
|
|
228
|
+
borderColor: 'transparent'
|
|
229
|
+
},
|
|
230
|
+
tooltip: 'Known bug'
|
|
231
|
+
},
|
|
232
|
+
display: {
|
|
233
|
+
sidebar: {
|
|
234
|
+
type: 'story',
|
|
235
|
+
skipInherited: false
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
204
240
|
/** Badge (๐) for stories that serve as the specification of the component or code. */
|
|
205
241
|
export const specBadge: TagBadgeParameter = {
|
|
206
242
|
tags: 'spec',
|
|
@@ -260,9 +296,21 @@ export const typeBadge: TagBadgeParameter = {
|
|
|
260
296
|
},
|
|
261
297
|
tooltip: 'TypeScript Types'
|
|
262
298
|
},
|
|
263
|
-
display:
|
|
264
|
-
|
|
265
|
-
|
|
299
|
+
display: componentDisplay
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Badge (๐ท) for stories that showcase or document classes. Hidden in MDX. */
|
|
303
|
+
export const classBadge: TagBadgeParameter = {
|
|
304
|
+
tags: 'class',
|
|
305
|
+
badge: {
|
|
306
|
+
text: '๐ท',
|
|
307
|
+
style: {
|
|
308
|
+
backgroundColor: 'transparent',
|
|
309
|
+
borderColor: 'transparent'
|
|
310
|
+
},
|
|
311
|
+
tooltip: 'Class'
|
|
312
|
+
},
|
|
313
|
+
display: componentDisplay
|
|
266
314
|
}
|
|
267
315
|
|
|
268
316
|
/** Badge (ฦ(x)) for stories that showcase or document functions. Hidden in MDX. */
|
|
@@ -276,9 +324,7 @@ export const functionBadge: TagBadgeParameter = {
|
|
|
276
324
|
},
|
|
277
325
|
tooltip: 'Function'
|
|
278
326
|
},
|
|
279
|
-
display:
|
|
280
|
-
mdx: true
|
|
281
|
-
}
|
|
327
|
+
display: componentDisplay
|
|
282
328
|
}
|
|
283
329
|
|
|
284
330
|
/** Badge (var) for stories that describe values and variables. */
|
|
@@ -292,9 +338,7 @@ export const varBadge: TagBadgeParameter = {
|
|
|
292
338
|
},
|
|
293
339
|
tooltip: 'Variables'
|
|
294
340
|
},
|
|
295
|
-
display:
|
|
296
|
-
mdx: true
|
|
297
|
-
}
|
|
341
|
+
display: componentDisplay
|
|
298
342
|
}
|
|
299
343
|
|
|
300
344
|
/** Badge (`</>`) for source-code-focused stories. Hidden in MDX. */
|
|
@@ -313,7 +357,8 @@ export const sourceBadge: TagBadgeParameter = {
|
|
|
313
357
|
sidebar: {
|
|
314
358
|
type: 'story',
|
|
315
359
|
skipInherited: false
|
|
316
|
-
}
|
|
360
|
+
},
|
|
361
|
+
toolbar: ['story']
|
|
317
362
|
}
|
|
318
363
|
}
|
|
319
364
|
|
|
@@ -497,8 +542,8 @@ export const perfBadge: TagBadgeParameter = {
|
|
|
497
542
|
* Configuration for story tag badges that appear in the Storybook sidebar.
|
|
498
543
|
* Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
|
|
499
544
|
*
|
|
500
|
-
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Use Case โ
|
|
501
|
-
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Function โ Var โ Props โ Todo โ Unit โ
|
|
545
|
+
* Badge order (first match wins): New โ Alpha โ Beta โ RC โ Deprecated โ Remove โ Outdated โ Danger โ Bug โ Use Case โ
|
|
546
|
+
* Spec โ Playground โ Example โ Perf โ A11y โ Keyboard โ Source โ Type โ Class โ Function โ Var โ Props โ Todo โ Unit โ
|
|
502
547
|
* Integration โ Editor โ Code Only โ Version โ Internal โ Snapshot.
|
|
503
548
|
*
|
|
504
549
|
* - ๐ New - Recently added stories
|
|
@@ -509,6 +554,7 @@ export const perfBadge: TagBadgeParameter = {
|
|
|
509
554
|
* - โ ๏ธ Remove - (`remove` or `remove:next` = next release; `remove:<version>` = specific version) The feature or component will be removed in the specified version
|
|
510
555
|
* - โ ๏ธ Outdated - Stories that need updating
|
|
511
556
|
* - ๐จ Danger - Stories demonstrating dangerous patterns
|
|
557
|
+
* - ๐ Bug - Stories that document or reproduce a known bug
|
|
512
558
|
* - ๐ฏ Use Case - Stories that demonstrate a specific use case or scenario
|
|
513
559
|
* - ๐ Spec - Stories that serve as the specification of the component or code
|
|
514
560
|
* - โถ๏ธ Playground - High-quality interactive stories for users to explore and interact with the component
|
|
@@ -517,10 +563,11 @@ export const perfBadge: TagBadgeParameter = {
|
|
|
517
563
|
* - โฟ A11y - Stories that demonstrate or test accessibility
|
|
518
564
|
* - โจ๏ธ Keyboard - Stories that demonstrate or test keyboard interaction
|
|
519
565
|
* - `</>` Source - Source-code-focused stories
|
|
566
|
+
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
520
567
|
* - `<T>` Type - Stories that showcase or document TypeScript types
|
|
568
|
+
* - ๐ท Class - Stories that showcase or document classes
|
|
521
569
|
* - `ฦ(x)` Function - Stories that showcase or document functions
|
|
522
570
|
* - `var` Variables - Stories that describe values and variables
|
|
523
|
-
* - ๐ง Props - Stories that demonstrate props or configuration
|
|
524
571
|
* - ๐ Todo - Stories marked as todo/incomplete
|
|
525
572
|
* - ๐งช Unit - Stories with unit tests
|
|
526
573
|
* - ๐ Integration - Stories with integration tests
|
|
@@ -532,32 +579,23 @@ export const perfBadge: TagBadgeParameter = {
|
|
|
532
579
|
* - ๐ธ Snapshot - Stories with snapshot tests
|
|
533
580
|
*/
|
|
534
581
|
export const tagBadges: TagBadgeParameters = [
|
|
582
|
+
// Story states
|
|
583
|
+
[bugBadge, todoBadge],
|
|
535
584
|
newBadge,
|
|
536
|
-
alphaBadge,
|
|
537
|
-
|
|
538
|
-
rcBadge,
|
|
539
|
-
deprecatedBadge,
|
|
540
|
-
removeBadge,
|
|
541
|
-
outdatedBadge,
|
|
542
|
-
dangerBadge,
|
|
585
|
+
[alphaBadge, betaBadge, rcBadge],
|
|
586
|
+
[deprecatedBadge, removeBadge, outdatedBadge, dangerBadge],
|
|
543
587
|
useCaseBadge,
|
|
544
588
|
specBadge,
|
|
545
589
|
playgroundBadge,
|
|
546
590
|
exampleBadge,
|
|
547
591
|
perfBadge,
|
|
548
|
-
a11yBadge,
|
|
549
|
-
keyboardBadge,
|
|
550
592
|
sourceBadge,
|
|
551
|
-
|
|
552
|
-
functionBadge,
|
|
553
|
-
varBadge,
|
|
554
|
-
propsBadge,
|
|
555
|
-
todoBadge,
|
|
593
|
+
[a11yBadge, keyboardBadge],
|
|
594
|
+
[propsBadge, typeBadge, classBadge, functionBadge, varBadge],
|
|
556
595
|
unitBadge,
|
|
557
596
|
integrationBadge,
|
|
558
597
|
editorBadge,
|
|
559
598
|
codeOnlyBadge,
|
|
560
599
|
versionBadge,
|
|
561
|
-
internalBadge,
|
|
562
|
-
|
|
563
|
-
]
|
|
600
|
+
[internalBadge, snapshotBadge]
|
|
601
|
+
].flat()
|
package/styles.css
CHANGED