Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Paulen committed Dec 17, 2024
0 parents commit 97b8672
Show file tree
Hide file tree
Showing 122 changed files with 20,209 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended",
],
globals: {
appConfig: "readonly",
},
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["react-refresh"],
rules: {
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.eslintcache

npm-debug.log*
yarn-debug.log*
yarn-error.log*


build-storybook.log
19 changes: 19 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
stories: [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)",
"../src/components/**/*.stories.@(js|jsx|ts|tsx)",
],
staticDirs: ["../public"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
};
export default config;
16 changes: 16 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type { import('@storybook/react').Preview } */

import '../src/index.css'

const preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Chroma Software Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<p align="center">
<a href="https://www.chromatic.com/">
<img alt="Chromatic" src="https://avatars2.githubusercontent.com/u/24584319?s=200&v=4" width="60" />
</a>
</p>

<h1 align="center">
Chromatic's Intro to Storybook React template
</h1>

This template ships with the main React and Storybook configuration files you'll need to get up and running fast.

## 🚅 Quick start

1. **Create the application.**

Use [degit](https://github.com/Rich-Harris/degit) to get this template.

```shell
# Clone the template
npx degit chromaui/intro-storybook-react-template taskbox
```

1. **Install the dependencies.**

Navigate into your new site’s directory and install the necessary dependencies.

```shell
# Navigate to the directory
cd taskbox/
# Install the dependencies
yarn
```

1. **Open the source code and start editing!**

Open the `taskbox` directory in your code editor of choice and building your first component!

1. **Browse your stories!**

Run `yarn storybook` to see your component's stories at `http://localhost:6006`
## 🔎 What's inside?

A quick look at the top-level files and directories included with this template.

.
├── .storybook
├── node_modules
├── public
├── src
├── .eslintrc.cjs
├── .gitignore
├── .index.html
├── LICENSE
├── package.json
├── yarn.lock
├── vite.config.js
└── README.md

1. **`.storybook`**: This directory contains Storybook's [configuration](https://storybook.js.org/docs/react/configure/overview) files.
2. **`node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages).
3. **`public`**: This directory will contain the development and production build of the site.
4. **`src`**: This directory will contain all of the code related to what you will see on your application.
5. **`.eslintrc.cjs`**: This file is the configuration file for [ESLint](https://eslint.org/), a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
6. **`.gitignore`**: This file tells git which files it should not track or maintain during the development process of your project.
7. **`.index.html`**: This is the HTML page that is served when generating a development or production build.
8. **`LICENSE`**: The template is licensed under the MIT licence.
9. **`package.json`**: Standard manifest file for Node.js projects, which typically includes project specific metadata (such as the project's name, the author among other information). It's based on this file that npm will know which packages are necessary to the project.
10. **`yarn.lock`**: This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(Do not change it manually).**
11. **`vite.config.js`**: This is the configuration file for [Vite](https://vitejs.dev/), a build tool that aims to provide a faster and leaner development experience for modern web projects.
12. **`README.md`**: A text file containing useful reference information about the project.
## Contribute
If you encounter an issue with the template, we encourage you to open an issue in this template's repository.

## Learning Storybook

1. Read our introductory tutorial at [Learn Storybook](https://storybook.js.org/tutorials/intro-to-storybook/react/en/get-started/).
2. Learn how to transform your component libraries into design systems in our [Design Systems for Developers](https://storybook.js.org/tutorials/design-systems-for-developers/) tutorial.
3. See our official documentation at [Storybook](https://storybook.js.org/).
25 changes: 25 additions & 0 deletions create_config_maps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

npm install
npm run build

NAMESPACE="jupyterhub-dev-ns"
BASE_DIR="./dist"

create_configmap() {
local name=$1
local path=$2

kubectl delete configmap $name --namespace $NAMESPACE --ignore-not-found
kubectl create configmap $name --from-file=$path --namespace $NAMESPACE
kubectl create configmap $name --from-file=$path --dry-run=client -o yaml > $name.yaml
}

create_configmap "static-files" "$BASE_DIR"
create_configmap "static-files-js" "$BASE_DIR/static/custom-js"
create_configmap "static-files-css" "$BASE_DIR/static/custom-css"
create_configmap "static-files-woff" "$BASE_DIR/static/woff"
create_configmap "static-files-woff2" "$BASE_DIR/static/woff2"
create_configmap "static-files-images" "$BASE_DIR/static"

echo "All ConfigMaps processed successfully."
44 changes: 44 additions & 0 deletions dist/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JupyterHub</title>
<script type="module" crossorigin src="/static/custom-js/home-BQ-vk0Ao.js"></script>
<link rel="modulepreload" crossorigin href="/static/custom-js/index-KynLtoi1.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/DropDownButton-D1nzfXAw.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/Button-ud3eAs_-.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/JupyterHubHeader-DMFqVwqU.js">
<link rel="stylesheet" crossorigin href="/static/custom-css/index-xp0Zdfsg.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/DropDownButton-CMG9XcRQ.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/Button-Ct2nO6oO.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/JupyterHubHeader-CtXVzUqr.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/home-BEsE5aCF.css">
</head>

<body>
{% block main %} {% set named_spawners =
user.all_spawners(include_default=False)|list %}
<div id="root"></div>
<script>
const appConfig = {
spawners: {
{% for spawner in named_spawners %}
"{{ spawner.name }}": {
last_activity: {% if spawner.last_activity %} "{{ spawner.last_activity.isoformat() + 'Z' }}"{% else %} null{% endif %},
url: {% if spawner.ready %} "{{ user.server_url(spawner.name) }}"{% else %} null{% endif %},
active: {{ "true" if spawner.active else "false" }},
ready: {{ "true" if spawner.ready else "false" }},
} {% if not loop.last %}, {% endif %}
{% endfor %}
},
default_server_active: {{ "true" if default_server.active else "false" }},
url: "{{ url }}",
userName: "{{ user.name }}",
xsrf: "{{ xsrf_token }}",
};
</script>
{% endblock main %}
</body>
</html>
20 changes: 20 additions & 0 deletions dist/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JupyterHub</title>
<script type="module" crossorigin src="/static/custom-js/login-JeFqoEiD.js"></script>
<link rel="modulepreload" crossorigin href="/static/custom-js/index-KynLtoi1.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/Button-ud3eAs_-.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/WarningMassage-Jy2bG8he.js">
<link rel="stylesheet" crossorigin href="/static/custom-css/index-xp0Zdfsg.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/Button-Ct2nO6oO.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/WarningMassage-R5Rmd-Z4.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/login-D7AZgyiO.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
28 changes: 28 additions & 0 deletions dist/not_running.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JupyterHub</title>
<script type="module" crossorigin src="/static/custom-js/not_running-Z8S44c_N.js"></script>
<link rel="modulepreload" crossorigin href="/static/custom-js/index-KynLtoi1.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/Button-ud3eAs_-.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/JupyterHubHeader-DMFqVwqU.js">
<link rel="stylesheet" crossorigin href="/static/custom-css/index-xp0Zdfsg.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/Button-Ct2nO6oO.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/JupyterHubHeader-CtXVzUqr.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/not_running-8VBXrdtd.css">
</head>

<body>
<div id="root"></div>
<script>
const appConfig = {
serverName: "{{ server_name }}",
spawnUrl: "{{ spawn_url }}",
userName: "{{ user.name }}",
};
</script>
</body>
</html>
29 changes: 29 additions & 0 deletions dist/spawn.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JupyterHub</title>
<script type="module" crossorigin src="/static/custom-js/spawn-CGPGHoH8.js"></script>
<link rel="modulepreload" crossorigin href="/static/custom-js/index-KynLtoi1.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/JupyterHubHeader-DMFqVwqU.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/DropDownButton-D1nzfXAw.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/WarningMassage-Jy2bG8he.js">
<link rel="stylesheet" crossorigin href="/static/custom-css/index-xp0Zdfsg.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/JupyterHubHeader-CtXVzUqr.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/DropDownButton-CMG9XcRQ.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/WarningMassage-R5Rmd-Z4.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/spawn-B-UQXXz1.css">
</head>
<body>
<div id="root"></div>
<div style="display: none">{{spawner_options_form | safe}}</div>
<script>
const appConfig = {
postUrl: "{{ url | safe }}",
userName: "{{ for_user.name }}",
};
</script>
</body>
</html>
24 changes: 24 additions & 0 deletions dist/spawn_pending.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JupyterHub</title>
<script type="module" crossorigin src="/static/custom-js/spawn_pending-ApIX0CWF.js"></script>
<link rel="modulepreload" crossorigin href="/static/custom-js/index-KynLtoi1.js">
<link rel="modulepreload" crossorigin href="/static/custom-js/JupyterHubHeader-DMFqVwqU.js">
<link rel="stylesheet" crossorigin href="/static/custom-css/index-xp0Zdfsg.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/JupyterHubHeader-CtXVzUqr.css">
<link rel="stylesheet" crossorigin href="/static/custom-css/spawn_pending-DcSfDwUb.css">
</head>
<body>
<div id="root"></div>
<script>
const appConfig = {
progressUrl: "{{ progress_url }}",
userName: "{{ user.name }}",
};
</script>
</body>
</html>
1 change: 1 addition & 0 deletions dist/static/custom-css/Button-Ct2nO6oO.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/static/custom-css/DropDownButton-CMG9XcRQ.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/static/custom-css/JupyterHubHeader-CtXVzUqr.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 97b8672

Please sign in to comment.