@repobuddy/storybook 2.15.0 → 2.17.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.js CHANGED
@@ -93,11 +93,11 @@ function generateKey(prefix) {
93
93
  }
94
94
 
95
95
  //#endregion
96
- //#region src/contexts/story_card_registry_context.tsx
96
+ //#region src/contexts/_story_card_registry_context.tsx
97
97
  const StoryCardRegistryContext = createContext(null);
98
98
 
99
99
  //#endregion
100
- //#region src/contexts/story_card_scope.tsx
100
+ //#region src/contexts/_story_card_scope.tsx
101
101
  /**
102
102
  * Ensures a story-card collection scope: creates the root container when no context exists,
103
103
  * otherwise renders the collector so this card participates in the existing scope.
@@ -8,26 +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 = 'editor' | 'source' | 'type' | 'new' | 'beta' | 'props' | 'deprecated' | 'outdated' | 'danger' | 'todo' | 'code-only' | 'snapshot' | 'unit' | 'integration' | 'keyboard' | 'internal' | 'usecase' | 'version:next';
12
- /**
13
- * Configuration for story tag badges that appear in the Storybook sidebar.
14
- * Each badge is associated with a specific tag and displays an emoji with a tooltip.
15
- *
16
- * The badges help visually identify stories with certain characteristics:
17
- * - ✏️ Editor - Stories with live editor
18
- * - 🆕 New - Recently added stories
19
- * - 🅱️ Beta - Stories for features in beta
20
- * - 🪦 Deprecated - Stories for deprecated features
21
- * - ⚠️ Outdated - Stories that need updating
22
- * - 🚨 Danger - Stories demonstrating dangerous patterns
23
- * - 📋 Todo - Stories marked as todo/incomplete
24
- * - 📝 Code Only - Stories without visual examples
25
- * - 📸 Snapshot - Stories with snapshot tests
26
- * - 🧪 Unit - Stories with unit tests
27
- * - 🔗 Integration - Stories with integration tests
28
- *
29
- * Also includes the default version badge from `storybook-addon-tag-badges`.
30
- */
11
+ type TagNames = 'editor' | 'source' | 'type' | 'func' | 'var' | 'new' | 'beta' | 'props' | 'deprecated' | 'outdated' | 'danger' | 'todo' | 'code-only' | 'snapshot' | 'unit' | 'integration' | 'keyboard' | 'internal' | 'usecase' | 'use-case' | 'version:next';
31
12
  /** Badge (✏️) for stories with a live editor. Shown in sidebar on story and inherited. */
32
13
  declare const editorBadge: TagBadgeParameter;
33
14
  /** Badge (🆕) for recently added stories. */
@@ -48,6 +29,10 @@ declare const todoBadge: TagBadgeParameter;
48
29
  declare const codeOnlyBadge: TagBadgeParameter;
49
30
  /** Badge (<T>) for stories that showcase or document TypeScript types. Hidden in MDX. */
50
31
  declare const typeBadge: TagBadgeParameter;
32
+ /** Badge (ƒ(x)) for stories that showcase or document functions. Hidden in MDX. */
33
+ declare const functionBadge: TagBadgeParameter;
34
+ /** Badge (var) for stories that describe values and variables. */
35
+ declare const varBadge: TagBadgeParameter;
51
36
  /** Badge (`</>`) for source-code-focused stories. Hidden in MDX. */
52
37
  declare const sourceBadge: TagBadgeParameter;
53
38
  /** Badge (📸) for stories with snapshot tests. Shown in toolbar only, not in sidebar. */
@@ -60,7 +45,32 @@ declare const integrationBadge: TagBadgeParameter;
60
45
  declare const keyboardBadge: TagBadgeParameter;
61
46
  /** Badge (🔒) for internal or private-use-only stories. */
62
47
  declare const internalBadge: TagBadgeParameter;
63
- /** Ordered list of all tag badge configs used by the addon (includes version badge). */
48
+ /**
49
+ * Configuration for story tag badges that appear in the Storybook sidebar.
50
+ * Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
51
+ *
52
+ * The badges help visually identify stories with certain characteristics:
53
+ * - 🆕 New - Recently added stories
54
+ * - 🅱️ Beta - Stories for features in beta
55
+ * - 🪦 Deprecated - Stories for deprecated features
56
+ * - ⚠️ Outdated - Stories that need updating
57
+ * - ✏️ Editor - Stories with live editor
58
+ * - 🧪 Unit - Stories with unit tests
59
+ * - 🔗 Integration - Stories with integration tests
60
+ * - ⌨️ Keyboard - Stories that demonstrate or test keyboard interaction
61
+ * - 🚨 Danger - Stories demonstrating dangerous patterns
62
+ * - `</>` Source - Source-code-focused stories
63
+ * - `<T>` Type - Stories that showcase or document TypeScript types
64
+ * - `ƒ(x)` Function - Stories that showcase or document functions
65
+ * - `var` Variables - Stories that describe values and variables
66
+ * - 🔧 Props - Stories that demonstrate props or configuration
67
+ * - 📝 Code Only - Stories without visual examples
68
+ * - 📋 Todo - Stories marked as todo/incomplete
69
+ * - `next` - (`version:next`) The component or function is available in the next version
70
+ * - `x.y` - (`version:x.y`) The component or function was created or updated in the x.y version
71
+ * - 🔒 Internal - Internal or private-use-only stories
72
+ * - 📸 Snapshot - Stories with snapshot tests
73
+ */
64
74
  declare const tagBadges: TagBadgeParameters;
65
75
  //#endregion
66
76
  //#region src/types/_extract_string_literals.d.ts
@@ -134,4 +144,4 @@ type StoryObj<TMetaOrCmpOrArgs = Args> = ExtendStoryObj<TMetaOrCmpOrArgs, StoryO
134
144
  tag: TagNames;
135
145
  }>;
136
146
  //#endregion
137
- export { Meta, StoryObj, TagNames, betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, propsBadge, snapshotBadge, sourceBadge, tagBadges, todoBadge, typeBadge, unitBadge };
147
+ export { Meta, StoryObj, TagNames, betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, propsBadge, snapshotBadge, sourceBadge, tagBadges, todoBadge, typeBadge, unitBadge, varBadge };
@@ -3,25 +3,6 @@ import { defaultConfig } from "storybook-addon-tag-badges/manager-helpers";
3
3
 
4
4
  //#region src/storybook-addon-tag-badges/tag_badges.ts
5
5
  const [, , , , , , versionBadge] = defaultConfig;
6
- /**
7
- * Configuration for story tag badges that appear in the Storybook sidebar.
8
- * Each badge is associated with a specific tag and displays an emoji with a tooltip.
9
- *
10
- * The badges help visually identify stories with certain characteristics:
11
- * - ✏️ Editor - Stories with live editor
12
- * - 🆕 New - Recently added stories
13
- * - 🅱️ Beta - Stories for features in beta
14
- * - 🪦 Deprecated - Stories for deprecated features
15
- * - ⚠️ Outdated - Stories that need updating
16
- * - 🚨 Danger - Stories demonstrating dangerous patterns
17
- * - 📋 Todo - Stories marked as todo/incomplete
18
- * - 📝 Code Only - Stories without visual examples
19
- * - 📸 Snapshot - Stories with snapshot tests
20
- * - 🧪 Unit - Stories with unit tests
21
- * - 🔗 Integration - Stories with integration tests
22
- *
23
- * Also includes the default version badge from `storybook-addon-tag-badges`.
24
- */
25
6
  /** Badge (✏️) for stories with a live editor. Shown in sidebar on story and inherited. */
26
7
  const editorBadge = {
27
8
  tags: "editor",
@@ -146,7 +127,33 @@ const typeBadge = {
146
127
  },
147
128
  tooltip: "TypeScript Types"
148
129
  },
149
- display: { mdx: false }
130
+ display: { mdx: true }
131
+ };
132
+ /** Badge (ƒ(x)) for stories that showcase or document functions. Hidden in MDX. */
133
+ const functionBadge = {
134
+ tags: "func",
135
+ badge: {
136
+ text: "ƒ(x)",
137
+ style: {
138
+ backgroundColor: "transparent",
139
+ borderColor: "transparent"
140
+ },
141
+ tooltip: "Function"
142
+ },
143
+ display: { mdx: true }
144
+ };
145
+ /** Badge (var) for stories that describe values and variables. */
146
+ const varBadge = {
147
+ tags: "var",
148
+ badge: {
149
+ text: "var",
150
+ style: {
151
+ backgroundColor: "transparent",
152
+ borderColor: "transparent"
153
+ },
154
+ tooltip: "Variables"
155
+ },
156
+ display: { mdx: true }
150
157
  };
151
158
  /** Badge (`</>`) for source-code-focused stories. Hidden in MDX. */
152
159
  const sourceBadge = {
@@ -227,26 +234,53 @@ const internalBadge = {
227
234
  tooltip: "Internal"
228
235
  }
229
236
  };
230
- /** Ordered list of all tag badge configs used by the addon (includes version badge). */
237
+ /**
238
+ * Configuration for story tag badges that appear in the Storybook sidebar.
239
+ * Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
240
+ *
241
+ * The badges help visually identify stories with certain characteristics:
242
+ * - 🆕 New - Recently added stories
243
+ * - 🅱️ Beta - Stories for features in beta
244
+ * - 🪦 Deprecated - Stories for deprecated features
245
+ * - ⚠️ Outdated - Stories that need updating
246
+ * - ✏️ Editor - Stories with live editor
247
+ * - 🧪 Unit - Stories with unit tests
248
+ * - 🔗 Integration - Stories with integration tests
249
+ * - ⌨️ Keyboard - Stories that demonstrate or test keyboard interaction
250
+ * - 🚨 Danger - Stories demonstrating dangerous patterns
251
+ * - `</>` Source - Source-code-focused stories
252
+ * - `<T>` Type - Stories that showcase or document TypeScript types
253
+ * - `ƒ(x)` Function - Stories that showcase or document functions
254
+ * - `var` Variables - Stories that describe values and variables
255
+ * - 🔧 Props - Stories that demonstrate props or configuration
256
+ * - 📝 Code Only - Stories without visual examples
257
+ * - 📋 Todo - Stories marked as todo/incomplete
258
+ * - `next` - (`version:next`) The component or function is available in the next version
259
+ * - `x.y` - (`version:x.y`) The component or function was created or updated in the x.y version
260
+ * - 🔒 Internal - Internal or private-use-only stories
261
+ * - 📸 Snapshot - Stories with snapshot tests
262
+ */
231
263
  const tagBadges = [
232
- editorBadge,
233
- sourceBadge,
234
- typeBadge,
235
- unitBadge,
236
- integrationBadge,
237
- keyboardBadge,
238
264
  newBadge,
239
265
  betaBadge,
240
266
  deprecatedBadge,
241
267
  outdatedBadge,
268
+ editorBadge,
269
+ unitBadge,
270
+ integrationBadge,
271
+ keyboardBadge,
242
272
  dangerBadge,
273
+ sourceBadge,
274
+ typeBadge,
275
+ functionBadge,
276
+ varBadge,
243
277
  propsBadge,
244
- todoBadge,
245
278
  codeOnlyBadge,
279
+ todoBadge,
246
280
  versionBadge,
247
281
  internalBadge,
248
282
  snapshotBadge
249
283
  ];
250
284
 
251
285
  //#endregion
252
- export { betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, propsBadge, snapshotBadge, sourceBadge, tagBadges, todoBadge, typeBadge, unitBadge };
286
+ export { betaBadge, codeOnlyBadge, dangerBadge, deprecatedBadge, editorBadge, functionBadge, integrationBadge, internalBadge, keyboardBadge, newBadge, outdatedBadge, propsBadge, snapshotBadge, sourceBadge, tagBadges, todoBadge, typeBadge, unitBadge, varBadge };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobuddy/storybook",
3
- "version": "2.15.0",
3
+ "version": "2.17.0",
4
4
  "description": "Storybook repo buddy",
5
5
  "keywords": [
6
6
  "storybook",
@@ -5,7 +5,7 @@ import {
5
5
  type StoryCardEntry,
6
6
  StoryCardRegistryContext,
7
7
  type StoryCardRegistryContextValue
8
- } from './story_card_registry_context.js'
8
+ } from './_story_card_registry_context.js'
9
9
 
10
10
  export type StoryCardScopeProps = { Story: ComponentType } & StoryCardEntry
11
11
 
@@ -5,7 +5,7 @@ import { addons } from 'storybook/preview-api'
5
5
  import { convert, ThemeProvider, themes } from 'storybook/theming'
6
6
  import { twJoin } from 'tailwind-merge'
7
7
  import { StoryCard, type StoryCardProps } from '../components/story_card'
8
- import { StoryCardScope } from '../contexts/story_card_scope'
8
+ import { StoryCardScope } from '../contexts/_story_card_scope'
9
9
 
10
10
  const channel = addons.getChannel()
11
11
 
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react'
2
2
  import type { DecoratorFunction, Renderer } from 'storybook/internal/csf'
3
3
  import type { StoryCardProps, StoryCardStatus } from '../components/story_card.js'
4
- import { StoryCardScope } from '../contexts/story_card_scope.js'
4
+ import { StoryCardScope } from '../contexts/_story_card_scope.js'
5
5
  import type { StoryCardParam } from '../parameters/define_story_card_param.js'
6
6
 
7
7
  export type WithStoryCardProps = Omit<StoryCardProps, 'children' | 'className'> & {
@@ -11,6 +11,8 @@ export type TagNames =
11
11
  | 'editor'
12
12
  | 'source'
13
13
  | 'type'
14
+ | 'func'
15
+ | 'var'
14
16
  | 'new'
15
17
  | 'beta'
16
18
  | 'props'
@@ -25,28 +27,9 @@ export type TagNames =
25
27
  | 'keyboard'
26
28
  | 'internal'
27
29
  | 'usecase'
30
+ | 'use-case'
28
31
  | 'version:next'
29
32
 
30
- /**
31
- * Configuration for story tag badges that appear in the Storybook sidebar.
32
- * Each badge is associated with a specific tag and displays an emoji with a tooltip.
33
- *
34
- * The badges help visually identify stories with certain characteristics:
35
- * - ✏️ Editor - Stories with live editor
36
- * - 🆕 New - Recently added stories
37
- * - 🅱️ Beta - Stories for features in beta
38
- * - 🪦 Deprecated - Stories for deprecated features
39
- * - ⚠️ Outdated - Stories that need updating
40
- * - 🚨 Danger - Stories demonstrating dangerous patterns
41
- * - 📋 Todo - Stories marked as todo/incomplete
42
- * - 📝 Code Only - Stories without visual examples
43
- * - 📸 Snapshot - Stories with snapshot tests
44
- * - 🧪 Unit - Stories with unit tests
45
- * - 🔗 Integration - Stories with integration tests
46
- *
47
- * Also includes the default version badge from `storybook-addon-tag-badges`.
48
- */
49
-
50
33
  /** Badge (✏️) for stories with a live editor. Shown in sidebar on story and inherited. */
51
34
  export const editorBadge: TagBadgeParameter = {
52
35
  tags: 'editor',
@@ -185,7 +168,39 @@ export const typeBadge: TagBadgeParameter = {
185
168
  tooltip: 'TypeScript Types'
186
169
  },
187
170
  display: {
188
- mdx: false
171
+ mdx: true
172
+ }
173
+ }
174
+
175
+ /** Badge (ƒ(x)) for stories that showcase or document functions. Hidden in MDX. */
176
+ export const functionBadge: TagBadgeParameter = {
177
+ tags: 'func',
178
+ badge: {
179
+ text: 'ƒ(x)',
180
+ style: {
181
+ backgroundColor: 'transparent',
182
+ borderColor: 'transparent'
183
+ },
184
+ tooltip: 'Function'
185
+ },
186
+ display: {
187
+ mdx: true
188
+ }
189
+ }
190
+
191
+ /** Badge (var) for stories that describe values and variables. */
192
+ export const varBadge: TagBadgeParameter = {
193
+ tags: 'var',
194
+ badge: {
195
+ text: 'var',
196
+ style: {
197
+ backgroundColor: 'transparent',
198
+ borderColor: 'transparent'
199
+ },
200
+ tooltip: 'Variables'
201
+ },
202
+ display: {
203
+ mdx: true
189
204
  }
190
205
  }
191
206
 
@@ -280,22 +295,49 @@ export const internalBadge: TagBadgeParameter = {
280
295
  }
281
296
  }
282
297
 
283
- /** Ordered list of all tag badge configs used by the addon (includes version badge). */
298
+ /**
299
+ * Configuration for story tag badges that appear in the Storybook sidebar.
300
+ * Each badge is associated with a specific tag and displays an emoji or symbol with a tooltip.
301
+ *
302
+ * The badges help visually identify stories with certain characteristics:
303
+ * - 🆕 New - Recently added stories
304
+ * - 🅱️ Beta - Stories for features in beta
305
+ * - 🪦 Deprecated - Stories for deprecated features
306
+ * - ⚠️ Outdated - Stories that need updating
307
+ * - ✏️ Editor - Stories with live editor
308
+ * - 🧪 Unit - Stories with unit tests
309
+ * - 🔗 Integration - Stories with integration tests
310
+ * - ⌨️ Keyboard - Stories that demonstrate or test keyboard interaction
311
+ * - 🚨 Danger - Stories demonstrating dangerous patterns
312
+ * - `</>` Source - Source-code-focused stories
313
+ * - `<T>` Type - Stories that showcase or document TypeScript types
314
+ * - `ƒ(x)` Function - Stories that showcase or document functions
315
+ * - `var` Variables - Stories that describe values and variables
316
+ * - 🔧 Props - Stories that demonstrate props or configuration
317
+ * - 📝 Code Only - Stories without visual examples
318
+ * - 📋 Todo - Stories marked as todo/incomplete
319
+ * - `next` - (`version:next`) The component or function is available in the next version
320
+ * - `x.y` - (`version:x.y`) The component or function was created or updated in the x.y version
321
+ * - 🔒 Internal - Internal or private-use-only stories
322
+ * - 📸 Snapshot - Stories with snapshot tests
323
+ */
284
324
  export const tagBadges: TagBadgeParameters = [
285
- editorBadge,
286
- sourceBadge,
287
- typeBadge,
288
- unitBadge,
289
- integrationBadge,
290
- keyboardBadge,
291
325
  newBadge,
292
326
  betaBadge,
293
327
  deprecatedBadge,
294
328
  outdatedBadge,
329
+ editorBadge,
330
+ unitBadge,
331
+ integrationBadge,
332
+ keyboardBadge,
295
333
  dangerBadge,
334
+ sourceBadge,
335
+ typeBadge,
336
+ functionBadge,
337
+ varBadge,
296
338
  propsBadge,
297
- todoBadge,
298
339
  codeOnlyBadge,
340
+ todoBadge,
299
341
  versionBadge,
300
342
  internalBadge,
301
343
  snapshotBadge