Skip to content

Commit 229383a

Browse files
Fix: Minor Storybook docs fixes, and add Disclaimer in Core utilities
1 parent 66c7786 commit 229383a

File tree

3 files changed

+68
-19
lines changed

3 files changed

+68
-19
lines changed

.storybook/SBUrlCore.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@ addons.register("storybook/redirect", () => {
88
title: "Go to Core Components",
99
type: types.TOOL,
1010
match: ({ viewMode }) => !!viewMode?.match(/^(story|docs)$/),
11-
render: () => (
12-
<IconButton
13-
key="redirect"
14-
title="Navigate to Core Components"
15-
onClick={async () =>
16-
window.open("https://core.thecodebit.digital", "_blank")
17-
}
18-
style={{
19-
position: "absolute",
20-
right: "90px",
21-
}}
22-
>
23-
Go to Core Components
24-
<ArrowUpRight
25-
style={{ color: "white", width: "0.75em", height: "0.75em" }}
26-
/>
27-
</IconButton>
28-
),
11+
render: () => {
12+
const isDocs = window.location.search.includes("--docs");
13+
return (
14+
<IconButton
15+
key="redirect"
16+
title="Navigate to Core Components"
17+
onClick={async () =>
18+
window.open("https://core.thecodebit.digital", "_blank")
19+
}
20+
style={{
21+
position: "absolute",
22+
right: isDocs ? "30px" : "100px",
23+
}}
24+
>
25+
Go to Core Components
26+
<ArrowUpRight
27+
style={{ color: "white", width: "0.75em", height: "0.75em" }}
28+
/>
29+
</IconButton>
30+
);
31+
},
2932
});
3033
});

.storybook/preview.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ const preview: Preview = {
1919
},
2020
options: {
2121
storySort: {
22-
order: ["Introduction", "FAQ", "Changelog"],
22+
order: [
23+
"Introduction",
24+
"FAQ",
25+
"Changelog",
26+
"Documentation",
27+
"Components",
28+
"Hooks",
29+
"Lib",
30+
],
2331
},
2432
},
2533
},

src/stories/lib/Disclaimer.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Meta } from "@storybook/blocks";
2+
3+
<Meta title="Lib/Disclaimer" />
4+
5+
# Disclaimer
6+
7+
This utility library is intentionally minimal and focused. It contains only specific, personally crafted utilities that:
8+
9+
- Are not readily available in established utility libraries
10+
- Solve unique use cases in my projects
11+
- Provide opinionated implementations for common patterns
12+
13+
## 🔍 Recommended Alternatives
14+
15+
For comprehensive utility needs, I highly recommend using established libraries:
16+
17+
- [Ramda](https://ramdajs.com/) - Functional programming utilities
18+
- [Lodash](https://lodash.com/) - The gold standard for JavaScript utilities
19+
- [radash](https://radash-docs.vercel.app/) - Modern utility library focused on TypeScript
20+
- [date-fns](https://date-fns.org/) - Modern JavaScript date utility library
21+
- [just](https://github.com/angus-c/just) - A library of dependency-free utilities
22+
23+
## 🎯 My Focus
24+
25+
The utilities provided here are:
26+
27+
- Highly specific to my use cases
28+
- Not meant to replace comprehensive utility libraries
29+
- Designed to complement existing solutions
30+
- Thoroughly tested and documented
31+
- TypeScript-first implementations
32+
33+
## 📝 Usage Guidelines
34+
35+
- Always check if your needed utility exists in established libraries first
36+
- Use my utilities only for specific use cases not covered elsewhere
37+
- Consider contributing to existing libraries instead of adding new utilities here
38+
- Follow the documentation patterns when adding new utilities

0 commit comments

Comments
 (0)