-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update dependencies, add theme provider, and implement Storyboo…
…k deployment workflow - Removed `@radix-ui/react-icons` and added `next-themes` and `chromatic` to package dependencies for theme management and Storybook deployment. - Introduced a new `ThemeProvider` component to manage theme context across the application. - Added a `ThemeToggle` component for switching between light and dark themes. - Created a GitHub Actions workflow for deploying Storybook to GitHub Pages. - Updated Storybook configuration to include theme support and improved layout. - Enhanced the timeline component with new icons and improved structure for better customization.
- Loading branch information
Showing
11 changed files
with
151 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Workflow name | ||
name: Build and Publish Storybook to GitHub Pages | ||
|
||
on: | ||
# Event for the workflow to run on | ||
push: | ||
branches: | ||
- 'main' # Replace with the branch you want to deploy from | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# List of jobs | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# Job steps | ||
steps: | ||
# Manual Checkout | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# Set up Node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow | ||
- uses: bitovi/[email protected] | ||
with: | ||
install_command: yarn install # default: npm ci | ||
build_command: yarn build-storybook # default: npm run build-storybook | ||
path: storybook-static # default: dist/storybook | ||
checkout: false # default: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<meta name="description" content="Components for my shadcntimeline project" key="desc" /> | ||
<meta name="robots" content="noindex" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import { ThemeProvider as NextThemesProvider } from "next-themes" | ||
import { type ThemeProviderProps } from "next-themes" | ||
|
||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) { | ||
return <NextThemesProvider {...props}>{children}</NextThemesProvider> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import { Moon, Sun } from "lucide-react" | ||
import { useTheme } from "next-themes" | ||
|
||
import { Button } from "@/components/ui/button" | ||
|
||
export function ThemeToggle() { | ||
const { setTheme, theme } = useTheme() | ||
|
||
return ( | ||
<Button | ||
variant="ghost" | ||
size="icon" | ||
onClick={() => setTheme(theme === "light" ? "dark" : "light")} | ||
> | ||
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
<span className="sr-only">Toggle theme</span> | ||
</Button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters