mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-16 06:13:32 -06:00
Compare commits
7 Commits
v0.8.2
...
add-chroma
Author | SHA1 | Date | |
---|---|---|---|
|
8ebca95cdd | ||
|
3c816ce3de | ||
|
4ddb5ef460 | ||
|
bd2d1dc046 | ||
|
90b9c0cce0 | ||
|
f55f648479 | ||
|
7e6bbb9e6a |
15
.babelrc.json
Normal file
15
.babelrc.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"sourceType": "unambiguous",
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"chrome": 100
|
||||
}
|
||||
}
|
||||
],
|
||||
"@babel/preset-typescript"
|
||||
],
|
||||
"plugins": []
|
||||
}
|
51
.github/workflows/chromatic.yml
vendored
Normal file
51
.github/workflows/chromatic.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
name: 'Chromatic'
|
||||
|
||||
jobs:
|
||||
chromatic:
|
||||
name: "Chromatic"
|
||||
strategy:
|
||||
matrix:
|
||||
jekyll-version: [4.3]
|
||||
os: [ ubuntu-latest ]
|
||||
ruby-version: [3.1]
|
||||
node-version: [18.x]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
||||
# Ruby setup
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Ruby ${{ matrix.ruby-version }}
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby-version }}
|
||||
bundler-cache: false
|
||||
- name: Bundle Install
|
||||
run: bundle install
|
||||
- name: Install Jekyll ${{ matrix.jekyll-version }}
|
||||
run: gem install jekyll -v ${{ matrix.jekyll-version }}
|
||||
- name: Init Search
|
||||
run: bundle exec rake search:init
|
||||
- name: Build Site
|
||||
run: bundle exec jekyll build
|
||||
|
||||
# Node setup
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm install
|
||||
- run: npm run build-storybook
|
||||
- name: Publish to Chromatic
|
||||
uses: chromaui/action@v1
|
||||
env:
|
||||
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -16,10 +16,13 @@ vendor/
|
||||
|
||||
# These next files are used by Just the Docs developers. They are not necessary for end users of the theme, only developers.
|
||||
|
||||
# We use Stylelint and Prettier, JavaScript tools, to lint and format our own code.
|
||||
# We use Stylelint and Prettier, JavaScript tools, to lint and format our own code,
|
||||
# We use Node.js as our runtime, so we ignore node_modules
|
||||
node_modules
|
||||
|
||||
# We also use Storybook to test regressions in changes; we ignore the build output.
|
||||
storybook-static
|
||||
|
||||
# .DS_Store is a macOS-only metadata file about directories. Convention is to not commit them.
|
||||
# See: https://en.wikipedia.org/wiki/.DS_Store
|
||||
.DS_Store
|
||||
|
17
.storybook/main.js
Normal file
17
.storybook/main.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/** @type { import('@storybook/html-webpack5').StorybookConfig } */
|
||||
const config = {
|
||||
stories: ["../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||
addons: [
|
||||
"@storybook/addon-links",
|
||||
"@storybook/addon-essentials",
|
||||
"@storybook/addon-interactions",
|
||||
],
|
||||
framework: {
|
||||
name: "@storybook/html-webpack5",
|
||||
options: {},
|
||||
},
|
||||
docs: {
|
||||
autodocs: "tag",
|
||||
},
|
||||
}
|
||||
export default config
|
14
.storybook/preview.js
Normal file
14
.storybook/preview.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/** @type { import('@storybook/html').Preview } */
|
||||
const preview = {
|
||||
parameters: {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default preview
|
@@ -48,6 +48,7 @@ exclude:
|
||||
- Dockerfile
|
||||
# theme test code
|
||||
- fixtures/
|
||||
- stories/
|
||||
|
||||
# Set a path/url to a logo that will be displayed instead of the title
|
||||
#logo: "/assets/images/just-the-docs.png"
|
||||
|
@@ -105,7 +105,7 @@
|
||||
}
|
||||
|
||||
.btn-purple {
|
||||
@include btn-color($white, $purple-100);
|
||||
@include btn-color($white, $purple-300);
|
||||
}
|
||||
|
||||
.btn-blue {
|
||||
|
23602
package-lock.json
generated
23602
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,13 +1,31 @@
|
||||
{
|
||||
"name": "just-the-docs",
|
||||
"version": "0.3.3",
|
||||
"version": "0.5.0",
|
||||
"description": "A modern Jekyll theme for documentation",
|
||||
"repository": "just-the-docs/just-the-docs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/just-the-docs/just-the-docs.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/just-the-docs/just-the-docs/issues",
|
||||
"bugs": {
|
||||
"url": "https://github.com/just-the-docs/just-the-docs/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.21.4",
|
||||
"@babel/preset-typescript": "^7.21.4",
|
||||
"@storybook/addon-essentials": "^7.0.7",
|
||||
"@storybook/addon-interactions": "^7.0.7",
|
||||
"@storybook/addon-links": "^7.0.7",
|
||||
"@storybook/blocks": "^7.0.7",
|
||||
"@storybook/html": "^7.0.7",
|
||||
"@storybook/html-webpack5": "^7.0.7",
|
||||
"@storybook/testing-library": "^0.0.14-next.2",
|
||||
"chromatic": "^6.17.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^3.0.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"storybook": "^7.0.7",
|
||||
"stylelint": "^15.10.3",
|
||||
"stylelint-config-standard-scss": "^10.0.0"
|
||||
},
|
||||
@@ -16,7 +34,10 @@
|
||||
"lint:css": "stylelint '**/*.scss'",
|
||||
"lint:formatting": "prettier --check '**/*.{scss,js,json}'",
|
||||
"format": "prettier --write '**/*.{scss,js,json}'",
|
||||
"test": "npm run lint"
|
||||
"test": "npm run lint",
|
||||
"storybook": "bundle exec jekyll build && storybook dev -p 6006",
|
||||
"build-storybook": "bundle exec jekyll build && storybook build",
|
||||
"chromatic": "npx chromatic --project-token=9355f489c51b -d storybook-static"
|
||||
},
|
||||
"stylelint": {
|
||||
"ignoreFiles": [
|
||||
@@ -43,5 +64,7 @@
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5"
|
||||
}
|
||||
},
|
||||
"homepage": "https://just-the-docs.com",
|
||||
"_id": "just-the-docs@0.5.0"
|
||||
}
|
||||
|
7
stories/Introduction.mdx
Normal file
7
stories/Introduction.mdx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Meta } from '@storybook/blocks';
|
||||
|
||||
<Meta title="Example/Introduction" />
|
||||
|
||||
# Storybook for Just the Docs
|
||||
|
||||
A WIP [Storybook](https://storybook.js.org/) for Just the Docs.
|
11
stories/ui-components/Button.js
Normal file
11
stories/ui-components/Button.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import "../../_site/assets/css/just-the-docs-default.css"
|
||||
|
||||
export const createButton = ({ variant = "default", label, size = "4" }) => {
|
||||
const btn = document.createElement("button")
|
||||
btn.type = "button"
|
||||
btn.innerText = label
|
||||
|
||||
btn.className = ["btn", `btn-${variant}`, `fs-${size}`].join(" ")
|
||||
|
||||
return btn
|
||||
}
|
68
stories/ui-components/Button.stories.js
Normal file
68
stories/ui-components/Button.stories.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import { createButton } from "./Button"
|
||||
|
||||
export default {
|
||||
title: "UI Components/Button",
|
||||
tags: ["autodocs"],
|
||||
render: ({ label, ...args }) => {
|
||||
return createButton({ label, ...args })
|
||||
},
|
||||
argTypes: {
|
||||
label: { control: "text" },
|
||||
size: {
|
||||
control: { type: "select" },
|
||||
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
},
|
||||
variant: {
|
||||
control: { type: "select" },
|
||||
options: ["default", "primary", "purple", "blue", "green", "outline"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const Default = {
|
||||
args: {
|
||||
variant: "default",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Primary = {
|
||||
args: {
|
||||
variant: "primary",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Purple = {
|
||||
args: {
|
||||
variant: "purple",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Blue = {
|
||||
args: {
|
||||
variant: "blue",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Green = {
|
||||
args: {
|
||||
variant: "green",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Outline = {
|
||||
args: {
|
||||
variant: "outline",
|
||||
label: "Button",
|
||||
size: 4,
|
||||
},
|
||||
}
|
10
stories/ui-components/Label.js
Normal file
10
stories/ui-components/Label.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import "../../_site/assets/css/just-the-docs-default.css"
|
||||
|
||||
export const createLabel = ({ variant = "default", label, size = "4" }) => {
|
||||
const btn = document.createElement("span")
|
||||
btn.innerText = label
|
||||
|
||||
btn.className = ["label", `label-${variant}`, `fs-${size}`].join(" ")
|
||||
|
||||
return btn
|
||||
}
|
68
stories/ui-components/Label.stories.js
Normal file
68
stories/ui-components/Label.stories.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import { createLabel } from "./Label"
|
||||
|
||||
export default {
|
||||
title: "UI Components/Label",
|
||||
tags: ["autodocs"],
|
||||
render: ({ label, ...args }) => {
|
||||
return createLabel({ label, ...args })
|
||||
},
|
||||
argTypes: {
|
||||
label: { control: "text" },
|
||||
size: {
|
||||
control: { type: "select" },
|
||||
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
},
|
||||
variant: {
|
||||
control: { type: "select" },
|
||||
options: ["default", "purple", "blue", "green", "red", "yellow"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const Default = {
|
||||
args: {
|
||||
variant: "default",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Purple = {
|
||||
args: {
|
||||
variant: "purple",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Blue = {
|
||||
args: {
|
||||
variant: "blue",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Green = {
|
||||
args: {
|
||||
variant: "green",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Red = {
|
||||
args: {
|
||||
variant: "red",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
||||
|
||||
export const Yellow = {
|
||||
args: {
|
||||
variant: "yellow",
|
||||
label: "Label",
|
||||
size: 4,
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user